- Joined
- Aug 2, 2010
- Messages
- 14
So I tried making a shockwave spell with triggers, and it doesn't work. I have no idea how to fix it, hope someone can help me.
-
Shockwave init
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Shockwave
-
-
Actions
-
Custom script: call RemoveLocation(udg_ShockLoc)
-
Custom script: call RemoveLocation(udg_ShockTarget)
-
Set ShockCaster = (Triggering unit)
-
Set ShockDamage = (Real((Level of Shockwave for ShockCaster)))
-
Set ShockDistance = 5.00
-
Set ShockTime = 2.00
-
Set ShockLoc = (Position of ShockCaster)
-
Set ShockTarget = (Target point of ability being cast)
-
Set ShockAngle = (Angle from ShockLoc to ShockTarget)
-
Unit - Create 1 ShockEffect for (Owner of ShockCaster) at (ShockLoc offset by 5.00 towards ShockAngle degrees) facing ShockAngle degrees
-
Unit Group - Add (Last created unit) to ShockEffect
-
Hashtable - Save ShockAngle as 0 of (Key (Last created unit)) in Hashtable
-
Hashtable - Save ShockDamage as 1 of (Key (Last created unit)) in Hashtable
-
Hashtable - Save ShockDistance as 2 of (Key (Last created unit)) in Hashtable
-
Hashtable - Save Handle OfShockCaster as 3 of (Key (Last created unit)) in Hashtable
-
Hashtable - Save ShockTime as 4 of (Key (Last created unit)) in Hashtable
-
Trigger - Turn on Shockwave Loop <gen>
-
-
-
Shockwave Loop
-
Events
-
Time - Every 0.04 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in ShockEffect and do (Actions)
-
Loop - Actions
-
Custom script: call RemoveLocation(udg_ShockLoc)
-
Custom script: call DestroyGroup(udg_ShockVictims)
-
Set ShockAngle = (Load 0 of (Key (Picked unit)) from Hashtable)
-
Set ShockDamage = (Load 1 of (Key (Picked unit)) from Hashtable)
-
Set ShockDistance = (Load 2 of (Key (Picked unit)) from Hashtable)
-
Set ShockCaster = (Load 3 of (Key (Picked unit)) in Hashtable)
-
Set ShockLoc = (Position of (Picked unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ShockTime Greater than or equal to 0.04
-
-
Then - Actions
-
Unit - Move (Picked unit) instantly to (ShockLoc offset by ShockDistance towards ShockAngle degrees), facing ShockAngle degrees
-
Hashtable - Save (ShockDistance + 5.00) as 2 of (Key (Picked unit)) in (Last created hashtable)
-
Hashtable - Save (ShockTime - 0.04) as 4 of (Key (Picked unit)) in (Last created hashtable)
-
Set ShockVictims = (Units within 100.00 of ShockLoc matching (((Matching unit) belongs to an enemy of (Owner of ShockCaster)) Equal to True))
-
Unit Group - Pick every unit in ShockVictims and do (Actions)
-
Loop - Actions
-
Unit - Cause ShockCaster to damage (Picked unit), dealing ShockDamage damage of attack type Spells and damage type Normal
-
-
-
-
Else - Actions
-
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hashtable
-
Unit Group - Remove (Picked unit) from ShockEffect
-
-
-
-
-
-