Code
function SH_Filter takes nothing returns boolean
local unit u = GetFilterUnit()
local real a = GetUnitFacing(u)
local real x = GetUnitX(u)+80.*Cos(a*.0174532)
local real y = GetUnitY(u)+80.*Sin(a*.0174532)
local location l = Location(x,y)
local location l2 = GetUnitLoc(u)
local real z = GetLocationZ(l)
local real z2 = GetLocationZ(l2)
local real z3Rb = z - z2
local real dms = GetUnitDefaultMoveSpeed(u)
if IsUnitType(u,UNIT_TYPE_GROUND) or IsUnitType(u, UNIT_TYPE_HERO) then
if z3Rb > 30. and z3Rb < 69. then
call SetUnitMoveSpeed(u,dms*.3)
endif
if z3Rb > 70. and z3Rb < 179. then
call SetUnitMoveSpeed(u,dms*.1)
endif
if z3Rb > 180. and z3Rb < 999. then
call SetUnitMoveSpeed(u,0.)
endif
if z3Rb >= -15. and z3Rb <= 15. then
call SetUnitMoveSpeed(u,dms)
endif
if z3Rb < -30. and z3Rb > -69. then
call SetUnitMoveSpeed(u,dms*1.5)
endif
if z3Rb < -80. and z3Rb > -999. then
call SetUnitMoveSpeed(u,dms*2.)
endif
endif
call RemoveLocation(l)
call RemoveLocation(l2)
return false
endfunction
function SH_Ac takes nothing returns nothing
local group g = CreateGroup()
call GroupEnumUnitsInRect(g,GetWorldBounds(),Filter(function SH_Filter))
call DestroyGroup(g)
set g = null
endfunction
//=========================================================
function InitTrig_hill_System takes nothing returns nothing
set gg_trg_hill_System = CreateTrigger()
call TriggerRegisterTimerEvent(gg_trg_hill_System,.20,true)
call TriggerAddAction(gg_trg_hill_System,function SH_Ac)
endfunction
Вот он - нормальный безутечный код твоей системы.