Ok so what I'm trying to do is create a shock/lightning special effect attached to the chest of each damaged unit by this spell:
-
Electrokinesis
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Electrokinesis
-
Actions
- Special Effect - Create a special effect attached to the chest of Caster using Abilities\Weapons\Bolt\BoltImpact.mdl
- Set ElectroCaster = (Last created special effect)
- Special Effect - Create a special effect attached to the hand,left of Caster using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
- Set ElectroCaster2 = (Last created special effect)
- Special Effect - Create a special effect attached to the hand,left of Caster using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
- Set ElectroCaster3 = (Last created special effect)
- Hashtable - Create a hashtable
- Set ElectroTable = (Last created hashtable)
- Set Caster = (Triggering unit)
- Set CasLoc = (Position of (Triggering unit))
- Set Sptarget = (Target point of ability being cast)
- Set Real = ((Facing of Caster) - 90.00)
- Set CasDist = (Distance between CasLoc and Sptarget)
- Set CasAng = (Angle from CasLoc to Sptarget)
- Set ElectroTableVar = 0
- Unit - Create 1 Dummy for (Owner of Caster) at CasLoc facing Default building facing degrees
- Unit - Turn collision for (Last created unit) Off
- Unit - Add Electrokinesis Dummy to (Last created unit)
- Unit - Set level of Electrokinesis Dummy for (Last created unit) to (Level of Electrokinesis for Caster)
- Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm Sptarget
- Unit - Add a 3.50 second Generic expiration timer to (Last created unit)
-
For each (Integer A) from 1 to 6, do (Actions)
-
Loop - Actions
- Set LocOffset = (CasLoc offset by 200.00 towards Real degrees)
- Set AngOffset = (LocOffset offset by CasDist towards CasAng degrees)
- Lightning - Create a Chain Lightning - Primary lightning effect from source CasLoc to target LocOffset
- Hashtable - Save Handle Of(Last created lightning effect) as (ElectroTableVar + 1) of 1 in ElectroTable
- Lightning - Create a Chain Lightning - Secondary lightning effect from source LocOffset to target AngOffset
- Hashtable - Save Handle Of(Last created lightning effect) as (ElectroTableVar + 1) of 2 in ElectroTable
- Set Real = (Real + (180.00 / 5.00))
- Set ElectroTableVar = (ElectroTableVar + 1)
-
Loop - Actions
- Custom script: call RemoveLocation(udg_CasLoc)
- Wait 0.75 seconds
- Special Effect - Destroy ElectroCaster
- Special Effect - Destroy ElectroCaster2
- Special Effect - Destroy ElectroCaster3
- Lightning - Destroy (Load 1 of 1 in ElectroTable)
- Lightning - Destroy (Load 1 of 2 in ElectroTable)
- Lightning - Destroy (Load 2 of 1 in ElectroTable)
- Lightning - Destroy (Load 2 of 2 in ElectroTable)
- Lightning - Destroy (Load 3 of 1 in ElectroTable)
- Lightning - Destroy (Load 3 of 2 in ElectroTable)
- Lightning - Destroy (Load 4 of 1 in ElectroTable)
- Lightning - Destroy (Load 4 of 2 in ElectroTable)
- Lightning - Destroy (Load 5 of 1 in ElectroTable)
- Lightning - Destroy (Load 5 of 2 in ElectroTable)
- Lightning - Destroy (Load 6 of 1 in ElectroTable)
- Lightning - Destroy (Load 6 of 2 in ElectroTable)
- Hashtable - Clear all child hashtables of child ElectroTableVar in ElectroTable
-
Events