Hi guys, i made a simple spell with the help of hashtables (A missle that flies to the enemy and dealing damage). what i want to know, can i do anything better or more efficient, are there any leaks, did i something wrong? What i can say: the spell works:
-
Hydro Pump 1
-
Events
-
Unit - A unit starts the effect of an ability
-
-
Conditions
-
(Ability being cast) equal to Hydro Pump
-
-
Actions
-
Set Hydropump_Caster[1] = (Casting unit)
-
Set Hydropump_Target[1] = (Target unit of ability being cast)
-
Set Hydropump_Point[1] = (Position of Hydropump_Caster[1])
-
Set Hydropump_Point[2] = (Hydropump_Point[1] offset by 25.00 towards (Facing of Hydropump_Caster[1]) degrees)
-
Unit - Create 1 Hydro Pump Dummy for (Owner of Hydropump_Caster[1]) at Hydropump_Point[2] facing (Facing of Egelsamen_Einheit) degrees
-
Set Hydropump_Dummy = (Last created unit)
-
Set Hydropump_Caster[2] = (Load 4 of (Key (Last created unit)) in Hashtabelle)
-
Set Hydropump_Caster[2] = Hydropump_Caster[1]
-
Hashtabelle - Save Handle OfHydropump_Caster[2] as 4 of (Key (Last created unit)) in Hashtabelle
-
Set Hydropump_Target[2] = (Load 9 of (Key (Last created unit)) in Hashtabelle)
-
Set Hydropump_Target[2] = Hydropump_Target[1]
-
Hashtabelle - Save Handle OfHydropump_Target[2] as 9 of (Key (Last created unit)) in Hashtabelle
-
Unit Group - Add Hydropump_Dummy to Hydropump_Group
-
Trigger - Turn on Hydro Pump 2 <gen>
-
Custom script: call RemoveLocation (udg_Hydropump_Point[1])
-
Custom script: call RemoveLocation (udg_Hydropump_Point[2])
-
-
-
Hydro Pump 2
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in Hydropump_Group and do (Actions)
-
Loop - Action
-
Set Hydropump_Caster[2] = (Load 4 of (Key (Picked unit)) in Hashtabelle)
-
Set Hydropump_Target[2] = (Load 9 of (Key (Picked unit)) in Hashtabelle)
-
Set Hydropump_Point[3] = (Position of Hydropump_Target[2])
-
Set Hydropump_Point[4] = (Position of (Picked unit))
-
Unit - Move (Picked unit) instantly to (Hydropump_Point[4] offset by 25.00 towards (Angle from Hydropump_Point[4] to Hydropump_Point[3]) degrees)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
-
(Distance between Hydropump_Point[4] and Hydropump_Point[3]) smaller than 20.00
-
-
'THEN'-Actions
-
Unit - Kill (Picked unit)
-
Unit - Cause Hydropump_Caster[2] to damage Hydropump_Target[2], dealing (1.25 x (Real((Strength of Hydropump_Caster[2] (Including bonuses))))) damage of attack type Spells and damage type Normal
-
Unit Group - Remove (Picked unit) from Hydropump_Group
-
-
'ELSE'-Actions
-
-
Custom script: call RemoveLocation (udg_Hydropump_Point[3])
-
Custom script: call RemoveLocation (udg_Hydropump_Point[4])
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
-
(Number of units in Hydropump_Group) equal to 0
-
-
'THEN'-Actions
-
Trigger - Turn off (This trigger)
-
-
'ELSE'-Actions
-
-
-