Here is my trigger. What I'm unsure of is what will happen if this trigger fires multiple times back to back. For example, Hero 1 triggers this and then 0.5 seconds later Hero 2 triggers it. The first run of the trigger, the timer is started expiring in two seconds to destroy the special effect. Will the second run of the trigger restart the timer before it is able to finish, causing a leak?
-
CompulsionLaborers
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
((Killing unit) has an item of type Compulsion: Laborers) Equal to True
-
((Killing unit) is A Hero) Equal to True
-
((Unit-type of (Dying unit)) Equal to Farmer) or ((Unit-type of (Dying unit)) Equal to Merchant)
-
-
Actions
-
Set CompulsionRandom = (Random integer number between 1 and 100)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
CompulsionRandom Greater than or equal to 50
-
-
Then - Actions
-
Player - Add 1 to (Owner of (Killing unit)) Current gold
-
Special Effect - Create a special effect attached to the overhead of (Killing unit) using Abilities\Spells\Other\Transmute\PileofGold.mdl
-
Set CompulsionSpecialEffect[0] = (Last created special effect)
-
Countdown Timer - Start CompulsionTimer[0] as a One-shot timer that will expire in 2.00 seconds
-
-
Else - Actions
-
-
-
-
CompulsionTimerExpireZero
-
Events
-
Time - CompulsionTimer[0] expires
-
-
Conditions
-
Actions
-
Special Effect - Destroy CompulsionSpecialEffect[0]
-
-