| 02-05-2003, 04:53 AM | #1 |
I'm trying to make a type of shop where if you bring components you can buy stuff but I cant figure out the triggers for detecting if the triggering hero has the item or not. anywon know those triggers? |
| 02-05-2003, 05:23 AM | #2 |
Well you could make a Trigger checks for the components when the person gets item. If he does not have the components just remove the item and refund the money. The only downside I can see with this is that the item cooldown would be messed up at the shop. Heres an example if you want Player Acquires item Item type=the item which needs the components If Components not equal to true then Item Remove Triggering Item else do nothing If Components not equal to true give triggering player (cost of item) else do nothing |
| 02-05-2003, 05:03 PM | #3 |
Guest | There is actually a condition that checks to see if the hero has a particular item. I'm at work so I don't have WE to access right now, but I am positive about the condition existing. You could just do an AND and tie together two or more conditions to make sure all the reqs are met. You could use the enter region event and create a region around the "shop." It may be possible to add an item to a shop during game play with triggers, but I don't think so. If you could then you just make the item available when the components were obtained. Then when the hero bought the item you would run a trigger that would remove the component items from the hero's inventory. Would be pretty cool actually. Key to this second method would be the ability to add/remove items from a shops "sell" list. Yet another way to do this is to set a variable like StaffOfWhoopAss=0. Lets say that the Staff of Whoop *** requires three components. Each time the hero turns in one of the three components you set StaffOfWhoopAss = StaffOfWhoopAss + 1. You can tie some displayed game text in there to keep the hero moving in the right direction. Then, of course, the final trigger would be when StaffOfWhoopAss = 3 the hero gets the item. As the hero would have to be close to the quest giver to turn in the items you can set up a few extra triggers associated with the region around the quest giver. Special effects and so forth. By setting up different variables for each "quest" item and for the components you could do lots of different quests from the same quest giver or have multiple quest givers based on the hero type or type of item desired. Oh, be sure that you create a variable for the component items to be turned in. Like when Ogre 0042 <gen> dies create Fellwood branch at spot of Triggering unit. Then do Branch = last created item. Now you have a variable attached to the item. So, when the Branch is given to the quest giver the system will know which quest it is for by running the correct trigger. Much cleaner and less buggy then trying to do it without the use of variables. There is a limit on the number of variables you can use in a single map. I believe its 99 (I could be smoking crack here) so that would be your greatest limitation. There may be a way to clean up this third method with arrays but I wouldn't be the person to ask for that. Good luck. If you have any questions or need further clarification of any of the above post here or email me: [email protected]. EDIT} Forgot to mention this. The quest giver (or person to whom the components are given) MUST be a hero. It can be NP or whatever but it must be someone who can "use" an item (i.e. Create a custom unit based on Jaina. You can edit the model or whatever pleases ya, but the unit must be classified as a hero). If the unit is not of a classification hero then method 3 gets fubared. |
