From 0e0f43a009b7b6689f282d6fd35045437d8dd6bd Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Thu, 25 Jul 2024 09:47:08 -0300 Subject: [PATCH] To Outfox a Fox Quest --- data-otservbr-global/lib/core/quests.lua | 2 +- data-otservbr-global/lib/core/storages.lua | 15 +++++++++------ data-otservbr-global/npc/budrik.lua | 13 ++++++++----- .../creaturescripts/customs/freequests.lua | 2 +- data-otservbr-global/startup/tables/chest.lua | 8 ++++++++ .../startup/tables/door_quest.lua | 2 +- 6 files changed, 28 insertions(+), 14 deletions(-) diff --git a/data-otservbr-global/lib/core/quests.lua b/data-otservbr-global/lib/core/quests.lua index aedb9e7c58e..0bc38df4583 100644 --- a/data-otservbr-global/lib/core/quests.lua +++ b/data-otservbr-global/lib/core/quests.lua @@ -4649,7 +4649,7 @@ if not Quests then }, [14] = { name = "To Outfox a Fox", - storageId = Storage.ToOutfoxAFoxQuest, + storageId = Storage.TibiaTales.ToOutfoxAFoxQuest, missionId = 10432, startValue = 1, endValue = 2, diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 980ae0bdc37..db7ab08090d 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -89,7 +89,6 @@ Storage = { WagonTicket = 30009, BloodHerbQuest = 30010, FirstMageWeapon = 30011, - ToOutfoxAFoxQuest = 30012, KawillBlessing = 30014, RentedHorseTimer = 30015, FountainOfLife = 30016, @@ -1165,11 +1164,15 @@ Storage = { Questline = 51532, }, ToBlindTheEnemy = { - Questline = 41398, - DwarvenShield = 41399, - MorningStar = 41400, - BP1 = 41401, - BP2 = 41402, + Questline = 51533, + DwarvenShield = 51534, + MorningStar = 51535, + BP1 = 51536, + BP2 = 51537, + }, + ToOutfoxAFoxQuest = { + Questline = 51538, + MiningHelmet = 51539, }, }, TheShatteredIsles = { diff --git a/data-otservbr-global/npc/budrik.lua b/data-otservbr-global/npc/budrik.lua index 6261e3d4c82..aab54f27e4b 100644 --- a/data-otservbr-global/npc/budrik.lua +++ b/data-otservbr-global/npc/budrik.lua @@ -58,21 +58,21 @@ local function creatureSayCallback(npc, creature, type, message) end if table.contains({ "mission", "quest" }, message:lower()) then - if player:getStorageValue(Storage.ToOutfoxAFoxQuest) < 1 then + if player:getStorageValue(Storage.TibiaTales.ToOutfoxAFoxQuest.Questline) < 1 then npcHandler:say({ "Funny that you are asking me for a mission! There is indeed something you can do for me. Ever heard about The Horned Fox? Anyway, yesterday his gang has stolen my mining helmet during a raid. ...", "It belonged to my father and before that to my grandfather. That helmet is at least 600 years old! I need it back. Are you willing to help me?", }, npc, creature) npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.ToOutfoxAFoxQuest) == 1 then + elseif player:getStorageValue(Storage.TibiaTales.ToOutfoxAFoxQuest.Questline) == 1 then if player:removeItem(139, 1) then - player:setStorageValue(Storage.ToOutfoxAFoxQuest, 2) + player:setStorageValue(Storage.TibiaTales.ToOutfoxAFoxQuest.Questline, 2) player:addItem(875, 1) npcHandler:say("As I was just saying to the others, 'this brave fellow will bring me my mining helmet back' and here you are with it!! Here take my spare helmet, I don't need it anymore!", npc, creature) else npcHandler:say("We presume the hideout of The Horned Fox is somewhere in the south-west near the coast, good luck finding my mining helmet!", npc, creature) end - elseif player:getStorageValue(Storage.ToOutfoxAFoxQuest) == 2 and player:getLevel() <= 40 and player:getStorageValue(Storage.KillingInTheNameOf.BudrikMinos) < 0 then + elseif player:getStorageValue(Storage.TibiaTales.ToOutfoxAFoxQuest.Questline) == 2 and player:getLevel() <= 40 and player:getStorageValue(Storage.KillingInTheNameOf.BudrikMinos) < 0 then npcHandler:say({ "I am so angry I could spit grit! That damn {Horned Fox} and his attacks! Let's show those bull-heads that they have messed with the wrong people....", "I want you to kill 5000 minotaurs - no matter where - for me and all the dwarfs of Kazordoon! Are you willing to do that?", @@ -100,7 +100,10 @@ local function creatureSayCallback(npc, creature, type, message) if npcHandler:getTopic(playerId) == 1 then npcHandler:say("I knew you have the guts for that task! We presume the hideout of The Horned Fox somewhere in the south-west near the coast. Good luck!", npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.ToOutfoxAFoxQuest, 1) + if player:getStorageValue(Storage.TibiaTales.DefaultStart) <= 0 then + player:setStorageValue(Storage.TibiaTales.DefaultStart, 1) + end + player:setStorageValue(Storage.TibiaTales.ToOutfoxAFoxQuest.Questline, 1) elseif npcHandler:getTopic(playerId) == 2 then npcHandler:say("Hussah! Let's bring war to those hoof-legged, dirt-necked, bull-headed minotaurs!! Come back to me when you are done with your {mission}.", npc, creature) player:setStorageValue(JOIN_STOR, 1) diff --git a/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua b/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua index 5669ccdd4b1..791986e6da0 100644 --- a/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua +++ b/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua @@ -361,7 +361,7 @@ local questTable = { -- Assassin Outfit quests { storage = Storage.KillingInTheNameOf.BudrikMinos, storageValue = 0 }, - { storage = Storage.ToOutfoxAFoxQuest, storageValue = 2 }, + { storage = Storage.TibiaTales.ToOutfoxAFoxQuest.Questline, storageValue = 2 }, -- Hunter Outfit quests { storage = Storage.OutfitQuest.HunterMusicSheet01, storageValue = 1 }, diff --git a/data-otservbr-global/startup/tables/chest.lua b/data-otservbr-global/startup/tables/chest.lua index b2fe1121f78..bc57e35855a 100644 --- a/data-otservbr-global/startup/tables/chest.lua +++ b/data-otservbr-global/startup/tables/chest.lua @@ -1330,6 +1330,14 @@ ChestUnique = { weight = 18.20, storage = Storage.TibiaTales.ToBlindTheEnemy.BP2, }, + -- To Outfox a Fox Quest + [6260] = { + itemId = 2469, + itemPos = { x = 32467, y = 31970, z = 5 }, + reward = { { 139, 1 } }, + weight = 7.00, + storage = Storage.TibiaTales.ToOutfoxAFoxQuest.MiningHelmet, + }, -- Reward of others scrips files (varied rewards) -- The First dragon Quest -- Treasure chests (data\scripts\actions\quests\first_dragon\treasure_chests.lua) diff --git a/data-otservbr-global/startup/tables/door_quest.lua b/data-otservbr-global/startup/tables/door_quest.lua index 1db118539b0..9d70115026f 100644 --- a/data-otservbr-global/startup/tables/door_quest.lua +++ b/data-otservbr-global/startup/tables/door_quest.lua @@ -46,7 +46,7 @@ QuestDoorAction = { itemPos = { { x = 32455, y = 31967, z = 14 } }, }, -- To Outfox a Fox Quest, mining helmet door - [Storage.ToOutfoxAFoxQuest] = { + [Storage.TibiaTales.ToOutfoxAFoxQuest.Questline] = { itemId = false, itemPos = { { x = 32467, y = 31969, z = 5 } }, },