Hi
I tried to make an ability which periodically damage target. When target dies while it has a buff, dummy should cast same ability on random enemy unit within range. Unfortunately it triggers only twice/more times and doesn't more even when it clearly should.
Here are the triggers:
And btw I'm wondering if anyone could explain me how variables are passed between triggers. I mean - if I create a trigger is it like a template and each time event happens it creates a class? If so - how would be variable passed between them if each object would have it's own. If it's not like that what would happen if we run multiple triggers at once for example playing online - and each player overwrites variables? I hope what I tried to say is clear.
I tried to make an ability which periodically damage target. When target dies while it has a buff, dummy should cast same ability on random enemy unit within range. Unfortunately it triggers only twice/more times and doesn't more even when it clearly should.
Here are the triggers:
-
Corruption
-
Events
-
Unit - A unit begin casting an ability
-
-
Conditions
-
Or - Any (Conditions) are true
-
Warunki
-
(Ability being cast) Equals to Corruption
-
(Ability being cast) Equals to Dummy Corruption
-
-
-
-
Actions
-
Set Corrupter = (Triggering unit)
-
Set Corrupted = (Target unit of ability being cast)
-
Unit Group - Add Corrupted to CoruptedUnits
-
Trigger - Turn on Corruption Dmg <gen>
-
-
-
Corruption Dmg
-
Events
-
Time - Every 0.30 seconds of game time
-
-
Coditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Corrupted has buff Corrutpin ) Equals to NO
-
-
Then - Actions
-
Unit Group - Remove Corrupted from CoruptedUnits
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(CoruptedUnits is empty) Equals to NO
-
-
Then - Actions
-
Unit - Cause Corruptor to damage Corrupted, dealing 5.00 damage of attack type
-
-
-
-
-
Spreading Corruption
-
Events
-
Unit - A unit dies
-
-
Conditions
-
((Dying unit) is in CoruptedUnits) Equals to YES
-
-
Actions
-
Set Corrupted = (Dying unit)
-
Set point = (Position of Corrupted)
-
Set RandomUnitFromGroup = (Units within 1000.00 of point matching (((Matching unit) belongs to an enemy of (Owner of Corruptor)) Equals to YES))
-
Unit Group - Pick every unit in (Random 1 units from RandomUnitFromGroup) and do (Actions)
-
Loop - Actions
-
Unit - Create 1 dummy for (Owner of Corruptor) at point facing default
-
Unit - Add Dummy Corruption to (Last created unit)
-
Unit - Order (Last created unit) to Undead - Necromancer - ‚ (Picked unit)
-
Unit - Add a 2.00 second expiration timer to (Last created unit)
-
Set Corrupted = (Picked unit)
-
Unit Group - Add Corrupted to CoruptedUnits
-
Unit Group - Remove (Dying unit) from CoruptedUnits
-
-
-
-
And btw I'm wondering if anyone could explain me how variables are passed between triggers. I mean - if I create a trigger is it like a template and each time event happens it creates a class? If so - how would be variable passed between them if each object would have it's own. If it's not like that what would happen if we run multiple triggers at once for example playing online - and each player overwrites variables? I hope what I tried to say is clear.