Trigger:
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Lockdown
- Actions
- Set LockdownTarget = (Target unit of ability being cast)
- Set x = 0
- Unit Group - Add LockdownTarget to LockdownTargets
- Unit Group - Pick every unit in LockdownTargets and do (Actions)
- Loop - Actions
- Unit Group - Pick every unit in LockdownTargets and do (Actions)
- Loop - Actions
- Lightning - Create a Chain Lightning - Primary lightning effect from source ((Position of (Target unit of ability being cast)) offset by (-100.00, 100.00)) to target ((Position of (Target unit of ability being cast)) offset by (100.00, 100.00))
- Set x = (x + 1)
- Lightning - Create a Chain Lightning - Primary lightning effect from source ((Position of (Target unit of ability being cast)) offset by (100.00, 100.00)) to target ((Target point of ability being cast) offset by (0.00, -100.00))
- Set x = (Lightning - Create a Chain Lightning - Primary lightning effect from source ((Target point of ability being cast) offset by (0.00, -100.00)) to target ((Position of (Target unit of ability being cast)) offset by (-100.00, 100.00))
- x + 1)
- Set x = (x + 1)
- Set LightningEffectsArray[x] = (Last created lightning effect)
- If ((Level of Lockdown for (Triggering unit)) Equal to 1) then do (Wait 8.00 seconds) else do (If ((Level of Lockdown for (Triggering unit)) Equal to 2) then do (Wait 16.00 seconds) else do (If ((Level of Lockdown for (Triggering unit)) Equal to 3) then do (Wait 24.00 seconds) else do (If ((Level of (Triggering unit)) Equal to 4) then do (Wait 32.00 seconds) else (Do Nothing)
- For each (Integer A) from 1 to x, do (Lightning - Destroy LightningEffectsArray[(Integer A)])
Hi everyone, I'm trying to add lightning effects to the Lockdown ability for my Ghost Hero, (i.e electricity disruption effect around the lockdown affected unit). The lightning effects are composed of multiple (3 separate) lightning effects that form a singular triangular 'cage' surrounding the locked down unit.
However, after the elapsed time, only the one of the lightning effects (the last created one) is destroyed while the other 2 stay on the map permanently...
I studied this thread for 30 mins:
http://www.thehelper.net/forums/showthread.php?t=133180
And tried to copy the usage of Integer Variables and Arrays, but still get the same result.. Can anyone what am i doing wrong??
Much appreciated