From a9c9020daed77ad70c8cb13f0616a4ff748811d6 Mon Sep 17 00:00:00 2001 From: Guilherme Date: Thu, 25 Jul 2024 12:16:15 -0300 Subject: [PATCH 01/16] fix: revised some quests (#2675) --- data-otservbr-global/lib/core/quests.lua | 73 +- data-otservbr-global/lib/core/storages.lua | 176 +-- .../lib/quests/killing_in_the_name_of.lua | 4 +- data-otservbr-global/npc/hanna.lua | 9 +- data-otservbr-global/npc/mr_morris.lua | 9 +- data-otservbr-global/npc/norma.lua | 9 +- data-otservbr-global/npc/paulie.lua | 283 ++++- data-otservbr-global/npc/vascalir.lua | 12 +- .../actions/other/others/quest_system2.lua | 92 -- .../actions/quests/dawnport/legion_helmet.lua | 4 +- .../desert_dungeon_lever.lua} | 2 +- .../devil_helmet_lever.lua} | 2 +- .../quests/others/black_knight_quest.lua | 15 - .../quests/others/plate_armor_quest.lua | 13 - .../life_ring_lever.lua | 2 +- .../actions/quests/the_outlaw_camp/oven.lua | 2 +- .../quests/the_outlaw_camp/power_burn.lua | 2 +- .../quests/the_outlaw_camp/power_switch.lua | 2 +- .../the_outlaw_camp/the_outlaw_camp_quest.lua | 33 + .../triangle_tower_lever.lua | 2 +- .../actions/rookgaard/banana_quest.lua | 15 - .../bear_room_quest_lever.lua} | 0 .../bear_room_quest/bear_room_quest_stone.lua | 17 + .../actions/rookgaard/doublet_quest.lua | 15 - .../actions/rookgaard/goblin_temple_quest.lua | 67 ++ .../actions/rookgaard/honey_flower_quest.lua | 15 - .../katana_quest/katana_quest_door.lua | 20 + .../{ => katana_quest}/katana_quest_lever.lua | 6 +- .../actions/rookgaard/katana_quest_door.lua | 8 - .../actions/system/quest_reward_common.lua | 79 +- .../20241715984294_quests_storages_to_kv.lua | 81 ++ .../quests/bright_sword/entrance.lua | 15 - .../movements/quests/devil_helmet/sewer.lua | 4 +- .../movements/quests/inquisition/entrance.lua | 25 +- .../quests/the_outlaw_camp/entrance.lua | 25 + .../scripts/quests/draconia/action-lever.lua | 25 +- data-otservbr-global/startup/tables/chest.lua | 1021 ++++++++++++++--- .../startup/tables/corpse.lua | 4 - .../startup/tables/door_key.lua | 54 +- .../startup/tables/door_level.lua | 26 + .../startup/tables/door_quest.lua | 5 + data-otservbr-global/startup/tables/item.lua | 18 + data-otservbr-global/startup/tables/lever.lua | 54 + .../startup/tables/teleport.lua | 4 +- data-otservbr-global/startup/tables/tile.lua | 13 +- .../startup/tables/tile_pick.lua | 7 + data/libs/functions/player.lua | 2 +- data/scripts/lib/register_actions.lua | 4 +- 48 files changed, 1773 insertions(+), 602 deletions(-) rename data-otservbr-global/scripts/actions/quests/{others/desert_dungeon_lever_quest.lua => desert_dungeon_quest/desert_dungeon_lever.lua} (99%) rename data-otservbr-global/scripts/actions/quests/{devil_helmet/lever.lua => mintwallin_quest/devil_helmet_lever.lua} (94%) delete mode 100644 data-otservbr-global/scripts/actions/quests/others/black_knight_quest.lua delete mode 100644 data-otservbr-global/scripts/actions/quests/others/plate_armor_quest.lua rename data-otservbr-global/scripts/actions/quests/{others => thais_quest}/life_ring_lever.lua (97%) create mode 100644 data-otservbr-global/scripts/actions/quests/the_outlaw_camp/the_outlaw_camp_quest.lua rename data-otservbr-global/scripts/actions/quests/{others => triangle_tower_quest}/triangle_tower_lever.lua (95%) delete mode 100644 data-otservbr-global/scripts/actions/rookgaard/banana_quest.lua rename data-otservbr-global/scripts/actions/rookgaard/{bearroom_quest_lever.lua => bear_room_quest/bear_room_quest_lever.lua} (100%) create mode 100644 data-otservbr-global/scripts/actions/rookgaard/bear_room_quest/bear_room_quest_stone.lua delete mode 100644 data-otservbr-global/scripts/actions/rookgaard/doublet_quest.lua create mode 100644 data-otservbr-global/scripts/actions/rookgaard/goblin_temple_quest.lua delete mode 100644 data-otservbr-global/scripts/actions/rookgaard/honey_flower_quest.lua create mode 100644 data-otservbr-global/scripts/actions/rookgaard/katana_quest/katana_quest_door.lua rename data-otservbr-global/scripts/actions/rookgaard/{ => katana_quest}/katana_quest_lever.lua (81%) delete mode 100644 data-otservbr-global/scripts/actions/rookgaard/katana_quest_door.lua create mode 100644 data-otservbr-global/scripts/game_migrations/20241715984294_quests_storages_to_kv.lua delete mode 100644 data-otservbr-global/scripts/movements/quests/bright_sword/entrance.lua create mode 100644 data-otservbr-global/scripts/movements/quests/the_outlaw_camp/entrance.lua diff --git a/data-otservbr-global/lib/core/quests.lua b/data-otservbr-global/lib/core/quests.lua index a35dcb15dea..042897f9369 100644 --- a/data-otservbr-global/lib/core/quests.lua +++ b/data-otservbr-global/lib/core/quests.lua @@ -2157,6 +2157,7 @@ if not Quests then states = { [1] = "Collect a legion helmet, 100 chicken feathers and 50 honeycombs and bring them to either \z Hanna or Norma to have them make a feather hat addon for you.", + [2] = "You got the Citizen Hat Addon!", }, }, [4] = { @@ -5641,9 +5642,9 @@ if not Quests then startValue = 1, endValue = 3, states = { - [1] = "Mr Morris tasked you to find an ancient amulet that was lost somewhare on Dawnport - probably next to a corpse somewhare.", - [2] = "Come back to Mr Morris", - [3] = "Mr Morris thanks for the help", + [1] = "Mr Morris tasked you to find an ancient amulet that was lost somewhere on Dawnport - probably next to a corpse somewhere.", + [2] = "Come back to Mr Morris.", + [3] = "Mr Morris thanks for you the help.", }, }, [3] = { @@ -5653,8 +5654,8 @@ if not Quests then startValue = 1, endValue = 2, states = { - [1] = "Mr Morris urged you fo find a log book that was stolen by trolls.", - [2] = "Mr Morris thanks for the help", + [1] = "Mr Morris urged you to find a log book that was stolen by trolls.", + [2] = "Mr Morris thanks you for the help.", }, }, [4] = { @@ -5664,9 +5665,9 @@ if not Quests then startValue = 1, endValue = 3, states = { - [1] = "Mr Morris needs the rae Dawnfire herb harvested and brought to hin. It grows on grey sand only, he said.", - [2] = "Come back to Mr Morris", - [3] = "Mr Morris thanks for the help", + [1] = "Mr Morris needs the rare Dawnfire herb harvested and brought to him. It grows on gray sand only, he said.", + [2] = "Come back to Mr Morris.", + [3] = "Mr Morris thanks you for the help.", }, }, [5] = { @@ -5677,40 +5678,40 @@ if not Quests then endValue = 5, states = { [1] = "The key to the adventurer's dormitory has disappeared. Maybe you can find it. Ask around to find out who was the last to have seen it.", - [2] = "use the fishing rod in the nearby lake to fish old nasty", + [2] = "Use the fishing rod in the nearby lake to fish Old Nasty.", [3] = "Come back to Woblin with Old Nasty", - [4] = "Come back to Mr Morris with key 0010", + [4] = "Come back to Mr Morris with Key 0010", [5] = "Mr Morris thanks for the help", }, }, [6] = { - name = "Task: Mountain Trolls", - storageId = 65062, + name = "Task: A Toll on Trolls", + storageId = Storage.Quest.U10_55.Dawnport.MorrisTrollCount, missionId = 10394, startValue = 0, endValue = 20, description = function(player) - return string.format("You already hunted %d/20 Mountain Trolls.", (math.max(player:getStorageValue(65062), 0))) + return string.format("You already hunted %d/20 Mountain Trolls.", (math.max(player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorrisTrollCount), 0))) end, }, [7] = { - name = "Task: Muglex Clan Footman", - storageId = 65061, + name = "Task: The Goblin Slayer", + storageId = Storage.Quest.U10_55.Dawnport.MorrisGoblinCount, missionId = 10395, startValue = 0, endValue = 20, description = function(player) - return string.format("You already hunted %d/20 Muglex Clan Footman.", (math.max(player:getStorageValue(65061), 0))) + return string.format("You already hunted %d/20 Muglex Clan Footman.", (math.max(player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorrisGoblinCount), 0))) end, }, [8] = { - name = "Task: Minotaur Bruisers", - storageId = 65060, + name = "Task: Plus Minos a Few", + storageId = Storage.Quest.U10_55.Dawnport.MorrisMinosCount, missionId = 10396, startValue = 0, endValue = 20, description = function(player) - return string.format("You already hunted %d/20 Minotaurs Bruisers.", (math.max(player:getStorageValue(65060), 0))) + return string.format("You already hunted %d/20 Minotaurs Bruisers.", (math.max(player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorrisMinosCount), 0))) end, }, }, @@ -5746,16 +5747,17 @@ if not Quests then }, [3] = { name = "Mission 03: A Rational Request", - storageId = Storage.TheRookieGuard.Mission03, + storageId = Storage.TheRookieGuard.RatKills, missionId = 10399, - startValue = 1, - endValue = 2, - states = { - [1] = function(player) - return string.format("Vascalir sent you to the Rookgaard sewers to kill 5 rats. You have already killed %d/5. Return to Vascalir once you're done.", player:getStorageValue(Storage.TheRookieGuard.RatKills)) - end, - [2] = "Vascalir was pleased with your hunting efforts. You've proven that you are a skilled hunter, ready for the task at hand.", - }, + startValue = 0, + endValue = 5, + description = function(player) + return string.format( + "Vascalir sent you to the Rookgaard sewers to kill 5 rats. You have already killed %d/5. \z + Return to Vascalir once you're done.", + (math.max(player:getStorageValue(Storage.TheRookieGuard.RatKills), 0)) + ) + end, }, [4] = { name = "Mission 04: Home-Brewed", @@ -6510,5 +6512,20 @@ if not Quests then }, }, }, + [49] = { + name = "The Outlaw Camp", + startStorageId = Storage.QuestChests.OutlawCamp, + startStorageValue = 1, + missions = { + [1] = { + name = "Outlaw Treasure", + storageId = Storage.QuestChests.OutlawCamp, + missionId = 10451, + startValue = 1, + endValue = 1, + description = "You made your way through the Outlaw Camp and found the hidden treasure of the bandits.", + }, + }, + }, } end diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 2b8d9a7783d..98aa057f9ca 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -66,8 +66,6 @@ Reserved player action storage key ranges (const.h) [4502] = key 4502 [4503] = key 4503 [4600] = key 4600 - [4601] = key 4601 - [4603] = key 4603 [5000] = key 5000 [5002] = key 5002 [5010] = key 5010 @@ -81,13 +79,11 @@ Storage = { -- General storages Dragonfetish = 30003, EdronRopeQuest = 30004, - GhostShipQuest = 30005, OrcKingGreeting = 30006, MarkwinGreeting = 30007, -- EmoteSpells Storage cannot be changed, it is set in source code EmoteSpells = 30008, WagonTicket = 30009, - BloodHerbQuest = 30010, FirstMageWeapon = 30011, ToOutfoxAFoxQuest = 30012, KawillBlessing = 30014, @@ -128,7 +124,6 @@ Storage = { -- Reserved in Global.Storage.FamiliarSummonEvent60 = 30055 ChayenneKeyTime = 30056, FreeQuests = 30057, - BattleAxeQuest = 30059, ShrineEntrance = 30060, PlayerWeaponReward = 30061, --[[ @@ -1399,17 +1394,12 @@ Storage = { FormorgarMinesHoistSkeleton = 51737, FormorgarMinesHoistChest = 51738, -- Custom Quests, currently not using system.lua (aid 2000) - BlackKnightTreeCrownShield = 51739, - BlackKnightTreeCrownArmor = 51740, - BlackKnightTreeKey = 51741, KosheiAmulet1 = 51742, KosheiAmulet2 = 51743, - SilverBrooch = 51744, FamilyBrooch = 51745, DCQGhoul = 51746, FirewalkerBoots = 51747, DeeperFibulaKey = 51748, - SixRubiesQuest = 51749, ParchmentRoomQuest = 51750, WarzoneReward1 = 51751, WarzoneReward2 = 51752, @@ -1420,16 +1410,11 @@ Storage = { FathersBurdenCrystal = 51757, FathersBurdenSilk = 51758, FathersBurdenCloth = 51759, - OutlawCampKey1 = 51760, - OutlawCampKey2 = 51761, - OutlawCampKey3 = 51762, - DoubletQuest = 51763, - HoneyFlower = 51764, - BananaPalm = 51765, WhisperMoss = 51766, OldParchment = 51767, DragahsSpellbook = 51768, StealFromThieves = 51769, + OutlawCamp = 51770, -- quest log to The Outlaw Camp }, PitsOfInferno = { -- Reserved storage from 52000 - 52019 @@ -1711,9 +1696,17 @@ Storage = { ID3007 = 3007, ID3008 = 3008, ID3012 = 3012, + ID3142 = 3142, + ID3301 = 3301, + ID3302 = 3302, + ID3303 = 3303, + ID3304 = 3304, + ID3520 = 3520, ID3600 = 3600, + ID3610 = 3610, ID3620 = 3620, ID3666 = 3666, + ID3667 = 3667, ID3702 = 3702, ID3800 = 3800, ID3801 = 3801, @@ -1723,6 +1716,8 @@ Storage = { ID3980 = 3980, ID4055 = 4055, ID4502 = 4502, + ID4601 = 4601, + ID4603 = 4603, ID5010 = 5010, ID6010 = 6010, }, @@ -1730,38 +1725,9 @@ Storage = { -- Use the reserved storage keys accordingly KeysUpdate = 40000, PreU6_0 = { -- update pre-6.0 - Reserved Storages 40001 - 40020 - DeeperFibula = { - Rewards = { - TowerShield = 40001, - WarriorHelmet = 40002, - DwarvenRing = 40003, - ElvenAmulet = 40004, - KnightAxe = 40005, - }, - }, OrnamentedShield = { Rewards = { OrnamentedShield = 40006, - TimeRing = 40007, - }, - }, - ShortSword = { - Rewards = { - Book = 40008, - }, - }, - ThaisLighthouse = { - Rewards = { - BattleHammer = 40009, - DarkShield = 40010, - }, - }, - }, - U6_0 = { -- update 6.0 - Reserved Storages 40021 - 40030 - StuddedShield = { - Rewards = { - BananaFree = 40021, - BananaPremium = 40022, }, }, }, @@ -1771,52 +1737,13 @@ Storage = { Cookies = 40031, }, }, - ExplorerBrooch = { - Brooch = 40032, - }, - OrcFortress = { - Rewards = { - KnightAxe = 40033, - KnightArmor = 40034, - FireSword = 40035, - }, - }, - Panpipe = { - Rewards = { - Panpipe = 40036, - }, - }, - }, - U6_2 = { -- update 6.2 - Reserved Storages 40051 - 40070 - Draconia = { - Rewards = { - BagWithWeapons = 40051, - BagWithAmulets = 40052, - }, - }, }, U6_4 = { -- update 6.4 - Reserved Storages 40071 - 40110 - AdornedUHRune = { - Rewards = { - SilverRuneEmblem = 40071, - }, - }, - BarbarianAxe = { - Rewards = { - BarbarianAxe = 40072, - Scimitar = 40073, - }, - }, BerserkerTreasure = { Rewards = { WhitePearls = 40074, }, }, - DarkArmor = { - Rewards = { - Armor = 40075, - }, - }, DemonHelmet = { Rewards = { SteelBoots = 40076, @@ -1824,88 +1751,14 @@ Storage = { DemonShield = 40078, }, }, - DoubleHero = { - Rewards = { - RedGem = 40079, - ClubRing = 40080, - }, - }, - EdronGoblin = { - Rewards = { - SilverAmulet = 40081, - SteelShield = 40082, - }, - }, - FireAxe = { - Rewards = { - Bag = 40083, - FireAxe = 40084, - }, - }, - PoisonDaggers = { - Rewards = { - BackpackReward = 40085, - }, - }, - ShamanTreasure = { - Rewards = { - BlankRunes = 40086, - }, - }, - TrollCave = { - Rewards = { - GarlicNecklace = 40087, - BrassLegs = 40088, - }, - }, - VampireShield = { - Rewards = { - StrangeSymbol = 40089, - DragonLance = 40090, - VampireShield = 40091, - }, - }, - WeddingRing = { - Rewards = { - DragonNecklace = 40092, - WeedingRing = 40093, - }, - }, - }, - U6_5 = { -- update 6.5 - Reserved Storages 40111 - 40120 - AlawarsVault = { - Rewards = { - WhitePearl = 40111, - Broadsword = 40112, - }, - }, }, U7_1 = { -- update 7.1 - Reserved Storages 40121 - 40140 - BlackKnight = { - Rewards = { - CrownArmor = 40121, - CrownShield = 40122, - }, - }, DragonTower = { Rewards = { Backpack1 = 40123, Backpack2 = 40124, }, }, - Ring = { - Rewards = { - TimeRing = 40125, - SwordRing = 40126, - }, - }, - TimeRing = { - Rewards = { - CrystallBall = 40127, - TimeRing = 40128, - ElvenAmulet = 40129, - }, - }, }, U7_2 = { -- update 7.2 - Reserved Storages 40141 - 40200 Behemoth = { @@ -1960,9 +1813,6 @@ Storage = { MadMageRoom = { QuestLine = 10095, APrisoner = 10096, - StarAmulet = 10097, - Hat = 10098, - StoneSkinAmulet = 10099, }, SkullOfRatha = { Bag1 = 10100, @@ -2509,10 +2359,6 @@ Storage = { MorrisMinos = 20014, MorrisMinosCount = 20015, }, - SanctuaryOfTheLizardGod = { - LizardGodTeleport = 20020, - LegionHelmet = 20021, - }, }, U10_70 = { -- update 10.70 - Reserved Storages 44801 - 44950 HeroOfRathleton = {}, diff --git a/data-otservbr-global/lib/quests/killing_in_the_name_of.lua b/data-otservbr-global/lib/quests/killing_in_the_name_of.lua index 154bf6d428d..1e051f20668 100644 --- a/data-otservbr-global/lib/quests/killing_in_the_name_of.lua +++ b/data-otservbr-global/lib/quests/killing_in_the_name_of.lua @@ -28,13 +28,13 @@ tasks = { Extra = { [1] = { killsRequired = 20, - raceName = "Mountain Trolls", + raceName = "Mountain Troll", level = { 1, 9999 }, storage = { 12701, 1 }, norepeatable = true, premium = false, creatures = { - "mountain trolls", + "mountain troll", }, rewards = { { type = "storage", value = { 17524, 1 } }, diff --git a/data-otservbr-global/npc/hanna.lua b/data-otservbr-global/npc/hanna.lua index dfea1547135..025ac04c22c 100644 --- a/data-otservbr-global/npc/hanna.lua +++ b/data-otservbr-global/npc/hanna.lua @@ -65,7 +65,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "addon") or MsgContains(message, "outfit") or MsgContains(message, "hat") then - local addonProgress = player:getStorageValue(Storage.OutfitQuest.Citizen.AddonHat) + local addonProgress = player:getStorageValue(Storage.OutfitQuest.Citizen.MissionHat) if addonProgress < 1 then npcHandler:say("Pretty, isn't it? My friend Amber taught me how to make it, but I could help you with one if you like. What do you say?", npc, creature) npcHandler:setTopic(playerId, 1) @@ -80,8 +80,7 @@ local function creatureSayCallback(npc, creature, type, message) if npcHandler:getTopic(playerId) == 1 then if MsgContains(message, "yes") then - player:setStorageValue(Storage.OutfitQuest.Ref, math.max(0, player:getStorageValue(Storage.OutfitQuest.Ref)) + 1) - player:setStorageValue(Storage.OutfitQuest.Citizen.AddonHat, 1) + player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) player:setStorageValue(Storage.OutfitQuest.Citizen.MissionHat, 1) npcHandler:say("Okay, here we go, listen closely! I need a few things... a basic hat of course, maybe a legion helmet would do. Then about 100 chicken feathers... and 50 honeycombs as glue. That's it, come back to me once you gathered it!", npc, creature) else @@ -107,9 +106,7 @@ local function creatureSayCallback(npc, creature, type, message) player:addOutfitAddon(136, 2) player:addOutfitAddon(128, 2) - player:setStorageValue(Storage.OutfitQuest.Ref, math.min(0, player:getStorageValue(Storage.OutfitQuest.Ref) - 1)) - player:setStorageValue(Storage.OutfitQuest.Citizen.MissionHat, 0) - player:setStorageValue(Storage.OutfitQuest.Citizen.AddonHat, 2) + player:setStorageValue(Storage.OutfitQuest.Citizen.MissionHat, 2) end else npcHandler:say("Maybe another time.", npc, creature) diff --git a/data-otservbr-global/npc/mr_morris.lua b/data-otservbr-global/npc/mr_morris.lua index 5cb155a88c9..dfcbadd400b 100644 --- a/data-otservbr-global/npc/mr_morris.lua +++ b/data-otservbr-global/npc/mr_morris.lua @@ -118,9 +118,8 @@ local function creatureSayCallback(npc, creature, type, message) elseif MsgContains(message, "herbs") then if player:getStorageValue(Storage.Quest.U10_55.Dawnport.TheRareHerb) < 1 then npcHandler:say( - "One of our ...less fortunate members lost an ancient amulet somewhere on the island, \z - along with his life. If you could retrieve the amulet at least, there's a little reward. \z - Would you go on that errand?", + "Some of those salamanders have crawled into Oressa's herb garden and munched all her Dawnfire herbs. \z + Would you get some fresh herbs?", npc, creature ) @@ -139,7 +138,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif MsgContains(message, "key") then if player:getStorageValue(Storage.Quest.U10_55.Dawnport.TheDormKey) < 1 then npcHandler:say( - "his is an undercover thing - the key to the dormitory has disappeared. \z + "This is an undercover thing - the key to the dormitory has disappeared. \z No one wants to own up who has lost it, at least not to me. Maybe they'll talk to you. \z I'll reward you if you find it. You in?", npc, @@ -147,7 +146,7 @@ local function creatureSayCallback(npc, creature, type, message) ) npcHandler:setTopic(playerId, 4) elseif player:getStorageValue(Storage.Quest.U10_55.Dawnport.TheDormKey) == 4 then - npcHandler:say("Ah, you're here to report about the key - any progress?", npc, creature) + npcHandler:say("Ah, you're here to report about the {key} - any progress?", npc, creature) npcHandler:setTopic(playerId, 5) end elseif MsgContains(message, "yes") then diff --git a/data-otservbr-global/npc/norma.lua b/data-otservbr-global/npc/norma.lua index 9842a07ebee..dc6b1178281 100644 --- a/data-otservbr-global/npc/norma.lua +++ b/data-otservbr-global/npc/norma.lua @@ -78,7 +78,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "addon") or MsgContains(message, "outfit") or MsgContains(message, "hat") then - local addonProgress = player:getStorageValue(Storage.OutfitQuest.Citizen.AddonHat) + local addonProgress = player:getStorageValue(Storage.OutfitQuest.Citizen.MissionHat) if addonProgress < 1 then npcHandler:say("Pretty, isn't it? My friend Amber taught me how to make it, but I could help you with one if you like. What do you say?", npc, creature) npcHandler:setTopic(playerId, 1) @@ -93,8 +93,7 @@ local function creatureSayCallback(npc, creature, type, message) if npcHandler:getTopic(playerId) == 1 then if MsgContains(message, "yes") then - player:setStorageValue(Storage.OutfitQuest.Ref, math.max(0, player:getStorageValue(Storage.OutfitQuest.Ref)) + 1) - player:setStorageValue(Storage.OutfitQuest.Citizen.AddonHat, 1) + player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) player:setStorageValue(Storage.OutfitQuest.Citizen.MissionHat, 1) npcHandler:say("Okay, here we go, listen closely! I need a few things... a basic hat of course, maybe a legion helmet would do. Then about 100 chicken feathers... and 50 honeycombs as glue. That's it, come back to me once you gathered it!", npc, creature) else @@ -120,9 +119,7 @@ local function creatureSayCallback(npc, creature, type, message) player:addOutfitAddon(136, 2) player:addOutfitAddon(128, 2) - player:setStorageValue(Storage.OutfitQuest.Ref, math.min(0, player:getStorageValue(Storage.OutfitQuest.Ref) - 1)) - player:setStorageValue(Storage.OutfitQuest.Citizen.MissionHat, 0) - player:setStorageValue(Storage.OutfitQuest.Citizen.AddonHat, 2) + player:setStorageValue(Storage.OutfitQuest.Citizen.MissionHat, 2) end else npcHandler:say("Maybe another time.", npc, creature) diff --git a/data-otservbr-global/npc/paulie.lua b/data-otservbr-global/npc/paulie.lua index 38c91e2b902..3b099caaa88 100644 --- a/data-otservbr-global/npc/paulie.lua +++ b/data-otservbr-global/npc/paulie.lua @@ -56,6 +56,20 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local count = {} + +local function greetCallback(npc, creature) + local playerId = creature:getId() + local player = Player(creature) + -- Mission 8: The Rookie Guard Quest + if player:getStorageValue(Storage.TheRookieGuard.Mission08) == 1 then + npcHandler:setMessage(MESSAGE_GREET, "Welcome |PLAYERNAME|! Special newcomer offer, today only! Deposit some money - or {deposit ALL} of your money! - and get 50 gold for free!") + else + npcHandler:setMessage(MESSAGE_GREET, "Yes? What may I do for you, |PLAYERNAME|? Bank business, perhaps?") + end + return true +end + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -64,19 +78,272 @@ local function creatureSayCallback(npc, creature, type, message) return false end - -- Parse bank - npc:parseBank(message, npc, creature, npcHandler) - -- Parse guild bank - npc:parseGuildBank(message, npc, creature, playerId, npcHandler) - -- Normal messages - npc:parseBankMessages(message, npc, creature, npcHandler) + --Help + if MsgContains(message, "bank account") then + npcHandler:say({ + "Every Adventurer has one. \z + The big advantage is that you can access your money in every branch of the World Bank! ...", + "Would you like to know more about the {basic} functions of your bank account, the {advanced} functions, \z + or are you already bored, perhaps?", + }, npc, creature, 10) + npcHandler:setTopic(playerId, 0) + return true + --Balance + elseif MsgContains(message, "balance") then + npcHandler:setTopic(playerId, 0) + if player:getBankBalance() >= 100000000 then + npcHandler:say("I think you must be one of the richest inhabitants in the world! \z + Your account balance is " .. player:getBankBalance() .. " gold.", npc, creature) + return true + elseif player:getBankBalance() >= 10000000 then + npcHandler:say("You have made ten millions and it still grows! Your account balance is \z + " .. player:getBankBalance() .. " gold.", npc, creature) + return true + elseif player:getBankBalance() >= 1000000 then + npcHandler:say("Wow, you have reached the magic number of a million gp!!! \z + Your account balance is " .. player:getBankBalance() .. " gold!", npc, creature) + return true + elseif player:getBankBalance() >= 100000 then + npcHandler:say("You certainly have made a pretty penny. Your account balance is \z + " .. player:getBankBalance() .. " gold.", npc, creature) + return true + else + npcHandler:say("Your account balance is " .. player:getBankBalance() .. " gold.", npc, creature) + return true + end + --Deposit + elseif MsgContains(message, "deposit") then + count[playerId] = player:getMoney() + if count[playerId] < 1 then + npcHandler:say("You do not have enough gold.", npc, creature) + npcHandler:setTopic(playerId, 0) + return false + elseif not isValidMoney(count[playerId]) then + npcHandler:say("Sorry, but you can't deposit that much.", npc, creature) + npcHandler:setTopic(playerId, 0) + return false + end + if MsgContains(message, "all") then + count[playerId] = player:getMoney() + npcHandler:say("Would you really like to deposit " .. count[playerId] .. " gold?", npc, creature) + npcHandler:setTopic(playerId, 2) + return true + else + if string.match(message, "%d+") then + count[playerId] = getMoneyCount(message) + if count[playerId] < 1 then + npcHandler:say("You do not have enough gold.", npc, creature) + npcHandler:setTopic(playerId, 0) + return false + end + npcHandler:say("Would you really like to deposit " .. count[playerId] .. " gold?", npc, creature) + npcHandler:setTopic(playerId, 2) + return true + else + npcHandler:say("Please tell me how much gold it is you would like to deposit.", npc, creature) + npcHandler:setTopic(playerId, 1) + return true + end + end + elseif npcHandler:getTopic(playerId) == 1 then + count[playerId] = getMoneyCount(message) + if isValidMoney(count[playerId]) then + npcHandler:say("Would you really like to deposit " .. count[playerId] .. " gold?", npc, creature) + npcHandler:setTopic(playerId, 2) + return true + else + npcHandler:say("You do not have enough gold.", npc, creature) + npcHandler:setTopic(playerId, 0) + return true + end + elseif npcHandler:getTopic(playerId) == 2 then + if MsgContains(message, "yes") then + if player:getStorageValue(Storage.TheRookieGuard.Mission08) == 1 then + player:depositMoney(count[playerId]) + Bank.credit(player, 50) + npcHandler:say("Alright, we have added the amount of " .. count[playerId] .. " +50 gold to your {balance} - that is the money you deposited plus a bonus of 50 gold. \z + Thank you! You can withdraw your money anytime.", npc, creature) + player:setStorageValue(Storage.TheRookieGuard.Mission08, 2) + npcHandler:setTopic(playerId, 0) + return false + end + if player:depositMoney(count[playerId]) then + npcHandler:say("Alright, we have added the amount of " .. count[playerId] .. " gold to your {balance}. \z + You can {withdraw} your money anytime you want to.", npc, creature) + else + npcHandler:say("You do not have enough gold.", npc, creature) + end + elseif MsgContains(message, "no") then + npcHandler:say("As you wish. Is there something else I can do for you?", npc, creature) + end + npcHandler:setTopic(playerId, 0) + return true + --Withdraw + elseif MsgContains(message, "withdraw") then + if string.match(message, "%d+") then + count[playerId] = getMoneyCount(message) + if isValidMoney(count[playerId]) then + npcHandler:say("Are you sure you wish to withdraw " .. count[playerId] .. " gold from your bank account?", npc, creature) + npcHandler:setTopic(playerId, 7) + else + npcHandler:say("There is not enough gold on your account.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + return true + else + npcHandler:say("Please tell me how much gold you would like to withdraw.", npc, creature) + npcHandler:setTopic(playerId, 6) + return true + end + elseif npcHandler:getTopic(playerId) == 6 then + count[playerId] = getMoneyCount(message) + if isValidMoney(count[playerId]) then + npcHandler:say("Are you sure you wish to withdraw " .. count[playerId] .. " gold from your bank account?", npc, creature) + npcHandler:setTopic(playerId, 7) + else + npcHandler:say("There is not enough gold on your account.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + return true + elseif npcHandler:getTopic(playerId) == 7 then + if MsgContains(message, "yes") then + if player:getFreeCapacity() >= getMoneyWeight(count[playerId]) then + if not player:withdrawMoney(count[playerId]) then + npcHandler:say("There is not enough gold on your account.", npc, creature) + else + npcHandler:say("Here you are, " .. count[playerId] .. " gold. \z + Please let me know if there is something else I can do for you.", npc, creature) + end + else + npcHandler:say( + "Whoah, hold on, you have no room in your inventory to carry all those coins. \z + I don't want you to drop it on the floor, maybe come back with a cart!", + npc, + creature + ) + end + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "no") then + npcHandler:say("The customer is king! Come back anytime you want to if you wish to {withdraw} your money.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + return true + --Money exchange + elseif MsgContains(message, "change gold") then + npcHandler:say("How many platinum coins would you like to get?", npc, creature) + npcHandler:setTopic(playerId, 14) + elseif npcHandler:getTopic(playerId) == 14 then + if getMoneyCount(message) < 1 then + npcHandler:say("Sorry, you do not have enough gold coins.", npc, creature) + npcHandler:setTopic(playerId, 0) + else + count[playerId] = getMoneyCount(message) + npcHandler:say("So you would like me to change " .. count[playerId] * 100 .. " of your gold \z + coins into " .. count[playerId] .. " platinum coins?", npc, creature) + npcHandler:setTopic(playerId, 15) + end + elseif npcHandler:getTopic(playerId) == 15 then + if MsgContains(message, "yes") then + if player:removeItem(3031, count[playerId] * 100) then + player:addItem(3035, count[playerId]) + npcHandler:say("Here you are.", npc, creature) + else + npcHandler:say("Sorry, you do not have enough gold coins.", npc, creature) + end + else + npcHandler:say("Well, can I help you with something else?", npc, creature) + end + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "change platinum") then + npcHandler:say("Would you like to change your platinum coins into gold or crystal?", npc, creature) + npcHandler:setTopic(playerId, 16) + elseif npcHandler:getTopic(playerId) == 16 then + if MsgContains(message, "gold") then + npcHandler:say("How many platinum coins would you like to change into gold?", npc, creature) + npcHandler:setTopic(playerId, 17) + elseif MsgContains(message, "crystal") then + npcHandler:say("How many crystal coins would you like to get?", npc, creature) + npcHandler:setTopic(playerId, 19) + else + npcHandler:say("Well, can I help you with something else?", npc, creature) + npcHandler:setTopic(playerId, 0) + end + elseif npcHandler:getTopic(playerId) == 17 then + if getMoneyCount(message) < 1 then + npcHandler:say("Sorry, you do not have enough platinum coins.", npc, creature) + npcHandler:setTopic(playerId, 0) + else + count[playerId] = getMoneyCount(message) + npcHandler:say("So you would like me to change " .. count[playerId] .. " of your platinum \z + coins into " .. count[playerId] * 100 .. " gold coins for you?", npc, creature) + npcHandler:setTopic(playerId, 18) + end + elseif npcHandler:getTopic(playerId) == 18 then + if MsgContains(message, "yes") then + if player:removeItem(3035, count[playerId]) then + player:addItem(3031, count[playerId] * 100) + npcHandler:say("Here you are.", npc, creature) + else + npcHandler:say("Sorry, you do not have enough platinum coins.", npc, creature) + end + else + npcHandler:say("Well, can I help you with something else?", npc, creature) + end + npcHandler:setTopic(playerId, 0) + elseif npcHandler:getTopic(playerId) == 19 then + if getMoneyCount(message) < 1 then + npcHandler:say("Sorry, you do not have enough platinum coins.", npc, creature) + npcHandler:setTopic(playerId, 0) + else + count[playerId] = getMoneyCount(message) + npcHandler:say("So you would like me to change " .. count[playerId] * 100 .. " of your platinum coins \z + into " .. count[playerId] .. " crystal coins for you?", npc, creature) + npcHandler:setTopic(playerId, 20) + end + elseif npcHandler:getTopic(playerId) == 20 then + if MsgContains(message, "yes") then + if player:removeItem(3035, count[playerId] * 100) then + player:addItem(3043, count[playerId]) + npcHandler:say("Here you are.", npc, creature) + else + npcHandler:say("Sorry, you do not have enough platinum coins.", npc, creature) + end + else + npcHandler:say("Well, can I help you with something else?", npc, creature) + end + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "change crystal") then + npcHandler:say("How many crystal coins would you like to change into platinum?", npc, creature) + npcHandler:setTopic(playerId, 21) + elseif npcHandler:getTopic(playerId) == 21 then + if getMoneyCount(message) < 1 then + npcHandler:say("Sorry, you do not have enough crystal coins.", npc, creature) + npcHandler:setTopic(playerId, 0) + else + count[playerId] = getMoneyCount(message) + npcHandler:say("So you would like me to change " .. count[playerId] .. " of your crystal coins \z + into " .. count[playerId] * 100 .. " platinum coins for you?", npc, creature) + npcHandler:setTopic(playerId, 22) + end + elseif npcHandler:getTopic(playerId) == 22 then + if MsgContains(message, "yes") then + if player:removeItem(3043, count[playerId]) then + player:addItem(3035, count[playerId] * 100) + npcHandler:say("Here you are.", npc, creature) + else + npcHandler:say("Sorry, you do not have enough crystal coins.", npc, creature) + end + else + npcHandler:say("Well, can I help you with something else?", npc, creature) + end + npcHandler:setTopic(playerId, 0) + end return true end -npcHandler:setMessage(MESSAGE_GREET, "Yes? What may I do for you, |PLAYERNAME|? Bank business, perhaps?") +npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setMessage(MESSAGE_FAREWELL, "Have a nice day.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Have a nice day.") -npcHandler:setCallback(CALLBACK_GREET, NpcBankGreetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) diff --git a/data-otservbr-global/npc/vascalir.lua b/data-otservbr-global/npc/vascalir.lua index 0f07ecaf73d..ef799e65709 100644 --- a/data-otservbr-global/npc/vascalir.lua +++ b/data-otservbr-global/npc/vascalir.lua @@ -218,6 +218,7 @@ local mission2Accept = mission2:addChildKeyword( text = { "Great. We best start by reinforcing our defences. There are four large catapults positioned on roofs high over the village. If you want to fight, you have to build up some muscles. ...", "Go into the barn just a few steps to the north-west of here and down the ladder into the cellar. You'll find a huge stone pile down there. Use it to pick up one of the big stones. ...", + "They are really heavy, so make sure you have lots of space in your inventory. ...", "Carry one stone to at least two of the four catapults located on Norma's roof to the north, this academy and Obi's roof to the south. ...", "Use the stone on the catapult to load it. You can load each catapult only once, so try spotting two different catapults. Have you understood all of that?", }, @@ -279,6 +280,7 @@ local mission3 = keywordHandler:addKeyword({ "yes" }, StdModule.say, { text = { "Ah, that came with confidence. Suited monsters to do some basic fighting would be rats - they actually fight back, but they don't hit that hard. Just make sure you wear your new studded shield and a sword. ...", "You can find rats in the sewers. In case you might think so, this task is not a lame excuse to help us with some rat infestation, we got the rat population quite under control. ...", + "Also please don't come carrying their dead bodies - what adventurers somehow tend to do for some reason. Maybe they think they're cats? I'm going to believe you, promise. ...", "So, back to the topic - please kill 5 rats and then come back to me. Shouldn't be too hard, should it? Just pay attention they don't trap you in a narrow passage and take on one at a time. ...", "If you run low on health, go on full defence - click the little shield icon - and leave the dungeon. Nothing corwardish about running, because dying hurts. Are you ready to go?", }, @@ -301,9 +303,9 @@ mission3:addChildKeyword( { npcHandler = npcHandler, text = { - "Nice. I've marked two rat dungeons on your map. Kill 5 rats and return to me. Smart adventurers try to face one creature at a time - use the environment to your advantage. ...", - "If you should happen to forget how many you have killed in the meantime, simply check your questlog. ...", - "Once you reach level 8, you should leave this island. While it is possible to reach higher levels, this quest is meant to be played up to level 8. ...", + "Nice. I've marked two rat dungeons on your map. Kill 5 rats and return to me. If you should happen to forget how many you have killed in the meantime, simply check your questlog. ...", + "I should also give you a small word of warning - once you reach level 8, you should leave this island. Thus you won't be able to continue this quest once you've reached level 9. ...", + "It's not good to reach level 9 without having chosen a vocation - you'll be weaker than normal. ...", "No need to be scared, just saying you don't need to plan large hunting sessions while helping me with this mission or kill more rats than I've asked you to. So, good hunting!", }, }, @@ -348,7 +350,7 @@ keywordHandler:addKeyword({ "yes" }, StdModule.say, { "Anyway, I think you're well enough equipped now to leave the village of Rookgaard for another small task. Find Lily south-west of here, she will tell you what she needs done.", }, }, function(player) - return player:getStorageValue(Storage.TheRookieGuard.Mission03) == 1 and player:getStorageValue(Storage.TheRookieGuard.RatKills) == 5 + return player:getStorageValue(Storage.TheRookieGuard.Mission03) == 1 and player:getStorageValue(Storage.TheRookieGuard.RatKills) >= 5 end, function(player) player:setStorageValue(Storage.TheRookieGuard.Mission03, 2) player:setStorageValue(Storage.TheRookieGuard.Mission04, 1) @@ -884,7 +886,7 @@ end) keywordHandler:addKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = { - "You DID kill him indeed! Incredible! This little village can finally live in peace again - and you've grown so strong, too. I'm proud of you, Synanceia Horrida. My work here is done, and yours too. Thank you for all you've done for us. ...", + "You DID kill him indeed! Incredible! This little village can finally live in peace again - and you've grown so strong, too. I'm proud of you, |PLAYERNAME|. My work here is done, and yours too. Thank you for all you've done for us. ...", "Now all that is left for you to do here is to talk to the oracle above the academy and travel to the Isle of Destiny. There, you will determine your future - which I'm sure is a bright one. ...", "What will become of you? A mighty sorcerer? A fierce knight? A skilled paladin? Or a powerful druid? Only you can decide. ...", "Rookgaard will miss you, but the whole world of Tibia is open to you now. Take care, |PLAYERNAME|. It's good to know you.", diff --git a/data-otservbr-global/scripts/actions/other/others/quest_system2.lua b/data-otservbr-global/scripts/actions/other/others/quest_system2.lua index 42fc5bb8ab8..a7e7c41b8e8 100644 --- a/data-otservbr-global/scripts/actions/other/others/quest_system2.lua +++ b/data-otservbr-global/scripts/actions/other/others/quest_system2.lua @@ -15,12 +15,6 @@ local config = { }, storage = Storage.QuestChests.FamilyBrooch, }, - [3002] = { - items = { - { itemId = 3030, count = 6 }, - }, - storage = Storage.QuestChests.SixRubiesQuest, - }, [3018] = { items = { { itemId = 3219 }, @@ -106,50 +100,18 @@ local config = { say = "A batch of documents has been stashed in the shelf. These might be of interest to Zalamon.", effect = CONST_ME_POFF, }, - [3311] = { - items = { - { itemId = 2970, actionId = 3301 }, - }, - storage = Storage.QuestChests.OutlawCampKey1, - }, - [3312] = { - items = { - { itemId = 2969, actionId = 3302 }, - }, - storage = Storage.QuestChests.OutlawCampKey2, - }, - [3313] = { - items = { - { itemId = 2970, actionId = 3303 }, - }, - storage = Storage.QuestChests.OutlawCampKey3, - }, [4010] = { items = { { itemId = 4832 }, }, storage = Storage.TheApeCity.HolyApeHair, }, - [5556] = { - items = { - { itemId = 3357 }, - }, - storage = Storage.GhostShipQuest, - }, [9136] = { items = { { itemId = 2972, actionId = 3980 }, }, storage = Storage.QuestChests.DeeperFibulaKey, }, - [9185] = { - items = { - { itemId = 3017 }, - { itemId = 3030, count = 2 }, - { itemId = 3028, count = 3 }, - }, - storage = Storage.QuestChests.SilverBrooch, - }, [9226] = { items = { { itemId = 3397 }, @@ -195,12 +157,6 @@ local config = { }, storage = Storage.SecretService.RottenTree, }, - [50032] = { - items = { - { itemId = 3734 }, - }, - storage = Storage.BloodHerbQuest, - }, [50112] = { items = { { itemId = 3725, count = 10 }, @@ -221,30 +177,6 @@ local config = { }, storage = 857440, }, - [65202] = { - items = { - { itemId = 2969, actionId = 3610 }, - }, - storage = 857441, - }, - [65204] = { - items = { - { itemId = 3269, count = 1 }, - }, - storage = 857442, - }, - [65205] = { - items = { - { itemId = 3356, count = 1 }, - }, - storage = 857443, - }, - [65206] = { - items = { - { itemId = 3029, count = 4 }, - }, - storage = 857444, - }, [65207] = { items = { { itemId = 3551, count = 1 }, @@ -257,30 +189,12 @@ local config = { }, storage = 857446, }, - [65209] = { - items = { - { itemId = 3054, count = 1 }, - }, - storage = 857447, - }, [65210] = { items = { { itemId = 3147, count = 3 }, }, storage = 857448, }, - [65211] = { - items = { - { itemId = 3028, count = 1 }, - }, - storage = 857449, - }, - [65212] = { - items = { - { itemId = 2969, actionId = 3667 }, - }, - storage = 857450, - }, [14037] = { items = { { @@ -397,12 +311,6 @@ The map shows the original floor plan of this mine. You recognise your position }, storage = Storage.QuestChests.FormorgarMinesHoistSkeleton, }, - [20004] = { - items = { - { itemId = 3266 }, - }, - storage = Storage.BattleAxeQuest, - }, [14041] = { items = { { diff --git a/data-otservbr-global/scripts/actions/quests/dawnport/legion_helmet.lua b/data-otservbr-global/scripts/actions/quests/dawnport/legion_helmet.lua index a692ed8618c..a867a2b1578 100644 --- a/data-otservbr-global/scripts/actions/quests/dawnport/legion_helmet.lua +++ b/data-otservbr-global/scripts/actions/quests/dawnport/legion_helmet.lua @@ -15,9 +15,9 @@ function sacredSnake.onUse(player, item, fromPosition, target, toPosition, isHot for i = 1, #sacrificialPosition do local tile = Tile(sacrificialPosition[i]) if toPosition == sacrificialPosition[i] then - if player:getStorageValue(Storage.Quest.U10_55.SanctuaryOfTheLizardGod.LizardGodTeleport) < 1 then + if not player:kv():scoped("lizard-god-teleport"):get("discovered") then player:removeItem(21469, 1) - player:setStorageValue(Storage.Quest.U10_55.SanctuaryOfTheLizardGod.LizardGodTeleport, 1) + player:kv():scoped("lizard-god-teleport"):set("discovered", true) player:say("The lizard god accepts your offer! You may enter the santuary!", TALKTYPE_MONSTER_SAY, false, player, toPosition) toPosition:sendMagicEffect(CONST_ME_MORTAREA) item:remove(1) diff --git a/data-otservbr-global/scripts/actions/quests/others/desert_dungeon_lever_quest.lua b/data-otservbr-global/scripts/actions/quests/desert_dungeon_quest/desert_dungeon_lever.lua similarity index 99% rename from data-otservbr-global/scripts/actions/quests/others/desert_dungeon_lever_quest.lua rename to data-otservbr-global/scripts/actions/quests/desert_dungeon_quest/desert_dungeon_lever.lua index 1361a521185..a026ed96cd1 100644 --- a/data-otservbr-global/scripts/actions/quests/others/desert_dungeon_lever_quest.lua +++ b/data-otservbr-global/scripts/actions/quests/desert_dungeon_quest/desert_dungeon_lever.lua @@ -78,5 +78,5 @@ function othersDesert.onUse(player, item, fromPosition, target, toPosition, isHo return true end -othersDesert:uid(1912) +othersDesert:uid(30030) othersDesert:register() diff --git a/data-otservbr-global/scripts/actions/quests/devil_helmet/lever.lua b/data-otservbr-global/scripts/actions/quests/mintwallin_quest/devil_helmet_lever.lua similarity index 94% rename from data-otservbr-global/scripts/actions/quests/devil_helmet/lever.lua rename to data-otservbr-global/scripts/actions/quests/mintwallin_quest/devil_helmet_lever.lua index e5e968d5afc..01d3ffeaac7 100644 --- a/data-otservbr-global/scripts/actions/quests/devil_helmet/lever.lua +++ b/data-otservbr-global/scripts/actions/quests/mintwallin_quest/devil_helmet_lever.lua @@ -15,5 +15,5 @@ function devilHelmetLever.onUse(player, item, fromPosition, target, toPosition, return true end -devilHelmetLever:aid(20594) +devilHelmetLever:aid(30008) devilHelmetLever:register() diff --git a/data-otservbr-global/scripts/actions/quests/others/black_knight_quest.lua b/data-otservbr-global/scripts/actions/quests/others/black_knight_quest.lua deleted file mode 100644 index b4f763c8672..00000000000 --- a/data-otservbr-global/scripts/actions/quests/others/black_knight_quest.lua +++ /dev/null @@ -1,15 +0,0 @@ -local othersBlackKnight = Action() -function othersBlackKnight.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.QuestChests.BlackKnightTreeKey) ~= 1 then - local newItem = Game.createItem(2969, 1) - newItem:setActionId(5010) - player:addItemEx(newItem) - player:setStorageValue(Storage.QuestChests.BlackKnightTreeKey, 1) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a silver key.") - else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The " .. ItemType(item.itemid):getName() .. " is empty.") - end -end - -othersBlackKnight:aid(5558) -othersBlackKnight:register() diff --git a/data-otservbr-global/scripts/actions/quests/others/plate_armor_quest.lua b/data-otservbr-global/scripts/actions/quests/others/plate_armor_quest.lua deleted file mode 100644 index 79bc0232397..00000000000 --- a/data-otservbr-global/scripts/actions/quests/others/plate_armor_quest.lua +++ /dev/null @@ -1,13 +0,0 @@ -local othersPlateArmor = Action() -function othersPlateArmor.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.GhostShipQuest) == 1 then - return false - end - - player:setStorageValue(Storage.GhostShipQuest, 1) - player:addItem(3357, 1) - return true -end - -othersPlateArmor:aid(5556) -othersPlateArmor:register() diff --git a/data-otservbr-global/scripts/actions/quests/others/life_ring_lever.lua b/data-otservbr-global/scripts/actions/quests/thais_quest/life_ring_lever.lua similarity index 97% rename from data-otservbr-global/scripts/actions/quests/others/life_ring_lever.lua rename to data-otservbr-global/scripts/actions/quests/thais_quest/life_ring_lever.lua index 60c490b8ddd..61786e84ec3 100644 --- a/data-otservbr-global/scripts/actions/quests/others/life_ring_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/thais_quest/life_ring_lever.lua @@ -33,5 +33,5 @@ function othersLifeRing.onUse(player, item, fromPosition, target, toPosition, is return true end -othersLifeRing:aid(50129) +othersLifeRing:aid(30007) othersLifeRing:register() diff --git a/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/oven.lua b/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/oven.lua index b7f7499336b..45527f07f10 100644 --- a/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/oven.lua +++ b/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/oven.lua @@ -19,5 +19,5 @@ function theOutlawOven.onUse(player, item, fromPosition, target, toPosition, isH return true end -theOutlawOven:uid(3400) +theOutlawOven:uid(30031) theOutlawOven:register() diff --git a/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/power_burn.lua b/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/power_burn.lua index b05c5882e76..43c9918be0b 100644 --- a/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/power_burn.lua +++ b/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/power_burn.lua @@ -16,5 +16,5 @@ function theOutlawPower.onUse(player, item, fromPosition, target, toPosition, is return true end -theOutlawPower:uid(3402) +theOutlawPower:uid(30033) theOutlawPower:register() diff --git a/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/power_switch.lua b/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/power_switch.lua index 3cdd3e766ee..01ab8b3f969 100644 --- a/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/power_switch.lua +++ b/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/power_switch.lua @@ -14,5 +14,5 @@ function theOutlawPowerSwitch.onUse(player, item, fromPosition, target, toPositi return true end -theOutlawPowerSwitch:uid(3401) +theOutlawPowerSwitch:uid(30032) theOutlawPowerSwitch:register() diff --git a/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/the_outlaw_camp_quest.lua b/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/the_outlaw_camp_quest.lua new file mode 100644 index 00000000000..bdecd57c01f --- /dev/null +++ b/data-otservbr-global/scripts/actions/quests/the_outlaw_camp/the_outlaw_camp_quest.lua @@ -0,0 +1,33 @@ +-- Bag -> bright sword and red gem +local outlawQuest = Action() + +function outlawQuest.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local bagId = 2853 + local rewardIds = { + { 3295, 1 }, -- bright sword + { 3039, 1 }, -- red gem + } + + for _, reward in ipairs(rewardIds) do + local rewardId, rewardCount = reward[1], reward[2] + if not player:canGetReward(rewardId, "outlaw") then + return true + end + end + + local bag = player:addItem(bagId, 1) + if bag then + for _, reward in ipairs(rewardIds) do + local rewardId, rewardCount = reward[1], reward[2] + bag:addItem(rewardId, rewardCount) + end + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a bag.") + player:questKV("outlaw"):set("completed", true) + player:setStorageValue(Storage.QuestChests.OutlawCamp, 1) + end + + return true +end + +outlawQuest:uid(14091) +outlawQuest:register() diff --git a/data-otservbr-global/scripts/actions/quests/others/triangle_tower_lever.lua b/data-otservbr-global/scripts/actions/quests/triangle_tower_quest/triangle_tower_lever.lua similarity index 95% rename from data-otservbr-global/scripts/actions/quests/others/triangle_tower_lever.lua rename to data-otservbr-global/scripts/actions/quests/triangle_tower_quest/triangle_tower_lever.lua index ec0884d9e0a..2edd6c4626c 100644 --- a/data-otservbr-global/scripts/actions/quests/others/triangle_tower_lever.lua +++ b/data-otservbr-global/scripts/actions/quests/triangle_tower_quest/triangle_tower_lever.lua @@ -15,5 +15,5 @@ function othersTriangle.onUse(player, item, fromPosition, target, toPosition, is return true end -othersTriangle:uid(50023) +othersTriangle:uid(30034) othersTriangle:register() diff --git a/data-otservbr-global/scripts/actions/rookgaard/banana_quest.lua b/data-otservbr-global/scripts/actions/rookgaard/banana_quest.lua deleted file mode 100644 index 05e89ebae69..00000000000 --- a/data-otservbr-global/scripts/actions/rookgaard/banana_quest.lua +++ /dev/null @@ -1,15 +0,0 @@ -local bananaQuest = Action() - -function bananaQuest.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.QuestChests.BananaPalm) == 1 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The banana palm is empty.") - else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a banana.") - player:addItem(3587, 1) - player:setStorageValue(Storage.QuestChests.BananaPalm, 1) - end - return true -end - -bananaQuest:aid(5641) -bananaQuest:register() diff --git a/data-otservbr-global/scripts/actions/rookgaard/bearroom_quest_lever.lua b/data-otservbr-global/scripts/actions/rookgaard/bear_room_quest/bear_room_quest_lever.lua similarity index 100% rename from data-otservbr-global/scripts/actions/rookgaard/bearroom_quest_lever.lua rename to data-otservbr-global/scripts/actions/rookgaard/bear_room_quest/bear_room_quest_lever.lua diff --git a/data-otservbr-global/scripts/actions/rookgaard/bear_room_quest/bear_room_quest_stone.lua b/data-otservbr-global/scripts/actions/rookgaard/bear_room_quest/bear_room_quest_stone.lua new file mode 100644 index 00000000000..ec8457748a8 --- /dev/null +++ b/data-otservbr-global/scripts/actions/rookgaard/bear_room_quest/bear_room_quest_stone.lua @@ -0,0 +1,17 @@ +local bearStone = Action() +function bearStone.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local stonePosition = { x = 32145, y = 32101, z = 11 } + + if item.itemid == 2772 then + Tile(stonePosition):getItemById(1791):remove() + item:transform(2773) + elseif item.itemid == 2773 then + Position(stonePosition):hasCreature({ x = 32145, y = 32102, z = 11 }) + Game.createItem(1791, 1, stonePosition) + item:transform(2772) + end + return true +end + +bearStone:aid(30006) +bearStone:register() diff --git a/data-otservbr-global/scripts/actions/rookgaard/doublet_quest.lua b/data-otservbr-global/scripts/actions/rookgaard/doublet_quest.lua deleted file mode 100644 index cb74877614e..00000000000 --- a/data-otservbr-global/scripts/actions/rookgaard/doublet_quest.lua +++ /dev/null @@ -1,15 +0,0 @@ -local doubletQuest = Action() - -function doubletQuest.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.QuestChests.DoubletQuest) == 1 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The loose board is empty.") - else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a doublet.") - player:addItem(3379, 1) - player:setStorageValue(Storage.QuestChests.DoubletQuest, 1) - end - return true -end - -doubletQuest:aid(5639) -doubletQuest:register() diff --git a/data-otservbr-global/scripts/actions/rookgaard/goblin_temple_quest.lua b/data-otservbr-global/scripts/actions/rookgaard/goblin_temple_quest.lua new file mode 100644 index 00000000000..8244cdf3a54 --- /dev/null +++ b/data-otservbr-global/scripts/actions/rookgaard/goblin_temple_quest.lua @@ -0,0 +1,67 @@ +-- Reward = bag -> sandals, 5 small stones, 50 gold coins +local goblintemple1Quest = Action() + +function goblintemple1Quest.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local bagId = 2853 + local rewardIds = { + { 3551, 1 }, + { 1781, 5 }, + { 3031, 50 }, + } + + for _, reward in ipairs(rewardIds) do + local rewardId, rewardCount = reward[1], reward[2] + if not player:canGetReward(rewardId, "goblintemple") then + return true + end + end + + local bag = player:addItem(bagId, 1) + if bag then + for _, reward in ipairs(rewardIds) do + local rewardId, rewardCount = reward[1], reward[2] + bag:addItem(rewardId, rewardCount) + end + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a bag.") + player:questKV("goblintemple"):set("completed", true) + end + + return true +end + +goblintemple1Quest:uid(14049) +goblintemple1Quest:register() + +-- Reward = bag -> pan, 4 snowballs, vial of milk +local goblintemple2Quest = Action() + +function goblintemple2Quest.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local bagId = 2853 + local rewardIds = { + { 3466, 1 }, + { 2992, 4 }, + { 2874, 1 }, + } + + for _, reward in ipairs(rewardIds) do + local rewardId, rewardCount = reward[1], reward[2] + if not player:canGetReward(rewardId, "goblintemple2") then + return true + end + end + + local bag = player:addItem(bagId, 1) + if bag then + for _, reward in ipairs(rewardIds) do + local rewardId, rewardCount = reward[1], reward[2] + bag:addItem(rewardId, rewardCount) + end + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a bag.") + player:questKV("goblintemple2"):set("completed", true) + end + + return true +end + +goblintemple2Quest:uid(14050) +goblintemple2Quest:register() diff --git a/data-otservbr-global/scripts/actions/rookgaard/honey_flower_quest.lua b/data-otservbr-global/scripts/actions/rookgaard/honey_flower_quest.lua deleted file mode 100644 index 8f5b7e08857..00000000000 --- a/data-otservbr-global/scripts/actions/rookgaard/honey_flower_quest.lua +++ /dev/null @@ -1,15 +0,0 @@ -local honeyFlowerQuest = Action() - -function honeyFlowerQuest.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.QuestChests.HoneyFlower) == 1 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The honeyflower patch is empty.") - else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a honey flower.") - player:addItem(2984, 1) - player:setStorageValue(Storage.QuestChests.HoneyFlower, 1) - end - return true -end - -honeyFlowerQuest:aid(5640) -honeyFlowerQuest:register() diff --git a/data-otservbr-global/scripts/actions/rookgaard/katana_quest/katana_quest_door.lua b/data-otservbr-global/scripts/actions/rookgaard/katana_quest/katana_quest_door.lua new file mode 100644 index 00000000000..1d53962b0c5 --- /dev/null +++ b/data-otservbr-global/scripts/actions/rookgaard/katana_quest/katana_quest_door.lua @@ -0,0 +1,20 @@ +local doorPosition = Position(32177, 32148, 11) +local leverPosition = Position(32182, 32145, 11) + +local katanaQuestDoor = Action() + +function katanaQuestDoor.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local doorItem = Tile(doorPosition):getItemById(5108) + if doorItem then + doorItem:transform(5107) + doorItem:setAttribute(ITEM_ATTRIBUTE_UNIQUEID, 22006) + end + local leverItem = Tile(leverPosition):getItemById(2773) + if leverItem then + leverItem:transform(2772) + end + return false +end + +katanaQuestDoor:uid(22006) +katanaQuestDoor:register() diff --git a/data-otservbr-global/scripts/actions/rookgaard/katana_quest_lever.lua b/data-otservbr-global/scripts/actions/rookgaard/katana_quest/katana_quest_lever.lua similarity index 81% rename from data-otservbr-global/scripts/actions/rookgaard/katana_quest_lever.lua rename to data-otservbr-global/scripts/actions/rookgaard/katana_quest/katana_quest_lever.lua index 98d0a155417..c628b8e4959 100644 --- a/data-otservbr-global/scripts/actions/rookgaard/katana_quest_lever.lua +++ b/data-otservbr-global/scripts/actions/rookgaard/katana_quest/katana_quest_lever.lua @@ -8,7 +8,7 @@ function katanaQuestLever.onUse(player, item, fromPosition, target, toPosition, local doorItem = Tile(doorPosition):getItemById(5107) if doorItem then doorItem:transform(5108) - doorItem:setAttribute(ITEM_ATTRIBUTE_UNIQUEID, 1055) + doorItem:setAttribute(ITEM_ATTRIBUTE_UNIQUEID, 22006) item:transform(2773) end else @@ -17,12 +17,12 @@ function katanaQuestLever.onUse(player, item, fromPosition, target, toPosition, if doorItem then tile:relocateTo(relocatePosition, true) doorItem:transform(5107) - doorItem:setAttribute(ITEM_ATTRIBUTE_UNIQUEID, 1055) + doorItem:setAttribute(ITEM_ATTRIBUTE_UNIQUEID, 22006) item:transform(2772) end end return true end -katanaQuestLever:uid(1054) +katanaQuestLever:uid(30029) katanaQuestLever:register() diff --git a/data-otservbr-global/scripts/actions/rookgaard/katana_quest_door.lua b/data-otservbr-global/scripts/actions/rookgaard/katana_quest_door.lua deleted file mode 100644 index f620a1733e8..00000000000 --- a/data-otservbr-global/scripts/actions/rookgaard/katana_quest_door.lua +++ /dev/null @@ -1,8 +0,0 @@ -local katanaQuestDoor = Action() - -function katanaQuestDoor.onUse(player, item, fromPosition, target, toPosition, isHotkey) - return false -end - -katanaQuestDoor:uid(1055) -katanaQuestDoor:register() diff --git a/data-otservbr-global/scripts/actions/system/quest_reward_common.lua b/data-otservbr-global/scripts/actions/system/quest_reward_common.lua index 7c79df383e7..a991cdbbcf1 100644 --- a/data-otservbr-global/scripts/actions/system/quest_reward_common.lua +++ b/data-otservbr-global/scripts/actions/system/quest_reward_common.lua @@ -18,6 +18,33 @@ Ferumbras * Frodo ** Noodles ****]], }, + [6112] = { + text = [[ +... the dream master retreated to the world behind the curtains of awareness, I can't reach him, now that the last hall of dreams is lost to the forces of evil. +I sealed Goshnar's grave so no one can enter the pits without knowing our secret. +I will try to retreat to Knightwatch Tower and wait for a dreamer in possession of the key. +So we can travel on one of the dream paths to a saver place to regroup and to plan a counter-attack. +I fear we have to recruit new members and we have only little time left to train them. +I hope Taciror will not waste our last forces in a futile attack on the Ruthless Seven. +Our order has never truly recovered from the losses in our war against Goshnar and his undead hordes. +Now that our leaders and best warriors have died in the attack on the demonic forces, we don't stand a chance against our enemies. +Our only hope is to gather new forces and to recapture the chamber of dreams. +Of course I know the right method to distract Hugo long enough to get past him. +The dream master is important to teach our recruits in the old ways and in the art of dreamwalking. +We need a leader for our cause and we need him badly. Headless we will fail and fall. +It is already uncertain who took the Nightmare Chronicles out of the pits and I have no idea where they are hidden. +They are fighting about power and influence but unity is the key to success. Our whole order is centred about unity. +All our rituals and procedures rooted on unity and sharing, they can't neglect that. +]], + }, + [6183] = { + text = [[ +Looks like the fox is out! +More luck next time! +Signed: +the horned fox +]], + }, } local achievementTable = { @@ -41,7 +68,7 @@ local function playerAddItem(params, item) -- Needs independent verification because it cannot be set as "key" in items.xml -- Because it generate bug in the item description if itemType:isKey() or itemType:getId(21392) then - -- If is key not in container, uses the "isKey = true" variable + -- If is key not in container, uses the "isKey = true" variab keyItem = player:addItem(params.itemid, params.count) keyItem:setActionId(params.storage) end @@ -59,10 +86,16 @@ local function playerAddItem(params, item) end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, params.message .. ".") - if params.timer then - player:setStorageValue(params.timer, os.time() + params.time * 3600) + if params.useKV then + player:questKV(params.questName):set("completed", true) + if params.timer then + player:questKV(params.questName):set("params.questName", os.time() + params.time * 3600) -- multiplicação por hora + end else player:setStorageValue(params.storage, 1) + if params.timer then + player:setStorageValue(params.timer, os.time() + params.time * 3600) -- multiplicação por hora + end end return true end @@ -73,7 +106,6 @@ local function playerAddContainerItem(params, item) local reward = params.containerReward local itemType = ItemType(params.itemid) if itemType:isKey() then - -- If is key inside container, uses the "keyAction" variable keyItem = reward:addItem(params.itemid, params.count) if params.storage then keyItem:setActionId(params.action) @@ -92,7 +124,17 @@ local function playerAddContainerItem(params, item) end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a " .. getItemName(params.itemBagName) .. ".") - player:setStorageValue(params.storage, 1) + if params.useKV then + player:questKV(params.questName):set("completed", true) + if params.timer then + player:questKV(params.questName):set("params.questName", os.time() + params.time * 3600) -- multiplicação por hora + end + else + player:setStorageValue(params.storage, 1) + if params.timer then + player:setStorageValue(params.timer, os.time() + params.time * 3600) -- multiplicação por hora + end + end return true end @@ -118,20 +160,32 @@ function questReward.onUse(player, item, fromPosition, itemEx, toPosition) end end - if setting.timerStorage then - if player:getStorageValue(setting.timerStorage) > os.time() then + if setting.useKV then + if player:questKV(setting.questName):get("completed") then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The " .. getItemName(setting.itemId) .. " is empty.") + return true + end + if setting.timerStorage and player:questKV(setting.questName):get("timer") and player:questKV(setting.questName):get("timer") > os.time() then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The " .. getItemName(setting.itemId) .. " is empty.") + return true + end + else + if player:getStorageValue(setting.storage) >= 1 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The " .. getItemName(setting.itemId) .. " is empty.") + return true + end + if setting.timerStorage and player:getStorageValue(setting.timerStorage) > os.time() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The " .. getItemName(setting.itemId) .. " is empty.") return true end - elseif player:getStorageValue(setting.storage) >= 0 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The " .. getItemName(setting.itemId) .. " is empty.") - return true end + if setting.randomReward then local randomReward = math.random(#setting.randomReward) setting.reward[1][1] = setting.randomReward[randomReward][1] setting.reward[1][2] = setting.randomReward[randomReward][2] end + local container = player:addItem(setting.container) for i = 1, #setting.reward do local itemid = setting.reward[i][1] @@ -152,6 +206,8 @@ function questReward.onUse(player, item, fromPosition, itemEx, toPosition) key = setting.isKey, timer = setting.timerStorage, time = setting.time, + questName = setting.questName, + useKV = setting.useKV, } if count > 1 and ItemType(itemid):isStackable() then @@ -182,6 +238,8 @@ function questReward.onUse(player, item, fromPosition, itemEx, toPosition) action = setting.keyAction, itemBagName = itemBagName, containerReward = itemBag, + questName = setting.questName, + useKV = setting.useKV, } if not playerAddContainerItem(addContainerItemParams, item) then @@ -189,6 +247,7 @@ function questReward.onUse(player, item, fromPosition, itemEx, toPosition) end end end + return true end diff --git a/data-otservbr-global/scripts/game_migrations/20241715984294_quests_storages_to_kv.lua b/data-otservbr-global/scripts/game_migrations/20241715984294_quests_storages_to_kv.lua new file mode 100644 index 00000000000..a6c4dae0547 --- /dev/null +++ b/data-otservbr-global/scripts/game_migrations/20241715984294_quests_storages_to_kv.lua @@ -0,0 +1,81 @@ +local migrationStoragetokv = { + { storageOld = 10061, questName = "behemothquest1" }, -- Storage.Quest.U7_2.Behemoth.Bag + { storageOld = 10062, questName = "behemothquest2" }, -- Storage.Quest.U7_2.Behemoth.GuardianHalberd + { storageOld = 10063, questName = "behemothquest3" }, -- Storage.Quest.U7_2.Behemoth.DemonShield + { storageOld = 10064, questName = "behemothquest4" }, -- Storage.Quest.U7_2.Behemoth.GoldenArmor + { storageOld = 51763, questName = "doublet" }, -- Storage.QuestChests.DoubletQuest + { storageOld = 51764, questName = "honeyflower" }, -- Storage.QuestChests.HoneyFlower + { storageOld = 40125, questName = "ringquest1" }, -- Storage.Quest.U7_1.Ring.Rewards.TimeRing + { storageOld = 40126, questName = "ringquest2" }, -- Storage.Quest.U7_1.Ring.Rewards.SwordRing + { storageOld = 40111, questName = "AlawarsVault1" }, -- Storage.Quest.U6_5.AlawarsVault.Rewards.WhitePearl + { storageOld = 40112, questName = "AlawarsVault2" }, -- Storage.Quest.U6_5.AlawarsVault.Rewards.Broadsword + { storageOld = 40121, questName = "Blackknight1" }, -- Storage.Quest.U7_1.BlackKnight.Rewards.CrownArmor + { storageOld = 40122, questName = "Blackknight2" }, -- Storage.Quest.U7_1.BlackKnight.Rewards.CrownShield + { storageOld = 40127, questName = "timering1" }, -- Storage.Quest.U7_1.TimeRing.Rewards.CrystallBall + { storageOld = 40128, questName = "timering2" }, -- Storage.Quest.U7_1.TimeRing.Rewards.TimeRing + { storageOld = 40129, questName = "timering3" }, -- Storage.Quest.U7_1.TimeRing.Rewards.ElvenAmulet + { storageOld = 30005, questName = "platearmor" }, -- Storage.GhostShipQuest + { storageOld = 51744, questName = "silverbrooch" }, -- Storage.QuestChests.SilverBrooch + { storageOld = 51749, questName = "sixrubies" }, -- Storage.QuestChests.SixRubiesQuest + { storageOld = 20021, questName = "legiondawnport" }, -- Storage.Quest.U10_55.SanctuaryOfTheLizardGod.LegionHelmet + { storageOld = 30059, questName = "battleaxe" }, -- Storage.BattleAxeQuest + { storageOld = 30010, questName = "deeperfibula1" }, -- Storage.BloodHerbQuest + { storageOld = 40001, questName = "deeperfibula2" }, -- Storage.Quest.PreU6_0.DeeperFibula.Rewards.TowerShield + { storageOld = 40002, questName = "deeperfibula3" }, -- Storage.Quest.PreU6_0.DeeperFibula.Rewards.WarriorHelmet + { storageOld = 40003, questName = "deeperfibula4" }, -- Storage.Quest.PreU6_0.DeeperFibula.Rewards.DwarvenRing + { storageOld = 40004, questName = "deeperfibula5" }, -- Storage.Quest.PreU6_0.DeeperFibula.Rewards.ElvenAmulet + { storageOld = 40005, questName = "deeperfibula6" }, -- Storage.Quest.PreU6_0.DeeperFibula.Rewards.KnightAxe + { storageOld = 40008, questName = "shortswordbook" }, -- Storage.Quest.PreU6_0.ShortSword.Rewards.Book + { storageOld = 40009, questName = "lighthouse1" }, -- Storage.Quest.PreU6_0.ThaisLighthouse.Rewards.BattleHammer + { storageOld = 40010, questName = "lighthouse2" }, -- Storage.Quest.PreU6_0.ThaisLighthouse.Rewards.DarkShield + { storageOld = 40021, questName = "bananafree" }, -- Storage.Quest.U6_0.StuddedShield.Rewards.BananaFre + { storageOld = 40022, questName = "bananapremium" }, -- Storage.Quest.U6_0.StuddedShield.Rewards.BananaPremium + { storageOld = 40032, questName = "explorerbrooch" }, -- Storage.Quest.U6_1.ExplorerBrooch.Brooch + { storageOld = 40033, questName = "orcfortress1" }, -- Storage.Quest.U6_1.OrcFortress.Rewards.KnightAxe + { storageOld = 40034, questName = "orcfortress2" }, -- Storage.Quest.U6_1.ExplorerBrooch.KnightArmor + { storageOld = 40035, questName = "orcfortress3" }, -- Storage.Quest.U6_1.ExplorerBrooch.FireSword + { storageOld = 40051, questName = "draconia1" }, -- Storage.Quest.U6_2.Draconia.Rewards.BagWithWeapons + { storageOld = 40052, questName = "draconia2" }, -- Storage.Quest.U6_2.Draconia.Rewards.BagWithAmulets + { storageOld = 40071, questName = "adoreduh" }, -- Storage.Quest.U6_4.AdornedUHRune.Rewards.SilverRuneEmblem + { storageOld = 40072, questName = "barbarianaxe1" }, -- Storage.Quest.U6_4.BarbarianAxe.Rewards.BarbarianAxe + { storageOld = 40073, questName = "barbarianaxe2" }, -- Storage.Quest.U6_4.BarbarianAxe.Rewards.Scimitar + { storageOld = 40075, questName = "darkarmor" }, -- Storage.Quest.U6_4.DarkArmor.Rewards.Armor + { storageOld = 40079, questName = "doublehero1" }, -- Storage.Quest.U6_4.DoubleHero.Rewards.RedGem + { storageOld = 40080, questName = "doublehero2" }, -- Storage.Quest.U6_4.DoubleHero.Rewards.ClubRing + { storageOld = 40081, questName = "edrongoblin1" }, -- Storage.Quest.U6_4.EdronGoblin.Rewards.SilverAmulet + { storageOld = 40082, questName = "edrongoblin2" }, -- Storage.Quest.U6_4.EdronGoblin.Rewards.SteelShield + { storageOld = 40083, questName = "fireaxe1" }, -- Storage.Quest.U6_4.FireAxe.Rewards.Bag + { storageOld = 40084, questName = "fireaxe2" }, -- Storage.Quest.U6_4.FireAxe.Rewards.FireAxe + { storageOld = 40085, questName = "poisondaggers" }, -- Storage.Quest.U6_4.PoisonDaggers.Rewards.BackpackReward + { storageOld = 40086, questName = "shamantreasure" }, -- Storage.Quest.U6_4.ShamanTreasure.Rewards.BlankRunes + { storageOld = 40089, questName = "vampireshield1" }, -- Storage.Quest.U6_4.VampireShield.Rewards.StrangeSymbol + { storageOld = 40090, questName = "vampireshield2" }, -- Storage.Quest.U6_4.VampireShield.Rewards.DragonLance + { storageOld = 40091, questName = "vampireshield3" }, -- Storage.Quest.U6_4.VampireShield.Rewards.VampireShield + { storageOld = 40087, questName = "trollcave1" }, -- Storage.Quest.U6_4.TrollCave.Rewards.GarlicNecklace + { storageOld = 40088, questName = "trollcave2" }, -- Storage.Quest.U6_4.TrollCave.Rewards.BrassLegs + { storageOld = 40092, questName = "weddingring1" }, -- Storage.Quest.U6_4.WeddingRing.Rewards.DragonNecklace + { storageOld = 40093, questName = "weddingring2" }, -- Storage.Quest.U6_4.WeddingRing.Rewards.WeedingRing + { storageOld = 10097, questName = "madmageroom1" }, -- Storage.Quest.U7_24.MadMageRoom.StarAmulet + { storageOld = 10098, questName = "madmageroom2" }, -- Storage.Quest.U7_24.MadMageRoom.Hat + { storageOld = 10099, questName = "madmageroom3" }, -- Storage.Quest.U7_24.MadMageRoom.StoneSkinAmulet + { storageOld = 40007, questName = "ornamentedshield" }, -- Storage.Quest.PreU6_0.OrnamentedShield.Rewards.TimeRing + { storageOld = 40036, questName = "panpipe" }, -- Storage.Quest.U6_1.Panpipe.Rewards.Panpipe +} + +local function migrate(player) + for _, scrollTable in ipairs(migrationStoragetokv) do + local oldStorage = player:getStorageValue(scrollTable.storageOld) + if oldStorage > 0 then + player:questKV(scrollTable.questName):set("completed", true) + player:setStorageValue(scrollTable.storageOld, -1) + end + end +end + +local migration = Migration("20241715984294_quests_storages_to_kv") + +function migration:onExecute() + self:forEachPlayer(migrate) +end + +migration:register() diff --git a/data-otservbr-global/scripts/movements/quests/bright_sword/entrance.lua b/data-otservbr-global/scripts/movements/quests/bright_sword/entrance.lua deleted file mode 100644 index 85447176db6..00000000000 --- a/data-otservbr-global/scripts/movements/quests/bright_sword/entrance.lua +++ /dev/null @@ -1,15 +0,0 @@ -local brightSword = MoveEvent() - -function brightSword.onStepIn(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then - return true - end - - player:teleportTo(Position(32619, 32249, 8)) - return true -end - -brightSword:type("stepin") -brightSword:aid(5634) -brightSword:register() diff --git a/data-otservbr-global/scripts/movements/quests/devil_helmet/sewer.lua b/data-otservbr-global/scripts/movements/quests/devil_helmet/sewer.lua index 269edf74fd2..6226a5f27ae 100644 --- a/data-otservbr-global/scripts/movements/quests/devil_helmet/sewer.lua +++ b/data-otservbr-global/scripts/movements/quests/devil_helmet/sewer.lua @@ -19,7 +19,7 @@ function sewer.onStepIn(creature, item, position, fromPosition) end sewer:type("stepin") -sewer:uid(65203) +sewer:uid(25030) sewer:register() sewer = MoveEvent() @@ -41,5 +41,5 @@ function sewer.onStepOut(creature, item, position, fromPosition) end sewer:type("stepout") -sewer:uid(65203) +sewer:uid(25030) sewer:register() diff --git a/data-otservbr-global/scripts/movements/quests/inquisition/entrance.lua b/data-otservbr-global/scripts/movements/quests/inquisition/entrance.lua index 73b28dc0c57..0ddcff88508 100644 --- a/data-otservbr-global/scripts/movements/quests/inquisition/entrance.lua +++ b/data-otservbr-global/scripts/movements/quests/inquisition/entrance.lua @@ -17,8 +17,11 @@ local function hasTouchedOneThrone(player) return false end -local entrance = MoveEvent() +local config = { + { position = { x = 33192, y = 31691, z = 14 }, destination = { x = 33168, y = 31683, z = 15 } }, +} +local entrance = MoveEvent() function entrance.onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if not player then @@ -26,11 +29,16 @@ function entrance.onStepIn(creature, item, position, fromPosition) end if hasTouchedOneThrone(player) and player:getLevel() >= 100 and player:getStorageValue(Storage.TheInquisition.Questline) >= 20 then - local destination = Position(33168, 31683, 15) - player:teleportTo(destination) - position:sendMagicEffect(CONST_ME_TELEPORT) - destination:sendMagicEffect(CONST_ME_TELEPORT) - return true + for i = 1, #config do + local cfg = config[i] + if Position(cfg.position.x, cfg.position.y, cfg.position.z) == player:getPosition() then + local destination = Position(cfg.destination.x, cfg.destination.y, cfg.destination.z) + player:teleportTo(destination) + position:sendMagicEffect(CONST_ME_TELEPORT) + destination:sendMagicEffect(CONST_ME_TELEPORT) + return true + end + end end player:teleportTo(fromPosition, true) @@ -40,5 +48,8 @@ function entrance.onStepIn(creature, item, position, fromPosition) end entrance:type("stepin") -entrance:uid(9014) +for i = 1, #config do + entrance:position(Position(config[i].position.x, config[i].position.y, config[i].position.z)) +end + entrance:register() diff --git a/data-otservbr-global/scripts/movements/quests/the_outlaw_camp/entrance.lua b/data-otservbr-global/scripts/movements/quests/the_outlaw_camp/entrance.lua new file mode 100644 index 00000000000..4930ab8cd77 --- /dev/null +++ b/data-otservbr-global/scripts/movements/quests/the_outlaw_camp/entrance.lua @@ -0,0 +1,25 @@ +--outlaw camp quest (bright sword quest) +local config = { + { position = { x = 32619, y = 32248, z = 6 }, destination = { x = 32619, y = 32249, z = 8 } }, +} + +local brightSword = MoveEvent() +function brightSword.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return false + end + for value in pairs(config) do + if Position(config[value].position) == player:getPosition() then + player:teleportTo(Position(config[value].destination)) + return true + end + end +end + +brightSword:type("stepin") +for value in pairs(config) do + brightSword:position(config[value].position) +end + +brightSword:register() diff --git a/data-otservbr-global/scripts/quests/draconia/action-lever.lua b/data-otservbr-global/scripts/quests/draconia/action-lever.lua index 449eb683461..9165d071dbf 100644 --- a/data-otservbr-global/scripts/quests/draconia/action-lever.lua +++ b/data-otservbr-global/scripts/quests/draconia/action-lever.lua @@ -1,6 +1,23 @@ -local lever = Action() +local lever1 = Action() -function lever.onUse(player, item, fromPosition, target, toPosition, isHotkey) +function lever1.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local position = { x = 32792, y = 31581, z = 7 } + if item.itemid == 2772 then + Tile(position):getItemById(1282):remove() + item:transform(2773) + elseif item.itemid == 2773 then + Game.createItem(1282, 1, position) + item:transform(2772) + end + return true +end + +lever1:uid(30006) +lever1:register() + +local lever2 = Action() + +function lever2.onUse(player, item, fromPosition, target, toPosition, isHotkey) local position = { x = 32790, y = 31594, z = 7 } if item.itemid == 2772 then Tile(position):getItemById(1772):remove() @@ -12,5 +29,5 @@ function lever.onUse(player, item, fromPosition, target, toPosition, isHotkey) return true end -lever:uid(30006) -lever:register() +lever2:uid(30035) +lever2:register() diff --git a/data-otservbr-global/startup/tables/chest.lua b/data-otservbr-global/startup/tables/chest.lua index 228e9ba2976..47151e2befb 100644 --- a/data-otservbr-global/startup/tables/chest.lua +++ b/data-otservbr-global/startup/tables/chest.lua @@ -21,6 +21,16 @@ storage = xxxxx }, + Example using KV: + [xxxx] = { + useKV = true, + itemId = xxxx, + itemPos = {x = xxxxx, y = xxxxx, z = x}, + container = xxxx, (it's for use reward in a container, only put the id of the container here) + reward = {{xxxx, x}}, + questName = "testkv", + } + Note: The "for use of the map" variables are only used to create the action or unique on the map during startup If the reward is an key, do not need to use "keyAction", only set the storage as same action id @@ -58,6 +68,17 @@ ChestAction = { { x = 33053, y = 31020, z = 7 }, }, }, + -- Key 5010 (dead tree black knight quest) + [5002] = { + isKey = true, + itemId = 3634, + itemPos = { + { x = 32813, y = 31964, z = 7 }, + { x = 32800, y = 31959, z = 7 }, + }, + reward = { { 2969, 1 } }, + storage = Storage.Quest.Key.ID5010, + }, } ChestUnique = { @@ -169,6 +190,94 @@ ChestUnique = { timerStorage = Storage.TheSecretLibrary.FalconBastionChestsTimer.Key0909, time = 24, -- hour }, + -- Bear Room Quest (rookgaard) key 4601 + [5013] = { + isKey = true, + itemId = 2472, + itemPos = { x = 32150, y = 32112, z = 12 }, + reward = { { 2970, 1 } }, + storage = Storage.Quest.Key.ID4601, + }, + -- Katana Quest (rookgaard) key 4603 + [5014] = { + isKey = true, + itemId = 4240, + itemPos = { x = 32176, y = 32132, z = 9 }, + reward = { { 2969, 1 } }, + storage = Storage.Quest.Key.ID4603, + }, + -- Key 3600 + [5015] = { + isKey = true, + itemId = 4285, + itemPos = { x = 32509, y = 32181, z = 13 }, + reward = { { 2969, 1 } }, + storage = Storage.Quest.Key.ID3600, + }, + -- Key 3667 + [5016] = { + isKey = true, + itemId = 3204, + itemPos = { x = 32576, y = 32216, z = 15 }, + reward = { { 2969, 1 } }, + storage = Storage.Quest.Key.ID3667, + }, + -- Key 3610 + [5017] = { + isKey = true, + itemId = 387, + itemPos = { x = 32589, y = 32100, z = 14 }, + reward = { { 2969, 1 } }, + storage = Storage.Quest.Key.ID3610, + }, + -- Key 3520 + [5018] = { + isKey = true, + itemId = 2473, + itemPos = { x = 32376, y = 31802, z = 7 }, + reward = { { 2973, 1 } }, + storage = Storage.Quest.Key.ID3520, + }, + -- Key 3301 (outlaw camp key 1) + [5019] = { + isKey = true, + itemId = 3634, + itemPos = { x = 32617, y = 32250, z = 7 }, + reward = { { 2970, 1 } }, + storage = Storage.Quest.Key.ID3301, + }, + -- Key 3302 (outlaw camp key 2) + [5020] = { + isKey = true, + itemId = 3634, + itemPos = { x = 32609, y = 32244, z = 7 }, + reward = { { 2969, 1 } }, + storage = Storage.Quest.Key.ID3302, + }, + -- Key 3303 (outlaw camp key 3) + [5021] = { + isKey = true, + itemId = 3634, + itemPos = { x = 32651, y = 32244, z = 7 }, + reward = { { 2970, 1 } }, + storage = Storage.Quest.Key.ID3303, + }, + -- Key 3304 (outlaw camp key 4) + [5022] = { + isKey = true, + itemId = 2472, + itemPos = { x = 32623, y = 32187, z = 9 }, + reward = { { 2972, 1 } }, + storage = Storage.Quest.Key.ID3304, + }, + -- Key 3008 (Draconia Quest) + [5023] = { + isKey = true, + itemId = 2435, + itemPos = { x = 32800, y = 31582, z = 2 }, + reward = { { 2969, 1 } }, + storage = Storage.Quest.Key.ID3008, + }, -- To add a reward inside a bag, you need to add the variable "container = bagId" before "reward" -- Just duplicate the table and configure correctly, the scripts already register the entire table automatically -- Path: data\scripts\actions\system\quest_reward_common.lua @@ -206,10 +315,11 @@ ChestUnique = { -- Dawnport -- Legion helmet quest (dawnport) [6006] = { + useKV = true, itemId = 4240, itemPos = { x = 32143, y = 31910, z = 8 }, reward = { { 3374, 1 } }, - storage = Storage.Quest.U10_55.SanctuaryOfTheLizardGod.LegionHelmet, + questName = "legiondawnport", }, -- Dawnport quest -- Torn log book @@ -220,153 +330,163 @@ ChestUnique = { storage = Storage.Quest.U10_55.Dawnport.TornLogBook, }, -- Deeper fibula quest - -- Tower shield [6008] = { + useKV = true, itemId = 4024, itemPos = { x = 32239, y = 32471, z = 10 }, - reward = { { 3428, 1 } }, - storage = Storage.Quest.PreU6_0.DeeperFibula.Rewards.TowerShield, + reward = { { 3428, 1 } }, -- Tower shield + questName = "deeperfibula1", }, - -- Warrior helmet [6009] = { + useKV = true, itemId = 4024, itemPos = { x = 32239, y = 32478, z = 10 }, - reward = { { 3369, 1 } }, - storage = Storage.Quest.PreU6_0.DeeperFibula.Rewards.WarriorHelmet, + reward = { { 3369, 1 } }, -- Warrior helmet + questName = "deeperfibula2", }, - -- Dwarven ring [6010] = { + useKV = true, itemId = 4240, itemPos = { x = 32233, y = 32491, z = 10 }, - reward = { { 3097, 1 } }, - storage = Storage.Quest.PreU6_0.DeeperFibula.Rewards.DwarvenRing, + reward = { { 3097, 1 } }, -- Dwarven ring + questName = "deeperfibula3", }, - -- Elven aulet [6011] = { + useKV = true, itemId = 4025, itemPos = { x = 32245, y = 32492, z = 10 }, - reward = { { 3082, 1 } }, - storage = Storage.Quest.PreU6_0.DeeperFibula.Rewards.ElvenAmulet, + reward = { { 3082, 1 } }, -- Elven aulet + questName = "deeperfibula4", }, - -- Knight axe [6012] = { + useKV = true, itemId = 4240, itemPos = { x = 32256, y = 32500, z = 10 }, - reward = { { 3318, 1 } }, - storage = Storage.Quest.PreU6_0.DeeperFibula.Rewards.KnightAxe, + reward = { { 3318, 1 } }, -- Knight axe + questName = "deeperfibula5", }, -- Short sword quest -- Book [6013] = { + useKV = true, itemId = 2472, itemPos = { x = 32171, y = 32197, z = 7 }, reward = { { 2821, 1 } }, - storage = Storage.Quest.PreU6_0.ShortSword.Rewards.Book, + questName = "shortswordbook", }, -- Thais lighthouse quest -- Battle hammer [6014] = { + useKV = true, itemId = 2472, itemPos = { x = 32225, y = 32265, z = 10 }, reward = { { 3305, 1 } }, - storage = Storage.Quest.PreU6_0.ThaisLighthouse.Rewards.BattleHammer, + questName = "lighthouse1", }, -- Dark shield [6015] = { + useKV = true, itemId = 2472, itemPos = { x = 32226, y = 32265, z = 10 }, reward = { { 3421, 1 } }, - storage = Storage.Quest.PreU6_0.ThaisLighthouse.DarkShield, + questName = "lighthouse2", }, -- Studded shield quest (rookgaard) -- Banana free account area [6016] = { + useKV = true, itemId = 3639, itemPos = { x = 32172, y = 32169, z = 7 }, reward = { { 3587, 1 } }, - storage = Storage.Quest.U6_0.StuddedShield.Rewards.BananaFree, + questName = "bananafree", }, -- Banana premium account area [6017] = { + useKV = true, itemId = 3639, itemPos = { x = 31983, y = 32193, z = 5 }, reward = { { 3587, 1 } }, - storage = Storage.Quest.U6_0.StuddedShield.Rewards.BananaPremium, + questName = "bananapremium", }, -- Explorer brooch quest (kazordoon) [6019] = { + useKV = true, itemId = 4240, itemPos = { x = 32636, y = 31873, z = 10 }, reward = { { 4871, 1 } }, - storage = Storage.Quest.U6_1.ExplorerBrooch.Brooch, + questName = "explorerbrooch", }, -- Orc fortress quest - -- Knight axe [6020] = { + useKV = true, itemId = 2469, itemPos = { x = 32980, y = 31727, z = 9 }, - reward = { { 3318, 1 } }, - storage = Storage.Quest.U6_1.OrcFortress.Rewards.KnightAxe, + reward = { { 3318, 1 } }, -- Knight axe + questName = "orcfortress1", }, - -- Knight armor [6021] = { + useKV = true, itemId = 2469, itemPos = { x = 32981, y = 31727, z = 9 }, - reward = { { 3370, 1 } }, - storage = Storage.Quest.U6_1.OrcFortress.Rewards.KnightArmor, + reward = { { 3370, 1 } }, -- Knight armor + questName = "orcfortress2", }, - -- Fire sword [6022] = { + useKV = true, itemId = 2469, itemPos = { x = 32985, y = 31727, z = 9 }, - reward = { { 3280, 1 } }, - storage = Storage.Quest.U6_1.OrcFortress.Rewards.FireSword, + reward = { { 3280, 1 } }, -- Fire sword + questName = "orcfortress3", }, -- Draconia quest [6023] = { + useKV = true, itemId = 2472, itemPos = { x = 32803, y = 31582, z = 2 }, container = 2853, - reward = { { 3284, 1 }, { 3297, 1 } }, + reward = { { 3284, 1 }, { 3297, 1 } }, -- bag with weapons weight = 64, - storage = Storage.Quest.U6_2.Draconia.Rewards.BagWithWeapons, + questName = "draconia1", }, [6024] = { + useKV = true, itemId = 2472, itemPos = { x = 32804, y = 31582, z = 2 }, container = 2853, - reward = { { 3081, 5 }, { 3051, 1 } }, + reward = { { 3081, 5 }, { 3051, 1 } }, -- bag with amulets weight = 15.80, - storage = Storage.Quest.U6_2.Draconia.Rewards.BagWithAmulets, + questName = "draconia2", }, -- Adorned UH rune quest [6025] = { + useKV = true, itemId = 2469, itemPos = { x = 33136, y = 31601, z = 15 }, reward = { { 11603, 1 } }, - storage = Storage.Quest.U6_4.AdornedUHRune.Rewards.SilverRuneEmblem, + questName = "adoreduh", }, -- Barbarian axe quest - -- Barbarian axe [6026] = { + useKV = true, itemId = 2469, itemPos = { x = 33184, y = 31945, z = 11 }, - reward = { { 3317, 1 } }, - storage = Storage.Quest.U6_4.BarbarianAxe.Rewards.BarbarianAxe, + reward = { { 3317, 1 } }, -- Barbarian axe + questName = "barbarianaxe1", }, - -- Scimitar [6027] = { + useKV = true, itemId = 2469, itemPos = { x = 33185, y = 31945, z = 11 }, - reward = { { 3307, 1 } }, - storage = Storage.Quest.U6_4.BarbarianAxe.Rewards.Scimitar, + reward = { { 3307, 1 } }, -- Scimitar + questName = "barbarianaxe1", }, -- Dark armor quest [6028] = { + useKV = true, itemId = 4311, itemPos = { x = 33178, y = 31870, z = 12 }, reward = { { 3383, 1 } }, - storage = Storage.Quest.U6_4.DarkArmor.Rewards.Armor, + questName = "darkarmor", }, -- Demon helmet quest -- Steel boots @@ -391,176 +511,176 @@ ChestUnique = { storage = Storage.Quest.U6_4.DemonHelmet.Rewards.DemonShield, }, -- Double hero quest - -- Red gem [6032] = { + useKV = true, itemId = 2469, itemPos = { x = 33109, y = 31679, z = 13 }, - reward = { { 3039, 1 } }, - storage = Storage.Quest.U6_4.DoubleHero.Rewards.RedGem, + reward = { { 3039, 1 } }, -- Red gem + questName = "doublehero1", }, - -- Club ring [6033] = { + useKV = true, itemId = 2469, itemPos = { x = 33110, y = 31679, z = 13 }, - reward = { { 3093, 1 } }, - storage = Storage.Quest.U6_4.DoubleHero.Rewards.ClubRing, + reward = { { 3093, 1 } }, -- Club ring + questName = "doublehero2", }, -- Edron goblin quest - -- Silver amulet [6034] = { + useKV = true, itemId = 2469, itemPos = { x = 33095, y = 31800, z = 10 }, - reward = { { 3054, 200 } }, - storage = Storage.Quest.U6_4.EdronGoblin.Rewards.SilverAmulet, + reward = { { 3054, 200 } }, -- Silver amulet + questName = "edrongoblin1", }, - -- Steel shield [6035] = { + useKV = true, itemId = 2469, itemPos = { x = 33095, y = 31801, z = 10 }, - reward = { { 3409, 1 } }, - storage = Storage.Quest.U6_4.EdronGoblin.Rewards.SteelShield, + reward = { { 3409, 1 } }, -- Steel shield + questName = "edrongoblin2", }, -- Fire axe quest - -- Fire axe [6036] = { + useKV = true, itemId = 4024, itemPos = { x = 33084, y = 31650, z = 12 }, - reward = { { 3320, 1 } }, - storage = Storage.Quest.U6_4.FireAxe.Rewards.FireAxe, + reward = { { 3320, 1 } }, -- Fire axe + questName = "fireaxe2", }, - -- Ring quest - -- Time ring + -- Ring Quest [6037] = { + useKV = true, itemId = 2469, itemPos = { x = 33131, y = 31624, z = 15 }, - reward = { { 3053, 1 } }, - storage = Storage.Quest.U7_1.Ring.Rewards.TimeRing, + reward = { { 3053, 1 } }, -- Time ring + questName = "ringquest1", }, - -- Sword ring [6038] = { + useKV = true, itemId = 2469, itemPos = { x = 33134, y = 31624, z = 15 }, - reward = { { 3091, 1 } }, - storage = Storage.Quest.U7_1.Ring.Rewards.SwordRing, + reward = { { 3091, 1 } }, -- Sword ring + questName = "ringquest2", }, -- Troll cave quest - -- Garlic necklace [6039] = { + useKV = true, itemId = 2473, itemPos = { x = 33143, y = 31719, z = 10 }, - reward = { { 3083, 150 } }, - storage = Storage.Quest.U6_4.TrollCave.Rewards.GarlicNecklace, + reward = { { 3083, 150 } }, -- Garlic necklace + questName = "trollcave1", }, - -- Brass legs [6040] = { + useKV = true, itemId = 2473, itemPos = { x = 33143, y = 31721, z = 10 }, - reward = { { 3372, 1 } }, - storage = Storage.Quest.U6_4.TrollCave.Rewards.BrassLegs, + reward = { { 3372, 1 } }, -- Brass legs + questName = "trollcave1", }, -- Vampire shield quest - -- Dragon lance [6041] = { + useKV = true, itemId = 2469, itemPos = { x = 33189, y = 31688, z = 14 }, - reward = { { 3302, 1 } }, - storage = Storage.Quest.U6_4.VampireShield.Rewards.DragonLance, + reward = { { 3302, 1 } }, -- Dragon lance + questName = "vampireshield2", }, - -- Vampire shield [6042] = { + useKV = true, itemId = 2469, itemPos = { x = 33195, y = 31688, z = 14 }, - reward = { { 3434, 1 } }, - storage = Storage.Quest.U6_4.VampireShield.Rewards.VampireShield, + reward = { { 3434, 1 } }, -- Vampire shield + questName = "vampireshield3", }, - -- Weeding ring quest - -- Dragon necklace + -- Wedding Ring Quest [6043] = { + useKV = true, itemId = 2469, itemPos = { x = 33158, y = 31621, z = 15 }, - reward = { { 3085, 200 } }, - storage = Storage.Quest.U6_4.WeddingRing.Rewards.DragonNecklace, + reward = { { 3085, 200 } }, -- Dragon necklace + questName = "weddingring1", }, - -- Weeding ring [6044] = { + useKV = true, itemId = 2469, itemPos = { x = 33158, y = 31622, z = 15 }, - reward = { { 3004, 1 } }, - storage = Storage.Quest.U6_4.WeddingRing.Rewards.WeedingRing, + reward = { { 3004, 1 } }, -- Weeding ring + questName = "weddingring2", }, -- Alawars vault quest - -- White pearl [6045] = { + useKV = true, itemId = 2472, itemPos = { x = 32105, y = 31567, z = 9 }, - reward = { { 3026, 3 } }, - storage = Storage.Quest.U6_5.AlawarsVault.Rewards.WhitePearl, + reward = { { 3026, 3 } }, -- White pearl + questName = "AlawarsVault1", }, - -- Broadsword [6046] = { + useKV = true, itemId = 2472, itemPos = { x = 32109, y = 31567, z = 9 }, - reward = { { 3301, 1 } }, - storage = Storage.Quest.U6_5.AlawarsVault.Rewards.Broadsword, + reward = { { 3301, 1 } }, -- Broadsword + questName = "AlawarsVault2", }, -- Black knight quest - -- Crown armor [6047] = { + useKV = true, itemId = 3634, itemPos = { x = 32868, y = 31955, z = 11 }, - reward = { { 3381, 1 } }, - storage = Storage.Quest.U7_1.BlackKnight.Rewards.CrownArmor, + reward = { { 3381, 1 } }, -- Crown armor + questName = "Blackknight1", }, - -- Crown shield [6048] = { + useKV = true, itemId = 3634, itemPos = { x = 32880, y = 31955, z = 11 }, - reward = { { 3419, 1 } }, - storage = Storage.Quest.U7_1.BlackKnight.Rewards.CrownShield, + reward = { { 3419, 1 } }, -- Crown shield + questName = "Blackknight2", }, - -- TIme ring quest - -- Crystal ball + -- Time Ring Quest [6049] = { + useKV = true, itemId = 2472, itemPos = { x = 33038, y = 32171, z = 9 }, - reward = { { 3076, 1 } }, - storage = Storage.Quest.U7_1.TimeRing.Rewards.CrystallBall, + reward = { { 3076, 1 } }, -- Crystal ball + questName = "timering1", }, - -- Time ring [6050] = { + useKV = true, itemId = 2472, itemPos = { x = 33039, y = 32171, z = 9 }, - reward = { { 3053, 1 } }, - storage = Storage.Quest.U7_1.TimeRing.Rewards.TimeRing, + reward = { { 3053, 1 } }, -- Time ring + questName = "timering2", }, - -- Elven amulet [6051] = { + useKV = true, itemId = 2472, itemPos = { x = 33040, y = 32171, z = 9 }, - reward = { { 3082, 1 } }, - storage = Storage.Quest.U7_1.TimeRing.Rewards.ElvenAmulet, + reward = { { 3082, 50 } }, -- Elven amulet + questName = "timering3", }, -- Behemoth quest - -- Guardian halberd [6052] = { + useKV = true, itemId = 2472, itemPos = { x = 33295, y = 31658, z = 13 }, - reward = { { 3315, 1 } }, - storage = Storage.Quest.U7_2.Behemoth.GuardianHalberd, + reward = { { 3315, 1 } }, -- Guardian halberd + questName = "behemothquest2", }, - -- Demon shield [6053] = { + useKV = true, itemId = 2472, itemPos = { x = 33297, y = 31658, z = 13 }, - reward = { { 3420, 1 } }, - storage = Storage.Quest.U7_2.Behemoth.DemonShield, + reward = { { 3420, 1 } }, -- Demon shield + questName = "behemothquest3", }, - -- Golden armor [6054] = { + useKV = true, itemId = 2472, itemPos = { x = 33298, y = 31658, z = 13 }, - reward = { { 3360, 1 } }, - storage = Storage.Quest.U7_2.Behemoth.GoldenArmor, + reward = { { 3360, 1 } }, -- Golden armor + questName = "behemothquest4", }, -- Family brooch quest [6055] = { @@ -623,21 +743,23 @@ ChestUnique = { storage = Storage.Quest.PreU6_0.OrnamentedShield.Rewards.OrnamentedShield, }, [6063] = { + useKV = true, itemId = 2480, itemPos = { x = 32769, y = 32302, z = 10 }, container = 2859, reward = { { 2949, 1 }, { 3059, 1 }, { 3083, 1 }, { 3035, 5 }, { 3053, 1 } }, weight = 44, - storage = Storage.Quest.PreU6_0.OrnamentedShield.Rewards.TimeRing, + questName = "ornamentedshield", }, --[6064] EMPTY [6065] = { + useKV = true, itemId = 2472, itemPos = { x = 32644, y = 32131, z = 8 }, container = 2853, reward = { { 3033, 2 }, { 3050, 1 }, { 2953, 1 } }, weight = 44, - storage = Storage.Quest.U6_1.Panpipe.Rewards.Panpipe, + questName = "panpipe", }, [6066] = { itemId = 2469, @@ -648,34 +770,34 @@ ChestUnique = { storage = Storage.Quest.U6_4.BerserkerTreasure.Rewards.WhitePearls, }, -- Fire axe quest - -- Bag [6067] = { + useKV = true, itemId = 2472, itemPos = { x = 33078, y = 31656, z = 11 }, container = 2853, - reward = { { 3098, 1 }, { 3085, 200 }, { 3028, 7 }, { 3320, 1 } }, + reward = { { 3098, 1 }, { 3085, 200 }, { 3028, 7 }, { 3320, 1 } }, -- Bag (Ring of Healing, Dragon Necklace, 7 Small Diamonds) weight = 27, - storage = Storage.Quest.U6_4.FireAxe.Rewards.Bag, + questName = "fireaxe1", }, -- Poison daggers quest - -- Backpack reward [6068] = { + useKV = true, itemId = 2473, itemPos = { x = 33155, y = 31880, z = 11 }, container = 2854, - reward = { { 3448, 30 }, { 3299, 1 }, { 3299, 1 } }, + reward = { { 3448, 30 }, { 3299, 1 }, { 3299, 1 } }, -- Backpack (2 Poison Daggers, 30 Poison Arrows) weight = 60, - storage = Storage.Quest.U6_4.PoisonDaggers.Rewards.BackpackReward, + questName = "poisondaggers", }, -- Shaman treasure quest - -- Bag with 3 blank runes [6069] = { + useKV = true, itemId = 4024, itemPos = { x = 33127, y = 31885, z = 9 }, container = 2853, - reward = { { 3147, 3 } }, + reward = { { 3147, 3 } }, -- Bag with 3 blank runes weight = 15, - storage = Storage.Quest.U6_4.ShamanTreasure.Rewards.BlankRunes, + questName = "shamantreasure", }, -- Strong potions quest -- Green bag with 5 strong mana potions @@ -688,17 +810,16 @@ ChestUnique = { storage = Storage.Quest.U8_1.StrongPotions.Reward, }, -- Vampire shield quest - -- Bag [6071] = { + useKV = true, itemId = 2469, itemPos = { x = 33188, y = 31682, z = 14 }, container = 2853, - reward = { { 3058, 1 }, { 3027, 1 }, { 3078, 1 } }, + reward = { { 3058, 1 }, { 3027, 1 }, { 3078, 1 } }, -- Bag (Strange Symbol, Black Pearl and Mysterious Fetish) weight = 16, - storage = Storage.Quest.U6_4.VampireShield.Rewards.StrangeSymbol, + questName = "vampireshield1", }, -- [6072] empty - -- Dragon tower quest -- Backpack 1 [6073] = { @@ -721,12 +842,13 @@ ChestUnique = { -- Behemoth quest -- Bag [6075] = { + useKV = true, itemId = 2472, itemPos = { x = 33294, y = 31658, z = 13 }, container = 2853, reward = { { 3028, 3 }, { 3029, 4 }, { 3007, 1 }, { 3052, 1 }, { 3055, 1 } }, weight = 50, - storage = Storage.Quest.U7_2.Behemoth.Bag, + questName = "behemothquest1", }, -- Parchment room quest -- Bag @@ -762,26 +884,26 @@ ChestUnique = { storage = Storage.Quest.U7_24.GiantSmithhammer.GoldCoin, }, -- Mad Mage room quest - -- Star amulet [6080] = { + useKV = true, itemId = 2472, itemPos = { x = 32578, y = 32195, z = 14 }, - reward = { { 3014, 1 } }, - storage = Storage.Quest.U7_24.MadMageRoom.StarAmulet, + reward = { { 3014, 1 } }, -- Star amulet + questName = "madmageroom1", }, - -- Hat of the mad [6081] = { + useKV = true, itemId = 2472, itemPos = { x = 32575, y = 32195, z = 14 }, - reward = { { 3210, 1 } }, - storage = Storage.Quest.U7_24.MadMageRoom.Hat, + reward = { { 3210, 1 } }, -- Hat of the mad + questName = "madmageroom2", }, - -- Stone skin amulet [6082] = { + useKV = true, itemId = 2472, itemPos = { x = 32572, y = 32195, z = 14 }, - reward = { { 3081, 5 } }, - storage = Storage.Quest.U7_24.MadMageRoom.StoneSkinAmulet, + reward = { { 3081, 5 } }, -- Stone skin amulet + questName = "madmageroom3", }, -- Skull of ratha quest -- Bag (white pearl, skull) @@ -998,6 +1120,620 @@ ChestUnique = { timerStorage = Storage.Quest.U11_80.TheSecretLibrary.FalconBastionChestsTimer.UndergroundBastion, time = 24, -- hour }, + -- Blood Herb Quest + [6111] = { + useKV = true, + itemId = 3634, + itemPos = { x = 32769, y = 31968, z = 7 }, + reward = { { 3734, 1 } }, + questName = "bloodherb", + }, + -- Power Bolts Quest (book) + [6112] = { + useKV = true, + itemId = 4240, + itemPos = { x = 32814, y = 32281, z = 8 }, + reward = { { 2821, 1 } }, + questName = "powerbolt2", + }, + -- Present Quest (rookgaard) + [6113] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32149, y = 32105, z = 11 }, + container = 2854, -- backpack + reward = { { 2882, 1 }, { 2856, 1 }, { 2881, 1 }, { 2905, 1 } }, -- Jug, Present Box, Cup and Plate + questName = "presentBox", + }, + -- Bear Room quest + [6114] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32146, y = 32097, z = 11 }, + container = 2853, -- bag + reward = { { 3447, 12 }, { 3031, 40 } }, -- bag: 12 arrows, 40 gold coin + questName = "bearChest1", + }, + [6115] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32144, y = 32096, z = 11 }, + reward = { { 3354, 1 } }, -- Brass Helmet + questName = "bearChest2", + }, + [6116] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32141, y = 32097, z = 11 }, + reward = { { 3358, 1 } }, -- Chain Armor + questName = "bearChest3", + }, + -- Captain Iglues Treasure Quest + [6117] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32039, y = 32121, z = 13 }, + reward = { { 3579, 1 } }, -- 2x Salmon + questName = "captainIglues", + }, + -- Combat Knife Quest + [6117] = { + useKV = true, + itemId = 2473, + itemPos = { x = 32102, y = 32235, z = 8 }, + reward = { { 3292, 1 } }, -- Combat Knife + questName = "combatknife", + }, + -- Goblin Temple Quest + [6118] = { + useKV = true, + itemId = 2472, + itemPos = { x = 31973, y = 32209, z = 12 }, + container = 2853, -- bag + reward = { { 3551, 1 }, { 1781, 5 }, { 3031, 50 } }, -- sandals, 5 small stones, 50 gold coins + questName = "goblintemple", + }, + [6119] = { + useKV = true, + itemId = 2472, + itemPos = { x = 31977, y = 32209, z = 12 }, + container = 2853, -- bag + reward = { { 3466, 1 }, { 2992, 4 }, { 2874, 1 } }, -- pan, 4 snowballs, vial of milk + questName = "goblintemple2", + }, + -- Minotaur Hell Quest + [6120] = { + useKV = true, + itemId = 2473, + itemPos = { x = 32130, y = 32066, z = 12 }, + reward = { { 3483, 1 } }, -- fishing rod + questName = "minohell1", + }, + [6121] = { + useKV = true, + itemId = 2473, + itemPos = { x = 32127, y = 32065, z = 12 }, + container = 2853, -- bag + reward = { { 3447, 10 }, { 3448, 4 } }, -- 10 arrows, 4 poison arrow + questName = "minohell2", + }, + [6121] = { + useKV = true, + itemId = 2473, + itemPos = { x = 32124, y = 32064, z = 12 }, + reward = { { 3283, 1 } }, -- carlin sword + questName = "minohell3", + }, + -- Circle Room Quest + [6122] = { + useKV = true, + itemId = 2469, + itemPos = { x = 32495, y = 31992, z = 14 }, + reward = { { 3279, 1 } }, -- war hammer + questName = "circleroom1", + }, + [6123] = { + useKV = true, + itemId = 2469, + itemPos = { x = 32497, y = 31992, z = 14 }, + reward = { { 3323, 1 } }, -- dwarven axe + questName = "circleroom2", + }, + -- Crystal Wand Quest + [6124] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32479, y = 31611, z = 15 }, + reward = { { 3068, 1 } }, -- crystal wand + questName = "crystalwand1", + }, + [6125] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32481, y = 31611, z = 15 }, + reward = { { 11609, 1 } }, -- crystal wand + questName = "crystalwand2", + }, + -- Demona Ring Quest + [6126] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32504, y = 31596, z = 14 }, + reward = { { 3049, 1 } }, -- steath ring + questName = "demonaring1", + }, + [6127] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32515, y = 31596, z = 14 }, + reward = { { 3051, 1 } }, -- energy ring + questName = "demonaring2", + }, + -- Purple Tome Quest + [6128] = { + useKV = true, + itemId = 2436, + itemPos = { x = 32424, y = 31591, z = 15 }, + reward = { { 2822, 1 } }, -- map + questName = "purpletome1", + }, + [6129] = { + useKV = true, + itemId = 2436, + itemPos = { x = 32427, y = 31591, z = 15 }, + reward = { { 2823, 1 } }, -- map + questName = "purpletome2", + }, + [6130] = { + useKV = true, + itemId = 2438, + itemPos = { x = 32421, y = 31594, z = 15 }, + reward = { { 2848, 1 } }, -- purple tome + questName = "purpletome3", + }, + -- Life Ring Quest + [6131] = { + useKV = true, + itemId = 2469, + itemPos = { x = 32443, y = 32238, z = 11 }, + container = 2853, -- bag + reward = { { 3052, 1 }, { 3085, 200 } }, -- life ring , dragon necklace + questName = "lifering", + }, + -- Noble Armor Quest + [6132] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32451, y = 32048, z = 8 }, + reward = { { 3380, 1 } }, -- noble armor + questName = "noblearmor1", + }, + [6133] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32455, y = 32048, z = 8 }, + reward = { { 3385, 1 } }, -- crown helmet + questName = "noblearmor2", + }, + -- Geomancer Quest + [6134] = { + useKV = true, + itemId = 2469, + itemPos = { x = 32456, y = 32008, z = 13 }, + container = 2853, -- bag + reward = { { 3029, 1 }, { 3028, 1 }, { 3097, 1 } }, -- small sapphire, small diamond, dwarven ring + questName = "geomancer", + }, + -- Naginata Quest + [6135] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32346, y = 32063, z = 12 }, + reward = { { 3314, 1 } }, -- naginata + questName = "naginata", + }, + -- Ghoul Room Quest + [6136] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32500, y = 32175, z = 14 }, + reward = { { 3083, 150 } }, -- garlic necklac + questName = "ghoulroom1", + }, + -- Mintwallin Cyclops Quest + [6137] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32500, y = 32177, z = 14 }, + reward = { { 3093, 1 } }, -- club ring + questName = "ghoulroom2", + }, + [6138] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32591, y = 32097, z = 14 }, + reward = { { 3028, 1 } }, -- small diamond + questName = "mintwallincyclops", + }, + -- Devil helmet Quest + [6139] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32459, y = 32144, z = 15 }, + reward = { { 3029, 4 } }, -- small sapphire + questName = "devilhemet1", + }, + [6140] = { + useKV = true, + itemId = 2480, + itemPos = { x = 32465, y = 32148, z = 15 }, + reward = { { 3356, 1 } }, -- devil helmet + questName = "devilhemet2", + }, + [6141] = { + useKV = true, + itemId = 2480, + itemPos = { x = 32466, y = 32148, z = 15 }, + reward = { { 3269, 1 } }, -- halberd + questName = "devilhemet3", + }, + -- Fanfare Quest + [6142] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32390, y = 31769, z = 9 }, + reward = { { 2955, 1 } }, -- fanfare + questName = "fanfare", + }, + -- Heaven Blossom Quest + [6143] = { + useKV = true, + itemId = 2523, + itemPos = { x = 33104, y = 32154, z = 8 }, + reward = { { 5921, 1 } }, -- heaven blossom + questName = "heavenblossom", + }, + -- Iron Ore Quest + [6144] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32532, y = 31873, z = 8 }, + reward = { { 5880, 1 } }, -- iron ore + questName = "ironore", + }, + -- Isle of the Mists Quest + [6145] = { + useKV = true, + itemId = 2469, + itemPos = { x = 32852, y = 32332, z = 7 }, + reward = { { 3032, 1 } }, -- small emerald + questName = "isleofthemists", + }, + -- Longsword Quest + [6146] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32649, y = 31969, z = 9 }, + reward = { { 3285, 1 } }, -- longsword + questName = "longsword1", + }, + [6147] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32650, y = 31969, z = 9 }, + reward = { { 3004, 1 } }, -- weeding ring + questName = "longsword2", + }, + [6148] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32651, y = 31969, z = 9 }, + container = 2853, -- bag + reward = { { 3147, 3 }, { 2989, 1 }, { 3031, 76 }, { 3463, 1 } }, -- 3 blank rune, wooden doll, 76 gold coin, mirror + questName = "longsword3", + }, + -- Minotaur Leather Quest + [6149] = { + useKV = true, + itemId = 2469, + itemPos = { x = 32302, y = 32415, z = 7 }, + reward = { { 5878, 1 } }, -- minotaur leather + questName = "minotaurleatherquest", + }, + -- Orc Shaman Quest + [6150] = { + useKV = true, + itemId = 2469, + itemPos = { x = 33089, y = 32030, z = 9 }, + container = 2853, -- bag + reward = { { 3046, 1 }, { 3092, 1 }, { 3147, 1 } }, -- magic light wand, axe ring, blank rune + questName = "orcshaman", + }, + -- Power Ring Quest + [6151] = { + useKV = true, + itemId = 2473, + itemPos = { x = 32599, y = 31776, z = 9 }, + reward = { { 3031, 1 } }, -- power ring + questName = "powerring1", + }, + [6152] = { + useKV = true, + itemId = 2473, + itemPos = { x = 32601, y = 31776, z = 9 }, + reward = { { 3056, 200 } }, -- bronze amulet + questName = "powerring2", + }, + -- Scale Armor Quest + [6153] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32357, y = 32130, z = 9 }, + container = 2853, -- bag + reward = { { 3377, 1 } }, -- scale armor + questName = "scalearmor", + }, + -- Silver Amulet Quest + [6154] = { + useKV = true, + itemId = 2469, + itemPos = { x = 32506, y = 32269, z = 9 }, + reward = { { 3054, 200 } }, -- silver amulet + questName = "silveramulet", + }, + -- Silver Brooch Quest + [6155] = { + useKV = true, + itemId = 2476, + itemPos = { x = 32775, y = 32006, z = 11 }, + container = 2853, -- bag + reward = { { 3017, 1 }, { 3030, 2 }, { 3028, 3 } }, -- Silver Brooch, 2 Small Rubies, 3 Small Diamonds + questName = "silverbrooch", + }, + -- Six Rubies Quest + [6156] = { + useKV = true, + itemId = 387, + itemPos = { x = 32371, y = 32262, z = 12 }, + reward = { { 3030, 6 } }, -- 6 small rubies + questName = "sixrubies", + }, + -- Desert Quest + [6157] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32668, y = 32069, z = 8 }, + reward = { { 3035, 100 } }, -- 100 platinum coins + questName = "desert1", + }, + [6158] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32675, y = 32069, z = 8 }, + container = 2857, -- green bag + reward = { { 3084, 250 }, { 3098, 1 }, { 3046, 1 }, { 3077, 1 } }, -- protection amulet, ring of healing, magic light wand and anhk + questName = "desert2", + }, + -- Throwing Star Quest + [6159] = { + useKV = true, + itemId = 2473, + itemPos = { x = 32522, y = 32111, z = 15 }, + reward = { { 3287, 10 } }, -- throwing star + questName = "throwingstar", + }, + -- Triangle Tower Quest + [6160] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32565, y = 32119, z = 3 }, + container = 2853, -- bag + reward = { { 3083, 150 }, { 3029, 2 }, { 3097, 1 } }, -- garlick necklace, small sapphire, dwarven ring + questName = "triangletower", + }, + -- Dragon Corpse Quest + [6161] = { + useKV = true, + itemId = 4025, + itemPos = { x = 32179, y = 32224, z = 9 }, + container = 2853, -- bag + reward = { { 3374, 1 }, { 3430, 1 } }, -- Copper Shield and Legion Helmet + questName = "dragoncorpse", + }, + -- Katana Quest (rookgaard) + [6162] = { + useKV = true, + itemId = 4240, + itemPos = { x = 32175, y = 32145, z = 11 }, + reward = { { 3367, 1 } }, -- katana + questName = "katanacorpse1", + }, + [6163] = { + useKV = true, + itemId = 4240, + itemPos = { x = 32174, y = 32149, z = 11 }, + reward = { { 3300, 1 } }, -- katana + questName = "katanacorpse2", + }, + -- Crusader Helmet Quest + [6164] = { + useKV = true, + itemId = 3990, + itemPos = { x = 32427, y = 31943, z = 14 }, + reward = { { 3391, 1 } }, -- crusader helmet + questName = "crusaderhelmet", + }, + [6165] = { + useKV = true, + itemId = 4240, + itemPos = { x = 32498, y = 31721, z = 15 }, + reward = { { 3433, 1 } }, -- griffing shield (Griffin Shield Quest) + questName = "griffinshield1", + }, + [6166] = { + useKV = true, + itemId = 4024, + itemPos = { x = 32500, y = 31721, z = 15 }, + reward = { { 3313, 1 } }, -- obsidian lance (Griffin Shield Quest) + questName = "griffinshield2", + }, + [6167] = { + useKV = true, + itemId = 4024, + itemPos = { x = 32503, y = 31724, z = 15 }, + reward = { { 3323, 1 } }, -- dwarven axe (Griffin Shield Quest) + questName = "griffinshield3", + }, + -- Iron Helmet Quest + [6168] = { + useKV = true, + itemId = 4240, + itemPos = { x = 32769, y = 32225, z = 7 }, + container = 2854, + reward = { { 3123, 1 }, { 3155, 3 }, { 3361, 1 }, { 3353, 1 }, { 3285, 1 }, { 3506, 1 } }, -- worn leather boots, sudden death rune, leather armor, iron helmet, longsword, stamped letter + questName = "ironhelmet", + }, + -- Dead Archer Quest + [6169] = { + useKV = true, + itemId = 4240, + itemPos = { x = 32514, y = 32303, z = 10 }, + container = 2853, + reward = { { 3350, 1 }, { 3448, 5 }, { 268, 1 }, { 266, 1 } }, -- bow, 5 poison arrows, mana potion, health potion + questName = "deadarcher", + }, + -- Power Bolt Quest + [6170] = { + useKV = true, + itemId = 4240, + itemPos = { x = 32816, y = 32279, z = 8 }, + container = 2853, + reward = { { 3450, 5 }, { 3449, 12 } }, -- 5 power bolt, 12 burst arrow + questName = "powerbolt1", + }, + -- Spike Sword Quest + [6171] = { + useKV = true, + itemId = 3990, + itemPos = { x = 32568, y = 32085, z = 12 }, + reward = { { 3271, 1 } }, -- 5 power bolt, 12 burst arrow + questName = "spikesword", + }, + -- Elvenbane Quest + [6172] = { + useKV = true, + itemId = 2434, + itemPos = { x = 32588, y = 31644, z = 3 }, + container = 2853, + reward = { { 3031, 100 }, { 3028, 2 } }, -- 100 gold coin, 2 small diamond + questName = "elvebanequest1", + }, + [6173] = { + useKV = true, + itemId = 2434, + itemPos = { x = 32588, y = 31645, z = 3 }, + container = 2853, + reward = { { 3059, 1 }, { 3147, 1 }, { 237, 1 } }, -- spellbook, blank rune, strong mana potion + questName = "elvebanequest2", + }, + [6174] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32590, y = 31647, z = 3 }, + reward = { { 3282, 1 } }, -- + questName = "elvebanequest3", + }, + [6175] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32591, y = 31647, z = 3 }, + reward = { { 3425, 1 } }, -- + questName = "elvebanequest4", + }, + -- Iron Hammer Quest + [6176] = { + useKV = true, + itemId = 2473, + itemPos = { x = 32434, y = 31938, z = 8 }, + reward = { { 3310, 1 } }, -- iron hammer + questName = "ironhamer", + }, + -- Plate Armor quest + [6177] = { + useKV = true, + itemId = 2474, + itemPos = { x = 33327, y = 32182, z = 7 }, + reward = { { 3357, 1 } }, -- plate armor + questName = "platearmor", + }, + -- Stealth Ring Quest + [6178] = { + useKV = true, + itemId = 1983, + itemPos = { x = 33315, y = 32277, z = 11 }, + reward = { { 3084, 250 } }, -- protection amulet + questName = "stealhring1", + }, + [6179] = { + useKV = true, + itemId = 1983, + itemPos = { x = 33315, y = 32282, z = 11 }, + reward = { { 3049, 1 } }, -- stealth ring + questName = "stealhring2", + }, + -- Steel Helmet Quest + [6180] = { + useKV = true, + itemId = 2434, + itemPos = { x = 32460, y = 31951, z = 5 }, + reward = { { 3031, 56 } }, -- 56 gold coin + questName = "steelhelmet1", + }, + [6181] = { + useKV = true, + itemId = 2469, + itemPos = { x = 32464, y = 31957, z = 5 }, + reward = { { 3031, 47 } }, -- 47 gold coin + questName = "steelhelmet2", + }, + [6182] = { + useKV = true, + itemId = 2473, + itemPos = { x = 32462, y = 31947, z = 4 }, + reward = { { 3351, 1 } }, -- steel helmet + questName = "steelhelmet3", + }, + [6183] = { + useKV = true, + itemId = 2472, + itemPos = { x = 32467, y = 31962, z = 4 }, + reward = { { 2815, 1 } }, -- scroll + questName = "steelhelmet4", + }, + -- Battle Axe Quest + [6184] = { + useKV = true, + itemId = 4285, + itemPos = { x = 32305, y = 32254, z = 9 }, + reward = { { 3266, 1 } }, -- battle axe + questName = "battleaxe", + }, + -- Doublet Quest + [6185] = { + useKV = true, + itemId = 408, + itemPos = { x = 32084, y = 32181, z = 8 }, + reward = { { 3379, 1 } }, -- doublet + questName = "doublet", + }, + -- Honey Flower Quest + [6186] = { + useKV = true, + itemId = 9226, + itemPos = { x = 32005, y = 32139, z = 3 }, + reward = { { 2984, 1 } }, -- honey + questName = "honeyflower", + }, -- Reward of others scrips files (varied rewards) -- The First dragon Quest -- Treasure chests (data\scripts\actions\quests\first_dragon\treasure_chests.lua) @@ -1190,4 +1926,9 @@ ChestUnique = { itemId = 2473, itemPos = { x = 32099, y = 32198, z = 9 }, }, + -- The Outlaw Camp Quest (Bright Sword Quest) + [14091] = { + itemId = 2472, + itemPos = { x = 32620, y = 32198, z = 10 }, + }, } diff --git a/data-otservbr-global/startup/tables/corpse.lua b/data-otservbr-global/startup/tables/corpse.lua index 70594adcaa4..a6ca06f7375 100644 --- a/data-otservbr-global/startup/tables/corpse.lua +++ b/data-otservbr-global/startup/tables/corpse.lua @@ -34,8 +34,4 @@ CorpseUnique = { itemId = 4285, itemPos = { x = 32211, y = 31273, z = 10 }, }, - [20004] = { - itemId = 4285, - itemPos = { x = 32305, y = 32254, z = 9 }, - }, } diff --git a/data-otservbr-global/startup/tables/door_key.lua b/data-otservbr-global/startup/tables/door_key.lua index f8c38941e42..63a52a6a6ad 100644 --- a/data-otservbr-global/startup/tables/door_key.lua +++ b/data-otservbr-global/startup/tables/door_key.lua @@ -53,6 +53,14 @@ KeyDoorAction = { { x = 32676, y = 31671, z = 10 }, }, }, + -- Door of the key 3610 (devil helmet quest) + [Storage.Quest.Key.ID3610] = { + itemId = false, + itemPos = { + { x = 32462, y = 32153, z = 14 }, + { x = 32462, y = 32151, z = 15 }, + }, + }, -- Door of the key 1864 (mad mage room quest) [Storage.Quest.Key.ID3620] = { itemId = false, @@ -68,6 +76,20 @@ KeyDoorAction = { itemId = 1631, itemPos = { { x = 32578, y = 32197, z = 15 } }, }, + -- Door of the key 3667 (mintwallin cyclops quest) + [Storage.Quest.Key.ID3667] = { + itemId = 5106, + itemPos = { { x = 32592, y = 32102, z = 14 } }, + }, + -- Door of the key 3520 (carlin cemetery) + [Storage.Quest.Key.ID3520] = { + itemId = false, + itemPos = { + { x = 32400, y = 31788, z = 8 }, + { x = 32400, y = 31789, z = 8 }, + { x = 32398, y = 31804, z = 8 }, + }, + }, -- Door of the key 2297 (emperor's cookies quest) [Storage.Quest.Key.ID3800] = { itemId = false, @@ -101,7 +123,7 @@ KeyDoorAction = { itemId = false, itemPos = { { x = 32190, y = 32432, z = 8 } }, }, - -- Door of the key 3496 + -- Door of the key 3980 [Storage.Quest.Key.ID3980] = { itemId = false, itemPos = { { x = 32277, y = 32420, z = 10 } }, @@ -130,6 +152,16 @@ KeyDoorAction = { itemId = false, itemPos = { { x = 33363, y = 31360, z = 3 } }, }, + -- Door of the key 4601 (bear room quest) + [Storage.Quest.Key.ID4601] = { + itemId = false, + itemPos = { { x = 32145, y = 32100, z = 11 } }, + }, + -- Door of the key 4693 (kata quest) + [Storage.Quest.Key.ID4603] = { + itemId = false, + itemPos = { { x = 32179, y = 32149, z = 10 } }, + }, [Storage.Quest.Key.ID0909] = { itemId = false, itemPos = { @@ -141,4 +173,24 @@ KeyDoorAction = { itemId = false, itemPos = { { x = 32506, y = 32175, z = 14 } }, }, + [Storage.Quest.Key.ID3142] = { -- noble armor (thais quest) + itemId = false, + itemPos = { { x = 32450, y = 32044, z = 8 } }, + }, + [Storage.Quest.Key.ID3301] = { + itemId = false, + itemPos = { { x = 32619, y = 32241, z = 8 } }, + }, + [Storage.Quest.Key.ID3302] = { + itemId = false, + itemPos = { { x = 32619, y = 32240, z = 8 } }, + }, + [Storage.Quest.Key.ID3303] = { + itemId = false, + itemPos = { { x = 32614, y = 32175, z = 9 } }, + }, + [Storage.Quest.Key.ID3304] = { + itemId = false, + itemPos = { { x = 32620, y = 32199, z = 10 } }, + }, } diff --git a/data-otservbr-global/startup/tables/door_level.lua b/data-otservbr-global/startup/tables/door_level.lua index e9253809f40..d4c549a0f6b 100644 --- a/data-otservbr-global/startup/tables/door_level.lua +++ b/data-otservbr-global/startup/tables/door_level.lua @@ -6,6 +6,13 @@ Just add new positions and it go work in the game ]] LevelDoorAction = { + -- Doors for level 20 + [1020] = { + itemId = false, + itemPos = { + { x = 32673, y = 32100, z = 8 }, + }, + }, -- Doors for level 25 [1025] = { itemId = false, @@ -20,6 +27,14 @@ LevelDoorAction = { { x = 33302, y = 31691, z = 11 }, { x = 33302, y = 31692, z = 11 }, { x = 32567, y = 31969, z = 3 }, + { x = 32479, y = 32174, z = 15 }, + }, + }, + -- Doors for level 35 + [1035] = { + itemId = false, + itemPos = { + { x = 32448, y = 32042, z = 8 }, }, }, -- Doors for level 40 @@ -27,6 +42,16 @@ LevelDoorAction = { itemId = false, itemPos = { { x = 32981, y = 31760, z = 9 }, + { x = 32353, y = 32073, z = 11 }, + { x = 32544, y = 32179, z = 14 }, + }, + }, + -- Doors for level 45 + [1045] = { + itemId = false, + itemPos = { + { x = 32612, y = 32253, z = 7 }, + { x = 32602, y = 32207, z = 10 }, }, }, -- Doors for level 50 @@ -44,6 +69,7 @@ LevelDoorAction = { itemPos = { { x = 33085, y = 31650, z = 10 }, { x = 32223, y = 31869, z = 14 }, + { x = 32483, y = 31722, z = 15 }, }, }, -- Doors for level 70 diff --git a/data-otservbr-global/startup/tables/door_quest.lua b/data-otservbr-global/startup/tables/door_quest.lua index 366a6d052bb..927eb5219f7 100644 --- a/data-otservbr-global/startup/tables/door_quest.lua +++ b/data-otservbr-global/startup/tables/door_quest.lua @@ -944,4 +944,9 @@ QuestDoorUnique = { itemId = 17709, itemPos = { x = 32908, y = 32112, z = 7 }, }, + -- Katana Quest + [22006] = { + itemId = 5107, + itemPos = { x = 32177, y = 32148, z = 11 }, + }, } diff --git a/data-otservbr-global/startup/tables/item.lua b/data-otservbr-global/startup/tables/item.lua index 6aaa5f7235d..c53a445cf9c 100644 --- a/data-otservbr-global/startup/tables/item.lua +++ b/data-otservbr-global/startup/tables/item.lua @@ -3,6 +3,17 @@ ItemAction = { --Parchment room quest -- data\scripts\quests\parchment_room\movement-parchment.lua + [102] = { -- downFloor + itemId = false, + itemPos = { + { x = 32171, y = 32439, z = 7 }, -- fibula acess + { x = 32172, y = 32439, z = 7 }, -- fibula acess + { x = 32507, y = 32176, z = 13 }, + { x = 32508, y = 32176, z = 13 }, + { x = 32353, y = 32131, z = 8 }, -- scale armor quest + { x = 32354, y = 32131, z = 8 }, -- scale armor quest + }, + }, [104] = { itemId = 2819, itemPos = { { x = 33063, y = 31624, z = 15 } }, @@ -273,6 +284,13 @@ ItemAction = { { x = 33155, y = 31297, z = 3 }, }, }, + -- naginata quest + [40031] = { -- stone + itemId = 1791, + itemPos = { + { x = 32356, y = 32074, z = 10 }, + }, + }, } ItemUnique = { diff --git a/data-otservbr-global/startup/tables/lever.lua b/data-otservbr-global/startup/tables/lever.lua index ad4a6edc940..ded194b341b 100644 --- a/data-otservbr-global/startup/tables/lever.lua +++ b/data-otservbr-global/startup/tables/lever.lua @@ -51,6 +51,25 @@ LeverAction = { { x = 32601, y = 31421, z = 9 }, }, }, + [30006] = { -- bear room quest stone + itemId = false, + itemPos = { + { x = 32148, y = 32105, z = 11 }, + }, + }, + [30007] = { -- life ring bridge lever + itemId = false, + itemPos = { + { x = 32414, y = 32252, z = 10 }, + { x = 32413, y = 32230, z = 10 }, + }, + }, + [30008] = { -- devil helmet lever + itemId = false, + itemPos = { + { x = 32600, y = 32105, z = 14 }, + }, + }, } LeverUnique = { @@ -298,4 +317,39 @@ LeverUnique = { itemId = 2772, itemPos = { x = 32440, y = 32191, z = 10 }, }, + -- Path: data\scripts\rookgaard\katana_quest\katana_quest_lever.lua + [30029] = { + itemId = 2772, + itemPos = { x = 32182, y = 32145, z = 11 }, + }, + -- Path: data-otservbr-global\scripts\actions\quests\desert_dungeon_quest\desert_dungeon_lever.lua + [30030] = { + itemId = 2772, + itemPos = { x = 32673, y = 32086, z = 8 }, + }, + -- Path: data-otservbr-global/scripts/actions/quests/the_outlaw_camp/oven.lua + [30031] = { + itemId = 2772, + itemPos = { x = 32614, y = 32173, z = 9 }, + }, + -- Path: data-otservbr-global/scripts/actions/quests/the_outlaw_camp/power_switch.lua + [30032] = { + itemId = 2772, + itemPos = { x = 32594, y = 32212, z = 9 }, + }, + -- Path: data-otservbr-global/scripts/actions/quests/the_outlaw_camp/power_burn.lua + [30033] = { + itemId = 2772, + itemPos = { x = 32616, y = 32222, z = 10 }, + }, + -- Path: data-otservbr-global/scripts/actions/quests/others/triangle_tower_lever.lua + [30034] = { + itemId = 2772, + itemPos = { x = 32573, y = 32121, z = 7 }, + }, + -- Path: data\scripts\quests\draconia\action-lever.lua + [30035] = { + itemId = 2772, + itemPos = { x = 32792, y = 31579, z = 7 }, + }, } diff --git a/data-otservbr-global/startup/tables/teleport.lua b/data-otservbr-global/startup/tables/teleport.lua index b82d39b585e..51a6bf3a85e 100644 --- a/data-otservbr-global/startup/tables/teleport.lua +++ b/data-otservbr-global/startup/tables/teleport.lua @@ -157,10 +157,10 @@ TeleportUnique = { -- Quests teleports -- Deeper fibula quest teleport -- Entrance - [38001] = { + [38001] = { -- "left portal" to go back itemId = 1949, itemPos = { x = 32208, y = 32433, z = 10 }, - destination = { x = 32281, y = 32389, z = 10 }, + destination = { x = 32167, y = 32438, z = 9 }, effect = CONST_ME_TELEPORT, }, -- Exit diff --git a/data-otservbr-global/startup/tables/tile.lua b/data-otservbr-global/startup/tables/tile.lua index 6e5cb605c24..ccb8a6f8d2f 100644 --- a/data-otservbr-global/startup/tables/tile.lua +++ b/data-otservbr-global/startup/tables/tile.lua @@ -1154,19 +1154,19 @@ TileUnique = { -- Path: data\scripts\actions\quests\the_rookie_guard\mission05_web_terror.lua -- Spider lair entrance hole [25022] = { - itemId = 12728, + itemId = 385, itemPos = { x = 32051, y = 32110, z = 7 }, }, -- Spider queen chamber hole [25023] = { - itemId = 12728, + itemId = 385, itemPos = { x = 32018, y = 32098, z = 11 }, }, -- The Rookie Guard Quest - Mission 06: Run Like a Wolf -- Path: data\scripts\actions\quests\the_rookie_guard\mission06_run_like_wolf.lua -- War wolf den entrance hole [25024] = { - itemId = 12728, + itemId = 385, itemPos = { x = 32138, y = 32132, z = 7 }, }, -- War wolf den fall tile @@ -1188,9 +1188,14 @@ TileUnique = { -- Path: data\scripts\actions\quests\the_rookie_guard\mission09_rock_troll.lua -- Troll caves dug tunnel hole [25028] = { - itemId = 12728, + itemId = 385, itemPos = { x = 32059, y = 32135, z = 9 }, }, + -- Mintwallin Quest (Devil Helmet Quest) + [25030] = { + itemId = 431, + itemPos = { x = 32468, y = 32119, z = 14 }, + }, -- Remove/create item on stepIn -- Reserved uniques range from 29001/30000 diff --git a/data-otservbr-global/startup/tables/tile_pick.lua b/data-otservbr-global/startup/tables/tile_pick.lua index f5eceea7e9a..c4d9f89ea9f 100644 --- a/data-otservbr-global/startup/tables/tile_pick.lua +++ b/data-otservbr-global/startup/tables/tile_pick.lua @@ -14,6 +14,13 @@ TilePickAction = { { x = 32204, y = 31887, z = 14 }, { x = 32165, y = 31890, z = 14 }, { x = 32162, y = 31921, z = 13 }, + { x = 32149, y = 32110, z = 11 }, + { x = 32302, y = 32257, z = 8 }, -- Battle Axe Quest + { x = 32437, y = 32239, z = 10 }, -- Life Ring Quest + { x = 32775, y = 32012, z = 10 }, + { x = 32595, y = 32068, z = 9 }, + { x = 32580, y = 32103, z = 11 }, + { x = 32517, y = 32107, z = 14 }, }, }, } diff --git a/data/libs/functions/player.lua b/data/libs/functions/player.lua index 03e88d7ccca..b0c74afeaa6 100644 --- a/data/libs/functions/player.lua +++ b/data/libs/functions/player.lua @@ -973,7 +973,7 @@ end function Player:canGetReward(rewardId, questName) if self:questKV(questName):get("completed") then - self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The box is empty.") + self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.") return false end diff --git a/data/scripts/lib/register_actions.lua b/data/scripts/lib/register_actions.lua index 25d23f1926d..e5d6688b167 100644 --- a/data/scripts/lib/register_actions.lua +++ b/data/scripts/lib/register_actions.lua @@ -451,7 +451,7 @@ function onUseShovel(player, item, fromPosition, target, toPosition, isHotkey) player:addItem(21395, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You dig up sand and sea shells.") elseif rand > 95 then - player:addItem(3976, math.random(1, 10)) + player:addItem(3492, math.random(1, 10)) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You dig up some worms. But you are confident that you'll find the amulet here, somewhere.") end toPosition:sendMagicEffect(CONST_ME_POFF) @@ -762,7 +762,7 @@ function onUsePick(player, item, fromPosition, target, toPosition, isHotkey) end target:transform(3141) toPosition:sendMagicEffect(CONST_ME_SMOKE) - elseif target.actionid == 50058 then + elseif target.actionid == 40031 then -- naginata quest local stoneStorage = Game.getStorageValue(GlobalStorage.NaginataStone) if stoneStorage ~= 5 then From 6f678c7d907d7140672e4d2debbe9fb95161cbaa Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Thu, 25 Jul 2024 14:16:16 -0300 Subject: [PATCH 02/16] fix: the paradox quest (#2719) --- ...lever.lua => action_fifth_floor_lever.lua} | 0 ..._lever.lua => action_four_floor_lever.lua} | 0 ...ever.lua => action_second_floor_lever.lua} | 0 ...lever.lua => action_third_floor_lever.lua} | 0 .../the_paradox_tower/move_let_the _quest.lua | 37 ++++++++++++++++ .../the_paradox_tower/movement-poison.lua | 32 -------------- .../movement-sacrifice_skulls.lua | 42 ------------------- ...air.lua => movement_first_floor_stair.lua} | 0 ...ard.lua => movement_last_floor_reward.lua} | 0 .../movement_sacrifice_skulls.lua | 41 ++++++++++++++++++ ...ent_strange_carvings_in _the_southeast.lua | 30 +++++++++++++ ...oul.lua => movement_third_floor_ghoul.lua} | 0 .../the_paradox_tower/trap_in_the_tree.lua | 23 ++++++++++ data-otservbr-global/startup/tables/tile.lua | 29 ++++++++++++- 14 files changed, 158 insertions(+), 76 deletions(-) rename data-otservbr-global/scripts/quests/the_paradox_tower/{action-fifth_floor_lever.lua => action_fifth_floor_lever.lua} (100%) rename data-otservbr-global/scripts/quests/the_paradox_tower/{action-four_floor_lever.lua => action_four_floor_lever.lua} (100%) rename data-otservbr-global/scripts/quests/the_paradox_tower/{action-second_floor_lever.lua => action_second_floor_lever.lua} (100%) rename data-otservbr-global/scripts/quests/the_paradox_tower/{action-third_floor_lever.lua => action_third_floor_lever.lua} (100%) create mode 100644 data-otservbr-global/scripts/quests/the_paradox_tower/move_let_the _quest.lua delete mode 100644 data-otservbr-global/scripts/quests/the_paradox_tower/movement-poison.lua delete mode 100644 data-otservbr-global/scripts/quests/the_paradox_tower/movement-sacrifice_skulls.lua rename data-otservbr-global/scripts/quests/the_paradox_tower/{movement-first_floor_stair.lua => movement_first_floor_stair.lua} (100%) rename data-otservbr-global/scripts/quests/the_paradox_tower/{movement-last_floor_reward.lua => movement_last_floor_reward.lua} (100%) create mode 100644 data-otservbr-global/scripts/quests/the_paradox_tower/movement_sacrifice_skulls.lua create mode 100644 data-otservbr-global/scripts/quests/the_paradox_tower/movement_strange_carvings_in _the_southeast.lua rename data-otservbr-global/scripts/quests/the_paradox_tower/{movement-third_floor_ghoul.lua => movement_third_floor_ghoul.lua} (100%) create mode 100644 data-otservbr-global/scripts/quests/the_paradox_tower/trap_in_the_tree.lua diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/action-fifth_floor_lever.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/action_fifth_floor_lever.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_paradox_tower/action-fifth_floor_lever.lua rename to data-otservbr-global/scripts/quests/the_paradox_tower/action_fifth_floor_lever.lua diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/action-four_floor_lever.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/action_four_floor_lever.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_paradox_tower/action-four_floor_lever.lua rename to data-otservbr-global/scripts/quests/the_paradox_tower/action_four_floor_lever.lua diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/action-second_floor_lever.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/action_second_floor_lever.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_paradox_tower/action-second_floor_lever.lua rename to data-otservbr-global/scripts/quests/the_paradox_tower/action_second_floor_lever.lua diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/action-third_floor_lever.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/action_third_floor_lever.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_paradox_tower/action-third_floor_lever.lua rename to data-otservbr-global/scripts/quests/the_paradox_tower/action_third_floor_lever.lua diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/move_let_the _quest.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/move_let_the _quest.lua new file mode 100644 index 00000000000..a20f503a9f8 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_paradox_tower/move_let_the _quest.lua @@ -0,0 +1,37 @@ +local teleportTileBack = MoveEvent() + +function teleportTileBack.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + -- UIDs específicos do tile + local specificUIDs = { 25034, 25035, 25036, 25037 } + + -- Posições específicas + local specificPositions = { + { x = 32486, y = 31927, z = 7 }, + { x = 32487, y = 31927, z = 7 }, + { x = 32486, y = 31928, z = 7 }, + { x = 32487, y = 31928, z = 7 }, + } + + -- Posição de teletransporte + local teleportPosition = { x = 32566, y = 31959, z = 1 } + + -- Verifica se a posição, o UID e o itemID coincidem + for _, pos in ipairs(specificPositions) do + if position.x == pos.x and position.y == pos.y and position.z == pos.z and item:getId() == 599 and table.contains(specificUIDs, item.uid) then + player:teleportTo(teleportPosition) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + break + end + end + + return true +end + +-- Registra o evento para os UIDs específicos +teleportTileBack:uid(25034, 25035, 25036, 25037) +teleportTileBack:register() diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/movement-poison.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/movement-poison.lua deleted file mode 100644 index 565762fa480..00000000000 --- a/data-otservbr-global/scripts/quests/the_paradox_tower/movement-poison.lua +++ /dev/null @@ -1,32 +0,0 @@ -local positions = { - { x = 32497, y = 31889, z = 7 }, - { x = 32497, y = 31890, z = 7 }, - { x = 32498, y = 31890, z = 7 }, - { x = 32499, y = 31890, z = 7 }, - { x = 32502, y = 31890, z = 7 }, - { x = 32494, y = 31888, z = 7 }, -} - -local poison = MoveEvent() - -function poison.onStepOut(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then - return true - end - - local removeHealth = Tile({ x = 32497, y = 31889, z = 7 }):getFieldItem() - if not removeHealth then - player:addHealth(-200, COMBAT_EARTHDAMAGE) - for i = 1, #positions do - local tile = Tile(positions[i]):getFieldItem() - if not tile then - Game.createItem(105, 1, Position(positions[i])) - end - end - end - return true -end - -poison:uid(25011) -poison:register() diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/movement-sacrifice_skulls.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/movement-sacrifice_skulls.lua deleted file mode 100644 index c351bde5c46..00000000000 --- a/data-otservbr-global/scripts/quests/the_paradox_tower/movement-sacrifice_skulls.lua +++ /dev/null @@ -1,42 +0,0 @@ -local positions = { - { x = 32563, y = 31957, z = 1 }, - { x = 32565, y = 31957, z = 1 }, - { x = 32567, y = 31957, z = 1 }, - { x = 32569, y = 31957, z = 1 }, -} - -local sacrificeSkulls = MoveEvent() - -function sacrificeSkulls.onStepIn(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then - return true - end - - for i = 4, #positions do - -- Check if have skulls in all positions - local tile = Tile(positions[i]):getItemById(3114) - if tile then - -- Message, only send in the first acess of the paradox tower - if player:getStorageValue(FirstParadoxAcess) < 1 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "One of the toxic salt seas in Krailos carries fresh and clean water again. The ogres' water supply is ensured for now") - player:setStorageValue(FirstParadoxAcess, 1) - end - -- Remove skulls - for skulls = 1, #positions do - local skull = Tile(positions[skulls]):getItemById(3114) - if skull then - -- Create poison fields from the positions - Game.createItem(105, 1, Position(positions[skulls])) - -- Remove skulls from the positions - skull:remove(1) - end - end - player:teleportTo({ x = 32479, y = 31923, z = 7 }) - end - end - return true -end - -sacrificeSkulls:uid(25012) -sacrificeSkulls:register() diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/movement-first_floor_stair.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/movement_first_floor_stair.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_paradox_tower/movement-first_floor_stair.lua rename to data-otservbr-global/scripts/quests/the_paradox_tower/movement_first_floor_stair.lua diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/movement-last_floor_reward.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/movement_last_floor_reward.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_paradox_tower/movement-last_floor_reward.lua rename to data-otservbr-global/scripts/quests/the_paradox_tower/movement_last_floor_reward.lua diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/movement_sacrifice_skulls.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/movement_sacrifice_skulls.lua new file mode 100644 index 00000000000..cefc303ae07 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_paradox_tower/movement_sacrifice_skulls.lua @@ -0,0 +1,41 @@ +local positions = { + { x = 32563, y = 31957, z = 1 }, + { x = 32565, y = 31957, z = 1 }, + { x = 32567, y = 31957, z = 1 }, + { x = 32569, y = 31957, z = 1 }, +} + +local sacrificeSkulls = MoveEvent() + +function sacrificeSkulls.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + for i = 1, #positions do + local tile = Tile(positions[i]) + if not tile or not tile:getItemById(3114) then + return true + end + end + + if player:getStorageValue(FirstParadoxAcess) < 1 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "One of the toxic salt seas in Krailos carries fresh and clean water again. The ogres' water supply is ensured for now") + player:setStorageValue(FirstParadoxAcess, 1) + end + + for i = 1, #positions do + local skull = Tile(positions[i]):getItemById(3114) + if skull then + Game.createItem(105, 1, positions[i]) + skull:remove(1) + end + end + + player:teleportTo({ x = 32479, y = 31923, z = 7 }) + return true +end + +sacrificeSkulls:uid(25012) +sacrificeSkulls:register() diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/movement_strange_carvings_in _the_southeast.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/movement_strange_carvings_in _the_southeast.lua new file mode 100644 index 00000000000..f4316250888 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_paradox_tower/movement_strange_carvings_in _the_southeast.lua @@ -0,0 +1,30 @@ +local teleportTile = MoveEvent() + +function teleportTile.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local specificUIDs = { 25031, 25032 } + + local specificPositions = { + { x = 32477, y = 31905, z = 7 }, + { x = 32476, y = 31906, z = 7 }, + } + + local teleportPosition = { x = 32478, y = 31908, z = 7 } + + for _, pos in ipairs(specificPositions) do + if position.x == pos.x and position.y == pos.y and position.z == pos.z and item:getId() == 599 and table.contains(specificUIDs, item.uid) then + player:teleportTo(teleportPosition) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + break + end + end + + return true +end + +teleportTile:uid(25031, 25032) +teleportTile:register() diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/movement-third_floor_ghoul.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/movement_third_floor_ghoul.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_paradox_tower/movement-third_floor_ghoul.lua rename to data-otservbr-global/scripts/quests/the_paradox_tower/movement_third_floor_ghoul.lua diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/trap_in_the_tree.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/trap_in_the_tree.lua new file mode 100644 index 00000000000..2e7342c7800 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_paradox_tower/trap_in_the_tree.lua @@ -0,0 +1,23 @@ +local trap_in_the_tree = MoveEvent() + +local trapPositions = { + { x = 32497, y = 31889, z = 07 }, + { x = 32499, y = 31890, z = 07 }, + { x = 32497, y = 31890, z = 07 }, + { x = 32498, y = 31890, z = 07 }, + { x = 32496, y = 31890, z = 07 }, + { x = 32494, y = 31888, z = 07 }, + { x = 32502, y = 31890, z = 07 }, +} + +function trap_in_the_tree.onStepIn(creature, item, toPosition, fromPosition) + if creature:isPlayer() and Tile({ x = 32502, y = 31890, z = 07 }):getThingCount() == 2 then + doTargetCombatHealth(0, creature, COMBAT_EARTHDAMAGE, -200, -200) + for _, pos in ipairs(trapPositions) do + Game.createItem(2121, 1, pos) + end + end +end + +trap_in_the_tree:uid(25011) +trap_in_the_tree:register() diff --git a/data-otservbr-global/startup/tables/tile.lua b/data-otservbr-global/startup/tables/tile.lua index ccb8a6f8d2f..e2bec126315 100644 --- a/data-otservbr-global/startup/tables/tile.lua +++ b/data-otservbr-global/startup/tables/tile.lua @@ -1099,8 +1099,8 @@ TileUnique = { }, -- The paradox tower quest [25011] = { - itemId = 354, - itemPos = { x = 32497, y = 31889, z = 7 }, + itemId = 353, + itemPos = { x = 32497, y = 31888, z = 7 }, }, [25012] = { itemId = 10145, @@ -1196,6 +1196,31 @@ TileUnique = { itemId = 431, itemPos = { x = 32468, y = 32119, z = 14 }, }, + -- The Paradox Tower Quest + [25031] = { + itemId = 599, + itemPos = { x = 32477, y = 31905, z = 7 }, + }, + [25032] = { + itemId = 599, + itemPos = { x = 32476, y = 31906, z = 7 }, + }, + [25034] = { + itemId = 599, + itemPos = { x = 32486, y = 31927, z = 7 }, + }, + [25035] = { + itemId = 599, + itemPos = { x = 32487, y = 31927, z = 7 }, + }, + [25036] = { + itemId = 599, + itemPos = { x = 32486, y = 31928, z = 7 }, + }, + [25037] = { + itemId = 599, + itemPos = { x = 32487, y = 31928, z = 7 }, + }, -- Remove/create item on stepIn -- Reserved uniques range from 29001/30000 From e30b0af0518fd11abe14afe992dccaa93e8e8c3c Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:10:20 -0300 Subject: [PATCH 03/16] fix: quests from version 7.24 revised (#2724) --- data-otservbr-global/lib/core/quests.lua | 6 +++--- data-otservbr-global/npc/kevin.lua | 8 ++++---- data-otservbr-global/npc/kroox.lua | 4 ++-- data-otservbr-global/npc/lokur.lua | 8 ++++++++ data-otservbr-global/npc/markwin.lua | 1 + data-otservbr-global/npc/talphion.lua | 2 +- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/data-otservbr-global/lib/core/quests.lua b/data-otservbr-global/lib/core/quests.lua index 042897f9369..2d60761bf92 100644 --- a/data-otservbr-global/lib/core/quests.lua +++ b/data-otservbr-global/lib/core/quests.lua @@ -3561,7 +3561,7 @@ if not Quests then storageId = Storage.Postman.Mission07, missionId = 10258, startValue = 1, - endValue = 8, + endValue = 9, states = { [1] = "Kevin wants you to bring him the measurements of Benjamin, Lokur, Dove, Liane, Chrystal and Olrik.", [2] = "You have received the measurements from 1 of 6 post officers.", @@ -3569,8 +3569,8 @@ if not Quests then [4] = "You have received the measurements from 3 of 6 post officers.", [5] = "You have received the measurements from 4 of 6 post officers.", [6] = "You have received the measurements from 5 of 6 post officers.", - [7] = "You have received all measurements, report back to Kevin!", - [8] = "You have reported back that you have completed the mission.", + [8] = "You have received all measurements, report back to Kevin!", + [9] = "You have reported back that you have completed the mission.", }, }, [8] = { diff --git a/data-otservbr-global/npc/kevin.lua b/data-otservbr-global/npc/kevin.lua index c8108e547aa..41686524673 100644 --- a/data-otservbr-global/npc/kevin.lua +++ b/data-otservbr-global/npc/kevin.lua @@ -88,7 +88,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif player:getStorageValue(Storage.Postman.Mission05) == 3 then npcHandler:say("Splendid, I knew we could trust you. I would like to ask for your help in another matter. Are you interested?", npc, creature) npcHandler:setTopic(playerId, 16) - elseif player:getStorageValue(Storage.Postman.Mission07) == 7 then + elseif player:getStorageValue(Storage.Postman.Mission07) == 8 then npcHandler:say("Once more you have impressed me! Are you willing to do another job?", npc, creature) npcHandler:setTopic(playerId, 21) elseif player:getStorageValue(Storage.Postman.Mission06) >= 1 and player:getStorageValue(Storage.Postman.Mission06) < 10 then @@ -127,10 +127,10 @@ local function creatureSayCallback(npc, creature, type, message) elseif player:getStorageValue(Storage.Postman.Rank) == 4 or player:getStorageValue(Storage.Postman.Rank) == 3 and player:getStorageValue(Storage.Postman.Mission09) == 0 then npcHandler:say("So are you ready for another mission?", npc, creature) npcHandler:setTopic(playerId, 25) - elseif player:getStorageValue(Storage.Postman.Mission06) == 13 and player:getStorageValue(Storage.Postman.Rank) == 3 then + elseif player:getStorageValue(Storage.Postman.Mission07) < 1 and player:getStorageValue(Storage.Postman.Mission06) == 13 and player:getStorageValue(Storage.Postman.Rank) == 3 then npcHandler:say("Excellent! Another job well done! Would you accept another mission?", npc, creature) npcHandler:setTopic(playerId, 19) - elseif player:getStorageValue(Storage.Postman.Mission06) == 13 and player:getStorageValue(Storage.Postman.Rank) == 2 then + elseif player:getStorageValue(Storage.Postman.Mission07) >= 1 and player:getStorageValue(Storage.Postman.Mission06) == 13 and player:getStorageValue(Storage.Postman.Rank) == 2 then npcHandler:say("Excellent! Another job well done! Would you accept another mission?", npc, creature) npcHandler:setTopic(playerId, 28) elseif player:getStorageValue(Storage.Postman.Mission04) == 2 and player:getStorageValue(Storage.Postman.Rank) == 2 then @@ -263,7 +263,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 22) elseif npcHandler:getTopic(playerId) == 22 then npcHandler:say("Find out about his whereabouts and retrieve him or at least his posthorn. He was looking for a new underground passage that is rumoured to be found underneath the troll-infested Mountain east of Thais.", npc, creature) - player:setStorageValue(Storage.Postman.Mission07, 8) + player:setStorageValue(Storage.Postman.Mission07, 9) player:setStorageValue(Storage.Postman.Mission08, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 23 then diff --git a/data-otservbr-global/npc/kroox.lua b/data-otservbr-global/npc/kroox.lua index 020153a27bf..6f237ad1d87 100644 --- a/data-otservbr-global/npc/kroox.lua +++ b/data-otservbr-global/npc/kroox.lua @@ -66,8 +66,8 @@ local function creatureSayCallback(npc, creature, type, message) player:setStorageValue(Storage.SamsOldBackpack, 2) player:setStorageValue(Storage.SamsOldBackpackDoor, 1) end - elseif MsgContains(message, "measurements") then - if player:getStorageValue(Storage.Postman.Mission07) >= 1 and player:getStorageValue(Storage.Postman.MeasurementsKroox) ~= 1 then + elseif message == "lokurs measurements" then + if player:getStorageValue(Storage.Postman.Mission07) >= 7 and player:getStorageValue(Storage.Postman.MeasurementsKroox) ~= 1 then npcHandler:say("Hm, well I guess its ok to tell you ... ", npc, creature) player:setStorageValue(Storage.Postman.Mission07, player:getStorageValue(Storage.Postman.Mission07) + 1) player:setStorageValue(Storage.Postman.MeasurementsKroox, 1) diff --git a/data-otservbr-global/npc/lokur.lua b/data-otservbr-global/npc/lokur.lua index 62fb5a50864..59fc7ed0f7c 100644 --- a/data-otservbr-global/npc/lokur.lua +++ b/data-otservbr-global/npc/lokur.lua @@ -94,6 +94,14 @@ local function creatureSayCallback(npc, creature, type, message) elseif MsgContains(message, "no") and npcHandler:getTopic(playerId) > 0 then npcHandler:say("No then.", npc, creature) npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "measurements") then + if player:getStorageValue(Storage.Postman.Mission07) >= 6 and player:getStorageValue(Storage.Postman.MeasurementsKroox) ~= 1 then + npcHandler:say("Come on, I have no clue what they are. Better ask my armorer Kroox for such nonsense.Go and ask him for good ol' Lokurs measurements, he'll know.", npc, creature) + player:setStorageValue(Storage.Postman.Mission07, player:getStorageValue(Storage.Postman.Mission07) + 1) + else + npcHandler:say("...", npc, creature) + npcHandler:setTopic(playerId, 0) + end end return true diff --git a/data-otservbr-global/npc/markwin.lua b/data-otservbr-global/npc/markwin.lua index b70437dddae..f0b2e055f5f 100644 --- a/data-otservbr-global/npc/markwin.lua +++ b/data-otservbr-global/npc/markwin.lua @@ -66,6 +66,7 @@ local function greetCallback(npc, creature) position:sendMagicEffect(CONST_ME_TELEPORT) end end + npcHandler:say("No! The hornless have reached my city! BODYGUARDS TO ME!", npc, creature) return false elseif player:getStorageValue(Storage.MarkwinGreeting) == 1 then npcHandler:setMessage(MESSAGE_GREET, "Well ... you defeated my guards! Now everything is over! I guess I will have to answer your questions now.") diff --git a/data-otservbr-global/npc/talphion.lua b/data-otservbr-global/npc/talphion.lua index 9a7ec7ae7e6..362dea22509 100644 --- a/data-otservbr-global/npc/talphion.lua +++ b/data-otservbr-global/npc/talphion.lua @@ -69,7 +69,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("CHESS? I DONT PLAY CHESS!", npc, creature) npcHandler:setTopic(playerId, 3) elseif npcHandler:getTopic(playerId) == 3 then - npcHandler:say("A PATTERN IN THIS MESS?? HEY DON'T INSULT MY MACHINEHALL!", npc, creature) + npcHandler:say("A PATTERN IN THIS MESS?? HEY DON'T INSULT MY MACHINE HALL!", npc, creature) npcHandler:setTopic(playerId, 4) elseif npcHandler:getTopic(playerId) == 4 then npcHandler:say("AH YES! I WORKED ON THE DRESS PATTERN FOR THOSE UNIFORMS. STAINLESS TROUSERES, STEAM DRIVEN BOOTS! ANOTHERMARVEL TO BEHOLD! I'LL SENT A COPY TO KEVIN IMEDIATELY!", npc, creature) From af0edb7fc490a3db0ccc43f97dffffbc860af830 Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:35:35 -0300 Subject: [PATCH 04/16] fix: quests from version 7.26 to 7.92 revised (#2725) --- data-otservbr-global/lib/core/quests.lua | 225 ++--- data-otservbr-global/lib/core/storages.lua | 628 +++++++------- .../npc/a_dead_bureaucrat1.lua | 16 +- .../npc/a_dead_bureaucrat2.lua | 4 +- .../npc/a_dead_bureaucrat3.lua | 8 +- .../npc/a_dead_bureaucrat4.lua | 8 +- data-otservbr-global/npc/a_ghostly_sage.lua | 2 +- .../npc/a_majestic_warwolf.lua | 6 +- data-otservbr-global/npc/a_sweaty_cyclops.lua | 258 +++--- data-otservbr-global/npc/ajax.lua | 53 +- data-otservbr-global/npc/alesar.lua | 97 ++- data-otservbr-global/npc/alesar_functions.lua | 10 +- data-otservbr-global/npc/amanda.lua | 10 +- data-otservbr-global/npc/amber.lua | 132 +-- data-otservbr-global/npc/angelina.lua | 19 +- data-otservbr-global/npc/angus.lua | 331 ++++---- data-otservbr-global/npc/ariella.lua | 78 +- data-otservbr-global/npc/atrad.lua | 12 +- data-otservbr-global/npc/baa_leal.lua | 42 +- data-otservbr-global/npc/berenice.lua | 14 +- data-otservbr-global/npc/bo_ques.lua | 56 +- data-otservbr-global/npc/brewster.lua | 27 +- data-otservbr-global/npc/bron.lua | 68 +- data-otservbr-global/npc/captain_max.lua | 2 +- .../npc/captain_waverider.lua | 2 +- data-otservbr-global/npc/ceiron.lua | 44 +- data-otservbr-global/npc/charlotta.lua | 4 +- data-otservbr-global/npc/chondur.lua | 510 +++++------- data-otservbr-global/npc/cobra.lua | 4 + data-otservbr-global/npc/cornelia.lua | 16 +- data-otservbr-global/npc/duncan.lua | 78 +- data-otservbr-global/npc/elane.lua | 26 +- data-otservbr-global/npc/eleonore.lua | 30 +- data-otservbr-global/npc/eliyas.lua | 51 -- data-otservbr-global/npc/elvith.lua | 1 - data-otservbr-global/npc/erayo.lua | 26 +- data-otservbr-global/npc/eremo.lua | 11 +- data-otservbr-global/npc/fa_hradin.lua | 45 +- data-otservbr-global/npc/gabel.lua | 46 +- data-otservbr-global/npc/gamon.lua | 2 +- data-otservbr-global/npc/gregor.lua | 111 +-- data-otservbr-global/npc/habdel.lua | 28 +- data-otservbr-global/npc/hairycles.lua | 70 +- data-otservbr-global/npc/hanna.lua | 12 +- data-otservbr-global/npc/haroun.lua | 38 +- data-otservbr-global/npc/hugo.lua | 22 +- data-otservbr-global/npc/iptar-sin.lua | 14 +- data-otservbr-global/npc/irmana.lua | 281 +++++-- data-otservbr-global/npc/ishina.lua | 30 +- data-otservbr-global/npc/isimov.lua | 10 +- data-otservbr-global/npc/jack_fate.lua | 2 +- data-otservbr-global/npc/jack_fate_goroma.lua | 14 +- data-otservbr-global/npc/karl.lua | 6 +- data-otservbr-global/npc/kasmir.lua | 10 +- data-otservbr-global/npc/kazzan.lua | 2 +- data-otservbr-global/npc/klaus.lua | 19 +- data-otservbr-global/npc/kroox.lua | 7 +- data-otservbr-global/npc/legola.lua | 6 +- data-otservbr-global/npc/lubo.lua | 21 +- data-otservbr-global/npc/lugri.lua | 20 +- data-otservbr-global/npc/lurik.lua | 26 +- data-otservbr-global/npc/lynda.lua | 32 +- data-otservbr-global/npc/maealil.lua | 10 +- data-otservbr-global/npc/malor.lua | 46 +- data-otservbr-global/npc/marina.lua | 32 +- data-otservbr-global/npc/maryza.lua | 27 +- data-otservbr-global/npc/melchior.lua | 10 +- data-otservbr-global/npc/miraia.lua | 23 +- data-otservbr-global/npc/morgan.lua | 51 +- data-otservbr-global/npc/mortimer.lua | 293 +++---- data-otservbr-global/npc/myra.lua | 365 +++++--- data-otservbr-global/npc/nah_bob.lua | 38 +- data-otservbr-global/npc/ninev.lua | 14 +- data-otservbr-global/npc/norma.lua | 24 +- data-otservbr-global/npc/ocelus.lua | 14 +- data-otservbr-global/npc/oldrak.lua | 21 +- data-otservbr-global/npc/partos.lua | 4 +- data-otservbr-global/npc/pemaret.lua | 11 +- data-otservbr-global/npc/quentin.lua | 16 +- data-otservbr-global/npc/rahkem.lua | 10 +- data-otservbr-global/npc/rata_mari.lua | 8 +- data-otservbr-global/npc/raymond_striker.lua | 64 +- data-otservbr-global/npc/razan.lua | 24 +- data-otservbr-global/npc/sam.lua | 18 +- data-otservbr-global/npc/sandra.lua | 66 +- data-otservbr-global/npc/sebastian.lua | 4 +- data-otservbr-global/npc/shauna.lua | 4 +- data-otservbr-global/npc/simon_the_beggar.lua | 302 ++++--- .../npc/the_blind_prophet.lua | 15 +- data-otservbr-global/npc/the_bone_master.lua | 23 +- data-otservbr-global/npc/the_dream_master.lua | 23 +- data-otservbr-global/npc/the_orc_king.lua | 12 +- .../npc/the_queen_of_the_banshees.lua | 121 +-- data-otservbr-global/npc/tibra.lua | 10 +- data-otservbr-global/npc/tom.lua | 9 +- data-otservbr-global/npc/trisha.lua | 28 +- data-otservbr-global/npc/tyrias.lua | 10 +- data-otservbr-global/npc/ubaid.lua | 41 +- data-otservbr-global/npc/umar.lua | 42 +- data-otservbr-global/npc/ustan.lua | 11 +- data-otservbr-global/npc/uzgod.lua | 21 +- data-otservbr-global/npc/vescu.lua | 56 +- data-otservbr-global/npc/vulturenose.lua | 11 +- data-otservbr-global/npc/wyrdin.lua | 2 +- data-otservbr-global/npc/yaman.lua | 37 +- data-otservbr-global/npc/yberius.lua | 10 +- data-otservbr-global/npc/zoltan.lua | 75 +- .../actions/other/others/quest_system1.lua | 8 +- .../actions/other/others/quest_system2.lua | 15 +- .../actions/quests/druid_outfit/waterskin.lua | 13 - .../quests/explorer_society/botanist.lua | 33 - .../quests/explorer_society/butterfly.lua | 26 - .../quests/explorer_society/dragon.lua | 13 - .../quests/explorer_society/icicle.lua | 13 - .../quests/explorer_society/resonance.lua | 15 - .../actions/quests/explorer_society/stone.lua | 26 - .../actions/quests/green_djinn/tear.lua | 14 - .../actions/quests/ice_islands/paint.lua | 2 +- .../quests/others/calassa_comb_door.lua | 2 +- .../quests/others/ectoplasm_container.lua | 9 +- .../actions/quests/others/fire_bug.lua | 6 +- .../active_teleport_switches.lua | 37 - .../quests/the_ancient_tombs/lever.lua | 62 -- .../the_ancient_tombs/ruins_instruments.lua | 32 - .../mission9_catacombs_snake_destroyer.lua | 20 - .../scripts/actions/tools/crowbar.lua | 39 + .../scripts/actions/tools/rake.lua | 4 +- .../creaturescripts/customs/freequests.lua | 112 +-- .../movements/quests/inquisition/entrance.lua | 14 +- .../quests/pits_of_inferno/check_throne.lua | 37 - ...mission9_the_deepest_catacomb_teleport.lua | 32 - .../movements/teleport/tomb_coal_basin.lua | 35 - .../scripts/movements/teleport/turtles.lua | 2 +- .../actions_documents.lua} | 6 +- .../actions_lever_brotherhood.lua} | 24 +- .../actions_lever_nightmare.lua} | 24 +- .../actions_stone_teleport.lua} | 2 +- .../actions_tic_tac.lua} | 0 .../actions_tic_tac_teleport.lua} | 0 .../actions_walls.lua} | 0 .../movement_carrot.lua} | 10 +- .../movement_clock_tile.lua} | 0 .../movement_court_teleport.lua} | 0 .../movement_death_ring.lua} | 0 .../movement_death_ring_teleport.lua} | 0 .../movement_fire_bug_teleport.lua} | 0 .../movement_riddle.lua} | 0 .../movement_riddle_teleport.lua} | 0 .../movement_sacrifice_teleport.lua} | 4 +- .../movement_stone_teleport.lua} | 0 .../movement_teleport.lua} | 0 .../movement_tic_teleport.lua} | 0 .../movement_tower.lua} | 2 +- .../movement_wall_teleport.lua} | 0 .../actions_ceirons_waterskin.lua | 15 + .../action_all_hymn_piano_teleport.lua} | 4 +- .../action_music_sheet.lua} | 8 +- .../actions_active_teleport_switches.lua | 62 ++ .../actions_dipthrah_signs_doors.lua | 50 ++ .../actions_oasis_lever_door.lua} | 0 .../actions_ruins_instruments.lua | 45 + ...vements_all_teleports_tombs_coal_basin.lua | 63 ++ .../movements_craft_helmet.lua} | 4 +- ...enter_ashmunrah_teleport_switche_done.lua} | 2 +- .../movements_enter_diprath_room.lua | 27 + ...s_enter_diprath_teleport_switche_done.lua} | 10 +- .../movements_enter_mahrdis_room.lua | 26 + .../movements_enter_morguthis_room.lua | 26 + .../movements_enter_omruc_room.lua | 26 + .../movements_enter_omruc_specific.lua | 26 + .../movements_enter_rahemos_levers.lua | 26 + .../movements_enter_rahemos_room.lua | 26 + .../movements_enter_thalas_poison_tile.lua} | 0 ...s_enter_thalas_teleport_switches_done.lua} | 2 +- .../movements_enter_vashresamun_room.lua | 26 + .../movements_enter_vashresamun_specific.lua | 26 + .../movements_peninsula_tomb_maze.lua} | 0 .../movements_step_morguthis_blue_flames.lua} | 19 +- .../movements_tomb_teleport.lua} | 3 +- .../actions_mission09_snake_destroyer.lua | 67 ++ .../actions_mission9_catacombs_lever.lua} | 0 ...ements_mission4_parchment_decyphering.lua} | 4 +- ...mission9_the_deepest_catacomb_teleport.lua | 60 ++ .../action_water_fountain.lua | 15 + .../the_explorer_society/actions_botanist.lua | 31 + .../actions_butterfly.lua | 26 + .../the_explorer_society/actions_dragon.lua | 13 + .../actions_findings.lua} | 18 +- .../the_explorer_society/actions_icicle.lua | 13 + .../actions_resonance.lua | 16 + .../the_explorer_society/actions_stone.lua | 26 + .../actions_tracing_paper.lua} | 6 +- .../movements_calassa.lua} | 0 ...ovements_carving_teleport_liberty_bay.lua} | 2 +- .../movements_carvingteleport_port_hope.lua} | 2 +- .../actions_bazir_maze_lever.lua} | 0 .../actions_bazir_mirror.lua} | 0 .../actions_bazir_wrong_levers.lua} | 0 .../actions_fire_throne_lever.lua} | 0 .../actions_fountain.lua} | 0 .../actions_ladder_levers.lua} | 0 .../actions_levers.lua} | 0 .../actions_maze_stone.lua} | 0 .../actions_oil.lua} | 0 .../actions_stone_lever.lua} | 0 .../actions_trap_lever.lua} | 0 .../actions_walls.lua} | 0 .../movements_bazir_tile.lua} | 0 .../movements_check_throne.lua | 37 + .../movements_drawbridge.lua} | 0 .../movements_fire_tile.lua} | 0 .../movements_holy_tible_tile.lua} | 0 .../movements_ladder.lua} | 0 .../movements_pumin_teleport.lua} | 2 +- .../movements_second_trap.lua} | 0 .../movements_shortcuts.lua} | 4 +- .../movements_stone.lua} | 0 .../movements_throne.lua} | 45 +- .../movements_tile_teleport.lua} | 0 .../movements_trap.lua} | 0 .../action_nargor_maps.lua} | 8 +- .../action_tortoise_egg_nargor.lua} | 4 +- .../movement_energy_barrier.lua} | 2 +- .../movement_teleport.lua} | 0 data-otservbr-global/startup/tables/chest.lua | 252 +++++- .../startup/tables/create_item.lua | 11 + .../startup/tables/door_key.lua | 5 + .../startup/tables/door_level.lua | 5 + .../startup/tables/door_quest.lua | 79 +- data-otservbr-global/startup/tables/item.lua | 783 +++++++++++++++++- data-otservbr-global/startup/tables/lever.lua | 258 ++++++ data-otservbr-global/startup/tables/tile.lua | 7 + .../startup/tables/tile_pick.lua | 2 + .../startup/tables/writeable.lua | 56 ++ data/npclib/npc_system/custom_modules.lua | 7 + data/npclib/npc_system/npc_handler.lua | 8 +- data/scripts/actions/tools/crowbar.lua | 8 - 237 files changed, 5580 insertions(+), 3356 deletions(-) delete mode 100644 data-otservbr-global/scripts/actions/quests/druid_outfit/waterskin.lua delete mode 100644 data-otservbr-global/scripts/actions/quests/explorer_society/botanist.lua delete mode 100644 data-otservbr-global/scripts/actions/quests/explorer_society/butterfly.lua delete mode 100644 data-otservbr-global/scripts/actions/quests/explorer_society/dragon.lua delete mode 100644 data-otservbr-global/scripts/actions/quests/explorer_society/icicle.lua delete mode 100644 data-otservbr-global/scripts/actions/quests/explorer_society/resonance.lua delete mode 100644 data-otservbr-global/scripts/actions/quests/explorer_society/stone.lua delete mode 100644 data-otservbr-global/scripts/actions/quests/green_djinn/tear.lua delete mode 100644 data-otservbr-global/scripts/actions/quests/the_ancient_tombs/active_teleport_switches.lua delete mode 100644 data-otservbr-global/scripts/actions/quests/the_ancient_tombs/lever.lua delete mode 100644 data-otservbr-global/scripts/actions/quests/the_ancient_tombs/ruins_instruments.lua delete mode 100644 data-otservbr-global/scripts/actions/quests/the_ape_city/mission9_catacombs_snake_destroyer.lua create mode 100644 data-otservbr-global/scripts/actions/tools/crowbar.lua delete mode 100644 data-otservbr-global/scripts/movements/quests/pits_of_inferno/check_throne.lua delete mode 100644 data-otservbr-global/scripts/movements/quests/the_ape_city/mission9_the_deepest_catacomb_teleport.lua delete mode 100644 data-otservbr-global/scripts/movements/teleport/tomb_coal_basin.lua rename data-otservbr-global/scripts/{actions/quests/dreamer_challenge/documents.lua => quests/dreamers_challenge_quest/actions_documents.lua} (79%) rename data-otservbr-global/scripts/{actions/quests/dreamer_challenge/lever_brotherhood.lua => quests/dreamers_challenge_quest/actions_lever_brotherhood.lua} (65%) rename data-otservbr-global/scripts/{actions/quests/dreamer_challenge/lever_nightmare.lua => quests/dreamers_challenge_quest/actions_lever_nightmare.lua} (65%) rename data-otservbr-global/scripts/{actions/quests/dreamer_challenge/stone_teleport.lua => quests/dreamers_challenge_quest/actions_stone_teleport.lua} (95%) rename data-otservbr-global/scripts/{actions/quests/dreamer_challenge/tic_tac.lua => quests/dreamers_challenge_quest/actions_tic_tac.lua} (100%) rename data-otservbr-global/scripts/{actions/quests/dreamer_challenge/tic_tac_teleport.lua => quests/dreamers_challenge_quest/actions_tic_tac_teleport.lua} (100%) rename data-otservbr-global/scripts/{actions/quests/dreamer_challenge/walls.lua => quests/dreamers_challenge_quest/actions_walls.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/dreamer_challenge/carrot.lua => quests/dreamers_challenge_quest/movement_carrot.lua} (63%) rename data-otservbr-global/scripts/{movements/quests/dreamer_challenge/clock_tile.lua => quests/dreamers_challenge_quest/movement_clock_tile.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/dreamer_challenge/court_teleport.lua => quests/dreamers_challenge_quest/movement_court_teleport.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/dreamer_challenge/death_ring.lua => quests/dreamers_challenge_quest/movement_death_ring.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/dreamer_challenge/death_ring_teleport.lua => quests/dreamers_challenge_quest/movement_death_ring_teleport.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/dreamer_challenge/fire_bug_teleport.lua => quests/dreamers_challenge_quest/movement_fire_bug_teleport.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/dreamer_challenge/riddle.lua => quests/dreamers_challenge_quest/movement_riddle.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/dreamer_challenge/riddle_teleport.lua => quests/dreamers_challenge_quest/movement_riddle_teleport.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/dreamer_challenge/sacrifice_teleport.lua => quests/dreamers_challenge_quest/movement_sacrifice_teleport.lua} (80%) rename data-otservbr-global/scripts/{movements/quests/dreamer_challenge/stone_teleport.lua => quests/dreamers_challenge_quest/movement_stone_teleport.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/dreamer_challenge/teleport.lua => quests/dreamers_challenge_quest/movement_teleport.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/dreamer_challenge/tic_teleport.lua => quests/dreamers_challenge_quest/movement_tic_teleport.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/dreamer_challenge/tower.lua => quests/dreamers_challenge_quest/movement_tower.lua} (84%) rename data-otservbr-global/scripts/{movements/quests/dreamer_challenge/wall_teleport.lua => quests/dreamers_challenge_quest/movement_wall_teleport.lua} (100%) create mode 100644 data-otservbr-global/scripts/quests/druid_outfits_quest/actions_ceirons_waterskin.lua rename data-otservbr-global/scripts/{actions/quests/hunter_outfit/all_hymn_piano_teleport.lua => quests/hunter_outfits_quest/action_all_hymn_piano_teleport.lua} (59%) rename data-otservbr-global/scripts/{actions/quests/hunter_outfit/music_sheet.lua => quests/hunter_outfits_quest/action_music_sheet.lua} (65%) create mode 100644 data-otservbr-global/scripts/quests/the_ancient_tombs/actions_active_teleport_switches.lua create mode 100644 data-otservbr-global/scripts/quests/the_ancient_tombs/actions_dipthrah_signs_doors.lua rename data-otservbr-global/scripts/{actions/quests/the_ancient_tombs/oasis_lever_door.lua => quests/the_ancient_tombs/actions_oasis_lever_door.lua} (100%) create mode 100644 data-otservbr-global/scripts/quests/the_ancient_tombs/actions_ruins_instruments.lua create mode 100644 data-otservbr-global/scripts/quests/the_ancient_tombs/movements_all_teleports_tombs_coal_basin.lua rename data-otservbr-global/scripts/{movements/quests/the_ancient_tombs/craft_helmet.lua => quests/the_ancient_tombs/movements_craft_helmet.lua} (91%) rename data-otservbr-global/scripts/{movements/quests/the_ancient_tombs/enter_ashmunrah_teleport_switche_done.lua => quests/the_ancient_tombs/movements_enter_ashmunrah_teleport_switche_done.lua} (84%) create mode 100644 data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_diprath_room.lua rename data-otservbr-global/scripts/{movements/quests/the_ancient_tombs/enter_diprath_teleport_switche_done.lua => quests/the_ancient_tombs/movements_enter_diprath_teleport_switche_done.lua} (70%) create mode 100644 data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_mahrdis_room.lua create mode 100644 data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_morguthis_room.lua create mode 100644 data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_omruc_room.lua create mode 100644 data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_omruc_specific.lua create mode 100644 data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_rahemos_levers.lua create mode 100644 data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_rahemos_room.lua rename data-otservbr-global/scripts/{movements/quests/the_ancient_tombs/enter_thalas_poison_tile.lua => quests/the_ancient_tombs/movements_enter_thalas_poison_tile.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/the_ancient_tombs/enter_thalas_teleport_switches_done.lua => quests/the_ancient_tombs/movements_enter_thalas_teleport_switches_done.lua} (84%) create mode 100644 data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_vashresamun_room.lua create mode 100644 data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_vashresamun_specific.lua rename data-otservbr-global/scripts/{movements/quests/the_ancient_tombs/peninsula_tomb_maze.lua => quests/the_ancient_tombs/movements_peninsula_tomb_maze.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/the_ancient_tombs/step_morguthis_blue_flames.lua => quests/the_ancient_tombs/movements_step_morguthis_blue_flames.lua} (54%) rename data-otservbr-global/scripts/{movements/quests/the_ancient_tombs/tomb_teleport.lua => quests/the_ancient_tombs/movements_tomb_teleport.lua} (97%) create mode 100644 data-otservbr-global/scripts/quests/the_ape_city/actions_mission09_snake_destroyer.lua rename data-otservbr-global/scripts/{actions/quests/the_ape_city/mission9_catacombs_lever.lua => quests/the_ape_city/actions_mission9_catacombs_lever.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/the_ape_city/mission4_parchment_decyphering.lua => quests/the_ape_city/movements_mission4_parchment_decyphering.lua} (63%) create mode 100644 data-otservbr-global/scripts/quests/the_ape_city/movements_mission9_the_deepest_catacomb_teleport.lua create mode 100644 data-otservbr-global/scripts/quests/the_djinn_war_quest/action_water_fountain.lua create mode 100644 data-otservbr-global/scripts/quests/the_explorer_society/actions_botanist.lua create mode 100644 data-otservbr-global/scripts/quests/the_explorer_society/actions_butterfly.lua create mode 100644 data-otservbr-global/scripts/quests/the_explorer_society/actions_dragon.lua rename data-otservbr-global/scripts/{actions/quests/explorer_society/findings.lua => quests/the_explorer_society/actions_findings.lua} (74%) create mode 100644 data-otservbr-global/scripts/quests/the_explorer_society/actions_icicle.lua create mode 100644 data-otservbr-global/scripts/quests/the_explorer_society/actions_resonance.lua create mode 100644 data-otservbr-global/scripts/quests/the_explorer_society/actions_stone.lua rename data-otservbr-global/scripts/{actions/quests/explorer_society/tracing_paper.lua => quests/the_explorer_society/actions_tracing_paper.lua} (53%) rename data-otservbr-global/scripts/{movements/quests/explorer_society/calassa.lua => quests/the_explorer_society/movements_calassa.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/explorer_society/carving_teleport_liberty_bay.lua => quests/the_explorer_society/movements_carving_teleport_liberty_bay.lua} (81%) rename data-otservbr-global/scripts/{movements/quests/explorer_society/carvingteleport_port_hope.lua => quests/the_explorer_society/movements_carvingteleport_port_hope.lua} (80%) rename data-otservbr-global/scripts/{actions/quests/pits_of_inferno/bazir_maze_lever.lua => quests/the_pits_of_inferno_quest/actions_bazir_maze_lever.lua} (100%) rename data-otservbr-global/scripts/{actions/quests/pits_of_inferno/bazir_mirror.lua => quests/the_pits_of_inferno_quest/actions_bazir_mirror.lua} (100%) rename data-otservbr-global/scripts/{actions/quests/pits_of_inferno/bazir_wrong_levers.lua => quests/the_pits_of_inferno_quest/actions_bazir_wrong_levers.lua} (100%) rename data-otservbr-global/scripts/{actions/quests/pits_of_inferno/fire_throne_lever.lua => quests/the_pits_of_inferno_quest/actions_fire_throne_lever.lua} (100%) rename data-otservbr-global/scripts/{actions/quests/pits_of_inferno/fountain.lua => quests/the_pits_of_inferno_quest/actions_fountain.lua} (100%) rename data-otservbr-global/scripts/{actions/quests/pits_of_inferno/ladder_levers.lua => quests/the_pits_of_inferno_quest/actions_ladder_levers.lua} (100%) rename data-otservbr-global/scripts/{actions/quests/pits_of_inferno/levers.lua => quests/the_pits_of_inferno_quest/actions_levers.lua} (100%) rename data-otservbr-global/scripts/{actions/quests/pits_of_inferno/maze_stone.lua => quests/the_pits_of_inferno_quest/actions_maze_stone.lua} (100%) rename data-otservbr-global/scripts/{actions/quests/pits_of_inferno/oil.lua => quests/the_pits_of_inferno_quest/actions_oil.lua} (100%) rename data-otservbr-global/scripts/{actions/quests/pits_of_inferno/stone_lever.lua => quests/the_pits_of_inferno_quest/actions_stone_lever.lua} (100%) rename data-otservbr-global/scripts/{actions/quests/pits_of_inferno/trap_lever.lua => quests/the_pits_of_inferno_quest/actions_trap_lever.lua} (100%) rename data-otservbr-global/scripts/{actions/quests/pits_of_inferno/walls.lua => quests/the_pits_of_inferno_quest/actions_walls.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/pits_of_inferno/bazir_tile.lua => quests/the_pits_of_inferno_quest/movements_bazir_tile.lua} (100%) create mode 100644 data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_check_throne.lua rename data-otservbr-global/scripts/{movements/quests/pits_of_inferno/drawbridge.lua => quests/the_pits_of_inferno_quest/movements_drawbridge.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/pits_of_inferno/fire_tile.lua => quests/the_pits_of_inferno_quest/movements_fire_tile.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/pits_of_inferno/holy_tible_tile.lua => quests/the_pits_of_inferno_quest/movements_holy_tible_tile.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/pits_of_inferno/ladder.lua => quests/the_pits_of_inferno_quest/movements_ladder.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/pits_of_inferno/pumin_teleport.lua => quests/the_pits_of_inferno_quest/movements_pumin_teleport.lua} (87%) rename data-otservbr-global/scripts/{movements/quests/pits_of_inferno/second_trap.lua => quests/the_pits_of_inferno_quest/movements_second_trap.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/pits_of_inferno/shortcuts.lua => quests/the_pits_of_inferno_quest/movements_shortcuts.lua} (78%) rename data-otservbr-global/scripts/{movements/quests/pits_of_inferno/stone.lua => quests/the_pits_of_inferno_quest/movements_stone.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/pits_of_inferno/throne.lua => quests/the_pits_of_inferno_quest/movements_throne.lua} (52%) rename data-otservbr-global/scripts/{movements/quests/pits_of_inferno/tile_teleport.lua => quests/the_pits_of_inferno_quest/movements_tile_teleport.lua} (100%) rename data-otservbr-global/scripts/{movements/quests/pits_of_inferno/trap.lua => quests/the_pits_of_inferno_quest/movements_trap.lua} (100%) rename data-otservbr-global/scripts/{actions/quests/the_shattered_isles/nargor_maps.lua => quests/the_shattered_isles_quest/action_nargor_maps.lua} (72%) rename data-otservbr-global/scripts/{actions/quests/the_shattered_isles/tortoise_egg_nargor.lua => quests/the_shattered_isles_quest/action_tortoise_egg_nargor.lua} (75%) rename data-otservbr-global/scripts/{movements/quests/the_sharttered_isles/energy_barrier.lua => quests/the_shattered_isles_quest/movement_energy_barrier.lua} (85%) rename data-otservbr-global/scripts/{movements/quests/the_sharttered_isles/teleport.lua => quests/the_shattered_isles_quest/movement_teleport.lua} (100%) delete mode 100644 data/scripts/actions/tools/crowbar.lua diff --git a/data-otservbr-global/lib/core/quests.lua b/data-otservbr-global/lib/core/quests.lua index 2d60761bf92..2e1741beeba 100644 --- a/data-otservbr-global/lib/core/quests.lua +++ b/data-otservbr-global/lib/core/quests.lua @@ -608,12 +608,12 @@ if not Quests then }, [7] = { name = "Factions", - startStorageId = Storage.Factions, + startStorageId = Storage.Quest.U7_4.DjinnWar.Factions, startStorageValue = 1, missions = { [1] = { name = "The Marid and the Efreet - Djinn Greeting", - storageId = Storage.DjinnWar.Faction.Greeting, + storageId = Storage.Quest.U7_4.DjinnWar.Faction.Greeting, missionId = 1064, startValue = 1, endValue = 2, @@ -625,7 +625,7 @@ if not Quests then }, [2] = { name = "The Marid and the Efreet - Marid Faction", - storageId = Storage.DjinnWar.Faction.MaridDoor, + storageId = Storage.Quest.U7_4.DjinnWar.Faction.MaridDoor, missionId = 1065, startValue = 1, endValue = 2, @@ -637,7 +637,7 @@ if not Quests then }, [3] = { name = "The Efreet and the Efreet - Efreet Faction", - storageId = Storage.DjinnWar.Faction.EfreetDoor, + storageId = Storage.Quest.U7_4.DjinnWar.Faction.EfreetDoor, missionId = 1066, startValue = 1, endValue = 2, @@ -651,12 +651,12 @@ if not Quests then }, [8] = { name = "Friends and Traders", - startStorageId = Storage.FriendsandTraders.DefaultStart, + startStorageId = Storage.Quest.U7_8.FriendsAndTraders.DefaultStart, startStorageValue = 1, missions = { [1] = { name = "The Sweaty Cyclops", - storageId = Storage.FriendsandTraders.TheSweatyCyclops, + storageId = Storage.Quest.U7_8.FriendsAndTraders.TheSweatyCyclops, missionId = 1067, startValue = 1, endValue = 2, @@ -669,7 +669,7 @@ if not Quests then }, [2] = { name = "The Mermaid Marina", - storageId = Storage.FriendsandTraders.TheMermaidMarina, + storageId = Storage.Quest.U7_8.FriendsAndTraders.TheMermaidMarina, missionId = 1068, startValue = 1, endValue = 2, @@ -682,7 +682,7 @@ if not Quests then }, [3] = { name = "The Blessed Stake", - storageId = Storage.FriendsandTraders.TheBlessedStake, + storageId = Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, missionId = 1069, startValue = 1, endValue = 12, @@ -2125,7 +2125,7 @@ if not Quests then missions = { [1] = { name = "Assassin Addon: The Red Death", - storageId = Storage.OutfitQuest.AssassinSecondAddon, + storageId = Storage.Quest.U7_8.AssassinOutfits.AssassinBaseOutfit, missionId = 10168, startValue = 1, endValue = 2, @@ -2137,7 +2137,7 @@ if not Quests then }, [2] = { name = "Citizen Addon: Backpack", - storageId = Storage.OutfitQuest.Citizen.MissionBackpack, + storageId = Storage.Quest.U7_8.CitizenOutfits.MissionBackpack, missionId = 10169, startValue = 1, endValue = 2, @@ -2150,7 +2150,7 @@ if not Quests then }, [3] = { name = "Citizen Addon: Feather Hat", - storageId = Storage.OutfitQuest.Citizen.MissionHat, + storageId = Storage.Quest.U7_8.CitizenOutfits.MissionHat, missionId = 10170, startValue = 1, endValue = 2, @@ -2162,7 +2162,7 @@ if not Quests then }, [4] = { name = "Barbarian Outfit Quest", - storageId = Storage.OutfitQuest.BarbarianAddon, + storageId = Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, missionId = 10171, startValue = 1, endValue = 17, @@ -2194,10 +2194,10 @@ if not Quests then }, [5] = { name = "Beggar Outfit: The Newest Fashion", - storageId = Storage.OutfitQuest.BeggarOutfit, + storageId = Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit, missionId = 10172, startValue = 1, - endValue = 6, + endValue = 8, states = { [1] = "Your current task is to bring Hugo 20 pieces of brown cloth, like the worn and ragged ghoul clothing.", [2] = "Your current task is to bring 50 pieces of minotaur leather to Hugo. \z @@ -2207,11 +2207,13 @@ if not Quests then [5] = "You brought all items required for the "poor man's look" to Hugo. \z He told you to come back to him after a whole day has passed, then the outfit should be finished.", [6] = "You got the outfit!", + [7] = "Now you need to go after the items to get the first addon.", + [8] = "Congratulations, you delivered the items for the first addon.", }, }, [6] = { name = "Druid Outfit Quest", - storageId = Storage.OutfitQuest.DruidHatAddon, + storageId = Storage.Quest.U7_8.DruidOutfits.DruidHatAddon, missionId = 10173, startValue = 1, endValue = 10, @@ -2232,7 +2234,7 @@ if not Quests then }, [7] = { name = "Hunter Outfit Quest", - storageId = Storage.OutfitQuest.HunterHatAddon, + storageId = Storage.Quest.U7_8.HunterOutfits.HunterHatAddon, missionId = 10174, startValue = 1, endValue = 5, @@ -2246,7 +2248,7 @@ if not Quests then }, [8] = { name = "Knight Addon: Helmet", - storageId = Storage.OutfitQuest.Knight.MissionHelmet, + storageId = Storage.Quest.U7_8.KnightOutfits.MissionHelmet, missionId = 10175, startValue = 1, endValue = 6, @@ -2265,7 +2267,7 @@ if not Quests then }, [9] = { name = "Mage & Summoner Outfit Quest (Wand)", - storageId = Storage.OutfitQuest.MageSummoner.AddonWand, + storageId = Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand, missionId = 10176, startValue = 1, endValue = 7, @@ -2283,7 +2285,7 @@ if not Quests then }, [10] = { name = "Mage & Summoner Outfit Quest (Fluid Belt)", - storageId = Storage.OutfitQuest.MageSummoner.AddonBelt, + storageId = Storage.Quest.U7_8.MageAndSummonerOutfits.AddonBelt, missionId = 10177, startValue = 1, endValue = 2, @@ -2294,7 +2296,7 @@ if not Quests then }, [11] = { name = "Female Mage and Male Summoner Addon: Headgear", - storageId = Storage.OutfitQuest.MageSummoner.MissionHatCloak, + storageId = Storage.Quest.U7_8.MageAndSummonerOutfits.MissionHatCloak, missionId = 10178, startValue = 1, endValue = 11, @@ -2331,7 +2333,7 @@ if not Quests then }, [13] = { name = "Warrior Addon: Shoulder Spike", - storageId = Storage.OutfitQuest.WarriorShoulderAddon, + storageId = Storage.Quest.U7_8.WarriorOutfits.WarriorShoulderAddon, missionId = 10180, startValue = 1, endValue = 7, @@ -2354,7 +2356,7 @@ if not Quests then }, [14] = { name = "Wizard Outfits Quest", - storageId = Storage.OutfitQuest.WizardAddon, + storageId = Storage.Quest.U7_8.WizardOutfits, missionId = 10181, startValue = 1, endValue = 7, @@ -2370,7 +2372,7 @@ if not Quests then }, [15] = { name = "Pirate Outfit Quest (Sabre)", - storageId = Storage.OutfitQuest.PirateSabreAddon, + storageId = Storage.Quest.U7_8.PirateOutfits.PirateSabreAddon, missionId = 10182, startValue = 1, endValue = 5, @@ -2384,7 +2386,7 @@ if not Quests then }, [16] = { name = "Oriental Addon: Hipwear", - storageId = Storage.OutfitQuest.FirstOrientalAddon, + storageId = Storage.Quest.U7_8.OrientalOutfits.FirstOrientalAddon, missionId = 10183, startValue = 1, endValue = 2, @@ -2397,7 +2399,7 @@ if not Quests then }, [17] = { name = "Oriental Addon: Headgear", - storageId = Storage.OutfitQuest.SecondOrientalAddon, + storageId = Storage.Quest.U7_8.OrientalOutfits.SecondOrientalAddon, missionId = 10184, startValue = 1, endValue = 5, @@ -2414,7 +2416,7 @@ if not Quests then }, [18] = { name = "Shaman Addon: Staff", - storageId = Storage.OutfitQuest.Shaman.MissionStaff, + storageId = Storage.Quest.U7_8.ShamanOutfits.MissionStaff, missionId = 10185, startValue = 1, endValue = 2, @@ -2425,7 +2427,7 @@ if not Quests then }, [19] = { name = "Shaman Addon: Mask", - storageId = Storage.OutfitQuest.Shaman.MissionMask, + storageId = Storage.Quest.U7_8.ShamanOutfits.MissionMask, missionId = 10186, startValue = 1, endValue = 2, @@ -2438,12 +2440,12 @@ if not Quests then }, [13] = { name = "Sam's Old Backpack", - startStorageId = Storage.SamsOldBackpack, + startStorageId = Storage.Quest.U7_5.SamsOldBackpack.SamsOldBackpackNpc, startStorageValue = 1, missions = { [1] = { name = "Dwarven Armor Quest", - storageId = Storage.SamsOldBackpack, + storageId = Storage.Quest.U7_5.SamsOldBackpack.SamsOldBackpackNpc, missionId = 10187, startValue = 1, endValue = 3, @@ -2752,75 +2754,98 @@ if not Quests then }, [16] = { name = "The Ancient Tombs", - startStorageId = Storage.TheAncientTombs.DefaultStart, + startStorageId = Storage.Quest.U7_4.TheAncientTombs.DefaultStart, startStorageValue = 1, missions = { [1] = { name = "Omruc's Treasure", - storageId = Storage.TheAncientTombs.OmrucsTreasure, + storageId = Storage.Quest.U7_4.TheAncientTombs.OmrucsTreasure, missionId = 10210, startValue = 1, - endValue = 1, - description = "You defeated Omruc and received a helmet adornment", + endValue = 2, + states = { + [1] = "Now you can start the steps until you reach Omruc's room.", + [2] = "You defeated Omruc and received a helmet adornment.", + }, }, [2] = { name = "Thalas' Treasure", - storageId = Storage.TheAncientTombs.ThalasTreasure, + storageId = Storage.Quest.U7_4.TheAncientTombs.ThalasTreasure, missionId = 10211, startValue = 1, - endValue = 1, - description = "You defeated Thalas and received a Gem Holder", + endValue = 2, + states = { + [1] = "Congratulations, you have pulled all 8 levers and can now continue to the next step.", + [2] = "You defeated Thalas and received a Gem Holder", + }, }, [3] = { name = "Diphtrah's Treasure", - storageId = Storage.TheAncientTombs.DiphtrahsTreasure, + storageId = Storage.Quest.U7_4.TheAncientTombs.DiphtrahsTreasure, missionId = 10212, startValue = 1, - endValue = 1, - description = "You defeated Dipthrah and received a Damaged Helmet", + endValue = 3, + states = { + [1] = "Now you need to pull all 11 levers to be able to continue.", + [2] = "Now you need to use all the plaques before accessing Diphtrah's room.", + [3] = "Congratulations, this step has been completed.", + }, }, [4] = { name = "Mahrdis' Treasure", - storageId = Storage.TheAncientTombs.MahrdisTreasure, + storageId = Storage.Quest.U7_4.TheAncientTombs.MahrdisTreasure, missionId = 10213, startValue = 1, - endValue = 1, - description = "You defeated Mahrdis and received a Helmet Ornament", + endValue = 2, + states = { + [1] = "You need to defeat Mahrdis and receive a Helmet Ornament.", + [2] = "You defeated Mahrdis and received a Helmet Ornament.", + }, }, [5] = { name = "Vashresamun's Treasure", - storageId = Storage.TheAncientTombs.VashresamunsTreasure, + storageId = Storage.Quest.U7_4.TheAncientTombs.VashresamunsTreasure, missionId = 10214, startValue = 1, - endValue = 1, - description = "You solved the musical riddles of Vashresamun's Tomb and received a left horn.", + endValue = 3, + states = { + [1] = "Once you've started this quest, you'll need to play the musicals before teleporting.", + [2] = "Congratulations, you played the musical correctly, now you can continue.", + [3] = "You solved the musical riddles of Vashresamun's Tomb and received a left horn.", + }, }, [6] = { name = "Morguthis' Treasure", - storageId = Storage.TheAncientTombs.MorguthisTreasure, + storageId = Storage.Quest.U7_4.TheAncientTombs.MorguthisTreasure, missionId = 10215, startValue = 1, - endValue = 1, - description = "You defeated Morguthis and received a Right Horn", + endValue = 2, + states = { + [1] = "Now you need to go over the blue fireworks on the path.", + [2] = "You defeated Morguthis and received a Right Horn.", + }, }, [7] = { name = "Rahemos' Treasure", - storageId = Storage.TheAncientTombs.RahemosTreasure, + storageId = Storage.Quest.U7_4.TheAncientTombs.RahemosTreasure, missionId = 10216, startValue = 1, - endValue = 1, - description = "You defeated Rahemos and received a Helmet Piece", + endValue = 2, + states = { + [1] = "You have started the steps to access Rahemos' room, and you will need to pull some levers to get to Rahemos' room.", + [2] = "You defeated Rahemos and received a Helmet Piece.", + }, }, }, }, [17] = { name = "The Ape City", - startStorageId = Storage.TheApeCity.Started, + startStorageId = Storage.Quest.U7_6.TheApeCity.Started, startStorageValue = 1, missions = { [1] = { name = "Hairycles' Missions", - storageId = Storage.TheApeCity.Questline, + storageId = Storage.Quest.U7_6.TheApeCity.Questline, missionId = 10217, startValue = 1, endValue = 18, @@ -2948,12 +2973,12 @@ if not Quests then }, [19] = { name = "The Djinn War - Efreet Faction", - startStorageId = Storage.DjinnWar.EfreetFaction.Start, + startStorageId = Storage.Quest.U7_4.DjinnWar.EfreetFaction.Start, startStorageValue = 1, missions = { [1] = { name = "Efreet Mission 1: The Supply Thief", - storageId = Storage.DjinnWar.EfreetFaction.Mission01, + storageId = Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission01, missionId = 10221, startValue = 1, endValue = 3, @@ -2967,7 +2992,7 @@ if not Quests then }, [2] = { name = "Efreet Mission 2: The Tear of Daraman", - storageId = Storage.DjinnWar.EfreetFaction.Mission02, + storageId = Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission02, missionId = 10222, startValue = 1, endValue = 3, @@ -2981,7 +3006,7 @@ if not Quests then }, [3] = { name = "Efreet Mission 3: The Sleeping Lamp", - storageId = Storage.DjinnWar.EfreetFaction.Mission03, + storageId = Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission03, missionId = 10223, startValue = 1, endValue = 3, @@ -2996,12 +3021,12 @@ if not Quests then }, [20] = { name = "The Djinn War - Marid Faction", - startStorageId = Storage.DjinnWar.MaridFaction.Start, + startStorageId = Storage.Quest.U7_4.DjinnWar.MaridFaction.Start, startStorageValue = 1, missions = { [1] = { name = "Marid Mission 1: The Dwarven Kitchen", - storageId = Storage.DjinnWar.MaridFaction.Mission01, + storageId = Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission01, missionId = 10224, startValue = 1, endValue = 2, @@ -3013,7 +3038,7 @@ if not Quests then }, [2] = { name = "Marid Mission 2: The Spyreport", - storageId = Storage.DjinnWar.MaridFaction.Mission02, + storageId = Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission02, missionId = 10225, startValue = 1, endValue = 2, @@ -3026,7 +3051,7 @@ if not Quests then }, [3] = { name = "Rata'Mari and the Cheese", - storageId = Storage.DjinnWar.MaridFaction.RataMari, + storageId = Storage.Quest.U7_4.DjinnWar.MaridFaction.RataMari, missionId = 10226, startValue = 1, endValue = 2, @@ -3037,7 +3062,7 @@ if not Quests then }, [4] = { name = "Marid Mission 3: The Sleeping Lamp", - storageId = Storage.DjinnWar.MaridFaction.Mission03, + storageId = Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission03, missionId = 10227, startValue = 1, endValue = 3, @@ -3628,12 +3653,12 @@ if not Quests then }, [25] = { name = "The Shattered Isles", - startStorageId = Storage.TheShatteredIsles.DefaultStart, + startStorageId = Storage.Quest.U7_8.TheShatteredIsles.DefaultStart, startStorageValue = 1, missions = { [1] = { name = "A Djinn in Love", - storageId = Storage.TheShatteredIsles.ADjinnInLove, + storageId = Storage.Quest.U7_8.TheShatteredIsles.ADjinnInLove, missionId = 10263, startValue = 1, endValue = 5, @@ -3649,7 +3674,7 @@ if not Quests then }, [2] = { name = "A Poem for the Mermaid", - storageId = Storage.TheShatteredIsles.APoemForTheMermaid, + storageId = Storage.Quest.U7_8.TheShatteredIsles.APoemForTheMermaid, missionId = 10264, startValue = 1, endValue = 3, @@ -3664,7 +3689,7 @@ if not Quests then }, [3] = { name = "Access to Goroma", - storageId = Storage.TheShatteredIsles.AccessToGoroma, + storageId = Storage.Quest.U7_8.TheShatteredIsles.AccessToGoroma, missionId = 10265, startValue = 1, endValue = 1, @@ -3673,7 +3698,7 @@ if not Quests then }, [4] = { name = "Access to Laguna Island", - storageId = Storage.TheShatteredIsles.AccessToLagunaIsland, + storageId = Storage.Quest.U7_8.TheShatteredIsles.AccessToLagunaIsland, missionId = 10266, startValue = 1, endValue = 1, @@ -3682,7 +3707,7 @@ if not Quests then }, [5] = { name = "Access to Meriana", - storageId = Storage.TheShatteredIsles.AccessToMeriana, + storageId = Storage.Quest.U7_8.TheShatteredIsles.AccessToMeriana, missionId = 10267, startValue = 1, endValue = 1, @@ -3691,7 +3716,7 @@ if not Quests then }, [6] = { name = "Access to Nargor", - storageId = Storage.TheShatteredIsles.AccessToNargor, + storageId = Storage.Quest.U7_8.TheShatteredIsles.AccessToNargor, missionId = 10268, startValue = 1, endValue = 1, @@ -3700,7 +3725,7 @@ if not Quests then }, [7] = { name = "Ray's Mission 1: Fafnar's Fire", - storageId = Storage.TheShatteredIsles.RaysMission1, + storageId = Storage.Quest.U7_8.TheShatteredIsles.RaysMission1, missionId = 10269, startValue = 1, endValue = 3, @@ -3715,7 +3740,7 @@ if not Quests then }, [8] = { name = "Ray's Mission 2: Sabotage", - storageId = Storage.TheShatteredIsles.RaysMission2, + storageId = Storage.Quest.U7_8.TheShatteredIsles.RaysMission2, missionId = 10270, startValue = 1, endValue = 3, @@ -3730,7 +3755,7 @@ if not Quests then }, [9] = { name = "Ray's Mission 3: Spy Mission", - storageId = Storage.TheShatteredIsles.RaysMission3, + storageId = Storage.Quest.U7_8.TheShatteredIsles.RaysMission3, missionId = 10271, startValue = 1, endValue = 2, @@ -3743,7 +3768,7 @@ if not Quests then }, [10] = { name = "Ray's Mission 4: Proof of Death", - storageId = Storage.TheShatteredIsles.RaysMission4, + storageId = Storage.Quest.U7_8.TheShatteredIsles.RaysMission4, missionId = 10272, startValue = 1, endValue = 5, @@ -3762,7 +3787,7 @@ if not Quests then }, [11] = { name = "Reputation in Sabrehaven: Suspicious", - storageId = Storage.TheShatteredIsles.ReputationInSabrehaven, + storageId = Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, missionId = 10273, startValue = 2, endValue = 13, @@ -3791,7 +3816,7 @@ if not Quests then }, [12] = { name = "Reputation in Sabrehaven: Friendly", - storageId = Storage.TheShatteredIsles.ReputationInSabrehaven, + storageId = Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, missionId = 10274, startValue = 14, endValue = 17, @@ -3806,7 +3831,7 @@ if not Quests then }, [13] = { name = "Reputation in Sabrehaven: Cordial", - storageId = Storage.TheShatteredIsles.ReputationInSabrehaven, + storageId = Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, missionId = 10275, startValue = 18, endValue = 19, @@ -3815,7 +3840,7 @@ if not Quests then }, [14] = { name = "Reputation in Sabrehaven: Loyal", - storageId = Storage.TheShatteredIsles.ReputationInSabrehaven, + storageId = Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, missionId = 10276, startValue = 20, endValue = 22, @@ -3827,7 +3852,7 @@ if not Quests then }, [15] = { name = "The Counterspell", - storageId = Storage.TheShatteredIsles.TheCounterspell, + storageId = Storage.Quest.U7_8.TheShatteredIsles.TheCounterspell, missionId = 10277, startValue = 1, endValue = 4, @@ -3844,7 +3869,7 @@ if not Quests then }, [16] = { name = "The Errand", - storageId = Storage.TheShatteredIsles.TheErrand, + storageId = Storage.Quest.U7_8.TheShatteredIsles.TheErrand, missionId = 10278, startValue = 1, endValue = 2, @@ -3856,7 +3881,7 @@ if not Quests then }, [17] = { name = "The Governor's Daughter", - storageId = Storage.TheShatteredIsles.TheGovernorDaughter, + storageId = Storage.Quest.U7_8.TheShatteredIsles.TheGovernorDaughter, missionId = 10279, startValue = 1, endValue = 3, @@ -4077,12 +4102,12 @@ if not Quests then }, [28] = { name = "The Explorer Society", - startStorageId = Storage.ExplorerSociety.QuestLine, + startStorageId = Storage.Quest.U7_6.ExplorerSociety.QuestLine, startStorageValue = 1, missions = { [1] = { name = "Joining the Explorers", - storageId = Storage.ExplorerSociety.JoiningTheExplorers, + storageId = Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers, missionId = 10295, startValue = 1, endValue = 5, @@ -4097,7 +4122,7 @@ if not Quests then }, [2] = { name = "The Ice Delivery", - storageId = Storage.ExplorerSociety.TheIceDelivery, + storageId = Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery, missionId = 10296, startValue = 6, endValue = 8, @@ -4111,7 +4136,7 @@ if not Quests then }, [3] = { name = "The Butterfly Hunt", - storageId = Storage.ExplorerSociety.TheButterflyHunt, + storageId = Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, missionId = 10297, startValue = 9, endValue = 17, @@ -4132,7 +4157,7 @@ if not Quests then }, [4] = { name = "The Plant Collection", - storageId = Storage.ExplorerSociety.ThePlantCollection, + storageId = Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, missionId = 10298, startValue = 18, endValue = 26, @@ -4150,7 +4175,7 @@ if not Quests then }, [5] = { name = "The Lizard Urn", - storageId = Storage.ExplorerSociety.TheLizardUrn, + storageId = Storage.Quest.U7_6.ExplorerSociety.TheLizardUrn, missionId = 10299, startValue = 27, endValue = 29, @@ -4164,7 +4189,7 @@ if not Quests then }, [6] = { name = "The Bonelord Secret", - storageId = Storage.ExplorerSociety.TheBonelordSecret, + storageId = Storage.Quest.U7_6.ExplorerSociety.TheBonelordSecret, missionId = 10300, startValue = 30, endValue = 32, @@ -4177,7 +4202,7 @@ if not Quests then }, [7] = { name = "The Orc Powder", - storageId = Storage.ExplorerSociety.TheOrcPowder, + storageId = Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder, missionId = 10301, startValue = 33, endValue = 35, @@ -4191,7 +4216,7 @@ if not Quests then }, [8] = { name = "The Elven Poetry", - storageId = Storage.ExplorerSociety.TheElvenPoetry, + storageId = Storage.Quest.U7_6.ExplorerSociety.TheElvenPoetry, missionId = 10302, startValue = 36, endValue = 38, @@ -4203,7 +4228,7 @@ if not Quests then }, [9] = { name = "The Memory Stone", - storageId = Storage.ExplorerSociety.TheMemoryStone, + storageId = Storage.Quest.U7_6.ExplorerSociety.TheMemoryStone, missionId = 10303, startValue = 39, endValue = 41, @@ -4215,7 +4240,7 @@ if not Quests then }, [10] = { name = "The Rune Writings", - storageId = Storage.ExplorerSociety.TheRuneWritings, + storageId = Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings, missionId = 10304, startValue = 42, endValue = 44, @@ -4229,7 +4254,7 @@ if not Quests then }, [11] = { name = "The Ectoplasm", - storageId = Storage.ExplorerSociety.TheEctoplasm, + storageId = Storage.Quest.U7_6.ExplorerSociety.TheEctoplasm, missionId = 10305, startValue = 45, endValue = 47, @@ -4240,7 +4265,7 @@ if not Quests then }, [12] = { name = "The Spectral Dress", - storageId = Storage.ExplorerSociety.TheSpectralDress, + storageId = Storage.Quest.U7_6.ExplorerSociety.TheSpectralDress, missionId = 10306, startValue = 48, endValue = 50, @@ -4252,7 +4277,7 @@ if not Quests then }, [13] = { name = "The Spectral Stone", - storageId = Storage.ExplorerSociety.TheSpectralStone, + storageId = Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, missionId = 10307, startValue = 51, endValue = 55, @@ -4267,7 +4292,7 @@ if not Quests then }, [14] = { name = "The Astral Portals", - storageId = Storage.ExplorerSociety.TheAstralPortals, + storageId = Storage.Quest.U7_6.ExplorerSociety.TheAstralPortals, missionId = 10308, startValue = 56, endValue = 56, @@ -4278,7 +4303,7 @@ if not Quests then }, [15] = { name = "The Island of Dragons", - storageId = Storage.ExplorerSociety.TheIslandofDragons, + storageId = Storage.Quest.U7_6.ExplorerSociety.TheIslandofDragons, missionId = 10309, startValue = 57, endValue = 59, @@ -4290,7 +4315,7 @@ if not Quests then }, [16] = { name = "The Ice Music", - storageId = Storage.ExplorerSociety.TheIceMusic, + storageId = Storage.Quest.U7_6.ExplorerSociety.TheIceMusic, missionId = 10310, startValue = 60, endValue = 62, @@ -4304,14 +4329,14 @@ if not Quests then }, [17] = { name = "The Undersea Kingdom", - storageId = Storage.ExplorerSociety.CalassaQuest, + storageId = Storage.Quest.U7_6.ExplorerSociety.CalassaQuest, missionId = 10311, startValue = 1, endValue = 3, states = { - [1] = "Captain Max will bring you to Calassa whenever you are ready. \z - Please try to retrieve the missing logbook which must be in one of the sunken shipwrecks.", + [1] = "Captain Max will bring you to Calassa whenever you are ready. Please try to retrieve the missing logbook which must be in one of the sunken shipwrecks.", [2] = "Report about your Calassa mission to Berenice in Liberty Bay.", + [3] = "Congratulations, you completed the remaining part of this mission!", }, }, }, diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 98aa057f9ca..56e940c059a 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -89,22 +89,17 @@ Storage = { KawillBlessing = 30014, RentedHorseTimer = 30015, FountainOfLife = 30016, - KnightwatchTowerDoor = 30017, -- Promotion Storage cannot be changed, it is set in source code Promotion = 30018, RookgaardHints = 30019, RookgaardDestiny = 30020, EruaranGreeting = 30021, MaryzaCookbook = 30022, - Factions = 30024, -- unused TrainerRoom = 30027, -- unused NpcSpawn = 30028, -- unused ExerciseDummyExhaust = 30029, - SamsOldBackpack = 30030, - SamsOldBackpackDoor = 30031, ChayenneReward = 30033, SwampDiggingTimeout = 30034, - HydraEggQuest = 30035, Atrad = 30036, ElementalistQuest1 = 30037, ElementalistQuest2 = 30038, @@ -521,41 +516,6 @@ Storage = { AmuletTimer = 50520, AmuletStatus = 50521, }, - ExplorerSociety = { - -- Reserved storage from 50530 - 50599 - QuestLine = 50530, - SpectralStone = 50531, - SkullOfRatha = 50532, - GiantSmithHammer = 50533, - JoiningTheExplorers = 505344, - TheIceDelivery = 50535, - TheButterflyHunt = 50536, - ThePlantCollection = 50537, - TheLizardUrn = 50538, - TheBonelordSecret = 50539, - TheOrcPowder = 50540, - CalassaQuest = 50541, - TheMemoryStone = 50542, - TheRuneWritings = 50543, - TheEctoplasm = 50544, - TheSpectralDress = 50545, - TheSpectralStone = 50546, - TheAstralPortals = 50547, - TheIslandofDragons = 50548, - TheIceMusic = 50549, - BansheeDoor = 50550, - BonelordsDoor = 50551, - CalassaDoor = 50552, - MemoryStoneDoor = 50553, - ElvenDoor = 50554, - OrcDoor = 50555, - ChorurnDoor = 50556, - DwacatraDoor = 50557, - FamilyBroochDoor = 50558, - TheElvenPoetry = 50559, - SpectralStoneDoor = 50560, - IceMusicDoor = 50561, - }, TravellingTrader = { -- Reserved storage from 50600 - 50619 Mission01 = 50600, @@ -567,34 +527,6 @@ Storage = { Mission07 = 50606, -- unused packageDoor = 50607 }, - DjinnWar = { - -- Reserved storage from 50620 - 50649 - Faction = { - Greeting = 50620, - MaridDoor = 50621, - EfreetDoor = 50622, - }, - RecievedLamp = 50625, - -- Blue djinn - MaridFaction = { - Start = 50630, - Mission01 = 50631, - Mission02 = 50632, - RataMari = 50633, - Mission03 = 50634, - DoorToLamp = 50635, - DoorToEfreetTerritory = 50636, - }, - -- Green djinn - EfreetFaction = { - Start = 50640, - Mission01 = 50641, - Mission02 = 50642, - Mission03 = 50643, - DoorToLamp = 50644, - DoorToMaridTerritory = 50645, - }, - }, VampireHunter = { -- Reserved storage from 50650 - 50659 Rank = 50650, @@ -809,123 +741,13 @@ Storage = { -- Until all outfit quests are completed DefaultStart = 50960, Ref = 50961, - Citizen = { - -- Mission storages for temporary questlog entries - MissionHat = 50966, - AddonHat = 50967, - MissionBackpack = 50968, - AddonBackpack = 50969, - AddonBackpackTimer = 50970, - }, - -- Begger Outfit Quest - BeggarFirstAddonDoor = 50975, -- Staff quest - BeggarSecondAddon = 50976, - -- Druid-outfit Quest - DruidHatAddon = 50977, - DruidBodyAddon = 50978, - DruidAmuletDoor = 50979, - -- Barbarian-outfit Quest - BarbarianAddon = 50980, - BarbarianAddonWaitTimer = 50981, - -- Beggar - BeggarOutfit = 50982, - BeggarOutfitTimer = 50983, - -- Hunter-outfit Quest - HunterMusicSheet01 = 50984, - HunterMusicSheet02 = 50985, - HunterMusicSheet03 = 50986, - HunterMusicSheet04 = 50987, - HunterBodyAddon = 50988, - HunterHatAddon = 50989, - Hunter = { - AddonGlove = 50990, - AddonHat = 50991, - }, - Knight = { - AddonSword = 50992, - MissionHelmet = 50993, - AddonHelmet = 50994, - AddonHelmetTimer = 50995, - RamsaysHelmetDoor = 50996, - }, - MageSummoner = { - AddonWand = 50997, - AddonBelt = 50998, - MissionHatCloak = 50999, - AddonHatCloak = 51000, - AddonWandTimer = 51001, - }, - -- Nobleman Outfit - NoblemanFirstAddon = 51002, - NoblemanSecondAddon = 51003, -- Norseman-outfit Quest NorsemanAddon = 51004, - -- Warrior-outfit Quest - WarriorShoulderAddon = 51005, - WarriorSwordAddon = 51006, - WarriorShoulderTimer = 51007, - -- Wizard-outfit Quest - WizardAddon = 51008, - -- Pirate-outfit Quest - PirateBaseOutfit = 51009, - PirateSabreAddon = 51010, - PirateHatAddon = 51011, - -- Assassin Outfit - AssassinBaseOutfit = 51012, - AssassinFirstAddon = 51013, - AssassinSecondAddon = 51014, -- Golden Outfit GoldenOutfit = 51015, - NightmareOutfit = 51016, - NightmareDoor = 51017, - BrotherhoodOutfit = 51018, - BrotherhoodDoor = 51019, - Shaman = { - AddonStaffMask = 51020, - MissionStaff = 51021, - MissionMask = 51022, - }, DeeplingAnchor = 51023, - FirstOrientalAddon = 51024, - SecondOrientalAddon = 51025, RoyalCostumeOutfit = 51026, }, - TheAncientTombs = { - -- Reserved storage from 50940 - 51059 - DefaultStart = 50940, - VashresamunInstruments = 50941, - VashresamunsDoor = 50942, - MorguthisBlueFlameStorage1 = 50943, - MorguthisBlueFlameStorage2 = 50944, - MorguthisBlueFlameStorage3 = 50945, - MorguthisBlueFlameStorage4 = 50946, - MorguthisBlueFlameStorage5 = 50947, - MorguthisBlueFlameStorage6 = 50948, - MorguthisBlueFlameStorage7 = 50949, - - OmrucsTreasure = 50950, - ThalasTreasure = 50951, - DiphtrahsTreasure = 50952, - MahrdisTreasure = 50953, - VashresamunsTreasure = 50954, - MorguthisTreasure = 50955, - RahemosTreasure = 50956, - }, - TheApeCity = { - -- Reserved storage from 51060 - 51079 - Started = 51060, - Questline = 51061, - DworcDoor = 51062, - ChorDoor = 51063, - ParchmentDecyphering = 51064, - FibulaDoor = 51065, - WitchesCapSpot = 51066, - CasksDoor = 51067, - Casks = 51068, - HolyApeHair = 51069, - SnakeDestroyer = 51070, - ShamanOufit = 51071, - }, TheInquisition = { -- Reserved storage from 51110 - 51139 Questline = 51110, @@ -1098,14 +920,6 @@ Storage = { BossRoom = 51332, }, }, - FriendsandTraders = { - -- Reserved storage from 51340 - 51359 - DefaultStart = 51340, - TheSweatyCyclops = 51341, - TheMermaidMarina = 51342, - TheBlessedStake = 51343, - TheBlessedStakeWaitTime = 51344, - }, Postman = { -- Reserved storage from 51360 - 51389 Mission01 = 51360, @@ -1243,32 +1057,6 @@ Storage = { Questline = 51532, }, }, - TheShatteredIsles = { - -- Reserved storage from 51540 - 51589 - DefaultStart = 51540, - TheGovernorDaughter = 51541, - TheErrand = 51542, - AccessToMeriana = 51543, - APoemForTheMermaid = 51544, - ADjinnInLove = 51545, - AccessToLagunaIsland = 51546, - AccessToGoroma = 51547, - Shipwrecked = 51548, - DragahsSpellbook = 51549, - TheCounterspell = 51550, - ReputationInSabrehaven = 51551, - RaysMission1 = 51552, - RaysMission2 = 51553, - RaysMission3 = 51554, - RaysMission4 = 51555, - AccessToNargor = 51556, - TortoiseEggNargorDoor = 51557, - TortoiseEggNargorTime = 51558, - YavernDoor = 51559, - TavernMap1 = 51560, - TavernMap2 = 51561, - TavernMap3 = 51562, - }, SearoutesAroundYalahar = { -- Reserved storage from 51590 - 51609 TownsCounter = 51590, @@ -1415,20 +1203,8 @@ Storage = { DragahsSpellbook = 51768, StealFromThieves = 51769, OutlawCamp = 51770, -- quest log to The Outlaw Camp - }, - PitsOfInferno = { - -- Reserved storage from 52000 - 52019 - ShortcutHubDoor = 52000, - ShortcutLeverDoor = 52001, - Pumin = 52002, - WeaponReward = 52003, - ThroneInfernatil = 52004, - ThroneTafariel = 52005, - ThroneVerminor = 52006, - ThroneApocalypse = 52007, - ThroneBazir = 52008, - ThroneAshfalor = 52009, - ThronePumin = 52010, + WitchHouseQuest = 51771, + SimonTheBeggarsFavoriteStaff = 51772, }, HorestisTomb = { -- Reserved storage from 52020 - 52029 @@ -1558,17 +1334,6 @@ Storage = { QuestLine = 52148, TheLostBrother = 52149, }, - DreamersChallenge = { - -- Reserved storage from 52160 - 52199 - LeverNightmare1 = 52160, - LeverNightmare2 = 52161, - LeverNightmare3 = 52162, - LeverBrotherhood1 = 52163, - LeverBrotherhood2 = 52164, - LeverBrotherhood3 = 52165, - TicTac = 52166, - Reward = 52167, - }, HallsOfHope = { -- Reserved storage from 52200 - 52219 Questline = 52200, @@ -1707,6 +1472,7 @@ Storage = { ID3620 = 3620, ID3666 = 3666, ID3667 = 3667, + ID3700 = 3700, ID3702 = 3702, ID3800 = 3800, ID3801 = 3801, @@ -1737,6 +1503,26 @@ Storage = { Cookies = 40031, }, }, + OrcFortress = { + Rewards = { + KnightAxe = 40033, + KnightArmor = 40034, + FireSword = 40035, + }, + }, + Panpipe = { + Rewards = { + Panpipe = 40036, + }, + }, + }, + U6_2 = { -- update 6.2 - Reserved Storages 40051 - 40070 + Draconia = { + Rewards = { + BagWithWeapons = 40051, + BagWithAmulets = 40052, + }, + }, }, U6_4 = { -- update 6.4 - Reserved Storages 40071 - 40110 BerserkerTreasure = { @@ -1804,20 +1590,10 @@ Storage = { FamilyBrooch = { Brooch = 9000, }, - GiantSmithhammer = { - QuestLine = 10091, - Talon = 10092, - Hammer = 10093, - GoldCoin = 10094, - }, MadMageRoom = { QuestLine = 10095, APrisoner = 10096, }, - SkullOfRatha = { - Bag1 = 10100, - Bag2 = 10101, - }, TheAnnihilator = { Reward = 10102, }, @@ -1839,54 +1615,322 @@ Storage = { VoodooDoll = {}, }, U7_3 = { -- update 7.3 - Reserved Storages 40351 - 40400 - MedusaShield = {}, - SerpentineTower = {}, - WhitePearl = {}, + TheMedusaQuest = 40351, + SerpentineTower = { + WhitePearl = 40352, + }, }, U7_4 = { -- update 7.4 - Reserved Storages 40401 - 40600 - TheAncientTombs = {}, - TheDjinnWarEfreetFaction = {}, - TheDjinnWarMaridFaction = {}, + TheAncientTombs = { + DefaultStart = 40401, + VashresamunInstruments = 40402, + VashresamunsDoor = 40403, + MorguthisBlueFlameStorage1 = 40404, + MorguthisBlueFlameStorage2 = 40405, + MorguthisBlueFlameStorage3 = 40406, + MorguthisBlueFlameStorage4 = 40407, + MorguthisBlueFlameStorage5 = 40408, + MorguthisBlueFlameStorage6 = 40409, + MorguthisBlueFlameStorage7 = 40410, + OmrucsTreasure = 40411, + ThalasTreasure = 40412, + DiphtrahsTreasure = 40413, + MahrdisTreasure = 40414, + VashresamunsTreasure = 40415, + MorguthisTreasure = 40416, + RahemosTreasure = 40417, + ThalasSwitchesGlobalStorage = 40418, + DiprathSwitchesGlobalStorage = 40419, + AshmunrahSwitchesGlobalStorage = 40420, + Diprath_sign1 = 40421, + Diprath_sign2 = 40422, + Diprath_sign3 = 40423, + Diprath_sign4 = 40424, + Diprath_sign5 = 40425, + Diprath_sign6 = 40426, + Diprath_sign7 = 40427, + Diprath_sign8 = 40428, + }, + DjinnWar = { + Factions = 40429, + -- Reserved storage from 50620 - 50649 + Faction = { + Greeting = 40430, + MaridDoor = 40431, + EfreetDoor = 40432, + }, + RecievedLamp = 40433, + -- Blue djinn + MaridFaction = { + Start = 40434, + Mission01 = 40435, + Mission02 = 40436, + RataMari = 40437, + Mission03 = 40438, + DoorToLamp = 40439, + DoorToEfreetTerritory = 40440, + }, + -- Green djinn + EfreetFaction = { + Start = 40441, + Mission01 = 40442, + Mission02 = 40443, + Mission03 = 40444, + DoorToLamp = 40445, + DoorToMaridTerritory = 40446, + }, + }, }, U7_5 = { -- update 7.5 - Reserved Storages 40601 - 40610 - ElephantTusk = {}, - SamsOldBackpack = {}, + ElephantTusk = 40601, + SamsOldBackpack = { + SamsOldBackpackNpc = 40602, + SamsOldBackpackDoor = 40603, + }, }, U7_6 = { -- update 7.6 - Reserved Storages 40611 - 40760 - HydraEgg = {}, - TheApeCity = {}, - TheExplorerSociety = {}, + HydraEggQuest = 40611, + TheApeCity = { + Started = 40612, + Questline = 40613, + DworcDoor = 40614, + ChorDoor = 40615, + ParchmentDecyphering = 40616, + FibulaDoor = 40617, + WitchesCapSpot = 40618, + CasksDoor = 40619, + Casks = 40620, + HolyApeHair = 40621, + SnakeDestroyer = 40622, + ShamanOufit = 40623, + TheLargeAmphoras1 = 40624, + TheLargeAmphoras2 = 40625, + TheLargeAmphoras3 = 40626, + TheLargeAmphoras4 = 40627, + TheLargeAmphorasCooldown = 40628, + }, + ExplorerSociety = { + QuestLine = 40629, + SpectralStone = 40630, + JoiningTheExplorers = 40631, + TheIceDelivery = 40632, + TheButterflyHunt = 40633, + ThePlantCollection = 40634, + TheLizardUrn = 40635, + TheBonelordSecret = 40636, + TheOrcPowder = 40637, + CalassaQuest = 40638, + TheMemoryStone = 40639, + TheRuneWritings = 40640, + TheEctoplasm = 40641, + TheSpectralDress = 40642, + TheSpectralStone = 40643, + TheAstralPortals = 40644, + TheIslandofDragons = 40645, + TheIceMusic = 40646, + BansheeDoor = 40647, + BonelordsDoor = 40648, + CalassaDoor = 40649, + MemoryStoneDoor = 40650, + ElvenDoor = 40651, + OrcDoor = 40652, + ChorurnDoor = 40653, + DwacatraDoor = 40654, + FamilyBroochDoor = 40655, + TheElvenPoetry = 40656, + SpectralStoneDoor = 40657, + IceMusicDoor = 40658, + ExplorerBrooch = 40659, + SkullOfRatha = { + Bag1 = 40660, + Bag2 = 40661, + }, + GiantSmithHammer = { + Talon = 40662, + Hammer = 40663, + GoldCoin = 40664, + }, + Books = { + Cyclops = 40665, + Hengis = 40666, + }, + }, }, U7_8 = { -- update 7.8 - Reserved Storages 40761 - 41000 - AssassinOutfits = {}, - BarbarianOutfits = {}, - BeggarOutfits = {}, - CitizenOutfits = {}, - CitizenOutfitsRook = {}, - DruidOutfits = {}, - DruidOutfitsRook = {}, - HunterOutfits = {}, - KnightOutfits = {}, - MageOutfits = {}, - MarlinTrophy = {}, - Meriana = {}, - NoblemanOutfits = {}, - ObsidianKnife = {}, - OrientalOutfits = {}, - PirateOutfits = {}, - ShamanOutfits = {}, - SummonerOutfits = {}, - TheBlessedStake = {}, - TheMermaidMarina = {}, - TheShatteredIsles = {}, - TheSweatyCyclops = {}, - TreasureIsland = {}, - WarriorOutfits = {}, - WizardOutfits = {}, + AssassinOutfits = { + AssassinBaseOutfit = 40761, + AssassinFirstAddon = 40762, + AssassinSecondAddon = 40763, + }, + BarbarianOutfits = { + BarbarianAddon = 40764, + BarbarianAddonWaitTimer = 40765, + }, + BeggarOutfits = { + BeggarOutfit = 40766, + BeggarOutfitTimer = 40767, + BeggarFirstAddonDoor = 40768, + BeggarSecondAddon = 40769, + BeggarOutfitTimerAddon = 40770, + }, + CitizenOutfitsRook = { + MissionHatRook = 40771, + AddonHatRook = 40772, + MissionBackpackRook = 40773, + AddonBackpackRook = 40774, + AddonBackpackRookTimer = 40775, + }, + CitizenOutfits = { + MissionHat = 40776, + AddonHat = 40777, + MissionBackpack = 40778, + AddonBackpack = 40779, + AddonBackpackTimer = 40780, + }, + DruidOutfitsRook = { + DruidBodyAddonRook = 40781, + }, + DruidOutfits = { + DruidHatAddon = 40782, + DruidBodyAddon = 40783, + DruidAmuletDoor = 40784, + GriffinclawFlower = 40785, + CeironsWaterskin = 40786, + WolfToothChain = 40787, + }, + HunterOutfits = { + HunterMusicSheet01 = 40788, + HunterMusicSheet02 = 40789, + HunterMusicSheet03 = 40790, + HunterMusicSheet04 = 40791, + HunterBodyAddon = 40792, + HunterHatAddon = 40793, + Hunter = { + AddonGlove = 40794, + AddonHat = 40795, + }, + ElaneCrossbow = 40796, + }, + KnightOutfits = { + AddonSword = 40797, + MissionHelmet = 40798, + AddonHelmet = 40799, + AddonHelmetTimer = 40800, + RamsaysHelmetDoor = 40801, + RamsaysHelmetChest = 40802, + }, + MageAndSummonerOutfits = { + AddonWand = 40803, + AddonBelt = 40804, + MissionHatCloak = 40805, + AddonHatCloak = 40806, + AddonWandTimer = 40807, + }, + MarlinTrophy = 40808, + NoblemanOutfits = { + NoblemanFirstAddon = 40809, + NoblemanSecondAddon = 40810, + }, + ObsidianKnife = 40811, + OrientalOutfits = { + FirstOrientalAddon = 40812, + SecondOrientalAddon = 40813, + OrientalDoor = 40814, + CoralComb = 40815, + }, + PirateOutfits = { + PirateBaseOutfit = 40816, + PirateSabreAddon = 40817, + PirateHatAddon = 40818, + }, + ShamanOutfits = { + AddonStaffMask = 40819, + MissionStaff = 40820, + MissionMask = 40821, + }, + FriendsAndTraders = { + DefaultStart = 40822, + TheSweatyCyclops = 40823, + TheMermaidMarina = 40824, + TheBlessedStake = 40825, + TheBlessedStakeWaitTime = 40826, + }, + TheShatteredIsles = { + DefaultStart = 40827, + TheGovernorDaughter = 40828, + TheErrand = 40829, + AccessToMeriana = 40830, + APoemForTheMermaid = 40831, + ADjinnInLove = 40832, + AccessToLagunaIsland = 40833, + AccessToGoroma = 40834, + Shipwrecked = 40835, + DragahsSpellbook = 40836, + TheCounterspell = 40837, + ReputationInSabrehaven = 40838, + RaysMission1 = 40839, + RaysMission2 = 40840, + RaysMission3 = 40841, + RaysMission4 = 40842, + AccessToNargor = 40843, + TortoiseEggNargorDoor = 40844, + TortoiseEggNargorTime = 40845, + YavernDoor = 40846, + TavernMap1 = 40847, + TavernMap2 = 40848, + TavernMap3 = 40849, + }, + WarriorOutfits = { + WarriorShoulderAddon = 40850, + WarriorSwordAddon = 40851, + WarriorShoulderTimer = 40852, + }, + WizardOutfits = 40853, }, U7_9 = { -- update 7.9 - Reserved Storages 41001 - 41150 - DreamersChallenge = {}, - ThePitsOfInferno = {}, + DreamersChallenge = { + LeverNightmare1 = 41001, + LeverNightmare2 = 41002, + LeverNightmare3 = 41003, + LeverBrotherhood1 = 41004, + LeverBrotherhood2 = 41005, + LeverBrotherhood3 = 41006, + TicTac = 41007, + BPLongSword = 41008, + ChestBook = 41009, + ChestsWine = 41010, + Chests3SmallDiamond = 41011, + }, + NightmareOutfits = { + Outfits = 41012, + Door = 41013, + KnightwatchTowerDoor = 41014, + }, + BrotherhoodOutfits = { + Outfits = 41015, + Door = 41016, + }, + ThePitsOfInferno = { + ShortcutHubDoor = 41017, + ShortcutLeverDoor = 41018, + Pumin = 41019, + ThroneInfernatil = 41020, + ThroneTafariel = 41021, + ThroneVerminor = 41022, + ThroneApocalypse = 41023, + ThroneBazir = 41024, + ThroneAshfalor = 41025, + ThronePumin = 41026, + ChestTible = 41027, + CorpseBook = 41028, + CorpsePirateBP = 41029, + RewardChestBP = 41030, + RewardChestPlatinumCoins = 41031, + RewardChestFrozenStarlight = 41032, + RewardChestStuffed = 41033, + RewardChestSoftBoots = 41034, + RewardChestStaffAvengerArbalest = 41035, + }, }, U8_0 = { -- update 8.0 - Reserved Storages 41151 - 41350 BarbarianArena = {}, @@ -1908,12 +1952,10 @@ Storage = { U8_1 = { -- update 8.1 - Reserved Storages 41351 - 41650 AgainstTheSpiderCult = {}, AritosTask = {}, - BrotherhoodOutfits = {}, OutfitBrotherhoodMaleAddon = {}, IntoTheBonePit = {}, KissingAPig = {}, KosheiTheDeathless = {}, - NightmareOutfits = {}, OutfitNightmareMaleAddon = {}, NomadsLand = {}, RestInHallowedGround = {}, @@ -2890,12 +2932,6 @@ GlobalStorage = { Machine3 = 60147, Machine4 = 60148, }, - TheAncientTombs = { - -- Reserved storage from 60160 - 60169 - ThalasSwitchesGlobalStorage = 60160, - DiprathSwitchesGlobalStorage = 60161, - AshmunrahSwitchesGlobalStorage = 60162, - }, TheOrderOfTheLion = { -- Reserved storage from 60170 - 60171 Drume = { @@ -2954,9 +2990,9 @@ GlobalStorage = { } startupGlobalStorages = { - GlobalStorage.TheAncientTombs.AshmunrahSwitchesGlobalStorage, - GlobalStorage.TheAncientTombs.DiprathSwitchesGlobalStorage, - GlobalStorage.TheAncientTombs.ThalasSwitchesGlobalStorage, + Storage.Quest.U7_4.TheAncientTombs.AshmunrahSwitchesGlobalStorage, + Storage.Quest.U7_4.TheAncientTombs.DiprathSwitchesGlobalStorage, + Storage.Quest.U7_4.TheAncientTombs.ThalasSwitchesGlobalStorage, GlobalStorage.HeroRathleton.FirstMachines, GlobalStorage.HeroRathleton.SecondMachines, GlobalStorage.HeroRathleton.ThirdMachines, diff --git a/data-otservbr-global/npc/a_dead_bureaucrat1.lua b/data-otservbr-global/npc/a_dead_bureaucrat1.lua index 4ab5b370d55..7fc5f8dbefc 100644 --- a/data-otservbr-global/npc/a_dead_bureaucrat1.lua +++ b/data-otservbr-global/npc/a_dead_bureaucrat1.lua @@ -78,11 +78,11 @@ local function creatureSayCallback(npc, creature, type, message) local vocationBaseId = vocation:getBaseId() if MsgContains(message, "pumin") then - if npcHandler:getTopic(playerId) == 0 and player:getStorageValue(Storage.PitsOfInferno.ThronePumin) < 1 then + if npcHandler:getTopic(playerId) == 0 and player:getStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin) < 1 then npcHandler:say("Sure, where else. Everyone likes to meet my master, he is a great demon, isn't he? Your name is ...?", npc, creature) npcHandler:setTopic(playerId, 1) elseif npcHandler:getTopic(playerId) == 3 then - player:setStorageValue(Storage.PitsOfInferno.ThronePumin, 1) + player:setStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin, 1) npcHandler:say("How very interesting. I need to tell that to my master immediately. Please go to my colleagues and ask for Form 356. You will need it in order to proceed.", npc, creature) npcHandler:setTopic(playerId, 0) end @@ -97,26 +97,26 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 3) end elseif MsgContains(message, "411") then - if player:getStorageValue(Storage.PitsOfInferno.ThronePumin) == 3 then + if player:getStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin) == 3 then npcHandler:say("Form 411? You need Form 287 to get that! Do you have it?", npc, creature) npcHandler:setTopic(playerId, 4) - elseif player:getStorageValue(Storage.PitsOfInferno.ThronePumin) == 5 then + elseif player:getStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin) == 5 then npcHandler:say("Form 411? You need Form 287 to get that! Do you have it?", npc, creature) npcHandler:setTopic(playerId, 5) end elseif MsgContains(message, "no") then if npcHandler:getTopic(playerId) == 4 then - player:setStorageValue(Storage.PitsOfInferno.ThronePumin, 4) + player:setStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin, 4) npcHandler:say("Oh, what a pity. Go see one of my colleagues. I give you the permission to get Form 287. Bye!", npc, creature) end elseif MsgContains(message, "yes") then if npcHandler:getTopic(playerId) == 5 then - player:setStorageValue(Storage.PitsOfInferno.ThronePumin, 6) + player:setStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin, 6) npcHandler:say("Great. Here you are. Form 411. Come back anytime you want to talk. Bye.", npc, creature) end elseif MsgContains(message, "356") then - if player:getStorageValue(Storage.PitsOfInferno.ThronePumin) == 8 then - player:setStorageValue(Storage.PitsOfInferno.ThronePumin, 9) + if player:getStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin) == 8 then + player:setStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin, 9) npcHandler:say("INCREDIBLE, you did it!! Have fun at Pumin's Domain!", npc, creature) end end diff --git a/data-otservbr-global/npc/a_dead_bureaucrat2.lua b/data-otservbr-global/npc/a_dead_bureaucrat2.lua index faef1786f21..80c57486b27 100644 --- a/data-otservbr-global/npc/a_dead_bureaucrat2.lua +++ b/data-otservbr-global/npc/a_dead_bureaucrat2.lua @@ -68,8 +68,8 @@ local function creatureSayCallback(npc, creature, type, message) if MsgContains(message, "287") then local player = Player(creature) - if player:getStorageValue(Storage.PitsOfInferno.ThronePumin) == 4 then - player:setStorageValue(Storage.PitsOfInferno.ThronePumin, 5) + if player:getStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin) == 4 then + player:setStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin, 5) npcHandler:say("Sure, you can get it from me. Here you are. Bye", npc, creature) end end diff --git a/data-otservbr-global/npc/a_dead_bureaucrat3.lua b/data-otservbr-global/npc/a_dead_bureaucrat3.lua index d9d990b4e37..7518468bad3 100644 --- a/data-otservbr-global/npc/a_dead_bureaucrat3.lua +++ b/data-otservbr-global/npc/a_dead_bureaucrat3.lua @@ -69,7 +69,7 @@ local function creatureSayCallback(npc, creature, type, message) local vocation = Vocation(player:getVocation():getBase():getId()) if MsgContains(message, "pumin") then - if player:getStorageValue(Storage.PitsOfInferno.ThronePumin) == 2 then + if player:getStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin) == 2 then npcHandler:say("Tell me if you liked it when you come back. What is your name?", npc, creature) npcHandler:setTopic(playerId, 1) end @@ -85,11 +85,11 @@ local function creatureSayCallback(npc, creature, type, message) end elseif MsgContains(message, "145") then if npcHandler:getTopic(playerId) == 3 then - player:setStorageValue(Storage.PitsOfInferno.ThronePumin, 3) + player:setStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin, 3) npcHandler:say("That's right, you can get Form 145 from me. However, I need Form 411 first. Come back when you have it.", npc, creature) npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.PitsOfInferno.ThronePumin) == 6 then - player:setStorageValue(Storage.PitsOfInferno.ThronePumin, 7) + elseif player:getStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin) == 6 then + player:setStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin, 7) npcHandler:say("Well done! You have form 411!! Here is Form 145. Have fun with it.", npc, creature) end end diff --git a/data-otservbr-global/npc/a_dead_bureaucrat4.lua b/data-otservbr-global/npc/a_dead_bureaucrat4.lua index 666d1beb90b..cb75e5f9d23 100644 --- a/data-otservbr-global/npc/a_dead_bureaucrat4.lua +++ b/data-otservbr-global/npc/a_dead_bureaucrat4.lua @@ -78,7 +78,7 @@ local function creatureSayCallback(npc, creature, type, message) local vocationBaseId = vocation:getBaseId() if MsgContains(message, "pumin") then - if player:getStorageValue(Storage.PitsOfInferno.ThronePumin) < 1 then + if player:getStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin) == 1 then npcHandler:say("I'm not sure if you know what you are doing but anyway. Your name is?", npc, creature) npcHandler:setTopic(playerId, 1) end @@ -94,11 +94,11 @@ local function creatureSayCallback(npc, creature, type, message) end elseif MsgContains(message, "356") then if npcHandler:getTopic(playerId) == 3 then - player:setStorageValue(Storage.PitsOfInferno.ThronePumin, 2) + player:setStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin, 2) npcHandler:say("Sorry, you need Form 145 to get Form 356. Come back when you have it", npc, creature) npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.PitsOfInferno.ThronePumin) == 7 then - player:setStorageValue(Storage.PitsOfInferno.ThronePumin, 8) + elseif player:getStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin) == 7 then + player:setStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin, 8) npcHandler:say("You are better than I thought! Congratulations, here you are: Form 356!", npc, creature) end end diff --git a/data-otservbr-global/npc/a_ghostly_sage.lua b/data-otservbr-global/npc/a_ghostly_sage.lua index 4cd9e242a4f..029bd67e93f 100644 --- a/data-otservbr-global/npc/a_ghostly_sage.lua +++ b/data-otservbr-global/npc/a_ghostly_sage.lua @@ -50,7 +50,7 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end -local travelNode = keywordHandler:addKeyword({ "teleport" }, StdModule.say, { npcHandler = npcHandler, text = "You will now be travelled out of here. Are you sure that you want to face that teleport?" }) +local travelNode = keywordHandler:addKeyword({ "help" }, StdModule.say, { npcHandler = npcHandler, text = "You will now be travelled out of here. Are you sure that you want to face that teleport?" }) travelNode:addChildKeyword({ "yes" }, StdModule.travel, { npcHandler = npcHandler, premium = false, destination = Position(32834, 32275, 9) }) travelNode:addChildKeyword({ "no" }, StdModule.say, { npcHandler = npcHandler, reset = true, text = "Then stay here in these ghostly halls." }) diff --git a/data-otservbr-global/npc/a_majestic_warwolf.lua b/data-otservbr-global/npc/a_majestic_warwolf.lua index fecc9ecefdc..a8b422a3ba9 100644 --- a/data-otservbr-global/npc/a_majestic_warwolf.lua +++ b/data-otservbr-global/npc/a_majestic_warwolf.lua @@ -47,7 +47,7 @@ end local function greetCallback(npc, creature) local playerId = creature:getId() - if Player(creature):getStorageValue(Storage.OutfitQuest.DruidHatAddon) < 9 then + if Player(creature):getStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon) < 9 then npcHandler:say("GRRRRRRRRRRRRR", npc, creature) return false end @@ -63,12 +63,12 @@ local function creatureSayCallback(npc, creature, type, message) end if table.contains({ "addon", "outfit" }, message) then - if player:getStorageValue(Storage.OutfitQuest.DruidHatAddon) == 9 then + if player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon) == 9 then npcHandler:say("I can see in your eyes that you are a honest and friendly person, |PLAYERNAME|. You were patient enough to learn our language and I will grant you a special gift. Will you accept it?", npc, creature) npcHandler:setTopic(playerId, 1) end elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 then - player:setStorageValue(Storage.OutfitQuest.DruidHatAddon, 10) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon, 10) player:addOutfitAddon(148, 2) player:addOutfitAddon(144, 2) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) diff --git a/data-otservbr-global/npc/a_sweaty_cyclops.lua b/data-otservbr-global/npc/a_sweaty_cyclops.lua index 927e10924db..b045b2ad1b4 100644 --- a/data-otservbr-global/npc/a_sweaty_cyclops.lua +++ b/data-otservbr-global/npc/a_sweaty_cyclops.lua @@ -60,181 +60,139 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "melt") then - npcHandler:say("Can melt gold ingot for lil' one. You want?", npc, creature) - npcHandler:setTopic(playerId, 10) - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 10 then - if player:removeItem(9058, 1) then - npcHandler:say("whoooosh There!", npc, creature) - player:addItem(12804, 1) - else - npcHandler:say("There is no gold ingot with you.", npc, creature) - end - npcHandler:setTopic(playerId, 0) - end - - if MsgContains(message, "amulet") then - if player:getStorageValue(Storage.SweetyCyclops.AmuletStatus) < 1 then - npcHandler:say("Me can do unbroken but Big Ben want gold 5000 and Big Ben need a lil' time to make it unbroken. Yes or no??", npc, creature) - npcHandler:setTopic(playerId, 9) - elseif player:getStorageValue(Storage.SweetyCyclops.AmuletStatus) == 1 then - npcHandler:say("Ahh, lil' one wants amulet. Here! Have it! Mighty, mighty amulet lil' one has. Don't know what but mighty, mighty it is!!!", npc, creature) - player:addItem(7532, 1) - player:setStorageValue(Storage.SweetyCyclops.AmuletStatus, 2) - npcHandler:setTopic(playerId, 0) - end + -- uth'lokr (Bast Skirts) + if MsgContains(message, "uth'lokr") and player:getStorageValue(Storage.Quest.U7_8.FriendsandTraders.TheSweatyCyclops) < 1 then + npcHandler:say("Firy steel it is. Need green ones' breath to melt. Or red even better. Me can make from shield. Lil' one want to trade?", npc, creature) + npcHandler:setTopic(playerId, 1) elseif MsgContains(message, "yes") then if npcHandler:getTopic(playerId) == 1 then npcHandler:say("Wait. Me work no cheap is. Do favour for me first, yes?", npc, creature) npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 2 then npcHandler:say("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.", npc, creature) - npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.FriendsandTraders.DefaultStart, 1) - player:setStorageValue(Storage.FriendsandTraders.TheSweatyCyclops, 1) - elseif npcHandler:getTopic(playerId) == 3 then - if player:removeItem(3560, 3) then - npcHandler:say("Good good! Woman happy will be. Now me happy too and help you.", npc, creature) - npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.FriendsandTraders.TheSweatyCyclops, 2) + if player:getStorageValue(Storage.OutfitQuest.FriendsandTraders.DefaultStart) ~= 1 then + player:setStorageValue(Storage.OutfitQuest.FriendsandTraders.DefaultStart, 1) end - -- Crown Armor + player:setStorageValue(Storage.Quest.U7_8.FriendsandTraders.TheSweatyCyclops, 1) + npcHandler:setTopic(playerId, 3) elseif npcHandler:getTopic(playerId) == 4 then - if player:removeItem(3381, 1) then - npcHandler:say("Cling clang!", npc, creature) - npcHandler:setTopic(playerId, 0) - player:addItem(5887, 1) - end - -- Dragon Shield - elseif npcHandler:getTopic(playerId) == 5 then - if player:removeItem(3416, 1) then - npcHandler:say("Cling clang!", npc, creature) - npcHandler:setTopic(playerId, 0) - player:addItem(5889, 1) - end - -- Devil Helmet - elseif npcHandler:getTopic(playerId) == 6 then - if player:removeItem(3356, 1) then - npcHandler:say("Cling clang!", npc, creature) - npcHandler:setTopic(playerId, 0) - player:addItem(5888, 1) - end - -- Giant Sword - elseif npcHandler:getTopic(playerId) == 7 then - if player:removeItem(3281, 1) then - npcHandler:say("Cling clang!", npc, creature) - npcHandler:setTopic(playerId, 0) - player:addItem(5892, 1) - end - -- Soul Orb - elseif npcHandler:getTopic(playerId) == 8 then - if player:getItemCount(5944) > 0 then - local count = player:getItemCount(5944) - for i = 1, count do - if math.random(100) <= 1 then - player:addItem(6528, 6) - player:removeItem(5944, 1) - else - player:addItem(6528, 3) - player:removeItem(5944, 1) - end - end - npcHandler:say("Cling clang!", npc, creature) + if player:removeItem(3560, 3) then + npcHandler:say("Good good! Woman happy will be. Now me happy too and help you.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.FriendsandTraders.TheSweatyCyclops, 2) npcHandler:setTopic(playerId, 0) else - npcHandler:say("You dont have soul orbs!", npc, creature) - npcHandler:setTopic(playerId, 0) + npcHandler:say("Lil' one bring three bast skirts.", npc, creature) + npcHandler:setTopic(playerId, 3) end - elseif npcHandler:getTopic(playerId) == 9 then - if player:getItemCount(7528) > 0 and player:getItemCount(7529) > 0 and player:getItemCount(7530) > 0 and player:getItemCount(7531) > 0 and player:getMoney() + player:getBankBalance() >= 5000 then - player:removeItem(7528, 1) - player:removeItem(7529, 1) - player:removeItem(7530, 1) - player:removeItem(7531, 1) - player:removeMoneyBank(5000) - player:setStorageValue(Storage.SweetyCyclops.AmuletTimer, os.time()) - player:setStorageValue(Storage.SweetyCyclops.AmuletStatus, 1) - npcHandler:say("Well, well, I do that! Big Ben makes lil' amulet unbroken with big hammer in big hands! No worry! Come back after sun hits the horizon 24 times and ask me for amulet.", npc, creature) - npcHandler:setTopic(playerId, 0) + end + elseif MsgContains(message, "bast skirt") and player:getStorageValue(Storage.Quest.U7_8.FriendsandTraders.TheSweatyCyclops) == 1 then + if npcHandler:getTopic(playerId) == 3 then + npcHandler:say("Lil' one bring three bast skirts?", npc, creature) + npcHandler:setTopic(playerId, 4) + end + end + -- uth'lokr (Bast Skirts) + if MsgContains(message, "uth'lokr") and player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheSweatyCyclops) < 1 then + npcHandler:say("Firy steel it is. Need green ones' breath to melt. Or red even better. Me can make from shield. Lil' one want to trade?", npc, creature) + npcHandler:setTopic(playerId, 1) + elseif MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 1 then + npcHandler:say("Wait. Me work no cheap is. Do favour for me first, yes?", npc, creature) + npcHandler:setTopic(playerId, 2) + elseif npcHandler:getTopic(playerId) == 2 then + npcHandler:say("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.", npc, creature) + if player:getStorageValue(Storage.OutfitQuest.FriendsandTraders.DefaultStart) ~= 1 then + player:setStorageValue(Storage.OutfitQuest.FriendsandTraders.DefaultStart, 1) end - elseif npcHandler:getTopic(playerId) == 11 then - if player:removeItem(5880, 1) then - player:setStorageValue(Storage.HiddenCityOfBeregar.GearWheel, player:getStorageValue(Storage.HiddenCityOfBeregar.GearWheel) + 1) - player:addItem(8775, 1) - npcHandler:say("Cling clang!", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheSweatyCyclops, 1) + npcHandler:setTopic(playerId, 3) + elseif npcHandler:getTopic(playerId) == 4 then + if player:removeItem(3560, 3) then + npcHandler:say("Good good! Woman happy will be. Now me happy too and help you.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheSweatyCyclops, 2) npcHandler:setTopic(playerId, 0) else - npcHandler:say("Lil' one does not have any iron ores.", npc, creature) + npcHandler:say("Lil' one bring three bast skirts.", npc, creature) + npcHandler:setTopic(playerId, 3) end - npcHandler:setTopic(playerId, 0) end - - -- Crown Armor - elseif MsgContains(message, "uth'kean") then - if player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) < 1 then - npcHandler:say("Very noble. Shiny. Me like. But breaks so fast. Me can make from shiny armour. Lil' one want to trade?", npc, creature) - npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) == 1 then + elseif MsgContains(message, "bast skirt") and player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheSweatyCyclops) == 1 then + if npcHandler:getTopic(playerId) == 3 then npcHandler:say("Lil' one bring three bast skirts?", npc, creature) - npcHandler:setTopic(playerId, 3) - elseif player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) == 2 then - npcHandler:say("Very noble. Shiny. Me like. But breaks so fast. Me can make from shiny armour. Lil' one want to trade?", npc, creature) npcHandler:setTopic(playerId, 4) end - -- Dragon Shield - elseif MsgContains(message, "uth'lokr") then - if player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) < 1 then - npcHandler:say("Firy steel it is. Need green ones' breath to melt. Or red even better. Me can make from shield. Lil' one want to trade?", npc, creature) - npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) == 1 then - npcHandler:say("Lil' one bring three bast skirts?", npc, creature) - npcHandler:setTopic(playerId, 3) - elseif player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) == 2 then - npcHandler:say("Firy steel it is. Need green ones' breath to melt. Or red even better. Me can make from shield. Lil' one want to trade?", npc, creature) - npcHandler:setTopic(playerId, 5) + end + + -- Uth'kean (Crown Armor - Piece of Royal Steel) + if MsgContains(message, "uth'kean") and player:getStorageValue(Storage.Quest.U7_8.FriendsandTraders.TheSweatyCyclops) == 2 then + npcHandler:say("Very noble. Shiny. Me like. But breaks so fast. Me can make from shiny armour. Lil' one want to trade?", npc, creature) + npcHandler:setTopic(playerId, 5) + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 then + if player:removeItem(3381, 1) then + npcHandler:say("Cling clang!", npc, creature) + player:addItem(5887, 1) + npcHandler:setTopic(playerId, 0) end - -- Devil Helmet - elseif MsgContains(message, "za'ralator") then - if player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) < 1 then - npcHandler:say("Hellsteel is. Cursed and evil. Dangerous to work with. Me can make from evil helmet. Lil' one want to trade?", npc, creature) - npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) == 1 then - npcHandler:say("Lil' one bring three bast skirts?", npc, creature) - npcHandler:setTopic(playerId, 3) - elseif player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) == 2 then - npcHandler:say("Hellsteel is. Cursed and evil. Dangerous to work with. Me can make from evil helmet. Lil' one want to trade?", npc, creature) - npcHandler:setTopic(playerId, 6) + end + + -- uth'lokr (Dragon Shield - Piece of Draconian Steel) + if MsgContains(message, "uth'lokr") and player:getStorageValue(Storage.Quest.U7_8.FriendsandTraders.TheSweatyCyclops) == 2 then + npcHandler:say("Firy steel it is. Need green ones' breath to melt. Or red even better. Me can make from shield. Lil' one want to trade?", npc, creature) + npcHandler:setTopic(playerId, 6) + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 6 then + if player:removeItem(3416, 1) then + npcHandler:say("Cling clang!", npc, creature) + player:addItem(5889, 1) + npcHandler:setTopic(playerId, 0) end - -- Giant Sword - elseif MsgContains(message, "uth'prta") then - if player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) < 1 then - npcHandler:say("Good iron is. Me friends use it much for fight. Me can make from weapon. Lil' one want to trade?", npc, creature) - npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) == 1 then - npcHandler:say("Lil' one bring three bast skirts?", npc, creature) - npcHandler:setTopic(playerId, 3) - elseif player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) == 2 then - npcHandler:say("Good iron is. Me friends use it much for fight. Me can make from weapon. Lil' one want to trade?", npc, creature) - npcHandler:setTopic(playerId, 7) + end + + -- za'ralator (Devil Helmet - Piece of Hell Steel) + if MsgContains(message, "za'ralator") and player:getStorageValue(Storage.Quest.U7_8.FriendsandTraders.TheSweatyCyclops) == 2 then + npcHandler:say("Hellsteel is. Cursed and evil. Dangerous to work with. Me can make from evil helmet. Lil' one want to trade?", npc, creature) + npcHandler:setTopic(playerId, 7) + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 7 then + if player:removeItem(3356, 1) then + npcHandler:say("Cling clang!", npc, creature) + player:addItem(5888, 1) + npcHandler:setTopic(playerId, 0) end - -- Soul Orb - elseif MsgContains(message, "soul orb") then - if player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) < 1 then - npcHandler:say("Uh. Me can make some nasty lil' bolt from soul orbs. Lil' one want to trade all?", npc, creature) - npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) == 1 then - npcHandler:say("Lil' one bring three bast skirts?", npc, creature) - npcHandler:setTopic(playerId, 3) - elseif player:getStorageValue(Storage.FriendsandTraders.TheSweatyCyclops) == 2 then - npcHandler:say("Uh. Me can make some nasty lil' bolt from soul orbs. Lil' one want to trade all?", npc, creature) - npcHandler:setTopic(playerId, 8) + end + + -- uth'prta (Giant Sword - Huge Chunk of Crude Iron) + if MsgContains(message, "uth'prta") and player:getStorageValue(Storage.Quest.U7_8.FriendsandTraders.TheSweatyCyclops) == 2 then + npcHandler:say("Good iron is. Me friends use it much for fight. Me can make from weapon. Lil' one want to trade?", npc, creature) + npcHandler:setTopic(playerId, 8) + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 8 then + if player:removeItem(3281, 1) then + npcHandler:say("Cling clang!", npc, creature) + player:addItem(5892, 1) + npcHandler:setTopic(playerId, 0) end - elseif MsgContains(message, "gear wheel") then - if player:getStorageValue(Storage.HiddenCityOfBeregar.GoingDown) > 0 and player:getStorageValue(Storage.HiddenCityOfBeregar.GearWheel) > 3 then - npcHandler:say("Uh. Me can make some gear wheel from iron ores. Lil' one want to trade?", npc, creature) - npcHandler:setTopic(playerId, 11) + end + + -- soul orb (soul orb - Infernal Bolts) + if MsgContains(message, "soul orb") and player:getStorageValue(Storage.Quest.U7_8.FriendsandTraders.TheSweatyCyclops) == 2 then + npcHandler:say("Uh. Me can make some nasty lil' bolt from soul orbs. Lil' one want to trade all?", npc, creature) + npcHandler:setTopic(playerId, 9) + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 9 then + if player:getItemCount(5944) > 0 then + local count = player:getItemCount(5944) + for i = 1, count do + if math.random(100) <= 1 then + player:addItem(6528, 6) + player:removeItem(5944, 1) + npcHandler:say("Cling clang! Me done good work today! Li'l one gets double bolts!", npc, creature) + else + player:addItem(6528, 3) + player:removeItem(5944, 1) + npcHandler:say("Cling clang!", npc, creature) + end + end + npcHandler:setTopic(playerId, 0) end end + return true end diff --git a/data-otservbr-global/npc/ajax.lua b/data-otservbr-global/npc/ajax.lua index b834b35fd24..209d75d2447 100644 --- a/data-otservbr-global/npc/ajax.lua +++ b/data-otservbr-global/npc/ajax.lua @@ -54,12 +54,13 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 1 or player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) > 3 then - npcHandler:setMessage(MESSAGE_GREET, "Whatcha do in my place?") - elseif player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 2 and player:getStorageValue(Storage.OutfitQuest.BarbarianAddonWaitTimer) < os.time() then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 2 and player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddonWaitTimer) < os.time() then npcHandler:setMessage(MESSAGE_GREET, "You back. You know, you right. Brother is right. Fist not always good. Tell him that!") - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 3) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 3) + else + npcHandler:setMessage(MESSAGE_GREET, "Whatcha do in my place?") end + return true end @@ -73,7 +74,7 @@ local function creatureSayCallback(npc, creature, type, message) -- PREQUEST if MsgContains(message, "mine") then - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 1 then npcHandler:say("YOURS? WHAT IS YOURS! NOTHING IS YOURS! IS MINE! GO AWAY, YES?!", npc, creature) npcHandler:setTopic(playerId, 1) end @@ -88,55 +89,55 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("I GIVE YOU NO!", npc, creature) npcHandler:setTopic(playerId, 4) end - elseif MsgContains(message, "please") then + elseif MsgContains(message, "say please") then if npcHandler:getTopic(playerId) == 4 then npcHandler:say("Please? What you mean please? Like I say please you say bye? Please?", npc, creature) npcHandler:setTopic(playerId, 5) end -- OUTFIT elseif MsgContains(message, "gelagos") then - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 4 then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 4 then npcHandler:say("Annoying kid. Bro hates him, but talking no help. Bro needs {fighting spirit}!", npc, creature) npcHandler:setTopic(playerId, 6) end elseif MsgContains(message, "fighting spirit") then if npcHandler:getTopic(playerId) == 6 then npcHandler:say("If you want to help bro, bring him fighting spirit. Magic fighting spirit. Ask Djinn.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 5) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 5) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "present") then - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 11 then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 11 then npcHandler:say("Bron gave me present. Ugly, but nice from him. Me want to give present too. You help me?", npc, creature) npcHandler:setTopic(playerId, 6) end - elseif MsgContains(message, "ore") then - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 12 then + elseif MsgContains(message, "iron ore") then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 12 then npcHandler:say("You bring 100 iron ore?", npc, creature) npcHandler:setTopic(playerId, 8) end - elseif MsgContains(message, "iron") then - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 13 then + elseif MsgContains(message, "crude iron") then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 13 then npcHandler:say("You bring crude iron?", npc, creature) npcHandler:setTopic(playerId, 9) end - elseif MsgContains(message, "fangs") then - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 14 then + elseif MsgContains(message, "behemoth fangs") then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 14 then npcHandler:say("You bring 50 behemoth fangs?", npc, creature) npcHandler:setTopic(playerId, 10) end - elseif MsgContains(message, "leather") then - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 15 then + elseif MsgContains(message, "lizard leather") then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 15 then npcHandler:say("You bring 50 lizard leather?", npc, creature) npcHandler:setTopic(playerId, 11) end elseif MsgContains(message, "axe") then if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 16 and player:getStorageValue(Storage.OutfitQuest.BarbarianAddonWaitTimer) < os.time() then npcHandler:say("Axe is done! For you. Take. Wear like me.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 17) player:addOutfitAddon(147, 1) player:addOutfitAddon(143, 1) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) + player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 17) player:addAchievement("Brutal Politeness") else npcHandler:say("Axe is not done yet!", npc, creature) @@ -149,8 +150,8 @@ local function creatureSayCallback(npc, creature, type, message) condition:setParameter(CONDITION_PARAM_DELAYED, 1) condition:addDamage(10, 2000, -10) player:addCondition(condition) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 2) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddonWaitTimer, os.time() + 60 * 60) -- 1 hour + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 2) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddonWaitTimer, os.time() + 60 * 60) -- 1 hour npcHandler:removeInteraction(npc, creature) npcHandler:resetNpc(creature) elseif npcHandler:getTopic(playerId) == 6 then @@ -163,30 +164,30 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 7 then npcHandler:say("Good. You get 100 iron ore first. Come back.", npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 12) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 12) elseif npcHandler:getTopic(playerId) == 8 then if player:removeItem(5880, 100) then npcHandler:say("Good! Now bring crude iron.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 13) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 13) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 9 then if player:removeItem(5892, 1) then npcHandler:say("Good! Now bring 50 behemoth fangs.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 14) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 14) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 10 then if player:removeItem(5893, 50) then npcHandler:say("Good! Now bring 50 lizard leather.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 15) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 15) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 11 then if player:removeItem(5876, 50) then npcHandler:say("Ah! All stuff there. I will start making axes now. Come later and ask me for axe.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 16) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddonWaitTimer, os.time() + 2 * 60 * 60) -- 2 hours + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 16) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddonWaitTimer, os.time() + 2 * 60 * 60) -- 2 hours npcHandler:setTopic(playerId, 0) end end diff --git a/data-otservbr-global/npc/alesar.lua b/data-otservbr-global/npc/alesar.lua index ca38fe37ac1..cd677466c21 100644 --- a/data-otservbr-global/npc/alesar.lua +++ b/data-otservbr-global/npc/alesar.lua @@ -85,6 +85,37 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local function endConversationWithDelay(npcHandler, npc, creature) + addEvent(function() + npcHandler:unGreet(npc, creature) + end, 1000) +end + +local function greetCallback(npc, creature, message) + local player = Player(creature) + local playerId = player:getId() + + if not MsgContains(message, "djanni'hah") then + npcHandler:say("Shove off, little one! Humans are not welcome here, |PLAYERNAME|!", npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Start) == 1 then + npcHandler:say({ + "Hahahaha! ...", + "|PLAYERNAME|, that almost sounded like the word of greeting. Humans - cute they are!", + }, npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + npcHandler:say("What do you want from me, |PLAYERNAME|?", npc, creature) + npcHandler:setInteraction(npc, creature) + + return true +end + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -93,7 +124,65 @@ local function creatureSayCallback(npc, creature, type, message) return false end - ParseAlesarSay(npc, creature, message, npcHandler) + local missionProgress = player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission02) + if MsgContains(message, "mission") then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission01) == 3 then + if missionProgress < 1 then + npcHandler:say({ + "So Baa'leal thinks you are up to do a mission for us? ...", + "I think he is getting old, entrusting human scum such as you are with an important mission like that. ...", + "Personally, I don't understand why you haven't been slaughtered right at the gates. ...", + "Anyway. Are you prepared to embark on a dangerous mission for us?", + }, npc, creature) + npcHandler:setTopic(playerId, 1) + elseif isInArray({ 1, 2 }, missionProgress) then + npcHandler:say("Did you find the tear of Daraman?", npc, creature) + npcHandler:setTopic(playerId, 2) + else + npcHandler:say("Don't forget to talk to Malor concerning your next mission.", npc, creature) + end + end + elseif npcHandler:getTopic(playerId) == 1 then + if MsgContains(message, "yes") then + npcHandler:say({ + "All right then, human. Have you ever heard of the {'Tears of Daraman'}? ...", + "They are precious gemstones made of some unknown blue mineral and possess enormous magical power. ...", + "If you want to learn more about these gemstones don't forget to visit our library. ...", + "Anyway, one of them is enough to create thousands of our mighty djinn blades. ...", + "Unfortunately my last gemstone broke and therefore I'm not able to create new blades anymore. ...", + "To my knowledge there is only one place where you can find these gemstones - I know for a fact that the Marid have at least one of them. ...", + "Well... to cut a long story short, your mission is to sneak into Ashta'daramai and to steal it. ...", + "Needless to say, the Marid won't be too eager to part with it. Try not to get killed until you have delivered the stone to me.", + }, npc, creature) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission02, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.DoorToMaridTerritory, 1) + elseif MsgContains(message, "no") then + npcHandler:say("Then not.", npc, creature) + end + npcHandler:setTopic(playerId, 0) + elseif npcHandler:getTopic(playerId) == 2 then + if MsgContains(message, "yes") then + if player:getItemCount(3233) == 0 or missionProgress ~= 2 then + npcHandler:say("As I expected. You haven't got the stone. Shall I explain your mission again?", npc, creature) + npcHandler:setTopic(playerId, 1) + else + npcHandler:say({ + "So you have made it? You have really managed to steal a Tear of Daraman? ...", + "Amazing how you humans are just impossible to get rid of. Incidentally, you have this character trait in common with many insects and with other vermin. ...", + "Nevermind. I hate to say it, but it you have done us a favour, human. That gemstone will serve us well. ...", + "Baa'leal, wants you to talk to Malor concerning some new mission. ...", + "Looks like you have managed to extended your life expectancy - for just a bit longer.", + }, npc, creature) + player:removeItem(3233, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission02, 3) + npcHandler:setTopic(playerId, 0) + end + elseif MsgContains(message, "no") then + npcHandler:say("As I expected. You haven't got the stone. Shall I explain your mission again?", npc, creature) + npcHandler:setTopic(playerId, 1) + end + end + return true end @@ -101,7 +190,7 @@ local function onTradeRequest(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.DjinnWar.EfreetFaction.Mission03) ~= 3 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission03) ~= 3 then npcHandler:say("I'm sorry, but you don't have Malor's permission to trade with me.", npc, creature) return false end @@ -109,11 +198,13 @@ local function onTradeRequest(npc, creature) return true end -npcHandler:setMessage(MESSAGE_GREET, "What do you want from me, |PLAYERNAME|?") +keywordHandler:addCustomGreetKeyword({ "djanni'hah" }, greetCallback, { npcHandler = npcHandler }) + npcHandler:setMessage(MESSAGE_FAREWELL, "Finally.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Finally.") npcHandler:setMessage(MESSAGE_SENDTRADE, "At your service, just browse through my wares.") +npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_ON_TRADE_REQUEST, onTradeRequest) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) diff --git a/data-otservbr-global/npc/alesar_functions.lua b/data-otservbr-global/npc/alesar_functions.lua index da25d5e8c62..d610a07d1f9 100644 --- a/data-otservbr-global/npc/alesar_functions.lua +++ b/data-otservbr-global/npc/alesar_functions.lua @@ -2,9 +2,9 @@ function ParseAlesarSay(npc, creature, message, npcHandler) local player = Player(creature) local playerId = player:getId() - local missionProgress = player:getStorageValue(Storage.DjinnWar.EfreetFaction.Mission02) + local missionProgress = player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission02) if MsgContains(message, "mission") then - if player:getStorageValue(Storage.DjinnWar.EfreetFaction.Mission01) == 3 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission01) == 3 then if missionProgress < 1 then npcHandler:say({ "So Baa'leal thinks you are up to do a mission for us? ...", @@ -32,8 +32,8 @@ function ParseAlesarSay(npc, creature, message, npcHandler) "Well... to cut a long story short, your mission is to sneak into Ashta'daramai and to steal it. ...", "Needless to say, the Marid won't be too eager to part with it. Try not to get killed until you have delivered the stone to me.", }, npc, creature) - player:setStorageValue(Storage.DjinnWar.EfreetFaction.Mission02, 1) - player:setStorageValue(Storage.DjinnWar.EfreetFaction.DoorToMaridTerritory, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission02, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.DoorToMaridTerritory, 1) elseif MsgContains(message, "no") then npcHandler:say("Then not.", npc, creature) end @@ -52,7 +52,7 @@ function ParseAlesarSay(npc, creature, message, npcHandler) "Looks like you have managed to extended your life expectancy - for just a bit longer.", }, npc, creature) player:removeItem(3233, 1) - player:setStorageValue(Storage.DjinnWar.EfreetFaction.Mission02, 3) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission02, 3) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "no") then diff --git a/data-otservbr-global/npc/amanda.lua b/data-otservbr-global/npc/amanda.lua index 64cc34f79dc..12c011481c0 100644 --- a/data-otservbr-global/npc/amanda.lua +++ b/data-otservbr-global/npc/amanda.lua @@ -119,23 +119,23 @@ stoneKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, t -- Wooden Stake keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "I think you have forgotten to bring your stake, my child." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 6 and player:getItemCount(5941) == 0 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 6 and player:getItemCount(5941) == 0 end) local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Yes, I was informed what to do. Are you prepared to receive my line of the prayer?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 6 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 6 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "So receive my prayer: 'Wicked curses shall be broken'. Now, bring your stake to Kasmir in Darashia for the next line of the prayer. I will inform him what to do.", reset = true }, nil, function(player) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 7) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 7) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end) stakeKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "I'll wait for you.", reset = true }) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You should visit Kasmir in Darashia now, my child." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 7 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 7 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You already received my line of the prayer." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) > 7 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) > 7 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "A blessed stake? That's a strange request. Maybe Quentin knows more, he is one of the oldest monks after all." }) diff --git a/data-otservbr-global/npc/amber.lua b/data-otservbr-global/npc/amber.lua index 335f5dea332..fedb84e56e7 100644 --- a/data-otservbr-global/npc/amber.lua +++ b/data-otservbr-global/npc/amber.lua @@ -68,70 +68,43 @@ local function creatureSayCallback(npc, creature, type, message) return false end - local addonProgress = player:getStorageValue(Storage.OutfitQuest.Citizen.AddonBackpack) + local addonProgress = player:getStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.AddonBackpackRook) if MsgContains(message, "addon") or MsgContains(message, "outfit") or (addonProgress == 1 and MsgContains(message, "leather")) or ((addonProgress == 1 or addonProgress == 2) and MsgContains(message, "backpack")) then if addonProgress < 1 then - npcHandler:say("Sorry, the backpack I wear is not for sale. It's handmade from rare minotaur leather.", npc, creature) + npcHandler:say("Ah, you noticed my new accessory? Sorry, this one is not for sale. It's handmade from rare minotaur leather.", npc, creature) npcHandler:setTopic(playerId, 1) elseif addonProgress == 1 then - npcHandler:say( - "Ah, right, almost forgot about the backpack! \z - Have you brought me 100 pieces of minotaur leather as requested?", - npc, - creature - ) + npcHandler:say("Ah, right, almost forgot about the backpack! Have you brought me 100 pieces of minotaur leather as requested?", npc, creature) npcHandler:setTopic(playerId, 3) elseif addonProgress == 2 then - if player:getStorageValue(Storage.OutfitQuest.Citizen.AddonBackpackTimer) < os.time() then + if player:getStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.AddonBackpackRookTimer) < os.time() then npcHandler:say("Just in time! Your backpack is finished. Here you go, I hope you like it.", npc, creature) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) player:setStorageValue(Storage.OutfitQuest.Ref, math.min(0, player:getStorageValue(Storage.OutfitQuest.Ref) - 1)) - player:setStorageValue(Storage.OutfitQuest.Citizen.MissionBackpack, 0) - player:setStorageValue(Storage.OutfitQuest.Citizen.AddonBackpack, 3) - + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.MissionBackpackRook, 4) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.AddonBackpackRook, 3) player:addOutfitAddon(136, 1) player:addOutfitAddon(128, 1) else - npcHandler:say( - "Uh... I didn't expect you to return that early. \z - Sorry, but I'm not finished yet with your backpack. \z - I'm doing the best I can, promised.", - npc, - creature - ) + npcHandler:say("Uh... I didn't expect you to return that early. Sorry, but I'm not finished yet with your backpack. I'm doing the best I can, promised.", npc, creature) end elseif addonProgress == 3 then - npcHandler:say( - "Sorry, but I can only make one backpack per person, \z - else I'd have to close my shop and open a leather manufactory.", - npc, - creature - ) + npcHandler:say("Sorry, but I can only make one backpack per person, else I'd have to close my shop and open a leather manufactory.", npc, creature) end return true end if npcHandler:getTopic(playerId) == 1 then if MsgContains(message, "backpack") or MsgContains(message, "minotaur") or MsgContains(message, "leather") then - npcHandler:say( - "Well, if you really like this backpack, I could make one for you, \z - but minotaur leather is hard to come by these days. Are you willing to put some work into this?", - npc, - creature - ) + npcHandler:say("Well, if you really like this backpack, I could make one for you, but minotaur leather is hard to come by these days. Are you willing to put some work into this?", npc, creature) npcHandler:setTopic(playerId, 2) end elseif npcHandler:getTopic(playerId) == 2 then if MsgContains(message, "yes") then player:setStorageValue(Storage.OutfitQuest.Ref, math.max(0, player:getStorageValue(Storage.OutfitQuest.Ref)) + 1) - player:setStorageValue(Storage.OutfitQuest.Citizen.AddonBackpack, 1) - player:setStorageValue(Storage.OutfitQuest.Citizen.MissionBackpack, 1) - npcHandler:say( - "Alright then, if you bring me 100 pieces of fine minotaur leather I will \z - see what I can do for you. You probably have to kill really many minotaurs though... so good luck!", - npc, - creature - ) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.AddonBackpackRook, 1) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.MissionBackpackRook, 1) + npcHandler:say("Alright then, if you bring me 100 pieces of fine minotaur leather I will see what I can do for you. You probably have to kill really many minotaurs though... so good luck!", npc, creature) npcHandler:removeInteraction(npc, creature) else npcHandler:say("Sorry, but I don't run a welfare office, you know... no pain, no gain.", npc, creature) @@ -140,29 +113,16 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 3 then if MsgContains(message, "yes") then if player:getItemCount(5878) < 100 then - npcHandler:say( - "Sorry, but that's not enough leather yet to make one of these backpacks. \z - Would you rather like to buy a normal backpack for 10 gold?", - npc, - creature - ) + npcHandler:say("Sorry, but that's not enough leather yet to make one of these backpacks. Would you rather like to buy a normal backpack for 10 gold?", npc, creature) else npcHandler:say("Great! Alright, I need a while to finish this backpack for you. Come ask me later, okay?", npc, creature) - player:removeItem(5878, 100) - - player:setStorageValue(Storage.OutfitQuest.Citizen.MissionBackpack, 2) - player:setStorageValue(Storage.OutfitQuest.Citizen.AddonBackpack, 2) - player:setStorageValue(Storage.OutfitQuest.Citizen.AddonBackpackTimer, os.time() + 2 * 60 * 60) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.MissionBackpackRook, 2) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.AddonBackpackRook, 2) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.AddonBackpackRookTimer, os.time() + 2 * 60 * 60) --2 hours end else - npcHandler:say( - "I know, it's quite some work... don't lose heart, \z - just keep killing minotaurs and you'll eventually get lucky. \z - Would you rather like to buy a normal backpack for 10 gold?", - npc, - creature - ) + npcHandler:say("I know, it's quite some work... don't lose heart, just keep killing minotaurs and you'll eventually get lucky. Would you rather like to buy a normal backpack for 10 gold?", npc, creature) end npcHandler:setTopic(playerId, 0) end @@ -184,14 +144,11 @@ keywordHandler:addKeyword({ "explore" }, StdModule.say, { }) keywordHandler:addKeyword({ "adventure" }, StdModule.say, { npcHandler = npcHandler, - text = "I fought fierce {monsters}, climbed the highest mountains, explored the deepest {dungeons} \z - and crossed the {sea} on a {raft}.", + text = "I fought fierce {monsters}, climbed the highest mountains, explored the deepest {dungeons} and crossed the {sea} on a {raft}.", }) keywordHandler:addKeyword({ "sea" }, StdModule.say, { npcHandler = npcHandler, - text = "My voyage on the sea was exhausting. \z - The weather was bad, the waves high and my raft quite simple. \z - There's a certain excitement to it, though.", + text = "My voyage on the sea was exhausting. The weather was bad, the waves high and my raft quite simple. There's a certain excitement to it, though.", }) keywordHandler:addKeyword({ "time" }, StdModule.say, { npcHandler = npcHandler, @@ -199,24 +156,19 @@ keywordHandler:addKeyword({ "time" }, StdModule.say, { }) keywordHandler:addKeyword({ "help" }, StdModule.say, { npcHandler = npcHandler, - text = "Well, I can give you general {hints} or tell you about my {adventures} and many other topics. \z - Oh, and if you are bored, I might have a small {quest} for you.", + text = "Well, I can give you general {hints} or tell you about my {adventures} and many other topics. Oh, and if you are bored, I might have a small {quest} for you.", }) keywordHandler:addKeyword({ "information" }, StdModule.say, { npcHandler = npcHandler, - text = "Well, I can give you general {hints} or tell you about my {adventures} and many other topics. \z - Oh, and if you are bored, I might have a small {quest} for you.", + text = "Well, I can give you general {hints} or tell you about my {adventures} and many other topics. Oh, and if you are bored, I might have a small {quest} for you.", }) keywordHandler:addKeyword({ "dungeon" }, StdModule.say, { npcHandler = npcHandler, - text = "I had no time to explore the dungeons of this isle yet, \z - but I've seen two big caves in the East, and there is a ruined tower to the north-west. \z - Oh, and there're the {sewers}.", + text = "I had no time to explore the dungeons of this isle yet, but I've seen two big caves in the East, and there is a ruined tower to the north-west. Oh, and there're the {sewers}.", }) keywordHandler:addKeyword({ "sewer" }, StdModule.say, { npcHandler = npcHandler, - text = "I like sewers. I made my very first battle experience in the sewers below {Thais}. \z - The small sewer system of {Rookgaard} has some nasty rats to fight.", + text = "I like sewers. I made my very first battle experience in the sewers below {Thais}. The small sewer system of {Rookgaard} has some nasty rats to fight.", }) keywordHandler:addKeyword({ "monster" }, StdModule.say, { npcHandler = npcHandler, @@ -226,30 +178,21 @@ keywordHandler:addKeyword({ "cyclops" }, StdModule.say, { npcHandler = npcHandler, text = "I don't like the way they look at you. Their eye seems to pierce right through you. Creepy!", }) -keywordHandler:addKeyword({ "minotaur" }, StdModule.say, { - npcHandler = npcHandler, - text = "They are nasty monsters, particularly as they have distance fighters and mages in their clans. \z - My {backpack} is handmade from minotaur leather.", -}) keywordHandler:addKeyword({ "dragon" }, StdModule.say, { npcHandler = npcHandler, - text = "Their breath is so hot! I had to cut my hair after my last encounter with \z - a dragon because the ends were all burnt. That's what you gotta deal with as a female adventurer!", + text = "Their breath is so hot! I had to cut my hair after my last encounter with a dragon because the ends were all burnt. That's what you gotta deal with as a female adventurer!", }) keywordHandler:addKeyword({ "raft" }, StdModule.say, { npcHandler = npcHandler, - text = "I left my raft at the south-eastern shore. I forgot my private {notebook} on it. \z - If you could return it to me, I would be very grateful.", + text = "I left my raft at the south-eastern shore. I forgot my private {notebook} on it. If you could return it to me, I would be very grateful.", }) keywordHandler:addKeyword({ "quest" }, StdModule.say, { npcHandler = npcHandler, - text = "I left my raft at the south-eastern shore. I forgot my private {notebook} on it. \z - If you could return it to me, I would be very grateful.", + text = "I left my raft at the south-eastern shore. I forgot my private {notebook} on it. If you could return it to me, I would be very grateful.", }) keywordHandler:addKeyword({ "mission" }, StdModule.say, { npcHandler = npcHandler, - text = "I left my raft at the south-eastern shore. I forgot my private {notebook} on it. \z - If you could return it to me, I would be very grateful.", + text = "I left my raft at the south-eastern shore. I forgot my private {notebook} on it. If you could return it to me, I would be very grateful.", }) keywordHandler:addKeyword({ "seymour" }, StdModule.say, { npcHandler = npcHandler, @@ -269,8 +212,7 @@ keywordHandler:addKeyword({ "thais" }, StdModule.say, { }) keywordHandler:addKeyword({ "weapon" }, StdModule.say, { npcHandler = npcHandler, - text = "The best weapons on this isle are just toothpicks \z - compared with the weapons warriors wield on the {mainland}.", + text = "The best weapons on this isle are just toothpicks compared with the weapons warriors wield on the {mainland}.", }) keywordHandler:addKeyword({ "magic" }, StdModule.say, { npcHandler = npcHandler, @@ -294,8 +236,7 @@ keywordHandler:addKeyword({ "tools" }, StdModule.say, { }) keywordHandler:addKeyword({ "rope" }, StdModule.say, { npcHandler = npcHandler, - text = "One day I fell into a hole without having a rope. I was yelling for help for three whole days! \z - Eventually a fisherman passed by and pulled me out with his own rope, lucky me.", + text = "One day I fell into a hole without having a rope. I was yelling for help for three whole days! Eventually a fisherman passed by and pulled me out with his own rope, lucky me.", }) keywordHandler:addKeyword({ "shovel" }, StdModule.say, { npcHandler = npcHandler, @@ -303,8 +244,7 @@ keywordHandler:addKeyword({ "shovel" }, StdModule.say, { }) keywordHandler:addKeyword({ "torch" }, StdModule.say, { npcHandler = npcHandler, - text = "You know, on mainland you will be able to cast magic spells which provide you with light. \z - You won't really need torches anymore.", + text = "You know, on mainland you will be able to cast magic spells which provide you with light. You won't really need torches anymore.", }) keywordHandler:addKeyword({ "bank" }, StdModule.say, { npcHandler = npcHandler, @@ -374,8 +314,7 @@ keywordHandler:addKeyword({ "lily" }, StdModule.say, { }) keywordHandler:addKeyword({ "billy" }, StdModule.say, { npcHandler = npcHandler, - text = "He brought me some of his famous rat stew. I really didn't want to insult him, \z - but I simply can't eat something like that. So I told him I'm a vegetarian and I only eat fish. ", + text = "He brought me some of his famous rat stew. I really didn't want to insult him, but I simply can't eat something like that. So I told him I'm a vegetarian and I only eat fish. ", }) keywordHandler:addKeyword({ "willie" }, StdModule.say, { npcHandler = npcHandler, @@ -410,8 +349,7 @@ keywordHandler:addAliasKeyword({ "dallheim" }) -- Orc language keywordHandler:addKeyword({ "orc" }, StdModule.say, { npcHandler = npcHandler, - text = "Not the nicest guys you can encounter. \z - I had some clashes with them and finally ended up being their {prisoner} for a few months.", + text = "Not the nicest guys you can encounter. I had some clashes with them and finally ended up being their {prisoner} for a few months.", }) local prisonerKeyword = keywordHandler:addKeyword({ "prisoner" }, StdModule.say, { npcHandler = npcHandler, @@ -487,11 +425,7 @@ keywordHandler:addAliasKeyword({ "notebook" }) npcHandler:setMessage(MESSAGE_WALKAWAY, "Yeah, see you later.") npcHandler:setMessage(MESSAGE_FAREWELL, "See you later, |PLAYERNAME|.") -npcHandler:setMessage( - MESSAGE_GREET, - "Oh hello, nice to see you |PLAYERNAME|. \z - Are you here to hear some stories of my {adventures} or do you need {help}?" -) +npcHandler:setMessage(MESSAGE_GREET, "Oh hello, nice to see you |PLAYERNAME|. Are you here to hear some stories of my {adventures} or do you need {help}?") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) diff --git a/data-otservbr-global/npc/angelina.lua b/data-otservbr-global/npc/angelina.lua index 0599d3ac243..eb63c4a63ae 100644 --- a/data-otservbr-global/npc/angelina.lua +++ b/data-otservbr-global/npc/angelina.lua @@ -54,9 +54,9 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand) < 1 then npcHandler:setMessage(MESSAGE_GREET, "The gods must be praised that I am finally saved. I do not have many worldly possessions, but please accept a small reward, do you?") - elseif player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand) >= 1 then + elseif player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand) >= 1 then npcHandler:setMessage(MESSAGE_GREET, "Thanks for saving my life! Should I teleport you out of the Dark Cathedral?") end return true @@ -70,19 +70,20 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "Yes") then - if player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand) < 1 then + if MsgContains(message, "yes") then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand) < 1 then npcHandler:say("I will tell you a small secret now. My friend Lynda in Thais can create a blessed wand. Greet her from me, maybe she will aid you.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand, 1) - player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) --this for default start of Outfit and Addon Quests - elseif player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand) >= 1 then - player:teleportTo(Position(32659, 32340, 7)) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand, 1) + player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) end end + return true end +npcHandler:setMessage(MESSAGE_FAREWELL, "May the gods bless you.") +npcHandler:setMessage(MESSAGE_WALKAWAY, "May the gods bless you.") + npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) diff --git a/data-otservbr-global/npc/angus.lua b/data-otservbr-global/npc/angus.lua index 3f8d80f6b4c..46579692d26 100644 --- a/data-otservbr-global/npc/angus.lua +++ b/data-otservbr-global/npc/angus.lua @@ -61,7 +61,7 @@ local function creatureSayCallback(npc, creature, type, message) -- Joining if MsgContains(message, "join") then - if player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) < 1 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) < 1 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) < 1 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) < 1 then npcHandler:say("Do you want to join the explorer society?", npc, creature) npcHandler:setTopic(playerId, 1) end @@ -97,205 +97,212 @@ local function creatureSayCallback(npc, creature, type, message) -- Mission Check elseif MsgContains(message, "mission") then if - player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) > 4 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) > 4 and player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) < 26 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) < 26 - or player:getStorageValue(Storage.ExplorerSociety.TheIceDelivery) == 8 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 8 - or player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 17 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 17 - or player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) == 5 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 5 + player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) > 4 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) > 4 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) < 26 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) < 26 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery) == 8 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 8 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 17 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 17 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) == 5 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 5 then npcHandler:say("The missions available for your rank are the {butterfly hunt}, {plant collection} and {ice delivery}.", npc, creature) npcHandler:setTopic(playerId, 0) elseif - player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) > 25 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) > 35 and player:getStorageValue(Storage.ExplorerSociety.TheOrcPowder) < 35 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) < 35 - or player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 26 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 26 - or player:getStorageValue(Storage.ExplorerSociety.TheLizardUrn) == 29 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 29 - or player:getStorageValue(Storage.ExplorerSociety.TheBonelordSecret) == 32 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 32 + player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) > 25 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) > 35 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder) < 35 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) < 35 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 26 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 26 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheLizardUrn) == 29 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 29 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheBonelordSecret) == 32 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 32 then npcHandler:say("The missions available for your rank are {lizard urn}, {bonelord secrets} and {orc powder}.", npc, creature) npcHandler:setTopic(playerId, 0) elseif - player:getStorageValue(Storage.ExplorerSociety.TheOrcPowder) > 34 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) > 34 and player:getStorageValue(Storage.ExplorerSociety.TheRuneWritings) < 44 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) < 44 - or player:getStorageValue(Storage.ExplorerSociety.TheOrcPowder) == 35 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 35 - or player:getStorageValue(Storage.ExplorerSociety.TheElvenPoetry) == 38 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 38 - or player:getStorageValue(Storage.ExplorerSociety.TheMemoryStone) == 41 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 41 + player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder) > 34 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) > 34 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings) < 44 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) < 44 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder) == 35 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 35 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheElvenPoetry) == 38 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 38 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheMemoryStone) == 41 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 41 then npcHandler:say("The missions available for your rank are {elven poetry}, {memory stone} and {rune writings}.", npc, creature) npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.ExplorerSociety.TheRuneWritings) == 44 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 44 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings) == 44 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 44 then npcHandler:say("The explorer society needs a great deal of help in the research of astral travel. Are you willing to help?", npc, creature) npcHandler:setTopic(playerId, 27) - elseif player:getStorageValue(Storage.ExplorerSociety.TheEctoplasm) == 46 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 46 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheEctoplasm) == 46 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 46 then npcHandler:say("Do you have some collected ectoplasm with you?", npc, creature) npcHandler:setTopic(playerId, 29) - elseif player:getStorageValue(Storage.ExplorerSociety.TheEctoplasm) == 47 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 47 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheEctoplasm) == 47 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 47 then npcHandler:say({ "The research on ectoplasm makes good progress. Now we need some spectral article. Our scientists think a spectral dress would be a perfect object for their studies ...", "The bad news is that the only source to got such a dress is the queen of the banshees. Do you dare to seek her out?" }, npc, creature) npcHandler:setTopic(playerId, 30) - elseif player:getStorageValue(Storage.ExplorerSociety.TheSpectralDress) == 49 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 48 then - npcHandler:say("Did you bring the dress?", npc, creature) + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralDress) == 49 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 48 then + npcHandler:say("Have you acquired the spectral dress we need?", npc, creature) npcHandler:setTopic(playerId, 31) -- Spectral stone - elseif player:getStorageValue(Storage.ExplorerSociety.TheSpectralDress) == 50 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 50 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralDress) == 50 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 50 then npcHandler:say({ "With the objects you've provided our researchers will make steady progress. Still we are missing some test results from fellow explorers ...", "Please travel to our base in Northport and ask them to mail us their latest research reports. Then return here and ask about new missions." }, npc, creature) - player:setStorageValue(Storage.ExplorerSociety.TheSpectralStone, 51) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 51) - player:setStorageValue(Storage.ExplorerSociety.SpectralStone, 1) - elseif player:getStorageValue(Storage.ExplorerSociety.TheSpectralStone) == 51 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 51 and player:getStorageValue(Storage.ExplorerSociety.SpectralStone) == 2 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 51) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 51) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone, 1) + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 51 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 51 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 2 then npcHandler:say("Oh, yes! Tell our fellow explorer that the papers are in the mail already.", npc, creature) - player:setStorageValue(Storage.ExplorerSociety.TheSpectralStone, 52) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 52) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 52) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 52) npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.ExplorerSociety.TheSpectralStone) == 52 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 52 and player:getStorageValue(Storage.ExplorerSociety.SpectralStone) == 1 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 52 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 52 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 1 then npcHandler:say("The reports from Northport have already arrived here and our progress is astonishing. We think it is possible to create an astral bridge between our bases. Are you interested to assist us with this?", npc, creature) npcHandler:setTopic(playerId, 32) -- Spectral stone -- Astral portals - elseif player:getStorageValue(Storage.ExplorerSociety.TheSpectralStone) == 55 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 55 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 55 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 55 then npcHandler:say({ "Both carvings are now charged and harmonised. In theory you should be able to travel in zero time from one base to the other ...", "However, you will need to have an orichalcum pearl in your possession to use it as power source. It will be destroyed during the process. I will give you 6 of such pearls and you can buy new ones in our bases ...", "In addition, you need to be a premium explorer to use the astral travel. ...", "And remember: it's a small teleport for you, but a big teleport for all Tibians! Here is a small present for your efforts!", }, npc, creature) - player:setStorageValue(Storage.ExplorerSociety.TheAstralPortals, 56) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 56) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheAstralPortals, 56) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 56) player:addItem(5021, 6) -- Orichalcum pearl player:addItem(9605, 1) -- Crown backpack + player:addItem(3035, 50) -- 50 Platinum coins -- Astral portals end -- Mission check -- Pickaxe mission elseif MsgContains(message, "pickaxe") then - if player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) < 5 or player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) > 1 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) < 1 or player:getStorageValue(Storage.ExplorerSociety.QuestLine) > 1 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) < 5 or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) > 1 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) < 1 or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) > 1 then npcHandler:say("Did you get the requested pickaxe from Uzgod in Kazordoon?", npc, creature) npcHandler:setTopic(playerId, 3) end -- Pickaxe mission -- Ice delivery elseif MsgContains(message, "ice delivery") then - if player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) == 5 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 5 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) == 5 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 5 then npcHandler:say({ "Our finest minds came up with the theory that deep beneath the ice island of Folda ice can be found that is ancient. To prove this theory we would need a sample of the aforesaid ice ...", "Of course the ice melts away quickly so you would need to hurry to bring it here ...", "Would you like to accept this mission?" }, npc, creature) npcHandler:setTopic(playerId, 4) - elseif player:getStorageValue(Storage.ExplorerSociety.TheIceDelivery) == 7 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 7 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery) == 7 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 7 then npcHandler:say("Did you get the ice we are looking for?", npc, creature) npcHandler:setTopic(playerId, 5) end -- Ice delivery -- Butterfly hunt elseif MsgContains(message, "butterfly hunt") then - if player:getStorageValue(Storage.ExplorerSociety.TheIceDelivery) == 8 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 8 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery) == 8 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 8 then npcHandler:say("The mission asks you to collect some species of butterflies, are you interested?", npc, creature) npcHandler:setTopic(playerId, 7) - elseif player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 10 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 10 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 10 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 10 then npcHandler:say("Did you acquire the purple butterfly we are looking for?", npc, creature) npcHandler:setTopic(playerId, 8) - elseif player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 11 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 11 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 11 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 11 then npcHandler:say({ "This preparation kit will allow you to collect a blue butterfly you have killed ...", "Just use it on the fresh corpse of a blue butterfly, return the prepared butterfly to me and give me a report of your butterfly hunt." }, npc, creature) npcHandler:setTopic(playerId, 0) player:addItem(4863, 1) - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 12) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 12) - elseif player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 13 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 13 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 12) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 12) + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 13 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 13 then npcHandler:say("Did you acquire the blue butterfly we are looking for?", npc, creature) npcHandler:setTopic(playerId, 9) - elseif player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 14 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 14 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 14 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 14 then npcHandler:say({ "This preparation kit will allow you to collect a red butterfly you have killed ...", "Just use it on the fresh corpse of a red butterfly, return the prepared butterfly to me and give me a report of your butterfly hunt." }, npc, creature) npcHandler:setTopic(playerId, 0) player:addItem(4863, 1) - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 15) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 15) - elseif player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 16 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 16 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 15) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 15) + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 16 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 16 then npcHandler:say("Did you acquire the red butterfly we are looking for?", npc, creature) npcHandler:setTopic(playerId, 10) end -- Butterfly Hunt -- Plant Collection elseif MsgContains(message, "plant collection") then - if player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 17 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 17 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 17 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 17 then npcHandler:say("In this mission we require you to get us some plant samples from Tiquandan plants. Would you like to fulfil this mission?", npc, creature) npcHandler:setTopic(playerId, 11) - elseif player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 19 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 19 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 19 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 19 then npcHandler:say("Did you acquire the sample of the jungle bells plant we are looking for?", npc, creature) npcHandler:setTopic(playerId, 12) - elseif player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 20 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 20 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 20 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 20 then npcHandler:say("Use this botanist's container on a witches cauldron to collect a sample for us. Bring it here and report about your plant collection.", npc, creature) npcHandler:setTopic(playerId, 0) player:addItem(4867, 1) - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 21) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 21) - elseif player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 22 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 22 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 21) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 21) + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 22 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 22 then npcHandler:say("Did you acquire the sample of the witches cauldron we are looking for?", npc, creature) npcHandler:setTopic(playerId, 13) - elseif player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 23 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 23 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 23 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 23 then npcHandler:say("Use this botanist's container on a giant jungle rose to obtain a sample for us. Bring it here and report about your plant collection.", npc, creature) npcHandler:setTopic(playerId, 0) player:addItem(4867, 1) - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 24) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 24) - elseif player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 25 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 25 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 24) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 24) + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 25 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 25 then npcHandler:say("Did you acquire the sample of the giant jungle rose we are looking for?", npc, creature) npcHandler:setTopic(playerId, 14) end -- Plant Collection -- Lizard Urn elseif MsgContains(message, "lizard urn") then - if player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 26 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 26 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 26 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 26 then npcHandler:say("The explorer society would like to acquire an ancient urn which is some sort of relic to the lizard people of Tiquanda. Would you like to accept this mission?", npc, creature) npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.ExplorerSociety.TheLizardUrn) == 28 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 27 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheLizardUrn) == 28 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 27 then npcHandler:say("Did you manage to get the ancient urn?", npc, creature) npcHandler:setTopic(playerId, 16) end -- Lizard Urn -- Bonelords elseif MsgContains(message, "bonelord secrets") then - if player:getStorageValue(Storage.ExplorerSociety.TheLizardUrn) == 29 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 29 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheLizardUrn) == 29 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 29 then npcHandler:say({ "We want to learn more about the ancient race of bonelords. We believe the black pyramid north east of Darashia was originally built by them ...", "We ask you to explore the ruins of the black pyramid and look for any signs that prove our theory. You might probably find some document with the numeric bonelord language ...", "That would be sufficient proof. Would you like to accept this mission?", }, npc, creature) npcHandler:setTopic(playerId, 17) - elseif player:getStorageValue(Storage.ExplorerSociety.TheBonelordSecret) == 31 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 30 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheBonelordSecret) == 31 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 30 then npcHandler:say("Have you found any proof that the pyramid was built by bonelords?", npc, creature) npcHandler:setTopic(playerId, 18) end -- Bonelords -- Orc Powder elseif MsgContains(message, "orc powder") then - if player:getStorageValue(Storage.ExplorerSociety.TheBonelordSecret) == 32 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 32 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheBonelordSecret) == 32 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 32 then npcHandler:say({ "It is commonly known that orcs of Uldereks Rock use some sort of powder to increase the fierceness of their war wolves and berserkers ...", "What we do not know are the ingredients of this powder and its effect on humans ...", "So we would like you to get a sample of the aforesaid powder. Do you want to accept this mission?" }, npc, creature) npcHandler:setTopic(playerId, 19) - elseif player:getStorageValue(Storage.ExplorerSociety.TheOrcPowder) == 34 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 33 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder) == 34 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 33 then npcHandler:say("Did you acquire some of the orcish powder?", npc, creature) npcHandler:setTopic(playerId, 20) end -- Orc Powder -- Elven Poetry elseif MsgContains(message, "elven poetry") then - if player:getStorageValue(Storage.ExplorerSociety.TheOrcPowder) == 35 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 35 then - npcHandler:say({ "Some high ranking members would like to study elven poetry. They want the rare book 'Songs of the Forest' ...", "For sure someone in Ab'Dendriel will own a copy. So you would just have to ask around there. Are you willing to accept this mission?" }, npc, creature) - npcHandler:setTopic(playerId, 21) - elseif player:getStorageValue(Storage.ExplorerSociety.TheElvenPoetry) == 37 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 36 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder) == 35 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 35 then + npcHandler:say({ + "Some high ranking members would like to study elven poetry. They want the rare book 'Songs of the Forest' ...", + "For sure someone in Ab'Dendriel will own a copy. So you would just have to ask around there. Are you willing to accept this mission?", + }, npc, creature) + npcHandler:setTopic(player:getId(), 21) + end + elseif MsgContains(message, "elven book") then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheElvenPoetry) == 37 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 36 then npcHandler:say("Did you acquire a copy of 'Songs of the Forest' for us?", npc, creature) - npcHandler:setTopic(playerId, 22) + npcHandler:setTopic(player:getId(), 22) end + -- Elven Poetry -- Memory Stone elseif MsgContains(message, "memory stone") then - if player:getStorageValue(Storage.ExplorerSociety.TheElvenPoetry) == 38 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 38 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheElvenPoetry) == 38 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 38 then npcHandler:say({ "We acquired some knowledge about special magic stones. Some lost civilisations used it to store knowledge and lore, just like we use books ...", "The wisdom in such stones must be immense, but so are the dangers faced by every person who tries to obtain one...", "As far as we know the ruins found in the north-west of Edron were once inhabited by beings who used such stones. Do you have the heart to go there and to get us such a stone?", }, npc, creature) npcHandler:setTopic(playerId, 23) - elseif player:getStorageValue(Storage.ExplorerSociety.TheMemoryStone) == 40 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 39 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheMemoryStone) == 40 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 39 then npcHandler:say("Were you able to acquire a memory stone for our society?", npc, creature) npcHandler:setTopic(playerId, 24) end -- Memory Stone -- Rune Writings elseif MsgContains(message, "rune writings") then - if player:getStorageValue(Storage.ExplorerSociety.TheMemoryStone) == 41 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 41 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheMemoryStone) == 41 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 41 then npcHandler:say({ "We would like to study some ancient runes that were used by the lizard race. We suspect some relation of the lizards to the founders of Ankrahmun ...", "Somewhere under the ape infested city of Banuta, one can find dungeons that were once inhabited by lizards...", @@ -303,7 +310,7 @@ local function creatureSayCallback(npc, creature, type, message) "Are you up to that challenge?", }, npc, creature) npcHandler:setTopic(playerId, 25) - elseif player:getStorageValue(Storage.ExplorerSociety.TheRuneWritings) == 43 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 43 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings) == 43 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 43 then npcHandler:say("Did you create a copy of the ancient runes as requested?", npc, creature) npcHandler:setTopic(playerId, 26) end @@ -320,238 +327,235 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 2 then npcHandler:say("We will see if you can handle this simple task. Get the pickaxe from Uzgod in Kazordoon and bring it to one of our bases. Report there about the pickaxe.", npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.ExplorerSociety.JoiningTheExplorers, 1) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 1) elseif npcHandler:getTopic(playerId) == 3 then if player:removeItem(4845, 1) then - player:setStorageValue(Storage.ExplorerSociety.JoiningTheExplorers, 5) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 5) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers, 5) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 5) npcHandler:say({ "Excellent, you brought just the tool we need! Of course it was only a simple task. However ...", "I officially welcome you to the explorer society. From now on you can ask for missions to improve your rank." }, npc, creature) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 4 then - player:setStorageValue(Storage.ExplorerSociety.TheIceDelivery, 6) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 6) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery, 6) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 6) npcHandler:say({ "So listen please: Take this ice pick and use it on a block of ice in the caves beneath Folda. Get some ice and bring it here as fast as you can ...", "Should the ice melt away, report on your ice delivery mission anyway. I will then tell you if the time is right to start another mission." }, npc, creature) npcHandler:setTopic(playerId, 0) player:addItem(4872, 1) elseif npcHandler:getTopic(playerId) == 5 then if player:removeItem(4837, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheIceDelivery, 8) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 8) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery, 8) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 8) npcHandler:say("Just in time. Sadly not much ice is left over but it will do. Thank you again.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 6 then - player:setStorageValue(Storage.ExplorerSociety.TheIceDelivery, 6) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 6) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery, 6) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 6) npcHandler:say("*Sigh* I think the time is right to grant you another chance to get that ice. Hurry up this time.", npc, creature) npcHandler:setTopic(playerId, 0) -- Butterfly Hunt elseif npcHandler:getTopic(playerId) == 7 then - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 9) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 9) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 9) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 9) npcHandler:say({ "This preparation kit will allow you to collect a purple butterfly you have killed ...", "Just use it on the fresh corpse of a purple butterfly, return the prepared butterfly to me and give me a report of your butterfly hunt." }, npc, creature) npcHandler:setTopic(playerId, 0) player:addItem(4863, 1) elseif npcHandler:getTopic(playerId) == 8 then if player:removeItem(4864, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 11) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 11) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 11) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 11) npcHandler:say("A little bit battered but it will do. Thank you! If you think you are ready, ask for another butterfly hunt.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 9 then if player:removeItem(4865, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 14) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 14) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 14) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 14) npcHandler:say("A little bit battered but it will do. Thank you! If you think you are ready, ask for another butterfly hunt.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 10 then if player:removeItem(4866, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 17) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 17) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 17) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 17) npcHandler:say("That is an extraordinary species you have brought. Thank you! That was the last butterfly we needed.", npc, creature) npcHandler:setTopic(playerId, 0) end -- Butterfly Hunt -- Plant Collection elseif npcHandler:getTopic(playerId) == 11 then - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 18) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 18) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 18) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 18) npcHandler:say("Fine! Here take this botanist's container. Use it on a jungle bells plant to collect a sample for us. Report about your plant collection when you have been successful.", npc, creature) npcHandler:setTopic(playerId, 0) player:addItem(4867, 1) elseif npcHandler:getTopic(playerId) == 12 then if player:removeItem(4868, 1) then - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 20) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 20) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 20) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 20) npcHandler:say("I see. It seems you've got some quite useful sample by sheer luck. Thank you! Just tell me when you are ready to continue with the plant collection.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 13 then if player:removeItem(4869, 1) then - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 23) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 23) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 23) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 23) npcHandler:say("Ah, finally. I started to wonder what took you so long. But thank you! Another fine sample, indeed. Just tell me when you are ready to continue with the plant collection.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 14 then if player:removeItem(4870, 1) then - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 26) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 26) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 26) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 26) npcHandler:say("What a lovely sample! With that you have finished your plant collection missions.", npc, creature) npcHandler:setTopic(playerId, 0) end -- Plant Collection -- Lizard Urn elseif npcHandler:getTopic(playerId) == 15 then - player:setStorageValue(Storage.ExplorerSociety.TheLizardUrn, 27) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 27) - player:setStorageValue(Storage.ExplorerSociety.ChorurnDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheLizardUrn, 27) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 27) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ChorurnDoor, 1) npcHandler:say({ "You have indeed the spirit of an adventurer! In the south-east of Tiquanda is a small settlement of the lizard people ...", "Beneath the newly constructed temple there, the lizards hide the said urn. Our attempts to acquire this item were without success ...", "Perhaps you are more successful." }, npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 16 then if player:removeItem(4847, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheLizardUrn, 29) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 29) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheLizardUrn, 29) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 29) npcHandler:say("Yes, that is the prized relic we have been looking for so long. You did a great job, thank you.", npc, creature) npcHandler:setTopic(playerId, 0) end -- Lizard Urn -- Bonelords elseif npcHandler:getTopic(playerId) == 17 then - player:setStorageValue(Storage.ExplorerSociety.TheBonelordSecret, 30) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 30) - player:setStorageValue(Storage.ExplorerSociety.BonelordsDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheBonelordSecret, 30) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 30) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.BonelordsDoor, 1) npcHandler:say({ "Excellent! So travel to the city of Darashia and then head north-east for the pyramid ...", "If any documents are left, you probably find them in the catacombs beneath. Good luck!" }, npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 18 then if player:removeItem(173, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheBonelordSecret, 32) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 32) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheBonelordSecret, 32) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 32) npcHandler:say("You did it! Excellent! The scientific world will be shaken by this discovery!", npc, creature) npcHandler:setTopic(playerId, 0) end -- Bonelords -- Orc Powder elseif npcHandler:getTopic(playerId) == 19 then - player:setStorageValue(Storage.ExplorerSociety.TheOrcPowder, 33) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 33) - player:setStorageValue(Storage.ExplorerSociety.OrcDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder, 33) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 33) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.OrcDoor, 1) npcHandler:say({ "You are a brave soul. As far as we can tell, the orcs maintain some sort of training facility in some hill in the north-east of their city ...", "There you should find lots of their war wolves and hopefully also some of the orcish powder. Good luck!" }, npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 20 then if player:removeItem(13974, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheOrcPowder, 35) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 35) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder, 35) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 35) npcHandler:say("You really got it? Amazing! Thank you for your efforts.", npc, creature) npcHandler:setTopic(playerId, 0) end -- Orc Powder -- Elven Poetry elseif npcHandler:getTopic(playerId) == 21 then - player:setStorageValue(Storage.ExplorerSociety.TheElvenPoetry, 36) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 36) - player:setStorageValue(Storage.ExplorerSociety.ElvenDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheElvenPoetry, 36) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 36) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ElvenDoor, 1) npcHandler:say("Excellent. This mission is easy but nonetheless vital. Travel to Ab'Dendriel and get the book.", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 22 then if player:removeItem(4844, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheElvenPoetry, 38) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 38) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheElvenPoetry, 38) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 38) npcHandler:say("Let me have a look! Yes, that's what we wanted. A copy of 'Songs of the Forest'. I won't ask any questions about those bloodstains.", npc, creature) npcHandler:setTopic(playerId, 0) end -- Elven Poetry -- Memory Stone elseif npcHandler:getTopic(playerId) == 23 then - player:setStorageValue(Storage.ExplorerSociety.TheMemoryStone, 39) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 39) - player:setStorageValue(Storage.ExplorerSociety.MemoryStoneDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheMemoryStone, 39) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 39) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.MemoryStoneDoor, 1) npcHandler:say("In the ruins of north-western Edron you should be able to find a memory stone. Good luck.", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 24 then if player:removeItem(4841, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheMemoryStone, 41) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 41) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheMemoryStone, 41) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 41) npcHandler:say("A flawless memory stone! Incredible! It will take years even to figure out how it works but what an opportunity for science, thank you!", npc, creature) npcHandler:setTopic(playerId, 0) end -- Memory Stone -- Rune Writings elseif npcHandler:getTopic(playerId) == 25 then - player:setStorageValue(Storage.ExplorerSociety.TheRuneWritings, 42) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 42) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings, 42) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 42) npcHandler:say("Excellent! Here, take this tracing paper and use it on the object you will find there to create a copy of the ancient runes.", npc, creature) npcHandler:setTopic(playerId, 0) player:addItem(4842, 1) elseif npcHandler:getTopic(playerId) == 26 then if player:removeItem(4843, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheRuneWritings, 44) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 44) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings, 44) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 44) npcHandler:say("It's a bit wrinkled but it will do. Thanks again.", npc, creature) npcHandler:setTopic(playerId, 0) end -- Rune Writings -- Ectoplasm elseif npcHandler:getTopic(playerId) == 27 then - npcHandler:say( - { "Fine. The society is looking for new means to travel. Some of our most brilliant minds have some theories about astral travel that they want to research further ...", "Therefore we need you to collect some ectoplasm from the corpse of a ghost. We will supply you with a collector that you can use on the body of a slain ghost ...", "Do you think you are ready for that mission?" }, - npc, - creature - ) + npcHandler:say({ + "Fine. The society is looking for new means to travel. Some of our most brilliant minds have some theories about astral travel that they want to research further ...", + "Therefore we need you to collect some ectoplasm from the corpse of a ghost. We will supply you with a collector that you can use on the body of a slain ghost ...", + "Do you think you are ready for that mission?", + }, npc, creature) npcHandler:setTopic(playerId, 28) elseif npcHandler:getTopic(playerId) == 28 then npcHandler:say("Good! Take this container and use it on a ghost that was recently slain. Return with the collected ectoplasm and hand me that container ...", npc, creature) npcHandler:say("Don't lose the container. They are expensive!", npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.ExplorerSociety.TheEctoplasm, 45) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 45) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheEctoplasm, 45) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 45) player:addItem(4852, 1) elseif npcHandler:getTopic(playerId) == 29 then if player:removeItem(4853, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheEctoplasm, 47) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 47) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheEctoplasm, 47) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 47) npcHandler:say("Phew, I had no idea that ectoplasm would smell that ... oh, it's you, well, sorry. Thank you for the ectoplasm.", npc, creature) npcHandler:setTopic(playerId, 0) end -- Ectoplasm -- Spectral Dress elseif npcHandler:getTopic(playerId) == 30 then - npcHandler:say( - { "That is quite courageous. We know, it's much we are asking for. The queen of the banshees lives in the so called Ghostlands, south west of Carlin. It is rumoured that her lair is located in the deepest dungeons beneath that cursed place ...", "Any violence will probably be futile, you will have to negotiate with her. Try to get a spectral dress from her. Good luck." }, - npc, - creature - ) + npcHandler:say({ + "That is quite courageous. We know, it's much we are asking for. The queen of the banshees lives in the so called Ghostlands, south west of Carlin. It is rumoured that her lair is located in the deepest dungeons beneath that cursed place ...", + "Any violence will probably be futile, you will have to negotiate with her. Try to get a spectral dress from her. Good luck.", + }, npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.ExplorerSociety.TheSpectralDress, 48) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 48) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralDress, 48) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 48) elseif npcHandler:getTopic(playerId) == 31 then if player:removeItem(4836, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheSpectralDress, 50) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 50) - npcHandler:say("Good! Ask me for another mission.", npc, creature) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralDress, 50) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 50) + npcHandler:say("Just in time! With this spectral article we can start the final phase of our research.", npc, creature) npcHandler:setTopic(playerId, 0) end -- Spectral Dress -- Spectral Stone elseif npcHandler:getTopic(playerId) == 32 then - npcHandler:say({ "Good, just take this spectral essence and use it on the strange carving in this building as well as on the corresponding tile in our base at Northport ...", "As soon as you have charged the portal tiles that way, report about the spectral portals." }, npc, creature) + npcHandler:say("Good, just take this spectral essence and use it on the strange carving in this building as well as on the corresponding tile in our base at Northport ...", "As soon as you have charged the portal tiles that way, report about the spectral portals.", npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.ExplorerSociety.TheSpectralStone, 53) - player:setStorageValue(Storage.ExplorerSociety.SpectralStoneDoor, 1) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 53) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 53) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStoneDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 53) player:addItem(4840, 1) -- Spectral stone -- Spectral Stone -- Skull Of Ratha / Giant Smithhammer elseif npcHandler:getTopic(playerId) == 33 then if player:removeItem(3207, 1) then npcHandler:say("Poor Ratha. Thank you for returning this skull to the society. We will see to a honourable burial of Ratha.", npc, creature) - player:setStorageValue(Storage.ExplorerSociety.SkullOfRatha, 1) - player:addItem(3035, 2) - player:addItem(3031, 50) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.SkullOfRatha.Bag1, 2) npcHandler:setTopic(playerId, 0) else npcHandler:say("Come back when you find any information.", npc, creature) @@ -560,9 +564,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 34 then if player:removeItem(12510, 1) then npcHandler:say("Marvellous! You brought a giant smith hammer for the explorer society!", npc, creature) - player:setStorageValue(Storage.ExplorerSociety.GiantSmithHammer, 1) - player:addItem(3035, 2) - player:addItem(3031, 50) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.GiantSmithHammer.Hamer, 2) npcHandler:setTopic(playerId, 0) else npcHandler:say("No you don't.", npc, creature) @@ -575,6 +577,13 @@ local function creatureSayCallback(npc, creature, type, message) player:setStorageValue(TheNewFrontier.Mission05.Angus, 1) npcHandler:setTopic(playerId, 2) end + -- Explorer Brooch + elseif npcHandler:getTopic(playerId) == 36 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ExplorerBrooch) == 1 and player:removeItem(4871, 1) then + npcHandler:say("It's always a sad day when we learn about the death of a member. But at least we learnt about his fate. Thank you, here is your reward.", npc, creature) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ExplorerBrooch, 2) + npcHandler:setTopic(playerId, 0) + end end -- Answer Yes -- Answer No @@ -591,13 +600,23 @@ local function creatureSayCallback(npc, creature, type, message) end -- Answer No -- Skull Of Ratha / Giant Smithhammer - elseif MsgContains(message, "skull of ratha") and player:getStorageValue(Storage.ExplorerSociety.SkullOfRatha) < 1 then - npcHandler:say({ "Ratha was a great explorer and even greater ladies' man. Sadly he never returned from a visit to the amazons. Probably he is dead ...", "The society offers a substantial reward for the retrieval of Ratha or his remains. Do you have any news about Ratha?" }, npc, creature) + elseif MsgContains(message, "skull of ratha") and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SkullOfRatha.Bag1) == 1 then + npcHandler:say({ + "Ratha was a great explorer and even greater ladies' man. Sadly he never returned from a visit to the amazons. Probably he is dead ...", + "The society offers a substantial reward for the retrieval of Ratha or his remains. Do you have any news about Ratha?", + }, npc, creature) npcHandler:setTopic(playerId, 33) - elseif MsgContains(message, "giant smith hammer") and player:getStorageValue(Storage.ExplorerSociety.GiantSmithHammer) < 1 then + elseif MsgContains(message, "giant smith hammer") and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.GiantSmithHammer.Hammer) == 1 then npcHandler:say("The explorer society is looking for a genuine giant smith hammer for our collection. It is rumoured the cyclopses of the Plains of Havoc might be using one. Did you by chance obtain such a hammer?", npc, creature) npcHandler:setTopic(playerId, 34) - -- Skull Of Ratha / Giant Smithhammer + -- Explorer Brooch + elseif MsgContains(message, "brooch") and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ExplorerBrooch) == 1 then + npcHandler:say({ + "Our members travel to far away places and cross dangerous areas, many fall prey to enemies or the land ...", + "Sometimes the personal explorer brooches can be recovered. That way we learn about the fate of our members ...", + "We offer a reward for each brooch returned to us. Have you found an explorer brooch?", + }, npc, creature) + npcHandler:setTopic(playerId, 36) else -- The New Frontier if player:getStorageValue(TheNewFrontier.Questline) == 14 and player:getStorageValue(TheNewFrontier.Mission05.Angus) == 1 then @@ -633,7 +652,7 @@ npcConfig.shop = { itemName = "crown backpack", clientId = 9605, buy = 800, - storageKey = Storage.ExplorerSociety.TheAstralPortals, + storageKey = Storage.Quest.U7_6.ExplorerSociety.TheAstralPortals, storageValue = 56, }, { diff --git a/data-otservbr-global/npc/ariella.lua b/data-otservbr-global/npc/ariella.lua index 35ff38f6621..b9565a9b28f 100644 --- a/data-otservbr-global/npc/ariella.lua +++ b/data-otservbr-global/npc/ariella.lua @@ -69,35 +69,26 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("So you brought a cookie to a pirate?", npc, creature) npcHandler:setTopic(playerId, 1) end - elseif MsgContains(message, "addon") and player:getStorageValue(Storage.OutfitQuest.PirateBaseOutfit) == 1 then - npcHandler:say( - "To get pirate hat you need give me Brutus Bloodbeard's Hat, \ - Lethal Lissy's Shirt, Ron the Ripper's Sabre and Deadeye Devious' Eye Patch. Do you have them with you?", - npc, - creature - ) + elseif MsgContains(message, "addon") and player:getStorageValue(Storage.Quest.U7_8.PirateOutfits.PirateBaseOutfit) == 1 then + npcHandler:say("You mean my hat? Well, I might have another one just like that, but I won't simply give it away, even if you earned our trust. You'd have to fulfil a task first.", npc, creature) npcHandler:setTopic(playerId, 2) + elseif npcHandler:getTopic(playerId) == 2 and MsgContains(message, "task") then + npcHandler:say("Your task is to bring me the shirt of the Lethal Lissy, the sabre of Ron the Ripper, the hat of Brutus Bloodbeard and the eye patch of Deadeye Devious. Did you succeed?", npc, creature) + npcHandler:setTopic(playerId, 5) elseif MsgContains(message, "mission") then - if player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 1 then - npcHandler:say( - "You know, we have plenty of rum here but we lack some basic food. \ - Especially food that easily becomes mouldy is a problem. Bring me 100 breads and you will help me a lot.", - npc, - creature - ) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 2) - elseif player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 2 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 1 then + npcHandler:say("You know, we have plenty of rum here but we lack some basic food. Especially food that easily becomes mouldy is a problem. Bring me 100 breads and you will help me a lot.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 2) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 2 then npcHandler:say("Are you here to bring me the 100 pieces of bread that I requested?", npc, creature) npcHandler:setTopic(playerId, 3) - elseif player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 10 then + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 3 then npcHandler:say({ - "The sailors always tell tales about the famous beer of Carlin. \z - You must know, alcohol is forbidden in that city. ...", - "The beer is served in a secret whisper bar anyway. \z - Bring me a sample of the whisper beer, NOT the usual beer but whisper beer. I hope you are listening.", + "The sailors always tell tales about the famous beer of Carlin. You must know, alcohol is forbidden in that city. ...", + "The beer is served in a secret whisper bar anyway. Bring me a sample of the whisper beer, NOT the usual beer but whisper beer. I hope you are listening.", }, npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 11) - elseif player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 12 or player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 11 then + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 4) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 5 then npcHandler:say("Did you get a sample of the whisper beer from Carlin?", npc, creature) npcHandler:setTopic(playerId, 4) end @@ -118,29 +109,11 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("How sweet of you ... Uhh ... OH NO ... Bozo did it again. Tell this prankster I'll pay him back.", npc, creature) npcHandler:removeInteraction(npc, creature) npcHandler:resetNpc(creature) - elseif npcHandler:getTopic(playerId) == 2 then - if player:getStorageValue(Storage.OutfitQuest.PirateHatAddon) == -1 then - if player:getItemCount(6101) > 0 and player:getItemCount(6102) > 0 and player:getItemCount(6100) > 0 and player:getItemCount(6099) > 0 then - if player:removeItem(6101, 1) and player:removeItem(6102, 1) and player:removeItem(6100, 1) and player:removeItem(6099, 1) then - npcHandler:say("Ah, right! The pirate hat! Here you go.", npc, creature) - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - player:setStorageValue(Storage.OutfitQuest.PirateHatAddon, 1) - player:addOutfitAddon(155, 2) - player:addOutfitAddon(151, 2) - end - else - npcHandler:say("You do not have all the required items.", npc, creature) - npcHandler:setTopic(playerId, 0) - end - else - npcHandler:say("It seems you already have this addon, don't you try to mock me son!", npc, creature) - npcHandler:setTopic(playerId, 0) - end elseif npcHandler:getTopic(playerId) == 3 then - if player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 2 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 2 then if player:removeItem(3600, 100) then npcHandler:say("What a joy. At least for a few days adequate supply is ensured.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 3) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 3) npcHandler:setTopic(playerId, 0) else npcHandler:say("Come back when you got all neccessary items.", npc, creature) @@ -148,16 +121,29 @@ local function creatureSayCallback(npc, creature, type, message) end end elseif npcHandler:getTopic(playerId) == 4 then - if player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 12 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 5 then if player:removeItem(6106, 1) then npcHandler:say("Thank you very much. I will test this beauty in privacy.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 14) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 6) npcHandler:setTopic(playerId, 0) else npcHandler:say("Come back when you got the neccessary item.", npc, creature) npcHandler:setTopic(playerId, 0) end end + elseif npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Quest.U7_8.PirateOutfits.PirateHatAddon) == -1 then + if player:getItemCount(6101) > 0 and player:getItemCount(6102) > 0 and player:getItemCount(6100) > 0 and player:getItemCount(6099) > 0 then + if player:removeItem(6101, 1) and player:removeItem(6102, 1) and player:removeItem(6100, 1) and player:removeItem(6099, 1) then + npcHandler:say("INCREDIBLE! You have found all four of them! |PLAYERNAME|, you have my respect. You more than deserve this hat. There you go.", npc, creature) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + player:addOutfitAddon(155, 2) + player:addOutfitAddon(151, 2) + player:setStorageValue(Storage.Quest.U7_8.PirateOutfits.PirateHatAddon, 1) + end + else + npcHandler:say("You do not have all the required items.", npc, creature) + npcHandler:setTopic(playerId, 0) + end end elseif MsgContains(message, "no") then if npcHandler:getTopic(playerId) == 1 then @@ -168,9 +154,11 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 0) end end + return true end +npcHandler:setMessage(MESSAGE_GREET, "Hi there.") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) diff --git a/data-otservbr-global/npc/atrad.lua b/data-otservbr-global/npc/atrad.lua index 2c07cf9725a..61c09fb4b19 100644 --- a/data-otservbr-global/npc/atrad.lua +++ b/data-otservbr-global/npc/atrad.lua @@ -50,6 +50,12 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local function endConversationWithDelay(npcHandler, npc, creature) + addEvent(function() + npcHandler:unGreet(npc, creature) + end, 1000) +end + local function greetCallback(npc, creature) local player = Player(creature) local fire = player:getCondition(CONDITION_FIRE) @@ -57,6 +63,8 @@ local function greetCallback(npc, creature) if fire and (player:hasOutfit(156) or player:hasOutfit(152)) then return true end + + endConversationWithDelay(npcHandler, npc, creature) return false end @@ -76,7 +84,8 @@ local function creatureSayCallback(npc, creature, type, message) doPlayerRemoveItem(creature, 5804, 1) doPlayerRemoveItem(creature, 5930, 1) doPlayerAddOutfit(creature, getPlayerSex(creature) == 0 and 156 or 152, 2) - setPlayerStorageValue(creature, Storage.Atrad, 2) -- exaust + setPlayerStorageValue(creature, Storage.Atrad, 2) + setPlayerStorageValue(creature, Storage.Quest.U7_8.AssassinOutfits.AssassinSecondAddon, 2) npcHandler:setTopic(playerId, 0) else npcHandler:say("You don't have it...", npc, creature) @@ -90,6 +99,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 3 then npcHandler:say("Good. Come back then you have BOTH. Should be clear where to get a behemoth claw from. There's a horned fox who wears a nose ring. Good luck.", npc, creature) setPlayerStorageValue(creature, Storage.Atrad, 1) + setPlayerStorageValue(creature, Storage.Quest.U7_8.AssassinOutfits.AssassinSecondAddon, 1) npcHandler:setTopic(playerId, 0) end end diff --git a/data-otservbr-global/npc/baa_leal.lua b/data-otservbr-global/npc/baa_leal.lua index 5a1cc2a96b5..2f2fd3d5de9 100644 --- a/data-otservbr-global/npc/baa_leal.lua +++ b/data-otservbr-global/npc/baa_leal.lua @@ -45,6 +45,12 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local function endConversationWithDelay(npcHandler, npc, creature) + addEvent(function() + npcHandler:unGreet(npc, creature) + end, 1000) +end + local condition = Condition(CONDITION_FIRE) condition:setParameter(CONDITION_PARAM_DELAYED, 1) condition:addDamage(150, 2000, -10) @@ -53,18 +59,29 @@ local function greetCallback(npc, creature, message) local player = Player(creature) local playerId = player:getId() - if not player:getCondition(CONDITION_FIRE) and not MsgContains(message, "djanni'hah") then - player:getPosition():sendMagicEffect(CONST_ME_EXPLOSIONAREA) - player:addCondition(condition) - npcHandler:say("Take this!", npc, creature) + if not MsgContains(message, "djanni'hah") then + npcHandler:say("Shove off, little one! Humans are not welcome here, |PLAYERNAME|!", npc, creature) + endConversationWithDelay(npcHandler, npc, creature) return false end - if player:getStorageValue(Storage.DjinnWar.EfreetFaction.Mission01) < 1 then - npcHandler:setMessage(MESSAGE_GREET, "You know the code human! Very well then... What do you want, |PLAYERNAME|?") + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Start) == 1 then + npcHandler:say({ + "Hahahaha! ...", + "|PLAYERNAME|, that almost sounded like the word of greeting. Humans - cute they are!", + }, npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission01) < 1 then + npcHandler:say("You know the code human! Very well then... What do you want, |PLAYERNAME|?", npc, creature) else - npcHandler:setMessage(MESSAGE_GREET, "You are still alive, |PLAYERNAME|? Well, what do you want?") + npcHandler:say("You are still alive, |PLAYERNAME|? Well, what do you want?", npc, creature) end + + npcHandler:setInteraction(npc, creature) + return true end @@ -76,7 +93,7 @@ local function creatureSayCallback(npc, creature, type, message) return false end - local missionProgress = player:getStorageValue(Storage.DjinnWar.EfreetFaction.Mission01) + local missionProgress = player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission01) if MsgContains(message, "mission") then if missionProgress < 1 then npcHandler:say({ @@ -101,8 +118,8 @@ local function creatureSayCallback(npc, creature, type, message) "His identity is still unknown but we have been told that the thief fled to the human settlement called Carlin. I want you to find him and report back to me. Nobody messes with the Efreet and lives to tell the tale! ...", "Now go! Travel to the northern city Carlin! Keep your eyes open and look around for something that might give you a clue!", }, npc, creature) - player:setStorageValue(Storage.DjinnWar.EfreetFaction.Start, 1) - player:setStorageValue(Storage.DjinnWar.EfreetFaction.Mission01, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Start, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission01, 1) elseif MsgContains(message, "no") then npcHandler:say("After all, you're just a human.", npc, creature) end @@ -126,7 +143,7 @@ local function creatureSayCallback(npc, creature, type, message) "If you are interested go to Alesar and ask him about it.", }, npc, creature) player:addMoney(600) - player:setStorageValue(Storage.DjinnWar.EfreetFaction.Mission01, 3) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission01, 3) end else npcHandler:say("Hmmm... I don't think so. Return to Thais and continue your search!", npc, creature) @@ -136,8 +153,7 @@ local function creatureSayCallback(npc, creature, type, message) return true end --- Greeting message -keywordHandler:addGreetKeyword({ "djanni'hah" }, { npcHandler = npcHandler, text = "What do you want from me, |PLAYERNAME|?" }) +keywordHandler:addCustomGreetKeyword({ "djanni'hah" }, greetCallback, { npcHandler = npcHandler }) npcHandler:setMessage(MESSAGE_FAREWELL, "Stand down, soldier!") diff --git a/data-otservbr-global/npc/berenice.lua b/data-otservbr-global/npc/berenice.lua index d1889c032cd..6bbd55dd3e4 100644 --- a/data-otservbr-global/npc/berenice.lua +++ b/data-otservbr-global/npc/berenice.lua @@ -59,23 +59,21 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "mission") then - if player:getStorageValue(Storage.ExplorerSociety.CalassaQuest) == 2 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.CalassaQuest) == 2 then npcHandler:say("OH! So you have safely returned from Calassa! Congratulations, were you able to retrieve the logbook?", npc, creature) npcHandler:setTopic(playerId, 5) - elseif player:getStorageValue(Storage.ExplorerSociety.TheOrcPowder) > 34 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) > 34 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder) > 34 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) > 44 then npcHandler:say("The most important mission we currently have is an expedition to {Calassa}.", npc, creature) npcHandler:setTopic(playerId, 1) end elseif MsgContains(message, "calassa") then - if npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.ExplorerSociety.CalassaQuest) < 1 then + if npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.CalassaQuest) < 1 then npcHandler:say("Ah! So you have heard about our special mission to investigate the Quara race in their natural surrounding! Would you like to know more about it?", npc, creature) npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 4 then npcHandler:say("Captain Max will bring you to Calassa whenever you are ready. Please try to retrieve the missing logbook which must be in one of the sunken shipwrecks.", npc, creature) - player:setStorageValue(Storage.ExplorerSociety.CalassaDoor, 1) - player:setStorageValue(Storage.ExplorerSociety.CalassaQuest, 1) npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.ExplorerSociety.CalassaQuest) == 2 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.CalassaQuest) == 2 then npcHandler:say("OH! So you have safely returned from Calassa! Congratulations, were you able to retrieve the logbook?", npc, creature) npcHandler:setTopic(playerId, 5) end @@ -94,10 +92,12 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 3) elseif npcHandler:getTopic(playerId) == 3 then npcHandler:say("Excellent! I will immediately inform Captain Max to bring you to {Calassa} whenever you are ready. Don't forget to make thorough preparations!", npc, creature) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.CalassaQuest, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.CalassaDoor, 1) npcHandler:setTopic(playerId, 4) elseif npcHandler:getTopic(playerId) == 5 then if player:removeItem(21378, 1) then - player:setStorageValue(Storage.ExplorerSociety.CalassaQuest, 3) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.CalassaQuest, 3) npcHandler:say("Yes! That's the logbook! However... it seems that the water has already destroyed many of the pages. This is not your fault though, you did your best. Thank you!", npc, creature) npcHandler:setTopic(playerId, 0) end diff --git a/data-otservbr-global/npc/bo_ques.lua b/data-otservbr-global/npc/bo_ques.lua index 3b279836dcc..7ceb854a77c 100644 --- a/data-otservbr-global/npc/bo_ques.lua +++ b/data-otservbr-global/npc/bo_ques.lua @@ -51,6 +51,52 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local function endConversationWithDelay(npcHandler, npc, creature) + addEvent(function() + npcHandler:unGreet(npc, creature) + end, 1000) +end + +local function greetCallback(npc, creature, message) + local player = Player(creature) + local playerId = player:getId() + + if not MsgContains(message, "djanni'hah") then + npcHandler:say("Whoa! A human! This is no place for you, |PLAYERNAME|. Go and play somewhere else.", npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Start) == 1 then + npcHandler:say({ + "Hahahaha! ...", + "|PLAYERNAME|, that almost sounded like the word of greeting. Humans - cute they are!", + }, npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.Greeting) == -1 then + npcHandler:say({ + "Hahahaha! ...", + "|PLAYERNAME|, that almost sounded like the word of greeting. Humans - cute they are!", + }, npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.MaridDoor) == 1 then + npcHandler:say("Hey! A human! What are you doing in my kitchen, |PLAYERNAME|?", npc, creature) + else + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + npcHandler:setInteraction(npc, creature) + + return true +end + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -59,7 +105,7 @@ local function creatureSayCallback(npc, creature, type, message) return false end - local missionProgress = player:getStorageValue(Storage.DjinnWar.MaridFaction.Mission01) + local missionProgress = player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission01) if MsgContains(message, "recipe") or MsgContains(message, "mission") then if missionProgress < 1 then npcHandler:say({ @@ -88,8 +134,8 @@ local function creatureSayCallback(npc, creature, type, message) "Fine! Even though I know so many recipes, I'm looking for the description of some dwarven meals. ...", "So, if you could bring me a cookbook of the dwarven kitchen, I'll reward you well.", }, npc, creature) - player:setStorageValue(Storage.DjinnWar.MaridFaction.Start, 1) - player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission01, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Start, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission01, 1) elseif MsgContains(message, "no") then npcHandler:say("Well, too bad.", npc, creature) end @@ -106,7 +152,7 @@ local function creatureSayCallback(npc, creature, type, message) "Dragon Egg Omelette, Dwarven beer sauce... it's all there. This is great! Here is your well-deserved reward. ...", "Incidentally, I have talked to Fa'hradin about you during dinner. I think he might have some work for you. Why don't you talk to him about it?", }, npc, creature) - player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission01, 2) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission01, 2) player:addItem(3029, 3) elseif MsgContains(message, "no") then npcHandler:say("Too bad. I must have this book.", npc, creature) @@ -117,7 +163,7 @@ local function creatureSayCallback(npc, creature, type, message) end -- Greeting -keywordHandler:addGreetKeyword({ "djanni'hah" }, { npcHandler = npcHandler, text = "Hey! A human! What are you doing in my kitchen, |PLAYERNAME|?" }) +keywordHandler:addCustomGreetKeyword({ "djanni'hah" }, greetCallback, { npcHandler = npcHandler }) npcHandler:setMessage(MESSAGE_FAREWELL, "Goodbye. I am sure you will come back for more. They all do.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Goodbye. I am sure you will come back for more. They all do.") diff --git a/data-otservbr-global/npc/brewster.lua b/data-otservbr-global/npc/brewster.lua index a59118bc953..3314d49c2d2 100644 --- a/data-otservbr-global/npc/brewster.lua +++ b/data-otservbr-global/npc/brewster.lua @@ -50,6 +50,21 @@ 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 MsgContains(message, "cough syrup") then + npcHandler:say("The only person who might have some cough syrup is this druid Ustan. You find him in the tavern. Hmmm the tavern ... ", npc, creature) + end + + return true +end + -- Twist of Fate local blessKeyword = keywordHandler:addKeyword({ "twist of fate" }, StdModule.say, { npcHandler = npcHandler, @@ -90,23 +105,23 @@ stoneKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, t -- Wooden Stake keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "I think you have forgotten to bring your stake, pilgrim." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 9 and player:getItemCount(5941) == 0 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 9 and player:getItemCount(5941) == 0 end) local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Yes, I have been informed and haven't yet drunk enough to forget, so you can count yourself lucky. Are you prepared to receive my line of the prayer?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 9 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 9 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "So receive my prayer: 'Your hand shall be guided - your feet shall walk in harmony'. Now, take your stake to Tyrias in Liberty Bay for the next line of the prayer. I shall let him know what he is to do.", reset = true }, nil, function(player) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 10) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 10) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end) stakeKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "I'll wait for you.", reset = true }) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You should visit Tyrias in Liberty Bay now." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 10 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 10 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You have already received my line of the prayer. Don't make me do more work than necessary!" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) > 10 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) > 10 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "A blessed stake? That's a strange request. Maybe Quentin knows more, he is one of the oldest monks after all." }) @@ -171,6 +186,8 @@ npcHandler:setMessage(MESSAGE_GREET, "Welcome, young |PLAYERNAME|! If you are he npcHandler:setMessage(MESSAGE_WALKAWAY, "Remember: If you are heavily wounded or poisoned, I can heal you for free.") npcHandler:setMessage(MESSAGE_FAREWELL, "May the gods bless you, |PLAYERNAME|!") +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/bron.lua b/data-otservbr-global/npc/bron.lua index 014be84e6b6..804e60c8284 100644 --- a/data-otservbr-global/npc/bron.lua +++ b/data-otservbr-global/npc/bron.lua @@ -54,9 +54,10 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 6 then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 6 then npcHandler:setMessage(MESSAGE_GREET, "Oh no! Was that really me? This is so embarassing, I have no idea what has gotten into me. Was that the fighting spirit you gave me?") end + return true end @@ -71,15 +72,15 @@ local function creatureSayCallback(npc, creature, type, message) end if table.contains({ "recruitment", "violence", "outfit", "addon" }, message) then - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) < 1 then npcHandler:say({ "Convincing Ajax that it is not always necessary to use brute force... this would be such an achievement. Definitely a hard task though. ...", "Listen, I simply have to ask, maybe a stranger can influence him better than I can. Would you help me with my brother?", }, npc, creature) npcHandler:setTopic(playerId, 1) end - elseif MsgContains(message, "fist") then - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 3 then + elseif MsgContains(message, "brother is right. fist not always good.") then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 3 then npcHandler:say("Oh! He really said that? I am so proud of you, |PLAYERNAME|. These are really good news. Everything would be great... if only there wasn't this {person} near my house.", npc, creature) npcHandler:setTopic(playerId, 3) end @@ -92,25 +93,25 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 4) end elseif MsgContains(message, "fighting spirit") then - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 5 then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 5 then if player:removeItem(5884, 1) then - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 6) npcHandler:say("Fighting spirit? What am I supposed to do with this fi... - oh! I feel strange... ME MIGHTY! ME WILL CHASE OFF ANNOYING KIDS!GROOOAARR!! RRRRRRRRRRRRAAAAAAAGE!!", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 6) npcHandler:setTopic(playerId, 0) end end - elseif MsgContains(message, "cloth") then - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 7 then - npcHandler:say("Have you really managed to fulfil the task and brought me 25 pieces of red cloth and 25 pieces of green cloth?", npc, creature) + elseif MsgContains(message, "red piece of cloth") then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 7 then + npcHandler:say("Have you really managed to fulfil the task and brought me 50 pieces of red cloth and 50 pieces of green cloth?", npc, creature) npcHandler:setTopic(playerId, 8) end - elseif MsgContains(message, "silk") then - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 8 then - npcHandler:say("Oh, did you bring 5 rolls of spider silk yarn for me?", npc, creature) + elseif MsgContains(message, "rolls of spider silk") then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 8 then + npcHandler:say("Oh, did you bring 10 rolls of spool of yarn for me?", npc, creature) npcHandler:setTopic(playerId, 9) end - elseif MsgContains(message, "sweat") then - if player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 9 then + elseif MsgContains(message, "warriors sweat") then + if player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 9 then npcHandler:say("Were you able to get hold of a flask with pure warrior's sweat?", npc, creature) npcHandler:setTopic(playerId, 10) end @@ -127,14 +128,13 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 2 then npcHandler:say("You are indeed not only well educated, but also very courageous. I wish you good luck, you are my last hope.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 1) - player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) --this for default start of Outfit and Addon Quests + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 4 then npcHandler:say("Again, I have to thank you for your selfless offer to help me. I hope that Ajax can come up with something, now that he has experienced the power of words.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 4) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 4) npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 6 and npcHandler:getTopic(playerId) == 0 then + elseif player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 6 and npcHandler:getTopic(playerId) == 0 then npcHandler:say({ "I'm impressed... I am sure this was Ajax' idea. I would love to give him a present, but if I leave my hut to gather ingredients, hewill surely notice. ...", "Would you maybe help me again, one last time, my friend? I assure you that your efforts will not be in vain.", @@ -143,48 +143,50 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 6 then npcHandler:say({ "Great! You see, I really would love to sew a nice shirt for him. I just need a few things for that, so please listen closely: ...", - "He loves green and red, so I will need about 25 pieces of red cloth - like the material heroes make their capes of - and 25 pieces of the green cloth Djinns like. ...", - "Secondly, I need about 5 rolls of spider silk yarn. I think mermaids can yarn silk of large spiders to create a smooth thread. ...", + "He loves green and red, so I will need about 50 pieces of red cloth - like the material heroes make their capes of - and 50 pieces of the green cloth Djinns like. ...", + "Secondly, I need about 10 rolls of spider silk yarn. I think mermaids can yarn silk of large spiders to create a smooth thread. ...", "The only remaining thing needed would be a bottle of warrior's sweat to spray it over the shirt... he just loves this smell. ...", "Have you understood everything I told you and are willing to handle this task?", }, npc, creature) npcHandler:setTopic(playerId, 7) elseif npcHandler:getTopic(playerId) == 7 then - npcHandler:say("Thank you, my friend! Come back to me once you have collected 25 pieces of red cloth and 25 pieces of green cloth.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 7) + npcHandler:say("Thank you, my friend! Come back to me once you have collected 50 pieces of red cloth and 50 pieces of green cloth.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 7) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 8 then - if player:getItemCount(5910) >= 25 and player:getItemCount(5911) >= 25 then - npcHandler:say("Terrific! I will start to trim it while you gather 5 rolls of spider silk. I'm sure that Ajax will love it.", npc, creature) - player:removeItem(5910, 25) - player:removeItem(5911, 25) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 8) + if player:getItemCount(5910) >= 50 and player:getItemCount(5911) >= 50 then + npcHandler:say("Terrific! I will start to trim it while you gather 10 rolls of spider silk. I'm sure that Ajax will love it.", npc, creature) + player:removeItem(5910, 50) + player:removeItem(5911, 50) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 8) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 9 then - if player:removeItem(5886, 5) then - npcHandler:say("I'm impressed! You really managed to get spider silk yarn for me! I will immediately start to work on this shirt. Please don't forget to bring me warrior's sweat!", npc, creature) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 9) + if player:removeItem(5886, 10) then + npcHandler:say("I'm impressed! You really managed to get spool of yarn for me! I will immediately start to work on this shirt. Please don't forget to bring me warrior's sweat!", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 9) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 10 then if player:removeItem(5885, 1) then npcHandler:say("Good work, |PLAYERNAME|! Now I can finally finish this present for Ajax. Because you were such a great help, I have also a present for you. Will you accept it?", npc, creature) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 10) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 10) npcHandler:setTopic(playerId, 0) end - elseif player:getStorageValue(Storage.OutfitQuest.BarbarianAddon) == 10 then + elseif player:getStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon) == 10 then npcHandler:say("I have kept this traditional barbarian wig safe for many years now. It is now yours! I hope you will wear it proudly, friend.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.BarbarianAddon, 11) player:addOutfitAddon(147, 2) player:addOutfitAddon(143, 2) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) + player:setStorageValue(Storage.Quest.U7_8.BarbarianOutfits.BarbarianAddon, 11) npcHandler:setTopic(playerId, 0) end end return true end +npcHandler:setMessage(MESSAGE_GREET, "Welcome to my humble hut, |PLAYERNAME|.") + npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:setMessage(MESSAGE_FAREWELL, "Take care, |PLAYERNAME|!") diff --git a/data-otservbr-global/npc/captain_max.lua b/data-otservbr-global/npc/captain_max.lua index 34eb7693cc2..e72008fd526 100644 --- a/data-otservbr-global/npc/captain_max.lua +++ b/data-otservbr-global/npc/captain_max.lua @@ -59,7 +59,7 @@ end local function addTravelKeyword(keyword, text, cost, destination) if keyword == "calassa" then keywordHandler:addKeyword({ keyword }, StdModule.say, { npcHandler = npcHandler, text = "I'm sorry but we don't serve this route." }, function(player) - return player:getStorageValue(Storage.ExplorerSociety.CalassaQuest) < 1 + return player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.CalassaQuest) < 1 end) end diff --git a/data-otservbr-global/npc/captain_waverider.lua b/data-otservbr-global/npc/captain_waverider.lua index d69108b7a02..52d0a3005b8 100644 --- a/data-otservbr-global/npc/captain_waverider.lua +++ b/data-otservbr-global/npc/captain_waverider.lua @@ -55,7 +55,7 @@ local function creatureSayCallback(npc, creature, type, message) local playerId = player:getId() if MsgContains(message, "peg leg") then - if player:getStorageValue(Storage.TheShatteredIsles.AccessToMeriana) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.AccessToMeriana) == 1 then npcHandler:say("Ohhhh. So... you know who sent you so I sail you to you know where. It will cost 50 gold to cover my expenses. Is it that what you wish?", npc, creature) npcHandler:setTopic(playerId, 1) else diff --git a/data-otservbr-global/npc/ceiron.lua b/data-otservbr-global/npc/ceiron.lua index 9a52c506291..efbd172fe7d 100644 --- a/data-otservbr-global/npc/ceiron.lua +++ b/data-otservbr-global/npc/ceiron.lua @@ -59,7 +59,7 @@ local function creatureSayCallback(npc, creature, type, message) end if table.contains({ "addon", "outfit" }, message) then - if player:getStorageValue(Storage.OutfitQuest.DruidHatAddon) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon) < 1 then npcHandler:say("What are you thinking! I would never allow you to slay my beloved friends for the sake of your narcism. Only {Faolan} can grant you a fur like this one.", npc, creature) npcHandler:setTopic(playerId, 2) end @@ -67,18 +67,18 @@ local function creatureSayCallback(npc, creature, type, message) if npcHandler:getTopic(playerId) == 2 then npcHandler:say("I know where the great wolf mother lives, but I will not tell that to just anyone. You have to earn my respect first. Are you willing to help me?", npc, creature) npcHandler:setTopic(playerId, 3) - elseif player:getStorageValue(Storage.OutfitQuest.DruidHatAddon) == 8 then + elseif player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon) == 8 then npcHandler:say("Right, I will keep my promise. Faolan roams Tibia freely, but her favourite sleeping cave is on Cormaya. I will now enchant you so you will be able to speak the wolf language.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.DruidHatAddon, 9) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon, 9) npcHandler:setTopic(playerId, 0) end elseif table.contains({ "griffinclaw", "container" }, message) then - if player:getStorageValue(Storage.OutfitQuest.DruidHatAddon) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon) == 1 then npcHandler:say("Were you able to obtain a sample of the Griffinclaw?", npc, creature) npcHandler:setTopic(playerId, 5) end elseif MsgContains(message, "task") then - if player:getStorageValue(Storage.OutfitQuest.DruidHatAddon) == 2 then + if player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon) == 2 then npcHandler:say({ "Listen, my next task for you is not exactly easy either. ...", "In the mountains between Ankrahmun and Tiquanda are two hydra lairs. The nothern one has many waterfalls whereas the southern one has just tiny water trickles. ...", @@ -88,7 +88,7 @@ local function creatureSayCallback(npc, creature, type, message) "Have you understood everything I told you and will fulfil this task for me?", }, npc, creature) npcHandler:setTopic(playerId, 6) - elseif player:getStorageValue(Storage.OutfitQuest.DruidHatAddon) == 4 then + elseif player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon) == 4 then npcHandler:say({ "I'm glad that you are still with me, |PLAYERNAME|. Especially because my next task might require even more patience from your side than the ones before. ...", "Demons... these unholy creatures should have never been able to walk the earth. They are a brood fueled only by hatred and malice. ...", @@ -99,7 +99,7 @@ local function creatureSayCallback(npc, creature, type, message) "Have you understood everything I told you and will fulfil this task for me?", }, npc, creature) npcHandler:setTopic(playerId, 8) - elseif player:getStorageValue(Storage.OutfitQuest.DruidHatAddon) == 6 then + elseif player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon) == 6 then npcHandler:say({ "I have one final task for you, |PLAYERNAME|. Many months ago, I was trying to free the war wolves which are imprisoned inside the orc fortress.", "Unfortunately, my intrusion was discovered and I had to run for my life. During my escape, I lost my favourite wolf tooth chain.", @@ -110,22 +110,22 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 10) end elseif MsgContains(message, "waterskin") or MsgContains(message, "water skin") then - if player:getStorageValue(Storage.OutfitQuest.DruidHatAddon) == 3 then + if player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon) == 3 then npcHandler:say("Did you bring me a sample of water from the hydra cave?", npc, creature) npcHandler:setTopic(playerId, 7) end elseif MsgContains(message, "dust") or MsgContains(message, "demon dust") then - if player:getStorageValue(Storage.OutfitQuest.DruidHatAddon) == 5 then + if player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon) == 5 then npcHandler:say("Were you really able to collect 100 ounces of demon dust?", npc, creature) npcHandler:setTopic(playerId, 9) end elseif MsgContains(message, "chain") or MsgContains(message, "wolf tooth chain") then - if player:getStorageValue(Storage.OutfitQuest.DruidHatAddon) == 7 then + if player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon) == 7 then npcHandler:say("Have you really found my wolf tooth chain??", npc, creature) npcHandler:setTopic(playerId, 11) end elseif MsgContains(message, "ceiron's waterskin") then - if player:getStorageValue(Storage.OutfitQuest.DruidHatAddon) == 3 then + if player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon) == 3 then npcHandler:say("Have you lost my waterskin?", npc, creature) npcHandler:setTopic(playerId, 12) end @@ -141,46 +141,46 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 4) elseif npcHandler:getTopic(playerId) == 4 then npcHandler:say("Alright then. Take this botanist's container and return to me once you were able to retrieve a sample. Don't lose patience!", npc, creature) - player:setStorageValue(Storage.OutfitQuest.DruidHatAddon, 1) - player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) --this for default start of Outfit and Addon Quests + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon, 1) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.DefaultStart, 1) --this for default start of Outfit and Addon Quests player:addItem(4867, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 5 then if player:removeItem(5937, 1) then npcHandler:say("Crunor be praised! The Griffinclaw really exists! Now, I will make sure that it will not become extinct. If you are ready to help me again, just ask me for a {task}.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.DruidHatAddon, 2) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon, 2) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 6 then npcHandler:say("Great! Here, take my waterskin and try to fill it with water from this special trickle. Don't lose my waterskin, I will not accept some random dirty waterskin.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.DruidHatAddon, 3) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon, 3) player:addItem(5938, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 7 then if player:removeItem(5939, 1) then npcHandler:say("Good work, |PLAYERNAME|! This water looks indeed extremely clear. I will examine it right away. If you are ready to help me again, just ask me for a {task}.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.DruidHatAddon, 4) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon, 4) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 8 then - npcHandler:say("Good! I will eagerly await your return.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.DruidHatAddon, 5) + npcHandler:say("I'm very impressed, |PLAYERNAME|. With this task you have proven that you are on the right side and are powerful as well. If you are ready to help me again, just ask me for a {task}.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon, 5) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 9 then if player:removeItem(5906, 100) then npcHandler:say("I'm very impressed, |PLAYERNAME|. With this task you have proven that you are on the right side and are powerful as well. If you are ready to help me again, just ask me for a {task}.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.DruidHatAddon, 6) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon, 6) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 10 then npcHandler:say("Thank you so much. I can't wait to wear it around my neck again, it was a special present from Faolan.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.DruidHatAddon, 7) - player:setStorageValue(Storage.OutfitQuest.DruidAmuletDoor, 1) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon, 7) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidAmuletDoor, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 11 then if player:removeItem(5940, 1) then npcHandler:say("Crunor be praised! You found my beloved chain! |PLAYERNAME|, you really earned my respect and I consider you as a friend from now on. Remind me to tell you about {Faolan} sometime.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.DruidHatAddon, 8) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidHatAddon, 8) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 12 then diff --git a/data-otservbr-global/npc/charlotta.lua b/data-otservbr-global/npc/charlotta.lua index a5d0311f1e1..41b5e65d84d 100644 --- a/data-otservbr-global/npc/charlotta.lua +++ b/data-otservbr-global/npc/charlotta.lua @@ -59,7 +59,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "errand") or MsgContains(message, "gold") then - if player:getStorageValue(Storage.TheShatteredIsles.TheErrand) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheErrand) == 1 then npcHandler:say("Oh, so you brought some gold from Eleonore to me?", npc, creature) npcHandler:setTopic(playerId, 1) end @@ -67,7 +67,7 @@ local function creatureSayCallback(npc, creature, type, message) if npcHandler:getTopic(playerId) == 1 then if player:removeMoneyBank(200) then npcHandler:say("Hmm, it seems that Eleonore does trust you. Perhaps she is even right. However. Since we need some help right now I guess we can't be too picky. Return to Eleonore and tell her the secret password: 'peg leg'. She will tell you more about her problem.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.TheErrand, 2) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheErrand, 2) npcHandler:setTopic(playerId, 2) else npcHandler:say("You don't have enough...", npc, creature) diff --git a/data-otservbr-global/npc/chondur.lua b/data-otservbr-global/npc/chondur.lua index c0a1a000d22..25849667d43 100644 --- a/data-otservbr-global/npc/chondur.lua +++ b/data-otservbr-global/npc/chondur.lua @@ -50,50 +50,129 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end -local function creatureSayCallback(npc, creature, type, message) +local function handleAddonMessages(npcHandler, npc, creature, message, playerId) local player = Player(creature) - local playerId = player:getId() - if not npcHandler:checkInteraction(npc, creature) then - return false + if MsgContains(message, "addon") then + if player:hasOutfit(player:getSex() == PLAYERSEX_FEMALE and 158 or 154) then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheCounterspell) >= 4 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ADjinnInLove) >= 5 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) >= 10 and player:getStorageValue(Storage.Quest.U7_8.ShamanOutfits.AddonStaffMask) < 1 then + npcHandler:say("The time has come, my child. I sense great spiritual wisdom in you and I shall grant you a sign of your progress, if you can fulfil my task.", npc, creature) + npcHandler:setTopic(playerId, 1) + elseif player:hasOutfit(158, 2) or player:hasOutfit(154, 2) and not (player:hasOutfit(158, 1) or player:hasOutfit(154, 1)) then + npcHandler:say("You have successfully passed the first task. If you can fulfil my second task, I will grant you a mask like the one I wear. Will you listen to the requirements?", npc, creature) + npcHandler:setTopic(playerId, 3) + end + else + npcHandler:say("You must have the Shaman Outfit to proceed with this task.", npc, creature) + end + return true + elseif MsgContains(message, "task") and npcHandler:getTopic(playerId) == 1 then + npcHandler:say({ + "Deep in the Tiquandian jungle a monster lurks which is seldom seen. It is the revenge of the jungle against humankind. ...", + "This monster, if slain, carries a rare root called Mandrake. If you find it, bring it to me. Also, gather 5 of the voodoo dolls used by the mysterious dworc voodoomasters. ...", + "If you manage to fulfil this task, I will grant you your own staff. Have you understood everything and are ready for this test?", + }, npc, creature) + npcHandler:setTopic(playerId, 2) + return true + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 2 then + npcHandler:say("Good! Come back once you found a mandrake and collected 5 dworcish voodoo dolls.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.ShamanOutfits.AddonStaffMask, 1) + player:setStorageValue(Storage.Quest.U7_8.ShamanOutfits.MissionStaff, 1) + npcHandler:setTopic(playerId, 0) + return true + elseif MsgContains(message, "dworc voodoo doll") or MsgContains(message, "mandrake") then + npcHandler:say("Have you gathered the mandrake and the 5 voodoo dolls from the dworcs?", npc, creature) + npcHandler:setTopic(playerId, 5) + return true + elseif MsgContains(message, "tribal masks") or MsgContains(message, "banana staff") then + npcHandler:say("Have you gathered the 5 tribal masks and the 5 banana staves?", npc, creature) + npcHandler:setTopic(playerId, 6) + return true + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 then + if player:getItemCount(3002) >= 5 and player:getItemCount(5014) >= 1 then + player:removeItem(3002, 5) + player:removeItem(5014, 1) + player:addOutfitAddon(158, 2) + player:addOutfitAddon(154, 2) + player:setStorageValue(Storage.Quest.U7_8.ShamanOutfits.AddonStaffMask, 2) + player:setStorageValue(Storage.Quest.U7_8.ShamanOutfits.MissionStaff, 2) + player:addAchievement("Way of the Shaman") + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) + npcHandler:say("I am proud of you, my child, excellent work. This staff shall be yours from now on!", npc, creature) + else + npcHandler:say("You don't have the necessary items.", npc, creature) + end + npcHandler:setTopic(playerId, 0) + return true + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 6 then + if player:getItemCount(3348) >= 5 and player:getItemCount(3403) >= 5 then + player:removeItem(3348, 5) + player:removeItem(3403, 5) + player:addOutfitAddon(158, 1) + player:addOutfitAddon(154, 1) + player:setStorageValue(Storage.Quest.U7_8.ShamanOutfits.AddonStaffMask, 4) + player:setStorageValue(Storage.Quest.U7_8.ShamanOutfits.MissionMask, 2) + player:addAchievement("Way of the Shaman") + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) + npcHandler:say("Well done, my child! I hereby grant you the right to wear a shamanic mask. Do it proudly.", npc, creature) + else + npcHandler:say("You don't have the necessary items.", npc, creature) + end + npcHandler:setTopic(playerId, 0) + return true + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 then + npcHandler:say({ + "The dworcs of Tiquanda like to wear certain tribal masks which I would like to take a look at. Please bring me 5 of these masks. ...", + "Secondly, the high ape magicians of Banuta use banana staves. I would love to learn more about these staves, so please bring me 5 of them also. ...", + "If you manage to fulfil this task, I will grant you your own mask. Have you understood everything and are ready for this test?", + }, npc, creature) + npcHandler:setTopic(playerId, 4) + return true + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 4 then + npcHandler:say({ + "Good! Come back once you have collected 5 tribal masks and 5 banana staves.", + "I shall grant you a sign of your progress as shaman if you can fulfil my task.", + }, npc, creature) + player:setStorageValue(Storage.Quest.U7_8.ShamanOutfits.AddonStaffMask, 3) + player:setStorageValue(Storage.Quest.U7_8.ShamanOutfits.MissionMask, 1) + npcHandler:setTopic(playerId, 0) + return true + elseif MsgContains(message, "no") and npcHandler:getTopic(playerId) > 2 then + npcHandler:say("Maybe next time.", npc, creature) + npcHandler:setTopic(playerId, 0) end + return false +end + +local function handleOtherMessages(npcHandler, npc, creature, message, playerId) + local player = Player(creature) + if MsgContains(message, "stampor") or MsgContains(message, "mount") then if not player:hasMount(11) then - npcHandler:say( - "You did bring all the items I requqested, cuild. Good. \ - Shall I travel to the spirit realm and try finding a stampor compasion for you?", - npc, - creature - ) - npcHandler:setTopic(playerId, 1) + npcHandler:say("You did bring all the items I requested, child. Good. Shall I travel to the spirit realm and try finding a stampor companion for you?", npc, creature) + npcHandler:setTopic(playerId, 7) else npcHandler:say("You already have stampor mount.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "mission") then - if player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 8 then - npcHandler:say( - "The evil cult has placed a curse on one of the captains here. \ - I need at least five of their pirate voodoo dolls to lift that curse.", - npc, - creature - ) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 9) + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 11 then + npcHandler:say("The evil cult has placed a curse on one of the captains here. I need at least five of their pirate voodoo dolls to lift that curse.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 12) npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 9 then + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 12 then npcHandler:say("Did you bring five pirate voodoo dolls?", npc, creature) - npcHandler:setTopic(playerId, 2) + npcHandler:setTopic(playerId, 8) end elseif MsgContains(message, "yes") then - if npcHandler:getTopic(playerId) == 1 then + if npcHandler:getTopic(playerId) == 7 then if player:removeItem(12312, 50) and player:removeItem(12314, 30) and player:removeItem(12313, 100) then npcHandler:say({ "Ohhhhh Mmmmmmmmmmmm Ammmmmgggggggaaaaaaa ...", "Aaaaaaaaaahhmmmm Mmmaaaaaaaaaa Kaaaaaamaaaa ...", - "Brrt! I think it worked! It's a male stampor. \ - I linked this spirit to yours. You can probably already summon him to you ...", - "So, since me are done here... I need to prepare another ritual, so please let me work, cuild.", + "Brrt! I think it worked! It's a male stampor. I linked this spirit to yours. You can probably already summon him to you ...", + "So, since we are done here... I need to prepare another ritual, so please let me work, child.", }, npc, creature) player:addMount(11) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) @@ -101,291 +180,144 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Sorry you don't have the necessary items.", npc, creature) end npcHandler:setTopic(playerId, 0) - elseif npcHandler:getTopic(playerId) == 2 then - if player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 9 then + elseif npcHandler:getTopic(playerId) == 8 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 12 then if player:removeItem(5810, 5) then npcHandler:say("Finally I can put an end to that curse. I thank you so much.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 10) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 13) npcHandler:setTopic(playerId, 0) else npcHandler:say("You don't have it...", npc, creature) npcHandler:setTopic(playerId, 0) end end + elseif npcHandler:getTopic(playerId) == 9 then + npcHandler:say("This is really not advisable. Behind this barrier, strong forces are raging violently. Are you sure that you want to go there?", npc, creature) + npcHandler:setTopic(playerId, 10) + elseif npcHandler:getTopic(playerId) == 10 then + npcHandler:say({ + "I guess I cannot stop you then. Since you told me about my apprentice, it is my turn to help you. I will perform a ritual for you, but I need a few ingredients. ...", + "Bring me one fresh dead chicken, one fresh dead rat and one fresh dead black sheep, in that order.", + }, npc, creature) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheCounterspell, 1) + npcHandler:setTopic(playerId, 0) + elseif npcHandler:getTopic(playerId) == 11 then + if player:getItemCount(4330) > 0 then + player:removeItem(4330, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheCounterspell, 2) + npcHandler:say("Very good! 'Your soul shall be protected!' Now, I need a fresh dead rat.", npc, creature) + return true + else + npcHandler:say("You don't have the necessary items.", npc, creature) + return true + end + npcHandler:setTopic(playerId, 0) + elseif npcHandler:getTopic(playerId) == 12 then + if player:getItemCount(3994) > 0 then + player:removeItem(3994, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheCounterspell, 3) + npcHandler:say("Very good! 'You shall face black magic without fear!' Now, I need a fresh dead black sheep.", npc, creature) + return true + else + npcHandler:say("You don't have the necessary items.", npc, creature) + return true + end + npcHandler:setTopic(playerId, 0) + elseif npcHandler:getTopic(playerId) == 13 then + if player:getItemCount(4095) > 0 then + player:removeItem(4095, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheCounterspell, 4) + npcHandler:say("Very good! 'EVIL POWERS SHALL NOT KEEP YOU ANYMORE! SO BE IT!'", npc, creature) + return true + else + npcHandler:say("You don't have the necessary items.", npc, creature) + return true + end + npcHandler:setTopic(playerId, 0) end - elseif MsgContains(message, "no") and npcHandler:getTopic(playerId) > 2 then - npcHandler:say("Maybe next time.", npc, creature) - npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "stake") then + if player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 11 then + npcHandler:say("Ten prayers for a blessed stake? Don't tell me they made you travel whole Tibia for it! Listen, child, if you bring me a wooden stake, I'll bless it for you. ", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 12) + player:addAchievement("Blessed!") + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) + return true + elseif player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 12 then + if player:getItemCount(5941) == 0 then + npcHandler:say("You don't have a wooden stake.", npc, creature) + return true + elseif player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStakeWaitTime) >= os.time() then + npcHandler:say("Sorry, but I'm still exhausted from the last ritual. Please come back later.", npc, creature) + return true + else + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStakeWaitTime, os.time() + 7 * 86400) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) + player:removeItem(5941, 1) + player:addItem(5942, 1) + npcHandler:say(" Sha Kesh Mar!", npc, creature) + return true + end + end + elseif MsgContains(message, "counterspell") then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.DragahsSpellbook) == -1 then + npcHandler:say("You should not talk about things you don't know anything about.", npc, creature) + return true + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheCounterspell) == -1 then + npcHandler:say("You mean, you are interested in a counterspell to cross the energy barrier on Goroma?", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheCounterspell, 0) + npcHandler:setTopic(playerId, 9) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheCounterspell) == 1 then + npcHandler:say("Did you bring the fresh dead chicken?", npc, creature) + npcHandler:setTopic(playerId, 11) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheCounterspell) == 2 then + npcHandler:say("Did you bring the fresh dead rat?", npc, creature) + npcHandler:setTopic(playerId, 12) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheCounterspell) == 3 then + npcHandler:say("Did you bring the fresh dead black sheep?", npc, creature) + npcHandler:setTopic(playerId, 13) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheCounterspell) == 4 then + npcHandler:say("Hm. I don't think you need another one of my counterspells to cross the barrier on Goroma.", npc, creature) + return true + end + elseif MsgContains(message, "spellbook") then + if player:getItemCount(6120) > 0 then + npcHandler:say("Ah, thank you very much! I'll honour his memory.", npc, creature) + player:removeItem(6120, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.DragahsSpellbook, 1) + return true + else + npcHandler:say("You don't have the necessary items.", npc, creature) + return true + end + elseif MsgContains(message, "energy field") then + npcHandler:say("Ah, the energy barrier set up by the cult is maintained by lousy magic, but it's still effective. Without a proper counterspell, you won't be able to pass it.", npc, creature) + return true end - return true -end - --- Shaman Addons --- If the player can't wear shaman outfit -local function notReadyKeyword(keyword, text) - keywordHandler:addKeyword({ keyword }, StdModule.say, { npcHandler = npcHandler, text = text }, function(player) - return not player:hasOutfit(player:getSex() == PLAYERSEX_FEMALE and 158 or 154) - end) -end - -notReadyKeyword("outfit", { - "Hum? Sorry, but I don't sense enough spiritual wisdom in you to even allow \z - you to touch the mask and staff I'm wearing... yet. ...", - "I know of a really wise ape healer, though, who might be able to bless you with shamanic energy. \z - You should become his apprentice first if you desire to become mine.", -}) -notReadyKeyword("addon", { - "Hum? Sorry, but I don't sense enough spiritual wisdom in you to even allow \z - you to touch the mask and staff I'm wearing... yet. ...", - "I know of a really wise ape healer, though, who might be able to bless you with shamanic energy. \z - You should become his apprentice first if you desire to become mine.", -}) -notReadyKeyword("task", "The time hasn't come yet, my child. Believe and learn.") --- Start task -local function addTaskKeyword(text, value, missionStorage) - local taskKeyword = keywordHandler:addKeyword({ "task" }, StdModule.say, { npcHandler = npcHandler, text = text[1] }, function(player) - return player:getStorageValue(Storage.OutfitQuest.Shaman.AddonStaffMask) == value - end) - local yesKeyword = taskKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = text[2] }) - - yesKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = text[3], reset = true }, nil, function(player) - player:setStorageValue(Storage.OutfitQuest.Shaman.AddonStaffMask, math.max(0, player:getStorageValue(Storage.OutfitQuest.Shaman.AddonStaffMask)) + 1) - player:setStorageValue(missionStorage, 1) - player:setStorageValue(Storage.OutfitQuest.Ref, math.max(0, player:getStorageValue(Storage.OutfitQuest.Ref)) + 1) - end) - yesKeyword:addChildKeyword({ "no" }, StdModule.say, { npcHandler = npcHandler, text = "Would you like me to repeat the task requirements then?", moveup = 2 }) - - taskKeyword:addChildKeyword({ "no" }, StdModule.say, { npcHandler = npcHandler, text = "Well, it seems you aren't ready yet.", reset = true }) - keywordHandler:addAliasKeyword({ "addon" }) - keywordHandler:addAliasKeyword({ "outfit" }) -end - --- Staff -addTaskKeyword({ - "If you fulfil a task for me, I'll grant you a staff like the one I'm wearing. \z - Do you want to hear the requirements?", - { - "Deep in the Tiquandian jungle a monster lurks which is seldom seen. \z - It is the revenge of the jungle against humankind. ...", - "This monster, if slain, carries a rare root called Mandrake. If you find it, bring it to me. \z - Also, gather 5 of the voodoo dolls used by the mysterious dworc voodoomasters. ...", - "If you manage to fulfil this task, I will grant you your own staff. \z - Have you understood everything and are ready for this test?", - }, - "Good! Come back once you've found a mandrake and collected 5 dworcish voodoo dolls.", -}, -1, Storage.OutfitQuest.Shaman.MissionStaff) - --- Mask -addTaskKeyword({ - "You have successfully passed the first task. \z - If you can fulfil my second task, I'll grant you a mask like the one I'm wearing. \z - Do you want to hear the requirements?", - { - "The dworcs of Tiquanda like to wear certain tribal masks which I'd like to take a look at. \z - Please bring me 5 of these masks. ...", - "Secondly, the high ape magicians of Banuta use banana staffs. \z - I'd love to learn more about theses staffs, so please bring me 5 of them, too. ...", - "If you manage to fulfil this task, I'll grant you your own mask. \z - Have you understood everything and are you ready for this test?", - }, - "Good! Come back once you have collected 5 tribal masks and 5 banana staffs.", -}, 2, Storage.OutfitQuest.Shaman.MissionMask) - --- Hand in task items -local function addItemKeyword(keyword, aliasKeyword, text, value, item, addonId, missionStorage, achievement) - local itemKeyword = keywordHandler:addKeyword({ keyword }, StdModule.say, { npcHandler = npcHandler, text = text[1] }, function(player) - return player:getStorageValue(Storage.OutfitQuest.Shaman.AddonStaffMask) == value - end) - itemKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = text[2], reset = true }, function(player) - return player:getItemCount(item[1].itemId) < item[1].count or player:getItemCount(item[2].itemId) < item[2].count - end) - - itemKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = text[3], reset = true }, function(player) - return player:getItemCount(item[1].itemId) >= item[1].count and player:getItemCount(item[2].itemId) >= item[2].count - end, function(player) - player:removeItem(item[1].itemId, item[1].count) - player:removeItem(item[2].itemId, item[2].count) - player:addOutfitAddon(158, addonId) - player:addOutfitAddon(154, addonId) - player:setStorageValue(Storage.OutfitQuest.Shaman.AddonStaffMask, player:getStorageValue(Storage.OutfitQuest.Shaman.AddonStaffMask) + 1) - player:setStorageValue(Storage.OutfitQuest.Ref, math.min(0, player:getStorageValue(Storage.OutfitQuest.Ref) - 1)) - player:setStorageValue(missionStorage, 0) - if achievement then - player:addAchievement("Way of the Shaman") - end - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) - end) - itemKeyword:addChildKeyword({ "no" }, StdModule.say, { npcHandler = npcHandler, text = "Well, it seems you aren't ready yet.", reset = true }) - keywordHandler:addAliasKeyword({ aliasKeyword }) - keywordHandler:addKeyword({ keyword }, StdModule.say, { npcHandler = npcHandler, text = aliasKeyword and text[4] or text[3] }) + return false end -addItemKeyword("mandrake", "voodoo doll", { - "Have you gathered the mandrake and the 5 voodoo dolls from the dworcs?", - "I'm proud of you my child, excellent work. This staff shall be yours from now on!", - "A rare root with mysterious powers.", - { - "Together with the spirits of the ancestors, I seek for wisdom. \ - Together we can change the flow of magic to do things that are beyond the limits of ordinary magic. ...", - "In conversations with the spirits, I gain insight into secrets that would have been lost otherwise.", - }, -}, 1, { { itemId = 5014, count = 1 }, { itemId = 3002, count = 5 } }, 2, Storage.OutfitQuest.Shaman.MissionStaff) -addItemKeyword("tribal mask", "banana staff", { - "Have you gathered the 5 tribal masks and the 5 banana staffs?", - "Well done, my child! I hereby grant you the right to wear a shamanic mask. Do it proudly.", - "Sometimes dworcs are seen with these masks.", - "A banana staff is the sign of a high ape magician.", -}, 3, { { itemId = 3348, count = 5 }, { itemId = 3403, count = 5 } }, 1, Storage.OutfitQuest.Shaman.MissionMask, true) +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() --- Task status -local function addTaskStatusKeyword(keyword, text, value) - keywordHandler:addKeyword({ keyword }, StdModule.say, { npcHandler = npcHandler, text = text }, function(player) - return player:getStorageValue(Storage.OutfitQuest.Shaman.AddonStaffMask) == value - end) - if keyword == "addon" then - keywordHandler:addAliasKeyword({ "outfit" }) + if not npcHandler:checkInteraction(npc, creature) then + return false end -end - -addTaskStatusKeyword("task", "Your task is to retrieve a mandrake from the Tiquandan jungle and 5 dworcish voodoo dolls.", 1) -addTaskStatusKeyword("task", "Your task is to retrieve 5 tribal masks from the dworcs and 5 banana staffs from the apes.", 3) -addTaskStatusKeyword("task", "You have successfully passed all of my tasks. There are no further things I can teach you right now.", 4) - -addTaskStatusKeyword( - "addon", - "The time has come, my child. I sense great spiritual wisdom in you and I shall grant you a \ - sign of your progress if you can fulfil my task.", - 1 -) -addTaskStatusKeyword("addon", "I shall grant you a sign of your progress as a shaman if you can fulfil my task.", 3) -addTaskStatusKeyword("addon", "You have successfully passed all of my tasks. There are no further things I can teach you right now.", 4) --- End Shaman Addons - --- Wooden Stake -keywordHandler:addKeyword({ "stake" }, StdModule.say, { - npcHandler = npcHandler, - text = "Ten prayers for a blessed stake? Don't tell me they made you travel whole Tibia for it! \ - Listen, child, if you bring me a wooden stake, I'll bless it for you. ", -}, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 11 -end, function(player) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 12) - player:addAchievement("Blessed!") - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) -end) -local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Would you like to receive a spiritual prayer to bless your stake?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 12 -end) - -stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "You don't have a wooden stake.", reset = true }, function(player) - return player:getItemCount(5941) == 0 -end) - -stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { - npcHandler = npcHandler, - text = "Sorry, but I'm still exhausted from the last ritual. Please come back later.", - reset = true, -}, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStakeWaitTime) >= os.time() -end) - -stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = " Sha Kesh Mar!", reset = true }, function(player) - return player:getItemCount(5941) > 0 -end, function(player) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStakeWaitTime, os.time() + 7 * 86400) - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - player:removeItem(5941, 1) - player:addItem(5942, 1) -end) -stakeKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "Maybe another time.", reset = true }) - --- Counterspell -keywordHandler:addKeyword({ "counterspell" }, StdModule.say, { npcHandler = npcHandler, text = "You should not talk about things you don't know anything about." }, function(player) - return player:getStorageValue(Storage.TheShatteredIsles.DragahsSpellbook) == -1 -end) -keywordHandler:addAliasKeyword({ "energy field" }) - --- Start mission -local startcounterspellKeyword = keywordHandler:addKeyword({ "counterspell" }, StdModule.say, { - npcHandler = npcHandler, - text = "You mean, you are interested in a counterspell to cross the energy barrier on Goroma?", -}, function(player) - return player:getStorageValue(Storage.TheShatteredIsles.TheCounterspell) == -1 -end) -local acceptKeyword = startcounterspellKeyword:addChildKeyword({ "yes" }, StdModule.say, { - npcHandler = npcHandler, - text = "This is really not advisable. Behind this barrier, strong forces are raging violently. \ - Are you sure that you want to go there?", -}) -acceptKeyword:addChildKeyword( - { "yes" }, - StdModule.say, - { - npcHandler = npcHandler, - text = { - "I guess I cannot stop you then. Since you told me about my apprentice, it's my turn to help you. \ - I'll perform a ritual for you, but I need a few ingredients. ...", - "Bring me one fresh dead chicken, one fresh dead rat and one fresh dead black sheep, in that order.", - }, - reset = true, - }, - nil, - function(player) - player:setStorageValue(Storage.TheShatteredIsles.TheCounterspell, 1) + if handleAddonMessages(npcHandler, npc, creature, message, playerId) then + return true end -) -acceptKeyword:addChildKeyword({ "no" }, StdModule.say, { npcHandler = npcHandler, text = "It's much safer for you to stay here anyway, trust me.", reset = true }) -startcounterspellKeyword:addChildKeyword({ "no" }, StdModule.say, { npcHandler = npcHandler, text = "It's much safer for you to stay here anyway, trust me.", reset = true }) + if handleOtherMessages(npcHandler, npc, creature, message, playerId) then + return true + end --- Deliver in corpses -local function addCounterspellKeyword(text, value, itemId) - local counterspellKeyword = keywordHandler:addKeyword({ "counterspell" }, StdModule.say, { npcHandler = npcHandler, text = text[1] }, function(player) - return player:getStorageValue(Storage.TheShatteredIsles.TheCounterspell) == value - end) - counterspellKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = text[2], reset = true }, function(player) - return player:getItemCount(itemId) > 0 - end, function(player) - player:removeItem(itemId, 1) - player:setStorageValue(Storage.TheShatteredIsles.TheCounterspell, value + 1) - end) + return false end -addCounterspellKeyword({ - "Did you bring the fresh dead chicken?", - "Very good! 'Your soul shall be protected!' Now, I need a fresh dead rat.", -}, 1, 4330) -addCounterspellKeyword({ - "Did you bring the fresh dead rat?", - "Very good! 'You shall face black magic without fear!' Now, I need a fresh dead black sheep.", -}, 2, 3994) -addCounterspellKeyword({ - "Did you bring the fresh dead black sheep?", - "Very good! 'EVIL POWERS SHALL NOT KEEP YOU ANYMORE! SO BE IT!'", -}, 3, 4095) - --- Completed the Counterspell -keywordHandler:addKeyword({ "counterspell" }, StdModule.say, { - npcHandler = npcHandler, - text = "Hm. I don't think you need another one of my counterspells to cross the barrier on Goroma.", -}) - --- Spellbook -keywordHandler:addKeyword({ "spellbook" }, StdModule.say, { npcHandler = npcHandler, text = "Ah, thank you very much! I'll honour his memory." }, function(player) - return player:getItemCount(6120) > 0 -end, function(player) - player:removeItem(6120, 1) - player:setStorageValue(Storage.TheShatteredIsles.DragahsSpellbook, 1) -end) - --- Energy Field -keywordHandler:addKeyword({ "energy field" }, StdModule.say, { - npcHandler = npcHandler, - text = "Ah, the energy barrier set up by the cult is maintained by lousy magic, but it's still effective. \ - Without a proper counterspell, you won't be able to pass it.", -}) +npcHandler:setMessage(MESSAGE_GREET, "Be greeted, child.") +npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye.") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) diff --git a/data-otservbr-global/npc/cobra.lua b/data-otservbr-global/npc/cobra.lua index 37a39c19b34..e80e14f3235 100644 --- a/data-otservbr-global/npc/cobra.lua +++ b/data-otservbr-global/npc/cobra.lua @@ -54,6 +54,10 @@ local function greetCallback(npc, creature) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:teleportTo(Position(33396, 32836, 14)) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.ThalasTreasure) <= 1 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.ThalasTreasure, 2) + end + return false else npcHandler:say("Begone! Hissssss! You bear not the mark of the cobra!", npc, creature) diff --git a/data-otservbr-global/npc/cornelia.lua b/data-otservbr-global/npc/cornelia.lua index c78b3482e78..2066b98cd18 100644 --- a/data-otservbr-global/npc/cornelia.lua +++ b/data-otservbr-global/npc/cornelia.lua @@ -66,19 +66,19 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if table.contains({ "addon", "armor" }, message) then - if player:getStorageValue(Storage.OutfitQuest.WarriorShoulderAddon) == 5 then - player:setStorageValue(Storage.OutfitQuest.WarriorShoulderAddon, 6) - player:setStorageValue(Storage.OutfitQuest.WarriorShoulderTimer, os.time() + (player:getSex() == PLAYERSEX_FEMALE and 1768 or 7200)) + if table.contains({ "addon", "armour" }, message) then + if player:getStorageValue(Storage.Quest.U7_8.WarriorOutfits.WarriorShoulderAddon) == 5 then + player:setStorageValue(Storage.Quest.U7_8.WarriorOutfits.WarriorShoulderAddon, 6) + player:setStorageValue(Storage.Quest.U7_8.WarriorOutfits.WarriorShoulderTimer, os.time() + (player:getSex() == PLAYERSEX_FEMALE and 3600 or 7200)) -- 1 hours female/2 hours male npcHandler:say("Ah, you must be the hero Trisha talked about. I'll prepare the shoulder spikes for you. Please give me some time to finish.", npc, creature) - elseif player:getStorageValue(Storage.OutfitQuest.WarriorShoulderAddon) == 6 then - if player:getStorageValue(Storage.OutfitQuest.WarriorShoulderTimer) > os.time() then + elseif player:getStorageValue(Storage.Quest.U7_8.WarriorOutfits.WarriorShoulderAddon) == 6 then + if player:getStorageValue(Storage.Quest.U7_8.WarriorOutfits.WarriorShoulderTimer) > os.time() then npcHandler:say("I'm not done yet. Please be as patient as you are courageous.", npc, creature) - elseif player:getStorageValue(Storage.OutfitQuest.WarriorShoulderTimer) > 0 and player:getStorageValue(Storage.OutfitQuest.WarriorShoulderTimer) < os.time() then + elseif player:getStorageValue(Storage.Quest.U7_8.WarriorOutfits.WarriorShoulderTimer) > 0 and player:getStorageValue(Storage.Quest.U7_8.WarriorOutfits.WarriorShoulderTimer) < os.time() then player:addOutfitAddon(142, 1) player:addOutfitAddon(134, 1) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - player:setStorageValue(Storage.OutfitQuest.WarriorShoulderAddon, 7) + player:setStorageValue(Storage.Quest.U7_8.WarriorOutfits.WarriorShoulderAddon, 7) player:addAchievementProgress("Wild Warrior", 2) npcHandler:say("Finished! Since you are a man, I thought you probably wanted two. Men always want that little extra status symbol. ", npc, creature) else diff --git a/data-otservbr-global/npc/duncan.lua b/data-otservbr-global/npc/duncan.lua index 2bc4df38712..0e5e8cdc6e5 100644 --- a/data-otservbr-global/npc/duncan.lua +++ b/data-otservbr-global/npc/duncan.lua @@ -58,39 +58,22 @@ local function creatureSayCallback(npc, creature, type, message) return false end - local storage = Storage.OutfitQuest.PirateSabreAddon - - if table.contains({ "outfit", "addon" }, message) and player:getStorageValue(Storage.OutfitQuest.PirateBaseOutfit) == 1 then - npcHandler:say( - "You're talking about my sabre? Well, even though you earned our trust, \z - you'd have to fulfill a task first before you are granted to wear such a sabre.", - npc, - creature - ) + local storage = Storage.Quest.U7_8.PirateOutfits.PirateSabreAddon + + if table.contains({ "outfit", "addon" }, message) and player:getStorageValue(Storage.Quest.U7_8.PirateOutfits.PirateBaseOutfit) == 1 then + npcHandler:say("You're talking about my sabre? Well, even though you earned our trust, you'd have to fulfill a task first before you are granted to wear such a sabre.", npc, creature) elseif MsgContains(message, "mission") then - if player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 6 then - npcHandler:say( - "I need a new quality atlas for our captains. Only one of the best will do it. \z - I heard the explorers society sells the best, but only to members of a certain rank. \z - You will have to get this rank or ask a high ranking member to buy it for you.", - npc, - creature - ) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 7) + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 9 then + npcHandler:say("I need a new quality atlas for our captains. Only one of the best will do it. I heard the explorers society sells the best, but only to members of a certain rank. You will have to get this rank or ask a high ranking member to buy it for you.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 10) npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 7 then + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 10 then npcHandler:say("Did you get an atlas of the explorers society as I requested?", npc, creature) npcHandler:setTopic(playerId, 6) - elseif player:getStorageValue(Storage.TheShatteredIsles.RaysMission2) > 0 and player:getStorageValue(Storage.TheShatteredIsles.TortoiseEggNargorDoor) < 0 then - npcHandler:say( - "You did some impressive things. I think people here start considering you as one of us. \z - But these are dire times and everyone of us is expected to give his best and even exceed himself. \z - Do you think you can handle that?", - npc, - creature - ) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission2) > 0 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TortoiseEggNargorDoor) < 0 then + npcHandler:say("You did some impressive things. I think people here start considering you as one of us. But these are dire times and everyone of us is expected to give his best and even exceed himself. Do you think you can handle that?", npc, creature) npcHandler:setTopic(playerId, 7) - elseif player:getStorageValue(Storage.TheShatteredIsles.TortoiseEggNargorDoor) == 1 then + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TortoiseEggNargorDoor) == 1 then npcHandler:say("Did you rescue one of those poor soon-to-be baby tortoises from Nargor?", npc, creature) npcHandler:setTopic(playerId, 8) end @@ -117,8 +100,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif MsgContains(message, "yes") then if npcHandler:getTopic(playerId) == 1 then npcHandler:say({ - "Listen, the task is not that hard. Simply prove that you are with us and not with the \z - pirates from Nargor by bringingme some of their belongings. ...", + "Listen, the task is not that hard. Simply prove that you are with us and not with the pirates from Nargor by bringingme some of their belongings. ...", "Bring me 100 of their eye patches, 100 of their peg legs and 100 of their hooks, in that order. ...", "Have you understood everything I told you and are willing to handle this task?", }, npc, creature) @@ -153,10 +135,10 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("You don't have it...", npc, creature) end elseif npcHandler:getTopic(playerId) == 6 then - if player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 7 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 10 then if player:removeItem(6108, 1) then npcHandler:say("Indeed, what a fine work... the book I mean. Your work was acceptable all in all.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 8) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 11) npcHandler:setTopic(playerId, 0) else npcHandler:say("You don't have it...", npc, creature) @@ -164,31 +146,22 @@ local function creatureSayCallback(npc, creature, type, message) end end elseif npcHandler:getTopic(playerId) == 7 then - if player:getStorageValue(Storage.TheShatteredIsles.TortoiseEggNargorDoor) < 0 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TortoiseEggNargorDoor) < 0 then npcHandler:say({ - "I am glad to hear this. Please listen. The pirates on Nargor are breeding tortoises. \ - They think eating tortoises makes a hard man even harder. ...", - "However I am quite fond of tortoises and can't stand the thought of them being eaten. \ - So I convinced Captain Striker that I can train them to help us. As a substitute for rafts and such ...", - "All I need is one tortoise egg from Nargor. \ - This is the opportunity to save a tortoise from a gruesome fate! ...", - "I will ask Sebastian to bring you there. \ - Travel to Nargor, find their tortoise eggs and bring me at least one of them.", + "I am glad to hear this. Please listen. The pirates on Nargor are breeding tortoises. They think eating tortoises makes a hard man even harder. ...", + "However I am quite fond of tortoises and can't stand the thought of them being eaten. So I convinced Captain Striker that I can train them to help us. As a substitute for rafts and such ...", + "All I need is one tortoise egg from Nargor. This is the opportunity to save a tortoise from a gruesome fate! ...", + "I will ask Sebastian to bring you there. Travel to Nargor, find their tortoise eggs and bring me at least one of them.", }, npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.TortoiseEggNargorDoor, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TortoiseEggNargorDoor, 1) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 8 then - if player:getStorageValue(Storage.TheShatteredIsles.TortoiseEggNargorDoor) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TortoiseEggNargorDoor) == 1 then if player:removeItem(6125, 1) then - npcHandler:say( - "A real tortoise egg ... I guess you are more accustomed to rescue some \z - noblewoman in distress but you did something goodtoday.", - npc, - creature - ) - player:setStorageValue(Storage.TheShatteredIsles.TortoiseEggNargorDoor, 2) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 16) + npcHandler:say("A real tortoise egg ... I guess you are more accustomed to rescue some noblewoman in distress but you did something goodtoday.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TortoiseEggNargorDoor, 2) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 16) if player:getStorageValue(Storage.TheIceIslands.Questline) >= 9 then player:addAchievement("Animal Activist") end @@ -208,6 +181,9 @@ local function creatureSayCallback(npc, creature, type, message) return true end +npcHandler:setMessage(MESSAGE_GREET, "Hi, come closer. Have a look at my wares.") +npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye.") + npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) diff --git a/data-otservbr-global/npc/elane.lua b/data-otservbr-global/npc/elane.lua index e84f211fe2c..d7abb30dbdb 100644 --- a/data-otservbr-global/npc/elane.lua +++ b/data-otservbr-global/npc/elane.lua @@ -59,7 +59,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "addon") or MsgContains(message, "outfit") then - if player:getStorageValue(Storage.OutfitQuest.HunterHatAddon) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.HunterOutfits.HunterHatAddon) < 1 then npcHandler:say("Oh, my winged tiara? Those are traditionally awarded after having completed a difficult {task} for our guild, only to female aspirants though. Male warriors will receive a hooded cloak.", npc, creature) npcHandler:setTopic(playerId, 1) end @@ -69,22 +69,22 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 2) end elseif MsgContains(message, "crossbow") then - if player:getStorageValue(Storage.OutfitQuest.HunterHatAddon) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.HunterOutfits.HunterHatAddon) == 1 then npcHandler:say("I'm so excited! Have you really found my crossbow?", npc, creature) npcHandler:setTopic(playerId, 4) end elseif MsgContains(message, "leather") then - if player:getStorageValue(Storage.OutfitQuest.HunterHatAddon) == 2 then + if player:getStorageValue(Storage.Quest.U7_8.HunterOutfits.HunterHatAddon) == 2 then npcHandler:say("Did you bring me 100 pieces of lizard leather and 100 pieces of red dragon leather?", npc, creature) npcHandler:setTopic(playerId, 5) end elseif MsgContains(message, "chicken wing") then - if player:getStorageValue(Storage.OutfitQuest.HunterHatAddon) == 3 then + if player:getStorageValue(Storage.Quest.U7_8.HunterOutfits.HunterHatAddon) == 3 then npcHandler:say("Were you able to get hold of 5 enchanted chicken wings?", npc, creature) npcHandler:setTopic(playerId, 6) end elseif MsgContains(message, "steel") then - if player:getStorageValue(Storage.OutfitQuest.HunterHatAddon) == 4 then + if player:getStorageValue(Storage.Quest.U7_8.HunterOutfits.HunterHatAddon) == 4 then npcHandler:say("Ah, have you brought one piece of royal steel, draconian steel and hell steel each?", npc, creature) npcHandler:setTopic(playerId, 7) end @@ -102,13 +102,13 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 3) elseif npcHandler:getTopic(playerId) == 3 then npcHandler:say("That's the spirit! I hope you will find my crossbow, |PLAYERNAME|!", npc, creature) - player:setStorageValue(Storage.OutfitQuest.HunterHatAddon, 1) + player:setStorageValue(Storage.Quest.U7_8.HunterOutfits.HunterHatAddon, 1) player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) --this for default start of Outfit and Addon Quests npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 4 then if player:removeItem(5947, 1) then npcHandler:say("Yeah! I could kiss you right here and there! Besides, you're a handsome one. Please bring me 100 pieces of lizard leather and 100 pieces of red dragon leather now!", npc, creature) - player:setStorageValue(Storage.OutfitQuest.HunterHatAddon, 2) + player:setStorageValue(Storage.Quest.U7_8.HunterOutfits.HunterHatAddon, 2) npcHandler:setTopic(playerId, 0) else npcHandler:say("You don't have it...", npc, creature) @@ -118,7 +118,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Good work, |PLAYERNAME|! That is enough leather for a lot of sturdy quivers. Now, please bring me 5 enchanted chicken wings.", npc, creature) player:removeItem(5876, 100) player:removeItem(5948, 100) - player:setStorageValue(Storage.OutfitQuest.HunterHatAddon, 3) + player:setStorageValue(Storage.Quest.U7_8.HunterOutfits.HunterHatAddon, 3) npcHandler:setTopic(playerId, 0) else npcHandler:say("You don't have it...", npc, creature) @@ -126,7 +126,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 6 then if player:removeItem(5891, 5) then npcHandler:say("Great! Now we can create a few more Tiaras. If only they weren't that expensive... Well anyway, please obtain one piece of royal steel, draconian steel and hell steel each.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.HunterHatAddon, 4) + player:setStorageValue(Storage.Quest.U7_8.HunterOutfits.HunterHatAddon, 4) npcHandler:setTopic(playerId, 0) else npcHandler:say("You don't have it...", npc, creature) @@ -137,7 +137,7 @@ local function creatureSayCallback(npc, creature, type, message) player:removeItem(5887, 1) player:removeItem(5888, 1) player:removeItem(5889, 1) - player:setStorageValue(Storage.OutfitQuest.HunterHatAddon, 5) + player:setStorageValue(Storage.Quest.U7_8.HunterOutfits.HunterHatAddon, 5) player:addOutfitAddon(129, 1) player:addOutfitAddon(137, 2) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) @@ -187,7 +187,7 @@ addGloveKeyword({ "Maybe another time.", "Alright! Here is your money, thank you very much.", }, function(player) - return player:getStorageValue(Storage.OutfitQuest.Hunter.AddonGlove) == 1 + return player:getStorageValue(Storage.Quest.U7_8.HunterOutfits.Hunter.AddonGlove) == 1 end, function(player) player:removeItem(5875, 1) player:addMoney(2000) @@ -199,10 +199,10 @@ addGloveKeyword({ "No problem, maybe another time.", "Great! I hereby grant you the right to wear the sniper gloves as an accessory. Congratulations!", }, function(player) - return player:getStorageValue(Storage.OutfitQuest.Hunter.AddonGlove) == -1 + return player:getStorageValue(Storage.Quest.U7_8.HunterOutfits.Hunter.AddonGlove) == -1 end, function(player) player:removeItem(5875, 1) - player:setStorageValue(Storage.OutfitQuest.Hunter.AddonGlove, 1) + player:setStorageValue(Storage.Quest.U7_8.HunterOutfits.Hunter.AddonGlove, 1) player:addOutfitAddon(129, 2) player:addOutfitAddon(137, 1) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) diff --git a/data-otservbr-global/npc/eleonore.lua b/data-otservbr-global/npc/eleonore.lua index e152235d2a9..67e26a45029 100644 --- a/data-otservbr-global/npc/eleonore.lua +++ b/data-otservbr-global/npc/eleonore.lua @@ -59,40 +59,40 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "ring") or MsgContains(message, "mission") then - if player:getStorageValue(Storage.TheShatteredIsles.TheGovernorDaughter) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheGovernorDaughter) < 1 then npcHandler:say({ "My ring was stolen by a parrot, directly from my dressing table near the window. It flew to the nearby mountains and I fear my ring will be lost forever. Whoever returns it to me will be rewarded generously. ...", "I guess that evil parrot hid the ring somewhere on a high tree or a rock so that you might need a rake to get it.", }, npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.DefaultStart, 1) - player:setStorageValue(Storage.TheShatteredIsles.TheGovernorDaughter, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.DefaultStart, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheGovernorDaughter, 1) npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.TheShatteredIsles.TheGovernorDaughter) == 2 then + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheGovernorDaughter) == 2 then npcHandler:say("Oh, my beloved ring! Have you found it and want to return it to me?", npc, creature) npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.TheShatteredIsles.TheGovernorDaughter) == 3 and player:getStorageValue(Storage.TheShatteredIsles.TheErrand) < 1 then + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheGovernorDaughter) == 3 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheErrand) < 1 then npcHandler:say("I would need some help in another matter. It is only a small errand. Are you interested?", npc, creature) npcHandler:setTopic(playerId, 2) end elseif MsgContains(message, "errand") then - if player:getStorageValue(Storage.TheShatteredIsles.TheErrand) == 2 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheErrand) == 2 then npcHandler:say("Great, thank you! As promised, here are your 5 gold pieces. Is there ... anything left that you might want to discuss with me?", npc, creature) player:addMoney(5) - player:setStorageValue(Storage.TheShatteredIsles.TheErrand, 3) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheErrand, 3) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "peg leg") then - if player:getStorageValue(Storage.TheShatteredIsles.TheErrand) == 3 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheErrand) == 3 then npcHandler:say("You have returned my ring and proven yourself as trustworthy. There is something I have to discuss with you. Are you willing to listen?", npc, creature) npcHandler:setTopic(playerId, 4) end elseif MsgContains(message, "raymond striker") then - if player:getStorageValue(Storage.TheShatteredIsles.AccessToLagunaIsland) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.AccessToLagunaIsland) == 1 then npcHandler:say(" Oh, he is so wonderful. A very special man with a special place in my heart.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "mermaid") then - if player:getStorageValue(Storage.TheShatteredIsles.AccessToLagunaIsland) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.AccessToLagunaIsland) == 1 then npcHandler:say("I can't thank you enough for freeing my beloved Ray from that evil spell. I am still shocked that a mermaid could steal his love that easily.", npc, creature) npcHandler:setTopic(playerId, 0) end @@ -101,7 +101,7 @@ local function creatureSayCallback(npc, creature, type, message) if player:removeItem(6093, 1) then player:addMoney(150) npcHandler:say("Oh, thank you so much! Take this gold as a reward. ... which reminds me, I would need some help in another matter. It is only a small errand. Are you interested?", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.TheGovernorDaughter, 3) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheGovernorDaughter, 3) npcHandler:setTopic(playerId, 2) else player:addMoney(150) @@ -109,7 +109,7 @@ local function creatureSayCallback(npc, creature, type, message) "Ahh, now I understand... One of my suitors - a real chicken-heart - just brought back my ring. I was really surprised. Suddenly he shows brave attitude. But... It seems you lost it and he tries to take advantage. ...", "Thanks a lot anyways and take this gold as a reward. By the way, I would need some help in another matter. It is only a small errand. Are you interested?", }, npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.TheGovernorDaughter, 3) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheGovernorDaughter, 3) npcHandler:setTopic(playerId, 2) end elseif npcHandler:getTopic(playerId) == 2 then @@ -118,7 +118,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 3 then player:addMoney(200) npcHandler:say("I was hoping that you'd agree. Please deliver these 200 gold pieces to the herbalist Charlotta in the south-western part of the town. If you return from this errand, I will grant you 5 gold pieces as reward for your efforts.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.TheErrand, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheErrand, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 4 then npcHandler:say({ @@ -129,8 +129,8 @@ local function creatureSayCallback(npc, creature, type, message) "Contact Captain Waverider, the old fisherman, and tell him the secret word 'peg leg'. He will make sure that you arrive safely ...", "Please look for Ray and find out what happened to him and why he was not able to answer. Return to me as soon as you have found something out. I wish you a good journey.", }, npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.TheErrand, 4) - player:setStorageValue(Storage.TheShatteredIsles.AccessToMeriana, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheErrand, 4) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.AccessToMeriana, 1) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "no") then diff --git a/data-otservbr-global/npc/eliyas.lua b/data-otservbr-global/npc/eliyas.lua index b25823acf0c..51ae0c46e9e 100644 --- a/data-otservbr-global/npc/eliyas.lua +++ b/data-otservbr-global/npc/eliyas.lua @@ -58,57 +58,6 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "outfit") then - if player:getSex() == PLAYERSEX_MALE then - npcHandler:say("My jewelled belt? That's not very manly. Maybe you'd prefer a scimitar like Habdel has.", npc, creature) - return true - end - - if player:getStorageValue(Storage.OutfitQuest.firstOrientalAddon) < 1 then - npcHandler:say("My jewelled belt? Of course I could make one for you, but I have a small request. Would you fulfil a task for me?", npc, creature) - npcHandler:setTopic(playerId, 1) - end - elseif MsgContains(message, "comb") then - if player:getSex() == PLAYERSEX_MALE then - npcHandler:say("Comb? This is a jewellery shop.", npc, creature) - return true - end - - if player:getStorageValue(Storage.OutfitQuest.firstOrientalAddon) == 1 then - npcHandler:say("Have you brought me a mermaid's comb?", npc, creature) - npcHandler:setTopic(playerId, 3) - end - elseif MsgContains(message, "yes") then - if npcHandler:getTopic(playerId) == 1 then - npcHandler:say({ - "Listen, um... I have been wanting a comb for a long time... not just any comb, but a mermaid's comb. Having a mermaid's comb means never having split ends again! ...", - "You know what that means to a girl! Could you please bring me such a comb? I really would appreciate it.", - }, npc, creature) - npcHandler:setTopic(playerId, 2) - elseif npcHandler:getTopic(playerId) == 2 then - player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) - player:setStorageValue(Storage.OutfitQuest.firstOrientalAddon, 1) - npcHandler:say("Yay! I will wait for you to return with a mermaid's comb then.", npc, creature) - npcHandler:setTopic(playerId, 0) - elseif npcHandler:getTopic(playerId) == 3 then - if not player:removeItem(5945, 1) then - npcHandler:say("No... that's not it.", npc, creature) - npcHandler:setTopic(playerId, 0) - return true - end - - player:setStorageValue(Storage.OutfitQuest.firstOrientalAddon, 2) - player:addOutfitAddon(150, 1) - player:addOutfitAddon(146, 1) - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - npcHandler:say("Yeah! That's it! I can't wait to comb my hair! Oh - but first, I'll fulfil my promise: Here is your jewelled belt! Thanks again!", npc, creature) - npcHandler:setTopic(playerId, 0) - end - elseif MsgContains(message, "no") and npcHandler:getTopic(playerId) ~= 0 then - npcHandler:say("Oh... okay.", npc, creature) - npcHandler:setTopic(playerId, 0) - end - return true end diff --git a/data-otservbr-global/npc/elvith.lua b/data-otservbr-global/npc/elvith.lua index ea704df1b20..67637ebe1b2 100644 --- a/data-otservbr-global/npc/elvith.lua +++ b/data-otservbr-global/npc/elvith.lua @@ -114,7 +114,6 @@ npcConfig.shop = { { itemName = "drum", clientId = 14253, buy = 140 }, { itemName = "lute", clientId = 2950, buy = 195 }, { itemName = "lyre", clientId = 2949, buy = 120 }, - { itemName = "poem scroll", clientId = 6119, buy = 200 }, { itemName = "simple fanfare", clientId = 2954, buy = 150 }, } -- On buy npc shop message diff --git a/data-otservbr-global/npc/erayo.lua b/data-otservbr-global/npc/erayo.lua index 96bb87cb5d3..40b05205992 100644 --- a/data-otservbr-global/npc/erayo.lua +++ b/data-otservbr-global/npc/erayo.lua @@ -53,14 +53,14 @@ end local topic = {} local config = { - ["blue cloth"] = { storageValue = 1, text = { "Brought the 50 pieces of blue cloth?", "Good. Get me 50 pieces of green cloth now." }, itemId = 5912, count = 50 }, - ["green cloth"] = { storageValue = 2, text = { "Brought the 50 pieces of green cloth?", "Good. Get me 50 pieces of red cloth now." }, itemId = 5910, count = 50 }, - ["red cloth"] = { storageValue = 3, text = { "Brought the 50 pieces of red cloth?", "Good. Get me 50 pieces of brown cloth now." }, itemId = 5911, count = 50 }, - ["brown cloth"] = { storageValue = 4, text = { "Brought the 50 pieces of brown cloth?", "Good. Get me 50 pieces of yellow cloth now." }, itemId = 5913, count = 50 }, - ["yellow cloth"] = { storageValue = 5, text = { "Brought the 50 pieces of yellow cloth?", "Good. Get me 50 pieces of white cloth now." }, itemId = 5914, count = 50 }, - ["white cloth"] = { storageValue = 6, text = { "Brought the 50 pieces of white cloth?", "Good. Get me 10 spools of yarn now." }, itemId = 5909, count = 50 }, - ["spools of yarn"] = { storageValue = 7, text = { "Brought the 10 spools of yarn?", "Thanks. That's it, you're done. Good job, |PLAYERNAME|. I keep my promise. Here's my old assassin head piece." }, itemId = 5886, count = 10 }, - ["yarn"] = { storageValue = 7, text = { "Brought the 10 spools of yarn?", "Thanks. That's it, you're done. Good job, |PLAYERNAME|. I keep my promise. Here's my old assassin head piece." }, itemId = 5886, count = 10 }, + ["50 blue cloth"] = { storageValue = 1, text = { "Brought the 50 pieces of blue cloth?", "Good. Get me 50 pieces of green cloth now." }, itemId = 5912, count = 50 }, + ["50 green cloth"] = { storageValue = 2, text = { "Brought the 50 pieces of green cloth?", "Good. Get me 50 pieces of red cloth now." }, itemId = 5910, count = 50 }, + ["50 red cloth"] = { storageValue = 3, text = { "Brought the 50 pieces of red cloth?", "Good. Get me 50 pieces of brown cloth now." }, itemId = 5911, count = 50 }, + ["50 brown cloth"] = { storageValue = 4, text = { "Brought the 50 pieces of brown cloth?", "Good. Get me 50 pieces of yellow cloth now." }, itemId = 5913, count = 50 }, + ["50 yellow cloth"] = { storageValue = 5, text = { "Brought the 50 pieces of yellow cloth?", "Good. Get me 50 pieces of white cloth now." }, itemId = 5914, count = 50 }, + ["50 white cloth"] = { storageValue = 6, text = { "Brought the 50 pieces of white cloth?", "Good. Get me 10 spools of yarn now." }, itemId = 5909, count = 50 }, + ["10 spools of yarn"] = { storageValue = 7, text = { "Brought the 10 spools of yarn?", "Thanks. That's it, you're done. Good job, |PLAYERNAME|. I keep my promise. Here's my old assassin head piece." }, itemId = 5886, count = 10 }, + ["10 yarn"] = { storageValue = 7, text = { "Brought the 10 spools of yarn?", "Thanks. That's it, you're done. Good job, |PLAYERNAME|. I keep my promise. Here's my old assassin head piece." }, itemId = 5886, count = 10 }, } local function creatureSayCallback(npc, creature, type, message) @@ -72,12 +72,12 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "addon") then - if player:hasOutfit(player:getSex() == PLAYERSEX_FEMALE and 156 or 152) and player:getStorageValue(Storage.OutfitQuest.AssassinFirstAddon) < 1 then + if player:hasOutfit(player:getSex() == PLAYERSEX_FEMALE and 156 or 152) and player:getStorageValue(Storage.OutfitQuest.AssassinFirstAddon) < 1 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.Shipwrecked) == 2 then npcHandler:say("Vescu gave you an assassin outfit? Haha. Noticed it lacks the head piece? You look a bit silly. Want my old head piece?", npc, creature) npcHandler:setTopic(playerId, 1) end elseif config[message] and npcHandler:getTopic(playerId) == 0 then - if player:getStorageValue(Storage.OutfitQuest.AssassinFirstAddon) == config[message].storageValue then + if player:getStorageValue(Storage.Quest.U7_8.AssassinOutfits.AssassinFirstAddon) == config[message].storageValue then npcHandler:say(config[message].text[1], npc, creature) npcHandler:setTopic(playerId, 3) topic[playerId] = message @@ -95,7 +95,7 @@ local function creatureSayCallback(npc, creature, type, message) if player:getStorageValue(Storage.OutfitQuest.DefaultStart) ~= 1 then player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) end - player:setStorageValue(Storage.OutfitQuest.AssassinFirstAddon, 1) + player:setStorageValue(Storage.Quest.U7_8.AssassinOutfits.AssassinFirstAddon, 1) npcHandler:say("Good. Start with the blue cloth. I'll wait.", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then @@ -106,8 +106,8 @@ local function creatureSayCallback(npc, creature, type, message) return true end - player:setStorageValue(Storage.OutfitQuest.AssassinFirstAddon, player:getStorageValue(Storage.OutfitQuest.AssassinFirstAddon) + 1) - if player:getStorageValue(Storage.OutfitQuest.AssassinFirstAddon) == 8 then + player:setStorageValue(Storage.Quest.U7_8.AssassinOutfits.AssassinFirstAddon, player:getStorageValue(Storage.Quest.U7_8.AssassinOutfits.AssassinFirstAddon) + 1) + if player:getStorageValue(Storage.Quest.U7_8.AssassinOutfits.AssassinFirstAddon) == 8 then player:addOutfitAddon(156, 1) player:addOutfitAddon(152, 1) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) diff --git a/data-otservbr-global/npc/eremo.lua b/data-otservbr-global/npc/eremo.lua index c61996e5318..c558148ccee 100644 --- a/data-otservbr-global/npc/eremo.lua +++ b/data-otservbr-global/npc/eremo.lua @@ -59,16 +59,11 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "letter") then - if player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 4 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 7 then if player:getItemCount(3506) > 0 then if player:removeItem(3506, 1) then - npcHandler:say( - "A letter from that youngster Morgan? I believed him dead since years. \z - These news are good news indeed. Thank you very much, my friend.", - npc, - creature - ) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 5) + npcHandler:say("A letter from that youngster Morgan? I believed him dead since years. These news are good news indeed. Thank you very much, my friend.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 8) end end end diff --git a/data-otservbr-global/npc/fa_hradin.lua b/data-otservbr-global/npc/fa_hradin.lua index 28e05610a81..3b4a2754717 100644 --- a/data-otservbr-global/npc/fa_hradin.lua +++ b/data-otservbr-global/npc/fa_hradin.lua @@ -45,6 +45,37 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local function endConversationWithDelay(npcHandler, npc, creature) + addEvent(function() + npcHandler:unGreet(npc, creature) + end, 1000) +end + +local function greetCallback(npc, creature, message) + local player = Player(creature) + local playerId = player:getId() + + if not MsgContains(message, "djanni'hah") then + npcHandler:say("Whoa! A human! This is no place for you, |PLAYERNAME|. Go and play somewhere else.", npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Start) == 1 then + npcHandler:say({ + "Hahahaha! ...", + "|PLAYERNAME|, that almost sounded like the word of greeting. Humans - cute they are!", + }, npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + npcHandler:say("Aaaah... what have we here. A human - interesting. And such an ugly specimen, too... All right, human |PLAYERNAME|. How can I help you?", npc, creature) + npcHandler:setInteraction(npc, creature) + + return true +end + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -53,9 +84,9 @@ local function creatureSayCallback(npc, creature, type, message) return false end - local missionProgress = player:getStorageValue(Storage.DjinnWar.MaridFaction.Mission02) + local missionProgress = player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission02) if MsgContains(message, "spy report") or MsgContains(message, "mission") then - if player:getStorageValue(Storage.DjinnWar.MaridFaction.Mission01) ~= 2 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission01) ~= 2 then npcHandler:say("Looking for work, are you? Well, it's very tempting, you know, but I'm afraid we do not really employ beginners. Perhaps our cook could need a helping hand in the kitchen.", npc, creature) elseif missionProgress < 1 then npcHandler:say({ @@ -68,8 +99,8 @@ local function creatureSayCallback(npc, creature, type, message) "I need you to infiltrate Mal'ouqhah, contact our man there and get his latest spyreport. The password is {PIEDPIPER}. Remember it well! ...", "I do not have to add that this is a dangerous mission, do I? If you are discovered expect to be attacked! So goodluck, human!", }, npc, creature) - player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission02, 1) - player:setStorageValue(Storage.DjinnWar.MaridFaction.DoorToEfreetTerritory, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission02, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.DoorToEfreetTerritory, 1) elseif missionProgress == 1 then npcHandler:say("Did you already retrieve the spyreport?", npc, creature) npcHandler:setTopic(playerId, 1) @@ -78,7 +109,7 @@ local function creatureSayCallback(npc, creature, type, message) end elseif npcHandler:getTopic(playerId) == 1 then if MsgContains(message, "yes") then - if player:getStorageValue(Storage.DjinnWar.MaridFaction.RataMari) ~= 2 or not player:removeItem(3232, 1) then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.RataMari) ~= 2 or not player:removeItem(3232, 1) then npcHandler:say({ "Don't waste any more time. We need the spyreport of our man in Mal'ouquah as soon as possible! ...", "Also don't forget the password to contact our man: PIEDPIPER!", @@ -89,7 +120,7 @@ local function creatureSayCallback(npc, creature, type, message) "Well, let's see. ...", "I think I need to talk to Gabel about this. I am sure he will know what to do. Perhaps you should have a word with him, too.", }, npc, creature) - player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission02, 2) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission02, 2) end elseif MsgContains(message, "no") then npcHandler:say({ @@ -102,7 +133,7 @@ local function creatureSayCallback(npc, creature, type, message) end -- Greeting -keywordHandler:addGreetKeyword({ "djanni'hah" }, { npcHandler = npcHandler, text = "Aaaah... what have we here. A human - interesting. And such an ugly specimen, too... All right, human |PLAYERNAME|. How can I help you?" }) +keywordHandler:addCustomGreetKeyword({ "djanni'hah" }, greetCallback, { npcHandler = npcHandler }) npcHandler:setMessage(MESSAGE_FAREWELL, "Farewell, human. I will always remember you. Unless I forget you, of course.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Farewell, human. I will always remember you. Unless I forget you, of course.") diff --git a/data-otservbr-global/npc/gabel.lua b/data-otservbr-global/npc/gabel.lua index 0ff9c104a03..85eabcc2882 100644 --- a/data-otservbr-global/npc/gabel.lua +++ b/data-otservbr-global/npc/gabel.lua @@ -45,6 +45,37 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local function endConversationWithDelay(npcHandler, npc, creature) + addEvent(function() + npcHandler:unGreet(npc, creature) + end, 1000) +end + +local function greetCallback(npc, creature, message) + local player = Player(creature) + local playerId = player:getId() + + if not MsgContains(message, "djanni'hah") then + npcHandler:say("Whoa! A human! This is no place for you, |PLAYERNAME|. Go and play somewhere else.", npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Start) == 1 then + npcHandler:say({ + "Hahahaha! ...", + "|PLAYERNAME|, that almost sounded like the word of greeting. Humans - cute they are!", + }, npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + npcHandler:say("Welcome, human |PLAYERNAME|, to our humble abode.", npc, creature) + npcHandler:setInteraction(npc, creature) + + return true +end + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -53,9 +84,9 @@ local function creatureSayCallback(npc, creature, type, message) return false end - local missionProgress = player:getStorageValue(Storage.DjinnWar.MaridFaction.Mission03) + local missionProgress = player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission03) if MsgContains(message, "mission") then - if player:getStorageValue(Storage.DjinnWar.MaridFaction.Mission02) ~= 2 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission02) ~= 2 then npcHandler:say({ "So you would like to fight for us, would you. Hmm. ...", "That is a noble resolution you have made there, human, but I'm afraid I cannot accept your generous offer at this point of time. ...", @@ -88,7 +119,7 @@ local function creatureSayCallback(npc, creature, type, message) "Once you have acquired the lamp you must enter Mal'ouquah again. Sneak into Malor's personal chambersand exchange his sleeping lamp with Fa'hradin's lamp! ...", "If you succeed, the war could be over one night later! I and all djinn will be in your debt forever! May Daraman watch over you!", }, npc, creature) - player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission03, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission03, 1) elseif MsgContains(message, "no") then npcHandler:say("As you wish.", npc, creature) end @@ -98,15 +129,16 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say({ "Daraman shall bless you and all humans! You have done us all a huge service! Soon, this awful war will be over! ...", "Know, that from now on you are considered one of us and are welcome to trade with Haroun and Nah'bob whenever you want to!", + "Farewell, stranger. May Uman open your minds and your hearts to Daraman's wisdom!", }, npc, creature) - player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission03, 3) - player:setStorageValue(Storage.DjinnWar.MaridFaction.DoorToEfreetTerritory, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission03, 3) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.DoorToEfreetTerritory, 1) player:addAchievement("Marid Ally") elseif MsgContains(message, "no") then npcHandler:say("Don't give up! May Daraman watch over you!", npc, creature) end npcHandler:setTopic(playerId, 0) - elseif MsgContains(message, "task") and player:getStorageValue(Storage.DjinnWar.MaridFaction.Mission03) == 3 then + elseif MsgContains(message, "task") and player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission03) == 3 then if player:getStorageValue(Storage.KillingInTheNameOf.GreenDjinnTask) < 0 or player:getStorageValue(Storage.KillingInTheNameOf.GreenDjinnTask) == 3 then npcHandler:say({ "You've proven to be an experienced soldier, human. Though I still hope the war to be over soon, the Efreet are still threatening our tower. ...", @@ -145,7 +177,7 @@ local function creatureSayCallback(npc, creature, type, message) end -- Greeting -keywordHandler:addGreetKeyword({ "djanni'hah" }, { npcHandler = npcHandler, text = "Welcome, human |PLAYERNAME|, to our humble abode." }) +keywordHandler:addCustomGreetKeyword({ "djanni'hah" }, greetCallback, { npcHandler = npcHandler }) npcHandler:setMessage(MESSAGE_FAREWELL, "Farewell, stranger. May Uman open your minds and your hearts to Daraman's wisdom!") npcHandler:setMessage(MESSAGE_WALKAWAY, "Farewell, stranger. May Uman open your minds and your hearts to Daraman's wisdom!") diff --git a/data-otservbr-global/npc/gamon.lua b/data-otservbr-global/npc/gamon.lua index e858f43eb30..1b7e6ad0ce2 100644 --- a/data-otservbr-global/npc/gamon.lua +++ b/data-otservbr-global/npc/gamon.lua @@ -58,7 +58,7 @@ end -- Wooden Stake local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Making a stake from a chair? Are you insane??! I won't waste my chairs on you for free! You will have to pay for it, but since I consider your plan a blasphemy, it will cost 5000 gold pieces. Okay?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) ~= -1 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) ~= -1 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Argh... my heart aches! Alright... a promise is a promise. Here - take this wooden stake, and now get lost.", ungreet = true }, function(player) diff --git a/data-otservbr-global/npc/gregor.lua b/data-otservbr-global/npc/gregor.lua index 1c8686d76a8..fbb6bdc1025 100644 --- a/data-otservbr-global/npc/gregor.lua +++ b/data-otservbr-global/npc/gregor.lua @@ -64,7 +64,12 @@ local function creatureSayCallback(npc, creature, type, message) return false end - local addonProgress = player:getStorageValue(Storage.OutfitQuest.Knight.AddonHelmet) + if player:getStorageValue(Storage.Quest.U7_6.TheApeCity.Questline) <= 15 then + npcHandler:say("Sorry but I don't have anything for you at the moment.", npc, creature) + return true + end + + local addonProgress = player:getStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonHelmet) if MsgContains(message, "task") then if not player:isPremium() then npcHandler:say("Sorry, but our tasks are only for premium warriors.", npc, creature) @@ -83,12 +88,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif addonProgress == 4 then npcHandler:say("Your current task is to bring me royal steel, |PLAYERNAME|.", npc, creature) elseif addonProgress == 5 then - npcHandler:say( - "Please talk to Sam and tell him I sent you. \z - I'm sure he will be glad to refine your helmet, |PLAYERNAME|.", - npc, - creature - ) + npcHandler:say("Please talk to Sam and tell him I sent you. I'm sure he will be glad to refine your helmet, |PLAYERNAME|.", npc, creature) else npcHandler:say("You've already completed the task and can consider yourself a mighty warrior, |PLAYERNAME|.", npc, creature) end @@ -97,14 +97,9 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Have you really managed to fulfil the task and brought me 100 perfect behemoth fangs?", npc, creature) npcHandler:setTopic(playerId, 3) else - npcHandler:say( - "You're not serious asking that, are you? They come from behemoths, of course. \z - Unless there are behemoth rabbits. Duh.", - npc, - creature - ) + npcHandler:say("You're not serious asking that, are you? They come from behemoths, of course. Unless there are behemoth rabbits. Duh.", npc, creature) end - elseif MsgContains(message, "ramsay") then + elseif MsgContains(message, "ramsay the reckless helmet") then if addonProgress == 2 then npcHandler:say("Did you recover the helmet of Ramsay the Reckless?", npc, creature) npcHandler:setTopic(playerId, 4) @@ -116,12 +111,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Were you able to get hold of a flask with pure warrior's sweat?", npc, creature) npcHandler:setTopic(playerId, 5) else - npcHandler:say( - "Warrior's sweat can be magically extracted from headgear worn by a true warrior, \z - but only in small amounts. Djinns are said to be good at magical extractions.", - npc, - creature - ) + npcHandler:say("Warrior's sweat can be magically extracted from headgear worn by a true warrior, but only in small amounts. Djinns are said to be good at magical extractions.", npc, creature) end elseif MsgContains(message, "royal steel") then if addonProgress == 4 then @@ -133,30 +123,22 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 1 then if MsgContains(message, "yes") then npcHandler:say({ - "Well then, listen closely. First, you will have to prove that you are a fierce and \z - restless warrior by bringing me 100 perfect behemoth fangs. ...", - "Secondly, please retrieve a helmet for us which has been lost a long time ago. \z - The famous Ramsay the Reckless wore it when exploring an ape settlement. ...", - "Third, we need a new flask of warrior's sweat. We've run out of it recently, \z - but we need a small amount for the show battles in our arena. ...", + "Well then, listen closely. First, you will have to prove that you are a fierce and restless warrior by bringing me 100 perfect behemoth fangs. ...", + "Secondly, please retrieve a helmet for us which has been lost a long time ago. The famous Ramsay the Reckless wore it when exploring an ape settlement. ...", + "Third, we need a new flask of warrior's sweat. We've run out of it recently, but we need a small amount for the show battles in our arena. ...", "Lastly, I will have our smith refine your helmet if you bring me royal steel, an especially noble metal. ...", "Did you understand everything I told you and are willing to handle this task?", }, npc, creature, 100) npcHandler:setTopic(playerId, 2) elseif MsgContains(message, "no") then - npcHandler:say( - "Bah. Then you will have to wait for the day these helmets are sold in shops, \z - but that will not happen before hell freezes over.", - npc, - creature - ) + npcHandler:say("Bah. Then you will have to wait for the day these helmets are sold in shops, but that will not happen before hell freezes over.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 2 then if MsgContains(message, "yes") then player:setStorageValue(Storage.OutfitQuest.Ref, math.max(0, player:getStorageValue(Storage.OutfitQuest.Ref)) + 1) - player:setStorageValue(Storage.OutfitQuest.Knight.AddonHelmet, 1) - player:setStorageValue(Storage.OutfitQuest.Knight.MissionHelmet, 1) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonHelmet, 1) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.MissionHelmet, 1) npcHandler:say("Alright then. Come back to me once you have collected 100 perfect behemoth fangs.", npc, creature) npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "no") then @@ -170,15 +152,10 @@ local function creatureSayCallback(npc, creature, type, message) return true end - player:setStorageValue(Storage.OutfitQuest.Knight.AddonHelmet, 2) - player:setStorageValue(Storage.OutfitQuest.Knight.MissionHelmet, 2) - player:setStorageValue(Storage.OutfitQuest.Knight.RamsaysHelmetDoor, 1) - npcHandler:say( - "I'm deeply impressed, brave Knight |PLAYERNAME|. I expected nothing less from you. \z - Now, please retrieve Ramsay's helmet.", - npc, - creature - ) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonHelmet, 2) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.MissionHelmet, 2) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.RamsaysHelmetDoor, 1) + npcHandler:say("I'm deeply impressed, brave Knight |PLAYERNAME|. I expected nothing less from you. Now, please retrieve Ramsay's helmet.", npc, creature) elseif MsgContains(message, "no") then npcHandler:say("There is no need to rush anyway.", npc, creature) end @@ -190,14 +167,9 @@ local function creatureSayCallback(npc, creature, type, message) return true end - player:setStorageValue(Storage.OutfitQuest.Knight.AddonHelmet, 3) - player:setStorageValue(Storage.OutfitQuest.Knight.MissionHelmet, 3) - npcHandler:say( - "Good work, brave Knight |PLAYERNAME|! Even though it is damaged, \z - it has a lot of sentimental value. Now, please bring me warrior's sweat.", - npc, - creature - ) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonHelmet, 3) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.MissionHelmet, 3) + npcHandler:say("Good work, brave Knight |PLAYERNAME|! Even though it is damaged, it has a lot of sentimental value. Now, please bring me warrior's sweat.", npc, creature) elseif MsgContains(message, "no") then npcHandler:say("There is no need to rush anyway.", npc, creature) end @@ -209,14 +181,9 @@ local function creatureSayCallback(npc, creature, type, message) return true end - player:setStorageValue(Storage.OutfitQuest.Knight.AddonHelmet, 4) - player:setStorageValue(Storage.OutfitQuest.Knight.MissionHelmet, 4) - npcHandler:say( - "Now that is a pleasant surprise, brave Knight |PLAYERNAME|! \z - There is only one task left now: Obtain royal steel to have your helmet refined.", - npc, - creature - ) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonHelmet, 4) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.MissionHelmet, 4) + npcHandler:say("Now that is a pleasant surprise, brave Knight |PLAYERNAME|! There is only one task left now: Obtain royal steel to have your helmet refined.", npc, creature) elseif MsgContains(message, "no") then npcHandler:say("There is no need to rush anyway.", npc, creature) end @@ -228,14 +195,9 @@ local function creatureSayCallback(npc, creature, type, message) return true end - player:setStorageValue(Storage.OutfitQuest.Knight.AddonHelmet, 5) - player:setStorageValue(Storage.OutfitQuest.Knight.MissionHelmet, 5) - npcHandler:say( - "You truly deserve to wear an adorned helmet, brave Knight |PLAYERNAME|. \z - Please talk to Sam and tell him I sent you. I'm sure he will be glad to refine your helmet.", - npc, - creature - ) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonHelmet, 5) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.MissionHelmet, 5) + npcHandler:say("You truly deserve to wear an adorned helmet, brave Knight |PLAYERNAME|. Please talk to Sam and tell him I sent you. I'm sure he will be glad to refine your helmet.", npc, creature) elseif MsgContains(message, "no") then npcHandler:say("There is no need to rush anyway.", npc, creature) end @@ -290,9 +252,7 @@ keywordHandler:addKeyword({ "support", "spells" }, StdModule.say, { }) keywordHandler:addKeyword({ "spells" }, StdModule.say, { npcHandler = npcHandler, - text = "I can teach you {healing spells} and {support spells}. \z - What kind of spell do you wish to learn? You can also tell me for which level \z - you would like to learn a spell, if you prefer that.", + text = "I can teach you {healing spells} and {support spells}. What kind of spell do you wish to learn? You can also tell me for which level you would like to learn a spell, if you prefer that.", }) keywordHandler:addKeyword({ "job" }, StdModule.say, { @@ -325,8 +285,7 @@ keywordHandler:addKeyword({ "time" }, StdModule.say, { }) keywordHandler:addKeyword({ "knights" }, StdModule.say, { npcHandler = npcHandler, - text = "Knights are the warriors of Tibia. Without us, no one would be safe. \z - Every brave and strong man or woman can join us.", + text = "Knights are the warriors of Tibia. Without us, no one would be safe. Every brave and strong man or woman can join us.", }) keywordHandler:addKeyword({ "bozo" }, StdModule.say, { npcHandler = npcHandler, @@ -382,13 +341,7 @@ keywordHandler:addKeyword({ "tibianus" }, StdModule.say, { }) keywordHandler:addKeyword({ "outfit" }, StdModule.say, { npcHandler = npcHandler, - text = "Only the bravest warriors may wear adorned helmets. \z - They are traditionally awarded after having completed a difficult task for our guild.", -}) -keywordHandler:addKeyword({ "helmet" }, StdModule.say, { - npcHandler = npcHandler, - text = "Only the bravest warriors may wear adorned helmets. \z - They are traditionally awarded after having completed a difficult task for our guild.", + text = "Only the bravest warriors may wear adorned helmets. They are traditionally awarded after having completed a difficult task for our guild.", }) npcHandler:setMessage(MESSAGE_GREET, "Greetings, |PLAYERNAME|. What do you want?") diff --git a/data-otservbr-global/npc/habdel.lua b/data-otservbr-global/npc/habdel.lua index d9371bb7c6a..1a060e95fa6 100644 --- a/data-otservbr-global/npc/habdel.lua +++ b/data-otservbr-global/npc/habdel.lua @@ -58,21 +58,13 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "outfit") then - if player:getSex() == PLAYERSEX_FEMALE then - npcHandler:say("My scimitar? Well, mylady, I do not want to sound rude, but I don't think a scimitar would fit to your beautiful outfit. If you are looking for an accessory, why don't you talk to Ishina?", npc, creature) - return true - end - if player:getStorageValue(Storage.OutfitQuest.firstOrientalAddon) < 1 then + if player:getSex() == PLAYERSEX_MALE and MsgContains(message, "outfit") and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder) >= 34 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) >= 44 then + if player:getStorageValue(Storage.Quest.U7_8.OrientalOutfits.FirstOrientalAddon) < 1 then npcHandler:say("My scimitar? Yes, that is a true masterpiece. Of course I could make one for you, but I have a small request. Would you fulfil a task for me?", npc, creature) npcHandler:setTopic(playerId, 1) end - elseif MsgContains(message, "comb") then - if player:getSex() == PLAYERSEX_FEMALE then - npcHandler:say("Comb? This is a weapon shop.", npc, creature) - return true - end - if player:getStorageValue(Storage.OutfitQuest.firstOrientalAddon) == 1 then + elseif player:getSex() == PLAYERSEX_MALE and MsgContains(message, "comb") then + if player:getStorageValue(Storage.Quest.U7_8.OrientalOutfits.FirstOrientalAddon) == 1 then npcHandler:say("Have you brought a mermaid's comb for Ishina?", npc, creature) npcHandler:setTopic(playerId, 3) end @@ -84,8 +76,11 @@ local function creatureSayCallback(npc, creature, type, message) }, npc, creature) npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 2 then - player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) - player:setStorageValue(Storage.OutfitQuest.firstOrientalAddon, 1) + if player:getStorageValue(Storage.OutfitQuest.DefaultStart) ~= 1 then + player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) + end + player:setStorageValue(Storage.Quest.U7_8.OrientalOutfits.FirstOrientalAddon, 1) + player:setStorageValue(Storage.Quest.U7_8.OrientalOutfits.OrientalDoor, 1) npcHandler:say("Brilliant! I will wait for you to return with a mermaid's comb then.", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then @@ -94,9 +89,8 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 0) return true end - player:setStorageValue(Storage.OutfitQuest.firstOrientalAddon, 2) - player:addOutfitAddon(150, 1) - player:addOutfitAddon(146, 1) + player:setStorageValue(Storage.Quest.U7_8.OrientalOutfits.FirstOrientalAddon, 2) + player:addOutfitAddon(146, 1) --male addon player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) npcHandler:say("Yeah! That's it! I can't wait to give it to her! Oh - but first, I'll fulfil my promise: Here is your scimitar! Thanks again!", npc, creature) npcHandler:setTopic(playerId, 0) diff --git a/data-otservbr-global/npc/hairycles.lua b/data-otservbr-global/npc/hairycles.lua index 7ffcb21433d..9af42751219 100644 --- a/data-otservbr-global/npc/hairycles.lua +++ b/data-otservbr-global/npc/hairycles.lua @@ -52,8 +52,8 @@ end local function greetCallback(npc, creature) local playerId = creature:getId() - if Player(creature):getStorageValue(Storage.TheApeCity.Questline) < 12 then - npcHandler:setMessage(MESSAGE_GREET, "Oh! Hello! Hello! Did not notice! So {busy}.") + if Player(creature):getStorageValue(Storage.Quest.U7_6.TheApeCity.Questline) < 12 then + npcHandler:setMessage(MESSAGE_GREET, "Oh! Hello! Hello! Did not notice!") else npcHandler:setMessage(MESSAGE_GREET, "Be greeted, friend of the ape people. If you want to {trade}, just ask for my offers. If you are injured, ask for healing.") end @@ -77,7 +77,7 @@ local function creatureSayCallback(npc, creature, type, message) return false end - local questProgress = player:getStorageValue(Storage.TheApeCity.Questline) + local questProgress = player:getStorageValue(Storage.Quest.U7_6.TheApeCity.Questline) if MsgContains(message, "mission") then if questProgress < 1 then npcHandler:say("These are dire times for our people. Problems plenty are in this times. But me people not grant trust easy. Are you willing to prove you friend of ape people?", npc, creature) @@ -94,7 +94,7 @@ local function creatureSayCallback(npc, creature, type, message) "Whisper moss strong is, but me need liquid that humans have to make it work ...", "Our raiders brought it from human settlement, it's called cough syrup. Go ask healer there for it.", }, npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 3) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 3) elseif questProgress == 3 then npcHandler:say("You brought me that cough syrup from human healer me asked for?", npc, creature) npcHandler:setTopic(playerId, 4) @@ -114,7 +114,7 @@ local function creatureSayCallback(npc, creature, type, message) }, npc, creature) npcHandler:setTopic(playerId, 8) elseif questProgress == 7 then - if player:getStorageValue(Storage.TheApeCity.ParchmentDecyphering) == 1 then + if player:getStorageValue(Storage.Quest.U7_6.TheApeCity.ParchmentDecyphering) == 1 then npcHandler:say("Ah yes, you read the signs in tomb? Good! May me look into your mind to see what you saw?", npc, creature) npcHandler:setTopic(playerId, 9) else @@ -147,9 +147,9 @@ local function creatureSayCallback(npc, creature, type, message) }, npc, creature) npcHandler:setTopic(playerId, 14) elseif questProgress == 13 then - if player:getStorageValue(Storage.TheApeCity.Casks) == 3 then + if player:getStorageValue(Storage.Quest.U7_6.TheApeCity.Casks) == 3 then npcHandler:say("You do please Hairycles again, friend. Me hope madness will not spread further now. Perhaps you are ready for other mission.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 14) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 14) else npcHandler:say("Please destroy three casks in the complex beneath Banuta, so my people will come to senses again.", npc, creature) end @@ -165,7 +165,7 @@ local function creatureSayCallback(npc, creature, type, message) }, npc, creature) npcHandler:setTopic(playerId, 15) elseif questProgress == 15 then - if player:getStorageValue(Storage.TheApeCity.HolyApeHair) == 1 then + if player:getStorageValue(Storage.Quest.U7_6.TheApeCity.HolyApeHair) == 1 then npcHandler:say("You brought hair of holy ape?", npc, creature) npcHandler:setTopic(playerId, 16) else @@ -180,13 +180,13 @@ local function creatureSayCallback(npc, creature, type, message) }, npc, creature) npcHandler:setTopic(playerId, 17) elseif questProgress == 17 then - if player:getStorageValue(Storage.TheApeCity.SnakeDestroyer) == 1 then + if player:getStorageValue(Storage.Quest.U7_6.TheApeCity.SnakeDestroyer) == 1 then npcHandler:say({ "Finally my people are safe! You have done incredible good for ape people and one day even me brethren will recognise that. ...", "I wish I could speak for all when me call you true friend but my people need time to get accustomed to change. ...", "Let us hope one day whole Banuta will greet you as a friend. Perhaps you want to check me offers for special friends... or shamanic powers.", }, npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 18) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 18) player:addAchievement("Friend of the Apes") else npcHandler:say("Me know its much me asked for but go into the deepest catacombs under Banuta and destroy the monument of the serpent god.", npc, creature) @@ -206,7 +206,7 @@ local function creatureSayCallback(npc, creature, type, message) end elseif MsgContains(message, "outfit") or MsgContains(message, "shamanic") then if questProgress == 18 then - if player:getStorageValue(Storage.TheApeCity.ShamanOutfit) ~= 1 then + if player:getStorageValue(Storage.Quest.U7_6.TheApeCity.ShamanOutfit) ~= 1 then npcHandler:say("Me truly proud of you, friend. You learn many about plants, charms and ape people. Me want grant you shamanic power now. You ready?", npc, creature) npcHandler:setTopic(playerId, 18) else @@ -249,9 +249,9 @@ local function creatureSayCallback(npc, creature, type, message) "Me know they hoard some in their underground lair. My people raided dworcs often before humans came. So we know the moss is hidden in east of upper level of dworc lair ...", "You go there and take good moss from evil dworcs. Talk with me about mission when having moss.", }, npc, creature) - player:setStorageValue(Storage.TheApeCity.Started, 1) - player:setStorageValue(Storage.TheApeCity.Questline, 1) - player:setStorageValue(Storage.TheApeCity.DworcDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Started, 1) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 1) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.DworcDoor, 1) elseif MsgContains(message, "no") then npcHandler:say("Hairycles thought better of you.", npc, creature) addEvent(function() @@ -268,7 +268,7 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:say("Ah yes! That's it. Thank you for bringing mighty whisper moss to Hairycles. It will help but still much is to be done. Just ask for other mission if you ready.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 2) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 2) elseif MsgContains(message, "no") then npcHandler:say("Strange being you are! Our people need help!", npc, creature) end @@ -281,7 +281,7 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:say("You so good! Brought syrup to me! Thank you, will prepare cure now. Just ask for {mission} if you want help again.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 4) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 4) elseif MsgContains(message, "no") then npcHandler:say("Please hurry, urgent it is!", npc, creature) end @@ -304,8 +304,8 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 6 then if MsgContains(message, "yes") then npcHandler:say("Good thing that is! Report about your mission when have scroll.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 5) - player:setStorageValue(Storage.TheApeCity.ChorDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 5) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.ChorDoor, 1) elseif MsgContains(message, "no") then npcHandler:say("Me sad. Me expected better from you!", npc, creature) addEvent(function() @@ -325,7 +325,7 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:say("You brought scroll with lizard text? Good! I will see what text tells me! Come back when ready for other mission.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 6) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 6) elseif MsgContains(message, "no") then npcHandler:say("That's bad news. If you lost it, only way to get other is to kill holy serpents. But you can't go there so you must ask adventurers who can.", npc, creature) end @@ -333,7 +333,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 8 then if MsgContains(message, "yes") then npcHandler:say("Good thing that is! Report about mission when you have read those signs.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 7) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 7) elseif MsgContains(message, "no") then npcHandler:say("Me sad. Me expected better from you!", npc, creature) addEvent(function() @@ -344,7 +344,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 9 then if MsgContains(message, "yes") then npcHandler:say("Oh, so clear is all now! Easy it will be to read the signs now! Soon we will know what to do! Thank you again! Ask for mission if you feel ready.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 8) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 8) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) elseif MsgContains(message, "no") then npcHandler:say("Me need to see it in your mind, other there is no way to proceed.", npc, creature) @@ -353,7 +353,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 10 then if MsgContains(message, "yes") then npcHandler:say("You brave hairless ape! Get me hydra egg. If you lose egg, you probably have to fight many, many hydras to get another.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 9) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 9) elseif MsgContains(message, "no") then npcHandler:say("Me sad. Me expected better from you!", npc, creature) addEvent(function() @@ -369,7 +369,7 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:say("Ah, the egg! Mighty warrior you be! Thank you. Hairycles will put it at safe place immediately.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 10) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 10) elseif MsgContains(message, "no") then npcHandler:say("Please hurry. Hairycles not knows when evil lizards strike again.", npc, creature) end @@ -377,8 +377,8 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 12 then if MsgContains(message, "yes") then npcHandler:say("Long journey it will take, good luck to you.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 11) - player:setStorageValue(Storage.TheApeCity.FibulaDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 11) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.FibulaDoor, 1) elseif MsgContains(message, "no") then npcHandler:say("Me sad. Me expected better from you!", npc, creature) addEvent(function() @@ -394,8 +394,8 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:say("Incredible, you brought a witches' cap! Now me can prepare mighty charm of life. Yet still other {missions} will await you, friend.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 12) - player:setStorageValue(Storage.TheApeCity.FibulaDoor, -1) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 12) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.FibulaDoor, -1) elseif MsgContains(message, "no") then npcHandler:say("Please try to find me a witches' cap on Fibula.", npc, creature) addEvent(function() @@ -406,8 +406,8 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 14 then if MsgContains(message, "yes") then npcHandler:say("Hairycles sure you will make it. Good luck, friend.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 13) - player:setStorageValue(Storage.TheApeCity.CasksDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 13) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.CasksDoor, 1) elseif MsgContains(message, "no") then npcHandler:say("Me sad. Please reconsider.", npc, creature) end @@ -415,7 +415,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 15 then if MsgContains(message, "yes") then npcHandler:say("Hairycles proud of you. Go and find holy hair. Good luck, friend.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 15) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 15) elseif MsgContains(message, "no") then npcHandler:say("Me sad. Please reconsider.", npc, creature) end @@ -424,12 +424,12 @@ local function creatureSayCallback(npc, creature, type, message) if MsgContains(message, "yes") then if not player:removeItem(4832, 1) then npcHandler:say("You no have hair. You lost it? Go and look again.", npc, creature) - player:setStorageValue(Storage.TheApeCity.HolyApeHair, -1) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.HolyApeHair, -1) return true end npcHandler:say("Incredible! You got a hair of holy Bong! This will raise the spirit of my people. You are truly a friend. But one last mission awaits you.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 16) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 16) elseif MsgContains(message, "no") then npcHandler:say("You no have hair. You lost it? Go and look again.", npc, creature) end @@ -437,7 +437,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 17 then if MsgContains(message, "yes") then npcHandler:say("Hairycles sure you will make it. Just use hammer on all that looks like snake or lizard. Tell Hairycles if you succeed with mission.", npc, creature) - player:setStorageValue(Storage.TheApeCity.Questline, 17) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 17) player:addItem(4835, 1) elseif MsgContains(message, "no") then npcHandler:say("Me sad. Please reconsider.", npc, creature) @@ -448,7 +448,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Friend of the ape people! Take my gift and become me apprentice! Here is shaman clothing for you!", npc, creature) player:addOutfit(154) player:addOutfit(158) - player:setStorageValue(Storage.TheApeCity.ShamanOutfit, 1) + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.ShamanOutfit, 1) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) elseif MsgContains(message, "no") then npcHandler:say("Come back if change mind.", npc, creature) @@ -490,7 +490,7 @@ keywordHandler:addKeyword({ "magic" }, StdModule.say, { npcHandler = npcHandler, keywordHandler:addKeyword({ "jungle" }, StdModule.say, { npcHandler = npcHandler, text = "Jungle is dangerous. Jungle also provides us food. Take care when in jungle and safe you be." }) local function onTradeRequest(npc, creature) - if Player(creature):getStorageValue(Storage.TheApeCity.Questline) < 18 then + if Player(creature):getStorageValue(Storage.Quest.U7_6.TheApeCity.Questline) < 18 then return false end diff --git a/data-otservbr-global/npc/hanna.lua b/data-otservbr-global/npc/hanna.lua index 025ac04c22c..cc66f83bc68 100644 --- a/data-otservbr-global/npc/hanna.lua +++ b/data-otservbr-global/npc/hanna.lua @@ -65,7 +65,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "addon") or MsgContains(message, "outfit") or MsgContains(message, "hat") then - local addonProgress = player:getStorageValue(Storage.OutfitQuest.Citizen.MissionHat) + local addonProgress = player:getStorageValue(Storage.Quest.U7_8.CitizenOutfits.AddonHat) if addonProgress < 1 then npcHandler:say("Pretty, isn't it? My friend Amber taught me how to make it, but I could help you with one if you like. What do you say?", npc, creature) npcHandler:setTopic(playerId, 1) @@ -80,8 +80,8 @@ local function creatureSayCallback(npc, creature, type, message) if npcHandler:getTopic(playerId) == 1 then if MsgContains(message, "yes") then - player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) - player:setStorageValue(Storage.OutfitQuest.Citizen.MissionHat, 1) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfits.AddonHat, 1) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfits.MissionHat, 1) npcHandler:say("Okay, here we go, listen closely! I need a few things... a basic hat of course, maybe a legion helmet would do. Then about 100 chicken feathers... and 50 honeycombs as glue. That's it, come back to me once you gathered it!", npc, creature) else npcHandler:say("Aw, I guess you don't like feather hats. No big deal.", npc, creature) @@ -98,15 +98,13 @@ local function creatureSayCallback(npc, creature, type, message) else npcHandler:say("Great job! That must have taken a lot of work. Okay, you put it like this... then glue like this... here!", npc, creature) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - player:removeItem(3374, 1) player:removeItem(5902, 50) player:removeItem(5890, 100) - player:addOutfitAddon(136, 2) player:addOutfitAddon(128, 2) - - player:setStorageValue(Storage.OutfitQuest.Citizen.MissionHat, 2) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfits.MissionHat, 0) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfits.AddonHat, 2) end else npcHandler:say("Maybe another time.", npc, creature) diff --git a/data-otservbr-global/npc/haroun.lua b/data-otservbr-global/npc/haroun.lua index 33a4e1c2c72..ccd762b46df 100644 --- a/data-otservbr-global/npc/haroun.lua +++ b/data-otservbr-global/npc/haroun.lua @@ -45,6 +45,37 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local function endConversationWithDelay(npcHandler, npc, creature) + addEvent(function() + npcHandler:unGreet(npc, creature) + end, 1000) +end + +local function greetCallback(npc, creature, message) + local player = Player(creature) + local playerId = player:getId() + + if not MsgContains(message, "djanni'hah") then + npcHandler:say("Whoa! A human! This is no place for you, |PLAYERNAME|. Go and play somewhere else.", npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Start) == 1 then + npcHandler:say({ + "Hahahaha! ...", + "|PLAYERNAME|, that almost sounded like the word of greeting. Humans - cute they are!", + }, npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + npcHandler:say("Be greeted, human |PLAYERNAME|. How can a humble djinn be of service?", npc, creature) + npcHandler:setInteraction(npc, creature) + + return true +end + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -94,7 +125,7 @@ end local function onTradeRequest(npc, creature) local player = Player(creature) - if player:getStorageValue(Storage.DjinnWar.MaridFaction.Mission03) ~= 3 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission03) ~= 3 then npcHandler:say("I'm sorry, human. But you need Gabel's permission to trade with me.", npc, creature) return false end @@ -102,13 +133,16 @@ local function onTradeRequest(npc, creature) return true end -npcHandler:setMessage(MESSAGE_GREET, "Be greeted, human |PLAYERNAME|. How can a humble djinn be of service?") +-- Greeting +keywordHandler:addCustomGreetKeyword({ "djanni'hah" }, greetCallback, { npcHandler = npcHandler }) + npcHandler:setMessage(MESSAGE_FAREWELL, "Farewell! May the serene light of the enlightened one rest shine on your travels.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Farewell, human.") npcHandler:setMessage(MESSAGE_SENDTRADE, "At your service, just browse through my wares.") npcHandler:setCallback(CALLBACK_ON_TRADE_REQUEST, onTradeRequest) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) +npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) npcConfig.shop = { diff --git a/data-otservbr-global/npc/hugo.lua b/data-otservbr-global/npc/hugo.lua index ee7f81337bd..16f5f468897 100644 --- a/data-otservbr-global/npc/hugo.lua +++ b/data-otservbr-global/npc/hugo.lua @@ -134,28 +134,28 @@ local function creatureSayCallback(npc, creature, type, message) return true end - if player:getStorageValue(Storage.OutfitQuest.BeggarOutfit) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) < 1 then npcHandler:say({ "I think I'm having an innovative vision! I feel that people are getting tired of attempting to look wealthy and of displaying their treasures. ...", "A really new and innovative look would be - the 'poor man's look'! I can already see it in front of me... yes... a little ragged... but not too shabby! ...", "I need material right now! Argh - the vision starts to fade... please hurry, can you bring me some stuff?", }, npc, creature) npcHandler:setTopic(playerId, 2) - elseif player:getStorageValue(Storage.OutfitQuest.BeggarOutfit) > 0 and player:getStorageValue(Storage.OutfitQuest.BeggarOutfit) < 5 then + elseif player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) > 0 and player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) < 5 then npcHandler:say("I am so excited! This poor man's look will be an outfit like the world has never seen before.", npc, creature) - elseif player:getStorageValue(Storage.OutfitQuest.BeggarOutfit) == 5 then - if player:getStorageValue(Storage.OutfitQuest.BeggarOutfitTimer) > os.time() then + elseif player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) == 5 then + if player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfitTimer) > os.time() then npcHandler:say("Sorry, but I am not done with the outfit yet. Venore wasn't built in a day.", npc, creature) - elseif player:getStorageValue(Storage.OutfitQuest.BeggarOutfitTimer) > 0 and player:getStorageValue(Storage.OutfitQuest.BeggarOutfitTimer) < os.time() then + elseif player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfitTimer) > 0 and player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfitTimer) < os.time() then npcHandler:say("Eureka! Alas, the poor man's outfit is finished, but... to be honest... it turned out much less appealing than I expected. However, you can have it if you want, okay?", npc, creature) npcHandler:setTopic(playerId, 5) end - elseif player:getStorageValue(Storage.OutfitQuest.BeggarOutfit) == 6 then + elseif player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) == 6 then npcHandler:say("I guess my vision wasn't that grand after all. I hope there are still people who enjoy it.", npc, creature) end elseif config[message:lower()] then local targetMessage = config[message:lower()] - if player:getStorageValue(Storage.OutfitQuest.BeggarOutfit) ~= targetMessage.value then + if player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) ~= targetMessage.value then npcHandler:say(targetMessage.messages.done, npc, creature) return true end @@ -175,7 +175,7 @@ local function creatureSayCallback(npc, creature, type, message) if player:getStorageValue(Storage.OutfitQuest.DefaultStart) ~= 1 then player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) end - player:setStorageValue(Storage.OutfitQuest.BeggarOutfit, 1) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit, 1) npcHandler:say("Terrific! What are you waiting for?! Start right away gathering 20 pieces of brown cloth and come back once you have them!", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 4 then @@ -185,16 +185,16 @@ local function creatureSayCallback(npc, creature, type, message) return true end - player:setStorageValue(Storage.OutfitQuest.BeggarOutfit, player:getStorageValue(Storage.OutfitQuest.BeggarOutfit) + 1) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit, player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) + 1) if targetMessage.lastItem then - player:setStorageValue(Storage.OutfitQuest.BeggarOutfitTimer, os.time() + 86400) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfitTimer, os.time() + 86400) end npcHandler:say(targetMessage.messages.success, npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 5 then player:addOutfit(153) player:addOutfit(157) - player:setStorageValue(Storage.OutfitQuest.BeggarOutfit, 6) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit, 6) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) npcHandler:say("Here you go. Maybe you enjoy if after all.", npc, creature) npcHandler:setTopic(playerId, 0) diff --git a/data-otservbr-global/npc/iptar-sin.lua b/data-otservbr-global/npc/iptar-sin.lua index 41fad376a4a..e206cac3f87 100644 --- a/data-otservbr-global/npc/iptar-sin.lua +++ b/data-otservbr-global/npc/iptar-sin.lua @@ -60,29 +60,29 @@ local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { "Is this stake really important enough to you so that you are willing to take this burden?", }, }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == -1 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == -1 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Alright, I guess you need a stake first. Maybe Gamon can help you, the leg of a chair or something could just do. Try asking him for a stake, and if you have one, bring it back to me.", reset = true, ungreet = true }, nil, function(player) - player:setStorageValue(Storage.FriendsandTraders.DefaultStart, 1) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 1) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.DefaultStart, 1) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 1) end) -- First prayer keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "I guess you couldn't convince Gamon to give you a stake, eh?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 1 and player:getItemCount(5941) == 0 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 1 and player:getItemCount(5941) == 0 end) local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Yes, I was informed what to do. Are you prepared to receive my line of the prayer?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 1 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 1 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "So receive my prayer: 'Light shall be near - and darkness afar'. Now, bring your stake to Tibra in the Carlin church for the next line of the prayer. I will inform her what to do.", reset = true }, nil, function(player) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 2) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 2) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end) stakeKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "I will wait for you.", reset = true }) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You should visit Tibra in the Carlin church now." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 2 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 2 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You already received my line of the prayer." }) diff --git a/data-otservbr-global/npc/irmana.lua b/data-otservbr-global/npc/irmana.lua index e106ef0a10c..107155f6f27 100644 --- a/data-otservbr-global/npc/irmana.lua +++ b/data-otservbr-global/npc/irmana.lua @@ -46,10 +46,165 @@ npcType.onThink = function(npc, interval) npcHandler:onThink(npc, interval) end +local function creatureSayCallbackFemale(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if MsgContains(message, "addon") and player:getStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanFirstAddon) < 1 then + npcHandler:say("Currently we are offering accessories for the nobleman - and, of course, noblewoman - outfit. Would you like to hear more about our offer?", npc, creature) + npcHandler:setTopic(playerId, 19) + elseif npcHandler:getTopic(playerId) == 19 and MsgContains(message, "yes") then + npcHandler:say("Especially for you, mylady, we are offering a pretty hat and a beautiful dress like the ones I wear. Which one are you interested in?", npc, creature) + npcHandler:setTopic(playerId, 20) + elseif npcHandler:getTopic(playerId) == 20 and MsgContains(message, "dress") then + npcHandler:say("Great! Since our accessories are hand-tailored designer pieces, of course they are not made for citizens with an empty wallet. Should I inform you about our payment policy?", npc, creature) + npcHandler:setTopic(playerId, 21) + elseif npcHandler:getTopic(playerId) == 21 and MsgContains(message, "yes") then + npcHandler:say({ + "The accessory requires a small fee of 150000 gold pieces. Of course, we do not want to put you at any risk to be attacked while carrying this huge amount of money. ...", + "This is why we have established our brand-new instalment sale. You can choose to either pay the price at once, or if you want to be safe, by instalments of 10000 gold pieces. ...", + "I also have to inform you that once you started paying for one of the accessories, you have to finish the payment first before you can start paying for the other one, of course. Are you interested in purchasing this accessory?", + }, npc, creature) + npcHandler:setTopic(playerId, 22) + elseif npcHandler:getTopic(playerId) == 22 and MsgContains(message, "yes") then + npcHandler:say("I'm very pleased to hear that! Which do you prefer - paying 150000 at once or 10000 for 15 times?", npc, creature) + npcHandler:setTopic(playerId, 23) + elseif npcHandler:getTopic(playerId) == 23 and MsgContains(message, "150000") then + player:setStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanFirstAddon, 1) + npcHandler:say("Good, I have noted down your order. Once you have the money, please come back to pick up your accessory.", npc, creature) + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "addon") and player:getStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanFirstAddon) == 1 then + npcHandler:say("Ah, are you here to pickup your accessory for 150000 gold pieces?", npc, creature) + npcHandler:setTopic(playerId, 24) + elseif npcHandler:getTopic(playerId) == 24 and MsgContains(message, "yes") then + if player:removeMoney(150000) then + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) + player:addOutfitAddon(140, 1) + npcHandler:say("Congratulations! Here is your brand-new accessory, I hope you like it. Please visit us again!", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanFirstAddon, 2) + else + npcHandler:say("You do not have enough money.", npc, creature) + end + elseif MsgContains(message, "addon") and player:getStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanSecondAddon) < 1 then + npcHandler:say("Currently we are offering accessories for the nobleman - and, of course, noblewoman - outfit. Would you like to hear more about our offer?", npc, creature) + npcHandler:setTopic(playerId, 25) + elseif npcHandler:getTopic(playerId) == 25 and MsgContains(message, "yes") then + npcHandler:say("Especially for you, mylady, we are offering a pretty hat and a beautiful dress like the ones I wear. Which one are you interested in?", npc, creature) + npcHandler:setTopic(playerId, 26) + elseif npcHandler:getTopic(playerId) == 26 and MsgContains(message, "hat") then + npcHandler:say("Great! Since our accessories are hand-tailored designer pieces, of course they are not made for citizens with an empty wallet. Should I inform you about our payment policy?", npc, creature) + npcHandler:setTopic(playerId, 27) + elseif npcHandler:getTopic(playerId) == 27 and MsgContains(message, "yes") then + npcHandler:say({ + "This accessory requires a small fee of 150000 gold pieces. Of course, we do not want to put you at any risk to be attacked while carrying this huge amount of money. ...", + "This is why we have established our brand-new instalment sale. You can choose to either pay the price at once, or if you want to be safe, by instalments of 10000 gold pieces. ...", + "I also have to inform you that once you started paying for one of the accessories, you have to finish the payment first before you can start paying for the other one, of course. Are you interested in purchasing this accessory?", + }, npc, creature) + npcHandler:setTopic(playerId, 28) + elseif npcHandler:getTopic(playerId) == 28 and MsgContains(message, "yes") then + npcHandler:say("I'm very pleased to hear that! Which do you prefer - paying 150000 at once or 10000 for 15 times?", npc, creature) + npcHandler:setTopic(playerId, 29) + elseif npcHandler:getTopic(playerId) == 29 and MsgContains(message, "150000") then + player:setStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanSecondAddon, 1) + npcHandler:say("Good, I have noted down your order. Once you have the money, please come back to pick up your accessory.", npc, creature) + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "addon") and player:getStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanSecondAddon) == 1 then + npcHandler:say("Ah, are you here to pickup your accessory for 150000 gold pieces?", npc, creature) + npcHandler:setTopic(playerId, 30) + elseif npcHandler:getTopic(playerId) == 30 and MsgContains(message, "yes") then + if player:removeMoney(150000) then + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) + player:addOutfitAddon(140, 2) + player:addAchievement(226) -- Achievement Aristocrat + npcHandler:say("Congratulations! Here is your brand-new accessory, I hope you like it. Please visit us again!", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanSecondAddon, 2) + else + npcHandler:say("You do not have enough money.", npc, creature) + end + end + + return true +end + +local function creatureSayCallbackMale(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if MsgContains(message, "addon") and player:getStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanFirstAddon) < 1 then + npcHandler:say("Currently we are offering accessories for the nobleman - and, of course, noblewoman - outfit. Would you like to hear more about our offer?", npc, creature) + npcHandler:setTopic(playerId, 9) + elseif npcHandler:getTopic(playerId) == 9 and MsgContains(message, "yes") then + npcHandler:say("Especially for you, mylord, we are offering a fashionable top hat and a fancy coat like the one Kalvin wears. Which one are you interested in?", npc, creature) + npcHandler:setTopic(playerId, 10) + elseif npcHandler:getTopic(playerId) == 10 and MsgContains(message, "coat") then + npcHandler:say("Great! Since our accessories are hand-tailored designer pieces, of course they are not made for citizens with an empty wallet. Should I inform you about our payment policy?", npc, creature) + npcHandler:setTopic(playerId, 11) + elseif npcHandler:getTopic(playerId) == 11 and MsgContains(message, "yes") then + npcHandler:say({ + "This accessory requires a small fee of 150000 gold pieces. Of course, we do not want to put you at any risk to be attacked while carrying this huge amount of money. ...", + "This is why we have established our brand-new instalment sale. You can choose to either pay the price at once, or if you want to be safe, by instalments of 10000 gold pieces. ...", + "I also have to inform you that once you started paying for one of the accessories, you have to finish the payment first before you can start paying for the other one, of course. Are you interested in purchasing this accessory?", + }, npc, creature) + npcHandler:setTopic(playerId, 12) + elseif npcHandler:getTopic(playerId) == 12 and MsgContains(message, "yes") then + npcHandler:say("I'm very pleased to hear that! Which do you prefer - paying 150000 at once or 10000 for 15 times?", npc, creature) + npcHandler:setTopic(playerId, 13) + elseif npcHandler:getTopic(playerId) == 13 and MsgContains(message, "150000") then + player:setStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanFirstAddon, 1) + npcHandler:say("Good, I have noted down your order. Once you have the money, please come back to pick up your accessory.", npc, creature) + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "addon") and player:getStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanFirstAddon) == 1 then + if player:removeMoney(150000) then + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) + player:addOutfitAddon(132, 1) + npcHandler:say("Ah, are you here to pickup your accessory for 150000 gold pieces? Here is your nobleman coat. Enjoy!", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanFirstAddon, 2) + else + npcHandler:say("You do not have enough money.", npc, creature) + end + elseif MsgContains(message, "addon") and player:getStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanSecondAddon) < 1 then + npcHandler:say("Currently we are offering accessories for the nobleman - and, of course, noblewoman - outfit. Would you like to hear more about our offer?", npc, creature) + npcHandler:setTopic(playerId, 14) + elseif npcHandler:getTopic(playerId) == 14 and MsgContains(message, "yes") then + npcHandler:say("Especially for you, mylord, we are offering a fashionable top hat and a fancy coat like the one Kalvin wears. Which one are you interested in?", npc, creature) + npcHandler:setTopic(playerId, 15) + elseif npcHandler:getTopic(playerId) == 15 and MsgContains(message, "yes") then + npcHandler:say("Great! Since our accessories are hand-tailored designer pieces, of course they are not made for citizens with an empty wallet. Should I inform you about our payment policy?", npc, creature) + npcHandler:setTopic(playerId, 16) + elseif npcHandler:getTopic(playerId) == 16 and MsgContains(message, "yes") then + npcHandler:say({ + "This accessory requires a small fee of 150000 gold pieces. Of course, we do not want to put you at any risk to be attacked while carrying this huge amount of money. ...", + "This is why we have established our brand-new instalment sale. You can choose to either pay the price at once, or if you want to be safe, by instalments of 10000 gold pieces. ...", + "I also have to inform you that once you started paying for one of the accessories, you have to finish the payment first before you can start paying for the other one, of course. Are you interested in purchasing this accessory?", + }, npc, creature) + npcHandler:setTopic(playerId, 17) + elseif npcHandler:getTopic(playerId) == 17 and MsgContains(message, "yes") then + npcHandler:say("I'm very pleased to hear that! Which do you prefer - paying 150000 at once or 10000 for 15 times?", npc, creature) + npcHandler:setTopic(playerId, 18) + elseif npcHandler:getTopic(playerId) == 18 and MsgContains(message, "150000") then + player:setStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanSecondAddon, 1) + npcHandler:say("Good, I have noted down your order. Once you have the money, please come back to pick up your accessory.", npc, creature) + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "addon") and player:getStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanSecondAddon) == 1 then + if player:removeMoney(150000) then + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) + player:addOutfitAddon(132, 2) + player:addAchievement(226) -- Achievement Aristocrat + npcHandler:say("Ah, are you here to pickup your accessory for 150000 gold pieces? Here is your nobleman hat. Enjoy!", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.NoblemanOutfits.NoblemanSecondAddon, 2) + else + npcHandler:say("You do not have enough money.", npc, creature) + end + end + + return true +end + local ThreatenedDreams = Storage.Quest.U11_40.ThreatenedDreams local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() + local playerSex = player:getSex() if MsgContains(message, "fur") then if player:getStorageValue(ThreatenedDreams.Mission01[1]) == 7 and player:getStorageValue(ThreatenedDreams.Mission01.PoacherNotes) == 1 then @@ -63,96 +218,43 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("You are not on that mission.", npc, creature) npcHandler:setTopic(playerId, 0) end - elseif MsgContains(message, "addon") then - if getPlayerStorageValue(creature, Storage.Irmana1) < 1 then - npcHandler:say("Currently we are offering accessories for the nobleman - and, of course, noblewoman - outfit. Would you like to hear more about our offer?", npc, creature) - npcHandler:setTopic(playerId, 1) - elseif getPlayerStorageValue(creature, Storage.Irmana2) < 1 then - npcHandler:say("Currently we are offering accessories for the nobleman - and, of course, noblewoman - outfit. Would you like to hear more about our offer?", npc, creature) - npcHandler:setTopic(playerId, 1) + elseif npcHandler:getTopic(playerId) == 5 then + if player:getItemCount(3566) >= 1 then + player:removeItem(3566, 1) + npcHandler:say("A {Red Robe}! Great. Here, take this red piece of cloth, I don't need it anyway.", npc, creature) + player:addItem(5911, 1) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("Are you trying to mess with me?!", npc, creature) + end + elseif npcHandler:getTopic(playerId) == 6 then + if player:getItemCount(3574) >= 1 then + player:removeItem(3574, 1) + npcHandler:say("A {Mystic Turban}! Great. Here, take this blue piece of cloth, I don't need it anyway.", npc, creature) + player:addItem(5912, 1) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("Are you trying to mess with me?!", npc, creature) + end + elseif npcHandler:getTopic(playerId) == 7 then + if player:getItemCount(3563) >= 150 then + player:removeItem(3563, 150) + npcHandler:say("A 150 {Green Tunic}! Great. Here, take this green piece of cloth, I don't need it anyway.", npc, creature) + player:addItem(5910, 1) + npcHandler:setTopic(playerId, 0) else - npcHandler:say("You have already bought the two addons.", npc, creature) + npcHandler:say("Are you trying to mess with me?!", npc, creature) end - elseif MsgContains(message, "yes") then - if npcHandler:getTopic(playerId) == 1 then - npcHandler:say("Especially for you, mylady, we are offering a pretty {hat} and a beautiful {dress} like the ones I wear. Which one are you interested in?", npc, creature) - npcHandler:setTopic(playerId, 2) - elseif npcHandler:getTopic(playerId) == 3 then - if doPlayerRemoveMoney(creature, 150000) and getPlayerStorageValue(creature, Storage.Irmana1) < 1 then - npcHandler:say("Congratulations! Here is your brand-new accessory, I hope you like it. Please visit us again! ", npc, creature) - npcHandler:setTopic(playerId, 0) - player:addOutfitAddon(140, 2) - player:addOutfitAddon(132, 2) - setPlayerStorageValue(creature, Storage.Irmana1, 1) - if player:getStorageValue(Storage.Irmana1) == 1 and player:getStorageValue(Storage.Irmana2) == 1 then - player:addAchievement(226) -- Achievement Aristocrat - end - end - elseif npcHandler:getTopic(playerId) == 4 then - if doPlayerRemoveMoney(creature, 150000) and getPlayerStorageValue(creature, Storage.Irmana2) < 1 then - npcHandler:say("Congratulations! Here is your brand-new accessory, I hope you like it. Please visit us again! ", npc, creature) - npcHandler:setTopic(playerId, 0) - player:addOutfitAddon(140, 1) - player:addOutfitAddon(132, 1) - setPlayerStorageValue(creature, Storage.Irmana2, 1) - if player:getStorageValue(Storage.Irmana1) == 1 and player:getStorageValue(Storage.Irmana2) == 1 then - player:addAchievement(226) -- Achievement Aristocrat - end - end - elseif npcHandler:getTopic(playerId) == 5 then - if getPlayerItemCount(creature, 3566) >= 1 then - doPlayerRemoveItem(creature, 3566, 1) - npcHandler:say("A {Red Robe}! Great. Here, take this red piece of cloth, I don't need it anyway.", npc, creature) - doPlayerAddItem(creature, 5911, 1) - npcHandler:setTopic(playerId, 0) - else - npcHandler:say("Are you trying to mess with me?!", npc, creature) - end - elseif npcHandler:getTopic(playerId) == 6 then - if getPlayerItemCount(creature, 3574) >= 1 then - doPlayerRemoveItem(creature, 3574, 1) - npcHandler:say("A {Mystic Turban}! Great. Here, take this blue piece of cloth, I don't need it anyway.", npc, creature) - doPlayerAddItem(creature, 5912, 1) - npcHandler:setTopic(playerId, 0) - else - npcHandler:say("Are you trying to mess with me?!", npc, creature) - end - elseif npcHandler:getTopic(playerId) == 7 then - if getPlayerItemCount(creature, 3563) >= 150 then - doPlayerRemoveItem(creature, 3563, 150) - npcHandler:say("A 150 {Green Tunic}! Great. Here, take this green piece of cloth, I don't need it anyway.", npc, creature) - doPlayerAddItem(creature, 5910, 1) - npcHandler:setTopic(playerId, 0) - else - npcHandler:say("Are you trying to mess with me?!", npc, creature) - end - elseif npcHandler:getTopic(playerId) == 8 then - if player:getMoney() >= 1000 then - player:removeMoney(1000) - player:addItem(25238, 1) -- Fur of a Wolf Whelp - npcHandler:say("Alright. Here is the fur.", npc, creature) - player:setStorageValue(ThreatenedDreams.Mission01[1], 8) - npcHandler:setTopic(playerId, 0) - else - npcHandler:say("Are you trying to mess with me?!", npc, creature) - end + elseif npcHandler:getTopic(playerId) == 8 then + if player:getMoney() >= 1000 then + player:removeMoney(1000) + player:addItem(25238, 1) -- Fur of a Wolf Whelp + npcHandler:say("Alright. Here is the fur.", npc, creature) + player:setStorageValue(ThreatenedDreams.Mission01[1], 8) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("Are you trying to mess with me?!", npc, creature) end - elseif (MsgContains(message, "hat") or MsgContains(message, "accessory")) and (npcHandler:getTopic(playerId) == 2 and getPlayerStorageValue(creature, Storage.Irmana1) < 1) then - npcHandler:say({ - "This accessory requires a small fee of 150000 gold pieces. Of course, we do not want to put you at any risk to be attacked while carrying this huge amount of money. ...", - "This is why we have established our brand-new instalment sale. You can choose to either pay the price at once, or if you want to be safe, by instalments of 10000 gold pieces. ...", - "I also have to inform you that once you started paying for one of the accessories, you have to finish the payment first before you can start paying for the other one, of course. ...", - "Are you interested in purchasing this accessory?", - }, npc, creature) - npcHandler:setTopic(playerId, 3) - elseif (MsgContains(message, "dress") or MsgContains(message, "coat")) and (npcHandler:getTopic(playerId) == 2 and getPlayerStorageValue(creature, Storage.Irmana2) < 1) then - npcHandler:say({ - "This accessory requires a small fee of 150000 gold pieces. Of course, we do not want to put you at any risk to be attacked while carrying this huge amount of money. ...", - "This is why we have established our brand-new instalment sale. You can choose to either pay the price at once, or if you want to be safe, by instalments of 10000 gold pieces. ...", - "I also have to inform you that once you started paying for one of the accessories, you have to finish the payment first before you can start paying for the other one, of course. ...", - "Are you interested in purchasing this accessory?", - }, npc, creature) - npcHandler:setTopic(playerId, 4) elseif MsgContains(message, "red robe") then npcHandler:say("Have you found a {Red Robe} for me?", npc, creature) npcHandler:setTopic(playerId, 5) @@ -162,10 +264,15 @@ local function creatureSayCallback(npc, creature, type, message) elseif MsgContains(message, "green tunic") then npcHandler:say("Have you found {150 Green Tunic} for me?", npc, creature) npcHandler:setTopic(playerId, 7) + elseif playerSex == PLAYERSEX_MALE then + return creatureSayCallbackMale(npc, creature, type, message) + else + return creatureSayCallbackFemale(npc, creature, type, message) end return true end +npcHandler:setMessage(MESSAGE_GREET, "Welcome to the house of fashion, |PLAYERNAME|!") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) diff --git a/data-otservbr-global/npc/ishina.lua b/data-otservbr-global/npc/ishina.lua index 358ee2619a3..1f317cca171 100644 --- a/data-otservbr-global/npc/ishina.lua +++ b/data-otservbr-global/npc/ishina.lua @@ -58,23 +58,13 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "outfit") then - if player:getSex() == PLAYERSEX_MALE then - npcHandler:say("My jewelled belt? That's not very manly. Maybe you'd prefer a scimitar like Habdel has.", npc, creature) - return true - end - - if player:getStorageValue(Storage.OutfitQuest.firstOrientalAddon) < 1 then + if player:getSex() == PLAYERSEX_FEMALE and MsgContains(message, "outfit") and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder) >= 34 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) >= 44 then + if player:getStorageValue(Storage.Quest.U7_8.OrientalOutfits.FirstOrientalAddon) < 1 then npcHandler:say("My jewelled belt? Of course I could make one for you, but I have a small request. Would you fulfil a task for me?", npc, creature) npcHandler:setTopic(playerId, 1) end - elseif MsgContains(message, "comb") then - if player:getSex() == PLAYERSEX_MALE then - npcHandler:say("Comb? This is a jewellery shop.", npc, creature) - return true - end - - if player:getStorageValue(Storage.OutfitQuest.firstOrientalAddon) == 1 then + elseif player:getSex() == PLAYERSEX_FEMALE and MsgContains(message, "comb") then + if player:getStorageValue(Storage.Quest.U7_8.OrientalOutfits.FirstOrientalAddon) == 1 then npcHandler:say("Have you brought me a mermaid's comb?", npc, creature) npcHandler:setTopic(playerId, 3) end @@ -86,8 +76,11 @@ local function creatureSayCallback(npc, creature, type, message) }, npc, creature) npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 2 then - player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) - player:setStorageValue(Storage.OutfitQuest.firstOrientalAddon, 1) + if player:getStorageValue(Storage.OutfitQuest.DefaultStart) ~= 1 then + player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) + end + player:setStorageValue(Storage.Quest.U7_8.OrientalOutfits.FirstOrientalAddon, 1) + player:setStorageValue(Storage.Quest.U7_8.OrientalOutfits.OrientalDoor, 1) npcHandler:say("Yay! I will wait for you to return with a mermaid's comb then.", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then @@ -97,9 +90,8 @@ local function creatureSayCallback(npc, creature, type, message) return true end - player:setStorageValue(Storage.OutfitQuest.firstOrientalAddon, 2) - player:addOutfitAddon(150, 1) - player:addOutfitAddon(146, 1) + player:setStorageValue(Storage.Quest.U7_8.OrientalOutfits.FirstOrientalAddon, 2) + player:addOutfitAddon(150, 1) -- female addon player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) npcHandler:say("Yeah! That's it! I can't wait to comb my hair! Oh - but first, I'll fulfil my promise: Here is your jewelled belt! Thanks again!", npc, creature) npcHandler:setTopic(playerId, 0) diff --git a/data-otservbr-global/npc/isimov.lua b/data-otservbr-global/npc/isimov.lua index ef229591e53..7e7d57061c7 100644 --- a/data-otservbr-global/npc/isimov.lua +++ b/data-otservbr-global/npc/isimov.lua @@ -89,23 +89,23 @@ stoneKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, t -- Wooden Stake keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "I think you have forgotten to bring your stake, kid." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 5 and player:getItemCount(5941) == 0 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 5 and player:getItemCount(5941) == 0 end) local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Yes, I was informed what to do. Are you prepared to receive my line of the prayer?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 5 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 5 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "So receive my prayer: 'Unclean spirits shall be repelled'. Now, bring your stake to Amanda in Edron for the next line of the prayer. I will inform her what to do.", reset = true }, nil, function(player) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 6) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 6) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end) stakeKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "I will wait for you.", reset = true }) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You should visit Amanda in Edron now, kid." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 6 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 6 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You already received my line of the prayer." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) > 6 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) > 6 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "A blessed stake? That's a strange request. Maybe Quentin knows more, he is one of the oldest monks after all." }) diff --git a/data-otservbr-global/npc/jack_fate.lua b/data-otservbr-global/npc/jack_fate.lua index aba111bbeea..5a98b0eb288 100644 --- a/data-otservbr-global/npc/jack_fate.lua +++ b/data-otservbr-global/npc/jack_fate.lua @@ -64,7 +64,7 @@ local function addTravelKeyword(keyword, cost, destination, text, condition) if keyword == "goroma" then keywordHandler:addKeyword({ keyword }, StdModule.say, { npcHandler = npcHandler, text = "Never heard about a place like this." }, function(player) - return player:getStorageValue(Storage.TheShatteredIsles.AccessToGoroma) ~= 1 + return player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.AccessToGoroma) ~= 1 end) end diff --git a/data-otservbr-global/npc/jack_fate_goroma.lua b/data-otservbr-global/npc/jack_fate_goroma.lua index 5a98b1651e9..44c7931c76a 100644 --- a/data-otservbr-global/npc/jack_fate_goroma.lua +++ b/data-otservbr-global/npc/jack_fate_goroma.lua @@ -63,11 +63,11 @@ local function creatureSayCallback(npc, creature, type, message) end if table.contains({ "sail", "passage", "wreck", "liberty bay", "ship" }, message) then - if player:getStorageValue(Storage.TheShatteredIsles.AccessToGoroma) ~= 1 then - if player:getStorageValue(Storage.TheShatteredIsles.Shipwrecked) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.AccessToGoroma) ~= 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.Shipwrecked) < 1 then npcHandler:say("I'd love to bring you back to Liberty Bay, but as you can see, my ship is ruined. I also hurt my leg and can barely move. Can you help me?", npc, creature) npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.TheShatteredIsles.Shipwrecked) == 1 then + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.Shipwrecked) == 1 then npcHandler:say("Have you brought 30 pieces of wood so that I can repair the ship?", npc, creature) npcHandler:setTopic(playerId, 3) end @@ -85,14 +85,14 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 2 then npcHandler:say("Good! Please return once you have gathered 30 pieces of wood.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.DefaultStart, 1) - player:setStorageValue(Storage.TheShatteredIsles.Shipwrecked, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.DefaultStart, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.Shipwrecked, 1) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then if player:removeItem(5901, 30) then npcHandler:say("Excellent! Now we can leave this godforsaken place. Thank you for your help. Should you ever want to return to this island, ask me for a passage to Goroma.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.Shipwrecked, 2) - player:setStorageValue(Storage.TheShatteredIsles.AccessToGoroma, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.Shipwrecked, 2) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.AccessToGoroma, 1) npcHandler:setTopic(playerId, 0) else npcHandler:say("You don't have enough...", npc, creature) diff --git a/data-otservbr-global/npc/karl.lua b/data-otservbr-global/npc/karl.lua index 92d6ca95128..fc8e3945afd 100644 --- a/data-otservbr-global/npc/karl.lua +++ b/data-otservbr-global/npc/karl.lua @@ -64,7 +64,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 1) end elseif MsgContains(message, "whisper beer") then - if player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 11 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 4 then npcHandler:say("Do you want to buy a bottle of our finest whisper beer for 80 gold?", npc, creature) npcHandler:setTopic(playerId, 2) end @@ -78,10 +78,10 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 2 then - if player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 11 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 4 then if player:removeMoneyBank(80) then npcHandler:say("Here. Don't take it into the city though.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 12) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 5) player:addItem(6106, 1) npcHandler:setTopic(playerId, 0) else diff --git a/data-otservbr-global/npc/kasmir.lua b/data-otservbr-global/npc/kasmir.lua index 6468a40c094..b08d52c09a9 100644 --- a/data-otservbr-global/npc/kasmir.lua +++ b/data-otservbr-global/npc/kasmir.lua @@ -90,23 +90,23 @@ stoneKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, t -- Wooden Stake keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "I think you have forgotten to bring your stake, pilgrim." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 7 and player:getItemCount(5941) == 0 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 7 and player:getItemCount(5941) == 0 end) local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Yes, I was informed what to do. Are you prepared to receive my line of the prayer?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 7 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 7 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "So receive my prayer: 'Let there be honour and humility'. Now, bring your stake to Rahkem in Ankrahmun for the next line of the prayer. I will inform him what to do.", reset = true }, nil, function(player) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 8) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 8) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end) stakeKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "I will wait for you.", reset = true }) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You should visit Rahkem in Ankrahmun now, pilgrim." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 8 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 8 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You already received my line of the prayer." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) > 8 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) > 8 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "A blessed stake? That is a strange request. Maybe Quentin knows more, he is one of the oldest monks after all." }) diff --git a/data-otservbr-global/npc/kazzan.lua b/data-otservbr-global/npc/kazzan.lua index f137e73f43e..b20352dd1d7 100644 --- a/data-otservbr-global/npc/kazzan.lua +++ b/data-otservbr-global/npc/kazzan.lua @@ -65,7 +65,7 @@ local function creatureSayCallback(npc, creature, type, message) -- Pegando a quest if MsgContains(message, "mission") and player:getStorageValue(Storage.TibiaTales.ToAppeaseTheMightyQuest) < 1 then - if player:getStorageValue(Storage.DjinnWar.Faction.MaridDoor) < 1 and player:getStorageValue(Storage.DjinnWar.Faction.EfreetDoor) < 1 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.MaridDoor) < 1 and player:getStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.EfreetDoor) < 1 then npcHandler:say({ "Do you know the location of the djinn fortresses in the mountains south of here?", }, npc, creature) diff --git a/data-otservbr-global/npc/klaus.lua b/data-otservbr-global/npc/klaus.lua index 5c5dc19e0a8..dbdba8833af 100644 --- a/data-otservbr-global/npc/klaus.lua +++ b/data-otservbr-global/npc/klaus.lua @@ -58,23 +58,19 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "mission") then - if player:getStorageValue(Storage.TheShatteredIsles.RaysMission4) == 1 then - npcHandler:say( - "Hmm, you look like a seasoned seadog. Kill Captain Ray Striker, \ - bring me his lucky pillow as a proof and you are our hero!", - creature - ) - player:setStorageValue(Storage.TheShatteredIsles.RaysMission4, 2) - elseif player:getStorageValue(Storage.TheShatteredIsles.RaysMission4) == 3 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission4) == 1 then + npcHandler:say("Hmm, you look like a seasoned seadog. Kill Captain Ray Striker, bring me his lucky pillow as a proof and you are our hero!", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission4, 2) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission4) == 3 then npcHandler:say("Do you have Striker's pillow?", npc, creature) npcHandler:setTopic(playerId, 1) end elseif MsgContains(message, "yes") then - if player:getStorageValue(Storage.TheShatteredIsles.RaysMission4) == 3 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission4) == 3 then if npcHandler:getTopic(playerId) == 1 then if player:removeItem(6105, 1) then npcHandler:say("You DID it!!! Incredible! Boys, lets have a PAAAAAARTY!!!!", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.RaysMission4, 4) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission4, 4) npcHandler:setTopic(playerId, 0) else npcHandler:say("Come back when you have his lucky pillow.", npc, creature) @@ -86,6 +82,9 @@ local function creatureSayCallback(npc, creature, type, message) return true end +npcHandler:setMessage(MESSAGE_GREET, "Ho matey.") +npcHandler:setMessage(MESSAGE_FAREWELL, "Whenever your throat is dry, you know where to find my tavern.") + npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) diff --git a/data-otservbr-global/npc/kroox.lua b/data-otservbr-global/npc/kroox.lua index 6f237ad1d87..c8adea58c72 100644 --- a/data-otservbr-global/npc/kroox.lua +++ b/data-otservbr-global/npc/kroox.lua @@ -58,13 +58,13 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "sam sent me") or MsgContains(message, "sam send me") then - if player:getStorageValue(Storage.SamsOldBackpack) == 1 then + if player:getStorageValue(Storage.Quest.U7_5.SamsOldBackpack.SamsOldBackpackNpc) == 1 then npcHandler:say({ "Oh, so its you, he wrote me about? Sadly I have no dwarven armor in stock. But I give you the permission to retrive one from the mines. ...", "The problem is, some giant spiders made the tunnels where the storage is their new home. Good luck.", }, npc, creature) - player:setStorageValue(Storage.SamsOldBackpack, 2) - player:setStorageValue(Storage.SamsOldBackpackDoor, 1) + player:setStorageValue(Storage.Quest.U7_5.SamsOldBackpack.SamsOldBackpackNpc, 2) + player:setStorageValue(Storage.Quest.U7_5.SamsOldBackpack.SamsOldBackpackDoor, 1) end elseif message == "lokurs measurements" then if player:getStorageValue(Storage.Postman.Mission07) >= 7 and player:getStorageValue(Storage.Postman.MeasurementsKroox) ~= 1 then @@ -79,6 +79,7 @@ local function creatureSayCallback(npc, creature, type, message) return true end +npcHandler:setMessage(MESSAGE_GREET, "Welcome to Kroox Quality Armor, |PLAYERNAME|! Wanna take a look, ask me for a trade.") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) diff --git a/data-otservbr-global/npc/legola.lua b/data-otservbr-global/npc/legola.lua index ca2eafc3ac1..6aecaad5daf 100644 --- a/data-otservbr-global/npc/legola.lua +++ b/data-otservbr-global/npc/legola.lua @@ -88,7 +88,7 @@ addGloveKeyword({ "Maybe another time.", "Alright! Here is your money, thank you very much.", }, function(player) - return player:getStorageValue(Storage.OutfitQuest.Hunter.AddonGlove) == 1 + return player:getStorageValue(Storage.Quest.U7_8.HunterOutfits.Hunter.AddonGlove) == 1 end, function(player) player:removeItem(5875, 1) player:addMoney(2000) @@ -100,10 +100,10 @@ addGloveKeyword({ "No problem, maybe another time.", "Great! I hereby grant you the right to wear the sniper gloves as an accessory. Congratulations!", }, function(player) - return player:getStorageValue(Storage.OutfitQuest.Hunter.AddonGlove) == -1 + return player:getStorageValue(Storage.Quest.U7_8.HunterOutfits.Hunter.AddonGlove) == -1 end, function(player) player:removeItem(5875, 1) - player:setStorageValue(Storage.OutfitQuest.Hunter.AddonGlove, 1) + player:setStorageValue(Storage.Quest.U7_8.HunterOutfits.Hunter.AddonGlove, 1) player:addOutfitAddon(129, 2) player:addOutfitAddon(137, 1) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) diff --git a/data-otservbr-global/npc/lubo.lua b/data-otservbr-global/npc/lubo.lua index 97aea1169da..2c1d7ab661b 100644 --- a/data-otservbr-global/npc/lubo.lua +++ b/data-otservbr-global/npc/lubo.lua @@ -65,7 +65,7 @@ local function creatureSayCallback(npc, creature, type, message) end -- Citizen outfit addon - local addonProgress = player:getStorageValue(Storage.OutfitQuest.Citizen.AddonBackpack) + local addonProgress = player:getStorageValue(Storage.Quest.U7_8.CitizenOutfits.AddonBackpack) if MsgContains(message, "addon") or MsgContains(message, "outfit") or (addonProgress == 1 and MsgContains(message, "leather")) or ((addonProgress == 1 or addonProgress == 2) and MsgContains(message, "backpack")) then if addonProgress < 1 then npcHandler:say("Sorry, the backpack I wear is not for sale. It's handmade from rare minotaur leather.", npc, creature) @@ -74,13 +74,11 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Ah, right, almost forgot about the backpack! Have you brought me 100 pieces of minotaur leather as requested?", npc, creature) npcHandler:setTopic(playerId, 3) elseif addonProgress == 2 then - if player:getStorageValue(Storage.OutfitQuest.Citizen.AddonBackpackTimer) < os.time() then + if player:getStorageValue(Storage.Quest.U7_8.CitizenOutfits.AddonBackpackTimer) < os.time() then npcHandler:say("Just in time! Your backpack is finished. Here you go, I hope you like it.", npc, creature) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - player:setStorageValue(Storage.OutfitQuest.Ref, math.min(0, player:getStorageValue(Storage.OutfitQuest.Ref) - 1)) - player:setStorageValue(Storage.OutfitQuest.Citizen.MissionBackpack, 0) - player:setStorageValue(Storage.OutfitQuest.Citizen.AddonBackpack, 3) - + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfits.MissionBackpack, 0) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfits.AddonBackpack, 3) player:addOutfitAddon(136, 1) player:addOutfitAddon(128, 1) else @@ -98,9 +96,8 @@ local function creatureSayCallback(npc, creature, type, message) end elseif npcHandler:getTopic(playerId) == 2 then if MsgContains(message, "yes") then - player:setStorageValue(Storage.OutfitQuest.Ref, math.max(0, player:getStorageValue(Storage.OutfitQuest.Ref)) + 1) - player:setStorageValue(Storage.OutfitQuest.Citizen.AddonBackpack, 1) - player:setStorageValue(Storage.OutfitQuest.Citizen.MissionBackpack, 1) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfits.AddonBackpack, 1) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfits.MissionBackpack, 1) npcHandler:say("Alright then, if you bring me 100 pieces of fine minotaur leather I will see what I can do for you. You probably have to kill really many minotaurs though... so good luck!", npc, creature) npcHandler:removeInteraction(npc, creature) else @@ -116,9 +113,9 @@ local function creatureSayCallback(npc, creature, type, message) player:removeItem(5878, 100) - player:setStorageValue(Storage.OutfitQuest.Citizen.MissionBackpack, 2) - player:setStorageValue(Storage.OutfitQuest.Citizen.AddonBackpack, 2) - player:setStorageValue(Storage.OutfitQuest.Citizen.AddonBackpackTimer, os.time() + 2 * 60 * 60) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfits.MissionBackpack, 2) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfits.AddonBackpack, 2) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfits.AddonBackpackTimer, os.time() + 2 * 60 * 60) end else npcHandler:say("I know, it's quite some work... don't lose heart, just keep killing minotaurs and you'll eventually get lucky. Would you rather like to buy a normal backpack for 10 gold?", npc, creature) diff --git a/data-otservbr-global/npc/lugri.lua b/data-otservbr-global/npc/lugri.lua index 001cadc9b14..d1a313b2d75 100644 --- a/data-otservbr-global/npc/lugri.lua +++ b/data-otservbr-global/npc/lugri.lua @@ -59,27 +59,27 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "outfit") or MsgContains(message, "addon") then - if player:getStorageValue(Storage.OutfitQuest.WizardAddon) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.WizardOutfits) < 1 then npcHandler:say("This skull shows that you are a true follower of Zathroth and the glorious gods of darkness. Are you willing to prove your loyalty?", npc, creature) npcHandler:setTopic(playerId, 1) end elseif MsgContains(message, "shield") or MsgContains(message, "medusa shield") then - if player:getStorageValue(Storage.OutfitQuest.WizardAddon) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.WizardOutfits) == 1 then npcHandler:say("Is it your true wish to sacrifice a medusa shield to Zathroth?", npc, creature) npcHandler:setTopic(playerId, 3) end elseif MsgContains(message, "mail") or MsgContains(message, "dragon scale mail") then - if player:getStorageValue(Storage.OutfitQuest.WizardAddon) == 2 then + if player:getStorageValue(Storage.Quest.U7_8.WizardOutfits) == 2 then npcHandler:say("Is it your true wish to sacrifice a dragon scale mail to Zathroth?", npc, creature) npcHandler:setTopic(playerId, 4) end elseif MsgContains(message, "legs") or MsgContains(message, "crown legs") then - if player:getStorageValue(Storage.OutfitQuest.WizardAddon) == 3 then + if player:getStorageValue(Storage.Quest.U7_8.WizardOutfits) == 3 then npcHandler:say("Is it your true wish to sacrifice crown legs to Zathroth?", npc, creature) npcHandler:setTopic(playerId, 5) end elseif MsgContains(message, "ring") or MsgContains(message, "ring of the sky") then - if player:getStorageValue(Storage.OutfitQuest.WizardAddon) == 4 then + if player:getStorageValue(Storage.Quest.U7_8.WizardOutfits) == 4 then npcHandler:say("Is it your true wish to sacrifice a ring of the sky to Zathroth?", npc, creature) npcHandler:setTopic(playerId, 6) end @@ -129,13 +129,13 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 2 then npcHandler:say("Good decision, |PLAYERNAME|. Your first sacrifice will be a medusa shield. Bring it to me and do give it happily.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.WizardAddon, 1) + player:setStorageValue(Storage.Quest.U7_8.WizardOutfits, 1) player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) --this for default start of Outfit and Addon Quests npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then if player:removeItem(3436, 1) then npcHandler:say("Good. I accept your sacrifice. The second sacrifice I require from you is a dragon scale mail. Bring it to me and do give it happily.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.WizardAddon, 2) + player:setStorageValue(Storage.Quest.U7_8.WizardOutfits, 2) npcHandler:setTopic(playerId, 0) else npcHandler:say("You don't have it...", npc, creature) @@ -143,7 +143,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 4 then if player:removeItem(3386, 1) then npcHandler:say("Good. I accept your sacrifice. The third sacrifice I require from you are crown legs. Bring them to me and do give them happily.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.WizardAddon, 3) + player:setStorageValue(Storage.Quest.U7_8.WizardOutfits, 3) npcHandler:setTopic(playerId, 0) else npcHandler:say("You don't have it...", npc, creature) @@ -151,7 +151,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 5 then if player:removeItem(3382, 1) then npcHandler:say("Good. I accept your sacrifice. The last sacrifice I require from you is a ring of the sky. Bring it to me and do give it happily.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.WizardAddon, 4) + player:setStorageValue(Storage.Quest.U7_8.WizardOutfits, 4) npcHandler:setTopic(playerId, 0) else npcHandler:say("You don't have it...", npc, creature) @@ -159,7 +159,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 6 then if player:removeItem(3006, 1) then npcHandler:say("Good. I accept your sacrifice. You have proven that you are a true follower of Zathroth and do not hesitate to sacrifice worldly goods. Thus, I will reward you with this headgear. ", npc, creature) - player:setStorageValue(Storage.OutfitQuest.WizardAddon, 5) + player:setStorageValue(Storage.Quest.U7_8.WizardOutfits, 5) player:addOutfitAddon(145, 2) player:addOutfitAddon(149, 2) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) diff --git a/data-otservbr-global/npc/lurik.lua b/data-otservbr-global/npc/lurik.lua index b9ea973f6ed..14119ba0d72 100644 --- a/data-otservbr-global/npc/lurik.lua +++ b/data-otservbr-global/npc/lurik.lua @@ -59,22 +59,22 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "mission") then - if player:getStorageValue(Storage.ExplorerSociety.TheAstralPortals) == 56 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 56 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheAstralPortals) == 56 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 56 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIslandofDragons) == 57 then --will need review in the future npcHandler:say("Ah, you've just come in time. An experienced explorer is just what we need here! Would you like to go on a mission for us?", npc, creature) npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.ExplorerSociety.TheIslandofDragons) == 58 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 58 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIslandofDragons) == 58 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 58 then if player:removeItem(7314, 1) then npcHandler:say({ "A frozen dragon lord? This is just the information we needed! And you even brought a scale from it! Take these 5000 gold pieces as a reward. ...", "As you did such a great job, I might have another mission for you later.", }, npc, creature) player:addItem(3035, 50) - player:setStorageValue(Storage.ExplorerSociety.TheIslandofDragons, 59) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 59) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIslandofDragons, 59) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 59) else npcHandler:say("You're not done yet...", npc, creature) end - elseif player:getStorageValue(Storage.ExplorerSociety.TheIslandofDragons) == 59 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 59 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIslandofDragons) == 59 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 59 then npcHandler:say({ "Ah, yes, the mission. Let me tell you about something called ice music. ...", "There is a cave on Hrodmir, north of the southernmost barbarian camp Krimhorn. ...", @@ -82,19 +82,19 @@ local function creatureSayCallback(npc, creature, type, message) "When the wind blows into this cave and hits the stalagmites, it is supposed to create a sound similar to a soft song. ...", "Please take this resonance crystal and use it on the stalagmites in the cave to record the sound of the wind.", }, npc, creature) - player:setStorageValue(Storage.ExplorerSociety.TheIceMusic, 60) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 60) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceMusic, 60) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 60) player:addItem(7242, 1) - elseif player:getStorageValue(Storage.ExplorerSociety.TheIceMusic) == 61 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 61 and player:removeItem(7315, 1) then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceMusic) == 61 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 61 and player:removeItem(7315, 1) then npcHandler:say({ "Ah! You did it! I can't wait to hear the sound... but I will do that in a silent moment. ...", "You helped as much in our research here. As a reward, you may use our astral portal in the upper room from now on. ...", "For just one orichalcum pearl, you can travel between Liberty Bay and Svargrond. Thank you again!", }, npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.ExplorerSociety.TheIceMusic, 62) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 62) - player:setStorageValue(Storage.ExplorerSociety.IceMusicDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceMusic, 62) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 62) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.IceMusicDoor, 1) elseif player:getStorageValue(Storage.TheIceIslands.Questline) == 32 then npcHandler:say({ "You are the one who became an honorary barbarian! The one who made friends with the grim local musher and helped the shamans of Nibelor! The one they call old bearhugg ... erm ... I mean indeed I might have a mission for someone like you ...", @@ -128,8 +128,8 @@ local function creatureSayCallback(npc, creature, type, message) "Travel to Okolnir and try to find a proof for the existence of dragon lords there in the old times. I think old Buddel might be able to bring you there.", }, npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.ExplorerSociety.TheIslandofDragons, 57) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 57) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIslandofDragons, 57) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 57) -- ISLAND OF DRAGONS elseif npcHandler:getTopic(playerId) == 2 then npcHandler:say("Excellent. Just report about your mission when you got the memory crystal.", npc, creature) diff --git a/data-otservbr-global/npc/lynda.lua b/data-otservbr-global/npc/lynda.lua index 82a8cf8cc7d..06122163084 100644 --- a/data-otservbr-global/npc/lynda.lua +++ b/data-otservbr-global/npc/lynda.lua @@ -59,7 +59,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "angelina") then - if player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand) == 1 then npcHandler:say({ "Angelina had been imprisoned? My, these are horrible news, but I am so glad to hear that she is safe now. ...", "I will happily carry out her wish and reward you, but I fear I need some important ingredients for my blessing spell first. ...", @@ -68,31 +68,31 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 1) end elseif MsgContains(message, "wand") or MsgContains(message, "rod") then - if player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand) == 2 then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand) == 2 then npcHandler:say("Did you bring a sample of each wand and each rod with you?", npc, creature) npcHandler:setTopic(playerId, 3) end elseif MsgContains(message, "sulphur") then - if player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand) == 3 then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand) == 3 then npcHandler:say("Did you obtain 10 ounces of magic sulphur?", npc, creature) npcHandler:setTopic(playerId, 4) end elseif MsgContains(message, "soul stone") then - if player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand) == 4 then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand) == 4 then npcHandler:say("Were you actually able to retrieve the Necromancer's soul stone?", npc, creature) npcHandler:setTopic(playerId, 5) end elseif MsgContains(message, "ankh") then - if player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand) == 5 then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand) == 5 then npcHandler:say("Am I sensing enough holy energy from ankhs here?", npc, creature) npcHandler:setTopic(playerId, 6) end elseif MsgContains(message, "ritual") then - if player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand) == 6 then - if player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonWandTimer) < os.time() then - player:setStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand, 7) - player:addOutfitAddon(141, 1) - player:addOutfitAddon(130, 1) + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand) == 6 then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWandTimer) < os.time() then + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand, 7) + player:addOutfitAddon(138, 1) --female mage addon + player:addOutfitAddon(141, 1) --female summoner addon player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) npcHandler:say("I'm glad to tell you that I have finished the ritual, player. Here is your new wand. I hope you carry it proudly for everyone to see..", npc, creature) npcHandler:setTopic(playerId, 0) @@ -114,7 +114,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 2 then npcHandler:say("Alright then. Come back to with a sample of all five wands and five rods, please.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand, 2) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand, 2) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then if player:getItemCount(3065) > 0 and player:getItemCount(3066) > 0 and player:getItemCount(3067) > 0 and player:getItemCount(3069) > 0 and player:getItemCount(3070) > 0 and player:getItemCount(3071) > 0 and player:getItemCount(3072) > 0 and player:getItemCount(3073) > 0 and player:getItemCount(3074) > 0 and player:getItemCount(3075) > 0 then @@ -129,26 +129,26 @@ local function creatureSayCallback(npc, creature, type, message) player:removeItem(3073, 1) player:removeItem(3074, 1) player:removeItem(3075, 1) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand, 3) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand, 3) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 4 then if player:removeItem(5904, 10) then npcHandler:say("Very good. I will immediately start to prepare the ritual and extract the elemental energy from the wands and rods. Please bring me the Necromancer's soul stone now.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand, 4) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand, 4) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 5 then if player:removeItem(5809, 1) then npcHandler:say("You have found a rarity there, |PLAYERNAME|. This will become the tip of your blessed wand. Please bring me 20 ankhs now to complete the ritual.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand, 5) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand, 5) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 6 then if player:removeItem(3077, 20) then npcHandler:say("The ingredients for the ritual are complete! I will start to prepare your blessed wand, but I have to medidate first. Please come back later to hear how the ritual went.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.AddonWand, 6) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.AddonWandTimer, os.time() + 10800) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWand, 6) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonWandTimer, os.time() + 10800) npcHandler:setTopic(playerId, 0) end end diff --git a/data-otservbr-global/npc/maealil.lua b/data-otservbr-global/npc/maealil.lua index eaa103366b1..f53dfd767a8 100644 --- a/data-otservbr-global/npc/maealil.lua +++ b/data-otservbr-global/npc/maealil.lua @@ -85,23 +85,23 @@ stoneKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, t -- Wooden Stake keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "I think you have forgotten to bring your stake." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 3 and player:getItemCount(5941) == 0 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 3 and player:getItemCount(5941) == 0 end) local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Yes, I was informed what to do. Are you prepared to receive my line of the prayer?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 3 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 3 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "So receive my prayer: 'Peace may fill your soul - evil shall be cleansed'. Now, bring your stake to Yberius in the Venore temple for the next line of the prayer. I will inform him what to do.", reset = true }, nil, function(player) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 4) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 4) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end) stakeKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "I will wait for you.", reset = true }) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You should visit Yberius in the Venore temple now." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 4 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 4 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You already received my line of the prayer." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) > 4 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) > 4 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "A blessed stake? That is a strange request. Maybe Quentin knows more, he is one of the oldest monks after all." }) diff --git a/data-otservbr-global/npc/malor.lua b/data-otservbr-global/npc/malor.lua index b4a1f630d6a..646bb32205d 100644 --- a/data-otservbr-global/npc/malor.lua +++ b/data-otservbr-global/npc/malor.lua @@ -54,6 +54,37 @@ local function releasePlayer(npc, creature) npcHandler:resetNpc(creature) end +local function endConversationWithDelay(npcHandler, npc, creature) + addEvent(function() + npcHandler:unGreet(npc, creature) + end, 1000) +end + +local function greetCallback(npc, creature, message) + local player = Player(creature) + local playerId = player:getId() + + if not MsgContains(message, "djanni'hah") then + npcHandler:say("Shove off, little one! Humans are not welcome here, |PLAYERNAME|!", npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Start) == 1 then + npcHandler:say({ + "Hahahaha! ...", + "|PLAYERNAME|, that almost sounded like the word of greeting. Humans - cute they are!", + }, npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + npcHandler:say("Greetings, human |PLAYERNAME|. My patience with your kind is limited, so speak quickly and choose your words well.", npc, creature) + npcHandler:setInteraction(npc, creature) + + return true +end + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -62,9 +93,9 @@ local function creatureSayCallback(npc, creature, type, message) return false end - local missionProgress = player:getStorageValue(Storage.DjinnWar.EfreetFaction.Mission03) + local missionProgress = player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission03) if MsgContains(message, "mission") then - if player:getStorageValue(Storage.DjinnWar.EfreetFaction.Mission02) == 3 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission02) == 3 then if missionProgress < 1 then npcHandler:say({ "I guess this is the first time I entrust a human with a mission. And such an important mission, too. But well, we live in hard times, and I am a bit short of adequate staff. ...", @@ -96,7 +127,7 @@ local function creatureSayCallback(npc, creature, type, message) "Once you have found the lamp you must enter Ashta'daramai again. Sneak into Gabel's personal chambers and exchange his sleeping lamp with Fa'hradin's lamp! ...", "If you succeed, the war could be over one night later!", }, npc, creature) - player:setStorageValue(Storage.DjinnWar.EfreetFaction.Mission03, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission03, 1) elseif MsgContains(message, "no") then npcHandler:say("Your choice.", npc, creature) npcHandler:setTopic(playerId, 0) @@ -111,8 +142,8 @@ local function creatureSayCallback(npc, creature, type, message) "But that's in the future. For now, I will confine myself to give you the permission to trade with my people whenever you want to. ...", "Farewell, human!", }, npc, creature) - player:setStorageValue(Storage.DjinnWar.EfreetFaction.Mission03, 3) - player:setStorageValue(Storage.DjinnWar.EfreetFaction.DoorToMaridTerritory, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission03, 3) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.DoorToMaridTerritory, 1) player:addAchievement("Efreet Ally") addEvent(function() releasePlayer(npc, creature) @@ -121,7 +152,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Just do it!", npc, creature) end npcHandler:setTopic(playerId, 0) - elseif MsgContains(message, "task") and player:getStorageValue(Storage.DjinnWar.EfreetFaction.Mission03) == 3 then + elseif MsgContains(message, "task") and player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission03) == 3 then if player:getStorageValue(Storage.KillingInTheNameOf.BlueDjinnTask) < 0 or player:getStorageValue(Storage.KillingInTheNameOf.BlueDjinnTask) == 3 then npcHandler:say("There are still blue djinns everywhere! We can't let a single one of them live. I guess a start would be for you to kill 500 blue djinns and Marid. Will you assist us?", npc, creature) npcHandler:setTopic(playerId, 3) @@ -157,8 +188,7 @@ local function creatureSayCallback(npc, creature, type, message) return true end --- Greeting -keywordHandler:addGreetKeyword({ "djanni'hah" }, { npcHandler = npcHandler, text = "Greetings, human |PLAYERNAME|. My patience with your kind is limited, so speak quickly and choose your words well." }) +keywordHandler:addCustomGreetKeyword({ "djanni'hah" }, greetCallback, { npcHandler = npcHandler }) npcHandler:setMessage(MESSAGE_FAREWELL, "Farewell, human. When I have taken my rightful place I shall remember those who served me well. Even if they are only humans.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Farewell, human.") diff --git a/data-otservbr-global/npc/marina.lua b/data-otservbr-global/npc/marina.lua index 5bcdebf2804..bb71e1860d2 100644 --- a/data-otservbr-global/npc/marina.lua +++ b/data-otservbr-global/npc/marina.lua @@ -54,37 +54,37 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "silk") or MsgContains(message, "yarn") or MsgContains(message, "silk yarn") or MsgContains(message, "spool of yarn") then - if player:getStorageValue(Storage.FriendsandTraders.TheMermaidMarina) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheMermaidMarina) < 1 then npcHandler:say("Um. You mean, you really want me to touch that gooey spider silk just because you need yarn? Well... do you think that I'm pretty?", npc, creature) npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.FriendsandTraders.TheMermaidMarina) == 2 then + elseif player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheMermaidMarina) == 2 then npcHandler:say("Okay... a deal is a deal, would you like me to create a {spool of yarn} from {10 pieces of spider silk}?", npc, creature) npcHandler:setTopic(playerId, 5) end elseif MsgContains(message, "honey") or MsgContains(message, "honeycomb") or MsgContains(message, "50 honeycombs") then - if player:getStorageValue(Storage.FriendsandTraders.TheMermaidMarina) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheMermaidMarina) == 1 then npcHandler:say("Did you bring me the 50 honeycombs I requested and do you absolutely admire my beauty?", npc, creature) npcHandler:setTopic(playerId, 4) end elseif MsgContains(message, "raymond striker") then - if player:getStorageValue(Storage.TheShatteredIsles.APoemForTheMermaid) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.APoemForTheMermaid) == 1 then npcHandler:say(" I think he has a crush on me. Well, silly man, it is only for his own good. This way he can get accustomed to TRUE beauty. And I won't give him up anymore now that he is mine.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.APoemForTheMermaid, 2) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.APoemForTheMermaid, 2) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "date") then - if player:getStorageValue(Storage.TheShatteredIsles.ADjinnInLove) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ADjinnInLove) == 1 then npcHandler:say("Is that the best you can do? A true Djinn would have done something more poetic.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.ADjinnInLove, 2) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ADjinnInLove, 2) npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.TheShatteredIsles.ADjinnInLove) == 4 then + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ADjinnInLove) == 4 then npcHandler:say({ "This lovely, exotic Djinn is a true poet. And he is asking me for a date? Excellent. Now I can finaly dump this human pirate. He was growing to be boring more and more with each day ...", "As a little reward for your efforts I allow you to ride my sea turtles. Just look around at the shores and you will find them.", }, npc, creature) player:addAchievement("Matchmaker") - player:setStorageValue(Storage.TheShatteredIsles.ADjinnInLove, 5) - player:setStorageValue(Storage.TheShatteredIsles.AccessToLagunaIsland, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ADjinnInLove, 5) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.AccessToLagunaIsland, 1) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "yes") then @@ -97,13 +97,16 @@ local function creatureSayCallback(npc, creature, type, message) "You want me to touch something gooey, so you have to touch something gooey for me too. ...", "I love honey and I haven't eaten it in a while, so bring me 50 honeycombs and worship my beauty a little more, then we will see.", }, npc, creature) - player:setStorageValue(Storage.FriendsandTraders.TheMermaidMarina, 1) - player:setStorageValue(Storage.FriendsandTraders.DefaultStart, 1) + if player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.DefaultStart) ~= 1 then + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.DefaultStart, 1) + end + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheMermaidMarina, 1) + npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 4 then if player:removeItem(5902, 50) then npcHandler:say("Oh goodie! Thank you! Okay... I guess since my fingers are sticky now anyway, I will help you. From now on, if you bring me {10 pieces of spider silk}, I will create one {spool of yarn}.", npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.FriendsandTraders.TheMermaidMarina, 2) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheMermaidMarina, 2) else npcHandler:say("You don't have enough honey.", npc, creature) npcHandler:setTopic(playerId, 0) @@ -122,7 +125,8 @@ local function creatureSayCallback(npc, creature, type, message) return true end -keywordHandler:addKeyword({ "comb" }, StdModule.say, { npcHandler = npcHandler, text = "Sorry, I don't have a spare comb. I lost my favourite one when diving around in Calassa." }) +npcHandler:setMessage(MESSAGE_GREET, "Oh, hello |PLAYERNAME|. A visitor, how nice!") + keywordHandler:addKeyword({ "mermaid comb" }, StdModule.say, { npcHandler = npcHandler, text = "Sorry, I don't have a spare comb. I lost my favourite one when diving around in Calassa." }) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) diff --git a/data-otservbr-global/npc/maryza.lua b/data-otservbr-global/npc/maryza.lua index 44901801fc4..bf061a2fe2f 100644 --- a/data-otservbr-global/npc/maryza.lua +++ b/data-otservbr-global/npc/maryza.lua @@ -49,6 +49,27 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local function endConversationWithDelay(npcHandler, npc, creature) + addEvent(function() + npcHandler:unGreet(npc, creature) + end, 1000) +end + +local function greetCallback(npc, creature, message) + local player = Player(creature) + local playerId = player:getId() + + if not MsgContains(message, "hi maryza") then + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + npcHandler:say("Welcome to the Jolly Axeman, |PLAYERNAME|. Have a good time and eat some food!", npc, creature) + npcHandler:setInteraction(npc, creature) + + return true +end + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -81,13 +102,13 @@ local function creatureSayCallback(npc, creature, type, message) return true end --- Greeting message -keywordHandler:addGreetKeyword({ "maryza" }, { npcHandler = npcHandler, text = "Welcome to the Jolly Axeman, |PLAYERNAME|. Have a good time and eat some food!" }) +-- Greeting +keywordHandler:addCustomGreetKeyword({ "hi maryza" }, greetCallback, { npcHandler = npcHandler }) -npcHandler:setMessage(MESSAGE_GREET, "Welcome to the Jolly Axeman, |PLAYERNAME|. Have a good time and eat some food!") npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye!") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) +npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) npcConfig.shop = { diff --git a/data-otservbr-global/npc/melchior.lua b/data-otservbr-global/npc/melchior.lua index ba4713a9e7f..2f9fe787523 100644 --- a/data-otservbr-global/npc/melchior.lua +++ b/data-otservbr-global/npc/melchior.lua @@ -64,8 +64,8 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "greeting") then - if player:getStorageValue(Storage.DjinnWar.Faction.Greeting) ~= 0 then + if MsgContains(message, "word of greeting") then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.Greeting) ~= 0 then npcHandler:say({ "The djinns have an ancient code of honour. This code includes a special concept of hospitality. Anybody who utters the word of greeting must not be attacked even if he is an enemy. Well, at least that is what the code says. ...", "I have found out, though, that this does not work at all times. There is no point to say the word of greeting to an enraged djinn. ...", @@ -73,10 +73,10 @@ local function creatureSayCallback(npc, creature, type, message) "And keep in mind that you must choose sides in this conflict. You can only follow the Efreet or the Marid - once you have made your choice there is no way back. I know from experience that djinn do not tolerate double-crossing.", }, npc, creature) - if player:getStorageValue(Storage.Factions) ~= 1 then - player:setStorageValue(Storage.Factions, 1) + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.Factions) ~= 1 then + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.Factions, 1) end - player:setStorageValue(Storage.DjinnWar.Faction.Greeting, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.Greeting, 1) end end diff --git a/data-otservbr-global/npc/miraia.lua b/data-otservbr-global/npc/miraia.lua index 00101154766..bcc2cb88076 100644 --- a/data-otservbr-global/npc/miraia.lua +++ b/data-otservbr-global/npc/miraia.lua @@ -103,19 +103,15 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "outfit") then - npcHandler:say(player:getSex() == PLAYERSEX_FEMALE and "Hehe, would you like to wear a pretty veil like I do? Well... I could help you, but you would have to complete a task first." or "My veil? No, I will definitely not lift it for you! If you are looking for an addon, go talk to Razan.", npc, creature) - elseif MsgContains(message, "task") then - if player:getSex() == PLAYERSEX_MALE then - npcHandler:say("Uh... I don't think that I have work for you right now. If you need a job, go talk to Razan.", npc, creature) - return true - end - if player:getStorageValue(Storage.OutfitQuest.secondOrientalAddon) < 1 then + if player:getSex() == PLAYERSEX_FEMALE and MsgContains(message, "outfit") then + npcHandler:say("Hehe, would you like to wear a pretty veil like I do? Well... I could help you, but you would have to complete a task first." or "My veil? No, I will definitely not lift it for you! If you are looking for an addon, go talk to Razan.", npc, creature) + elseif player:getSex() == PLAYERSEX_FEMALE and MsgContains(message, "task") then + if player:getStorageValue(Storage.Quest.U7_8.OrientalOutfits.SecondOrientalAddon) < 1 then npcHandler:say("You mean, you would like to prove that you deserve to wear such a veil?", npc, creature) npcHandler:setTopic(playerId, 1) end elseif config[message] and npcHandler:getTopic(playerId) == 0 then - if player:getStorageValue(Storage.OutfitQuest.secondOrientalAddon) == config[message].storageValue then + if player:getStorageValue(Storage.Quest.U7_8.OrientalOutfits.SecondOrientalAddon) == config[message].storageValue then npcHandler:say(config[message].text[1], npc, creature) npcHandler:setTopic(playerId, 3) topic[playerId] = message @@ -144,7 +140,7 @@ local function creatureSayCallback(npc, creature, type, message) if player:getStorageValue(Storage.OutfitQuest.DefaultStart) ~= 1 then player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) end - player:setStorageValue(Storage.OutfitQuest.secondOrientalAddon, 1) + player:setStorageValue(Storage.Quest.U7_8.OrientalOutfits.SecondOrientalAddon, 1) npcHandler:say("Excellent! Come back to me once you have collected 100 pieces of ape fur.", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then @@ -154,10 +150,9 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 0) return true end - player:setStorageValue(Storage.OutfitQuest.secondOrientalAddon, player:getStorageValue(Storage.OutfitQuest.secondOrientalAddon) + 1) - if player:getStorageValue(Storage.OutfitQuest.secondOrientalAddon) == 5 then - player:addOutfitAddon(146, 2) - player:addOutfitAddon(150, 2) + player:setStorageValue(Storage.Quest.U7_8.OrientalOutfits.SecondOrientalAddon, player:getStorageValue(Storage.Quest.U7_8.OrientalOutfits.SecondOrientalAddon) + 1) + if player:getStorageValue(Storage.Quest.U7_8.OrientalOutfits.SecondOrientalAddon) == 5 then + player:addOutfitAddon(150, 2) -- female addon player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end npcHandler:say(targetMessage.text[3], npc, creature) diff --git a/data-otservbr-global/npc/morgan.lua b/data-otservbr-global/npc/morgan.lua index f1e8897a046..f4bfdc43105 100644 --- a/data-otservbr-global/npc/morgan.lua +++ b/data-otservbr-global/npc/morgan.lua @@ -59,33 +59,24 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "firebird") then - if player:getStorageValue(Storage.OutfitQuest.PirateSabreAddon) == 4 then - player:setStorageValue(Storage.OutfitQuest.PirateSabreAddon, 5) + if player:getStorageValue(Storage.Quest.U7_8.PirateOutfits.PirateSabreAddon) == 4 then + player:setStorageValue(Storage.Quest.U7_8.PirateOutfits.PirateSabreAddon, 5) player:addOutfitAddon(151, 1) player:addOutfitAddon(155, 1) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - npcHandler:say( - "Ahh. So Duncan sent you, eh? You must have done something really impressive. \ - Okay, take this fine sabre from me, mate.", - npc, - creature - ) + npcHandler:say("Ahh. So Duncan sent you, eh? You must have done something really impressive. Okay, take this fine sabre from me, mate.", npc, creature) end elseif MsgContains(message, "mission") then - if player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 3 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 6 then npcHandler:say({ - "Hm, if you are that eager to work I have an idea how you could help me out. \z - A distant relative of mine, the old sage Eremo lives on the isle Cormaya, near Edron. ...", - "He has not heard from me since ages. He might assume that I am dead. \z - Since I don't want him to get into trouble for receiving a letter from a \z - pirate I ask you to deliver it personally. ...", - "Of course it's a long journey but you asked for it. \z - You will have to prove us your worth. Are you up to that?", + "Hm, if you are that eager to work I have an idea how you could help me out. A distant relative of mine, the old sage Eremo lives on the isle Cormaya, near Edron. ...", + "He has not heard from me since ages. He might assume that I am dead. Since I don't want him to get into trouble for receiving a letter from a pirate I ask you to deliver it personally. ...", + "Of course it's a long journey but you asked for it. You will have to prove us your worth. Are you up to that?", }, npc, creature) npcHandler:setTopic(playerId, 2) - elseif player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 5 then + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 8 then npcHandler:say("Thank you for delivering my letter to Eremo. I have no more missions for you.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 6) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 9) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "warrior's sword") then @@ -94,16 +85,17 @@ local function creatureSayCallback(npc, creature, type, message) return true end - if player:getStorageValue(Storage.OutfitQuest.WarriorSwordAddon) < 1 then - player:setStorageValue(Storage.OutfitQuest.WarriorSwordAddon, 1) + if player:getStorageValue(Storage.Quest.U7_8.WarriorOutfits.WarriorSwordAddon) < 1 then + player:setStorageValue(Storage.Quest.U7_8.WarriorOutfits.WarriorSwordAddon, 1) npcHandler:say("Great! Simply bring me 100 iron ore and one royal steel and I will happily {forge} it for you.", npc, creature) - elseif player:getStorageValue(Storage.OutfitQuest.WarriorSwordAddon) == 1 and npcHandler:getTopic(playerId) == 1 then + elseif player:getStorageValue(Storage.Quest.U7_8.WarriorOutfits.WarriorSwordAddon) == 1 and npcHandler:getTopic(playerId) == 1 then if player:getItemCount(5887) > 0 and player:getItemCount(5880) > 99 then player:removeItem(5887, 1) player:removeItem(5880, 100) player:addOutfitAddon(134, 2) player:addOutfitAddon(142, 2) - player:setStorageValue(Storage.OutfitQuest.WarriorSwordAddon, 2) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) + player:setStorageValue(Storage.Quest.U7_8.WarriorOutfits.WarriorSwordAddon, 2) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) player:addAchievementProgress("Wild Warrior", 2) npcHandler:say("Alright! As a matter of fact, I have one in store. Here you go!", npc, creature) @@ -118,16 +110,16 @@ local function creatureSayCallback(npc, creature, type, message) return true end - if player:getStorageValue(Storage.OutfitQuest.Knight.AddonSword) < 1 then - player:setStorageValue(Storage.OutfitQuest.Knight.AddonSword, 1) + if player:getStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonSword) < 1 then + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonSword, 1) npcHandler:say("Great! Simply bring me 100 Iron Ore and one Crude Iron and I will happily {forge} it for you.", npc, creature) - elseif player:getStorageValue(Storage.OutfitQuest.Knight.AddonSword) == 1 and npcHandler:getTopic(playerId) == 1 then + elseif player:getStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonSword) == 1 and npcHandler:getTopic(playerId) == 1 then if player:getItemCount(5892) > 0 and player:getItemCount(5880) > 99 then player:removeItem(5892, 1) player:removeItem(5880, 100) player:addOutfitAddon(131, 1) player:addOutfitAddon(139, 1) - player:setStorageValue(Storage.OutfitQuest.Knight.AddonSword, 2) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonSword, 2) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) npcHandler:say("Alright! As a matter of fact, I have one in store. Here you go!", npc, creature) else @@ -140,10 +132,10 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 1) elseif MsgContains(message, "yes") then if npcHandler:getTopic(playerId) == 2 then - if player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 3 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 6 then npcHandler:say("Alright, we will see. Here, take this letter and deliver it safely to old Eremo on Cormaya.", npc, creature) player:addItem(3506, 1) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 4) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 7) npcHandler:setTopic(playerId, 0) end end @@ -153,8 +145,7 @@ end keywordHandler:addKeyword({ "addon" }, StdModule.say, { npcHandler = npcHandler, - text = "I can forge the finest {weapons} for knights and warriors. \ - They may wear them proudly and visible to everyone.", + text = "I can forge the finest {weapons} for knights and warriors. They may wear them proudly and visible to everyone.", }) keywordHandler:addKeyword({ "weapons" }, StdModule.say, { npcHandler = npcHandler, diff --git a/data-otservbr-global/npc/mortimer.lua b/data-otservbr-global/npc/mortimer.lua index 79c8d734640..38303c1025d 100644 --- a/data-otservbr-global/npc/mortimer.lua +++ b/data-otservbr-global/npc/mortimer.lua @@ -61,7 +61,7 @@ local function creatureSayCallback(npc, creature, type, message) -- JOINING if MsgContains(message, "join") then - if player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) < 1 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) < 1 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) < 1 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) < 1 then npcHandler:say("Do you want to join the explorer society?", npc, creature) npcHandler:setTopic(playerId, 1) end @@ -87,81 +87,82 @@ local function creatureSayCallback(npc, creature, type, message) -- MISSION CHECK elseif MsgContains(message, "mission") then if - player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) > 4 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) > 4 and player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) < 26 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) < 26 - or player:getStorageValue(Storage.ExplorerSociety.TheIceDelivery) == 8 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 8 - or player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 17 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 17 - or player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) == 5 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 5 + player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) > 4 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) > 4 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) < 26 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) < 26 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery) == 8 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 8 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 17 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 17 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) == 5 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 5 then npcHandler:say("The missions available for your rank are the {butterfly hunt}, {plant collection} and {ice delivery}.", npc, creature) npcHandler:setTopic(playerId, 0) elseif - player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) > 25 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) > 35 and player:getStorageValue(Storage.ExplorerSociety.TheOrcPowder) < 35 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) < 35 - or player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 26 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 26 - or player:getStorageValue(Storage.ExplorerSociety.TheLizardUrn) == 29 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 29 - or player:getStorageValue(Storage.ExplorerSociety.TheBonelordSecret) == 32 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 32 + player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) > 25 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) > 35 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder) < 35 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) < 35 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 26 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 26 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheLizardUrn) == 29 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 29 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheBonelordSecret) == 32 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 32 then npcHandler:say("The missions available for your rank are {lizard urn}, {bonelord secrets} and {orc powder}.", npc, creature) npcHandler:setTopic(playerId, 0) elseif - player:getStorageValue(Storage.ExplorerSociety.TheOrcPowder) > 34 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) > 34 and player:getStorageValue(Storage.ExplorerSociety.TheRuneWritings) < 44 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) < 44 - or player:getStorageValue(Storage.ExplorerSociety.TheOrcPowder) == 35 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 35 - or player:getStorageValue(Storage.ExplorerSociety.TheElvenPoetry) == 38 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 38 - or player:getStorageValue(Storage.ExplorerSociety.TheMemoryStone) == 41 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 41 + player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder) > 34 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) > 34 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings) < 44 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) < 44 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder) == 35 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 35 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheElvenPoetry) == 38 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 38 + or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheMemoryStone) == 41 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 41 then npcHandler:say("The missions available for your rank are {elven poetry}, {memory stone} and {rune writings}.", npc, creature) npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.ExplorerSociety.TheRuneWritings) == 44 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 44 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings) == 44 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 44 then npcHandler:say("The explorer society needs a great deal of help in the research of astral travel. Are you willing to help?", npc, creature) npcHandler:setTopic(playerId, 27) - elseif player:getStorageValue(Storage.ExplorerSociety.TheEctoplasm) == 46 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 46 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheEctoplasm) == 46 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 46 then npcHandler:say("Do you have some collected ectoplasm with you?", npc, creature) npcHandler:setTopic(playerId, 29) - elseif player:getStorageValue(Storage.ExplorerSociety.TheEctoplasm) == 47 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 47 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheEctoplasm) == 47 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 47 then npcHandler:say({ "The research on ectoplasm makes good progress. Now we need some spectral article. Our scientists think a spectral dress would be a perfect object for their studies ...", "The bad news is that the only source to got such a dress is the queen of the banshees. Do you dare to seek her out?", }, npc, creature) npcHandler:setTopic(playerId, 30) - elseif player:getStorageValue(Storage.ExplorerSociety.TheSpectralDress) == 49 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 48 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralDress) == 49 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 48 then npcHandler:say("Did you bring the dress?", npc, creature) npcHandler:setTopic(playerId, 31) -- SPECTRAL STONE - elseif player:getStorageValue(Storage.ExplorerSociety.TheSpectralDress) == 50 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 50 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralDress) == 50 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 50 then npcHandler:say({ "With the objects you've provided our researchers will make steady progress. Still we are missing some test results from fellow explorers ...", "Please travel to our base in Port Hope and ask them to mail us their latest research reports. Then return here and ask about new missions.", }, npc, creature) - player:setStorageValue(Storage.ExplorerSociety.TheSpectralStone, 51) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 51) - player:setStorageValue(Storage.ExplorerSociety.SpectralStone, 2) - elseif player:getStorageValue(Storage.ExplorerSociety.TheSpectralStone) == 51 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 51 and player:getStorageValue(Storage.ExplorerSociety.SpectralStone) == 1 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 51) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 51) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone, 2) + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 51 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 51 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 1 then npcHandler:say("Oh, yes! Tell our fellow explorer that the papers are in the mail already.", npc, creature) - player:setStorageValue(Storage.ExplorerSociety.TheSpectralStone, 52) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 52) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 52) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 52) npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.ExplorerSociety.TheSpectralStone) == 52 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 52 and player:getStorageValue(Storage.ExplorerSociety.SpectralStone) == 2 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 52 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 52 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 2 then npcHandler:say("The reports from Port Hope have already arrived here and our progress is astonishing. We think it is possible to create an astral bridge between our bases. Are you interested to assist us with this?", npc, creature) npcHandler:setTopic(playerId, 32) -- SPECTRAL STONE -- ASTRAL PORTALS - elseif player:getStorageValue(Storage.ExplorerSociety.TheSpectralStone) == 55 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 55 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 55 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 55 then npcHandler:say({ "Both carvings are now charged and harmonised. In theory you should be able to travel in zero time from one base to the other ...", "However, you will need to have an orichalcum pearl in your possession to use it as power source. It will be destroyed during the process. I will give you 6 of such pearls and you can buy new ones in our bases ...", "In addition, you need to be a premium explorer to use the astral travel. ...", "And remember: it's a small teleport for you, but a big teleport for all Tibians! Here is a small present for your efforts!", }, npc, creature) - player:setStorageValue(Storage.ExplorerSociety.TheAstralPortals, 56) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 56) - player:addItem(5021, 6) -- orichalcum pearl - player:addItem(9605, 1) -- crown backpack + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheAstralPortals, 56) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 56) + player:addItem(5021, 6) -- Orichalcum pearl + player:addItem(9605, 1) -- Crown backpack + player:addItem(3035, 50) -- 50 Platinum coins -- ASTRAL PORTALS end -- MISSION CHECK -- PICKAXE MISSION elseif MsgContains(message, "pickaxe") then - if player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) < 5 or player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) > 1 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) < 1 or player:getStorageValue(Storage.ExplorerSociety.QuestLine) > 1 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) < 5 or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) > 1 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) < 1 or player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) > 1 then npcHandler:say("Did you get the requested pickaxe from Uzgod in Kazordoon?", npc, creature) npcHandler:setTopic(playerId, 3) end @@ -169,14 +170,14 @@ local function creatureSayCallback(npc, creature, type, message) -- ICE DELIVERY elseif MsgContains(message, "ice delivery") then - if player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) == 5 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 5 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) == 5 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 5 then npcHandler:say({ "Our finest minds came up with the theory that deep beneath the ice island of Folda ice can be found that is ancient. To prove this theory we would need a sample of the aforesaid ice ...", "Of course the ice melts away quickly so you would need to hurry to bring it here ...", "Would you like to accept this mission?", }, npc, creature) npcHandler:setTopic(playerId, 4) - elseif player:getStorageValue(Storage.ExplorerSociety.TheIceDelivery) == 7 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 7 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery) == 7 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 7 then npcHandler:say("Did you get the ice we are looking for?", npc, creature) npcHandler:setTopic(playerId, 5) end @@ -184,62 +185,62 @@ local function creatureSayCallback(npc, creature, type, message) -- BUTTERFLY HUNT elseif MsgContains(message, "butterfly hunt") then - if player:getStorageValue(Storage.ExplorerSociety.TheIceDelivery) == 8 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 8 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery) == 8 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 8 then npcHandler:say("The mission asks you to collect some species of butterflies, are you interested?", npc, creature) npcHandler:setTopic(playerId, 7) - elseif player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 10 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 10 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 10 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 10 then npcHandler:say("Did you acquire the purple butterfly we are looking for?", npc, creature) npcHandler:setTopic(playerId, 8) - elseif player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 11 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 11 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 11 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 11 then npcHandler:say({ "This preparation kit will allow you to collect a blue butterfly you have killed ...", "Just use it on the fresh corpse of a blue butterfly, return the prepared butterfly to me and give me a report of your butterfly hunt.", }, npc, creature) npcHandler:setTopic(playerId, 0) player:addItem(4863, 1) - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 12) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 12) - elseif player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 13 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 13 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 12) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 12) + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 13 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 13 then npcHandler:say("Did you acquire the blue butterfly we are looking for?", npc, creature) npcHandler:setTopic(playerId, 9) - elseif player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 14 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 14 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 14 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 14 then npcHandler:say({ "This preparation kit will allow you to collect a red butterfly you have killed ...", "Just use it on the fresh corpse of a red butterfly, return the prepared butterfly to me and give me a report of your butterfly hunt.", }, npc, creature) npcHandler:setTopic(playerId, 0) player:addItem(4863, 1) - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 15) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 15) - elseif player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 16 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 16 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 15) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 15) + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 16 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 16 then npcHandler:say("Did you acquire the red butterfly we are looking for?", npc, creature) npcHandler:setTopic(playerId, 10) end -- BUTTERFLY HUNT -- PLANT COLLECTION elseif MsgContains(message, "plant collection") then - if player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 17 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 17 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 17 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 17 then npcHandler:say("In this mission we require you to get us some plant samples from Tiquandan plants. Would you like to fulfil this mission?", npc, creature) npcHandler:setTopic(playerId, 11) - elseif player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 119 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 19 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 119 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 19 then npcHandler:say("Did you acquire the sample of the jungle bells plant we are looking for?", npc, creature) npcHandler:setTopic(playerId, 12) - elseif player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 20 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 20 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 20 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 20 then npcHandler:say("Use this botanist's container on a witches cauldron to collect a sample for us. Bring it here and report about your plant collection.", npc, creature) npcHandler:setTopic(playerId, 0) player:addItem(4867, 1) - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 21) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 21) - elseif player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 22 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 22 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 21) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 21) + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 22 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 22 then npcHandler:say("Did you acquire the sample of the witches cauldron we are looking for?", npc, creature) npcHandler:setTopic(playerId, 13) - elseif player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 23 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 23 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 23 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 23 then npcHandler:say("Use this botanist's container on a giant jungle rose to obtain a sample for us. Bring it here and report about your plant collection.", npc, creature) npcHandler:setTopic(playerId, 0) player:addItem(4867, 1) - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 24) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 24) - elseif player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 25 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 25 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 24) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 24) + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 25 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 25 then npcHandler:say("Did you acquire the sample of the giant jungle rose we are looking for?", npc, creature) npcHandler:setTopic(playerId, 14) end @@ -247,10 +248,10 @@ local function creatureSayCallback(npc, creature, type, message) -- LIZARD URN elseif MsgContains(message, "lizard urn") then - if player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 26 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 26 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 26 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 26 then npcHandler:say("The explorer society would like to acquire an ancient urn which is some sort of relic to the lizard people of Tiquanda. Would you like to accept this mission?", npc, creature) npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.ExplorerSociety.TheLizardUrn) == 28 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 27 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheLizardUrn) == 28 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 27 then npcHandler:say("Did you manage to get the ancient urn?", npc, creature) npcHandler:setTopic(playerId, 16) end @@ -258,14 +259,14 @@ local function creatureSayCallback(npc, creature, type, message) -- BONELORDS elseif MsgContains(message, "bonelord secrets") then - if player:getStorageValue(Storage.ExplorerSociety.TheLizardUrn) == 29 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 29 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheLizardUrn) == 29 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 29 then npcHandler:say({ "We want to learn more about the ancient race of bonelords. We believe the black pyramid north east of Darashia was originally built by them ...", "We ask you to explore the ruins of the black pyramid and look for any signs that prove our theory. You might probably find some document with the numeric bonelord language ...", "That would be sufficient proof. Would you like to accept this mission?", }, npc, creature) npcHandler:setTopic(playerId, 17) - elseif player:getStorageValue(Storage.ExplorerSociety.TheBonelordSecret) == 31 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 30 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheBonelordSecret) == 31 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 30 then npcHandler:say("Have you found any proof that the pyramid was built by bonelords?", npc, creature) npcHandler:setTopic(playerId, 18) end @@ -273,14 +274,14 @@ local function creatureSayCallback(npc, creature, type, message) -- ORC POWDER elseif MsgContains(message, "orc powder") then - if player:getStorageValue(Storage.ExplorerSociety.TheBonelordSecret) == 32 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 32 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheBonelordSecret) == 32 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 32 then npcHandler:say({ "It is commonly known that orcs of Uldereks Rock use some sort of powder to increase the fierceness of their war wolves and berserkers ...", "What we do not know are the ingredients of this powder and its effect on humans ...", "So we would like you to get a sample of the aforesaid powder. Do you want to accept this mission?", }, npc, creature) npcHandler:setTopic(playerId, 19) - elseif player:getStorageValue(Storage.ExplorerSociety.TheOrcPowder) == 34 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 33 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder) == 34 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 33 then npcHandler:say("Did you acquire some of the orcish powder?", npc, creature) npcHandler:setTopic(playerId, 20) end @@ -288,13 +289,13 @@ local function creatureSayCallback(npc, creature, type, message) -- ELVEN POETRY elseif MsgContains(message, "elven poetry") then - if player:getStorageValue(Storage.ExplorerSociety.TheOrcPowder) == 35 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 35 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder) == 35 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 35 then npcHandler:say({ "Some high ranking members would like to study elven poetry. They want the rare book 'Songs of the Forest' ...", "For sure someone in Ab'Dendriel will own a copy. So you would just have to ask around there. Are you willing to accept this mission?", }, npc, creature) npcHandler:setTopic(playerId, 21) - elseif player:getStorageValue(Storage.ExplorerSociety.TheElvenPoetry) == 37 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 36 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheElvenPoetry) == 37 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 36 then npcHandler:say("Did you acquire a copy of 'Songs of the Forest' for us?", npc, creature) npcHandler:setTopic(playerId, 22) end @@ -302,14 +303,14 @@ local function creatureSayCallback(npc, creature, type, message) -- MEMORY STONE elseif MsgContains(message, "memory stone") then - if player:getStorageValue(Storage.ExplorerSociety.TheElvenPoetry) == 38 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 38 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheElvenPoetry) == 38 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 38 then npcHandler:say({ "We acquired some knowledge about special magic stones. Some lost civilisations used it to store knowledge and lore, just like we use books ...", "The wisdom in such stones must be immense, but so are the dangers faced by every person who tries to obtain one...", "As far as we know the ruins found in the north-west of Edron were once inhabited by beings who used such stones. Do you have the heart to go there and to get us such a stone?", }, npc, creature) npcHandler:setTopic(playerId, 23) - elseif player:getStorageValue(Storage.ExplorerSociety.TheMemoryStone) == 40 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 39 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheMemoryStone) == 40 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 39 then npcHandler:say("Were you able to acquire a memory stone for our society?", npc, creature) npcHandler:setTopic(playerId, 24) end @@ -317,7 +318,7 @@ local function creatureSayCallback(npc, creature, type, message) -- RUNE WRITINGS elseif MsgContains(message, "rune writings") then - if player:getStorageValue(Storage.ExplorerSociety.TheMemoryStone) == 41 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 41 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheMemoryStone) == 41 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 41 then npcHandler:say({ "We would like to study some ancient runes that were used by the lizard race. We suspect some relation of the lizards to the founders of Ankrahmun ...", "Somewhere under the ape infested city of Banuta, one can find dungeons that were once inhabited by lizards...", @@ -325,7 +326,7 @@ local function creatureSayCallback(npc, creature, type, message) "Are you up to that challenge?", }, npc, creature) npcHandler:setTopic(playerId, 25) - elseif player:getStorageValue(Storage.ExplorerSociety.TheRuneWritings) == 43 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 43 then + elseif player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings) == 43 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 43 then npcHandler:say("Did you create a copy of the ancient runes as requested?", npc, creature) npcHandler:setTopic(playerId, 26) end @@ -343,12 +344,12 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 2 then npcHandler:say("We will see if you can handle this simple task. Get the pickaxe from Uzgod in Kazordoon and bring it to one of our bases. Report there about the pickaxe.", npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.ExplorerSociety.JoiningTheExplorers, 1) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 1) elseif npcHandler:getTopic(playerId) == 3 then if player:removeItem(4845, 1) then - player:setStorageValue(Storage.ExplorerSociety.JoiningTheExplorers, 5) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 5) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers, 5) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 5) npcHandler:say({ "Excellent, you brought just the tool we need! Of course it was only a simple task. However ...", "I officially welcome you to the explorer society. From now on you can ask for missions to improve your rank.", @@ -356,8 +357,8 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 4 then - player:setStorageValue(Storage.ExplorerSociety.TheIceDelivery, 5) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 5) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery, 5) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 5) npcHandler:say({ "So listen please: Take this ice pick and use it on a block of ice in the caves beneath Folda. Get some ice and bring it here as fast as you can ...", "Should the ice melt away, report on your ice delivery mission anyway. I will then tell you if the time is right to start another mission.", @@ -366,21 +367,21 @@ local function creatureSayCallback(npc, creature, type, message) player:addItem(3456, 1) elseif npcHandler:getTopic(playerId) == 5 then if player:removeItem(4837, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheIceDelivery, 7) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 7) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery, 7) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 7) npcHandler:say("Just in time. Sadly not much ice is left over but it will do. Thank you again.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 6 then - player:setStorageValue(Storage.ExplorerSociety.TheIceDelivery, 5) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 5) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery, 5) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 5) npcHandler:say("*Sigh* I think the time is right to grant you another chance to get that ice. Hurry up this time.", npc, creature) npcHandler:setTopic(playerId, 0) -- BUTTERFLY HUNT elseif npcHandler:getTopic(playerId) == 7 then - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 8) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 8) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 8) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 8) npcHandler:say({ "This preparation kit will allow you to collect a purple butterfly you have killed ...", "Just use it on the fresh corpse of a purple butterfly, return the prepared butterfly to me and give me a report of your butterfly hunt.", @@ -389,22 +390,22 @@ local function creatureSayCallback(npc, creature, type, message) player:addItem(4863, 1) elseif npcHandler:getTopic(playerId) == 8 then if player:removeItem(4864, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 10) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 10) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 10) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 10) npcHandler:say("A little bit battered but it will do. Thank you! If you think you are ready, ask for another butterfly hunt.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 9 then if player:removeItem(4865, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 13) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 13) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 13) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 13) npcHandler:say("A little bit battered but it will do. Thank you! If you think you are ready, ask for another butterfly hunt.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 10 then if player:removeItem(4866, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 16) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 16) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 16) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 16) npcHandler:say("That is an extraordinary species you have brought. Thank you! That was the last butterfly we needed.", npc, creature) npcHandler:setTopic(playerId, 0) end @@ -412,29 +413,29 @@ local function creatureSayCallback(npc, creature, type, message) -- PLANT COLLECTION elseif npcHandler:getTopic(playerId) == 11 then - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 17) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 17) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 17) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 17) npcHandler:say("Fine! Here take this botanist's container. Use it on a jungle bells plant to collect a sample for us. Report about your plant collection when you have been successful.", npc, creature) npcHandler:setTopic(playerId, 0) player:addItem(4867, 1) elseif npcHandler:getTopic(playerId) == 12 then if player:removeItem(4868, 1) then - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 19) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 19) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 19) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 19) npcHandler:say("I see. It seems you've got some quite useful sample by sheer luck. Thank you! Just tell me when you are ready to continue with the plant collection.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 13 then if player:removeItem(4869, 1) then - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 22) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 22) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 22) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 22) npcHandler:say("Ah, finally. I started to wonder what took you so long. But thank you! Another fine sample, indeed. Just tell me when you are ready to continue with the plant collection.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 14 then if player:removeItem(4870, 1) then - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 26) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 26) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 26) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 26) npcHandler:say("What a lovely sample! With that you have finished your plant collection missions.", npc, creature) npcHandler:setTopic(playerId, 0) end @@ -442,9 +443,9 @@ local function creatureSayCallback(npc, creature, type, message) -- LIZARD URN elseif npcHandler:getTopic(playerId) == 15 then - player:setStorageValue(Storage.ExplorerSociety.TheLizardUrn, 27) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 27) - player:setStorageValue(Storage.ExplorerSociety.ChorurnDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheLizardUrn, 27) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 27) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ChorurnDoor, 1) npcHandler:say({ "You have indeed the spirit of an adventurer! In the south-east of Tiquanda is a small settlement of the lizard people ...", "Beneath the newly constructed temple there, the lizards hide the said urn. Our attempts to acquire this item were without success ...", @@ -453,8 +454,8 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 16 then if player:removeItem(4847, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheLizardUrn, 29) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 29) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheLizardUrn, 29) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 29) npcHandler:say("Yes, that is the prized relic we have been looking for so long. You did a great job, thank you.", npc, creature) npcHandler:setTopic(playerId, 0) end @@ -462,9 +463,9 @@ local function creatureSayCallback(npc, creature, type, message) -- BONELORDS elseif npcHandler:getTopic(playerId) == 17 then - player:setStorageValue(Storage.ExplorerSociety.TheBonelordSecret, 30) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 30) - player:setStorageValue(Storage.ExplorerSociety.BonelordsDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheBonelordSecret, 30) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 30) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.BonelordsDoor, 1) npcHandler:say({ "Excellent! So travel to the city of Darashia and then head north-east for the pyramid ...", "If any documents are left, you probably find them in the catacombs beneath. Good luck!", @@ -472,8 +473,8 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 18 then if player:removeItem(173, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheBonelordSecret, 32) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 32) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheBonelordSecret, 32) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 32) npcHandler:say("You did it! Excellent! The scientific world will be shaken by this discovery!", npc, creature) npcHandler:setTopic(playerId, 0) end @@ -481,9 +482,9 @@ local function creatureSayCallback(npc, creature, type, message) -- ORC POWDER elseif npcHandler:getTopic(playerId) == 19 then - player:setStorageValue(Storage.ExplorerSociety.TheOrcPowder, 33) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 33) - player:setStorageValue(Storage.ExplorerSociety.OrcDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder, 33) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 33) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.OrcDoor, 1) npcHandler:say({ "You are a brave soul. As far as we can tell, the orcs maintain some sort of training facility in some hill in the north-east of their city ...", "There you should find lots of their war wolves and hopefully also some of the orcish powder. Good luck!", @@ -491,8 +492,8 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 20 then if player:removeItem(13974, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheOrcPowder, 35) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 35) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder, 35) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 35) npcHandler:say("You really got it? Amazing! Thank you for your efforts.", npc, creature) npcHandler:setTopic(playerId, 0) end @@ -500,15 +501,15 @@ local function creatureSayCallback(npc, creature, type, message) -- ELVEN POETRY elseif npcHandler:getTopic(playerId) == 21 then - player:setStorageValue(Storage.ExplorerSociety.TheElvenPoetry, 36) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 36) - player:setStorageValue(Storage.ExplorerSociety.ElvenDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheElvenPoetry, 36) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 36) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ElvenDoor, 1) npcHandler:say("Excellent. This mission is easy but nonetheless vital. Travel to Ab'Dendriel and get the book.", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 22 then if player:removeItem(4844, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheElvenPoetry, 38) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 38) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheElvenPoetry, 38) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 38) npcHandler:say("Let me have a look! Yes, that's what we wanted. A copy of 'Songs of the Forest'. I won't ask any questions about those bloodstains.", npc, creature) npcHandler:setTopic(playerId, 0) end @@ -516,15 +517,15 @@ local function creatureSayCallback(npc, creature, type, message) -- MEMORY STONE elseif npcHandler:getTopic(playerId) == 23 then - player:setStorageValue(Storage.ExplorerSociety.TheMemoryStone, 39) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 39) - player:setStorageValue(Storage.ExplorerSociety.MemoryStoneDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheMemoryStone, 39) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 39) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.MemoryStoneDoor, 1) npcHandler:say("In the ruins of north-western Edron you should be able to find a memory stone. Good luck.", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 24 then if player:removeItem(4841, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheMemoryStone, 41) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 41) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheMemoryStone, 41) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 41) npcHandler:say("A flawless memory stone! Incredible! It will take years even to figure out how it works but what an opportunity for science, thank you!", npc, creature) npcHandler:setTopic(playerId, 0) end @@ -532,15 +533,15 @@ local function creatureSayCallback(npc, creature, type, message) -- RUNE WRITINGS elseif npcHandler:getTopic(playerId) == 25 then - player:setStorageValue(Storage.ExplorerSociety.TheRuneWritings, 42) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 42) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings, 42) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 42) npcHandler:say("Excellent! Here, take this tracing paper and use it on the object you will find there to create a copy of the ancient runes.", npc, creature) npcHandler:setTopic(playerId, 0) player:addItem(4842, 1) elseif npcHandler:getTopic(playerId) == 26 then if player:removeItem(4843, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheRuneWritings, 44) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 44) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings, 44) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 44) npcHandler:say("It's a bit wrinkled but it will do. Thanks again.", npc, creature) npcHandler:setTopic(playerId, 0) end @@ -558,13 +559,13 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Good! Take this container and use it on a ghost that was recently slain. Return with the collected ectoplasm and hand me that container ...", npc, creature) npcHandler:say("Don't lose the container. They are expensive!", npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.ExplorerSociety.TheEctoplasm, 45) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 45) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheEctoplasm, 45) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 45) player:addItem(4852, 1) elseif npcHandler:getTopic(playerId) == 29 then if player:removeItem(4853, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheEctoplasm, 47) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 47) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheEctoplasm, 47) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 47) npcHandler:say("Phew, I had no idea that ectoplasm would smell that ... oh, it's you, well, sorry. Thank you for the ectoplasm.", npc, creature) npcHandler:setTopic(playerId, 0) end @@ -577,12 +578,12 @@ local function creatureSayCallback(npc, creature, type, message) "Any violence will probably be futile, you will have to negotiate with her. Try to get a spectral dress from her. Good luck.", }, npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.ExplorerSociety.TheSpectralDress, 48) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 48) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralDress, 48) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 48) elseif npcHandler:getTopic(playerId) == 31 then if player:removeItem(4836, 1) then - player:setStorageValue(Storage.ExplorerSociety.TheSpectralDress, 50) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 50) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralDress, 50) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 50) npcHandler:say("Good! Ask me for another mission.", npc, creature) npcHandler:setTopic(playerId, 0) end @@ -595,9 +596,9 @@ local function creatureSayCallback(npc, creature, type, message) "As soon as you have charged the portal tiles that way, report about the spectral portals.", }, npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.ExplorerSociety.TheSpectralStone, 53) - player:setStorageValue(Storage.ExplorerSociety.SpectralStoneDoor, 1) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 53) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 53) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStoneDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 53) player:addItem(4840, 1) -- spectral stone -- SPECTRAL STONE @@ -605,9 +606,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 33 then if player:removeItem(3207, 1) then npcHandler:say("Poor Ratha. Thank you for returning this skull to the society. We will see to a honourable burial of Ratha.", npc, creature) - player:setStorageValue(Storage.ExplorerSociety.SkullOfRatha, 1) - player:addItem(3035, 2) - player:addItem(3031, 50) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.SkullOfRatha.Bag1, 2) npcHandler:setTopic(playerId, 0) else npcHandler:say("Come back when you find any information.", npc, creature) @@ -616,15 +615,19 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 34 then if player:removeItem(12510, 1) then npcHandler:say("Marvellous! You brought a giant smith hammer for the explorer society!", npc, creature) - player:setStorageValue(Storage.ExplorerSociety.GiantSmithHammer, 1) - player:addItem(3035, 2) - player:addItem(3031, 50) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.GiantSmithHammer.Hamer, 2) npcHandler:setTopic(playerId, 0) else npcHandler:say("No you don't.", npc, creature) npcHandler:setTopic(playerId, 0) end -- SKULL OF RATHA / GIANT SMITHHAMMER + elseif npcHandler:getTopic(playerId) == 35 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ExplorerBrooch) == 1 and player:removeItem(4871, 1) then + npcHandler:say("It's always a sad day when we learn about the death of a member. But at least we learnt about his fate. Thank you, here is your reward.", npc, creature) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ExplorerBrooch, 2) + npcHandler:setTopic(playerId, 0) + end end -- ANSWER YES @@ -643,22 +646,30 @@ local function creatureSayCallback(npc, creature, type, message) -- ANSWER NO -- SKULL OF RATHA / GIANT SMITHHAMMER - elseif MsgContains(message, "skull of ratha") and player:getStorageValue(Storage.ExplorerSociety.SkullOfRatha) < 1 then + elseif MsgContains(message, "skull of ratha") and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SkullOfRatha.Bag1) == 1 then npcHandler:say({ "Ratha was a great explorer and even greater ladies' man. Sadly he never returned from a visit to the amazons. Probably he is dead ...", "The society offers a substantial reward for the retrieval of Ratha or his remains. Do you have any news about Ratha?", }, npc, creature) npcHandler:setTopic(playerId, 33) - elseif MsgContains(message, "giant smithhammer") and player:getStorageValue(Storage.ExplorerSociety.GiantSmithHammer) < 1 then + elseif MsgContains(message, "giant smith hammer") and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.GiantSmithHammer.Hammer) == 1 then npcHandler:say("The explorer society is looking for a genuine giant smith hammer for our collection. It is rumoured the cyclopses of the Plains of Havoc might be using one. Did you by chance obtain such a hammer?", npc, creature) npcHandler:setTopic(playerId, 34) - -- SKULL OF RATHA / GIANT SMITHHAMMER + -- Explorer Brooch + elseif MsgContains(message, "brooch") and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ExplorerBrooch) == 1 then + npcHandler:say({ + "Our members travel to far away places and cross dangerous areas, many fall prey to enemies or the land ...", + "Sometimes the personal explorer brooches can be recovered. That way we learn about the fate of our members ...", + "We offer a reward for each brooch returned to us. Have you found an explorer brooch?", + }, npc, creature) + npcHandler:setTopic(playerId, 35) end + return true end local function onTradeRequest(npc, creature) - if Player(creature):getStorageValue(Storage.ExplorerSociety.TheAstralPortals) ~= 56 then + if Player(creature):getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheAstralPortals) ~= 56 then return false end diff --git a/data-otservbr-global/npc/myra.lua b/data-otservbr-global/npc/myra.lua index 29593f4024a..b8ee8352ab7 100644 --- a/data-otservbr-global/npc/myra.lua +++ b/data-otservbr-global/npc/myra.lua @@ -50,119 +50,278 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end --- Start -local tiaraKeyword = keywordHandler:addKeyword({ "tiara" }, StdModule.say, { npcHandler = npcHandler, text = "Well... maybe, if you help me a little, I could convince the academy of Edron that you are a valuable help here and deserve an award too. How about it?" }, function(player) - return player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonHatCloak) == -1 -end) -local yesKeyword = tiaraKeyword:addChildKeyword({ "yes" }, StdModule.say, { - npcHandler = npcHandler, - text = { - "Okay, great! You see, I need a few magical ingredients which I've run out of. First of all, please bring me 70 bat wings. ...", - "Then, I urgently need a lot of red cloth. I think 20 pieces should suffice. ...", - "Oh, and also, I could use a whole load of ape fur. Please bring me 40 pieces. ...", - "After that, um, let me think... I'd like to have some holy orchids. Or no, many holy orchids, to be safe. Like 35. ...", - "Then, 10 spools of spider silk yarn, 60 lizard scales and 40 red dragon scales. ...", - "I know I'm forgetting something.. wait... ah yes, 15 ounces of magic sulphur and 30 ounces of vampire dust. ...", - "That's it already! Easy task, isn't it? I'm sure you could get all of that within a short time. ...", - "Did you understand everything I told you and are willing to handle this task?", - }, -}) - -yesKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Fine! Let's start with the 70 bat wings. I really feel uncomfortable out there in the jungle.", reset = true }, nil, function(player) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.AddonHatCloak, 1) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.MissionHatCloak, 1) - player:setStorageValue(Storage.OutfitQuest.Ref, math.max(0, player:getStorageValue(Storage.OutfitQuest.Ref)) + 1) -end) -yesKeyword:addChildKeyword({ "no" }, StdModule.say, { npcHandler = npcHandler, text = "Would you like me to repeat the task requirements then?", moveup = 2 }) - -tiaraKeyword:addChildKeyword({ "no" }, StdModule.say, { npcHandler = npcHandler, text = "That's a pity.", reset = true }) -keywordHandler:addAliasKeyword({ "award" }) - --- When asking for your award before completing your tasks -keywordHandler:addKeyword({ "tiara" }, StdModule.say, { npcHandler = npcHandler, text = "Before I can nominate you for an award, please complete your task" }, function(player) - return player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonHatCloak) > 0 and player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonHatCloak) < 10 -end) -keywordHandler:addAliasKeyword({ "award" }) - --- What happens when you say task -local function addTaskKeyword(value, text) - keywordHandler:addKeyword({ "task" }, StdModule.say, { npcHandler = npcHandler, text = text }, function(player) - return player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonHatCloak) == value - end) - if value == 10 then - keywordHandler:addAliasKeyword({ "tiara" }) - keywordHandler:addAliasKeyword({ "award" }) +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 -end -addTaskKeyword(1, "Your current task is to bring me 70 bat wings, |PLAYERNAME|.") -addTaskKeyword(2, "Your current task is to bring me 20 pieces of red cloth, |PLAYERNAME|.") -addTaskKeyword(3, "Your current task is to bring me 40 pieces of ape fur, |PLAYERNAME|.") -addTaskKeyword(4, "Your current task is to bring me 35 holy orchids, |PLAYERNAME|.") -addTaskKeyword(5, "Your current task is to bring me 10 spools of spider silk yarn, |PLAYERNAME|.") -addTaskKeyword(6, "Your current task is to bring me 60 lizard scales, |PLAYERNAME|.") -addTaskKeyword(7, "Your current task is to bring me 40 red dragon scales, |PLAYERNAME|.") -addTaskKeyword(8, "Your current task is to bring me 15 ounces of magic sulphur, |PLAYERNAME|.") -addTaskKeyword(9, "Your current task is to bring me 30 ounces of vampire dust, |PLAYERNAME|.") -addTaskKeyword(10, "Go to the academy in Edron and tell Zoltan that I sent you, |PLAYERNAME|.") -addTaskKeyword(11, "I don't have any tasks for you right now, |PLAYERNAME|. You were of great help.") - --- Hand over items -local function addItemKeyword(keyword, text, value, itemId, count, last) - local itemKeyword = keywordHandler:addKeyword({ keyword }, StdModule.say, { npcHandler = npcHandler, text = text[1] }, function(player) - return player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonHatCloak) == value - end) - itemKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "No, no. That's not enough, I fear.", reset = true }, function(player) - return player:getItemCount(itemId) < count - end) - local rewardKeyword = itemKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = text[2] }, nil, function(player) - player:removeItem(itemId, count) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.AddonHatCloak, player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonHatCloak) + 1) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.MissionHatCloak, player:getStorageValue(Storage.OutfitQuest.MageSummoner.MissionHatCloak) + 1) - if not last then - npcHandler:resetNpc(player.uid) - end - end) - - if last then - rewardKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "I thought so. Go to the academy of Edron and tell Zoltan that I sent you. I will send a nomination to him. You were really a great help. Thanks again!", reset = true }) - rewardKeyword:addChildKeyword({ "no" }, StdModule.say, { npcHandler = npcHandler, text = "Really? Well, if you should change your mind, go to the academy of Edron and tell Zoltan that I sent you. I will send a nomination to him.", reset = true }) + if MsgContains(message, "outfit") then + npcHandler:say("This Tiara is an award by the academy of Edron in recognition of my service here.", npc, creature) + npcHandler:setTopic(playerId, 100) + elseif MsgContains(message, "tiara") and player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) < 1 then + if npcHandler:getTopic(playerId) ~= 100 then + npcHandler:say("Please ask about the 'outfit' first.", npc, creature) + else + local storageValue = player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) + if storageValue == -1 then + npcHandler:say("Well... maybe, if you help me a little, I could convince the academy of Edron that you are a valuable help here and deserve an award too. How about it?", npc, creature) + npcHandler:setTopic(playerId, 1) + elseif storageValue > 0 and storageValue < 10 then + npcHandler:say("Before I can nominate you for an award, please complete your task.", npc, creature) + elseif storageValue == 10 then + npcHandler:say("Go to the academy in Edron and tell Zoltan that I sent you, |PLAYERNAME|.", npc, creature) + elseif storageValue == 11 then + npcHandler:say("I don't have any tasks for you right now, |PLAYERNAME|. You were of great help.", npc, creature) + end + end + elseif npcHandler:getTopic(playerId) == 1 then + if MsgContains(message, "yes") then + npcHandler:say({ + "Okay, great! You see, I need a few magical ingredients which I've run out of. First of all, please bring me 70 bat wings. ...", + "Then, I urgently need a lot of red cloth. I think 20 pieces should suffice. ...", + "Oh, and also, I could use a whole load of ape fur. Please bring me 40 pieces. ...", + "After that, um, let me think... I'd like to have some holy orchids. Or no, many holy orchids, to be safe. Like 35. ...", + "Then, 10 spools of spider silk yarn, 60 lizard scales and 40 red dragon scales. ...", + "I know I'm forgetting something.. wait... ah yes, 15 ounces of magic sulphur and 30 ounces of vampire dust. ...", + "That's it already! Easy task, isn't it? I'm sure you could get all of that within a short time. ...", + "Did you understand everything I told you and are willing to handle this task?", + }, npc, creature) + npcHandler:setTopic(playerId, 2) + elseif MsgContains(message, "no") then + npcHandler:say("That's a pity.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + elseif npcHandler:getTopic(playerId) == 2 then + if MsgContains(message, "yes") then + npcHandler:say("Fine! Let's start with the 70 bat wings. I really feel uncomfortable out there in the jungle.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak, 1) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.MissionHatCloak, 1) + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "no") then + npcHandler:say("Would you like me to repeat the task requirements then?", npc, creature) + npcHandler:setTopic(playerId, 1) + end + elseif MsgContains(message, "task") then + local tasks = { + [1] = "Your current task is to bring me 70 bat wings, |PLAYERNAME|.", + [2] = "Your current task is to bring me 20 pieces of red cloth, |PLAYERNAME|.", + [3] = "Your current task is to bring me 40 pieces of ape fur, |PLAYERNAME|.", + [4] = "Your current task is to bring me 35 holy orchids, |PLAYERNAME|.", + [5] = "Your current task is to bring me 10 spools of spider silk yarn, |PLAYERNAME|.", + [6] = "Your current task is to bring me 60 lizard scales, |PLAYERNAME|.", + [7] = "Your current task is to bring me 40 red dragon scales, |PLAYERNAME|.", + [8] = "Your current task is to bring me 15 ounces of magic sulphur, |PLAYERNAME|.", + [9] = "Your current task is to bring me 30 ounces of vampire dust, |PLAYERNAME|.", + [10] = "Go to the academy in Edron and tell Zoltan that I sent you, |PLAYERNAME|.", + [11] = "I don't have any tasks for you right now, |PLAYERNAME|. You were of great help.", + } + local taskMessage = tasks[player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak)] + if taskMessage then + npcHandler:say(taskMessage, npc, creature) + end + elseif MsgContains(message, "bat wing") then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) == 1 then + npcHandler:say("Oh, did you bring the 70 bat wings for me?", npc, creature) + npcHandler:setTopic(playerId, 3) + end + elseif MsgContains(message, "red cloth") then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) == 2 then + npcHandler:say("Have you found 20 pieces of red cloth?", npc, creature) + npcHandler:setTopic(playerId, 4) + end + elseif MsgContains(message, "ape fur") then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) == 3 then + npcHandler:say("Were you able to retrieve 40 pieces of ape fur?", npc, creature) + npcHandler:setTopic(playerId, 5) + end + elseif MsgContains(message, "holy orchid") then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) == 4 then + npcHandler:say("Did you convince the elves to give you 35 holy orchids?", npc, creature) + npcHandler:setTopic(playerId, 6) + end + elseif MsgContains(message, "spider silk") then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) == 5 then + npcHandler:say("Oh, did you bring 10 spools of spider silk yarn for me?", npc, creature) + npcHandler:setTopic(playerId, 7) + end + elseif MsgContains(message, "lizard scale") then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) == 6 then + npcHandler:say("Have you found 60 lizard scales?", npc, creature) + npcHandler:setTopic(playerId, 8) + end + elseif MsgContains(message, "red dragon scale") then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) == 7 then + npcHandler:say("Were you able to get all 40 red dragon scales?", npc, creature) + npcHandler:setTopic(playerId, 9) + end + elseif MsgContains(message, "magic sulphur") then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) == 8 then + npcHandler:say("Have you collected 15 ounces of magic sulphur?", npc, creature) + npcHandler:setTopic(playerId, 10) + end + elseif MsgContains(message, "vampire dust") then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) == 9 then + npcHandler:say("Have you gathered 30 ounces of vampire dust?", npc, creature) + npcHandler:setTopic(playerId, 11) + end + elseif npcHandler:getTopic(playerId) == 3 then + if MsgContains(message, "yes") then + if player:getItemCount(5894) < 70 then + npcHandler:say("No, no. That's not enough, I fear.", npc, creature) + else + npcHandler:say("Thank you! I really needed them for my anti-wrinkle lotion. Now, please bring me 20 pieces of red cloth.", npc, creature) + player:removeItem(5894, 70) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak, 2) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.MissionHatCloak, 2) + end + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "no") then + npcHandler:say("Would you like me to repeat the task requirements then?", npc, creature) + npcHandler:setTopic(playerId, 1) + end + elseif npcHandler:getTopic(playerId) == 4 then + if MsgContains(message, "yes") then + if player:getItemCount(5911) < 20 then + npcHandler:say("No, no. That's not enough, I fear.", npc, creature) + else + npcHandler:say("Great! This should be enough for my new dress. Don't forget to bring me 40 pieces of ape fur next!", npc, creature) + player:removeItem(5911, 20) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak, 3) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.MissionHatCloak, 3) + end + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "no") then + npcHandler:say("Would you like me to repeat the task requirements then?", npc, creature) + npcHandler:setTopic(playerId, 1) + end + elseif npcHandler:getTopic(playerId) == 5 then + if MsgContains(message, "yes") then + if player:getItemCount(5883) < 40 then + npcHandler:say("No, no. That's not enough, I fear.", npc, creature) + else + npcHandler:say("Nice job, player. You see, I'm testing a new depilation cream. I guess if it works on ape fur it's good quality. Next, please bring me 35 holy orchids.", npc, creature) + player:removeItem(5883, 40) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak, 4) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.MissionHatCloak, 4) + end + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "no") then + npcHandler:say("Would you like me to repeat the task requirements then?", npc, creature) + npcHandler:setTopic(playerId, 1) + end + elseif npcHandler:getTopic(playerId) == 6 then + if MsgContains(message, "yes") then + if player:getItemCount(5922) < 35 then + npcHandler:say("No, no. That's not enough, I fear.", npc, creature) + else + npcHandler:say("Thank god! The scent of holy orchids is simply the only possible solution against the horrible stench from the tavern latrine. Now, please bring me 10 rolls of spider silk yarn.", npc, creature) + player:removeItem(5922, 35) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak, 5) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.MissionHatCloak, 5) + end + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "no") then + npcHandler:say("Would you like me to repeat the task requirements then?", npc, creature) + npcHandler:setTopic(playerId, 1) + end + elseif npcHandler:getTopic(playerId) == 7 then + if MsgContains(message, "yes") then + if player:getItemCount(5886) < 10 then + npcHandler:say("No, no. That's not enough, I fear.", npc, creature) + else + npcHandler:say("I appreciate it. My pet doggie manages to bite through all sorts of leashes, which is why he is always gone. I'm sure this strong yarn will keep him. Now, go for the 60 lizard scales!", npc, creature) + player:removeItem(5886, 10) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak, 6) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.MissionHatCloak, 6) + end + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "no") then + npcHandler:say("Would you like me to repeat the task requirements then?", npc, creature) + npcHandler:setTopic(playerId, 1) + end + elseif npcHandler:getTopic(playerId) == 8 then + if MsgContains(message, "yes") then + if player:getItemCount(5881) < 60 then + npcHandler:say("No, no. That's not enough, I fear.", npc, creature) + else + npcHandler:say("Good job. They will look almost like sequins on my new dress. Please go for the 40 red dragon scales now.", npc, creature) + player:removeItem(5881, 60) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak, 7) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.MissionHatCloak, 7) + end + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "no") then + npcHandler:say("Would you like me to repeat the task requirements then?", npc, creature) + npcHandler:setTopic(playerId, 1) + end + elseif npcHandler:getTopic(playerId) == 9 then + if MsgContains(message, "yes") then + if player:getItemCount(5882) < 40 then + npcHandler:say("No, no. That's not enough, I fear.", npc, creature) + else + npcHandler:say("Thanks! They make a pretty decoration, don't you think? Please bring me 15 ounces of magic sulphur now!", npc, creature) + player:removeItem(5882, 40) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak, 8) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.MissionHatCloak, 8) + end + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "no") then + npcHandler:say("Would you like me to repeat the task requirements then?", npc, creature) + npcHandler:setTopic(playerId, 1) + end + elseif npcHandler:getTopic(playerId) == 10 then + if MsgContains(message, "yes") then + if player:getItemCount(5904) < 15 then + npcHandler:say("No, no. That's not enough, I fear.", npc, creature) + else + npcHandler:say("Ah, that's enough magic sulphur for my new peeling. You should try it once, your skin gets incredibly smooth. Now, the only thing I need is vampire dust. 30 ounces will suffice.", npc, creature) + player:removeItem(5904, 15) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak, 9) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.MissionHatCloak, 9) + end + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "no") then + npcHandler:say("Would you like me to repeat the task requirements then?", npc, creature) + npcHandler:setTopic(playerId, 1) + end + elseif npcHandler:getTopic(playerId) == 11 then + if MsgContains(message, "yes") then + if player:getItemCount(5905) < 30 then + npcHandler:say("No, no. That's not enough, I fear.", npc, creature) + else + npcHandler:say("Ah, great. Now I can finally finish the potion which the academy of Edron asked me to. I guess, now you want your reward, don't you?", npc, creature) + player:removeItem(5905, 30) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak, 10) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.MissionHatCloak, 10) + end + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "no") then + npcHandler:say("Would you like me to repeat the task requirements then?", npc, creature) + npcHandler:setTopic(playerId, 1) + end + elseif MsgContains(message, "addon") then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) == 10 then + npcHandler:say("This Tiara is an award by the academy of Edron in recognition of my service here.", npc, creature) + npcHandler:setTopic(playerId, 12) + end + elseif npcHandler:getTopic(playerId) == 12 then + if MsgContains(message, "tiara") and player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) == 10 then + npcHandler:say("Go to the academy in Edron and tell Zoltan that I sent you, |PLAYERNAME|.", npc, creature) + end end - itemKeyword:addChildKeyword({ "no" }, StdModule.say, { npcHandler = npcHandler, text = "That's a pity.", reset = true }) - keywordHandler:addKeyword({ keyword }, StdModule.say, { npcHandler = npcHandler, text = text[3] }) + return true end -addItemKeyword("bat wing", { "Oh, did you bring the 70 bat wings for me?", "Thank you! I really needed them for my anti-wrinkle lotion. Now, please bring me 20 pieces of {red cloth}.", "I love to say 'creatures of the night'. Got a dramatic as well as romantic ring to it." }, 1, 5894, 70) -addItemKeyword("red cloth", { "Have you found 20 pieces of red cloth?", "Great! This should be enough for my new dress. Don't forget to bring me 40 pieces of {ape fur} next!", "Nice material for a cape, isn't it?" }, 2, 5911, 20) -addItemKeyword("ape fur", { "Were you able to retrieve 40 pieces of ape fur?", "Nice job, player. You see, I'm testing a new depilation cream. I guess if it works on ape fur it's good quality. Next, please bring me 35 {holy orchids}.", "This feels really smooth." }, 3, 5883, 40) -addItemKeyword("holy orchid", { "Did you convince the elves to give you 35 holy orchids?", "Thank god! The scent of holy orchids is simply the only possible solution against the horrible stench from the tavern latrine. Now, please bring me 10 rolls of {spider silk yarn}!", "I heard that some elves cultivate these flowers." }, 4, 5922, 35) -addItemKeyword( - "spider silk", - { "Oh, did you bring 10 spools of spider silk yarn for me?", "I appreciate it. My pet doggie manages to bite through all sorts of leashes, which is why he is always gone. I'm sure this strong yarn will keep him. Now, go for the 60 {lizard scales}!", "Only very large spiders produce silk which is strong enough to be yarned. I heard that mermaids can turn spider silk into yarn." }, - 5, - 5886, - 10 -) -addItemKeyword("lizard scale", { "Have you found 60 lizard scales?", "Good job. They will look almost like sequins on my new dress. Please go for the 40 {red dragon scales} now.", "Lizard scales are great for all sorts of magical potions." }, 6, 5881, 60) -addItemKeyword("red dragon scale", { "Were you able to get all 40 red dragon scales?", "Thanks! They make a pretty decoration, don't you think? Please bring me 15 ounces of {magic sulphur} now!", "Red dragon scales are hard to come by, but much harder than the green ones." }, 7, 5882, 40) -addItemKeyword("magic sulphur", { "Have you collected 15 ounces of magic sulphur?", "Ah, that's enough magic sulphur for my new peeling. You should try it once, your skin gets incredibly smooth. Now, the only thing I need is {vampire dust}. 30 ounces will suffice.", "Magic sulphur can be extracted from magical weapons. I heard that Djinns are good at magical extractions." }, 8, 5904, 15) -addItemKeyword( - "vampire dust", - { "Have you gathered 30 ounces of vampire dust?", "Ah, great. Now I can finally finish the potion which the academy of Edron asked me to. I guess, now you want your reward, don't you?", "The Tibian vampires are quite restistant. I needs a special blessed stake to turn their corpse into dust, and it doesn't work all the time. Maybe a priest can help you." }, - 9, - 5905, - 30, - true -) - --- Basic -keywordHandler:addKeyword({ "outfit" }, StdModule.say, { npcHandler = npcHandler, text = "This Tiara is an award by the academy of Edron in recognition of my service here." }) - npcHandler:setMessage(MESSAGE_GREET, "Greetings, |PLAYERNAME|. If you are looking for sorcerer {spells} don't hesitate to ask.") npcHandler:setMessage(MESSAGE_FAREWELL, "Farewell, |PLAYERNAME|.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Farewell.") +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/nah_bob.lua b/data-otservbr-global/npc/nah_bob.lua index e63fffef7ba..a2511034e06 100644 --- a/data-otservbr-global/npc/nah_bob.lua +++ b/data-otservbr-global/npc/nah_bob.lua @@ -45,6 +45,37 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local function endConversationWithDelay(npcHandler, npc, creature) + addEvent(function() + npcHandler:unGreet(npc, creature) + end, 1000) +end + +local function greetCallback(npc, creature, message) + local player = Player(creature) + local playerId = player:getId() + + if not MsgContains(message, "djanni'hah") then + npcHandler:say("Whoa! A human! This is no place for you, |PLAYERNAME|. Go and play somewhere else.", npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Start) == 1 then + npcHandler:say({ + "Hahahaha! ...", + "|PLAYERNAME|, that almost sounded like the word of greeting. Humans - cute they are!", + }, npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + npcHandler:say(" Another {customer}! I've only just sat down! What is it, |PLAYERNAME|?", npc, creature) + npcHandler:setInteraction(npc, creature) + + return true +end + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -89,7 +120,7 @@ local function onTradeRequest(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.DjinnWar.MaridFaction.Mission03) ~= 3 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission03) ~= 3 then npcHandler:say("I'm sorry, human. But you need Gabel's permission to trade with me.", npc, creature) return false end @@ -97,13 +128,16 @@ local function onTradeRequest(npc, creature) return true end -npcHandler:setMessage(MESSAGE_GREET, " Another {customer}! I've only just sat down! What is it, |PLAYERNAME|?") +-- Greeting +keywordHandler:addCustomGreetKeyword({ "djanni'hah" }, greetCallback, { npcHandler = npcHandler }) + npcHandler:setMessage(MESSAGE_FAREWELL, "Bye now, Neutrala |PLAYERNAME|. Visit old Bob again one day!") npcHandler:setMessage(MESSAGE_WALKAWAY, "Bye then.") npcHandler:setMessage(MESSAGE_SENDTRADE, "At your service, just browse through my wares.") npcHandler:setCallback(CALLBACK_ON_TRADE_REQUEST, onTradeRequest) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) +npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) npcConfig.shop = { diff --git a/data-otservbr-global/npc/ninev.lua b/data-otservbr-global/npc/ninev.lua index f21ae7ed612..b888f005330 100644 --- a/data-otservbr-global/npc/ninev.lua +++ b/data-otservbr-global/npc/ninev.lua @@ -60,29 +60,29 @@ local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { "Is this stake really important enough to you so that you are willing to take this burden?", }, }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == -1 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == -1 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Alright, I guess you need a stake first. Maybe Gamon can help you, the leg of a chair or something could just do. Try asking him for a stake, and if you have one, bring it back to me.", reset = true, ungreet = true }, nil, function(player) - player:setStorageValue(Storage.FriendsandTraders.DefaultStart, 1) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 1) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.DefaultStart, 1) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 1) end) -- First prayer keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "I guess you couldn't convince Gamon to give you a stake, eh?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 1 and player:getItemCount(5941) == 0 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 1 and player:getItemCount(5941) == 0 end) local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Yes, I was informed what to do. Are you prepared to receive my line of the prayer?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 1 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 1 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "So receive my prayer: 'Light shall be near - and darkness afar'. Now, bring your stake to Tibra in the Carlin church for the next line of the prayer. I will inform her what to do.", reset = true }, nil, function(player) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 2) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 2) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end) stakeKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "I will wait for you.", reset = true }) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You should visit Tibra in the Carlin church now." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 2 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 2 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You already received my line of the prayer." }) diff --git a/data-otservbr-global/npc/norma.lua b/data-otservbr-global/npc/norma.lua index dc6b1178281..693dc7fadbb 100644 --- a/data-otservbr-global/npc/norma.lua +++ b/data-otservbr-global/npc/norma.lua @@ -78,24 +78,22 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "addon") or MsgContains(message, "outfit") or MsgContains(message, "hat") then - local addonProgress = player:getStorageValue(Storage.OutfitQuest.Citizen.MissionHat) - if addonProgress < 1 then - npcHandler:say("Pretty, isn't it? My friend Amber taught me how to make it, but I could help you with one if you like. What do you say?", npc, creature) - npcHandler:setTopic(playerId, 1) - elseif addonProgress == 1 then + if player:getStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.AddonHatRook) == 1 then npcHandler:say("Oh, you're back already? Did you bring a legion helmet, 100 chicken feathers and 50 honeycombs?", npc, creature) npcHandler:setTopic(playerId, 2) - elseif addonProgress == 2 then - npcHandler:say("Pretty hat, isn't it?", npc, creature) + elseif player:getStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.MissionHatRookRook) < 1 then + npcHandler:say("Pretty, isn't it? I made it myself, but I could teach you how to do that if you like. What do you say?", npc, creature) + npcHandler:setTopic(playerId, 1) end + return true end if npcHandler:getTopic(playerId) == 1 then if MsgContains(message, "yes") then - player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) - player:setStorageValue(Storage.OutfitQuest.Citizen.MissionHat, 1) - npcHandler:say("Okay, here we go, listen closely! I need a few things... a basic hat of course, maybe a legion helmet would do. Then about 100 chicken feathers... and 50 honeycombs as glue. That's it, come back to me once you gathered it!", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.AddonHatRook, 1) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.MissionHatRook, 1) + npcHandler:say("Okay, here we go, listen closely! I need a few things... a basic hat of course, maybe a legion helmet would do. Then about 100 chicken feathers... and 50 honeycombs as glue.That's it, come back to me once you gathered it!!", npc, creature) else npcHandler:say("Aw, I guess you don't like feather hats. No big deal.", npc, creature) end @@ -111,15 +109,13 @@ local function creatureSayCallback(npc, creature, type, message) else npcHandler:say("Great job! That must have taken a lot of work. Okay, you put it like this... then glue like this... here!", npc, creature) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - player:removeItem(3374, 1) player:removeItem(5902, 50) player:removeItem(5890, 100) - player:addOutfitAddon(136, 2) player:addOutfitAddon(128, 2) - - player:setStorageValue(Storage.OutfitQuest.Citizen.MissionHat, 2) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.MissionHatRook, 0) + player:setStorageValue(Storage.Quest.U7_8.CitizenOutfitsRook.AddonHatRook, 2) end else npcHandler:say("Maybe another time.", npc, creature) diff --git a/data-otservbr-global/npc/ocelus.lua b/data-otservbr-global/npc/ocelus.lua index d0032104e74..c705fd08c8b 100644 --- a/data-otservbr-global/npc/ocelus.lua +++ b/data-otservbr-global/npc/ocelus.lua @@ -59,7 +59,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "eleonore") then - if player:getStorageValue(Storage.TheShatteredIsles.APoemForTheMermaid) == 2 and player:getStorageValue(Storage.TheShatteredIsles.ADjinnInLove) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.APoemForTheMermaid) == 2 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ADjinnInLove) < 1 then npcHandler:say("I heard the birds sing about her beauty. But how could a human rival the enchanting beauty of a {mermaid}?", npc, creature) npcHandler:setTopic(playerId, 1) end @@ -70,9 +70,9 @@ local function creatureSayCallback(npc, creature, type, message) "... I guess I am quite shy. Oh my, if I were not blue, I would turn red now. If there would be someone to arrange a {date} with her.", }, npc, creature) npcHandler:setTopic(playerId, 2) - elseif player:getStorageValue(Storage.TheShatteredIsles.ADjinnInLove) == 2 then + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ADjinnInLove) == 2 then npcHandler:say("Oh my. Its not easy to impress a mermaid I guess. Please get me a {love poem}. I think elves are the greatest poets so their city seems like a good place to look for one.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.ADjinnInLove, 3) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ADjinnInLove, 3) end elseif MsgContains(message, "date") then if npcHandler:getTopic(playerId) == 2 then @@ -83,12 +83,12 @@ local function creatureSayCallback(npc, creature, type, message) if npcHandler:getTopic(playerId) == 3 then npcHandler:say("Thank you. How ironic, a human granting a djinn a wish.", npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.TheShatteredIsles.ADjinnInLove, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ADjinnInLove, 1) elseif npcHandler:getTopic(playerId) == 4 then if player:removeItem(6119, 1) then npcHandler:say("Excellent. Here, with this little spell I enable you to recite the poem like a true elven poet. Now go and ask her for a date again.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.ADjinnInLove, 4) - player:setStorageValue(Storage.TheShatteredIsles.APoemForTheMermaid, 3) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ADjinnInLove, 4) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.APoemForTheMermaid, 3) npcHandler:setTopic(playerId, 0) else npcHandler:setTopic(playerId, 0) @@ -96,7 +96,7 @@ local function creatureSayCallback(npc, creature, type, message) end end elseif MsgContains(message, "love poem") then - if player:getStorageValue(Storage.TheShatteredIsles.ADjinnInLove) == 3 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ADjinnInLove) == 3 then npcHandler:say("Did you get a love poem from Ab'Dendriel?", npc, creature) npcHandler:setTopic(playerId, 4) end diff --git a/data-otservbr-global/npc/oldrak.lua b/data-otservbr-global/npc/oldrak.lua index ff5860fa322..cc064dfd8c6 100644 --- a/data-otservbr-global/npc/oldrak.lua +++ b/data-otservbr-global/npc/oldrak.lua @@ -22,9 +22,6 @@ npcConfig.outfit = { npcConfig.flags = { floorchange = false, } -npcConfig.shop = { - { itemName = "holy tible", clientId = 2836 }, -} -- On buy npc shop message npcType.onBuyItem = function(npc, player, itemId, subType, amount, ignore, inBackpacks, totalCost) @@ -176,6 +173,24 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Yenny, known as the Gentle, was one of the most powerful wielders of magic in ancient times. She was known throughout the world for her mercy and kindness.", npc, creature) npcHandler:setTopic(playerId, 0) end + + if MsgContains(message, "holy") or MsgContains(message, "tible") then + if player:getStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ChestTible) == 1 then + npcHandler:say("Would you like to buy a The Holy Tible for 1000 gold?", npc, creature) + npcHandler:setTopic(playerId, 3) + else + npcHandler:say("You need to complete the quest for the book first before you can buy The Holy Tible.", npc, creature) + end + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 then + if player:removeMoney(1000) then + player:addItem(2836, 1) + npcHandler:say("Here is your The Holy Tible.", npc, creature) + else + npcHandler:say("You do not have enough money.", npc, creature) + end + npcHandler:setTopic(playerId, 0) + end + return true end diff --git a/data-otservbr-global/npc/partos.lua b/data-otservbr-global/npc/partos.lua index 2172e137a57..a1587e9c4cf 100644 --- a/data-otservbr-global/npc/partos.lua +++ b/data-otservbr-global/npc/partos.lua @@ -59,12 +59,12 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "supplies") then - if player:getStorageValue(Storage.DjinnWar.EfreetFaction.Mission01) == 1 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission01) == 1 then npcHandler:say({ "What!? I bet, Baa'leal sent you! ...", "I won't tell you anything! Shove off!", }, npc, creature) - player:setStorageValue(Storage.DjinnWar.EfreetFaction.Mission01, 2) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission01, 2) else npcHandler:say("I won't talk about that.", npc, creature) end diff --git a/data-otservbr-global/npc/pemaret.lua b/data-otservbr-global/npc/pemaret.lua index ab8ea5ecc62..3af5fc2d0c7 100644 --- a/data-otservbr-global/npc/pemaret.lua +++ b/data-otservbr-global/npc/pemaret.lua @@ -59,14 +59,17 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "marlin") then - if player:getItemCount(901) > 0 then - npcHandler:say("WOW! You have a marlin!! I could make a nice decoration for your wall from it. May I have it?", npc, creature) - npcHandler:setTopic(playerId, 1) + if player:getStorageValue(Storage.Quest.U7_8.MarlinTrophy) < 1 then + if player:getItemCount(901) > 0 then + npcHandler:say("WOW! You have a marlin!! I could make a nice decoration for your wall from it. May I have it?", npc, creature) + npcHandler:setTopic(playerId, 1) + end end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U7_8.MarlinTrophy) < 1 then if player:removeItem(901, 1) then npcHandler:say("Yeah! Now let's see... There you go, I hope you like it!", npc, creature) player:addItem(902, 1) + player:setStorageValue(Storage.Quest.U7_8.MarlinTrophy, 1) else npcHandler:say("You don't have the fish.", npc, creature) end diff --git a/data-otservbr-global/npc/quentin.lua b/data-otservbr-global/npc/quentin.lua index 905933053e3..5a60aded8e0 100644 --- a/data-otservbr-global/npc/quentin.lua +++ b/data-otservbr-global/npc/quentin.lua @@ -55,29 +55,29 @@ local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { "Is this stake really important enough to you so that you are willing to take this burden?", }, }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == -1 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == -1 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Alright, I guess you need a stake first. Maybe Gamon can help you, the leg of a chair or something could just do. Try asking him for a stake, and if you have one, bring it back to me.", reset = true, ungreet = true }, nil, function(player) - player:setStorageValue(Storage.FriendsandTraders.DefaultStart, 1) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 1) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.DefaultStart, 1) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 1) end) -- First prayer keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "I guess you couldn't convince Gamon to give you a stake, eh?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 1 and player:getItemCount(5941) == 0 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 1 and player:getItemCount(5941) == 0 end) -local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Yes, I was informed what to do. Are you prepared to receive my line of the prayer?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 1 +local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Ah, I see you brought a stake with you. Are you ready to receive my line of the prayer then?" }, function(player) + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 1 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "So receive my prayer: 'Light shall be near - and darkness afar'. Now, bring your stake to Tibra in the Carlin church for the next line of the prayer. I will inform her what to do.", reset = true }, nil, function(player) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 2) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 2) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end) stakeKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "I will wait for you.", reset = true }) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You should visit Tibra in the Carlin church now." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 2 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 2 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You already received my line of the prayer." }) diff --git a/data-otservbr-global/npc/rahkem.lua b/data-otservbr-global/npc/rahkem.lua index b585aa0ec9f..a50f7c2aa7c 100644 --- a/data-otservbr-global/npc/rahkem.lua +++ b/data-otservbr-global/npc/rahkem.lua @@ -121,23 +121,23 @@ keywordHandler:addKeyword({ "heal" }, StdModule.say, { npcHandler = npcHandler, -- Wooden Stake keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "I think you have forgotten to bring your stake, pilgrim." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 8 and player:getItemCount(5941) == 0 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 8 and player:getItemCount(5941) == 0 end) local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Yes, I was informed what to do. Are you prepared to receive my line of the prayer?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 8 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 8 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "So receive my prayer: 'Let there be power and compassion'. Now, bring your stake to Brewster in Port Hope for the next line of the prayer. I will inform him what to do.", reset = true }, nil, function(player) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 9) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 9) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end) stakeKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "I will wait for you.", reset = true }) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You should visit Brewster in Port Hope now." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 9 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 9 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You already received my line of the prayer." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) > 9 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) > 9 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "A blessed stake? That is a strange request. Maybe Quentin knows more, he is one of the oldest monks after all." }) diff --git a/data-otservbr-global/npc/rata_mari.lua b/data-otservbr-global/npc/rata_mari.lua index 03284edad00..1d81ea47dcb 100644 --- a/data-otservbr-global/npc/rata_mari.lua +++ b/data-otservbr-global/npc/rata_mari.lua @@ -47,7 +47,7 @@ end local function greetCallback(npc, creature) local playerId = creature:getId() - if Player(creature):getStorageValue(Storage.DjinnWar.MaridFaction.Mission02) == -1 then + if Player(creature):getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission02) == -1 then return false end return true @@ -62,7 +62,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "spy report") then - local reportProgress = player:getStorageValue(Storage.DjinnWar.MaridFaction.RataMari) + local reportProgress = player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.RataMari) if reportProgress < 1 then npcHandler:say({ "You have come for the report? Great! I have been working hard on it during the last months. And nobody came to pick it up. I thought everybody had forgotten about me! ...", @@ -71,7 +71,7 @@ local function creatureSayCallback(npc, creature, type, message) "All right - listen - I know Fa'hradin would not approve of this, but I can't help it. I need some cheese! I need it now! ...", "And I will not give the report to you until you get me some! Meep!", }, npc, creature) - player:setStorageValue(Storage.DjinnWar.MaridFaction.RataMari, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.RataMari, 1) elseif reportProgress == 1 then npcHandler:say("Ok, have you brought me the cheese, I've asked for?", npc, creature) npcHandler:setTopic(playerId, 1) @@ -84,7 +84,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("No cheese - no report.", npc, creature) return true end - player:setStorageValue(Storage.DjinnWar.MaridFaction.RataMari, 2) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.RataMari, 2) player:addItem(3232, 1) npcHandler:say("Meep! Meep! Great! Here is the spyreport for you!", npc, creature) else diff --git a/data-otservbr-global/npc/raymond_striker.lua b/data-otservbr-global/npc/raymond_striker.lua index 37cb0dbe557..e31e737321c 100644 --- a/data-otservbr-global/npc/raymond_striker.lua +++ b/data-otservbr-global/npc/raymond_striker.lua @@ -59,29 +59,29 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "eleonore") then - if player:getStorageValue(Storage.TheShatteredIsles.APoemForTheMermaid) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.APoemForTheMermaid) < 1 then npcHandler:say("Eleonore ... Yes, I remember her... vaguely. She is a pretty girl ... but still only a girl and now I am in love with a beautiful and passionate woman. A true {mermaid} even.", npc, creature) npcHandler:setTopic(playerId, 1) end elseif MsgContains(message, "mission") then - if player:getStorageValue(Storage.TheShatteredIsles.APoemForTheMermaid) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.APoemForTheMermaid) < 1 then npcHandler:say("Don't ask about silly missions. All I can think about is this lovely {mermaid}.", npc, creature) npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.TheShatteredIsles.APoemForTheMermaid) == 3 and player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) < 1 then + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.APoemForTheMermaid) == 3 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) < 1 then npcHandler:say("Ask around in the settlement where you can help out. If you have proven your worth I might have some missions for you.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 1) - elseif player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 14 and player:getStorageValue(Storage.TheShatteredIsles.RaysMission1) < 1 then + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 1) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 13 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission1) < 1 then npcHandler:say({ "Indeed, I could use some help. The evil pirates of Nargor have convinced an alchemist from Edron to supply them with a substance called Fafnar's Fire ...", "It can burn even on water and is a threat to us all. I need you to travel to Edron and pretend to the alchemist Sandra that you are the one whom the other pirates sent to get the fire ...", "When she asks for a payment, tell her 'Your continued existence is payment enough'. That should enrage any member of the Edron academy enough to refuse any further deals with the pirates.", }, npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.RaysMission1, 1) - elseif player:getStorageValue(Storage.TheShatteredIsles.RaysMission1) == 2 then + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission1, 1) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission1) == 2 then npcHandler:say("I think that means 'mission accomplished'. Hehe. I guess that will put an end to their efforts to buy any alchemical substance from Edron.", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 15) - player:setStorageValue(Storage.TheShatteredIsles.RaysMission1, 3) - elseif player:getStorageValue(Storage.TheShatteredIsles.RaysMission1) == 3 and player:getStorageValue(Storage.TheShatteredIsles.RaysMission2) < 1 then + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 15) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission1, 3) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission1) == 3 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission2) < 1 then npcHandler:say({ "The mission on which I will send you is vital to our cause. It is a sabotage mission. Nargor is guarded by several heavy catapults. ...", "I need you to sabotage the most dangerous of those catapults which can be found right in their harbour, aiming at ships passing by the entrance. ...", @@ -91,13 +91,13 @@ local function creatureSayCallback(npc, creature, type, message) "Of course, he can't drop you off directly in the pirate's base. However, we have discovered a secret way into the Howling Grotto. ...", "Try to make your way through the caves of Nargor to reach their harbour. This is where you will find the catapult in question.", }, npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.AccessToNargor, 1) - player:setStorageValue(Storage.TheShatteredIsles.RaysMission2, 1) - elseif player:getStorageValue(Storage.TheShatteredIsles.RaysMission2) == 2 and player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 16 then + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.AccessToNargor, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission2, 1) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission2) == 2 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 16 then npcHandler:say("You did it! Excellent!", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 18) - player:setStorageValue(Storage.TheShatteredIsles.RaysMission2, 3) - elseif player:getStorageValue(Storage.TheShatteredIsles.RaysMission2) == 3 and player:getStorageValue(Storage.TheShatteredIsles.RaysMission3) < 1 then + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 18) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission2, 3) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission2) == 3 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission3) < 1 then npcHandler:say({ "If you manage to accomplish this vital mission you will prove yourself to be a worthy member of our community. Imight even grant you your own ship and pirate clothing! ...", "So listen to the first step of my plan. I want you to infiltrate their base. Try to enter their tavern, which meansthat you have to get past the guard. ...", @@ -105,52 +105,52 @@ local function creatureSayCallback(npc, creature, type, message) "In the tavern, the pirates feel safe and plan their next strikes. Study ALL of their maps and plans lying around ...", "Afterwards, return here and report to me about your mission.", }, npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.RaysMission3, 1) - elseif player:getStorageValue(Storage.TheShatteredIsles.RaysMission3) == 1 and player:getStorageValue(Storage.TheShatteredIsles.TavernMap1) == 1 and player:getStorageValue(Storage.TheShatteredIsles.TavernMap2) == 1 and player:getStorageValue(Storage.TheShatteredIsles.TavernMap3) == 1 then + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission3, 1) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission3) == 1 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TavernMap1) == 1 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TavernMap2) == 1 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TavernMap3) == 1 then npcHandler:say({ "Well done, my friend. That will help us a lot. Of course there are other things to be done though. ...", "I learned that Klaus, the owner of the tavern, wants me dead. He is offering any of those pirates a mission to kill me....", "If we could convince him that you fulfilled that mission, the pirates will have the party of their lives. This would beour chance for a sneak attack to damage their boats and steal their plunder! ...", "Obtain this mission from him and learn what he needs as a proof. Then return to me and report to me about yourmission so we can formulate an appropriate plan.", }, npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 20) - player:setStorageValue(Storage.TheShatteredIsles.RaysMission3, 3) - player:setStorageValue(Storage.TheShatteredIsles.RaysMission4, 1) - elseif player:getStorageValue(Storage.TheShatteredIsles.RaysMission4) == 2 then + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 20) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission3, 3) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission4, 1) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission4) == 2 then npcHandler:say("My pillow?? They know me all too well... I've owned it since my childhood. However. Here, take it and convincehim that I am dead.", npc, creature) player:addItem(6105, 1) - player:setStorageValue(Storage.TheShatteredIsles.RaysMission4, 3) - elseif player:getStorageValue(Storage.TheShatteredIsles.RaysMission4) == 4 then + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission4, 3) + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission4) == 4 then npcHandler:say({ "Incredible! You did what no other did even dare to think about! You are indeed a true hero to our cause ...", "Sadly I have no ship that lacks a captain, else you would of course be our first choice. I am still true to my word asbest as I am able. ...", "So take this as your very own ship. Oh, and remind me about the pirate outfit sometime.", }, npc, creature) player:addItem(2994, 1) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 21) - player:setStorageValue(Storage.TheShatteredIsles.RaysMission4, 5) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 21) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission4, 5) end elseif MsgContains(message, "mermaid") then - if player:getStorageValue(Storage.TheShatteredIsles.APoemForTheMermaid) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.APoemForTheMermaid) < 1 then if npcHandler:getTopic(playerId) == 1 then npcHandler:say("The mermaid is the most beautiful creature I have ever met. She is so wonderful. It was some kind of magic as we first met. A look in her eyes and I suddenly knew there would be never again another woman in my life but her.", npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.TheShatteredIsles.APoemForTheMermaid, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.APoemForTheMermaid, 1) end - elseif player:getStorageValue(Storage.TheShatteredIsles.APoemForTheMermaid) == 1 and player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) < 1 then + elseif player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.APoemForTheMermaid) == 1 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) < 1 then npcHandler:say("I am deeply ashamed that I lacked the willpower to resist her spell. Thank you for your help in that matter. Now my head is once more free to think about our {mission}.", npc, creature) npcHandler:setTopic(playerId, 1) end elseif MsgContains(message, "pirate outfit") then - if player:getStorageValue(Storage.TheShatteredIsles.AccessToLagunaIsland) == 1 and player:getStorageValue(Storage.OutfitQuest.PirateBaseOutfit) < 1 and player:getStorageValue(Storage.TheShatteredIsles.RaysMission4) == 5 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.AccessToLagunaIsland) == 1 and player:getStorageValue(Storage.Quest.U7_8.PirateOutfits.PirateBaseOutfit) < 1 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission4) == 5 then npcHandler:say("Ah, right! The pirate outfit! Here you go, now you are truly one of us.", npc, creature) player:addOutfit(151) player:addOutfit(155) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) - player:setStorageValue(Storage.OutfitQuest.PirateBaseOutfit, 1) + player:setStorageValue(Storage.Quest.U7_8.PirateOutfits.PirateBaseOutfit, 1) npcHandler:setTopic(playerId, 0) end - elseif MsgContains(message, "task") and player:getStorageValue(Storage.TheShatteredIsles.RaysMission4) == 5 then + elseif MsgContains(message, "task") and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission4) == 5 then if player:getStorageValue(Storage.KillingInTheNameOf.PirateTask) < 0 then npcHandler:say({ "The pirates on Nargor are becoming more and more of a threat to us each day. I wish someone could get rid of them once and for all, but unfortunately they just keep coming! ...", diff --git a/data-otservbr-global/npc/razan.lua b/data-otservbr-global/npc/razan.lua index 0882e172f62..57fb6fdf4f9 100644 --- a/data-otservbr-global/npc/razan.lua +++ b/data-otservbr-global/npc/razan.lua @@ -103,20 +103,15 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "outfit") then - npcHandler:say(player:getSex() == PLAYERSEX_FEMALE and "My turban? I know something better for a pretty girl like you. Why don't you go talk to Miraia?" or "My turban? Eh no, you can't have it. Only oriental weaponmasters may wear it after having completed a difficult task.", npc, creature) - elseif MsgContains(message, "task") then - if player:getSex() == PLAYERSEX_FEMALE then - npcHandler:say("I really don't want to make girls work for me. If you are looking for a job, ask Miraia.", npc, creature) - return true - end - - if player:getStorageValue(Storage.OutfitQuest.secondOrientalAddon) < 1 then + if player:getSex() == PLAYERSEX_MALE and MsgContains(message, "outfit") then + npcHandler:say("My turban? Eh no, you can't have it. Only oriental weapon masters may wear it after having completed a difficult task.", npc, creature) + elseif player:getSex() == PLAYERSEX_MALE and MsgContains(message, "task") then + if player:getStorageValue(Storage.Quest.U7_8.OrientalOutfits.SecondOrientalAddon) < 1 then npcHandler:say("You mean, you would like to prove that you deserve to wear such a turban?", npc, creature) npcHandler:setTopic(playerId, 1) end elseif config[message] and npcHandler:getTopic(playerId) == 0 then - if player:getStorageValue(Storage.OutfitQuest.secondOrientalAddon) == config[message].storageValue then + if player:getStorageValue(Storage.Quest.U7_8.OrientalOutfits.SecondOrientalAddon) == config[message].storageValue then npcHandler:say(config[message].text[1], npc, creature) npcHandler:setTopic(playerId, 3) topic[playerId] = message @@ -138,7 +133,7 @@ local function creatureSayCallback(npc, creature, type, message) if player:getStorageValue(Storage.OutfitQuest.DefaultStart) ~= 1 then player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) end - player:setStorageValue(Storage.OutfitQuest.secondOrientalAddon, 1) + player:setStorageValue(Storage.Quest.U7_8.OrientalOutfits.SecondOrientalAddon, 1) npcHandler:say("Excellent! Come back to me once you have collected 100 pieces of ape fur.", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then @@ -149,10 +144,9 @@ local function creatureSayCallback(npc, creature, type, message) return true end - player:setStorageValue(Storage.OutfitQuest.secondOrientalAddon, player:getStorageValue(Storage.OutfitQuest.secondOrientalAddon) + 1) - if player:getStorageValue(Storage.OutfitQuest.secondOrientalAddon) == 5 then - player:addOutfitAddon(146, 2) - player:addOutfitAddon(150, 2) + player:setStorageValue(Storage.Quest.U7_8.OrientalOutfits.SecondOrientalAddon, player:getStorageValue(Storage.Quest.U7_8.OrientalOutfits.SecondOrientalAddon) + 1) + if player:getStorageValue(Storage.Quest.U7_8.OrientalOutfits.SecondOrientalAddon) == 5 then + player:addOutfitAddon(146, 2) -- male addon player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end npcHandler:say(targetMessage.text[3], npc, creature) diff --git a/data-otservbr-global/npc/sam.lua b/data-otservbr-global/npc/sam.lua index fdca8c02f01..0fb2e8e1b5a 100644 --- a/data-otservbr-global/npc/sam.lua +++ b/data-otservbr-global/npc/sam.lua @@ -65,16 +65,16 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "adorn") or MsgContains(message, "outfit") or MsgContains(message, "addon") then - local addonProgress = player:getStorageValue(Storage.OutfitQuest.Knight.AddonHelmet) + local addonProgress = player:getStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonHelmet) if addonProgress == 5 then - player:setStorageValue(Storage.OutfitQuest.Knight.MissionHelmet, 6) - player:setStorageValue(Storage.OutfitQuest.Knight.AddonHelmet, 6) - player:setStorageValue(Storage.OutfitQuest.Knight.AddonHelmetTimer, os.time() + 7200) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.MissionHelmet, 6) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonHelmet, 6) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonHelmetTimer, os.time() + 7200) -- 2 hours npcHandler:say("Oh, Gregor sent you? I see. It will be my pleasure to adorn your helmet. Please give me some time to finish it.", npc, creature) elseif addonProgress == 6 then - if player:getStorageValue(Storage.OutfitQuest.Knight.AddonHelmetTimer) < os.time() then - player:setStorageValue(Storage.OutfitQuest.Knight.MissionHelmet, 0) - player:setStorageValue(Storage.OutfitQuest.Knight.AddonHelmet, 7) + if player:getStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonHelmetTimer) < os.time() then + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.MissionHelmet, 0) + player:setStorageValue(Storage.Quest.U7_8.KnightOutfits.AddonHelmet, 7) player:setStorageValue(Storage.OutfitQuest.Ref, math.min(0, player:getStorageValue(Storage.OutfitQuest.Ref) - 1)) player:addOutfitAddon(131, 2) player:addOutfitAddon(139, 2) @@ -89,7 +89,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Sorry, but without the permission of Gregor I cannot help you with this matter.", npc, creature) end elseif MsgContains(message, "old backpack") or MsgContains(message, "backpack") then - if player:getStorageValue(Storage.SamsOldBackpack) < 1 then + if player:getStorageValue(Storage.Quest.U7_5.SamsOldBackpack.SamsOldBackpackNpc) < 1 then npcHandler:say("What? Are you telling me you found my old adventurer's backpack that I lost years ago??", npc, creature) npcHandler:setTopic(playerId, 1) end @@ -113,7 +113,7 @@ local function creatureSayCallback(npc, creature, type, message) "Thank you very much! This brings back good old memories! Please, as a reward, travel to Kazordoon and ask my old friend Kroox to provide you a special dwarven armor. ...", "I will mail him about you immediately. Just tell him, his old buddy Sam is sending you.", }, npc, creature) - player:setStorageValue(Storage.SamsOldBackpack, 1) + player:setStorageValue(Storage.Quest.U7_5.SamsOldBackpack.SamsOldBackpackNpc, 1) player:addAchievement("Backpack Tourist") else npcHandler:say("You don't have it...", npc, creature) diff --git a/data-otservbr-global/npc/sandra.lua b/data-otservbr-global/npc/sandra.lua index 69bc18a17b7..a362b8ee78c 100644 --- a/data-otservbr-global/npc/sandra.lua +++ b/data-otservbr-global/npc/sandra.lua @@ -66,10 +66,10 @@ local function creatureSayCallback(npc, creature, type, message) end if table.contains({ "vial", "ticket", "bonus", "deposit" }, message) then - if player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonBelt) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonBelt) < 1 then npcHandler:say("We have a special offer right now for depositing vials. Are you interested in hearing it?", npc, creature) npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonBelt) >= 1 then + elseif player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonBelt) >= 1 then npcHandler:say("Would you like to get a lottery ticket instead of the deposit for your vials?", npc, creature) npcHandler:setTopic(playerId, 3) end @@ -77,45 +77,31 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Are you here to claim a prize?", npc, creature) npcHandler:setTopic(playerId, 4) elseif string.match(message:lower(), "fafnar") then - if player:getStorageValue(Storage.TheShatteredIsles.RaysMission1) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission1) == 1 then npcHandler:say("Pssht, not that loud. So they have sent you to get... the stuff?", npc, creature) npcHandler:setTopic(playerId, 5) end elseif MsgContains(message, "your continued existence is payment enough") then if npcHandler:getTopic(playerId) == 6 then - if player:getStorageValue(Storage.TheShatteredIsles.RaysMission1) == 1 then - npcHandler:say( - "What?? How dare you?! I am a sorcerer of the most reknown academy on the face of this world. \ - Do you think some lousy pirates could scare me? Get lost! Now! \ - I will have no further dealings with the likes of you!", - npc, - creature - ) - player:setStorageValue(Storage.TheShatteredIsles.RaysMission1, 2) + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission1) == 1 then + npcHandler:say("What?? How dare you?! I am a sorcerer of the most reknown academy on the face of this world. Do you think some lousy pirates could scare me? Get lost! Now! I will have no further dealings with the likes of you!", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission1, 2) npcHandler:setTopic(playerId, 0) end end elseif MsgContains(message, "yes") then if npcHandler:getTopic(playerId) == 1 then npcHandler:say({ - "The Edron academy has introduced a bonus system. Each time you deposit 100 vials without \ - claiming the money for it, you will receive a lottery ticket. ...", - "Some of these lottery tickets will grant you a special potion belt accessory, \ - if you bring the ticket to me. ...", - "If you join the bonus system now, I will ask you each time you are bringing back 100 or \ - more vials to me whether you claim your deposit or rather want a lottery ticket. ...", + "The Edron academy has introduced a bonus system. Each time you deposit 100 vials without claiming the money for it, you will receive a lottery ticket. ...", + "Some of these lottery tickets will grant you a special potion belt accessory, if you bring the ticket to me. ...", + "If you join the bonus system now, I will ask you each time you are bringing back 100 or more vials to me whether you claim your deposit or rather want a lottery ticket. ...", "Of course, you can leave or join the bonus system at any time by just asking me for the 'bonus'. ...", "Would you like to join the bonus system now?", }, npc, creature) npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 2 then - npcHandler:say( - "Great! I've signed you up for our bonus system. From now on, \ - you will have the chance to win the potion belt addon!", - npc, - creature - ) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.AddonBelt, 1) + npcHandler:say("Great! I've signed you up for our bonus system. From now on, you will have the chance to win the potion belt addon!", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonBelt, 1) player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) --this for default start of Outfit and Addon Quests npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then @@ -124,33 +110,23 @@ local function creatureSayCallback(npc, creature, type, message) player:addItem(5957, 1) npcHandler:setTopic(playerId, 0) else - npcHandler:say( - "Sorry, but you don't have 100 empty flasks or vials of the SAME kind and thus don't qualify for the lottery. \ - Would you like to deposit the vials you have as usual and receive 5 gold per vial?", - npc, - creature - ) + npcHandler:say("Sorry, but you don't have 100 empty flasks or vials of the SAME kind and thus don't qualify for the lottery. Would you like to deposit the vials you have as usual and receive 5 gold per vial?", npc, creature) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 4 then - if player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonBelt) == 1 and player:removeItem(5958, 1) then + if player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonBelt) == 1 and player:removeItem(5958, 1) then npcHandler:say("Congratulations! Here, from now on you can wear our lovely potion belt as accessory.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.AddonBelt, 2) - player:addOutfitAddon(138, 1) - player:addOutfitAddon(133, 1) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonBelt, 2) + player:addOutfitAddon(130, 1) --male mage addon + player:addOutfitAddon(133, 1) --male summoner addon player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) else npcHandler:say("Sorry, but you don't have your lottery ticket with you.", npc, creature) end npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 5 then - if player:getStorageValue(Storage.TheShatteredIsles.RaysMission1) == 1 then - npcHandler:say( - "Finally. You have no idea how difficult it is to keep something secret here. \ - And you brought me all the crystal coins I demanded?", - npc, - creature - ) + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission1) == 1 then + npcHandler:say("Finally. You have no idea how difficult it is to keep something secret here. And you brought me all the crystal coins I demanded?", npc, creature) npcHandler:setTopic(playerId, 6) end end @@ -166,11 +142,7 @@ keywordHandler:addKeyword({ "shop" }, StdModule.say, { npcHandler:setMessage(MESSAGE_GREET, "Hello |PLAYERNAME|, welcome to the fluid and potion {shop} of Edron.") npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye, |PLAYERNAME|, please come back soon.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Good bye, |PLAYERNAME|, please come back soon.") -npcHandler:setMessage( - MESSAGE_SENDTRADE, - "Of course, just browse through my wares. By the way, if you'd like to join our bonus \ - system for depositing flasks and vial, you have to tell me about that {deposit}." -) +npcHandler:setMessage(MESSAGE_SENDTRADE, "Of course, just browse through my wares. By the way, if you'd like to join our bonus system for depositing flasks and vial, you have to tell me about that {deposit}.") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) diff --git a/data-otservbr-global/npc/sebastian.lua b/data-otservbr-global/npc/sebastian.lua index ebe69258f1d..0dd55b37af8 100644 --- a/data-otservbr-global/npc/sebastian.lua +++ b/data-otservbr-global/npc/sebastian.lua @@ -55,13 +55,13 @@ local function creatureSayCallback(npc, creature, type, message) local playerId = player:getId() if MsgContains(message, "nargor") then - if player:getStorageValue(Storage.TheShatteredIsles.AccessToNargor) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.AccessToNargor) == 1 then npcHandler:say("Do you want to sail Nargor for 50 gold coins?", npc, creature) npcHandler:setTopic(playerId, 1) end elseif MsgContains(message, "yes") then if npcHandler:getTopic(playerId) == 1 then - if player:getStorageValue(Storage.TheShatteredIsles.AccessToNargor) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.AccessToNargor) == 1 then if player:removeMoneyBank(50) then npcHandler:say("Set the sails!", npc, creature) player:teleportTo(Position(32024, 32813, 7)) diff --git a/data-otservbr-global/npc/shauna.lua b/data-otservbr-global/npc/shauna.lua index fc6fd4fbf7e..b7834e5ffe8 100644 --- a/data-otservbr-global/npc/shauna.lua +++ b/data-otservbr-global/npc/shauna.lua @@ -60,7 +60,7 @@ local function creatureSayCallback(npc, creature, type, message) -- Mission 1 - The Supply Thief if MsgContains(message, "job") then - if Player(creature):getStorageValue(Storage.DjinnWar.EfreetFaction.Mission01) == 2 then + if Player(creature):getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission01) == 2 then npcHandler:say("What do you think? I am the sheriff of Carlin.", npc, creature) npcHandler:setTopic(playerId, 1) end @@ -81,7 +81,7 @@ local function creatureSayCallback(npc, creature, type, message) "Obviously he wasn't pleased with this place, because he headed for Thais the next day. ...", "Something tells me that he won't stay out of trouble for too long.", }, npc, creature) - Player(creature):setStorageValue(Storage.DjinnWar.EfreetFaction.Mission01, 3) + Player(creature):setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission01, 3) npcHandler:setTopic(playerId, 0) end end diff --git a/data-otservbr-global/npc/simon_the_beggar.lua b/data-otservbr-global/npc/simon_the_beggar.lua index 84cf524075b..1706321d132 100644 --- a/data-otservbr-global/npc/simon_the_beggar.lua +++ b/data-otservbr-global/npc/simon_the_beggar.lua @@ -72,123 +72,215 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end --- First beggar addon -local function BeggarFirst(npc, creature, message, keywords, parameters, node) +local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() - if player:isPremium() then - if player:getStorageValue(Storage.OutfitQuest.BeggarFirstAddonDoor) == -1 then - if player:getItemCount(5883) >= 100 and player:getMoney() + player:getBankBalance() >= 20000 then - if player:removeItem(5883, 100) and player:removeMoneyBank(20000) then - npcHandler:say("Ah, right! The beggar beard or beggar dress! Here you go.", npc, creature) + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + -- Outfits and Addons logic + if MsgContains(message, "outfit") then + if player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) == 6 then + if player:hasOutfit(player:getSex() == PLAYERSEX_FEMALE and 157 or 153) then + npcHandler:say("Haha, that beard is - well, not fake, but there's a trick behind it. I noticed people tend to be more generous towards a poor gramps. Want to know my trick?", npc, creature) + npcHandler:setTopic(playerId, 1) + end + end + elseif MsgContains(message, "100 ape fur") then + npcHandler:say("Have you brought me the 100 pieces of ape fur and 20000 gold pieces?", npc, creature) + npcHandler:setTopic(playerId, 3) + elseif MsgContains(message, "beard") then + if player:getSex() == PLAYERSEX_MALE then + if player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) == 8 then + npcHandler:say("Hmm, I'm not done yet with your potion. But here, let me sprinkle a few drops of my own potion on your face... there you go. Now you just have to wait.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit, 9) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfitTimerAddon, os.time()) + elseif player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) == 9 then + local beggarOutfitTimer = player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfitTimerAddon) + if os.time() - beggarOutfitTimer >= 432000 then -- 5 dias em segundos + npcHandler:say("Aha! I can see it! Now that you've waited patiently without shaving, your beard is perfect! All thanks to my, err, potion. Yes. Goodbye!", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit, 10) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - player:setStorageValue(Storage.OutfitQuest.BeggarFirstAddonDoor, 1) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarFirstAddonDoor, 1) player:addOutfitAddon(153, 1) - player:addOutfitAddon(157, 1) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("Hmm, it seems you need to wait a bit longer for the potion to take full effect. Please be patient.", npc, creature) end + end + end + elseif MsgContains(message, "addon") then + if player:getSex() == PLAYERSEX_MALE and player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) == 9 then + local beggarOutfitTimer = player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfitTimerAddon) + if os.time() - beggarOutfitTimer >= 432000 then + npcHandler:say("Aha! I can see it! Now that you've waited patiently without shaving, your beard is perfect! All thanks to my, err, potion. Yes. Goodbye!", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit, 10) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarFirstAddonDoor, 1) + player:addOutfitAddon(153, 1) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("Hmm, it seems you need to wait a bit longer for the potion to take full effect. Please be patient.", npc, creature) + end + end + elseif MsgContains(message, "gypsy dress") then + if player:getSex() == PLAYERSEX_FEMALE then + if player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) == 8 then + npcHandler:say("Oh, I'm sorry... I almost forgot! Okay, okay... here is your promised dress. I'm sure it will look so much better on you than on me- I mean, my, err, sister.", npc, creature) + player:addOutfitAddon(157, 1) + end + end + elseif MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 1 then + if player:getSex() == PLAYERSEX_MALE then + npcHandler:say({ + "I can mix a secret potion which will increase your facial hair growth enormously. I call it 'Instabeard'. However, it requires certain ingredients. ...", + "For the small fee of 20000 gold pieces I will help you mix this potion. Just bring me 100 pieces of ape fur, which are necessary to create this potion. ...", + "Do we have a deal?", + }, npc, creature) + npcHandler:setTopic(playerId, 2) else - npcHandler:say("You do not have all the required items.", npc, creature) + npcHandler:say({ + "I can mix a secret potion which increases facial hair growth enormously. I call it 'Instabeard'. However, I fear it works only for men. ...", + "Even if it worked on girls, I'd rather not be responsible for you ruining your pretty face. I have an idea though. If you help me brew one of these potions, I will sell something nice to you. ...", + "I still have a pretty gypsy dress and a pearl necklace somewhere, which you could wear instead of this ragged skirt. For the small fee of 20000 gold pieces, it'd be yours. ...", + "You only have to bring me 100 pieces of ape fur, so I can brew the potion. Do we have a deal?", + }, npc, creature) + npcHandler:setTopic(playerId, 2) + end + elseif npcHandler:getTopic(playerId) == 2 then + npcHandler:say("Great! Come back to me once you have the 100 pieces of ape fur and I'll do my part of the deal.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit, 7) + npcHandler:setTopic(playerId, 0) + elseif npcHandler:getTopic(playerId) == 3 then + if player:isPremium() then + if player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarFirstAddonDoor) == -1 then + if player:getItemCount(5883) >= 100 and player:getMoney() + player:getBankBalance() >= 20000 then + if player:removeItem(5883, 100) and player:removeMoneyBank(20000) then + npcHandler:say("Ahh! Very good. I will start mixing the potion immediately. Come back later. Bye bye.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit, 8) + if player:getSex() == PLAYERSEX_MALE then + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfitTimerAddon, os.time()) + end + else + npcHandler:say("You do not have all the required items.", npc, creature) + end + else + npcHandler:say("You do not have all the required items.", npc, creature) + end + else + npcHandler:say("It seems you already have this addon, don't you try to mock me son!", npc, creature) + end end - else - npcHandler:say("It seems you already have this addon, don't you try to mock me son!", npc, creature) + npcHandler:setTopic(playerId, 0) end end -end --- Second beggar addon -local function BeggarSecond(npc, creature, message, keywords, parameters, node) - local player = Player(creature) - local playerId = player:getId() + -- Second addon logic + if MsgContains(message, "addon") and player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) == 10 then + npcHandler:say("No, no. Our deal is finished, no complaining now, I don't have time all day. And no, you can't have my staff.", npc, creature) + npcHandler:setTopic(playerId, 4) + elseif MsgContains(message, "staff") then + if npcHandler:getTopic(playerId) == 4 then + npcHandler:say("I said, no! Or well - I have a suggestion to make. Will you listen?", npc, creature) + npcHandler:setTopic(playerId, 5) + end + elseif MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 5 then + npcHandler:say({ + "When I was wandering around in Tibia, I lost my favourite staff somewhere in the northern ruins in Edron. ...", + "Uh, don't ask me what I was doing there... sort of a pilgrimage. Well anyway, if you could bring that staff back to me, I promise I'll give you my current one. ...", + "What do you say?", + }, npc, creature) + npcHandler:setTopic(playerId, 6) + elseif npcHandler:getTopic(playerId) == 6 then + npcHandler:say("Good! Come back to me once you have retrieved my staff. Good luck.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit, 11) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarFirstAddonDoor, 1) + npcHandler:setTopic(playerId, 0) + end + end - if player:isPremium() then - if player:getStorageValue(Storage.OutfitQuest.BeggarSecondAddon) == -1 then - if player:getItemCount(6107) >= 1 then - if player:removeItem(6107, 1) then - npcHandler:say("Ah, right! The beggar staff! Here you go.", npc, creature) - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - player:setStorageValue(Storage.OutfitQuest.BeggarSecondAddon, 1) - player:addOutfitAddon(153, 2) - player:addOutfitAddon(157, 2) + if MsgContains(message, "staff") and player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) == 11 then + npcHandler:say("Did you bring my favourite staff??", npc, creature) + npcHandler:setTopic(playerId, 7) + elseif MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 7 then + if player:isPremium() then + if player:getItemCount(6107) >= 1 then + if player:removeItem(6107, 1) then + npcHandler:say("Yes!! That's it! I'm so glad! Here, you can have my other one. Thanks!", npc, creature) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) + player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarSecondAddon, 2) + player:addOutfitAddon(153, 2) + player:addOutfitAddon(157, 2) + else + npcHandler:say("You do not have the staff.", npc, creature) + end + else + npcHandler:say("You do not have the staff.", npc, creature) end else - npcHandler:say("You do not have all the required items.", npc, creature) + npcHandler:say("Sorry, but you need to have a premium account!", npc, creature) end - else - npcHandler:say("It seems you already have this addon, don't you try to mock me son!", npc, creature) + npcHandler:setTopic(playerId, 0) end end -end - -local function creatureSayCallback(npc, creature, type, message) - local player = Player(creature) - local playerId = player:getId() - - if not npcHandler:checkInteraction(npc, creature) then - return false - end if MsgContains(message, "cookie") then if player:getStorageValue(Storage.WhatAFoolish.Questline) == 31 and player:getStorageValue(Storage.WhatAFoolish.CookieDelivery.SimonTheBeggar) ~= 1 then npcHandler:say("Have you brought a cookie for the poor?", npc, creature) - npcHandler:setTopic(playerId, 1) + npcHandler:setTopic(playerId, 8) end elseif MsgContains(message, "help") then npcHandler:say("I need gold. Can you spare 100 gold pieces for me?", npc, creature) - npcHandler:setTopic(playerId, 2) + npcHandler:setTopic(playerId, 9) elseif MsgContains(message, "yes") then - if npcHandler:getTopic(playerId) == 1 then - if not player:removeItem(130, 1) then + if npcHandler:getTopic(playerId) == 8 then + if not player:removeItem(130, 8) then npcHandler:say("You have no cookie that I'd like.", npc, creature) npcHandler:setTopic(playerId, 0) return true end - player:setStorageValue(Storage.WhatAFoolish.CookieDelivery.SimonTheBeggar, 1) if player:getCookiesDelivered() == 10 then player:addAchievement("Allow Cookies?") end - npc:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS) - npcHandler:say( - "Well, it's the least you can do for those who live in dire poverty. \z - A single cookie is a bit less than I'd expected, but better than ... WHA ... WHAT?? \z - MY BEARD! MY PRECIOUS BEARD! IT WILL TAKE AGES TO CLEAR IT OF THIS CONFETTI!", - npc, - creature - ) + npcHandler:say({ + "Well, it's the least you can do for those who live in dire poverty.", + "A single cookie is a bit less than I'd expected, but better than ... WHA ... WHAT??", + "MY BEARD! MY PRECIOUS BEARD! IT WILL TAKE AGES TO CLEAR IT OF THIS CONFETTI!", + }, npc, creature) npcHandler:removeInteraction(npc, creature) npcHandler:resetNpc(creature) - elseif npcHandler:getTopic(playerId) == 2 then + elseif npcHandler:getTopic(playerId) == 9 then if not player:removeMoneyBank(100) then npcHandler:say("You haven't got enough money for me.", npc, creature) npcHandler:setTopic(playerId, 0) return true end - npcHandler:say("Thank you very much. Can you spare 500 more gold pieces for me? I will give you a nice hint.", npc, creature) - npcHandler:setTopic(playerId, 3) - elseif npcHandler:getTopic(playerId) == 3 then + npcHandler:setTopic(playerId, 10) + elseif npcHandler:getTopic(playerId) == 10 then if not player:removeMoneyBank(500) then npcHandler:say("Sorry, that's not enough.", npc, creature) npcHandler:setTopic(playerId, 0) return true end - - npcHandler:say( - "That's great! I have stolen something from Dermot. \z - You can buy it for 200 gold. Do you want to buy it?", - npc, - creature - ) - npcHandler:setTopic(playerId, 4) - elseif npcHandler:getTopic(playerId) == 4 then + npcHandler:say({ + "That's great! I have stolen something from Dermot.", + "You can buy it for 200 gold. Do you want to buy it?", + }, npc, creature) + npcHandler:setTopic(playerId, 11) + elseif npcHandler:getTopic(playerId) == 11 then if not player:removeMoneyBank(200) then npcHandler:say("Pah! I said 200 gold. You don't have that much.", npc, creature) npcHandler:setTopic(playerId, 0) return true end - local key = player:addItem(2968, 1) if key then key:setActionId(3940) @@ -196,78 +288,34 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Now you own the hot key.", npc, creature) npcHandler:setTopic(playerId, 0) end - elseif MsgContains(message, "no") and npcHandler:getTopic(playerId) ~= 0 then - if npcHandler:getTopic(playerId) == 1 then - npcHandler:say("I see.", npc, creature) - elseif npcHandler:getTopic(playerId) == 2 then - npcHandler:say("Hmm, maybe next time.", npc, creature) - elseif npcHandler:getTopic(playerId) == 3 then - npcHandler:say("It was your decision.", npc, creature) - elseif npcHandler:getTopic(playerId) == 4 then - npcHandler:say("Ok. No problem. I'll find another buyer.", npc, creature) - end + end + + if MsgContains(message, "no") and npcHandler:getTopic(playerId) ~= 0 then + local noResponse = { + [1] = "I see.", + [2] = "Hmm, maybe next time.", + [3] = "It was your decision.", + [4] = "I see.", + [5] = "Hmm, maybe next time.", + [6] = "It was your decision.", + [7] = "Ok. No problem", + [8] = "Ok. No problem", + [9] = "Ok. No problem", + [10] = "Ok. No problem", + [11] = "Ok. No problem", + } + npcHandler:say(noResponse[npcHandler:getTopic(playerId)], npc, creature) npcHandler:setTopic(playerId, 0) end + return true end --- Node 1 -local node1 = keywordHandler:addKeyword({ "addon" }, StdModule.say, { - npcHandler = npcHandler, - text = "For the small fee of 20000 gold pieces I will help you mix this potion. \z - Just bring me 100 pieces of ape fur, which are necessary to create this potion. ... Do we have a deal?", -}) -node1:addChildKeyword({ "yes" }, BeggarSecond, {}) -node1:addChildKeyword({ "no" }, StdModule.say, { - npcHandler = npcHandler, - text = "Alright then. Come back when you got all neccessary items.", - reset = true, -}) - --- Node 2 -local node2 = keywordHandler:addKeyword({ "dress" }, StdModule.say, { - npcHandler = npcHandler, - text = "For the small fee of 20000 gold pieces I will help you mix this potion. \z - Just bring me 100 pieces of ape fur, which are necessary to create this potion. ...Do we have a deal?", -}) -node2:addChildKeyword({ "yes" }, BeggarFirst, {}) -node2:addChildKeyword({ "no" }, StdModule.say, { - npcHandler = npcHandler, - text = "Alright then. Come back when you got all neccessary items.", - reset = true, -}) - --- Node 3 -local node3 = keywordHandler:addKeyword({ "staff" }, StdModule.say, { - npcHandler = npcHandler, - text = "To get beggar staff you need to give me simon the beggar's staff. Do you have it with you?", -}) -node3:addChildKeyword({ "yes" }, BeggarSecond, {}) -node3:addChildKeyword({ "no" }, StdModule.say, { - npcHandler = npcHandler, - text = "Alright then. Come back when you got all neccessary items.", - reset = true, -}) - --- Node 4 -local node4 = keywordHandler:addKeyword({ "outfit" }, StdModule.say, { - npcHandler = npcHandler, - text = "For the small fee of 20000 gold pieces I will help you mix this potion. \z - Just bring me 100 pieces of ape fur, which are necessary to create this potion. ...Do we have a deal?", -}) -node4:addChildKeyword({ "yes" }, BeggarFirst, {}) -node4:addChildKeyword({ "no" }, StdModule.say, { - npcHandler = npcHandler, - text = "Alright then. Come back when you got all neccessary items.", - reset = true, -}) - npcHandler:setMessage(MESSAGE_GREET, "Hello |PLAYERNAME|. I am a poor man. Please help me.") npcHandler:setMessage(MESSAGE_FAREWELL, "Have a nice day.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Have a nice day.") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) - npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) -- npcType registering the npcConfig table diff --git a/data-otservbr-global/npc/the_blind_prophet.lua b/data-otservbr-global/npc/the_blind_prophet.lua index 682cc34446e..16ddb7a3c0c 100644 --- a/data-otservbr-global/npc/the_blind_prophet.lua +++ b/data-otservbr-global/npc/the_blind_prophet.lua @@ -83,11 +83,16 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 1) elseif npcHandler:getTopic(playerId) == 1 then if MsgContains(message, "yes") then - npcHandler:say("Take care!", npc, creature) - local destination = Position(33025, 32580, 6) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - player:teleportTo(destination) - destination:sendMagicEffect(CONST_ME_TELEPORT) + local questlineValue = player:getStorageValue(Storage.Quest.U7_6.TheApeCity.Questline) + if questlineValue >= 15 then + npcHandler:say("Take care!", npc, creature) + local destination = Position(33025, 32580, 6) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:teleportTo(destination) + destination:sendMagicEffect(CONST_ME_TELEPORT) + else + npcHandler:say("You are not worthy to be transported there yet.", npc, creature) + end elseif MsgContains(message, "no") then npcHandler:say("Wise decision maybe.", npc, creature) end diff --git a/data-otservbr-global/npc/the_bone_master.lua b/data-otservbr-global/npc/the_bone_master.lua index 67a6322f299..99ee9989cb5 100644 --- a/data-otservbr-global/npc/the_bone_master.lua +++ b/data-otservbr-global/npc/the_bone_master.lua @@ -59,7 +59,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "join") then - if player:getStorageValue(Storage.OutfitQuest.NightmareOutfit) < 1 and player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) < 1 then + if player:getStorageValue(Storage.Quest.U7_9.NightmareOutfits.Outfits) < 1 and player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) < 1 then npcHandler:say({ "The Brotherhood of Bones has suffered greatly in the past, but we did survive as we always will ...", "You have proven resourceful by beating the silly riddles the Nightmare Knights set up to test their candidates ...", @@ -69,13 +69,13 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 1) end elseif MsgContains(message, "advancement") or MsgContains(message, "demonic") or MsgContains(message, "essence") then - if player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) == 1 then + if player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) == 1 then npcHandler:say("So you want to advance to a {Hyaena} rank? Did you bring 500 demonic essences with you?", npc, creature) npcHandler:setTopic(playerId, 3) - elseif player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) == 2 then + elseif player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) == 2 then npcHandler:say("So you want to advance to a {Death Dealer} rank? Did you bring 1000 demonic essences with you?", npc, creature) npcHandler:setTopic(playerId, 4) - elseif player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) == 3 then + elseif player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) == 3 then npcHandler:say("So you want to advance to a {Dread Lord} rank? Did you bring 1500 demonic essences with you?", npc, creature) npcHandler:setTopic(playerId, 5) end @@ -92,14 +92,14 @@ local function creatureSayCallback(npc, creature, type, message) "Take it, if you are up to that challenge ... or perish in agony if you deserve this fate ...", "You can always ask me about your current rank and about the privileges the ranks grant to those who hold them.", }, npc, creature) - player:setStorageValue(Storage.OutfitQuest.BrotherhoodOutfit, 1) + player:setStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits, 1) player:addAchievement("Bone Brother") npcHandler:setTopic(playerId, 0) player:addItem(768, 1) elseif npcHandler:getTopic(playerId) == 3 then if player:removeItem(6499, 500) then player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - player:setStorageValue(Storage.OutfitQuest.BrotherhoodOutfit, 2) + player:setStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits, 2) player:addItem(769, 1) npcHandler:say("You advanced to {Hyaena} rank! You are now able to use teleports of second floor of Knightwatch Tower.", npc, creature) else @@ -109,7 +109,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 4 then if player:removeItem(6499, 1000) then player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - player:setStorageValue(Storage.OutfitQuest.BrotherhoodOutfit, 3) + player:setStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits, 3) player:addItem(770, 1) player:addItem(6432, 1) player:addAchievement("Skull and Bones") @@ -121,9 +121,9 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 5 then if player:removeItem(6499, 1500) then player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - player:setStorageValue(Storage.OutfitQuest.BrotherhoodOutfit, 4) - player:setStorageValue(Storage.OutfitQuest.BrotherhoodDoor, 1) - player:setStorageValue(Storage.KnightwatchTowerDoor, 1) + player:setStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits, 4) + player:setStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Door, 1) + player:setStorageValue(Storage.Quest.U7_9.NightmareOutfits.KnightwatchTowerDoor, 1) player:addAchievement("Dread Lord") npcHandler:say("You advanced to {Dread Lord} rank! You are now able to use teleports of fourth floor of Knightwatch Tower and to create addon scrolls.", npc, creature) else @@ -135,6 +135,9 @@ local function creatureSayCallback(npc, creature, type, message) return true end +npcHandler:setMessage(MESSAGE_GREET, "Welcome to my little realm.") +npcHandler:setMessage(MESSAGE_FAREWELL, "We will meet again.") + npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) diff --git a/data-otservbr-global/npc/the_dream_master.lua b/data-otservbr-global/npc/the_dream_master.lua index b282908b375..c45afda22d3 100644 --- a/data-otservbr-global/npc/the_dream_master.lua +++ b/data-otservbr-global/npc/the_dream_master.lua @@ -59,7 +59,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "join") then - if player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) < 1 and player:getStorageValue(Storage.OutfitQuest.NightmareOutfit) < 1 then + if player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) < 1 and player:getStorageValue(Storage.Quest.U7_9.NightmareOutfits.Outfits) < 1 then npcHandler:say({ "The Nightmare Knights are almost extinct now, and as far as I know I am the only teacher that is left. But you might beright and its time to accept new disciples ...", "After all you have passed the Dream Challenge to reach this place, which used to be the process of initiation in the past...", @@ -68,13 +68,13 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 1) end elseif MsgContains(message, "advancement") or MsgContains(message, "demonic") or MsgContains(message, "essence") then - if player:getStorageValue(Storage.OutfitQuest.NightmareOutfit) == 1 then + if player:getStorageValue(Storage.Quest.U7_9.NightmareOutfits.Outfits) == 1 then npcHandler:say("So you want to advance to a {Initiate} rank? Did you bring 500 demonic essences with you?", npc, creature) npcHandler:setTopic(playerId, 3) - elseif player:getStorageValue(Storage.OutfitQuest.NightmareOutfit) == 2 then + elseif player:getStorageValue(Storage.Quest.U7_9.NightmareOutfits.Outfits) == 2 then npcHandler:say("So you want to advance to a {Dreamer} rank? Did you bring 1000 demonic essences with you?", npc, creature) npcHandler:setTopic(playerId, 4) - elseif player:getStorageValue(Storage.OutfitQuest.NightmareOutfit) == 3 then + elseif player:getStorageValue(Storage.Quest.U7_9.NightmareOutfits.Outfits) == 3 then npcHandler:say("So you want to advance to a {Lord Protector} rank? Did you bring 1500 demonic essences with you?", npc, creature) npcHandler:setTopic(playerId, 5) end @@ -89,14 +89,14 @@ local function creatureSayCallback(npc, creature, type, message) "You can always ask me about your current rank and about the privileges the ranks grant to those who hold them.", }, npc, creature) player:addItem(768, 1) - player:setStorageValue(Storage.OutfitQuest.NightmareOutfit, 1) + player:setStorageValue(Storage.Quest.U7_9.NightmareOutfits.Outfits, 1) player:addAchievement("Nightmare Knight") npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then if player:removeItem(6499, 500) then player:addItem(769, 1) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - player:setStorageValue(Storage.OutfitQuest.NightmareOutfit, 2) + player:setStorageValue(Storage.Quest.U7_9.NightmareOutfits.Outfits, 2) npcHandler:say("You advanced to {Initiate} rank! You are now able to use teleports of second floor of Knightwatch Tower.", npc, creature) else npcHandler:say("Come back when you gather all essences.", npc, creature) @@ -105,7 +105,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 4 then if player:removeItem(6499, 1000) then player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - player:setStorageValue(Storage.OutfitQuest.NightmareOutfit, 3) + player:setStorageValue(Storage.Quest.U7_9.NightmareOutfits.Outfits, 3) player:addItem(770, 1) player:addItem(6390, 1) player:addAchievement("Nightmare Walker") @@ -117,9 +117,9 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 5 then if player:removeItem(6499, 1500) then player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - player:setStorageValue(Storage.OutfitQuest.NightmareOutfit, 4) - player:setStorageValue(Storage.OutfitQuest.NightmareDoor, 1) - player:setStorageValue(Storage.KnightwatchTowerDoor, 1) + player:setStorageValue(Storage.Quest.U7_9.NightmareOutfits.Outfits, 4) + player:setStorageValue(Storage.Quest.U7_9.NightmareOutfits.Door, 1) + player:setStorageValue(Storage.Quest.U7_9.NightmareOutfits.KnightwatchTowerDoor, 1) player:addAchievement("Lord Protector") npcHandler:say("You advanced to {Lord Protector} rank! You are now able to use teleports of fourth floor of Knightwatch Tower and to create addon scrolls.", npc, creature) else @@ -131,6 +131,9 @@ local function creatureSayCallback(npc, creature, type, message) return true end +npcHandler:setMessage(MESSAGE_GREET, "Be greeted, visitor.") +npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye. May the gods watch over your path.") + npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) diff --git a/data-otservbr-global/npc/the_orc_king.lua b/data-otservbr-global/npc/the_orc_king.lua index c835f57e314..c7450c7dfdb 100644 --- a/data-otservbr-global/npc/the_orc_king.lua +++ b/data-otservbr-global/npc/the_orc_king.lua @@ -71,11 +71,11 @@ local function creatureSayCallback(npc, creature, type, message) return false end - local efreet, marid = player:getStorageValue(Storage.DjinnWar.EfreetFaction.Mission03), player:getStorageValue(Storage.DjinnWar.MaridFaction.Mission03) + local efreet, marid = player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission03), player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission03) -- Mission 3 - Orc Fortress if MsgContains(message, "lamp") then if efreet == 1 or marid == 1 then - if player:getStorageValue(Storage.DjinnWar.ReceivedLamp) ~= 1 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.RecievedLamp) ~= 1 then npcHandler:say({ "I can sense your evil intentions to imprison a djinn! You are longing for the lamp, which I still possess. ...", "Who do you want to trap in this cursed lamp?", @@ -95,12 +95,12 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 1 then if MsgContains(message, "malor") then if efreet == 1 then - player:setStorageValue(Storage.DjinnWar.EfreetFaction.DoorToLamp, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.DoorToLamp, 1) elseif marid == 1 then - player:setStorageValue(Storage.DjinnWar.MaridFaction.DoorToLamp, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.DoorToLamp, 1) end - player:setStorageValue(Storage.DjinnWar.ReceivedLamp, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.RecievedLamp, 1) player:addItem(3231, 1) npcHandler:say("I was waiting for this day! Take the lamp and let Malor feel my wrath!", npc, creature) else @@ -150,7 +150,7 @@ keywordHandler:addKeyword({ "deathwish" }, StdModule.say, { npcHandler = npcHand keywordHandler:addKeyword({ "good djinn" }, StdModule.say, { npcHandler = npcHandler, text = "I will not share anything more about that topic with you {paleskins}." }) keywordHandler:addKeyword({ "paleskins" }, StdModule.say, { npcHandler = npcHandler, text = "You are as ugly as maggots, although not quite as as tasty." }) keywordHandler:addKeyword({ "malor" }, StdModule.say, { npcHandler = npcHandler, text = "This cursed djinn king! I set him free from an enchanted lamp, and he cheated me!" }, function(player) - return player:getStorageValue(Storage.DjinnWar.ReceivedLamp) == 1 + return player:getStorageValue(Storage.Quest.U7_4.DjinnWar.RecievedLamp) == 1 end) npcHandler:setCallback(CALLBACK_GREET, greetCallback) diff --git a/data-otservbr-global/npc/the_queen_of_the_banshees.lua b/data-otservbr-global/npc/the_queen_of_the_banshees.lua index 14ac38f4170..e619269fc64 100644 --- a/data-otservbr-global/npc/the_queen_of_the_banshees.lua +++ b/data-otservbr-global/npc/the_queen_of_the_banshees.lua @@ -60,62 +60,35 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "seventh seal") then - npcHandler:say( - "If you have passed the first six seals and entered the blue fires that lead to \z - the chamber of the seal you might receive my {kiss} ... It will open the last seal. \z - Do you think you are ready?", - npc, - creature - ) + npcHandler:say("If you have passed the first six seals and entered the blue fires that lead to the chamber of the seal you might receive my {kiss} ... It will open the last seal. Do you think you are ready?", npc, creature) npcHandler:setTopic(playerId, 1) elseif MsgContains(message, "kiss") and npcHandler:getTopic(playerId) == 7 then if player:getStorageValue(Storage.Quest.U7_2.TheQueenOfTheBanshees.LastSeal) < 1 then - npcHandler:say( - "Are you prepared to receive my kiss, even though this will mean that your \z - death as well as a part of your soul will forever belong to me, my dear?", - npc, - creature - ) + npcHandler:say("Are you prepared to receive my kiss, even though this will mean that your death as well as a part of your soul will forever belong to me, my dear?", npc, creature) npcHandler:setTopic(playerId, 8) else npcHandler:say("You have already received my kiss. You should know better then to ask for it.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "spectral dress") then - if player:getStorageValue(Storage.ExplorerSociety.TheSpectralDress) == 48 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 48 and player:getStorageValue(Storage.ExplorerSociety.BansheeDoor) < 1 then - npcHandler:say( - "Your wish for a spectral dress is silly. \z - Although I will grant you the permission to take one. \z - My maidens left one in a box in a room, directly south of here.", - npc, - creature - ) - player:setStorageValue(Storage.ExplorerSociety.BansheeDoor, 1) + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralDress) == 48 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 48 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.BansheeDoor) < 1 then + npcHandler:say("Your wish for a spectral dress is silly. Although I will grant you the permission to take one. My maidens left one in a box in a room, directly south of here.", npc, creature) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.BansheeDoor, 1) end elseif MsgContains(message, "addon") then - if player:getStorageValue(Storage.OutfitQuest.WizardAddon) == 5 then - npcHandler:say( - "Say... I have been longing for something for an eternity now... \z - if you help me retrieve it, I will reward you. Do you consent to this arrangement?", - npc, - creature - ) + if player:getStorageValue(Storage.Quest.U7_8.WizardOutfits) == 5 then + npcHandler:say("Say... I have been longing for something for an eternity now... if you help me retrieve it, I will reward you. Do you consent to this arrangement?", npc, creature) npcHandler:setTopic(playerId, 9) end elseif MsgContains(message, "orchid") or MsgContains(message, "holy orchid") then - if player:getStorageValue(Storage.OutfitQuest.WizardAddon) == 6 then + if player:getStorageValue(Storage.Quest.U7_8.WizardOutfits) == 6 then npcHandler:say("Have you really brought me 50 holy orchids?", npc, creature) npcHandler:setTopic(playerId, 11) end elseif MsgContains(message, "yes") then if npcHandler:getTopic(playerId) == 1 then if player:getStorageValue(Storage.Quest.U7_2.TheQueenOfTheBanshees.FourthSeal) == 1 then - npcHandler:say( - "The Queen of the Banshee: Yessss, I can sense you have passed the seal of sacrifice. \z - Have you passed any other seal yet?", - npc, - creature - ) + npcHandler:say("The Queen of the Banshee: Yessss, I can sense you have passed the seal of sacrifice. Have you passed any other seal yet?", npc, creature) npcHandler:setTopic(playerId, 2) else npcHandler:say("You have not passed the seal of sacrifice yet. Return to me when you are better prepared.", npc, creature) @@ -123,12 +96,7 @@ local function creatureSayCallback(npc, creature, type, message) end elseif npcHandler:getTopic(playerId) == 2 then if player:getStorageValue(Storage.Quest.U7_2.TheQueenOfTheBanshees.FirstSeal) == 1 then - npcHandler:say( - "The Queen of the Banshee: I sense you have passed the hidden seal as well. \z - Have you passed any other seal yet?", - npc, - creature - ) + npcHandler:say("The Queen of the Banshee: I sense you have passed the hidden seal as well. Have you passed any other seal yet?", npc, creature) npcHandler:setTopic(playerId, 3) else npcHandler:say("You have not found the hidden seal yet. Return when you are better prepared.", npc, creature) @@ -136,12 +104,7 @@ local function creatureSayCallback(npc, creature, type, message) end elseif npcHandler:getTopic(playerId) == 3 then if player:getStorageValue(Storage.Quest.U7_2.TheQueenOfTheBanshees.SecondSeal) == 1 then - npcHandler:say( - "The Queen of the Banshee: Oh yes, you have braved the plague seal. \z - Have you passed any other seal yet?", - npc, - creature - ) + npcHandler:say("The Queen of the Banshee: Oh yes, you have braved the plague seal. Have you passed any other seal yet?", npc, creature) npcHandler:setTopic(playerId, 4) else npcHandler:say("You have not faced the plagueseal yet. Return to me when you are better prepared.", npc, creature) @@ -149,12 +112,7 @@ local function creatureSayCallback(npc, creature, type, message) end elseif npcHandler:getTopic(playerId) == 4 then if player:getStorageValue(Storage.Quest.U7_2.TheQueenOfTheBanshees.ThirdSeal) == 1 then - npcHandler:say( - "The Queen of the Banshee: Ah, I can sense the power of the seal of \z - demonrage burning in your heart. Have you passed any other seal yet?", - npc, - creature - ) + npcHandler:say("The Queen of the Banshee: Ah, I can sense the power of the seal of demonrage burning in your heart. Have you passed any other seal yet?", npc, creature) npcHandler:setTopic(playerId, 5) else npcHandler:say("You are not filled with the fury of the imprisoned demon. Return when you are better prepared.", npc, creature) @@ -162,12 +120,7 @@ local function creatureSayCallback(npc, creature, type, message) end elseif npcHandler:getTopic(playerId) == 5 then if player:getStorageValue(Storage.Quest.U7_2.TheQueenOfTheBanshees.FifthSeal) == 1 then - npcHandler:say( - "The Queen of the Banshee: So, you have managed to pass the seal of the true path. \z - Have you passed any other seal yet?", - npc, - creature - ) + npcHandler:say("The Queen of the Banshee: So, you have managed to pass the seal of the true path. Have you passed any other seal yet?", npc, creature) npcHandler:setTopic(playerId, 6) else npcHandler:say("You have not found your true path yet. Return when you are better prepared.", npc, creature) @@ -175,13 +128,7 @@ local function creatureSayCallback(npc, creature, type, message) end elseif npcHandler:getTopic(playerId) == 6 then if player:getStorageValue(Storage.Quest.U7_2.TheQueenOfTheBanshees.SixthSeal) == 1 then - npcHandler:say( - "The Queen of the Banshee: I see! You have mastered the seal of logic. \z - You have made the sacrifice, you have seen the unseen, you possess fortitude, \z - you have filled yourself with power and found your path. You may ask me for my {kiss} now.", - npc, - creature - ) + npcHandler:say("The Queen of the Banshee: I see! You have mastered the seal of logic. You have made the sacrifice, you have seen the unseen, you possess fortitude, you have filled yourself with power and found your path. You may ask me for my {kiss} now.", npc, creature) npcHandler:setTopic(playerId, 7) else npcHandler:say("You have not found your true path yet. Return to meh when you are better prepared.", npc, creature) @@ -197,30 +144,20 @@ local function creatureSayCallback(npc, creature, type, message) player:setStorageValue(Storage.Quest.U7_2.TheQueenOfTheBanshees.LastSealDoor, 1) player:setStorageValue(Storage.Quest.U7_2.TheQueenOfTheBanshees.BansheeDoor, 1) else - npcHandler:say( - "You have spilled too much blood recently and the dead are hungry for your soul. \z - Perhaps return when you regained you inner balance.", - npc, - creature - ) + npcHandler:say("You have spilled too much blood recently and the dead are hungry for your soul. Perhaps return when you regained you inner balance.", npc, creature) npcHandler:setTopic(playerId, 0) end elseif npcHandler:getTopic(playerId) == 9 then - npcHandler:say({ - "Listen... there are no blooming flowers down here and the only smell present is that of death and decay. ...", - "I wish that I could breathe the lovely smell of beautiful flowers just one more time, \z - especially those which elves cultivate. ...", - "Could you please bring me 50 holy orchids?", - }, npc, creature) + npcHandler:say("Listen... there are no blooming flowers down here and the only smell present is that of death and decay. I wish that I could breathe the lovely smell of beautiful flowers just one more time, especially those which elves cultivate. Could you please bring me 50 holy orchids?", npc, creature) npcHandler:setTopic(playerId, 10) elseif npcHandler:getTopic(playerId) == 10 then npcHandler:say("Thank you. I will wait for your return.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.WizardAddon, 6) + player:setStorageValue(Storage.Quest.U7_8.WizardOutfits, 6) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 11 then if player:removeItem(5922, 50) then - npcHandler:say("Thank you! You have no idea what that means to me. As promised,here is your reward... as a follower of Zathroth, I hope that you will like this accessory.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.WizardAddon, 7) + npcHandler:say("Thank you! You have no idea what that means to me. As promised, here is your reward... as a follower of Zathroth, I hope that you will like this accessory.", npc, creature) + player:setStorageValue(Storage.Quest.U7_8.WizardOutfits, 7) player:addOutfitAddon(145, 1) player:addOutfitAddon(149, 1) player:addAchievement("Warlock") @@ -246,35 +183,27 @@ keywordHandler:addKeyword({ "stay" }, StdModule.say, { }) keywordHandler:addKeyword({ "guardian" }, StdModule.say, { npcHandler = npcHandler, - text = "I'm the {guardian} of the {SEVENTH} and final seal. The seal to open the last door before ... \z - but perhaps it's better to see it with your own eyes.", + text = "I'm the {guardian} of the {SEVENTH} and final seal. The seal to open the last door before ... but perhaps it's better to see it with your own eyes.", }) keywordHandler:addKeyword({ "place" }, StdModule.say, { npcHandler = npcHandler, - text = "It served as a temple, a source of power and ... \z - as a sender for an ancient {race} which lived a long time ago and has long been forgotten.", + text = "It served as a temple, a source of power and ... as a sender for an ancient {race} which lived a long time ago and has long been forgotten.", }) keywordHandler:addKeyword({ "race" }, StdModule.say, { npcHandler = npcHandler, - text = "The race that built this edifice came to this place from the stars. \z - They ran from an enemy even more horrible than themselves. \z - But they carried the {seed} of their own destruction in them.", + text = "The race that built this edifice came to this place from the stars. They ran from an enemy even more horrible than themselves. But they carried the {seed} of their own destruction in them.", }) keywordHandler:addKeyword({ "seed" }, StdModule.say, { npcHandler = npcHandler, - text = "This ancient race was annihilated by its own doings, that's all I know. \z - Aeons have passed since then, but the sheer presence of this {complex} is still defiling and desecrating this area.", + text = "This ancient race was annihilated by its own doings, that's all I know. Aeons have passed since then, but the sheer presence of this {complex} is still defiling and desecrating this area.", }) keywordHandler:addKeyword({ "complex" }, StdModule.say, { npcHandler = npcHandler, - text = "Its constructors were too strange for you or even me to understand. \z - We don't know what this ... thing they built was supposed to be good for. \z - I feel a constant twisting and binding of souls, though, that is probably only a side-effect.", + text = "Its constructors were too strange for you or even me to understand. We don't know what this ... thing they built was supposed to be good for. I feel a constant twisting and binding of souls, though, that is probably only a side-effect.", }) keywordHandler:addKeyword({ "ghostlands" }, StdModule.say, { npcHandler = npcHandler, - text = "The place you know as the Ghostlands had a different name once ... \z - and many names after. Too many to remember them all.", + text = "The place you know as the Ghostlands had a different name once ... and many names after. Too many to remember them all.", }) keywordHandler:addKeyword({ "banshee" }, StdModule.say, { npcHandler = npcHandler, diff --git a/data-otservbr-global/npc/tibra.lua b/data-otservbr-global/npc/tibra.lua index 3746347f1a6..ab8ef1271eb 100644 --- a/data-otservbr-global/npc/tibra.lua +++ b/data-otservbr-global/npc/tibra.lua @@ -52,23 +52,23 @@ end -- Wooden Stake keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "I think you have forgotten to bring your stake, my child." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 2 and player:getItemCount(5941) == 0 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 2 and player:getItemCount(5941) == 0 end) local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Yes, I was informed what to do. Are you prepared to receive my line of the prayer?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 2 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 2 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "So receive my prayer: 'Hope may fill your heart - doubt shall be banned'. Now, bring your stake to Maealil in the elven settlement for the next line of the prayer. I will inform him what to do.", reset = true }, nil, function(player) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 3) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 3) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end) stakeKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "I will wait for you.", reset = true }) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You should visit Maealil in the elven settlement now, my child." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 3 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 3 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You already received my line of the prayer, dear child." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) > 3 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) > 3 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "A blessed stake? That is a strange request, my child. Maybe Quentin knows more, he is one of the oldest monks after all." }) diff --git a/data-otservbr-global/npc/tom.lua b/data-otservbr-global/npc/tom.lua index c278a728d77..c66ade91e30 100644 --- a/data-otservbr-global/npc/tom.lua +++ b/data-otservbr-global/npc/tom.lua @@ -228,13 +228,13 @@ local function creatureSayCallback(npc, creature, type, message) if MsgContains(message, "cough syrup") then npcHandler:say("I had some cough syrup a while ago. It was stolen in an ape raid. I fear if you want more cough syrup you will have to buy it in the druids guild in carlin.", npc, creature) elseif MsgContains(message, "addon") then - if player:getStorageValue(Storage.OutfitQuest.DruidBodyAddon) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.DruidOutfitsRook.DruidBodyAddonRook) < 1 then npcHandler:say("Would you like to wear bear paws like I do? No problem, just bring me 50 bear paws and 50 wolf paws and I'll fit them on.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.DruidBodyAddon, 1) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfitsRook.DruidBodyAddonRook, 1) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "paws") or MsgContains(message, "bear paws") then - if player:getStorageValue(Storage.OutfitQuest.DruidBodyAddon) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.DruidOutfitsRook.DruidBodyAddonRook) == 1 then npcHandler:say("Have you brought 50 bear paws and 50 wolf paws?", npc, creature) npcHandler:setTopic(playerId, 1) end @@ -244,7 +244,8 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Excellent! Like promised, here are your bear paws. ", npc, creature) player:removeItem(5896, 50) player:removeItem(5897, 50) - player:setStorageValue(Storage.OutfitQuest.DruidBodyAddon, 2) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfitsRook.DruidBodyAddonRook, 2) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) player:addOutfitAddon(148, 1) player:addOutfitAddon(144, 1) npcHandler:setTopic(playerId, 0) diff --git a/data-otservbr-global/npc/trisha.lua b/data-otservbr-global/npc/trisha.lua index 1dbafeb7024..2542d3dde3c 100644 --- a/data-otservbr-global/npc/trisha.lua +++ b/data-otservbr-global/npc/trisha.lua @@ -101,7 +101,7 @@ local topic = {} local function greetCallback(npc, creature) local playerId = creature:getId() - npcHandler:setMessage(MESSAGE_GREET, "Salutations, |PLAYERNAME|. What can I do for you?") + npcHandler:setMessage(MESSAGE_GREET, "Welcome back, knight |PLAYERNAME|!") topic[playerId] = nil return true end @@ -114,33 +114,18 @@ local function creatureSayCallback(npc, creature, type, message) return false end - local player, storage = Player(creature), Storage.OutfitQuest.WarriorShoulderAddon + local player, storage = Player(creature), Storage.Quest.U7_8.WarriorOutfits.WarriorShoulderAddon if npcHandler:getTopic(playerId) == 0 then if table.contains({ "outfit", "addon" }, message) then - npcHandler:say( - "Are you talking about my spiky shoulder pad? You can't buy one of these. \z - They have to be {earned}.", - npc, - creature - ) + npcHandler:say("Are you talking about my spiky shoulder pad? You can't buy one of these. They have to be {earned}.", npc, creature) elseif MsgContains(message, "earn") then if player:getStorageValue(storage) < 1 then - npcHandler:say( - "I'm not sure if you are enough of a hero to earn them. \z - You could try, though. What do you think?", - npc, - creature - ) + npcHandler:say("I'm not sure if you are enough of a hero to earn them. You could try, though. What do you think?", npc, creature) npcHandler:setTopic(playerId, 1) elseif player:getStorageValue(storage) >= 1 and player:getStorageValue(storage) < 5 then npcHandler:say("Before I can nominate you for an award, please complete your task.", npc, creature) elseif player:getStorageValue(storage) == 5 then - npcHandler:say( - "You did it! I have seldom seen a man as courageous as you. \z - I really have to say that you deserve to wear a spike. Go ask Cornelia to adorn your armour.", - npc, - creature - ) + npcHandler:say("You did it! I have seldom seen a man as courageous as you. I really have to say that you deserve to wear a spike. Go ask Cornelia to adorn your armour.", npc, creature) end elseif config[message:lower()] then local targetMessage = config[message:lower()] @@ -158,8 +143,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say({ "Okay, who knows, maybe you have a chance. A really small one though. Listen up: ...", "First, you have to prove your guts by bringing me 100 hardened bones. ...", - "Next, if you actually managed to collect that many, please complete a small task for \z - our guild and bring us 100 turtle shells. ...", + "Next, if you actually managed to collect that many, please complete a small task for our guild and bring us 100 turtle shells. ...", "It is said that excellent shields can be created from these. ...", "Alright, um, afterwards show me that you have fighting spirit. Any true hero needs plenty of that. ...", "The last task is the hardest. You will need to bring me a claw from a mighty dragon king. ...", diff --git a/data-otservbr-global/npc/tyrias.lua b/data-otservbr-global/npc/tyrias.lua index 16dd2dd4ab7..6ea39bab9f2 100644 --- a/data-otservbr-global/npc/tyrias.lua +++ b/data-otservbr-global/npc/tyrias.lua @@ -90,16 +90,16 @@ stoneKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, t -- Wooden Stake keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You don't even have that strange stake with you." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 10 and player:getItemCount(5941) == 0 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 10 and player:getItemCount(5941) == 0 end) local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Brewster sent me a strange message about some strange hocus-pocus. I think it's nonsense, but since you have come that far, I'll play along. Are you ready?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 10 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 10 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "So receive my prayer: 'Your mind shall be a vessel for joy, light and wisdom' - uh, wow, something happened. Well, I guess that's it, but next time if you need some mumbo jumbo rather go to Chondur.", reset = true }, function(player) return player:getItemCount(5941) > 0 end, function(player) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 11) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 11) player:removeItem(5941, 1) player:addItem(5942, 1) end) @@ -107,10 +107,10 @@ stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler stakeKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "No problem, I have other things to do.", reset = true }) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "A blessed stake? I don't believe in things like that. If anyone does, it's probably old Quentin." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) < 10 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) < 10 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "I won't do that rubbish again. Go pester Chondur with your hocus-pocus." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 11 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 11 end) -- Healing diff --git a/data-otservbr-global/npc/ubaid.lua b/data-otservbr-global/npc/ubaid.lua index f6fd3e814af..6d46bb32d9c 100644 --- a/data-otservbr-global/npc/ubaid.lua +++ b/data-otservbr-global/npc/ubaid.lua @@ -45,28 +45,48 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local function endConversationWithDelay(npcHandler, npc, creature) + addEvent(function() + npcHandler:unGreet(npc, creature) + end, 1000) +end + local function greetCallback(npc, creature, message) local player = Player(creature) local playerId = player:getId() - if not MsgContains(message, "djanni'hah") and player:getStorageValue(Storage.DjinnWar.Faction.EfreetDoor) ~= 1 then + if not MsgContains(message, "djanni'hah") then npcHandler:say("Shove off, little one! Humans are not welcome here, |PLAYERNAME|!", npc, creature) + endConversationWithDelay(npcHandler, npc, creature) return false end - if player:getStorageValue(Storage.DjinnWar.Faction.Greeting) == -1 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Start) == 1 then npcHandler:say({ "Hahahaha! ...", "|PLAYERNAME|, that almost sounded like the word of greeting. Humans - cute they are!", }, npc, creature) + endConversationWithDelay(npcHandler, npc, creature) return false end - if player:getStorageValue(Storage.DjinnWar.Faction.EfreetDoor) ~= 1 then - npcHandler:setMessage(MESSAGE_GREET, "What? You know the word, |PLAYERNAME|? All right then - I won't kill you. At least, not now. What brings you {here}?") + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.Greeting) == -1 then + npcHandler:say({ + "Hahahaha! ...", + "|PLAYERNAME|, that almost sounded like the word of greeting. Humans - cute they are!", + }, npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.EfreetDoor) ~= 1 then + npcHandler:say("What? You know the word, |PLAYERNAME|? All right then - I won't kill you. At least, not now. What brings you {here}?", npc, creature) else - npcHandler:setMessage(MESSAGE_GREET, "Still alive, |PLAYERNAME|? What brings you {here}?") + npcHandler:say("Still alive, |PLAYERNAME|? What brings you {here}?", npc, creature) end + + npcHandler:setInteraction(npc, creature) + return true end @@ -93,7 +113,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "passage") then - if player:getStorageValue(Storage.DjinnWar.Faction.EfreetDoor) ~= 1 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.EfreetDoor) ~= 1 then npcHandler:say({ "Only the mighty Efreet, the true djinn of Tibia, may enter Mal'ouquah! ...", "All Marid and little worms like yourself should leave now or something bad may happen. Am I right?", @@ -113,7 +133,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Of course. Then don't waste my time and shove off.", npc, creature) npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "no") then - if player:getStorageValue(Storage.DjinnWar.Faction.MaridDoor) == 1 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.MaridDoor) == 1 then npcHandler:say("Who do you think you are? A Marid? Shove off you worm!", npc, creature) npcHandler:setTopic(playerId, 0) else @@ -140,8 +160,8 @@ local function creatureSayCallback(npc, creature, type, message) "Go now to general Baa'leal and don't forget to greet him correctly! ...", "And don't touch anything!", }, npc, creature) - player:setStorageValue(Storage.DjinnWar.Faction.EfreetDoor, 1) - player:setStorageValue(Storage.DjinnWar.Faction.Greeting, 0) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.EfreetDoor, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.Greeting, 0) elseif MsgContains(message, "no") then npcHandler:say("Of course. Then don't waste my time and shove off.", npc, creature) end @@ -150,8 +170,7 @@ local function creatureSayCallback(npc, creature, type, message) return true end --- Greeting -keywordHandler:addGreetKeyword({ "djanni'hah" }, { npcHandler = npcHandler, text = "Shove off, little one! Humans are not welcome here, |PLAYERNAME|" }) +keywordHandler:addCustomGreetKeyword({ "djanni'hah" }, greetCallback, { npcHandler = npcHandler }) npcHandler:setMessage(MESSAGE_FAREWELL, "Farewell human!") npcHandler:setMessage(MESSAGE_WALKAWAY, "Farewell human!") diff --git a/data-otservbr-global/npc/umar.lua b/data-otservbr-global/npc/umar.lua index 51865a19cbb..4836c568958 100644 --- a/data-otservbr-global/npc/umar.lua +++ b/data-otservbr-global/npc/umar.lua @@ -45,32 +45,52 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local function endConversationWithDelay(npcHandler, npc, creature) + addEvent(function() + npcHandler:unGreet(npc, creature) + end, 1000) +end + local function greetCallback(npc, creature, message) local player = Player(creature) local playerId = player:getId() - if not MsgContains(message, "djanni'hah") and player:getStorageValue(Storage.DjinnWar.Faction.MaridDoor) ~= 1 then + if not MsgContains(message, "djanni'hah") then npcHandler:say("Whoa! A human! This is no place for you, |PLAYERNAME|. Go and play somewhere else.", npc, creature) + endConversationWithDelay(npcHandler, npc, creature) return false end - if player:getStorageValue(Storage.DjinnWar.Faction.Greeting) == -1 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Start) == 1 then npcHandler:say({ "Hahahaha! ...", "|PLAYERNAME|, that almost sounded like the word of greeting. Humans - cute they are!", }, npc, creature) + endConversationWithDelay(npcHandler, npc, creature) return false end - if player:getStorageValue(Storage.DjinnWar.Faction.MaridDoor) ~= 1 then - npcHandler:setMessage(MESSAGE_GREET, { + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.Greeting) == -1 then + npcHandler:say({ + "Hahahaha! ...", + "|PLAYERNAME|, that almost sounded like the word of greeting. Humans - cute they are!", + }, npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.MaridDoor) ~= 1 then + npcHandler:say({ "Whoa? You know the word! Amazing, |PLAYERNAME|! ...", "I should go and tell Fa'hradin. ...", "Well. Why are you here anyway, |PLAYERNAME|?", - }) + }, npc, creature) else - npcHandler:setMessage(MESSAGE_GREET, "|PLAYERNAME|! How's it going these days? What brings you {here}?") + npcHandler:say("|PLAYERNAME|! How's it going these days? What brings you {here}?", npc, creature) end + + npcHandler:setInteraction(npc, creature) + return true end @@ -98,7 +118,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "passage") then - if player:getStorageValue(Storage.DjinnWar.Faction.MaridDoor) ~= 1 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.MaridDoor) ~= 1 then npcHandler:say({ "If you want to enter our fortress you have to become one of us and fight the Efreet. ...", "So, are you willing to do so?", @@ -109,7 +129,7 @@ local function creatureSayCallback(npc, creature, type, message) end elseif npcHandler:getTopic(playerId) == 1 then if MsgContains(message, "yes") then - if player:getStorageValue(Storage.DjinnWar.Faction.EfreetDoor) ~= 1 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.EfreetDoor) ~= 1 then npcHandler:say("Are you sure? You pledge loyalty to king Gabel, who is... you know. And you are willing to never ever set foot on Efreets' territory, unless you want to kill them? Yes?", npc, creature) npcHandler:setTopic(playerId, 2) else @@ -126,8 +146,8 @@ local function creatureSayCallback(npc, creature, type, message) "Oh. Ok. Welcome then. You may pass. ...", "And don't forget to kill some Efreets, now and then.", }, npc, creature) - player:setStorageValue(Storage.DjinnWar.Faction.MaridDoor, 1) - player:setStorageValue(Storage.DjinnWar.Faction.Greeting, 0) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.MaridDoor, 1) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.Faction.Greeting, 0) elseif MsgContains(message, "no") then npcHandler:say("This isn't your war anyway, human.", npc, creature) end @@ -137,7 +157,7 @@ local function creatureSayCallback(npc, creature, type, message) end -- Greeting -keywordHandler:addGreetKeyword({ "djanni'hah" }, { npcHandler = npcHandler, text = "Whoa! A human! This is no place for you, |PLAYERNAME|. Go and play somewhere else" }) +keywordHandler:addCustomGreetKeyword({ "djanni'hah" }, greetCallback, { npcHandler = npcHandler }) npcHandler:setMessage(MESSAGE_FAREWELL, "Aaaa -tention!") npcHandler:setMessage(MESSAGE_WALKAWAY, "Aaaa -tention!") diff --git a/data-otservbr-global/npc/ustan.lua b/data-otservbr-global/npc/ustan.lua index b7c037ae6e9..cd0ccf33b4b 100644 --- a/data-otservbr-global/npc/ustan.lua +++ b/data-otservbr-global/npc/ustan.lua @@ -61,13 +61,13 @@ local function creatureSayCallback(npc, creature, type, message) if MsgContains(message, "cough syrup") then npcHandler:say("I had some cough syrup a while ago. It was stolen in an ape raid. I fear if you want more cough syrup you will have to buy it in the druids guild in carlin.", npc, creature) elseif MsgContains(message, "addon") then - if player:getStorageValue(Storage.OutfitQuest.DruidBodyAddon) < 1 then + if player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidBodyAddon) < 1 then npcHandler:say("Would you like to wear bear paws like I do? No problem, just bring me 50 bear paws and 50 wolf paws and I'll fit them on.", npc, creature) - player:setStorageValue(Storage.OutfitQuest.DruidBodyAddon, 1) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidBodyAddon, 1) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "paws") or MsgContains(message, "bear paws") then - if player:getStorageValue(Storage.OutfitQuest.DruidBodyAddon) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidBodyAddon) == 1 then npcHandler:say("Have you brought 50 bear paws and 50 wolf paws?", npc, creature) npcHandler:setTopic(playerId, 1) end @@ -77,7 +77,8 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Excellent! Like promised, here are your bear paws. ", npc, creature) player:removeItem(5896, 50) player:removeItem(5897, 50) - player:setStorageValue(Storage.OutfitQuest.DruidBodyAddon, 2) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.DruidBodyAddon, 2) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) player:addOutfitAddon(148, 1) player:addOutfitAddon(144, 1) npcHandler:setTopic(playerId, 0) @@ -87,6 +88,8 @@ local function creatureSayCallback(npc, creature, type, message) return true end +npcHandler:setMessage(MESSAGE_GREET, "Crunor's blessing, traveller.") + npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) diff --git a/data-otservbr-global/npc/uzgod.lua b/data-otservbr-global/npc/uzgod.lua index 698ad8ea579..db9ec364b58 100644 --- a/data-otservbr-global/npc/uzgod.lua +++ b/data-otservbr-global/npc/uzgod.lua @@ -57,7 +57,7 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "piece of draconian steel") then + if MsgContains(message, "piece of draconian steel") and player:getStorageValue(Storage.Quest.U7_8.ObsidianKnife) < 1 then npcHandler:say("You bringing me draconian steel and obsidian lance in exchange for obsidian knife?", npc, creature) npcHandler:setTopic(playerId, 15) elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 15 then @@ -65,6 +65,7 @@ local function creatureSayCallback(npc, creature, type, message) if player:removeItem(5889, 1) and player:removeItem(3313, 1) then npcHandler:say("Here you have it.", npc, creature) player:addItem(5908, 1) + player:setStorageValue(Storage.Quest.U7_8.ObsidianKnife, 1) npcHandler:setTopic(playerId, 0) end else @@ -74,7 +75,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "pickaxe") then - if player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) == 1 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 1 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) == 1 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 1 then npcHandler:say("True dwarven pickaxes having to be maded by true weaponsmith! You wanting to get pickaxe for explorer society?", npc, creature) npcHandler:setTopic(playerId, 1) end @@ -89,7 +90,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 6) end elseif MsgContains(message, "brooch") then - if player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) == 3 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 3 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) == 3 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 3 then npcHandler:say("You got me brooch?", npc, creature) npcHandler:setTopic(playerId, 3) end @@ -103,9 +104,9 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Last key should be in the generals quarter near armory. Only General might have key to enter there too. But me not knowing how to enter Generals private room at barracks. You looking on your own ...", npc, creature) npcHandler:say("When got key, then you going down to dwarven prison and getting me that brooch. Tell me that you got brooch when having it.", npc, creature) npcHandler:setTopic(playerId, 0) - player:setStorageValue(Storage.ExplorerSociety.JoiningTheExplorers, 2) - player:setStorageValue(Storage.ExplorerSociety.DwacatraDoor, 1) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 2) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers, 2) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.DwacatraDoor, 1) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 2) elseif npcHandler:getTopic(playerId) == 3 then if player:removeItem(4834, 1) then ----- npcHandler:say("Thanking you for brooch. Me guessing you now want your pickaxe?", npc, creature) @@ -114,8 +115,8 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 4 then npcHandler:say("Here you have it.", npc, creature) player:addItem(4845, 1) ----- - player:setStorageValue(Storage.ExplorerSociety.JoiningTheExplorers, 4) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 4) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers, 4) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 4) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 9 then if player:getMoney() + player:getBankBalance() >= 250 and player:getItemCount(5880) >= 3 then @@ -142,6 +143,10 @@ local function creatureSayCallback(npc, creature, type, message) return true end +npcHandler:setMessage(MESSAGE_GREET, "Hiho |PLAYERNAME|! Wanna weapon, eh?") +npcHandler:setMessage(MESSAGE_FAREWELL, "Guut bye. Coming back soon.") +npcHandler:setMessage(MESSAGE_WALKAWAY, "Guut bye. Coming back soon.") + npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) diff --git a/data-otservbr-global/npc/vescu.lua b/data-otservbr-global/npc/vescu.lua index b5bb19f773f..57924d9c601 100644 --- a/data-otservbr-global/npc/vescu.lua +++ b/data-otservbr-global/npc/vescu.lua @@ -91,14 +91,23 @@ local config = { }, } +local function endConversationWithDelay(npcHandler, npc, creature) + addEvent(function() + npcHandler:unGreet(npc, creature) + end, 1000) +end + local function greetCallback(npc, creature) local playerId = creature:getId() - if Player(creature):getCondition(CONDITION_DRUNK) then + if Player(creature):getCondition(CONDITION_DRUNK) and player:getStorageValue(Storage.Quest.U7_8.AssassinOutfits.AssassinBaseOutfit) < 1 then npcHandler:setMessage(MESSAGE_GREET, "Hey t-there, you look like someone who enjoys a good {booze}.") + npcHandler:setInteraction(npc, creature) else npcHandler:say("Oh, two t-trolls. Hellooo, wittle twolls. ", npc, creature) + endConversationWithDelay(npcHandler, npc, creature) return false end + return true end @@ -110,29 +119,36 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "potion") then - if player:getStorageValue(Storage.OutfitQuest.AssassinBaseOutfit) < 1 then - npcHandler:say("It's so hard to know the exact time when to stop drinking. C-could you help me to brew such a potion?", npc, creature) + if MsgContains(message, "sober") then + if player:getStorageValue(Storage.Quest.U7_8.AssassinOutfits.AssassinBaseOutfit) < 1 then + npcHandler:say("I wish there was like a {potion} which makes you sober in an instant. Dwarven rings wear off so fast. ", npc, creature) npcHandler:setTopic(playerId, 1) end + elseif MsgContains(message, "potion") then + if npcHandler:getTopic(playerId) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.AssassinOutfits.AssassinBaseOutfit) < 1 then + npcHandler:say("It's so hard to know the exact time when to stop drinking. C-could you help me to brew such a potion?", npc, creature) + npcHandler:setTopic(playerId, 2) + end + end elseif config[message] and npcHandler:getTopic(playerId) == 0 then - if player:getStorageValue(Storage.OutfitQuest.AssassinBaseOutfit) == config[message].storageValue then + if player:getStorageValue(Storage.Quest.U7_8.AssassinOutfits.AssassinBaseOutfit) == config[message].storageValue then npcHandler:say(config[message].text[1], npc, creature) - npcHandler:setTopic(playerId, 3) + npcHandler:setTopic(playerId, 4) topic[playerId] = message else npcHandler:say(config[message].text[2], npc, creature) end elseif MsgContains(message, "secret") then - if player:getStorageValue(Storage.OutfitQuest.AssassinBaseOutfit) == 8 then + if player:getStorageValue(Storage.Quest.U7_8.AssassinOutfits.AssassinBaseOutfit) == 8 then npcHandler:say("Right. Since you helped me to b-brew that potion and thus ensured the high quality of my work , I'll give you my old assassin costume. It lacks the head part, but it's almost like new. Don't pretend to be me though, 'kay? ", npc, creature) player:addOutfit(156) player:addOutfit(152) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) - player:setStorageValue(Storage.OutfitQuest.AssassinBaseOutfit, 9) + player:setStorageValue(Storage.Quest.U7_8.AssassinOutfits.AssassinBaseOutfit, 9) end elseif MsgContains(message, "yes") then - if npcHandler:getTopic(playerId) == 1 then + if npcHandler:getTopic(playerId) == 2 then npcHandler:say({ "You're a true buddy. I promise I will t-try to avoid killing you even if someone asks me to. ...", "Listen, I have this old formula from my grandma. It says... 30 {bonelord eyes}... 10 {red dragon scales}. ...", @@ -140,15 +156,15 @@ local function creatureSayCallback(npc, creature, type, message) "Add 20 ounces of {vampire dust}, 10 ounces of {demon dust} and mix well with one flask of {warrior's sweat}. ...", "Okayyy, this is a lot... we'll take this step by step. Will you help me gathering 30 {bonelord eyes}?", }, npc, creature) - npcHandler:setTopic(playerId, 2) - elseif npcHandler:getTopic(playerId) == 2 then + npcHandler:setTopic(playerId, 3) + elseif npcHandler:getTopic(playerId) == 3 then if player:getStorageValue(Storage.OutfitQuest.DefaultStart) ~= 1 then player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1) end - player:setStorageValue(Storage.OutfitQuest.AssassinBaseOutfit, 1) + player:setStorageValue(Storage.Quest.U7_8.AssassinOutfits.AssassinBaseOutfit, 1) npcHandler:say("G-good. Go get them, I'll have a beer in the meantime.", npc, creature) npcHandler:setTopic(playerId, 0) - elseif npcHandler:getTopic(playerId) == 3 then + elseif npcHandler:getTopic(playerId) == 4 then local targetMessage = config[topic[playerId]] local count = targetMessage.count or 1 if not player:removeItem(targetMessage.itemId, count) then @@ -157,14 +173,14 @@ local function creatureSayCallback(npc, creature, type, message) return true end - player:setStorageValue(Storage.OutfitQuest.AssassinBaseOutfit, player:getStorageValue(Storage.OutfitQuest.AssassinBaseOutfit) + 1) + player:setStorageValue(Storage.Quest.U7_8.AssassinOutfits.AssassinBaseOutfit, player:getStorageValue(Storage.Quest.U7_8.AssassinOutfits.AssassinBaseOutfit) + 1) npcHandler:say(targetMessage.text[3], npc, creature) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "no") then - if npcHandler:getTopic(playerId) ~= 3 then + if npcHandler:getTopic(playerId) ~= 4 then npcHandler:say("Then not .", npc, creature) - elseif npcHandler:getTopic(playerId) == 3 then + elseif npcHandler:getTopic(playerId) == 4 then npcHandler:say("H-hurry up! I have to start working soon.", npc, creature) end npcHandler:setTopic(playerId, 0) @@ -177,14 +193,6 @@ local function onReleaseFocus(npc, creature) topic[playerId] = nil end -keywordHandler:addKeyword({ "addon" }, StdModule.say, { npcHandler = npcHandler, text = "I can give you a scar as an addon. Nyahahah." }) -keywordHandler:addKeyword({ "booze" }, StdModule.say, { npcHandler = npcHandler, text = "Did I say booze? I meant, {flamingo}. Pink birds are kinda cool, don't you think? Especially on a painting." }) -keywordHandler:addKeyword({ "flamingo" }, StdModule.say, { npcHandler = npcHandler, text = "You have to enjoy the word. Like, {flayyyminnngoooo}. Say it with me. " }) -keywordHandler:addKeyword({ "flayyyminnngoooo" }, StdModule.say, { npcHandler = npcHandler, text = "Yes, you got it! Hahaha, we understand each other. Good {job}. " }) -keywordHandler:addKeyword({ "job" }, StdModule.say, { npcHandler = npcHandler, text = "I'm a killer! Yeshindeed! A masterful assassin. I prefer that too 'Peekay'. " }) -keywordHandler:addKeyword({ "outfit" }, StdModule.say, { npcHandler = npcHandler, text = "O-outfit? You already have a t-troll outfit. That's good enough for you. " }) -keywordHandler:addKeyword({ "sober" }, StdModule.say, { npcHandler = npcHandler, text = "I wish there was like a {potion} which makes you sober in an instant. Dwarven rings wear off so fast. " }) - npcHandler:setMessage(MESSAGE_FAREWELL, "T-time for another b-beer. ") npcHandler:setMessage(MESSAGE_WALKAWAY, "Oh, two t-trolls. Hellooo, wittle twolls. ") diff --git a/data-otservbr-global/npc/vulturenose.lua b/data-otservbr-global/npc/vulturenose.lua index 97610fff906..3623e661cc6 100644 --- a/data-otservbr-global/npc/vulturenose.lua +++ b/data-otservbr-global/npc/vulturenose.lua @@ -54,21 +54,16 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "enter") then - if player:getStorageValue(Storage.TheShatteredIsles.RaysMission3) == 1 and player:getStorageValue(Storage.TheShatteredIsles.YavernDoor) < 0 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission3) == 1 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.YavernDoor) < 0 then local headItem = player:getSlotItem(CONST_SLOT_HEAD) local armorItem = player:getSlotItem(CONST_SLOT_ARMOR) local legsItem = player:getSlotItem(CONST_SLOT_LEGS) local feetItem = player:getSlotItem(CONST_SLOT_FEET) if headItem and headItem.itemid == 6096 and armorItem and armorItem.itemid == 6095 and legsItem and legsItem.itemid == 5918 and feetItem and feetItem.itemid == 5461 then npcHandler:say("Hey, I rarely see a dashing pirate like you! Get in, matey!", npc, creature) - player:setStorageValue(Storage.TheShatteredIsles.YavernDoor, 1) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.YavernDoor, 1) else - npcHandler:say( - "YOU WILL NOT PASS! Erm ... \ - I mean you don't look like a true pirate to me. You won't get in.", - npc, - creature - ) + npcHandler:say("YOU WILL NOT PASS! Erm ... I mean you don't look like a true pirate to me. You won't get in.", npc, creature) end end end diff --git a/data-otservbr-global/npc/wyrdin.lua b/data-otservbr-global/npc/wyrdin.lua index ee7ff28fdee..6e66b007db7 100644 --- a/data-otservbr-global/npc/wyrdin.lua +++ b/data-otservbr-global/npc/wyrdin.lua @@ -77,7 +77,7 @@ local function creatureSayCallback(npc, creature, type, message) end if MsgContains(message, "mission") then - if player:getStorageValue(Storage.TheWayToYalahar.QuestLine) < 1 and player:getStorageValue(Storage.ExplorerSociety.JoiningTheExplorers) >= 4 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) >= 4 then + if player:getStorageValue(Storage.TheWayToYalahar.QuestLine) < 1 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers) >= 4 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) >= 4 then npcHandler:say({ "There is indeed something that needs our attention. In the far north, a new city named Yalahar was discovered. It seems to be incredibly huge. ...", "According to travelers, it's a city of glory and wonders. We need to learn as much as we can about this city and its inhabitants. ...", diff --git a/data-otservbr-global/npc/yaman.lua b/data-otservbr-global/npc/yaman.lua index 3c66cd888e5..cb86fd7346f 100644 --- a/data-otservbr-global/npc/yaman.lua +++ b/data-otservbr-global/npc/yaman.lua @@ -45,6 +45,37 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local function endConversationWithDelay(npcHandler, npc, creature) + addEvent(function() + npcHandler:unGreet(npc, creature) + end, 1000) +end + +local function greetCallback(npc, creature, message) + local player = Player(creature) + local playerId = player:getId() + + if not MsgContains(message, "djanni'hah") then + npcHandler:say("Shove off, little one! Humans are not welcome here, |PLAYERNAME|!", npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.MaridFaction.Start) == 1 then + npcHandler:say({ + "Hahahaha! ...", + "|PLAYERNAME|, that almost sounded like the word of greeting. Humans - cute they are!", + }, npc, creature) + endConversationWithDelay(npcHandler, npc, creature) + return false + end + + npcHandler:say("Be greeted, human |PLAYERNAME|. How can a humble djinn be of service?", npc, creature) + npcHandler:setInteraction(npc, creature) + + return true +end + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -121,18 +152,20 @@ local function onTradeRequest(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.DjinnWar.EfreetFaction.Mission03) ~= 3 then + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission03) ~= 3 then npcHandler:say("I'm sorry, but you don't have Malor's permission to trade with me.", npc, creature) return false end return true end -npcHandler:setMessage(MESSAGE_GREET, "Be greeted, human |PLAYERNAME|. How can a humble djinn be of service?") +keywordHandler:addCustomGreetKeyword({ "djanni'hah" }, greetCallback, { npcHandler = npcHandler }) + npcHandler:setMessage(MESSAGE_FAREWELL, "Farewell, human.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Farewell, human.") npcHandler:setMessage(MESSAGE_SENDTRADE, "At your service, just browse through my wares.") +npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_ON_TRADE_REQUEST, onTradeRequest) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) diff --git a/data-otservbr-global/npc/yberius.lua b/data-otservbr-global/npc/yberius.lua index 7d2f6fa7b9b..ab6a48d323b 100644 --- a/data-otservbr-global/npc/yberius.lua +++ b/data-otservbr-global/npc/yberius.lua @@ -89,23 +89,23 @@ stoneKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, t -- Wooden Stake keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "I think you have forgotten to bring your stake." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 4 and player:getItemCount(5941) == 0 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 4 and player:getItemCount(5941) == 0 end) local stakeKeyword = keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "Yes, I was informed what to do. Are you prepared to receive my line of the prayer?" }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 4 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 4 end) stakeKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "So receive my prayer: 'Protection will be granted - from dangers at hand'. Now, bring your stake to Isimov in the dwarven settlement for the next line of the prayer. I will inform him what to do.", reset = true }, nil, function(player) - player:setStorageValue(Storage.FriendsandTraders.TheBlessedStake, 5) + player:setStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, 5) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) end) stakeKeyword:addChildKeyword({ "" }, StdModule.say, { npcHandler = npcHandler, text = "I will wait for you.", reset = true }) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You should visit Isimov in the dwarven settlement now." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) == 5 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) == 5 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "You already received my line of the prayer." }, function(player) - return player:getStorageValue(Storage.FriendsandTraders.TheBlessedStake) > 5 + return player:getStorageValue(Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake) > 5 end) keywordHandler:addKeyword({ "stake" }, StdModule.say, { npcHandler = npcHandler, text = "A blessed stake? That is a strange request. Maybe Quentin knows more, he is one of the oldest monks after all." }) diff --git a/data-otservbr-global/npc/zoltan.lua b/data-otservbr-global/npc/zoltan.lua index 2b6d0d78518..1dbdad4d07a 100644 --- a/data-otservbr-global/npc/zoltan.lua +++ b/data-otservbr-global/npc/zoltan.lua @@ -69,48 +69,47 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:say("A quite undruidic order of druids they were, as far as we know. I have no more enlightening knowledge about them though.", npc, creature) npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "proof") then + npcHandler:say("... I cannot believe my eyes. You retrieved this hat from Ferumbras' remains? That is incredible. If you give it to me, I will grant you the right to wear this hat as addon. What do you say?", npc, creature) + npcHandler:setTopic(playerId, 1) + elseif npcHandler:getTopic(playerId) == 1 then + if player:getSex() == PLAYERSEX_MALE and not player:hasOutfit(130, 2) then + if MsgContains(message, "yes") then + if player:getItemCount(5903) == 1 then + npcHandler:say("Sorry you don't have the Ferumbras' hat.", npc, creature) + else + npcHandler:say("I bow to you, player, and hereby grant you the right to wear Ferumbras' hat as accessory. Congratulations!", npc, creature) + player:removeItem(5903, 1) + player:addOutfitAddon(130, 2) -- male mage addon + player:addOutfitAddon(133, 2) -- male summoner addon + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + end + else + npcHandler:say("This task is only available for male players who don't already have the addon.", npc, creature) + end + end + elseif MsgContains(message, "myra") then + if player:getSex() == PLAYERSEX_FEMALE and player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) == 10 and not player:hasOutfit(138, 2) then + npcHandler:say({ + "Bah, I know. I received some sort of 'nomination' from our outpost in Port Hope. ...", + "Usually it takes a little more than that for an award though. However, I honour Myra's word. ...", + "I hereby grant you the right to wear a special sign of honour, acknowledged by the academy of Edron. Since you are a woman, I guess you don't want manly stuff. There you go.", + }, npc, creature, 100) + player:addOutfitAddon(138, 2) -- female mage addon + player:addOutfitAddon(141, 2) -- female summoner addon + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak, 11) + player:setStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.MissionHatCloak, 0) + elseif player:getStorageValue(Storage.Quest.U7_8.MageAndSummonerOutfits.AddonHatCloak) == 11 then + npcHandler:say("Stop bothering me. I am a far too busy man to be constantly giving out awards.", npc, creature) + else + npcHandler:say("What the hell are you talking about?", npc, creature) + end end + return true end --- Female Summoner and Male Mage Hat Addon (needs to be rewritten) -local hatKeyword = keywordHandler:addKeyword({ "proof" }, StdModule.say, { npcHandler = npcHandler, text = "... I cannot believe my eyes. You retrieved this hat from Ferumbras' remains? That is incredible. If you give it to me, I will grant you the right to wear this hat as addon. What do you say?" }, function(player) - return not player:hasOutfit(player:getSex() == PLAYERSEX_FEMALE and 141 or 130, 2) -end) -hatKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "Sorry you don't have the Ferumbras' hat." }, function(player) - return player:getItemCount(5903) == 0 -end) -hatKeyword:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "I bow to you, player, and hereby grant you the right to wear Ferumbras' hat as accessory. Congratulations!" }, nil, function(player) - player:removeItem(5903, 1) - player:addOutfitAddon(141, 2) - player:addOutfitAddon(130, 2) - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) -end) --- hatKeyword:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = ''}) - -keywordHandler:addKeyword({ "myra" }, StdModule.say, { - npcHandler = npcHandler, - text = { - "Bah, I know. I received some sort of 'nomination' from our outpost in Port Hope. ...", - "Usually it takes a little more than that for an award though. However, I honour Myra's word. ...", - "I hereby grant you the right to wear a special sign of honour, acknowledged by the academy of Edron. Since you are a man, I guess you don't want girlish stuff. There you go.", - }, -}, function(player) - return player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonHatCloak) == 10 -end, function(player) - player:addOutfitAddon(138, 2) - player:addOutfitAddon(133, 2) - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.AddonHatCloak, 11) - player:setStorageValue(Storage.OutfitQuest.MageSummoner.MissionHatCloak, 0) - player:setStorageValue(Storage.OutfitQuest.Ref, math.min(0, player:getStorageValue(Storage.OutfitQuest.Ref) - 1)) -end) - -keywordHandler:addKeyword({ "myra" }, StdModule.say, { npcHandler = npcHandler, text = "Stop bothering me. I am a far too busy man to be constantly giving out awards." }, function(player) - return player:getStorageValue(Storage.OutfitQuest.MageSummoner.AddonHatCloak) == 11 -end) -keywordHandler:addKeyword({ "myra" }, StdModule.say, { npcHandler = npcHandler, text = "What the hell are you talking about?" }) - npcHandler:setMessage(MESSAGE_GREET, "Welcome |PLAYERNAME|, student of the arcane arts. I teach the fiercest {spells} available.") npcHandler:setMessage(MESSAGE_FAREWELL, "Use your knowledge wisely, |PLAYERNAME|.") diff --git a/data-otservbr-global/scripts/actions/other/others/quest_system1.lua b/data-otservbr-global/scripts/actions/other/others/quest_system1.lua index f0781d45dd7..1783d8454a3 100644 --- a/data-otservbr-global/scripts/actions/other/others/quest_system1.lua +++ b/data-otservbr-global/scripts/actions/other/others/quest_system1.lua @@ -1,8 +1,4 @@ local specialQuests = { - -- {x = 32752, y = 32343, z = 14} - [52167] = Storage.DreamersChallenge.Reward, - -- {x = 32806, y = 32230, z = 11} - [52003] = Storage.PitsOfInferno.WeaponReward, -- {x = 32311, y = 32211, z = 8} [51400] = Storage.ThievesGuild.Reward, [51324] = Storage.WrathoftheEmperor.MainReward, @@ -176,8 +172,8 @@ function questSystem1.onUse(player, item, fromPosition, target, toPosition, isHo end if table.contains(hotaQuest, item.uid) then - if player:getStorageValue(Storage.TheAncientTombs.DefaultStart) ~= 1 then - player:setStorageValue(Storage.TheAncientTombs.DefaultStart, 1) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.DefaultStart) ~= 1 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.DefaultStart, 1) end end diff --git a/data-otservbr-global/scripts/actions/other/others/quest_system2.lua b/data-otservbr-global/scripts/actions/other/others/quest_system2.lua index a7e7c41b8e8..4f8dbd32546 100644 --- a/data-otservbr-global/scripts/actions/other/others/quest_system2.lua +++ b/data-otservbr-global/scripts/actions/other/others/quest_system2.lua @@ -1,9 +1,9 @@ local config = { - [2285] = { + [2285] = { -- The Djinn War Quest - lamp items = { { itemId = 3243 }, }, - storage = Storage.DjinnWar.EfreetFaction.Mission03, + storage = Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission03, formerValue = 1, newValue = 2, needItem = { itemId = 3231 }, @@ -35,7 +35,7 @@ local config = { items = { { itemId = 3243 }, }, - storage = Storage.DjinnWar.MaridFaction.Mission03, + storage = Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission03, formerValue = 1, newValue = 2, needItem = { itemId = 3231 }, @@ -104,7 +104,7 @@ local config = { items = { { itemId = 4832 }, }, - storage = Storage.TheApeCity.HolyApeHair, + storage = Storage.Quest.U7_6.TheApeCity.HolyApeHair, }, [9136] = { items = { @@ -116,21 +116,22 @@ local config = { items = { { itemId = 3397 }, }, - storage = Storage.SamsOldBackpack, + storage = Storage.Quest.U7_5.SamsOldBackpack.SamsOldBackpackNpc, formerValue = 2, newValue = 3, }, + -- Hydra Egg Quest [9255] = { items = { { itemId = 4839 }, }, - storage = Storage.HydraEggQuest, + storage = Storage.Quest.U7_6.HydraEggQuest, }, [9256] = { items = { { itemId = 4829, decay = true }, }, - storage = Storage.TheApeCity.WitchesCapSpot, + storage = Storage.Quest.U7_6.TheApeCity.WitchesCapSpot, time = true, }, [9259] = { diff --git a/data-otservbr-global/scripts/actions/quests/druid_outfit/waterskin.lua b/data-otservbr-global/scripts/actions/quests/druid_outfit/waterskin.lua deleted file mode 100644 index 084ce3ecffe..00000000000 --- a/data-otservbr-global/scripts/actions/quests/druid_outfit/waterskin.lua +++ /dev/null @@ -1,13 +0,0 @@ -local druidWaterSkin = Action() -function druidWaterSkin.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if target.itemid ~= 5662 then - return false - end - - toPosition:sendMagicEffect(CONST_ME_LOSEENERGY) - item:transform(5939) - return true -end - -druidWaterSkin:id(5938) -druidWaterSkin:register() diff --git a/data-otservbr-global/scripts/actions/quests/explorer_society/botanist.lua b/data-otservbr-global/scripts/actions/quests/explorer_society/botanist.lua deleted file mode 100644 index 27298f5e7ba..00000000000 --- a/data-otservbr-global/scripts/actions/quests/explorer_society/botanist.lua +++ /dev/null @@ -1,33 +0,0 @@ -local explorerSocietyBotanist = Action() -function explorerSocietyBotanist.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if target.itemid == 3874 and player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 18 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 18 then - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 19) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 19) - toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) - item:transform(4868) - elseif target.itemid == 3885 and player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 21 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 21 then - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 22) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 22) - toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) - item:transform(4869) - elseif target.itemid == 3878 and player:getStorageValue(Storage.ExplorerSociety.ThePlantCollection) == 24 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 24 then - player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 25) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 25) - toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) - item:transform(4870) - elseif target.itemid == 5658 and target.uid == 3152 then - if player:getStorageValue(53051) < 1 then - toPosition:sendMagicEffect(CONST_ME_MAGIC_RED) - item:transform(5937) - player:setStorageValue(53051, 1) - player:say("You successfully took a sample of the rare griffinclaw flower.", TALKTYPE_MONSTER_SAY) - else - toPosition:sendMagicEffect(CONST_ME_POFF) - player:say("You already took a sample of the rare griffinclaw flower.", TALKTYPE_MONSTER_SAY) - end - end - return true -end - -explorerSocietyBotanist:id(4867) -explorerSocietyBotanist:register() diff --git a/data-otservbr-global/scripts/actions/quests/explorer_society/butterfly.lua b/data-otservbr-global/scripts/actions/quests/explorer_society/butterfly.lua deleted file mode 100644 index 4ac5fc0828d..00000000000 --- a/data-otservbr-global/scripts/actions/quests/explorer_society/butterfly.lua +++ /dev/null @@ -1,26 +0,0 @@ -local explorerSocietyButterfly = Action() -function explorerSocietyButterfly.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if target.itemid == 4992 and player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 9 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 9 then - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 10) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 10) - toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) - item:transform(4864) - target:remove() - elseif target.itemid == 4993 and player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 12 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 12 then - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 13) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 13) - toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) - item:transform(4865) - target:remove() - elseif target.itemid == 4991 and player:getStorageValue(Storage.ExplorerSociety.TheButterflyHunt) == 15 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 15 then - player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 16) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 16) - toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) - item:transform(4866) - target:remove() - end - return true -end - -explorerSocietyButterfly:id(4863) -explorerSocietyButterfly:register() diff --git a/data-otservbr-global/scripts/actions/quests/explorer_society/dragon.lua b/data-otservbr-global/scripts/actions/quests/explorer_society/dragon.lua deleted file mode 100644 index 267153e1d97..00000000000 --- a/data-otservbr-global/scripts/actions/quests/explorer_society/dragon.lua +++ /dev/null @@ -1,13 +0,0 @@ -local explorerSocietyDragon = Action() -function explorerSocietyDragon.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.ExplorerSociety.TheIslandofDragons) == 57 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 57 then - player:setStorageValue(Storage.ExplorerSociety.TheIslandofDragons, 58) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 58) - player:addItem(7314, 1) - toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) - end - return true -end - -explorerSocietyDragon:uid(40042) -explorerSocietyDragon:register() diff --git a/data-otservbr-global/scripts/actions/quests/explorer_society/icicle.lua b/data-otservbr-global/scripts/actions/quests/explorer_society/icicle.lua deleted file mode 100644 index 83ddf5ec044..00000000000 --- a/data-otservbr-global/scripts/actions/quests/explorer_society/icicle.lua +++ /dev/null @@ -1,13 +0,0 @@ -local explorerSocietyIcicle = Action() -function explorerSocietyIcicle.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if target.itemid == 4994 and player:getStorageValue(Storage.ExplorerSociety.TheIceDelivery) == 6 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 6 then - player:setStorageValue(Storage.ExplorerSociety.TheIceDelivery, 7) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 7) - player:addItem(4837, 1) - toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) - end - return true -end - -explorerSocietyIcicle:id(4872) -explorerSocietyIcicle:register() diff --git a/data-otservbr-global/scripts/actions/quests/explorer_society/resonance.lua b/data-otservbr-global/scripts/actions/quests/explorer_society/resonance.lua deleted file mode 100644 index 3840a17cca2..00000000000 --- a/data-otservbr-global/scripts/actions/quests/explorer_society/resonance.lua +++ /dev/null @@ -1,15 +0,0 @@ -local explorerSocietyResonance = Action() -function explorerSocietyResonance.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if target.uid == 40043 then - if player:getStorageValue(Storage.ExplorerSociety.TheIceMusic) == 60 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 60 then - player:setStorageValue(Storage.ExplorerSociety.TheIceMusic, 61) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 61) - toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) - item:transform(7315) - end - end - return true -end - -explorerSocietyResonance:id(7242) -explorerSocietyResonance:register() diff --git a/data-otservbr-global/scripts/actions/quests/explorer_society/stone.lua b/data-otservbr-global/scripts/actions/quests/explorer_society/stone.lua deleted file mode 100644 index 9d1916641fe..00000000000 --- a/data-otservbr-global/scripts/actions/quests/explorer_society/stone.lua +++ /dev/null @@ -1,26 +0,0 @@ -local explorerSocietyStone = Action() -function explorerSocietyStone.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if target.uid == 25018 and player:getStorageValue(Storage.ExplorerSociety.TheSpectralStone) == 53 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 53 and player:getStorageValue(Storage.ExplorerSociety.SpectralStone) == 1 then -- mission taken from Angus - player:setStorageValue(Storage.ExplorerSociety.TheSpectralStone, 54) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 54) - toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) - elseif target.uid == 25019 and player:getStorageValue(Storage.ExplorerSociety.TheSpectralStone) == 54 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 54 and player:getStorageValue(Storage.ExplorerSociety.SpectralStone) == 1 then -- mission taken from Angus - player:setStorageValue(Storage.ExplorerSociety.TheSpectralStone, 55) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 55) - player:removeItem(4840, 1) - toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) - elseif target.uid == 25019 and player:getStorageValue(Storage.ExplorerSociety.TheSpectralStone) == 53 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 53 and player:getStorageValue(Storage.ExplorerSociety.SpectralStone) == 2 then -- mission taken from Mortimer - player:setStorageValue(Storage.ExplorerSociety.TheSpectralStone, 54) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 54) - toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) - elseif target.uid == 25018 and player:getStorageValue(Storage.ExplorerSociety.TheSpectralStone) == 54 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 54 and player:getStorageValue(Storage.ExplorerSociety.SpectralStone) == 2 then -- mission taken from Mortimer - player:setStorageValue(Storage.ExplorerSociety.TheSpectralStone, 55) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 55) - player:removeItem(4840, 1) - toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) - end - return true -end - -explorerSocietyStone:id(4840) -explorerSocietyStone:register() diff --git a/data-otservbr-global/scripts/actions/quests/green_djinn/tear.lua b/data-otservbr-global/scripts/actions/quests/green_djinn/tear.lua deleted file mode 100644 index 47b7dc8750f..00000000000 --- a/data-otservbr-global/scripts/actions/quests/green_djinn/tear.lua +++ /dev/null @@ -1,14 +0,0 @@ -local greenTear = Action() -function greenTear.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.DjinnWar.EfreetFaction.Mission02) ~= 1 then - return true - end - - Game.createItem(3233, 1, fromPosition) - player:setStorageValue(Storage.DjinnWar.EfreetFaction.Mission02, 2) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a tear of daraman.") - return true -end - -greenTear:aid(5390) -greenTear:register() diff --git a/data-otservbr-global/scripts/actions/quests/ice_islands/paint.lua b/data-otservbr-global/scripts/actions/quests/ice_islands/paint.lua index b1172b164bc..f7fd78ecd58 100644 --- a/data-otservbr-global/scripts/actions/quests/ice_islands/paint.lua +++ b/data-otservbr-global/scripts/actions/quests/ice_islands/paint.lua @@ -19,7 +19,7 @@ function icePaint.onUse(player, item, fromPosition, target, toPosition, isHotkey player:setStorageValue(Storage.TheIceIslands.Questline, 9) player:setStorageValue(Storage.TheIceIslands.Mission04, 2) -- Questlog The Ice Islands Quest, Nibelor 3: Artful Sabotage player:removeItem(7253, 1) - if player:getStorageValue(Storage.TheShatteredIsles.TortoiseEggNargorDoor) >= 2 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TortoiseEggNargorDoor) >= 2 then player:addAchievement("Animal Activist") end end diff --git a/data-otservbr-global/scripts/actions/quests/others/calassa_comb_door.lua b/data-otservbr-global/scripts/actions/quests/others/calassa_comb_door.lua index 4d84988d59d..681712d6aee 100644 --- a/data-otservbr-global/scripts/actions/quests/others/calassa_comb_door.lua +++ b/data-otservbr-global/scripts/actions/quests/others/calassa_comb_door.lua @@ -4,7 +4,7 @@ function othersCalassa.onUse(player, item, fromPosition, target, toPosition, isH return false end - if player:getStorageValue(Storage.OutfitQuest.firstOrientalAddon) ~= 1 or player:hasOutfit(player:getSex() == PLAYERSEX_FEMALE and 150 or 146, 1) then + if player:getStorageValue(Storage.Quest.U7_8.OrientalOutfits.FirstOrientalAddon) ~= 1 or player:hasOutfit(player:getSex() == PLAYERSEX_FEMALE and 150 or 146, 1) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.") return true end diff --git a/data-otservbr-global/scripts/actions/quests/others/ectoplasm_container.lua b/data-otservbr-global/scripts/actions/quests/others/ectoplasm_container.lua index 4c98cc53fdf..80e45219e2a 100644 --- a/data-otservbr-global/scripts/actions/quests/others/ectoplasm_container.lua +++ b/data-otservbr-global/scripts/actions/quests/others/ectoplasm_container.lua @@ -1,4 +1,5 @@ local othersEctoplasm = Action() + function othersEctoplasm.onUse(player, item, fromPosition, target, toPosition, isHotkey) if target.actionid == 4206 then if player:getStorageValue(Storage.TibiaTales.IntoTheBonePit) ~= 1 then @@ -9,10 +10,10 @@ function othersEctoplasm.onUse(player, item, fromPosition, target, toPosition, i item:transform(131) target:remove() toPosition:sendMagicEffect(CONST_ME_POFF) - elseif target.itemid == 4290 then - if player:getStorageValue(Storage.ExplorerSociety.TheEctoplasm) == 45 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 45 then - player:setStorageValue(Storage.ExplorerSociety.TheEctoplasm, 46) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 46) + elseif target.itemid == 4094 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheEctoplasm) == 45 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 45 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheEctoplasm, 46) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 46) toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) item:transform(4853) target:remove() diff --git a/data-otservbr-global/scripts/actions/quests/others/fire_bug.lua b/data-otservbr-global/scripts/actions/quests/others/fire_bug.lua index e75bebf26bd..42c6b19e7fe 100644 --- a/data-otservbr-global/scripts/actions/quests/others/fire_bug.lua +++ b/data-otservbr-global/scripts/actions/quests/others/fire_bug.lua @@ -57,9 +57,9 @@ function othersFireBug.onUse(player, item, fromPosition, target, toPosition, isH createTeleport:setDestination(Position(32857, 32234, 11)) return true elseif target.uid == 2273 then - if player:getStorageValue(Storage.TheShatteredIsles.RaysMission2) == 1 and player:getStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven) == 15 then - player:setStorageValue(Storage.TheShatteredIsles.RaysMission2, 2) - player:setStorageValue(Storage.TheShatteredIsles.ReputationInSabrehaven, 16) + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission2) == 1 and player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven) == 15 then + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission2, 2) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.ReputationInSabrehaven, 16) toPosition:sendMagicEffect(CONST_ME_HITBYFIRE) return true else diff --git a/data-otservbr-global/scripts/actions/quests/the_ancient_tombs/active_teleport_switches.lua b/data-otservbr-global/scripts/actions/quests/the_ancient_tombs/active_teleport_switches.lua deleted file mode 100644 index 8b846f435ea..00000000000 --- a/data-otservbr-global/scripts/actions/quests/the_ancient_tombs/active_teleport_switches.lua +++ /dev/null @@ -1,37 +0,0 @@ -local config = { - [12121] = GlobalStorage.TheAncientTombs.ThalasSwitchesGlobalStorage, - [12122] = GlobalStorage.TheAncientTombs.DiprathSwitchesGlobalStorage, - [12123] = GlobalStorage.TheAncientTombs.AshmunrahSwitchesGlobalStorage, -} - -local function resetScript(position, storage) - local item = Tile(position):getItemById(2773) - if item then - item:transform(2772) - end - - Game.setStorageValue(storage, Game.getStorageValue(storage) - 1) -end - -local theAncientActiveTeleport = Action() -function theAncientActiveTeleport.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local storage = config[item.actionid] - if not storage then - return true - end - - if item.itemid ~= 2772 then - return false - end - - Game.setStorageValue(storage, Game.getStorageValue(storage) + 1) - item:transform(2773) - addEvent(resetScript, 20 * 60 * 1000, toPosition, storage) - return true -end - -for actionId, info in pairs(config) do - theAncientActiveTeleport:aid(actionId) -end - -theAncientActiveTeleport:register() diff --git a/data-otservbr-global/scripts/actions/quests/the_ancient_tombs/lever.lua b/data-otservbr-global/scripts/actions/quests/the_ancient_tombs/lever.lua deleted file mode 100644 index 7c37af8b682..00000000000 --- a/data-otservbr-global/scripts/actions/quests/the_ancient_tombs/lever.lua +++ /dev/null @@ -1,62 +0,0 @@ -local config = { - bridgePositions = { - { position = Position(33119, 32794, 14), groundId = 727 }, - { position = Position(33119, 32795, 14), groundId = 727 }, - { position = Position(33120, 32794, 14), groundId = 727 }, - { position = Position(33120, 32795, 14), groundId = 727 }, - { position = Position(33121, 32794, 14), groundId = 727 }, - { position = Position(33121, 32795, 14), groundId = 727 }, - }, - leverPositions = { - Position(33115, 32797, 14), - Position(33118, 32790, 14), - Position(33122, 32790, 14), - }, - relocatePosition = Position(33120, 2791, 14), - relocateMonsterPosition = Position(33120, 32799, 14), - bridgeId = 5770, -} - -local theAncientLever = Action() -function theAncientLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local leverLeft, lever = item.itemid == 2772 - for i = 1, #config.leverPositions do - lever = Tile(config.leverPositions[i]):getItemById(leverLeft and 2772 or 2773) - if lever then - lever:transform(leverLeft and 2773 or 2772) - end - end - - local tile, tmpItem, bridge - if leverLeft then - for i = 1, #config.bridgePositions do - bridge = config.bridgePositions[i] - tile = Tile(bridge.position) - - tmpItem = tile:getGround() - if tmpItem then - tmpItem:transform(config.bridgeId) - end - - if bridge.itemId then - tmpItem = tile:getItemById(bridge.itemId) - if tmpItem then - tmpItem:remove() - end - end - end - else - for i = 1, #config.bridgePositions do - bridge = config.bridgePositions[i] - tile = Tile(bridge.position) - - tile:relocateTo(config.relocatePosition, true, config.relocateMonsterPosition) - tile:getGround():transform(bridge.groundId) - Game.createItem(bridge.itemId, 1, bridge.position) - end - end - return true -end - -theAncientLever:aid(12120) -theAncientLever:register() diff --git a/data-otservbr-global/scripts/actions/quests/the_ancient_tombs/ruins_instruments.lua b/data-otservbr-global/scripts/actions/quests/the_ancient_tombs/ruins_instruments.lua deleted file mode 100644 index 7b405f94d0d..00000000000 --- a/data-otservbr-global/scripts/actions/quests/the_ancient_tombs/ruins_instruments.lua +++ /dev/null @@ -1,32 +0,0 @@ -local config = { - [3255] = 1, - [3261] = 2, - [3258] = 3, - [3260] = 4, - [3257] = 5, -} - -local storage = Storage.TheAncientTombs.VashresamunInstruments - -local theAncientRuinsInstru = Action() -function theAncientRuinsInstru.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local targetTable = config[item.itemid] - if not targetTable then - player:setStorageValue(storage, 0) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You played them wrong, now you must begin with first again!") - doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -20, -20, CONST_ME_GROUNDSHAKER) - return true - end - - if player:getStorageValue(storage) == targetTable and targetTable < 4 then - player:setStorageValue(storage, math.max(1, player:getPlayerStorageValue(storage)) + 1) - fromPosition:sendMagicEffect(CONST_ME_SOUND_BLUE) - else - player:setStorageValue(Storage.TheAncientTombs.VashresamunsDoor, 1) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You played them in correct order and got the access through door!") - end - return true -end - -theAncientRuinsInstru:aid(12105) -theAncientRuinsInstru:register() diff --git a/data-otservbr-global/scripts/actions/quests/the_ape_city/mission9_catacombs_snake_destroyer.lua b/data-otservbr-global/scripts/actions/quests/the_ape_city/mission9_catacombs_snake_destroyer.lua deleted file mode 100644 index f726109d622..00000000000 --- a/data-otservbr-global/scripts/actions/quests/the_ape_city/mission9_catacombs_snake_destroyer.lua +++ /dev/null @@ -1,20 +0,0 @@ -local theApeMiss9 = Action() -function theApeMiss9.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if target.itemid ~= 4850 then - return false - end - - if player:getStorageValue(Storage.TheApeCity.Questline) ~= 17 or player:getStorageValue(Storage.TheApeCity.SnakeDestroyer) == 1 then - return false - end - - player:setStorageValue(Storage.TheApeCity.SnakeDestroyer, 1) - item:remove() - target:transform(4851) - target:decay() - toPosition:sendMagicEffect(CONST_ME_FIREAREA) - return true -end - -theApeMiss9:id(4835) -theApeMiss9:register() diff --git a/data-otservbr-global/scripts/actions/tools/crowbar.lua b/data-otservbr-global/scripts/actions/tools/crowbar.lua new file mode 100644 index 00000000000..0981bd61d24 --- /dev/null +++ b/data-otservbr-global/scripts/actions/tools/crowbar.lua @@ -0,0 +1,39 @@ +local function the_ape_city(player, item, target, toPosition) + if target:getActionId() == 40041 and target:getId() == 4848 then + local storageValue = player:getStorageValue(Storage.Quest.U7_6.TheApeCity.Casks) + if storageValue < 0 then + storageValue = 0 + end + + if storageValue >= 3 then + return true + end + + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Casks, storageValue + 1) + + return true + end + return false +end + +local crowbarActions = { + the_ape_city = the_ape_city, +} + +local function onUseCrowbar(player, item, fromPosition, target, toPosition, isHotkey) + for actionName, actionFunction in pairs(crowbarActions) do + if actionFunction(player, item, target, toPosition) then + return true + end + end + return true +end + +local crowbar = Action() + +function crowbar.onUse(player, item, fromPosition, target, toPosition, isHotkey) + return onUseCrowbar(player, item, fromPosition, target, toPosition, isHotkey) +end + +crowbar:id(3304) +crowbar:register() diff --git a/data-otservbr-global/scripts/actions/tools/rake.lua b/data-otservbr-global/scripts/actions/tools/rake.lua index 6279a5132fa..5d520e99aed 100644 --- a/data-otservbr-global/scripts/actions/tools/rake.lua +++ b/data-otservbr-global/scripts/actions/tools/rake.lua @@ -7,11 +7,11 @@ function rake.onUse(player, item, fromPosition, target, toPosition, isHotkey) player:say("You dig out a handful of ordinary clay.", TALKTYPE_MONSTER_SAY) -- The Shattered Isles Parrot ring elseif target.itemid == 6094 then - if player:getStorageValue(Storage.TheShatteredIsles.TheGovernorDaughter) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheGovernorDaughter) == 1 then toPosition:sendMagicEffect(CONST_ME_POFF) Game.createItem(6093, 1, Position(32422, 32770, 1)) player:say("You have found a ring.", TALKTYPE_MONSTER_SAY) - player:setStorageValue(Storage.TheShatteredIsles.TheGovernorDaughter, 2) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheGovernorDaughter, 2) end end return true diff --git a/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua b/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua index 6f7e00e77f6..da3c346e34d 100644 --- a/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua +++ b/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua @@ -91,25 +91,25 @@ local questTable = { { storage = Storage.CultsOfTibia.Misguided.BossTimer, storageValue = 1 }, { storage = Storage.CultsOfTibia.Minotaurs.EntranceAccessDoor, storageValue = 1 }, { storage = Storage.CultsOfTibia.Minotaurs.AccessDoor, storageValue = 1 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 1 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 4 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 7 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 16 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 26 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 29 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 32 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 35 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 38 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 41 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 43 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 46 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 47 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 50 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 55 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 56 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 58 }, - { storage = Storage.ExplorerSociety.QuestLine, storageValue = 61 }, - { storage = Storage.ExplorerSociety.CalassaQuest, storageValue = 2 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 1 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 4 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 7 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 16 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 26 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 29 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 32 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 35 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 38 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 41 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 43 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 46 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 47 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 50 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 55 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 56 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 58 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.QuestLine, storageValue = 61 }, + { storage = Storage.Quest.U7_6.ExplorerSociety.CalassaQuest, storageValue = 2 }, { storage = Storage.ForgottenKnowledge.Tomes, storageValue = 1 }, { storage = Storage.ForgottenKnowledge.LastLoreKilled, storageValue = 1 }, { storage = Storage.ForgottenKnowledge.TimeGuardianKilled, storageValue = 1 }, @@ -135,18 +135,18 @@ local questTable = { { storage = Storage.ChildrenoftheRevolution.SpyBuilding02, storageValue = 1 }, { storage = Storage.ChildrenoftheRevolution.SpyBuilding03, storageValue = 1 }, { storage = Storage.ChildrenoftheRevolution.StrangeSymbols, storageValue = 1 }, - { storage = Storage.DjinnWar.Faction.Greeting, storageValue = 2 }, - { storage = Storage.DjinnWar.Faction.MaridDoor, storageValue = 2 }, - { storage = Storage.DjinnWar.Faction.EfreetDoor, storageValue = 2 }, - { storage = Storage.DjinnWar.EfreetFaction.Start, storageValue = 1 }, - { storage = Storage.DjinnWar.EfreetFaction.Mission01, storageValue = 3 }, - { storage = Storage.DjinnWar.EfreetFaction.Mission02, storageValue = 3 }, - { storage = Storage.DjinnWar.EfreetFaction.Mission03, storageValue = 3 }, - { storage = Storage.DjinnWar.MaridFaction.Start, storageValue = 1 }, - { storage = Storage.DjinnWar.MaridFaction.Mission01, storageValue = 2 }, - { storage = Storage.DjinnWar.MaridFaction.Mission02, storageValue = 2 }, - { storage = Storage.DjinnWar.MaridFaction.RataMari, storageValue = 2 }, - { storage = Storage.DjinnWar.MaridFaction.Mission03, storageValue = 3 }, + { storage = Storage.Quest.U7_4.DjinnWar.Faction.Greeting, storageValue = 2 }, + { storage = Storage.Quest.U7_4.DjinnWar.Faction.MaridDoor, storageValue = 2 }, + { storage = Storage.Quest.U7_4.DjinnWar.Faction.EfreetDoor, storageValue = 2 }, + { storage = Storage.Quest.U7_4.DjinnWar.EfreetFaction.Start, storageValue = 1 }, + { storage = Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission01, storageValue = 3 }, + { storage = Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission02, storageValue = 3 }, + { storage = Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission03, storageValue = 3 }, + { storage = Storage.Quest.U7_4.DjinnWar.MaridFaction.Start, storageValue = 1 }, + { storage = Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission01, storageValue = 2 }, + { storage = Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission02, storageValue = 2 }, + { storage = Storage.Quest.U7_4.DjinnWar.MaridFaction.RataMari, storageValue = 2 }, + { storage = Storage.Quest.U7_4.DjinnWar.MaridFaction.Mission03, storageValue = 3 }, { storage = Storage.TheWayToYalahar.QuestLine, storageValue = 1 }, { storage = Storage.SearoutesAroundYalahar.TownsCounter, storageValue = 5 }, { storage = Storage.SearoutesAroundYalahar.AbDendriel, storageValue = 1 }, @@ -209,17 +209,17 @@ local questTable = { { storage = Storage.Quest.U8_54.TheNewFrontier.Mission05.Wyrdin, storageValue = 1 }, { storage = Storage.Quest.U8_54.TheNewFrontier.Mission05.Telas, storageValue = 1 }, { storage = Storage.Quest.U8_54.TheNewFrontier.Mission05.Humgolf, storageValue = 1 }, - { storage = Storage.TheShatteredIsles.DefaultStart, storageValue = 3 }, - { storage = Storage.TheShatteredIsles.TheGovernorDaughter, storageValue = 3 }, - { storage = Storage.TheShatteredIsles.TheErrand, storageValue = 2 }, - { storage = Storage.TheShatteredIsles.AccessToMeriana, storageValue = 1 }, - { storage = Storage.TheShatteredIsles.APoemForTheMermaid, storageValue = 3 }, - { storage = Storage.TheShatteredIsles.ADjinnInLove, storageValue = 5 }, - { storage = Storage.TheShatteredIsles.AccessToLagunaIsland, storageValue = 1 }, - { storage = Storage.TheShatteredIsles.AccessToGoroma, storageValue = 1 }, - { storage = Storage.TheShatteredIsles.Shipwrecked, storageValue = 2 }, - { storage = Storage.TheShatteredIsles.DragahsSpellbook, storageValue = 1 }, - { storage = Storage.TheShatteredIsles.TheCounterspell, storageValue = 4 }, + { storage = Storage.Quest.U7_8.TheShatteredIsles.DefaultStart, storageValue = 3 }, + { storage = Storage.Quest.U7_8.TheShatteredIsles.TheGovernorDaughter, storageValue = 3 }, + { storage = Storage.Quest.U7_8.TheShatteredIsles.TheErrand, storageValue = 2 }, + { storage = Storage.Quest.U7_8.TheShatteredIsles.AccessToMeriana, storageValue = 1 }, + { storage = Storage.Quest.U7_8.TheShatteredIsles.APoemForTheMermaid, storageValue = 3 }, + { storage = Storage.Quest.U7_8.TheShatteredIsles.ADjinnInLove, storageValue = 5 }, + { storage = Storage.Quest.U7_8.TheShatteredIsles.AccessToLagunaIsland, storageValue = 1 }, + { storage = Storage.Quest.U7_8.TheShatteredIsles.AccessToGoroma, storageValue = 1 }, + { storage = Storage.Quest.U7_8.TheShatteredIsles.Shipwrecked, storageValue = 2 }, + { storage = Storage.Quest.U7_8.TheShatteredIsles.DragahsSpellbook, storageValue = 1 }, + { storage = Storage.Quest.U7_8.TheShatteredIsles.TheCounterspell, storageValue = 4 }, { storage = Storage.ThievesGuild.Quest, storageValue = 1 }, { storage = Storage.ThievesGuild.Mission01, storageValue = 2 }, { storage = Storage.ThievesGuild.Mission02, storageValue = 3 }, @@ -244,10 +244,10 @@ local questTable = { { storage = 12330, storageValue = 1 }, { storage = 12332, storageValue = 13 }, { storage = 12333, storageValue = 3 }, - { storage = Storage.FriendsandTraders.DefaultStart, storageValue = 1 }, - { storage = Storage.FriendsandTraders.TheSweatyCyclops, storageValue = 2 }, - { storage = Storage.FriendsandTraders.TheMermaidMarina, storageValue = 2 }, - { storage = Storage.FriendsandTraders.TheBlessedStake, storageValue = 12 }, + { storage = Storage.Quest.U7_8.FriendsAndTraders.DefaultStart, storageValue = 1 }, + { storage = Storage.Quest.U7_8.FriendsAndTraders.TheSweatyCyclops, storageValue = 2 }, + { storage = Storage.Quest.U7_8.FriendsAndTraders.TheMermaidMarina, storageValue = 2 }, + { storage = Storage.Quest.U7_8.FriendsAndTraders.TheBlessedStake, storageValue = 12 }, { storage = 100157, storageValue = 1 }, { storage = Storage.WrathoftheEmperor.Questline, storageValue = 29 }, { storage = Storage.WrathoftheEmperor.Mission01, storageValue = 3 }, @@ -260,8 +260,8 @@ local questTable = { { storage = Storage.WrathoftheEmperor.Mission08, storageValue = 2 }, { storage = Storage.WrathoftheEmperor.Mission09, storageValue = 2 }, { storage = Storage.WrathoftheEmperor.Mission10, storageValue = 1 }, - { storage = Storage.TheApeCity.Started, storageValue = 1 }, - { storage = Storage.TheApeCity.Questline, storageValue = 18 }, + { storage = Storage.Quest.U7_6.TheApeCity.Started, storageValue = 1 }, + { storage = Storage.Quest.U7_6.TheApeCity.Questline, storageValue = 18 }, { storage = Storage.BanutaSecretTunnel.DeeperBanutaShortcut, storageValue = 1 }, { storage = Storage.Oramond.QuestLine, storageValue = 1 }, { storage = Storage.Oramond.MissionToTakeRoots, storageValue = 3000 }, @@ -343,10 +343,10 @@ local questTable = { { storage = Storage.TheSecretLibrary.MiniBosses.GrandCommanderSoeren, storageValue = 1 }, { storage = Storage.TheSecretLibrary.MiniBosses.DazedLeafGolem, storageValue = 1 }, - { storage = Storage.DjinnWar.EfreetFaction.DoorToLamp, storageValue = 1 }, - { storage = Storage.DjinnWar.EfreetFaction.DoorToMaridTerritory, storageValue = 1 }, - { storage = Storage.DjinnWar.MaridFaction.DoorToLamp, storageValue = 1 }, - { storage = Storage.DjinnWar.MaridFaction.DoorToEfreetTerritory, storageValue = 1 }, + { storage = Storage.Quest.U7_4.DjinnWar.EfreetFaction.DoorToLamp, storageValue = 1 }, + { storage = Storage.Quest.U7_4.DjinnWar.EfreetFaction.DoorToMaridTerritory, storageValue = 1 }, + { storage = Storage.Quest.U7_4.DjinnWar.MaridFaction.DoorToLamp, storageValue = 1 }, + { storage = Storage.Quest.U7_4.DjinnWar.MaridFaction.DoorToEfreetTerritory, storageValue = 1 }, { storage = Storage.Quest.U12_20.GraveDanger.QuestLine, storageValue = 14 }, { storage = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelosDoor, storageValue = 1 }, @@ -364,10 +364,10 @@ local questTable = { { storage = Storage.ToOutfoxAFoxQuest, storageValue = 2 }, -- Hunter Outfit quests - { storage = Storage.OutfitQuest.HunterMusicSheet01, storageValue = 1 }, - { storage = Storage.OutfitQuest.HunterMusicSheet02, storageValue = 1 }, - { storage = Storage.OutfitQuest.HunterMusicSheet03, storageValue = 1 }, - { storage = Storage.OutfitQuest.HunterMusicSheet04, storageValue = 1 }, + { storage = Storage.Quest.U7_8.HunterOutfits.HunterMusicSheet01, storageValue = 1 }, + { storage = Storage.Quest.U7_8.HunterOutfits.HunterMusicSheet02, storageValue = 1 }, + { storage = Storage.Quest.U7_8.HunterOutfits.HunterMusicSheet03, storageValue = 1 }, + { storage = Storage.Quest.U7_8.HunterOutfits.HunterMusicSheet04, storageValue = 1 }, -- Norseman { storage = Storage.OutfitQuest.NorsemanAddon, storageValue = 1 }, diff --git a/data-otservbr-global/scripts/movements/quests/inquisition/entrance.lua b/data-otservbr-global/scripts/movements/quests/inquisition/entrance.lua index 0ddcff88508..19f6914eb96 100644 --- a/data-otservbr-global/scripts/movements/quests/inquisition/entrance.lua +++ b/data-otservbr-global/scripts/movements/quests/inquisition/entrance.lua @@ -1,11 +1,11 @@ local throneStorages = { - Storage.PitsOfInferno.ThroneInfernatil, - Storage.PitsOfInferno.ThroneTafariel, - Storage.PitsOfInferno.ThroneVerminor, - Storage.PitsOfInferno.ThroneApocalypse, - Storage.PitsOfInferno.ThroneBazir, - Storage.PitsOfInferno.ThroneAshfalor, - Storage.PitsOfInferno.ThronePumin, + Storage.Quest.U7_9.ThePitsOfInferno.ThroneInfernatil, + Storage.Quest.U7_9.ThePitsOfInferno.ThroneTafariel, + Storage.Quest.U7_9.ThePitsOfInferno.ThroneVerminor, + Storage.Quest.U7_9.ThePitsOfInferno.ThroneApocalypse, + Storage.Quest.U7_9.ThePitsOfInferno.ThroneBazir, + Storage.Quest.U7_9.ThePitsOfInferno.ThroneAshfalor, + Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin, } local function hasTouchedOneThrone(player) diff --git a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/check_throne.lua b/data-otservbr-global/scripts/movements/quests/pits_of_inferno/check_throne.lua deleted file mode 100644 index 9507d731742..00000000000 --- a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/check_throne.lua +++ /dev/null @@ -1,37 +0,0 @@ -local setting = { - [2090] = { storage = Storage.PitsOfInferno.ThroneInfernatil, value = 1 }, - [2091] = { storage = Storage.PitsOfInferno.ThroneTafariel, value = 1 }, - [2092] = { storage = Storage.PitsOfInferno.ThroneVerminor, value = 1 }, - [2093] = { storage = Storage.PitsOfInferno.ThroneApocalypse, value = 1 }, - [2094] = { storage = Storage.PitsOfInferno.ThroneBazir, value = 1 }, - [2095] = { storage = Storage.PitsOfInferno.ThroneAshfalor, value = 1 }, - [2096] = { storage = Storage.PitsOfInferno.ThronePumin, value = 1 }, -} - -local checkThrone = MoveEvent() - -function checkThrone.onStepIn(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then - return true - end - - local thrones = setting[item.uid] - if not thrones then - return true - end - - if player:getStorageValue(thrones.storage) ~= thrones.value then - player:teleportTo(fromPosition, true) - player:say("You've not absorbed energy from this throne.", TALKTYPE_MONSTER_SAY) - end - return true -end - -checkThrone:type("stepin") - -for index, value in pairs(setting) do - checkThrone:uid(index) -end - -checkThrone:register() diff --git a/data-otservbr-global/scripts/movements/quests/the_ape_city/mission9_the_deepest_catacomb_teleport.lua b/data-otservbr-global/scripts/movements/quests/the_ape_city/mission9_the_deepest_catacomb_teleport.lua deleted file mode 100644 index 3209936e25a..00000000000 --- a/data-otservbr-global/scripts/movements/quests/the_ape_city/mission9_the_deepest_catacomb_teleport.lua +++ /dev/null @@ -1,32 +0,0 @@ -local mission9TheDeepestCatacombTeleport = MoveEvent() - -function mission9TheDeepestCatacombTeleport.onStepIn(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then - return true - end - if item.uid == 9257 and player:getStorageValue(Storage.TheApeCity.Questline) >= 17 then - player:teleportTo(Position(32749, 32536, 10)) - position:sendMagicEffect(CONST_ME_TELEPORT) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - elseif item.uid == 9258 then - if Tile(Position(32792, 32527, 10)):getItemById(4996) and Tile(Position(32823, 32525, 10)):getItemById(4996) and Tile(Position(32876, 32584, 10)):getItemById(4996) and Tile(Position(32744, 32586, 10)):getItemById(4996) then - player:teleportTo(Position(32885, 32632, 11)) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - return true - else - player:teleportTo(fromPosition) - position:sendMagicEffect(CONST_ME_TELEPORT) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There are 4 large amphoras that must be broken in order to open the teleporter.") - return true - end - else - player:teleportTo(fromPosition, true) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You don't have access to this area.") - end -end - -mission9TheDeepestCatacombTeleport:type("stepin") -mission9TheDeepestCatacombTeleport:uid(9257, 9258) -mission9TheDeepestCatacombTeleport:register() diff --git a/data-otservbr-global/scripts/movements/teleport/tomb_coal_basin.lua b/data-otservbr-global/scripts/movements/teleport/tomb_coal_basin.lua deleted file mode 100644 index fb3957efa8d..00000000000 --- a/data-otservbr-global/scripts/movements/teleport/tomb_coal_basin.lua +++ /dev/null @@ -1,35 +0,0 @@ -local config = { - [9033] = { flamePosition = Position(33097, 32816, 13), toPosition = Position(33093, 32824, 13) }, - [9034] = { flamePosition = Position(33293, 32742, 13), toPosition = Position(33299, 32742, 13) }, - [9035] = { flamePosition = Position(33073, 32590, 13), toPosition = Position(33080, 32588, 13) }, - [9036] = { flamePosition = Position(33240, 32856, 13), toPosition = Position(33246, 32850, 13) }, - [9037] = { flamePosition = Position(33276, 32553, 14), toPosition = Position(33271, 32553, 14) }, - [9038] = { flamePosition = Position(33234, 32692, 13), toPosition = Position(33234, 32687, 13) }, - [9039] = { flamePosition = Position(33135, 32683, 12), toPosition = Position(33130, 32683, 12) }, - [9040] = { flamePosition = Position(33162, 32831, 10), toPosition = Position(33158, 32832, 10) }, -} - -local tombCoalBasin = MoveEvent() - -function tombCoalBasin.onAddItem(moveitem, tileitem, position) - local targetCoalBasin = config[tileitem.uid] - if not targetCoalBasin then - return true - end - - if moveitem.itemid ~= 3042 then - position:sendMagicEffect(CONST_ME_POFF) - return true - end - - moveitem:remove() - position:sendMagicEffect(CONST_ME_HITBYFIRE) - - Tile(targetCoalBasin.flamePosition):relocateTo(targetCoalBasin.toPosition) - targetCoalBasin.toPosition:sendMagicEffect(CONST_ME_TELEPORT) - return true -end - -tombCoalBasin:type("additem") -tombCoalBasin:id(2114) -tombCoalBasin:register() diff --git a/data-otservbr-global/scripts/movements/teleport/turtles.lua b/data-otservbr-global/scripts/movements/teleport/turtles.lua index fbc2ff2a6a7..40ffe42f0dd 100644 --- a/data-otservbr-global/scripts/movements/teleport/turtles.lua +++ b/data-otservbr-global/scripts/movements/teleport/turtles.lua @@ -17,7 +17,7 @@ function turtles.onStepIn(creature, item, position, fromPosition) return true end - if player:getStorageValue(Storage.TheShatteredIsles.AccessToLagunaIsland) ~= 1 and item.uid == 3206 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.AccessToLagunaIsland) ~= 1 and item.uid == 3206 then local accessPosition = Position(32340, 32540, 7) player:teleportTo(accessPosition) position:sendMagicEffect(CONST_ME_TELEPORT) diff --git a/data-otservbr-global/scripts/actions/quests/dreamer_challenge/documents.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_documents.lua similarity index 79% rename from data-otservbr-global/scripts/actions/quests/dreamer_challenge/documents.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_documents.lua index 7f2145c52ad..f7d7a4339cd 100644 --- a/data-otservbr-global/scripts/actions/quests/dreamer_challenge/documents.lua +++ b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_documents.lua @@ -23,14 +23,14 @@ function dreamerDocuments.onUse(player, item, fromPosition, target, toPosition, end local choice = useItem[1] - if player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) > player:getStorageValue(Storage.OutfitQuest.NightmareOutfit) then + if player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) > player:getStorageValue(Storage.Quest.U7_9.NightmareOutfits.Outfits) then choice = useItem[2] end if choice.addon then if player:hasOutfit(player:getSex() == PLAYERSEX_FEMALE and choice.female or choice.male) then if not player:hasOutfit(player:getSex() == PLAYERSEX_FEMALE and choice.female or choice.male, choice.addon) then - if player:getStorageValue(Storage.OutfitQuest.NightmareOutfit) >= useItem.storageValue or player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) >= useItem.storageValue then + if player:getStorageValue(Storage.Quest.U7_9.NightmareOutfits.Outfits) >= useItem.storageValue or player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) >= useItem.storageValue then player:addOutfitAddon(choice.female, choice.addon) player:addOutfitAddon(choice.male, choice.addon) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received the " .. choice.msg .. " addon!") @@ -47,7 +47,7 @@ function dreamerDocuments.onUse(player, item, fromPosition, target, toPosition, end else if not player:hasOutfit(player:getSex() == PLAYERSEX_FEMALE and choice.female or choice.male) then - if player:getStorageValue(Storage.OutfitQuest.NightmareOutfit) >= 1 or player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) >= 1 then + if player:getStorageValue(Storage.Quest.U7_9.NightmareOutfits.Outfits) >= 1 or player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) >= 1 then player:addOutfit(choice.female) player:addOutfit(choice.male) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received the " .. choice.msg .. " outfit!") diff --git a/data-otservbr-global/scripts/actions/quests/dreamer_challenge/lever_brotherhood.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_lever_brotherhood.lua similarity index 65% rename from data-otservbr-global/scripts/actions/quests/dreamer_challenge/lever_brotherhood.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_lever_brotherhood.lua index e0f62069758..647373fac09 100644 --- a/data-otservbr-global/scripts/actions/quests/dreamer_challenge/lever_brotherhood.lua +++ b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_lever_brotherhood.lua @@ -18,15 +18,15 @@ function dreamerBrotherhoodLever.onUse(player, item, fromPosition, target, toPos end if item.uid == config[1].uid then local diamondItem = Tile(config[1].position):getItemById(3028) - if player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) >= config[1].storageOutfit then - if diamondItem and player:getStorageValue(Storage.DreamersChallenge.LeverBrotherhood1) < 1 then + if player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) >= config[1].storageOutfit then + if diamondItem and player:getStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverBrotherhood1) < 1 then diamondItem:remove(1) - player:setStorageValue(Storage.DreamersChallenge.LeverBrotherhood1, 1) + player:setStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverBrotherhood1, 1) config[1].position:sendMagicEffect(CONST_ME_TELEPORT) Game.createItem(config[1].itemId, 1, config[1].position) item:transform(2773) addEvent(revertLever, 4 * 1000, toPosition) - elseif not diamondItem and player:getStorageValue(Storage.DreamersChallenge.LeverBrotherhood1) < 1 then + elseif not diamondItem and player:getStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverBrotherhood1) < 1 then player:sendCancelMessage("You need to offer a small diamond.") else player:sendCancelMessage("You have already used this lever!") @@ -35,16 +35,16 @@ function dreamerBrotherhoodLever.onUse(player, item, fromPosition, target, toPos player:sendCancelMessage("You still don't have permission.") end elseif item.uid == config[2].uid then - if player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) >= config[2].storageOutfit then + if player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) >= config[2].storageOutfit then local diamondItem = Tile(config[2].position):getItemById(3028) - if diamondItem and player:getStorageValue(Storage.DreamersChallenge.LeverBrotherhood2) < 1 then + if diamondItem and player:getStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverBrotherhood2) < 1 then diamondItem:remove(1) - player:setStorageValue(Storage.DreamersChallenge.LeverBrotherhood2, 1) + player:setStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverBrotherhood2, 1) config[2].position:sendMagicEffect(CONST_ME_TELEPORT) Game.createItem(config[2].itemId, 1, config[2].position) item:transform(2773) addEvent(revertLever, 4 * 1000, toPosition) - elseif not diamondItem and player:getStorageValue(Storage.DreamersChallenge.LeverBrotherhood2) < 1 then + elseif not diamondItem and player:getStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverBrotherhood2) < 1 then player:sendCancelMessage("You need to offer a small diamond.") else player:sendCancelMessage("You have already used this lever!") @@ -53,16 +53,16 @@ function dreamerBrotherhoodLever.onUse(player, item, fromPosition, target, toPos player:sendCancelMessage("You still don't have permission.") end elseif item.uid == config[3].uid then - if player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) >= config[3].storageOutfit then + if player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) >= config[3].storageOutfit then local diamondItem = Tile(config[3].position):getItemById(3028) - if diamondItem and player:getStorageValue(Storage.DreamersChallenge.LeverBrotherhood3) < 1 then + if diamondItem and player:getStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverBrotherhood3) < 1 then diamondItem:remove(1) - player:setStorageValue(Storage.DreamersChallenge.LeverBrotherhood3, 1) + player:setStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverBrotherhood3, 1) config[3].position:sendMagicEffect(CONST_ME_TELEPORT) Game.createItem(config[3].itemId, 1, config[3].position) item:transform(2773) addEvent(revertLever, 4 * 1000, toPosition) - elseif not diamondItem and player:getStorageValue(Storage.DreamersChallenge.LeverBrotherhood3) < 1 then + elseif not diamondItem and player:getStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverBrotherhood3) < 1 then player:sendCancelMessage("You need to offer a small diamond.") else player:sendCancelMessage("You have already used this lever!") diff --git a/data-otservbr-global/scripts/actions/quests/dreamer_challenge/lever_nightmare.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_lever_nightmare.lua similarity index 65% rename from data-otservbr-global/scripts/actions/quests/dreamer_challenge/lever_nightmare.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_lever_nightmare.lua index 9ed136c1fdb..bf820c21dad 100644 --- a/data-otservbr-global/scripts/actions/quests/dreamer_challenge/lever_nightmare.lua +++ b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_lever_nightmare.lua @@ -18,15 +18,15 @@ function dreamerNightmareLever.onUse(player, item, fromPosition, target, toPosit end if item.uid == config[1].uid then local diamondItem = Tile(config[1].position):getItemById(3028) - if player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) >= config[1].storageOutfit then - if diamondItem and player:getStorageValue(Storage.DreamersChallenge.LeverNightmare1) < 1 then + if player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) >= config[1].storageOutfit then + if diamondItem and player:getStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverNightmare1) < 1 then diamondItem:remove(1) - player:setStorageValue(Storage.DreamersChallenge.LeverNightmare1, 1) + player:setStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverNightmare1, 1) config[1].position:sendMagicEffect(CONST_ME_TELEPORT) Game.createItem(config[1].itemId, 1, config[1].position) item:transform(2773) addEvent(revertLever, 4 * 1000, toPosition) - elseif not diamondItem and player:getStorageValue(Storage.DreamersChallenge.LeverNightmare1) < 1 then + elseif not diamondItem and player:getStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverNightmare1) < 1 then player:sendCancelMessage("You need to offer a small diamond.") else player:sendCancelMessage("You have already used this lever!") @@ -35,16 +35,16 @@ function dreamerNightmareLever.onUse(player, item, fromPosition, target, toPosit player:sendCancelMessage("You still don't have permission.") end elseif item.uid == config[2].uid then - if player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) >= config[2].storageOutfit then + if player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) >= config[2].storageOutfit then local diamondItem = Tile(config[2].position):getItemById(3028) - if diamondItem and player:getStorageValue(Storage.DreamersChallenge.LeverNightmare1) < 1 then + if diamondItem and player:getStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverNightmare1) < 1 then diamondItem:remove(1) - player:setStorageValue(Storage.DreamersChallenge.LeverNightmare1, 1) + player:setStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverNightmare1, 1) config[2].position:sendMagicEffect(CONST_ME_TELEPORT) Game.createItem(config[2].itemId, 1, config[2].position) item:transform(2773) addEvent(revertLever, 4 * 1000, toPosition) - elseif not diamondItem and player:getStorageValue(Storage.DreamersChallenge.LeverNightmare1) < 1 then + elseif not diamondItem and player:getStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverNightmare1) < 1 then player:sendCancelMessage("You need to offer a small diamond.") else player:sendCancelMessage("You have already used this lever!") @@ -53,16 +53,16 @@ function dreamerNightmareLever.onUse(player, item, fromPosition, target, toPosit player:sendCancelMessage("You still don't have permission.") end elseif item.uid == config[3].uid then - if player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) >= config[3].storageOutfit then + if player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) >= config[3].storageOutfit then local diamondItem = Tile(config[3].position):getItemById(3028) - if diamondItem and player:getStorageValue(Storage.DreamersChallenge.LeverNightmare3) < 1 then + if diamondItem and player:getStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverNightmare3) < 1 then diamondItem:remove(1) - player:setStorageValue(Storage.DreamersChallenge.LeverNightmare3, 1) + player:setStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverNightmare3, 1) config[3].position:sendMagicEffect(CONST_ME_TELEPORT) Game.createItem(config[3].itemId, 1, config[3].position) item:transform(2773) addEvent(revertLever, 4 * 1000, toPosition) - elseif not diamondItem and player:getStorageValue(Storage.DreamersChallenge.LeverNightmare3) < 1 then + elseif not diamondItem and player:getStorageValue(Storage.Quest.U7_9.DreamersChallenge.LeverNightmare3) < 1 then player:sendCancelMessage("You need to offer a small diamond.") else player:sendCancelMessage("You have already used this lever!") diff --git a/data-otservbr-global/scripts/actions/quests/dreamer_challenge/stone_teleport.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_stone_teleport.lua similarity index 95% rename from data-otservbr-global/scripts/actions/quests/dreamer_challenge/stone_teleport.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_stone_teleport.lua index 6b082e8cf70..2bb5a5a4597 100644 --- a/data-otservbr-global/scripts/actions/quests/dreamer_challenge/stone_teleport.lua +++ b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_stone_teleport.lua @@ -4,7 +4,7 @@ local config = { { position = Position(32878, 32270, 14), itemId = 2886 }, { position = Position(32881, 32267, 14), itemId = 3052 }, { position = Position(32881, 32273, 14), itemId = 6299 }, - { position = Position(32884, 32270, 14), itemId = 21465 }, -- or itemID = 2118 for PVP servers + { position = Position(32884, 32270, 14), itemId = 2118 }, -- or itemID = 2118 for PVP servers }, wells = { { position = Position(32874, 32263, 14), wellId = 2094, transformId = 2098 }, diff --git a/data-otservbr-global/scripts/actions/quests/dreamer_challenge/tic_tac.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_tic_tac.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/dreamer_challenge/tic_tac.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_tic_tac.lua diff --git a/data-otservbr-global/scripts/actions/quests/dreamer_challenge/tic_tac_teleport.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_tic_tac_teleport.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/dreamer_challenge/tic_tac_teleport.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_tic_tac_teleport.lua diff --git a/data-otservbr-global/scripts/actions/quests/dreamer_challenge/walls.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_walls.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/dreamer_challenge/walls.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/actions_walls.lua diff --git a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/carrot.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_carrot.lua similarity index 63% rename from data-otservbr-global/scripts/movements/quests/dreamer_challenge/carrot.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_carrot.lua index 40e02285eb1..2b860e00ed1 100644 --- a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/carrot.lua +++ b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_carrot.lua @@ -8,8 +8,14 @@ function carrot.onStepIn(creature, item, position, fromPosition) if item.uid == 2241 then if player:getItemCount(3595) > 0 then - player:teleportTo(Position(32861, 32235, 9)) - player:removeItem(3595, 1) + if player:isPremium() then + player:teleportTo(Position(32861, 32235, 9)) + player:removeItem(3595, 1) + else + player:say("It seems that Hugo doesn't like free accounts", TALKTYPE_MONSTER_SAY) + player:teleportTo(fromPosition) + doAreaCombatHealth(player, COMBAT_FIREDAMAGE, fromPosition, 0, -10, -20, CONST_ME_HITBYFIRE) + end else player:teleportTo(fromPosition) doAreaCombatHealth(player, COMBAT_FIREDAMAGE, fromPosition, 0, -10, -20, CONST_ME_HITBYFIRE) diff --git a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/clock_tile.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_clock_tile.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/dreamer_challenge/clock_tile.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_clock_tile.lua diff --git a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/court_teleport.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_court_teleport.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/dreamer_challenge/court_teleport.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_court_teleport.lua diff --git a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/death_ring.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_death_ring.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/dreamer_challenge/death_ring.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_death_ring.lua diff --git a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/death_ring_teleport.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_death_ring_teleport.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/dreamer_challenge/death_ring_teleport.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_death_ring_teleport.lua diff --git a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/fire_bug_teleport.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_fire_bug_teleport.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/dreamer_challenge/fire_bug_teleport.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_fire_bug_teleport.lua diff --git a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/riddle.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_riddle.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/dreamer_challenge/riddle.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_riddle.lua diff --git a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/riddle_teleport.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_riddle_teleport.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/dreamer_challenge/riddle_teleport.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_riddle_teleport.lua diff --git a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/sacrifice_teleport.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_sacrifice_teleport.lua similarity index 80% rename from data-otservbr-global/scripts/movements/quests/dreamer_challenge/sacrifice_teleport.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_sacrifice_teleport.lua index 80587c21e02..c30c0d4dc1e 100644 --- a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/sacrifice_teleport.lua +++ b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_sacrifice_teleport.lua @@ -5,7 +5,7 @@ function sacrificeTeleport.onStepIn(creature, item, position, fromPosition) if not player then return true end - if item.actionid == 50149 and player:getStorageValue(Storage.OutfitQuest.NightmareOutfit) >= 2 then + if item.actionid == 50149 and player:getStorageValue(Storage.Quest.U7_9.NightmareOutfits.Outfits) >= 2 then player:teleportTo(Position(32835, 32225, 14)) --Sacrifice 2 doSendMagicEffect(Position(32835, 32225, 14), CONST_ME_POFF) --Sacrifice 2 elseif item.actionid == 50149 then @@ -13,7 +13,7 @@ function sacrificeTeleport.onStepIn(creature, item, position, fromPosition) player:getPosition():sendMagicEffect(CONST_ME_POFF) else player:teleportTo(Position(32844, 32228, 14)) --Sacrifice - if item.actionid == 50150 and player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) >= 2 then + if item.actionid == 50150 and player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) >= 2 then player:teleportTo(Position(32784, 32226, 14)) --Sacrifice 4 doSendMagicEffect(Position(32835, 32225, 14), CONST_ME_POFF) --Sacrifice 2 else diff --git a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/stone_teleport.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_stone_teleport.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/dreamer_challenge/stone_teleport.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_stone_teleport.lua diff --git a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/teleport.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_teleport.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/dreamer_challenge/teleport.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_teleport.lua diff --git a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/tic_teleport.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_tic_teleport.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/dreamer_challenge/tic_teleport.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_tic_teleport.lua diff --git a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/tower.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_tower.lua similarity index 84% rename from data-otservbr-global/scripts/movements/quests/dreamer_challenge/tower.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_tower.lua index db955f2e356..1ade2e63256 100644 --- a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/tower.lua +++ b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_tower.lua @@ -23,7 +23,7 @@ function tower.onStepIn(creature, item, position, fromPosition) return true end - if (player:getStorageValue(Storage.OutfitQuest.NightmareOutfit) >= targetTeleport.storageValue or player:getStorageValue(Storage.OutfitQuest.BrotherhoodOutfit) >= targetTeleport.storageValue) and player:removeItem(5021, 1) then + if (player:getStorageValue(Storage.Quest.U7_9.NightmareOutfits.Outfits) >= targetTeleport.storageValue or player:getStorageValue(Storage.Quest.U7_9.BrotherhoodOutfits.Outfits) >= targetTeleport.storageValue) and player:removeItem(5021, 1) then player:teleportTo(targetTeleport.toPosition) else player:teleportTo(fromPosition) diff --git a/data-otservbr-global/scripts/movements/quests/dreamer_challenge/wall_teleport.lua b/data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_wall_teleport.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/dreamer_challenge/wall_teleport.lua rename to data-otservbr-global/scripts/quests/dreamers_challenge_quest/movement_wall_teleport.lua diff --git a/data-otservbr-global/scripts/quests/druid_outfits_quest/actions_ceirons_waterskin.lua b/data-otservbr-global/scripts/quests/druid_outfits_quest/actions_ceirons_waterskin.lua new file mode 100644 index 00000000000..0457b92f7b2 --- /dev/null +++ b/data-otservbr-global/scripts/quests/druid_outfits_quest/actions_ceirons_waterskin.lua @@ -0,0 +1,15 @@ +local actions_ceirons_waterskin = Action() + +function actions_ceirons_waterskin.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if target.itemid == 5662 and target.uid == 40096 and player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.CeironsWaterskin) ~= 1 then + toPosition:sendMagicEffect(CONST_ME_LOSEENERGY) + item:transform(5939) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.CeironsWaterskin, 1) + player:say("You have successfully collected a special water sample from the hydra cave.", TALKTYPE_MONSTER_SAY) + end + + return true +end + +actions_ceirons_waterskin:id(5938) +actions_ceirons_waterskin:register() diff --git a/data-otservbr-global/scripts/actions/quests/hunter_outfit/all_hymn_piano_teleport.lua b/data-otservbr-global/scripts/quests/hunter_outfits_quest/action_all_hymn_piano_teleport.lua similarity index 59% rename from data-otservbr-global/scripts/actions/quests/hunter_outfit/all_hymn_piano_teleport.lua rename to data-otservbr-global/scripts/quests/hunter_outfits_quest/action_all_hymn_piano_teleport.lua index 794d66bfdcc..d54b9b1ae6b 100644 --- a/data-otservbr-global/scripts/actions/quests/hunter_outfit/all_hymn_piano_teleport.lua +++ b/data-otservbr-global/scripts/quests/hunter_outfits_quest/action_all_hymn_piano_teleport.lua @@ -1,8 +1,8 @@ +local hunterAll = Action() local portpos = Position({ x = 32402, y = 32794, z = 9 }) -local hunterAll = Action() function hunterAll.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.OutfitQuest.HunterMusicSheet01) == 1 and player:getStorageValue(Storage.OutfitQuest.HunterMusicSheet02) == 1 and player:getStorageValue(Storage.OutfitQuest.HunterMusicSheet03) == 1 and player:getStorageValue(Storage.OutfitQuest.HunterMusicSheet04) == 1 then + if player:getStorageValue(Storage.Quest.U7_8.HunterOutfits.HunterMusicSheet01) == 1 and player:getStorageValue(Storage.Quest.U7_8.HunterOutfits.HunterMusicSheet02) == 1 and player:getStorageValue(Storage.Quest.U7_8.HunterOutfits.HunterMusicSheet03) == 1 and player:getStorageValue(Storage.Quest.U7_8.HunterOutfits.HunterMusicSheet04) == 1 then player:teleportTo(portpos, false) portpos:sendMagicEffect(CONST_ME_TELEPORT) toPosition:sendMagicEffect(CONST_ME_SOUND_YELLOW) diff --git a/data-otservbr-global/scripts/actions/quests/hunter_outfit/music_sheet.lua b/data-otservbr-global/scripts/quests/hunter_outfits_quest/action_music_sheet.lua similarity index 65% rename from data-otservbr-global/scripts/actions/quests/hunter_outfit/music_sheet.lua rename to data-otservbr-global/scripts/quests/hunter_outfits_quest/action_music_sheet.lua index 8248020970d..fb85d1fbbe6 100644 --- a/data-otservbr-global/scripts/actions/quests/hunter_outfit/music_sheet.lua +++ b/data-otservbr-global/scripts/quests/hunter_outfits_quest/action_music_sheet.lua @@ -1,8 +1,8 @@ local config = { - [6087] = { storage = Storage.OutfitQuest.HunterMusicSheet01, text = "first" }, - [6088] = { storage = Storage.OutfitQuest.HunterMusicSheet02, text = "second" }, - [6089] = { storage = Storage.OutfitQuest.HunterMusicSheet03, text = "third" }, - [6090] = { storage = Storage.OutfitQuest.HunterMusicSheet04, text = "fourth" }, + [6087] = { storage = Storage.Quest.U7_8.HunterOutfits.HunterMusicSheet01, text = "first" }, + [6088] = { storage = Storage.Quest.U7_8.HunterOutfits.HunterMusicSheet02, text = "second" }, + [6089] = { storage = Storage.Quest.U7_8.HunterOutfits.HunterMusicSheet03, text = "third" }, + [6090] = { storage = Storage.Quest.U7_8.HunterOutfits.HunterMusicSheet04, text = "fourth" }, } local hunterMusic = Action() diff --git a/data-otservbr-global/scripts/quests/the_ancient_tombs/actions_active_teleport_switches.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/actions_active_teleport_switches.lua new file mode 100644 index 00000000000..095663a0fb2 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/actions_active_teleport_switches.lua @@ -0,0 +1,62 @@ +local config = { + [12121] = { + storage = Storage.Quest.U7_4.TheAncientTombs.ThalasSwitchesGlobalStorage, + specificCheck = function(player) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.ThalasTreasure) <= 0 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.ThalasTreasure, 1) + end + end, + }, + [12122] = { + storage = Storage.Quest.U7_4.TheAncientTombs.DiprathSwitchesGlobalStorage, + specificCheck = function(player) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.DiphtrahsTreasure) <= 1 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.DiphtrahsTreasure, 2) + end + end, + }, + [12123] = { + storage = Storage.Quest.U7_4.TheAncientTombs.AshmunrahSwitchesGlobalStorage, + specificCheck = function(player) end, + }, +} + +local function resetScript(position, storage, configEntry, playerId) + local item = Tile(position):getItemById(2773) + if item then + item:transform(2772) + end + + local player = Player(playerId) + if player then + if configEntry.specificCheck then + configEntry.specificCheck(player) + end + + player:setStorageValue(storage, player:getStorageValue(storage) - 1) + end +end + +local theAncientActiveTeleport = Action() +function theAncientActiveTeleport.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local configEntry = config[item.actionid] + if not configEntry then + return true + end + + local storage = configEntry.storage or configEntry + if item.itemid ~= 2772 then + return false + end + + player:setStorageValue(storage, player:getStorageValue(storage) + 1) + item:transform(2773) + addEvent(resetScript, 20 * 60 * 1000, toPosition, storage, configEntry, player:getId()) + return true +end + +for actionId, info in pairs(config) do + theAncientActiveTeleport:aid(actionId) +end + +theAncientActiveTeleport:register() diff --git a/data-otservbr-global/scripts/quests/the_ancient_tombs/actions_dipthrah_signs_doors.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/actions_dipthrah_signs_doors.lua new file mode 100644 index 00000000000..a2d626b8a9f --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/actions_dipthrah_signs_doors.lua @@ -0,0 +1,50 @@ +local actions_dipthrah_signs_doors = Action() + +local questSteps = { + [40032] = Storage.Quest.U7_4.TheAncientTombs.Diprath_sign1, + [40033] = Storage.Quest.U7_4.TheAncientTombs.Diprath_sign2, + [40034] = Storage.Quest.U7_4.TheAncientTombs.Diprath_sign3, + [40035] = Storage.Quest.U7_4.TheAncientTombs.Diprath_sign4, + [40036] = Storage.Quest.U7_4.TheAncientTombs.Diprath_sign5, + [40037] = Storage.Quest.U7_4.TheAncientTombs.Diprath_sign6, + [40038] = Storage.Quest.U7_4.TheAncientTombs.Diprath_sign7, + [40039] = Storage.Quest.U7_4.TheAncientTombs.Diprath_sign8, +} + +local function hasCompletedPreviousStep(player, currentStep) + if currentStep == Storage.Quest.U7_4.TheAncientTombs.Diprath_sign1 then + return true + end + + local previousStep = currentStep - 1 + return player:getStorageValue(previousStep) == 1 +end + +function actions_dipthrah_signs_doors.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local aid = item.actionid + local currentStorageKey = questSteps[aid] + + if not currentStorageKey then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Invalid action ID.") + return false + end + + if not hasCompletedPreviousStep(player, currentStorageKey) then + return true + end + + if player:getStorageValue(currentStorageKey) == 1 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have already completed this step.") + return true + end + + player:setStorageValue(currentStorageKey, 1) + + return true +end + +for aid in pairs(questSteps) do + actions_dipthrah_signs_doors:aid(aid) +end + +actions_dipthrah_signs_doors:register() diff --git a/data-otservbr-global/scripts/actions/quests/the_ancient_tombs/oasis_lever_door.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/actions_oasis_lever_door.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/the_ancient_tombs/oasis_lever_door.lua rename to data-otservbr-global/scripts/quests/the_ancient_tombs/actions_oasis_lever_door.lua diff --git a/data-otservbr-global/scripts/quests/the_ancient_tombs/actions_ruins_instruments.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/actions_ruins_instruments.lua new file mode 100644 index 00000000000..247498616f2 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/actions_ruins_instruments.lua @@ -0,0 +1,45 @@ +local config = { + [3255] = 1, + [3261] = 2, + [3258] = 3, + [3260] = 4, + [3257] = 5, +} + +local storage = Storage.Quest.U7_4.TheAncientTombs.VashresamunInstruments + +local theAncientRuinsInstru = Action() +function theAncientRuinsInstru.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local targetValue = config[item.itemid] + if not targetValue then + player:setStorageValue(storage, 0) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You played it wrong, now you must begin with the first again!") + doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -20, -20, CONST_ME_GROUNDSHAKER) + return true + end + + local currentValue = player:getStorageValue(storage) + if currentValue == -1 then + currentValue = 0 + end + + if currentValue + 1 == targetValue then + player:setStorageValue(storage, targetValue) + fromPosition:sendMagicEffect(CONST_ME_SOUND_BLUE) + if targetValue == 5 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.VashresamunsDoor, 1) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You played them in the correct order and got access through the door!") + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.VashresamunsTreasure) <= 1 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.VashresamunsTreasure, 2) + end + end + else + player:setStorageValue(storage, 0) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You played it wrong, now you must begin with the first again!") + doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -20, -20, CONST_ME_GROUNDSHAKER) + end + return true +end + +theAncientRuinsInstru:aid(12105) +theAncientRuinsInstru:register() diff --git a/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_all_teleports_tombs_coal_basin.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_all_teleports_tombs_coal_basin.lua new file mode 100644 index 00000000000..b5cb34a1176 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_all_teleports_tombs_coal_basin.lua @@ -0,0 +1,63 @@ +local config = { + [9033] = { flamePosition = Position(33097, 32816, 13), toPosition = Position(33093, 32824, 13) }, + [9034] = { flamePosition = Position(33293, 32742, 13), toPosition = Position(33299, 32742, 13) }, + [9035] = { + flamePosition = Position(33073, 32590, 13), + toPosition = Position(33080, 32588, 13), + specificCheck = function(player) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.DiphtrahsTreasure) <= 0 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.DiphtrahsTreasure, 1) + end + end, + }, + [9036] = { + flamePosition = Position(33240, 32856, 13), + toPosition = Position(33246, 32850, 13), + specificCheck = function(player) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.MahrdisTreasure) <= 0 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.MahrdisTreasure, 1) + end + end, + }, + [9037] = { flamePosition = Position(33276, 32553, 14), toPosition = Position(33271, 32553, 14) }, + [9038] = { flamePosition = Position(33234, 32692, 13), toPosition = Position(33234, 32687, 13) }, + [9039] = { flamePosition = Position(33135, 32683, 12), toPosition = Position(33130, 32683, 12) }, + [9040] = { flamePosition = Position(33162, 32831, 10), toPosition = Position(33158, 32832, 10) }, +} + +local tombCoalBasin = MoveEvent() + +function tombCoalBasin.onAddItem(moveitem, tileitem, position) + local targetCoalBasin = config[tileitem.uid] + if not targetCoalBasin then + return true + end + + if moveitem.itemid ~= 3042 then + position:sendMagicEffect(CONST_ME_POFF) + return true + end + + moveitem:remove() + position:sendMagicEffect(CONST_ME_HITBYFIRE) + + local player = Tile(targetCoalBasin.flamePosition):getTopCreature() + if player and player:isPlayer() then + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.DefaultStart) ~= 1 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.DefaultStart, 1) + end + + if targetCoalBasin.specificCheck then + targetCoalBasin.specificCheck(player) + end + + player:teleportTo(targetCoalBasin.toPosition) + targetCoalBasin.toPosition:sendMagicEffect(CONST_ME_TELEPORT) + end + + return true +end + +tombCoalBasin:type("additem") +tombCoalBasin:id(2114) +tombCoalBasin:register() diff --git a/data-otservbr-global/scripts/movements/quests/the_ancient_tombs/craft_helmet.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_craft_helmet.lua similarity index 91% rename from data-otservbr-global/scripts/movements/quests/the_ancient_tombs/craft_helmet.lua rename to data-otservbr-global/scripts/quests/the_ancient_tombs/movements_craft_helmet.lua index a5553ae49dc..407bbf04999 100644 --- a/data-otservbr-global/scripts/movements/quests/the_ancient_tombs/craft_helmet.lua +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_craft_helmet.lua @@ -1,4 +1,4 @@ -local helmetIds = { 3222, 3223, 3224, 3225, 3226, 3227, 3228 } +local helmetIds = { 3236, 3241, 3235, 3239, 3240, 3238, 3237 } local craftHelmet = MoveEvent() @@ -41,5 +41,5 @@ function craftHelmet.onAddItem(moveitem, tileitem, position) end craftHelmet:type("additem") -craftHelmet:aid(60626) +craftHelmet:aid(40040) craftHelmet:register() diff --git a/data-otservbr-global/scripts/movements/quests/the_ancient_tombs/enter_ashmunrah_teleport_switche_done.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_ashmunrah_teleport_switche_done.lua similarity index 84% rename from data-otservbr-global/scripts/movements/quests/the_ancient_tombs/enter_ashmunrah_teleport_switche_done.lua rename to data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_ashmunrah_teleport_switche_done.lua index fb8d66329c0..de0a74f932c 100644 --- a/data-otservbr-global/scripts/movements/quests/the_ancient_tombs/enter_ashmunrah_teleport_switche_done.lua +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_ashmunrah_teleport_switche_done.lua @@ -6,7 +6,7 @@ function enterAshmunrahTeleport.onStepIn(creature, item, position, fromPosition) return true end - if Game.getStorageValue(GlobalStorage.TheAncientTombs.AshmunrahSwitchesGlobalStorage) < 6 then + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.AshmunrahSwitchesGlobalStorage) < 5 then player:teleportTo(fromPosition, true) fromPosition:sendMagicEffect(CONST_ME_TELEPORT) return true diff --git a/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_diprath_room.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_diprath_room.lua new file mode 100644 index 00000000000..1bd9d464725 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_diprath_room.lua @@ -0,0 +1,27 @@ +local movements_enter_diprath_room = MoveEvent() + +function movements_enter_diprath_room.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local destination = Position(33092, 32590, 15) + + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.DiprathSwitchesGlobalStorage) < 7 and player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.Diprath_sign8) ~= 1 then + player:teleportTo(fromPosition, true) + fromPosition:sendMagicEffect(CONST_ME_TELEPORT) + else + player:teleportTo(destination) + destination:sendMagicEffect(CONST_ME_TELEPORT) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.DiphtrahsTreasure) <= 2 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.DiphtrahsTreasure, 3) + end + end + + return true +end + +movements_enter_diprath_room:type("stepin") +movements_enter_diprath_room:uid(40083) +movements_enter_diprath_room:register() diff --git a/data-otservbr-global/scripts/movements/quests/the_ancient_tombs/enter_diprath_teleport_switche_done.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_diprath_teleport_switche_done.lua similarity index 70% rename from data-otservbr-global/scripts/movements/quests/the_ancient_tombs/enter_diprath_teleport_switche_done.lua rename to data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_diprath_teleport_switche_done.lua index eb418d07917..2fe6fcae5ef 100644 --- a/data-otservbr-global/scripts/movements/quests/the_ancient_tombs/enter_diprath_teleport_switche_done.lua +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_diprath_teleport_switche_done.lua @@ -6,15 +6,15 @@ function enterDiprathTeleport.onStepIn(creature, item, position, fromPosition) return true end - if Game.getStorageValue(GlobalStorage.TheAncientTombs.DiprathSwitchesGlobalStorage) < 7 then + local destination = Position(33083, 32568, 14) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.DiprathSwitchesGlobalStorage) < 7 then player:teleportTo(fromPosition, true) fromPosition:sendMagicEffect(CONST_ME_TELEPORT) - return true + else + player:teleportTo(destination) + destination:sendMagicEffect(CONST_ME_TELEPORT) end - local destination = Position(33083, 32568, 14) - player:teleportTo(destination) - destination:sendMagicEffect(CONST_ME_TELEPORT) return true end diff --git a/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_mahrdis_room.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_mahrdis_room.lua new file mode 100644 index 00000000000..6182941e34c --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_mahrdis_room.lua @@ -0,0 +1,26 @@ +local movements_enter_mahrdis_room = MoveEvent() + +function movements_enter_mahrdis_room.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local destination = Position(33190, 32947, 15) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.MahrdisTreasure) ~= 1 then + player:teleportTo(fromPosition, true) + fromPosition:sendMagicEffect(CONST_ME_TELEPORT) + else + player:teleportTo(destination) + destination:sendMagicEffect(CONST_ME_TELEPORT) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.MahrdisTreasure) <= 1 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.MahrdisTreasure, 2) + end + end + + return true +end + +movements_enter_mahrdis_room:type("stepin") +movements_enter_mahrdis_room:uid(40084) +movements_enter_mahrdis_room:register() diff --git a/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_morguthis_room.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_morguthis_room.lua new file mode 100644 index 00000000000..041e0dec006 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_morguthis_room.lua @@ -0,0 +1,26 @@ +local movements_enter_morguthis_room = MoveEvent() + +function movements_enter_morguthis_room.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local destination = Position(33259, 32707, 13) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.DefaultStart) ~= 1 then + player:teleportTo(fromPosition, true) + fromPosition:sendMagicEffect(CONST_ME_TELEPORT) + else + player:teleportTo(destination) + destination:sendMagicEffect(CONST_ME_TELEPORT) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.MorguthisTreasure) <= 0 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.MorguthisTreasure, 1) + end + end + + return true +end + +movements_enter_morguthis_room:type("stepin") +movements_enter_morguthis_room:uid(40085) +movements_enter_morguthis_room:register() diff --git a/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_omruc_room.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_omruc_room.lua new file mode 100644 index 00000000000..c1dcfedf9bf --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_omruc_room.lua @@ -0,0 +1,26 @@ +local movements_enter_omruc_room = MoveEvent() + +function movements_enter_omruc_room.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local destination = Position(33207, 33002, 14) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.DefaultStart) ~= 1 then + player:teleportTo(fromPosition, true) + fromPosition:sendMagicEffect(CONST_ME_TELEPORT) + else + player:teleportTo(destination) + destination:sendMagicEffect(CONST_ME_TELEPORT) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.OmrucsTreasure) <= 1 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.OmrucsTreasure, 2) + end + end + + return true +end + +movements_enter_omruc_room:type("stepin") +movements_enter_omruc_room:uid(40087) +movements_enter_omruc_room:register() diff --git a/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_omruc_specific.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_omruc_specific.lua new file mode 100644 index 00000000000..3c6b5d1378c --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_omruc_specific.lua @@ -0,0 +1,26 @@ +local movements_enter_omruc_room = MoveEvent() + +function movements_enter_omruc_room.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local destination = Position(33205, 32955, 14) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.DefaultStart) ~= 1 then + player:teleportTo(fromPosition, true) + fromPosition:sendMagicEffect(CONST_ME_TELEPORT) + else + player:teleportTo(destination) + destination:sendMagicEffect(CONST_ME_TELEPORT) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.OmrucsTreasure) <= 0 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.OmrucsTreasure, 1) + end + end + + return true +end + +movements_enter_omruc_room:type("stepin") +movements_enter_omruc_room:uid(40086) +movements_enter_omruc_room:register() diff --git a/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_rahemos_levers.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_rahemos_levers.lua new file mode 100644 index 00000000000..3fa01ce2332 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_rahemos_levers.lua @@ -0,0 +1,26 @@ +local movements_enter_omruc_room = MoveEvent() + +function movements_enter_omruc_room.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local destination = Position(33124, 32760, 14) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.DefaultStart) ~= 1 then + player:teleportTo(fromPosition, true) + fromPosition:sendMagicEffect(CONST_ME_TELEPORT) + else + player:teleportTo(destination) + destination:sendMagicEffect(CONST_ME_TELEPORT) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.RahemosTreasure) <= 0 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.RahemosTreasure, 1) + end + end + + return true +end + +movements_enter_omruc_room:type("stepin") +movements_enter_omruc_room:uid(40088) +movements_enter_omruc_room:register() diff --git a/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_rahemos_room.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_rahemos_room.lua new file mode 100644 index 00000000000..82e7a64d1d1 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_rahemos_room.lua @@ -0,0 +1,26 @@ +local movements_enter_omruc_room = MoveEvent() + +function movements_enter_omruc_room.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local destination = Position(33086, 32781, 14) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.DefaultStart) ~= 1 then + player:teleportTo(fromPosition, true) + fromPosition:sendMagicEffect(CONST_ME_TELEPORT) + else + player:teleportTo(destination) + destination:sendMagicEffect(CONST_ME_TELEPORT) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.RahemosTreasure) <= 1 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.RahemosTreasure, 2) + end + end + + return true +end + +movements_enter_omruc_room:type("stepin") +movements_enter_omruc_room:uid(40089) +movements_enter_omruc_room:register() diff --git a/data-otservbr-global/scripts/movements/quests/the_ancient_tombs/enter_thalas_poison_tile.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_thalas_poison_tile.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/the_ancient_tombs/enter_thalas_poison_tile.lua rename to data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_thalas_poison_tile.lua diff --git a/data-otservbr-global/scripts/movements/quests/the_ancient_tombs/enter_thalas_teleport_switches_done.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_thalas_teleport_switches_done.lua similarity index 84% rename from data-otservbr-global/scripts/movements/quests/the_ancient_tombs/enter_thalas_teleport_switches_done.lua rename to data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_thalas_teleport_switches_done.lua index b3592d39b9c..8a0daba82c6 100644 --- a/data-otservbr-global/scripts/movements/quests/the_ancient_tombs/enter_thalas_teleport_switches_done.lua +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_thalas_teleport_switches_done.lua @@ -6,7 +6,7 @@ function enterThalasTeleport.onStepIn(creature, item, position, fromPosition) return true end - if Game.getStorageValue(GlobalStorage.TheAncientTombs.ThalasSwitchesGlobalStorage) < 8 then + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.ThalasSwitchesGlobalStorage) < 8 then player:teleportTo(fromPosition, true) fromPosition:sendMagicEffect(CONST_ME_TELEPORT) return true diff --git a/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_vashresamun_room.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_vashresamun_room.lua new file mode 100644 index 00000000000..bfdcd763d7a --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_vashresamun_room.lua @@ -0,0 +1,26 @@ +local movements_enter_omruc_room = MoveEvent() + +function movements_enter_omruc_room.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local destination = Position(33129, 32657, 15) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.DefaultStart) ~= 1 then + player:teleportTo(fromPosition, true) + fromPosition:sendMagicEffect(CONST_ME_TELEPORT) + else + player:teleportTo(destination) + destination:sendMagicEffect(CONST_ME_TELEPORT) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.VashresamunsTreasure) <= 2 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.VashresamunsTreasure, 3) + end + end + + return true +end + +movements_enter_omruc_room:type("stepin") +movements_enter_omruc_room:uid(40091) +movements_enter_omruc_room:register() diff --git a/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_vashresamun_specific.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_vashresamun_specific.lua new file mode 100644 index 00000000000..fafb96b861c --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_enter_vashresamun_specific.lua @@ -0,0 +1,26 @@ +local movements_enter_omruc_room = MoveEvent() + +function movements_enter_omruc_room.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local destination = Position(33194, 32665, 15) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.DefaultStart) ~= 1 then + player:teleportTo(fromPosition, true) + fromPosition:sendMagicEffect(CONST_ME_TELEPORT) + else + player:teleportTo(destination) + destination:sendMagicEffect(CONST_ME_TELEPORT) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.VashresamunsTreasure) <= 0 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.VashresamunsTreasure, 1) + end + end + + return true +end + +movements_enter_omruc_room:type("stepin") +movements_enter_omruc_room:uid(40090) +movements_enter_omruc_room:register() diff --git a/data-otservbr-global/scripts/movements/quests/the_ancient_tombs/peninsula_tomb_maze.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_peninsula_tomb_maze.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/the_ancient_tombs/peninsula_tomb_maze.lua rename to data-otservbr-global/scripts/quests/the_ancient_tombs/movements_peninsula_tomb_maze.lua diff --git a/data-otservbr-global/scripts/movements/quests/the_ancient_tombs/step_morguthis_blue_flames.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_step_morguthis_blue_flames.lua similarity index 54% rename from data-otservbr-global/scripts/movements/quests/the_ancient_tombs/step_morguthis_blue_flames.lua rename to data-otservbr-global/scripts/quests/the_ancient_tombs/movements_step_morguthis_blue_flames.lua index 411628f7e12..4227aa36c51 100644 --- a/data-otservbr-global/scripts/movements/quests/the_ancient_tombs/step_morguthis_blue_flames.lua +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_step_morguthis_blue_flames.lua @@ -1,11 +1,11 @@ local setting = { - [50139] = Storage.TheAncientTombs.MorguthisBlueFlameStorage1, - [50140] = Storage.TheAncientTombs.MorguthisBlueFlameStorage2, - [50141] = Storage.TheAncientTombs.MorguthisBlueFlameStorage3, - [50142] = Storage.TheAncientTombs.MorguthisBlueFlameStorage4, - [50143] = Storage.TheAncientTombs.MorguthisBlueFlameStorage5, - [50144] = Storage.TheAncientTombs.MorguthisBlueFlameStorage6, - [50145] = Storage.TheAncientTombs.MorguthisBlueFlameStorage7, + [50139] = Storage.Quest.U7_4.TheAncientTombs.MorguthisBlueFlameStorage1, + [50140] = Storage.Quest.U7_4.TheAncientTombs.MorguthisBlueFlameStorage2, + [50141] = Storage.Quest.U7_4.TheAncientTombs.MorguthisBlueFlameStorage3, + [50142] = Storage.Quest.U7_4.TheAncientTombs.MorguthisBlueFlameStorage4, + [50143] = Storage.Quest.U7_4.TheAncientTombs.MorguthisBlueFlameStorage5, + [50144] = Storage.Quest.U7_4.TheAncientTombs.MorguthisBlueFlameStorage6, + [50145] = Storage.Quest.U7_4.TheAncientTombs.MorguthisBlueFlameStorage7, } local stepMorguthisBlueFlames = MoveEvent() @@ -25,7 +25,7 @@ function stepMorguthisBlueFlames.onStepIn(creature, item, position, fromPosition player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) else local missingStorage = false - for i = Storage.TheAncientTombs.MorguthisBlueFlameStorage1, Storage.TheAncientTombs.MorguthisBlueFlameStorage7 do + for i = Storage.Quest.U7_4.TheAncientTombs.MorguthisBlueFlameStorage1, Storage.Quest.U7_4.TheAncientTombs.MorguthisBlueFlameStorage7 do if player:getStorageValue(i) ~= 1 then missingStorage = true break @@ -40,6 +40,9 @@ function stepMorguthisBlueFlames.onStepIn(creature, item, position, fromPosition player:teleportTo(Position(33163, 32694, 14)) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + if player:getStorageValue(Storage.Quest.U7_4.TheAncientTombs.MorguthisTreasure) <= 1 then + player:setStorageValue(Storage.Quest.U7_4.TheAncientTombs.MorguthisTreasure, 2) + end end return true end diff --git a/data-otservbr-global/scripts/movements/quests/the_ancient_tombs/tomb_teleport.lua b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_tomb_teleport.lua similarity index 97% rename from data-otservbr-global/scripts/movements/quests/the_ancient_tombs/tomb_teleport.lua rename to data-otservbr-global/scripts/quests/the_ancient_tombs/movements_tomb_teleport.lua index 0015cab9ec7..142d5c6932f 100644 --- a/data-otservbr-global/scripts/movements/quests/the_ancient_tombs/tomb_teleport.lua +++ b/data-otservbr-global/scripts/quests/the_ancient_tombs/movements_tomb_teleport.lua @@ -29,7 +29,7 @@ local config = { destination = Position(33041, 32774, 14), exitDestination = Position(33133, 32642, 8), }, - -- from Dipthrah Boss + -- from Dipthrah Boss [3955] = { removeId = 3241, destination = Position(33349, 32827, 14), @@ -73,5 +73,4 @@ for index, value in pairs(config) do tombTeleport:uid(index) end -tombTeleport:aid(12108) tombTeleport:register() diff --git a/data-otservbr-global/scripts/quests/the_ape_city/actions_mission09_snake_destroyer.lua b/data-otservbr-global/scripts/quests/the_ape_city/actions_mission09_snake_destroyer.lua new file mode 100644 index 00000000000..86e1c008a6d --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ape_city/actions_mission09_snake_destroyer.lua @@ -0,0 +1,67 @@ +local theApeMiss9 = Action() + +local amphoraStorages = { + [40092] = Storage.Quest.U7_6.TheApeCity.TheLargeAmphoras1, + [40093] = Storage.Quest.U7_6.TheApeCity.TheLargeAmphoras2, + [40094] = Storage.Quest.U7_6.TheApeCity.TheLargeAmphoras3, + [40095] = Storage.Quest.U7_6.TheApeCity.TheLargeAmphoras4, +} + +local cooldownStorage = Storage.Quest.U7_6.TheApeCity.TheLargeAmphorasCooldown +local cooldownTime = 5 * 60 + +function theApeMiss9.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local uid = target:getUniqueId() + local itemId = target.itemid + + if amphoraStorages[uid] and itemId == 4995 then + local storage = amphoraStorages[uid] + + local storageValue = player:getStorageValue(storage) + if storageValue > 0 then + return false + end + + player:setStorageValue(storage, 1) + + target:transform(4996) + + local allUsed = true + for _, s in pairs(amphoraStorages) do + if player:getStorageValue(s) < 1 then + allUsed = false + break + end + end + + if allUsed then + player:setStorageValue(cooldownStorage, os.time()) + end + + toPosition:sendMagicEffect(CONST_ME_POFF) + return true + end + + local specificPosition = Position(32858, 32526, 11) + if itemId == 4850 and toPosition == specificPosition then + if player:getStorageValue(Storage.Quest.U7_6.TheApeCity.Questline) ~= 17 then + return false + end + + if player:getStorageValue(Storage.Quest.U7_6.TheApeCity.SnakeDestroyer) == 1 then + return false + end + + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.SnakeDestroyer, 1) + item:remove() + target:transform(4851) + target:decay() + toPosition:sendMagicEffect(CONST_ME_POFF) + return true + end + + return false +end + +theApeMiss9:id(4835) +theApeMiss9:register() diff --git a/data-otservbr-global/scripts/actions/quests/the_ape_city/mission9_catacombs_lever.lua b/data-otservbr-global/scripts/quests/the_ape_city/actions_mission9_catacombs_lever.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/the_ape_city/mission9_catacombs_lever.lua rename to data-otservbr-global/scripts/quests/the_ape_city/actions_mission9_catacombs_lever.lua diff --git a/data-otservbr-global/scripts/movements/quests/the_ape_city/mission4_parchment_decyphering.lua b/data-otservbr-global/scripts/quests/the_ape_city/movements_mission4_parchment_decyphering.lua similarity index 63% rename from data-otservbr-global/scripts/movements/quests/the_ape_city/mission4_parchment_decyphering.lua rename to data-otservbr-global/scripts/quests/the_ape_city/movements_mission4_parchment_decyphering.lua index bd52c6c442c..f401d0d1c07 100644 --- a/data-otservbr-global/scripts/movements/quests/the_ape_city/mission4_parchment_decyphering.lua +++ b/data-otservbr-global/scripts/quests/the_ape_city/movements_mission4_parchment_decyphering.lua @@ -6,8 +6,8 @@ function mission4ParchmentDecyphering.onStepIn(creature, item, position, fromPos return true end - if player:getStorageValue(Storage.TheApeCity.Questline) == 7 and player:getStorageValue(Storage.TheApeCity.ParchmentDecyphering) ~= 1 then - player:setStorageValue(Storage.TheApeCity.ParchmentDecyphering, 1) + if player:getStorageValue(Storage.Quest.U7_6.TheApeCity.Questline) == 6 and player:getStorageValue(Storage.Quest.U7_6.TheApeCity.ParchmentDecyphering) ~= 1 then + player:setStorageValue(Storage.Quest.U7_6.TheApeCity.ParchmentDecyphering, 1) end player:say("!-! -O- I_I (/( --I Morgathla", TALKTYPE_MONSTER_SAY) diff --git a/data-otservbr-global/scripts/quests/the_ape_city/movements_mission9_the_deepest_catacomb_teleport.lua b/data-otservbr-global/scripts/quests/the_ape_city/movements_mission9_the_deepest_catacomb_teleport.lua new file mode 100644 index 00000000000..2237d3f34f9 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_ape_city/movements_mission9_the_deepest_catacomb_teleport.lua @@ -0,0 +1,60 @@ +local mission9TheDeepestCatacombTeleport = MoveEvent() + +local amphoraStorages = { + Storage.Quest.U7_6.TheApeCity.TheLargeAmphoras1, + Storage.Quest.U7_6.TheApeCity.TheLargeAmphoras2, + Storage.Quest.U7_6.TheApeCity.TheLargeAmphoras3, + Storage.Quest.U7_6.TheApeCity.TheLargeAmphoras4, +} + +local cooldownStorage = Storage.Quest.U7_6.TheApeCity.TheLargeAmphorasCooldown +local cooldownTime = 5 * 60 + +function mission9TheDeepestCatacombTeleport.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + if item.uid == 9257 and player:getStorageValue(Storage.Quest.U7_6.TheApeCity.Questline) >= 17 then + player:teleportTo(Position(32749, 32536, 10)) + position:sendMagicEffect(CONST_ME_TELEPORT) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + elseif item.uid == 9258 then + local cooldownStart = player:getStorageValue(cooldownStorage) + if cooldownStart > 0 and (os.time() - cooldownStart) > cooldownTime then + for _, storage in pairs(amphoraStorages) do + player:setStorageValue(storage, 0) + end + player:setStorageValue(cooldownStorage, 0) + end + + local allAmphorasBroken = true + for _, storage in pairs(amphoraStorages) do + local storageValue = player:getStorageValue(storage) + if storageValue < 1 then + allAmphorasBroken = false + break + end + end + + if allAmphorasBroken then + player:teleportTo(Position(32885, 32632, 11)) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true + else + player:teleportTo(fromPosition) + position:sendMagicEffect(CONST_ME_TELEPORT) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to break all 4 large amphoras to use this teleporter.") + return true + end + else + player:teleportTo(fromPosition, true) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You don't have access to this area.") + end +end + +mission9TheDeepestCatacombTeleport:type("stepin") +mission9TheDeepestCatacombTeleport:uid(9257, 9258) +mission9TheDeepestCatacombTeleport:register() diff --git a/data-otservbr-global/scripts/quests/the_djinn_war_quest/action_water_fountain.lua b/data-otservbr-global/scripts/quests/the_djinn_war_quest/action_water_fountain.lua new file mode 100644 index 00000000000..0f8ae9f8ac5 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_djinn_war_quest/action_water_fountain.lua @@ -0,0 +1,15 @@ +local action_water_fountain = Action() + +function action_water_fountain.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:getStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission02) ~= 1 then + return true + end + + Game.createItem(3233, 1, fromPosition) + player:setStorageValue(Storage.Quest.U7_4.DjinnWar.EfreetFaction.Mission02, 2) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a tear of daraman.") + return true +end + +action_water_fountain:aid(5390) +action_water_fountain:register() diff --git a/data-otservbr-global/scripts/quests/the_explorer_society/actions_botanist.lua b/data-otservbr-global/scripts/quests/the_explorer_society/actions_botanist.lua new file mode 100644 index 00000000000..ee1a6125ca5 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_explorer_society/actions_botanist.lua @@ -0,0 +1,31 @@ +local explorerSocietyBotanist = Action() + +function explorerSocietyBotanist.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if target.itemid == 3874 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 18 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 18 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 19) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 19) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + item:transform(4868) + elseif target.itemid == 3885 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 21 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 21 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 22) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 22) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + item:transform(4869) + elseif target.itemid == 3878 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 24 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 24 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 25) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 25) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + item:transform(4870) + elseif target.itemid == 5658 and target.uid == 3152 and player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.GriffinclawFlower) ~= 1 then --Mission-independent function that uses the same item + toPosition:sendMagicEffect(CONST_ME_MAGIC_RED) + item:transform(5937) + target:transform(5687) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.GriffinclawFlower, 1) + player:say("You successfully took a sample of the rare griffinclaw flower.", TALKTYPE_MONSTER_SAY) + end + + return true +end + +explorerSocietyBotanist:id(4867) +explorerSocietyBotanist:register() diff --git a/data-otservbr-global/scripts/quests/the_explorer_society/actions_butterfly.lua b/data-otservbr-global/scripts/quests/the_explorer_society/actions_butterfly.lua new file mode 100644 index 00000000000..a9238f95f61 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_explorer_society/actions_butterfly.lua @@ -0,0 +1,26 @@ +local explorerSocietyButterfly = Action() +function explorerSocietyButterfly.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if target.itemid == 4992 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 9 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 9 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 10) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 10) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + item:transform(4864) + target:remove() + elseif target.itemid == 4993 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 12 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 12 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 13) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 13) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + item:transform(4865) + target:remove() + elseif target.itemid == 4991 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 15 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 15 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 16) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 16) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + item:transform(4866) + target:remove() + end + return true +end + +explorerSocietyButterfly:id(4863) +explorerSocietyButterfly:register() diff --git a/data-otservbr-global/scripts/quests/the_explorer_society/actions_dragon.lua b/data-otservbr-global/scripts/quests/the_explorer_society/actions_dragon.lua new file mode 100644 index 00000000000..90129aeaf39 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_explorer_society/actions_dragon.lua @@ -0,0 +1,13 @@ +local explorerSocietyDragon = Action() +function explorerSocietyDragon.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIslandofDragons) == 57 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 57 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIslandofDragons, 58) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 58) + player:addItem(7314, 1) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + end + return true +end + +explorerSocietyDragon:uid(40042) +explorerSocietyDragon:register() diff --git a/data-otservbr-global/scripts/actions/quests/explorer_society/findings.lua b/data-otservbr-global/scripts/quests/the_explorer_society/actions_findings.lua similarity index 74% rename from data-otservbr-global/scripts/actions/quests/explorer_society/findings.lua rename to data-otservbr-global/scripts/quests/the_explorer_society/actions_findings.lua index 3f81f4cd08d..c9a7cc8f42c 100644 --- a/data-otservbr-global/scripts/actions/quests/explorer_society/findings.lua +++ b/data-otservbr-global/scripts/quests/the_explorer_society/actions_findings.lua @@ -3,49 +3,49 @@ local UniqueTable = { [14029] = { -- Uzgod's Family Brooch rewardItemId = 4834, - storageMission = Storage.ExplorerSociety.JoiningTheExplorers, + storageMission = Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers, storageMissionValue = 3, storageQuestlineValue = 3, }, [14030] = { -- Wrinkled parchment rewardItemId = 173, - storageMission = Storage.ExplorerSociety.TheBonelordSecret, + storageMission = Storage.Quest.U7_6.ExplorerSociety.TheBonelordSecret, storageMissionValue = 31, storageQuestlineValue = 30, }, [14031] = { -- Strange powder rewardItemId = 13974, - storageMission = Storage.ExplorerSociety.TheOrcPowder, + storageMission = Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder, storageMissionValue = 34, storageQuestlineValue = 33, }, [14032] = { -- Elven poetry book rewardItemId = 4844, - storageMission = Storage.ExplorerSociety.TheElvenPoetry, + storageMission = Storage.Quest.U7_6.ExplorerSociety.TheElvenPoetry, storageMissionValue = 37, storageQuestlineValue = 36, }, [14033] = { -- Memory stone rewardItemId = 4841, - storageMission = Storage.ExplorerSociety.TheMemoryStone, + storageMission = Storage.Quest.U7_6.ExplorerSociety.TheMemoryStone, storageMissionValue = 40, storageQuestlineValue = 39, }, [14034] = { -- Spectral dress rewardItemId = 4836, - storageMission = Storage.ExplorerSociety.TheSpectralDress, + storageMission = Storage.Quest.U7_6.ExplorerSociety.TheSpectralDress, storageMissionValue = 49, storageQuestlineValue = 48, }, [14035] = { -- Damage logbook rewardItemId = 21378, - storageMission = Storage.ExplorerSociety.CalassaQuest, + storageMission = Storage.Quest.U7_6.ExplorerSociety.CalassaQuest, storageMissionValue = 2, storageQuestlineValue = 0, }, @@ -53,7 +53,7 @@ local UniqueTable = { [40041] = { -- Funeral urn rewardItemId = 4847, - storageMission = Storage.ExplorerSociety.TheLizardUrn, + storageMission = Storage.Quest.U7_6.ExplorerSociety.TheLizardUrn, storageMissionValue = 28, storageQuestlineValue = 27, }, @@ -75,7 +75,7 @@ function explorerSocietyFindings.onUse(player, item, fromPosition, target, toPos player:setStorageValue(item.uid, 1) player:setStorageValue(uniqueItem.storageMission, uniqueItem.storageMissionValue) if uniqueItem.storageQuestlineValue > 0 then - player:setStorageValue(Storage.ExplorerSociety.QuestLine, uniqueItem.storageQuestlineValue) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, uniqueItem.storageQuestlineValue) end return true end diff --git a/data-otservbr-global/scripts/quests/the_explorer_society/actions_icicle.lua b/data-otservbr-global/scripts/quests/the_explorer_society/actions_icicle.lua new file mode 100644 index 00000000000..7489727a39a --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_explorer_society/actions_icicle.lua @@ -0,0 +1,13 @@ +local explorerSocietyIcicle = Action() +function explorerSocietyIcicle.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if target.itemid == 4994 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery) == 6 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 6 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery, 7) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 7) + player:addItem(4837, 1) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + end + return true +end + +explorerSocietyIcicle:id(4872) +explorerSocietyIcicle:register() diff --git a/data-otservbr-global/scripts/quests/the_explorer_society/actions_resonance.lua b/data-otservbr-global/scripts/quests/the_explorer_society/actions_resonance.lua new file mode 100644 index 00000000000..172c0acbf81 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_explorer_society/actions_resonance.lua @@ -0,0 +1,16 @@ +local explorerSocietyResonance = Action() +function explorerSocietyResonance.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if target.uid == 40043 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceMusic) == 60 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 60 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceMusic, 61) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 61) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + item:transform(7315) + player:say("You recorded the ice music.", TALKTYPE_MONSTER_SAY) + end + end + return true +end + +explorerSocietyResonance:id(7242) +explorerSocietyResonance:register() diff --git a/data-otservbr-global/scripts/quests/the_explorer_society/actions_stone.lua b/data-otservbr-global/scripts/quests/the_explorer_society/actions_stone.lua new file mode 100644 index 00000000000..0852e156e8e --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_explorer_society/actions_stone.lua @@ -0,0 +1,26 @@ +local explorerSocietyStone = Action() +function explorerSocietyStone.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if target.uid == 25018 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 53 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 53 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 1 then -- mission taken from Angus + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 54) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 54) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + elseif target.uid == 25019 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 54 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 54 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 1 then -- mission taken from Angus + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 55) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 55) + player:removeItem(4840, 1) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + elseif target.uid == 25019 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 53 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 53 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 2 then -- mission taken from Mortimer + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 54) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 54) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + elseif target.uid == 25018 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 54 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 54 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 2 then -- mission taken from Mortimer + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 55) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 55) + player:removeItem(4840, 1) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + end + return true +end + +explorerSocietyStone:id(4840) +explorerSocietyStone:register() diff --git a/data-otservbr-global/scripts/actions/quests/explorer_society/tracing_paper.lua b/data-otservbr-global/scripts/quests/the_explorer_society/actions_tracing_paper.lua similarity index 53% rename from data-otservbr-global/scripts/actions/quests/explorer_society/tracing_paper.lua rename to data-otservbr-global/scripts/quests/the_explorer_society/actions_tracing_paper.lua index d2551b51402..b366671bb75 100644 --- a/data-otservbr-global/scripts/actions/quests/explorer_society/tracing_paper.lua +++ b/data-otservbr-global/scripts/quests/the_explorer_society/actions_tracing_paper.lua @@ -1,8 +1,8 @@ local explorerSocietyPaper = Action() function explorerSocietyPaper.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if target.itemid == 2199 and target.uid == 3010 and player:getStorageValue(Storage.ExplorerSociety.TheRuneWritings) == 42 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) == 42 then - player:setStorageValue(Storage.ExplorerSociety.TheRuneWritings, 43) - player:setStorageValue(Storage.ExplorerSociety.QuestLine, 43) + if target.itemid == 2199 and target.uid == 3010 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings) == 42 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 42 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings, 43) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 43) item:transform(4843) toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) end diff --git a/data-otservbr-global/scripts/movements/quests/explorer_society/calassa.lua b/data-otservbr-global/scripts/quests/the_explorer_society/movements_calassa.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/explorer_society/calassa.lua rename to data-otservbr-global/scripts/quests/the_explorer_society/movements_calassa.lua diff --git a/data-otservbr-global/scripts/movements/quests/explorer_society/carving_teleport_liberty_bay.lua b/data-otservbr-global/scripts/quests/the_explorer_society/movements_carving_teleport_liberty_bay.lua similarity index 81% rename from data-otservbr-global/scripts/movements/quests/explorer_society/carving_teleport_liberty_bay.lua rename to data-otservbr-global/scripts/quests/the_explorer_society/movements_carving_teleport_liberty_bay.lua index c709008c9e4..5bc03c29b53 100644 --- a/data-otservbr-global/scripts/movements/quests/explorer_society/carving_teleport_liberty_bay.lua +++ b/data-otservbr-global/scripts/quests/the_explorer_society/movements_carving_teleport_liberty_bay.lua @@ -16,7 +16,7 @@ function carvingTeleportLibertyBay.onStepIn(creature, item, position, fromPositi return end - if player:getStorageValue(Storage.ExplorerSociety.TheIceMusic) >= 62 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) >= 62 and player:removeItem(5021, 1) then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceMusic) >= 62 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) >= 62 and player:removeItem(5021, 1) then player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:teleportTo(carvingTP.position) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) diff --git a/data-otservbr-global/scripts/movements/quests/explorer_society/carvingteleport_port_hope.lua b/data-otservbr-global/scripts/quests/the_explorer_society/movements_carvingteleport_port_hope.lua similarity index 80% rename from data-otservbr-global/scripts/movements/quests/explorer_society/carvingteleport_port_hope.lua rename to data-otservbr-global/scripts/quests/the_explorer_society/movements_carvingteleport_port_hope.lua index 572a3a86738..b91de8e9fd3 100644 --- a/data-otservbr-global/scripts/movements/quests/explorer_society/carvingteleport_port_hope.lua +++ b/data-otservbr-global/scripts/quests/the_explorer_society/movements_carvingteleport_port_hope.lua @@ -16,7 +16,7 @@ function carvingTeleportPortHope.onStepIn(creature, item, position, fromPosition return end - if player:getStorageValue(Storage.ExplorerSociety.TheAstralPortals) >= 56 and player:getStorageValue(Storage.ExplorerSociety.QuestLine) >= 56 and player:removeItem(5021, 1) then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheAstralPortals) >= 56 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) >= 56 and player:removeItem(5021, 1) then player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:teleportTo(carvingTP.position) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) diff --git a/data-otservbr-global/scripts/actions/quests/pits_of_inferno/bazir_maze_lever.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_bazir_maze_lever.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/pits_of_inferno/bazir_maze_lever.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_bazir_maze_lever.lua diff --git a/data-otservbr-global/scripts/actions/quests/pits_of_inferno/bazir_mirror.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_bazir_mirror.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/pits_of_inferno/bazir_mirror.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_bazir_mirror.lua diff --git a/data-otservbr-global/scripts/actions/quests/pits_of_inferno/bazir_wrong_levers.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_bazir_wrong_levers.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/pits_of_inferno/bazir_wrong_levers.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_bazir_wrong_levers.lua diff --git a/data-otservbr-global/scripts/actions/quests/pits_of_inferno/fire_throne_lever.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_fire_throne_lever.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/pits_of_inferno/fire_throne_lever.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_fire_throne_lever.lua diff --git a/data-otservbr-global/scripts/actions/quests/pits_of_inferno/fountain.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_fountain.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/pits_of_inferno/fountain.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_fountain.lua diff --git a/data-otservbr-global/scripts/actions/quests/pits_of_inferno/ladder_levers.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_ladder_levers.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/pits_of_inferno/ladder_levers.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_ladder_levers.lua diff --git a/data-otservbr-global/scripts/actions/quests/pits_of_inferno/levers.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_levers.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/pits_of_inferno/levers.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_levers.lua diff --git a/data-otservbr-global/scripts/actions/quests/pits_of_inferno/maze_stone.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_maze_stone.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/pits_of_inferno/maze_stone.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_maze_stone.lua diff --git a/data-otservbr-global/scripts/actions/quests/pits_of_inferno/oil.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_oil.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/pits_of_inferno/oil.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_oil.lua diff --git a/data-otservbr-global/scripts/actions/quests/pits_of_inferno/stone_lever.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_stone_lever.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/pits_of_inferno/stone_lever.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_stone_lever.lua diff --git a/data-otservbr-global/scripts/actions/quests/pits_of_inferno/trap_lever.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_trap_lever.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/pits_of_inferno/trap_lever.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_trap_lever.lua diff --git a/data-otservbr-global/scripts/actions/quests/pits_of_inferno/walls.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_walls.lua similarity index 100% rename from data-otservbr-global/scripts/actions/quests/pits_of_inferno/walls.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/actions_walls.lua diff --git a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/bazir_tile.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_bazir_tile.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/pits_of_inferno/bazir_tile.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_bazir_tile.lua diff --git a/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_check_throne.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_check_throne.lua new file mode 100644 index 00000000000..38e3b1f658e --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_check_throne.lua @@ -0,0 +1,37 @@ +local setting = { + [2090] = { storage = Storage.Quest.U7_9.ThePitsOfInferno.ThroneInfernatil, value = 1 }, + [2091] = { storage = Storage.Quest.U7_9.ThePitsOfInferno.ThroneTafariel, value = 1 }, + [2092] = { storage = Storage.Quest.U7_9.ThePitsOfInferno.ThroneVerminor, value = 1 }, + [2093] = { storage = Storage.Quest.U7_9.ThePitsOfInferno.ThroneApocalypse, value = 1 }, + [2094] = { storage = Storage.Quest.U7_9.ThePitsOfInferno.ThroneBazir, value = 1 }, + [2095] = { storage = Storage.Quest.U7_9.ThePitsOfInferno.ThroneAshfalor, value = 1 }, + [2096] = { storage = Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin, value = 10 }, +} + +local checkThrone = MoveEvent() + +function checkThrone.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local thrones = setting[item.uid] + if not thrones then + return true + end + + if player:getStorageValue(thrones.storage) ~= thrones.value then + player:teleportTo(fromPosition, true) + player:say("You've not absorbed energy from this throne.", TALKTYPE_MONSTER_SAY) + end + return true +end + +checkThrone:type("stepin") + +for index, value in pairs(setting) do + checkThrone:uid(index) +end + +checkThrone:register() diff --git a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/drawbridge.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_drawbridge.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/pits_of_inferno/drawbridge.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_drawbridge.lua diff --git a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/fire_tile.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_fire_tile.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/pits_of_inferno/fire_tile.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_fire_tile.lua diff --git a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/holy_tible_tile.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_holy_tible_tile.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/pits_of_inferno/holy_tible_tile.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_holy_tible_tile.lua diff --git a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/ladder.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_ladder.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/pits_of_inferno/ladder.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_ladder.lua diff --git a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/pumin_teleport.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_pumin_teleport.lua similarity index 87% rename from data-otservbr-global/scripts/movements/quests/pits_of_inferno/pumin_teleport.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_pumin_teleport.lua index efd45f2b0d4..cc98cce60b3 100644 --- a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/pumin_teleport.lua +++ b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_pumin_teleport.lua @@ -6,7 +6,7 @@ function puminTeleport.onStepIn(creature, item, position, fromPosition) return true end - if player:getStorageValue(Storage.PitsOfInferno.ThronePumin) < 50 then + if player:getStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin) >= 9 then player:teleportTo(Position(32786, 32308, 15)) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) else diff --git a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/second_trap.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_second_trap.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/pits_of_inferno/second_trap.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_second_trap.lua diff --git a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/shortcuts.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_shortcuts.lua similarity index 78% rename from data-otservbr-global/scripts/movements/quests/pits_of_inferno/shortcuts.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_shortcuts.lua index 8db4334a7f4..11bb2e086ff 100644 --- a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/shortcuts.lua +++ b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_shortcuts.lua @@ -1,6 +1,6 @@ local setting = { - [8816] = Storage.PitsOfInferno.ShortcutHubDoor, - [8817] = Storage.PitsOfInferno.ShortcutLeverDoor, + [8816] = Storage.Quest.U7_9.ThePitsOfInferno.ShortcutHubDoor, + [8817] = Storage.Quest.U7_9.ThePitsOfInferno.ShortcutLeverDoor, } local shortcuts = MoveEvent() diff --git a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/stone.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_stone.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/pits_of_inferno/stone.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_stone.lua diff --git a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/throne.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_throne.lua similarity index 52% rename from data-otservbr-global/scripts/movements/quests/pits_of_inferno/throne.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_throne.lua index 92e1c656673..598ab72a64f 100644 --- a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/throne.lua +++ b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_throne.lua @@ -1,42 +1,42 @@ local setting = { [2080] = { - storage = Storage.PitsOfInferno.ThroneInfernatil, + storage = Storage.Quest.U7_9.ThePitsOfInferno.ThroneInfernatil, text = "You have touched Infernatil's throne and absorbed some of his spirit.", effect = CONST_ME_FIREAREA, toPosition = Position(32909, 32211, 15), }, [2081] = { - storage = Storage.PitsOfInferno.ThroneTafariel, + storage = Storage.Quest.U7_9.ThePitsOfInferno.ThroneTafariel, text = "You have touched Tafariel's throne and absorbed some of his spirit.", effect = CONST_ME_MORTAREA, toPosition = Position(32761, 32243, 15), }, [2082] = { - storage = Storage.PitsOfInferno.ThroneVerminor, + storage = Storage.Quest.U7_9.ThePitsOfInferno.ThroneVerminor, text = "You have touched Verminor's throne and absorbed some of his spirit.", effect = CONST_ME_POISONAREA, toPosition = Position(32840, 32327, 15), }, [2083] = { - storage = Storage.PitsOfInferno.ThroneApocalypse, + storage = Storage.Quest.U7_9.ThePitsOfInferno.ThroneApocalypse, text = "You have touched Apocalypse's throne and absorbed some of his spirit.", effect = CONST_ME_EXPLOSIONAREA, toPosition = Position(32875, 32267, 15), }, [2084] = { - storage = Storage.PitsOfInferno.ThroneBazir, + storage = Storage.Quest.U7_9.ThePitsOfInferno.ThroneBazir, text = "You have touched Bazir's throne and absorbed some of his spirit.", effect = CONST_ME_MAGIC_GREEN, toPosition = Position(32745, 32385, 15), }, [2085] = { - storage = Storage.PitsOfInferno.ThroneAshfalor, + storage = Storage.Quest.U7_9.ThePitsOfInferno.ThroneAshfalor, text = "You have touched Ashfalor's throne and absorbed some of his spirit.", effect = CONST_ME_FIREAREA, toPosition = Position(32839, 32310, 15), }, [2086] = { - storage = Storage.PitsOfInferno.ThronePumin, + storage = Storage.Quest.U7_9.ThePitsOfInferno.ThronePumin, text = "You have touched Pumin's throne and absorbed some of his spirit.", effect = CONST_ME_MORTAREA, toPosition = Position(32785, 32279, 15), @@ -56,15 +56,30 @@ function throne.onStepIn(creature, item, position, fromPosition) return true end - if player:getStorageValue(throne.storage) ~= 1 then - player:setStorageValue(throne.storage, 1) - player:setStorageValue(Storage.PitsOfInferno.ShortcutHubDoor, 1) - player:getPosition():sendMagicEffect(throne.effect) - player:say(throne.text, TALKTYPE_MONSTER_SAY) + -- Check specific condition for UID 2086 + if item.uid == 2086 then + if player:getStorageValue(throne.storage) == 9 then + player:setStorageValue(throne.storage, 10) + player:setStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ShortcutHubDoor, 1) + player:getPosition():sendMagicEffect(throne.effect) + player:say(throne.text, TALKTYPE_MONSTER_SAY) + else + player:teleportTo(throne.toPosition) + player:getPosition():sendMagicEffect(CONST_ME_MORTAREA) + player:say("Begone!", TALKTYPE_MONSTER_SAY) + end else - player:teleportTo(throne.toPosition) - player:getPosition():sendMagicEffect(CONST_ME_MORTAREA) - player:say("Begone!", TALKTYPE_MONSTER_SAY) + -- Default behavior for other UIDs + if player:getStorageValue(throne.storage) ~= 1 then + player:setStorageValue(throne.storage, 1) + player:setStorageValue(Storage.Quest.U7_9.ThePitsOfInferno.ShortcutHubDoor, 1) + player:getPosition():sendMagicEffect(throne.effect) + player:say(throne.text, TALKTYPE_MONSTER_SAY) + else + player:teleportTo(throne.toPosition) + player:getPosition():sendMagicEffect(CONST_ME_MORTAREA) + player:say("Begone!", TALKTYPE_MONSTER_SAY) + end end return true end diff --git a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/tile_teleport.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_tile_teleport.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/pits_of_inferno/tile_teleport.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_tile_teleport.lua diff --git a/data-otservbr-global/scripts/movements/quests/pits_of_inferno/trap.lua b/data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_trap.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/pits_of_inferno/trap.lua rename to data-otservbr-global/scripts/quests/the_pits_of_inferno_quest/movements_trap.lua diff --git a/data-otservbr-global/scripts/actions/quests/the_shattered_isles/nargor_maps.lua b/data-otservbr-global/scripts/quests/the_shattered_isles_quest/action_nargor_maps.lua similarity index 72% rename from data-otservbr-global/scripts/actions/quests/the_shattered_isles/nargor_maps.lua rename to data-otservbr-global/scripts/quests/the_shattered_isles_quest/action_nargor_maps.lua index c183522c08d..1b9af9bbc50 100644 --- a/data-otservbr-global/scripts/actions/quests/the_shattered_isles/nargor_maps.lua +++ b/data-otservbr-global/scripts/quests/the_shattered_isles_quest/action_nargor_maps.lua @@ -1,14 +1,14 @@ local UniqueTable = { [40001] = { - storage = Storage.TheShatteredIsles.TavernMap1, + storage = Storage.Quest.U7_8.TheShatteredIsles.TavernMap1, message = "You have sucessfully read plan A.", }, [40002] = { - storage = Storage.TheShatteredIsles.TavernMap2, + storage = Storage.Quest.U7_8.TheShatteredIsles.TavernMap2, message = "You have sucessfully read plan B.", }, [40003] = { - storage = Storage.TheShatteredIsles.TavernMap3, + storage = Storage.Quest.U7_8.TheShatteredIsles.TavernMap3, message = "You have sucessfully read plan C.", }, } @@ -21,7 +21,7 @@ function nargorMaps.onUse(player, item, fromPosition, target, toPosition, isHotk return true end - if player:getStorageValue(Storage.TheShatteredIsles.RaysMission3) ~= 1 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.RaysMission3) ~= 1 then return false end diff --git a/data-otservbr-global/scripts/actions/quests/the_shattered_isles/tortoise_egg_nargor.lua b/data-otservbr-global/scripts/quests/the_shattered_isles_quest/action_tortoise_egg_nargor.lua similarity index 75% rename from data-otservbr-global/scripts/actions/quests/the_shattered_isles/tortoise_egg_nargor.lua rename to data-otservbr-global/scripts/quests/the_shattered_isles_quest/action_tortoise_egg_nargor.lua index b556faeefc7..64930d6e4e4 100644 --- a/data-otservbr-global/scripts/actions/quests/the_shattered_isles/tortoise_egg_nargor.lua +++ b/data-otservbr-global/scripts/quests/the_shattered_isles_quest/action_tortoise_egg_nargor.lua @@ -14,9 +14,9 @@ function tortoiseEggNargor.onUse(player, item, fromPosition, target, toPosition, return true end - if player:getStorageValue(Storage.TheShatteredIsles.TortoiseEggNargorTime) < os.time() then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TortoiseEggNargorTime) < os.time() then player:addItem(setting.name, setting.count, true) - player:setStorageValue(Storage.TheShatteredIsles.TortoiseEggNargorTime, os.time() + 24 * 3600) + player:setStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TortoiseEggNargorTime, os.time() + 24 * 3600) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You found " .. setting.count .. " " .. setting.name .. ".") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The " .. getItemName(setting.itemId) .. " is empty.") diff --git a/data-otservbr-global/scripts/movements/quests/the_sharttered_isles/energy_barrier.lua b/data-otservbr-global/scripts/quests/the_shattered_isles_quest/movement_energy_barrier.lua similarity index 85% rename from data-otservbr-global/scripts/movements/quests/the_sharttered_isles/energy_barrier.lua rename to data-otservbr-global/scripts/quests/the_shattered_isles_quest/movement_energy_barrier.lua index 8ef523b6075..ce06795ec20 100644 --- a/data-otservbr-global/scripts/movements/quests/the_sharttered_isles/energy_barrier.lua +++ b/data-otservbr-global/scripts/quests/the_shattered_isles_quest/movement_energy_barrier.lua @@ -10,7 +10,7 @@ function energyBarrier.onStepIn(creature, item, position, fromPosition) if not player then return true end - if player:getStorageValue(Storage.TheShatteredIsles.TheCounterspell) ~= 4 then + if player:getStorageValue(Storage.Quest.U7_8.TheShatteredIsles.TheCounterspell) ~= 4 then position:sendMagicEffect(CONST_ME_ENERGYHIT) position.x = position.x + 2 player:teleportTo(position) diff --git a/data-otservbr-global/scripts/movements/quests/the_sharttered_isles/teleport.lua b/data-otservbr-global/scripts/quests/the_shattered_isles_quest/movement_teleport.lua similarity index 100% rename from data-otservbr-global/scripts/movements/quests/the_sharttered_isles/teleport.lua rename to data-otservbr-global/scripts/quests/the_shattered_isles_quest/movement_teleport.lua diff --git a/data-otservbr-global/startup/tables/chest.lua b/data-otservbr-global/startup/tables/chest.lua index 47151e2befb..42471d5a906 100644 --- a/data-otservbr-global/startup/tables/chest.lua +++ b/data-otservbr-global/startup/tables/chest.lua @@ -278,6 +278,14 @@ ChestUnique = { reward = { { 2969, 1 } }, storage = Storage.Quest.Key.ID3008, }, + -- The Pits of Inferno - Key 3700 + [5024] = { + isKey = true, + itemId = 2472, + itemPos = { x = 32842, y = 32225, z = 8 }, + reward = { { 2971, 1 } }, + storage = Storage.Quest.Key.ID3700, + }, -- To add a reward inside a bag, you need to add the variable "container = bagId" before "reward" -- Just duplicate the table and configure correctly, the scripts already register the entire table automatically -- Path: data\scripts\actions\system\quest_reward_common.lua @@ -408,7 +416,7 @@ ChestUnique = { reward = { { 3587, 1 } }, questName = "bananapremium", }, - -- Explorer brooch quest (kazordoon) + -- The Explorer Society - Explorer brooch (kazordoon) [6019] = { useKV = true, itemId = 4240, @@ -867,21 +875,21 @@ ChestUnique = { itemId = 2472, itemPos = { x = 32774, y = 32253, z = 8 }, reward = { { 3034, 1 } }, - storage = Storage.Quest.U7_24.GiantSmithhammer.Talon, + storage = Storage.Quest.U7_6.ExplorerSociety.GiantSmithHammer.Talon, }, -- Giant smithhammer [6078] = { itemId = 2472, itemPos = { x = 32776, y = 32253, z = 8 }, reward = { { 12510, 1 } }, - storage = Storage.Quest.U7_24.GiantSmithhammer.Hammer, + storage = Storage.Quest.U7_6.ExplorerSociety.GiantSmithHammer.Hammer, }, -- 100 gold coin [6079] = { itemId = 2472, itemPos = { x = 32778, y = 32253, z = 8 }, reward = { { 3031, 100 } }, - storage = Storage.Quest.U7_24.GiantSmithhammer.GoldCoin, + storage = Storage.Quest.U7_6.ExplorerSociety.GiantSmithHammer.GoldCoin, }, -- Mad Mage room quest [6080] = { @@ -913,7 +921,7 @@ ChestUnique = { container = 2853, weight = 42, reward = { { 3026, 1 }, { 3207, 1 } }, - storage = Storage.Quest.U7_24.SkullOfRatha.Bag1, + storage = Storage.Quest.U7_6.ExplorerSociety.SkullOfRatha.Bag1, }, -- Bag (wolf tooth chain/dwarven ring) [6084] = { @@ -922,7 +930,7 @@ ChestUnique = { container = 2853, weight = 42, reward = { { 3012, 1 }, { 3097, 1 } }, - storage = Storage.Quest.U7_24.SkullOfRatha.Bag2, + storage = Storage.Quest.U7_6.ExplorerSociety.SkullOfRatha.Bag2, }, -- The annihilator quest -- Demon armor @@ -1734,6 +1742,238 @@ ChestUnique = { reward = { { 2984, 1 } }, -- honey questName = "honeyflower", }, + -- The Medusa Quest + [6187] = { + itemId = 1983, + itemPos = { x = 33049, y = 32399, z = 10 }, + container = 2853, + weight = 105, + reward = { { 3436, 1 }, { 3567, 1 }, { 3324, 1 } }, + storage = Storage.Quest.U7_3.TheMedusaQuest, + }, + -- Serpentine Tower Quest + [6188] = { + itemId = 2472, + itemPos = { x = 33150, y = 32862, z = 7 }, + weight = 0.20, + reward = { { 3026, 1 } }, + storage = Storage.Quest.U7_3.SerpentineTower.WhitePearl, + }, + -- Elephant Tusk Quest + [6189] = { + itemId = 2472, + itemPos = { x = 32922, y = 32755, z = 7 }, + weight = 0.20, + reward = { { 3044, 2 } }, + storage = Storage.Quest.U7_5.ElephantTusk, + }, + -- The Explorer Society - Books + [6190] = { + itemId = 2434, + itemPos = { x = 32770, y = 32245, z = 8 }, + weight = 13, + reward = { { 2821, 1 } }, + storage = Storage.Quest.U7_6.ExplorerSociety.Books.Cyclops, + }, + [6191] = { + itemId = 2523, + itemPos = { x = 32786, y = 32254, z = 8 }, + weight = 13.00, + reward = { { 2821, 1 } }, + storage = Storage.Quest.U7_6.ExplorerSociety.Books.Hengis, + }, + -- Witch House Quest + [6192] = { + itemId = 2472, + itemPos = { x = 32867, y = 31909, z = 8 }, + weight = 23.30, + container = 2853, + reward = { { 3027, 2 }, { 3008, 1 }, { 3031, 100 } }, + storage = Storage.QuestChests.WitchHouseQuest, + }, + -- Simon The Beggar's Favorite Staff + [6193] = { + itemId = 2482, + itemPos = { x = 33167, y = 31600, z = 15 }, + weight = 38.00, + reward = { { 6107, 1 } }, + storage = Storage.QuestChests.SimonTheBeggarsFavoriteStaff, + }, + -- Druid Outfit Quest - Wolf Tooth Chain + [6194] = { + itemId = 2480, + itemPos = { x = 32939, y = 31776, z = 9 }, + weight = 3.30, + reward = { { 5940, 1 } }, + storage = Storage.Quest.U7_8.DruidOutfits.WolfToothChain, + }, + -- Hunter Outfits Quest - Elane Crossbow + [6195] = { + itemId = 2472, + itemPos = { x = 32369, y = 32795, z = 10 }, + weight = 40.00, + reward = { { 5947, 1 } }, + storage = Storage.Quest.U7_8.HunterOutfits.ElaneCrossbow, + }, + -- Knight Outfits Quest - Ramsay the Reckless Helmet + [6196] = { + itemId = 2472, + itemPos = { x = 32860, y = 32516, z = 11 }, + weight = 46.00, + reward = { { 5924, 1 } }, + storage = Storage.Quest.U7_8.KnightOutfits.RamsaysHelmetChest, + }, + -- Oriental Outfits Quest - Chest + [6197] = { + itemId = 2472, + itemPos = { x = 32088, y = 32780, z = 11 }, + weight = 4.50, + reward = { { 5945, 1 } }, + storage = Storage.Quest.U7_8.OrientalOutfits.CoralComb, + }, + -- The Shattered Isles Quest - Dragahs Spellbook + [6198] = { + itemId = 4240, + itemPos = { x = 32093, y = 32574, z = 8 }, + weight = 58.00, + reward = { { 6120, 1 } }, + storage = Storage.Quest.U7_8.TheShatteredIsles.DragahsSpellbook, + }, + -- Dreamer's Challenge Quest + [6199] = { + itemId = 4240, + itemPos = { x = 32860, y = 32249, z = 9 }, + weight = 150.00, + container = 2854, + reward = { { 2816, 1 }, { 3285, 1 }, { 3352, 1 }, { 3558, 1 } }, + storage = Storage.Quest.U7_9.DreamersChallenge.BPLongSword, + }, + [6200] = { + itemId = 2472, + itemPos = { x = 32850, y = 32285, z = 14 }, + weight = 13.00, + reward = { { 2821, 1 } }, + storage = Storage.Quest.U7_9.DreamersChallenge.ChestBook, + }, + [6201] = { + itemId = 2469, + itemPos = { x = 32749, y = 32341, z = 14 }, + weight = 15.30, + container = 2853, + reward = { { 6498, 1 }, { 2874, 1 }, { 3602, 1 } }, + storage = Storage.Quest.U7_9.DreamersChallenge.ChestsWine, + }, + [6202] = { + itemId = 2469, + itemPos = { x = 32751, y = 32341, z = 14 }, + weight = 15.30, + container = 2853, + reward = { { 6498, 1 }, { 2874, 1 }, { 3602, 1 } }, + storage = Storage.Quest.U7_9.DreamersChallenge.ChestsWine, + }, + [6203] = { + itemId = 2469, + itemPos = { x = 32753, y = 32341, z = 14 }, + weight = 15.30, + container = 2853, + reward = { { 6498, 1 }, { 2874, 1 }, { 3602, 1 } }, + storage = Storage.Quest.U7_9.DreamersChallenge.ChestsWine, + }, + [6204] = { + itemId = 2469, + itemPos = { x = 32755, y = 32341, z = 14 }, + weight = 15.30, + container = 2853, + reward = { { 6498, 1 }, { 2874, 1 }, { 3602, 1 } }, + storage = Storage.Quest.U7_9.DreamersChallenge.ChestsWine, + }, + [6205] = { + itemId = 2469, + itemPos = { x = 32835, y = 32223, z = 14 }, + weight = 0.30, + reward = { { 3028, 3 } }, + storage = Storage.Quest.U7_9.DreamersChallenge.Chests3SmallDiamond, + }, + -- The Pits of Inferno + [6206] = { + itemId = 2472, + itemPos = { x = 32828, y = 32340, z = 7 }, + weight = 13.00, + reward = { { 2836, 1 } }, + storage = Storage.Quest.U7_9.ThePitsOfInferno.ChestTible, + }, + [6207] = { + itemId = 5972, + itemPos = { x = 32854, y = 32325, z = 11 }, + weight = 13.00, + reward = { { 2816, 1 } }, + storage = Storage.Quest.U7_9.ThePitsOfInferno.CorpseBook, + }, + [6208] = { + itemId = 5972, + itemPos = { x = 32832, y = 32277, z = 10 }, + weight = 40.90, + container = 5926, + reward = { { 6561, 1 }, { 6299, 1 }, { 3052, 1 }, { 5021, 3 }, { 3026, 5 }, { 3035, 11 }, { 5944, 2 }, { 3160, 3 }, { 3155, 2 }, { 3147, 1 }, { 238, 1 } }, + storage = Storage.Quest.U7_9.ThePitsOfInferno.CorpsePirateBP, + }, + [6209] = { + itemId = 2472, + itemPos = { x = 32826, y = 32232, z = 11 }, + weight = 20.70, + container = 3253, + reward = { { 11605, 1 }, { 11607, 1 }, { 11609, 1 }, { 11603, 1 } }, + storage = Storage.Quest.U7_9.ThePitsOfInferno.RewardChestBP, + }, + [6210] = { + itemId = 2472, + itemPos = { x = 32824, y = 32232, z = 11 }, + weight = 10.00, + reward = { { 3035, 100 } }, + storage = Storage.Quest.U7_9.ThePitsOfInferno.RewardChestPlatinumCoins, + }, + [6211] = { + itemId = 2472, + itemPos = { x = 32819, y = 32232, z = 11 }, + weight = 10.00, + reward = { { 3249, 1 } }, + storage = Storage.Quest.U7_9.ThePitsOfInferno.RewardChestFrozenStarlight, + }, + [6212] = { + itemId = 2472, + itemPos = { x = 32814, y = 32232, z = 11 }, + weight = 8.50, + reward = { { 5791, 1 } }, + storage = Storage.Quest.U7_9.ThePitsOfInferno.RewardChestStuffed, + }, + [6213] = { + itemId = 2472, + itemPos = { x = 32812, y = 32232, z = 11 }, + weight = 8.00, + reward = { { 6529, 1 } }, + storage = Storage.Quest.U7_9.ThePitsOfInferno.RewardChestSoftBoots, + }, + [6214] = { + itemId = 2472, + itemPos = { x = 32804, y = 32229, z = 11 }, + weight = 40.00, + reward = { { 3341, 1 } }, + storage = Storage.Quest.U7_9.ThePitsOfInferno.RewardChestStaffAvengerArbalest, + }, + [6215] = { + itemId = 2472, + itemPos = { x = 32806, y = 32229, z = 11 }, + weight = 64.00, + reward = { { 6527, 1 } }, + storage = Storage.Quest.U7_9.ThePitsOfInferno.RewardChestStaffAvengerArbalest, + }, + [6216] = { + itemId = 2472, + itemPos = { x = 32808, y = 32229, z = 11 }, + weight = 95.00, + reward = { { 5803, 1 } }, + storage = Storage.Quest.U7_9.ThePitsOfInferno.RewardChestStaffAvengerArbalest, + }, -- Reward of others scrips files (varied rewards) -- The First dragon Quest -- Treasure chests (data\scripts\actions\quests\first_dragon\treasure_chests.lua) diff --git a/data-otservbr-global/startup/tables/create_item.lua b/data-otservbr-global/startup/tables/create_item.lua index a091701672b..2310d4e5a86 100644 --- a/data-otservbr-global/startup/tables/create_item.lua +++ b/data-otservbr-global/startup/tables/create_item.lua @@ -1,4 +1,15 @@ CreateItemOnMap = { + -- The Explorer Society - dwarven pickaxe in 6 locals + [4845] = { + itemPos = { + { x = 32506, y = 31964, z = 12 }, + { x = 32427, y = 31900, z = 12 }, + { x = 32520, y = 31929, z = 10 }, + { x = 32503, y = 31922, z = 12 }, + { x = 32447, y = 31973, z = 11 }, + { x = 32425, y = 31948, z = 12 }, + }, + }, [11402] = { itemPos = { { x = 33239, y = 31224, z = 10 } }, }, diff --git a/data-otservbr-global/startup/tables/door_key.lua b/data-otservbr-global/startup/tables/door_key.lua index 63a52a6a6ad..01d571991ac 100644 --- a/data-otservbr-global/startup/tables/door_key.lua +++ b/data-otservbr-global/startup/tables/door_key.lua @@ -90,6 +90,11 @@ KeyDoorAction = { { x = 32398, y = 31804, z = 8 }, }, }, + -- Door of the key 3700 (The Pits of Inferno) + [Storage.Quest.Key.ID3700] = { + itemId = 1628, + itemPos = { { x = 32827, y = 32246, z = 10 } }, + }, -- Door of the key 2297 (emperor's cookies quest) [Storage.Quest.Key.ID3800] = { itemId = false, diff --git a/data-otservbr-global/startup/tables/door_level.lua b/data-otservbr-global/startup/tables/door_level.lua index d4c549a0f6b..4739b040753 100644 --- a/data-otservbr-global/startup/tables/door_level.lua +++ b/data-otservbr-global/startup/tables/door_level.lua @@ -44,6 +44,11 @@ LevelDoorAction = { { x = 32981, y = 31760, z = 9 }, { x = 32353, y = 32073, z = 11 }, { x = 32544, y = 32179, z = 14 }, + -- The Djinn War - The Efreet + { x = 33050, y = 32622, z = 6 }, + { x = 33050, y = 32623, z = 6 }, + { x = 33102, y = 32537, z = 6 }, + { x = 33103, y = 32537, z = 6 }, }, }, -- Doors for level 45 diff --git a/data-otservbr-global/startup/tables/door_quest.lua b/data-otservbr-global/startup/tables/door_quest.lua index 927eb5219f7..59c667944fa 100644 --- a/data-otservbr-global/startup/tables/door_quest.lua +++ b/data-otservbr-global/startup/tables/door_quest.lua @@ -41,7 +41,7 @@ QuestDoorAction = { itemPos = { { x = 32223, y = 31890, z = 14 } }, }, -- Sams old backpack door - [Storage.SamsOldBackpackDoor] = { + [Storage.Quest.U7_5.SamsOldBackpack.SamsOldBackpackDoor] = { itemId = false, itemPos = { { x = 32455, y = 31967, z = 14 } }, }, @@ -96,48 +96,48 @@ QuestDoorAction = { itemPos = { { x = 33269, y = 32446, z = 12 } }, }, -- Beggar outfit quest door - [Storage.OutfitQuest.BeggarFirstAddonDoor] = { + [Storage.Quest.U7_8.BeggarOutfits.BeggarFirstAddonDoor] = { itemId = false, itemPos = { { x = 33165, y = 31600, z = 15 } }, }, -- The explorer society quest doors -- Mission in Dwacatra - [Storage.ExplorerSociety.DwacatraDoor] = { + [Storage.Quest.U7_6.ExplorerSociety.DwacatraDoor] = { itemId = false, itemPos = { { x = 32598, y = 31933, z = 15 } }, }, -- Mission in Chor - [Storage.ExplorerSociety.ChorurnDoor] = { + [Storage.Quest.U7_6.ExplorerSociety.ChorurnDoor] = { itemId = false, itemPos = { { x = 32957, y = 32835, z = 8 } }, }, -- Mission in Dark Pyramid - [Storage.ExplorerSociety.BonelordsDoor] = { + [Storage.Quest.U7_6.ExplorerSociety.BonelordsDoor] = { itemId = false, itemPos = { { x = 33308, y = 32280, z = 12 } }, }, -- Mission in Orc Fortress - [Storage.ExplorerSociety.OrcDoor] = { + [Storage.Quest.U7_6.ExplorerSociety.OrcDoor] = { itemId = false, itemPos = { { x = 32967, y = 31720, z = 2 } }, }, -- Mission in Hell Gate - [Storage.ExplorerSociety.ElvenDoor] = { + [Storage.Quest.U7_6.ExplorerSociety.ElvenDoor] = { itemId = false, itemPos = { { x = 32703, y = 31605, z = 14 } }, }, -- Mission in Endron - [Storage.ExplorerSociety.MemoryStoneDoor] = { + [Storage.Quest.U7_6.ExplorerSociety.MemoryStoneDoor] = { itemId = false, itemPos = { { x = 33151, y = 31640, z = 11 } }, }, -- Mission in Isle of Kings - [Storage.ExplorerSociety.BansheeDoor] = { + [Storage.Quest.U7_6.ExplorerSociety.BansheeDoor] = { itemId = false, itemPos = { { x = 32259, y = 31948, z = 14 } }, }, -- Astral Bridge from Port Hope to Northport - [Storage.ExplorerSociety.SpectralStoneDoor] = { + [Storage.Quest.U7_6.ExplorerSociety.SpectralStoneDoor] = { itemId = false, itemPos = { { x = 32665, y = 32734, z = 6 }, @@ -145,7 +145,7 @@ QuestDoorAction = { }, }, -- Astral Bridge from Svargrond to Liberty Bay - [Storage.ExplorerSociety.IceMusicDoor] = { + [Storage.Quest.U7_6.ExplorerSociety.IceMusicDoor] = { itemId = false, itemPos = { { x = 32318, y = 31137, z = 6 }, @@ -153,25 +153,25 @@ QuestDoorAction = { }, }, -- Mission in Calassa - [Storage.ExplorerSociety.CalassaDoor] = { + [Storage.Quest.U7_6.ExplorerSociety.CalassaDoor] = { itemId = false, itemPos = { { x = 31939, y = 32771, z = 13 } }, }, -- The war djin quest -- Marid faction - [Storage.DjinnWar.Faction.MaridDoor] = { + [Storage.Quest.U7_4.DjinnWar.Faction.MaridDoor] = { itemId = false, itemPos = { { x = 33106, y = 32532, z = 6 } }, }, - [Storage.DjinnWar.Faction.EfreetDoor] = { + [Storage.Quest.U7_4.DjinnWar.Faction.EfreetDoor] = { itemId = false, itemPos = { { x = 33047, y = 32626, z = 6 } }, }, - [Storage.DjinnWar.MaridFaction.DoorToLamp] = { + [Storage.Quest.U7_4.DjinnWar.MaridFaction.DoorToLamp] = { itemId = false, itemPos = { { x = 33038, y = 32632, z = 1 } }, }, - [Storage.DjinnWar.MaridFaction.DoorToEfreetTerritory] = { + [Storage.Quest.U7_4.DjinnWar.MaridFaction.DoorToEfreetTerritory] = { itemId = false, itemPos = { { x = 33034, y = 32620, z = 6 }, @@ -180,11 +180,11 @@ QuestDoorAction = { }, }, -- Efreet faction - [Storage.DjinnWar.EfreetFaction.DoorToLamp] = { + [Storage.Quest.U7_4.DjinnWar.EfreetFaction.DoorToLamp] = { itemId = false, itemPos = { { x = 33097, y = 32531, z = 1 } }, }, - [Storage.DjinnWar.EfreetFaction.DoorToMaridTerritory] = { + [Storage.Quest.U7_4.DjinnWar.EfreetFaction.DoorToMaridTerritory] = { itemId = false, itemPos = { { x = 33100, y = 32518, z = 7 }, @@ -306,25 +306,25 @@ QuestDoorAction = { itemPos = { { x = 33666, y = 31924, z = 7 } }, }, -- Outfit quest door - [Storage.OutfitQuest.HunterHatAddon] = { + [Storage.Quest.U7_8.HunterOutfits.HunterHatAddon] = { itemId = false, itemPos = { { x = 32369, y = 32796, z = 10 } }, }, - -- Ancient tombs door - [Storage.TheAncientTombs.VashresamunsDoor] = { + -- The Ancient Tombs Quest - door Vashresamuns + [Storage.Quest.U7_4.TheAncientTombs.VashresamunsDoor] = { itemId = false, itemPos = { { x = 33184, y = 32665, z = 15 } }, }, -- The ape city door - [Storage.TheApeCity.ChorDoor] = { + [Storage.Quest.U7_6.TheApeCity.ChorDoor] = { itemId = false, itemPos = { { x = 32934, y = 32886, z = 7 } }, }, - [Storage.TheApeCity.FibulaDoor] = { + [Storage.Quest.U7_6.TheApeCity.FibulaDoor] = { itemId = false, itemPos = { { x = 32182, y = 32468, z = 10 } }, }, - [Storage.TheApeCity.CasksDoor] = { + [Storage.Quest.U7_6.TheApeCity.CasksDoor] = { itemId = false, itemPos = { { x = 32861, y = 32495, z = 9 }, @@ -336,7 +336,7 @@ QuestDoorAction = { { x = 32861, y = 32507, z = 9 }, }, }, - [Storage.TheApeCity.DworcDoor] = { + [Storage.Quest.U7_6.TheApeCity.DworcDoor] = { itemId = false, itemPos = { { x = 32781, y = 32910, z = 8 } }, }, @@ -601,11 +601,11 @@ QuestDoorAction = { itemPos = { { x = 33247, y = 32534, z = 8 } }, }, -- THe shattered isles door - [Storage.TheShatteredIsles.TortoiseEggNargorDoor] = { + [Storage.Quest.U7_8.TheShatteredIsles.TortoiseEggNargorDoor] = { itemId = false, itemPos = { { x = 31934, y = 32838, z = 7 } }, }, - [Storage.TheShatteredIsles.YavernDoor] = { + [Storage.Quest.U7_8.TheShatteredIsles.YavernDoor] = { itemId = false, itemPos = { { x = 31978, y = 32856, z = 3 } }, }, @@ -644,11 +644,11 @@ QuestDoorAction = { itemPos = { { x = 32227, y = 31052, z = 7 } }, }, -- The pits of inferno door - [Storage.PitsOfInferno.ShortcutHubDoor] = { + [Storage.Quest.U7_9.ThePitsOfInferno.ShortcutHubDoor] = { itemId = false, itemPos = { { x = 32786, y = 32328, z = 6 } }, }, - [Storage.PitsOfInferno.ShortcutLeverDoor] = { + [Storage.Quest.U7_9.ThePitsOfInferno.ShortcutLeverDoor] = { itemId = false, itemPos = { { x = 32825, y = 32331, z = 11 }, @@ -743,7 +743,7 @@ QuestDoorAction = { itemId = 6260, itemPos = { { x = 32180, y = 31933, z = 11 } }, }, - [Storage.OutfitQuest.Knight.RamsaysHelmetDoor] = { + [Storage.Quest.U7_8.KnightOutfits.RamsaysHelmetDoor] = { itemId = 5122, itemPos = { { x = 32860, y = 32517, z = 11 } }, }, @@ -914,6 +914,25 @@ QuestDoorAction = { { x = 33782, y = 32576, z = 12 }, }, }, + [Storage.Quest.U7_8.DruidOutfits.DruidAmuletDoor] = { + itemId = false, + itemPos = { + { x = 32939, y = 31775, z = 9 }, + }, + }, + [Storage.Quest.U7_8.OrientalOutfits.OrientalDoor] = { + itemId = false, + itemPos = { + { x = 32084, y = 32776, z = 11 }, + }, + }, + [Storage.Quest.U7_9.NightmareOutfits.KnightwatchTowerDoor] = { + itemId = false, + itemPos = { + { x = 32815, y = 32328, z = 8 }, + { x = 32817, y = 32328, z = 8 }, + }, + }, } QuestDoorUnique = { diff --git a/data-otservbr-global/startup/tables/item.lua b/data-otservbr-global/startup/tables/item.lua index c53a445cf9c..3ae486a9b1b 100644 --- a/data-otservbr-global/startup/tables/item.lua +++ b/data-otservbr-global/startup/tables/item.lua @@ -18,7 +18,318 @@ ItemAction = { itemId = 2819, itemPos = { { x = 33063, y = 31624, z = 15 } }, }, - [40001] = { -- The cursed crystal skeletons + -- The Pits of Inferno Quest + [2023] = { + itemId = 1982, + itemPos = { + { x = 32791, y = 32333, z = 6 }, + }, + }, + -- The Explorer Society - Jump - Calassa + [2070] = { + itemId = 470, + itemPos = { + { x = 31914, y = 32716, z = 6 }, + { x = 31915, y = 32716, z = 6 }, + }, + }, + -- Dreamers Challenge Quest + [2245] = { + itemId = 431, + itemPos = { + { x = 32816, y = 32334, z = 9 }, + { x = 32816, y = 32335, z = 9 }, + { x = 32816, y = 32336, z = 9 }, + { x = 32816, y = 32337, z = 9 }, + { x = 32816, y = 32339, z = 9 }, + }, + }, + [2246] = { + itemId = 431, + itemPos = { + { x = 32818, y = 32332, z = 9 }, + { x = 32819, y = 32332, z = 9 }, + { x = 32820, y = 32332, z = 9 }, + { x = 32821, y = 32332, z = 9 }, + { x = 32822, y = 32332, z = 9 }, + }, + }, + -- The Pits of Inferno Quest + [4002] = { + itemId = 353, + itemPos = { + { x = 32854, y = 32326, z = 11 }, + }, + }, + -- Griffinclaw flower + [3152] = { + itemId = 5658, + itemPos = { x = 32024, y = 32830, z = 4 }, + }, + -- The Pits of Inferno Quest + [8815] = { + itemId = false, + itemPos = { + { x = 32805, y = 32319, z = 11 }, + { x = 32806, y = 32319, z = 11 }, + { x = 32806, y = 32318, z = 11 }, + { x = 32805, y = 32318, z = 11 }, + }, + }, + -- Dreamers Challenge Quest + [9049] = { + itemId = 2576, + itemPos = { + { x = 32934, y = 32282, z = 13 }, + { x = 32934, y = 32281, z = 13 }, + { x = 32933, y = 32281, z = 13 }, + { x = 32934, y = 32280, z = 13 }, + { x = 32933, y = 32280, z = 13 }, + { x = 32934, y = 32279, z = 13 }, + { x = 32933, y = 32279, z = 13 }, + { x = 32934, y = 32278, z = 13 }, + { x = 32933, y = 32278, z = 13 }, + { x = 32934, y = 32277, z = 13 }, + { x = 32933, y = 32277, z = 13 }, + { x = 32934, y = 32277, z = 13 }, + { x = 32934, y = 32276, z = 13 }, + { x = 32933, y = 32276, z = 13 }, + { x = 32934, y = 32275, z = 13 }, + { x = 32933, y = 32275, z = 13 }, + { x = 32934, y = 32274, z = 13 }, + { x = 32933, y = 32274, z = 13 }, + { x = 32934, y = 32273, z = 13 }, + { x = 32933, y = 32273, z = 13 }, + { x = 32934, y = 32272, z = 13 }, + { x = 32933, y = 32272, z = 13 }, + { x = 32934, y = 32271, z = 13 }, + { x = 32933, y = 32271, z = 13 }, + { x = 32934, y = 32270, z = 13 }, + { x = 32933, y = 32270, z = 13 }, + }, + }, + -- The Djinn War Quest - Green - Water fountain + [12105] = { + itemId = 1928, + itemPos = { + { x = 33109, y = 32530, z = 3 }, + }, + }, + -- The Ancient Tombs Quest + [12105] = { + itemId = false, + itemPos = { + { x = 33188, y = 32660, z = 15 }, + { x = 33189, y = 32660, z = 15 }, + { x = 33190, y = 32660, z = 15 }, + { x = 33191, y = 32660, z = 15 }, + { x = 33188, y = 32669, z = 15 }, + { x = 33189, y = 32669, z = 15 }, + { x = 33190, y = 32669, z = 15 }, + { x = 33191, y = 32669, z = 15 }, + }, + }, + [12107] = { + itemId = 2772, + itemPos = { + { x = 33118, y = 32761, z = 14 }, + { x = 33118, y = 32762, z = 14 }, + { x = 33118, y = 32763, z = 14 }, + }, + }, + [12107] = { + itemId = 1662, + itemPos = { + { x = 33122, y = 32765, z = 14 }, + }, + }, + -- The Shattered Isles Quest + [12585] = { + itemId = 1949, + itemPos = { + { x = 31919, y = 32600, z = 10 }, + }, + }, + -- The Pits of Inferno Quest + [16772] = { + itemId = 353, + itemPos = { + { x = 32767, y = 32358, z = 15 }, + }, + }, + [16774] = { + itemId = 2576, + itemPos = { + { x = 32741, y = 32382, z = 15 }, + }, + }, + -- Hunter Outfits Quest - piano + [33216] = { + itemId = 6123, + itemPos = { + { x = 32406, y = 32794, z = 9 }, + }, + }, + -- The Pits of Inferno Quest + [28810] = { + itemId = 353, + itemPos = { + { x = 32858, y = 32285, z = 9 }, + }, + }, + [28811] = { + itemId = 353, + itemPos = { + { x = 32836, y = 32289, z = 9 }, + }, + }, + [28812] = { + itemId = 353, + itemPos = { + { x = 32851, y = 32290, z = 9 }, + }, + }, + [28813] = { + itemId = 354, + itemPos = { + { x = 32839, y = 32292, z = 9 }, + }, + }, + [28814] = { + itemId = 353, + itemPos = { + { x = 32857, y = 32292, z = 9 }, + }, + }, + [28815] = { + itemId = 351, + itemPos = { + { x = 32844, y = 32294, z = 9 }, + }, + }, + [28816] = { + itemId = 353, + itemPos = { + { x = 32852, y = 32297, z = 9 }, + }, + }, + [28817] = { + itemId = 353, + itemPos = { + { x = 32832, y = 32299, z = 9 }, + }, + }, + [28818] = { + itemId = 353, + itemPos = { + { x = 32862, y = 32300, z = 9 }, + }, + }, + [28819] = { + itemId = 353, + itemPos = { + { x = 32855, y = 32301, z = 9 }, + }, + }, + [28820] = { + itemId = 353, + itemPos = { + { x = 32843, y = 32303, z = 9 }, + }, + }, + [28821] = { + itemId = 353, + itemPos = { + { x = 32834, y = 32307, z = 9 }, + }, + }, + [28822] = { + itemId = 353, + itemPos = { + { x = 32834, y = 32310, z = 9 }, + }, + }, + [28823] = { + itemId = 353, + itemPos = { + { x = 32862, y = 32311, z = 9 }, + }, + }, + [28824] = { + itemId = 353, + itemPos = { + { x = 32839, y = 32312, z = 9 }, + }, + }, + [28825] = { + itemId = 353, + itemPos = { + { x = 32862, y = 32313, z = 9 }, + }, + }, + [28826] = { + itemId = 353, + itemPos = { + { x = 32837, y = 32315, z = 9 }, + }, + }, + [28827] = { + itemId = 353, + itemPos = { + { x = 32843, y = 32319, z = 9 }, + }, + }, + [28828] = { + itemId = 353, + itemPos = { + { x = 32850, y = 32319, z = 9 }, + }, + }, + [28829] = { + itemId = 353, + itemPos = { + { x = 32858, y = 32324, z = 9 }, + }, + }, + [28830] = { + itemId = 353, + itemPos = { + { x = 32848, y = 32325, z = 9 }, + }, + }, + [28831] = { + itemId = 353, + itemPos = { + { x = 32858, y = 32289, z = 9 }, + }, + }, + [28832] = { + itemId = 353, + itemPos = { + { x = 32854, y = 32307, z = 9 }, + }, + }, + [28833] = { + itemId = 353, + itemPos = { + { x = 32830, y = 32308, z = 9 }, + }, + }, + [28834] = { + itemId = 353, + itemPos = { + { x = 32858, y = 32321, z = 9 }, + }, + }, + -- The Pits of Inferno + [39511] = { + itemId = 6433, + itemPos = { + { x = 32739, y = 32392, z = 14 }, + }, + }, + -- The cursed crystal skeletons + [40001] = { itemId = 27490, itemPos = { { x = 31974, y = 32907, z = 8 }, @@ -291,16 +602,368 @@ ItemAction = { { x = 32356, y = 32074, z = 10 }, }, }, + -- The Ancient Tombs Quest + [40032] = { + itemId = 2023, + itemPos = { + { x = 33071, y = 32637, z = 15 }, + }, + }, + [40033] = { + itemId = 2023, + itemPos = { + { x = 33074, y = 32633, z = 15 }, + }, + }, + [40034] = { + itemId = 2023, + itemPos = { + { x = 33071, y = 32629, z = 15 }, + }, + }, + [40035] = { + itemId = 2023, + itemPos = { + { x = 33077, y = 32625, z = 15 }, + }, + }, + [40036] = { + itemId = 2023, + itemPos = { + { x = 33077, y = 32621, z = 15 }, + }, + }, + [40037] = { + itemId = 2023, + itemPos = { + { x = 33071, y = 32617, z = 15 }, + }, + }, + [40038] = { + itemId = 2023, + itemPos = { + { x = 33077, y = 32613, z = 15 }, + }, + }, + [40039] = { + itemId = 2023, + itemPos = { + { x = 33071, y = 32609, z = 15 }, + }, + }, + [40040] = { + itemId = 2344, + itemPos = { + { x = 33198, y = 32876, z = 11 }, + }, + }, + -- The Ape City Quest - Casks + [40041] = { + itemId = 4848, + itemPos = { + { x = 32862, y = 32507, z = 9 }, + { x = 32862, y = 32505, z = 9 }, + { x = 32862, y = 32503, z = 9 }, + { x = 32862, y = 32501, z = 9 }, + { x = 32862, y = 32499, z = 9 }, + { x = 32862, y = 32497, z = 9 }, + { x = 32862, y = 32495, z = 9 }, + }, + }, + -- The Pits of Inferno + [50082] = { + itemId = 2576, + itemPos = { + { x = 32745, y = 32383, z = 15 }, + }, + }, + [50083] = { + itemId = 2576, + itemPos = { + { x = 32745, y = 32392, z = 15 }, + }, + }, + [50087] = { + itemId = 1949, + itemPos = { + { x = 32732, y = 32264, z = 15 }, + }, + }, + -- Dreamers Challenge Quest + [50149] = { + itemId = 1949, + itemPos = { + { x = 32840, y = 32226, z = 14 }, + }, + }, + [50150] = { + itemId = 1949, + itemPos = { + { x = 32788, y = 32227, z = 14 }, + }, + }, } ItemUnique = { + -- The Pits of Inferno Quest + [2000] = { + itemId = 599, + itemPos = { x = 32791, y = 32328, z = 10 }, + }, + [2002] = { + itemId = 431, + itemPos = { x = 32906, y = 32287, z = 12 }, + }, + [2001] = { + itemId = 599, + itemPos = { x = 32791, y = 32330, z = 10 }, + }, + [2080] = { + itemId = 5915, + itemPos = { x = 32909, y = 32207, z = 15 }, + }, + [2081] = { + itemId = 5916, + itemPos = { x = 32757, y = 32243, z = 15 }, + }, + [2082] = { + itemId = 5915, + itemPos = { x = 32840, y = 32324, z = 15 }, + }, + [2083] = { + itemId = 5915, + itemPos = { x = 32875, y = 32264, z = 15 }, + }, + [2084] = { + itemId = 5915, + itemPos = { x = 32717, y = 32381, z = 13 }, + }, + [2085] = { + itemId = 5915, + itemPos = { x = 32839, y = 32305, z = 15 }, + }, + [2086] = { + itemId = 5915, + itemPos = { x = 32785, y = 32275, z = 15 }, + }, + [2090] = { + itemId = 1482, + itemPos = { x = 32824, y = 32230, z = 12 }, + }, + [2091] = { + itemId = 1482, + itemPos = { x = 32824, y = 32229, z = 12 }, + }, + [2092] = { + itemId = 1482, + itemPos = { x = 32824, y = 32228, z = 12 }, + }, + [2093] = { + itemId = 1482, + itemPos = { x = 32824, y = 32227, z = 12 }, + }, + [2094] = { + itemId = 1482, + itemPos = { x = 32824, y = 32226, z = 12 }, + }, + [2095] = { + itemId = 1482, + itemPos = { x = 32824, y = 32225, z = 12 }, + }, + [2096] = { + itemId = 1482, + itemPos = { x = 32824, y = 32224, z = 12 }, + }, + -- Dreamers Challenge Quest + [2241] = { + itemId = 353, + itemPos = { x = 32861, y = 32239, z = 9 }, + }, + [2242] = { + itemId = 351, + itemPos = { x = 32861, y = 32236, z = 9 }, + }, + [2243] = { + itemId = 3134, + itemPos = { x = 32849, y = 32233, z = 9 }, + }, + [2244] = { + itemId = 563, + itemPos = { x = 32857, y = 32225, z = 11 }, + }, + [2250] = { + itemId = 5572, + itemPos = { x = 32915, y = 32278, z = 14 }, + }, + [2251] = { + itemId = 5590, + itemPos = { x = 32916, y = 32263, z = 14 }, + }, + [2252] = { + itemId = 5484, + itemPos = { x = 32953, y = 32277, z = 13 }, + }, + [2253] = { + itemId = 452, + itemPos = { x = 32976, y = 32271, z = 14 }, + }, + [2254] = { + itemId = 2576, + itemPos = { x = 32933, y = 32269, z = 13 }, + }, + [2255] = { + itemId = 2576, + itemPos = { x = 32934, y = 32269, z = 13 }, + }, + -- The Shattered Isles Quest - Catapult + [2273] = { + itemId = 5601, + itemPos = { x = 31978, y = 32887, z = 6 }, + }, + -- The Explorer Society - The Rune Writings + [3010] = { + itemId = 2199, + itemPos = { x = 32754, y = 32559, z = 9 }, + }, + -- Dreamers Challenge Quest + [3048] = { + itemId = 1949, + itemPos = { x = 32822, y = 32344, z = 6 }, + }, + [3049] = { + itemId = 1949, + itemPos = { x = 32815, y = 32344, z = 6 }, + }, + [3050] = { + itemId = 1949, + itemPos = { x = 32818, y = 32347, z = 6 }, + }, + [3051] = { + itemId = 1949, + itemPos = { x = 32818, y = 32347, z = 5 }, + }, + [3052] = { + itemId = 1949, + itemPos = { x = 32815, y = 32344, z = 5 }, + }, + [3053] = { + itemId = 1949, + itemPos = { x = 32822, y = 32344, z = 5 }, + }, + [3054] = { + itemId = 1949, + itemPos = { x = 32815, y = 32344, z = 4 }, + }, + [3055] = { + itemId = 1949, + itemPos = { x = 32822, y = 32344, z = 4 }, + }, + [3056] = { + itemId = 1949, + itemPos = { x = 32819, y = 32347, z = 4 }, + }, + -- The Pits of Inferno Quest + [3303] = { + itemId = 431, + itemPos = { x = 32826, y = 32273, z = 11 }, + }, + -- The Ancient Tombs Quest + [3950] = { + itemId = 1949, + itemPos = { x = 33174, y = 32694, z = 14 }, + }, + [3951] = { + itemId = 1949, + itemPos = { x = 33396, y = 32852, z = 14 }, + }, + [3952] = { + itemId = 1949, + itemPos = { x = 33191, y = 32959, z = 15 }, + }, + [3953] = { + itemId = 1949, + itemPos = { x = 33195, y = 33002, z = 14 }, + }, + [3954] = { + itemId = 1949, + itemPos = { x = 33073, y = 32781, z = 14 }, + }, + [3955] = { + itemId = 1949, + itemPos = { x = 33103, y = 32590, z = 15 }, + }, + [3956] = { + itemId = 1949, + itemPos = { x = 33116, y = 32656, z = 15 }, + }, + -- The Ape City - HolyApeHair + [4010] = { + itemId = 2753, + itemPos = { x = 32933, y = 32495, z = 7 }, + }, + -- Dreamers Challenge Quest + [9030] = { + itemId = 1949, + itemPos = { x = 32762, y = 32290, z = 14 }, + }, + -- The Ape City - HolyApeHair + [9033] = { + itemId = 2114, + itemPos = { x = 33098, y = 32816, z = 13 }, + }, + [9034] = { + itemId = 2114, + itemPos = { x = 33293, y = 32741, z = 13 }, + }, + [9035] = { + itemId = 2114, + itemPos = { x = 33073, y = 32589, z = 13 }, + }, + [9036] = { + itemId = 2114, + itemPos = { x = 33240, y = 32855, z = 13 }, + }, + [9037] = { + itemId = 2114, + itemPos = { x = 33276, y = 32552, z = 14 }, + }, + [9038] = { + itemId = 2114, + itemPos = { x = 33233, y = 32692, z = 13 }, + }, + [9039] = { + itemId = 2114, + itemPos = { x = 33135, y = 32682, z = 12 }, + }, + [9040] = { + itemId = 2114, + itemPos = { x = 33161, y = 32831, z = 10 }, + }, + -- Dreamers Challenge Quest + [9234] = { + itemId = 1949, + itemPos = { x = 32857, y = 32230, z = 11 }, + }, + -- Hydra Egg Quest + [9255] = { + itemId = 5676, + itemPos = { x = 32954, y = 32695, z = 8 }, + }, + -- The Ape City Quest + [9256] = { + itemId = 3919, + itemPos = { x = 32181, y = 32468, z = 10 }, + }, + [9257] = { + itemId = 1949, + itemPos = { x = 32839, y = 32533, z = 9 }, + }, -- Issavi town teleport [9515] = { itemId = 1949, itemPos = { x = 33926, y = 31477, z = 5 }, }, -- The shattered isles - -- data\scripts\actions\quests\the_shattered_isles\nargor_maps.lua [40001] = { itemId = 6118, itemPos = { x = 31978, y = 32828, z = 2 }, @@ -448,20 +1111,17 @@ ItemUnique = { itemPos = { x = 33874, y = 31433, z = 9 }, }, -- Explorer Society Quest - -- Path: data\scripts\actions\quests\explorer_society\findings.lua -- Lizard Urn (Chor) [40041] = { itemId = 2904, itemPos = { x = 32957, y = 32834, z = 8 }, }, -- Frozen Dragon (Okolnir) - -- Path: data\scripts\actions\quests\explorer_society\dragon.lua [40042] = { itemId = 7295, itemPos = { x = 32321, y = 31455, z = 9 }, }, -- Icicles for Ice Music (Camp / Hrodmir) - -- Path: data\scripts\actions\quests\explorer_society\resonance.lua [40043] = { itemId = 6966, itemPos = { x = 32078, y = 31217, z = 7 }, @@ -666,4 +1326,117 @@ ItemUnique = { itemId = 4077, itemPos = { x = 31978, y = 32184, z = 10 }, }, + -- The Ancient Tombs Quest + [40083] = { + itemId = 1949, + itemPos = { x = 33073, y = 32603, z = 15 }, + }, + [40084] = { + itemId = 1949, + itemPos = { x = 33183, y = 32757, z = 15 }, + }, + [40085] = { + itemId = 1949, + itemPos = { x = 33238, y = 32644, z = 14 }, + }, + [40086] = { + itemId = 1949, + itemPos = { x = 33109, y = 33009, z = 14 }, + }, + [40087] = { + itemId = 1949, + itemPos = { x = 33206, y = 32982, z = 14 }, + }, + [40088] = { + itemId = 1949, + itemPos = { x = 33130, y = 32736, z = 14 }, + }, + [40089] = { + itemId = 1949, + itemPos = { x = 33120, y = 32811, z = 15 }, + }, + [40090] = { + itemId = 1949, + itemPos = { x = 33117, y = 32627, z = 15 }, + }, + [40091] = { + itemId = 1949, + itemPos = { x = 33178, y = 32664, z = 15 }, + }, + -- The Ape City Quest - The Large Amphoras + [40092] = { + itemId = 4995, + itemPos = { x = 32792, y = 32527, z = 10 }, + }, + [40093] = { + itemId = 4995, + itemPos = { x = 32823, y = 32525, z = 10 }, + }, + [40094] = { + itemId = 4995, + itemPos = { x = 32876, y = 32584, z = 10 }, + }, + [40095] = { + itemId = 4995, + itemPos = { x = 32744, y = 32586, z = 10 }, + }, + -- Druid Outfits Quest - Ceirons Waterskin + [40096] = { + itemId = 5662, + itemPos = { x = 33024, y = 32672, z = 6 }, + }, + -- The Ancient Tombs Quest + [50135] = { + itemId = 1949, + itemPos = { x = 33393, y = 32802, z = 14 }, + }, + [50136] = { + itemId = 419, + itemPos = { x = 33362, y = 32811, z = 14 }, + }, + [50137] = { + itemId = 1949, + itemPos = { x = 33083, y = 32569, z = 13 }, + }, + [50138] = { + itemId = 1949, + itemPos = { x = 33179, y = 32890, z = 11 }, + }, + [50139] = { + itemId = 1959, + itemPos = { x = 33252, y = 32703, z = 15 }, + }, + [50140] = { + itemId = 1959, + itemPos = { x = 33270, y = 32667, z = 15 }, + }, + [50141] = { + itemId = 1959, + itemPos = { x = 33245, y = 32686, z = 15 }, + }, + [50142] = { + itemId = 1959, + itemPos = { x = 33275, y = 32685, z = 14 }, + }, + [50143] = { + itemId = 1959, + itemPos = { x = 33279, y = 32682, z = 14 }, + }, + [50144] = { + itemId = 1959, + itemPos = { x = 33263, y = 32681, z = 14 }, + }, + [50145] = { + itemId = 1959, + itemPos = { x = 33269, y = 32698, z = 14 }, + }, + [50146] = { + itemId = 1949, + itemPos = { x = 33263, y = 32668, z = 13 }, + }, + -- Dreamers Challenge Quest + [50147] = { + itemId = 1949, + itemPos = { x = 32826, y = 32347, z = 9 }, + }, } diff --git a/data-otservbr-global/startup/tables/lever.lua b/data-otservbr-global/startup/tables/lever.lua index ded194b341b..1c8f95fe246 100644 --- a/data-otservbr-global/startup/tables/lever.lua +++ b/data-otservbr-global/startup/tables/lever.lua @@ -1,6 +1,81 @@ -- Look README.md for see the reserved action/unique numbers LeverAction = { + -- The Pits of Inferno Quest + [4001] = { + itemId = 431, + itemPos = { + { x = 32848, y = 32277, z = 9 }, + }, + }, + [7799] = { + itemId = 431, + itemPos = { + { x = 32842, y = 32274, z = 9 }, + { x = 32842, y = 32275, z = 9 }, + { x = 32842, y = 32276, z = 9 }, + }, + }, + -- Dreamer's Challenge Quest + [8033] = { + itemId = 2772, + itemPos = { + { x = 32836, y = 32278, z = 14 }, + }, + }, + -- The Ancient Tombs Quest + [12121] = { + itemId = 2772, + itemPos = { + { x = 33358, y = 32701, z = 14 }, + { x = 33349, y = 32680, z = 14 }, + { x = 33305, y = 32734, z = 14 }, + { x = 33357, y = 32749, z = 14 }, + { x = 33368, y = 32763, z = 14 }, + { x = 33382, y = 32786, z = 14 }, + { x = 33338, y = 32702, z = 14 }, + { x = 33320, y = 32682, z = 14 }, + }, + }, + [12122] = { + itemId = 2772, + itemPos = { + { x = 33027, y = 32530, z = 13 }, + { x = 33006, y = 32563, z = 13 }, + { x = 33123, y = 32599, z = 13 }, + { x = 33028, y = 32588, z = 13 }, + { x = 33147, y = 32524, z = 13 }, + { x = 33104, y = 32514, z = 13 }, + { x = 33055, y = 32487, z = 13 }, + { x = 33036, y = 32507, z = 13 }, + { x = 33089, y = 32514, z = 13 }, + { x = 33077, y = 32507, z = 13 }, + { x = 33130, y = 32489, z = 13 }, + }, + }, + [12123] = { + itemId = 2772, + itemPos = { + { x = 33183, y = 32884, z = 11 }, + { x = 33181, y = 32889, z = 11 }, + { x = 33175, y = 32884, z = 11 }, + { x = 33176, y = 32880, z = 11 }, + { x = 33182, y = 32880, z = 11 }, + { x = 33176, y = 32889, z = 11 }, + }, + }, + -- The Ape City Quest - levers + [12129] = { + itemId = 2772, + itemPos = { + { x = 32891, y = 32590, z = 11 }, + { x = 32843, y = 32649, z = 11 }, + { x = 32808, y = 32613, z = 11 }, + { x = 32775, y = 32583, z = 11 }, + { x = 32756, y = 32494, z = 11 }, + { x = 32799, y = 32556, z = 11 }, + }, + }, -- Dawnport bridge lever -- Path: data\scripts\actions\dawnport\lever.lua [30001] = { @@ -70,9 +145,167 @@ LeverAction = { { x = 32600, y = 32105, z = 14 }, }, }, + -- The Pits of Inferno Quest + [50160] = { + itemId = 2772, + itemPos = { + { x = 32853, y = 32318, z = 9 }, + }, + }, } LeverUnique = { + -- The Pits of Inferno + [1037] = { + itemId = 2772, + itemPos = { x = 32800, y = 32339, z = 11 }, + }, + -- The Ape City Quest - levers + [1040] = { + itemId = 2772, + itemPos = { x = 32862, y = 32557, z = 11 }, + }, + [1041] = { + itemId = 2772, + itemPos = { x = 32862, y = 32555, z = 11 }, + }, + -- Dreamers Challenge Quest + [2004] = { + itemId = 2772, + itemPos = { x = 32873, y = 32263, z = 14 }, + }, + -- The Pits of Inferno Quest + [2025] = { + itemId = 2772, + itemPos = { x = 32820, y = 32321, z = 10 }, + }, + [2026] = { + itemId = 2772, + itemPos = { x = 32820, y = 32345, z = 10 }, + }, + [2027] = { + itemId = 2772, + itemPos = { x = 32847, y = 32339, z = 10 }, + }, + [2028] = { + itemId = 2772, + itemPos = { x = 32847, y = 32327, z = 10 }, + }, + [2050] = { + itemId = 2772, + itemPos = { x = 32874, y = 32334, z = 12 }, + }, + [2051] = { + itemId = 2772, + itemPos = { x = 32891, y = 32328, z = 14 }, + }, + [2052] = { + itemId = 2772, + itemPos = { x = 32843, y = 32352, z = 14 }, + }, + [2053] = { + itemId = 2772, + itemPos = { x = 32889, y = 32349, z = 15 }, + }, + [2054] = { + itemId = 2772, + itemPos = { x = 32887, y = 32330, z = 12 }, + }, + [2055] = { + itemId = 2772, + itemPos = { x = 32846, y = 32318, z = 12 }, + }, + [2056] = { + itemId = 2772, + itemPos = { x = 32887, y = 32355, z = 13 }, + }, + [2057] = { + itemId = 2772, + itemPos = { x = 32853, y = 32359, z = 14 }, + }, + [2058] = { + itemId = 2772, + itemPos = { x = 32843, y = 32359, z = 12 }, + }, + [2059] = { + itemId = 2772, + itemPos = { x = 32847, y = 32332, z = 13 }, + }, + [2060] = { + itemId = 2772, + itemPos = { x = 32886, y = 32337, z = 13 }, + }, + [2061] = { + itemId = 2772, + itemPos = { x = 32874, y = 32365, z = 13 }, + }, + [2062] = { + itemId = 2772, + itemPos = { x = 32850, y = 32366, z = 13 }, + }, + [2063] = { + itemId = 2772, + itemPos = { x = 32859, y = 32364, z = 13 }, + }, + [2064] = { + itemId = 2772, + itemPos = { x = 32874, y = 32354, z = 14 }, + }, + [2065] = { + itemId = 2772, + itemPos = { x = 32848, y = 32335, z = 12 }, + }, + -- Dreamers Challenge Quest + [2246] = { + itemId = 2772, + itemPos = { x = 32763, y = 32291, z = 14 }, + }, + [2247] = { + itemId = 2772, + itemPos = { x = 32761, y = 32291, z = 14 }, + }, + [2248] = { + itemId = 2772, + itemPos = { x = 32763, y = 32289, z = 14 }, + }, + [2249] = { + itemId = 2772, + itemPos = { x = 32761, y = 32289, z = 14 }, + }, + [2272] = { + itemId = 2772, + itemPos = { x = 32838, y = 32263, z = 14 }, + }, + -- Dreamers Challenge Quest + [3041] = { + itemId = 2772, + itemPos = { x = 32837, y = 32221, z = 14 }, + }, + [3042] = { + itemId = 2772, + itemPos = { x = 32836, y = 32229, z = 14 }, + }, + [3043] = { + itemId = 2772, + itemPos = { x = 32833, y = 32224, z = 14 }, + }, + -- The Pits of Inferno Quest + [3300] = { + itemId = 2772, + itemPos = { x = 32850, y = 32268, z = 10 }, + }, + [3301] = { + itemId = 2772, + itemPos = { x = 32862, y = 32312, z = 11 }, + }, + [3302] = { + itemId = 2772, + itemPos = { x = 32851, y = 32308, z = 11 }, + }, + [3304] = { + itemId = 2772, + itemPos = { x = 32826, y = 32263, z = 11 }, + }, -- Dark trails quest (The Ravager lever) -- Path: data\scripts\actions\quests\dark_trails\lever_the_ravager.lua [30001] = { @@ -209,6 +442,31 @@ LeverUnique = { itemId = 2772, itemPos = { x = 32478, y = 31904, z = 3 }, }, + -- The Pits of Inferno Quest + [50095] = { + itemId = 2772, + itemPos = { x = 32815, y = 32333, z = 15 }, + }, + [50097] = { + itemId = 2772, + itemPos = { x = 32811, y = 32357, z = 15 }, + }, + [50098] = { + itemId = 2772, + itemPos = { x = 32803, y = 32353, z = 15 }, + }, + [50104] = { + itemId = 2772, + itemPos = { x = 32821, y = 32341, z = 13 }, + }, + [50105] = { + itemId = 2772, + itemPos = { x = 32821, y = 32346, z = 13 }, + }, + [50106] = { + itemId = 2772, + itemPos = { x = 32915, y = 32215, z = 15 }, + }, [Storage.ThaisExhibition.FriendshipAmulet] = { itemId = 2772, itemPos = { x = 32399, y = 32209, z = 9 }, diff --git a/data-otservbr-global/startup/tables/tile.lua b/data-otservbr-global/startup/tables/tile.lua index e2bec126315..546bc66ef65 100644 --- a/data-otservbr-global/startup/tables/tile.lua +++ b/data-otservbr-global/startup/tables/tile.lua @@ -1,6 +1,13 @@ -- Look README.md for see the reserved action/unique numbers TileAction = { + -- The Ape City Quest + [12124] = { + itemId = 419, + itemPos = { + { x = 33305, y = 32861, z = 13 }, + }, + }, -- Cure poison tiles at dawnport outpost entrances -- Tiles data\scripts\movements\others\dawnport_tiles.lua [20001] = { diff --git a/data-otservbr-global/startup/tables/tile_pick.lua b/data-otservbr-global/startup/tables/tile_pick.lua index c4d9f89ea9f..f208306ed30 100644 --- a/data-otservbr-global/startup/tables/tile_pick.lua +++ b/data-otservbr-global/startup/tables/tile_pick.lua @@ -21,6 +21,8 @@ TilePickAction = { { x = 32595, y = 32068, z = 9 }, { x = 32580, y = 32103, z = 11 }, { x = 32517, y = 32107, z = 14 }, + -- The Explorer Society + { x = 32295, y = 31441, z = 8 }, }, }, } diff --git a/data-otservbr-global/startup/tables/writeable.lua b/data-otservbr-global/startup/tables/writeable.lua index 5c555f51c82..9b903cd1133 100644 --- a/data-otservbr-global/startup/tables/writeable.lua +++ b/data-otservbr-global/startup/tables/writeable.lua @@ -860,4 +860,60 @@ Not mine! itemPos = { x = 32205, y = 32883, z = 7 }, text = "DANGER. Quara sighted below. Experienced adventurers only! Do not swim into a water channel unless you are prepared to meet your death!", }, + -- The Ancient Tombs Quest + [17] = { + itemId = 2023, + itemPos = { x = 33071, y = 32637, z = 15 }, + text = "endless", + }, + [18] = { + itemId = 2023, + itemPos = { x = 33074, y = 32633, z = 15 }, + text = "pale-faced", + }, + [19] = { + itemId = 2023, + itemPos = { x = 33071, y = 32629, z = 15 }, + text = "deceased", + }, + [20] = { + itemId = 2023, + itemPos = { x = 33077, y = 32625, z = 15 }, + text = "unholy", + }, + [21] = { + itemId = 2023, + itemPos = { x = 33077, y = 32621, z = 15 }, + text = "doomed", + }, + [22] = { + itemId = 2023, + itemPos = { x = 33071, y = 32617, z = 15 }, + text = "righteous", + }, + [23] = { + itemId = 2023, + itemPos = { x = 33077, y = 32613, z = 15 }, + text = "sharpened", + }, + [24] = { + itemId = 2023, + itemPos = { x = 33071, y = 32609, z = 15 }, + text = "mortal", + }, + -- Dreamers Challenge Quest + [25] = { + itemId = 1982, + itemPos = { x = 32761, y = 32290, z = 14 }, + text = "Pull us and let the fun begin!", + }, + -- The Pits of Inferno Quest + [26] = { + itemId = 2015, + itemPos = { x = 32855, y = 32334, z = 12 }, + text = [[ +Emergency Exit + +Will only work if the way is blocked]], + }, } diff --git a/data/npclib/npc_system/custom_modules.lua b/data/npclib/npc_system/custom_modules.lua index f1438d39d64..a1e339d1878 100644 --- a/data/npclib/npc_system/custom_modules.lua +++ b/data/npclib/npc_system/custom_modules.lua @@ -82,6 +82,13 @@ function KeywordHandler:addGreetKeyword(keys, parameters, condition, action) return self:addKeyword(localKeys, GreetModule.greet, parameters, condition, action) end +-- Function adapted to be able to create a single call to the NPC and per function +function KeywordHandler:addCustomGreetKeyword(keys, callbackFunction, parameters, condition, action) + local localKeys = keys + localKeys.callback = FocusModule.messageMatcherDefault + return self:addKeyword(localKeys, callbackFunction, parameters, condition, action) +end + -- Adds a keyword which acts as a farewell word function KeywordHandler:addFarewellKeyword(keys, parameters, condition, action) local localKeys = keys diff --git a/data/npclib/npc_system/npc_handler.lua b/data/npclib/npc_system/npc_handler.lua index 31aaa88faaf..7de4172faaa 100644 --- a/data/npclib/npc_system/npc_handler.lua +++ b/data/npclib/npc_system/npc_handler.lua @@ -595,6 +595,7 @@ if NpcHandler == nil then events = nil end + -- From now on, when you have several messages and inside brackets, use the tag |PLAYERNAME| recognition will be possible. function NpcHandler:doNPCTalkALot(msgs, delay, npc, player) local playerId = player:getId() if self:getEventDelayedSay(playerId) then @@ -613,13 +614,18 @@ if NpcHandler == nil then self.eventDelayedSay[playerId] = {} local ret = {} + local parseInfo = { + [TAG_PLAYERNAME] = player:getName(), + } + for messagesTable, messageString in pairs(msgs) do self.eventDelayedSay[playerId][messagesTable] = {} if delay ~= nil and delay > 1 then self.talkDelay = delay end -- The "self.talkDelayTimeForOutgoingMessages * 1000" = Interval for sending subsequent messages from the first - npc:sayWithDelay(npcUniqueId, msgs[messagesTable], TALKTYPE_PRIVATE_NP, ((messagesTable - 1) * self.talkDelay + self.talkDelayTimeForOutgoingMessages * 1000), self.eventDelayedSay[playerId][messagesTable], playerUniqueId) + local parsedMessage = self:parseMessage(msgs[messagesTable], parseInfo, player, messageString) + npc:sayWithDelay(npcUniqueId, parsedMessage, TALKTYPE_PRIVATE_NP, ((messagesTable - 1) * self.talkDelay + self.talkDelayTimeForOutgoingMessages * 1000), self.eventDelayedSay[playerId][messagesTable], playerUniqueId) ret[#ret + 1] = self.eventDelayedSay[playerId][messagesTable] end return ret diff --git a/data/scripts/actions/tools/crowbar.lua b/data/scripts/actions/tools/crowbar.lua deleted file mode 100644 index c3352cdb976..00000000000 --- a/data/scripts/actions/tools/crowbar.lua +++ /dev/null @@ -1,8 +0,0 @@ -local crowbar = Action() - -function crowbar.onUse(player, item, fromPosition, target, toPosition, isHotkey) - return onUseCrowbar(player, item, fromPosition, target, toPosition, isHotkey) -end - -crowbar:id(3304) -crowbar:register() From cd43a89c631662689f47ff69cc3c3aac221c65c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Thu, 25 Jul 2024 17:15:49 -0300 Subject: [PATCH 05/16] refactor: duplicated check of condition rooted (#2752) --- src/game/game.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index 949da71c0a3..b353537cf0c 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -1543,10 +1543,6 @@ ReturnValue Game::internalMoveCreature(const std::shared_ptr &creature return ret; } - if (creature->hasCondition(CONDITION_ROOTED)) { - return RETURNVALUE_NOTPOSSIBLE; - } - if (creature->hasCondition(CONDITION_FEARED)) { std::shared_ptr field = toTile->getFieldItem(); if (field && !field->isBlocking() && field->getDamage() != 0) { From a0b72fcd6fd332dc5017e53bfc9ab2e224b3c882 Mon Sep 17 00:00:00 2001 From: AlphaRage Date: Thu, 25 Jul 2024 22:26:46 +0200 Subject: [PATCH 06/16] fix: offer for life crystal and white pearls in npcs (#2761) --- data-otservbr-global/npc/alexander.lua | 2 +- data-otservbr-global/npc/briasol.lua | 2 +- data-otservbr-global/npc/chantalle.lua | 2 +- data-otservbr-global/npc/edmund.lua | 2 +- data-otservbr-global/npc/gail.lua | 2 +- data-otservbr-global/npc/haroun.lua | 2 +- data-otservbr-global/npc/ishina.lua | 2 +- data-otservbr-global/npc/iwan.lua | 2 +- data-otservbr-global/npc/jessica.lua | 2 +- data-otservbr-global/npc/khanna.lua | 2 +- data-otservbr-global/npc/odemara.lua | 2 +- data-otservbr-global/npc/oiriz.lua | 2 +- data-otservbr-global/npc/tesha.lua | 2 +- data-otservbr-global/npc/tezila.lua | 2 +- data-otservbr-global/npc/yonan.lua | 2 +- data-otservbr-global/npc/zoltan.lua | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/data-otservbr-global/npc/alexander.lua b/data-otservbr-global/npc/alexander.lua index fda2799bf4d..52b98a9760e 100644 --- a/data-otservbr-global/npc/alexander.lua +++ b/data-otservbr-global/npc/alexander.lua @@ -40,7 +40,7 @@ local itemsTable = { }, ["creature products"] = { { itemName = "crystal ball", clientId = 3076, buy = 530, sell = 190 }, - { itemName = "life crystal", clientId = 3061, sell = 83 }, + { itemName = "life crystal", clientId = 3061, sell = 85 }, { itemName = "mind stone", clientId = 3062, sell = 170 }, }, ["shields"] = { diff --git a/data-otservbr-global/npc/briasol.lua b/data-otservbr-global/npc/briasol.lua index 38dcd074159..999e09482f5 100644 --- a/data-otservbr-global/npc/briasol.lua +++ b/data-otservbr-global/npc/briasol.lua @@ -161,7 +161,7 @@ npcConfig.shop = { { itemName = "unicorn figurine", clientId = 30054, sell = 50000 }, { itemName = "violet crystal shard", clientId = 16120, sell = 1500 }, { itemName = "wedding ring", clientId = 3004, buy = 990 }, - { itemName = "white pearl", clientId = 3026, buy = 320 }, + { itemName = "white pearl", clientId = 3026, buy = 320, sell = 160 }, { itemName = "white silk flower", clientId = 34008, sell = 9000 }, } diff --git a/data-otservbr-global/npc/chantalle.lua b/data-otservbr-global/npc/chantalle.lua index 3ed42984f5c..dceb2ac2736 100644 --- a/data-otservbr-global/npc/chantalle.lua +++ b/data-otservbr-global/npc/chantalle.lua @@ -152,7 +152,7 @@ npcConfig.shop = { { itemName = "violet crystal shard", clientId = 16120, sell = 1500 }, { itemName = "watermelon tourmaline", clientId = 33780, sell = 230000 }, { itemName = "wedding ring", clientId = 3004, buy = 990 }, - { itemName = "white pearl", clientId = 3026, buy = 320 }, + { itemName = "white pearl", clientId = 3026, buy = 320, sell = 160 }, { itemName = "white silk flower", clientId = 34008, sell = 9000 }, } diff --git a/data-otservbr-global/npc/edmund.lua b/data-otservbr-global/npc/edmund.lua index c61a95bcd72..1533a20810d 100644 --- a/data-otservbr-global/npc/edmund.lua +++ b/data-otservbr-global/npc/edmund.lua @@ -116,7 +116,7 @@ npcConfig.shop = { { itemName = "unicorn figurine", clientId = 30054, sell = 50000 }, { itemName = "violet crystal shard", clientId = 16120, sell = 1500 }, { itemName = "wedding ring", clientId = 3004, buy = 990 }, - { itemName = "white pearl", clientId = 3026, buy = 320 }, + { itemName = "white pearl", clientId = 3026, buy = 320, sell = 160 }, { itemName = "white silk flower", clientId = 34008, sell = 9000 }, } diff --git a/data-otservbr-global/npc/gail.lua b/data-otservbr-global/npc/gail.lua index de2a52dc7f4..1c61a2cbc6d 100644 --- a/data-otservbr-global/npc/gail.lua +++ b/data-otservbr-global/npc/gail.lua @@ -157,7 +157,7 @@ npcConfig.shop = { { itemName = "unicorn figurine", clientId = 30054, sell = 50000 }, { itemName = "violet crystal shard", clientId = 16120, sell = 1500 }, { itemName = "wedding ring", clientId = 3004, buy = 990 }, - { itemName = "white pearl", clientId = 3026, buy = 320 }, + { itemName = "white pearl", clientId = 3026, buy = 320, sell = 160 }, { itemName = "white silk flower", clientId = 34008, sell = 9000 }, } diff --git a/data-otservbr-global/npc/haroun.lua b/data-otservbr-global/npc/haroun.lua index ccd762b46df..aa7560af9dd 100644 --- a/data-otservbr-global/npc/haroun.lua +++ b/data-otservbr-global/npc/haroun.lua @@ -151,7 +151,7 @@ npcConfig.shop = { { itemName = "club ring", clientId = 3093, buy = 500, sell = 100 }, { itemName = "elven amulet", clientId = 3082, buy = 500, sell = 100, count = 50 }, { itemName = "garlic necklace", clientId = 3083, buy = 100, sell = 50 }, - { itemName = "life crystal", clientId = 4840, sell = 50 }, + { itemName = "life crystal", clientId = 3061, sell = 50 }, { itemName = "magic light wand", clientId = 3046, buy = 120, sell = 35 }, { itemName = "mind stone", clientId = 3062, sell = 100 }, { itemName = "orb", clientId = 3060, sell = 750 }, diff --git a/data-otservbr-global/npc/ishina.lua b/data-otservbr-global/npc/ishina.lua index 1f317cca171..b69933c2ba3 100644 --- a/data-otservbr-global/npc/ishina.lua +++ b/data-otservbr-global/npc/ishina.lua @@ -179,7 +179,7 @@ npcConfig.shop = { { itemName = "unicorn figurine", clientId = 30054, sell = 50000 }, { itemName = "violet crystal shard", clientId = 16120, sell = 1500 }, { itemName = "wedding ring", clientId = 3004, buy = 990 }, - { itemName = "white pearl", clientId = 3026, buy = 320 }, + { itemName = "white pearl", clientId = 3026, buy = 320, sell = 160 }, { itemName = "white silk flower", clientId = 34008, sell = 9000 }, } diff --git a/data-otservbr-global/npc/iwan.lua b/data-otservbr-global/npc/iwan.lua index 77689b12003..45763807bdd 100644 --- a/data-otservbr-global/npc/iwan.lua +++ b/data-otservbr-global/npc/iwan.lua @@ -126,7 +126,7 @@ npcConfig.shop = { { itemName = "unicorn figurine", clientId = 30054, sell = 50000 }, { itemName = "violet crystal shard", clientId = 16120, sell = 1500 }, { itemName = "wedding ring", clientId = 3004, buy = 990 }, - { itemName = "white pearl", clientId = 3026, buy = 320 }, + { itemName = "white pearl", clientId = 3026, buy = 320, sell = 160 }, { itemName = "white silk flower", clientId = 34008, sell = 9000 }, } diff --git a/data-otservbr-global/npc/jessica.lua b/data-otservbr-global/npc/jessica.lua index 43b1839b3ee..42798987ee0 100644 --- a/data-otservbr-global/npc/jessica.lua +++ b/data-otservbr-global/npc/jessica.lua @@ -151,7 +151,7 @@ npcConfig.shop = { { itemName = "violet crystal shard", clientId = 16120, sell = 1500 }, { itemName = "watermelon tourmaline", clientId = 33780, sell = 230000 }, { itemName = "wedding ring", clientId = 3004, buy = 990 }, - { itemName = "white pearl", clientId = 3026, buy = 320 }, + { itemName = "white pearl", clientId = 3026, buy = 320, sell = 160 }, { itemName = "white silk flower", clientId = 34008, sell = 9000 }, } diff --git a/data-otservbr-global/npc/khanna.lua b/data-otservbr-global/npc/khanna.lua index 76b5c1e70da..156a827f455 100644 --- a/data-otservbr-global/npc/khanna.lua +++ b/data-otservbr-global/npc/khanna.lua @@ -103,7 +103,7 @@ local itemsTable = { { itemName = "goanna meat", clientId = 31560, sell = 190 }, { itemName = "lamassu hoof", clientId = 31441, sell = 330 }, { itemName = "lamassu horn", clientId = 31442, sell = 240 }, - { itemName = "life crystal", clientId = 3061, sell = 85 }, + { itemName = "life crystal", clientId = 3061, sell = 75 }, { itemName = "lizard heart", clientId = 31340, sell = 530 }, { itemName = "manticore ear", clientId = 31440, sell = 310 }, { itemName = "manticore tail", clientId = 31439, sell = 220 }, diff --git a/data-otservbr-global/npc/odemara.lua b/data-otservbr-global/npc/odemara.lua index 3e1986714c7..5417e2d6b1c 100644 --- a/data-otservbr-global/npc/odemara.lua +++ b/data-otservbr-global/npc/odemara.lua @@ -123,7 +123,7 @@ npcConfig.shop = { { itemName = "violet crystal shard", clientId = 16120, sell = 1500 }, { itemName = "watermelon tourmaline", clientId = 33780, sell = 230000 }, { itemName = "wedding ring", clientId = 3004, buy = 990 }, - { itemName = "white pearl", clientId = 3026, buy = 320 }, + { itemName = "white pearl", clientId = 3026, buy = 320, sell = 160 }, { itemName = "white silk flower", clientId = 34008, sell = 9000 }, } diff --git a/data-otservbr-global/npc/oiriz.lua b/data-otservbr-global/npc/oiriz.lua index 4b731c015a2..84fb1619bda 100644 --- a/data-otservbr-global/npc/oiriz.lua +++ b/data-otservbr-global/npc/oiriz.lua @@ -116,7 +116,7 @@ npcConfig.shop = { { itemName = "unicorn figurine", clientId = 30054, sell = 50000 }, { itemName = "violet crystal shard", clientId = 16120, sell = 1500 }, { itemName = "wedding ring", clientId = 3004, buy = 990 }, - { itemName = "white pearl", clientId = 3026, buy = 320 }, + { itemName = "white pearl", clientId = 3026, buy = 320, sell = 160 }, { itemName = "white silk flower", clientId = 34008, sell = 9000 }, } diff --git a/data-otservbr-global/npc/tesha.lua b/data-otservbr-global/npc/tesha.lua index 6a3c4b9fadb..d204656baed 100644 --- a/data-otservbr-global/npc/tesha.lua +++ b/data-otservbr-global/npc/tesha.lua @@ -140,7 +140,7 @@ npcConfig.shop = { { itemName = "watermelon tourmaline", clientId = 33780, sell = 230000 }, { itemName = "wedding ring", clientId = 3004, buy = 990 }, { itemName = "white silk flower", clientId = 34008, sell = 9000 }, - { itemName = "white pearl", clientId = 3026, buy = 320 }, + { itemName = "white pearl", clientId = 3026, buy = 320, sell = 160 }, } -- On buy npc shop message npcType.onBuyItem = function(npc, player, itemId, subType, amount, ignore, inBackpacks, totalCost) diff --git a/data-otservbr-global/npc/tezila.lua b/data-otservbr-global/npc/tezila.lua index fe667133ad7..f4d8cbafe44 100644 --- a/data-otservbr-global/npc/tezila.lua +++ b/data-otservbr-global/npc/tezila.lua @@ -115,7 +115,7 @@ npcConfig.shop = { { itemName = "unicorn figurine", clientId = 30054, sell = 50000 }, { itemName = "violet crystal shard", clientId = 16120, sell = 1500 }, { itemName = "wedding ring", clientId = 3004, buy = 990 }, - { itemName = "white pearl", clientId = 3026, buy = 320 }, + { itemName = "white pearl", clientId = 3026, buy = 320, sell = 160 }, { itemName = "white silk flower", clientId = 34008, sell = 9000 }, } diff --git a/data-otservbr-global/npc/yonan.lua b/data-otservbr-global/npc/yonan.lua index 69bddee5cb3..1b85ecc7c17 100644 --- a/data-otservbr-global/npc/yonan.lua +++ b/data-otservbr-global/npc/yonan.lua @@ -87,7 +87,7 @@ npcConfig.shop = { { itemName = "unicorn figurine", clientId = 30054, sell = 50000 }, { itemName = "violet crystal shard", clientId = 16120, sell = 1500 }, { itemName = "wedding ring", clientId = 3004, buy = 990 }, - { itemName = "white pearl", clientId = 3026, buy = 320 }, + { itemName = "white pearl", clientId = 3026, buy = 320, sell = 160 }, { itemName = "white silk flower", clientId = 34008, sell = 9000 }, } diff --git a/data-otservbr-global/npc/zoltan.lua b/data-otservbr-global/npc/zoltan.lua index 1dbdad4d07a..9d783dd0441 100644 --- a/data-otservbr-global/npc/zoltan.lua +++ b/data-otservbr-global/npc/zoltan.lua @@ -62,7 +62,7 @@ local function creatureSayCallback(npc, creature, type, message) if MsgContains(message, "yenny the gentle") then npcHandler:say("Ah, Yenny the Gentle was one of the founders of the druid order called Crunor's Caress, that has been originated in her hometown Carlin.", npc, creature) npcHandler:setTopic(playerId, 0) - elseif MsgContains(message, "crunors caress") then + elseif MsgContains(message, "crunor's caress") then if player:getStorageValue(Storage.Quest.U7_24.TheParadoxTower.TheFearedHugo) == 1 then -- Questlog: The Feared Hugo (Padreia) player:setStorageValue(Storage.Quest.U7_24.TheParadoxTower.TheFearedHugo, 2) From f2dc17f526b0577812559865844f89541038c1ef Mon Sep 17 00:00:00 2001 From: ConsKrypt <5482028+ImConsKrypt@users.noreply.github.com> Date: Fri, 26 Jul 2024 07:22:16 +1000 Subject: [PATCH 07/16] fix: looktype and setkv talkactions (#2708) --- data/scripts/talkactions/gm/looktype.lua | 21 ++++++++++++++------- data/scripts/talkactions/god/manage_kv.lua | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/data/scripts/talkactions/gm/looktype.lua b/data/scripts/talkactions/gm/looktype.lua index 28662a54f93..30a9957ee38 100644 --- a/data/scripts/talkactions/gm/looktype.lua +++ b/data/scripts/talkactions/gm/looktype.lua @@ -373,15 +373,22 @@ function looktype.onSay(player, words, param) return true end - local lookType = tonumber(param) - if lookType >= 0 and lookType < 1469 and not table.contains(invalidTypes, lookType) then - local playerOutfit = player:getOutfit() - playerOutfit.lookType = lookType - player:setOutfit(playerOutfit) + -- Test if supplied parameter is actually a numerical value to ensure there is no nil value passed. + if param:match("%d") then + local lookType = tonumber(param) + if lookType >= 0 and lookType < 1469 and not table.contains(invalidTypes, lookType) then + local playerOutfit = player:getOutfit() + playerOutfit.lookType = lookType + player:setOutfit(playerOutfit) + else + player:sendCancelMessage("A look type with that id does not exist.") + end + return true else - player:sendCancelMessage("A look type with that id does not exist.") + -- return message if supplied param is not numerical. + player:sendCancelMessage("Looktype must be a numerical value.") + return true end - return true end looktype:separator(" ") diff --git a/data/scripts/talkactions/god/manage_kv.lua b/data/scripts/talkactions/god/manage_kv.lua index d4c7f104c10..4d11a32d943 100644 --- a/data/scripts/talkactions/god/manage_kv.lua +++ b/data/scripts/talkactions/god/manage_kv.lua @@ -16,7 +16,7 @@ get:register() local set = TalkAction("/setkv") function set.onSay(player, words, param) - local key, value = string.splitFirst(param, " ") + local key, value = string.splitFirst(param, ",") -- With a space some KV's are not able to be edited due to spaces within the key names, changed to a comma (,) to overcome this issue value = load("return " .. value)() kv.set(key, value) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "kv[" .. key .. "] = " .. PrettyString(value)) From bbcb95ea004f5530f3bb8803c86e6a1770415c4b Mon Sep 17 00:00:00 2001 From: PEDRO HENRIQUE FRANCHI KAGUE Date: Thu, 25 Jul 2024 18:25:37 -0300 Subject: [PATCH 08/16] fix: hirelings save (#2723) --- data/libs/systems/hireling.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/libs/systems/hireling.lua b/data/libs/systems/hireling.lua index 30134cd7cd0..75005a1adfc 100644 --- a/data/libs/systems/hireling.lua +++ b/data/libs/systems/hireling.lua @@ -312,7 +312,7 @@ function Hireling:save() sql = sql .. " WHERE `id`=" .. tostring(self.id) - db.query(sql) + return db.query(sql) end function Hireling:spawn() @@ -390,7 +390,7 @@ function SaveHirelings() local failedCount = 0 for _, hireling in ipairs(HIRELINGS) do - local success = hireling:save() + local success = hireling:save() or false if not success then failedCount = failedCount + 1 From 14d7b45a5beb548cc5e198d31c6f2f38f5f61ab9 Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Fri, 26 Jul 2024 10:08:33 -0300 Subject: [PATCH 09/16] fix: setHouseOwner in server initialization and Husky occurrence (#2762) --- data-otservbr-global/monster/mammals/husky.lua | 2 +- data/scripts/globalevents/server_initialization.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data-otservbr-global/monster/mammals/husky.lua b/data-otservbr-global/monster/mammals/husky.lua index dae58bcc664..cb4398fc9e0 100644 --- a/data-otservbr-global/monster/mammals/husky.lua +++ b/data-otservbr-global/monster/mammals/husky.lua @@ -26,7 +26,7 @@ monster.Bestiary = { SecondUnlock = 10, CharmsPoints = 1, Stars = 0, - Occurence = 1, + Occurrence = 1, Locations = "Svargrond and Nibelor.", } diff --git a/data/scripts/globalevents/server_initialization.lua b/data/scripts/globalevents/server_initialization.lua index 97478582fc8..df29660d373 100644 --- a/data/scripts/globalevents/server_initialization.lua +++ b/data/scripts/globalevents/server_initialization.lua @@ -39,7 +39,7 @@ local function processHouseAuctions() local lastBid = Result.getNumber(resultId, "last_bid") if balance >= lastBid then db.query("UPDATE `players` SET `balance` = " .. (balance - lastBid) .. " WHERE `id` = " .. highestBidder) - house:setOwnerGuid(highestBidder) + house:setHouseOwner(highestBidder) end db.asyncQuery("UPDATE `houses` SET `last_bid` = 0, `bid_end` = 0, `highest_bidder` = 0, `bid` = 0 " .. "WHERE `id` = " .. house:getId()) From 2401aed11426158c7919a843e18fbbdd37f993b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Lu=C3=ADs=20Lucarelo=20Lamonato?= Date: Fri, 26 Jul 2024 10:10:27 -0300 Subject: [PATCH 10/16] fix: incorrect price in NPC Khanna (#2773) --- data-otservbr-global/npc/khanna.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-otservbr-global/npc/khanna.lua b/data-otservbr-global/npc/khanna.lua index 156a827f455..76b5c1e70da 100644 --- a/data-otservbr-global/npc/khanna.lua +++ b/data-otservbr-global/npc/khanna.lua @@ -103,7 +103,7 @@ local itemsTable = { { itemName = "goanna meat", clientId = 31560, sell = 190 }, { itemName = "lamassu hoof", clientId = 31441, sell = 330 }, { itemName = "lamassu horn", clientId = 31442, sell = 240 }, - { itemName = "life crystal", clientId = 3061, sell = 75 }, + { itemName = "life crystal", clientId = 3061, sell = 85 }, { itemName = "lizard heart", clientId = 31340, sell = 530 }, { itemName = "manticore ear", clientId = 31440, sell = 310 }, { itemName = "manticore tail", clientId = 31439, sell = 220 }, From 3f595e354d2860f9e03d402068eab7758c82df7e Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Fri, 26 Jul 2024 10:35:45 -0300 Subject: [PATCH 11/16] fix: bestiary occurrence (#2763) If the occurrence is at maximum level (3), the icon should appear. --- src/server/network/protocol/protocolgame.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index c67cee710a8..4c17b20965f 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -2962,6 +2962,7 @@ void ProtocolGame::parseBestiarysendCreatures(NetworkMessage &msg) { newmsg.add(raceid_); uint8_t progress = 0; + uint8_t occurrence = 0; for (const auto &_it : creaturesKilled) { if (_it.first == raceid_) { const auto tmpType = g_monsters().getMonsterType(it_.second); @@ -2969,11 +2970,13 @@ void ProtocolGame::parseBestiarysendCreatures(NetworkMessage &msg) { return; } progress = g_iobestiary().getKillStatus(tmpType, _it.second); + occurrence = tmpType->info.bestiaryOccurrence; } } if (progress > 0) { - newmsg.add(static_cast(progress)); + newmsg.addByte(progress); + newmsg.addByte(occurrence); } else { newmsg.addByte(0); } From 7a14bad57a31e7f7a92435ad9ff7eb534046f8d1 Mon Sep 17 00:00:00 2001 From: Davi Alves Bezerra Date: Fri, 26 Jul 2024 10:42:01 -0300 Subject: [PATCH 12/16] feat: talkactions description (#2766) Implement the use of the setDescription and getDescription methods in the talkactions lua scripts. --- .../scripts/talkactions/god/inbox_command.lua | 1 + data/scripts/talkactions/player/commands.lua | 13 +++++++-- src/lua/creature/talkaction.hpp | 9 +++++++ .../events/talk_action_functions.cpp | 27 +++++++++++++++++++ .../events/talk_action_functions.hpp | 4 +++ 5 files changed, 52 insertions(+), 2 deletions(-) diff --git a/data/scripts/talkactions/god/inbox_command.lua b/data/scripts/talkactions/god/inbox_command.lua index a080a237027..e4de2af4a81 100644 --- a/data/scripts/talkactions/god/inbox_command.lua +++ b/data/scripts/talkactions/god/inbox_command.lua @@ -32,5 +32,6 @@ function inboxCommand.onSay(player, words, param) end inboxCommand:separator(" ") +inboxCommand:setDescription("[Usage]: /inbox {PlayerName},{add|remove},{itemId}") inboxCommand:groupType("god") inboxCommand:register() diff --git a/data/scripts/talkactions/player/commands.lua b/data/scripts/talkactions/player/commands.lua index 8d374f47742..2ad2ec23bfa 100644 --- a/data/scripts/talkactions/player/commands.lua +++ b/data/scripts/talkactions/player/commands.lua @@ -4,12 +4,20 @@ function commands.onSay(player, words, param) local allTalkActions = Game.getTalkActions() local playerGroupId = player:getGroup():getId() - local text = "Available commands:\n" + local text = "Available commands:\n\n" for _, talkaction in pairs(allTalkActions) do if talkaction:getGroupType() ~= 0 then if talkaction:getGroupType() <= playerGroupId then - text = text .. talkaction:getName() .. "\n" + text = text .. talkaction:getName() + + description = talkaction:getDescription() + + if description ~= "" then + text = text .. " " .. talkaction:getDescription() + end + + text = text .. "\n\n" end end end @@ -19,5 +27,6 @@ function commands.onSay(player, words, param) return true end +commands:setDescription("[Usage]: !commands to see each command with its description") commands:groupType("normal") commands:register() diff --git a/src/lua/creature/talkaction.hpp b/src/lua/creature/talkaction.hpp index ec68539850c..d4fd6165459 100644 --- a/src/lua/creature/talkaction.hpp +++ b/src/lua/creature/talkaction.hpp @@ -36,6 +36,14 @@ class TalkAction : public Script { } } + const std::string &getDescription() const { + return m_description; + } + + void setDescription(const std::string &stringDescription) { + m_description = stringDescription; + } + std::string getSeparator() const { return separator; } @@ -56,6 +64,7 @@ class TalkAction : public Script { } std::string m_word; + std::string m_description; std::string separator = "\""; uint8_t m_groupType = 0; }; diff --git a/src/lua/functions/events/talk_action_functions.cpp b/src/lua/functions/events/talk_action_functions.cpp index 8618cc3c4a3..559e251eb8e 100644 --- a/src/lua/functions/events/talk_action_functions.cpp +++ b/src/lua/functions/events/talk_action_functions.cpp @@ -144,6 +144,33 @@ int TalkActionFunctions::luaTalkActionGetName(lua_State* L) { return 1; } +int TalkActionFunctions::luaTalkActionGetDescription(lua_State* L) { + // local description = talkAction:getDescription() + const auto talkactionSharedPtr = getUserdataShared(L, 1); + if (!talkactionSharedPtr) { + reportErrorFunc(getErrorDesc(LUA_ERROR_TALK_ACTION_NOT_FOUND)); + pushBoolean(L, false); + return 1; + } + + pushString(L, talkactionSharedPtr->getDescription()); + return 1; +} + +int TalkActionFunctions::luaTalkActionSetDescription(lua_State* L) { + // local description = talkAction:setDescription() + auto talkactionSharedPtr = getUserdataShared(L, 1); + if (!talkactionSharedPtr) { + reportErrorFunc(getErrorDesc(LUA_ERROR_TALK_ACTION_NOT_FOUND)); + pushBoolean(L, false); + return 1; + } + + talkactionSharedPtr->setDescription(getString(L, 2)); + pushBoolean(L, true); + return 1; +} + int TalkActionFunctions::luaTalkActionGetGroupType(lua_State* L) { // local groupType = talkAction:getGroupType() const auto talkactionSharedPtr = getUserdataShared(L, 1); diff --git a/src/lua/functions/events/talk_action_functions.hpp b/src/lua/functions/events/talk_action_functions.hpp index 6b2bc9b7a20..384688b4722 100644 --- a/src/lua/functions/events/talk_action_functions.hpp +++ b/src/lua/functions/events/talk_action_functions.hpp @@ -20,6 +20,8 @@ class TalkActionFunctions final : LuaScriptInterface { registerMethod(L, "TalkAction", "register", TalkActionFunctions::luaTalkActionRegister); registerMethod(L, "TalkAction", "separator", TalkActionFunctions::luaTalkActionSeparator); registerMethod(L, "TalkAction", "getName", TalkActionFunctions::luaTalkActionGetName); + registerMethod(L, "TalkAction", "getDescription", TalkActionFunctions::luaTalkActionGetDescription); + registerMethod(L, "TalkAction", "setDescription", TalkActionFunctions::luaTalkActionSetDescription); registerMethod(L, "TalkAction", "getGroupType", TalkActionFunctions::luaTalkActionGetGroupType); } @@ -30,5 +32,7 @@ class TalkActionFunctions final : LuaScriptInterface { static int luaTalkActionRegister(lua_State* L); static int luaTalkActionSeparator(lua_State* L); static int luaTalkActionGetName(lua_State* L); + static int luaTalkActionGetDescription(lua_State* L); + static int luaTalkActionSetDescription(lua_State* L); static int luaTalkActionGetGroupType(lua_State* L); }; From c6d5eb1c552727192dd0a4757069f7c50e4ab939 Mon Sep 17 00:00:00 2001 From: Marco Date: Fri, 26 Jul 2024 11:10:47 -0300 Subject: [PATCH 13/16] refactor: concoctions to core (#2769) --- data-otservbr-global/lib/core/storages.lua | 85 ------------------- data/libs/core/global_storage.lua | 85 +++++++++++++++++++ .../scripts/systems}/concoctions.lua | 4 +- 3 files changed, 87 insertions(+), 87 deletions(-) rename {data-otservbr-global/scripts/actions/tibiadrome => data/scripts/systems}/concoctions.lua (94%) diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 56e940c059a..fa7537eeb3c 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -2717,91 +2717,6 @@ Storage = { TibiorasBox = 63977, }, - -- Reserved storage from 64000 - 64099 - TibiaDrome = { - -- General Upgrades - BestiaryBetterment = { - TimeLeft = 64000, - LastActivatedAt = 64001, - }, - CharmUpgrade = { - TimeLeft = 64002, - LastActivatedAt = 64003, - }, - KooldownAid = { - LastActivatedAt = 64005, - }, - StaminaExtension = { - LastActivatedAt = 64007, - }, - StrikeEnhancement = { - TimeLeft = 64008, - LastActivatedAt = 64009, - }, - WealthDuplex = { - TimeLeft = 64010, - LastActivatedAt = 64011, - }, - -- Resilience - FireResilience = { - TimeLeft = 64012, - LastActivatedAt = 64013, - }, - IceResilience = { - TimeLeft = 64014, - LastActivatedAt = 64015, - }, - EarthResilience = { - TimeLeft = 64016, - LastActivatedAt = 64017, - }, - EnergyResilience = { - TimeLeft = 64018, - LastActivatedAt = 64019, - }, - HolyResilience = { - TimeLeft = 64020, - LastActivatedAt = 64021, - }, - DeathResilience = { - TimeLeft = 64022, - LastActivatedAt = 64023, - }, - PhysicalResilience = { - TimeLeft = 64024, - LastActivatedAt = 64025, - }, - -- Amplifications - FireAmplification = { - TimeLeft = 64026, - LastActivatedAt = 64027, - }, - IceAmplification = { - TimeLeft = 64028, - LastActivatedAt = 64029, - }, - EarthAmplification = { - TimeLeft = 64030, - LastActivatedAt = 64031, - }, - EnergyAmplification = { - TimeLeft = 64032, - LastActivatedAt = 64033, - }, - HolyAmplification = { - TimeLeft = 64034, - LastActivatedAt = 64035, - }, - DeathAmplification = { - TimeLeft = 64036, - LastActivatedAt = 64037, - }, - PhysicalAmplification = { - TimeLeft = 64038, - LastActivatedAt = 64039, - }, - }, - VipSystem = { OnlineCoinsGain = 150002, OnlineTokensGain = 150003, diff --git a/data/libs/core/global_storage.lua b/data/libs/core/global_storage.lua index cfca535dc4b..9c69322c6fd 100644 --- a/data/libs/core/global_storage.lua +++ b/data/libs/core/global_storage.lua @@ -26,5 +26,90 @@ Global = { FamiliarSummonEvent10 = 30054, FamiliarSummonEvent60 = 30055, CobraFlask = 30056, + + -- Reserved storage from 64000 - 64099 + TibiaDrome = { + -- General Upgrades + BestiaryBetterment = { + TimeLeft = 64000, + LastActivatedAt = 64001, + }, + CharmUpgrade = { + TimeLeft = 64002, + LastActivatedAt = 64003, + }, + KooldownAid = { + LastActivatedAt = 64005, + }, + StaminaExtension = { + LastActivatedAt = 64007, + }, + StrikeEnhancement = { + TimeLeft = 64008, + LastActivatedAt = 64009, + }, + WealthDuplex = { + TimeLeft = 64010, + LastActivatedAt = 64011, + }, + -- Resilience + FireResilience = { + TimeLeft = 64012, + LastActivatedAt = 64013, + }, + IceResilience = { + TimeLeft = 64014, + LastActivatedAt = 64015, + }, + EarthResilience = { + TimeLeft = 64016, + LastActivatedAt = 64017, + }, + EnergyResilience = { + TimeLeft = 64018, + LastActivatedAt = 64019, + }, + HolyResilience = { + TimeLeft = 64020, + LastActivatedAt = 64021, + }, + DeathResilience = { + TimeLeft = 64022, + LastActivatedAt = 64023, + }, + PhysicalResilience = { + TimeLeft = 64024, + LastActivatedAt = 64025, + }, + -- Amplifications + FireAmplification = { + TimeLeft = 64026, + LastActivatedAt = 64027, + }, + IceAmplification = { + TimeLeft = 64028, + LastActivatedAt = 64029, + }, + EarthAmplification = { + TimeLeft = 64030, + LastActivatedAt = 64031, + }, + EnergyAmplification = { + TimeLeft = 64032, + LastActivatedAt = 64033, + }, + HolyAmplification = { + TimeLeft = 64034, + LastActivatedAt = 64035, + }, + DeathAmplification = { + TimeLeft = 64036, + LastActivatedAt = 64037, + }, + PhysicalAmplification = { + TimeLeft = 64038, + LastActivatedAt = 64039, + }, + }, }, } diff --git a/data-otservbr-global/scripts/actions/tibiadrome/concoctions.lua b/data/scripts/systems/concoctions.lua similarity index 94% rename from data-otservbr-global/scripts/actions/tibiadrome/concoctions.lua rename to data/scripts/systems/concoctions.lua index fe17dfef06b..6449df9974c 100644 --- a/data-otservbr-global/scripts/actions/tibiadrome/concoctions.lua +++ b/data/scripts/systems/concoctions.lua @@ -40,8 +40,8 @@ local configs = { for concoctionKey, concoctionId in pairs(Concoction.Ids) do Concoction.new({ id = concoctionId, - timeLeftStorage = Storage.TibiaDrome[concoctionKey].TimeLeft, - lastActivatedAtStorage = Storage.TibiaDrome[concoctionKey].LastActivatedAt, + timeLeftStorage = Global.Storage.TibiaDrome[concoctionKey].TimeLeft, + lastActivatedAtStorage = Global.Storage.TibiaDrome[concoctionKey].LastActivatedAt, config = configs[concoctionId] or {}, }):register() end From 1a6dac462fa34ab19ad7204aa9716a4e9d9e3e8b Mon Sep 17 00:00:00 2001 From: Renato Machado Date: Fri, 26 Jul 2024 14:51:05 -0300 Subject: [PATCH 14/16] perf: pathfinder refactor (#2729) --- src/creatures/combat/combat.cpp | 3 +- src/creatures/combat/condition.cpp | 6 +- src/creatures/combat/condition.hpp | 2 +- src/creatures/creature.cpp | 20 +- src/creatures/creature.hpp | 6 +- src/creatures/monsters/monster.cpp | 4 +- src/creatures/npcs/npc.cpp | 2 +- src/creatures/players/player.cpp | 4 +- src/game/game.cpp | 60 ++-- src/game/scheduling/task.hpp | 50 ++- .../creatures/creature_functions.cpp | 2 +- src/lua/functions/map/position_functions.cpp | 2 +- src/map/map.cpp | 276 ++++++++++++++--- src/map/map.hpp | 8 +- src/map/utils/astarnodes.cpp | 286 +++++++++++++----- src/map/utils/astarnodes.hpp | 22 +- src/server/network/protocol/protocolgame.cpp | 27 +- 17 files changed, 559 insertions(+), 221 deletions(-) diff --git a/src/creatures/combat/combat.cpp b/src/creatures/combat/combat.cpp index 91ff712de4c..8e3de0da1bd 100644 --- a/src/creatures/combat/combat.cpp +++ b/src/creatures/combat/combat.cpp @@ -937,7 +937,8 @@ void Combat::addDistanceEffect(std::shared_ptr caster, const Position void Combat::doChainEffect(const Position &origin, const Position &dest, uint8_t effect) { if (effect > 0) { - stdext::arraylist dirList(128); + std::vector dirList; + FindPathParams fpp; fpp.minTargetDist = 0; fpp.maxTargetDist = 1; diff --git a/src/creatures/combat/condition.cpp b/src/creatures/combat/condition.cpp index b9603d010a2..34db29dcd4a 100644 --- a/src/creatures/combat/condition.cpp +++ b/src/creatures/combat/condition.cpp @@ -1926,7 +1926,7 @@ bool ConditionFeared::getFleeDirection(std::shared_ptr creature) { return false; } -bool ConditionFeared::getFleePath(std::shared_ptr creature, const Position &pos, stdext::arraylist &dirList) { +bool ConditionFeared::getFleePath(std::shared_ptr creature, const Position &pos, std::vector &dirList) { const std::vector walkSize { 15, 9, 3, 1 }; bool found = false; std::ptrdiff_t found_size = 0; @@ -2029,7 +2029,7 @@ bool ConditionFeared::startCondition(std::shared_ptr creature) { bool ConditionFeared::executeCondition(std::shared_ptr creature, int32_t interval) { Position currentPos = creature->getPosition(); - stdext::arraylist listDir(128); + std::vector listDir; g_logger().debug("[ConditionFeared::executeCondition] Executing condition, current position is {}", currentPos.toString()); @@ -2039,7 +2039,7 @@ bool ConditionFeared::executeCondition(std::shared_ptr creature, int32 } if (getFleePath(creature, currentPos, listDir)) { - g_dispatcher().addEvent([id = creature->getID(), listDir = listDir.data()] { + g_dispatcher().addEvent([id = creature->getID(), listDir] { g_game().forcePlayerAutoWalk(id, listDir); }, "ConditionFeared::executeCondition"); diff --git a/src/creatures/combat/condition.hpp b/src/creatures/combat/condition.hpp index 07b31b42d15..2b28029bcef 100644 --- a/src/creatures/combat/condition.hpp +++ b/src/creatures/combat/condition.hpp @@ -333,7 +333,7 @@ class ConditionFeared final : public Condition { private: bool canWalkTo(std::shared_ptr creature, Position pos, Direction moveDirection) const; bool getFleeDirection(std::shared_ptr creature); - bool getFleePath(std::shared_ptr creature, const Position &pos, stdext::arraylist &dirList); + bool getFleePath(std::shared_ptr creature, const Position &pos, std::vector &dirList); bool getRandomDirection(std::shared_ptr creature, Position pos); bool isStuck(std::shared_ptr creature, Position pos) const; diff --git a/src/creatures/creature.cpp b/src/creatures/creature.cpp index e3474ab2436..94795669561 100644 --- a/src/creatures/creature.cpp +++ b/src/creatures/creature.cpp @@ -213,8 +213,8 @@ bool Creature::getNextStep(Direction &dir, uint32_t &) { return false; } - dir = listWalkDir.front(); - listWalkDir.pop_front(); + dir = listWalkDir.back(); + listWalkDir.pop_back(); onWalk(dir); return true; } @@ -814,7 +814,6 @@ bool Creature::dropCorpse(std::shared_ptr lastHitCreature, std::shared player->sendLootMessage(lootMessage.str()); } - stdext::arraylist dirList(128); FindPathParams fpp; fpp.minTargetDist = 0; fpp.maxTargetDist = 1; @@ -822,6 +821,7 @@ bool Creature::dropCorpse(std::shared_ptr lastHitCreature, std::shared fpp.clearSight = true; fpp.maxSearchDist = 0; + std::vector dirList; auto isReachable = g_game().map.getPathMatching(player->getPosition(), dirList, FrozenPathingConditionCall(corpse->getPosition()), fpp); if (player->checkAutoLoot(monster->isRewardBoss()) && isReachable) { @@ -1078,7 +1078,8 @@ void Creature::goToFollowCreature() { } bool executeOnFollow = true; - stdext::arraylist listDir(128); + std::vector listDir; + listDir.reserve(128); FindPathParams fpp; getPathSearchParams(followCreature, fpp); @@ -1101,7 +1102,7 @@ void Creature::goToFollowCreature() { hasFollowPath = getPathTo(followCreature->getPosition(), listDir, fpp); } - startAutoWalk(listDir.data()); + startAutoWalk(listDir); if (executeOnFollow) { onFollowCreatureComplete(followCreature); @@ -1737,12 +1738,15 @@ bool Creature::isInvisible() const { != conditions.end(); } -bool Creature::getPathTo(const Position &targetPos, stdext::arraylist &dirList, const FindPathParams &fpp) { +bool Creature::getPathTo(const Position &targetPos, std::vector &dirList, const FindPathParams &fpp) { metrics::method_latency measure(__METHOD_NAME__); - return g_game().map.getPathMatching(getCreature(), dirList, FrozenPathingConditionCall(targetPos), fpp); + if (fpp.maxSearchDist != 0 || fpp.keepDistance) { + return g_game().map.getPathMatchingCond(getCreature(), targetPos, dirList, FrozenPathingConditionCall(targetPos), fpp); + } + return g_game().map.getPathMatching(getCreature(), targetPos, dirList, FrozenPathingConditionCall(targetPos), fpp); } -bool Creature::getPathTo(const Position &targetPos, stdext::arraylist &dirList, int32_t minTargetDist, int32_t maxTargetDist, bool fullPathSearch /*= true*/, bool clearSight /*= true*/, int32_t maxSearchDist /*= 7*/) { +bool Creature::getPathTo(const Position &targetPos, std::vector &dirList, int32_t minTargetDist, int32_t maxTargetDist, bool fullPathSearch /*= true*/, bool clearSight /*= true*/, int32_t maxSearchDist /*= 7*/) { FindPathParams fpp; fpp.fullPathSearch = fullPathSearch; fpp.maxSearchDist = maxSearchDist; diff --git a/src/creatures/creature.hpp b/src/creatures/creature.hpp index edf2fa55b74..138e8b364c8 100644 --- a/src/creatures/creature.hpp +++ b/src/creatures/creature.hpp @@ -584,8 +584,8 @@ class Creature : virtual public Thing, public SharedObject { double getDamageRatio(std::shared_ptr attacker) const; - bool getPathTo(const Position &targetPos, stdext::arraylist &dirList, const FindPathParams &fpp); - bool getPathTo(const Position &targetPos, stdext::arraylist &dirList, int32_t minTargetDist, int32_t maxTargetDist, bool fullPathSearch = true, bool clearSight = true, int32_t maxSearchDist = 7); + bool getPathTo(const Position &targetPos, std::vector &dirList, const FindPathParams &fpp); + bool getPathTo(const Position &targetPos, std::vector &dirList, int32_t minTargetDist, int32_t maxTargetDist, bool fullPathSearch = true, bool clearSight = true, int32_t maxSearchDist = 7); struct CountBlock_t { int32_t total; @@ -720,7 +720,7 @@ class Creature : virtual public Thing, public SharedObject { CreatureEventList eventsList; ConditionList conditions; - std::deque listWalkDir; + std::vector listWalkDir; std::weak_ptr m_tile; std::weak_ptr m_attackedCreature; diff --git a/src/creatures/monsters/monster.cpp b/src/creatures/monsters/monster.cpp index 4b993cbab0e..575ee321914 100644 --- a/src/creatures/monsters/monster.cpp +++ b/src/creatures/monsters/monster.cpp @@ -1257,12 +1257,12 @@ void Monster::doWalkBack(uint32_t &flags, Direction &nextDirection, bool &result return; } - stdext::arraylist listDir(128); + std::vector listDir; if (!getPathTo(masterPos, listDir, 0, std::max(0, distance - 5), true, true, distance)) { isWalkingBack = false; return; } - startAutoWalk(listDir.data()); + startAutoWalk(listDir); } } diff --git a/src/creatures/npcs/npc.cpp b/src/creatures/npcs/npc.cpp index fdbf58853b4..18ca0dd0758 100644 --- a/src/creatures/npcs/npc.cpp +++ b/src/creatures/npcs/npc.cpp @@ -522,7 +522,7 @@ void Npc::onThinkWalk(uint32_t interval) { if (Direction newDirection; getRandomStep(newDirection)) { - listWalkDir.push_front(newDirection); + listWalkDir.emplace_back(newDirection); addEventWalk(); } diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index a6db39f587d..c2d8c7a8c70 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -7818,9 +7818,9 @@ SoundEffect_t Player::getAttackSoundEffect() const { bool Player::canAutoWalk(const Position &toPosition, const std::function &function, uint32_t delay /* = 500*/) { if (!Position::areInRange<1, 1>(getPosition(), toPosition)) { // Check if can walk to the toPosition and send event to use function - stdext::arraylist listDir(128); + std::vector listDir; if (getPathTo(toPosition, listDir, 0, 1, true, true)) { - g_dispatcher().addEvent([creatureId = getID(), dirs = listDir.data()] { g_game().playerAutoWalk(creatureId, dirs); }, __FUNCTION__); + g_dispatcher().addEvent([creatureId = getID(), listDir] { g_game().playerAutoWalk(creatureId, listDir); }, __FUNCTION__); std::shared_ptr task = createPlayerTask(delay, function, __FUNCTION__); setNextWalkActionTask(task); diff --git a/src/game/game.cpp b/src/game/game.cpp index b353537cf0c..8cc6754392c 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -1405,9 +1405,9 @@ void Game::playerMoveCreature(std::shared_ptr player, std::shared_ptr(movingCreatureOrigPos, player->getPosition())) { // need to walk to the creature first before moving it - stdext::arraylist listDir(128); + std::vector listDir; if (player->getPathTo(movingCreatureOrigPos, listDir, 0, 1, true, true)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); const auto &task = createPlayerTask( 600, [this, player, movingCreature, toTile, movingCreatureOrigPos] { playerMoveCreatureByID(player->getID(), movingCreature->getID(), movingCreatureOrigPos, toTile->getPosition()); }, "Game::playerMoveCreatureByID" ); @@ -1694,9 +1694,9 @@ void Game::playerMoveItem(std::shared_ptr player, const Position &fromPo if (!Position::areInRange<1, 1>(playerPos, mapFromPos)) { // need to walk to the item first before using it - stdext::arraylist listDir(128); + std::vector listDir; if (player->getPathTo(item->getPosition(), listDir, 0, 1, true, true)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); std::shared_ptr task = createPlayerTask( 400, [this, playerId = player->getID(), fromPos, itemId, fromStackPos, toPos, count] { @@ -1756,9 +1756,9 @@ void Game::playerMoveItem(std::shared_ptr player, const Position &fromPo internalGetPosition(moveItem, itemPos, itemStackPos); } - stdext::arraylist listDir(128); + std::vector listDir; if (player->getPathTo(walkPos, listDir, 0, 0, true, true)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); std::shared_ptr task = createPlayerTask( 400, [this, playerId = player->getID(), itemPos, itemId, itemStackPos, toPos, count] { @@ -3681,9 +3681,9 @@ void Game::playerUseItemEx(uint32_t playerId, const Position &fromPos, uint8_t f internalGetPosition(moveItem, itemPos, itemStackPos); } - stdext::arraylist listDir(128); + std::vector listDir; if (player->getPathTo(walkToPos, listDir, 0, 1, true, true)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); std::shared_ptr task = createPlayerTask( 400, [this, playerId, itemPos, itemStackPos, fromItemId, toPos, toStackPos, toItemId] { playerUseItemEx(playerId, itemPos, itemStackPos, fromItemId, toPos, toStackPos, toItemId); }, "Game::playerUseItemEx" @@ -3795,9 +3795,9 @@ void Game::playerUseItem(uint32_t playerId, const Position &pos, uint8_t stackPo ReturnValue ret = g_actions().canUse(player, pos); if (ret != RETURNVALUE_NOERROR) { if (ret == RETURNVALUE_TOOFARAWAY) { - stdext::arraylist listDir(128); + std::vector listDir; if (player->getPathTo(pos, listDir, 0, 1, true, true)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); std::shared_ptr task = createPlayerTask( 400, [this, playerId, pos, stackPos, index, itemId] { playerUseItem(playerId, pos, stackPos, index, itemId); }, "Game::playerUseItem" @@ -3952,9 +3952,9 @@ void Game::playerUseWithCreature(uint32_t playerId, const Position &fromPos, uin internalGetPosition(moveItem, itemPos, itemStackPos); } - stdext::arraylist listDir(128); + std::vector listDir; if (player->getPathTo(walkToPos, listDir, 0, 1, true, true)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); std::shared_ptr task = createPlayerTask( 400, [this, playerId, itemPos, itemStackPos, creatureId, itemId] { @@ -4113,9 +4113,9 @@ void Game::playerRotateItem(uint32_t playerId, const Position &pos, uint8_t stac } if (pos.x != 0xFFFF && !Position::areInRange<1, 1, 0>(pos, player->getPosition())) { - stdext::arraylist listDir(128); + std::vector listDir; if (player->getPathTo(pos, listDir, 0, 1, true, true)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); std::shared_ptr task = createPlayerTask( 400, [this, playerId, pos, stackPos, itemId] { @@ -4169,9 +4169,9 @@ void Game::playerConfigureShowOffSocket(uint32_t playerId, const Position &pos, bool isPodiumOfRenown = itemId == ITEM_PODIUM_OF_RENOWN1 || itemId == ITEM_PODIUM_OF_RENOWN2; if (!Position::areInRange<1, 1, 0>(pos, player->getPosition())) { - stdext::arraylist listDir(128); + std::vector listDir; if (player->getPathTo(pos, listDir, 0, 1, true, false)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); std::shared_ptr task; if (isPodiumOfRenown) { task = createPlayerTask( @@ -4230,9 +4230,9 @@ void Game::playerSetShowOffSocket(uint32_t playerId, Outfit_t &outfit, const Pos } if (!Position::areInRange<1, 1, 0>(pos, player->getPosition())) { - stdext::arraylist listDir(128); + std::vector listDir; if (player->getPathTo(pos, listDir, 0, 1, true, false)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); std::shared_ptr task = createPlayerTask( 400, [this, playerId, pos] { playerBrowseField(playerId, pos); }, "Game::playerBrowseField" ); @@ -4371,9 +4371,9 @@ void Game::playerWrapableItem(uint32_t playerId, const Position &pos, uint8_t st } if (pos.x != 0xFFFF && !Position::areInRange<1, 1, 0>(pos, player->getPosition())) { - stdext::arraylist listDir(128); + std::vector listDir; if (player->getPathTo(pos, listDir, 0, 1, true, true)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); std::shared_ptr task = createPlayerTask( 400, [this, playerId, pos, stackPos, itemId] { playerWrapableItem(playerId, pos, stackPos, itemId); }, "Game::playerWrapableItem" @@ -4552,9 +4552,9 @@ void Game::playerBrowseField(uint32_t playerId, const Position &pos) { } if (!Position::areInRange<1, 1>(playerPos, pos)) { - stdext::arraylist listDir(128); + std::vector listDir; if (player->getPathTo(pos, listDir, 0, 1, true, true)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); std::shared_ptr task = createPlayerTask( 400, [this, playerId, pos] { playerBrowseField(playerId, pos); }, "Game::playerBrowseField" ); @@ -4815,9 +4815,9 @@ void Game::playerRequestTrade(uint32_t playerId, const Position &pos, uint8_t st } if (!Position::areInRange<1, 1>(tradeItemPosition, playerPosition)) { - stdext::arraylist listDir(128); + std::vector listDir; if (player->getPathTo(pos, listDir, 0, 1, true, true)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); std::shared_ptr task = createPlayerTask( 400, [this, playerId, pos, stackPos, tradePlayerId, itemId] { playerRequestTrade(playerId, pos, stackPos, tradePlayerId, itemId); }, "Game::playerRequestTrade" @@ -5394,9 +5394,9 @@ void Game::playerQuickLoot(uint32_t playerId, const Position &pos, uint16_t item if (!autoLoot && pos.x != 0xffff) { if (!Position::areInRange<1, 1, 0>(pos, player->getPosition())) { // need to walk to the corpse first before looting it - stdext::arraylist listDir(128); + std::vector listDir; if (player->getPathTo(pos, listDir, 0, 1, true, true)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); std::shared_ptr task = createPlayerTask( 0, [this, playerId = player->getID(), pos, itemId, stackPos, defaultItem, lootAllCorpses, autoLoot] { playerQuickLoot(playerId, pos, itemId, stackPos, defaultItem, lootAllCorpses, autoLoot); @@ -9486,9 +9486,9 @@ void Game::playerSetMonsterPodium(uint32_t playerId, uint32_t monsterRaceId, con } if (!Position::areInRange<1, 1, 0>(pos, player->getPosition())) { - if (stdext::arraylist listDir(128); + if (std::vector listDir; player->getPathTo(pos, listDir, 0, 1, true, false)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); std::shared_ptr task = createPlayerTask( 400, [this, playerId, pos] { playerBrowseField(playerId, pos); }, "Game::playerBrowseField" ); @@ -9586,9 +9586,9 @@ void Game::playerRotatePodium(uint32_t playerId, const Position &pos, uint8_t st } if (pos.x != 0xFFFF && !Position::areInRange<1, 1, 0>(pos, player->getPosition())) { - if (stdext::arraylist listDir(128); + if (std::vector listDir; player->getPathTo(pos, listDir, 0, 1, true, true)) { - g_dispatcher().addEvent([this, playerId = player->getID(), listDir = listDir.data()] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); + g_dispatcher().addEvent([this, playerId = player->getID(), listDir] { playerAutoWalk(playerId, listDir); }, "Game::playerAutoWalk"); std::shared_ptr task = createPlayerTask( 400, [this, playerId, pos, stackPos, itemId] { playerRotatePodium(playerId, pos, stackPos, itemId); diff --git a/src/game/scheduling/task.hpp b/src/game/scheduling/task.hpp index 7bdc7db8084..9c561b41381 100644 --- a/src/game/scheduling/task.hpp +++ b/src/game/scheduling/task.hpp @@ -69,32 +69,30 @@ class Task { } bool hasTraceableContext() const { - const static auto tasksContext = std::unordered_set({ - "Decay::checkDecay", - "Dispatcher::asyncEvent", - "Game::checkCreatureAttack", - "Game::checkCreatureWalk", - "Game::checkCreatures", - "Game::checkImbuements", - "Game::checkLight", - "Game::createFiendishMonsters", - "Game::createInfluencedMonsters", - "Game::updateCreatureWalk", - "Game::updateForgeableMonsters", - "GlobalEvents::think", - "LuaEnvironment::executeTimerEvent", - "Modules::executeOnRecvbyte", - "OutputMessagePool::sendAll", - "ProtocolGame::addGameTask", - "ProtocolGame::parsePacketFromDispatcher", - "Raids::checkRaids", - "SpawnMonster::checkSpawnMonster", - "SpawnMonster::scheduleSpawn", - "SpawnMonster::startup", - "SpawnNpc::checkSpawnNpc", - "Webhook::run", - "Protocol::sendRecvMessageCallback", - }); + const static auto tasksContext = std::unordered_set({ "Decay::checkDecay", + "Dispatcher::asyncEvent", + "Game::checkCreatureAttack", + "Game::checkCreatureWalk", + "Game::checkCreatures", + "Game::checkImbuements", + "Game::checkLight", + "Game::createFiendishMonsters", + "Game::createInfluencedMonsters", + "Game::updateCreatureWalk", + "Game::updateForgeableMonsters", + "GlobalEvents::think", + "LuaEnvironment::executeTimerEvent", + "Modules::executeOnRecvbyte", + "OutputMessagePool::sendAll", + "ProtocolGame::addGameTask", + "ProtocolGame::parsePacketFromDispatcher", + "Raids::checkRaids", + "SpawnMonster::checkSpawnMonster", + "SpawnMonster::scheduleSpawn", + "SpawnMonster::startup", + "SpawnNpc::checkSpawnNpc", + "Webhook::run", + "Protocol::sendRecvMessageCallback" }); return tasksContext.contains(context); } diff --git a/src/lua/functions/creatures/creature_functions.cpp b/src/lua/functions/creatures/creature_functions.cpp index 4ae5da0e132..6b09945971a 100644 --- a/src/lua/functions/creatures/creature_functions.cpp +++ b/src/lua/functions/creatures/creature_functions.cpp @@ -938,7 +938,7 @@ int CreatureFunctions::luaCreatureGetPathTo(lua_State* L) { fpp.clearSight = getBoolean(L, 6, fpp.clearSight); fpp.maxSearchDist = getNumber(L, 7, fpp.maxSearchDist); - stdext::arraylist dirList(128); + std::vector dirList; if (creature->getPathTo(position, dirList, fpp)) { lua_newtable(L); diff --git a/src/lua/functions/map/position_functions.cpp b/src/lua/functions/map/position_functions.cpp index 579304266c0..0e4397f3fce 100644 --- a/src/lua/functions/map/position_functions.cpp +++ b/src/lua/functions/map/position_functions.cpp @@ -97,7 +97,7 @@ int PositionFunctions::luaPositionGetPathTo(lua_State* L) { fpp.clearSight = getBoolean(L, 6, fpp.clearSight); fpp.maxSearchDist = getNumber(L, 7, fpp.maxSearchDist); - stdext::arraylist dirList(128); + std::vector dirList; if (g_game().map.getPathMatching(pos, dirList, FrozenPathingConditionCall(position), fpp)) { lua_newtable(L); diff --git a/src/map/map.cpp b/src/map/map.cpp index 7406ecffbdf..0d9a38b7cc1 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -638,11 +638,7 @@ std::shared_ptr Map::canWalkTo(const std::shared_ptr &creature, return tile; } -bool Map::getPathMatching(const std::shared_ptr &creature, stdext::arraylist &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp) { - return getPathMatching(creature, creature->getPosition(), dirList, pathCondition, fpp); -} - -bool Map::getPathMatching(const std::shared_ptr &creature, const Position &startPos, stdext::arraylist &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp) { +bool Map::getPathMatching(const std::shared_ptr &creature, const Position &__targetPos, std::vector &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp) { static int_fast32_t allNeighbors[8][2] = { { -1, 0 }, { 0, 1 }, { 1, 0 }, { 0, -1 }, { -1, -1 }, { 1, -1 }, { 1, 1 }, { -1, 1 } }; @@ -658,15 +654,25 @@ bool Map::getPathMatching(const std::shared_ptr &creature, const Posit { { -1, 0 }, { 0, 1 }, { -1, -1 }, { 1, 1 }, { -1, 1 } } }; - Position pos = startPos; + const bool withoutCreature = creature == nullptr; + + Position pos = withoutCreature ? __targetPos : creature->getPosition(); Position endPos; - AStarNodes nodes(pos.x, pos.y); + AStarNodes nodes(pos.x, pos.y, AStarNodes::getTileWalkCost(creature, getTile(pos.x, pos.y, pos.z))); int32_t bestMatch = 0; + const auto &startPos = pos; + const auto &targetPos = withoutCreature ? pathCondition.getTargetPos() : __targetPos; + + const int_fast32_t sX = std::abs(targetPos.getX() - pos.getX()); + const int_fast32_t sY = std::abs(targetPos.getY() - pos.getY()); + + uint_fast16_t cntDirs = 0; + AStarNode* found = nullptr; - while (fpp.maxSearchDist != 0 || nodes.getClosedNodes() < 100) { + do { AStarNode* n = nodes.getBestNode(); if (!n) { if (found) { @@ -687,6 +693,8 @@ bool Map::getPathMatching(const std::shared_ptr &creature, const Posit } } + ++cntDirs; + uint_fast32_t dirCount; int_fast32_t* neighbors; if (n->parent) { @@ -698,7 +706,7 @@ bool Map::getPathMatching(const std::shared_ptr &creature, const Posit } else { neighbors = *dirNeighbors[DIRECTION_EAST]; } - } else if (!fpp.allowDiagonal || offset_x == 0) { + } else if (offset_x == 0) { if (offset_y == -1) { neighbors = *dirNeighbors[DIRECTION_NORTH]; } else { @@ -715,7 +723,7 @@ bool Map::getPathMatching(const std::shared_ptr &creature, const Posit } else { neighbors = *dirNeighbors[DIRECTION_SOUTHEAST]; } - dirCount = fpp.allowDiagonal ? 5 : 3; + dirCount = 5; } else { dirCount = 8; neighbors = *allNeighbors; @@ -726,6 +734,185 @@ bool Map::getPathMatching(const std::shared_ptr &creature, const Posit pos.x = x + *neighbors++; pos.y = y + *neighbors++; + int_fast32_t extraCost; + AStarNode* neighborNode = nodes.getNodeByPosition(pos.x, pos.y); + if (neighborNode) { + extraCost = neighborNode->c; + } else { + const auto &tile = withoutCreature ? getTile(pos.x, pos.y, pos.z) : canWalkTo(creature, pos); + if (!tile) { + continue; + } + extraCost = AStarNodes::getTileWalkCost(creature, tile); + } + + // The cost (g) for this neighbor + const int_fast32_t cost = AStarNodes::getMapWalkCost(n, pos); + const int_fast32_t newf = f + cost + extraCost; + if (neighborNode) { + if (neighborNode->f <= newf) { + // The node on the closed/open list is cheaper than this one + continue; + } + neighborNode->f = newf; + neighborNode->parent = n; + nodes.openNode(neighborNode); + } else { + // Does not exist in the open/closed list, create a new node + const int_fast32_t dX = std::abs(targetPos.getX() - pos.getX()); + const int_fast32_t dY = std::abs(targetPos.getY() - pos.getY()); + if (!nodes.createOpenNode(n, pos.x, pos.y, newf, ((dX - sX) << 3) + ((dY - sY) << 3) + (std::max(dX, dY) << 3), extraCost)) { + if (found) { + break; + } + return false; + } + } + } + nodes.closeNode(n); + } while (nodes.getClosedNodes() < 100); + if (!found) { + return false; + } + + int_fast32_t prevx = endPos.x; + int_fast32_t prevy = endPos.y; + + dirList.reserve(cntDirs); + + found = found->parent; + while (found) { + pos.x = found->x; + pos.y = found->y; + + int_fast32_t dx = pos.getX() - prevx; + int_fast32_t dy = pos.getY() - prevy; + + prevx = pos.x; + prevy = pos.y; + if (dx == 1) { + if (dy == 1) { + dirList.emplace_back(DIRECTION_NORTHWEST); + } else if (dy == -1) { + dirList.emplace_back(DIRECTION_SOUTHWEST); + } else { + dirList.emplace_back(DIRECTION_WEST); + } + } else if (dx == -1) { + if (dy == 1) { + dirList.emplace_back(DIRECTION_NORTHEAST); + } else if (dy == -1) { + dirList.emplace_back(DIRECTION_SOUTHEAST); + } else { + dirList.emplace_back(DIRECTION_EAST); + } + } else if (dy == 1) { + dirList.emplace_back(DIRECTION_NORTH); + } else if (dy == -1) { + dirList.emplace_back(DIRECTION_SOUTH); + } + found = found->parent; + } + + return true; +} + +bool Map::getPathMatching(const std::shared_ptr &creature, std::vector &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp) { + return getPathMatching(creature, creature->getPosition(), dirList, pathCondition, fpp); +} + +bool Map::getPathMatchingCond(const std::shared_ptr &creature, const Position &targetPos, std::vector &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp) { + Position pos = creature->getPosition(); + Position endPos; + + AStarNodes nodes(pos.x, pos.y, AStarNodes::getTileWalkCost(creature, getTile(pos.x, pos.y, pos.z))); + + int32_t bestMatch = 0; + + static int_fast32_t dirNeighbors[8][5][2] = { + { { -1, 0 }, { 0, 1 }, { 1, 0 }, { 1, 1 }, { -1, 1 } }, + { { -1, 0 }, { 0, 1 }, { 0, -1 }, { -1, -1 }, { -1, 1 } }, + { { -1, 0 }, { 1, 0 }, { 0, -1 }, { -1, -1 }, { 1, -1 } }, + { { 0, 1 }, { 1, 0 }, { 0, -1 }, { 1, -1 }, { 1, 1 } }, + { { 1, 0 }, { 0, -1 }, { -1, -1 }, { 1, -1 }, { 1, 1 } }, + { { -1, 0 }, { 0, -1 }, { -1, -1 }, { 1, -1 }, { -1, 1 } }, + { { 0, 1 }, { 1, 0 }, { 1, -1 }, { 1, 1 }, { -1, 1 } }, + { { -1, 0 }, { 0, 1 }, { -1, -1 }, { 1, 1 }, { -1, 1 } } + }; + + static int_fast32_t allNeighbors[8][2] = { + { -1, 0 }, { 0, 1 }, { 1, 0 }, { 0, -1 }, { -1, -1 }, { 1, -1 }, { 1, 1 }, { -1, 1 } + }; + + const Position startPos = pos; + + const int_fast32_t sX = std::abs(targetPos.getX() - pos.getX()); + const int_fast32_t sY = std::abs(targetPos.getY() - pos.getY()); + + uint_fast16_t cntDirs = 0; + + AStarNode* found = nullptr; + do { + AStarNode* n = nodes.getBestNode(); + if (!n) { + if (found) { + break; + } + return false; + } + + const int_fast32_t x = n->x; + const int_fast32_t y = n->y; + pos.x = x; + pos.y = y; + if (pathCondition(startPos, pos, fpp, bestMatch)) { + found = n; + endPos = pos; + if (bestMatch == 0) { + break; + } + } + + ++cntDirs; + + uint_fast32_t dirCount; + int_fast32_t* neighbors; + if (n->parent) { + const int_fast32_t offset_x = n->parent->x - x; + const int_fast32_t offset_y = n->parent->y - y; + if (offset_y == 0) { + if (offset_x == -1) { + neighbors = *dirNeighbors[DIRECTION_WEST]; + } else { + neighbors = *dirNeighbors[DIRECTION_EAST]; + } + } else if (offset_x == 0) { + if (offset_y == -1) { + neighbors = *dirNeighbors[DIRECTION_NORTH]; + } else { + neighbors = *dirNeighbors[DIRECTION_SOUTH]; + } + } else if (offset_y == -1) { + if (offset_x == -1) { + neighbors = *dirNeighbors[DIRECTION_NORTHWEST]; + } else { + neighbors = *dirNeighbors[DIRECTION_NORTHEAST]; + } + } else if (offset_x == -1) { + neighbors = *dirNeighbors[DIRECTION_SOUTHWEST]; + } else { + neighbors = *dirNeighbors[DIRECTION_SOUTHEAST]; + } + dirCount = 5; + } else { + dirCount = 8; + neighbors = *allNeighbors; + } + + const int_fast32_t f = n->f; + for (uint_fast32_t i = 0; i < dirCount; ++i) { + pos.x = x + *neighbors++; + pos.y = y + *neighbors++; if (fpp.maxSearchDist != 0 && (Position::getDistanceX(startPos, pos) > fpp.maxSearchDist || Position::getDistanceY(startPos, pos) > fpp.maxSearchDist)) { continue; } @@ -734,33 +921,34 @@ bool Map::getPathMatching(const std::shared_ptr &creature, const Posit continue; } + int_fast32_t extraCost; AStarNode* neighborNode = nodes.getNodeByPosition(pos.x, pos.y); - - const bool withoutCreature = creature == nullptr; - const auto &tile = neighborNode || withoutCreature ? getTile(pos.x, pos.y, pos.z) : canWalkTo(creature, pos); - - if (!tile || (!neighborNode && withoutCreature && tile->hasFlag(TILESTATE_BLOCKSOLID))) { - continue; + if (neighborNode) { + extraCost = neighborNode->c; + } else { + const auto &tile = Map::canWalkTo(creature, pos); + if (!tile) { + continue; + } + extraCost = AStarNodes::getTileWalkCost(creature, tile); } // The cost (g) for this neighbor - const int_fast32_t cost = AStarNodes::getMapWalkCost(n, pos, withoutCreature); - const int_fast32_t extraCost = AStarNodes::getTileWalkCost(creature, tile); + const int_fast32_t cost = AStarNodes::getMapWalkCost(n, pos); const int_fast32_t newf = f + cost + extraCost; - if (neighborNode) { if (neighborNode->f <= newf) { // The node on the closed/open list is cheaper than this one continue; } - neighborNode->f = newf; neighborNode->parent = n; nodes.openNode(neighborNode); } else { - // Does not exist in the open/closed list, create a std::make_shared - neighborNode = nodes.createOpenNode(n, pos.x, pos.y, newf); - if (!neighborNode) { + // Does not exist in the open/closed list, create a new node + const int_fast32_t dX = std::abs(targetPos.getX() - pos.getX()); + const int_fast32_t dY = std::abs(targetPos.getY() - pos.getY()); + if (!nodes.createOpenNode(n, pos.x, pos.y, newf, ((dX - sX) << 3) + ((dY - sY) << 3) + (std::max(dX, dY) << 3), extraCost)) { if (found) { break; } @@ -768,9 +956,8 @@ bool Map::getPathMatching(const std::shared_ptr &creature, const Posit } } } - nodes.closeNode(n); - } + } while (fpp.maxSearchDist != 0 || nodes.getClosedNodes() < 100); if (!found) { return false; @@ -779,37 +966,42 @@ bool Map::getPathMatching(const std::shared_ptr &creature, const Posit int_fast32_t prevx = endPos.x; int_fast32_t prevy = endPos.y; + dirList.reserve(cntDirs); + found = found->parent; while (found) { pos.x = found->x; pos.y = found->y; - const int_fast32_t dx = pos.getX() - prevx; - const int_fast32_t dy = pos.getY() - prevy; + int_fast32_t dx = pos.getX() - prevx; + int_fast32_t dy = pos.getY() - prevy; prevx = pos.x; prevy = pos.y; - - if (dx == 1 && dy == 1) { - dirList.push_front(DIRECTION_NORTHWEST); - } else if (dx == -1 && dy == 1) { - dirList.push_front(DIRECTION_NORTHEAST); - } else if (dx == 1 && dy == -1) { - dirList.push_front(DIRECTION_SOUTHWEST); - } else if (dx == -1 && dy == -1) { - dirList.push_front(DIRECTION_SOUTHEAST); - } else if (dx == 1) { - dirList.push_front(DIRECTION_WEST); + if (dx == 1) { + if (dy == 1) { + dirList.emplace_back(DIRECTION_NORTHWEST); + } else if (dy == -1) { + dirList.emplace_back(DIRECTION_SOUTHWEST); + } else { + dirList.emplace_back(DIRECTION_WEST); + } } else if (dx == -1) { - dirList.push_front(DIRECTION_EAST); + if (dy == 1) { + dirList.emplace_back(DIRECTION_NORTHEAST); + } else if (dy == -1) { + dirList.emplace_back(DIRECTION_SOUTHEAST); + } else { + dirList.emplace_back(DIRECTION_EAST); + } } else if (dy == 1) { - dirList.push_front(DIRECTION_NORTH); + dirList.emplace_back(DIRECTION_NORTH); } else if (dy == -1) { - dirList.push_front(DIRECTION_SOUTH); + dirList.emplace_back(DIRECTION_SOUTH); } - found = found->parent; } + return true; } diff --git a/src/map/map.hpp b/src/map/map.hpp index bae07445156..a2000766382 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -123,9 +123,11 @@ class Map : public MapCache { std::shared_ptr canWalkTo(const std::shared_ptr &creature, const Position &pos); - bool getPathMatching(const std::shared_ptr &creature, stdext::arraylist &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp); + bool getPathMatching(const std::shared_ptr &creature, std::vector &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp); + bool getPathMatching(const std::shared_ptr &creature, const Position &targetPos, std::vector &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp); + bool getPathMatchingCond(const std::shared_ptr &creature, const Position &targetPos, std::vector &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp); - bool getPathMatching(const Position &startPos, stdext::arraylist &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp) { + bool getPathMatching(const Position &startPos, std::vector &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp) { return getPathMatching(nullptr, startPos, dirList, pathCondition, fpp); } @@ -143,8 +145,6 @@ class Map : public MapCache { Houses housesCustomMaps[50]; private: - bool getPathMatching(const std::shared_ptr &creature, const Position &startPos, stdext::arraylist &dirList, const FrozenPathingConditionCall &pathCondition, const FindPathParams &fpp); - /** * Set a single tile. */ diff --git a/src/map/utils/astarnodes.cpp b/src/map/utils/astarnodes.cpp index 9342fd8436b..21ebe5f982f 100644 --- a/src/map/utils/astarnodes.cpp +++ b/src/map/utils/astarnodes.cpp @@ -13,8 +13,28 @@ #include "creatures/monsters/monster.hpp" #include "creatures/combat/combat.hpp" -AStarNodes::AStarNodes(uint32_t x, uint32_t y) : - nodes(), openNodes() { +AStarNodes::AStarNodes(uint32_t x, uint32_t y, int_fast32_t extraCost) : + openNodes(), nodes() { +#if defined(__AVX2__) + __m256i defaultCost = _mm256_set1_epi32(std::numeric_limits::max()); + for (int32_t i = 0; i < MAX_NODES; i += 32) { + _mm256_stream_si256(reinterpret_cast<__m256i*>(&calculatedNodes[i + 0]), defaultCost); + _mm256_stream_si256(reinterpret_cast<__m256i*>(&calculatedNodes[i + 8]), defaultCost); + _mm256_stream_si256(reinterpret_cast<__m256i*>(&calculatedNodes[i + 16]), defaultCost); + _mm256_stream_si256(reinterpret_cast<__m256i*>(&calculatedNodes[i + 24]), defaultCost); + } + _mm_sfence(); +#elif defined(__SSE2__) + __m128i defaultCost = _mm_set1_epi32(std::numeric_limits::max()); + for (int32_t i = 0; i < MAX_NODES; i += 16) { + _mm_stream_si128(reinterpret_cast<__m128i*>(&calculatedNodes[i + 0]), defaultCost); + _mm_stream_si128(reinterpret_cast<__m128i*>(&calculatedNodes[i + 4]), defaultCost); + _mm_stream_si128(reinterpret_cast<__m128i*>(&calculatedNodes[i + 8]), defaultCost); + _mm_stream_si128(reinterpret_cast<__m128i*>(&calculatedNodes[i + 12]), defaultCost); + } + _mm_sfence(); +#endif + curNode = 1; closedNodes = 0; openNodes[0] = true; @@ -24,121 +44,239 @@ AStarNodes::AStarNodes(uint32_t x, uint32_t y) : startNode.x = x; startNode.y = y; startNode.f = 0; - nodeTable[(x << 16) | y] = nodes; + startNode.g = 0; + startNode.c = extraCost; + nodesTable[0] = (x << 16) | y; +#if defined(__SSE2__) + calculatedNodes[0] = 0; +#endif } -AStarNode* AStarNodes::createOpenNode(AStarNode* parent, uint32_t x, uint32_t y, int_fast32_t f) { +bool AStarNodes::createOpenNode(AStarNode* parent, uint32_t x, uint32_t y, int_fast32_t f, int_fast32_t heuristic, int_fast32_t extraCost) { if (curNode >= MAX_NODES) { - return nullptr; + return false; } - size_t retNode = curNode++; + int32_t retNode = curNode++; openNodes[retNode] = true; - AStarNode* node = nodes + retNode; - nodeTable[(x << 16) | y] = node; - node->parent = parent; - node->x = x; - node->y = y; - node->f = f; - return node; + AStarNode &node = nodes[retNode]; + node.parent = parent; + node.x = x; + node.y = y; + node.f = f; + node.g = heuristic; + node.c = extraCost; + nodesTable[retNode] = (x << 16) | y; +#if defined(__SSE2__) + calculatedNodes[retNode] = f + heuristic; +#endif + return true; } AStarNode* AStarNodes::getBestNode() { - if (curNode == 0) { - return nullptr; +// Branchless best node search +#if defined(__AVX512F__) + const __m512i increment = _mm512_set1_epi32(16); + __m512i indices = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); + __m512i minindices = indices; + __m512i minvalues = _mm512_load_si512(reinterpret_cast(calculatedNodes)); + for (int32_t pos = 16; pos < curNode; pos += 16) { + const __m512i values = _mm512_load_si512(reinterpret_cast(&calculatedNodes[pos])); + indices = _mm512_add_epi32(indices, increment); + minindices = _mm512_mask_blend_epi32(_mm512_cmplt_epi32_mask(values, minvalues), minindices, indices); + minvalues = _mm512_min_epi32(minvalues, values); + } + + alignas(64) int32_t values_array[16]; + alignas(64) int32_t indices_array[16]; + _mm512_store_si512(reinterpret_cast(values_array), minvalues); + _mm512_store_si512(reinterpret_cast(indices_array), minindices); + + int32_t best_node = indices_array[0]; + int32_t best_node_f = values_array[0]; + for (int32_t i = 1; i < 16; ++i) { + int32_t total_cost = values_array[i]; + best_node = (total_cost < best_node_f ? indices_array[i] : best_node); + best_node_f = (total_cost < best_node_f ? total_cost : best_node_f); + } + return (openNodes[best_node] ? &nodes[best_node] : NULL); +#elif defined(__AVX2__) + const __m256i increment = _mm256_set1_epi32(8); + __m256i indices = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7); + __m256i minindices = indices; + __m256i minvalues = _mm256_load_si256(reinterpret_cast(calculatedNodes)); + for (int32_t pos = 8; pos < curNode; pos += 8) { + const __m256i values = _mm256_load_si256(reinterpret_cast(&calculatedNodes[pos])); + indices = _mm256_add_epi32(indices, increment); + minindices = _mm256_blendv_epi8(minindices, indices, _mm256_cmpgt_epi32(minvalues, values)); + minvalues = _mm256_min_epi32(values, minvalues); + } + + __m256i res = _mm256_min_epi32(minvalues, _mm256_shuffle_epi32(minvalues, _MM_SHUFFLE(2, 3, 0, 1))); // Calculate horizontal minimum + res = _mm256_min_epi32(res, _mm256_shuffle_epi32(res, _MM_SHUFFLE(0, 1, 2, 3))); // Calculate horizontal minimum + res = _mm256_min_epi32(res, _mm256_permutevar8x32_epi32(res, _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7))); // Calculate horizontal minimum + + alignas(32) int32_t indices_array[8]; + _mm256_store_si256(reinterpret_cast<__m256i*>(indices_array), minindices); + + int32_t best_node = indices_array[(_mm_ctz(_mm256_movemask_epi8(_mm256_cmpeq_epi32(minvalues, res))) >> 2)]; + return (openNodes[best_node] ? &nodes[best_node] : NULL); +#elif defined(__SSE4_1__) + const __m128i increment = _mm_set1_epi32(4); + __m128i indices = _mm_setr_epi32(0, 1, 2, 3); + __m128i minindices = indices; + __m128i minvalues = _mm_load_si128(reinterpret_cast(calculatedNodes)); + for (int32_t pos = 4; pos < curNode; pos += 4) { + const __m128i values = _mm_load_si128(reinterpret_cast(&calculatedNodes[pos])); + indices = _mm_add_epi32(indices, increment); + minindices = _mm_blendv_epi8(minindices, indices, _mm_cmplt_epi32(values, minvalues)); + minvalues = _mm_min_epi32(values, minvalues); } + __m128i res = _mm_min_epi32(minvalues, _mm_shuffle_epi32(minvalues, _MM_SHUFFLE(2, 3, 0, 1))); // Calculate horizontal minimum + res = _mm_min_epi32(res, _mm_shuffle_epi32(res, _MM_SHUFFLE(0, 1, 2, 3))); // Calculate horizontal minimum + + alignas(16) int32_t indices_array[4]; + _mm_store_si128(reinterpret_cast<__m128i*>(indices_array), minindices); + + int32_t best_node = indices_array[(_mm_ctz(_mm_movemask_epi8(_mm_cmpeq_epi32(minvalues, res))) >> 2)]; + return (openNodes[best_node] ? &nodes[best_node] : NULL); +#elif defined(__SSE2__) + auto _mm_sse2_min_epi32 = [](const __m128i a, const __m128i b) { + __m128i mask = _mm_cmpgt_epi32(a, b); + return _mm_or_si128(_mm_and_si128(mask, b), _mm_andnot_si128(mask, a)); + }; + + auto _mm_sse2_blendv_epi8 = [](const __m128i a, const __m128i b, __m128i mask) { + mask = _mm_cmplt_epi8(mask, _mm_setzero_si128()); + return _mm_or_si128(_mm_andnot_si128(mask, a), _mm_and_si128(mask, b)); + }; + + const __m128i increment = _mm_set1_epi32(4); + __m128i indices = _mm_setr_epi32(0, 1, 2, 3); + __m128i minindices = indices; + __m128i minvalues = _mm_load_si128(reinterpret_cast(calculatedNodes)); + for (int32_t pos = 4; pos < curNode; pos += 4) { + const __m128i values = _mm_load_si128(reinterpret_cast(&calculatedNodes[pos])); + indices = _mm_add_epi32(indices, increment); + minindices = _mm_sse2_blendv_epi8(minindices, indices, _mm_cmplt_epi32(values, minvalues)); + minvalues = _mm_sse2_min_epi32(values, minvalues); + } + + __m128i res = _mm_sse2_min_epi32(minvalues, _mm_shuffle_epi32(minvalues, _MM_SHUFFLE(2, 3, 0, 1))); // Calculate horizontal minimum + res = _mm_sse2_min_epi32(res, _mm_shuffle_epi32(res, _MM_SHUFFLE(0, 1, 2, 3))); // Calculate horizontal minimum + + alignas(16) int32_t indices_array[4]; + _mm_store_si128(reinterpret_cast<__m128i*>(indices_array), minindices); + + int32_t best_node = indices_array[(_mm_ctz(_mm_movemask_epi8(_mm_cmpeq_epi32(minvalues, res))) >> 2)]; + return (openNodes[best_node] ? &nodes[best_node] : NULL); +#else int32_t best_node_f = std::numeric_limits::max(); int32_t best_node = -1; - for (size_t i = 0; i < curNode; i++) { - if (openNodes[i] && nodes[i].f < best_node_f) { - best_node_f = nodes[i].f; - best_node = i; + for (int32_t pos = 0; pos < curNode; ++pos) { + if (!openNodes[pos]) { + continue; } - } - if (best_node >= 0) { - return nodes + best_node; + int32_t total_cost = nodes[pos].f + nodes[pos].g; + best_node = (total_cost < best_node_f ? pos : best_node); + best_node_f = (total_cost < best_node_f ? total_cost : best_node_f); } - return nullptr; + return (best_node != -1 ? &nodes[best_node] : nullptr); +#endif } void AStarNodes::closeNode(const AStarNode* node) { - size_t index = node - nodes; - if (index >= MAX_NODES) { - g_logger().error("[{}]: node index out of bounds!", __FUNCTION__); - return; - } - + const size_t index = node - nodes; assert(index < MAX_NODES); +#if defined(__SSE2__) + calculatedNodes[index] = std::numeric_limits::max(); +#endif openNodes[index] = false; ++closedNodes; } void AStarNodes::openNode(const AStarNode* node) { - size_t index = node - nodes; - if (index >= MAX_NODES) { - g_logger().error("[{}]: node index out of bounds!", __FUNCTION__); - return; - } - + const size_t index = node - nodes; assert(index < MAX_NODES); - if (!openNodes[index]) { - openNodes[index] = true; - --closedNodes; - } +#if defined(__SSE2__) + calculatedNodes[index] = nodes[index].f + nodes[index].g; +#endif + closedNodes -= (openNodes[index] ? 0 : 1); + openNodes[index] = true; } -int_fast32_t AStarNodes::getClosedNodes() const { +int32_t AStarNodes::getClosedNodes() const { return closedNodes; } AStarNode* AStarNodes::getNodeByPosition(uint32_t x, uint32_t y) { - auto it = nodeTable.find((x << 16) | y); - if (it == nodeTable.end()) { - return nullptr; - } - return it->second; -} + uint32_t xy = (x << 16) | y; +#if defined(__SSE2__) + const __m128i key = _mm_set1_epi32(xy); -int_fast32_t AStarNodes::getMapWalkCost(AStarNode* node, const Position &neighborPos, bool preferDiagonal) { - if (std::abs(node->x - neighborPos.x) == std::abs(node->y - neighborPos.y)) { - // diagonal movement extra cost - if (preferDiagonal) { - return MAP_PREFERDIAGONALWALKCOST; - } else { - return MAP_DIAGONALWALKCOST; + int32_t pos = 0; + int32_t curRound = curNode - 16; + for (; pos <= curRound; pos += 16) { + __m128i v[4]; + v[0] = _mm_cmpeq_epi32(_mm_load_si128(reinterpret_cast(&nodesTable[pos])), key); + v[1] = _mm_cmpeq_epi32(_mm_load_si128(reinterpret_cast(&nodesTable[pos + 4])), key); + v[2] = _mm_cmpeq_epi32(_mm_load_si128(reinterpret_cast(&nodesTable[pos + 8])), key); + v[3] = _mm_cmpeq_epi32(_mm_load_si128(reinterpret_cast(&nodesTable[pos + 12])), key); + const uint32_t mask = _mm_movemask_epi8(_mm_packs_epi16(_mm_packs_epi32(v[0], v[1]), _mm_packs_epi32(v[2], v[3]))); + if (mask != 0) { + return &nodes[pos + _mm_ctz(mask)]; + } + } + curRound = curNode - 8; + if (pos <= curRound) { + __m128i v[2]; + v[0] = _mm_cmpeq_epi32(_mm_load_si128(reinterpret_cast(&nodesTable[pos])), key); + v[1] = _mm_cmpeq_epi32(_mm_load_si128(reinterpret_cast(&nodesTable[pos + 4])), key); + const uint32_t mask = _mm_movemask_epi8(_mm_packs_epi32(v[0], v[1])); + if (mask != 0) { + return &nodes[pos + (_mm_ctz(mask) >> 1)]; + } + pos += 8; + } + for (; pos < curNode; ++pos) { + if (nodesTable[pos] == xy) { + return &nodes[pos]; } } - return MAP_NORMALWALKCOST; + return nullptr; +#else + for (int32_t i = 1; i < curNode; ++i) { + if (nodesTable[i] == xy) { + return &nodes[i]; + } + } + return (nodesTable[0] == xy ? &nodes[0] : nullptr); // The first node is very unlikely to be the "neighbor" so leave it for end +#endif } -int_fast32_t AStarNodes::getTileWalkCost(const std::shared_ptr &creature, const std::shared_ptr &tile) { - if (!creature || !tile) { - return 0; - } +int_fast32_t AStarNodes::getMapWalkCost(AStarNode* node, const Position &neighborPos) { + // diagonal movement extra cost + return (((std::abs(node->x - neighborPos.x) + std::abs(node->y - neighborPos.y)) - 1) * MAP_DIAGONALWALKCOST) + MAP_NORMALWALKCOST; +} +int_fast32_t AStarNodes::getTileWalkCost(const std::shared_ptr &creature, const std::shared_ptr &tile) { int_fast32_t cost = 0; - if (tile->getTopVisibleCreature(creature) != nullptr) { - // destroy creature cost - cost += MAP_NORMALWALKCOST * 3; - } - if (const auto &field = tile->getFieldItem()) { - const CombatType_t combatType = field->getCombatType(); - const auto &monster = creature->getMonster(); - - if (!creature->isImmune(combatType) && !creature->hasCondition(Combat::DamageToConditionType(combatType)) && (monster && !monster->canWalkOnFieldType(combatType))) { - cost += MAP_NORMALWALKCOST * 18; + if (creature) { + if (tile->getTopVisibleCreature(creature) != nullptr) { + // destroy creature cost + cost += MAP_NORMALWALKCOST * 4; } - /** - * Make player try to avoid magic fields, when calculating pathing - */ - const auto &player = creature->getPlayer(); - if (player && !field->isBlocking() && field->getDamage() != 0) { - cost += MAP_NORMALWALKCOST * 18; + if (const auto &field = tile->getFieldItem()) { + CombatType_t combatType = field->getCombatType(); + if (!creature->isImmune(combatType) && !creature->hasCondition(Combat::DamageToConditionType(combatType)) && (creature->getMonster() && !creature->getMonster()->canWalkOnFieldType(combatType))) { + cost += MAP_NORMALWALKCOST * 18; + } } } + return cost; } diff --git a/src/map/utils/astarnodes.hpp b/src/map/utils/astarnodes.hpp index 546d490d858..d66171f0d53 100644 --- a/src/map/utils/astarnodes.hpp +++ b/src/map/utils/astarnodes.hpp @@ -15,22 +15,22 @@ class Tile; struct AStarNode { AStarNode* parent; - int_fast32_t f; + int_fast32_t f, g, c; uint16_t x, y; }; class AStarNodes { public: - AStarNodes(uint32_t x, uint32_t y); + AStarNodes(uint32_t x, uint32_t y, int_fast32_t extraCost); - AStarNode* createOpenNode(AStarNode* parent, uint32_t x, uint32_t y, int_fast32_t f); + bool createOpenNode(AStarNode* parent, uint32_t x, uint32_t y, int_fast32_t f, int_fast32_t heuristic, int_fast32_t extraCost); AStarNode* getBestNode(); void closeNode(const AStarNode* node); void openNode(const AStarNode* node); - int_fast32_t getClosedNodes() const; + int32_t getClosedNodes() const; AStarNode* getNodeByPosition(uint32_t x, uint32_t y); - static int_fast32_t getMapWalkCost(AStarNode* node, const Position &neighborPos, bool preferDiagonal = false); + static int_fast32_t getMapWalkCost(AStarNode* node, const Position &neighborPos); static int_fast32_t getTileWalkCost(const std::shared_ptr &creature, const std::shared_ptr &tile); private: @@ -39,9 +39,15 @@ class AStarNodes { static constexpr int32_t MAP_PREFERDIAGONALWALKCOST = 14; static constexpr int32_t MAP_DIAGONALWALKCOST = 25; +#if defined(__SSE2__) + alignas(16) uint32_t nodesTable[MAX_NODES]; + alignas(64) int32_t calculatedNodes[MAX_NODES]; AStarNode nodes[MAX_NODES]; +#else + AStarNode nodes[MAX_NODES]; + uint32_t nodesTable[MAX_NODES]; +#endif + int32_t closedNodes; + int32_t curNode; bool openNodes[MAX_NODES]; - phmap::flat_hash_map nodeTable; - size_t curNode; - int_fast32_t closedNodes; }; diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 4c17b20965f..ae8510011b0 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -1599,35 +1599,34 @@ void ProtocolGame::parseAutoWalk(NetworkMessage &msg) { return; } - msg.skipBytes(numdirs); - - stdext::arraylist path; - for (uint8_t i = 0; i < numdirs; ++i) { - uint8_t rawdir = msg.getPreviousByte(); + std::vector path; + path.resize(numdirs, DIRECTION_NORTH); + for (size_t i = numdirs; --i < numdirs;) { + const uint8_t rawdir = msg.getByte(); switch (rawdir) { case 1: - path.push_front(DIRECTION_EAST); + path[i] = DIRECTION_EAST; break; case 2: - path.push_front(DIRECTION_NORTHEAST); + path[i] = DIRECTION_NORTHEAST; break; case 3: - path.push_front(DIRECTION_NORTH); + path[i] = DIRECTION_NORTH; break; case 4: - path.push_front(DIRECTION_NORTHWEST); + path[i] = DIRECTION_NORTHWEST; break; case 5: - path.push_front(DIRECTION_WEST); + path[i] = DIRECTION_WEST; break; case 6: - path.push_front(DIRECTION_SOUTHWEST); + path[i] = DIRECTION_SOUTHWEST; break; case 7: - path.push_front(DIRECTION_SOUTH); + path[i] = DIRECTION_SOUTH; break; case 8: - path.push_front(DIRECTION_SOUTHEAST); + path[i] = DIRECTION_SOUTHEAST; break; default: break; @@ -1638,7 +1637,7 @@ void ProtocolGame::parseAutoWalk(NetworkMessage &msg) { return; } - g_game().playerAutoWalk(player->getID(), path.data()); + g_game().playerAutoWalk(player->getID(), path); } void ProtocolGame::parseSetOutfit(NetworkMessage &msg) { From fa85e18ff591f136caaea09719a262d818f40919 Mon Sep 17 00:00:00 2001 From: Renato Machado Date: Fri, 26 Jul 2024 14:51:55 -0300 Subject: [PATCH 15/16] fix: crash when monster pulls items from a tile (#2770) --- src/creatures/monsters/monster.cpp | 34 +++++++++++++----------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/creatures/monsters/monster.cpp b/src/creatures/monsters/monster.cpp index 575ee321914..3ae73f8dc7c 100644 --- a/src/creatures/monsters/monster.cpp +++ b/src/creatures/monsters/monster.cpp @@ -1129,27 +1129,23 @@ void Monster::pushItems(std::shared_ptr tile, const Direction &nextDirecti // We can not use iterators here since we can push the item to another tile // which will invalidate the iterator. // start from the end to minimize the amount of traffic - TileItemVector* items; - if (!(items = tile->getItemList())) { - return; - } - uint32_t moveCount = 0; - uint32_t removeCount = 0; - auto it = items->begin(); - while (it != items->end()) { - std::shared_ptr item = *it; - if (item && item->hasProperty(CONST_PROP_MOVABLE) && (item->hasProperty(CONST_PROP_BLOCKPATH) || item->hasProperty(CONST_PROP_BLOCKSOLID)) && item->canBeMoved()) { - if (moveCount < 20 && pushItem(item, nextDirection)) { - ++moveCount; - } else if (!item->isCorpse() && g_game().internalRemoveItem(item) == RETURNVALUE_NOERROR) { - ++removeCount; + if (const auto items = tile->getItemList()) { + uint32_t moveCount = 0; + uint32_t removeCount = 0; + int32_t downItemSize = tile->getDownItemCount(); + for (int32_t i = downItemSize; --i >= 0;) { + const auto &item = items->at(i); + if (item && item->hasProperty(CONST_PROP_MOVABLE) && (item->hasProperty(CONST_PROP_BLOCKPATH) || item->hasProperty(CONST_PROP_BLOCKSOLID)) && item->canBeMoved()) { + if (moveCount < 20 && pushItem(item, nextDirection)) { + ++moveCount; + } else if (!item->isCorpse() && g_game().internalRemoveItem(item) == RETURNVALUE_NOERROR) { + ++removeCount; + } } - } else { - it++; } - } - if (removeCount > 0) { - g_game().addMagicEffect(tile->getPosition(), CONST_ME_POFF); + if (removeCount > 0) { + g_game().addMagicEffect(tile->getPosition(), CONST_ME_POFF); + } } } From fccf43522163a2d97e0d7dc3409d56d246c5074c Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Sat, 27 Jul 2024 20:46:10 -0400 Subject: [PATCH 16/16] fix: login after death and prey window oldprotocol (#2776) --- src/server/network/protocol/protocolgame.cpp | 15 +++++++-------- src/server/network/protocol/protocolgame.hpp | 1 + 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index ae8510011b0..133f0335ff1 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -473,6 +473,7 @@ void ProtocolGame::login(const std::string &name, uint32_t accountId, OperatingS // Extended opcodes if (operatingSystem >= CLIENTOS_OTCLIENT_LINUX) { + isOTC = true; NetworkMessage opcodeMessage; opcodeMessage.addByte(0x32); opcodeMessage.addByte(0x00); @@ -923,8 +924,8 @@ void ProtocolGame::parsePacket(NetworkMessage &msg) { void ProtocolGame::parsePacketDead(uint8_t recvbyte) { if (recvbyte == 0x14) { - // Remove player from game if click "ok" using otcv8 - if (player && otclientV8 > 0) { + // Remove player from game if click "ok" using otc + if (player && isOTC) { g_game().removePlayerUniqueLogin(player->getName()); } disconnect(); @@ -4261,12 +4262,10 @@ void ProtocolGame::sendBasicData() { msg.addByte(player->getVocation()->getClientId()); // Prey window - if (!oldProtocol) { - if (player->getVocation()->getId() == 0 && player->getGroup()->id < GROUP_TYPE_GAMEMASTER) { - msg.addByte(0); - } else { - msg.addByte(1); // has reached Main (allow player to open Prey window) - } + if (player->getVocation()->getId() == 0 && player->getGroup()->id < GROUP_TYPE_GAMEMASTER) { + msg.addByte(0); + } else { + msg.addByte(1); // has reached Main (allow player to open Prey window) } // Filter only valid ids diff --git a/src/server/network/protocol/protocolgame.hpp b/src/server/network/protocol/protocolgame.hpp index 8e99aa68a54..f6b7be93cb2 100644 --- a/src/server/network/protocol/protocolgame.hpp +++ b/src/server/network/protocol/protocolgame.hpp @@ -503,6 +503,7 @@ class ProtocolGame final : public Protocol { bool oldProtocol = false; uint16_t otclientV8 = 0; + bool isOTC = false; void sendInventory(); void sendOpenStash();