function Trig_Unit_Move_Code_Enum takes nothing returns nothing
local unit u = GetEnumUnit()
call SetUnitPosition(u, GetUnitX(u)+50.0*Cos(GetUnitFacing(u)*0.01745), GetUnitY(u)+50.0*Sin(GetUnitFacing(u)*0.01745))
set u = null
endfunction
function Trig_Unit_Move_Code_Enum_Fast takes nothing returns nothing
local unit u = GetEnumUnit()
call SetUnitPosition(u, GetUnitX(u)+75.0*Cos(GetUnitFacing(u)*0.01745), GetUnitY(u)+75.0*Sin(GetUnitFacing(u)*0.01745))
set u = null
endfunction
function Trig_Unit_Move_Code_Enum_Slow takes nothing returns nothing
local unit u = GetEnumUnit()
call SetUnitPosition(u, GetUnitX(u)+15.0*Cos(GetUnitFacing(u)*0.01745), GetUnitY(u)+15.0*Sin(GetUnitFacing(u)*0.01745))
set u = null
endfunction
function Trig_Unit_Move_Code_Enum_Medium takes nothing returns nothing
local unit u = GetEnumUnit()
call SetUnitPosition(u, GetUnitX(u)+37.5*Cos(GetUnitFacing(u)*0.01745), GetUnitY(u)+37.5*Sin(GetUnitFacing(u)*0.01745))
set u = null
endfunction
function Trig_Unit_Move_Code_Actions takes nothing returns nothing
call ForGroup(udg_Move, function Trig_Unit_Move_Code_Enum)
call ForGroup(udg_MoveLaser, function Trig_Unit_Move_Code_Enum)
call ForGroup(udg_MoveFast, function Trig_Unit_Move_Code_Enum_Fast)
call ForGroup(udg_MoveSlow, function Trig_Unit_Move_Code_Enum_Slow)
call ForGroup(udg_MoveMedium, function Trig_Unit_Move_Code_Enum_Medium)
endfunction
//===========================================================================
function InitTrig_Unit_Move_Code takes nothing returns nothing
set gg_trg_Unit_Move_Code = CreateTrigger()
call TriggerAddAction(gg_trg_Unit_Move_Code, function Trig_Unit_Move_Code_Actions)
call TriggerRegisterTimerEvent(gg_trg_Unit_Move_Code, 0.05, true)
endfunction