I'm trying to make this spell that shoots chunks of ice from the sky down onto nearby enemy units. The spells works except for this one problem I have: The chunks of ice don't actually move anywhere. I can't figure out why the ice isn't moving. I don't need this spell to be MUI or MPI since a single boss will be casting this spell only every 60 seconds.
I think the problem is around where I labeled "DAMAGE PART" in the periodic trigger since this is where I try to move the ice chunks, but I'm not sure. Can someone point out where I'm failing?
-
Crystal Haven
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Crystal Rain
-
-
Actions
-
Set Crystal_Haven_C = (Triggering unit)
-
Set Crystal_Haven_Count = 0
-
Set Crystal_Haven_Count2 = 0
-
Set Crystal_Haven_P[0] = (Position of (Triggering unit))
-
Unit - Create 1 Crystal Rain First Effect for (Owner of (Triggering unit)) at Crystal_Haven_P[0] facing Default building facing degrees
-
Set Crystal_Haven_Shards[0] = (Last created unit)
-
Animation - Change Crystal_Haven_Shards[0]'s size to (200.00%, 200.00%, 200.00%) of its original size
-
Custom script: call RemoveLocation (udg_Crystal_Haven_P[0])
-
Set Crystal_Haven_Phases[0] = True
-
Trigger - Turn on Crystal Haven DPS <gen>
-
-
-
Crystal Haven DPS
-
Events
-
Time - Every 0.05 seconds of game time
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Crystal_Haven_Phases[0] Equal to True
-
-
Then - Actions
-
-------- MAKES THE FIRST PROJECTILE FLY UPWARDS --------
-
Set Crystal_Haven_P[0] = (Position of Crystal_Haven_Shards[0])
-
Unit - Move Crystal_Haven_Shards[0] instantly to Crystal_Haven_P[0]
-
Animation - Change Crystal_Haven_Shards[0] flying height to ((Current flying height of Crystal_Haven_Shards[0]) + 80.00) at 0.00
-
Custom script: call RemoveLocation (udg_Crystal_Haven_P[0])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Current flying height of Crystal_Haven_Shards[0]) Greater than or equal to 1000.00
-
-
Then - Actions
-
Set Crystal_Haven_Phases[0] = False
-
Set Crystal_Haven_Phases[1] = True
-
-
Else - Actions
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Crystal_Haven_Phases[1] Equal to True
-
-
Then - Actions
-
-------- CREATES THE OTHER PROJECTILES AND MOVES THEM --------
-
Set Crystal_Haven_Count2 = (Crystal_Haven_Count2 + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Crystal_Haven_Count2 Greater than or equal to 10
-
-
Then - Actions
-
Set Crystal_Haven_Count2 = 0
-
Set Crystal_Haven_Count = (Crystal_Haven_Count + 1)
-
Set Crystal_Haven_Shard_Active[Crystal_Haven_Count] = True
-
Set Crystal_Haven_P[0] = (Position of Crystal_Haven_Shards[0])
-
Set Crystal_Haven_T = (Units within 1800.00 of Crystal_Haven_P[0] matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is Magic Immune) Not equal to True) and ((((Matching unit) is dead) Not equal to True) and (((Matching unit) belongs to an enemy
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in Crystal_Haven_T) Equal to 0
-
-
Then - Actions
-
Set Crystal_Haven_P[Crystal_Haven_Count] = (Crystal_Haven_P[0] offset by (Random real number between 0.00 and 1800.00) towards (Random angle) degrees)
-
-
Else - Actions
-
Set Crystal_Haven_P[Crystal_Haven_Count] = (Position of (Random unit from Crystal_Haven_T))
-
-
-
Unit - Create 1 Crystal Rain Missile for (Owner of Crystal_Haven_C) at Crystal_Haven_P[0] facing Crystal_Haven_P[Crystal_Haven_Count]
-
Set Crystal_Haven_Shards[Crystal_Haven_Count] = (Last created unit)
-
Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
-
Custom script: call RemoveLocation (udg_Crystal_Haven_P[0])
-
Custom script: call DestroyGroup (udg_Crystal_Haven_T)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Crystal_Haven_Count Greater than or equal to 20
-
-
Then - Actions
-
Set Crystal_Haven_Phases[1] = False
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-------- MOVES ALL PROJECTILES --------
-
For each (Integer A) from 1 to Crystal_Haven_Count, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Crystal_Haven_Shard_Active[(Integer A)] Equal to True
-
-
Then - Actions
-
Set Crystal_Haven_P[0] = (Position of Crystal_Haven_Shards[0])
-
Set Crystal_Haven_P2[0] = (Position of Crystal_Haven_Shards[(Integer A)])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between Crystal_Haven_P2[0] and Crystal_Haven_P[(Integer A)]) Less than or equal to ((Distance between Crystal_Haven_P[0] and Crystal_Haven_P[(Integer A)]) / 24.00)
-
-
Then - Actions
-
-------- DAMAGE PART --------
-
Set Crystal_Haven_Shard_Active[(Integer A)] = False
-
Unit - Remove Crystal_Haven_Shards[(Integer A)] from the game
-
Special Effect - Create a special effect at Crystal_Haven_P[(Integer A)] using war3mapImported\IceSlam.mdx
-
Special Effect - Destroy (Last created special effect)
-
Set Crystal_Haven_T = (Units within 300.00 of Crystal_Haven_P2[0] matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is Magic Immune) Not equal to True) and ((((Matching unit) is dead) Not equal to True) and (((Matching unit) belongs to an enemy
-
Unit Group - Pick every unit in Crystal_Haven_T and do (Actions)
-
Loop - Actions
-
Unit - Cause Crystal_Haven_C to damage (Picked unit), dealing ((Real((Intelligence of Crystal_Haven_C (Include bonuses)))) x 1.00) damage of attack type Spells and damage type Normal
-
-
-
Environment - Create a 0.20 second Temporary crater deformation at Crystal_Haven_P2[0] with radius 300.00 and depth 72.00
-
Custom script: call DestroyGroup (udg_Crystal_Haven_T)
-
Custom script: call RemoveLocation (udg_Crystal_Haven_P[GetForLoopIndexA()])
-
-
Else - Actions
-
Set Crystal_Haven_P2[1] = (Crystal_Haven_P2[0] offset by ((Distance between Crystal_Haven_P[0] and Crystal_Haven_P[(Integer A)]) / 30.00) towards (Angle from Crystal_Haven_P[0] to Crystal_Haven_P[(Integer A)]) degrees)
-
Set Crystal_Haven_XY[0] = (X of Crystal_Haven_P2[1])
-
Set Crystal_Haven_XY[1] = (Y of Crystal_Haven_P2[1])
-
Custom script: call SetUnitX(udg_Crystal_Haven_Shards[GetForLoopIndexA()],udg_Crystal_Haven_XY[0])
-
Custom script: call SetUnitY(udg_Crystal_Haven_Shards[GetForLoopIndexA()],udg_Crystal_Haven_XY[1])
-
Animation - Change Crystal_Haven_Shards[(Integer A)] flying height to ((Current flying height of Crystal_Haven_Shards[(Integer A)]) - 30.00) at 30.00
-
Custom script: call RemoveLocation (udg_Crystal_Haven_P2[1])
-
-
-
Custom script: call RemoveLocation (udg_Crystal_Haven_P[0])
-
Custom script: call RemoveLocation (udg_Crystal_Haven_P2[0])
-
-
Else - Actions
-
-
-
-
For each (Integer A) from 1 to Crystal_Haven_Count, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Crystal_Haven_Shard_Active[(Integer A)] Equal to False
-
-
Then - Actions
-
Unit - Set the custom value of Crystal_Haven_Shards[0] to ((Custom value of Crystal_Haven_Shards[0]) + 1)
-
-
Else - Actions
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Custom value of Crystal_Haven_Shards[0]) Greater than or equal to Crystal_Haven_Count
-
Crystal_Haven_Phases[1] Equal to False
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
Unit - Remove Crystal_Haven_Shards[0] from the game
-
-
Else - Actions
-
Unit - Set the custom value of Crystal_Haven_Shards[0] to 0
-
-
-
-
-
-