|
比如:
function AB_c takes nothing returns nothing
.....................
endfunction
function AB_b takes nothing returns boolean
if GetSpellAbilityId()=='AUan' then
call AB_c()
endif
return false
endfunction
function AB_a takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function AB_b))
set t=null
endfunction
和
function AB_c takes nothing returns nothing
.....................
endfunction
function AB_b takes nothing returns boolean
return GetSpellAbilityId()=='AUan'
endfunction
function AB_a takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function AB_b))
call TriggerAddAction(t,function AB_c)
set t=null
endfunction
哪种的效率更高呢?或者一样高? |
|