- Joined
- Jul 14, 2011
- Messages
- 3,213
Hi! I made this trigger for a quest. There are several 'Dust' in the area, and heroes have to pick them. But If a hero picks one, I need to disable the pick of that dust for that hero/player. Also, the hero has to pick them all without dying. If the hero dies, I have to set to DustCount for that hero to 0, and re-enable the pick of the dust for that hero.
Managed to do this:
Managed to do this:
-
Quest2DustFind
-

Events
-


Unit - A unit begins casting an ability
-
-

Conditions
-


((Triggering unit) is A Hero) Equal to True
-


(Ability being cast) Equal to Explore
-


DustCollected[Player number of (Owner of (Triggering Unit))] Less than 20
-
-

Actions
-


Set tempPoint = (Position of (Triggering unit))
-


Destructible - Pick every destructible within 100.00 of tempPoint and do (Actions)
-



Loop - Actions
-




Set TempBool = (Load (Key (Picked destructible)) of (Player number of (Triggering player)) from DustHashtable)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






TEmpBool Equal to False
-






(Destructible-type of (Picked destructible)) Equal to Removable Dust
-
-





Then - Actions
-






Set DustCollected[Player number of (Owner of (Triggering Unit))] = (DustCollected[Player number of (Owner of (Triggering Unit))] + 1)
-






Hashtable - Save True as (Key (Picked destructible)) of (Player number of (Triggering player)) in DustHashtable
-
-





Else - Actions
-
-
-
-


Custom script: call RemoveLocation(udg_tempPoint)
-
-





