-
Notifications
You must be signed in to change notification settings - Fork 659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lua, quest] Converts BRD unlock and BRD AF1 to IF #6682
base: base
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Co-authored-by: hooksta4 <[email protected]>
- Loading branch information
There are no files selected for viewing
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adjusted to the example |
||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As written, there is a bug with this part of the code. If the player delays checking the Waters of Oblivion until after Tros has fully despawned, Tros will then respawn and agro onto the player while they are in the final cutscene. if
nmKilled == 0 and
player:hasKeyItem(xi.ki.MERTAIRES_BRACELET) and
npcUtil.popFromQM(player, npc, ID.mob.TROS, { claim = true, hide = 0 })
then Swap the NM killed check to the top (or at least above the NM spawn) to prevent this from happening. Since you want to make sure all checks are passed before spawning the NM. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I'll keep that in mind for future quests. Got it adjusted, along with the NPC commands below. |
||
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 |
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This !gotoid as well. |
||
-- ----------------------------------- | ||
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 |
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 }, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swap these !gotoid checks to !pos this way if ids ever shift this won't cause issues or need to be updated in the future.