HM Init

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Heat Seeking Missile

Actions


Set HM_CASTER = (Triggering unit)


Set HM_LEVEL = (Level of (Ability being cast) for (Triggering unit))


-------- Configure this settings --------


Set HM_DAMAGE = (40.00 + (10.00 x (Real(HM_LEVEL))))


Set HM_DISTANCE = 500.00


Set HM_SPEED_ADD = 0.00


Set HM_SFX = Abilities\Weapons\RocketMissile\RocketMissile.mdl


Set HM_Unit_Type = HM Dummy


-------- Number of missiles that will come out --------


Set HM_Count[0] = (2 + HM_LEVEL)


Set HM_Count[1] = 0


-------- You can make the missiles go back to you if you set this to TRUE --------


Set HM_CHECK = False


Set HM_SPEED = 25.00


Trigger - Run HM Cast <gen> (ignoring conditions)
HM Cast

Events

Conditions

Actions


For each (Integer HM_Count[1]) from 1 to HM_Count[0], do (Actions)



Loop - Actions




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





If - Conditions






HM_Mui[0] Less than or equal to 0





Then - Actions






Trigger - Turn on HM Loop <gen>





Else - Actions




Set HM_Mui[0] = (HM_Mui[0] + 1)




Set HM_Mui[1] = (HM_Mui[1] + 1)




-------- HM_Check_Homing = Set this to true if you want the spirits to come back to your hero. --------




Set HM_Check_Homing[HM_Mui[1]] = HM_CHECK




Set HM_Unit_Caster[HM_Mui[1]] = HM_CASTER




Set HM_Points[0] = (Position of HM_Unit_Caster[HM_Mui[1]])




Set HM_Angle[HM_Mui[1]] = (Random angle)




Unit - Create 1 HM_Unit_Type for (Owner of HM_Unit_Caster[HM_Mui[1]]) at HM_Points[0] facing HM_Angle[HM_Mui[1]] degrees




Set HM_Unit_Dummy[HM_Mui[1]] = (Last created unit)




-------- Variable Settings --------




Set HM_Damage[HM_Mui[1]] = HM_DAMAGE




Set HM_Distance[HM_Mui[1]] = HM_DISTANCE




Set HM_Speed[HM_Mui[1]] = HM_SPEED




Set HM_Speed_Add[HM_Mui[1]] = 0.00




Set HM_Sfx[HM_Count[1]] = HM_SFX




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





If - Conditions






(Random integer number between 1 and 2) Equal to 1





Then - Actions






Set HM_Angle_Add[HM_Mui[1]] = (Random real number between -2.00 and -6.00)





Else - Actions






Set HM_Angle_Add[HM_Mui[1]] = (Random real number between 2.00 and 6.00)




Custom script: call RemoveLocation (udg_HM_Points[0])
HM Loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


For each (Integer HM_Mui[2]) from 1 to HM_Mui[1], do (Actions)



Loop - Actions




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





If - Conditions






HM_Distance[HM_Mui[2]] Greater than 0.00





Then - Actions






Set HM_Speed_Add[HM_Mui[2]] = (HM_Speed_Add[HM_Mui[2]] - 0.10)






Set HM_Speed[HM_Mui[2]] = (HM_Speed[HM_Mui[2]] + HM_Speed_Add[HM_Mui[2]])






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







If - Conditions








HM_Speed[HM_Mui[2]] Less than or equal to 5.00







Then - Actions








Set HM_Speed[HM_Mui[2]] = 5.00







Else - Actions






Set HM_Distance[HM_Mui[2]] = (HM_Distance[HM_Mui[2]] - HM_Speed[HM_Mui[2]])






Set HM_Angle[HM_Mui[2]] = (HM_Angle[HM_Mui[2]] + HM_Angle_Add[HM_Mui[2]])






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







If - Conditions








HM_Angle[HM_Mui[2]] Less than or equal to 0.00







Then - Actions








Set HM_Angle[HM_Mui[2]] = 360.00







Else - Actions






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







If - Conditions








HM_Angle[HM_Mui[2]] Greater than or equal to 360.00







Then - Actions








Set HM_Angle[HM_Mui[2]] = 0.00







Else - Actions






Set HM_Points[1] = (Position of HM_Unit_Dummy[HM_Mui[2]])






Set HM_Points[2] = (HM_Points[1] offset by HM_Speed[HM_Mui[2]] towards HM_Angle[HM_Mui[2]] degrees)






Unit - Move HM_Unit_Dummy[HM_Mui[2]] instantly to HM_Points[2], facing HM_Angle[HM_Mui[2]] degrees






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







If - Conditions








HM_Distance[HM_Mui[2]] Less than or equal to 0.00







Then - Actions








Set HM_Group[HM_Mui[2]] = (Random 1 units from (Units within 1000.00 of HM_Points[2] matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of HM_Unit_Caster[HM_Mui[2]])) Equal to True)) and (((Matching unit) is visible to (Owner of H








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









If - Conditions










(Number of units in HM_Group[HM_Mui[2]]) Not equal to 0









Then - Actions










Unit Group - Pick every unit in HM_Group[HM_Mui[2]] and do (Actions)











Loop - Actions












Set HM_Unit_Target[HM_Mui[2]] = (Picked unit)









Else - Actions










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











If - Conditions












HM_Check_Homing[HM_Mui[2]] Equal to True











Then - Actions












Set HM_Unit_Target[HM_Mui[2]] = HM_Unit_Caster[HM_Mui[2]]











Else - Actions












Set HM_Unit_Target[HM_Mui[2]] = No unit








Special Effect - Create a special effect at HM_Point_Dummy[HM_Mui[2]] using HM_Sfx[HM_Count[2]]








Special Effect - Destroy (Last created special effect)








Set HM_Points[3] = (Position of HM_Unit_Target[HM_Mui[2]])








Set HM_Distance2[HM_Mui[2]] = (Distance between HM_Points[1] and HM_Points[3])








Custom script: call RemoveLocation (udg_HM_Points[3])








Custom script: call DestroyGroup( udg_HM_Group[udg_HM_Mui[2]])








Set HM_Distance[HM_Mui[2]] = 0.00








Set HM_Speed_Add[HM_Mui[2]] = 0.00







Else - Actions






Custom script: call RemoveLocation (udg_HM_Points[1])






Custom script: call RemoveLocation (udg_HM_Points[2])





Else - Actions






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







If - Conditions








HM_Distance2[HM_Mui[2]] Greater than 0.00







Then - Actions








Set HM_Points[1] = (Position of HM_Unit_Dummy[HM_Mui[2]])








Set HM_Points[2] = (HM_Points[1] offset by HM_Speed[HM_Mui[2]] towards HM_Angle[HM_Mui[2]] degrees)








Set HM_Points[3] = (Position of HM_Unit_Target[HM_Mui[2]])








Set HM_Angle[HM_Mui[2]] = (Angle from HM_Points[1] to HM_Points[3])








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









If - Conditions










(HM_Unit_Target[HM_Mui[2]] is dead) Equal to True









Then - Actions










Set HM_Group[HM_Mui[2]] = (Random 1 units from (Units within 1000.00 of HM_Points[2] matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of HM_Unit_Caster[HM_Mui[2]])) Equal to True)) and (((Matching unit) is visible to (Owner of H










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











If - Conditions












(Number of units in HM_Group[HM_Mui[2]]) Not equal to 0











Then - Actions












Unit Group - Pick every unit in HM_Group[HM_Mui[2]] and do (Actions)













Loop - Actions














Set HM_Unit_Target[HM_Mui[2]] = (Picked unit)











Else - Actions












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













If - Conditions














HM_Check_Homing[HM_Mui[2]] Equal to True













Then - Actions














Set HM_Unit_Target[HM_Mui[2]] = HM_Unit_Caster[HM_Mui[2]]













Else - Actions














Set HM_Unit_Target[HM_Mui[2]] = No unit










Custom script: call DestroyGroup( udg_HM_Group[udg_HM_Mui[2]])









Else - Actions








Set HM_Speed_Add[HM_Mui[2]] = (HM_Speed_Add[HM_Mui[2]] + 0.15)








Set HM_Speed[HM_Mui[2]] = (HM_Speed[HM_Mui[2]] + HM_Speed_Add[HM_Mui[2]])








-------- --------








Set HM_Distance2[HM_Mui[2]] = (HM_Distance2[HM_Mui[2]] - HM_Speed[HM_Mui[2]])








Set HM_Distance2[HM_Mui[2]] = (Distance between HM_Points[1] and HM_Points[3])








Unit - Move HM_Unit_Dummy[HM_Mui[2]] instantly to HM_Points[2], facing HM_Angle[HM_Mui[2]] degrees








-------- --------








Custom script: call RemoveLocation (udg_HM_Points[1])








Custom script: call RemoveLocation (udg_HM_Points[2])








Custom script: call RemoveLocation (udg_HM_Points[3])








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









If - Conditions










Or - Any (Conditions) are true











Conditions












HM_Distance2[HM_Mui[2]] Less than or equal to 100.00












HM_Unit_Target[HM_Mui[2]] Equal to No unit









Then - Actions










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











If - Conditions












HM_Unit_Target[HM_Mui[2]] Not equal to HM_Unit_Caster[HM_Mui[2]]











Then - Actions












Unit - Cause HM_Unit_Caster[HM_Mui[2]] to damage HM_Unit_Target[HM_Mui[2]], dealing HM_Damage[HM_Mui[2]] damage of attack type Spells and damage type Normal











Else - Actions










Special Effect - Create a special effect attached to the chest of HM_Unit_Target[HM_Mui[2]] using HM_Sfx[HM_Count[2]]










Special Effect - Destroy (Last created special effect)










Unit - Kill HM_Unit_Dummy[HM_Mui[2]]










Set HM_Unit_Caster[HM_Mui[2]] = No unit










Set HM_Unit_Dummy[HM_Mui[2]] = No unit










Set HM_Unit_Target[HM_Mui[2]] = No unit










Set HM_Distance2[HM_Mui[2]] = 0.00










Set HM_Angle[HM_Mui[2]] = 0.00










Set HM_Angle_Add[HM_Mui[2]] = 0.00










Set HM_Speed[HM_Mui[2]] = 0.00










Set HM_Speed_Add[HM_Mui[2]] = 0.00










Set HM_Damage[HM_Mui[2]] = 0.00










Set HM_Mui[0] = (HM_Mui[0] - 1)









Else - Actions







Else - Actions


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



If - Conditions




HM_Mui[0] Less than or equal to 0



Then - Actions




Trigger - Turn off (This trigger)




Set HM_Mui[0] = 0




Set HM_Mui[1] = 0



Else - Actions