|
发表于 2009-11-9 11:04:33
|
显示全部楼层
[jass]//触发条件
function Trig_stop_x3_1_Conditions takes nothing returns boolean
return GetIssuedOrderId()==String2OrderIdBJ("stop")
endfunction
//触发动作
function Trig_stop_x3_1_Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer i=GetUnitTypeId(u)
set udg_stop_x3=udg_stop_x3+1
if udg_stop_x3==3 then
if GetUnitAbilityLevel(u,'A004')<=0 and i=='Obla' then
call DisplayTextToPlayer(GetOwningPlayer(u),0,0,"杀敌数量为|cff00FFFF"+I2S(udg_ll_s)+"|r!")
endif
if GetUnitAbilityLevel(u,'A000')<=0 and i=='O000' then
call DisplayTextToPlayer(GetOwningPlayer(u),0,0,"杀敌数量为|cff00FFFF"+I2S(udg_ll_t)+"|r!")
endif
set udg_stop_x3=0
else
call PolledWait(0.30)
set udg_stop_x3=0
endif
set u=null
endfunction
//注册触发器
function InitTrig_stop_x3_1 takes nothing returns nothing
set gg_trg_stop_x3_1=CreateTrigger()
call TriggerRegisterPlayerUnitEvent(gg_trg_stop_x3_1,Player(0),EVENT_PLAYER_UNIT_ISSUED_ORDER,null)
call TriggerAddCondition(gg_trg_stop_x3_1,Condition(function Trig_stop_x3_1_Conditions))
call TriggerAddAction(gg_trg_stop_x3_1,function Trig_stop_x3_1_Actions)
endfunction[/jass]
这样才稍微算Jass,没有从触发转出来的多余的东西
。。。
优化完后才发现是个坟帖,况且那两个elseif竟然似乎在楼主看来是多余的 |
|