function ActionsOf1 takes nothing returns nothing
//level 1 actions
endfunction
function ActionsOf2 takes nothing returns nothing
//level 2 actions
endfunction
function ActionsOf3 takes nothing returns nothing
//level 3 actions
endfunction
function Trig takes nothing returns nothing
local integer level = GetUnitAbilityLevel(GetSpellAbilityUnit(), 'ABCD')
call TriggerExecute(CODES[level])
endfunction
function TrigConds takes nothing returns boolean
return (GetSpellAbilityId() == 'ABCD')
endfunction
function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function TrigConds))
call TriggerAddAction(t, function Trig)
set t = CreateTrigger()
set CODES[1] = t
call TriggerAddAction(t, function ActionsOf1)
set t = CreateTrigger()
set CODES[2] = t
call TriggerAddAction(t, function ActionsOf2)
set t = CreateTrigger()
set CODES[3] = t
call TriggerAddAction(t, function ActionsOf3)
set t = null
endfunction