From ebef487222f705b24a5cf499f04ab23306060794 Mon Sep 17 00:00:00 2001 From: Xaver-DaRed Date: Mon, 9 Jun 2025 19:27:57 +0200 Subject: [PATCH 1/3] Fix ZM8 mission complete check --- scripts/missions/rotz/08_Return_to_Delkfutts_Tower.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/missions/rotz/08_Return_to_Delkfutts_Tower.lua b/scripts/missions/rotz/08_Return_to_Delkfutts_Tower.lua index 30de4d2c74a..698a63af51c 100644 --- a/scripts/missions/rotz/08_Return_to_Delkfutts_Tower.lua +++ b/scripts/missions/rotz/08_Return_to_Delkfutts_Tower.lua @@ -80,9 +80,10 @@ mission.sections = [xi.zone.STELLAR_FULCRUM] = { onZoneIn = function(player, prevZone) - if not mission:isVarBitsSet(player, 'Option', 2) then + local missionStatus = player:getMissionStatus(mission.areaId) + if missionStatus == 0 then return 0 -- Pre-Battle. - elseif player:getMissionStatus(mission.areaId) == 2 then + elseif missionStatus == 2 then return 17 -- Post-Battle. Mission complete event. elseif player:getPreviousZone() == xi.zone.UPPER_DELKFUTTS_TOWER then return 7 -- Ensure regular entering CS plays. From 2dfdcc13575adc259528bd43f3fe5b5b2551294d Mon Sep 17 00:00:00 2001 From: Xaver-DaRed Date: Mon, 9 Jun 2025 19:31:35 +0200 Subject: [PATCH 2/3] Correct LB 6, 7 and 8 event 10045 parameters --- .../quests/jeuno/LB06_New_Worlds_Await.lua | 101 ++++++------------ .../quests/jeuno/LB07_Expanding_Horizons.lua | 37 +++++-- .../quests/jeuno/LB08_Beyond_the_Stars.lua | 46 +++++--- 3 files changed, 96 insertions(+), 88 deletions(-) diff --git a/scripts/quests/jeuno/LB06_New_Worlds_Await.lua b/scripts/quests/jeuno/LB06_New_Worlds_Await.lua index dcb4edff8bf..11560755736 100644 --- a/scripts/quests/jeuno/LB06_New_Worlds_Await.lua +++ b/scripts/quests/jeuno/LB06_New_Worlds_Await.lua @@ -11,20 +11,23 @@ local quest = Quest:new(xi.questLog.JEUNO, xi.quest.id.jeuno.NEW_WORLDS_AWAIT) quest.reward = { - fame = 50, + fame = 50, fameArea = xi.fameArea.JEUNO, } +-- Event 10045 is the global event used in all Limit break quest from 6 to 10. +-- Parameter 1 -> player level. +-- Parameter 2 -> player has the Limit Breaker KI (1) or not (2) +-- Parameter 3 -> "ID/number" of current LB quest associated with this npc. LB-6 = 1, LB-7 = 2, LB-8 = 3... +-- Parameter 4 -> progress in current quest. + quest.sections = { - -- Section: Quest available. Player doesn't have Limit Breaker KI. + -- Section: Quest accepted. { check = function(player, status, vars) return status == xi.questStatus.QUEST_AVAILABLE and - xi.settings.main.MAX_LEVEL >= 75 and - player:getMainLvl() >= 75 and - player:getLevelCap() == 75 and - not player:hasKeyItem(xi.ki.LIMIT_BREAKER) + player:getLevelCap() == 75 end, [xi.zone.RULUDE_GARDENS] = @@ -32,12 +35,19 @@ quest.sections = ['Nomad_Moogle'] = { onTrigger = function(player, npc) - -- NOTE: - -- Event 10045 is the global event used in all Limit break quest from 6 to 10. - -- First argument is player level. (Confirmed from retail captures) - -- Second or third argument are seemingly event control parameters. - -- The rest, I have no clue. I haven''t tried it without those, but im inclined to believe they are just unused garbage data. - return quest:progressEvent(10045, 75, 2, 2964, -1, -1075052545, 2147434431, 3) + local playerLevel = player:getMainLvl() + local limitBreaker = player:hasKeyItem(xi.ki.LIMIT_BREAKER) and 1 or 2 + local lastQuestNumber = 0 + local lastQuestStage = 0 + if + xi.settings.main.MAX_LEVEL > 75 and -- Can we level over 75? + playerLevel == 75 and -- Are we at limit level? + limitBreaker == 1 -- Do we have limit breaker KI? (Pre-requisite) + then + lastQuestNumber = 1 + end + + return quest:progressEvent(10045, playerLevel, limitBreaker, lastQuestNumber, lastQuestStage) end, }, @@ -45,7 +55,7 @@ quest.sections = { [10045] = function(player, csid, option, npc) if option == 4 then - player:updateEvent(243, 2, 3, 1, 17154, 0, 235339776, 4) + player:updateEvent(243, 2, 3, 1, 17154, 0, 235339776, 4) -- I've taken 3 different captures and they always seem different. end end, }, @@ -53,58 +63,12 @@ quest.sections = onEventFinish = { [10045] = function(player, csid, option, npc) + -- Obtain Limit Breaker KI option. if option == 4 then npcUtil.giveKeyItem(player, xi.ki.LIMIT_BREAKER) - end - end, - }, - }, - }, - -- Section: Quest available. Got Limit Breaker KI. Era server section. - { - check = function(player, status, vars) - return status == xi.questStatus.QUEST_AVAILABLE and - xi.settings.main.MAX_LEVEL == 75 and - player:getMainLvl() >= 75 and - player:getLevelCap() == 75 and - player:hasKeyItem(xi.ki.LIMIT_BREAKER) - end, - - [xi.zone.RULUDE_GARDENS] = - { - ['Nomad_Moogle'] = - { - onTrigger = function(player, npc) - return quest:event(10045, 0, 1, 0, 0) - end, - }, - }, - }, - - -- Section: Quest available. Got Limit Breaker KI. Can actually raise level cap. - { - check = function(player, status, vars) - return status == xi.questStatus.QUEST_AVAILABLE and - xi.settings.main.MAX_LEVEL >= 80 and - player:getMainLvl() >= 75 and - player:getLevelCap() == 75 and - player:hasKeyItem(xi.ki.LIMIT_BREAKER) - end, - - [xi.zone.RULUDE_GARDENS] = - { - ['Nomad_Moogle'] = - { - onTrigger = function(player, npc) - return quest:progressEvent(10045, 0, 1, 1, 0, 0, 62421, 4095) - end, - }, - - onEventFinish = - { - [10045] = function(player, csid, option, npc) - if option == 5 then -- Accept quest option. + -- Accept LB6 quest option. + elseif option == 5 then quest:begin(player) end end, @@ -122,10 +86,6 @@ quest.sections = { ['Nomad_Moogle'] = { - onTrigger = function(player, npc) - return quest:event(10045, 0, 1, 1, 1) - end, - onTrade = function(player, npc, trade) if npcUtil.tradeHasExactly(trade, { { xi.item.KINDREDS_SEAL, 5 } }) and @@ -134,6 +94,15 @@ quest.sections = return quest:progressEvent(10135) end end, + + onTrigger = function(player, npc) + local playerLevel = player:getMainLvl() + local limitBreaker = player:hasKeyItem(xi.ki.LIMIT_BREAKER) and 1 or 2 + local lastQuestNumber = 1 + local lastQuestStage = 1 + + return quest:event(10045, playerLevel, limitBreaker, lastQuestNumber, lastQuestStage) -- Reminder. + end, }, onEventFinish = diff --git a/scripts/quests/jeuno/LB07_Expanding_Horizons.lua b/scripts/quests/jeuno/LB07_Expanding_Horizons.lua index fd30c429ed6..57c7c97cfd4 100644 --- a/scripts/quests/jeuno/LB07_Expanding_Horizons.lua +++ b/scripts/quests/jeuno/LB07_Expanding_Horizons.lua @@ -11,7 +11,7 @@ local quest = Quest:new(xi.questLog.JEUNO, xi.quest.id.jeuno.EXPANDING_HORIZONS) quest.reward = { - fame = 50, + fame = 50, fameArea = xi.fameArea.JEUNO, } @@ -21,9 +21,7 @@ quest.sections = { check = function(player, status, vars) return status == xi.questStatus.QUEST_AVAILABLE and - player:getMainLvl() >= 76 and - player:getLevelCap() == 80 and - xi.settings.main.MAX_LEVEL >= 85 + player:getLevelCap() == 80 end, [xi.zone.RULUDE_GARDENS] = @@ -31,7 +29,23 @@ quest.sections = ['Nomad_Moogle'] = { onTrigger = function(player, npc) - return quest:progressEvent(10045, 0, 1, 2, 0) -- Confirmed. + local playerLevel = player:getMainLvl() + local limitBreaker = player:hasKeyItem(xi.ki.LIMIT_BREAKER) and 1 or 2 + local lastQuestNumber = 0 + local lastQuestStage = 0 + if + xi.settings.main.MAX_LEVEL > 80 and + limitBreaker == 1 + then + if playerLevel > 75 then + lastQuestNumber = 2 + elseif playerLevel == 75 then + lastQuestNumber = 1 + lastQuestStage = 2 + end + end + + return quest:progressEvent(10045, playerLevel, limitBreaker, lastQuestNumber, lastQuestStage) end, }, @@ -56,10 +70,6 @@ quest.sections = { ['Nomad_Moogle'] = { - onTrigger = function(player, npc) - return quest:event(10045, 0, 1, 2, 1) - end, - onTrade = function(player, npc, trade) if npcUtil.tradeHasExactly(trade, { { xi.item.KINDREDS_CREST, 5 } }) and @@ -68,6 +78,15 @@ quest.sections = return quest:progressEvent(10136) end end, + + onTrigger = function(player, npc) + local playerLevel = player:getMainLvl() + local limitBreaker = player:hasKeyItem(xi.ki.LIMIT_BREAKER) and 1 or 2 + local lastQuestNumber = 2 + local lastQuestStage = 1 + + return quest:event(10045, playerLevel, limitBreaker, lastQuestNumber, lastQuestStage) + end, }, onEventFinish = diff --git a/scripts/quests/jeuno/LB08_Beyond_the_Stars.lua b/scripts/quests/jeuno/LB08_Beyond_the_Stars.lua index 6f9815bc34a..211b261f497 100644 --- a/scripts/quests/jeuno/LB08_Beyond_the_Stars.lua +++ b/scripts/quests/jeuno/LB08_Beyond_the_Stars.lua @@ -26,9 +26,7 @@ quest.sections = { check = function(player, status, vars) return status == xi.questStatus.QUEST_AVAILABLE and - player:getMainLvl() >= 81 and player:getLevelCap() == 85 and - xi.settings.main.MAX_LEVEL >= 90 end, [xi.zone.RULUDE_GARDENS] = @@ -36,7 +34,23 @@ quest.sections = ['Nomad_Moogle'] = { onTrigger = function(player, npc) - return quest:progressEvent(10045, 0, 1, 3, 0) + local playerLevel = player:getMainLvl() + local limitBreaker = player:hasKeyItem(xi.ki.LIMIT_BREAKER) and 1 or 2 + local lastQuestNumber = 0 + local lastQuestStage = 0 + if + xi.settings.main.MAX_LEVEL > 85 and + limitBreaker == 1 + then + if playerLevel > 80 then + lastQuestNumber = 3 + elseif playerLevel == 80 then + lastQuestNumber = 2 + lastQuestStage = 2 + end + end + + return quest:progressEvent(10045, playerLevel, limitBreaker, lastQuestNumber, lastQuestStage) end, }, @@ -61,16 +75,6 @@ quest.sections = { ['Nomad_Moogle'] = { - onTrigger = function(player, npc) - if quest:getVar(player, 'Prog') == 1 then - -- Rock, Paper, Scissor Minigame starting event. - -- NOT CODED. WAITING FOR CAPS. - return quest:progressEvent(10161) - else - return quest:event(10045, 0, 1, 3, 1) - end - end, - onTrade = function(player, npc, trade) if npcUtil.tradeHasExactly(trade, { { xi.item.KINDREDS_CREST, 10 } }) and @@ -79,6 +83,22 @@ quest.sections = return quest:progressEvent(10137) end end, + + onTrigger = function(player, npc) + -- Rock, Paper, Scissor Minigame. + if quest:getVar(player, 'Prog') == 1 then + return quest:progressEvent(10161) + + -- Reminder + else + local playerLevel = player:getMainLvl() + local limitBreaker = player:hasKeyItem(xi.ki.LIMIT_BREAKER) and 1 or 2 + local lastQuestNumber = 3 + local lastQuestStage = 1 + + return quest:event(10045, playerLevel, limitBreaker, lastQuestNumber, lastQuestStage) + end + end, }, -- onEventUpdate = From 28423675f79e2f1ff231466699d9968cbc375d0d Mon Sep 17 00:00:00 2001 From: Xaver-DaRed Date: Mon, 9 Jun 2025 19:36:20 +0200 Subject: [PATCH 3/3] Implement LB8 "Rock, Paper, Scissor" minigame --- .../quests/jeuno/LB08_Beyond_the_Stars.lua | 54 ++++++++++++++----- sql/npc_list.sql | 8 +-- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/scripts/quests/jeuno/LB08_Beyond_the_Stars.lua b/scripts/quests/jeuno/LB08_Beyond_the_Stars.lua index 211b261f497..ba8a3004325 100644 --- a/scripts/quests/jeuno/LB08_Beyond_the_Stars.lua +++ b/scripts/quests/jeuno/LB08_Beyond_the_Stars.lua @@ -26,7 +26,7 @@ quest.sections = { check = function(player, status, vars) return status == xi.questStatus.QUEST_AVAILABLE and - player:getLevelCap() == 85 and + player:getLevelCap() == 85 end, [xi.zone.RULUDE_GARDENS] = @@ -85,27 +85,54 @@ quest.sections = end, onTrigger = function(player, npc) + local playerLevel = player:getMainLvl() + local limitBreaker = player:hasKeyItem(xi.ki.LIMIT_BREAKER) and 1 or 2 + local lastQuestNumber = 3 + local lastQuestStage = 1 + -- Rock, Paper, Scissor Minigame. if quest:getVar(player, 'Prog') == 1 then - return quest:progressEvent(10161) + return quest:progressEvent(10161, playerLevel, 0) -- Reminder else - local playerLevel = player:getMainLvl() - local limitBreaker = player:hasKeyItem(xi.ki.LIMIT_BREAKER) and 1 or 2 - local lastQuestNumber = 3 - local lastQuestStage = 1 - return quest:event(10045, playerLevel, limitBreaker, lastQuestNumber, lastQuestStage) end end, }, - -- onEventUpdate = - -- { - -- [10161] = function(player, csid, option, npc) - -- end, - -- }, + onEventUpdate = + { + [10161] = function(player, csid, option, npc) + -- Maat move choice. + local maatMove = 0 + if option == 21 then + maatMove = 0 -- Red. + elseif option == 22 then + maatMove = 1 -- Blue. + elseif option == 23 then + maatMove = 2 -- Green. + end + + -- Degenhard move choice. + local degenhardMove = math.random(0, 2) + + -- Rock-Paper-Scissors: Red beats Blue; Blue beats Green; Green beats Red. + local clashOutcome = 1 -- Assume Degenhard wins + if maatMove == degenhardMove then + clashOutcome = 2 -- Draw + elseif + (maatMove == 0 and degenhardMove == 1) or + (maatMove == 1 and degenhardMove == 2) or + (maatMove == 2 and degenhardMove == 0) + then + clashOutcome = 0 + end + + local eventBitmask = maatMove + degenhardMove * 4 + clashOutcome * 16 -- Controls moves chosen by Maat and Degenhard, and who wins the round. + player:updateEvent(eventBitmask) + end, + }, onEventFinish = { @@ -116,7 +143,8 @@ quest.sections = end, [10161] = function(player, csid, option, npc) - if quest:complete(player) then + if option == 254 then + quest:complete(player) player:setLevelCap(90) player:messageSpecial(ruludeID.text.YOUR_LEVEL_LIMIT_IS_NOW_90) end diff --git a/sql/npc_list.sql b/sql/npc_list.sql index 45b5757abff..a99bf9f3e52 100644 --- a/sql/npc_list.sql +++ b/sql/npc_list.sql @@ -30827,10 +30827,10 @@ INSERT INTO `npc_list` VALUES (17772760,'blank','',0,0.000,0.000,0.000,0,50,50,0 INSERT INTO `npc_list` VALUES (17772761,'Razfahd','Razfahd',0,0.000,0.000,0.000,0,40,40,0,0,0,6,29,0x0000350600000000000000000000000000000000,32,NULL,1); INSERT INTO `npc_list` VALUES (17772762,'blank','',0,0.000,0.000,0.000,0,50,50,0,0,0,6,27,0x0000F40500000000000000000000000000000000,32,NULL,0); INSERT INTO `npc_list` VALUES (17772763,'Parike-Poranke','Parike-Poranke',0,0.000,0.000,0.000,7,40,40,0,0,0,6,27,0x010004050A100A200A300A400A50006000700000,32,NULL,1); -INSERT INTO `npc_list` VALUES (17772764,'Magian_Moogle','Magian Moogle',0,0.000,0.000,0.000,0,40,40,0,0,0,6,3,0x0000650900000000000000000000000000000000,0,'WOTG',1); -INSERT INTO `npc_list` VALUES (17772765,'Degenhard','Degenhard',0,0.000,0.000,0.000,0,40,40,0,0,0,6,27,0x00007E0000000000000000000000000000000000,32,NULL,1); -INSERT INTO `npc_list` VALUES (17772766,'Maat','Maat',0,0.000,0.000,0.000,0,40,40,0,0,0,6,27,0x0000FA0200000000000000000000000000000000,32,NULL,1); -INSERT INTO `npc_list` VALUES (17772767,'Atori-Tutori','Atori-Tutori',0,0.000,0.000,0.000,0,40,40,0,0,0,6,27,0x0100020500101120003000400050006000700000,32,NULL,1); +INSERT INTO `npc_list` VALUES (17772764,'Magian_Moogle','Magian Moogle',0,0.000,0.000,0.000,0,50,50,0,0,0,6,3,0x0000610900000000000000000000000000000000,0,'WOTG',1); +INSERT INTO `npc_list` VALUES (17772765,'Degenhard','Degenhard',0,0.000,0.000,0.000,0,50,50,0,0,0,6,27,0x0000810800000000000000000000000000000000,32,NULL,1); +INSERT INTO `npc_list` VALUES (17772766,'Maat','Maat',0,0.000,0.000,0.000,0,50,50,0,0,0,6,27,0x0000FA0200000000000000000000000000000000,32,NULL,1); +INSERT INTO `npc_list` VALUES (17772767,'Atori-Tutori','Atori-Tutori',0,0.000,0.000,0.000,0,50,50,0,0,0,6,27,0x0100020500101120003000400050006000700000,32,NULL,1); INSERT INTO `npc_list` VALUES (17772768,'Chamama','Chamama',0,0.000,0.000,0.000,0,40,40,0,0,0,6,27,0x0100000600100820083008400850006000700000,32,NULL,1); INSERT INTO `npc_list` VALUES (17772769,'csnpc','',0,0.000,0.000,0.000,0,40,40,0,0,0,6,27,0x0000CC0700000000000000000000000000000000,32,NULL,1); INSERT INTO `npc_list` VALUES (17772770,'Magian_Moogle','',0,0.000,0.000,0.000,0,40,40,0,0,0,6,3,0x0000650900000000000000000000000000000000,0,'WOTG',1);