From 6b2370d4b185011d81217654e47a96c70200b657 Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:27:18 -0300 Subject: [PATCH] The Dream Courts Quest - part 2 I stopped at "The Seven Keys". --- data-otservbr-global/lib/core/storages.lua | 11 +- .../the_dream_courts/bosses/faceless_bane.lua | 14 -- data-otservbr-global/npc/andrew_lyze.lua | 214 ++++++++++++++---- data-otservbr-global/npc/myzzi.lua | 110 +++++++++ data-otservbr-global/npc/stricken_soul.lua | 59 ++++- data-otservbr-global/npc/vanys.lua | 176 +++++++------- .../actions/bosses_levers/faceless_bane.lua | 24 -- .../scripts/actions/other/enchanting.lua | 4 + .../actions_acidFishingRod.lua | 1 + .../actions_bookOnTable.lua | 6 +- .../actions_chargedCompass.lua | 2 +- .../actions_containerRewards.lua | 28 +-- .../actions_doorInvisible.lua | 2 +- .../actions_dreamTalisman.lua | 14 +- .../actions_dreamcatcher_curse.lua | 6 +- .../actions_dreamscarLevers.lua | 40 ++-- .../actions_facelessLever.lua | 12 +- .../actions_goldenAxe.lua | 10 +- .../actions_goldenIdol.lua | 26 +++ .../actions_idolCheck.lua | 57 ----- .../actions_questDoors.lua | 66 +++--- .../actions_sequenceBooks.lua | 2 +- .../actions_sequenceSkulls.lua | 2 +- .../creaturescripts_Izcandar.lua | 4 +- .../creaturescripts_dreamCourtsDeath.lua | 38 ++-- .../creaturescripts_facelessBane.lua | 4 +- .../creaturescripts_nightmareCurse.lua | 8 +- .../movements_acessTeleports.lua | 20 +- .../movements_facelessTiles.lua | 2 +- .../movements_spiderSummon.lua | 3 +- .../spells_alptramun_summon.lua | 2 +- .../spells_nightmare_beast_curse.lua | 8 +- data-otservbr-global/startup/tables/item.lua | 46 ++++ data-otservbr-global/startup/tables/lever.lua | 2 +- .../startup/tables/teleport_item.lua | 7 - data-otservbr-global/world/otservbr-npc.xml | 3 + data/items/items.xml | 1 + 37 files changed, 656 insertions(+), 378 deletions(-) create mode 100644 data-otservbr-global/npc/myzzi.lua delete mode 100644 data-otservbr-global/scripts/actions/bosses_levers/faceless_bane.lua delete mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 7a2b2ac1abc..e1c2f913539 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -2740,6 +2740,7 @@ Storage = { Cellar = 23132, Temple = 23133, Tomb = 23134, + IdolCount = 2313555, }, BurriedCatedral = { FishingRod = 23145, @@ -2755,7 +2756,7 @@ Storage = { TheSevenKeys = { Questline = 23170, RoseBush = 23171, - Mushroom = 23172, + MushRoom = 23172, Book = 23173, OrcSkull = 23174, Recipe = 23175, @@ -2773,20 +2774,20 @@ Storage = { BossCount = 23191, MaxxeniusTimer = 23192, AlptramunTimer = 23193, - PlaguerootTimer = 23194, + PlagueRootTimer = 23194, IzcandarTimer = 23195, MalofurTimer = 23196, NightmareTimer = 23197, LastBossCurse = 23198, }, - BurriedCatedral = { + BurriedCatedralGlobal = { FacelessTiles = 531900, FacelessTimer = 531901, }, - DreamScar = { + DreamScarGlobal = { MaxxeniusTimer = 531902, AlptramunTimer = 531903, - PlaguerootTimer = 531904, + PlagueRootTimer = 531904, IzcandarTimer = 531905, MalofurTimer = 531906, AlptramunSummonsKilled = 531907, diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua index c288cd67eb5..20ab0feb208 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua @@ -23,7 +23,6 @@ monster.manaCost = 0 monster.events = { "dreamCourtsDeath", "facelessThink", - "facelessHealth", } monster.changeTarget = { @@ -151,19 +150,6 @@ monster.immunities = { { type = "bleed", condition = false }, } -mType.onThink = function(monster, interval) end - -mType.onAppear = function(monster, creature) - if monster:getType():isRewardBoss() then - -- reset global storage state to default / ensure sqm's reset for the next team - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.FacelessBane.Deaths, -1) - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.FacelessBane.StepsOn, -1) - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.FacelessBane.ResetSteps, 1) - monster:registerEvent("facelessBaneImmunity") - monster:setReward(true) - end -end - mType.onDisappear = function(monster, creature) end mType.onMove = function(monster, creature, fromPosition, toPosition) end diff --git a/data-otservbr-global/npc/andrew_lyze.lua b/data-otservbr-global/npc/andrew_lyze.lua index 82b1f9a61ce..2438ef792f5 100644 --- a/data-otservbr-global/npc/andrew_lyze.lua +++ b/data-otservbr-global/npc/andrew_lyze.lua @@ -64,6 +64,52 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local brokenCompass = 25746 +local chargeableCompass = 29291 +local chargedCompass = 29294 +local goldenAxe = 29286 +local CompassValue = 10000 + +local buildCompass = { + [1] = {id = 29346, qnt = 15}, + [2] = {id = 29345, qnt = 50}, + [3] = {id = 29347, qnt = 5}, + [4] = {id = 25746, qnt = 1}, +} + +local chargeCompass = { + [1] = {id = 29287, qnt = 5}, + [2] = {id = 29288, qnt = 3}, + [3] = {id = 29289, qnt = 1}, + [4] = {id = 29348, qnt = 1}, + [5] = {id = 29291, qnt = 1}, +} + +local function removeBait(player) + local player = Player(player) + + if player and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait) == 1 then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait, - 1) + end +end + +local function greetCallback(npc, creature) + local player = Player(creature) + local playerId = player:getId() + + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) < 1 then + npcHandler:setMessage(MESSAGE_GREET, "Hello, I am the warden of this {monument}. The {sarcophagus} in front of you was established to prevent people from going {down} there. But I doubt that this step is sufficient.") + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 1 then + npcHandler:setMessage(MESSAGE_GREET, "Well, let's see if your mission was successful. Just bring me all needed {materials}.") + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 2 then + npcHandler:setMessage(MESSAGE_GREET, "If you dug up all three crystals of sufficient quantity and obtained the poison gland, the charging of your compass can start! For the very first time it will be charged by the violet crystal. Ready to {unleash} the power of the crystals?") + else + npcHandler:setMessage(MESSAGE_GREET, "Greetings.") + end + + return true +end + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -72,62 +118,154 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "monument") then + if MsgContains(message, "monument") and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) < 1 then npcHandler:say({ "Well, a while ago powerful magic devices were used all around Tibia. These are chargeable compasses. There was but one problem: they offered the possibility to make people rich in a quite easy way. ...", "Therefore, these instruments were very coveted. People tried to get their hands on them at all costs. And so it happened what everybody feared - bloody battles forged ahead. ...", - "To put an end to these cruel escalations, eventually all of the devices were collected and destroyed. The remains were buried {deep} in the earth.", - }, npc, creature, 10) - npcHandler:setTopic(playerId, 0) - elseif MsgContains(message, "deep") then + "To put an end to these cruel escalations, eventually all of the devices were collected and destroyed. The remains were buried {deep} in the earth." + }, npc, creature) + npcHandler:setTopic(playerId, 2) + elseif MsgContains(message, "deep") and npcHandler:getTopic(playerId) == 2 then npcHandler:say("As far as I know it is a place of helish heat with bloodthirsty monsters of all kinds.", npc, creature) - npcHandler:setTopic(playerId, 0) - elseif MsgContains(message, "sarcophagus") then + npcHandler:setTopic(playerId, 1) + elseif MsgContains(message, "sarcophagus") and npcHandler:getTopic(playerId) == 1 then npcHandler:say("This sarcophagus seals the entrance to the caves down there. Only here you can get all the {materials} you need for a working compass of this kind. So no entrance here - no further magic compasses in Tibia. In theory.", npc, creature) + npcHandler:setTopic(playerId, 4) + elseif MsgContains(message, "down") and npcHandler:getTopic(playerId) == 10 then + npcHandler:say("On first glance, this cave does not look very spectacular, but the things you find in there, are. You have to know that this is the only place where you can find the respective materials to build the compass.", npc, creature) npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "materials") then - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.AndrewDoor) ~= 1 then - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.AndrewDoor, 1) + if npcHandler:getTopic(playerId) == 4 then + npcHandler:say({ + "Only in the cave down there you will find the materials you need to repair the {compass}. Now you know why the entrance is sealed. There's the seal, but I have a deal for you: ...", + "I can repair the compass for you if you deliver what I need. Besides the broken compass you have to bring me the following materials: 50 blue glas plates, 15 green glas plates and 5 violet glas plates. ...", + "They all can be found in this closed cave in front of you. I should have destroyed this seal key but things have changed. The entrance is opened now, go down and do what has to be done." + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, 1) + npcHandler:setTopic(playerId, 0) + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 1 then + npcHandler:say("May I repair your compass if possible?", npc, creature) + npcHandler:setTopic(playerId, 11) + end + elseif MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 11 then + local haveItens = false + + for _, k in pairs(buildCompass) do + if player:getItemCount(k.id) >= k.qnt then + haveItens = true + else + haveItens = false + end + end + + if haveItens then + for _, k in pairs(buildCompass) do + if player:getItemCount(k.id) >= k.qnt then + player:removeItem(k.id, k.qnt) + end + end + + npcHandler:say({ + "Alright, I put the glasses into the right pattern and can repair the compass. ...", + "There we are! The next step is the charging of the compass. For this you have to dig three different crystals down there: 5 blue, 3 green and one violet crystal. Are you ready to do that?" + }, npc, creature) + player:addItem(chargeableCompass, 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, 2) + npcHandler:setTopic(playerId, 12) + else + npcHandler:say("You don't have the needed itens yet.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + elseif npcHandler:getTopic(playerId) == 12 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.GotAxe) < 1 then + npcHandler:say({ + "Nice! To do so, take this golden axe and mine the prominent crystals in the cave. Besides, I need a poison gland of quite rare spiders, they are called lucifuga araneae. ...", + "These are quite shy, but I have a {bait} for you to lure them. But take care not to face too many of them at once. And hurry, the effect won't last forever!" + }, npc, creature) + player:addItem(goldenAxe, 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.GotAxe, 1) + npcHandler:setTopic(playerId, 0) + elseif npcHandler:getTopic(playerId) == 51 then + if (player:getMoney() + player:getBankBalance()) >= CompassValue then + npcHandler:say("Here's your broken compass!", npc, creature) + player:removeMoneyBank(CompassValue) + player:addItem(brokenCompass, 1) + npcHandler:setTopic(playerId, 10) + else + npcHandler:say("You don't have enough money.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + end + elseif MsgContains(message, "unleash") then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 2 then + local haveItens = false + + for _, k in pairs(chargeCompass) do + if player:getItemCount(k.id) >= k.qnt then + haveItens = true + else + haveItens = false + end + end + + if haveItens then + for _, k in pairs(chargeCompass) do + if player:getItemCount(k.id) >= k.qnt then + player:removeItem(k.id, k.qnt) + end + end + + npcHandler:say({ + "I put these crystals onto the top of compass. As you can see, the compass is now pulsating in a warm, violet colour. ...", + "Now this compass is ready for usage. It can transfer the bound energy to other inanimate objects to open certain gates or chests." + }, npc, creature) + player:addItem(chargedCompass, 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, 3) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("You don't have the needed itens yet.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + end + elseif MsgContains(message, "bait") then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 2 then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait) < 1 then + npcHandler:say("Done. Worry, the effect won't last forever!", npc, creature) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait, 1) + addEvent(removeBait, 3*60*1000, player:getId()) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("You're already with my bait!", npc, creature) + npcHandler:setTopic(playerId, 0) + end + else + npcHandler:say("You cannot do that yet.", npc, creature) + npcHandler:setTopic(playerId, 0) end - npcHandler:say({ - "Only in the cave down there you will find the materials you need to repair the compass. Now you know why the entrance is sealed. There's the seal, but I have a deal for you: ...", - "I can repair the compass for you if you deliver what I need. Besides the broken compass you have to bring me the following materials: 50 blue glas plates, 15 green glas plates and 5 violet glas plates. ...", - "They all can be found in this closed cave in front of you. I should have destroyed this seal key but things have changed. The entrance is opened now, go down and do what has to be done.", - }, npc, creature, 10) - npcHandler:setTopic(playerId, 2) - elseif MsgContains(message, "down") then - npcHandler:say("On first glance, this cave does not look very spectacular, but the things you find in there, are. You have to know that this is the only place where you can find the respective materials to build the {compass}.", npc, creature) - npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "compass") then - npcHandler:say("It was decided to collect all of the compasses, destroy them and throw them in the fiery {depths} of Tibia. I still have some of them here. I {sell} them for a low price if you want.", npc, creature) - npcHandler:setTopic(playerId, 0) - elseif MsgContains(message, "depths") then - npcHandler:say("As far as I know it is a place of helish heat with bloodthirsty monsters of all kinds.", npc, creature) - npcHandler:setTopic(playerId, 0) + npcHandler:say("It was decided to collect all of the compasses, destroy them and throw them in the fiery depths of Tibia. I still have some of them here. I {sell} them for a low price if you want.", npc, creature) + npcHandler:setTopic(playerId, 50) elseif MsgContains(message, "sell") then - npcHandler:say("Would you like to buy a broken compass for 10.000 gold?", npc, creature) - npcHandler:setTopic(playerId, 1) - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 then - local message = "You have bought a compass" - if not checkWeightAndBackpackRoom(player, 80, message) then - npcHandler:say("You not have room or capacity to take it.", npc, creature) - return true - end - if player:getMoney() + player:getBankBalance() >= 5000 then - player:removeMoneyBank(5000) - player:addItem(10302, 1) + if npcHandler:getTopic(playerId) == 50 then + npcHandler:say("Would you like to buy a broken compass for 10.000 gold?", npc, creature) + npcHandler:setTopic(playerId, 51) end + elseif MsgContains(message, "no") then + npcHandler:say({"Don't waste my time."}, npc, creature) npcHandler:setTopic(playerId, 0) + else + npcHandler:say("Sorry, I didn't understand.", npc, creature) end + return true end -npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) - -npcHandler:setMessage(MESSAGE_GREET, "Hello, I am the warden of this {monument}. The {sarcophagus} in front of you was established to prevent people from going {down} there. But I {doubt} that this step is sufficient.") - +npcHandler:setMessage(MESSAGE_WALKAWAY, 'Well, bye then.') npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye.") +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/myzzi.lua b/data-otservbr-global/npc/myzzi.lua new file mode 100644 index 00000000000..275768b8430 --- /dev/null +++ b/data-otservbr-global/npc/myzzi.lua @@ -0,0 +1,110 @@ +local internalNpcName = "Myzzi" +local npcType = Game.createNpcType(internalNpcName) +local npcConfig = {} + +npcConfig.name = internalNpcName +npcConfig.description = internalNpcName + +npcConfig.health = 100 +npcConfig.maxHealth = npcConfig.health +npcConfig.walkInterval = 2000 +npcConfig.walkRadius = 2 + +npcConfig.outfit = { + lookType = 982, + lookHead = 0, + lookBody = 0, + lookLegs = 0, + lookFeet = 0, + lookAddons = 0, +} + +npcConfig.flags = { + floorchange = false, +} + +npcConfig.voices = { + interval = 15000, + chance = 50, + { text = "You need to find some heroes. Find, find, find!!" }, +} + +local keywordHandler = KeywordHandler:new() +local npcHandler = NpcHandler:new(keywordHandler) + +npcType.onThink = function(npc, interval) + npcHandler:onThink(npc, interval) +end + +npcType.onAppear = function(npc, creature) + npcHandler:onAppear(npc, creature) +end + +npcType.onDisappear = function(npc, creature) + npcHandler:onDisappear(npc, creature) +end + +npcType.onMove = function(npc, creature, fromPosition, toPosition) + npcHandler:onMove(npc, creature, fromPosition, toPosition) +end + +npcType.onSay = function(npc, creature, type, message) + npcHandler:onSay(npc, creature, type, message) +end + +npcType.onCloseChannel = function(npc, creature) + npcHandler:onCloseChannel(npc, creature) +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 player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline) < 1 then + if MsgContains(message, "good") then + npcHandler:say("I'm just a mere messenger and I'm here to find brave adventurers that might {help} my friends in this time of need.", npc, creature) + npcHandler:setTopic(playerId, 2) + elseif MsgContains(message, "help") and npcHandler:getTopic(playerId) == 2 then + npcHandler:say("Lady Alivar of the Summer Court and Lord Cadion of the Winter Court are in need of brave adventurers to avert a great {threat} for the whole world.", npc, creature) + npcHandler:setTopic(playerId, 3) + elseif MsgContains(message, "threat") and npcHandler:getTopic(playerId) == 3 then + npcHandler:say({ + "I know only little and I forget so much. So many things going around my mind! ...", + "However, I can grant you access to the {Courts} of Summer and Winter if you promise to help! There you can meet with Undal or Vanys, the servants of Lord Cadion and Lady Alivar. They will be able to tell you more about the issue." + }, npc, creature) + npcHandler:setTopic(playerId, 4) + elseif MsgContains(message, "courts") and npcHandler:getTopic(playerId) == 4 then + npcHandler:say({"There are {entrances} to the hidden Courts of Summer and Winter in secluded places. You can find the portal to the Winter Court high in the mountains of Tyrsung and the portal to the Summer Court in the meadows of Feyrist. ...", + "With my magic you will be able to enter the Courts. Find Undal or Vanys and talk to them."}, npc, creature) + npcHandler:setTopic(playerId, 5) + elseif MsgContains(message, "entrances") and npcHandler:getTopic(playerId) == 5 then + npcHandler:say("So, are you willing to help in this time of need?", npc, creature) + npcHandler:setTopic(playerId, 6) + elseif npcHandler:getTopic(playerId) == 6 then + if MsgContains(message, "yes") then + npcHandler:say({"You are a true hero! Here, take my enchantment and you will be able to pass the portals. Now hurry, my friends are waiting."}, npc, creature) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline, 1) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("What?!", npc, creature) + end + end + end + + return true +end + +npcHandler:setMessage(MESSAGE_GREET, "Hello adventurer. It is {good} to see you.") +npcHandler:setMessage(MESSAGE_FAREWELL, "Well, bye then.") +npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") + +npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) + +npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) + +-- npcType registering the npcConfig table +npcType:register(npcConfig) diff --git a/data-otservbr-global/npc/stricken_soul.lua b/data-otservbr-global/npc/stricken_soul.lua index 88857dfb1e1..2e1448fd300 100644 --- a/data-otservbr-global/npc/stricken_soul.lua +++ b/data-otservbr-global/npc/stricken_soul.lua @@ -45,8 +45,63 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end -keywordHandler:addKeyword({ "job" }, StdModule.say, { npcHandler = npcHandler, text = "Esperando Script." }) -npcHandler:setMessage(MESSAGE_GREET, "Greetings, |PLAYERNAME|.") +local function greetCallback(npc, creature) + local player = Player(creature) + local playerId = player:getId() + + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline) < 1 then + npcHandler:setMessage(MESSAGE_GREET, "This place is... haunted... heed my warning... there are... ghooooooosts here...! Why are you giving me that... look? I am certain, there aaaaaaare ghosts here - I've seen them! Do you believe me?") + else + npcHandler:setMessage(MESSAGE_GREET, "Gree... tings.") + end + + return true +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 + + local playerName = player:getName() + + if MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 2 then + npcHandler:say("Excellent... I hope they will haaaaaaunt my house no longer. What was your... naaaaaame again, tell me?", npc, creature) + npcHandler:setTopic(playerId, 3) + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline) < 1 then + npcHandler:say("Yeeeees... you need to help meeeeeee. I want those ghosts gone... this is my home and I need it to teach my students. Will you take care of the... ghosts?", npc, creature) + npcHandler:setTopic(playerId, 2) + end + elseif MsgContains(message, playerName) then + if npcHandler:getTopic(playerId) == 3 then + npcHandler:say({ + " Ah yeeeeees, ".. playerName .. ". I will remember you. Now, lessons are every day in the morning and once a week in the evening... ...", + "Oh, you're not here for this, are you? So about the ghoooosts, yes. You seeeee, there are 3 secret passages here. ...", + "Thiiiiis is no ordinary house... it is a nexus, a gateway to a once hidden cathedral. Sheltering a small and peaceful society of scholars and monks. Secluded from every distraction. ...", + "I was one of them and ordered to hold contact to the outside woooorld. But then, something... happened. ...", + "Outsiders managed to sneak in, infiltrate and influence the society... for the worse. Who knows for what ends. They chaaaaanged... ...", + "Shortly after, contact was lost... the nexus broken and sealed, ghosts appeared... eeeeeeeverywhere. ...", + "Find the three passages... one is right here in the cellars, one in the jungles of Tiquanda and one in the deserts of Darama. ...", + "Restore their connection and open this nexus to access the buried cathedral and find the cause to this... eliminate all remainders there if you must, "..playerName.."." + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 1) + npcHandler:setTopic(playerId, 0) + end + else + npcHandler:say("Sorry, I didn't understand.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + + return true +end + +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/vanys.lua b/data-otservbr-global/npc/vanys.lua index c922ce8c8cd..b3b3cf8eb58 100644 --- a/data-otservbr-global/npc/vanys.lua +++ b/data-otservbr-global/npc/vanys.lua @@ -53,36 +53,6 @@ end npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) -local outfits = { 1147, 1146 } - -local function hasOutfit(player) - for _, outfit in ipairs(outfits) do - if player:hasOutfit(outfit) then - return true - end - end - return false -end - -local function hasAddon(player, addon) - for _, outfit in ipairs(outfits) do - if player:hasOutfit(outfit, addon) then - return true - end - end - return false -end - -local function hasKllledTheNightmareBeast(player) - return player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareBeastKilled) == 1 -end - -local function checkAchievement(player) - if hasAddon(player, 3) then - player:addAchievement("Dream Warrior") - end -end - local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -91,82 +61,112 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if npcHandler:getTopic(playerId) == 0 then - if MsgContains(message, "task") or MsgContains(message, "outfit") then - if hasOutfit(player) then - npcHandler:say("You already have the Dream Warrior outfit.", npc, creature) - return true - end - - if not hasKllledTheNightmareBeast(player) then - npcHandler:say("You need to kill the Nightmare Beast first.", npc, creature) - return true - end + local dreamTalisman = 30132 - npcHandler:say("The Nightmare Beast is slain. You have done well. The Courts of Summer and Winter will be forever grateful. For your efforts I want to reward you with our traditional dream warrior outfit. May it suit you well!", npc, creature) - for _, outfit in ipairs(outfits) do - player:addOutfit(outfit, 0) - end - return true + if MsgContains(message, "talk") then + npcHandler:say("So do you want to learn the {story} behind of this or rather talk about the {task} at hand? ", npc, creature) + npcHandler:setTopic(playerId, 2) + elseif MsgContains(message, "story") then + if npcHandler:getTopic(playerId) == 2 then + npcHandler:say("Do you prefer the {long} version or the {short} version?", npc, creature) + npcHandler:setTopic(playerId, 3) end - - if MsgContains(message, "addon") then - if not hasOutfit(player) then - npcHandler:say("You don't have the Dream Warrior outfit.", npc, creature) - return true + elseif MsgContains(message, "short") and npcHandler:getTopic(playerId) == 3 then + npcHandler:say({ + "You will have to re-empower several wardstones all over the world, to weaken the beast of nightmares. ...", + "The next step would be to enter a place known as dream scar and participate in battles, to gain access to the lower areas. ...", + "There the nightmare beast can be challenged and defeated.", + "So do you want to learn the story behind of this or rather talk about the {task} at hand?" + }, npc, creature) + npcHandler:setTopic(playerId, 4) + elseif npcHandler:getTopic(playerId) == 4 or npcHandler:getTopic(playerId) == 2 then + if MsgContains(message, "task") then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) >= 3 and not (player:hasOutfit(1146) or player:hasOutfit(1147)) then + npcHandler:say("The Nightmare Beast is slain. You have done well. The Courts of Summer and Winter will be forever grateful. For your efforts I want to reward you with our traditional dream warrior outfit. May it suit you well!", npc, creature) + for i = 1146, 1147 do + player:addOutfit(i) + end + npcHandler:setTopic(playerId, 0) + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count) >= 8 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) == 1 then + npcHandler:say({ + "You empowered all eight ward stones. Well done! You may now enter the Dream Labyrinth via the portal here in the Court. Beneath it you will find the Nightmare Beast's lair. But the labyrinth is protected by seven so called Dream Doors. ...", + "You have to find the Seven {Keys} to unlock the Seven Dream Doors down there. Only then you will be able to enter the Nightmare Beast's lair." + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, 2) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, 1) + npcHandler:setTopic(playerId, 5) + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) < 1 then + npcHandler:say({ + "You have to empower eight ward stones. Once charged with arcane energy, they will strengthen the Nightmare Beast's prison and at the same time weaken this terrible creature. We know about the specific location of six of those stones. ...", + "You can find them in the mountains of the island Okolnir, in a water elemental cave beneath Folda, in the depths of Calassa, in the forests of Feyrist and on the islands Meriana and Cormaya. ..." , + "The location of the other two ward stones is a bit more obscure, however. We are not completely sure where they are. You should make inquiries at an abandoned house in the Plains of Havoc. You may find it east of an outlaw camp. ..." , + "The other stone seems to be somewhere in Tiquanda. Search for a small stone building south-west of Banuta. Take this talisman to empower the ward stones. It will work with the six stones at the known locations. ..." , + "However, the empowering of the two hidden stones could be a bit more complicated. But you have to find out on yourself what to do with those stones." + }, npc, creature) + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline) < 1 then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline, 1) + end + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count, 0) + player:addItem(dreamTalisman, 1) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("I already gave your task.", npc, creature) + npcHandler:setTopic(playerId, 0) end - npcHandler:say("Are you interested in one or two addons to your dream warrior outfit?", npc, creature) - npcHandler:setTopic(playerId, 1) - return true end - elseif npcHandler:getTopic(playerId) == 1 then - if MsgContains(message, "yes") then - npcHandler:say("I provide two addons. For the first one I need you to bring me five pomegranates. For the second addon you need an ice shield. Which one would you like? {Pomegranate} or {shield}?", npc, creature) - npcHandler:setTopic(playerId, 2) + elseif MsgContains(message, "keys") and npcHandler:getTopic(playerId) == 5 then + npcHandler:say("They are not literally keys but rather puzzles you have to solve or a secret mechanism you have to discover in order to open the Dream Doors. A parchment in the chest here can tell you more about it.", npc, creature) + elseif MsgContains(message, "addon") then + if player:hasOutfit(1146) or player:hasOutfit(1147) then + npcHandler:say("Are you interested in one or two addons to your dream warrior outfit?", npc, creature) + npcHandler:setTopic(playerId, 6) else - npcHandler:say("Alright then. Come back if you change your mind.", npc, creature) - npcHandler:setTopic(playerId, 0) + npcHandler:say("You don't even have the outfit.", npc, creature) end - elseif npcHandler:getTopic(playerId) == 2 then - if MsgContains(message, "pomegranate") then - if hasAddon(player, 1) then - npcHandler:say("You already have this addon.", npc, creature) - return true - end - if player:removeItem(30169, 5) then - npcHandler:say("Great! Here is the addon.", npc, creature) - for _, outfit in ipairs(outfits) do - player:addOutfitAddon(outfit, 1) + elseif MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 6 then + npcHandler:say("I provide two addons. For the first one I need you to bring me five pomegranates. For the second addon you need an ice shield. Do you want one of these addons?", npc, creature) + npcHandler:setTopic(playerId, 7) + elseif npcHandler:getTopic(playerId) == 7 then + npcHandler:say("What do you have for me: the {pomegranates} or the {ice shield}?", npc, creature) + npcHandler:setTopic(playerId, 8) + end + elseif npcHandler:getTopic(playerId) == 8 then + if MsgContains(message, "pomegranates") then + if player:getItemCount(30169) >= 5 then + npcHandler:say("Very good! You gained the second addon to the dream warrior outfit.", npc, creature) + player:removeItem(30169, 5) + for i = 1146, 1147 do + player:addOutfitAddon(i, 2) end - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - checkAchievement(player) npcHandler:setTopic(playerId, 0) else - npcHandler:say("Sorry, you don't have the required items.", npc, creature) - end - elseif MsgContains(message, "shield") then - if hasAddon(player, 2) then - npcHandler:say("You already have this addon.", npc, creature) - return true + npcHandler:say("You do not have enough items.", npc, creature) + npcHandler:setTopic(playerId, 0) end - if player:removeItem(30168, 1) then - npcHandler:say("Great! Here is the addon.", npc, creature) - for _, outfit in ipairs(outfits) do - player:addOutfitAddon(outfit, 2) + elseif MsgContains(message, "ice shield") then + if player:getItemCount(30168) >= 1 then + npcHandler:say("Very good! You gained the first addon to the dream warrior outfit.", npc, creature) + player:removeItem(30168, 1) + for i = 1146, 1147 do + player:addOutfitAddon(i, 1) end - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - checkAchievement(player) npcHandler:setTopic(playerId, 0) else - npcHandler:say("Sorry, you don't have the required items.", npc, creature) + npcHandler:say("You do not have enough items.", npc, creature) + npcHandler:setTopic(playerId, 0) end - else - npcHandler:say("Sorry, I didn't understand.", npc, creature) - return true end + else + npcHandler:say("Sorry, I didn't understand.", npc, creature) end end +npcHandler:setMessage(MESSAGE_GREET, "Greetings hero. I guess you came to {talk}.") +npcHandler:setMessage(MESSAGE_FAREWELL, "Well, bye then.") +npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") + npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) -- npcType registering the npcConfig table diff --git a/data-otservbr-global/scripts/actions/bosses_levers/faceless_bane.lua b/data-otservbr-global/scripts/actions/bosses_levers/faceless_bane.lua deleted file mode 100644 index 75dcc91bbb9..00000000000 --- a/data-otservbr-global/scripts/actions/bosses_levers/faceless_bane.lua +++ /dev/null @@ -1,24 +0,0 @@ -local config = { - boss = { - name = "Faceless Bane", - position = Position(33617, 32561, 13), - }, - requiredLevel = 250, - timeToDefeat = 15 * 60, - playerPositions = { - { pos = Position(33638, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33639, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33640, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33641, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33642, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, - }, - specPos = { - from = Position(33607, 32553, 13), - to = Position(33627, 32570, 13), - }, - exit = Position(33618, 32523, 15), -} - -local lever = BossLever(config) -lever:uid(1039) -lever:register() diff --git a/data-otservbr-global/scripts/actions/other/enchanting.lua b/data-otservbr-global/scripts/actions/other/enchanting.lua index ef6d648d15e..1db4448f921 100644 --- a/data-otservbr-global/scripts/actions/other/enchanting.lua +++ b/data-otservbr-global/scripts/actions/other/enchanting.lua @@ -44,6 +44,10 @@ local enchantedItems = { local enchanting = Action() function enchanting.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if item.itemid == 675 and target.itemid == 21573 then + return onGrindItem(player, item, fromPosition, target, toPosition) + end + if table.contains({ 33268, 33269 }, toPosition.x) and toPosition.y == 31830 and toPosition.z == 10 and player:getStorageValue(Storage.Quest.U8_2.ElementalSpheres.QuestLine) > 0 then if not table.contains(spheres[item.itemid], player:getVocation():getBaseId()) then return false diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua index 3d89eb52136..2f1502bd063 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua @@ -28,4 +28,5 @@ function actions_acidFishingRod.onUse(player, item, fromPosition, target, toPosi end actions_acidFishingRod:id(29950) +actions_acidFishingRod:allowFarUse(true) actions_acidFishingRod:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua index a2e4a930059..a16bc0bc930 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua @@ -1,6 +1,6 @@ local questline = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline -local wordsCount = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount -local facelessTime = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTime +local wordsCount = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount +local facelessTime = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FacelessTime local actions_bookOnTable = Action() @@ -27,5 +27,5 @@ function actions_bookOnTable.onUse(player, item, fromPosition, target, toPositio return true end -actions_bookOnTable:id(29991) +actions_bookOnTable:id(29954) actions_bookOnTable:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua index 574dbaea545..92267a99d47 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua @@ -1,5 +1,5 @@ local wardPosition = Position(32769, 32621, 10) -local storage = Storage.Quest.U12_00.TheDreamCourts.WardStones.porthopeStone +local storage = Storage.Quest.U12_00.TheDreamCourts.WardStones.PortHopeStone local count = Storage.Quest.U12_00.TheDreamCourts.WardStones.Count local function revertStone(position, on, off) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua index ca1f2018d1f..a543149b648 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua @@ -2,7 +2,7 @@ local containers = { [1] = { uniqueid = 23102, cPosition = Position(32736, 32282, 8), - storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.skeletonContainer, + storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.SkeletonContainer, value = 1, reward = 29310, defaultItem = true, @@ -10,7 +10,7 @@ local containers = { [2] = { uniqueid = 23103, cPosition = Position(33693, 32185, 8), - storage = Storage.Quest.U12_00.TheDreamCourts.Main.courtChest, + storage = Storage.Quest.U12_00.TheDreamCourts.Main.CourtChest, value = 1, reward = 30146, defaultItem = true, @@ -18,7 +18,7 @@ local containers = { [3] = { uniqueid = 23104, cPosition = Position(33711, 32108, 4), - storage = Storage.Quest.U12_00.TheDreamCourts.Main.courtChest, + storage = Storage.Quest.U12_00.TheDreamCourts.Main.CourtChest, value = 1, reward = 30146, defaultItem = true, @@ -26,7 +26,7 @@ local containers = { [4] = { uniqueid = 23105, cPosition = Position(33578, 32527, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.fishingRod, + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FishingRod, value = 1, reward = 29950, defaultItem = true, @@ -34,7 +34,7 @@ local containers = { [5] = { uniqueid = 23106, cPosition = Position(33599, 32533, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.barrelWord, + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.BarrelWord, value = 1, defaultItem = false, text = "The inside of this barrel's lid has a word written onto it: 'O'kteth'.", @@ -42,7 +42,7 @@ local containers = { [6] = { uniqueid = 23107, cPosition = Position(33618, 32518, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.estatueWord, + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.EstatueWord, value = 1, defaultItem = false, text = "This statue has a word written on her hand: 'N'ogalu'.", @@ -50,7 +50,7 @@ local containers = { [7] = { uniqueid = 23108, cPosition = Position(33638, 32507, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.bedWord, + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.BedWord, value = 1, defaultItem = false, text = "This end of the bed has a stack of notes hidden under it. There is only one word on all of them: 'T'sough'.", @@ -58,7 +58,7 @@ local containers = { [8] = { uniqueid = 23109, cPosition = Position(33703, 32185, 5), - storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Rosebush, + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.RoseBush, value = 1, reward = 29993, defaultItem = true, @@ -66,7 +66,7 @@ local containers = { [9] = { uniqueid = 23110, cPosition = Position(33663, 32192, 7), - storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Mushroom, + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MushRoom, value = 1, reward = 30009, defaultItem = true, @@ -106,7 +106,7 @@ local containers = { [14] = { uniqueid = 23115, cPosition = Position(32054, 31936, 13), - storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.trollSkull, + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.TrollSkull, value = 1, reward = 29990, defaultItem = true, @@ -126,11 +126,11 @@ function actions_containerRewards.onUse(player, item, fromPosition, target, toPo player:addItem(k.reward, 1) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, k.text) - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount) < 0 then - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, 0) + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount) < 0 then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount, 0) end - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount) + 1) - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount) == 4 then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount) + 1) + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount) == 4 then player:addAchievement("Tied the Knot") end end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua index 07d2bda4b79..7d0bbb7a85a 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua @@ -1,5 +1,5 @@ local Count = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count -local Storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.doorInvisible +local Storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.DoorInvisible local lanternId = 23738 local actions_doorInvisible = Action() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua index c61df597305..26309a69749 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua @@ -3,49 +3,49 @@ local config = { on = 29337, off = 29336, hisPosition = Position(32251, 31386, 5), - hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.okolnirStone, + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.OkolnirStone, hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.", }, [2] = { on = 29337, off = 29336, hisPosition = Position(31939, 31653, 10), - hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.foldaStone, + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.FoldaStone, hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.", }, [3] = { on = 29337, off = 29336, hisPosition = Position(32058, 32792, 13), - hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.calassaStone, + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.CalassaStone, hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.", }, [4] = { on = 29335, off = 29334, hisPosition = Position(33555, 32220, 7), - hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.feyristStone, + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.FeyristStone, hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.", }, [5] = { on = 29335, off = 29334, hisPosition = Position(32383, 32610, 7), - hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.merianaStone, + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.MerianaStone, hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.", }, [6] = { on = 29335, off = 29334, hisPosition = Position(33273, 31997, 7), - hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.cormayaStone, + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.CormayaStone, hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.", }, [7] = { on = 29335, off = 29334, hisPosition = Position(33576, 32537, 15), - hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.catedralStone, + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.CatedralStone, hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.", lastStone = true, }, diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua index 80eb86cba18..69a9f78965c 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua @@ -16,7 +16,7 @@ local function resetArea() local player = Player(p:getId()) if player then playerCount = playerCount + 1 - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse) >= 1 then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse) >= 1 then infectedCount = infectedCount + 1 end end @@ -45,7 +45,7 @@ function actions_dreamcatcher_curse.onUse(player, item, fromPosition, target, to end addEvent(placeMask, 10 * 1000, item:getPosition(), 29274, 29275) elseif item.itemid == 29276 then - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse) < 1 then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse) < 1 then if (target ~= player) and target:isPlayer() then if target:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) >= 1 then target:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, 0) @@ -58,7 +58,7 @@ function actions_dreamcatcher_curse.onUse(player, item, fromPosition, target, to item:remove(1) local j = resetArea() if j then - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse, 0) end else return true diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua index e1c29e81166..531bee268a9 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua @@ -19,13 +19,13 @@ local leverInfo = { pushPosition = Position(32208, 32021, 13), leverFromPos = Position(32208, 32021, 13), leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.AlptramunTimer, roomFromPosition = Position(32198, 32037, 14), roomToPosition = Position(32234, 32054, 14), teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunTimer, }, [2] = { byDay = "Tuesday", @@ -35,13 +35,13 @@ local leverInfo = { pushPosition = Position(32208, 32021, 13), leverFromPos = Position(32208, 32021, 13), leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.IzcandarTimer, roomFromPosition = Position(32198, 32037, 14), roomToPosition = Position(32234, 32054, 14), teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, }, [3] = { byDay = "Wednesday", @@ -51,13 +51,13 @@ local leverInfo = { pushPosition = Position(32208, 32021, 13), leverFromPos = Position(32208, 32021, 13), leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.MalofurTimer, roomFromPosition = Position(32198, 32037, 14), roomToPosition = Position(32234, 32054, 14), teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MalofurTimer, }, [4] = { byDay = "Thursday", @@ -67,13 +67,13 @@ local leverInfo = { pushPosition = Position(32208, 32021, 13), leverFromPos = Position(32208, 32021, 13), leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.MaxxeniusTimer, roomFromPosition = Position(32198, 32037, 14), roomToPosition = Position(32234, 32054, 14), teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer, }, [5] = { byDay = "Friday", @@ -83,13 +83,13 @@ local leverInfo = { pushPosition = Position(32208, 32021, 13), leverFromPos = Position(32208, 32021, 13), leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.IzcandarTimer, roomFromPosition = Position(32198, 32037, 14), roomToPosition = Position(32234, 32054, 14), teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, }, [6] = { byDay = "Saturday", @@ -99,13 +99,13 @@ local leverInfo = { pushPosition = Position(32208, 32021, 13), leverFromPos = Position(32208, 32021, 13), leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.PlagueRootTimer, roomFromPosition = Position(32198, 32037, 14), roomToPosition = Position(32234, 32054, 14), teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.PlagueRootTimer, }, [7] = { byDay = "Sunday", @@ -115,13 +115,13 @@ local leverInfo = { pushPosition = Position(32208, 32021, 13), leverFromPos = Position(32208, 32021, 13), leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.MaxxeniusTimer, roomFromPosition = Position(32198, 32037, 14), roomToPosition = Position(32234, 32054, 14), teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer, }, } @@ -212,8 +212,8 @@ local heatOfSummer = { local lastBoss = { bossName = "The Nightmare Beast", bossPosition = Position(32209, 32044, 15), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.nightmareTimer, - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.nightmareTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.NightmareTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.NightmareTimer, fromPositionTeleport = Position(32210, 32070, 15), toPositionTeleport = Position(32214, 32071, 15), fromPositionPush = Position(32211, 32070, 15), @@ -269,7 +269,7 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos monster:registerEvent("dreamCourtsDeath") end - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse, 0) addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, lastBoss.roomFromPosition, lastBoss.roomToPosition, lastBoss.exitPosition) else @@ -278,7 +278,7 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos end else for i = 1, #leverInfo do - if iPos == leverInfo[i].leverPosition and os.sdate("%A") == leverInfo[i].byDay then + if iPos == leverInfo[i].leverPosition and os.date("%A") == leverInfo[i].byDay then local leverTable = leverInfo[i] if pPos == leverTable.pushPosition then if player:doCheckBossRoom(leverTable.bossName, leverTable.roomFromPosition, leverTable.roomToPosition) then @@ -327,7 +327,7 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos summon:registerEvent("dreamCourtsDeath") end - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, 0) monster:registerEvent("facelessHealth") elseif leverTable.bossName:lower() == "izcandar the banished" then @@ -336,7 +336,7 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos spawnSummons(1, "the heat of summer", false, 15, heatOfSummer, leverTable.bossPosition) spawnSummons(1, "the cold of winter", false, 15, coldOfWinter, leverTable.bossPosition) - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarOutfit, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarOutfit, 0) elseif leverTable.bossName:lower() == "plagueroot" then spawnSummons(1, "plant attendant", false, 15, plantAttendants, leverTable.bossPosition) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua index 08b2839162f..01b254c00f7 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua @@ -11,13 +11,13 @@ local leverInfo = { pushPosition = Position(33638, 32562, 13), leverFromPos = Position(33638, 32562, 13), leverToPos = Position(33642, 32562, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FacelessTimer, roomFromPosition = Position(33606, 32552, 13), roomToPosition = Position(33631, 32572, 13), teleportTo = Position(33617, 32567, 13), typePush = "x", exitPosition = Position(33619, 32522, 15), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedralGlobal.FacelessTimer, }, } @@ -38,7 +38,7 @@ function actions_facelessLever.onUse(player, item, fromPosition, target, toPosit local leverTable = leverInfo[i] if pPos == leverTable.pushPosition then - if doCheckBossRoom(player:getId(), leverTable.bossName, leverTable.roomFromPosition, leverTable.roomToPosition) then + if player:doCheckBossRoom(leverTable.bossName, leverTable.roomFromPosition, leverTable.roomToPosition) then if leverTable.typePush == "x" then for i = leverTable.leverFromPos.x, leverTable.leverToPos.x do local newPos = Position(i, leverTable.leverFromPos.y, leverTable.leverFromPos.z) @@ -47,7 +47,7 @@ function actions_facelessLever.onUse(player, item, fromPosition, target, toPosit if creature and creature:isPlayer() then creature:teleportTo(leverTable.teleportTo) creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - creature:setStorageValue(leverInfo.storageTimer, os.time() + 20 * 60 * 60) + creature:setStorageValue(leverTable.storageTimer, os.time() + 20 * 60 * 60) table.insert(playersTable, creature:getId()) end end @@ -59,7 +59,7 @@ function actions_facelessLever.onUse(player, item, fromPosition, target, toPosit if creature and creature:isPlayer() then creature:teleportTo(leverTable.teleportTo) creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - creature:setStorageValue(leverInfo.storageTimer, os.time() + 20 * 60 * 60) + creature:setStorageValue(leverTable.storageTimer, os.time() + 20 * 60 * 60) table.insert(playersTable, creature:getId()) end end @@ -70,7 +70,7 @@ function actions_facelessLever.onUse(player, item, fromPosition, target, toPosit if monster then if leverTable.bossName:lower() == "faceless bane" then monster:registerEvent("facelessThink") - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTiles, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedralGlobal.FacelessTiles, 0) end monster:registerEvent("dreamCourtsDeath") diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua index bde57709505..91757dbe7fb 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua @@ -50,7 +50,7 @@ local function tryCrystal(player, itemid, position, actionid, message, rewardid) end end -local storage = Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.gotAxe +local storage = Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.GotAxe local actions_goldenAxe = Action() @@ -66,19 +66,19 @@ function actions_goldenAxe.onUse(player, item, fromPosition, target, toPosition, if target.itemid == 8865 then for _, k in pairs(firstFloor) do if tPos == k.hisPosition then - tryCrystal(player:getId(), tId, tPos, 23121, "You got a blue crystal!", 33780) + tryCrystal(player:getId(), tId, tPos, 23121, "You got a blue crystal!", 29287) end end - elseif target.itemid == 16168 then + elseif target.itemid == 14940 then for _, k in pairs(secondFloor) do if tPos == k.hisPosition then - tryCrystal(player:getId(), tId, tPos, 23122, "You got a green crystal!", 33781) + tryCrystal(player:getId(), tId, tPos, 23122, "You got a green crystal!", 29288) end end elseif target.itemid == 14974 then for _, k in pairs(thirdFloor) do if tPos == k.hisPosition then - tryCrystal(player:getId(), tId, tPos, 23123, "You got a purple crystal!", 33782) + tryCrystal(player:getId(), tId, tPos, 23123, "You got a purple crystal!", 29289) end end end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua index e0a867468f3..cf59b96e9ea 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua @@ -6,6 +6,17 @@ local altars = { } local blockedItem = 29300 +local storageIdolCount = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.IdolCount +local finalStorage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple +local totalAltars = 4 +local resetTime = 1 * 60 * 1000 + +local function removeIdol(position) + local idol = Tile(position):getItemById(blockedItem) + if idol then + idol:remove() + end +end local actions_goldenIdol = Action() @@ -24,6 +35,21 @@ function actions_goldenIdol.onUse(player, item, fromPosition, target, toPosition Game.createItem(blockedItem, 1, altar.position) tPos:sendMagicEffect(CONST_ME_POFF) player:say("**placing idol**", TALKTYPE_MONSTER_SAY) + + local currentCount = player:getStorageValue(storageIdolCount) + + if currentCount < 0 then currentCount = 0 end + player:setStorageValue(storageIdolCount, currentCount + 1) + + if currentCount + 1 == totalAltars then + player:setStorageValue(finalStorage, 1) + if p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb) == 1 and p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar) == 1 and p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple) == 1 then + p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 2) + end + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have placed all the idols on the altars and unlocked the temple!") + end + + addEvent(removeIdol, resetTime, altar.position) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There is already an idol here. Try another altar.") end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua deleted file mode 100644 index 29ea48d18b1..00000000000 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua +++ /dev/null @@ -1,57 +0,0 @@ -local altars = { - [1] = { position = Position(32591, 32629, 9) }, - [2] = { position = Position(32591, 32621, 9) }, - [3] = { position = Position(32602, 32629, 9) }, - [4] = { position = Position(32602, 32621, 9) }, -} - -local blockedItem = 29300 - -local function cleanIdols() - for _, altar in pairs(altars) do - local checkTile = Tile(altar.position):getItemById(blockedItem) - - if checkTile then - checkTile:remove(1) - end - end -end - -local actions_idolCheck = Action() - -function actions_idolCheck.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if not player then - return true - end - - local count = 0 - - for _, altar in pairs(altars) do - local checkTile = Tile(altar.position):getItemById(blockedItem) - - if checkTile then - count = count + 1 - end - end - - if count == 4 then - addEvent(cleanIdols, 1 * 60 * 1000) - - local spectators = Game.getSpectators(item:getPosition(), false, true, 12, 12, 12, 12) - - for _, spectator in pairs(spectators) do - local p = Player(spectator:getId()) - p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple, 1) - if p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb) == 1 and p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar) == 1 and p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple) == 1 then - p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 2) - end - end - - player:say("REPLACING THE IDOLS FEEDS THE PORTAL BUT DOES NOT FREE ONE FROM THE SACRILEGE OF TAKING THEM AWAY FROM TUKH!", TALKTYPE_MONSTER_SAY) - end - - return true -end - -actions_idolCheck:aid(23107) -actions_idolCheck:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua index 860d7bc8b7a..6fbbd95636e 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua @@ -32,7 +32,7 @@ local doors = { [7] = { doorPosition = Position(32606, 32629, 9), storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple, - value = -1, + value = 1, help = "Tomb", }, [8] = { @@ -42,22 +42,22 @@ local doors = { }, [9] = { doorPosition = Position(33625, 32525, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount, value = 3, }, [10] = { doorPosition = Position(33640, 32551, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount, value = 3, }, [11] = { doorPosition = Position(33657, 32551, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount, value = 3, }, [12] = { doorPosition = Position(31983, 31960, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.doorMedusa, + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.DoorMedusa, value = 1, help = "Medusa", }, @@ -68,7 +68,7 @@ local doors = { }, [14] = { doorPosition = Position(32074, 31974, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.sequenceSkulls, + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.SequenceSkulls, value = 3, }, [15] = { @@ -85,65 +85,61 @@ local doors = { }, } -local actions_questDoors = Action() - -function actions_questDoors.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local door = Door(item.itemid) - local usedDoor = item.itemid + 1 - +local function closeDoor(position, closedId) + local door = Tile(position):getItemById(closedId + 1) if door then - usedDoor = door:use() + door:transform(closedId) end +end +local actions_questDoors = Action() + +function actions_questDoors.onUse(player, item, fromPosition, target, toPosition, isHotkey) local iPos = item:getPosition() for _, p in pairs(doors) do - if (iPos == p.doorPosition) and not (player:getPosition() == p.doorPosition) then + if iPos == p.doorPosition and not (player:getPosition() == p.doorPosition) then if p.help == "Tomb" then if player:getStorageValue(p.storage) < p.value then player:teleportTo(toPosition, true) - item:transform(usedDoor) + item:transform(item.itemid + 1) + addEvent(closeDoor, 2000, iPos, item.itemid) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.") end elseif p.help == "Medusa" then if player:getStorageValue(p.storage) < 1 then player:setStorageValue(p.storage, 1) - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count) + 1) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "As Medusas's Ointment takes effect the door is unpetrified again. You can use it now.") - end - - if iPos.y < player:getPosition().y then - player:teleportTo(Position(iPos.x, iPos.y - 3, iPos.z)) - else - player:teleportTo(Position(iPos.x, iPos.y + 3, iPos.z)) + local count = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count, (count < 0 and 1 or count + 1)) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "As Medusa's Ointment takes effect, the door is unpetrified. You can use it now.") end + local newPos = (iPos.y < player:getPosition().y) and Position(iPos.x, iPos.y - 3, iPos.z) or Position(iPos.x, iPos.y + 3, iPos.z) + player:teleportTo(newPos) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + item:transform(item.itemid + 1) + addEvent(closeDoor, 2000, iPos, item.itemid) elseif p.help == "Lock" then if player:getStorageValue(p.storage) >= p.value then - if iPos.y < player:getPosition().y then - player:teleportTo(Position(iPos.x, iPos.y - 1, iPos.z)) - else - player:teleportTo(Position(iPos.x, iPos.y + 1, iPos.z)) - end + local newPos = (iPos.y < player:getPosition().y) and Position(iPos.x, iPos.y - 1, iPos.z) or Position(iPos.x, iPos.y + 1, iPos.z) + player:teleportTo(newPos) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + item:transform(item.itemid + 1) + addEvent(closeDoor, 2000, iPos, item.itemid) else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The lock in this door is missing. Mysteriously, the door is locked nonetheless. Perhaps you can find a matching lock somewhere?") + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The lock in this door is missing. Perhaps you can find a matching lock somewhere?") return true end elseif p.help == "Open/Close" then if player:getStorageValue(p.storage) >= p.value then - if item.itemid == 30033 then - item:transform(30035) - elseif item.itemid == 30035 then - item:transform(30033) - end + item:transform((item.itemid == 30033) and 30035 or 30033) end else if player:getStorageValue(p.storage) >= p.value then player:teleportTo(toPosition, true) - item:transform(usedDoor) + item:transform(item.itemid + 1) + addEvent(closeDoor, 2000, iPos, item.itemid) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.") end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua index d8d5f97d71f..6a11f8d3596 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua @@ -1,4 +1,4 @@ -local sequenceBooks = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.sequenceBooks +local sequenceBooks = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.SequenceBooks local questline = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline local sequence = { diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua index 40b1cdd56db..fde13982e2e 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua @@ -1,4 +1,4 @@ -local sequenceSkulls = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.sequenceSkulls +local sequenceSkulls = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.SequenceSkulls local Count = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count local bookId = 29991 diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua index 8fd2c7b278e..f529108e076 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua @@ -65,10 +65,10 @@ function creaturescripts_Izcandar.onThink(creature, interval) if position:isInRange(sides[1].fromPosition, sides[1].toPosition) and not (cName == "izcandar champion of winter") then transformIzcandar(creature:getId(), "izcandar champion of winter", health, position) - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarOutfit, 1) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.izcandarOutfit, 1) elseif position:isInRange(sides[2].fromPosition, sides[2].toPosition) and not (cName == "izcandar champion of summer") then transformIzcandar(creature:getId(), "izcandar champion of summer", health, position) - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarOutfit, 2) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.izcandarOutfit, 2) end return true diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua index 804b1faa69c..0ed9afb6060 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua @@ -2,63 +2,63 @@ local questlog = { [1] = { bossName = "Faceless Bane", storageQuestline = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTime, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedralGlobal.FacelessTime, middlePosition = Position(33617, 32563, 13), maxValue = 4, }, [2] = { bossName = "Maxxenius", - storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, [3] = { bossName = "Alptramun", - storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer, + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, [4] = { bossName = "Izcandar the Banished", - storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, [5] = { bossName = "Izcandar Champion of Winter", - storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, [6] = { bossName = "Izcandar Champion of Summer", - storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, [7] = { bossName = "Plagueroot", - storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer, + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.PlaguerootTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, [8] = { bossName = "Malofur Mangrinder", - storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer, + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MalofurTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, [9] = { bossName = "The Nightmare Beast", storageQuestline = Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.nightmareTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.NightmareTimer, middlePosition = Position(32207, 32045, 15), maxValue = 2, }, @@ -115,17 +115,17 @@ function creaturescripts_dreamCourtsDeath.onDeath(creature, corpse, killer, most end if cName:lower() == "alptramun" then - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, 0) end end end - local summonsKilled = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled) + local summonsKilled = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled) for _, k in pairs(alptramunSummons) do if cName:lower() == k.name then if summonsKilled >= k.minValue and summonsKilled <= k.maxValue then - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled, summonsKilled + 1) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, summonsKilled + 1) end end end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua index e8ab7f48368..268166d61e0 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua @@ -1,5 +1,5 @@ local summons = { "Burster Spectre", "Gazer Spectre", "Ripper Spectre" } -local storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessLifes +local storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FacelessLifes local creaturescripts_facelessBane = CreatureEvent("facelessThink") @@ -24,7 +24,7 @@ function creaturescripts_facelessBane.onThink(creature, interval) end creature:setStorageValue(storage, lifes + 1) - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTiles, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FacelessLifes, 0) end end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua index 10147f43a49..9325e2a48e4 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua @@ -13,12 +13,12 @@ local function resetArea() for _, p in pairs(spectators) do local player = Player(p:getId()) if player then - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse, 0) end end end -local creaturescripts_nightmareCurse = CreatureEvent(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) +local creaturescripts_nightmareCurse = CreatureEvent("nightmareCurse") function creaturescripts_nightmareCurse.onThink(creature, interval) if not creature:isPlayer() then @@ -46,10 +46,10 @@ function creaturescripts_nightmareCurse.onThink(creature, interval) if p and p:getCondition(CONDITION_OUTFIT, phantasm) then resetArea() - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse, 0) p:teleportTo(Position(32213, 32083, 15)) p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, -1) - p:unregisterEvent(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) + p:unregisterEvent("nightmareCurse") end end, phantasmTime, player:getId()) elseif (stage == 1 or stage == 2) and (player:getCondition(CONDITION_OUTFIT, spectre) or player:getCondition(CONDITION_OUTFIT, phantasm)) then diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua index 29e9ef1f9f4..d3d524f4b79 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua @@ -26,37 +26,37 @@ local dreamScar = { [1] = { day = "Monday", bossName = "Alptramun", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunTimer, }, [2] = { day = "Tuesday", bossName = "Izcandar the Banished", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, }, [3] = { day = "Wednesday", bossName = "Malofur Mangrinder", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MalofurTimer, }, [4] = { day = "Thursday", bossName = "Maxxenius", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer, }, [5] = { day = "Friday", bossName = "Izcandar the Banished", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, }, [6] = { day = "Saturday", bossName = "Plagueroot", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.PlaguerootTimer, }, [7] = { day = "Sunday", bossName = "Maxxenius", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer, }, } @@ -76,8 +76,8 @@ function movements_acessTeleports.onStepIn(creature, item, position, fromPositio local nightmareTeleport = Position(32211, 32081, 15) if item:getPosition() == nightmareTeleport then - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount) >= 5 then - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.nightmareTimer) > os.time() then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount) >= 5 then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.NightmareTimer) > os.time() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to wait to challenge The Nightmare Beast again!") player:teleportTo(fromPosition) else @@ -106,7 +106,7 @@ function movements_acessTeleports.onStepIn(creature, item, position, fromPositio if iPos == dreamScarTeleport then if player:getStorageValue(permission) >= 1 then for i = 1, #dreamScar do - if os.sdate("%A") == dreamScar[i].day then + if os.date("%A") == dreamScar[i].day then if player:getStorageValue(dreamScar[i].storageTimer) > os.time() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to wait to challenge " .. dreamScar[i].bossName .. " again!") player:teleportTo(fromPosition) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua index 45ed31a7ea0..d5f61ae2bd1 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua @@ -1,4 +1,4 @@ -local storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTiles +local storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedralGlobal.FacelessTiles local function setActionId(itemid, position, aid) local item = Tile(position):getItemById(itemid) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua index 241dd183a3e..00562a98375 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua @@ -1,4 +1,3 @@ -local storage = Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline local spiderName = "Lucifuga Aranea" local function setActionId(itemid, position, aid) @@ -18,7 +17,7 @@ function movements_spiderSummon.onStepIn(creature, item, position, fromPosition) return true end - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.hasBait) == 1 then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait) == 1 then local r = math.random(1, 10) Game.createMonster(spiderName, position) item:setActionId(0) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua index ab27dabde4e..2b5f1c91023 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua @@ -20,7 +20,7 @@ function spell.onCastSpell(creature, var) local monsterName = "" local randomName = math.random(1, #config) local randomSummon = math.random(1, 4) - local summonsKilled = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled) or -1 + local summonsKilled = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled) or -1 if summonsKilled >= 0 and summonsKilled <= 9 then monsterName = config[1].name diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua index 0c486038a71..2a405c74748 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua @@ -1,7 +1,7 @@ local spell = Spell("instant") function spell.onCastSpell(creature, var) - local hasCasted = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse) + local hasCasted = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse) if hasCasted == 0 then local players = Game.getSpectators(cid:getPosition(), false, true, 14, 14, 14, 14) @@ -10,7 +10,7 @@ function spell.onCastSpell(creature, var) for _, k in pairs(players) do local player = Player(k) if player then - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, -1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse, -1) end end @@ -18,10 +18,10 @@ function spell.onCastSpell(creature, var) newPlayer:registerEvent("nightmareCurse") newPlayer:setStorageValue("nightmareCurse", 1) - newPlayer:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 1) + newPlayer:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse, 1) newPlayer:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The beast laid a terrible curse on you!") - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 1) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse, 1) end end diff --git a/data-otservbr-global/startup/tables/item.lua b/data-otservbr-global/startup/tables/item.lua index f8188ad3847..2b33c30d21f 100644 --- a/data-otservbr-global/startup/tables/item.lua +++ b/data-otservbr-global/startup/tables/item.lua @@ -1252,11 +1252,30 @@ ItemAction = { { x = 33618, y = 32546, z = 13 }, }, }, + [23104] = { + itemId = 29349, + itemPos = { + {x = 33054, y = 32335, z = 8}, + {x = 33081, y = 32355, z = 8}, + {x = 33091, y = 32319, z = 8}, + {x = 33091, y = 32301, z = 8}, + {x = 33092, y = 32347, z = 8}, + {x = 33051, y = 32309, z = 8}, + {x = 33081, y = 32349, z = 8}, + {x = 33083, y = 32338, z = 8}, + {x = 33058, y = 32323, z = 8}, + {x = 33103, y = 32344, z = 8}, + {x = 33093, y = 32338, z = 8}, + {x = 33093, y = 32356, z = 8}, + {x = 33055, y = 32297, z = 8}, + }, + }, [23105] = { itemId = false, itemPos = { { x = 33070, y = 32317, z = 8 }, { x = 33069, y = 32317, z = 8 }, + { x = 33068, y = 32308, z = 8 }, }, }, [23106] = { @@ -1341,6 +1360,33 @@ ItemAction = { { x = 32757, y = 32643, z = 10 }, }, }, + [23121] = { + itemId = 8865, + itemPos = { + {x = 32745, y = 32613, z = 8}, + {x = 32811, y = 32645, z = 8}, + {x = 32749, y = 32628, z = 8}, + {x = 32781, y = 32641, z = 8}, + }, + }, + [23122] = { + itemId = 14940, + itemPos = { + {x = 32808, y = 32612, z = 9}, + {x = 32743, y = 32612, z = 9}, + {x = 32775, y = 32600, z = 9}, + {x = 32761, y = 32630, z = 9}, + }, + }, + [23123] = { + itemId = 14974, + itemPos = { + {x = 32789, y = 32613, z = 10}, + {x = 32767, y = 32638, z = 10}, + {x = 32742, y = 32636, z = 10}, + {x = 32757, y = 32606, z = 10}, + }, + }, -- Ferumbras' Ascension Quest [24837] = { itemId = 1949, diff --git a/data-otservbr-global/startup/tables/lever.lua b/data-otservbr-global/startup/tables/lever.lua index 4e47b4f9b4c..ed48199805d 100644 --- a/data-otservbr-global/startup/tables/lever.lua +++ b/data-otservbr-global/startup/tables/lever.lua @@ -143,7 +143,7 @@ LeverAction = { }, -- The Dream Courts Quest [23110] = { - itemId = 9111, + itemId = 9110, itemPos = { { x = 33637, y = 32562, z = 13 }, }, diff --git a/data-otservbr-global/startup/tables/teleport_item.lua b/data-otservbr-global/startup/tables/teleport_item.lua index c09dd9e22fa..395a3c18e80 100644 --- a/data-otservbr-global/startup/tables/teleport_item.lua +++ b/data-otservbr-global/startup/tables/teleport_item.lua @@ -161,11 +161,4 @@ TeleportItemUnique = { destination = { x = 33916, y = 31466, z = 8 }, effect = CONST_ME_TELEPORT, }, - -- Faceless Bane entrance - [15004] = { - itemId = 29954, - itemPos = { x = 33619, y = 32518, z = 15 }, - destination = { x = 33640, y = 32561, z = 13 }, - effect = CONST_ME_TELEPORT, - }, } diff --git a/data-otservbr-global/world/otservbr-npc.xml b/data-otservbr-global/world/otservbr-npc.xml index 5c53601aa9c..1e94b2e50ef 100644 --- a/data-otservbr-global/world/otservbr-npc.xml +++ b/data-otservbr-global/world/otservbr-npc.xml @@ -1353,6 +1353,9 @@ + + + diff --git a/data/items/items.xml b/data/items/items.xml index eb00ac6bdf3..f5fb8e363e8 100644 --- a/data/items/items.xml +++ b/data/items/items.xml @@ -55704,6 +55704,7 @@ hands of its owner. Granted by TibiaRoyal.com"/> +