[trigger=Main Trigger]
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Dash
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DashInteger[0] Equal to 0
Then - Actions
Trigger - Turn on Spell Loop <gen>
Else - Actions
-------- ----------------------------------------------------- --------
Set DashInteger[0] = (DashInteger[0] + 1)
Set DashInteger[1] = (DashInteger[1] + 1)
-------- ----------------------------------------------------- --------
Set DashCaster[DashInteger[1]] = (Triggering unit)
-------- ----------------------------------------------------- --------
Unit - Pause DashCaster[DashInteger[1]]
-------- ----------------------------------------------------- --------
Set DashReal1[DashInteger[1]] = (Facing of DashCaster[DashInteger[1]])
-------- ----------------------------------------------------- --------
-------- -----------Configure The Spell--------------------------- --------
-------- ----------------------------------------------------- --------
Set DashDamage[DashInteger[1]] = ((Real((Level of Dash for DashCaster[DashInteger[1]]))) x 200.00)
-------- ----------------------------------------------------- --------
Set DashSpeed[DashInteger[1]] = 40.00
-------- ----------------------------------------------------- --------
-------- ----------------How Much the Caster to Dash-------------------- --------
-------- ----------------------------------------------------- --------
Set DashDistance[DashInteger[1]] = 30
-------- ----------------------------------------------------- --------
-------- ----------------How Much the Caster to Dash-------------------- --------
-------- ----------------------------------------------------- --------
-------- -------------Turn Collision off----------------------- --------
-------- ----------------------------------------------------- --------
Custom script: call SetUnitAnimationByIndex (udg_DashCaster[udg_DashInteger[1]] , 2)
Animation - Play DashCaster[DashInteger[1]]'s walk animation
Unit - Turn collision for DashCaster[DashInteger[1]] Off
-------- ----------------------------------------------------- --------
[/trigger]
[trigger=Loop Trigger]
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
For each (Integer DashInteger[2]) from 1 to DashInteger[1], do (Actions)
Loop - Actions
Set DashDistance[DashInteger[2]] = (DashDistance[DashInteger[2]] - 1)
-------- ----------------------------------------------------- --------
Set DashPoint3[DashInteger[2]] = (Position of DashCaster[DashInteger[2]])
Set DashPoint4[DashInteger[2]] = (DashPoint3[DashInteger[2]] offset by DashSpeed[DashInteger[2]] towards DashReal1[DashInteger[2]] degrees)
-------- ----------------------------------------------------- --------
Unit - Move DashCaster[DashInteger[2]] instantly to DashPoint4[DashInteger[2]]
-------- ----------------------------------------------------- --------
Unit - Create 1 Dash Dummy for (Owner of DashCaster[DashInteger[2]]) at DashPoint4[DashInteger[2]] facing (Facing of DashCaster[DashInteger[2]]) degrees
Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
Unit Group - Add (Last created unit) to DashGroup3
Animation - Play (Last created unit)'s walk animation
-------- ----------------------------------------------------- --------
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in DashGroup3 and do (Actions)
Loop - Actions
Set DashPoint5[DashInteger[2]] = (Position of (Picked unit))
Set DashReal2[DashInteger[2]] = ((Distance between DashPoint3[DashInteger[2]] and DashPoint5[DashInteger[2]]) / 5.00)
Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with DashReal2[DashInteger[2]]% transparency
-------- ----------------------------------------------------- --------
Set DashGroup1 = (Units within 150.00 of DashPoint4[DashInteger[2]] matching ((((Matching unit) belongs to an enemy of (Owner of DashCaster[DashInteger[2]])) Equal to True) and (((Matching unit) is in DashGroup2) Equal to False)))
Unit Group - Pick every unit in DashGroup1 and do (Actions)
Loop - Actions
Unit Group - Add (Picked unit) to DashGroup2
Unit - Cause DashCaster[DashInteger[2]] to damage (Picked unit), dealing DashDamage[DashInteger[2]] damage of attack type Spells and damage type Normal
-------- ----------------------------------------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
DashDistance[DashInteger[2]] Less than or equal to 0
(Terrain pathing at DashPoint3[DashInteger[2]] of type Walkability is off) Equal to True
Then - Actions
For each (Integer DashInteger[2]) from 1 to DashInteger[1], do (Actions)
Loop - Actions
-------- ----------------------------------------------------- --------
Unit - Turn collision for DashCaster[DashInteger[2]] On
Unit - Unpause DashCaster[DashInteger[2]]
-------- ----------------------------------------------------- --------
-------- ----------------------------------------------------- --------
Set DashInteger[1] = 0
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DashInteger[0] Equal to 0
Then - Actions
-------- ----------------------------------------------------- --------
Set DashInteger[1] = 0
-------- ----------------------------------------------------- --------
Trigger - Turn off (This trigger)
Else - Actions
Else - Actions
-------- ----------------------------------------------------- --------
Custom script: call RemoveLocation (udg_DashPoint3[udg_DashInteger[2]])
Custom script: call RemoveLocation (udg_DashPoint4[udg_DashInteger[2]])
Custom script: call DestroyGroup (udg_DashGroup1)
-------- ----------------------------------------------------- --------
[/trigger]
This one from bellow idk if is a leak but i think is better with this trigger.
[trigger=Unit Leak Remove]
Events
Unit - A unit Dies
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Dying unit)) Equal to Dash Dummy
Then - Actions
Unit - Remove (Dying unit) from the game
Else - Actions
[/trigger]