private function OnSpellCast takes nothing returns nothing
local integer abilID = GetSpellAbilityId()
if abilID == SPELL_PORTAL then
call Trig_MythicalScrollPortal_Actions()
elseif abilID == SPELL_TELEPORT then
call Trig_MythicalScrollTeleport_Actions()
endif
endfunction
private function Init_MythicalScroll takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T, Condition(function OnSpellCast)) // The Condition function can also accept functions which do not return boolean values.
// call TriggerAddAction(T, function OnSpellCast) // Either one will do
// Other preload stuff
endfunction