- Joined
- Mar 1, 2013
- Messages
- 555
Hey everyone
I used 2 triggers for all my missile-like spells but I've found this weird problem
When I cast the spell for a 2nd time then the effect just stands there without moving. After that when I cast the spell on someone else, the first target will always take some damage.
I used 2 triggers for all my missile-like spells but I've found this weird problem
When I cast the spell for a 2nd time then the effect just stands there without moving. After that when I cast the spell on someone else, the first target will always take some damage.
-
Missile cast
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


Or - Any (Conditions) are true
-



Conditions
-




(Ability being cast) Equal to Graviton
-




(Ability being cast) Equal to Solar plasma
-
-
-
-

Actions
-


If (iIndex Equal to 0) then do (Trigger - Turn on Missile loop <gen>) else do (Do nothing)
-


Set iIndex = (iIndex + 1)
-


Set uC[iIndex] = (Triggering unit)
-


Set uT[iIndex] = (Target unit of ability being cast)
-


Set Temp_Point = (Position of uC[iIndex])
-


Set Temp_Point2 = (Position of uT[iIndex])
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Ability being cast) Equal to Graviton
-
-



Then - Actions
-




Unit - Create 1 Graviton for (Owner of uC[iIndex]) at Temp_Point facing Temp_Point2
-




Set uE[iIndex] = (Last created unit)
-




Set rSpeed[iIndex] = 7.00
-




Set rDamage[iIndex] = 200.00
-
-



Else - Actions
-
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Ability being cast) Equal to Solar plasma
-
-



Then - Actions
-




Unit - Create 1 Solar plasma for (Owner of uC[iIndex]) at Temp_Point facing Temp_Point2
-




Set uE[iIndex] = (Last created unit)
-




Set rSpeed[iIndex] = 3.00
-




Set rDamage[iIndex] = (500.00 + (10.00 x (Real((Hero level of uC[iIndex])))))
-
-



Else - Actions
-
-


Custom script: call RemoveLocation(udg_Temp_Point)
-


Custom script: call RemoveLocation(udg_Temp_Point2)
-
-
-
Missile loop
-

Events
-


Time - Every 0.02 seconds of game time
-
-

Conditions
-

Actions
-


For each (Integer Temp_Int) from 1 to iIndex, do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(uE[Temp_Int] is paused) Equal to False
-
-





Then - Actions
-






Set Temp_Point = (Position of uE[Temp_Int])
-






Set Temp_Point2 = (Position of uT[Temp_Int])
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Distance between Temp_Point and Temp_Point2) Greater than (2.00 x rSpeed[Temp_Int])
-
-







Then - Actions
-








Set Temp_Point3 = (Temp_Point offset by rSpeed[Temp_Int] towards (Angle from Temp_Point to Temp_Point2) degrees)
-








Unit - Move uE[Temp_Int] instantly to Temp_Point3, facing Temp_Point2
-








Custom script: call RemoveLocation(udg_Temp_Point3)
-
-







Else - Actions
-








Unit - Kill uE[Temp_Int]
-








Unit - Cause uC[Temp_Int] to damage uT[Temp_Int], dealing rDamage[Temp_Int] damage of attack type Spells and damage type Force
-
-
-






Custom script: call RemoveLocation(udg_Temp_Point)
-






Custom script: call RemoveLocation(udg_Temp_Point2)
-
-





Else - Actions
-
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(uE[Temp_Int] is dead) Equal to True
-
-





Then - Actions
-






Set uC[Temp_Int] = uC[iIndex]
-






Set uC[iIndex] = No unit
-






Set uT[Temp_Int] = uT[iIndex]
-






Set uT[iIndex] = No unit
-






Set uE[Temp_Int] = uE[iIndex]
-






Set uE[iIndex] = No unit
-






Set rSpeed[Temp_Int] = rSpeed[iIndex]
-






Set rSpeed[iIndex] = 0.00
-






Set rDamage[Temp_Int] = rDamage[iIndex]
-






Set rDamage[iIndex] = 0.00
-






Set iIndex = (iIndex - 1)
-






Set Temp_Int = (Temp_Int - 1)
-






If (iIndex Equal to 0) then do (Trigger - Turn off (This trigger)) else do (-------- 0 --------)
-
-





Else - Actions
-
-
-
-
-



