|
捕捉计时器到期事件
第一次到期后做动作
后面再到期就不做动作了
高手说下为什么呢
是不是我写的不对啊
[codes=jass]
function SGS takes nothing returns nothing
local integer i
local unit u
if(udg_shuaguaishu<60) then
set i=ModuloInteger(udg_boshu-1,5)*5
set u= CreateUnitAtLoc(Player(6),udg_A_UT[i+GetRandomInt(0,4)],udg_A_P[11],180)
call TriggerRegisterUnitEvent( gg_trg_GD, u, EVENT_UNIT_DEATH )
call SetUnitAbilityLevel(u, 'A03U', udg_boshu )
call SetUnitAbilityLevel(u, 'A03S', udg_boshu )
call SetUnitAbilityLevel(u, 'A03V', udg_boshu )
call UnitRemoveAbility(u, 'A03V')
call GroupAddUnit( udg_guai, u )
call IssuePointOrderLoc(u, "attack", udg_A_P[10] )
set u= CreateUnitAtLoc(Player(6),udg_A_UT[i+GetRandomInt(0,4)],udg_A_P[12],180)
call TriggerRegisterUnitEvent( gg_trg_GD, u, EVENT_UNIT_DEATH )
call SetUnitAbilityLevel(u, 'A03U', udg_boshu )
call SetUnitAbilityLevel(u, 'A03S', udg_boshu )
call SetUnitAbilityLevel(u, 'A03V', udg_boshu )
call UnitRemoveAbility(u, 'A03V')
call GroupAddUnit( udg_guai, u )
call IssuePointOrderLoc(u, "attack", udg_A_P[10] )
set u= CreateUnitAtLoc(Player(6),udg_A_UT[i+GetRandomInt(0,4)],udg_A_P[13],180)
call TriggerRegisterUnitEvent( gg_trg_GD, u, EVENT_UNIT_DEATH )
call SetUnitAbilityLevel(u, 'A03U', udg_boshu )
call SetUnitAbilityLevel(u, 'A03S', udg_boshu )
call SetUnitAbilityLevel(u, 'A03V', udg_boshu )
call UnitRemoveAbility(u, 'A03V')
call GroupAddUnit( udg_guai, u )
call IssuePointOrderLoc(u, "attack", udg_A_P[10] )
set u=null
elseif(udg_shuaguaishu==80) then
call DestroyTimer(GetExpiredTimer())
call TimerStart(udg_A_T[6],36,false,null)
set udg_A_TW[6]=CreateTimerDialogBJ(udg_A_T[6],"|C00FF0000鬼魂出现|r")
endif
set udg_shuaguaishu=udg_shuaguaishu+1
endfunction
[/codes]
[codes=jass]
function SG takes nothing returns boolean
local timer tm=CreateTimer()
call DestroyTimerDialog(udg_A_TW[6])
set udg_boshu=udg_boshu+1
set udg_shuaguaishu=0
call TimerStart(tm,1.8,true,function SGS)
return false
endfunction
[/codes]
[codes=jass]
function InitTrig_SG takes nothing returns nothing
set gg_trg_SG = CreateTrigger( )
call TriggerRegisterTimerExpireEvent( gg_trg_SG, udg_A_T[6] )
call TriggerAddCondition( gg_trg_SG, Condition( function SG ) )
endfunction
[/codes] |
|