Parachute Init

Events


Map initialization

Conditions

Actions


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


-------- After importing this system, you might need to sets these variables again --------


Set Pcht_modelPath = war3mapImported\Parachute.mdx


Set Pcht_attachment = chest


Set Pcht_loopTrigger = Parachute Loop <gen>


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


-------- Determines the loop timer speed --------


Set Pcht_loopSpeed = 0.03


-------- Note: I recommend you not to change this, but for some reason i leave this configurable for those who might need this somehow --------


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


-------- Do not change anything below this line if don't know what you're doing --------


-------- =========================================================================== --------


Trigger - Add to Pcht_loopTrigger the event (Time - Every Pcht_loopSpeed seconds of game time)
Parachute Drop

Events

Conditions

Actions


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



If - Conditions




Pcht_maxIndex Equal to 0



Then - Actions




Trigger - Turn on Pcht_loopTrigger



Else - Actions


Set Pcht_maxIndex = (Pcht_maxIndex + 1)


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



If - Conditions




Pcht_dropCreateNew Equal to True



Then - Actions




Unit - Create 1 Pcht_dropUnitType for Pcht_dropPlayer at Pcht_dropPoint facing Pcht_dropAngle degrees




Set Pcht_unit[Pcht_maxIndex] = (Last created unit)




Set Pcht_lastCreatedUnit = Pcht_unit[Pcht_maxIndex]



Else - Actions




Set Pcht_unit[Pcht_maxIndex] = Pcht_dropUnit


Custom script: if UnitAddAbility(udg_Pcht_unit[udg_Pcht_maxIndex],'Amrf') and UnitRemoveAbility(udg_Pcht_unit[udg_Pcht_maxIndex],'Amrf') then


Custom script: endif


Animation - Change Pcht_unit[Pcht_maxIndex] flying height to Pcht_dropHeight at 0.00


Special Effect - Create a special effect attached to the Pcht_attachment of Pcht_unit[Pcht_maxIndex] using Pcht_modelPath


Set Pcht_model[Pcht_maxIndex] = (Last created special effect)


Set Pcht_height[Pcht_maxIndex] = Pcht_dropHeight


Set Pcht_speed[Pcht_maxIndex] = Pcht_dropSpeed


Set Pcht_endTrigger[Pcht_maxIndex] = Pcht_dropEndTrigger


Set Pcht_dropAngle = 0.00


Set Pcht_dropCreateNew = False


Custom script: set udg_Pcht_dropEndTrigger=null


Set Pcht_dropHeight = 0.00


Custom script: set udg_Pcht_dropPlayer=null


Set Pcht_dropSpeed = 0.00


Set Pcht_dropUnit = No unit


Set Pcht_dropUnitType = No unit-type
Parachute Loop

Events

Conditions

Actions


For each (Integer Pcht_index) from 1 to Pcht_maxIndex, do (Actions)



Loop - Actions




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





If - Conditions






Pcht_height[Pcht_index] Greater than 0.00





Then - Actions






Set Pcht_height[Pcht_index] = (Pcht_height[Pcht_index] - Pcht_speed[Pcht_index])






Animation - Change Pcht_unit[Pcht_index] flying height to Pcht_height[Pcht_index] at 0.00





Else - Actions






Animation - Change Pcht_unit[Pcht_index] flying height to 0.00 at 0.00






Special Effect - Destroy Pcht_model[Pcht_index]






Trigger - Run Pcht_endTrigger[Pcht_index] (ignoring conditions)






Set Pcht_endTrigger[Pcht_index] = Pcht_endTrigger[Pcht_maxIndex]






Set Pcht_height[Pcht_index] = Pcht_height[Pcht_maxIndex]






Set Pcht_model[Pcht_index] = Pcht_model[Pcht_maxIndex]






Set Pcht_speed[Pcht_index] = Pcht_speed[Pcht_maxIndex]






Set Pcht_unit[Pcht_index] = Pcht_unit[Pcht_maxIndex]






Set Pcht_maxIndex = (Pcht_maxIndex - 1)






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







If - Conditions








Pcht_maxIndex Equal to 0







Then - Actions








Trigger - Turn off (This trigger)







Else - Actions








Set Pcht_index = (Pcht_index - 1)
Drop Footman

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Drop Footman

Actions


Set tempLoc = (Target point of ability being cast)


Set tempPlayer = (Triggering player)


For each (Integer loopIndex) from 1 to 6, do (Actions)



Loop - Actions




Set Pcht_dropCreateNew = True




Set Pcht_dropUnitType = Footman




Set Pcht_dropUnit = No unit




Set Pcht_dropPlayer = tempPlayer




Set Pcht_dropAngle = 0.00




Set Pcht_dropPoint = (tempLoc offset by (Random real number between 0.00 and 500.00) towards (Random angle) degrees)




Set Pcht_dropHeight = 600.00




Set Pcht_dropSpeed = 20.00




Trigger - Run Parachute Drop <gen> (ignoring conditions)




Custom script: call RemoveLocation(udg_Pcht_dropPoint)


Custom script: call RemoveLocation(udg_tempLoc)
Drop Rifleman

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Drop Rifleman

Actions


Set tempLoc = (Target point of ability being cast)


Set tempPlayer = (Triggering player)


For each (Integer loopIndex) from 1 to 4, do (Actions)



Loop - Actions




Set Pcht_dropCreateNew = True




Set Pcht_dropUnitType = Rifleman




Set Pcht_dropUnit = No unit




Set Pcht_dropPlayer = tempPlayer




Set Pcht_dropAngle = 0.00




Set Pcht_dropPoint = (tempLoc offset by (Random real number between 0.00 and 500.00) towards (Random angle) degrees)




Set Pcht_dropHeight = 600.00




Set Pcht_dropSpeed = 20.00




Trigger - Run Parachute Drop <gen> (ignoring conditions)




Custom script: call RemoveLocation(udg_Pcht_dropPoint)


Custom script: call RemoveLocation(udg_tempLoc)
Drop Knight

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Drop Knight

Actions


Set tempLoc = (Target point of ability being cast)


Set tempPlayer = (Triggering player)


For each (Integer loopIndex) from 1 to 3, do (Actions)



Loop - Actions




Set Pcht_dropCreateNew = True




Set Pcht_dropUnitType = Knight




Set Pcht_dropUnit = No unit




Set Pcht_dropPlayer = tempPlayer




Set Pcht_dropAngle = 0.00




Set Pcht_dropPoint = (tempLoc offset by (Random real number between 0.00 and 500.00) towards (Random angle) degrees)




Set Pcht_dropHeight = 600.00




Set Pcht_dropSpeed = 20.00




Trigger - Run Parachute Drop <gen> (ignoring conditions)




Custom script: call RemoveLocation(udg_Pcht_dropPoint)


Custom script: call RemoveLocation(udg_tempLoc)