|
function FearSwardLoop takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit ut = GetHandleUnit(t,"FearSward_ut")
local real Ang = GetHandleReal(t,"FearSward_ang")
local integer j = GetHandleInt(t,"FearSward_j")
if (GetUnitAbilityLevel(ut,'BNht')==1 ) then
set j = j + 1
if ( j>=24)then
set j = 1
set Ang = Ang + GetRandomReal(-180,180)
call SetHandleReal(t,"FearSward_ang",Ang)
endif
call SetHandleInt(t,"FearSward_j",j)
call SetHandleReal(t,"FearSward_ang",Ang)
call IssuePointOrder(ut,"move",GetUnitX(ut)+300*Cos(Ang*bj_DEGTORAD),GetUnitY(ut)+300*Sin(Ang*bj_DEGTORAD))
else
call BJDebugMsg("恐惧效果结束")
call EndTimer(t)
endif
set ut = null
set t = null
endfunction
function FearSward takes unit ut returns nothing
local timer t = CreateTimer()
call SetHandleHandle(t,"FearSward_ut",ut)
call SetHandleReal(t,"FearSward_ang",GetUnitFacing(ut))
call SetHandleInt(t,"FearSward_j",1)
call TimerStart(t,0.12,true,function FearSwardLoop )
set t = null
endfunction
为什么一使用就结束? |
|