I'm making a triggered spell that does exactly what the Shockwave spell does: damages enemies in a line. But I ran into a problem.
Here's how my spell works: the missle is created and moves forward, every 0.03 seconds checking a 200 radius for targets. It damages all the targets and is supposed to add them to a unit group, so they won't be damaged again. But this part doesn't work, and the spell instantly kills anything it touches.
I'm really stumped here, because I checked my trigger like a dozen times and it still does everything else properly. Trigger 2 below has the damage check that is messing up.
Here's how my spell works: the missle is created and moves forward, every 0.03 seconds checking a 200 radius for targets. It damages all the targets and is supposed to add them to a unit group, so they won't be damaged again. But this part doesn't work, and the spell instantly kills anything it touches.
I'm really stumped here, because I checked my trigger like a dozen times and it still does everything else properly. Trigger 2 below has the damage check that is messing up.
-
InfernalWave1
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Infernal Wave (Sorceress - Active)
-
-
Actions
-
Set temp_hashtable = H_InfernalWave
-
Set temp_point[0] = (Position of (Triggering unit))
-
Set temp_point[1] = (temp_point[0] offset by 50.00 towards (Facing of (Triggering unit)) degrees)
-
Custom script: call RemoveLocation( udg_temp_point[0] )
-
Unit - Create 1 infernalwave for (Owner of (Triggering unit)) at temp_point[1] facing (Facing of (Triggering unit)) degrees
-
Custom script: call RemoveLocation( udg_temp_point[1] )
-
Hashtable - Save 0.00 as (Key distance) of (Key (Last created unit)) in temp_hashtable
-
Hashtable - Save ((40.00 + (25.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))) + (0.80 x (Load 100 of (Key (Triggering unit)) from H_Spellpower))) as (Key damage) of (Key (Last created unit)) in temp_hashtable
-
Hashtable - Save Handle Of(Triggering unit) as (Key caster) of (Key (Last created unit)) in temp_hashtable
-
Hashtable - Save 22.50 as (Key speed) of (Key (Last created unit)) in temp_hashtable
-
Hashtable - Save (Facing of (Triggering unit)) as (Key facing) of (Key (Last created unit)) in temp_hashtable
-
Custom script: set udg_temp_hashtable = null
-
Unit Group - Add (Last created unit) to InfernalWaveMissles
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(InfernalWave2 <gen> is on) Equal to False
-
-
Then - Actions
-
Trigger - Turn on InfernalWave2 <gen>
-
-
Else - Actions
-
-
-
-
InfernalWave2
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in InfernalWaveMissles) Greater than 0
-
-
Then - Actions
-
Unit Group - Pick every unit in InfernalWaveMissles and do (Actions)
-
Loop - Actions
-
Set temp_point[0] = (Position of (Picked unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Load (Key distance) of (Key (Picked unit)) from H_InfernalWave) Greater than or equal to 750.00
-
-
Then - Actions
-
Special Effect - Create a special effect at temp_point[0] using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
-
Special Effect - Destroy (Last created special effect)
-
Custom script: call RemoveLocation( udg_temp_point[0] )
-
Unit - Kill (Picked unit)
-
Unit Group - Remove (Picked unit) from InfernalWaveMissles
-
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in H_InfernalWave
-
-
Else - Actions
-
Set temp_unit[0] = (Picked unit)
-
Set temp_integer[0] = (Key (Picked unit))
-
Set temp_unit[1] = (Load (Key caster) of (Key (Picked unit)) in H_InfernalWave)
-
Set temp_real[0] = (Load (Key damage) of (Key (Picked unit)) from H_InfernalWave)
-
Set temp_group = (Units within 200.00 of temp_point[0] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of (Owner of (Picked unit))) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) is in
-
Unit Group - Pick every unit in temp_group and do (Actions)
-
Loop - Actions
-
Unit - Cause temp_unit[1] to damage (Picked unit), dealing temp_real[0] damage of attack type Spells and damage type Death
-
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmDamage.mdl
-
Special Effect - Destroy (Last created special effect)
-
Unit Group - Add (Picked unit) to (Load (Key hit) of temp_integer[0] in H_InfernalWave)
-
Unit Group - Remove (Picked unit) from temp_group
-
-
-
Custom script: call DestroyGroup( udg_temp_group )
-
Set temp_point[1] = (temp_point[0] offset by (Load (Key speed) of (Key (Picked unit)) from H_InfernalWave) towards (Load (Key facing) of (Key (Picked unit)) from H_InfernalWave) degrees)
-
Custom script: call RemoveLocation( udg_temp_point[0] )
-
Unit - Move (Picked unit) instantly to temp_point[1], facing (Load (Key facing) of (Key (Picked unit)) from H_InfernalWave) degrees
-
Custom script: call RemoveLocation( udg_temp_point[1] )
-
Hashtable - Save ((Load (Key distance) of (Key (Picked unit)) from H_InfernalWave) + (Load (Key speed) of (Key (Picked unit)) from H_InfernalWave)) as (Key distance) of (Key (Picked unit)) in H_InfernalWave
-
-
-
-
-
-
Else - Actions
-
Trigger - Turn off (This trigger)
-
-
-
-