


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



-------- Set the timeout to be used throughout the system --------



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



Set K2DTimeout = 0.03



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



-------- Create dummy casters to check pathing throughout the game --------



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



Set CenterPoint = (Point(TempX, TempY))



Set UnitIndexerEnabled = False



Unit - Create 1 Dummy (Vexorian, Anitarf, Infrane) for Neutral Passive at CenterPoint facing 0.00 degrees



Set K2DCaster = (Last created unit)



Unit - Create 1 Dummy (Vexorian, Anitarf, Infrane) for Neutral Passive at CenterPoint facing 0.00 degrees



Set K2DClearer = (Last created unit)



Set UnitIndexerEnabled = True



Custom script: call RemoveLocation(udg_CenterPoint)



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



-------- Add a custom "Inferno" to it to check for pathing --------



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



Set K2DPathAbil = Pathing Checker



Unit - Add K2DPathAbil to K2DCaster



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



-------- Add a custom "flame strike" to destroy debris / trees in the area --------



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



Set K2DDebrisAbil = Debris Killer



Unit - Add K2DDebrisAbil to K2DClearer



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



Custom script: call ExecuteFunc("InitKnockback2D")



Custom script: endfunction



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



-------- This function destroys any knockback, you can call it yourself via ExecuteFunc("DestroyKnockback2D") --------



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



Custom script: function DestroyKnockback2D takes nothing returns nothing



Custom script: endfunction



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



-------- In case a unit is being knocked back while deindexed (very rare), destroy the knockback --------



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



Custom script: function DestroyKnockback2DProxy takes nothing returns boolean



Custom script: endfunction



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



-------- Set the sine and cosine to a new angle --------



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



Custom script: function Knockback2DApplyAngle takes nothing returns nothing



Custom script: endfunction



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



-------- Check if a point is pathable --------



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



Custom script: function Knockback2DCheckXY takes real x, real y returns boolean



Custom script: endfunction



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



-------- This function is run each time you execute this trigger --------



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



Custom script: function Knockback2DSetup takes nothing returns nothing



Custom script: endfunction



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



-------- This function is run periodically to update the movement of units --------



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



Custom script: function Knockback2DLooper takes nothing returns nothing



Custom script: endfunction



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



-------- Initialize it all --------



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



Custom script: function InitKnockback2D takes nothing returns nothing




Custom script: local trigger t = GetTriggeringTrigger()




Custom script: call TriggerClearActions(t)




Custom script: call TriggerRegisterVariableEvent(t, "udg_UnitIndexEvent", EQUAL, 2)




Custom script: call TriggerAddCondition(t, Filter(function DestroyKnockback2DProxy))




Custom script: call TriggerAddAction(t, function Knockback2DSetup)




Custom script: set t = null




Custom script: call UnitRemoveAbility(udg_K2DCaster, 'Amov')




Custom script: call UnitRemoveAbility(udg_K2DClearer, 'Amov')




Custom script: call TimerStart(udg_K2DTimer, udg_K2DTimeout, false, function Knockback2DLooper)




Countdown Timer - Pause K2DTimer