- Joined
- Feb 17, 2007
- Messages
- 368
I'm not sure why this is lagging and causing noticeable slowdown for a few seconds when its in progress and slightly after, does anyone see any leaks or something wrong? Oh and the weird thing is the lag does not seem to happen to all units who are targeted.
-
Actions
-
-------- Stores into variables Caster and Target --------
-
Set LeapCaster = (Triggering unit)
-
Set LeapTarget = (Target unit of ability being cast)
-
-------- Finds the Distance between the Caster and Target --------
-
Set LeapPoints[1] = (Position of LeapCaster)
-
Set LeapPoints[2] = (Position of LeapTarget)
-
Set LeapReal[1] = (Distance between LeapPoints[1] and LeapPoints[2])
-
-------- Counts up the range at which the Caster shall start landing --------
-
Set LeapReal[2] = (LeapReal[1] / 2.00)
-
-------- Creates a trail SFX and instantly destroys it, removing leak --------
-
-------- Stores target into Hashtable --------
-
Hashtable - Save Handle OfLeapTarget as 0 of (Key (Triggering unit)) in LeapHashtable
-
-------- Stores the Distance-to-jump and distance at which the Caster shall start landing --------
-
Hashtable - Save LeapReal[1] as 1 of (Key (Triggering unit)) in LeapHashtable
-
Hashtable - Save LeapReal[2] as 2 of (Key (Triggering unit)) in LeapHashtable
-
Unit - Turn collision for LeapCaster Off
-
-------- Checks if there is any instance of spell already in effect --------
-
-------- If not, turns the Loop trigger on --------
-
If ((Leapers is empty) Equal to True) then do (Trigger - Turn on Leap Loop <gen>) else do (Do nothing)
-
-------- Adds the Caster into Leapers' group --------
-
Unit Group - Add LeapCaster to Leapers
-
-------- Removes leaks --------
-
Custom script: call RemoveLocation(udg_LeapPoints[1])
-
Custom script: call RemoveLocation(udg_LeapPoints[2])
-
-
Actions
-
Unit Group - Pick every unit in Leapers and do (Actions)
-
Loop - Actions
-
-------- Stores Target and Caster into variables --------
-
Set LeapTarget = (Load 0 of (Key (Picked unit)) in LeapHashtable)
-
Set LeapCaster = (Picked unit)
-
-------- Finds the locations of Caster and Target --------
-
Set LeapPoints[1] = (Position of LeapCaster)
-
Set LeapPoints[2] = (Position of LeapTarget)
-
-------- Finds a location to which the Caster would be moved --------
-
-------- NOTE 1: Here change your speed --------
-
-------- NOTE 2: Speed is counted by dividing your real number into trigger's loop interval --------
-
-------- NOTE 3: My speed is 40/0.04=1000 units per second --------
-
Set LeapPoints[3] = (LeapPoints[1] offset by 50.00 towards (Angle from LeapPoints[1] to LeapPoints[2]) degrees)
-
-------- Loads the Distance at which caster would start landing --------
-
Set LeapReal[1] = (Load 2 of (Key (Picked unit)) from LeapHashtable)
-
-------- Counts the Distance between caster and target --------
-
Set LeapReal[2] = (Distance between LeapPoints[1] and LeapPoints[2])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
LeapReal[2] Greater than or equal to 120.00
-
-
Then - Actions
-
-------- If distance between caster and target is greater than 120, then... --------
-
-------- Moves caster to Points[3] --------
-
Unit - Move LeapCaster instantly to LeapPoints[3], facing LeapPoints[2]
-
-------- Increases/decreases the flying heigh of Caster --------
-
-------- NOTE 4: Here it checks if the Distance between Caster and Target is greater than Distance at which Caster should start landing --------
-
-------- If yes, then it increases the flying height of the caster, else reduces it by equal amount --------
-
If (LeapReal[2] Greater than or equal to LeapReal[1]) then do (Set LeapReal[1] = 8.00) else do (Set LeapReal[1] = -8.00)
-
Unit - Add Storm Crow Form to LeapCaster
-
Unit - Remove Storm Crow Form from LeapCaster
-
Animation - Change LeapCaster flying height to ((Current flying height of LeapCaster) + LeapReal[1]) at 1000000000.00
-
-
Else - Actions
-
-------- Else... --------
-
-------- Resets the Flying height of Caster --------
-
Animation - Change LeapCaster flying height to 0.00 at 100000000.00
-
Unit - Turn collision for LeapCaster On
-
-------- Orders caster to attack target --------
-
Unit - Order LeapCaster to Attack LeapTarget
-
-------- Creates the Thunderclap --------
-
-------- NOTE 5: Change damage at dummy ability in Object Editor --------
-
Unit - Create 1 Leap Dummy Unit for (Owner of LeapCaster) at LeapPoints[1] facing Default building facing degrees
-
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
-
Unit - Add Dummy Thunder Clap to (Last created unit)
-
Unit - Set level of Dummy Thunder Clap for (Last created unit) to (Level of Leap for LeapCaster)
-
Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
-
-------- Clears the Hashtable and Removes caster from Leapers' group --------
-
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in LeapHashtable
-
Unit Group - Remove (Picked unit) from Leapers
-
-
-
-------- Clears leaks --------
-
Custom script: call RemoveLocation(udg_LeapPoints[1])
-
Custom script: call RemoveLocation(udg_LeapPoints[2])
-
Custom script: call RemoveLocation(udg_LeapPoints[3])
-
-
-
-------- Checks if there is any instance left after loop --------
-
-------- If not, turns this trigger off --------
-
If ((Leapers is empty) Equal to True) then do (Trigger - Turn off (This trigger)) else do (Do nothing)
-