From 3750cf74c794da2b1230252c297fb309bba699ed Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Thu, 7 Nov 2024 19:10:16 -0300 Subject: [PATCH] Kilmaresh Quest - Fafnar's Wrath and Organization Storages --- data-otservbr-global/lib/core/storages.lua | 131 +++++++-------- .../kilmaresh/urmahlullu_the_immaculate.lua | 7 +- data-otservbr-global/npc/alyxo.lua | 86 +++++----- .../npc/ambassador_of_rathleton.lua | 42 +++-- data-otservbr-global/npc/eshaya.lua | 153 +++++++++--------- data-otservbr-global/npc/faloriel.lua | 53 +++--- data-otservbr-global/npc/gail.lua | 8 +- data-otservbr-global/npc/kallimae.lua | 48 +++--- data-otservbr-global/npc/moe.lua | 104 ++++++------ data-otservbr-global/npc/narsai.lua | 28 ++-- data-otservbr-global/npc/saideh.lua | 12 +- data-otservbr-global/npc/shimun.lua | 28 ++-- data-otservbr-global/npc/tefrit.lua | 28 ++-- data-otservbr-global/npc/the_empress.lua | 41 ++--- data-otservbr-global/npc/the_librarian.lua | 37 +++-- data-otservbr-global/npc/yonan.lua | 28 ++-- .../scripts/actions/other/gems.lua | 7 +- .../creaturescripts/customs/freequests.lua | 4 +- .../1-fafnars-wrath/2-ambassadors-treason.lua | 18 +-- .../1-fafnars-wrath/6-mind-travel.lua | 8 +- .../1-fafnars-wrath/7-four-masks.lua | 13 +- .../8-blessing-the-statues.lua | 6 +- .../quests/kilmaresh/actions_augerfun.lua | 2 +- .../quests/kilmaresh/actions_basin.lua | 4 +- .../quests/kilmaresh/actions_books.lua | 14 -- .../quests/kilmaresh/actions_cagekey.lua | 4 +- .../quests/kilmaresh/actions_coruja.lua | 4 +- .../kilmaresh/actions_glasshoneyfun.lua | 2 +- .../scripts/quests/kilmaresh/actions_lyre.lua | 4 +- .../quests/kilmaresh/actions_peeler.lua | 4 +- .../quests/kilmaresh/actions_peelerfun.lua | 2 +- .../kilmaresh/actions_pickenchanted.lua | 2 +- .../quests/kilmaresh/actions_sangra.lua | 4 +- .../quests/kilmaresh/actions_scissors.lua | 4 +- .../quests/kilmaresh/actions_scissorsfun.lua | 76 ++++----- .../quests/kilmaresh/actions_tortoise.lua | 4 +- .../quests/kilmaresh/actions_tumulo.lua | 4 +- .../quests/kilmaresh/actions_tumuloerro.lua | 4 +- .../actions_urmahlullu_the_immaculate.lua} | 0 .../kilmaresh/creaturescripts_bragrumol.lua | 4 +- .../kilmaresh/creaturescripts_fafnar.lua | 4 +- .../kilmaresh/creaturescripts_mozradek.lua | 4 +- .../creaturescripts_urmahlullu_change.lua} | 0 .../kilmaresh/creaturescripts_xogixath.lua | 4 +- .../startup/tables/door_quest.lua | 52 +++--- data-otservbr-global/startup/tables/item.lua | 13 ++ data-otservbr-global/startup/tables/tile.lua | 3 +- 47 files changed, 561 insertions(+), 551 deletions(-) delete mode 100644 data-otservbr-global/scripts/quests/kilmaresh/actions_books.lua rename data-otservbr-global/scripts/{actions/bosses_levers/urmahlullu_the_immaculate.lua => quests/kilmaresh/actions_urmahlullu_the_immaculate.lua} (100%) rename data-otservbr-global/scripts/{creaturescripts/monster/urmahlullu_change.lua => quests/kilmaresh/creaturescripts_urmahlullu_change.lua} (100%) diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index cbc4f493748..84209c26eec 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -127,66 +127,6 @@ Storage = { ThirdStage = 50003, Crystal = 50004, }, - Kilmaresh = { - -- Reserved storage from 50015 - 50049 - Questline = 50015, - First = { - Title = 50016, - }, - Second = { - Investigating = 50017, - }, - Third = { - Recovering = 50018, - }, - Fourth = { - Moe = 50019, - MoeTimer = 50020, - }, - Fifth = { - Memories = 50021, - MemoriesShards = 50022, - }, - Sixth = { - Favor = 50023, - FourMasks = 50024, - BlessedStatues = 50025, - }, - Set = { - Ritual = 50026, - }, - Eighth = { - Yonan = 50027, - Narsai = 50028, - Shimun = 50029, - Tefrit = 50030, - }, - Nine = { - Owl = 50031, - }, - Tem = { - Bleeds = 50032, - }, - Eleven = { - Basin = 50033, - }, - Twelve = { - Boss = 50034, - Bragrumol = 50035, - Mozradek = 50036, - Xogixath = 50037, - }, - Thirteen = { - Fafnar = 50038, - Lyre = 50039, - Presente = 50040, - }, - Fourteen = { - Remains = 50041, - }, - AccessDoor = 50043, - CatacombDoors = 55047, - }, DeeplingBosses = { -- Reserved storage from 50075 - 50079 Jaul = 50075, @@ -2858,15 +2798,76 @@ Storage = { }, }, CobraBastion = { - Questline = 52311, + Questline = 46891, }, }, HandOfTheInquisitionOutfits = { - Outfits = 52312, - Addon1 = 52313, - Addon2 = 52314, + Outfits = 46892, + Addon1 = 46893, + Addon2 = 46894, + }, + KilmareshQuest = { + Questline = 46895, + First = { + Title = 46896, + }, + Second = { + Investigating = 46897, + }, + Third = { + Recovering = 46898, + }, + Fourth = { + Moe = 46899, + MoeTimer = 46890, + }, + Fifth = { + Memories = 46891, + MemoriesShards = 46892, + }, + Sixth = { + Favor = 46893, + FourMasks = 46894, + BlessedStatues = 46895, + IvoryMask = 46896, + MirrorMask = 46897, + SilverMask = 46898, + GryphonMask = 46899, + }, + Set = { + Ritual = 46900, + }, + Eighth = { + Yonan = 46901, + Narsai = 46903, + Shimun = 46904, + Tefrit = 46905, + }, + Nine = { + Owl = 46906, + }, + Tem = { + Bleeds = 46907, + }, + Eleven = { + Basin = 46908, + }, + Twelve = { + Boss = 46909, + Bragrumol = 46910, + Mozradek = 46911, + Xogixath = 46912, + }, + Thirteen = { + Fafnar = 46913, + Lyre = 46914, + Presente = 46915, + }, + Fourteen = { + Remains = 46916, + }, + AccessDoor = 46917, }, - Kilmaresh = {}, Orcsoberfest = {}, }, U12_30 = { -- update 12.30 - Reserved Storages 47001 - 47200 diff --git a/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_immaculate.lua b/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_immaculate.lua index 8f41b9c404b..2cefeec88e2 100644 --- a/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_immaculate.lua +++ b/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_immaculate.lua @@ -20,6 +20,10 @@ monster.corpse = 0 monster.speed = 95 monster.manaCost = 0 +monster.events = { + "UrmahlulluChanges", +} + monster.changeTarget = { interval = 4000, chance = 10, @@ -57,9 +61,6 @@ monster.flags = { canWalkOnPoison = true, } -monster.events = { - "UrmahlulluChanges", -} monster.light = { level = 0, color = 0, diff --git a/data-otservbr-global/npc/alyxo.lua b/data-otservbr-global/npc/alyxo.lua index f8fd752ba48..35a8f759252 100644 --- a/data-otservbr-global/npc/alyxo.lua +++ b/data-otservbr-global/npc/alyxo.lua @@ -49,15 +49,15 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) - elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then + elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.First.Mission, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5) npcHandler:setTopic(playerId, 20) end return true @@ -73,17 +73,17 @@ local function creatureSayCallback(npc, creature, type, message) -- Mission 3 Steal The Ambassador Ring if MsgContains(message, "mission") then - if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 1 then npcHandler:setTopic(playerId, 1) end npcHandler:say({ "Could you kill 3 bosses for me?" }, npc, creature) -- needs review, this is not the speech of the global elseif MsgContains(message, "yes") then - if npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 1 then + if npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 1 then npcHandler:say({ "Come back as soon as you kill all 3 bosses." }, npc, creature) -- needs review, this is not the speech of the global - player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 2) - player:setStorageValue(Storage.Kilmaresh.Twelve.Bragrumol, 1) - player:setStorageValue(Storage.Kilmaresh.Twelve.Mozradek, 1) - player:setStorageValue(Storage.Kilmaresh.Twelve.Xogixath, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Bragrumol, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Mozradek, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Xogixath, 1) npcHandler:setTopic(playerId, 2) else npcHandler:say({ "Sorry, you do not have access." }, npc, creature) @@ -91,80 +91,80 @@ local function creatureSayCallback(npc, creature, type, message) end end -- Mission 3 Steal The Ambassador Ring - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 2 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 2 then npcHandler:say({ "Did you manage to face all 3 bosses?" }, npc, creature) -- needs review, this is not the speech of the global npcHandler:setTopic(playerId, 3) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Twelve.Bragrumol) == 2 and player:getStorageValue(Storage.Kilmaresh.Twelve.Mozradek) == 2 and player:getStorageValue(Storage.Kilmaresh.Twelve.Xogixath) == 2 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Bragrumol) == 2 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Mozradek) == 2 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Xogixath) == 2 then npcHandler:say({ "I am very satisfied." }, npc, creature) -- needs review, this is not the speech of the global - player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 3) npcHandler:setTopic(playerId, 4) else npcHandler:say({ "Sorry." }, npc, creature) npcHandler:setTopic(playerId, 0) end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then - if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then npcHandler:say({ "Could you help me with some more work?" }, npc, creature) -- needs review, this is not the speech of the global npcHandler:setTopic(playerId, 5) npcHandler:setTopic(playerId, 5) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then - if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then npcHandler:say({ "Kill 300 members of the Fafnar cult, help me find Ivory Lyre and help me find an animal to stone." }, npc, creature) -- needs review, this is not the speech of the global - player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 4) - player:setStorageValue(Storage.Kilmaresh.Thirteen.Fafnar, 1) - player:setStorageValue(Storage.Kilmaresh.Thirteen.Lyre, 1) - player:setStorageValue(Storage.Kilmaresh.Thirteen.Presente, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 4) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente, 1) npcHandler:setTopic(playerId, 6) else npcHandler:say({ "Sorry." }, npc, creature) npcHandler:setTopic(playerId, 0) end end - if MsgContains(message, "report") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then + if MsgContains(message, "report") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then npcHandler:say({ "Have you finished killing the 300 members of Fafnar's cult?" }, npc, creature) -- needs review, this is not the speech of the global npcHandler:setTopic(playerId, 7) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 7 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 7 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then npcHandler:say({ "Thanks. You killed the 300 members of the Fafnar cult." }, npc, creature) -- needs review, this is not the speech of the global - player:setStorageValue(Storage.Kilmaresh.Thirteen.Fafnar, 301) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar, 301) npcHandler:setTopic(playerId, 8) else npcHandler:say({ "Sorry." }, npc, creature) npcHandler:setTopic(playerId, 0) end end - if MsgContains(message, "report") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 then + if MsgContains(message, "report") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 then npcHandler:say({ "Did you manage to find Lyre?" }, npc, creature) -- needs review, this is not the speech of the global npcHandler:setTopic(playerId, 9) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 9 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 and player:getItemById(31447, 1) then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 9 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 and player:getItemById(31447, 1) then player:removeItem(31447, 1) npcHandler:say({ "Thanks. I was looking for Lyre for a long time." }, npc, creature) -- needs review, this is not the speech of the global - player:setStorageValue(Storage.Kilmaresh.Thirteen.Lyre, 4) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 4) else npcHandler:say({ "Sorry." }, npc, creature) npcHandler:setTopic(playerId, 0) end end - if MsgContains(message, "report") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 then + if MsgContains(message, "report") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 then npcHandler:say({ "Did you manage to find Small Tortoise?" }, npc, creature) -- needs review, this is not the speech of the global npcHandler:setTopic(playerId, 11) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 11 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 and player:getItemById(31445, 1) then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 11 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 and player:getItemById(31445, 1) then player:removeItem(31445, 1) npcHandler:say({ "Thanks. I was looking for Small Tortoise." }, npc, creature) -- needs review, this is not the speech of the global - player:setStorageValue(Storage.Kilmaresh.Thirteen.Presente, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente, 3) npcHandler:setTopic(playerId, 12) else npcHandler:say({ "Sorry." }, npc, creature) @@ -187,17 +187,17 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 0) end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then npcHandler:say({ "Did you finish the 3 jobs I gave you?" }, npc, creature) -- needs review, this is not the speech of the global npcHandler:setTopic(playerId, 13) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 13 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 13 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then player:addAchievement("Sculptor Apprentice", 'Congratulations! You earned the achievement "Sculptor Apprentice".') player:addItem(31574, 1) npcHandler:say({ "Congratulations, you have completed the 3 jobs I gave you." }, npc, creature) -- needs review, this is not the speech of the global - player:setStorageValue(Storage.Kilmaresh.Fourteen.Remains, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains, 1) npcHandler:setTopic(playerId, 14) else npcHandler:say({ "Sorry." }, npc, creature) diff --git a/data-otservbr-global/npc/ambassador_of_rathleton.lua b/data-otservbr-global/npc/ambassador_of_rathleton.lua index fa120c51941..0e9e1953d30 100644 --- a/data-otservbr-global/npc/ambassador_of_rathleton.lua +++ b/data-otservbr-global/npc/ambassador_of_rathleton.lua @@ -58,23 +58,31 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end -keywordHandler:addKeyword({ "present" }, StdModule.say, { - npcHandler = npcHandler, - text = "This is a very beautiful ring. Thank you for this generous present!", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Third.Recovering) == 2 and player:getItemById(31263, true) -end, function(player) - player:removeItem(31263, 1) - player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 1) - player:setStorageValue(Storage.Kilmaresh.Third.Recovering, 3) -end) - -keywordHandler:addKeyword({ "present" }, StdModule.say, { - npcHandler = npcHandler, - text = "Didn't you bring my gift?", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Third.Recovering) == 2 -end) +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "present") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering) == 2 then + if player:getItemById(31263, true) then + npcHandler:say("This is a very beautiful ring. Thank you for this generous present!", npc, creature) + player:removeItem(31263, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering, 3) + else + npcHandler:say("Didn't you bring my gift?", npc, creature) + end + else + npcHandler:say("I don't need a present right now. Thank you.", npc, creature) + end + end + + return true +end + npcHandler:setMessage(MESSAGE_GREET, "Greetings, friend.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") diff --git a/data-otservbr-global/npc/eshaya.lua b/data-otservbr-global/npc/eshaya.lua index 20f39c50dd8..b5038680f99 100644 --- a/data-otservbr-global/npc/eshaya.lua +++ b/data-otservbr-global/npc/eshaya.lua @@ -58,86 +58,78 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end --- First - -local firstMission = keywordHandler:addKeyword({ "mission" }, StdModule.say, { - npcHandler = npcHandler, - text = "I'm willing to admit that I need help. And the help of someone who is not from {Issavi} at that. But the task could be dangerous and you would become embroiled in the politics and court intrigues of {Kilmaresh}. Will you help me anyhow?", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == -1 -end, function(player) - player:setStorageValue(Storage.Kilmaresh.First.Title, 1) -end) - -firstMission:addChildKeyword( - { "yes" }, - StdModule.say, - { - npcHandler = npcHandler, - text = { - "You are a noble soul! So listen: for many decades, over a century actually, the city of {Rathleton} had an Ambassador here in {Issavi}. ...", - "Kilmaresh and Oramond maintain important commercial relations, and for this reason Rathleton has an envoy here. In the past, the relations were good but now ...", - "I hate to admit it but I heavily suspect that the current Ambassador is a traitor and consorts with the forbidden cult of Fafnar. I have several hints and Kallimae saw it in one of her visions ...", - "But the vision of a Kilmareshian seer is no proof they will ever accept in Rathleton. And without proof we can't banish the Ambassador, this would cause major diplomatic fallout or even a war. I can't risk that. ...", - "I need unequivocal evidence that the Ambassador conspires with the Fafnar cultists. Please go to his residence in the eastern part of the city and search for letters, journals ... anything that could prove him guilty.", - }, - }, - nil, - function(player) - player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 1) - end -) - --- Second - -keywordHandler:addKeyword({ "mission" }, StdModule.say, { - npcHandler = npcHandler, - text = { - "It seems that he destroyed every visible evidence of his treason. That's very unfortunate and I see only one remaining possibility: You need to see the {Ambassador}'s memories. ...", - "But there is only one way to achieve this: You have to find a Ring of {Secret Thoughts}. Legend has it that a monstrous being called {Urmahlullu} has such a ring. If the myths are true you can find this creature in a subterranean tomb south of Issavi.", - }, -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 5 -end, function(player) - player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 6) - player:setStorageValue(Storage.Kilmaresh.Third.Recovering, 1) -end) - -keywordHandler:addKeyword({ "mission" }, StdModule.say, { - npcHandler = npcHandler, - text = "You haven't investigated all the evidence.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Second.Investigating) >= 0 and player:getStorageValue(Storage.Kilmaresh.Second.Investigating) < 5 -end) - --- Third - -keywordHandler:addKeyword({ "ring" }, StdModule.say, { - npcHandler = npcHandler, - text = "You found the Ring of {Secret Thoughts}! Well done! Now give it to the {Ambassador} as a present. He's a peacock and will accept such a precious gift for sure. As soon as he wears it, his memories will be stored in the ring.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Third.Recovering) == 1 and player:getItemById(31263, true) -end, function(player) - player:setStorageValue(Storage.Kilmaresh.Third.Recovering, 2) -end) - -keywordHandler:addKeyword({ "ring" }, StdModule.say, { - npcHandler = npcHandler, - text = "You don't have the ring I need.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Third.Recovering) == 1 -end) - --- Fifth - -keywordHandler:addKeyword({ "mission" }, StdModule.say, { - npcHandler = npcHandler, - text = "This is the proof we need! Very well done! You have to report this to our {Empress}. She will grant you an audience now.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fifth.Memories) == 4 -end, function(player) - player:setStorageValue(Storage.Kilmaresh.Fifth.Memories, 5) -end) +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "mission") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) < 1 then + npcHandler:say("Very good. But now you need the Ring of Secret Thoughts back in order to extract the Ambassador's memories.", npc, creature) + npcHandler:setTopic(playerId, 2) + elseif player:getItemById(31263, true) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering) < 2 then + npcHandler:say("You found the Ring of Secret Thoughts! Well done! Now give it to the Ambassador as a present. He's a peacock and will accept such a precious gift for sure. As soon as he wears it, his memories will be stored in the ring.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering, 2) + npcHandler:setTopic(playerId, 0) + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Title) < 1 then + npcHandler:say("I'm willing to admit that I need help. And the help of someone who is not from {Issavi} at that. But the task could be dangerous and you would become embroiled in the politics and court intrigues of {Kilmaresh}. Will you help me anyhow?", npc, creature) + npcHandler:setTopic(playerId, 1) + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 5 then + npcHandler:say({ + "It seems that he destroyed every visible evidence of his treason. That's very unfortunate and I see only one remaining possibility: You need to see the {Ambassador}'s memories. ...", + "But there is only one way to achieve this: You have to find a Ring of {Secret Thoughts}. Legend has it that a monstrous being called {Urmahlullu} has such a ring. If the myths are true you can find this creature in a subterranean tomb south of Issavi.", + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 6) + npcHandler:setTopic(playerId, 0) + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) == 4 then + npcHandler:say("This is the proof we need! Very well done! You have to report this to our {Empress}. She will grant you an audience now.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, 5) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("You haven't completed your mission yet. Keep searching!", npc, creature) + npcHandler:setTopic(playerId, 0) + end + elseif MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 1 then + npcHandler:say({ + "You are a noble soul! So listen: for many decades, over a century actually, the city of {Rathleton} had an Ambassador here in {Issavi}. ...", + "{Kilmaresh} and {Oramond} maintain important commercial relations, and for this reason Rathleton has an envoy here. In the past, the relations were good but now ..", + "I hate to admit it but I heavily suspect that the current {Ambassador} is a traitor and consorts with the forbidden cult of {Fafnar}. I have several hints and {Kallimae} saw it in one of her visions. ...", + "But the vision of a Kilmareshian seer is no proof they will ever accept in Rathleton. And without proof we can't banish the {Ambassador}, this would cause major diplomatic fallout or even a war. I can't risk that. ...", + "I need unequivocal evidence that the {Ambassador} conspires with the Fafnar cultists. Please go to his residence in the eastern part of the city and search for letters, journals ... anything that could prove him guilty.", + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Title, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 1) + npcHandler:setTopic(playerId, 0) + end + elseif MsgContains(message, "theft") then + if npcHandler:getTopic(playerId) == 3 then + npcHandler:say("I don't know whether you are experienced in such things. If not, you could ask somebody who is. But I'm not sure where in Issavi you should look to hire a thief.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 1) + npcHandler:setTopic(playerId, 0) + end + elseif MsgContains(message, "ring of secret thoughts back") then + if npcHandler:getTopic(playerId) == 2 then + npcHandler:say("I guess claiming back a present would be a bit suspicious. You'll have to find another way. I resent thinking about theft but sometimes, desperate times call for desperate measures.", npc, creature) + npcHandler:setTopic(playerId, 3) + end + elseif MsgContains(message, "ring") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 4 then + npcHandler:say("You got the ring back? Very well done! Now search for the memories that will prove the Ambassador's treason. I don't know much about ancient artefacts but you could ask the librarian in the palace. I'm sure he knows something helpful.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 5) + npcHandler:setTopic(playerId, 0) + end + elseif MsgContains(message, "empress") then + npcHandler:say("Good luck on your audience with the Empress. May Kilmaresh prosper.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + + return true +end + npcHandler:setMessage(MESSAGE_GREET, "Suon's and Bastesh's blessing, dear guest!") npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") @@ -145,6 +137,7 @@ npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") npcHandler:setCallback(CALLBACK_SET_INTERACTION, onAddFocus) npcHandler:setCallback(CALLBACK_REMOVE_INTERACTION, onReleaseFocus) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) + npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) -- npcType registering the npcConfig table diff --git a/data-otservbr-global/npc/faloriel.lua b/data-otservbr-global/npc/faloriel.lua index 7d259c72ea3..edf7fc68a0a 100644 --- a/data-otservbr-global/npc/faloriel.lua +++ b/data-otservbr-global/npc/faloriel.lua @@ -57,29 +57,36 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end -local potionTalk = keywordHandler:addKeyword({ "ring" }, StdModule.say, { - npcHandler = npcHandler, - text = "So, the Librarian sent you. Well, yes, I have a vial of the hallucinogen you need. I'll give it to you for 1000 gold. Do you agree?", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fifth.Memories) == 1 -end) - -potionTalk:addChildKeyword({ "yes" }, StdModule.say, { - npcHandler = npcHandler, - text = "Great. Here, take it.", -}, function(player) - return player:getMoney() + player:getBankBalance() >= 1000 -end, function(player) - player:removeMoneyBank(1000) - player:addItem(31350, 1) -- flask of hallucinogen -end) - -potionTalk:addChildKeyword({ "yes" }, StdModule.say, { - npcHandler = npcHandler, - text = "You do not have enough money.", -}, function(player) - return player:getMoney() + player:getBankBalance() < 1000 -end) +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "ring") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) == 1 then + npcHandler:say("So, the Librarian sent you. Well, yes, I have a vial of the hallucinogen you need. I'll give it to you for 1000 gold. Do you agree?", npc, creature) + npcHandler:setTopic(playerId, 1) + else + npcHandler:say("I don't have anything to offer you regarding a ring.", npc, creature) + end + + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 then + if player:getMoney() + player:getBankBalance() >= 1000 then + npcHandler:say("Great. Here, take it.", npc, creature) + player:removeMoneyBank(1000) + player:addItem(31350, 1) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("You do not have enough money.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + end + + return true +end npcHandler:setMessage(MESSAGE_GREET, "Greetings, dear guest and welcome to my {potion} shop.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") diff --git a/data-otservbr-global/npc/gail.lua b/data-otservbr-global/npc/gail.lua index e0b6062908b..13cf1eff716 100644 --- a/data-otservbr-global/npc/gail.lua +++ b/data-otservbr-global/npc/gail.lua @@ -54,15 +54,15 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) - elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then + elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.First.Mission, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5) npcHandler:setTopic(playerId, 20) end return true diff --git a/data-otservbr-global/npc/kallimae.lua b/data-otservbr-global/npc/kallimae.lua index 61be4cb34a9..b85062c760d 100644 --- a/data-otservbr-global/npc/kallimae.lua +++ b/data-otservbr-global/npc/kallimae.lua @@ -54,15 +54,15 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) - elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then + elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.First.Mission, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5) npcHandler:setTopic(playerId, 20) end return true @@ -76,55 +76,55 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) == 11 then - if player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) == 11 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) == 11 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) == 11 then npcHandler:say({ "Some residents are in need of ingredients to finish a ritual. You can help?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) npcHandler:setTopic(playerId, 1) end elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) == 11 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) == 11 then npcHandler:say({ "Search for the NPCs Yonan, Narsai, Shimun and Tefrit." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Set.Ritual, 1) - player:setStorageValue(Storage.Kilmaresh.Set.Yonan, 1) - player:setStorageValue(Storage.Kilmaresh.Set.Narsai, 1) - player:setStorageValue(Storage.Kilmaresh.Set.Shimun, 1) - player:setStorageValue(Storage.Kilmaresh.Set.Tefrit, 1) - player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, 12) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Yonan, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Narsai, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Shimun, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Tefrit, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, 12) npcHandler:setTopic(playerId, 2) npcHandler:setTopic(playerId, 2) else npcHandler:say({ "Sorry." }, npc, creature) -- It needs to be revised, it's not the same as the global end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 3 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 3 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3 then npcHandler:say({ "Did you help some residents with ingredients?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 3) npcHandler:setTopic(playerId, 3) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 3 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 3 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3 then npcHandler:say({ "Thanks. I need you to go to 4 places indicated by Goddess Bastesh." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Nine.Owl, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Nine.Owl, 1) npcHandler:setTopic(playerId, 4) npcHandler:setTopic(playerId, 4) else npcHandler:say({ "Sorry." }, npc, creature) -- It needs to be revised, it's not the same as the global end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eleven.Basin) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eleven.Basin) == 1 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin) == 1 then npcHandler:say({ "Did you check all the points and bring the Symbol of Sun and Sea?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 5) npcHandler:setTopic(playerId, 5) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Kilmaresh.Eleven.Basin) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eleven.Basin) == 1 and player:getItemById(31431, 1) then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin) == 1 and player:getItemById(31431, 1) then player:addItem(31572, 1) npcHandler:say({ "Thanks. Here is your reward." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 1) - player:setStorageValue(Storage.Kilmaresh.Eleven.Basin, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin, 2) npcHandler:setTopic(playerId, 6) npcHandler:setTopic(playerId, 6) else diff --git a/data-otservbr-global/npc/moe.lua b/data-otservbr-global/npc/moe.lua index c96c03da8af..bf6672b8035 100644 --- a/data-otservbr-global/npc/moe.lua +++ b/data-otservbr-global/npc/moe.lua @@ -58,57 +58,59 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end -keywordHandler:addKeyword({ "help" }, StdModule.say, { - npcHandler = npcHandler, - text = "I guess I could do this, yes. But I have to impose a condition. If you bring me ten sphinx {feathers} I will steal this ring for you.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 1 -end, function(player) - player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 2) -end) - -keywordHandler:addKeyword({ "feathers" }, StdModule.say, { - npcHandler = npcHandler, - text = "Thank you! They look so pretty, I'm very pleased. Agreed, now I will steal the ring from the Ambassador of Rathleton. Just be patient, I have to wait for a good moment.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 2 and player:getItemById(31437, 10) -end, function(player) - player:removeItem(31437, 10) - player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 3) - player:setStorageValue(Storage.Kilmaresh.Fourth.MoeTimer, os.time() + 60 * 60) -- one hour -end) - -keywordHandler:addKeyword({ "feathers" }, StdModule.say, { - npcHandler = npcHandler, - text = "If you bring me ten sphinx {feathers} I will steal this ring for you.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 2 and not player:getItemById(31437, 10) -end) - -keywordHandler:addKeyword({ "ring" }, StdModule.say, { - npcHandler = npcHandler, - text = "You're arriving at the right time. I have the ring you asked for. It was not too difficult. I just had to wait until the Ambassador left his residence and then I climbed in through the window. Here it is.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 3 and player:getStorageValue(Storage.Kilmaresh.Fourth.MoeTimer) - os.time() <= 0 -end, function(player) - player:addItem(31306, 1) - player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 4) -end) - -keywordHandler:addKeyword({ "ring" }, StdModule.say, { - npcHandler = npcHandler, - text = "I will steal it, promised. I'm just waiting for a good moment.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 3 and player:getStorageValue(Storage.Kilmaresh.Fourth.MoeTimer) - os.time() > 0 -end) -keywordHandler:addKeyword({ "lyre" }, StdModule.say, { - npcHandler = npcHandler, - text = "I'm upset to accuse myself, the lyre is hidden in a tomb west of Kilmaresh.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 1 -end, function(player) - player:setStorageValue(Storage.Kilmaresh.Thirteen.Lyre, 2) -end) +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "help") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 1 then + npcHandler:say("I guess I could do this, yes. But I have to impose a condition. If you bring me ten sphinx feathers I will steal this ring for you.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 2) + end + elseif MsgContains(message, "feathers") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 2 then + if player:getItemById(31437, 10) then + npcHandler:say("Thank you! They look so pretty, I'm very pleased. Agreed, now I will steal the ring from the Ambassador of Rathleton. Just be patient, I have to wait for a good moment.", npc, creature) + player:removeItem(31437, 10) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.MoeTimer, os.time() + 60 * 60) + else + npcHandler:say("If you bring me ten sphinx feathers, I will steal this ring for you.", npc, creature) + end + else + npcHandler:say("You already delivered the feathers. Be patient while I steal the ring.", npc, creature) + end + elseif MsgContains(message, "ring") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 3 then + local timeLeft = player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.MoeTimer) - os.time() + if timeLeft <= 0 then + npcHandler:say("You're arriving at the right time. I have the ring you asked for. It was not too difficult. I just had to wait until the Ambassador left his residence and then I climbed in through the window. Here it is.", npc, creature) + player:addItem(31306, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 4) + else + npcHandler:say("I will steal it, promised. I'm just waiting for a good moment.", npc, creature) + end + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 1 then + npcHandler:say("I guess I could do this, yes. But I have to impose a condition. If you bring me ten sphinx feathers I will steal this ring for you.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 2) + else + npcHandler:say("You don't need this ring anymore.", npc, creature) + end + elseif MsgContains(message, "lyre") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 1 then + npcHandler:say("I'm upset to accuse myself, the lyre is hidden in a tomb west of Kilmaresh.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 2) + else + npcHandler:say("You already know about the lyre's location.", npc, creature) + end + end + + return true +end npcHandler:setMessage(MESSAGE_GREET, "Greetings, traveller. It seems, you're a {guest} here, just like me.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") diff --git a/data-otservbr-global/npc/narsai.lua b/data-otservbr-global/npc/narsai.lua index 42e375956f3..aed1a3e3576 100644 --- a/data-otservbr-global/npc/narsai.lua +++ b/data-otservbr-global/npc/narsai.lua @@ -54,15 +54,15 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) - elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then + elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.First.Mission, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5) npcHandler:setTopic(playerId, 20) end return true @@ -76,36 +76,36 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 1 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 1 then npcHandler:say({ "Could you help me do a ritual?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) npcHandler:setTopic(playerId, 1) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 1 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 1 then player:addItem(31714, 1) npcHandler:say({ "Here is the list of ingredients that are missing to complete the ritual. " }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Narsai, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai, 2) npcHandler:setTopic(playerId, 2) npcHandler:setTopic(playerId, 2) else npcHandler:say({ "Sorry." }, npc, creature) -- It needs to be revised, it's not the same as the global end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then npcHandler:say({ "Did you bring all the materials I informed you about?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 3) npcHandler:setTopic(playerId, 3) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 and player:getItemById(31335, 10) and player:getItemById(10279, 2) and player:getItemById(31332, 5) then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 and player:getItemById(31335, 10) and player:getItemById(10279, 2) and player:getItemById(31332, 5) then player:removeItem(31335, 10) player:removeItem(10279, 2) player:removeItem(31332, 5) npcHandler:say({ "Thank you this stage of the ritual is complete." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Narsai, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai, 3) npcHandler:setTopic(playerId, 4) npcHandler:setTopic(playerId, 4) else diff --git a/data-otservbr-global/npc/saideh.lua b/data-otservbr-global/npc/saideh.lua index 7b28c754a59..855a0616ff9 100644 --- a/data-otservbr-global/npc/saideh.lua +++ b/data-otservbr-global/npc/saideh.lua @@ -49,7 +49,7 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "Hello, my name is Saideh. Once this was the entry to the crypt of our heroes. One of the graves belongs to our beloved hero Dayyan. Nowadays it is not a good idea to visit this place.") npcHandler:setTopic(playerId, 1) end @@ -64,16 +64,16 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 1 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 1 then npcHandler:say({ " I would like you to visit the grave of our beloved hero Dayyan. His remains have to be reburied, because a horde of ogres controls this place. Do you want to start this holy mission?" }, npc, creature) npcHandler:setTopic(playerId, 1) npcHandler:setTopic(playerId, 1) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 1 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 1 then npcHandler:say({ "Well, I appreciate that. Good luck!" }, npc, creature) - player:setStorageValue(Storage.Kilmaresh.Fourteen.Remains, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains, 2) npcHandler:setTopic(playerId, 2) npcHandler:setTopic(playerId, 2) else diff --git a/data-otservbr-global/npc/shimun.lua b/data-otservbr-global/npc/shimun.lua index c3607feccd8..3d0281d98a4 100644 --- a/data-otservbr-global/npc/shimun.lua +++ b/data-otservbr-global/npc/shimun.lua @@ -54,15 +54,15 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) - elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then + elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.First.Mission, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5) npcHandler:setTopic(playerId, 20) end return true @@ -76,36 +76,36 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 1 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 1 then npcHandler:say({ "Could you help me do a ritual?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) npcHandler:setTopic(playerId, 1) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 1 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 1 then player:addItem(31715, 1) npcHandler:say({ "Here is the list with the missing ingredients to complete the ritual." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Shimun, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun, 2) npcHandler:setTopic(playerId, 2) npcHandler:setTopic(playerId, 2) else npcHandler:say({ "Sorry." }, npc, creature) -- It needs to be revised, it's not the same as the global end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 2 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 2 then npcHandler:say({ "Did you bring all the materials I informed you about? " }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 3) npcHandler:setTopic(playerId, 3) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 2 and player:getItemById(31340, 1) and player:getItemById(31336, 12) and player:getItemById(2874, 5) then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 2 and player:getItemById(31340, 1) and player:getItemById(31336, 12) and player:getItemById(2874, 5) then player:removeItem(31340, 1) player:removeItem(31336, 12) player:removeItem(2874, 5) npcHandler:say({ "Thank you this stage of the ritual is complete." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Shimun, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun, 3) npcHandler:setTopic(playerId, 4) npcHandler:setTopic(playerId, 4) else diff --git a/data-otservbr-global/npc/tefrit.lua b/data-otservbr-global/npc/tefrit.lua index 8ef2c821bd6..d30248282b8 100644 --- a/data-otservbr-global/npc/tefrit.lua +++ b/data-otservbr-global/npc/tefrit.lua @@ -54,15 +54,15 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) - elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then + elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.First.Mission, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5) npcHandler:setTopic(playerId, 20) end return true @@ -76,37 +76,37 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 1 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 1 then npcHandler:say({ "Could you help me do a ritual?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) npcHandler:setTopic(playerId, 1) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 1 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 1 then player:addItem(31716, 1) npcHandler:say({ "Here is the list with the missing ingredients to complete the ritual." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Tefrit, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, 2) npcHandler:setTopic(playerId, 2) npcHandler:setTopic(playerId, 2) else npcHandler:say({ "Sorry." }, npc, creature) end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 then npcHandler:say({ "Did you bring all the materials I informed you about?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 3) npcHandler:setTopic(playerId, 3) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 and player:getItemById(31329, 20) and player:getItemById(31339, 25) and player:getItemById(31330, 15) then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 and player:getItemById(31329, 20) and player:getItemById(31339, 25) and player:getItemById(31330, 15) then player:removeItem(10272, 5) player:removeItem(31329, 20) player:removeItem(31339, 25) player:removeItem(31330, 15) npcHandler:say({ "Thank you this stage of the ritual is complete." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Tefrit, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, 3) npcHandler:setTopic(playerId, 4) npcHandler:setTopic(playerId, 4) else diff --git a/data-otservbr-global/npc/the_empress.lua b/data-otservbr-global/npc/the_empress.lua index fdc475b546e..7b6fb8fd2b6 100644 --- a/data-otservbr-global/npc/the_empress.lua +++ b/data-otservbr-global/npc/the_empress.lua @@ -54,7 +54,14 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.Fifth.Memories) == 4 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) == 10 then + npcHandler:setMessage(MESSAGE_GREET, { + "You succeeded! Issavi is safe again. Take this as a sign of our grace and gratitude, brave mortal being. It is a precious relic from earlier times. More precisely, it is one of four parts of the relic called the Regalia of Suon. ...", + "Should you ever find the other three parts, a talented jeweler might be able to combine them and recreate the regalia for you.", + }) + player:addItem(31573, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, 11) + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) == 5 then player:addItem(31414, 1) npcHandler:setMessage(MESSAGE_GREET, { "I see. There is enough and adequate evidence that the Ambassador of Rathleton is indeed an arch traitor. So, Eshaya was right. Well done, mortal being. You have proven your loyalty and bravery, therefore allow me to ask you one more favour. ...", @@ -63,43 +70,23 @@ local function greetCallback(npc, creature) "Well, they want to activate five Fafnar statues which they have already enchanted. They are hidden in the catacombs underneath the city. Please go down and search for the statues. ...", "Then use this sceptre to bless them in the name of Suon and Bastesh. This will destroy the disastrous enchantment and Issavi will be safe again.", }) - player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, 1) - player:setStorageValue(Storage.Kilmaresh.Sixth.FourMasks, 0) - player:setStorageValue(Storage.Kilmaresh.Sixth.BlessedStatues, 0) - player:setStorageValue(Storage.Kilmaresh.Fifth.Memories, 6) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks, 0) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.BlessedStatues, 0) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, 6) else npcHandler:setMessage(MESSAGE_GREET, "Greetings.") end + return true end -local masksDialogue = keywordHandler:addKeyword({ "mission" }, StdModule.say, { - npcHandler = npcHandler, - text = "Did you take all the masks and enchant all the statues?", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) == 10 -end) - -masksDialogue:addChildKeyword( - { "yes" }, - StdModule.say, - { - npcHandler = npcHandler, - text = "Thank you.", - }, - nil, - function(player) - player:addItem(31573, 1) -- Sun Medal - player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, 11) - end -) - npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") npcHandler:setCallback(CALLBACK_SET_INTERACTION, onAddFocus) npcHandler:setCallback(CALLBACK_REMOVE_INTERACTION, onReleaseFocus) npcHandler:setCallback(CALLBACK_GREET, greetCallback) -npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) + npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) -- npcType registering the npcConfig table diff --git a/data-otservbr-global/npc/the_librarian.lua b/data-otservbr-global/npc/the_librarian.lua index 45b786342de..192c4c79393 100644 --- a/data-otservbr-global/npc/the_librarian.lua +++ b/data-otservbr-global/npc/the_librarian.lua @@ -58,19 +58,30 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end -keywordHandler:addKeyword({ "ring" }, StdModule.say, { - npcHandler = npcHandler, - text = { - "To extract memories from the ring, you have to enter a trance-like state with the help of a hallucinogen. Like this you can see all memories that are stored in the ring. Ask {Faloriel} for a respective potion. ...", - "Drink it while wearing the ring in the Temple of {Bastesh} and say: 'Sa Katesa Tarsani na'. If the legends are true you will be able to take memories with you in the form of memory shards.", - }, -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 4 -end, function(player) - player:setStorageValue(Storage.Kilmaresh.Fifth.Memories, 1) - player:setStorageValue(Storage.Kilmaresh.Fifth.MemoriesShards, 0) - player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 5) -end) +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "ring") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 5 then + npcHandler:say({ + "To extract memories from the ring, you have to enter a trance-like state with the help of a hallucinogen. Like this you can see all memories that are stored in the ring. Ask Faloriel for a respective potion. ...", + "Drink it while wearing the ring in the Temple of Bastesh and say: 'Sa Katesa Tarsani na'. If the legends are true you will be able to take memories with you in the form of memory shards.", + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.MemoriesShards, 0) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 6) + else + npcHandler:say("You don't need any instructions about the ring right now.", npc, creature) + end + end + + return true +end npcHandler:setMessage(MESSAGE_GREET, "Greetings, dear guest. If you are interested in paperware such as books or scrolls, ask me for a trade.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") diff --git a/data-otservbr-global/npc/yonan.lua b/data-otservbr-global/npc/yonan.lua index 1b85ecc7c17..c31fe9b93da 100644 --- a/data-otservbr-global/npc/yonan.lua +++ b/data-otservbr-global/npc/yonan.lua @@ -133,15 +133,15 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) - elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then + elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.First.Mission, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5) npcHandler:setTopic(playerId, 20) end return true @@ -155,37 +155,37 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 1 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 1 then npcHandler:say({ "Could you help me do a ritual?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) npcHandler:setTopic(playerId, 1) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 1 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 1 then player:addItem(31717, 1) -- Yonans List player:addItem(31613, 1) -- Pick Enchanted npcHandler:say({ "Here is the list with the missing ingredients to complete the ritual." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Yonan, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan, 2) npcHandler:setTopic(playerId, 2) npcHandler:setTopic(playerId, 2) else npcHandler:say({ "Sorry." }, npc, creature) end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 then npcHandler:say({ "Did you bring all the materials I informed you about? " }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 3) npcHandler:setTopic(playerId, 3) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 and player:getItemById(9651, 3) and player:getItemById(31325, 12) and player:getItemById(31333, 10) then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 and player:getItemById(9651, 3) and player:getItemById(31325, 12) and player:getItemById(31333, 10) then player:removeItem(9651, 3) player:removeItem(31325, 12) player:removeItem(31333, 10) npcHandler:say({ "Thank you this stage of the ritual is complete." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Yonan, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan, 3) npcHandler:setTopic(playerId, 4) npcHandler:setTopic(playerId, 4) else diff --git a/data-otservbr-global/scripts/actions/other/gems.lua b/data-otservbr-global/scripts/actions/other/gems.lua index e56ea30e896..51d40165a9c 100644 --- a/data-otservbr-global/scripts/actions/other/gems.lua +++ b/data-otservbr-global/scripts/actions/other/gems.lua @@ -85,12 +85,13 @@ function gems.onUse(player, item, fromPosition, target, toPosition, isHotkey) -- Small emerald for Kilmaresh quest -- see data\scripts\quests\kilmaresh\1-fafnars-wrath\7-four-masks.lua - if item.itemid == 3032 and target.uid == 40032 and player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) >= 1 and not testFlag(player:getStorageValue(Storage.Kilmaresh.Sixth.FourMasks), 4) then + if item.itemid == 3032 and target.uid == 40032 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) >= 1 and not testFlag(player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks), 4) then player:addItem(31371, 1) -- Ivory mask item:remove(1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You hear a *click*. You can now lift the floor tile and discover a secret compartment. A mask made of ivory lies in it.") - player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) + 1) - player:setStorageValue(Storage.Kilmaresh.Sixth.FourMasks, setFlag(player:getStorageValue(Storage.Kilmaresh.Sixth.FourMasks), 4)) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) + 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks, setFlag(player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks), 4)) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.IvoryMask, 1) return true -- Enchanted helmet of the ancients elseif player:getItemCount(3030) >= 1 and target.itemid == 3229 then diff --git a/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua b/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua index 1cbca17c563..84e1ef32719 100644 --- a/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua +++ b/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua @@ -290,8 +290,8 @@ local questTable = { { storage = Storage.Quest.U11_02.ForgottenKnowledge.AccessGolden, storageValue = 1 }, { storage = Storage.Quest.U10_80.GrimvaleQuest.AncientFeudDoors, storageValue = 1 }, { storage = Storage.Quest.U10_80.GrimvaleQuest.AncientFeudShortcut, storageValue = 1 }, - { storage = Storage.Kilmaresh.AccessDoor, storageValue = 1 }, - { storage = Storage.Kilmaresh.CatacombDoors, storageValue = 1 }, + { storage = Storage.Quest.U12_20.KilmareshQuest.AccessDoor, storageValue = 1 }, + { storage = Storage.Quest.U12_20.KilmareshQuest.CatacombDoors, storageValue = 1 }, { storage = Storage.Quest.U12_00.TheDreamCourts.AccessDoors, storageValue = 1 }, { storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouseAccess, storageValue = 1 }, { storage = Storage.Quest.U12_00.TheDreamCourts.BuriedCathedralAccess, storageValue = 1 }, diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua index ff6d3950028..25d055f5482 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua @@ -3,9 +3,9 @@ local paper = Action() function paper.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 2 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Documents were burnt here recently. Only the part of one scroll still lies in front of the chimney but it's too sooted to read.") - player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 3) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already investigated this.") end @@ -20,9 +20,9 @@ paper:register() local paperScraps = Action() function paperScraps.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 3 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 3 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Paper scraps lie scattered on the floor. It takes some time to put them back together. But it's only a badly written poem.") - player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 4) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 4) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already investigated this.") end @@ -37,9 +37,9 @@ paperScraps:register() local scrolls = Action() function scrolls.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 1 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You examine the scrolls carefully. Those are orders from Rathleton for the Ambassador. No sign of treason here.") - player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 2) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already investigated this.") end @@ -54,12 +54,12 @@ scrolls:register() local roofTop = MoveEvent() function roofTop.onStepIn(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 4 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 4 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You find nothing in the Ambassador's house. If he's in fact a traitor he got rid of any evidence that could incriminate him.") - player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 5) end return true end roofTop:aid(50307) -roofTop:register() +roofTop:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/6-mind-travel.lua b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/6-mind-travel.lua index cc0d24c7281..d36288eca79 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/6-mind-travel.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/6-mind-travel.lua @@ -89,8 +89,8 @@ local memoryShardsItemIdsBitmasks = { local memoryShards = Action() function memoryShards.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local memoryStorage = player:getStorageValue(Storage.Kilmaresh.Fifth.Memories) - local memoriesShardsStorage = player:getStorageValue(Storage.Kilmaresh.Fifth.MemoriesShards) + local memoryStorage = player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) + local memoriesShardsStorage = player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.MemoriesShards) local hasUsedShard = testFlag(memoriesShardsStorage, memoryShardsItemIdsBitmasks[item:getId()]) if @@ -99,8 +99,8 @@ function memoryShards.onUse(player, item, fromPosition, target, toPosition, isHo and target.uid == 57507 -- is it the shrine? then player:say(memoriesWords[memoryStorage], TALKTYPE_MONSTER_SAY, false, player, toPosition) - player:setStorageValue(Storage.Kilmaresh.Fifth.Memories, memoryStorage + 1) - player:setStorageValue(Storage.Kilmaresh.Fifth.MemoriesShards, setFlag(memoriesShardsStorage, memoryShardsItemIdsBitmasks[item:getId()])) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, memoryStorage + 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.MemoriesShards, setFlag(memoriesShardsStorage, memoryShardsItemIdsBitmasks[item:getId()])) toPosition:sendMagicEffect(CONST_ME_ENERGYAREA) return true end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/7-four-masks.lua b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/7-four-masks.lua index b3dc0585bce..3ab075a2f4d 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/7-four-masks.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/7-four-masks.lua @@ -3,19 +3,23 @@ local masks = { storage = 1, successMessage = "You have found a gryphon mask.", -- TODO Gryphon Mask emptyMessage = "The gryphon nest is empty.", + storageKey = Storage.Quest.U12_20.KilmareshQuest.Sixth.GryphonMask, }, [31370] = { -- Silver mask storage = 2, successMessage = "You have found a silver mask.", emptyMessage = "This palm is empty.", + storageKey = Storage.Quest.U12_20.KilmareshQuest.Sixth.SilverMask, }, [31371] = { -- For Ivory mask action see data\scripts\actions\other\gems.lua storage = 4, + storageKey = Storage.Quest.U12_20.KilmareshQuest.Sixth.IvoryMask, }, [31372] = { -- Mirror Mask storage = 8, successMessage = "You have found a mirror mask.", emptyMessage = "The sarcophagus is empty.", + storageKey = Storage.Quest.U12_20.KilmareshQuest.Sixth.MirrorMask, }, } @@ -31,12 +35,13 @@ function masksAction.onUse(player, item, fromPosition, target, toPosition, isHot local maskDiscovered = uidRewards[item.uid] local mask = masks[maskDiscovered] - if player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) >= 1 and not testFlag(player:getStorageValue(Storage.Kilmaresh.Sixth.FourMasks), mask.storage) then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) >= 1 and not testFlag(player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks), mask.storage) then player:addItem(maskDiscovered, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, mask.successMessage) - player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) + 1) - player:setStorageValue(Storage.Kilmaresh.Sixth.FourMasks, player:getStorageValue(Storage.Kilmaresh.Sixth.FourMasks) + mask.storage) - elseif player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) >= 1 then + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) + 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks) + mask.storage) + player:setStorageValue(mask.storageKey, 1) + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) >= 1 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, mask.emptyMessage) else return false diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/8-blessing-the-statues.lua b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/8-blessing-the-statues.lua index 1c5bc1964bc..b113a191ad3 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/8-blessing-the-statues.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/8-blessing-the-statues.lua @@ -30,10 +30,10 @@ function statuesActions.onUse(player, item, fromPosition, target, toPosition, is return false end - if player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) >= 5 and not testFlag(player:getStorageValue(Storage.Kilmaresh.Sixth.BlessedStatues), key.storage) then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) >= 5 and not testFlag(player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.BlessedStatues), key.storage) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You bless the statue.") - player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) + 1) - player:setStorageValue(Storage.Kilmaresh.Sixth.BlessedStatues, player:getStorageValue(Storage.Kilmaresh.Sixth.BlessedStatues) + key.storage) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) + 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.BlessedStatues, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.BlessedStatues) + key.storage) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already blessed this statue.") end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_augerfun.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_augerfun.lua index 4ab6691ab6c..699cf1957b8 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_augerfun.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_augerfun.lua @@ -1,7 +1,7 @@ local augerfun = Action() function augerfun.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then if table.contains({ 31377 }, target.itemid) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are gathering some catus milk.") player:addItem(31335, 1) diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_basin.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_basin.lua index 613bd5a2f79..9628f9f26d5 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_basin.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_basin.lua @@ -1,10 +1,10 @@ local basin = Action() function basin.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Tem.Bleeds) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Tem.Bleeds) == 1 then player:addItem(31431, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You find a golden symbol at the bottom of the blood-filled basin.") - player:setStorageValue(Storage.Kilmaresh.Eleven.Basin, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin, 1) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sorry") end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_books.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_books.lua deleted file mode 100644 index c068fcadb88..00000000000 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_books.lua +++ /dev/null @@ -1,14 +0,0 @@ -local books = Action() - -function books.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 4 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You find nothing in the Ambassador's house. If he's in fact a traitor he got rid of any evidence that could incriminate him.") - player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 5) - else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.") - end - return true -end - -books:uid(57504) -books:register() diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_cagekey.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_cagekey.lua index d4a01248e57..67a3f56cadc 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_cagekey.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_cagekey.lua @@ -1,10 +1,10 @@ local cagekey = Action() function cagekey.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 2 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a wooden cage key.") player:addItem(31379, 1) -- Wooden Cage Key - player:setStorageValue(Storage.Kilmaresh.Fourteen.Remains, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains, 3) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.") end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_coruja.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_coruja.lua index 367ee462a05..0ab72a6d1ba 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_coruja.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_coruja.lua @@ -1,9 +1,9 @@ local coruja = Action() function coruja.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Nine.Owl) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Nine.Owl) == 1 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You discover an owl resting in a tree. Thats special, because you have never seen an owl in all of Kilmaresh.") - player:setStorageValue(Storage.Kilmaresh.Nine.Owl, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Nine.Owl, 2) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sorry") end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_glasshoneyfun.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_glasshoneyfun.lua index b106aa6cab9..e0911e2a695 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_glasshoneyfun.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_glasshoneyfun.lua @@ -1,7 +1,7 @@ local glasshoneyfun = Action() function glasshoneyfun.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then if table.contains({ 31376 }, target.itemid) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are gently squishing some of the honey palm blossoms and golden honey is depping into the jug.") player:removeItem(31331, 1) diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_lyre.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_lyre.lua index bdac82d88ef..878caaed444 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_lyre.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_lyre.lua @@ -1,10 +1,10 @@ local lyre = Action() function lyre.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 2 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found Lyre.") player:addItem(31447, 1) - player:setStorageValue(Storage.Kilmaresh.Thirteen.Lyre, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 3) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The bag can not be opened.") end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_peeler.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_peeler.lua index 8507ac946f9..ed5f337e92c 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_peeler.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_peeler.lua @@ -1,9 +1,9 @@ local peeler = Action() function peeler.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Set.Ritual) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual) == 2 then player:addItem(31328, 1) - player:setStorageValue(Storage.Kilmaresh.Set.Ritual, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual, 3) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a bark peeler.") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.") diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_peelerfun.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_peelerfun.lua index 330f838543e..dc1837c2996 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_peelerfun.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_peelerfun.lua @@ -1,7 +1,7 @@ local peelerfun = Action() function peelerfun.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 then if table.contains({ 31376 }, target.itemid) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are peeling a piece of tark off the again tree.") player:addItem(31329, 1) diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_pickenchanted.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_pickenchanted.lua index 6cc2ad57f46..29cff3c03a5 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_pickenchanted.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_pickenchanted.lua @@ -1,7 +1,7 @@ local pickenchanted = Action() function pickenchanted.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 then if table.contains({ 30438 }, target.itemid) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are quarrying some tagralt.") player:addItem(31333, 1) diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_sangra.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_sangra.lua index f1b0b37a698..3ca1f37b0db 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_sangra.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_sangra.lua @@ -1,9 +1,9 @@ local sangra = Action() function sangra.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Nine.Owl) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Nine.Owl) == 2 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The arrow is still sticking in the tree. Fresh blood keeps trickling from the spot where the arrow hit the trunk.") - player:setStorageValue(Storage.Kilmaresh.Tem.Bleeds, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Tem.Bleeds, 1) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sorry") end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_scissors.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_scissors.lua index d1d16fa1c30..5d6fae1c98c 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_scissors.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_scissors.lua @@ -1,9 +1,9 @@ local scissors = Action() function scissors.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Set.Ritual) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual) == 1 then player:addItem(31327, 1) - player:setStorageValue(Storage.Kilmaresh.Set.Ritual, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual, 2) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a ritual scissors.") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.") diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_scissorsfun.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_scissorsfun.lua index 1e4975e705a..0f255445baf 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_scissorsfun.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_scissorsfun.lua @@ -2,266 +2,266 @@ local config = { [30426] = { itemId = 30426, msg = "You are cutting some veldt flowers.", - storage = Storage.Kilmaresh.Eighth.Yonan, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan, getValue = 2, addItemId = 31325, }, -- Veldt Flower [30422] = { itemId = 30422, msg = "You are cutting some snake maw.", - storage = Storage.Kilmaresh.Eighth.Shimun, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun, getValue = 2, addItemId = 31336, }, -- Sanke Maw [30427] = { itemId = 30427, msg = "You are cutting some desert rose blossoms.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31330, }, -- Rose Blossoms [12747] = { itemId = 12747, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12748] = { itemId = 12748, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12749] = { itemId = 12749, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12750] = { itemId = 12750, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12751] = { itemId = 12751, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12752] = { itemId = 12752, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12753] = { itemId = 12753, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12754] = { itemId = 12754, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12755] = { itemId = 12755, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12756] = { itemId = 12756, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12757] = { itemId = 12757, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12758] = { itemId = 12758, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12759] = { itemId = 12759, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12760] = { itemId = 12760, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12761] = { itemId = 12761, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12762] = { itemId = 12762, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12763] = { itemId = 12763, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12764] = { itemId = 12764, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12765] = { itemId = 12765, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12766] = { itemId = 12766, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12767] = { itemId = 12767, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12768] = { itemId = 12768, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12769] = { itemId = 12769, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12770] = { itemId = 12770, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12771] = { itemId = 12771, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12772] = { itemId = 12772, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12773] = { itemId = 12773, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12774] = { itemId = 12774, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12775] = { itemId = 12775, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12776] = { itemId = 12776, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12777] = { itemId = 12777, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12778] = { itemId = 12778, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12779] = { itemId = 12779, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12780] = { itemId = 12780, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12781] = { itemId = 12781, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_tortoise.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_tortoise.lua index 3d2f67bb489..ea5158719da 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_tortoise.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_tortoise.lua @@ -1,10 +1,10 @@ local tortoise = Action() function tortoise.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 1 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Tortoise.") player:addItem(31445, 1) - player:setStorageValue(Storage.Kilmaresh.Thirteen.Presente, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente, 2) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The tortoise nest empty.") end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_tumulo.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_tumulo.lua index 80724b7b876..2b993b41b9c 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_tumulo.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_tumulo.lua @@ -1,8 +1,8 @@ local tumulo = Action() function tumulo.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 1 then - -- player:setStorageValue(Storage.Kilmaresh.Treze.Presente, 2) + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 1 then + -- player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Treze.Presente, 2) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The grave is empty. Nothing than gaping void.") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.") diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_tumuloerro.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_tumuloerro.lua index 07ce019e84b..8148603b01a 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_tumuloerro.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_tumuloerro.lua @@ -1,8 +1,8 @@ local tumuloerro = Action() function tumuloerro.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 1 then - -- player:setStorageValue(Storage.Kilmaresh.Treze.Presente, 2) + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 1 then + -- player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Treze.Presente, 2) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The grave is empty. Nothing than gaping void.") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.") diff --git a/data-otservbr-global/scripts/actions/bosses_levers/urmahlullu_the_immaculate.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_urmahlullu_the_immaculate.lua similarity index 100% rename from data-otservbr-global/scripts/actions/bosses_levers/urmahlullu_the_immaculate.lua rename to data-otservbr-global/scripts/quests/kilmaresh/actions_urmahlullu_the_immaculate.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_bragrumol.lua b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_bragrumol.lua index 02846ec6cfd..4b0f04a885d 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_bragrumol.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_bragrumol.lua @@ -2,8 +2,8 @@ local bragrumol = CreatureEvent("BragrumolDeath") function bragrumol.onDeath(creature) onDeathForDamagingPlayers(creature, function(creature, player) - if player:getStorageValue(Storage.Kilmaresh.Twelve.Bragrumol) == 1 then - player:setStorageValue(Storage.Kilmaresh.Twelve.Bragrumol, 2) + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Bragrumol) == 1 then + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Bragrumol, 2) end end) return true diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_fafnar.lua b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_fafnar.lua index 4d94f0e6d3b..495c1e4136c 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_fafnar.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_fafnar.lua @@ -1,6 +1,6 @@ local monster = { - ["burning gladiator"] = Storage.Kilmaresh.Thirteen.Fafnar, - ["priestess of the wild sun"] = Storage.Kilmaresh.Thirteen.Fafnar, + ["burning gladiator"] = Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar, + ["priestess of the wild sun"] = Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar, } local fafnar = CreatureEvent("FafnarMissionsDeath") diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_mozradek.lua b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_mozradek.lua index 23507b878b0..fdfc876634d 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_mozradek.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_mozradek.lua @@ -2,8 +2,8 @@ local mozradek = CreatureEvent("MozradekDeath") function mozradek.onDeath(creature) onDeathForDamagingPlayers(creature, function(creature, player) - if player:getStorageValue(Storage.Kilmaresh.Twelve.Mozradek) == 1 then - player:setStorageValue(Storage.Kilmaresh.Twelve.Mozradek, 2) + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Mozradek) == 1 then + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Mozradek, 2) end end) return true diff --git a/data-otservbr-global/scripts/creaturescripts/monster/urmahlullu_change.lua b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_urmahlullu_change.lua similarity index 100% rename from data-otservbr-global/scripts/creaturescripts/monster/urmahlullu_change.lua rename to data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_urmahlullu_change.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_xogixath.lua b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_xogixath.lua index cbfe0daeb3b..41dc703989f 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_xogixath.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_xogixath.lua @@ -2,8 +2,8 @@ local xogixath = CreatureEvent("XogixathDeath") function xogixath.onDeath(creature) onDeathForDamagingPlayers(creature, function(creature, player) - if player:getStorageValue(Storage.Kilmaresh.Twelve.Xogixath) == 1 then - player:setStorageValue(Storage.Kilmaresh.Twelve.Xogixath, 2) + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Xogixath) == 1 then + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Xogixath, 2) end end) return true diff --git a/data-otservbr-global/startup/tables/door_quest.lua b/data-otservbr-global/startup/tables/door_quest.lua index d175ac61b90..3a0837fa8d1 100644 --- a/data-otservbr-global/startup/tables/door_quest.lua +++ b/data-otservbr-global/startup/tables/door_quest.lua @@ -50,18 +50,6 @@ QuestDoorAction = { itemId = false, itemPos = { { x = 32467, y = 31969, z = 5 } }, }, - -- Edron - [Storage.Kilmaresh.Sixth.Favor] = { - itemId = false, - itemPos = { - { x = 33855, y = 31450, z = 9 }, - { x = 33855, y = 31496, z = 9 }, - { x = 33884, y = 31510, z = 9 }, - { x = 33884, y = 31536, z = 9 }, - { x = 33911, y = 31496, z = 9 }, - { x = 33912, y = 31466, z = 9 }, - }, - }, -- Rathleton quest door [Storage.HeroRathleton.AccessDoor] = { itemId = false, @@ -667,16 +655,6 @@ QuestDoorAction = { { x = 32169, y = 31933, z = 7 }, }, }, - -- Kilmaresh doors - -- [Storage.Kilmaresh.First.Title] = { - -- itemId = false, - -- itemPos = { - -- {x = 33959, y = 31501, z = 4}, - -- {x = 33375, y = 31346, z = 5}, - -- {x = 33371, y = 31349, z = 4}, - -- {x = 33376, y = 31335, z = 3} - -- } - -- }, -- The Rookie Guard Quest - Mission 07: Attack! -- The library vault door [Storage.Quest.U9_1.TheRookieGuard.LibraryDoor] = { @@ -796,19 +774,35 @@ QuestDoorAction = { { x = 33470, y = 32786, z = 11 }, }, }, - [Storage.Kilmaresh.AccessDoor] = { + -- Kilmaresh Quest + [Storage.Quest.U12_20.KilmareshQuest.AccessDoor] = { itemId = false, itemPos = { { x = 33886, y = 31476, z = 7 } }, }, - [Storage.Kilmaresh.CatacombDoors] = { - itemId = false, + [Storage.Quest.U12_20.KilmareshQuest.Second.Investigating] = { + itemId = 31568, + itemPos = { { x = 33959, y = 31501, z = 4 } }, + }, + [Storage.Quest.U12_20.KilmareshQuest.Sixth.GryphonMask] = { + itemId = 9558, + itemPos = { { x = 33884, y = 31536, z = 9 } }, + }, + [Storage.Quest.U12_20.KilmareshQuest.Sixth.MirrorMask] = { + itemId = 9558, + itemPos = { { x = 33884, y = 31510, z = 9 } }, + }, + [Storage.Quest.U12_20.KilmareshQuest.Sixth.IvoryMask] = { + itemId = 9558, + itemPos = { + { x = 33911, y = 31496, z = 9 }, + { x = 33855, y = 31496, z = 9 }, + }, + }, + [Storage.Quest.U12_20.KilmareshQuest.Sixth.SilverMask] = { + itemId = 9558, itemPos = { { x = 33855, y = 31450, z = 9 }, { x = 33912, y = 31466, z = 9 }, - { x = 33855, y = 31496, z = 9 }, - { x = 33911, y = 31496, z = 9 }, - { x = 33884, y = 31510, z = 9 }, - { x = 33884, y = 31536, z = 9 }, }, }, [Storage.Quest.U12_60.APiratesTail.TentuglyDoor] = { diff --git a/data-otservbr-global/startup/tables/item.lua b/data-otservbr-global/startup/tables/item.lua index 99854dad8c8..883fe90ce48 100644 --- a/data-otservbr-global/startup/tables/item.lua +++ b/data-otservbr-global/startup/tables/item.lua @@ -3447,4 +3447,17 @@ ItemUnique = { itemId = 9253, itemPos = { x = 33755, y = 32161, z = 14 }, }, + -- Kilmaresh Quest + [57505] = { + itemId = 31349, + itemPos = { x = 33899, y = 31643, z = 9 }, + }, + [57506] = { + itemId = 31349, + itemPos = { x = 33936, y = 31647, z = 9 }, + }, + [57507] = { + itemId = 31357, + itemPos = { x = 33914, y = 31639, z = 9 }, + }, } diff --git a/data-otservbr-global/startup/tables/tile.lua b/data-otservbr-global/startup/tables/tile.lua index 59d9d3be69f..5246b290c37 100644 --- a/data-otservbr-global/startup/tables/tile.lua +++ b/data-otservbr-global/startup/tables/tile.lua @@ -296,8 +296,9 @@ TileAction = { [50307] = { itemId = false, itemPos = { + { x = 33955, y = 31503, z = 2 }, { x = 33956, y = 31503, z = 2 }, - { x = 33957, y = 31503, z = 2 }, + { x = 33956, y = 31504, z = 2 }, }, }, -- The paradox tower quest