|
整个函数是用周期为0.01秒的计时器运行的,如果加上特殊效果的话就很容易弹错。如果特殊效果在创建的时候就删除的话就不会弹错。请教原因。。。
function fenxue takes nothing returns nothing//血量少于十分之一加敏捷
local timer tm=GetExpiredTimer()
local unit me=LUtm(tm,"me")
local integer level=GetUnitAbilityLevel(me,'A00H')
if GetUnitLifePercent(me)<10 and LItm(tm,"t")==0 then
call UnitAddAbility(me,'A003')
call SaveEffect(udg_HT,GetHadnleId(me),StringHash("ef"),AddSpecialEffectTarget( "war3mapImported\\BloodBanish.mdx" ,me,"origin"))
call SetUnitAbilityLevel(me,'A003',level)
call SItm(tm,"t",1)
endif
if GetUnitLifePercent(me)>10 or GetUnitLifePercent(me)==10 and LItm(tm,"t")==1 then
call DestroyEffect(LoadEffect(udg_HT,GetHadnleId(me),StringHash("ef")))
call FlushChildHashtable(xxxxx)
call UnitRemoveAbility(me,'A003')
call SItm(tm,"t",0)
endif
set tm=null
set me=null
endfunction |
|