REQUIRED VARIABLES

Events

Conditions

Actions


-------- [SETUP AT MAP INITIALIZATION] --------


Set AbilityId = Shadow Paralysis


Set DummyId = Chicken


Set OrderId = channel


Set Attack_Type = Spells


Set Damage_Type = Magic


Set AssignedDPS[1] = 3.00


Set AssignedDPS[2] = 6.00


Set AssignedDPS[3] = 9.00


Set AssignedMPS[1] = 10.00


Set AssignedMPS[2] = 20.00


Set AssignedMPS[3] = 30.00


-------- [SETUP AT ABILITY TRIGGER] --------


Set AssignedCaster = No unit


Set AssignedDistance = 0.00


Set AssignedTarget = (Target point of ability being cast)
SP Call

Events

Conditions

Actions


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


Set SP_Caster[SP_Integer[0]] = AssignedCaster


Set SP_Target[SP_Integer[0]] = AssignedTarget


Set SP_StartDistance[SP_Integer[0]] = (Position of SP_Caster[SP_Integer[0]])


Set SP_EndDistance[SP_Integer[0]] = AssignedDistance


Set SP_Level[SP_Integer[0]] = (Level of AbilityId for SP_Caster[SP_Integer[0]])


Set SP_DPS[SP_Integer[0]] = AssignedDPS[SP_Level[SP_Integer[0]]]


Set SP_MPS[SP_Integer[0]] = AssignedMPS[SP_Level[SP_Integer[0]]]


Set SP_Angle[SP_Integer[0]] = (Angle from SP_StartDistance[SP_Integer[0]] to SP_Target[SP_Integer[0]])


Set SP_Last[SP_Integer[0]] = SP_Caster[SP_Integer[0]]


Set SP_Group[SP_Integer[0]] = (Random 0 units from (Units in (Playable map area)))


Set SP_Paralyzed[SP_Integer[0]] = (Random 0 units from (Units in (Playable map area)))


Set SP_LastPoint[SP_Integer[0]] = (Position of SP_Last[SP_Integer[0]])


Set SP_Player[SP_Integer[0]] = (Owner of SP_Caster[SP_Integer[0]])


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



If - Conditions




SP_Integer[0] Equal to 1



Then - Actions




Trigger - Turn on SP Loop <gen>



Else - Actions
SP Loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


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



Loop - Actions




Set SP_CurDPS[SP_Integer[1]] = (SP_DPS[SP_Level[SP_Integer[1]]] x 0.03)




Set SP_CurMPS[SP_Integer[1]] = (SP_MPS[SP_Level[SP_Integer[1]]] x 0.03)




Set SP_LastPoint[SP_Integer[1]] = (Position of SP_Last[SP_Integer[1]])




Unit - Set mana of SP_Caster[SP_Integer[1]] to ((Mana of SP_Caster[SP_Integer[1]]) - SP_CurMPS[SP_Integer[1]])




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





If - Conditions






(Distance between SP_StartDistance[SP_Integer[1]] and SP_LastPoint[SP_Integer[1]]) Less than SP_EndDistance[SP_Integer[1]]





Then - Actions






Set SP_Point[SP_Integer[1]] = (SP_LastPoint[SP_Integer[1]] offset by 35.00 towards SP_Angle[SP_Integer[1]] degrees)






Unit - Create 1 DummyId for SP_Player[SP_Integer[1]] at SP_Point[SP_Integer[1]] facing Default building facing degrees






Set SP_Last[SP_Integer[1]] = (Last created unit)






Unit Group - Add SP_Last[SP_Integer[1]] to SP_Group[SP_Integer[1]]






Custom script: call RemoveLocation(udg_SP_Point[udg_SP_Integer[1]])





Else - Actions






Custom script: call RemoveLocation(udg_SP_LastPoint[udg_SP_Integer[1]])




Unit Group - Pick every unit in SP_Group[SP_Integer[1]] and do (Actions)





Loop - Actions






Set SP_Picked = (Picked unit)






Set TempPoint = (Position of SP_Picked)






Set TempGroup = (Units within 85.00 of TempPoint)






Unit Group - Pick every unit in TempGroup and do (Actions)







Loop - Actions








Set TempPicked = (Picked unit)








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









If - Conditions










(TempPicked is A structure) Equal to False










(TempPicked is in SP_Paralyzed[SP_Integer[1]]) Equal to False










(TempPicked is alive) Equal to True










TempPicked Not equal to SP_Caster[SP_Integer[1]]










(Unit-type of TempPicked) Not equal to DummyId










(TempPicked belongs to an enemy of SP_Player[SP_Integer[1]]) Equal to True









Then - Actions










Unit - Pause TempPicked










Animation - Change TempPicked's animation speed to 0.00% of its original speed










Unit Group - Add TempPicked to SP_Paralyzed[SP_Integer[1]]









Else - Actions








Set TempPicked = No unit






Custom script: call DestroyGroup(udg_TempGroup)






Custom script: call RemoveLocation(udg_TempPoint)






Set SP_Picked = No unit




Unit Group - Pick every unit in SP_Paralyzed[SP_Integer[1]] and do (Actions)





Loop - Actions






Set SP_Temp = (Picked unit)






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







If - Conditions








(SP_Temp is alive) Equal to True







Then - Actions








Unit - Cause SP_Caster[SP_Integer[1]] to damage SP_Temp, dealing SP_CurDPS[SP_Integer[1]] damage of attack type Attack_Type and damage type Damage_Type







Else - Actions








Unit Group - Remove SP_Temp from SP_Paralyzed[SP_Integer[1]]








Animation - Change SP_Temp's animation speed to 100.00% of its original speed






Set SP_Temp = No unit




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





If - Conditions






(Mana of SP_Caster[SP_Integer[1]]) Less than SP_MPS[SP_Level[SP_Integer[1]]]





Then - Actions






Unit - Order SP_Caster[SP_Integer[1]] to Stop





Else - Actions
SP EndCall

Events


Unit - A unit Stops casting an ability

Conditions


(Ability being cast) Equal to AbilityId

Actions


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



Loop - Actions




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





If - Conditions






SP_Caster[SP_Integer[2]] Equal to (Triggering unit)





Then - Actions






Unit Group - Pick every unit in SP_Group[SP_Integer[2]] and do (Actions)







Loop - Actions








Set SP_Picked = (Picked unit)








Unit - Remove SP_Picked from the game








Set SP_Picked = No unit






Unit Group - Pick every unit in SP_Paralyzed[SP_Integer[2]] and do (Actions)







Loop - Actions








Set SP_Temp = (Picked unit)








Unit - Unpause SP_Temp








Animation - Change SP_Temp's animation speed to 100.00% of its original speed








Set SP_Temp = No unit






Custom script: call DestroyGroup(udg_SP_Group[udg_SP_Integer[2]])






Custom script: call DestroyGroup(udg_SP_Paralyzed[udg_SP_Integer[2]])






Set SP_Angle[SP_Integer[2]] = SP_Angle[SP_Integer[0]]






Set SP_Caster[SP_Integer[2]] = SP_Caster[SP_Integer[0]]






Set SP_DPS[SP_Integer[2]] = SP_DPS[SP_Integer[0]]






Set SP_EndDistance[SP_Integer[2]] = SP_EndDistance[SP_Integer[0]]






Set SP_Group[SP_Integer[2]] = SP_Group[SP_Integer[0]]






Set SP_Group2[SP_Integer[2]] = SP_Group2[SP_Integer[0]]






Set SP_Last[SP_Integer[2]] = SP_Last[SP_Integer[0]]






Set SP_Level[SP_Integer[2]] = SP_Level[SP_Integer[0]]






Set SP_MPS[SP_Integer[2]] = SP_MPS[SP_Integer[0]]






Set SP_Player[SP_Integer[2]] = SP_Player[SP_Integer[0]]






Set SP_Point[SP_Integer[2]] = SP_Point[SP_Integer[0]]






Set SP_StartDistance[SP_Integer[2]] = SP_StartDistance[SP_Integer[0]]






Set SP_Target[SP_Integer[2]] = SP_Target[SP_Integer[0]]






Set SP_Integer[2] = SP_Integer[0]






Set SP_Caster[SP_Integer[0]] = No unit






Set SP_Last[SP_Integer[0]] = No unit






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






Set SP_Integer[1] = (SP_Integer[1] - 1)






Set SP_Integer[2] = (SP_Integer[2] - 1)





Else - Actions


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



If - Conditions




SP_Integer[0] Equal to 0



Then - Actions




Trigger - Turn off SP Loop <gen>



Else - Actions