diff --git a/scripts/globals/quests.lua b/scripts/globals/quests.lua index 1b15f8fb881..927eff6eb7b 100644 --- a/scripts/globals/quests.lua +++ b/scripts/globals/quests.lua @@ -336,7 +336,7 @@ xi.quest.id = TENSHODO_MEMBERSHIP = 17, -- + THE_LOST_CARDIAN = 18, -- + PATH_OF_THE_BEASTMASTER = 19, -- + Converted - PATH_OF_THE_BARD = 20, -- + + PATH_OF_THE_BARD = 20, -- + Converted THE_CLOCKMASTER = 21, -- + Converted CANDLE_MAKING = 22, -- + Converted CHILDS_PLAY = 23, -- + Converted diff --git a/scripts/quests/jeuno/A_Minstrel_In_Despair.lua b/scripts/quests/jeuno/A_Minstrel_In_Despair.lua index e7274e6d655..f2080bb05a6 100644 --- a/scripts/quests/jeuno/A_Minstrel_In_Despair.lua +++ b/scripts/quests/jeuno/A_Minstrel_In_Despair.lua @@ -19,7 +19,7 @@ quest.sections = { check = function(player, status, vars) return status == xi.questStatus.QUEST_AVAILABLE and - player:getQuestStatus(xi.questLog.JEUNO, xi.quest.id.jeuno.THE_OLD_MONUMENT) == xi.questStatus.QUEST_COMPLETED + player:hasCompletedQuest(xi.questLog.JEUNO, xi.quest.id.jeuno.THE_OLD_MONUMENT) end, [xi.zone.LOWER_JEUNO] = diff --git a/scripts/quests/jeuno/BRD_AF1_Painful_Memory.lua b/scripts/quests/jeuno/BRD_AF1_Painful_Memory.lua new file mode 100644 index 00000000000..fb0f76d8d7c --- /dev/null +++ b/scripts/quests/jeuno/BRD_AF1_Painful_Memory.lua @@ -0,0 +1,130 @@ +----------------------------------- +-- Painful Memory +----------------------------------- +-- Log ID: 3, Quest ID: 63 +-- Mertaire: !gotoid 17780764 +-- Waters_of_Oblivion: !gotoid 17457347 +----------------------------------- +local ID = zones[xi.zone.RANGUEMONT_PASS] +----------------------------------- + +local quest = Quest:new(xi.questLog.JEUNO, xi.quest.id.jeuno.PAINFUL_MEMORY) + +quest.reward = +{ + item = xi.item.PAPER_KNIFE, +} + +quest.sections = +{ + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_AVAILABLE and + player:getMainLvl() >= xi.settings.main.AF1_QUEST_LEVEL and + player:hasCompletedQuest(xi.questLog.JEUNO, xi.quest.id.jeuno.PATH_OF_THE_BARD) and + player:getMainJob() == xi.job.BRD + end, + + [xi.zone.LOWER_JEUNO] = + { + ['Mertaire'] = + { + onTrigger = function(player, npc) + local initialCS = quest:getVar(player, 'initialCS') + + if initialCS == 0 then + return quest:progressEvent(138) + elseif initialCS == 1 then + return quest:progressEvent(137) + end + end, + }, + + onEventFinish = + { + [138] = function(player, csid, option, npc) + if option == 1 then + quest:begin(player) + quest:setVar(player, 'initialCS', 0) + npcUtil.giveKeyItem(player, xi.ki.MERTAIRES_BRACELET) + else + quest:setVar(player, 'initialCS', 1) + end + end, + + [137] = function(player, csid, option, npc) + if option == 1 then + quest:begin(player) + quest:setVar(player, 'initialCS ', 0) + npcUtil.giveKeyItem(player, xi.ki.MERTAIRES_BRACELET) + end + end, + }, + }, + }, + + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED + end, + + [xi.zone.LOWER_JEUNO] = + { + ['Mertaire'] = + { + onTrigger = function(player, npc) + return quest:event(136) + end, + }, + + ['Mataligeat'] = + { + onTrigger = function(player, npc) + if quest:getVar(player, 'Prog') >= 1 then + return quest:event(141) + end + end, + }, + }, + + [xi.zone.RANGUEMONT_PASS] = + { + ['Waters_of_Oblivion'] = + { + onTrigger = function(player, npc) + local nmKilled = quest:getVar(player, 'nmKilled') + + if + player:hasKeyItem(xi.ki.MERTAIRES_BRACELET) and + npcUtil.popFromQM(player, npc, ID.mob.TROS, { claim = true, hide = 0 }) and + nmKilled == 0 + then + return quest:noAction() + elseif nmKilled == 1 then + return quest:progressEvent(8) + end + end, + }, + + ['Tros'] = + { + onMobDeath = function(mob, player, optParams) + if player:hasKeyItem(xi.ki.MERTAIRES_BRACELET) then + quest:setVar(player, 'nmKilled', 1) + end + end, + }, + + onEventFinish = + { + [8] = function(player, csid, option, npc) + if quest:complete(player) then + player:delKeyItem(xi.ki.MERTAIRES_BRACELET) + end + end, + }, + }, + }, +} + +return quest diff --git a/scripts/quests/jeuno/Path_of_the_Bard.lua b/scripts/quests/jeuno/Path_of_the_Bard.lua new file mode 100644 index 00000000000..a847adc8c7f --- /dev/null +++ b/scripts/quests/jeuno/Path_of_the_Bard.lua @@ -0,0 +1,50 @@ +-- ----------------------------------- +-- -- Path of the Bard +-- ----------------------------------- +-- -- Log ID: 3, Quest ID: 20 +-- -- Song Runes: !gotoid 17199695 +-- ----------------------------------- +local ID = zones[xi.zone.VALKURM_DUNES] +----------------------------------- + +local quest = Quest:new(xi.questLog.JEUNO, xi.quest.id.jeuno.PATH_OF_THE_BARD) + +quest.reward = +{ + gil = 3000, + fame = 30, + fameArea = xi.fameArea.JEUNO, + title = xi.title.WANDERING_MINSTREL, +} + +quest.sections = +{ + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_AVAILABLE and + player:hasCompletedQuest(xi.questLog.JEUNO, xi.quest.id.jeuno.A_MINSTREL_IN_DESPAIR) + end, + + [xi.zone.VALKURM_DUNES] = + { + ['Song_Runes'] = + { + onTrigger = function(player, npc) + return quest:progressEvent(2) + end, + }, + + onEventFinish = + { + [2] = function(player, csid, option, npc) + if quest:complete(player) then + player:unlockJob(xi.job.BRD) + player:messageSpecial(ID.text.UNLOCK_BARD) + end + end, + }, + }, + }, +} + +return quest diff --git a/scripts/zones/Lower_Jeuno/IDs.lua b/scripts/zones/Lower_Jeuno/IDs.lua index 3aa2077d986..cea6f245b16 100644 --- a/scripts/zones/Lower_Jeuno/IDs.lua +++ b/scripts/zones/Lower_Jeuno/IDs.lua @@ -36,6 +36,7 @@ zones[xi.zone.LOWER_JEUNO] = CHOCOBO_DIALOG = 7337, -- Hmph. MERTAIRE_MALLIEBELL_LEFT = 7418, -- Ugh... Malliebell... This time she's left me forever... MERTAIRE_DEFAULT = 7443, -- Who are you? Leave me alone! + MERTAIRE_MINSTREL = 7453, -- Wait, could he be...? Naw, he couldn't be. ITS_LOCKED = 7605, -- It's locked. PAWKRIX_SHOP_DIALOG = 7653, -- Hey, we're fixin' up some stew. Gobbie food's good food! AMALASANDA_SHOP_DIALOG = 7701, -- Welcome to the Tenshodo. You want something, we got it. We got all kinds of special merchandise you won't find anywhere else! diff --git a/scripts/zones/Lower_Jeuno/npcs/Mertaire.lua b/scripts/zones/Lower_Jeuno/npcs/Mertaire.lua index b90fa1254d3..29ccd01f054 100644 --- a/scripts/zones/Lower_Jeuno/npcs/Mertaire.lua +++ b/scripts/zones/Lower_Jeuno/npcs/Mertaire.lua @@ -12,26 +12,12 @@ local entity = {} entity.onTrigger = function(player, npc) local painfulMemory = player:getQuestStatus(xi.questLog.JEUNO, xi.quest.id.jeuno.PAINFUL_MEMORY) local circleOfTime = player:getQuestStatus(xi.questLog.JEUNO, xi.quest.id.jeuno.THE_CIRCLE_OF_TIME) + local minstrel = player:getQuestStatus(xi.questLog.JEUNO, xi.quest.id.jeuno.A_MINSTREL_IN_DESPAIR) local job = player:getMainJob() local level = player:getMainLvl() - -- PAINFUL MEMORY (Bard AF1) - if - painfulMemory == xi.questStatus.QUEST_AVAILABLE and - job == xi.job.BRD and - level >= xi.settings.main.AF1_QUEST_LEVEL - then - if player:getCharVar('PainfulMemoryCS') == 0 then - player:startEvent(138) -- Long dialog for 'Painful Memory' - else - player:startEvent(137) -- Short dialog for 'Painful Memory' - end - - elseif painfulMemory == xi.questStatus.QUEST_ACCEPTED then - player:startEvent(136) -- During Quest 'Painful Memory' - -- CIRCLE OF TIME (Bard AF3) - elseif + if player:getQuestStatus(xi.questLog.JEUNO, xi.quest.id.jeuno.THE_REQUIEM) == xi.questStatus.QUEST_COMPLETED and circleOfTime == xi.questStatus.QUEST_AVAILABLE and job == xi.job.BRD and @@ -46,27 +32,17 @@ entity.onTrigger = function(player, npc) elseif painfulMemory == xi.questStatus.QUEST_COMPLETED then player:startEvent(135) -- Standard dialog after completed "Painful Memory" + elseif minstrel == xi.questStatus.QUEST_COMPLETED then + player:messageSpecial(ID.text.MERTAIRE_MINSTREL) -- Standard dialog after completing "A Minstrel in Despair" + else player:messageSpecial(ID.text.MERTAIRE_DEFAULT) end end entity.onEventFinish = function(player, csid, option, npc) - -- PAINFUL MEMORY (Bard AF1) - if csid == 138 and option == 0 then - player:setCharVar('PainfulMemoryCS', 1) -- player declined quest - - elseif - (csid == 137 or csid == 138) and - option == 1 - then - player:addQuest(xi.questLog.JEUNO, xi.quest.id.jeuno.PAINFUL_MEMORY) - player:setCharVar('PainfulMemoryCS', 0) - player:addKeyItem(xi.ki.MERTAIRES_BRACELET) - player:messageSpecial(ID.text.KEYITEM_OBTAINED, xi.ki.MERTAIRES_BRACELET) - -- CIRCLE OF TIME (Bard AF3) - elseif csid == 139 then + if csid == 139 then player:addQuest(xi.questLog.JEUNO, xi.quest.id.jeuno.THE_CIRCLE_OF_TIME) player:setCharVar('circleTime', 1) end diff --git a/scripts/zones/Ranguemont_Pass/DefaultActions.lua b/scripts/zones/Ranguemont_Pass/DefaultActions.lua new file mode 100644 index 00000000000..473f9cc2de8 --- /dev/null +++ b/scripts/zones/Ranguemont_Pass/DefaultActions.lua @@ -0,0 +1,5 @@ +local ID = zones[xi.zone.RANGUEMONT_PASS] + +return { + ['Waters_of_Oblivion'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY }, +} diff --git a/scripts/zones/Ranguemont_Pass/mobs/Tros.lua b/scripts/zones/Ranguemont_Pass/mobs/Tros.lua index e7e6db868a2..9c2e5c146ca 100644 --- a/scripts/zones/Ranguemont_Pass/mobs/Tros.lua +++ b/scripts/zones/Ranguemont_Pass/mobs/Tros.lua @@ -12,10 +12,6 @@ entity.onMobInitialize = function(mob) end entity.onMobDeath = function(mob, player, optParams) - if player:hasKeyItem(xi.ki.MERTAIRES_BRACELET) then - player:setCharVar('TrosKilled', 1) - player:setCharVar('Tros_Timer', os.time()) - end end return entity diff --git a/scripts/zones/Ranguemont_Pass/npcs/Waters_of_Oblivion.lua b/scripts/zones/Ranguemont_Pass/npcs/Waters_of_Oblivion.lua index 29c5678dfa7..0563c653803 100644 --- a/scripts/zones/Ranguemont_Pass/npcs/Waters_of_Oblivion.lua +++ b/scripts/zones/Ranguemont_Pass/npcs/Waters_of_Oblivion.lua @@ -4,36 +4,13 @@ -- Finish Quest: Painful Memory (BARD AF1) -- !pos -284 -45 210 166 ----------------------------------- -local ID = zones[xi.zone.RANGUEMONT_PASS] ------------------------------------ ---@type TNpcEntity local entity = {} entity.onTrigger = function(player, npc) - local trosKilled = player:getCharVar('TrosKilled') - - if - player:hasKeyItem(xi.ki.MERTAIRES_BRACELET) and - not GetMobByID(ID.mob.TROS):isSpawned() and - (trosKilled == 0 or (os.time() - player:getCharVar('Tros_Timer')) > 60) - then - player:messageSpecial(ID.text.SENSE_OF_FOREBODING) - SpawnMob(ID.mob.TROS):updateClaim(player) - elseif player:hasKeyItem(xi.ki.MERTAIRES_BRACELET) and trosKilled == 1 then - player:startEvent(8) -- Finish Quest 'Painful Memory' - else - player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY) - end end entity.onEventFinish = function(player, csid, option, npc) - if csid == 8 then - if npcUtil.completeQuest(player, xi.questLog.JEUNO, xi.quest.id.jeuno.PAINFUL_MEMORY, { item = 16766 }) then - player:delKeyItem(xi.ki.MERTAIRES_BRACELET) - player:setCharVar('TrosKilled', 0) - player:setCharVar('Tros_Timer', 0) - end - end end return entity diff --git a/scripts/zones/Valkurm_Dunes/DefaultActions.lua b/scripts/zones/Valkurm_Dunes/DefaultActions.lua index c97d06a328f..1d9574b4fca 100644 --- a/scripts/zones/Valkurm_Dunes/DefaultActions.lua +++ b/scripts/zones/Valkurm_Dunes/DefaultActions.lua @@ -6,4 +6,5 @@ return { ['qm4'] = { messageSpecial = ID.text.MONSTERS_KILLED_ADVENTURERS }, ['Signpost1'] = { messageSpecial = ID.text.SIGNPOST1 }, ['Signpost2'] = { messageSpecial = ID.text.SIGNPOST2 }, + ['Song_Runes'] = { messageSpecial = ID.text.SONG_RUNES_DEFAULT }, } diff --git a/scripts/zones/Valkurm_Dunes/npcs/Song_Runes.lua b/scripts/zones/Valkurm_Dunes/npcs/Song_Runes.lua index 9de30bcf2d8..c50295a26b0 100755 --- a/scripts/zones/Valkurm_Dunes/npcs/Song_Runes.lua +++ b/scripts/zones/Valkurm_Dunes/npcs/Song_Runes.lua @@ -4,35 +4,13 @@ -- Finishes Quest: Path of the Bard -- !pos -721 -7 102 103 ----------------------------------- -local ID = zones[xi.zone.VALKURM_DUNES] ------------------------------------ ---@type TNpcEntity local entity = {} entity.onTrigger = function(player, npc) - -- PATH OF THE BARD (Bard Flag) - if - player:getQuestStatus(xi.questLog.JEUNO, xi.quest.id.jeuno.PATH_OF_THE_BARD) == xi.questStatus.QUEST_AVAILABLE and - player:getCharVar('PathOfTheBard_Event') == 1 - then - player:startEvent(2) - - -- DEFAULT DIALOG - else - player:messageSpecial(ID.text.SONG_RUNES_DEFAULT) - end end entity.onEventFinish = function(player, csid, option, npc) - if csid == 2 then - npcUtil.giveCurrency(player, 'gil', 3000) - player:addTitle(xi.title.WANDERING_MINSTREL) - player:unlockJob(xi.job.BRD) -- Bard - player:messageSpecial(ID.text.UNLOCK_BARD) --You can now become a bard! - player:setCharVar('PathOfTheBard_Event', 0) - player:addFame(xi.fameArea.JEUNO, 30) - player:completeQuest(xi.questLog.JEUNO, xi.quest.id.jeuno.PATH_OF_THE_BARD) - end end return entity