|
楼主 |
发表于 2009-9-5 12:37:47
|
显示全部楼层
Init
[codes=Jass]
globals
trigger array triggers
triggeraction array actions
location array locations
unit array units
lightning array lightnings
effect array effects
integer index = 0
endglobals
//==========================================================================
function InitTrig_Init takes nothing returns nothing
endfunction
[/codes]
CreateTrigger
[codes=Jass]
function CreateTriggerTest takes nothing returns nothing
if ( index < 8000 ) then
set triggers[index] = CreateTrigger()
set actions[index] = TriggerAddAction(triggers[index],function CreateTriggerTest)
set index = index + 1
else
call PauseTimer(GetExpiredTimer())
call DestroyTimer(GetExpiredTimer())
endif
endfunction
function Trig_CreateTrigger_Actions takes nothing returns nothing
local timer t = CreateTimer()
set index = 0
call TimerStart(t,0,true,function CreateTriggerTest)
call BJDebugMsg("CreateTrigger")
endfunction
//==========================================================================
function InitTrig_CreateTrigger takes nothing returns nothing
set gg_trg_CreateTrigger = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_CreateTrigger, Player(0), "-CreateTrigger", true )
call TriggerAddAction( gg_trg_CreateTrigger, function Trig_CreateTrigger_Actions )
endfunction
[/codes]
[codes=Jass]
function DestroyTriggerTest takes nothing returns nothing
if ( index < 8000 ) then
call TriggerRemoveAction(triggers[index],actions[index])
set actions[index] = null
call DestroyTrigger(triggers[index])
set triggers[index] = null
set index = index + 1
else
call PauseTimer(GetExpiredTimer())
call DestroyTimer(GetExpiredTimer())
endif
endfunction
function Trig_DestroyTrigger_Actions takes nothing returns nothing
local timer t = CreateTimer()
set index = 0
call TimerStart(t,0,true,function DestroyTriggerTest)
call BJDebugMsg("DestroyTrigger")
endfunction
//==========================================================================
function InitTrig_DestroyTrigger takes nothing returns nothing
set gg_trg_DestroyTrigger = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_DestroyTrigger, Player(0), "-DestroyTrigger", true )
call TriggerAddAction( gg_trg_DestroyTrigger, function Trig_DestroyTrigger_Actions )
endfunction
[/codes]
其他的类推 |
|