function EffectCheck takes nothing returns nothing
local timer t = GetExpiredTimer()
if LoadEffectHandle(udg_Table, GetHandleId(t), 'efct') == null then
call BJDebugMsg("gone")
call RecTimer(t)
else
call BJDebugMsg("still there")
endif
endfunction
function GetRandomEffect takes nothing returns string
local integer i = GetRandomInt(1,3)
if i == 1 then
return "Abilities\\Spells\\Orc\\Voodoo\\VoodooAuraTarget.mdl"
elseif i == 2 then
return "Abilities\\Spells\\Items\\StaffOfSanctuary\\Staff_Sanctuary_Target.mdl"
else
return "Abilities\\Spells\\Undead\\ReplenishMana\\ReplenishManaCasterOverhead.mdl"
endif
endfunction
function Trig_Test_Actions takes nothing returns nothing
local group g = CreateGroup()
local timer t = GetFreeTimer()
call GroupEnumUnitsSelected( g, Player(0), null)
call SaveEffectHandle(udg_Table, GetHandleId(t), 'efct', AddSpecialEffectTarget( GetRandomEffect() , FirstOfGroup(g), "chest"))
call GroupClear(g)
call DestroyGroup(g)
call TimerStart( t, 2.00, true, function EffectCheck )
set t = null
set g = null
endfunction
//===========================================================================
function InitTrig_Test takes nothing returns nothing
set gg_trg_Test = CreateTrigger( )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Test, Player(0) )
call TriggerAddAction( gg_trg_Test, function Trig_Test_Actions )
endfunction