static integer OFFSET=0
//...
private static method onPress takes nothing returns boolean
call TriggerEvaluate(trig)
set whatEvent = GetHandleId(GetTriggeringTrigger())-OFFSET
set triggerPlayer = GetTriggerPlayer()
return false
endmethod
private static method onInit takes nothing returns nothing
local integer i = 0
local player p
loop
exitwhen i > 8
set trigger[i] = CreateTrigger()
set i = i + 1
endloop
// insert
set OFFSET=GetHandleId(trigger[0])
// the line above
set i = 0
loop
exitwhen i > 11
set p = Player(i)
call TriggerRegisterPlayerEvent(trigger[ARROW_UP_PRESS], p, EVENT_PLAYER_ARROW_UP_DOWN)
call TriggerRegisterPlayerEvent(trigger[ARROW_UP_RELEASE], p, EVENT_PLAYER_ARROW_UP_UP)
call TriggerRegisterPlayerEvent(trigger[ARROW_DOWN_PRESS], p, EVENT_PLAYER_ARROW_DOWN_DOWN)
call TriggerRegisterPlayerEvent(trigger[ARROW_DOWN_RELEASE], p, EVENT_PLAYER_ARROW_DOWN_UP)
call TriggerRegisterPlayerEvent(trigger[ARROW_LEFT_PRESS], p, EVENT_PLAYER_ARROW_LEFT_DOWN)
call TriggerRegisterPlayerEvent(trigger[ARROW_LEFT_RELEASE], p, EVENT_PLAYER_ARROW_LEFT_UP)
call TriggerRegisterPlayerEvent(trigger[ARROW_RIGHT_PRESS], p, EVENT_PLAYER_ARROW_RIGHT_DOWN)
call TriggerRegisterPlayerEvent(trigger[ARROW_RIGHT_RELEASE], p, EVENT_PLAYER_ARROW_RIGHT_UP)
call TriggerRegisterPlayerEvent(trigger[END_CINEMATIC], p, EVENT_PLAYER_END_CINEMATIC)
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 8
call TriggerAddCondition(trigger[i], Condition(function thistype.onPress))
set i = i + 1
endloop
endmethod