From 322b1a45dac42565e02199b31d713637e200432f Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Wed, 24 Jul 2024 18:09:12 -0300 Subject: [PATCH] The Travelling Trader Quest --- data-otservbr-global/lib/core/quests.lua | 16 +++--- data-otservbr-global/lib/core/storages.lua | 22 +++---- data-otservbr-global/npc/briasol.lua | 4 +- data-otservbr-global/npc/miraia.lua | 6 +- data-otservbr-global/npc/rashid.lua | 57 +++++++++---------- data-otservbr-global/npc/rashid_custom.lua | 54 +++++++++--------- data-otservbr-global/npc/snake_eye.lua | 4 +- data-otservbr-global/npc/uzgod.lua | 4 +- data-otservbr-global/npc/willard.lua | 4 +- .../actions/other/others/quest_system2.lua | 2 +- .../outlaw_camp_door.lua | 2 +- .../creaturescripts/customs/freequests.lua | 16 +++--- data-otservbr-global/startup/tables/item.lua | 5 ++ 13 files changed, 98 insertions(+), 98 deletions(-) diff --git a/data-otservbr-global/lib/core/quests.lua b/data-otservbr-global/lib/core/quests.lua index 8e939e71d6f..aedb9e7c58e 100644 --- a/data-otservbr-global/lib/core/quests.lua +++ b/data-otservbr-global/lib/core/quests.lua @@ -3979,12 +3979,12 @@ if not Quests then }, [27] = { name = "The Travelling Trader Quest", - startStorageId = Storage.TravellingTrader.Mission01, + startStorageId = Storage.Quest.U8_1.TheTravellingTrader.Mission01, startStorageValue = 1, missions = { [1] = { name = "Mission 1: Trophy", - storageId = Storage.TravellingTrader.Mission01, + storageId = Storage.Quest.U8_1.TheTravellingTrader.Mission01, missionId = 10288, startValue = 1, endValue = 2, @@ -3996,7 +3996,7 @@ if not Quests then }, [2] = { name = "Mission 2: Delivery", - storageId = Storage.TravellingTrader.Mission02, + storageId = Storage.Quest.U8_1.TheTravellingTrader.Mission02, missionId = 10289, startValue = 1, endValue = 5, @@ -4011,7 +4011,7 @@ if not Quests then }, [3] = { name = "Mission 3: Cheese", - storageId = Storage.TravellingTrader.Mission03, + storageId = Storage.Quest.U8_1.TheTravellingTrader.Mission03, missionId = 10290, startValue = 1, endValue = 3, @@ -4024,7 +4024,7 @@ if not Quests then }, [4] = { name = "Mission 4: Vase", - storageId = Storage.TravellingTrader.Mission04, + storageId = Storage.Quest.U8_1.TheTravellingTrader.Mission04, missionId = 10291, startValue = 1, endValue = 3, @@ -4038,7 +4038,7 @@ if not Quests then }, [5] = { name = "Mission 5: Make a deal", - storageId = Storage.TravellingTrader.Mission05, + storageId = Storage.Quest.U8_1.TheTravellingTrader.Mission05, missionId = 10292, startValue = 1, endValue = 3, @@ -4051,7 +4051,7 @@ if not Quests then }, [6] = { name = "Mission 6: Goldfish", - storageId = Storage.TravellingTrader.Mission06, + storageId = Storage.Quest.U8_1.TheTravellingTrader.Mission06, missionId = 10293, startValue = 1, endValue = 2, @@ -4062,7 +4062,7 @@ if not Quests then }, [7] = { name = "Mission 7: Declare", - storageId = Storage.TravellingTrader.Mission07, + storageId = Storage.Quest.U8_1.TheTravellingTrader.Mission07, missionId = 10294, startValue = 1, endValue = 1, diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 6d0144b1e5f..328e9f8e5bd 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -561,17 +561,6 @@ Storage = { SpectralStoneDoor = 50560, IceMusicDoor = 50561, }, - TravellingTrader = { - -- Reserved storage from 50600 - 50619 - Mission01 = 50600, - Mission02 = 50601, - Mission03 = 50602, - Mission04 = 50603, - Mission05 = 50604, - Mission06 = 50605, - Mission07 = 50606, - -- unused packageDoor = 50607 - }, DjinnWar = { -- Reserved storage from 50620 - 50649 Faction = { @@ -2073,8 +2062,15 @@ Storage = { StrongPotions = { Reward = 41390, }, - TheExterminator = {}, - TheTravellingTrader = {}, + TheTravellingTrader = { + Mission01 = 41391, + Mission02 = 41392, + Mission03 = 41393, + Mission04 = 41394, + Mission05 = 41395, + Mission06 = 41396, + Mission07 = 41397, + }, TheUltimateBooze = {}, ToAppeaseTheMighty = {}, ToBlindTheEnemy = {}, diff --git a/data-otservbr-global/npc/briasol.lua b/data-otservbr-global/npc/briasol.lua index 38dcd074159..78eef134bbf 100644 --- a/data-otservbr-global/npc/briasol.lua +++ b/data-otservbr-global/npc/briasol.lua @@ -64,7 +64,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "fine vase") then - if player:getStorageValue(Storage.TravellingTrader.Mission04) == 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission04) == 1 then npcHandler:say({ "Rashid sent you, I suppose. Before I sell you that vase, one word of advice. ...", "Make room in your backpack so that I can place the vase carefully inside it. If it falls to the floor, it will most likely shatter or break if you try to pick it up again. ...", @@ -76,7 +76,7 @@ local function creatureSayCallback(npc, creature, type, message) if npcHandler:getTopic(playerId) == 1 then if player:getMoney() + player:getBankBalance() >= 1000 then npcHandler:say("Here it is.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission04, 2) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission04, 2) player:addItem(227, 1) player:removeMoneyBank(1000) else diff --git a/data-otservbr-global/npc/miraia.lua b/data-otservbr-global/npc/miraia.lua index 00101154766..bb0651110ea 100644 --- a/data-otservbr-global/npc/miraia.lua +++ b/data-otservbr-global/npc/miraia.lua @@ -123,9 +123,9 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say(config[message].text[2], npc, creature) end elseif MsgContains(message, "scarab cheese") then - if player:getStorageValue(Storage.TravellingTrader.Mission03) == 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission03) == 1 then npcHandler:say("Let me cover my nose before I get this for you... Would you REALLY like to buy scarab cheese for 100 gold?", npc, creature) - elseif player:getStorageValue(Storage.TravellingTrader.Mission03) == 2 then + elseif player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission03) == 2 then npcHandler:say("Oh the last cheese molded? Would you like to buy another one for 100 gold?", npc, creature) end npcHandler:setTopic(playerId, 4) @@ -164,7 +164,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 4 then if player:getMoney() + player:getBankBalance() >= 100 then - player:setStorageValue(Storage.TravellingTrader.Mission03, 2) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission03, 2) player:addItem(169, 1) player:removeMoneyBank(100) npcHandler:say("Here it is.", npc, creature) diff --git a/data-otservbr-global/npc/rashid.lua b/data-otservbr-global/npc/rashid.lua index 7c719f0c655..4fda8a6c788 100644 --- a/data-otservbr-global/npc/rashid.lua +++ b/data-otservbr-global/npc/rashid.lua @@ -60,57 +60,57 @@ local function creatureSayCallback(npc, creature, type, message) if MsgContains(message, "mission") then if os.date("%A") == "Monday" then - if player:getStorageValue(Storage.TravellingTrader.Mission01) < 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission01) < 1 then npcHandler:say("Well, you could attempt the mission to become a recognised trader, but it requires a lot of travelling. Are you willing to try?", npc, creature) npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.TravellingTrader.Mission01) == 1 then + elseif player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission01) == 1 then npcHandler:say("Have you managed to obtain a rare deer trophy for my customer?", npc, creature) npcHandler:setTopic(playerId, 3) end elseif os.date("%A") == "Tuesday" then - if player:getStorageValue(Storage.TravellingTrader.Mission01) == 2 and player:getStorageValue(Storage.TravellingTrader.Mission02) < 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission01) == 2 and player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02) < 1 then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", npc, creature) npcHandler:setTopic(playerId, 4) - elseif player:getStorageValue(Storage.TravellingTrader.Mission02) == 4 then + elseif player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02) == 4 then npcHandler:say("Did you bring me the package?", npc, creature) npcHandler:setTopic(playerId, 6) end elseif os.date("%A") == "Wednesday" then - if player:getStorageValue(Storage.TravellingTrader.Mission02) == 5 and player:getStorageValue(Storage.TravellingTrader.Mission03) < 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02) == 5 and player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission03) < 1 then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", npc, creature) npcHandler:setTopic(playerId, 7) - elseif player:getStorageValue(Storage.TravellingTrader.Mission03) == 2 then + elseif player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission03) == 2 then npcHandler:say("Have you brought the cheese?", npc, creature) npcHandler:setTopic(playerId, 9) end elseif os.date("%A") == "Thursday" then - if player:getStorageValue(Storage.TravellingTrader.Mission03) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission04) < 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission03) == 3 and player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission04) < 1 then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", npc, creature) npcHandler:setTopic(playerId, 10) - elseif player:getStorageValue(Storage.TravellingTrader.Mission04) == 2 then + elseif player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission04) == 2 then npcHandler:say("Have you brought the vase?", npc, creature) npcHandler:setTopic(playerId, 12) end elseif os.date("%A") == "Friday" then - if player:getStorageValue(Storage.TravellingTrader.Mission04) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission05) < 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission04) == 3 and player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission05) < 1 then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", npc, creature) npcHandler:setTopic(playerId, 13) - elseif player:getStorageValue(Storage.TravellingTrader.Mission05) == 2 then + elseif player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission05) == 2 then npcHandler:say("Have you brought a cheap but good crimson sword?", npc, creature) npcHandler:setTopic(playerId, 15) end elseif os.date("%A") == "Saturday" then - if player:getStorageValue(Storage.TravellingTrader.Mission05) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission06) < 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission05) == 3 and player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission06) < 1 then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", npc, creature) npcHandler:setTopic(playerId, 16) - elseif player:getStorageValue(Storage.TravellingTrader.Mission06) == 1 then + elseif player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission06) == 1 then npcHandler:say("Have you brought me a gold fish??", npc, creature) npcHandler:setTopic(playerId, 18) end elseif os.date("%A") == "Sunday" then - if player:getStorageValue(Storage.TravellingTrader.Mission06) == 2 and player:getStorageValue(Storage.TravellingTrader.Mission07) ~= 1 then - npcHandler:say("Ah, right. I hereby declare you - one of my recognised traders! Feel free to offer me your wares!", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission07, 1) + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission06) == 2 and player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission07) ~= 1 then + npcHandler:say("Ah, right. I hereby declare you - one of my recognised traders! Feel free to offer me your wares, just ask me for a {trade}!", npc, creature) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission07, 1) player:addAchievement("Recognised Trader") npcHandler:setTopic(playerId, 0) end @@ -128,12 +128,12 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 2 then npcHandler:say("Fine. Then get a hold of that deer trophy and bring it to me while I'm in Svargrond. Just ask me about your mission.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission01, 1) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission01, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then if player:removeItem(7397, 1) then npcHandler:say("Well done! I'll take that from you. Come see me another day, I'll be busy for a while now. ", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission01, 2) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission01, 2) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 4 then @@ -145,12 +145,12 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 5) elseif npcHandler:getTopic(playerId) == 5 then npcHandler:say("Fine. Then off you go, just ask Willard about the 'package for Rashid'.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission02, 1) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 6 then if player:removeItem(145, 1) then npcHandler:say("Great. Just place it over there - yes, thanks, that's it. Come see me another day, I'll be busy for a while now. ", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission02, 5) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02, 5) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 7 then @@ -164,12 +164,12 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 8) elseif npcHandler:getTopic(playerId) == 8 then npcHandler:say("Okay, then please find Miraia in Darashia and ask her about the {'scarab cheese'}.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission03, 1) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission03, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 9 then if player:removeItem(169, 1) then npcHandler:say("Mmmhh, the lovely odeur of scarab cheese! I really can't understand why most people can't stand it. Thanks, well done! ", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission03, 3) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission03, 3) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 10 then @@ -181,13 +181,13 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 11) elseif npcHandler:getTopic(playerId) == 11 then npcHandler:say("Okay, then please find {Briasol} in {Ab'Dendriel} and ask for a {'fine vase'}.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission04, 1) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission04, 1) player:addMoney(1000) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 12 then if player:removeItem(227, 1) then npcHandler:say("I'm surprised that you managed to bring this vase without a single crack. That was what I needed to know, thank you. ", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission04, 3) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission04, 3) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 13 then @@ -197,17 +197,16 @@ local function creatureSayCallback(npc, creature, type, message) "Dwarves are said to be the most stubborn of all traders. Travel to {Kazordoon} and try to get the smith {Uzgod} to sell a {crimson sword} to you. ...", "Of course, it has to be cheap. Don't come back with anything more expensive than 400 gold. ...", "And the quality must not suffer, of course! Everything clear and understood?", - "Dwarves are said to be the most stubborn of all traders. Travel to Kazordoon and try to get the smith Uzgod to sell a crimson sword to you. ...", }, npc, creature) npcHandler:setTopic(playerId, 14) elseif npcHandler:getTopic(playerId) == 14 then npcHandler:say("Okay, I'm curious how you will do with {Uzgod}. Good luck!", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission05, 1) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission05, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 15 then if player:removeItem(7385, 1) then npcHandler:say("Ha! You are clever indeed, well done! I'll take this from you. Come see me tomorrow, I think we two might get into business after all.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission05, 3) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission05, 3) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 16 then @@ -220,12 +219,12 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 17) elseif npcHandler:getTopic(playerId) == 17 then npcHandler:say("Thanks so much! I'll be waiting eagerly for your return then.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission06, 1) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission06, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 18 then if player:removeItem(5929, 1) then npcHandler:say("Thank you!! Ah, this makes my day! I'll take the rest of the day off to get to know this little guy. Come see me tomorrow, if you like.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission06, 2) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission06, 2) npcHandler:setTopic(playerId, 0) end end @@ -262,7 +261,7 @@ npcHandler:setMessage(MESSAGE_WALKAWAY, "Come back soon!") npcHandler:setMessage(MESSAGE_SENDTRADE, "Take all the time you need to decide what you want!") local function onTradeRequest(npc, creature) - if Player(creature):getStorageValue(Storage.TravellingTrader.Mission07) ~= 1 then + if Player(creature):getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission07) ~= 1 then npcHandler:say("Sorry, but you do not belong to my exclusive customers. I have to make sure that I can trust in the quality of your wares.", npc, creature) return false end diff --git a/data-otservbr-global/npc/rashid_custom.lua b/data-otservbr-global/npc/rashid_custom.lua index 421427ee795..46b2f35abad 100644 --- a/data-otservbr-global/npc/rashid_custom.lua +++ b/data-otservbr-global/npc/rashid_custom.lua @@ -62,57 +62,57 @@ local function creatureSayCallback(npc, creature, type, message) if MsgContains(message, "mission") then if os.date("%A") == "Monday" then - if player:getStorageValue(Storage.TravellingTrader.Mission01) < 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission01) < 1 then npcHandler:say("Well, you could attempt the mission to become a recognised trader, but it requires a lot of travelling. Are you willing to try?", npc, creature) npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.TravellingTrader.Mission01) == 1 then + elseif player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission01) == 1 then npcHandler:say("Have you managed to obtain a rare deer trophy for my customer?", npc, creature) npcHandler:setTopic(playerId, 3) end elseif os.date("%A") == "Tuesday" then - if player:getStorageValue(Storage.TravellingTrader.Mission01) == 2 and player:getStorageValue(Storage.TravellingTrader.Mission02) < 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission01) == 2 and player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02) < 1 then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", npc, creature) npcHandler:setTopic(playerId, 4) - elseif player:getStorageValue(Storage.TravellingTrader.Mission02) == 4 then + elseif player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02) == 4 then npcHandler:say("Did you bring me the package?", npc, creature) npcHandler:setTopic(playerId, 6) end elseif os.date("%A") == "Wednesday" then - if player:getStorageValue(Storage.TravellingTrader.Mission02) == 5 and player:getStorageValue(Storage.TravellingTrader.Mission03) < 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02) == 5 and player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission03) < 1 then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", npc, creature) npcHandler:setTopic(playerId, 7) - elseif player:getStorageValue(Storage.TravellingTrader.Mission03) == 2 then + elseif player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission03) == 2 then npcHandler:say("Have you brought the cheese?", npc, creature) npcHandler:setTopic(playerId, 9) end elseif os.date("%A") == "Thursday" then - if player:getStorageValue(Storage.TravellingTrader.Mission03) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission04) < 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission03) == 3 and player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission04) < 1 then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", npc, creature) npcHandler:setTopic(playerId, 10) - elseif player:getStorageValue(Storage.TravellingTrader.Mission04) == 2 then + elseif player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission04) == 2 then npcHandler:say("Have you brought the vase?", npc, creature) npcHandler:setTopic(playerId, 12) end elseif os.date("%A") == "Friday" then - if player:getStorageValue(Storage.TravellingTrader.Mission04) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission05) < 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission04) == 3 and player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission05) < 1 then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", npc, creature) npcHandler:setTopic(playerId, 13) - elseif player:getStorageValue(Storage.TravellingTrader.Mission05) == 2 then + elseif player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission05) == 2 then npcHandler:say("Have you brought a cheap but good crimson sword?", npc, creature) npcHandler:setTopic(playerId, 15) end elseif os.date("%A") == "Saturday" then - if player:getStorageValue(Storage.TravellingTrader.Mission05) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission06) < 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission05) == 3 and player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission06) < 1 then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", npc, creature) npcHandler:setTopic(playerId, 16) - elseif player:getStorageValue(Storage.TravellingTrader.Mission06) == 1 then + elseif player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission06) == 1 then npcHandler:say("Have you brought me a gold fish??", npc, creature) npcHandler:setTopic(playerId, 18) end elseif os.date("%A") == "Sunday" then - if player:getStorageValue(Storage.TravellingTrader.Mission06) == 2 and player:getStorageValue(Storage.TravellingTrader.Mission07) ~= 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission06) == 2 and player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission07) ~= 1 then npcHandler:say("Ah, right. I hereby declare you - one of my recognised traders! Feel free to offer me your wares!", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission07, 1) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission07, 1) player:addAchievement("Recognised Trader") npcHandler:setTopic(playerId, 0) end @@ -130,12 +130,12 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 2 then npcHandler:say("Fine. Then get a hold of that deer trophy and bring it to me while I'm in Svargrond. Just ask me about your mission.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission01, 1) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission01, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then if player:removeItem(7397, 1) then npcHandler:say("Well done! I'll take that from you. Come see me another day, I'll be busy for a while now. ", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission01, 2) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission01, 2) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 4 then @@ -147,12 +147,12 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 5) elseif npcHandler:getTopic(playerId) == 5 then npcHandler:say("Fine. Then off you go, just ask Willard about the 'package for Rashid'.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission02, 1) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 6 then if player:removeItem(145, 1) then npcHandler:say("Great. Just place it over there - yes, thanks, that's it. Come see me another day, I'll be busy for a while now. ", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission02, 5) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02, 5) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 7 then @@ -166,12 +166,12 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 8) elseif npcHandler:getTopic(playerId) == 8 then npcHandler:say("Okay, then please find Miraia in Darashia and ask her about the {'scarab cheese'}.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission03, 1) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission03, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 9 then if player:removeItem(169, 1) then npcHandler:say("Mmmhh, the lovely odeur of scarab cheese! I really can't understand why most people can't stand it. Thanks, well done! ", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission03, 3) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission03, 3) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 10 then @@ -183,13 +183,13 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 11) elseif npcHandler:getTopic(playerId) == 11 then npcHandler:say("Okay, then please find {Briasol} in {Ab'Dendriel} and ask for a {'fine vase'}.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission04, 1) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission04, 1) player:addMoney(1000) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 12 then if player:removeItem(227, 1) then npcHandler:say("I'm surprised that you managed to bring this vase without a single crack. That was what I needed to know, thank you. ", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission04, 3) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission04, 3) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 13 then @@ -204,12 +204,12 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 14) elseif npcHandler:getTopic(playerId) == 14 then npcHandler:say("Okay, I'm curious how you will do with {Uzgod}. Good luck!", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission05, 1) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission05, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 15 then if player:removeItem(7385, 1) then npcHandler:say("Ha! You are clever indeed, well done! I'll take this from you. Come see me tomorrow, I think we two might get into business after all.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission05, 3) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission05, 3) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 16 then @@ -222,12 +222,12 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 17) elseif npcHandler:getTopic(playerId) == 17 then npcHandler:say("Thanks so much! I'll be waiting eagerly for your return then.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission06, 1) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission06, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 18 then if player:removeItem(5929, 1) then npcHandler:say("Thank you!! Ah, this makes my day! I'll take the rest of the day off to get to know this little guy. Come see me tomorrow, if you like.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission06, 2) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission06, 2) npcHandler:setTopic(playerId, 0) end end @@ -264,7 +264,7 @@ npcHandler:setMessage(MESSAGE_WALKAWAY, "Come back soon!") npcHandler:setMessage(MESSAGE_SENDTRADE, "Take all the time you need to decide what you want!") local function onTradeRequest(npc, creature) - if toggleRashidStorage and Player(creature):getStorageValue(Storage.TravellingTrader.Mission07) ~= 1 then + if toggleRashidStorage and Player(creature):getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission07) ~= 1 then npcHandler:say("Sorry, but you do not belong to my exclusive customers. I have to make sure that I can trust in the quality of your wares.", npc, creature) return false end diff --git a/data-otservbr-global/npc/snake_eye.lua b/data-otservbr-global/npc/snake_eye.lua index 4eade5af763..9e59632667d 100644 --- a/data-otservbr-global/npc/snake_eye.lua +++ b/data-otservbr-global/npc/snake_eye.lua @@ -59,9 +59,9 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "package for rashid") then - if player:getStorageValue(Storage.TravellingTrader.Mission02) >= 1 and player:getStorageValue(Storage.TravellingTrader.Mission02) < 3 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02) >= 1 and player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02) < 3 then npcHandler:say("So you're the delivery boy? Go ahead, but I warn you, it's quite heavy. You can take it from the box over there.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission02, 3) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02, 3) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "documents") then diff --git a/data-otservbr-global/npc/uzgod.lua b/data-otservbr-global/npc/uzgod.lua index 698ad8ea579..b3afffea699 100644 --- a/data-otservbr-global/npc/uzgod.lua +++ b/data-otservbr-global/npc/uzgod.lua @@ -79,7 +79,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 1) end elseif MsgContains(message, "crimson sword") then - if player:getStorageValue(Storage.TravellingTrader.Mission05) == 1 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission05) == 1 then npcHandler:say("Me don't sell crimson sword.", npc, creature) npcHandler:setTopic(playerId, 5) end @@ -122,7 +122,7 @@ local function creatureSayCallback(npc, creature, type, message) if player:removeMoneyBank(250) and player:removeItem(5880, 3) then npcHandler:say("Ah, that's how me like me customers. Ok, me do this... ... another fine swing of the hammer here and there... ... here you have it!", npc, creature) player:addItem(7385, 1) - player:setStorageValue(Storage.TravellingTrader.Mission05, 2) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission05, 2) npcHandler:setTopic(playerId, 0) end end diff --git a/data-otservbr-global/npc/willard.lua b/data-otservbr-global/npc/willard.lua index f35d20ad231..f6395476ba7 100644 --- a/data-otservbr-global/npc/willard.lua +++ b/data-otservbr-global/npc/willard.lua @@ -65,7 +65,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "package for rashid") then - if player:getStorageValue(Storage.TravellingTrader.Mission02) >= 1 and player:getStorageValue(Storage.TravellingTrader.Mission02) < 3 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02) >= 1 and player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02) < 3 then npcHandler:say({ "Oooh, damn, I completely forgot about that. I was supposed to pick it up from the Outlaw Camp. ...", "I can't leave my shop here right now, please go and talk to Snake Eye about that package... I promise he won't make any trouble. ...", @@ -76,7 +76,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif MsgContains(message, "yes") then if npcHandler:getTopic(playerId) == 1 then npcHandler:say("Thank you, I appreciate it. Don't forget to mention the package to Snake.", npc, creature) - player:setStorageValue(Storage.TravellingTrader.Mission02, player:getStorageValue(Storage.TravellingTrader.Mission02) + 1) + player:setStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02, player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02) + 1) npcHandler:setTopic(playerId, 0) end end diff --git a/data-otservbr-global/scripts/actions/other/others/quest_system2.lua b/data-otservbr-global/scripts/actions/other/others/quest_system2.lua index 51548ba437e..4d46deda7c4 100644 --- a/data-otservbr-global/scripts/actions/other/others/quest_system2.lua +++ b/data-otservbr-global/scripts/actions/other/others/quest_system2.lua @@ -33,7 +33,7 @@ local config = { items = { { itemId = 145 }, }, - storage = Storage.TravellingTrader.Mission02, + storage = Storage.Quest.U8_1.TheTravellingTrader.Mission02, formerValue = 3, newValue = 4, }, diff --git a/data-otservbr-global/scripts/actions/quests/the_travelling_trader/outlaw_camp_door.lua b/data-otservbr-global/scripts/actions/quests/the_travelling_trader/outlaw_camp_door.lua index 50f2687748f..9f8acff2bc5 100644 --- a/data-otservbr-global/scripts/actions/quests/the_travelling_trader/outlaw_camp_door.lua +++ b/data-otservbr-global/scripts/actions/quests/the_travelling_trader/outlaw_camp_door.lua @@ -1,6 +1,6 @@ local outlawCamp = Action() function outlawCamp.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.TravellingTrader.Mission02) == 3 then + if player:getStorageValue(Storage.Quest.U8_1.TheTravellingTrader.Mission02) == 3 then if item.itemid == 1642 then player:teleportTo(toPosition, true) item:transform(item.itemid + 1) diff --git a/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua b/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua index ec8eb869498..5669ccdd4b1 100644 --- a/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua +++ b/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua @@ -229,14 +229,14 @@ local questTable = { { storage = Storage.ThievesGuild.Mission06, storageValue = 4 }, { storage = Storage.ThievesGuild.Mission07, storageValue = 2 }, { storage = Storage.ThievesGuild.Mission08, storageValue = 1 }, - { storage = Storage.TravellingTrader.Mission01, storageValue = 1 }, - { storage = Storage.TravellingTrader.Mission01, storageValue = 2 }, - { storage = Storage.TravellingTrader.Mission02, storageValue = 5 }, - { storage = Storage.TravellingTrader.Mission03, storageValue = 3 }, - { storage = Storage.TravellingTrader.Mission04, storageValue = 3 }, - { storage = Storage.TravellingTrader.Mission05, storageValue = 3 }, - { storage = Storage.TravellingTrader.Mission06, storageValue = 2 }, - { storage = Storage.TravellingTrader.Mission07, storageValue = 1 }, + { storage = Storage.Quest.U8_1.TheTravellingTrader.Mission01, storageValue = 1 }, + { storage = Storage.Quest.U8_1.TheTravellingTrader.Mission01, storageValue = 2 }, + { storage = Storage.Quest.U8_1.TheTravellingTrader.Mission02, storageValue = 5 }, + { storage = Storage.Quest.U8_1.TheTravellingTrader.Mission03, storageValue = 3 }, + { storage = Storage.Quest.U8_1.TheTravellingTrader.Mission04, storageValue = 3 }, + { storage = Storage.Quest.U8_1.TheTravellingTrader.Mission05, storageValue = 3 }, + { storage = Storage.Quest.U8_1.TheTravellingTrader.Mission06, storageValue = 2 }, + { storage = Storage.Quest.U8_1.TheTravellingTrader.Mission07, storageValue = 1 }, { storage = Storage.Quest.U8_0.BarbarianArena.QuestLogGreenhorn, storageValue = 1 }, { storage = Storage.TibiaTales.DefaultStart, storageValue = 1 }, { storage = Storage.TibiaTales.ToAppeaseTheMightyQuest, storageValue = 1 }, diff --git a/data-otservbr-global/startup/tables/item.lua b/data-otservbr-global/startup/tables/item.lua index c99f943d785..96f60676a80 100644 --- a/data-otservbr-global/startup/tables/item.lua +++ b/data-otservbr-global/startup/tables/item.lua @@ -7,6 +7,11 @@ ItemAction = { itemId = 2819, itemPos = { { x = 33063, y = 31624, z = 15 } }, }, + -- The Travelling Trader Quest + [1108] = { + itemId = 1642, + itemPos = { { x = 32660, y = 32192, z = 8 } }, + }, -- Into The Bone Pit Quest - ectoplasm container [4205] = { itemId = 103,