From e397fc9762a4d8332087c62c47da221d9ca7c51c Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Wed, 24 Jul 2024 19:50:37 -0300 Subject: [PATCH] To Blind the Enemy Quest - Tibia Tales --- data-otservbr-global/lib/core/storages.lua | 14 +++++++------- data-otservbr-global/npc/eroth.lua | 8 ++++---- .../quests/to_blind_the_enemy_quest/mirror.lua | 4 ++-- data-otservbr-global/startup/tables/chest.lua | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index c4ec4522748..980ae0bdc37 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -1164,6 +1164,13 @@ Storage = { MedusaOil = 51531, Questline = 51532, }, + ToBlindTheEnemy = { + Questline = 41398, + DwarvenShield = 41399, + MorningStar = 41400, + BP1 = 41401, + BP2 = 41402, + }, }, TheShatteredIsles = { -- Reserved storage from 51540 - 51589 @@ -2071,13 +2078,6 @@ Storage = { Mission06 = 41396, Mission07 = 41397, }, - ToBlindTheEnemy = { - Questline = 41398, - DwarvenShield = 41399, - MorningStar = 41400, - BP1 = 41401, - BP2 = 41402, - }, ToOutfoxAFox = {}, TowerDefence = {}, Waterfall = {}, diff --git a/data-otservbr-global/npc/eroth.lua b/data-otservbr-global/npc/eroth.lua index c53f22d7b49..e8b59fa681f 100644 --- a/data-otservbr-global/npc/eroth.lua +++ b/data-otservbr-global/npc/eroth.lua @@ -57,15 +57,15 @@ local function creatureSayCallback(npc, creature, type, message) -- Check if the message contains "mission" if MsgContains(message, "mission") then -- Check if player is starting the quest - if player:getStorageValue(Storage.Quest.U8_1.ToBlindTheEnemy.Questline) < 1 then + if player:getStorageValue(Storage.TibiaTales.ToBlindTheEnemy.Questline) < 1 then npcHandler:say("Have you ever heard of Elvenbane? It is the castle west of Ab'Dendriel which is inhabited by villains from all over the continent. Any support in this war is welcome. Are you willing to help?", npc, creature) npcHandler:setTopic(playerId, 1) -- Check if player has completed certain objectives - elseif player:getStorageValue(Storage.Quest.U8_1.ToBlindTheEnemy.Questline) == 2 and player:getStorageValue(Storage.Quest.U8_1.ToBlindTheEnemy.DwarvenShield) == 1 and player:getStorageValue(Storage.Quest.U8_1.ToBlindTheEnemy.MorningStar) == 1 and player:getStorageValue(Storage.Quest.U8_1.ToBlindTheEnemy.BP1) == 1 and player:getStorageValue(Storage.Quest.U8_1.ToBlindTheEnemy.BP2) == 1 then + elseif player:getStorageValue(Storage.TibiaTales.ToBlindTheEnemy.Questline) == 2 and player:getStorageValue(Storage.TibiaTales.ToBlindTheEnemy.DwarvenShield) == 1 and player:getStorageValue(Storage.TibiaTales.ToBlindTheEnemy.MorningStar) == 1 and player:getStorageValue(Storage.TibiaTales.ToBlindTheEnemy.BP1) == 1 and player:getStorageValue(Storage.TibiaTales.ToBlindTheEnemy.BP2) == 1 then npcHandler:say("I heard the blow! The reflection must have caused a overcharge of magical energy leading to the contraction and the implosion. Just like I hoped! Please take this as a reward. Thank you very much.", npc, creature) player:addItem(3082, 1) player:addItem(3035, 10) - player:setStorageValue(Storage.Quest.U8_1.ToBlindTheEnemy.Questline, 3) + player:setStorageValue(Storage.TibiaTales.ToBlindTheEnemy.Questline, 3) npcHandler:setTopic(playerId, 0) end -- Check if the player has accepted the mission @@ -76,7 +76,7 @@ local function creatureSayCallback(npc, creature, type, message) "We don't really know how to destroy it but we suppose it may work if you reflect the invisible power of the ball. The beam should be adjusted to Ab'Dendriel. Take this mirror and give it a try. Good luck.", }, npc, creature) player:addItem(3463, 1) - player:setStorageValue(Storage.Quest.U8_1.ToBlindTheEnemy.Questline, 1) + player:setStorageValue(Storage.TibiaTales.ToBlindTheEnemy.Questline, 1) npcHandler:setTopic(playerId, 0) end diff --git a/data-otservbr-global/scripts/quests/to_blind_the_enemy_quest/mirror.lua b/data-otservbr-global/scripts/quests/to_blind_the_enemy_quest/mirror.lua index 454d1692742..95da06446a5 100644 --- a/data-otservbr-global/scripts/quests/to_blind_the_enemy_quest/mirror.lua +++ b/data-otservbr-global/scripts/quests/to_blind_the_enemy_quest/mirror.lua @@ -8,13 +8,13 @@ local function revertItem(position, itemId) end function mirror.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.Quest.U8_1.ToBlindTheEnemy.Questline) == 1 then + if player:getStorageValue(Storage.TibiaTales.ToBlindTheEnemy.Questline) == 1 then if target:getActionId() == 4001 and target.itemid == 132 then local itemToRemove = Tile(toPosition):getItemById(132) if itemToRemove then itemToRemove:remove() toPosition:sendMagicEffect(CONST_ME_MAGIC_POWDER) - player:setStorageValue(Storage.Quest.U8_1.ToBlindTheEnemy.Questline, 2) + player:setStorageValue(Storage.TibiaTales.ToBlindTheEnemy.Questline, 2) player:say("KABOOM !!", TALKTYPE_MONSTER_SAY, false, player, toPosition) addEvent(revertItem, 60 * 1000, toPosition, 132) item:remove(1) diff --git a/data-otservbr-global/startup/tables/chest.lua b/data-otservbr-global/startup/tables/chest.lua index d40bf24c2c2..53e1d981526 100644 --- a/data-otservbr-global/startup/tables/chest.lua +++ b/data-otservbr-global/startup/tables/chest.lua @@ -1305,14 +1305,14 @@ ChestUnique = { itemPos = { x = 32591, y = 31647, z = 3 }, reward = { { 3425, 1 } }, weight = 55.00, - storage = Storage.Quest.U8_1.ToBlindTheEnemy.DwarvenShield, + storage = Storage.TibiaTales.ToBlindTheEnemy.DwarvenShield, }, [6181] = { itemId = 2472, itemPos = { x = 32590, y = 31647, z = 3 }, reward = { { 3282, 1 } }, weight = 54.00, - storage = Storage.Quest.U8_1.ToBlindTheEnemy.MorningStar, + storage = Storage.TibiaTales.ToBlindTheEnemy.MorningStar, }, [6182] = { itemId = 2434, @@ -1320,7 +1320,7 @@ ChestUnique = { container = 2853, reward = { { 237, 1 }, { 3147, 1 }, { 3059, 1 } }, weight = 31.00, - storage = Storage.Quest.U8_1.ToBlindTheEnemy.BP1, + storage = Storage.TibiaTales.ToBlindTheEnemy.BP1, }, [6183] = { itemId = 2434, @@ -1328,7 +1328,7 @@ ChestUnique = { container = 2853, reward = { { 3028, 2 }, { 3031, 100 } }, weight = 18.20, - storage = Storage.Quest.U8_1.ToBlindTheEnemy.BP2, + storage = Storage.TibiaTales.ToBlindTheEnemy.BP2, }, -- Reward of others scrips files (varied rewards) -- The First dragon Quest