- Joined
- Apr 6, 2008
- Messages
- 760
i just looked on redscores spellpack and hes spells are runned by a global timer(one for each spell) and every time that timer expirer i go tru a "stack" for every unit casting the spell. Is this a better and more effective way?
btw i have removed everything that is about the stack
btw i have removed everything that is about the stack
JASS:
scope BlisterBlast
public struct BlisterBlast
endstruct
globals
private BlisterBlast array Kr
private integer Total = 0
private integer tempint = 0
private timer t = CreateTimer()
endglobals
function Trig_BlisterBlastStuff takes nothing returns nothing
local BlisterBlast kb
local integer i = 0
loop
exitwhen i >= Total
set kb = Kr[i]
if then
if then
if then
endif
endif
else
set Kr[i] = Kr[Total - 1]
set Total = Total - 1
call kb.destroy()
if kb.time == 0.00 then
endif
else
if then
else
endif
if then
if then
loop
if then
endif
endloop
set Kr[i] = Kr[Total - 1]
set Total = Total - 1
call kb.destroy()
endif
endif
endif
set i = i + 1
if Total == 0 then
call PauseTimer(t)
endif
endfunction
//===========================================================================
function InitTrig_BlisterBlast takes nothing returns nothing
local integer index = 0
set gg_trg_BlisterBlast = CreateTrigger( )
loop
call TriggerRegisterPlayerUnitEvent(gg_trg_BlisterBlast, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition( gg_trg_BlisterBlast, Condition( function Trig_Blister_Blast_Conditions ) )
call TriggerAddAction( gg_trg_BlisterBlast, function Trig_Blister_Blast_Actions )
endfunction
endscope