- Joined
- Sep 19, 2006
- Messages
- 152
This code seems needless complex. The trigger just takes every item laying on the ground in the playable map area, and reduces its life at intervals. Is there a more efficient way to do this?
JASS:
function Every30Seconds_Action02 takes nothing returns nothing
call SetWidgetLife (GetEnumItem(), (GetWidgetLife (GetEnumItem()) - 20.00))
endfunction
function Every30Seconds_Action01 takes nothing returns nothing
local rect r = Rect (-7424.000, -11776.000, 7424.000, 11264.000)
call EnumItemsInRect (r, null, function Every30Seconds_Action02)
call RemoveRect (r)
set r = null
endfunction
function InitTrig_Every30Seconds takes nothing returns nothing
set gg_trg_Every30Seconds = CreateTrigger ()
call DisableTrigger (gg_trg_Every30Seconds)
call TriggerRegisterTimerEventPeriodic (gg_trg_Every30Seconds, 30.00)
call TriggerAddAction (gg_trg_Every30Seconds, function Every30Seconds_Action01)
endfunction