把代码发上来把 可以参考下 (回光返照)
function BurrowTime_Spell takes nothing returns boolean
return GetLearnedSkill()=='A0NS'and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function BurrowTime_Main takes nothing returns nothing
local string lf5=H2Tx(GetTriggeringTrigger())
local boolean lrF=GetBoolean(lf5,"BTOn")
local boolean lrg=GetBoolean(lf5,"BTDuration")
if(lrg)then
//下面这句最关键
call DelayedDamageCheck(GetTriggerUnit(),GetEventDamage())
elseif(lrF==false and((GetTriggerEventId()==EVENT_UNIT_DAMAGED and GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)<400)or(GetTriggerEventId()==EVENT_UNIT_SPELL_EFFECT)))then
call UnitRemoveBuffsBJ(1,GetTriggerUnit())
if(GetTriggerEventId()==EVENT_UNIT_DAMAGED)then
call DisableTrigger(GetTriggeringTrigger())
call IssueImmediateOrderById(GetTriggerUnit(),OrderId("windwalk"))
call EnableTrigger(GetTriggeringTrigger())
endif
set lrF=true
set lrg=true
call SetBoolean(lf5,"BTOn",lrF)
call SetBoolean(lf5,"BTDuration",lrg)
call SetHandle(lf5,"BTFX",AddSpecialEffectTarget("Abilities\\\\Spells\\\\Undead\\\\Unsummon\\\\UnsummonTarget.mdl",GetTriggerUnit(),"origin"))
call ExecuteFunc("EndDuration"+I2S(2+GetUnitAbilityLevel(GetTriggerUnit(),'A0NS')))
call ExecuteFunc("BurrowTime_Off")
endif
endfunction
function BurrowTime_Event takes nothing returns boolean
if(GetTriggerEventId()==EVENT_UNIT_SPELL_EFFECT)then
if(GetSpellAbilityId()=='A0NS')then
return true
endif
endif
if(GetTriggerEventId()==EVENT_UNIT_DAMAGED)then
if GetEventDamage()>1 then
return true
endif
endif
return false
endfunction
function BurrowTime_Run takes nothing returns nothing
local trigger ltt
if(GetUnitAbilityLevel(GetTriggerUnit(),'A0NS')==1)then
set ltt=CreateTrigger()
call SetBoolean(H2Tx(ltt),"BTOn",false)
call TriggerRegisterUnitEvent(ltt,GetTriggerUnit(),EVENT_UNIT_DAMAGED)
call TriggerRegisterUnitEvent(ltt,GetTriggerUnit(),EVENT_UNIT_SPELL_EFFECT)
call TriggerAddAction(ltt,function BurrowTime_Main)
call TriggerAddCondition(ltt,Condition(function BurrowTime_Event))
endif
endfunction
function BurrowTime_Init takes nothing returns nothing
local trigger ltt=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(ltt,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(ltt,Condition(function BurrowTime_Spell))
call TriggerAddAction(ltt,function BurrowTime_Run)
endfunction
function InitTrig_Borrowed_Time takes nothing returns nothing
endfunction |