From 0d8f881e4bcfc666e655e00506b6ab165c1cc63e Mon Sep 17 00:00:00 2001 From: Aeshur Date: Thu, 11 Jun 2026 02:13:41 -0400 Subject: [PATCH] [lua] Fix Back to the Beginning Cutscene --- .../wotg/02_Back_to_the_Beginning.lua | 68 +++++++++---------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/scripts/missions/wotg/02_Back_to_the_Beginning.lua b/scripts/missions/wotg/02_Back_to_the_Beginning.lua index 4a68fc32e4b..9ba70758f72 100644 --- a/scripts/missions/wotg/02_Back_to_the_Beginning.lua +++ b/scripts/missions/wotg/02_Back_to_the_Beginning.lua @@ -25,6 +25,26 @@ mission.reward = nextMission = { xi.mission.log_id.WOTG, xi.mission.id.wotg.CAIT_SITH }, } +local mawEvents = +{ + [xi.zone.BATALLIA_DOWNS] = { 501, 0, 1 }, + [xi.zone.ROLANBERRY_FIELDS] = { 501, 1, 1 }, + [xi.zone.SAUROMUGUE_CHAMPAIGN] = { 501, 2, 1 }, + [xi.zone.BATALLIA_DOWNS_S] = { 701, 0, 1 }, + [xi.zone.ROLANBERRY_FIELDS_S] = { 701, 1, 1 }, + [xi.zone.SAUROMUGUE_CHAMPAIGN_S] = { 701, 2, 1 }, +} + +local function mawEvent(zoneId) + return mission:progressEvent(unpack(mawEvents[zoneId])) +end + +local function completeMission(player, csid, option, npc) + if mission:complete(player) then + xi.maws.addMaw(player) + end +end + mission.sections = { { @@ -35,85 +55,61 @@ mission.sections = [xi.zone.BATALLIA_DOWNS] = { - ['Cavernous_Maw'] = mission:progressEvent(501), + ['Cavernous_Maw'] = mawEvent(xi.zone.BATALLIA_DOWNS), onEventFinish = { - [501] = function(player, csid, option, npc) - if mission:complete(player) then - xi.maws.addMaw(player) - end - end, + [501] = completeMission, }, }, [xi.zone.ROLANBERRY_FIELDS] = { - ['Cavernous_Maw'] = mission:progressEvent(501), + ['Cavernous_Maw'] = mawEvent(xi.zone.ROLANBERRY_FIELDS), onEventFinish = { - [501] = function(player, csid, option, npc) - if mission:complete(player) then - xi.maws.addMaw(player) - end - end, + [501] = completeMission, }, }, [xi.zone.SAUROMUGUE_CHAMPAIGN] = { - ['Cavernous_Maw'] = mission:progressEvent(501), + ['Cavernous_Maw'] = mawEvent(xi.zone.SAUROMUGUE_CHAMPAIGN), onEventFinish = { - [501] = function(player, csid, option, npc) - if mission:complete(player) then - xi.maws.addMaw(player) - end - end, + [501] = completeMission, }, }, [xi.zone.BATALLIA_DOWNS_S] = { - ['Cavernous_Maw'] = mission:progressEvent(701), + ['Cavernous_Maw'] = mawEvent(xi.zone.BATALLIA_DOWNS_S), onEventFinish = { - [701] = function(player, csid, option, npc) - if mission:complete(player) then - xi.maws.addMaw(player) - end - end, + [701] = completeMission, }, }, [xi.zone.ROLANBERRY_FIELDS_S] = { - ['Cavernous_Maw'] = mission:progressEvent(701), + ['Cavernous_Maw'] = mawEvent(xi.zone.ROLANBERRY_FIELDS_S), onEventFinish = { - [701] = function(player, csid, option, npc) - if mission:complete(player) then - xi.maws.addMaw(player) - end - end, + [701] = completeMission, }, }, [xi.zone.SAUROMUGUE_CHAMPAIGN_S] = { - ['Cavernous_Maw'] = mission:progressEvent(701), + ['Cavernous_Maw'] = mawEvent(xi.zone.SAUROMUGUE_CHAMPAIGN_S), onEventFinish = { - [701] = function(player, csid, option, npc) - if mission:complete(player) then - xi.maws.addMaw(player) - end - end, + [701] = completeMission, }, }, },