|
楼主 |
发表于 2010-7-26 19:25:55
|
显示全部楼层
继续问,这方法好像有个弊端..
假如恢复为不为0时以上的值.如果去掉了移动技能就再也无法加回来.
不过好像听说过用ShiftMoveSpeed(u,-XX.0)方法,不过试过了不起作用.
function FuelSystemConditions takes nothing returns boolean
local integer i = GetUnitTypeId(GetTriggerUnit())
return i=='H00J'
endfunction
function FuelSystem takes nothing returns nothing
local unit u = GetTriggerUnit()
local real fuel = GetUnitState(u,UNIT_STATE_MANA)
if fuel<0.5 then
call IssueImmediateOrder(u,"stop")
call ShiftMoveSpeed(u,-522.0)
endif
call SetUnitState(u,UNIT_STATE_MANA,fuel)
endif
set u = null
endfunction
//===========================================================================
function InitTrig_FuelSystem takes nothing returns nothing
set gg_trg_FuelSystem = CreateTrigger()
call TriggerAddCondition( gg_trg_FuelSystem, Condition( function FuelSystemConditions ) )
call TriggerAddAction( gg_trg_FuelSystem, function FuelSystem )
endfunction |
|