From e87ef47cc2586da2a9e010c4b2e6be13057d2fa2 Mon Sep 17 00:00:00 2001 From: jamesbradleym Date: Thu, 5 Sep 2024 14:14:52 -0400 Subject: [PATCH] Convert Beast AF1 Quest --- scripts/globals/quests.lua | 2 +- scripts/quests/jeuno/Wings_of_Gold.lua | 101 ++++++++++++++++++++++ scripts/zones/Upper_Jeuno/npcs/Brutus.lua | 35 +------- 3 files changed, 104 insertions(+), 34 deletions(-) create mode 100644 scripts/quests/jeuno/Wings_of_Gold.lua diff --git a/scripts/globals/quests.lua b/scripts/globals/quests.lua index d92b8de5a31..a087599250e 100644 --- a/scripts/globals/quests.lua +++ b/scripts/globals/quests.lua @@ -376,7 +376,7 @@ xi.quest.id = BORGHERTZ_S_DRAGON_HANDS = 57, -- + BORGHERTZ_S_CALLING_HANDS = 58, -- + AXE_THE_COMPETITION = 59, -- + Converted - WINGS_OF_GOLD = 60, -- ± + WINGS_OF_GOLD = 60, -- ± Converted SCATTERED_INTO_SHADOW = 61, -- ± A_NEW_DAWN = 62, PAINFUL_MEMORY = 63, -- + diff --git a/scripts/quests/jeuno/Wings_of_Gold.lua b/scripts/quests/jeuno/Wings_of_Gold.lua new file mode 100644 index 00000000000..083bb00c136 --- /dev/null +++ b/scripts/quests/jeuno/Wings_of_Gold.lua @@ -0,0 +1,101 @@ +----------------------------------- +-- Wings of Gold +----------------------------------- +-- Log ID: 3, Quest ID: 60 +-- Brutus : !pos -55 8 95 244 +----------------------------------- + +---@type TQuest +local quest = Quest:new(xi.questLog.JEUNO, xi.quest.id.jeuno.WINGS_OF_GOLD) + +quest.reward = +{ + fame = 20, + fameArea = xi.fameArea.JEUNO, + item = xi.item.BARBAROI_AXE, +} + +quest.sections = +{ + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_AVAILABLE and + player:hasCompletedQuest(xi.questLog.JEUNO, xi.quest.id.jeuno.PATH_OF_THE_BEASTMASTER) and + player:getMainLvl() >= xi.settings.main.AF1_QUEST_LEVEL and + player:getMainJob() == xi.job.BST + end, + + [xi.zone.UPPER_JEUNO] = + { + ['Brutus'] = + { + onTrigger = function(player, npc) + if quest:getVar(player, 'Prog') == 0 then + return quest:progressEvent(139) + else + return quest:progressEvent(137) + end + end, + + }, + onEventFinish = + { + [137] = function(player, csid, option, npc) + if option == 1 then + quest:begin(player) + end + end, + + [139] = function(player, csid, option, npc) + if option == 1 then + quest:begin(player) + else + quest:setVar(player, 'Prog', 1) -- If declined then future Brutus quest start will use short dialog + end + end, + }, + }, + }, + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED + end, + + [xi.zone.UPPER_JEUNO] = + { + ['Brutus'] = + { + onTrigger = function(player, npc) + if not player:hasKeyItem(xi.ki.GUIDING_BELL) then + return quest:event(136) + else + return quest:progressEvent(138) + end + end, + }, + + onEventFinish = + { + [138] = function(player, csid, option, npc) + if quest:complete(player) then + player:delKeyItem(xi.ki.GUIDING_BELL) + end + end, + }, + }, + }, + + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_COMPLETED and + not player:hasCompletedQuest(xi.questLog.JEUNO, xi.quest.id.jeuno.SCATTERED_INTO_SHADOW) + end, + + [xi.zone.UPPER_JEUNO] = + { + ['Brutus'] = quest:event(134):replaceDefault(), + }, + }, +} + +return quest diff --git a/scripts/zones/Upper_Jeuno/npcs/Brutus.lua b/scripts/zones/Upper_Jeuno/npcs/Brutus.lua index 10400716a7e..aa71559a472 100755 --- a/scripts/zones/Upper_Jeuno/npcs/Brutus.lua +++ b/scripts/zones/Upper_Jeuno/npcs/Brutus.lua @@ -11,7 +11,6 @@ entity.onTrade = function(player, npc, trade) end entity.onTrigger = function(player, npc) - local pathOfTheBeastmaster = player:getQuestStatus(xi.questLog.JEUNO, xi.quest.id.jeuno.PATH_OF_THE_BEASTMASTER) local wingsOfGold = player:getQuestStatus(xi.questLog.JEUNO, xi.quest.id.jeuno.WINGS_OF_GOLD) local scatteredIntoShadow = player:getQuestStatus(xi.questLog.JEUNO, xi.quest.id.jeuno.SCATTERED_INTO_SHADOW) local scatteredIntoShadowStat = player:getCharVar('scatIntoShadowCS') @@ -19,28 +18,8 @@ entity.onTrigger = function(player, npc) local mLvl = player:getMainLvl() local mJob = player:getMainJob() - -- WINGS OF GOLD - if - pathOfTheBeastmaster == xi.questStatus.QUEST_COMPLETED and - wingsOfGold == xi.questStatus.QUEST_AVAILABLE and - mJob == xi.job.BST and - mLvl >= xi.settings.main.AF1_QUEST_LEVEL - then - if player:getCharVar('wingsOfGold_shortCS') == 1 then - player:startEvent(137) -- Start Quest 'Wings of gold' (Short dialog) - else - player:setCharVar('wingsOfGold_shortCS', 1) - player:startEvent(139) -- Start Quest 'Wings of gold' (Long dialog) - end - elseif wingsOfGold == xi.questStatus.QUEST_ACCEPTED then - if not player:hasKeyItem(xi.ki.GUIDING_BELL) then - player:startEvent(136) - else - player:startEvent(138) -- Finish Quest 'Wings of gold' - end - -- SCATTERED INTO SHADOW - elseif + if wingsOfGold == xi.questStatus.QUEST_COMPLETED and scatteredIntoShadow == xi.questStatus.QUEST_AVAILABLE and mJob == xi.job.BST and @@ -78,18 +57,8 @@ entity.onTrigger = function(player, npc) end entity.onEventFinish = function(player, csid, option, npc) - -- WINGS OF GOLD - if (csid == 137 or csid == 139) and option == 1 then - player:addQuest(xi.questLog.JEUNO, xi.quest.id.jeuno.WINGS_OF_GOLD) - player:setCharVar('wingsOfGold_shortCS', 0) - elseif - csid == 138 and - npcUtil.completeQuest(player, xi.questLog.JEUNO, xi.quest.id.jeuno.WINGS_OF_GOLD, { item = 16680, fame = 20 }) - then - player:delKeyItem(xi.ki.GUIDING_BELL) - -- SCATTERED INTO SHADOW - elseif (csid == 141 or csid == 143) and option == 1 then + if (csid == 141 or csid == 143) and option == 1 then player:addQuest(xi.questLog.JEUNO, xi.quest.id.jeuno.SCATTERED_INTO_SHADOW) player:setCharVar('scatIntoShadow_shortCS', 0) npcUtil.giveKeyItem(player, { xi.ki.AQUAFLORA1, xi.ki.AQUAFLORA2, xi.ki.AQUAFLORA3 })