Skip to content

Commit

Permalink
fix logic and messages for quest Your Crystal Ball
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbradleym committed May 31, 2024
1 parent 1242529 commit fd32bc5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.
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!
KOROU_FORTUNE = 7502, -- You are now ready to have your fortune told by Korou-Morou
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
5 changes: 4 additions & 1 deletion scripts/zones/Lower_Jeuno/npcs/Kurou-Morou.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ entity.onTrigger = function(player, npc)
yourCrystalBall == xi.questStatus.QUEST_AVAILABLE
then
player:startEvent(194) -- Start 'Your Crystal Ball' quest
elseif yourCrystalBall == xi.questStatus.QUEST_ACCEPTED then
player:startEvent(191) -- reminder to get an Ahriman Lens and turn it into a divination sphere

elseif
jeunoFame >= 5 and
Expand Down Expand Up @@ -96,7 +98,8 @@ entity.onEventFinish = function(player, csid, option, npc)
player:addTitle(xi.title.FORTUNE_TELLER_IN_TRAINING)
player:addFame(xi.fameArea.JEUNO, 30)
player:tradeComplete()
player:completeQuest(xi.questLog.JEUNO, xi.quest.id.jeuno.YOUR_CRYSTAL_BALL)
player:completeQuest(xi.quest.log_id.JEUNO, xi.quest.id.jeuno.YOUR_CRYSTAL_BALL)
player:messageSpecial(ID.text.KOROU_FORTUNE)

elseif csid == 204 and option == 0 then
player:incrementCharVar('QuestNeverToReturn_prog', 1) -- Keep track of how many times the players fortune has been read
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Maze_of_Shakhrami/DefaultActions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ local ID = zones[xi.zone.MAZE_OF_SHAKHRAMI]

return {
['Fossil_Rock'] = { messageSpecial = ID.text.JUST_A_ROCK },
['Rockwell'] = { messageSpecial = ID.text.WATER_POOL },
}
4 changes: 4 additions & 0 deletions scripts/zones/Maze_of_Shakhrami/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ zones[xi.zone.MAZE_OF_SHAKHRAMI] =
NOTHING_FOSSIL = 7065, -- It looks like a rock with fossils embedded in it. Nothing out of the ordinary.
NO_NEED_INVESTIGATE = 7069, -- There is no need to investigate it any further.
JUST_A_ROCK = 7072, -- It is just a rock. There is no need to investigate it.
SUBMERGE = 7087, -- You submerged the <item> into the pool of water.
CANNOT_SUBMERGE = 7088, -- You cannot submerge more than one Ahriman Lens at a time.
WATER_POOL = 7089, -- Water forms a pool here.
NOT_READY = 7090, -- It does not seem to have become a <item> yet. You need to wait a bit longer.
CONQUEST_BASE = 7092, -- Tallying conquest results...
DEVICE_NOT_WORKING = 7265, -- The device is not working.
SYS_OVERLOAD = 7274, -- Warning! Sys...verload! Enterin...fety mode. ID eras...d.
Expand Down
30 changes: 18 additions & 12 deletions scripts/zones/Maze_of_Shakhrami/npcs/Rockwell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,29 @@ local ID = zones[xi.zone.MAZE_OF_SHAKHRAMI]
local entity = {}

entity.onTrade = function(player, npc, trade)
if
player:getQuestStatus(xi.questLog.JEUNO, xi.quest.id.jeuno.YOUR_CRYSTAL_BALL) == xi.questStatus.QUEST_ACCEPTED and
npcUtil.tradeHas(trade, xi.item.AHRIMAN_LENS)
then
player:setCharVar('QuestYourCrystalBall_prog', 1)
player:confirmTrade(trade)
if player:getQuestStatus(xi.quest.log_id.JEUNO, xi.quest.id.jeuno.YOUR_CRYSTAL_BALL) == xi.questStatus.QUEST_ACCEPTED then
if npcUtil.tradeHasExactly(trade, { { xi.item.AHRIMAN_LENS, 1 } }) then
if player:getCharVar('QuestYourCrystalBall_prog') == 0 then
player:confirmTrade()
player:setCharVar('QuestYourCrystalBall_prog', os.time() + 30) -- current retail capture shows 30s time to pickup
player:messageSpecial(ID.text.SUBMERGE, xi.item.AHRIMAN_LENS)
else
player:messageSpecial(ID.text.CANNOT_SUBMERGE, xi.item.AHRIMAN_LENS) -- don't initiate submerge if previous one hasn't been collected
end
end
end
end

entity.onTrigger = function(player, npc)
if
player:getQuestStatus(xi.questLog.JEUNO, xi.quest.id.jeuno.YOUR_CRYSTAL_BALL) == xi.questStatus.QUEST_ACCEPTED and
player:getCharVar('QuestYourCrystalBall_prog') == 1
player:getQuestStatus(xi.quest.log_id.JEUNO, xi.quest.id.jeuno.YOUR_CRYSTAL_BALL) == xi.questStatus.QUEST_ACCEPTED and
player:getCharVar('QuestYourCrystalBall_prog') ~= 0 -- if 0 then there is no currently submerged lens
then
player:startEvent(52)
else
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
if player:getCharVar('QuestYourCrystalBall_prog') < os.time() then
player:startEvent(52):progress()
else
player:messageSpecial(ID.text.NOT_READY, 0, xi.item.DIVINATION_SPHERE):progress()
end
end
end

Expand All @@ -34,7 +40,7 @@ end

entity.onEventFinish = function(player, csid, option, npc)
if csid == 52 and npcUtil.giveItem(player, xi.item.DIVINATION_SPHERE) then
player:setCharVar('QuestYourCrystalBall_prog', 0)
player:setCharVar('QuestYourCrystalBall_prog', 0) -- set to 0 indicating divination sphere has been collected and no lens presently submerged
end
end

Expand Down

0 comments on commit fd32bc5

Please sign in to comment.