Skip to content

Commit

Permalink
[lua, quest] Converts BRD unlock and BRD AF1 to IF
Browse files Browse the repository at this point in the history
Co-authored-by: hooksta4 <[email protected]>
  • Loading branch information
CriticalXI and hooksta4 committed Jan 10, 2025
1 parent e97a568 commit c3ce32d
Show file tree
Hide file tree
Showing 11 changed files with 196 additions and 78 deletions.
2 changes: 1 addition & 1 deletion scripts/globals/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/quests/jeuno/A_Minstrel_In_Despair.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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] =
Expand Down
130 changes: 130 additions & 0 deletions scripts/quests/jeuno/BRD_AF1_Painful_Memory.lua
Original file line number Diff line number Diff line change
@@ -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
50 changes: 50 additions & 0 deletions scripts/quests/jeuno/Path_of_the_Bard.lua
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions scripts/zones/Lower_Jeuno/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ zones[xi.zone.LOWER_JEUNO] =
CHOCOBO_DIALOG = 7336, -- Hmph.
MERTAIRE_MALLIEBELL_LEFT = 7417, -- Ugh... Malliebell... This time she's left me forever...
MERTAIRE_DEFAULT = 7442, -- Who are you? Leave me alone!
MERTAIRE_MINSTREL = 7452, -- Wait, could he be...? Naw, he couldn't be.
ITS_LOCKED = 7604, -- It's locked.
PAWKRIX_SHOP_DIALOG = 7652, -- Hey, we're fixin' up some stew. Gobbie food's good food!
AMALASANDA_SHOP_DIALOG = 7700, -- Welcome to the Tenshodo. You want something, we got it. We got all kinds of special merchandise you won't find anywhere else!
Expand Down
36 changes: 6 additions & 30 deletions scripts/zones/Lower_Jeuno/npcs/Mertaire.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,12 @@ end
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
Expand All @@ -49,6 +35,9 @@ 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
Expand All @@ -58,21 +47,8 @@ entity.onEventUpdate = function(player, csid, option, npc)
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
Expand Down
5 changes: 5 additions & 0 deletions scripts/zones/Ranguemont_Pass/DefaultActions.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
local ID = zones[xi.zone.RANGUEMONT_PASS]

return {
['Waters_of_Oblivion'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY },
}
4 changes: 0 additions & 4 deletions scripts/zones/Ranguemont_Pass/mobs/Tros.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
local entity = {}

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
21 changes: 0 additions & 21 deletions scripts/zones/Ranguemont_Pass/npcs/Waters_of_Oblivion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,12 @@ entity.onTrade = function(player, npc, trade)
end

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.onEventUpdate = function(player, csid, option, npc)
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
3 changes: 2 additions & 1 deletion scripts/zones/Valkurm_Dunes/DefaultActions.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local ID = zones[xi.zone.VALKURM_DUNES]

return {
['qm3'] = { messageSpecial = ID.text.YOU_SENSE_AN_EVIL_PRESENCE },
['qm3'] = { messageSpecial = ID.text.YOU_SENSE_AN_EVIL_PRESENCE },
['Song_Runes'] = { messageSpecial = ID.text.SONG_RUNES_DEFAULT },
}
20 changes: 0 additions & 20 deletions scripts/zones/Valkurm_Dunes/npcs/Song_Runes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,12 @@ entity.onTrade = function(player, npc, trade)
end

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.onEventUpdate = function(player, csid, option, npc)
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

0 comments on commit c3ce32d

Please sign in to comment.