Moderator
M
Moderator
11:08, 4th Sep 2010
TriggerHappy:
Coding and spell were fine.
TriggerHappy:
Coding and spell were fine.
Heroic Leap Cast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Heroic Leap

Actions


-------- Stores caster into variable --------


Set Caster = (Triggering unit)


-------- Finds caster's location and center of target AoE --------


Set Points[1] = (Position of Caster)


Set Points[2] = (Target point of ability being cast)


-------- Fixes the Out-of-Boundary bugg --------


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



If - Conditions




(Terrain pathing at Points[2] of type Walkability is off) Equal to True



Then - Actions




Item - Create Tome of Experience at Points[2]




Custom script: call RemoveLocation(udg_Points[2])




Set Points[2] = (Position of (Last created item))




Item - Remove (Last created item)



Else - Actions


-------- Stores distance-to-jump into variable --------


Set Real[1] = (Distance between Points[1] and Points[2])


-------- Counts up the Distance at which Caster shall start landing --------


Set Real[2] = (Real[1] / 2.00)


-------- Counts angle at which caster shall 'jump' --------


Set Real[3] = (Angle from Points[1] to Points[2])


-------- Turns Caster's collision off, as we want it jump above (go through) any obstacle --------


Unit - Turn collision for Caster Off


-------- Makes Caster invulnerable --------


Unit - Make Caster Invulnerable


-------- Adds to and removes from Caster Storm Crow Form spell , allowing us to manipulate the Flying height of Caster --------


Unit - Add Storm Crow Form to Caster


Unit - Remove Storm Crow Form from Caster


-------- Creates a trail SFX and instantly destroys it, fixing the leak --------


Special Effect - Create a special effect attached to the origin of Caster using Abilities\Spells\Human\Invisibility\InvisibilityTarget.mdl


Special Effect - Destroy (Last created special effect)


-------- Stores all Information needed to the Hashtable --------


-------- NOTE 1: All information is attached to caster --------


-------- Never, EVER, make hashtable-based MUI spells, that are cast by Caster and Information is attached to the Target, as it will cause huge bugg --------


Hashtable - Save Real[1] as 0 of (Key (Triggering unit)) in Hashtable


Hashtable - Save Real[2] as 1 of (Key (Triggering unit)) in Hashtable


Hashtable - Save Real[3] as 2 of (Key (Triggering unit)) in Hashtable


-------- Checks if there is any instance of spell already in game --------


-------- If not, then turns sliding trigger on --------


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



If - Conditions




(Leapers is empty) Equal to True



Then - Actions




Trigger - Turn on Heroic Leap Slide <gen>



Else - Actions


-------- Adds caster to leapers' group --------


Unit Group - Add (Triggering unit) to Leapers


-------- Clears the leaks --------


Custom script: call RemoveLocation(udg_Points[1])


Custom script: call RemoveLocation(udg_Points[2])


-------- NOTE 2: AoE, damage and stun duration are all works in Object Editor, spells Heroic Leap and Dummy Stomp --------
Heroic Leap Slide

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


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



Loop - Actions




-------- Stores Caster into variable, solely for faster code writing --------




Set Caster = (Picked unit)




-------- Loads distance-to-jump and reduces it by SPEED --------




-------- NOTE 1: This reducement MUST be equal to the offset by real number in the countings of Points[2] --------




Set Real[1] = (Load 0 of (Key (Picked unit)) from Hashtable)




Set Real[1] = (Real[1] - 33.00)




-------- Loads distance-to-rise --------




Set Real[2] = (Load 1 of (Key (Picked unit)) from Hashtable)




-------- Loads jump angle --------




Set Real[3] = (Load 2 of (Key (Picked unit)) from Hashtable)




-------- Finds current position of Caster and Counts the next Point-to-move --------




Set Points[1] = (Position of Caster)




Set Points[2] = (Points[1] offset by 33.00 towards Real[3] degrees)




-------- Checks if it is time to finish landing --------




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





If - Conditions






Real[1] Greater than or equal to 0.00





Then - Actions






-------- If not, then... --------






-------- Moves Caster to the Points[2], making it slide --------






Unit - Move Caster instantly to Points[2]






-------- Checks if the distance-to-jump is greater than distance-to-rise --------






-------- If it is, then sets bonus jump height into positive real number, else, to negative, but equal one --------






If (Real[1] Greater than Real[2]) then do (Set Real[3] = 20.00) else do (Set Real[3] = -20.00)






-------- Increases/decreases flying height of caster, making it 'jump' --------






Animation - Change Caster flying height to ((Current flying height of Caster) + Real[3]) at 0.00






-------- Updates reduced distance-to-jump --------






Hashtable - Save Real[1] as 0 of (Key (Picked unit)) in Hashtable





Else - Actions






-------- If it is, then... --------






-------- Fixes Caster's collision, vulnerability and flying height --------






Unit - Turn collision for Caster On






Unit - Make Caster Vulnerable






Animation - Change Caster flying height to (Default flying height of Caster) at 0.00






-------- Plays caster's slam animation --------






Animation - Play Caster's slam animation






-------- Does the AoE-stunning --------






Unit - Create 1 Dummy Caster for (Owner of Caster) at Points[2] facing Default building facing degrees






Unit - Add a 0.50 second Generic expiration timer to (Last created unit)






Unit - Add Dummy Stomp to (Last created unit)






Unit - Set level of Dummy Stomp for (Last created unit) to (Level of Heroic Leap for Caster)






Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp






-------- Clears the Hashtable --------






Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hashtable






-------- Removes Caster from leapers' group --------






Unit Group - Remove Caster from Leapers




-------- Clears the Leaks --------




Custom script: call RemoveLocation(udg_Points[1])




Custom script: call RemoveLocation(udg_Points[2])


-------- Checks if there is any instance of spell left after this loop --------


-------- If not, then turns this trigger off --------


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



If - Conditions




(Leapers is empty) Equal to True



Then - Actions




Trigger - Turn off (This trigger)



Else - Actions