The spell is meant to create a shock effect for picked units, but if you cast the spell again even after the units died the SFX`s are still created. Here's the trigger:
-
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\Bolt\BoltImpact.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
- Set ElectroAoE = (CasLoc offset by (CasDist / 2.00) towards CasAng degrees)
- 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)
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within (CasDist / 2.00) of ElectroAoE matching (((((Matching unit) is A structure) Not equal to True) and (((Matching unit) belongs to an enemy of (Owner of Caster)) Equal to True)) and (((Matching unit) is Magic Immune) Not equal to True))) and do (Actions)
-
Loop - Actions
- Set ElectroPicked = (Position of (Picked unit))
- Special Effect - Create a special effect at ElectroPicked using Abilities\Weapons\Bolt\BoltImpact.mdl
- Set ElectroEffect = (Last created special effect)
- Special Effect - Destroy ElectroEffect
- Custom script: call RemoveLocation(udg_ElectroPicked)
-
Loop - Actions
-
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)
- Custom script: call RemoveLocation(udg_Sptarget)
- Custom script: call RemoveLocation(udg_ElectroAoE)
- 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