- Joined
- Oct 6, 2022
- Messages
- 213
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Well I do not know if it was dash in the first place or maybe i could also call it "move" or moving triangle shape, but so maybe I just thought that i could call it triangle dash was like that, sorry for the late replyWhy do you want to make a dash spell that returns to its original position?
Thats fine, it wasnt late. I wanted to make sure that there werent additional requirements to the spell. I spent a lot of time to create a dash/charge spell system using techniques I have seen used before and with a lot of configurability from trying to configure other systems myself. Its a very common approach that uses dynamic indexing. Tell me if it works for you or if you have any questions.Well I do not know if it was dash in the first place or maybe i could also call it "move" or moving triangle shape, but so maybe I just thought that i could call it triangle dash was like that, sorry for the late reply
Triangle Dash Start 1

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Fan of Knives

Actions


Set VariableSet DashMax = (DashMax + 1)


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



If - Conditions




DashMax Equal to 1



Then - Actions




Trigger - Turn on Dash Periodic <gen>



Else - Actions


Set VariableSet DashUnit[DashMax] = (Triggering unit)


-------- Sets the amount of dashes --------


Set VariableSet DashAmount[DashMax] = 3


-------- Sets the distance of each dash --------


Set VariableSet DashDistance[DashMax] = 256.00


-------- Sets the distance traveled each period of 0.03 seconds. Needs to be dividable with DashDistance to a full integer --------


Set VariableSet DashSpeed[DashMax] = (DashDistance[DashMax] / 8.00)


-------- Saves the original angle of the casting unit --------


Set VariableSet DashAngleOriginal[DashMax] = (Facing of DashUnit[DashMax])


-------- Decides wether or not the original angle should be restored after the spell is finished --------


Set VariableSet DashAngleOriginalBool[DashMax] = True


-------- Sets the first angle --------


Set VariableSet DashAngle[DashMax] = (DashAngleOriginal[DashMax] + 30.00)


-------- Sets the changle in degrees for the next dashes if DashAmount is greater than 1. The angle is reduced by this amount --------


Set VariableSet DashAngleChange[DashMax] = 120.00


Unit - Make DashUnit[DashMax] face DashAngle[DashMax]


Animation - Play DashUnit[DashMax]'s attack animation


-------- Sets the animation the unit plays --------


Set VariableSet DashAnimationString[DashMax] = attack


-------- Sets the effect that continually occurs during the spell --------


Set VariableSet DashEffectString[DashMax] = Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl


-------- Sets how often the effect occurs --------


Set VariableSet DashEffectInterval[DashMax] = 2


-------- Sets if the effect occurs on the units position or on the unit itself --------


Set VariableSet DashEffectPointBool[DashMax] = True


-------- Configurable option to allow a customizable event to occur during each period or at the end of each dash --------


Set VariableSet DashType[DashMax] = 1


-------- Creates an effect on the unit that is destroyed when the spell is finished --------


Special Effect - Create a special effect attached to the chest of DashUnit[DashMax] using <Empty String>


Set VariableSet DashUnitEffect[DashMax] = (Last created special effect)


Unit Group - Add DashUnit[DashMax] to DashGroup


Countdown Timer - Start DashTimer as a One-shot timer that will expire in 0.00 seconds
Triangle Dash Start 2

Events


Time - DashTimer expires

Conditions

Actions


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



Loop - Actions




Custom script: call BlzPauseUnitEx(GetEnumUnit(), true)




Unit Group - Remove (Picked unit) from DashGroup.
Dash Periodic

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


For each (Integer DashIndex) from 1 to DashMax, do (Actions)



Loop - Actions




Set VariableSet TempPoint[0] = (Position of DashUnit[DashIndex])




Set VariableSet TempPoint[1] = (TempPoint[0] offset by DashSpeed[DashIndex] towards DashAngle[DashIndex] degrees.)




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





If - Conditions






(Random integer number between 1 and DashEffectInterval[DashIndex]) Equal to 1





Then - Actions






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







If - Conditions








DashEffectPointBool[DashIndex] Equal to True







Then - Actions








Special Effect - Create a special effect at TempPoint[1] using DashEffectString[DashIndex]







Else - Actions








Special Effect - Create a special effect attached to the origin of DashUnit[DashIndex] using DashEffectString[DashIndex]






Special Effect - Destroy (Last created special effect)





Else - Actions




Set VariableSet DashX = (X of TempPoint[1])




Set VariableSet DashY = (Y of TempPoint[1])




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





If - Conditions






DashType[DashIndex] Equal to 1





Then - Actions





Else - Actions




Custom script: call SetUnitX(udg_DashUnit[udg_DashIndex], udg_DashX)




Custom script: call SetUnitY(udg_DashUnit[udg_DashIndex], udg_DashY)




Custom script: call RemoveLocation(udg_TempPoint[0])




Custom script: call RemoveLocation(udg_TempPoint[1])




Set VariableSet DashDistanceProgress[DashIndex] = (DashDistanceProgress[DashIndex] + DashSpeed[DashIndex])




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





If - Conditions






DashDistanceProgress[DashIndex] Greater than or equal to DashDistance[DashIndex]





Then - Actions






Set VariableSet DashDistanceProgress[DashIndex] = 0.00






Set VariableSet DashAngle[DashIndex] = (DashAngle[DashIndex] - DashAngleChange[DashIndex])






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







If - Conditions








DashType[DashIndex] Equal to 1







Then - Actions







Else - Actions






Set VariableSet DashAmount[DashIndex] = (DashAmount[DashIndex] - 1)






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







If - Conditions








DashAmount[DashIndex] Equal to 0







Then - Actions








Custom script: call BlzPauseUnitEx(udg_DashUnit[udg_DashIndex], false)








Animation - Queue DashUnit[DashIndex]'s stand animation








Special Effect - Destroy DashUnitEffect[DashIndex]








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









If - Conditions










DashAngleOriginalBool[DashIndex] Equal to True









Then - Actions










Unit - Make DashUnit[DashIndex] face DashAngleOriginal[DashIndex]









Else - Actions








Set VariableSet DashAmount[DashIndex] = DashAmount[DashMax]








Set VariableSet DashAngle[DashIndex] = DashAngle[DashMax]








Set VariableSet DashAngleChange[DashIndex] = DashAngleChange[DashMax]








Set VariableSet DashAngleOriginal[DashIndex] = DashAngleOriginal[DashMax]








Set VariableSet DashAngleOriginalBool[DashIndex] = DashAngleOriginalBool[DashMax]








Set VariableSet DashDistance[DashIndex] = DashDistance[DashMax]








Set VariableSet DashDistanceProgress[DashIndex] = DashDistanceProgress[DashMax]








Set VariableSet DashSpeed[DashIndex] = DashSpeed[DashMax]








Set VariableSet DashUnit[DashIndex] = DashUnit[DashMax]








Set VariableSet DashUnitEffect[DashIndex] = DashUnitEffect[DashMax]








Set VariableSet DashAnimationString[DashIndex] = DashAnimationString[DashMax]








Set VariableSet DashEffectString[DashIndex] = DashEffectString[DashMax]








Set VariableSet DashEffectInterval[DashIndex] = DashEffectInterval[DashMax]








Set VariableSet DashEffectPointBool[DashIndex] = DashEffectPointBool[DashMax]








Set VariableSet DashType[DashIndex] = DashType[DashMax]








Set VariableSet DashMax = (DashMax - 1)








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









If - Conditions










DashMax Equal to 0









Then - Actions










Trigger - Turn off Dash Periodic <gen>









Else - Actions







Else - Actions








Unit - Make DashUnit[DashIndex] face DashAngle[DashIndex]





Else - Actions
Thanks, I'll use this as my other method if ever the caseThats fine, it wasnt late. I wanted to make sure that there werent additional requirements to the spell. I spent a lot of time to create a dash/charge spell system using techniques I have seen used before and with a lot of configurability from trying to configure other systems myself. Its a very common approach that uses dynamic indexing. Tell me if it works for you or if you have any questions.
Triangle Dash Start 1
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Fan of Knives
Actions
Set VariableSet DashMax = (DashMax + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DashMax Equal to 1
Then - Actions
Trigger - Turn on Dash Periodic <gen>
Else - Actions
Set VariableSet DashUnit[DashMax] = (Triggering unit)
-------- Sets the amount of dashes --------
Set VariableSet DashAmount[DashMax] = 3
-------- Sets the distance of each dash --------
Set VariableSet DashDistance[DashMax] = 256.00
-------- Sets the distance traveled each period of 0.03 seconds. Needs to be dividable with DashDistance to a full integer --------
Set VariableSet DashSpeed[DashMax] = (DashDistance[DashMax] / 8.00)
-------- Saves the original angle of the casting unit --------
Set VariableSet DashAngleOriginal[DashMax] = (Facing of DashUnit[DashMax])
-------- Decides wether or not the original angle should be restored after the spell is finished --------
Set VariableSet DashAngleOriginalBool[DashMax] = True
-------- Sets the first angle --------
Set VariableSet DashAngle[DashMax] = (DashAngleOriginal[DashMax] + 30.00)
-------- Sets the changle in degrees for the next dashes if DashAmount is greater than 1. The angle is reduced by this amount --------
Set VariableSet DashAngleChange[DashMax] = 120.00
Unit - Make DashUnit[DashMax] face DashAngle[DashMax]
Animation - Play DashUnit[DashMax]'s attack animation
-------- Sets the animation the unit plays --------
Set VariableSet DashAnimationString[DashMax] = attack
-------- Sets the effect that continually occurs during the spell --------
Set VariableSet DashEffectString[DashMax] = Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl
-------- Sets how often the effect occurs --------
Set VariableSet DashEffectInterval[DashMax] = 2
-------- Sets if the effect occurs on the units position or on the unit itself --------
Set VariableSet DashEffectPointBool[DashMax] = True
-------- Configurable option to allow a customizable event to occur during each period or at the end of each dash --------
Set VariableSet DashType[DashMax] = 1
-------- Creates an effect on the unit that is destroyed when the spell is finished --------
Special Effect - Create a special effect attached to the chest of DashUnit[DashMax] using <Empty String>
Set VariableSet DashUnitEffect[DashMax] = (Last created special effect)
Unit Group - Add DashUnit[DashMax] to DashGroup
Countdown Timer - Start DashTimer as a One-shot timer that will expire in 0.00 seconds
Triangle Dash Start 2
Events
Time - DashTimer expires
Conditions
Actions
Unit Group - Pick every unit in DashGroup and do (Actions)
Loop - Actions
Custom script: call BlzPauseUnitEx(GetEnumUnit(), true)
Unit Group - Remove (Picked unit) from DashGroup.
EDIT: I forgot to add any check for pathing but it shouldnt matter for the Triangle Dash spell at least...
Dash Periodic
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
For each (Integer DashIndex) from 1 to DashMax, do (Actions)
Loop - Actions
Set VariableSet TempPoint[0] = (Position of DashUnit[DashIndex])
Set VariableSet TempPoint[1] = (TempPoint[0] offset by DashSpeed[DashIndex] towards DashAngle[DashIndex] degrees.)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and DashEffectInterval[DashIndex]) Equal to 1
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DashEffectPointBool[DashIndex] Equal to True
Then - Actions
Special Effect - Create a special effect at TempPoint[1] using DashEffectString[DashIndex]
Else - Actions
Special Effect - Create a special effect attached to the origin of DashUnit[DashIndex] using DashEffectString[DashIndex]
Special Effect - Destroy (Last created special effect)
Else - Actions
Set VariableSet DashX = (X of TempPoint[1])
Set VariableSet DashY = (Y of TempPoint[1])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DashType[DashIndex] Equal to 1
Then - Actions
Else - Actions
Custom script: call SetUnitX(udg_DashUnit[udg_DashIndex], udg_DashX)
Custom script: call SetUnitY(udg_DashUnit[udg_DashIndex], udg_DashY)
Custom script: call RemoveLocation(udg_TempPoint[0])
Custom script: call RemoveLocation(udg_TempPoint[1])
Set VariableSet DashDistanceProgress[DashIndex] = (DashDistanceProgress[DashIndex] + DashSpeed[DashIndex])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DashDistanceProgress[DashIndex] Greater than or equal to DashDistance[DashIndex]
Then - Actions
Set VariableSet DashDistanceProgress[DashIndex] = 0.00
Set VariableSet DashAngle[DashIndex] = (DashAngle[DashIndex] - DashAngleChange[DashIndex])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DashType[DashIndex] Equal to 1
Then - Actions
Else - Actions
Set VariableSet DashAmount[DashIndex] = (DashAmount[DashIndex] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DashAmount[DashIndex] Equal to 0
Then - Actions
Custom script: call BlzPauseUnitEx(udg_DashUnit[udg_DashIndex], false)
Animation - Queue DashUnit[DashIndex]'s stand animation
Special Effect - Destroy DashUnitEffect[DashIndex]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DashAngleOriginalBool[DashIndex] Equal to True
Then - Actions
Unit - Make DashUnit[DashIndex] face DashAngleOriginal[DashIndex]
Else - Actions
Set VariableSet DashAmount[DashIndex] = DashAmount[DashMax]
Set VariableSet DashAngle[DashIndex] = DashAngle[DashMax]
Set VariableSet DashAngleChange[DashIndex] = DashAngleChange[DashMax]
Set VariableSet DashAngleOriginal[DashIndex] = DashAngleOriginal[DashMax]
Set VariableSet DashAngleOriginalBool[DashIndex] = DashAngleOriginalBool[DashMax]
Set VariableSet DashDistance[DashIndex] = DashDistance[DashMax]
Set VariableSet DashDistanceProgress[DashIndex] = DashDistanceProgress[DashMax]
Set VariableSet DashSpeed[DashIndex] = DashSpeed[DashMax]
Set VariableSet DashUnit[DashIndex] = DashUnit[DashMax]
Set VariableSet DashUnitEffect[DashIndex] = DashUnitEffect[DashMax]
Set VariableSet DashAnimationString[DashIndex] = DashAnimationString[DashMax]
Set VariableSet DashEffectString[DashIndex] = DashEffectString[DashMax]
Set VariableSet DashEffectInterval[DashIndex] = DashEffectInterval[DashMax]
Set VariableSet DashEffectPointBool[DashIndex] = DashEffectPointBool[DashMax]
Set VariableSet DashType[DashIndex] = DashType[DashMax]
Set VariableSet DashMax = (DashMax - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DashMax Equal to 0
Then - Actions
Trigger - Turn off Dash Periodic <gen>
Else - Actions
Else - Actions
Unit - Make DashUnit[DashIndex] face DashAngle[DashIndex]
Else - Actions
Facing angle - 45 degrees with an offset of 200 = first point
Facing angle + 45 degrees with an offset of 200 = second point
third point = the starting position of the unit.
Tri Dash Cast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Tri Dash

Actions


Set VariableSet Tri_Unit = (Triggering unit)


Set VariableSet Tri_CV = (Custom value of Tri_Unit)


Set VariableSet Tri_Level = (Level of (Ability being cast) for Tri_Unit)


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


-------- [ ================== CUSTOMIZE ================== ] --------


-------- The Loop trigger runs every 0.02 seconds so keep that in mind when defining the Speed: --------


Set VariableSet Tri_Speed[Tri_CV] = 35.00


Set VariableSet Tri_Max_Distance[Tri_CV] = 490.00


-------- [ ===================== STOP ===================== ] --------


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


Set VariableSet Tri_Angle[0] = (Facing of Tri_Unit)


Set VariableSet Tri_Point1[Tri_CV] = (Position of Tri_Unit)


Set VariableSet Tri_Point2[Tri_CV] = (Tri_Point1[Tri_CV] offset by Tri_Max_Distance[Tri_CV] towards (Tri_Angle[0] - 30.00) degrees.)


Set VariableSet Tri_Point3[Tri_CV] = (Tri_Point1[Tri_CV] offset by Tri_Max_Distance[Tri_CV] towards (Tri_Angle[0] + 30.00) degrees.)


Set VariableSet Tri_Angle[Tri_CV] = (Tri_Angle[0] - 30.00)


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


Set VariableSet Tri_Current_Destination[Tri_CV] = 1


Set VariableSet Tri_Current_Distance[Tri_CV] = 0.00


Set VariableSet Tri_Max_Distance[Tri_CV] = (Tri_Max_Distance[Tri_CV] - 0.01)


Set VariableSet Tri_Is_Playing_Animation[Tri_CV] = False


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


Special Effect - Create a special effect at Tri_Point1[Tri_CV] using Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl


Set VariableSet Tri_Sfx[Tri_CV] = (Last created special effect)


Special Effect - Set Yaw of Tri_Sfx[Tri_CV] to: (Radians(Tri_Angle[Tri_CV]))


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


Unit - Turn collision for Tri_Unit Off.


Custom script: call BlzPauseUnitEx(udg_Tri_Unit, true)


Unit - Make Tri_Unit face Tri_Angle[Tri_CV]


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


Unit Group - Add Tri_Unit to Tri_Unit_Group


Trigger - Turn on Tri Dash Loop <gen>
Tri Dash Loop

Events


Time - Every 0.02 seconds of game time

Conditions

Actions


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



Loop - Actions




Set VariableSet Tri_Unit = (Picked unit)




Set VariableSet Tri_CV = (Custom value of Tri_Unit)




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




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





If - Conditions






(Tri_Unit is alive) Equal to True





Then - Actions






Set VariableSet Tri_Current_Distance[Tri_CV] = (Tri_Current_Distance[Tri_CV] + Tri_Speed[Tri_CV])






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






-------- Determine what to do next based on the Point that the unit is currently on: --------






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







If - Conditions








Tri_Current_Destination[Tri_CV] Equal to 1







Then - Actions








-------- We need to delay the animation by at least 1 frame: --------








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









If - Conditions










Tri_Is_Playing_Animation[Tri_CV] Equal to False









Then - Actions










Set VariableSet Tri_Is_Playing_Animation[Tri_CV] = True










Custom script: call SetUnitAnimationByIndex(udg_Tri_Unit, 6)









Else - Actions








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








Set VariableSet Tri_Point1[0] = (Tri_Point1[Tri_CV] offset by Tri_Current_Distance[Tri_CV] towards Tri_Angle[Tri_CV] degrees.)








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









If - Conditions










Tri_Current_Distance[Tri_CV] Greater than or equal to Tri_Max_Distance[Tri_CV]









Then - Actions










Set VariableSet Tri_Current_Distance[Tri_CV] = 0.00










Set VariableSet Tri_Current_Destination[Tri_CV] = (Tri_Current_Destination[Tri_CV] + 1)










Set VariableSet Tri_Angle[Tri_CV] = (Angle from Tri_Point2[Tri_CV] to Tri_Point3[Tri_CV])










Unit - Make Tri_Unit face Tri_Angle[Tri_CV]










Special Effect - Set Yaw of Tri_Sfx[Tri_CV] to: (Radians(Tri_Angle[Tri_CV]))









Else - Actions







Else - Actions








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









If - Conditions










Tri_Current_Destination[Tri_CV] Equal to 2









Then - Actions










Set VariableSet Tri_Point1[0] = (Tri_Point2[Tri_CV] offset by Tri_Current_Distance[Tri_CV] towards Tri_Angle[Tri_CV] degrees.)










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











If - Conditions












Tri_Current_Distance[Tri_CV] Greater than or equal to Tri_Max_Distance[Tri_CV]











Then - Actions












Set VariableSet Tri_Current_Distance[Tri_CV] = 0.00












Set VariableSet Tri_Current_Destination[Tri_CV] = (Tri_Current_Destination[Tri_CV] + 1)












Set VariableSet Tri_Angle[Tri_CV] = (Angle from Tri_Point3[Tri_CV] to Tri_Point1[Tri_CV])












Unit - Make Tri_Unit face Tri_Angle[Tri_CV]












Special Effect - Set Yaw of Tri_Sfx[Tri_CV] to: (Radians(Tri_Angle[Tri_CV]))











Else - Actions









Else - Actions










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











If - Conditions












Tri_Current_Destination[Tri_CV] Equal to 3











Then - Actions












Set VariableSet Tri_Point1[0] = (Tri_Point3[Tri_CV] offset by Tri_Current_Distance[Tri_CV] towards Tri_Angle[Tri_CV] degrees.)












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













If - Conditions














Tri_Current_Distance[Tri_CV] Greater than or equal to Tri_Max_Distance[Tri_CV]













Then - Actions














Animation - Reset Tri_Unit's animation














Trigger - Run Tri Dash End <gen> (ignoring conditions)













Else - Actions











Else - Actions






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






Unit - Move Tri_Unit instantly to Tri_Point1[0]






Special Effect - Set Position of Tri_Sfx[Tri_CV] to Tri_Point1[0]






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






Custom script: call RemoveLocation(udg_Tri_Point1[0])





Else - Actions






-------- The unit is dead: --------






Trigger - Run Tri Dash End <gen> (ignoring conditions)
Tri Dash End

Events

Conditions

Actions


Special Effect - Destroy Tri_Sfx[Tri_CV]


Unit - Turn collision for Tri_Unit On.


Custom script: call BlzPauseUnitEx(udg_Tri_Unit, false)


Custom script: call RemoveLocation(udg_Tri_Point1[udg_Tri_CV])


Custom script: call RemoveLocation(udg_Tri_Point2[udg_Tri_CV])


Custom script: call RemoveLocation(udg_Tri_Point3[udg_Tri_CV])


Unit Group - Remove Tri_Unit from Tri_Unit_Group.


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



If - Conditions




(Number of units in Tri_Unit_Group) Equal to 0



Then - Actions




Trigger - Turn off Tri Dash Loop <gen>



Else - Actions
Tri Dash Cast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Tri Dash

Actions


Set VariableSet Tri_Unit = (Triggering unit)


Set VariableSet Tri_CV = (Custom value of Tri_Unit)


Set VariableSet Tri_Level = (Level of (Ability being cast) for Tri_Unit)


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


-------- [ ================== CUSTOMIZE ================== ] --------


-------- Movement: --------


Set VariableSet Tri_Speed[Tri_CV] = 35.00


Set VariableSet Tri_Max_Distance[Tri_CV] = 490.00


-------- [ ===================== STOP ===================== ] --------


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


Set VariableSet Tri_Angle[0] = (Facing of Tri_Unit)


Set VariableSet Tri_Point1[Tri_CV] = (Position of Tri_Unit)


Set VariableSet Tri_Point2[Tri_CV] = (Tri_Point1[Tri_CV] offset by Tri_Max_Distance[Tri_CV] towards (Tri_Angle[0] - 30.00) degrees.)


Set VariableSet Tri_Point3[Tri_CV] = (Tri_Point1[Tri_CV] offset by Tri_Max_Distance[Tri_CV] towards (Tri_Angle[0] + 30.00) degrees.)


Set VariableSet Tri_Angle[Tri_CV] = (Tri_Angle[0] - 30.00)


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


-------- [ ================== CUSTOMIZE ================== ] --------


-------- Damage: --------


Set VariableSet Tri_Damage_Point[Tri_CV] = (Tri_Point1[Tri_CV] offset by (Tri_Max_Distance[Tri_CV] / 2.00) towards Tri_Angle[0] degrees.)


Set VariableSet Tri_Damage_Radius[Tri_CV] = (Tri_Max_Distance[Tri_CV] / 2.00)


Set VariableSet Tri_Damage_Amount[Tri_CV] = (15.00 x (Real(Tri_Level)))


Set VariableSet Tri_Damage_Max_Delay[Tri_CV] = 7


Set VariableSet Tri_Damage_Current_Delay[Tri_CV] = Tri_Damage_Max_Delay[Tri_CV]


-------- [ ===================== STOP ===================== ] --------


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


Set VariableSet Tri_Current_Destination[Tri_CV] = 1


Set VariableSet Tri_Current_Distance[Tri_CV] = 0.00


Set VariableSet Tri_Max_Distance[Tri_CV] = (Tri_Max_Distance[Tri_CV] - 0.01)


Set VariableSet Tri_Is_Playing_Animation[Tri_CV] = False


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


Special Effect - Create a special effect at Tri_Point1[Tri_CV] using Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl


Set VariableSet Tri_Sfx[Tri_CV] = (Last created special effect)


Special Effect - Set Yaw of Tri_Sfx[Tri_CV] to: (Radians(Tri_Angle[Tri_CV]))


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


Unit - Turn collision for Tri_Unit Off.


Custom script: call BlzPauseUnitEx(udg_Tri_Unit, true)


Unit - Make Tri_Unit face Tri_Angle[Tri_CV]


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


Unit Group - Add Tri_Unit to Tri_Unit_Group


Trigger - Turn on Tri Dash Loop <gen>
Tri Dash Loop

Events


Time - Every 0.02 seconds of game time

Conditions

Actions


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



Loop - Actions




Set VariableSet Tri_Unit = (Picked unit)




Set VariableSet Tri_CV = (Custom value of Tri_Unit)




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




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





If - Conditions






(Tri_Unit is alive) Equal to True





Then - Actions






Set VariableSet Tri_Current_Distance[Tri_CV] = (Tri_Current_Distance[Tri_CV] + Tri_Speed[Tri_CV])






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






-------- Determine what to do next based on the Point that the unit is currently on: --------






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







If - Conditions








Tri_Current_Destination[Tri_CV] Equal to 1







Then - Actions








-------- We need to delay the animation by at least 1 frame: --------








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









If - Conditions










Tri_Is_Playing_Animation[Tri_CV] Equal to False









Then - Actions










Set VariableSet Tri_Is_Playing_Animation[Tri_CV] = True










Custom script: call SetUnitAnimationByIndex(udg_Tri_Unit, 6)









Else - Actions








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








Set VariableSet Tri_Point1[0] = (Tri_Point1[Tri_CV] offset by Tri_Current_Distance[Tri_CV] towards Tri_Angle[Tri_CV] degrees.)








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









If - Conditions










Tri_Current_Distance[Tri_CV] Greater than or equal to Tri_Max_Distance[Tri_CV]









Then - Actions










Set VariableSet Tri_Current_Distance[Tri_CV] = 0.00










Set VariableSet Tri_Current_Destination[Tri_CV] = (Tri_Current_Destination[Tri_CV] + 1)










Set VariableSet Tri_Angle[Tri_CV] = (Angle from Tri_Point2[Tri_CV] to Tri_Point3[Tri_CV])










Unit - Make Tri_Unit face Tri_Angle[Tri_CV]










Special Effect - Set Yaw of Tri_Sfx[Tri_CV] to: (Radians(Tri_Angle[Tri_CV]))









Else - Actions







Else - Actions








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









If - Conditions










Tri_Current_Destination[Tri_CV] Equal to 2









Then - Actions










Set VariableSet Tri_Point1[0] = (Tri_Point2[Tri_CV] offset by Tri_Current_Distance[Tri_CV] towards Tri_Angle[Tri_CV] degrees.)










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











If - Conditions












Tri_Current_Distance[Tri_CV] Greater than or equal to Tri_Max_Distance[Tri_CV]











Then - Actions












Set VariableSet Tri_Current_Distance[Tri_CV] = 0.00












Set VariableSet Tri_Current_Destination[Tri_CV] = (Tri_Current_Destination[Tri_CV] + 1)












Set VariableSet Tri_Angle[Tri_CV] = (Angle from Tri_Point3[Tri_CV] to Tri_Point1[Tri_CV])












Unit - Make Tri_Unit face Tri_Angle[Tri_CV]












Special Effect - Set Yaw of Tri_Sfx[Tri_CV] to: (Radians(Tri_Angle[Tri_CV]))











Else - Actions









Else - Actions










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











If - Conditions












Tri_Current_Destination[Tri_CV] Equal to 3











Then - Actions












Set VariableSet Tri_Point1[0] = (Tri_Point3[Tri_CV] offset by Tri_Current_Distance[Tri_CV] towards Tri_Angle[Tri_CV] degrees.)












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













If - Conditions














Tri_Current_Distance[Tri_CV] Greater than or equal to Tri_Max_Distance[Tri_CV]













Then - Actions














Animation - Reset Tri_Unit's animation














Trigger - Run Tri Dash End <gen> (ignoring conditions)













Else - Actions











Else - Actions






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






Unit - Move Tri_Unit instantly to Tri_Point1[0]






Special Effect - Set Position of Tri_Sfx[Tri_CV] to Tri_Point1[0]






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






-------- Damage: --------






Set VariableSet Tri_Damage_Current_Delay[Tri_CV] = (Tri_Damage_Current_Delay[Tri_CV] + 1)






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







If - Conditions








Tri_Damage_Current_Delay[Tri_CV] Greater than or equal to Tri_Damage_Max_Delay[Tri_CV]







Then - Actions








Set VariableSet Tri_Damage_Current_Delay[Tri_CV] = 0








Set VariableSet Tri_Damage_Group = (Units within Tri_Damage_Radius[Tri_CV] of Tri_Damage_Point[Tri_CV].)








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









Loop - Actions










Set VariableSet Tri_Target = (Picked unit)










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











If - Conditions












(Tri_Target belongs to an enemy of (Owner of Tri_Unit).) Equal to True












(Tri_Target is alive) Equal to True












(Tri_Target is A structure) Equal to False












(Tri_Target is invulnerable) Equal to False











Then - Actions












Special Effect - Create a special effect attached to the chest of Tri_Target using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl












Special Effect - Destroy (Last created special effect)












Unit - Cause Tri_Unit to damage Tri_Target, dealing Tri_Damage_Amount[Tri_CV] damage of attack type Spells and damage type Normal











Else - Actions








Custom script: call DestroyGroup(udg_Tri_Damage_Group)







Else - Actions






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






Custom script: call RemoveLocation(udg_Tri_Point1[0])





Else - Actions






-------- The unit is dead: --------






Trigger - Run Tri Dash End <gen> (ignoring conditions)
Tri Dash End

Events

Conditions

Actions


Special Effect - Destroy Tri_Sfx[Tri_CV]


Unit - Turn collision for Tri_Unit On.


Custom script: call BlzPauseUnitEx(udg_Tri_Unit, false)


Custom script: call RemoveLocation(udg_Tri_Point1[udg_Tri_CV])


Custom script: call RemoveLocation(udg_Tri_Point2[udg_Tri_CV])


Custom script: call RemoveLocation(udg_Tri_Point3[udg_Tri_CV])


Custom script: call RemoveLocation(udg_Tri_Damage_Point[udg_Tri_CV])


Unit Group - Remove Tri_Unit from Tri_Unit_Group.


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



If - Conditions




(Number of units in Tri_Unit_Group) Equal to 0



Then - Actions




Trigger - Turn off Tri Dash Loop <gen>



Else - Actions
Custom script: Custom script: call BlzPauseUnitEx(GetEnumUnit(), true)
Custom script: call BlzPauseUnitEx(GetEnumUnit(), true)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions

DashMax Equal to 0
Then - Actions

Trigger - Turn off Dash Periodic <gen>
