diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 7a62040a653..2364b7cf5ca 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -424,42 +424,6 @@ Storage = { AccessTeleport2 = 50405, AccessTeleport3 = 50406, }, - FerumbrasAscension = { - -- Reserved storage from 50420 - 50469 - RiftRunner = 50420, -- Scroll - TheShattererTimer = 50421, - TheLordOfTheLiceTimer = 50422, - Tarbaz = 50431, - Razzagorn = 50432, - Ragiaz = 50433, - Zamulosh = 50434, - Shulgrax = 50435, - Mazoran = 50436, - Plagirath = 50437, - Access = 50438, - TheShatterer = 50439, - ZamuloshTeleports = 50440, - BasinCounter = 50441, - TheLordOfTheLiceAccess = 50442, - FirstDoor = 50443, - MonsterDoor = 50444, - TarbazDoor = 50445, - HabitatsAccess = 50446, - HabitatsTimer = 50447, - TarbazNotes = 50448, - ColorLever = 50449, - BoneFluteWall = 50450, - BoneFlute = 50451, - Ring = 50452, - Statue = 50453, - Fount = 50454, - Vampire = 50455, - Flower = 50456, - Ring2 = 50457, - Bone = 50458, - Reward = 50459, - TheShattererLever = 50460, - }, ForgottenKnowledge = { -- Reserved storage from 50470 - 50519 AccessDeath = 50470, @@ -2467,11 +2431,91 @@ Storage = { DragonCounter = 45181, Achievement = 45182, }, - TheLostBrotherQuest = 52149, + TheLostBrotherQuest = 45183, TheTaintedSouls = {}, }, U10_90 = { -- update 10.90 - Reserved Storages 45201 - 45350 - FerumbrasAscension = {}, + FerumbrasAscension = { + RiftRunner = 45201, -- Scroll + TheShattererTimer = 45202, + TheLordOfTheLiceTimer = 45203, + Tarbaz = 45204, + Razzagorn = 45205, + Ragiaz = 45206, + Zamulosh = 45207, + Shulgrax = 45208, + Mazoran = 45209, + Plagirath = 45210, + Access = 45211, + TheShatterer = 45212, + ZamuloshTeleports = 45213, + BasinCounter = 45214, + TheLordOfTheLiceAccess = 45215, + FirstDoor = 45216, + MonsterDoor = 45217, + TarbazDoor = 45218, + HabitatsAccess = 45219, + HabitatsTimer = 45220, + TarbazNotes = 45221, + ColorLever = 45222, + BoneFluteWall = 45223, + BoneFlute = 45224, + Ring = 45225, + Statue = 45226, + Fount = 45227, + Vampire = 45228, + Flower = 45229, + Ring2 = 45230, + Bone = 45231, + Reward = 45232, + TheShattererLever = 45233, + TheLordOfTheLiceTime = 45234, + TarbazTime = 45235, + RagiazTime = 45236, + PlagirathTime = 45237, + RazzagornTime = 45238, + ZamuloshTime = 45239, + MazoranTime = 45240, + ShulgraxTime = 45241, + FerumbrasMortalShellTime = 45242, + ZamuloshSummon = 45243, + FerumbrasEssence = 45244, + DesperateSoul = 45245, + FlowerPuzzleTimer = 45246, + Crystals = { + Crystal1 = 45247, + Crystal2 = 45248, + Crystal3 = 45249, + Crystal4 = 45250, + Crystal5 = 45251, + Crystal6 = 45252, + Crystal7 = 45253, + Crystal8 = 45254, + AllCrystals = 45255, + }, + Habitats = { + Roshamuul = 45256, + Grass = 45257, + Mushroom = 45258, + Desert = 45259, + Venom = 45260, + Ice = 45261, + Corrupted = 45262, + Dimension = 45263, + AllHabitats = 45264, + }, + Elements = { + First = 45265, + Second = 45266, + Third = 45267, + Four = 45268, + Active = 45269, + Done = 45270, + }, + TheRiteOfEternalNight = 45271, + StoneCoffinsBones = 45272, + VampireTeeth = 45273, + }, Krailos = {}, RiftWarriorOutfits = {}, }, @@ -2781,43 +2825,7 @@ GlobalStorage = { Chance = 60020, Active = 60021, }, - FerumbrasAscendant = { - -- Reserved storage from 60030 - 60069 - ZamuloshSummon = 60030, - FerumbrasEssence = 60031, - DesperateSoul = 60032, - FlowerPuzzleTimer = 60033, - Crystals = { - Crystal1 = 60040, - Crystal2 = 60041, - Crystal3 = 60042, - Crystal4 = 60043, - Crystal5 = 60044, - Crystal6 = 60045, - Crystal7 = 60046, - Crystal8 = 60047, - AllCrystals = 60048, - }, - Habitats = { - Roshamuul = 60050, - Grass = 60051, - Mushroom = 60052, - Desert = 60053, - Venom = 60054, - Ice = 60055, - Corrupted = 60056, - Dimension = 60057, - AllHabitats = 60058, - }, - Elements = { - First = 60060, - Second = 60061, - Third = 60062, - Four = 60063, - Active = 60064, - Done = 60065, - }, - }, + HeroRathleton = { -- Reserved storage from 60070 - 60089 FirstMachines = 60070, @@ -2914,21 +2922,21 @@ startupGlobalStorages = { GlobalStorage.HeroRathleton.MaxxenRunning, GlobalStorage.HeroRathleton.LavaCounter, GlobalStorage.HeroRathleton.FourthMachines, - GlobalStorage.FerumbrasAscendant.Crystals.Crystal1, - GlobalStorage.FerumbrasAscendant.Crystals.Crystal2, - GlobalStorage.FerumbrasAscendant.Crystals.Crystal3, - GlobalStorage.FerumbrasAscendant.Crystals.Crystal4, - GlobalStorage.FerumbrasAscendant.Crystals.Crystal5, - GlobalStorage.FerumbrasAscendant.Crystals.Crystal6, - GlobalStorage.FerumbrasAscendant.Crystals.Crystal7, - GlobalStorage.FerumbrasAscendant.Crystals.Crystal8, - GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals, - GlobalStorage.FerumbrasAscendant.FerumbrasEssence, + Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal1, + Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal2, + Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal3, + Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal4, + Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal5, + Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal6, + Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal7, + Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal8, + Storage.Quest.U10_90.FerumbrasAscension.Crystals.AllCrystals, + Storage.Quest.U10_90.FerumbrasAscension.FerumbrasEssence, GlobalStorage.Feroxa.Active, - GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats, - GlobalStorage.FerumbrasAscendant.Elements.Active, - GlobalStorage.FerumbrasAscendant.Elements.First, - GlobalStorage.FerumbrasAscendant.Elements.Second, - GlobalStorage.FerumbrasAscendant.Elements.Third, - GlobalStorage.FerumbrasAscendant.Elements.Done, + Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, + Storage.Quest.U10_90.FerumbrasAscension.Elements.Active, + Storage.Quest.U10_90.FerumbrasAscension.Elements.First, + Storage.Quest.U10_90.FerumbrasAscension.Elements.Second, + Storage.Quest.U10_90.FerumbrasAscension.Elements.Third, + Storage.Quest.U10_90.FerumbrasAscension.Elements.Done, } diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ascending_ferumbras.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ascending_ferumbras.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ascending_ferumbras.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ascending_ferumbras.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/death_dragon.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/death_dragon.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/death_dragon.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/death_dragon.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/destabilized_ferumbras.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/destabilized_ferumbras.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/destabilized_ferumbras.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/destabilized_ferumbras.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/enraged_soul.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/enraged_soul.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/enraged_soul.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/enraged_soul.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ferumbras_mortal_shell.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ferumbras_mortal_shell.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ferumbras_mortal_shell.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ferumbras_mortal_shell.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ferumbras_soul_splinter.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ferumbras_soul_splinter.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ferumbras_soul_splinter.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ferumbras_soul_splinter.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/mazoran.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/mazoran.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/mazoran.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/mazoran.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/plagirath.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/plagirath.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/plagirath.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/plagirath.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ragiaz.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ragiaz.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ragiaz.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/ragiaz.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/razzagorn.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/razzagorn.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/razzagorn.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/razzagorn.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/redeemed_soul.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/redeemed_soul.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/redeemed_soul.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/redeemed_soul.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/shulgrax.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/shulgrax.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/shulgrax.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/shulgrax.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/sin_devourer.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/sin_devourer.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/sin_devourer.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/sin_devourer.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/tarbaz.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/tarbaz.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/tarbaz.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/tarbaz.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/the_lord_of_the_lice.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/the_lord_of_the_lice.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/the_lord_of_the_lice.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/the_lord_of_the_lice.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/the_shatterer.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/the_shatterer.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/the_shatterer.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/the_shatterer.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/zamulosh.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/zamulosh.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh2.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/zamulosh2.lua similarity index 98% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh2.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/zamulosh2.lua index 5adb3a046bc..e3f7a2cfceb 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh2.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/zamulosh2.lua @@ -14,10 +14,6 @@ monster.outfit = { lookMount = 0, } -monster.events = { - "AscendantBossesDeath", -} - monster.health = 300000 monster.maxHealth = 300000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh3.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/zamulosh3.lua similarity index 98% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh3.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/bosses/zamulosh3.lua index ec8cb0ade3a..bb0671d663a 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh3.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascension/bosses/zamulosh3.lua @@ -15,7 +15,6 @@ monster.outfit = { } monster.events = { - "AscendantBossesDeath", "ZamuloshClone", } diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/damned_soul.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/damned_soul.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/damned_soul.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/damned_soul.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/desperate_soul.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/desperate_soul.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/desperate_soul.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/desperate_soul.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/disgusting_ooze.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/disgusting_ooze.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/disgusting_ooze.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/disgusting_ooze.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/ferumbras_essence.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/ferumbras_essence.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/ferumbras_essence.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/ferumbras_essence.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_deer.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_deer.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_deer.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_deer.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_frazzlemaw.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_frazzlemaw.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_frazzlemaw.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_frazzlemaw.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_polar_bear.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_polar_bear.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_polar_bear.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_polar_bear.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_rotworm.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_rotworm.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_rotworm.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_rotworm.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_scorpion.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_scorpion.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_scorpion.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_scorpion.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_snake.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_snake.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_snake.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_snake.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_souleater.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_souleater.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_souleater.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_souleater.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_yielothax.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_yielothax.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/lovely/lovely_yielothax.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/lovely/lovely_yielothax.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/rage_of_mazoran.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/rage_of_mazoran.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/rage_of_mazoran.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/rage_of_mazoran.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/summons/enthralled_demon.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/summons/enthralled_demon.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/summons/enthralled_demon.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/summons/enthralled_demon.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/summons/rift_fragment.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/summons/rift_fragment.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/summons/rift_fragment.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/summons/rift_fragment.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/summons/rift_invader.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/summons/rift_invader.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/summons/rift_invader.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/summons/rift_invader.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/traps/bone_capsule.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/traps/bone_capsule.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/traps/bone_capsule.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/traps/bone_capsule.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/traps/despair.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/traps/despair.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/traps/despair.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/traps/despair.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/traps/electric_sparks.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/traps/electric_sparks.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/traps/electric_sparks.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/traps/electric_sparks.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/traps/eruption_of_destruction.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/traps/eruption_of_destruction.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/traps/eruption_of_destruction.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/traps/eruption_of_destruction.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/traps/guilt.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/traps/guilt.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/traps/guilt.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/traps/guilt.lua diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/traps/void.lua b/data-otservbr-global/monster/quests/ferumbras_ascension/traps/void.lua similarity index 100% rename from data-otservbr-global/monster/quests/ferumbras_ascendant/traps/void.lua rename to data-otservbr-global/monster/quests/ferumbras_ascension/traps/void.lua diff --git a/data-otservbr-global/npc/mazarius.lua b/data-otservbr-global/npc/mazarius.lua index a44e01e893f..df87ecd3541 100644 --- a/data-otservbr-global/npc/mazarius.lua +++ b/data-otservbr-global/npc/mazarius.lua @@ -61,28 +61,35 @@ local function creatureSayCallback(npc, creature, type, message) if MsgContains(message, "brings") then npcHandler:say("Ah, you have heard about my search for experienced help. And indeed your reputation for solving certain {problems} has preceded you.", npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "problems") then - npcHandler:say(" My problems are, so to say, dire news for the whole world. I don't want to confuse you with overly complicated and lengthy stories, so do you want to hear the {long} version or the {short}?", npc, creature) + npcHandler:say("My problems are, so to say, dire news for the whole world. I don't want to confuse you with overly complicated and lengthy stories, so do you want to hear the {long} version or the {short}?", npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "long") then - npcHandler:say("He obviously had taken an interest to the topic of ascension, and I came into possession of some of his early writings. ...You have to know I'm a scholar of some renown. In the course of my latest studies about ascension, I stumbled upon disturbing facts about the person of the all to well known Ferumbras, the fiendish. ...", npc, creature) - npcHandler:say("This, combined with investigation and divination, bit by bit led to the conclusion that all that Ferumbras has done in the past may be part of a cunning plan. ...", npc, creature) - npcHandler:say("Considering his writings and the books he based them upon, it became clear that Ferumbras is planning his ascension to godlike status. ...", npc, creature) - npcHandler:say("All of his attacks and defeats only served one purpose: to become an integral part of the people's knowledge, fears and beliefs. ...", npc, creature) - npcHandler:say("He actually used this as an energy source, and combined it with some sources of power which might not all be of our own world. ...", npc, creature) - npcHandler:say("He uses this energy to increasingly empower himself and will eventually be prepared to take the final step to transform himself into a godlike being. ...", npc, creature) - npcHandler:say("With the knowledge what to look for, I acquired expensive but powerful artefacts to scry the world for the expected power signature - and indeed I made contact. ...", npc, creature) - npcHandler:say("To my horror I had to recognise that Ferumbras had already made significant progress, and his final bid for ascension is imminent! ...", npc, creature) - npcHandler:say("His power levels are already too high for there to be any hope of stopping him with conventional means. ...", npc, creature) - npcHandler:say("But not all is lost yet. During my studies about godhood, I learned that the dark Zathroth himself had created a weapon so powerful that it could actually slay a god. ...", npc, creature) - npcHandler:say("Yet even he deemed this so-called '{godbreaker}' too dangerous, and split it into seven parts. These were at some point entrusted to his powerful minions, known as the Ruthless Seven. ...", npc, creature) - npcHandler:say("Ancient, forbidden texts hinted at a hellish place where the seven built deadly dungeons, and placed some of their most fearsome and terrible minions as guards, before they sealed the place off. ...", npc, creature) - npcHandler:say("I'm confident that I can prepare a matching ritual that will breach their protection and allow someone to enter their realm; but I'm in no way suited to handle the horrors to be encountered there. ...", npc, creature) - npcHandler:say("Therefore I have to ask you, if you are willing to retrieve the parts of the godbreaker, and face the threat of the ascending Ferumbras?", npc, creature) + npcHandler:say({ + "He obviously had taken an interest to the topic of ascension, and I came into possession of some of his early writings. ...You have to know I'm a scholar of some renown. In the course of my latest studies about ascension, I stumbled upon disturbing facts about the person of the all too well known Ferumbras, the fiendish. ...", + "This, combined with investigation and divination, bit by bit led to the conclusion that all that Ferumbras has done in the past may be part of a cunning plan. ...", + "Considering his writings and the books he based them upon, it became clear that Ferumbras is planning his ascension to godlike status. ...", + "All of his attacks and defeats only served one purpose: to become an integral part of the people's knowledge, fears and beliefs. ...", + "He actually used this as an energy source, and combined it with some sources of power which might not all be of our own world. ...", + "He uses this energy to increasingly empower himself and will eventually be prepared to take the final step to transform himself into a godlike being. ...", + "With the knowledge what to look for, I acquired expensive but powerful artefacts to scry the world for the expected power signature - and indeed I made contact. ...", + "To my horror I had to recognise that Ferumbras had already made significant progress, and his final bid for ascension is imminent! ...", + "His power levels are already too high for there to be any hope of stopping him with conventional means. ...", + "But not all is lost yet. During my studies about godhood, I learned that the dark Zathroth himself had created a weapon so powerful that it could actually slay a god. ...", + "Yet even he deemed this so-called '{godbreaker}' too dangerous, and split it into seven parts. These were at some point entrusted to his powerful minions, known as the Ruthless Seven. ...", + "Ancient, forbidden texts hinted at a hellish place where the seven built deadly dungeons, and placed some of their most fearsome and terrible minions as guards, before they sealed the place off. ...", + "I'm confident that I can prepare a matching ritual that will breach their protection and allow someone to enter their realm; but I'm in no way suited to handle the horrors to be encountered there. ...", + "Therefore I have to ask you, if you are willing to retrieve the parts of the godbreaker, and face the threat of the ascending Ferumbras?" + }, npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "short") then - npcHandler:say("My studies indicate that without all doubt Ferumbras the fiendish is in the process of accumulating nearly godlike powers. We have to stop him. ...", npc, creature) - npcHandler:say("Therefore I need you to enter a hellish dimension and acquire the parts of a weapon, the {godbreaker}, powerful enough to stop him once and for all. Are you willing to help me in this dire mission?", npc, creature) + npcHandler:say({ + "My studies indicate that without all doubt Ferumbras the fiendish is in the process of accumulating nearly godlike powers. We have to stop him.", + "Therefore I need you to enter a hellish dimension and acquire the parts of a weapon, the {godbreaker}, powerful enough to stop him once and for all. Are you willing to help me in this dire mission?" + }, npc, creature) npcHandler:setTopic(playerId, 2) - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 2 and player:getStorageValue(Storage.FerumbrasAscension.Access) < 1 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 2 and player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Access) < 1 then npcHandler:say("Good!, but I need 30 {demonic essences} to exchange with the demonic messenger for a ticket for you to enter the Abodes of Torments.", npc, creature) elseif MsgContains(message, "demonic essence") or MsgContains(message, "essence") then npcHandler:say("Do you have 30 demonic essences to offer to the demonic messenger?", npc, creature) @@ -91,59 +98,92 @@ local function creatureSayCallback(npc, creature, type, message) if player:removeItem(6499, 30) then npcHandler:say("Excellent! This will empower possibilty to create a breach is enough to let you pass into that hellish hiding place. ...", npc, creature) player:addItem(22182, 1) - player:setStorageValue(Storage.FerumbrasAscension.Access, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Access, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FirstDoor, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.MonsterDoor, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TarbazDoor, 1) + npcHandler:setTopic(playerId, 0) else npcHandler:say("You don't have the demonic essences, back here when you get it.", npc, creature) - npcHandler:removeInteraction(npc, creature) + npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "godbreaker") then - npcHandler:say("For a long time, I thought the godbreaker to be some apocryphal myth. But apparently others had learned about the godbreaker in the aeons past and lusted for its power. ...", npc, creature) - npcHandler:say("They had gathered hint after hint - until, ultimately, they were squashed by the Seven or their minions; which only made the leads that hinted at them all the more probable. ...", npc, creature) - npcHandler:say("What Zathroth hoped to accomplish with the creation of such a weapon can only be subject to speculation. Assumedly he already had slain Tibiasula, so the godbreaker might have been even more powerful, more absolute. ...", npc, creature) - npcHandler:say("However, it has to be assumed that in the end the sheer power of his creation scared Zathroth, who had to fear the weapon could one day be used against him. So he disassembled it. ...", npc, creature) - npcHandler:say("He kept the parts hidden and guarded, and if the resources can be trusted and my interpretation is right, moved them again and again, never satisfied with a hiding place. In the end he entrusted the parts to the {Ruthless Seven}. ...", npc, creature) - npcHandler:say("Knowing that they would never, ever allow one of their own to come in possession of all parts. Since then, the parts have been hidden in a {demi-plane} shared by the Seven.", npc, creature) - npcHandler:say("Well, I need 30 {demonic essences} to change for a passage to you can access", npc, creature) + npcHandler:say({ + "For a long time, I thought the godbreaker to be some apocryphal myth. But apparently others had learned about the godbreaker in the aeons past and lusted for its power. ...", + "They had gathered hint after hint - until, ultimately, they were squashed by the Seven or their minions; which only made the leads that hinted at them all the more probable. ...", + "What Zathroth hoped to accomplish with the creation of such a weapon can only be subject to speculation. Assumedly he already had slain Tibiasula, so the godbreaker might have been even more powerful, more absolute. ...", + "However, it has to be assumed that in the end the sheer power of his creation scared Zathroth, who had to fear the weapon could one day be used against him. So he disassembled it. ...", + "He kept the parts hidden and guarded, and if the resources can be trusted and my interpretation is right, moved them again and again, never satisfied with a hiding place. In the end he entrusted the parts to the {Ruthless Seven}. ...", + "Knowing that they would never, ever allow one of their own to come in possession of all parts. Since then, the parts have been hidden in a {demi-plane} shared by the Seven.", + "Well, I need 30 {demonic essences} to exchange for a passage so you can access." + }, npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "Ruthless Seven") or MsgContains(message, "ruthless seven") then npcHandler:say("Given the internal power plays amongst the Seven, they are the ideal keepers for individual parts of an powerful artefact. Not one of them would allow his compatriots to hold such a power, and neither would trust the other.", npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "demi-plane") then - npcHandler:say("It is a place, so to say, not completely of this world. It is separate of, yet strongly connected to, our own world. I would imagine it is quite limited in size and its laws of physics and magic should be roughly the same as ours. ...", npc, creature) - npcHandler:say("Being home to a host of demons for a while, I expect it to be an hostile and dangerous environment.", npc, creature) + npcHandler:say({ + "It is a place, so to say, not completely of this world. It is separate of, yet strongly connected to, our own world. I would imagine it is quite limited in size and its laws of physics and magic should be roughly the same as ours. ...", + "Being home to a host of demons for a while, I expect it to be a hostile and dangerous environment." + }, npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "ascension") then - npcHandler:say("Ascension is a fascinating topic that dates back to efforts and philosophies of some of the most ancient, and mostly extinct, races which fought in the godwars. ...", npc, creature) - npcHandler:say("Probably born out of desperation, they extensively researched ways to acquire godhood themselves. ...", npc, creature) - npcHandler:say("Some of them at least even met with moderate success. But the process is complicated at best, and may vary from race to race or even from one individual to another. ...", npc, creature) - npcHandler:say("The theories differ vastly and waxed and waned in popularity over the centuries if not aeons. Even today and in human society there are a number of obscure ascension cults. ...", npc, creature) - npcHandler:say("Some of them claim that humans are most suitable for ascension because they already own a bit of divinity through Banor's godly spark.", npc, creature) + npcHandler:say({ + "Ascension is a fascinating topic that dates back to efforts and philosophies of some of the most ancient, and mostly extinct, races which fought in the godwars. ...", + "Probably born out of desperation, they extensively researched ways to acquire godhood themselves. ...", + "Some of them at least even met with moderate success. But the process is complicated at best, and may vary from race to race or even from one individual to another. ...", + "The theories differ vastly and waxed and waned in popularity over the centuries if not aeons. Even today and in human society there are a number of obscure ascension cults. ...", + "Some of them claim that humans are most suitable for ascension because they already own a bit of divinity through Banor's godly spark." + }, npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "ferumbras") then - npcHandler:say("Although already powerful in his own right, it is obvious that his ultimate goal seems to be the ascension to godly powers. ...", npc, creature) - npcHandler:say("His whole existence seems to be centred on becoming a name that strikes fear into the heart of men and to become a persistent figure in the minds of humanity. ...", npc, creature) - npcHandler:say("This gives him a hold in reality and a kind of mould to fill with his power and conscience. It's also obvious that this kind of belief of the people alone won't be enough to empower him sufficiently. ...", npc, creature) - npcHandler:say("Therefore he has to tap into other, probably even more sinister power sources. I can't tell what these sources are, but my scrying revealed that he has reached massive amounts of power. He has probably been infusing himself since years. ...", npc, creature) - npcHandler:say("By now he is apparently reaching the end circle of his ascension and could make his final move any day.", npc, creature) + npcHandler:say({ + "Although already powerful in his own right, it is obvious that his ultimate goal seems to be the ascension to godly powers. ...", + "His whole existence seems to be centred on becoming a name that strikes fear into the heart of men and to become a persistent figure in the minds of humanity. ...", + "This gives him a hold in reality and a kind of mould to fill with his power and conscience. It's also obvious that this kind of belief of the people alone won't be enough to empower him sufficiently. ...", + "Therefore he has to tap into other, probably even more sinister power sources. I can't tell what these sources are, but my scrying revealed that he has reached massive amounts of power. He has probably been infusing himself since years. ...", + "By now he is apparently reaching the end circle of his ascension and could make his final move any day." + }, npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "bozarn") then npcHandler:say("Ah, a good man and a competent aid.", npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "darashia") then npcHandler:say("I like the quietness and the climate. And admittedly it helped my studies not to be constantly disturbed by petitioners.", npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "thais") then npcHandler:say("Thais has become a melting pot of some source. Yet whatever you melt, if the ingredients are corrupted, the outcome is always flawed.", npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "carlin") then npcHandler:say("Instead of banding together and starting to change something, they and Thais keep wasting resources in hostilities.", npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "kazordoon") then - npcHandler:say("The dwarves are leftovers from a time long gone by. They have outlived their usefulness to the gods and seem to have come to terms with that. ...", npc, creature) - npcHandler:say("They are as unchanging as rock and no greatness awaits them any more. They missed their chance, if they ever had any.", npc, creature) + npcHandler:say({ + "The dwarves are leftovers from a time long gone by. They have outlived their usefulness to the gods and seem to have come to terms with that. ...", + "They are as unchanging as rock and no greatness awaits them any more. They missed their chance, if they ever had any." + }, npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "ab'dendriel") then - npcHandler:say("The elves are like lost children. Their potential might be great, but they lack focus and dedication to truly improve. If their myths are true, some of the more early elves might have accomplished ascension. ...", npc, creature) - npcHandler:say("Yet even if hints strongly suggest those stories are true, the sheer inaction of those assumedly ascended beings is disturbing. Perhaps what those legendary elves achieved was something completely different.", npc, creature) + npcHandler:say({ + "The elves are like lost children. Their potential might be great, but they lack focus and dedication to truly improve. If their myths are true, some of the more early elves might have accomplished ascension. ...", + "Yet even if hints strongly suggest those stories are true, the sheer inaction of those assumedly ascended beings is disturbing. Perhaps what those legendary elves achieved was something completely different." + }, npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "edron") then npcHandler:say("Edron has become as stagnant as the teachings in its academy. No new idea has been thought there for decades. The whole Edron is an example for what happens when humanity has become fat and lazy.", npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "demons") then - npcHandler:say("With all their powers and vast magic knowledge they are still more pawns than anything else. Given their resources, ascension might seem within reach. ...", npc, creature) - npcHandler:say("The absence of any ascendant demon might prove that they are no true beings at all and literally damned to be stuck in their accursed forms.", npc, creature) + npcHandler:say({ + "With all their powers and vast magic knowledge they are still more pawns than anything else. Given their resources, ascension might seem within reach. ...", + "The absence of any ascendant demon might prove that they are no true beings at all and literally damned to be stuck in their accursed forms." + }, npc, creature) + npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "venore") then npcHandler:say("An almost laughable greed is persistent in that city. At least this makes knowledge and materials conveniently available to those who can match their prizes.", npc, creature) + npcHandler:setTopic(playerId, 0) else npcHandler:say("What?!", npc, creature) + npcHandler:setTopic(playerId, 0) end end npcHandler:setMessage(MESSAGE_GREET, "Greetings, dear visitor. Please tell me what {brings} you here, to my humble adobe.") diff --git a/data-otservbr-global/scripts/actions/bosses_levers/mazoran.lua b/data-otservbr-global/scripts/actions/bosses_levers/mazoran.lua deleted file mode 100644 index b43f674af30..00000000000 --- a/data-otservbr-global/scripts/actions/bosses_levers/mazoran.lua +++ /dev/null @@ -1,24 +0,0 @@ -local config = { - boss = { - name = "Mazoran", - position = Position(33584, 32689, 14), - }, - - timeToDefeat = 30 * 60, - playerPositions = { - { pos = Position(33593, 32644, 14), teleport = Position(33585, 32693, 14), effect = CONST_ME_TELEPORT }, - { pos = Position(33593, 32645, 14), teleport = Position(33585, 32693, 14), effect = CONST_ME_TELEPORT }, - { pos = Position(33593, 32646, 14), teleport = Position(33585, 32693, 14), effect = CONST_ME_TELEPORT }, - { pos = Position(33593, 32647, 14), teleport = Position(33585, 32693, 14), effect = CONST_ME_TELEPORT }, - { pos = Position(33593, 32648, 14), teleport = Position(33585, 32693, 14), effect = CONST_ME_TELEPORT }, - }, - specPos = { - from = Position(33570, 32677, 14), - to = Position(33597, 32700, 14), - }, - exit = Position(33319, 32318, 13), -} - -local lever = BossLever(config) -lever:uid(1025) -lever:register() diff --git a/data-otservbr-global/scripts/actions/bosses_levers/plagirath.lua b/data-otservbr-global/scripts/actions/bosses_levers/plagirath.lua deleted file mode 100644 index 65207dae0b4..00000000000 --- a/data-otservbr-global/scripts/actions/bosses_levers/plagirath.lua +++ /dev/null @@ -1,24 +0,0 @@ -local config = { - boss = { - name = "Plagirath", - position = Position(33172, 31501, 13), - }, - - timeToDefeat = 30 * 60, - playerPositions = { - { pos = Position(33229, 31500, 13), teleport = Position(33173, 31504, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33229, 31501, 13), teleport = Position(33173, 31504, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33229, 31502, 13), teleport = Position(33173, 31504, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33229, 31503, 13), teleport = Position(33173, 31504, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33229, 31504, 13), teleport = Position(33173, 31504, 13), effect = CONST_ME_TELEPORT }, - }, - specPos = { - from = Position(33159, 31488, 13), - to = Position(33190, 31515, 13), - }, - exit = Position(33319, 32318, 13), -} - -local lever = BossLever(config) -lever:uid(1022) -lever:register() diff --git a/data-otservbr-global/scripts/actions/bosses_levers/ragiaz.lua b/data-otservbr-global/scripts/actions/bosses_levers/ragiaz.lua deleted file mode 100644 index 4fc83e29aa0..00000000000 --- a/data-otservbr-global/scripts/actions/bosses_levers/ragiaz.lua +++ /dev/null @@ -1,30 +0,0 @@ -local config = { - boss = { - name = "Ragiaz", - position = Position(33481, 32334, 13), - }, - - timeToDefeat = 30 * 60, - playerPositions = { - { pos = Position(33456, 32356, 13), teleport = Position(33482, 32339, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33457, 32356, 13), teleport = Position(33482, 32339, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33458, 32356, 13), teleport = Position(33482, 32339, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33459, 32356, 13), teleport = Position(33482, 32339, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33460, 32356, 13), teleport = Position(33482, 32339, 13), effect = CONST_ME_TELEPORT }, - }, - monsters = { - { name = "Death Dragon", pos = Position(33476, 32331, 13) }, - { name = "Death Dragon", pos = Position(33476, 32340, 13) }, - { name = "Death Dragon", pos = Position(33487, 32340, 13) }, - { name = "Death Dragon", pos = Position(33488, 32331, 13) }, - }, - specPos = { - from = Position(33468, 32319, 13), - to = Position(33495, 32347, 13), - }, - exit = Position(33319, 32318, 13), -} - -local lever = BossLever(config) -lever:uid(1023) -lever:register() diff --git a/data-otservbr-global/scripts/actions/bosses_levers/razzagorn.lua b/data-otservbr-global/scripts/actions/bosses_levers/razzagorn.lua deleted file mode 100644 index 6e6f9348b87..00000000000 --- a/data-otservbr-global/scripts/actions/bosses_levers/razzagorn.lua +++ /dev/null @@ -1,24 +0,0 @@ -local config = { - boss = { - name = "Razzagorn", - position = Position(33422, 32467, 14), - }, - - timeToDefeat = 30 * 60, - playerPositions = { - { pos = Position(33386, 32455, 14), teleport = Position(33419, 32467, 14), effect = CONST_ME_TELEPORT }, - { pos = Position(33387, 32455, 14), teleport = Position(33419, 32467, 14), effect = CONST_ME_TELEPORT }, - { pos = Position(33388, 32455, 14), teleport = Position(33419, 32467, 14), effect = CONST_ME_TELEPORT }, - { pos = Position(33389, 32455, 14), teleport = Position(33419, 32467, 14), effect = CONST_ME_TELEPORT }, - { pos = Position(33390, 32455, 14), teleport = Position(33419, 32467, 14), effect = CONST_ME_TELEPORT }, - }, - specPos = { - from = Position(33407, 32453, 14), - to = Position(33439, 32481, 14), - }, - exit = Position(33319, 32318, 13), -} - -local lever = BossLever(config) -lever:uid(1024) -lever:register() diff --git a/data-otservbr-global/scripts/actions/bosses_levers/shulgrax.lua b/data-otservbr-global/scripts/actions/bosses_levers/shulgrax.lua deleted file mode 100644 index 2a2305bfd52..00000000000 --- a/data-otservbr-global/scripts/actions/bosses_levers/shulgrax.lua +++ /dev/null @@ -1,24 +0,0 @@ -local config = { - boss = { - name = "Shulgrax", - position = Position(33485, 32786, 13), - }, - - timeToDefeat = 30 * 60, - playerPositions = { - { pos = Position(33434, 32785, 13), teleport = Position(33485, 32790, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33434, 32786, 13), teleport = Position(33485, 32790, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33434, 32787, 13), teleport = Position(33485, 32790, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33434, 32788, 13), teleport = Position(33485, 32790, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33434, 32789, 13), teleport = Position(33485, 32790, 13), effect = CONST_ME_TELEPORT }, - }, - specPos = { - from = Position(33474, 32775, 13), - to = Position(33496, 32798, 13), - }, - exit = Position(33319, 32318, 13), -} - -local lever = BossLever(config) -lever:uid(1028) -lever:register() diff --git a/data-otservbr-global/scripts/actions/bosses_levers/tarbaz.lua b/data-otservbr-global/scripts/actions/bosses_levers/tarbaz.lua deleted file mode 100644 index 13cdb5766f8..00000000000 --- a/data-otservbr-global/scripts/actions/bosses_levers/tarbaz.lua +++ /dev/null @@ -1,24 +0,0 @@ -local config = { - boss = { - name = "Tarbaz", - position = Position(33459, 32844, 11), - }, - - timeToDefeat = 30 * 60, - playerPositions = { - { pos = Position(33418, 32849, 11), teleport = Position(33459, 32848, 11), effect = CONST_ME_TELEPORT }, - { pos = Position(33418, 32850, 11), teleport = Position(33459, 32848, 11), effect = CONST_ME_TELEPORT }, - { pos = Position(33418, 32851, 11), teleport = Position(33459, 32848, 11), effect = CONST_ME_TELEPORT }, - { pos = Position(33418, 32852, 11), teleport = Position(33459, 32848, 11), effect = CONST_ME_TELEPORT }, - { pos = Position(33418, 32853, 11), teleport = Position(33459, 32848, 11), effect = CONST_ME_TELEPORT }, - }, - specPos = { - from = Position(33447, 32832, 11), - to = Position(33473, 32856, 11), - }, - exit = Position(33319, 32318, 13), -} - -local lever = BossLever(config) -lever:uid(1027) -lever:register() diff --git a/data-otservbr-global/scripts/actions/bosses_levers/zamulosh.lua b/data-otservbr-global/scripts/actions/bosses_levers/zamulosh.lua deleted file mode 100644 index 94c7d59c0b2..00000000000 --- a/data-otservbr-global/scripts/actions/bosses_levers/zamulosh.lua +++ /dev/null @@ -1,33 +0,0 @@ -local config = { - boss = { - name = "Zamulosh", - position = Position(33643, 32756, 11), - }, - - timeToDefeat = 30 * 60, - playerPositions = { - { pos = Position(33680, 32741, 11), teleport = Position(33644, 32760, 11), effect = CONST_ME_TELEPORT }, - { pos = Position(33680, 32742, 11), teleport = Position(33644, 32760, 11), effect = CONST_ME_TELEPORT }, - { pos = Position(33680, 32743, 11), teleport = Position(33644, 32760, 11), effect = CONST_ME_TELEPORT }, - { pos = Position(33680, 32744, 11), teleport = Position(33644, 32760, 11), effect = CONST_ME_TELEPORT }, - { pos = Position(33680, 32745, 11), teleport = Position(33644, 32760, 11), effect = CONST_ME_TELEPORT }, - }, - specPos = { - from = Position(33632, 32747, 11), - to = Position(33654, 32765, 11), - }, - exit = Position(33319, 32318, 13), -} - -local zamuloshSummons = { - Position(33642, 32756, 11), - Position(33642, 32756, 11), - Position(33642, 32756, 11), - Position(33644, 32756, 11), - Position(33644, 32756, 11), - Position(33644, 32756, 11), -} - -local lever = BossLever(config) -lever:uid(1026) -lever:register() diff --git a/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua b/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua index bd6302fdf04..bf0e1430635 100644 --- a/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua +++ b/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua @@ -310,12 +310,12 @@ local questTable = { { storage = Storage.CultsOfTibia.Misguided.AccessDoor, storageValue = 1 }, { storage = Storage.CultsOfTibia.FinalBoss.AccessDoor, storageValue = 1 }, - { storage = Storage.FerumbrasAscension.FirstDoor, storageValue = 1 }, - { storage = Storage.FerumbrasAscension.MonsterDoor, storageValue = 1 }, - { storage = Storage.FerumbrasAscension.TarbazDoor, storageValue = 1 }, - { storage = Storage.FerumbrasAscension.HabitatsAccess, storageValue = 1 }, - { storage = Storage.FerumbrasAscension.TheLordOfTheLiceAccess, storageValue = 1 }, - { storage = Storage.FerumbrasAscension.Statue, storageValue = 1 }, + { storage = Storage.Quest.U10_90.FerumbrasAscension.FirstDoor, storageValue = 1 }, + { storage = Storage.Quest.U10_90.FerumbrasAscension.MonsterDoor, storageValue = 1 }, + { storage = Storage.Quest.U10_90.FerumbrasAscension.TarbazDoor, storageValue = 1 }, + { storage = Storage.Quest.U10_90.FerumbrasAscension.HabitatsAccess, storageValue = 1 }, + { storage = Storage.Quest.U10_90.FerumbrasAscension.TheLordOfTheLiceAccess, storageValue = 1 }, + { storage = Storage.Quest.U10_90.FerumbrasAscension.Statue, storageValue = 1 }, { storage = Storage.Quest.U12_00.TheDreamCourts.AndrewDoor, storageValue = 1 }, diff --git a/data-otservbr-global/scripts/globalevents/others/map_attributes_loader.lua b/data-otservbr-global/scripts/globalevents/others/map_attributes_loader.lua index 7000a36bc34..af5b0e80fd7 100644 --- a/data-otservbr-global/scripts/globalevents/others/map_attributes_loader.lua +++ b/data-otservbr-global/scripts/globalevents/others/map_attributes_loader.lua @@ -39,8 +39,8 @@ local function resetGlobalStorages() end local function resetFerumbrasAscendantQuestHabitats() - for i = 1, #GlobalStorage.FerumbrasAscendant.Habitats do - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats[i], 0) + for i = 1, #Storage.Quest.U10_90.FerumbrasAscension.Habitats do + Game.setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats[i], 0) end end diff --git a/data-otservbr-global/scripts/lib/register_actions.lua b/data-otservbr-global/scripts/lib/register_actions.lua index 0a8dcfc0bba..6d6ab616689 100644 --- a/data-otservbr-global/scripts/lib/register_actions.lua +++ b/data-otservbr-global/scripts/lib/register_actions.lua @@ -215,27 +215,13 @@ local cutItems = { -- Ferumbras ascendant ring reward local function addFerumbrasAscendantReward(player, target, toPosition) - local stonePos = Position(32648, 32134, 10) - if toPosition == stonePos then - local tile = Tile(stonePos) - local stone = tile:getItemById(1772) - if stone then - stone:remove(1) - toPosition:sendMagicEffect(CONST_ME_POFF) - addEvent(function() - Game.createItem(1772, 1, stonePos) - end, 20000) - return true - end - end - if target.itemid == 22872 and target.actionid == 53803 then - if player:getStorageValue(Storage.FerumbrasAscension.Ring) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Ring) >= 1 then return false end player:addItem(22170, 1) - player:setStorageValue(Storage.FerumbrasAscension.Ring, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Ring, 1) end end diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_ferumbras_lever.lua b/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_ferumbras_lever.lua deleted file mode 100644 index c259b308c0b..00000000000 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_ferumbras_lever.lua +++ /dev/null @@ -1,86 +0,0 @@ -local config = AscendingFerumbrasConfig - -local function clearFerumbrasRoom() - local spectators = Game.getSpectators(config.bossPos, false, false, 20, 20, 20, 20) - for i = 1, #spectators do - local spectator = spectators[i] - if spectator:isPlayer() then - spectator:teleportTo(config.exitPosition) - spectator:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - spectator:say("Time out! You were teleported out by strange forces.", TALKTYPE_MONSTER_SAY) - elseif spectator:isMonster() then - spectator:remove() - end - end -end - -local ferumbrasAscendantLever = Action() -function ferumbrasAscendantLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if item.itemid == 8911 then - if player:getPosition() ~= config.leverPos then - return true - end - - for x = 33269, 33271 do - for y = 31477, 31481 do - local playerTile = Tile(Position(x, y, 14)):getTopCreature() - if playerTile and playerTile:isPlayer() then - if not playerTile:canFightBoss("Ferumbras Mortal Shell") then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You or a member in your team have to wait %d days to face Ferumbras again!", config.days)) - item:transform(8912) - return true - end - end - end - end - - local specs, spec = Game.getSpectators(config.centerRoom, false, false, 15, 15, 15, 15) - for i = 1, #specs do - spec = specs[i] - if spec:isPlayer() then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There's someone fighting with Ferumbras.") - return true - end - end - - local spectators = Game.getSpectators(config.bossPos, false, false, 15, 15, 15, 15) - for i = 1, #spectators do - local spectator = spectators[i] - if spectator:isMonster() then - spectator:remove() - end - end - - for x = 33269, 33271 do - for y = 31477, 31481 do - local playerTile = Tile(Position(x, y, 14)):getTopCreature() - if playerTile and playerTile:isPlayer() then - playerTile:getPosition():sendMagicEffect(CONST_ME_POFF) - playerTile:teleportTo(config.newPos) - playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - playerTile:setBossCooldown("Ferumbras Mortal Shell", os.time() + config.days * 24 * 3600) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have %d minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.", config.time)) - addEvent(clearFerumbrasRoom, config.time * 60 * 1000, player:getId(), config.centerRoom, config.range, config.range, config.exitPosition) - - for b = 1, config.maxSummon do - local xrand = math.random(-10, 10) - local yrand = math.random(-10, 10) - local position = Position(33392 + xrand, 31473 + yrand, 14) - if not Game.createMonster(config.summonName, position) then - logger.error("[ferumbrasAscendantLever.onUse] can't create monster {}, on position {}", config.summonName, position:toString()) - end - end - - Game.createMonster(config.bossName, config.bossPos, true, true) - item:transform(8912) - end - end - end - elseif item.itemid == 8912 then - item:transform(8911) - return true - end -end - -ferumbrasAscendantLever:uid(1021) -ferumbrasAscendantLever:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_rat_lever.lua b/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_rat_lever.lua deleted file mode 100644 index 6c9a1b7db9c..00000000000 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_rat_lever.lua +++ /dev/null @@ -1,49 +0,0 @@ -local config = { - centerRoom = Position(33215, 31456, 12), - BossPosition = Position(33220, 31460, 12), - playerPositions = { - Position(33197, 31475, 11), - Position(33198, 31475, 11), - Position(33199, 31475, 11), - Position(33200, 31475, 11), - Position(33201, 31475, 11), - }, - newPosition = Position(33215, 31470, 12), -} - -local ferumbrasAscendantRatLever = Action() -function ferumbrasAscendantRatLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if item.itemid == 8911 then - if player:getPosition() ~= Position(33201, 31475, 11) then - item:transform(8912) - return true - end - end - if item.itemid == 8911 then - local specs, spec = Game.getSpectators(config.centerRoom, false, false, 30, 30, 30, 30) - for i = 1, #specs do - spec = specs[i] - if spec:isPlayer() then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting with The Lord of The Lice.") - return true - end - end - Game.createMonster("the lord of the lice", config.BossPosition, true, true) - for x = 33197, 33201 do - local playerTile = Tile(Position(x, 31475, 11)):getTopCreature() - if playerTile and playerTile:isPlayer() then - playerTile:getPosition():sendMagicEffect(CONST_ME_POFF) - playerTile:teleportTo(config.newPosition) - playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - end - end - addEvent(clearForgotten, 30 * 60 * 1000, Position(33187, 31429, 12), Position(33242, 31487, 12), Position(33319, 32318, 13)) - item:transform(8912) - elseif item.itemid == 8912 then - item:transform(8911) - end - return true -end - -ferumbrasAscendantRatLever:uid(1030) -ferumbrasAscendantRatLever:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_the_shatterer_lever.lua b/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_the_shatterer_lever.lua deleted file mode 100644 index 5ee308349da..00000000000 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_the_shatterer_lever.lua +++ /dev/null @@ -1,51 +0,0 @@ -local config = { - centerRoom = Position(33406, 32418, 14), - BossPosition = Position(33406, 32418, 14), - playerPositions = { - Position(33403, 32465, 13), - Position(33404, 32465, 13), - Position(33405, 32465, 13), - Position(33406, 32465, 13), - Position(33407, 32465, 13), - }, - newPosition = Position(33398, 32414, 14), -} - -local ferumbrasAscendantTheShattererLever = Action() -function ferumbrasAscendantTheShattererLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if item.itemid == 8911 then - if player:getPosition() ~= Position(33403, 32465, 13) then - item:transform(8912) - return true - end - end - if item.itemid == 8911 then - local specs, spec = Game.getSpectators(config.centerRoom, false, false, 30, 30, 30, 30) - for i = 1, #specs do - spec = specs[i] - if spec:isPlayer() then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting with The Shatterer.") - return true - end - end - Game.createMonster("The Shatterer", config.BossPosition, true, true) - for x = 33403, 33407 do - local playerTile = Tile(Position(x, 32465, 13)):getTopCreature() - if playerTile and playerTile:isPlayer() then - playerTile:getPosition():sendMagicEffect(CONST_ME_POFF) - playerTile:teleportTo(config.newPosition) - playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - end - end - Game.setStorageValue(Storage.FerumbrasAscension.TheShattererLever, 0) - Game.setStorageValue(Storage.FerumbrasAscension.TheShattererTimer, 1) - addEvent(clearForgotten, 30 * 60 * 1000, Position(33377, 32390, 14), Position(33446, 32447, 14), Position(33319, 32318, 13), Storage.FerumbrasAscension.TheShattererTimer) - item:transform(8912) - elseif item.itemid == 8912 then - item:transform(8911) - end - return true -end - -ferumbrasAscendantTheShattererLever:uid(1029) -ferumbrasAscendantTheShattererLever:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_bosses_kill.lua b/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_bosses_kill.lua deleted file mode 100644 index 8993c4b9063..00000000000 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_bosses_kill.lua +++ /dev/null @@ -1,76 +0,0 @@ -local bosses = { - ["the lord of the lice"] = { teleportPos = Position(33226, 31478, 12), godbreakerPos = Position(33237, 31477, 13) }, - ["tarbaz"] = { teleportPos = Position(33460, 32853, 11), godbreakerPos = Position(33427, 32852, 13) }, - ["ragiaz"] = { teleportPos = Position(33482, 32345, 13), godbreakerPos = Position(33466, 32392, 13) }, - ["plagirath"] = { teleportPos = Position(33174, 31511, 13), godbreakerPos = Position(33204, 31510, 13) }, - ["razzagorn"] = { teleportPos = Position(33357, 32434, 12), godbreakerPos = Position(33357, 32440, 13) }, - ["zamulosh"] = { teleportPos = Position(33644, 32764, 11), godbreakerPos = Position(33678, 32758, 13) }, - ["mazoran"] = { teleportPos = Position(33585, 32699, 14), godbreakerPos = Position(33614, 32679, 15) }, - ["shulgrax"] = { teleportPos = Position(33486, 32796, 13), godbreakerPos = Position(33459, 32820, 14) }, - ["ferumbras mortal shell"] = { teleportPos = Position(33392, 31485, 14), godbreakerPos = Position(33388, 31414, 14) }, -} - -local crystals = { - [1] = { crystalPosition = Position(33390, 31468, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal1 }, - [2] = { crystalPosition = Position(33394, 31468, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal2 }, - [3] = { crystalPosition = Position(33397, 31471, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal3 }, - [4] = { crystalPosition = Position(33397, 31475, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal4 }, - [5] = { crystalPosition = Position(33394, 31478, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal5 }, - [6] = { crystalPosition = Position(33390, 31478, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal6 }, - [7] = { crystalPosition = Position(33387, 31475, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal7 }, - [8] = { crystalPosition = Position(33387, 31471, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal8 }, -} -local function transformCrystal() - for c = 1, #crystals do - local crystal = crystals[c] - Game.getStorageValue(crystal.globalStorage, 0) - Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals, 0) - local item = Tile(crystal.crystalPosition):getItemById(14961) - if item then - item:transform(14955) - end - end -end - -local function revertTeleport(position, itemId, transformId, destination) - local item = Tile(position):getItemById(itemId) - if item then - item:transform(transformId) - item:setDestination(destination) - end -end - -local ascendantBossesKill = CreatureEvent("AscendantBossesDeath") -function ascendantBossesKill.onDeath(creature) - local bossConfig = bosses[creature:getName():lower()] - if not bossConfig then - return true - end - - onDeathForDamagingPlayers(creature, function(creature, player) - if creature:getName():lower() == "ferumbras mortal shell" then - player:setBossCooldown(creature:getName(), os.time() + AscendingFerumbrasConfig.days * 24 * 3600) - elseif creature:getName():lower() == "the lord of the lice" then - player:setStorageValue(Storage.FerumbrasAscension.TheLordOfTheLiceAccess, 1) - end - end) - - local teleport = Tile(bossConfig.teleportPos):getItemById(1949) - if not teleport then - return true - end - - if teleport then - teleport:transform(22761) - creature:getPosition():sendMagicEffect(CONST_ME_THUNDER) - teleport:setDestination(bossConfig.godbreakerPos) - addEvent(revertTeleport, 2 * 60 * 1000, bossConfig.teleportPos, 22761, 1949, Position(33319, 32318, 13)) - end - - if creature:getName():lower() == "ferumbras mortal shell" then - addEvent(transformCrystal, 2 * 60 * 1000) - end - return true -end - -ascendantBossesKill:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_boss_teleport.lua b/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_boss_teleport.lua deleted file mode 100644 index 812cfff1421..00000000000 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_boss_teleport.lua +++ /dev/null @@ -1,36 +0,0 @@ -local config = { - [24830] = { storage = Storage.FerumbrasAscension.Razzagorn }, - [24831] = { storage = Storage.FerumbrasAscension.Ragiaz }, - [24832] = { storage = Storage.FerumbrasAscension.Zamulosh }, - [24833] = { storage = Storage.FerumbrasAscension.Mazoran }, - [24834] = { storage = Storage.FerumbrasAscension.Tarbaz }, - [24835] = { storage = Storage.FerumbrasAscension.Shulgrax }, - [24836] = { storage = Storage.FerumbrasAscension.Plagirath }, -} - -local bossTeleport = MoveEvent() - -function bossTeleport.onStepIn(creature, item, position, fromPosition) - local teleport = config[item.actionid] - if not teleport then - return false - end - local player = creature:getPlayer() - if not player then - return true - end - if player:getStorageValue(teleport.storage) == 1 then - local position = player:getPosition() - position.z = position.z - 1 - player:teleportTo(position) - end - return true -end - -bossTeleport:type("stepin") - -for index, value in pairs(config) do - bossTeleport:aid(index) -end - -bossTeleport:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_desperate_soul.lua b/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_desperate_soul.lua deleted file mode 100644 index 63c79aa5d44..00000000000 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_desperate_soul.lua +++ /dev/null @@ -1,18 +0,0 @@ -local desperateSoul = MoveEvent() - -function desperateSoul.onStepIn(creature, item, position, fromPosition) - local monster = creature:getMonster() - if not monster or monster:getName():lower() ~= "desperate soul" then - return true - end - - monster:remove() - position:sendMagicEffect(CONST_ME_POFF) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence, 1) - addEvent(Game.setStorageValue, 2 * 60 * 1000, GlobalStorage.FerumbrasAscendant.FerumbrasEssence, 0) - return true -end - -desperateSoul:type("stepin") -desperateSoul:aid(54390) -desperateSoul:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_entrance.lua b/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_entrance.lua deleted file mode 100644 index 356434282bb..00000000000 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_entrance.lua +++ /dev/null @@ -1,53 +0,0 @@ -local config = { - [1] = { storage = Storage.FerumbrasAscension.Razzagorn }, - [2] = { storage = Storage.FerumbrasAscension.Ragiaz }, - [3] = { storage = Storage.FerumbrasAscension.Zamulosh }, - [4] = { storage = Storage.FerumbrasAscension.Mazoran }, - [5] = { storage = Storage.FerumbrasAscension.Tarbaz }, - [6] = { storage = Storage.FerumbrasAscension.Shulgrax }, - [7] = { storage = Storage.FerumbrasAscension.Plagirath }, -} - -local entrance = MoveEvent() - -function entrance.onStepIn(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then - return true - end - local complete = false - for i = 1, #config do - local storage = config[i].storage - if player:getStorageValue(storage) ~= 1 then - complete = false - else - complete = true - end - end - if item:getActionId() == 24837 then - if complete then - player:teleportTo(Position(33275, 32390, 9)) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - return true - else - player:teleportTo(Position(33275, 32390, 8)) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - return true - end - elseif item:getActionId() == 24838 then - if player:getStorageValue(Storage.FerumbrasAscension.Access) < 1 then - player:teleportTo(Position(33275, 32390, 8)) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This portal is not yet strong enough to breach the destination dimension.") - return true - end - player:teleportTo(Position(33319, 32317, 13)) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - return true - end - return true -end - -entrance:type("stepin") -entrance:aid(24837, 24838) -entrance:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_lovely_monsters.lua b/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_lovely_monsters.lua deleted file mode 100644 index f9808413ca6..00000000000 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_lovely_monsters.lua +++ /dev/null @@ -1,50 +0,0 @@ -local config = { - [34315] = { name = "lovely frazzlemaw", centerPos = Position(33618, 32666, 12) }, - [34316] = { name = "lovely deer", centerPos = Position(33641, 32666, 12) }, - [34317] = { name = "lovely rotworm", centerPos = Position(33618, 32684, 12) }, - [34318] = { name = "lovely scorpion", centerPos = Position(33641, 32684, 12) }, - [34319] = { name = "lovely snake", centerPos = Position(33618, 32702, 12) }, - [34320] = { name = "lovely polar bear", centerPos = Position(33641, 32702, 12) }, - [34321] = { name = "lovely souleater", centerPos = Position(33618, 32720, 12) }, - [34322] = { name = "lovely yielothax", centerPos = Position(33641, 32720, 12) }, -} - -local lovelyMonsters = MoveEvent() - -function lovelyMonsters.onStepIn(creature, item, position, fromPosition) - local config = config[item.actionid] - if not config then - return true - end - - if creature:isPlayer() then - return true - end - - local monster = creature:getMonster() - if monster:getName():lower() == config.name then - monster:say("That seemed correct!", TALKTYPE_MONSTER_SAY) - monster:getPosition():sendMagicEffect(CONST_ME_THUNDER) - monster:remove() - local spectators = Game.getSpectators(config.centerPos, false, true, 9, 9, 9, 9) - for _, spectator in pairs(spectators) do - if spectator:isPlayer() then - local player = spectator - if player:getStorageValue(Storage.FerumbrasAscension.ZamuloshTeleports) < 0 then - player:setStorageValue(Storage.FerumbrasAscension.ZamuloshTeleports, 0) - end - player:setStorageValue(Storage.FerumbrasAscension.ZamuloshTeleports, player:getStorageValue(Storage.FerumbrasAscension.ZamuloshTeleports) + 1) - end - end - return true - end - return true -end - -lovelyMonsters:type("stepin") - -for index, value in pairs(config) do - lovelyMonsters:aid(index) -end - -lovelyMonsters:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_seal.lua b/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_seal.lua deleted file mode 100644 index f8727da061e..00000000000 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_seal.lua +++ /dev/null @@ -1,117 +0,0 @@ -local config = { - [24839] = { - toPosition = Position(33419, 32841, 11), - backPosition = Position(33484, 32775, 12), - boss = "Tarbaz", - }, - [24840] = { - toPosition = Position(33452, 32356, 13), - backPosition = Position(33432, 32330, 14), - boss = "Ragiaz", - }, - [24841] = { - toPosition = Position(33230, 31493, 13), - backPosition = Position(33197, 31438, 13), - boss = "Plagirath", - }, - [24842] = { - toPosition = Position(33380, 32454, 14), - backPosition = Position(33399, 32402, 15), - boss = "Razzagorn", - }, - [24843] = { - toPosition = Position(33680, 32736, 11), - backPosition = Position(33664, 32682, 10), - boss = "Zamulosh", - }, - [24844] = { - toPosition = Position(33593, 32658, 14), - backPosition = Position(33675, 32690, 13), - boss = "Mazoran", - }, - [24845] = { - toPosition = Position(33436, 32800, 13), - backPosition = Position(33477, 32701, 14), - boss = "Shulgrax", - }, - [24846] = { - toPosition = Position(33270, 31474, 14), - backPosition = Position(33324, 31374, 14), - boss = "Ferumbras Mortal Shell", - }, -} - -local seal = MoveEvent() - -function seal.onStepIn(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then - return true - end - - local setting = config[item.actionid] - if not setting then - return true - end - - if item.actionid == 24844 then - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done) >= 4 then - if player:canFightBoss(setting.boss) then - player:teleportTo(setting.toPosition) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - else - player:teleportTo(Position(33675, 32690, 13)) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - player:say("You have to wait to challenge this enemy again!", TALKTYPE_MONSTER_SAY) - return true - end - else - local pos = position - pos.y = pos.y + 2 - player:teleportTo(pos) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You not proven your worth. There is no escape for you here.") - item:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - return true - end - end - if item.actionid == 24845 then - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.FlowerPuzzleTimer) >= 1 then - if player:canFightBoss(setting.boss) then - player:teleportTo(setting.toPosition) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - else - player:teleportTo(Position(33477, 32701, 14)) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - player:say("You have to wait to challenge this enemy again!", TALKTYPE_MONSTER_SAY) - return true - end - else - local pos = position - pos.y = pos.y + 2 - player:teleportTo(pos) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You not proven your worth. There is no escape for you here.") - item:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - return true - end - end - if player:canFightBoss(setting.boss) then - player:teleportTo(setting.toPosition) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - elseif item.actionid == 24846 then - local days = AscendingFerumbrasConfig.days - player:say("You cannot enter, you must wait " .. days .. " days after preventing the ascension of Ferumbras.", TALKTYPE_MONSTER_SAY) - else - player:teleportTo(setting.backPosition) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - player:say("You have to wait to challenge this enemy again!", TALKTYPE_MONSTER_SAY) - end - return true -end - -seal:type("stepin") - -for index, value in pairs(config) do - seal:aid(index) -end - -seal:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_bone_flute.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_bone_flute.lua similarity index 86% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_bone_flute.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_bone_flute.lua index def47cc49ca..33b9604a7d2 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_bone_flute.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_bone_flute.lua @@ -3,7 +3,7 @@ function ferumbrasAscendantBoneFlute.onUse(player, item, fromPosition, target, t if target:isItem() then return false end - if player:getStorageValue(Storage.FerumbrasAscension.BoneFlute) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.BoneFlute) >= 1 then return false end if not target:getPosition():isInRange(Position(33477, 32775, 11), Position(33493, 32781, 11)) then @@ -13,7 +13,7 @@ function ferumbrasAscendantBoneFlute.onUse(player, item, fromPosition, target, t local rand = math.random(100) if rand <= 5 then player:say("Finally this one reveal your spirit animal.", TALKTYPE_MONSTER_SAY) - player:setStorageValue(Storage.FerumbrasAscension.BoneFlute, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.BoneFlute, 1) item:remove() return true elseif rand > 5 and rand <= 50 then diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_bone_flute_wall.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_bone_flute_wall.lua similarity index 70% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_bone_flute_wall.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_bone_flute_wall.lua index 53350db1f4f..f69efcb46a7 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_bone_flute_wall.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_bone_flute_wall.lua @@ -1,8 +1,8 @@ local ferumbrasAscendantBoneWall = Action() function ferumbrasAscendantBoneWall.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.FerumbrasAscension.BoneFluteWall) < 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.BoneFluteWall) < 1 then player:addItem(22254) - player:setStorageValue(Storage.FerumbrasAscension.BoneFluteWall, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.BoneFluteWall, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a bone flute.") toPosition:sendMagicEffect(CONST_ME_THUNDER) else diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_boots_of_homecoming.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_boots_of_homecoming.lua similarity index 100% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_boots_of_homecoming.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_boots_of_homecoming.lua diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_color_levers.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_color_levers.lua similarity index 57% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_color_levers.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_color_levers.lua index 8607f99b4cb..6ef051008a9 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_color_levers.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_color_levers.lua @@ -1,37 +1,37 @@ local ferumbrasAscendantColorLevers = Action() function ferumbrasAscendantColorLevers.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.FerumbrasAscension.FirstDoor) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FirstDoor) >= 1 then item:transform(item.itemid == 9125 and 9126 or 9125) return true end if item.actionid == 54381 then - if player:getStorageValue(Storage.FerumbrasAscension.ColorLever) < 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ColorLever) < 1 then local rand = math.random(4) - player:setStorageValue(Storage.FerumbrasAscension.ColorLever, rand) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ColorLever, rand) player:getPosition():sendMagicEffect(166 + rand) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You choose the colour of decay.") end elseif item.actionid == 54382 then - if player:getStorageValue(Storage.FerumbrasAscension.ColorLever) == 1 then - player:setStorageValue(Storage.FerumbrasAscension.FirstDoor, 1) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ColorLever) == 1 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FirstDoor, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You select the correct colour.") toPosition:sendMagicEffect(CONST_ME_POFF) end elseif item.actionid == 54383 then - if player:getStorageValue(Storage.FerumbrasAscension.ColorLever) == 3 then - player:setStorageValue(Storage.FerumbrasAscension.FirstDoor, 1) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ColorLever) == 3 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FirstDoor, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You select the correct colour.") toPosition:sendMagicEffect(CONST_ME_POFF) end elseif item.actionid == 54384 then - if player:getStorageValue(Storage.FerumbrasAscension.ColorLever) == 4 then - player:setStorageValue(Storage.FerumbrasAscension.FirstDoor, 1) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ColorLever) == 4 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FirstDoor, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You select the correct colour.") toPosition:sendMagicEffect(CONST_ME_POFF) end elseif item.actionid == 54385 then - if player:getStorageValue(Storage.FerumbrasAscension.ColorLever) == 2 then - player:setStorageValue(Storage.FerumbrasAscension.FirstDoor, 1) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ColorLever) == 2 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FirstDoor, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You select the correct colour.") toPosition:sendMagicEffect(CONST_ME_POFF) end diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_ferumbras_amulet.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_ferumbras_amulet.lua similarity index 100% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_ferumbras_amulet.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_ferumbras_amulet.lua diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_ferumbras_lever.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_ferumbras_lever.lua new file mode 100644 index 00000000000..83c284d8be0 --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_ferumbras_lever.lua @@ -0,0 +1,105 @@ +local config = { + boss = { + name = "Ferumbras Mortal Shell", + position = Position(33392, 31473, 14), + }, + playerPositions = { + { pos = Position(33269, 31477, 14), teleport = Position(33390, 31483, 14), effect = CONST_ME_TELEPORT }, + + }, + specPos = { + from = Position(33374, 31458, 14), + to = Position(33414, 31498, 14), + }, + exit = Position(33319, 32318, 13), + centerRoom = Position(33392, 31473, 14), + summonName = "Rift Fragment", + maxSummon = 3, +} + +local leverFerumbras = Action() + +function leverFerumbras.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + player:say("Someone is already inside the room.", TALKTYPE_MONSTER_SAY) + return true + end + end + + if isBossInRoom(config.specPos.from, config.specPos.to, config.boss.name) then + player:say("The room is being cleared. Please wait a moment.", TALKTYPE_MONSTER_SAY) + return true + end + + local players = {} + for i = 1, #config.playerPositions do + local pos = config.playerPositions[i].pos + local creature = Tile(pos):getTopCreature() + if not creature or not creature:isPlayer() then + player:sendCancelMessage("You need " .. #config.playerPositions .. " players to challenge " .. config.boss.name .. ".") + return true + end + table.insert(players, creature) + end + + for i = 1, #players do + local playerToTeleport = players[i] + local teleportPos = config.playerPositions[i].teleport + local effect = config.playerPositions[i].effect + playerToTeleport:teleportTo(teleportPos) + teleportPos:sendMagicEffect(effect) + end + + Game.createMonster(config.boss.name, config.boss.position, true, true) + for b = 1, config.maxSummon do + local xrand = math.random(-5, 5) + local yrand = math.random(-5, 5) + local position = Position(config.boss.position.x + xrand, config.boss.position.y + yrand, config.boss.position.z) + Game.createMonster(config.summonName, position) + end + + if item.itemid == 8911 then + item:transform(8912) + else + item:transform(8911) + end + + return true +end + +function clearBossRoom(fromPos, toPos, exitPos) + local spectators = Game.getSpectators(fromPos, false, false, 0, 0, 0, 0, toPos) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + spec:teleportTo(exitPos) + exitPos:sendMagicEffect(CONST_ME_TELEPORT) + spec:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You took too long, the battle has ended.") + else + spec:remove() + end + end +end + +function isBossInRoom(fromPos, toPos, bossName) + local monstersRemoved = false + for x = fromPos.x, toPos.x do + for y = fromPos.y, toPos.y do + for z = fromPos.z, toPos.z do + local tile = Tile(Position(x, y, z)) + if tile then + local creature = tile:getTopCreature() + if creature and creature:isMonster() then + creature:remove() + monstersRemoved = true + end + end + end + end + end + return monstersRemoved +end + +leverFerumbras:uid(1021) +leverFerumbras:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_ferumbras_mana_keg.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_ferumbras_mana_keg.lua similarity index 100% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_ferumbras_mana_keg.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_ferumbras_mana_keg.lua diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_flower_puzzle_lever.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_flower_puzzle_lever.lua similarity index 88% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_flower_puzzle_lever.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_flower_puzzle_lever.lua index 6cc91c9d45a..748ce24bd66 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_flower_puzzle_lever.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_flower_puzzle_lever.lua @@ -25,6 +25,7 @@ local function revertItem(position, itemId, transformId) end local ferumbrasAscendantFlowerPuzzle = Action() + function ferumbrasAscendantFlowerPuzzle.onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 9110 then for a = 1, #flowerPositions do @@ -34,11 +35,11 @@ function ferumbrasAscendantFlowerPuzzle.onUse(player, item, fromPosition, target return true end end - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.FlowerPuzzleTimer) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FlowerPuzzleTimer) >= 1 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The portal still activated.") else - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.FlowerPuzzleTimer, 1) - addEvent(Game.setStorageValue, 30 * 1000, GlobalStorage.FerumbrasAscendant.FlowerPuzzleTimer, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FlowerPuzzleTimer, 1) + addEvent(function() player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FlowerPuzzleTimer, 0) end, 30 * 1000) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "A portal forms as two beams of a strange construction dividing this room move towards each other.") for x = 33475, 33479 do local pos = Position(x, 32698, 14) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_grave_flower.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_grave_flower.lua similarity index 100% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_grave_flower.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_grave_flower.lua diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_corrupted.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_corrupted.lua similarity index 94% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_corrupted.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_corrupted.lua index 74a93dbf5a9..95d4eac0035 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_corrupted.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_corrupted.lua @@ -340,6 +340,7 @@ local corrupted = { { itemid = 417, position = Position(33614, 32721, 12) }, { itemid = 417, position = Position(33611, 32712, 12) }, } + local function transformArea() for x = 33611, 33625 do for y = 32712, 32727 do @@ -374,10 +375,24 @@ local function transformArea() return true end +local function resetFerumbrasAscendantHabitats(player) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, 0) +end + + local ferumbrasAscendantHabitatCorrupted = Action() + function ferumbrasAscendantHabitatCorrupted.onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 9125 then - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Corrupted) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted) >= 1 then player:say("The lever are stuck, need some time to it can be movable again.", TALKTYPE_MONSTER_SAY) return true end @@ -389,12 +404,12 @@ function ferumbrasAscendantHabitatCorrupted.onUse(player, item, fromPosition, ta basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) basin:transform(22196) end - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Corrupted, 1) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) + 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) + 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The room transforms into a completely different landscape.") - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) >= 8 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) >= 7 then addEvent(function() - resetFerumbrasAscendantHabitats() + resetFerumbrasAscendantHabitats(player) local basin = Tile(Position(33628, 32721, 12)):getItemById(22196) if basin then basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_desert.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_desert.lua similarity index 93% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_desert.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_desert.lua index e5b8e22f150..e7bd6134196 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_desert.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_desert.lua @@ -354,10 +354,23 @@ local function transformArea() return true end +local function resetFerumbrasAscendantHabitats(player) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, 0) +end + local ferumbrasAscendantHabitatDesert = Action() + function ferumbrasAscendantHabitatDesert.onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 9125 then - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Desert) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert) >= 1 then player:say("The lever are stuck, need some time to it can be movable again.", TALKTYPE_MONSTER_SAY) return true end @@ -369,12 +382,12 @@ function ferumbrasAscendantHabitatDesert.onUse(player, item, fromPosition, targe basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) basin:transform(22196) end - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Desert, 1) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) + 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) + 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The room transforms into a completely different landscape.") - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) >= 8 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) >= 7 then addEvent(function() - resetFerumbrasAscendantHabitats() + resetFerumbrasAscendantHabitats(player) local basin = Tile(Position(33631, 32685, 12)):getItemById(22196) if basin then basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_dimension.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_dimension.lua similarity index 94% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_dimension.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_dimension.lua index 1fc14c6646f..533a435d9d2 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_dimension.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_dimension.lua @@ -390,10 +390,23 @@ local function transformArea() return true end +local function resetFerumbrasAscendantHabitats(player) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, 0) +end + local ferumbrasAscendantHabitatDimension = Action() + function ferumbrasAscendantHabitatDimension.onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 9125 then - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Dimension) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension) >= 1 then player:say("The lever are stuck, need some time to it can be movable again.", TALKTYPE_MONSTER_SAY) return true end @@ -405,12 +418,12 @@ function ferumbrasAscendantHabitatDimension.onUse(player, item, fromPosition, ta basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) basin:transform(22196) end - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Dimension, 1) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) + 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) + 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The room transforms into a completely different landscape.") - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) >= 8 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) >= 7 then addEvent(function() - resetFerumbrasAscendantHabitats() + resetFerumbrasAscendantHabitats(player) local basin = Tile(Position(33631, 32721, 12)):getItemById(22196) if basin then basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_grass.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_grass.lua similarity index 94% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_grass.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_grass.lua index 293e65844cc..98a22f54450 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_grass.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_grass.lua @@ -422,10 +422,23 @@ local function transformArea() return true end +local function resetFerumbrasAscendantHabitats(player) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, 0) +end + local ferumbrasAscendantHabitatGlass = Action() + function ferumbrasAscendantHabitatGlass.onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 9125 then - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Grass) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass) >= 1 then player:say("The lever are stuck, need some time to it can be movable again.", TALKTYPE_MONSTER_SAY) return true end @@ -437,12 +450,12 @@ function ferumbrasAscendantHabitatGlass.onUse(player, item, fromPosition, target basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) basin:transform(22196) end - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Grass, 1) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) + 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) + 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The room transforms into a completely different landscape.") - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) >= 8 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) >= 7 then addEvent(function() - resetFerumbrasAscendantHabitats() + resetFerumbrasAscendantHabitats(player) local basin = Tile(Position(33631, 32667, 12)):getItemById(22196) if basin then basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_ice.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_ice.lua similarity index 94% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_ice.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_ice.lua index b46a984a00e..948289a1719 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_ice.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_ice.lua @@ -437,10 +437,23 @@ local function transformArea() return true end +local function resetFerumbrasAscendantHabitats(player) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, 0) +end + local ferumbrasAscendantHabitatIce = Action() + function ferumbrasAscendantHabitatIce.onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 9125 then - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Ice) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice) >= 1 then player:say("The lever are stuck, need some time to it can be movable again.", TALKTYPE_MONSTER_SAY) return true end @@ -452,12 +465,12 @@ function ferumbrasAscendantHabitatIce.onUse(player, item, fromPosition, target, basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) basin:transform(22196) end - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Ice, 1) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) + 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) + 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The room transforms into a completely different landscape.") - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) >= 8 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) >= 7 then addEvent(function() - resetFerumbrasAscendantHabitats() + resetFerumbrasAscendantHabitats(player) local basin = Tile(Position(33631, 32703, 12)):getItemById(22196) if basin then basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_lever.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_lever.lua similarity index 68% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_lever.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_lever.lua index f44bc549603..653deb4683d 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_lever.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_lever.lua @@ -1,11 +1,11 @@ local ferumbrasAscendantHabitatLever = Action() function ferumbrasAscendantHabitatLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.FerumbrasAscension.HabitatsAccess) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.HabitatsAccess) >= 1 then return false end if item.itemid == 9125 then - player:setStorageValue(Storage.FerumbrasAscension.HabitatsAccess, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.HabitatsAccess, 1) item:transform(9126) elseif item.itemid == 9126 then item:transform(9125) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_mushroom.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_mushroom.lua similarity index 94% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_mushroom.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_mushroom.lua index 52b0c9b7ac7..828002e419a 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_mushroom.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_mushroom.lua @@ -390,10 +390,24 @@ local function transformArea() return true end +local function resetFerumbrasAscendantHabitats(player) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, 0) +end + + local ferumbrasAscendantHabitatMushroom = Action() + function ferumbrasAscendantHabitatMushroom.onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 9125 then - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Mushroom) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom) >= 1 then player:say("The lever are stuck, need some time to it can be movable again.", TALKTYPE_MONSTER_SAY) return true end @@ -405,12 +419,12 @@ function ferumbrasAscendantHabitatMushroom.onUse(player, item, fromPosition, tar basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) basin:transform(22196) end - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Mushroom, 1) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) + 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) + 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The room transforms into a completely different landscape.") - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) >= 8 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) >= 7 then addEvent(function() - resetFerumbrasAscendantHabitats() + resetFerumbrasAscendantHabitats(player) local basin = Tile(Position(33628, 32685, 12)):getItemById(22196) if basin then basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_roshamuul.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_roshamuul.lua similarity index 95% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_roshamuul.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_roshamuul.lua index 42da59f0e93..d77c00e6876 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_roshamuul.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_roshamuul.lua @@ -463,10 +463,23 @@ local function transformArea() return true end +local function resetFerumbrasAscendantHabitats(player) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, 0) +end + local ferumbrasAscendantHabitatRoshamuul = Action() + function ferumbrasAscendantHabitatRoshamuul.onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 9125 then - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Roshamuul) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul) >= 1 then player:say("The lever are stuck, need some time to it can be movable again.", TALKTYPE_MONSTER_SAY) return true end @@ -478,12 +491,12 @@ function ferumbrasAscendantHabitatRoshamuul.onUse(player, item, fromPosition, ta basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) basin:transform(22196) end - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Roshamuul, 1) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) + 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) + 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The room transforms into a completely different landscape.") - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) >= 8 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) >= 7 then addEvent(function() - resetFerumbrasAscendantHabitats() + resetFerumbrasAscendantHabitats(player) local basin = Tile(Position(33628, 32667, 12)):getItemById(22196) if basin then basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_venom.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_venom.lua similarity index 95% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_venom.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_venom.lua index 2649da5694e..fe9960036b9 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_habitat_venom.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_habitat_venom.lua @@ -413,6 +413,7 @@ local venom = { { itemid = 1059, position = Position(33625, 32709, 12) }, { itemid = 417, position = Position(33625, 32709, 12) }, } + local function transformArea() for x = 33611, 33625 do for y = 32694, 32709 do @@ -445,10 +446,23 @@ local function transformArea() return true end +local function resetFerumbrasAscendantHabitats(player) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Roshamuul, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Grass, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Mushroom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Desert, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Ice, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Corrupted, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Dimension, -1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, 0) +end + local ferumbrasAscendantHabitatVenom = Action() + function ferumbrasAscendantHabitatVenom.onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 9125 then - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Venom) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom) >= 1 then player:say("The lever are stuck, need some time to it can be movable again.", TALKTYPE_MONSTER_SAY) return true end @@ -460,14 +474,14 @@ function ferumbrasAscendantHabitatVenom.onUse(player, item, fromPosition, target basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) basin:transform(22196) end - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Venom, 1) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) + 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.Venom, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats, player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) + 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The room transforms into a completely different landscape.") - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) >= 8 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) >= 7 then addEvent(function() local basin = Tile(Position(33628, 32703, 12)):getItemById(22196) if basin then - resetFerumbrasAscendantHabitats() + resetFerumbrasAscendantHabitats(player) basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) basin:transform(11114) end diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_lever_first.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_lever_first.lua similarity index 64% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_lever_first.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_lever_first.lua index 000dfdf9f6d..bfda089df67 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_lever_first.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_lever_first.lua @@ -1,11 +1,11 @@ local ferumbrasAscendantLeverFirst = Action() function ferumbrasAscendantLeverFirst.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Active) < 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Active) < 1 then return false end if item.itemid == 9110 then - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done) >= 1 then - local spectators = Game.getSpectators(item:getPosition(), false, false, 9, 9, 6, 6) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done) >= 1 then + local spectators = player:getSpectators(item:getPosition(), false, false, 9, 9, 6, 6) for i = 1, #spectators do if spectators[i]:isPlayer() then local spec = spectators[i] @@ -17,8 +17,8 @@ function ferumbrasAscendantLeverFirst.onUse(player, item, fromPosition, target, revertStorages() return true end - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done) < 1 then - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done, 2) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done) < 1 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done, 2) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Something clicked.") end item:transform(9111) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_lever_four.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_lever_four.lua similarity index 58% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_lever_four.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_lever_four.lua index 637384e90b5..f267c9cd1e7 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_lever_four.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_lever_four.lua @@ -1,11 +1,11 @@ local ferumbrasAscendantLevelFour = Action() function ferumbrasAscendantLevelFour.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Active) < 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Active) < 1 then return false end if item.itemid == 9110 then - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done) < 4 then - local spectators = Game.getSpectators(item:getPosition(), false, false, 9, 9, 6, 6) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done) < 4 then + local spectators = player:getSpectators(item:getPosition(), false, false, 9, 9, 6, 6) for i = 1, #spectators do if spectators[i]:isPlayer() then local spec = spectators[i] @@ -16,8 +16,8 @@ function ferumbrasAscendantLevelFour.onUse(player, item, fromPosition, target, t revertStorages() return true end - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done) >= 4 then - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done, 4) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done) >= 4 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done, 4) end item:transform(9111) elseif item.itemid == 9111 then diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_lever_second.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_lever_second.lua similarity index 65% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_lever_second.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_lever_second.lua index d1c93f33aeb..af68fb44b42 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_lever_second.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_lever_second.lua @@ -1,11 +1,11 @@ local ferumbrasAscendantLeverSecond = Action() function ferumbrasAscendantLeverSecond.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Active) < 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Active) < 1 then return false end if item.itemid == 9110 then - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done) < 2 then - local spectators = Game.getSpectators(item:getPosition(), false, false, 9, 9, 6, 6) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done) < 2 then + local spectators = player:getSpectators(item:getPosition(), false, false, 9, 9, 6, 6) for i = 1, #spectators do if spectators[i]:isPlayer() then local spec = spectators[i] @@ -17,8 +17,8 @@ function ferumbrasAscendantLeverSecond.onUse(player, item, fromPosition, target, revertStorages() return true end - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done) >= 2 then - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done, 3) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done) >= 2 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done, 3) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Something clicked.") end item:transform(9111) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_lever_third.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_lever_third.lua similarity index 62% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_lever_third.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_lever_third.lua index 589abecd5a1..2626112bd8e 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_lever_third.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_lever_third.lua @@ -1,11 +1,11 @@ local ferumbrasAscendantLeverThird = Action() function ferumbrasAscendantLeverThird.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Active) < 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Active) < 1 then return false end if item.itemid == 9110 then - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done) < 3 then - local spectators = Game.getSpectators(item:getPosition(), false, false, 9, 9, 6, 6) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done) < 3 then + local spectators = player:getSpectators(item:getPosition(), false, false, 9, 9, 6, 6) for i = 1, #spectators do if spectators[i]:isPlayer() then local spec = spectators[i] @@ -17,17 +17,17 @@ function ferumbrasAscendantLeverThird.onUse(player, item, fromPosition, target, revertStorages() return true end - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Four) == 4 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Four) == 4 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "A booming sound almost deafens you. From somewhere deep within you hear a whisper: 'Blood...'") end - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Four) == 5 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Four) == 5 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "A booming sound almost deafens you. From somewhere deep within you hear a whisper: 'Grass...'") end - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Four) == 6 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Four) == 6 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "A booming sound almost deafens you. From somewhere deep within you hear a whisper: 'Ice...'") end - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done) >= 3 then - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done, 4) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done) >= 3 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done, 4) end item:transform(9111) elseif item.itemid == 9111 then diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_mazoran.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_mazoran.lua new file mode 100644 index 00000000000..9111dfef175 --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_mazoran.lua @@ -0,0 +1,105 @@ +local config = { + boss = { + name = "Mazoran", + position = Position(33584, 32689, 14), + }, + timeToDefeat = 17 * 60, -- 17 minutes in seconds + playerPositions = { + { pos = Position(33593, 32644, 14), teleport = Position(33585, 32693, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(33593, 32645, 14), teleport = Position(33585, 32693, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(33593, 32646, 14), teleport = Position(33585, 32693, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(33593, 32647, 14), teleport = Position(33585, 32693, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(33593, 32648, 14), teleport = Position(33585, 32693, 14), effect = CONST_ME_TELEPORT }, + }, + specPos = { + from = Position(33570, 32677, 14), + to = Position(33597, 32700, 14), + }, + exit = Position(33319, 32318, 13), +} + +local leverMazoran = Action() + +function leverMazoran.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + player:say("Someone is already inside the room.", TALKTYPE_MONSTER_SAY) + return true + end + end + + if isBossInRoom(config.specPos.from, config.specPos.to, config.boss.name) then + player:say("The room is being cleared. Please wait a moment.", TALKTYPE_MONSTER_SAY) + return true + end + + local players = {} + for i = 1, #config.playerPositions do + local pos = config.playerPositions[i].pos + local creature = Tile(pos):getTopCreature() + if not creature or not creature:isPlayer() then + player:sendCancelMessage("You need " .. #config.playerPositions .. " players to challenge " .. config.boss.name .. ".") + return true + end + table.insert(players, creature) + end + + for i = 1, #players do + local playerToTeleport = players[i] + local teleportPos = config.playerPositions[i].teleport + local effect = config.playerPositions[i].effect + playerToTeleport:teleportTo(teleportPos) + teleportPos:sendMagicEffect(effect) + end + + local boss = Game.createMonster(config.boss.name, config.boss.position) + if boss then + boss:setReward(true) + end + + addEvent(clearBossRoom, config.timeToDefeat * 1000, config.specPos.from, config.specPos.to, config.exit) + + if item.itemid == 8911 then + item:transform(8912) + else + item:transform(8911) + end + + return true +end + +function clearBossRoom(fromPos, toPos, exitPos) + local spectators = Game.getSpectators(fromPos, false, false, 0, 0, 0, 0, toPos) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + spec:teleportTo(exitPos) + exitPos:sendMagicEffect(CONST_ME_TELEPORT) + spec:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You took too long, the battle has ended.") + else + spec:remove() + end + end +end + +function isBossInRoom(fromPos, toPos, bossName) + local monstersRemoved = false + for x = fromPos.x, toPos.x do + for y = fromPos.y, toPos.y do + for z = fromPos.z, toPos.z do + local tile = Tile(Position(x, y, z)) + if tile then + local creature = tile:getTopCreature() + if creature and creature:isMonster() then + creature:remove() + monstersRemoved = true + end + end + end + end + end + return monstersRemoved +end + +leverMazoran:uid(1025) +leverMazoran:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_mysterious_scroll.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_mysterious_scroll.lua similarity index 72% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_mysterious_scroll.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_mysterious_scroll.lua index 88bf697f907..bcef5b7b69c 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_mysterious_scroll.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_mysterious_scroll.lua @@ -1,12 +1,12 @@ local ferumbrasAscendantMysterious = Action() function ferumbrasAscendantMysterious.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.FerumbrasAscension.RiftRunner) >= 1 or player:getStorageValue(24850) < 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.RiftRunner) >= 1 or player:getStorageValue(24850) < 1 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "No matter how often you try, you cannot decipher anything.") return true else player:addMount(87) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You decipher something! You get a rift runner to accompany you on your journey.") - player:setStorageValue(Storage.FerumbrasAscension.RiftRunner, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.RiftRunner, 1) end return true end diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_plagirath.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_plagirath.lua new file mode 100644 index 00000000000..7a4769e8482 --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_plagirath.lua @@ -0,0 +1,102 @@ +local config = { + boss = { + name = "Plagirath", + position = Position(33172, 31501, 13), + }, + timeToDefeat = 17 * 60, -- 17 minutes in seconds + playerPositions = { + { pos = Position(33229, 31500, 13), teleport = Position(33173, 31504, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33229, 31501, 13), teleport = Position(33173, 31504, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33229, 31502, 13), teleport = Position(33173, 31504, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33229, 31503, 13), teleport = Position(33173, 31504, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33229, 31504, 13), teleport = Position(33173, 31504, 13), effect = CONST_ME_TELEPORT }, + }, + specPos = { + from = Position(33159, 31488, 13), + to = Position(33190, 31515, 13), + }, + exit = Position(33319, 32318, 13), +} + +local leverPlagirath = Action() + +function leverPlagirath.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + player:say("Someone is already inside the room.", TALKTYPE_MONSTER_SAY) + return true + end + end + + if isBossInRoom(config.specPos.from, config.specPos.to, config.boss.name) then + player:say("The room is being cleared. Please wait a moment.", TALKTYPE_MONSTER_SAY) + return true + end + + local players = {} + for i = 1, #config.playerPositions do + local pos = config.playerPositions[i].pos + local creature = Tile(pos):getTopCreature() + if not creature or not creature:isPlayer() then + player:sendCancelMessage("You need " .. #config.playerPositions .. " players to challenge " .. config.boss.name .. ".") + return true + end + table.insert(players, creature) + end + + for i = 1, #players do + local playerToTeleport = players[i] + local teleportPos = config.playerPositions[i].teleport + local effect = config.playerPositions[i].effect + playerToTeleport:teleportTo(teleportPos) + teleportPos:sendMagicEffect(effect) + end + + Game.createMonster(config.boss.name, config.boss.position) + + addEvent(clearBossRoom, config.timeToDefeat * 1000, config.specPos.from, config.specPos.to, config.exit) + + if item.itemid == 8911 then + item:transform(8912) + else + item:transform(8911) + end + + return true +end + +function clearBossRoom(fromPos, toPos, exitPos) + local spectators = Game.getSpectators(fromPos, false, false, 0, 0, 0, 0, toPos) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + spec:teleportTo(exitPos) + exitPos:sendMagicEffect(CONST_ME_TELEPORT) + spec:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You took too long, the battle has ended.") + else + spec:remove() + end + end +end + +function isBossInRoom(fromPos, toPos, bossName) + local monstersRemoved = false + for x = fromPos.x, toPos.x do + for y = fromPos.y, toPos.y do + for z = fromPos.z, toPos.z do + local tile = Tile(Position(x, y, z)) + if tile then + local creature = tile:getTopCreature() + if creature and creature:isMonster() then + creature:remove() + monstersRemoved = true + end + end + end + end + end + return monstersRemoved +end + +leverPlagirath:uid(1022) +leverPlagirath:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_purified_soul.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_purified_soul.lua similarity index 100% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_purified_soul.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_purified_soul.lua diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_ragiaz.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_ragiaz.lua new file mode 100644 index 00000000000..52ad53d1a18 --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_ragiaz.lua @@ -0,0 +1,114 @@ +local config = { + boss = { + name = "Ragiaz", + position = Position(33481, 32334, 13), + }, + + timeToDefeat = 17 * 60, -- 17 minutes in seconds + playerPositions = { + { pos = Position(33456, 32356, 13), teleport = Position(33482, 32339, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33457, 32356, 13), teleport = Position(33482, 32339, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33458, 32356, 13), teleport = Position(33482, 32339, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33459, 32356, 13), teleport = Position(33482, 32339, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33460, 32356, 13), teleport = Position(33482, 32339, 13), effect = CONST_ME_TELEPORT }, + }, + monsters = { + { name = "Death Dragon", pos = Position(33476, 32331, 13) }, + { name = "Death Dragon", pos = Position(33476, 32340, 13) }, + { name = "Death Dragon", pos = Position(33487, 32340, 13) }, + { name = "Death Dragon", pos = Position(33488, 32331, 13) }, + }, + specPos = { + from = Position(33468, 32319, 13), + to = Position(33495, 32347, 13), + }, + exit = Position(33319, 32318, 13), +} + +local leverRagiaz = Action() + +function leverRagiaz.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + player:say("Someone is already inside the room.", TALKTYPE_MONSTER_SAY) + return true + end + end + + if isBossInRoom(config.specPos.from, config.specPos.to, config.boss.name) then + player:say("The room is being cleared. Please wait a moment.", TALKTYPE_MONSTER_SAY) + return true + end + + local players = {} + for i = 1, #config.playerPositions do + local pos = config.playerPositions[i].pos + local creature = Tile(pos):getTopCreature() + if not creature or not creature:isPlayer() then + player:sendCancelMessage("You need " .. #config.playerPositions .. " players to challenge " .. config.boss.name .. ".") + return true + end + table.insert(players, creature) + end + + for i = 1, #players do + local playerToTeleport = players[i] + local teleportPos = config.playerPositions[i].teleport + local effect = config.playerPositions[i].effect + playerToTeleport:teleportTo(teleportPos) + teleportPos:sendMagicEffect(effect) + end + + Game.createMonster(config.boss.name, config.boss.position) + + for i = 1, #config.monsters do + local monsterConfig = config.monsters[i] + Game.createMonster(monsterConfig.name, monsterConfig.pos, true, true) + end + + addEvent(clearBossRoom, config.timeToDefeat * 1000, config.specPos.from, config.specPos.to, config.exit) + + if item.itemid == 8911 then + item:transform(8912) + else + item:transform(8911) + end + + return true +end + +function clearBossRoom(fromPos, toPos, exitPos) + local spectators = Game.getSpectators(fromPos, false, false, 0, 0, 0, 0, toPos) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + spec:teleportTo(exitPos) + exitPos:sendMagicEffect(CONST_ME_TELEPORT) + spec:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You took too long, the battle has ended.") + else + spec:remove() + end + end +end + +function isBossInRoom(fromPos, toPos, bossName) + local monstersRemoved = false + for x = fromPos.x, toPos.x do + for y = fromPos.y, toPos.y do + for z = fromPos.z, toPos.z do + local tile = Tile(Position(x, y, z)) + if tile then + local creature = tile:getTopCreature() + if creature and creature:isMonster() then + creature:remove() + monstersRemoved = true + end + end + end + end + end + return monstersRemoved +end + +leverRagiaz:uid(1023) +leverRagiaz:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_rat_lever.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_rat_lever.lua new file mode 100644 index 00000000000..0b9c1fdf008 --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_rat_lever.lua @@ -0,0 +1,102 @@ +local config = { + boss = { + name = "The Lord of The Lice", + position = Position(33220, 31460, 12), + }, + timeToDefeat = 17 * 60, -- 17 minutes in seconds + playerPositions = { + { pos = Position(33197, 31475, 11), teleport = Position(33215, 31470, 12), effect = CONST_ME_TELEPORT }, + { pos = Position(33198, 31475, 11), teleport = Position(33215, 31470, 12), effect = CONST_ME_TELEPORT }, + { pos = Position(33199, 31475, 11), teleport = Position(33215, 31470, 12), effect = CONST_ME_TELEPORT }, + { pos = Position(33200, 31475, 11), teleport = Position(33215, 31470, 12), effect = CONST_ME_TELEPORT }, + { pos = Position(33201, 31475, 11), teleport = Position(33215, 31470, 12), effect = CONST_ME_TELEPORT }, + }, + specPos = { + from = Position(33187, 31429, 12), + to = Position(33242, 31487, 12), + }, + exit = Position(33319, 32318, 13), +} + +local ferumbrasAscendantRatLever = Action() + +function ferumbrasAscendantRatLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + player:say("Someone is already inside the room.", TALKTYPE_MONSTER_SAY) + return true + end + end + + if isBossInRoom(config.specPos.from, config.specPos.to, config.boss.name) then + player:say("The room is being cleared. Please wait a moment.", TALKTYPE_MONSTER_SAY) + return true + end + + local players = {} + for i = 1, #config.playerPositions do + local pos = config.playerPositions[i].pos + local creature = Tile(pos):getTopCreature() + if not creature or not creature:isPlayer() then + player:sendCancelMessage("You need " .. #config.playerPositions .. " players to challenge " .. config.boss.name .. ".") + return true + end + table.insert(players, creature) + end + + for i = 1, #players do + local playerToTeleport = players[i] + local teleportPos = config.playerPositions[i].teleport + local effect = config.playerPositions[i].effect + playerToTeleport:teleportTo(teleportPos) + teleportPos:sendMagicEffect(effect) + end + + Game.createMonster(config.boss.name, config.boss.position) + + addEvent(clearBossRoom, config.timeToDefeat * 1000, config.specPos.from, config.specPos.to, config.exit) + + if item.itemid == 8911 then + item:transform(8912) + else + item:transform(8911) + end + + return true +end + +function clearBossRoom(fromPos, toPos, exitPos) + local spectators = Game.getSpectators(fromPos, false, false, 0, 0, 0, 0, toPos) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + spec:teleportTo(exitPos) + exitPos:sendMagicEffect(CONST_ME_TELEPORT) + spec:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You took too long, the battle has ended.") + else + spec:remove() + end + end +end + +function isBossInRoom(fromPos, toPos, bossName) + local bossRemoved = false + for x = fromPos.x, toPos.x do + for y = fromPos.y, toPos.y do + for z = fromPos.z, toPos.z do + local tile = Tile(Position(x, y, z)) + if tile then + local creature = tile:getTopCreature() + if creature and creature:isMonster() and creature:getName() == bossName then + creature:remove() + bossRemoved = true + end + end + end + end + end + return bossRemoved +end + +ferumbrasAscendantRatLever:uid(1030) +ferumbrasAscendantRatLever:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_razzagorn.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_razzagorn.lua new file mode 100644 index 00000000000..ee0f2f147d2 --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_razzagorn.lua @@ -0,0 +1,103 @@ +local config = { + boss = { + name = "Razzagorn", + position = Position(33422, 32467, 14), + }, + timeToDefeat = 17 * 60, -- 17 minutes in seconds + playerPositions = { + { pos = Position(33386, 32455, 14), teleport = Position(33419, 32467, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(33387, 32455, 14), teleport = Position(33419, 32467, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(33388, 32455, 14), teleport = Position(33419, 32467, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(33389, 32455, 14), teleport = Position(33419, 32467, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(33390, 32455, 14), teleport = Position(33419, 32467, 14), effect = CONST_ME_TELEPORT }, + }, + specPos = { + from = Position(33407, 32453, 14), + to = Position(33439, 32481, 14), + }, + exit = Position(33319, 32318, 13), +} + +local leverRazzagorn = Action() + +function leverRazzagorn.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + player:say("Someone is already inside the room.", TALKTYPE_MONSTER_SAY) + return true + end + end + + if isBossInRoom(config.specPos.from, config.specPos.to, config.boss.name) then + player:say("The room is being cleared. Please wait a moment.", TALKTYPE_MONSTER_SAY) + return true + end + + local players = {} + for i = 1, #config.playerPositions do + local pos = config.playerPositions[i].pos + local creature = Tile(pos):getTopCreature() + if not creature or not creature:isPlayer() then + player:sendCancelMessage("You need " .. #config.playerPositions .. " players to challenge " .. config.boss.name .. ".") + return true + end + table.insert(players, creature) + end + + for i = 1, #players do + local playerToTeleport = players[i] + local teleportPos = config.playerPositions[i].teleport + local effect = config.playerPositions[i].effect + playerToTeleport:teleportTo(teleportPos) + teleportPos:sendMagicEffect(effect) + end + + Game.createMonster(config.boss.name, config.boss.position) + + addEvent(clearBossRoom, config.timeToDefeat * 1000, config.specPos.from, config.specPos.to, config.exit) + + if item.itemid == 8911 then + item:transform(8912) + else + item:transform(8911) + end + + return true +end + +function clearBossRoom(fromPos, toPos, exitPos) + local spectators = Game.getSpectators(fromPos, false, false, 0, 0, 0, 0, toPos) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + spec:teleportTo(exitPos) + exitPos:sendMagicEffect(CONST_ME_TELEPORT) + spec:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You took too long, the battle has ended.") + else + spec:remove() + end + end +end + +function isBossInRoom(fromPos, toPos, bossName) + local monstersRemoved = false + for x = fromPos.x, toPos.x do + for y = fromPos.y, toPos.y do + for z = fromPos.z, toPos.z do + local tile = Tile(Position(x, y, z)) + if tile then + local creature = tile:getTopCreature() + if creature and creature:isMonster() then + creature:remove() + monstersRemoved = true + end + end + end + end + end + return monstersRemoved +end + +leverRazzagorn:uid(1024) +leverRazzagorn:register() + diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_reward.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_reward.lua similarity index 88% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_reward.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_reward.lua index 4c751de9af0..c353a4cc089 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_reward.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_reward.lua @@ -14,7 +14,7 @@ function ferumbrasAscendantReward.onUse(player, item, fromPosition, target, toPo if item.itemid ~= 4073 then return false end - if player:getStorageValue(Storage.FerumbrasAscension.Reward) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Reward) >= 1 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The treasure chest is empty.") return true end @@ -34,7 +34,7 @@ function ferumbrasAscendantReward.onUse(player, item, fromPosition, target, toPo end return true end - player:setStorageValue(Storage.FerumbrasAscension.Reward, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Reward, 1) return true end diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_sacrifice.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_sacrifice.lua similarity index 60% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_sacrifice.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_sacrifice.lua index cf69d4dc968..16f7cae78b9 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_sacrifice.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_sacrifice.lua @@ -7,35 +7,35 @@ local fount = { local ferumbrasAscendantSacrifice = Action() function ferumbrasAscendantSacrifice.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if not target.actionid == 53805 or Tile(Position(33415, 32379, 12)):getItemById(22163) or player:getStorageValue(Storage.FerumbrasAscension.Fount) >= 4 then + if not target.actionid == 53805 or Tile(Position(33415, 32379, 12)):getItemById(22163) or player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Fount) >= 4 then return false end if item.itemid == 22158 then - if player:getStorageValue(Storage.FerumbrasAscension.Bone) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Bone) >= 1 then player:say("You already put the bones on the blood well.", TALKTYPE_MONSTER_SAY) return true end - player:setStorageValue(Storage.FerumbrasAscension.Bone, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Bone, 1) elseif item.itemid == 22170 then - if player:getStorageValue(Storage.FerumbrasAscension.Ring2) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Ring2) >= 1 then player:say("You already put the signet ring on the blood well.", TALKTYPE_MONSTER_SAY) return true end - player:setStorageValue(Storage.FerumbrasAscension.Ring2, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Ring2, 1) elseif item.itemid == 9685 then - if player:getStorageValue(Storage.FerumbrasAscension.Vampire) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Vampire) >= 1 then player:say("You already put the vampire teeth on the blood well.", TALKTYPE_MONSTER_SAY) return true end - player:setStorageValue(Storage.FerumbrasAscension.Vampire, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Vampire, 1) elseif item.itemid == 3661 then - if player:getStorageValue(Storage.FerumbrasAscension.Flower) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Flower) >= 1 then player:say("You already put the grave flower on the blood well.", TALKTYPE_MONSTER_SAY) return true end - player:setStorageValue(Storage.FerumbrasAscension.Flower, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Flower, 1) end - if player:getStorageValue(Storage.FerumbrasAscension.Fount) == 3 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Fount) == 3 then for i = 1, #fount do local fount = fount[i] local founts = Tile(fount.pos):getItemById(fount.revert) @@ -47,10 +47,10 @@ function ferumbrasAscendantSacrifice.onUse(player, item, fromPosition, target, t statue:transform(22161) end end - if player:getStorageValue(Storage.FerumbrasAscension.Fount) < 0 then - player:setStorageValue(Storage.FerumbrasAscension.Fount, 0) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Fount) < 0 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Fount, 0) end - player:setStorageValue(Storage.FerumbrasAscension.Fount, player:getStorageValue(Storage.FerumbrasAscension.Fount) + 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Fount, player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Fount) + 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You put the " .. item:getName() .. " into the dried well.") toPosition:sendMagicEffect(CONST_ME_DRAWBLOOD) item:remove(1) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_shulgrax.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_shulgrax.lua new file mode 100644 index 00000000000..9c27e569113 --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_shulgrax.lua @@ -0,0 +1,102 @@ +local config = { + boss = { + name = "Shulgrax", + position = Position(33485, 32786, 13), + }, + timeToDefeat = 17 * 60, -- 17 minutes in seconds + playerPositions = { + { pos = Position(33434, 32785, 13), teleport = Position(33485, 32790, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33434, 32786, 13), teleport = Position(33485, 32790, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33434, 32787, 13), teleport = Position(33485, 32790, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33434, 32788, 13), teleport = Position(33485, 32790, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33434, 32789, 13), teleport = Position(33485, 32790, 13), effect = CONST_ME_TELEPORT }, + }, + specPos = { + from = Position(33474, 32775, 13), + to = Position(33496, 32798, 13), + }, + exit = Position(33319, 32318, 13), +} + +local leverShulgrax = Action() + +function leverShulgrax.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + player:say("Someone is already inside the room.", TALKTYPE_MONSTER_SAY) + return true + end + end + + if isBossInRoom(config.specPos.from, config.specPos.to, config.boss.name) then + player:say("The room is being cleared. Please wait a moment.", TALKTYPE_MONSTER_SAY) + return true + end + + local players = {} + for i = 1, #config.playerPositions do + local pos = config.playerPositions[i].pos + local creature = Tile(pos):getTopCreature() + if not creature or not creature:isPlayer() then + player:sendCancelMessage("You need " .. #config.playerPositions .. " players to challenge " .. config.boss.name .. ".") + return true + end + table.insert(players, creature) + end + + for i = 1, #players do + local playerToTeleport = players[i] + local teleportPos = config.playerPositions[i].teleport + local effect = config.playerPositions[i].effect + playerToTeleport:teleportTo(teleportPos) + teleportPos:sendMagicEffect(effect) + end + + Game.createMonster(config.boss.name, config.boss.position) + + addEvent(clearBossRoom, config.timeToDefeat * 1000, config.specPos.from, config.specPos.to, config.exit) + + if item.itemid == 8911 then + item:transform(8912) + else + item:transform(8911) + end + + return true +end + +function clearBossRoom(fromPos, toPos, exitPos) + local spectators = Game.getSpectators(fromPos, false, false, 0, 0, 0, 0, toPos) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + spec:teleportTo(exitPos) + exitPos:sendMagicEffect(CONST_ME_TELEPORT) + spec:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You took too long, the battle has ended.") + else + spec:remove() + end + end +end + +function isBossInRoom(fromPos, toPos, bossName) + local monstersRemoved = false + for x = fromPos.x, toPos.x do + for y = fromPos.y, toPos.y do + for z = fromPos.z, toPos.z do + local tile = Tile(Position(x, y, z)) + if tile then + local creature = tile:getTopCreature() + if creature and creature:isMonster() then + creature:remove() + monstersRemoved = true + end + end + end + end + end + return monstersRemoved +end + +leverShulgrax:uid(1028) +leverShulgrax:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_statue.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_statue.lua similarity index 80% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_statue.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_statue.lua index 65040b79df9..b7181eaa171 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_statue.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_statue.lua @@ -7,7 +7,7 @@ local fount = { local ferumbrasAscendantStatue = Action() function ferumbrasAscendantStatue.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if Tile(Position(33415, 32379, 12)):getItemById(22163) or player:getStorageValue(Storage.FerumbrasAscension.Fount) < 4 or player:getStorageValue(Storage.FerumbrasAscension.Statue) >= 1 then + if Tile(Position(33415, 32379, 12)):getItemById(22163) or player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Fount) < 4 or player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Statue) >= 1 then return false end for i = 1, #fount do @@ -17,7 +17,7 @@ function ferumbrasAscendantStatue.onUse(player, item, fromPosition, target, toPo founts:setActionId(53805) end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You douse the sacred statue's flame. The room darkens.") - player:setStorageValue(Storage.FerumbrasAscension.Statue, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Statue, 1) item:transform(22163) return true end diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_tarbaz.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_tarbaz.lua new file mode 100644 index 00000000000..12b39158a57 --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_tarbaz.lua @@ -0,0 +1,102 @@ +local config = { + boss = { + name = "Tarbaz", + position = Position(33459, 32844, 11), + }, + timeToDefeat = 17 * 60, -- 17 minutes in seconds + playerPositions = { + { pos = Position(33418, 32849, 11), teleport = Position(33459, 32848, 11), effect = CONST_ME_TELEPORT }, + { pos = Position(33418, 32850, 11), teleport = Position(33459, 32848, 11), effect = CONST_ME_TELEPORT }, + { pos = Position(33418, 32851, 11), teleport = Position(33459, 32848, 11), effect = CONST_ME_TELEPORT }, + { pos = Position(33418, 32852, 11), teleport = Position(33459, 32848, 11), effect = CONST_ME_TELEPORT }, + { pos = Position(33418, 32853, 11), teleport = Position(33459, 32848, 11), effect = CONST_ME_TELEPORT }, + }, + specPos = { + from = Position(33447, 32832, 11), + to = Position(33473, 32856, 11), + }, + exit = Position(33319, 32318, 13), +} + +local leverTarbaz = Action() + +function leverTarbaz.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + player:say("Someone is already inside the room.", TALKTYPE_MONSTER_SAY) + return true + end + end + + if isBossInRoom(config.specPos.from, config.specPos.to, config.boss.name) then + player:say("The room is being cleared. Please wait a moment.", TALKTYPE_MONSTER_SAY) + return true + end + + local players = {} + for i = 1, #config.playerPositions do + local pos = config.playerPositions[i].pos + local creature = Tile(pos):getTopCreature() + if not creature or not creature:isPlayer() then + player:sendCancelMessage("You need " .. #config.playerPositions .. " players to challenge " .. config.boss.name .. ".") + return true + end + table.insert(players, creature) + end + + for i = 1, #players do + local playerToTeleport = players[i] + local teleportPos = config.playerPositions[i].teleport + local effect = config.playerPositions[i].effect + playerToTeleport:teleportTo(teleportPos) + teleportPos:sendMagicEffect(effect) + end + + Game.createMonster(config.boss.name, config.boss.position) + + addEvent(clearBossRoom, config.timeToDefeat * 1000, config.specPos.from, config.specPos.to, config.exit) + + if item.itemid == 8911 then + item:transform(8912) + else + item:transform(8911) + end + + return true +end + +function clearBossRoom(fromPos, toPos, exitPos) + local spectators = Game.getSpectators(fromPos, false, false, 0, 0, 0, 0, toPos) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + spec:teleportTo(exitPos) + exitPos:sendMagicEffect(CONST_ME_TELEPORT) + spec:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You took too long, the battle has ended.") + else + spec:remove() + end + end +end + +function isBossInRoom(fromPos, toPos, bossName) + local monstersRemoved = false + for x = fromPos.x, toPos.x do + for y = fromPos.y, toPos.y do + for z = fromPos.z, toPos.z do + local tile = Tile(Position(x, y, z)) + if tile then + local creature = tile:getTopCreature() + if creature and creature:isMonster() then + creature:remove() + monstersRemoved = true + end + end + end + end + end + return monstersRemoved +end + +leverTarbaz:uid(1027) +leverTarbaz:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_tarbaz_notes.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_tarbaz_notes.lua similarity index 61% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_tarbaz_notes.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_tarbaz_notes.lua index 4dea9d21e2c..60a1bf2fc2e 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_tarbaz_notes.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_tarbaz_notes.lua @@ -1,17 +1,17 @@ local ferumbrasAscendantTarbazNotes = Action() function ferumbrasAscendantTarbazNotes.onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.actionid == 54388 then - if player:getStorageValue(Storage.FerumbrasAscension.BasinCounter) ~= 8 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.BasinCounter) ~= 8 then return false end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Suddenly, you see the big picture. It all makes sense now. And then you despair.") - player:setStorageValue(Storage.FerumbrasAscension.TarbazNotes, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TarbazNotes, 1) elseif item.actionid == 54389 then - if player:getStorageValue(Storage.FerumbrasAscension.BasinCounter) ~= 8 and player:getStorageValue(Storage.FerumbrasAscension.TarbazNotes) < 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.BasinCounter) ~= 8 and player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TarbazNotes) < 1 then return false end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Suddenly, you see the latter A. It all makes sense now. And then you now the secret.") - player:setStorageValue(Storage.FerumbrasAscension.TarbazNotes, 2) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TarbazNotes, 2) end toPosition:sendMagicEffect(CONST_ME_THUNDER) return true diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_teleportation_rod.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_teleportation_rod.lua similarity index 59% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_teleportation_rod.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_teleportation_rod.lua index 062233e7eb7..1f1f2f32e40 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_teleportation_rod.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_teleportation_rod.lua @@ -1,14 +1,15 @@ local config = { - [22174] = { storageKey = Storage.FerumbrasAscension.Razzagorn }, - [22175] = { storageKey = Storage.FerumbrasAscension.Ragiaz }, - [22176] = { storageKey = Storage.FerumbrasAscension.Zamulosh }, - [22177] = { storageKey = Storage.FerumbrasAscension.Mazoran }, - [22178] = { storageKey = Storage.FerumbrasAscension.Tarbaz }, - [22179] = { storageKey = Storage.FerumbrasAscension.Shulgrax }, - [22180] = { storageKey = Storage.FerumbrasAscension.Plagirath }, + [22174] = { storageKey = Storage.Quest.U10_90.FerumbrasAscension.Razzagorn }, + [22175] = { storageKey = Storage.Quest.U10_90.FerumbrasAscension.Ragiaz }, + [22176] = { storageKey = Storage.Quest.U10_90.FerumbrasAscension.Zamulosh }, + [22177] = { storageKey = Storage.Quest.U10_90.FerumbrasAscension.Mazoran }, + [22178] = { storageKey = Storage.Quest.U10_90.FerumbrasAscension.Tarbaz }, + [22179] = { storageKey = Storage.Quest.U10_90.FerumbrasAscension.Shulgrax }, + [22180] = { storageKey = Storage.Quest.U10_90.FerumbrasAscension.Plagirath }, } local ferumbrasAscendantTeleportation = Action() + function ferumbrasAscendantTeleportation.onUse(player, item, fromPosition, target, toPosition, isHotkey) local targetItem = config[target.itemid] if not targetItem then diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_the_shatterer_lever.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_the_shatterer_lever.lua new file mode 100644 index 00000000000..7b43a2c59f3 --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_the_shatterer_lever.lua @@ -0,0 +1,113 @@ +local config = { + boss = { + name = "The Shatterer", + position = Position(33406, 32418, 14), + }, + timeToDefeat = 17 * 60, -- 17 minutes in seconds + playerPositions = { + { pos = Position(33403, 32465, 13), teleport = Position(33398, 32414, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(33404, 32465, 13), teleport = Position(33398, 32414, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(33405, 32465, 13), teleport = Position(33398, 32414, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(33406, 32465, 13), teleport = Position(33398, 32414, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(33407, 32465, 13), teleport = Position(33398, 32414, 14), effect = CONST_ME_TELEPORT }, + }, + specPos = { + from = Position(33377, 32390, 14), + to = Position(33446, 32447, 14), + }, + exit = Position(33319, 32318, 13), + centerRoom = Position(33406, 32418, 14), + storage = { + lever = Storage.Quest.U10_90.FerumbrasAscension.TheShattererLever, + timer = Storage.Quest.U10_90.FerumbrasAscension.TheShattererTimer, + }, +} + +local ferumbrasAscendantTheShattererLever = Action() + +function ferumbrasAscendantTheShattererLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local spectators = Game.getSpectators(config.centerRoom, false, false, 30, 30, 30, 30) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting with The Shatterer.") + return true + end + end + + if isBossInRoom(config.specPos.from, config.specPos.to, config.boss.name) then + player:say("The room is being cleared. Please wait a moment.", TALKTYPE_MONSTER_SAY) + return true + end + + + local players = {} + for i = 1, #config.playerPositions do + local pos = config.playerPositions[i].pos + local creature = Tile(pos):getTopCreature() + if not creature or not creature:isPlayer() then + player:sendCancelMessage("You need " .. #config.playerPositions .. " players to challenge " .. config.boss.name .. ".") + return true + end + table.insert(players, creature) + end + + for i = 1, #players do + local playerToTeleport = players[i] + local teleportPos = config.playerPositions[i].teleport + local effect = config.playerPositions[i].effect + playerToTeleport:teleportTo(teleportPos) + teleportPos:sendMagicEffect(effect) + end + + Game.createMonster(config.boss.name, config.boss.position, true, true) + + for _, participant in pairs(players) do + participant:setStorageValue(config.storage.lever, 0) + participant:setStorageValue(config.storage.timer, 1) + end + + addEvent(clearBossRoom, config.timeToDefeat * 1000, config.specPos.from, config.specPos.to, config.exit, config.storage.timer) + + if item.itemid == 8911 then + item:transform(8912) + else + item:transform(8911) + end + + return true +end + +function clearBossRoom(fromPos, toPos, exitPos) + local spectators = Game.getSpectators(fromPos, false, false, 0, 0, 0, 0, toPos) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + spec:teleportTo(exitPos) + exitPos:sendMagicEffect(CONST_ME_TELEPORT) + spec:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You took too long, the battle has ended.") + else + spec:remove() + end + end +end + +function isBossInRoom(fromPos, toPos, bossName) + local bossRemoved = false + for x = fromPos.x, toPos.x do + for y = fromPos.y, toPos.y do + for z = fromPos.z, toPos.z do + local tile = Tile(Position(x, y, z)) + if tile then + local creature = tile:getTopCreature() + if creature and creature:isMonster() and creature:getName() == bossName then + creature:remove() + bossRemoved = true + end + end + end + end + end + return bossRemoved +end + +ferumbrasAscendantTheShattererLever:uid(1029) +ferumbrasAscendantTheShattererLever:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_the_shatterer_levers.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_the_shatterer_levers.lua similarity index 80% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_the_shatterer_levers.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/actions_the_shatterer_levers.lua index d97d8c4bccc..b7e7916ebdf 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/actions_the_shatterer_levers.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_the_shatterer_levers.lua @@ -40,7 +40,7 @@ local chains = { local ferumbrasAscendantTheShattererLevers = Action() function ferumbrasAscendantTheShattererLevers.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.FerumbrasAscension.TheShatterer) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShatterer) >= 1 then player:sendCancelMessage("You cannot use this lever again.") return true end @@ -55,8 +55,8 @@ function ferumbrasAscendantTheShattererLevers.onUse(player, item, fromPosition, Game.createMonster("Fury", { x = player:getPosition().x + math.random(-3, 3), y = player:getPosition().y + math.random(-3, 3), z = player:getPosition().z }) end end - Game.setStorageValue(Storage.FerumbrasAscension.TheShattererLever, math.max(Game.getStorageValue(Storage.FerumbrasAscension.TheShattererLever), 0) + 1) - if Game.getStorageValue(Storage.FerumbrasAscension.TheShattererLever) >= 4 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShattererLever, math.max(player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShattererLever), 0) + 1) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShattererLever) >= 4 then local boss = Tile(Position(33406, 32418, 14)):getTopCreature() if boss and boss:getName():lower() == "the shatterer" then boss:teleportTo(Position(33400, 32415, 14)) @@ -73,8 +73,8 @@ function ferumbrasAscendantTheShattererLevers.onUse(player, item, fromPosition, Game.createMonster("Destroyer", { x = player:getPosition().x + math.random(-3, 3), y = player:getPosition().y + math.random(-3, 3), z = player:getPosition().z }) end end - Game.setStorageValue(Storage.FerumbrasAscension.TheShattererLever, math.max(Game.getStorageValue(Storage.FerumbrasAscension.TheShattererLever), 0) + 1) - if Game.getStorageValue(Storage.FerumbrasAscension.TheShattererLever) >= 4 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShattererLever, math.max(player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShattererLever), 0) + 1) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShattererLever) >= 4 then local boss = Tile(Position(33406, 32418, 14)):getTopCreature() if boss and boss:getName():lower() == "the shatterer" then boss:teleportTo(Position(33400, 32415, 14)) @@ -90,8 +90,8 @@ function ferumbrasAscendantTheShattererLevers.onUse(player, item, fromPosition, bla:remove() end end - Game.setStorageValue(Storage.FerumbrasAscension.TheShattererLever, math.max(Game.getStorageValue(Storage.FerumbrasAscension.TheShattererLever), 0) + 1) - if Game.getStorageValue(Storage.FerumbrasAscension.TheShattererLever) >= 4 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShattererLever, math.max(player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShattererLever), 0) + 1) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShattererLever) >= 4 then local boss = Tile(Position(33406, 32418, 14)):getTopCreature() if boss and boss:getName():lower() == "the shatterer" then boss:teleportTo(Position(33400, 32415, 14)) @@ -107,8 +107,8 @@ function ferumbrasAscendantTheShattererLevers.onUse(player, item, fromPosition, bla:remove() end end - Game.setStorageValue(Storage.FerumbrasAscension.TheShattererLever, math.max(Game.getStorageValue(Storage.FerumbrasAscension.TheShattererLever), 0) + 1) - if Game.getStorageValue(Storage.FerumbrasAscension.TheShattererLever) >= 4 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShattererLever, math.max(player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShattererLever), 0) + 1) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShattererLever) >= 4 then local boss = Tile(Position(33406, 32418, 14)):getTopCreature() if boss and boss:getName():lower() == "the shatterer" then boss:teleportTo(Position(33400, 32415, 14)) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_zamulosh.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_zamulosh.lua new file mode 100644 index 00000000000..142132bb5e7 --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/actions_zamulosh.lua @@ -0,0 +1,116 @@ +local config = { + boss = { + name = "Zamulosh", + position = Position(33643, 32756, 11), + }, + timeToDefeat = 17 * 60, -- 17 minutes in seconds + playerPositions = { + { pos = Position(33680, 32741, 11), teleport = Position(33644, 32760, 11), effect = CONST_ME_TELEPORT }, + }, + specPos = { + from = Position(33632, 32747, 11), + to = Position(33654, 32765, 11), + }, + exit = Position(33319, 32318, 13), + summons = { + Position(33642, 32756, 11), + Position(33642, 32756, 11), + Position(33642, 32756, 11), + Position(33644, 32756, 11), + Position(33644, 32756, 11), + Position(33644, 32756, 11), + } +} + +local leverZamulosh = Action() + +function leverZamulosh.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local spectators = Game.getSpectators(config.specPos.from, false, false, 0, 0, 0, 0, config.specPos.to) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + player:say("Someone is already inside the room.", TALKTYPE_MONSTER_SAY) + return true + end + end + + if isBossInRoom(config.specPos.from, config.specPos.to, config.boss.name) then + player:say("The room is being cleared. Please wait a moment.", TALKTYPE_MONSTER_SAY) + return true + end + + local players = {} + for i = 1, #config.playerPositions do + local pos = config.playerPositions[i].pos + local creature = Tile(pos):getTopCreature() + if not creature or not creature:isPlayer() then + player:sendCancelMessage("You need " .. #config.playerPositions .. " players to challenge " .. config.boss.name .. ".") + return true + end + table.insert(players, creature) + end + + for i = 1, #players do + local playerToTeleport = players[i] + local teleportPos = config.playerPositions[i].teleport + local effect = config.playerPositions[i].effect + playerToTeleport:teleportTo(teleportPos) + teleportPos:sendMagicEffect(effect) + end + + Game.createMonster(config.boss.name, config.boss.position) + + local zamuloshIndex = math.random(#config.summons) + + for i, summonPos in ipairs(config.summons) do + if i == zamuloshIndex then + Game.createMonster(config.boss.name, summonPos) + else + Game.createMonster("Zamulosh3", summonPos) + end + end + + addEvent(clearBossRoom, config.timeToDefeat * 1000, config.specPos.from, config.specPos.to, config.exit) + + if item.itemid == 8911 then + item:transform(8912) + else + item:transform(8911) + end + + return true +end + +function clearBossRoom(fromPos, toPos, exitPos) + local spectators = Game.getSpectators(fromPos, false, false, 0, 0, 0, 0, toPos) + for _, spec in pairs(spectators) do + if spec:isPlayer() then + spec:teleportTo(exitPos) + exitPos:sendMagicEffect(CONST_ME_TELEPORT) + spec:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You took too long, the battle has ended.") + else + spec:remove() + end + end +end + +function isBossInRoom(fromPos, toPos, bossName) + local monstersRemoved = false + for x = fromPos.x, toPos.x do + for y = fromPos.y, toPos.y do + for z = fromPos.z, toPos.z do + local tile = Tile(Position(x, y, z)) + if tile then + local creature = tile:getTopCreature() + if creature and creature:isMonster() then + creature:remove() + monstersRemoved = true + end + end + end + end + end + return monstersRemoved +end + +leverZamulosh:uid(1026) +leverZamulosh:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_bone_capsule.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_bone_capsule.lua similarity index 100% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_bone_capsule.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_bone_capsule.lua diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_bosses_kill.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_bosses_kill.lua new file mode 100644 index 00000000000..19d5d116afe --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_bosses_kill.lua @@ -0,0 +1,135 @@ +local bosses = { + ["the lord of the lice"] = { + teleportPos = Position(33226, 31478, 12), + godbreakerPos = Position(33237, 31477, 13), + cooldown = 44, -- hours + storage = Storage.Quest.U10_90.FerumbrasAscension.TheLordOfTheLiceTime + }, + ["tarbaz"] = { + teleportPos = Position(33460, 32853, 11), + godbreakerPos = Position(33427, 32852, 13), + cooldown = 44, -- hours + storage = Storage.Quest.U10_90.FerumbrasAscension.TarbazTime + }, + ["ragiaz"] = { + teleportPos = Position(33482, 32345, 13), + godbreakerPos = Position(33466, 32392, 13), + cooldown = 44, -- hours + storage = Storage.Quest.U10_90.FerumbrasAscension.RagiazTime + }, + ["plagirath"] = { + teleportPos = Position(33174, 31511, 13), + godbreakerPos = Position(33204, 31510, 13), + cooldown = 44, -- hours + storage = Storage.Quest.U10_90.FerumbrasAscension.PlagirathTime + }, + ["razzagorn"] = { + teleportPos = Position(33357, 32434, 12), + godbreakerPos = Position(33357, 32440, 13), + cooldown = 44, -- hours + storage = Storage.Quest.U10_90.FerumbrasAscension.RazzagornTime + }, + ["zamulosh"] = { + teleportPos = Position(33644, 32764, 11), + godbreakerPos = Position(33678, 32758, 13), + cooldown = 44, -- hours + storage = Storage.Quest.U10_90.FerumbrasAscension.ZamuloshTime + }, + ["mazoran"] = { + teleportPos = Position(33585, 32699, 14), + godbreakerPos = Position(33614, 32679, 15), + cooldown = 44, -- hours + storage = Storage.Quest.U10_90.FerumbrasAscension.MazoranTime + }, + ["shulgrax"] = { + teleportPos = Position(33486, 32796, 13), + godbreakerPos = Position(33459, 32820, 14), + cooldown = 44, -- hours + storage = Storage.Quest.U10_90.FerumbrasAscension.ShulgraxTime + }, + ["ferumbras mortal shell"] = { + teleportPos = Position(33392, 31485, 14), + godbreakerPos = Position(33388, 31414, 14), + cooldown = 332, -- hours - 13 days and 20 hours + storage = Storage.Quest.U10_90.FerumbrasAscension.FerumbrasMortalShellTime + }, +} + +local crystals = { + [1] = { crystalPosition = Position(33390, 31468, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal1 }, + [2] = { crystalPosition = Position(33394, 31468, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal2 }, + [3] = { crystalPosition = Position(33397, 31471, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal3 }, + [4] = { crystalPosition = Position(33397, 31475, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal4 }, + [5] = { crystalPosition = Position(33394, 31478, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal5 }, + [6] = { crystalPosition = Position(33390, 31478, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal6 }, + [7] = { crystalPosition = Position(33387, 31475, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal7 }, + [8] = { crystalPosition = Position(33387, 31471, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal8 }, +} + +local function transformCrystal(player) + for c = 1, #crystals do + local crystal = crystals[c] + player:setStorageValue(crystal.globalStorage, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Crystals.AllCrystals, 0) + local item = Tile(crystal.crystalPosition):getItemById(14961) + if item then + item:transform(14955) + end + end +end + +local function revertTeleport(position, itemId, transformId, destination) + local item = Tile(position):getItemById(itemId) + if item then + item:transform(transformId) + item:setDestination(destination) + end +end + +local ascendantBossesKill = CreatureEvent("AscendantBossesDeath") + +local function formatCooldownMessage(cooldownHours) + local days = math.floor(cooldownHours / 24) + local hours = cooldownHours % 24 + if days > 0 then + return string.format("%d days and %d hours", days, hours) + else + return string.format("%d hours", hours) + end +end + +function ascendantBossesKill.onDeath(creature) + local bossConfig = bosses[creature:getName():lower()] + if not bossConfig then + return true + end + + onDeathForDamagingPlayers(creature, function(creature, player) + local bossName = creature:getName():lower() + if bossConfig.storage then + local cooldownTime = bossConfig.cooldown * 3600 + local nextAvailableTime = os.time() + cooldownTime + player:setStorageValue(bossConfig.storage, nextAvailableTime) + local cooldownMessage = formatCooldownMessage(bossConfig.cooldown) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have defeated " .. bossName .. ". You can challenge this boss again in " .. cooldownMessage .. ".") + end + end) + + local teleport = Tile(bossConfig.teleportPos):getItemById(1949) + if teleport then + teleport:transform(22761) + teleport:getPosition():sendMagicEffect(CONST_ME_THUNDER) + teleport:setDestination(bossConfig.godbreakerPos) + addEvent(revertTeleport, 1 * 60 * 1000, bossConfig.teleportPos, 22761, 1949, Position(33319, 32318, 13)) + end + + if creature:getName():lower() == "ferumbras mortal shell" then + onDeathForDamagingPlayers(creature, function(creature, player) + addEvent(transformCrystal, 2 * 60 * 1000, player) + end) + end + + return true +end + +ascendantBossesKill:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_death_dragon.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_death_dragon.lua similarity index 87% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_death_dragon.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_death_dragon.lua index 2f952dd81d8..bc9fe4c5197 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_death_dragon.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_death_dragon.lua @@ -9,7 +9,7 @@ function deathDragon.onDeath(creature, corpse, lasthitkiller, mostdamagekiller, return true end - local spectators = Game.getSpectators(creature:getPosition(), false, false, 10, 10, 10, 10) + local spectators = player:getSpectators(creature:getPosition(), false, false, 10, 10, 10, 10) for i = 1, #spectators do local spectator = spectators[i] if spectator:isMonster() and spectator:getName():lower() == "ragiaz" then diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_disgusting_ooze_death.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_disgusting_ooze_death.lua similarity index 100% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_disgusting_ooze_death.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_disgusting_ooze_death.lua diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_ferumbras_mortal_shell_death.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_ferumbras_mortal_shell_death.lua similarity index 100% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_ferumbras_mortal_shell_death.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_ferumbras_mortal_shell_death.lua diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_ferumbras_soul_splinter.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_ferumbras_soul_splinter.lua similarity index 100% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_ferumbras_soul_splinter.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_ferumbras_soul_splinter.lua diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_rift_invader_death.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_rift_invader_death.lua similarity index 72% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_rift_invader_death.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_rift_invader_death.lua index 3db8456d1d1..ecd56ef0467 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_rift_invader_death.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_rift_invader_death.lua @@ -1,12 +1,12 @@ local crystals = { - [1] = { fromPosition = Position(33389, 31467, 14), toPosition = Position(33391, 31469, 14), crystalPosition = Position(33390, 31468, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal1 }, - [2] = { fromPosition = Position(33393, 31467, 14), toPosition = Position(33395, 31469, 14), crystalPosition = Position(33394, 31468, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal2 }, - [3] = { fromPosition = Position(33396, 31470, 14), toPosition = Position(33398, 31472, 14), crystalPosition = Position(33397, 31471, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal3 }, - [4] = { fromPosition = Position(33396, 31474, 14), toPosition = Position(33398, 31476, 14), crystalPosition = Position(33397, 31475, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal4 }, - [5] = { fromPosition = Position(33393, 31477, 14), toPosition = Position(33395, 31479, 14), crystalPosition = Position(33394, 31478, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal5 }, - [6] = { fromPosition = Position(33389, 31477, 14), toPosition = Position(33391, 31479, 14), crystalPosition = Position(33390, 31478, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal6 }, - [7] = { fromPosition = Position(33386, 31474, 14), toPosition = Position(33388, 31476, 14), crystalPosition = Position(33387, 31475, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal7 }, - [8] = { fromPosition = Position(33386, 31470, 14), toPosition = Position(33388, 31472, 14), crystalPosition = Position(33387, 31471, 14), globalStorage = GlobalStorage.FerumbrasAscendant.Crystals.Crystal8 }, + [1] = { fromPosition = Position(33389, 31467, 14), toPosition = Position(33391, 31469, 14), crystalPosition = Position(33390, 31468, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal1 }, + [2] = { fromPosition = Position(33393, 31467, 14), toPosition = Position(33395, 31469, 14), crystalPosition = Position(33394, 31468, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal2 }, + [3] = { fromPosition = Position(33396, 31470, 14), toPosition = Position(33398, 31472, 14), crystalPosition = Position(33397, 31471, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal3 }, + [4] = { fromPosition = Position(33396, 31474, 14), toPosition = Position(33398, 31476, 14), crystalPosition = Position(33397, 31475, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal4 }, + [5] = { fromPosition = Position(33393, 31477, 14), toPosition = Position(33395, 31479, 14), crystalPosition = Position(33394, 31478, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal5 }, + [6] = { fromPosition = Position(33389, 31477, 14), toPosition = Position(33391, 31479, 14), crystalPosition = Position(33390, 31478, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal6 }, + [7] = { fromPosition = Position(33386, 31474, 14), toPosition = Position(33388, 31476, 14), crystalPosition = Position(33387, 31475, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal7 }, + [8] = { fromPosition = Position(33386, 31470, 14), toPosition = Position(33388, 31472, 14), crystalPosition = Position(33387, 31471, 14), globalStorage = Storage.Quest.U10_90.FerumbrasAscension.Crystals.Crystal8 }, } local config = AscendingFerumbrasConfig @@ -23,15 +23,15 @@ function riftInvaderDeath.onDeath(creature, corpse, lasthitkiller, mostdamagekil for i = 1, #crystals do local crystal = crystals[i] if creature:getPosition():isInRange(crystal.fromPosition, crystal.toPosition) then - if Game.getStorageValue(crystal.globalStorage) > 8 then + if player:getStorageValue(crystal.globalStorage) > 8 then local item = Tile(crystal.crystalPosition):getItemById(14955) if not item then return true end item:transform(14961) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals) + 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Crystals.AllCrystals, player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Crystals.AllCrystals) + 1) end - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Crystals.AllCrystals) == 8 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Crystals.AllCrystals) == 8 then local creature = Tile(config.bossPos):getTopCreature() creature:say("NOOOOOOOOOOO!", TALKTYPE_MONSTER_YELL) creature:say("FERUMBRAS BURSTS INTO SOUL SPLINTERS!", TALKTYPE_MONSTER_YELL, nil, nil, Position(33392, 31475, 14)) @@ -42,7 +42,7 @@ function riftInvaderDeath.onDeath(creature, corpse, lasthitkiller, mostdamagekil Game.createMonster("Ferumbras Soul Splinter", Position(33392, 31473, 14), false, true) end end - Game.setStorageValue(crystal.globalStorage, Game.getStorageValue(crystal.globalStorage) + 1) + player:setStorageValue(crystal.globalStorage, player:getStorageValue(crystal.globalStorage) + 1) lasthitkiller:say("The negative energy of the rift creature is absorbed by the crystal!", TALKTYPE_MONSTER_SAY, nil, nil, crystal.crystalPosition) lasthitkiller:say("ARGH!", TALKTYPE_MONSTER_SAY, nil, nil, Position(33392, 31473, 14)) end diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_the_shatterer_kill.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_the_shatterer_kill.lua similarity index 93% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_the_shatterer_kill.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_the_shatterer_kill.lua index 493db2c089e..85f1494cd2e 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_the_shatterer_kill.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_the_shatterer_kill.lua @@ -85,7 +85,7 @@ local newPos = Position(33436, 32443, 15) local theShattererKill = CreatureEvent("TheShattererDeath") function theShattererKill.onDeath(creature) onDeathForDamagingPlayers(creature, function(creature, player) - player:setStorageValue(Storage.FerumbrasAscension.TheShatterer, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShatterer, 1) end) local teleport = Tile(Position(33393, 32438, 14)):getItemById(1949) @@ -100,8 +100,8 @@ function theShattererKill.onDeath(creature) addEvent(revertTeleport, 2 * 60 * 1000, teleportPos, 22761, 1949, oldPos) revert() end - Game.setStorageValue(Storage.FerumbrasAscension.TheShattererLever, 0) - Game.setStorageValue(Storage.FerumbrasAscension.TheShattererTimer, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShattererLever, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShattererTimer, 0) return true end diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_zamulosh_clone.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_zamulosh_clone.lua similarity index 84% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_zamulosh_clone.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_zamulosh_clone.lua index 6b6a2b4494c..6a24fea1c9f 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/creaturescripts_zamulosh_clone.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/creaturescripts_zamulosh_clone.lua @@ -8,7 +8,7 @@ end local zamuloshClone = CreatureEvent("ZamuloshClone") function zamuloshClone.onThink(creature) - local spectators = Game.getSpectators(Position(33644, 32757, 11), false, false, 10, 10, 10, 10) + local spectators = player:getSpectators(Position(33644, 32757, 11), false, false, 10, 10, 10, 10) for i = 1, #spectators do local master = spectators[i] if master:getMaxHealth() == 300000 and not master:getMaster() then diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/globalevents_ferumbras_ascendant_effect_1.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/globalevents_ferumbras_ascendant_effect_1.lua similarity index 100% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/globalevents_ferumbras_ascendant_effect_1.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/globalevents_ferumbras_ascendant_effect_1.lua diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/globalevents_ferumbras_ascendant_effect_2.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/globalevents_ferumbras_ascendant_effect_2.lua similarity index 100% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/globalevents_ferumbras_ascendant_effect_2.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/globalevents_ferumbras_ascendant_effect_2.lua diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_blue_gem.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_blue_gem.lua similarity index 73% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_blue_gem.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/movements_blue_gem.lua index 60083434a04..da8a8e442d2 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_blue_gem.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_blue_gem.lua @@ -33,19 +33,19 @@ local function revertBasin(position) end function revertStorages() - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Active, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.First, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Second, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Third, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Four, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Active, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.First, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Second, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Third, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Four, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done, 0) end local blueGem = MoveEvent() function blueGem.onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() - if not player or Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Active) >= 1 then + if not player or player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Active) >= 1 then position:sendMagicEffect(CONST_ME_TELEPORT) return true end @@ -54,10 +54,10 @@ function blueGem.onStepIn(creature, item, position, fromPosition) local leverSecond = Tile(Position(33613, 32691, 13)):getItemById(9110) or Tile(Position(33613, 32691, 13)):getItemById(9111) -- lever green local leverThird = Tile(Position(33651, 32661, 13)):getItemById(9110) or Tile(Position(33651, 32661, 13)):getItemById(9111) -- lever red local leverFour = Tile(Position(33672, 32688, 13)):getItemById(9110) or Tile(Position(33672, 32688, 13)):getItemById(9111) -- lever green - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.First, 3) -- blue - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Second, 2) -- green - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Third, 1) -- red - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Four, 5) -- grass + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.First, 3) -- blue + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Second, 2) -- green + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Third, 1) -- red + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Four, 5) -- grass player:sendTextMessage( MESSAGE_EVENT_ADVANCE, "You hear a whisper: \z @@ -71,7 +71,7 @@ function blueGem.onStepIn(creature, item, position, fromPosition) leverThird:setActionId(53823) leverFour:setActionId(53824) end - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Active, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Active, 1) item:transform(8648) addEvent(activeBasin, 1 * 1000, position) addEvent(revertBasin, 60 * 60 * 1000, position) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_boss_teleport.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_boss_teleport.lua new file mode 100644 index 00000000000..449113b1c06 --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_boss_teleport.lua @@ -0,0 +1,79 @@ +local config = { + [24830] = { + storage = Storage.Quest.U10_90.FerumbrasAscension.Razzagorn, + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.RazzagornTime, + bossName = "Razzagorn" + }, + [24831] = { + storage = Storage.Quest.U10_90.FerumbrasAscension.Ragiaz, + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.RagiazTime, + bossName = "Ragiaz" + }, + [24832] = { + storage = Storage.Quest.U10_90.FerumbrasAscension.Zamulosh, + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.ZamuloshTime, + bossName = "Zamulosh" + }, + [24833] = { + storage = Storage.Quest.U10_90.FerumbrasAscension.Mazoran, + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.MazoranTime, + bossName = "Mazoran" + }, + [24834] = { + storage = Storage.Quest.U10_90.FerumbrasAscension.Tarbaz, + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.TarbazTime, + bossName = "Tarbaz" + }, + [24835] = { + storage = Storage.Quest.U10_90.FerumbrasAscension.Shulgrax, + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.ShulgraxTime, + bossName = "Shulgrax" + }, + [24836] = { + storage = Storage.Quest.U10_90.FerumbrasAscension.Plagirath, + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.PlagirathTime, + bossName = "Plagirath" + }, +} + +local bossTeleport = MoveEvent() + +function bossTeleport.onStepIn(creature, item, position, fromPosition) + local teleportConfig = config[item.actionid] + if not teleportConfig then + return false + end + local player = creature:getPlayer() + if not player then + return true + end + + local cooldownStorage = teleportConfig.cooldownStorage + local bossName = teleportConfig.bossName + local cooldownTime = player:getStorageValue(cooldownStorage) + + if cooldownTime > os.time() then + local remainingTime = cooldownTime - os.time() + local hours = math.floor(remainingTime / 3600) + local minutes = math.floor((remainingTime % 3600) / 60) + player:teleportTo(fromPosition) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true + end + + if player:getStorageValue(teleportConfig.storage) ~= 1 then + player:teleportTo(fromPosition) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true + end + + return true +end + +bossTeleport:type("stepin") + +for index, value in pairs(config) do + bossTeleport:aid(index) +end + +bossTeleport:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_desperate_soul.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_desperate_soul.lua new file mode 100644 index 00000000000..85ffe10e204 --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_desperate_soul.lua @@ -0,0 +1,24 @@ +local desperateSoul = MoveEvent() + +function desperateSoul.onStepIn(creature, item, position, fromPosition) + if not creature:isMonster() or creature:getName():lower() ~= "desperate soul" then + return true + end + + creature:remove() + position:sendMagicEffect(CONST_ME_POFF) + + local player = Tile(fromPosition):getTopCreature() + if player and player:isPlayer() then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FerumbrasEssence, 1) + addEvent(function() + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FerumbrasEssence, 0) + end, 2 * 60 * 1000) + end + + return true +end + +desperateSoul:type("stepin") +desperateSoul:aid(54390) +desperateSoul:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_entrance.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_entrance.lua new file mode 100644 index 00000000000..6522d006ef1 --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_entrance.lua @@ -0,0 +1,61 @@ +local config = { + [1] = { storage = Storage.Quest.U10_90.FerumbrasAscension.Razzagorn }, + [2] = { storage = Storage.Quest.U10_90.FerumbrasAscension.Ragiaz }, + [3] = { storage = Storage.Quest.U10_90.FerumbrasAscension.Zamulosh }, + [4] = { storage = Storage.Quest.U10_90.FerumbrasAscension.Mazoran }, + [5] = { storage = Storage.Quest.U10_90.FerumbrasAscension.Tarbaz }, + [6] = { storage = Storage.Quest.U10_90.FerumbrasAscension.Shulgrax }, + [7] = { storage = Storage.Quest.U10_90.FerumbrasAscension.Plagirath }, +} + +local entrance = MoveEvent() + +function entrance.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + if player:getLevel() < 150 then + player:teleportTo(fromPosition) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to be at least level 150 to enter.") + return true + end + + local complete = true + for i = 1, #config do + local storage = config[i].storage + if player:getStorageValue(storage) ~= 1 then + complete = false + break + end + end + + if item:getActionId() == 24837 then + if complete then + player:teleportTo(Position(33275, 32390, 9)) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true + else + player:teleportTo(Position(33275, 32390, 8)) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true + end + elseif item:getActionId() == 24838 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Access) < 1 then + player:teleportTo(Position(33275, 32390, 8)) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This portal is not yet strong enough to breach the destination dimension.") + return true + end + player:teleportTo(Position(33319, 32317, 13)) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true + end + return true +end + +entrance:type("stepin") +entrance:aid(24837, 24838) +entrance:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_flower_puzzle.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_flower_puzzle.lua similarity index 100% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_flower_puzzle.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/movements_flower_puzzle.lua diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_gate_of_deathstruction.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_gate_of_deathstruction.lua similarity index 90% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_gate_of_deathstruction.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/movements_gate_of_deathstruction.lua index 0b74b80d86e..09369882785 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_gate_of_deathstruction.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_gate_of_deathstruction.lua @@ -6,7 +6,7 @@ function gateOfDeathstruction.onStepIn(creature, item, position, fromPosition) return true end - if player:getStorageValue(Storage.FerumbrasAscension.Statue) < 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Statue) < 1 then position:sendMagicEffect(CONST_ME_TELEPORT) position.y = position.y + 2 player:teleportTo(position) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_green_gem.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_green_gem.lua similarity index 73% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_green_gem.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/movements_green_gem.lua index 885d2a2e0ff..aaa8ffd9e6f 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_green_gem.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_green_gem.lua @@ -34,19 +34,19 @@ local function revertBasin(position) end function revertStorages() - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Active, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.First, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Second, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Third, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Four, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Active, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.First, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Second, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Third, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Four, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done, 0) end local greenGem = MoveEvent() function greenGem.onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() - if not player or Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Active) >= 1 then + if not player or player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Active) >= 1 then position:sendMagicEffect(CONST_ME_TELEPORT) return true end @@ -55,10 +55,10 @@ function greenGem.onStepIn(creature, item, position, fromPosition) local leverSecond = Tile(Position(33671, 32638, 13)):getItemById(9110) or Tile(Position(33671, 32638, 13)):getItemById(9111) -- lever blue local leverThird = Tile(Position(33651, 32661, 13)):getItemById(9110) or Tile(Position(33651, 32661, 13)):getItemById(9111) -- lever red local leverFour = Tile(Position(33673, 32688, 13)):getItemById(9110) or Tile(Position(33673, 32688, 13)):getItemById(9111) -- lever green - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.First, 2) -- green - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Second, 3) -- blue - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Third, 1) -- red - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Four, 6) -- ice + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.First, 2) -- green + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Second, 3) -- blue + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Third, 1) -- red + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Four, 6) -- ice player:sendTextMessage( MESSAGE_EVENT_ADVANCE, "You hear a whisper: \z @@ -72,7 +72,7 @@ function greenGem.onStepIn(creature, item, position, fromPosition) leverThird:setActionId(53823) leverFour:setActionId(53824) end - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Active, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Active, 1) item:transform(8648) addEvent(activeBasin, 1 * 1000, position) addEvent(revertBasin, 60 * 60 * 1000, position) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_habitats_access.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_habitats_access.lua similarity index 88% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_habitats_access.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/movements_habitats_access.lua index 748ba3d574f..984782bac2f 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_habitats_access.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_habitats_access.lua @@ -2,7 +2,7 @@ local config = { [34323] = { toPosition = Position(33630, 32651, 12), backPosition = Position(33630, 32651, 12), - timer = Storage.FerumbrasAscension.HabitatsTimer, + timer = Storage.Quest.U10_90.FerumbrasAscension.HabitatsTimer, }, } @@ -20,7 +20,7 @@ function habitatsAccess.onStepIn(creature, item, position, fromPosition) end if item.actionid == 34323 then - if player:getStorageValue(Storage.FerumbrasAscension.HabitatsAccess) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.HabitatsAccess) >= 1 then if player:getStorageValue(setting.timer) < os.time() then player:teleportTo(setting.toPosition) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_lovely_monsters.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_lovely_monsters.lua new file mode 100644 index 00000000000..9b9e531fa0e --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_lovely_monsters.lua @@ -0,0 +1,51 @@ +local config = { + [34315] = { name = "lovely frazzlemaw", centerPos = Position(33618, 32666, 12) }, + [34316] = { name = "lovely deer", centerPos = Position(33641, 32666, 12) }, + [34317] = { name = "lovely rotworm", centerPos = Position(33618, 32684, 12) }, + [34318] = { name = "lovely scorpion", centerPos = Position(33641, 32684, 12) }, + [34319] = { name = "lovely snake", centerPos = Position(33618, 32702, 12) }, + [34320] = { name = "lovely polar bear", centerPos = Position(33641, 32702, 12) }, + [34321] = { name = "lovely souleater", centerPos = Position(33618, 32720, 12) }, + [34322] = { name = "lovely yielothax", centerPos = Position(33641, 32720, 12) }, +} + +local lovelyMonsters = MoveEvent() + +function lovelyMonsters.onStepIn(creature, item, position, fromPosition) + local monsterConfig = config[item.actionid] + if not monsterConfig then + return true + end + + if creature:isPlayer() then + return true + end + + local monster = creature:getMonster() + if monster:getName():lower() == monsterConfig.name then + monster:say("That seemed correct!", TALKTYPE_MONSTER_SAY) + monster:getPosition():sendMagicEffect(CONST_ME_THUNDER) + monster:remove() + + local spectators = Game.getSpectators(monsterConfig.centerPos, false, true, 9, 9, 9, 9) + for _, spectator in pairs(spectators) do + if spectator:isPlayer() then + local player = spectator + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ZamuloshTeleports) < 0 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ZamuloshTeleports, 0) + end + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ZamuloshTeleports, player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ZamuloshTeleports) + 1) + end + end + return true + end + return true +end + +lovelyMonsters:type("stepin") + +for index, value in pairs(config) do + lovelyMonsters:aid(index) +end + +lovelyMonsters:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_mazoran_fire.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_mazoran_fire.lua similarity index 100% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_mazoran_fire.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/movements_mazoran_fire.lua diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_plagirath_access.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_plagirath_access.lua similarity index 86% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_plagirath_access.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/movements_plagirath_access.lua index b949b797b90..554e351e533 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_plagirath_access.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_plagirath_access.lua @@ -6,7 +6,7 @@ function plagirathAccess.onStepIn(creature, item, position, fromPosition) return true end - if player:getStorageValue(Storage.FerumbrasAscension.TheLordOfTheLiceAccess) < 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheLordOfTheLiceAccess) < 1 then local pos = player:getPosition() pos.x = pos.x - 2 player:teleportTo(pos) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_razzagorn_access.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_razzagorn_access.lua similarity index 87% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_razzagorn_access.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/movements_razzagorn_access.lua index c83b7be6f48..fe196bbf6e5 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_razzagorn_access.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_razzagorn_access.lua @@ -6,7 +6,7 @@ function razzagornAccess.onStepIn(creature, item, position, fromPosition) return true end - if player:getStorageValue(Storage.FerumbrasAscension.TheShatterer) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.TheShatterer) >= 1 then player:teleportTo(Position(33437, 32443, 15)) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) else diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_red_gem.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_red_gem.lua similarity index 67% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_red_gem.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/movements_red_gem.lua index a4acd970006..a98438661e5 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_red_gem.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_red_gem.lua @@ -34,19 +34,19 @@ local function revertBasin(position) end function revertStorages() - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Active, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.First, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Second, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Third, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Four, 0) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Done, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Active, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.First, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Second, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Third, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Four, 0) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done, 0) end local redGem = MoveEvent() function redGem.onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() - if not player or Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Active) >= 1 then + if not player or player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Active) >= 1 then position:sendMagicEffect(CONST_ME_TELEPORT) return true end @@ -55,10 +55,10 @@ function redGem.onStepIn(creature, item, position, fromPosition) local leverSecond = Tile(Position(33671, 32638, 13)):getItemById(9110) or Tile(Position(33671, 32638, 13)):getItemById(9111) -- lever blue local leverThird = Tile(Position(33613, 32691, 13)):getItemById(9110) or Tile(Position(33613, 32691, 13)):getItemById(9111) -- lever green local leverFour = Tile(Position(33671, 32688, 13)):getItemById(9110) or Tile(Position(33671, 32688, 13)):getItemById(9111) -- lever green - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.First, 1) -- red - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Second, 3) -- blue - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Third, 2) -- green - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Four, 4) -- blood + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.First, 1) -- red + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Second, 3) -- blue + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Third, 2) -- green + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Four, 4) -- blood player:sendTextMessage( MESSAGE_EVENT_ADVANCE, "You hear a whisper: \z @@ -67,12 +67,12 @@ function redGem.onStepIn(creature, item, position, fromPosition) if not leverFirst or not leverSecond or not leverThird or not leverFour then return false end - leverFirst:setActionId(53820 + Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.First)) - leverSecond:setActionId(53820 + Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Second)) - leverThird:setActionId(53820 + Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Third)) + leverFirst:setActionId(53820 + player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.First)) + leverSecond:setActionId(53820 + player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Second)) + leverThird:setActionId(53820 + player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Third)) leverFour:setActionId(53824) end - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Elements.Active, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Active, 1) item:transform(8648) addEvent(activeBasin, 1 * 1000, position) addEvent(revertBasin, 60 * 60 * 1000, position) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_seal.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_seal.lua new file mode 100644 index 00000000000..4c381a20264 --- /dev/null +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_seal.lua @@ -0,0 +1,130 @@ +local config = { + [24839] = { + toPosition = Position(33419, 32841, 11), + backPosition = Position(33484, 32775, 12), + boss = "Tarbaz", + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.TarbazTime, + }, + [24840] = { + toPosition = Position(33452, 32356, 13), + backPosition = Position(33432, 32330, 14), + boss = "Ragiaz", + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.RagiazTime, + }, + [24841] = { + toPosition = Position(33230, 31493, 13), + backPosition = Position(33197, 31438, 13), + boss = "Plagirath", + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.PlagirathTime, + }, + [24842] = { + toPosition = Position(33380, 32454, 14), + backPosition = Position(33399, 32402, 15), + boss = "Razzagorn", + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.RazzagornTime, + }, + [24843] = { + toPosition = Position(33680, 32736, 11), + backPosition = Position(33664, 32682, 10), + boss = "Zamulosh", + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.ZamuloshTime, + }, + [24844] = { + toPosition = Position(33593, 32658, 14), + backPosition = Position(33675, 32690, 13), + boss = "Mazoran", + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.MazoranTime, + }, + [24845] = { + toPosition = Position(33436, 32800, 13), + backPosition = Position(33477, 32701, 14), + boss = "Shulgrax", + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.ShulgraxTime, + }, + [24846] = { + toPosition = Position(33270, 31474, 14), + backPosition = Position(33324, 31374, 14), + boss = "Ferumbras Mortal Shell", + cooldownStorage = Storage.Quest.U10_90.FerumbrasAscension.FerumbrasMortalShellTime, + }, +} + +local seal = MoveEvent() + +function seal.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local setting = config[item.actionid] + if not setting then + return true + end + + local cooldownTime = player:getStorageValue(setting.cooldownStorage) + if cooldownTime > os.time() then + local remainingTime = cooldownTime - os.time() + local days = math.floor(remainingTime / (24 * 3600)) + local hours = math.floor((remainingTime % (24 * 3600)) / 3600) + local minutes = math.floor((remainingTime % 3600) / 60) + player:teleportTo(setting.backPosition) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait for time to pass for this boss again.") + return true + end + + if item.actionid == 24844 then -- Mazoran + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Elements.Done) >= 4 then + if player:canFightBoss(setting.boss) then + player:teleportTo(setting.toPosition) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + else + player:teleportTo(Position(33675, 32690, 13)) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:say("You have to wait to challenge this enemy again!", TALKTYPE_MONSTER_SAY) + return true + end + else + local pos = position + pos.y = pos.y + 2 + player:teleportTo(pos) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You not proven your worth. There is no escape for you here.") + item:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true + end + elseif item.actionid == 24845 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FlowerPuzzleTimer) >= 1 then + if player:canFightBoss(setting.boss) then + player:teleportTo(setting.toPosition) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + else + player:teleportTo(Position(33477, 32701, 14)) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:say("You have to wait to challenge this enemy again!", TALKTYPE_MONSTER_SAY) + return true + end + else + local pos = position + pos.y = pos.y + 2 + player:teleportTo(pos) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You not proven your worth. There is no escape for you here.") + item:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true + end + elseif item.actionid == 24846 then -- Ferumbras Mortal Shell + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The portal leads you to the final challenge.") + end + + player:teleportTo(setting.toPosition) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true +end + +seal:type("stepin") + +for index, value in pairs(config) do + seal:aid(index) +end + +seal:register() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_shulgrax_lever.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_shulgrax_lever.lua similarity index 86% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_shulgrax_lever.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/movements_shulgrax_lever.lua index f0a74a7a058..d6052ee0861 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_shulgrax_lever.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_shulgrax_lever.lua @@ -6,7 +6,7 @@ function shulgraxLever.onStepIn(creature, item, position, fromPosition) return true end - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.FlowerPuzzleTimer) >= 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FlowerPuzzleTimer) >= 1 then player:teleportTo(Position(33436, 32800, 13)) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) else diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_stair.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_stair.lua similarity index 60% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_stair.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/movements_stair.lua index 3ab9d7b1a30..f7f9366ecd8 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_stair.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_stair.lua @@ -1,11 +1,11 @@ local config = { - [1] = { storage = Storage.FerumbrasAscension.Razzagorn }, - [2] = { storage = Storage.FerumbrasAscension.Ragiaz }, - [3] = { storage = Storage.FerumbrasAscension.Zamulosh }, - [4] = { storage = Storage.FerumbrasAscension.Mazoran }, - [5] = { storage = Storage.FerumbrasAscension.Tarbaz }, - [6] = { storage = Storage.FerumbrasAscension.Shulgrax }, - [7] = { storage = Storage.FerumbrasAscension.Plagirath }, + [1] = { storage = Storage.Quest.U10_90.FerumbrasAscension.Razzagorn }, + [2] = { storage = Storage.Quest.U10_90.FerumbrasAscension.Ragiaz }, + [3] = { storage = Storage.Quest.U10_90.FerumbrasAscension.Zamulosh }, + [4] = { storage = Storage.Quest.U10_90.FerumbrasAscension.Mazoran }, + [5] = { storage = Storage.Quest.U10_90.FerumbrasAscension.Tarbaz }, + [6] = { storage = Storage.Quest.U10_90.FerumbrasAscension.Shulgrax }, + [7] = { storage = Storage.Quest.U10_90.FerumbrasAscension.Plagirath }, } local stair = MoveEvent() diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_vortex.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_vortex.lua similarity index 71% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_vortex.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/movements_vortex.lua index eaa838cd8e1..6a001370f7c 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_vortex.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_vortex.lua @@ -10,8 +10,8 @@ function vortex.onStepIn(creature, item, position, fromPosition) monster:remove() position:sendMagicEffect(CONST_ME_POFF) - Game.setStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence) + 1) - if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.FerumbrasEssence) >= 8 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FerumbrasEssence, player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FerumbrasEssence) + 1) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.FerumbrasEssence) >= 8 then Game.createMonster("Destabilized Ferumbras", config.bossPos, true, true) for i = 1, config.maxSummon do Game.createMonster("Rift Fragment", Position(math.random(33381, 33403), math.random(31462, 31483), 14), true, true) diff --git a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_zamulosh_teleport.lua b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_zamulosh_teleport.lua similarity index 79% rename from data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_zamulosh_teleport.lua rename to data-otservbr-global/scripts/quests/ferumbras_ascension/movements_zamulosh_teleport.lua index 11f98b10861..fcb6ecf332b 100644 --- a/data-otservbr-global/scripts/quests/ferumbras_ascendant/movements_zamulosh_teleport.lua +++ b/data-otservbr-global/scripts/quests/ferumbras_ascension/movements_zamulosh_teleport.lua @@ -7,7 +7,7 @@ function zamuloshTeleport.onStepIn(creature, item, position, fromPosition) end if item.actionid == 34313 then - if player:getStorageValue(Storage.FerumbrasAscension.ZamuloshTeleports) >= 9 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ZamuloshTeleports) >= 9 then player:teleportTo(Position(33618, 32620, 10)) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "What was wrong is not necessarily right now. Nevertheless you nade it further.") @@ -21,11 +21,11 @@ function zamuloshTeleport.onStepIn(creature, item, position, fromPosition) return true end elseif item.actionid == 34314 then - if player:getStorageValue(Storage.FerumbrasAscension.ZamuloshTeleports) >= 4 and Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) >= 8 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ZamuloshTeleports) >= 4 and player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.Habitats.AllHabitats) >= 7 then player:teleportTo(Position(33618, 32620, 10)) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "What was wrong is not necessarily right now. Nevertheless you nade it further.") - player:setStorageValue(Storage.FerumbrasAscension.ZamuloshTeleports, 9) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.ZamuloshTeleports, 9) return true else local pos = player:getPosition() diff --git a/data-otservbr-global/scripts/quests/others/actions_fire_bug.lua b/data-otservbr-global/scripts/quests/others/actions_fire_bug.lua index 5e941bc89d7..ab532eef8fb 100644 --- a/data-otservbr-global/scripts/quests/others/actions_fire_bug.lua +++ b/data-otservbr-global/scripts/quests/others/actions_fire_bug.lua @@ -29,19 +29,19 @@ local positions = { local othersFireBug = Action() function othersFireBug.onUse(player, item, fromPosition, target, toPosition, isHotkey) if target.actionid == 54387 and target.itemid == 22875 then - if player:getStorageValue(Storage.FerumbrasAscension.BasinCounter) >= 8 or player:getStorageValue(Storage.FerumbrasAscension.BoneFlute) < 1 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.BasinCounter) >= 8 or player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.BoneFlute) < 1 then return false end - if player:getStorageValue(Storage.FerumbrasAscension.BasinCounter) < 0 then - player:setStorageValue(Storage.FerumbrasAscension.BasinCounter, 0) + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.BasinCounter) < 0 then + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.BasinCounter, 0) end - if player:getStorageValue(Storage.FerumbrasAscension.BasinCounter) == 7 then + if player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.BasinCounter) == 7 then player:say("You ascended the last basin.", TALKTYPE_MONSTER_SAY) item:remove() - player:setStorageValue(Storage.FerumbrasAscension.MonsterDoor, 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.MonsterDoor, 1) end target:transform(22876) - player:setStorageValue(Storage.FerumbrasAscension.BasinCounter, player:getStorageValue(Storage.FerumbrasAscension.BasinCounter) + 1) + player:setStorageValue(Storage.Quest.U10_90.FerumbrasAscension.BasinCounter, player:getStorageValue(Storage.Quest.U10_90.FerumbrasAscension.BasinCounter) + 1) toPosition:sendMagicEffect(CONST_ME_FIREAREA) addEvent(revert, 2 * 60 * 1000, toPosition, 22876, 22875) return true diff --git a/data-otservbr-global/startup/tables/chest.lua b/data-otservbr-global/startup/tables/chest.lua index ac239873b87..d5b28c633ed 100644 --- a/data-otservbr-global/startup/tables/chest.lua +++ b/data-otservbr-global/startup/tables/chest.lua @@ -2599,6 +2599,28 @@ ChestUnique = { weight = 6.00, questName = "NightmareTeddyQuest", }, + -- Ferumbras' Ascension Quest + [6306] = { + itemId = 1983, + itemPos = { x = 33384, y = 32323, z = 12 }, + reward = { { 22160, 1 } }, + weight = 1.00, + storage = Storage.Quest.U10_90.FerumbrasAscension.TheRiteOfEternalNight, + }, + [6307] = { + itemId = 1986, + itemPos = { x = 33393, y = 32373, z = 11 }, + reward = { { 22158, 1 } }, + weight = 15.00, + storage = Storage.Quest.U10_90.FerumbrasAscension.StoneCoffinsBones, + }, + [6309] = { + itemId = 21818, + itemPos = { x = 33408, y = 32396, z = 11 }, + reward = { { 9685, 1 } }, + weight = 1.00, + storage = Storage.Quest.U10_90.FerumbrasAscension.VampireTeeth, + }, -- Reward of others scrips files (varied rewards) -- The First dragon Quest -- Treasure chests (data\scripts\actions\quests\first_dragon\treasure_chests.lua) diff --git a/data-otservbr-global/startup/tables/door_quest.lua b/data-otservbr-global/startup/tables/door_quest.lua index 74b07ff81df..3e5888b7399 100644 --- a/data-otservbr-global/startup/tables/door_quest.lua +++ b/data-otservbr-global/startup/tables/door_quest.lua @@ -258,15 +258,15 @@ QuestDoorAction = { itemPos = { { x = 33452, y = 32241, z = 7 } }, }, -- Ferumbras ascension door - [Storage.FerumbrasAscension.FirstDoor] = { + [Storage.Quest.U10_90.FerumbrasAscension.FirstDoor] = { itemId = false, itemPos = { { x = 33479, y = 32782, z = 11 } }, }, - [Storage.FerumbrasAscension.MonsterDoor] = { + [Storage.Quest.U10_90.FerumbrasAscension.MonsterDoor] = { itemId = false, itemPos = { { x = 33482, y = 32786, z = 11 } }, }, - [Storage.FerumbrasAscension.TarbazDoor] = { + [Storage.Quest.U10_90.FerumbrasAscension.TarbazDoor] = { itemId = false, itemPos = { { x = 33470, y = 32786, z = 11 } }, }, @@ -833,6 +833,13 @@ QuestDoorAction = { { x = 33159, y = 32322, z = 12 }, }, }, + [Storage.Quest.U10_90.FerumbrasAscension.TarbazDoor] = { + itemId = 22508, + itemPos = { + { x = 33476, y = 32791, z = 11 }, + { x = 33470, y = 32786, z = 11 }, + }, + }, [Storage.Kilmaresh.AccessDoor] = { itemId = false, itemPos = { { x = 33886, y = 31476, z = 7 } }, diff --git a/data-otservbr-global/startup/tables/item.lua b/data-otservbr-global/startup/tables/item.lua index e4bfabf610d..ed01d30aeed 100644 --- a/data-otservbr-global/startup/tables/item.lua +++ b/data-otservbr-global/startup/tables/item.lua @@ -824,6 +824,67 @@ ItemAction = { { x = 32741, y = 32382, z = 15 }, }, }, + -- Ferumbras' Ascension Quest + [24837] = { + itemId = 1949, + itemPos = { + { x = 33317, y = 32315, z = 13 }, + }, + }, + [24838] = { + itemId = 1949, + itemPos = { + { x = 33275, y = 32388, z = 8 }, + }, + }, + [24839] = { + itemId = 1949, + itemPos = { + { x = 33482, y = 32775, z = 12 }, + }, + }, + [24840] = { + itemId = 1949, + itemPos = { + { x = 33432, y = 32332, z = 14 }, + }, + }, + [24841] = { + itemId = 1949, + itemPos = { + { x = 33199, y = 31439, z = 13 }, + }, + }, + [24842] = { + itemId = 1949, + itemPos = { + { x = 33402, y = 32406, z = 15 }, + }, + }, + [24843] = { + itemId = 1949, + itemPos = { + { x = 33662, y = 32682, z = 10 }, + }, + }, + [24844] = { + itemId = 1949, + itemPos = { + { x = 33677, y = 32689, z = 13 }, + }, + }, + [24845] = { + itemId = 8280, + itemPos = { + { x = 33477, y = 32698, z = 14 }, + }, + }, + [24846] = { + itemId = 1949, + itemPos = { + { x = 33324, y = 31372, z = 14 }, + }, + }, -- The Cursed Crystal [25018] = { itemId = false, @@ -994,6 +1055,26 @@ ItemAction = { { x = 32406, y = 32794, z = 9 }, }, }, + -- Ferumbras' Ascension Quest + [34313] = { + itemId = 1949, + itemPos = { + { x = 33637, y = 32650, z = 12 }, + }, + }, + [34314] = { + itemId = 1949, + itemPos = { + { x = 33629, y = 32739, z = 12 }, + }, + }, + [34323] = { + itemId = 1949, + itemPos = { + { x = 33666, y = 32624, z = 11 }, + { x = 33629, y = 32621, z = 11 }, + }, + }, -- The Pits of Inferno [39511] = { itemId = 6433, @@ -1458,6 +1539,40 @@ ItemAction = { { x = 32994, y = 32625, z = 6 }, }, }, + -- Ferumbras' Ascension Quest + [53803] = { + itemId = 22872, + itemPos = { + { x = 33388, y = 32358, z = 11 }, + }, + }, + [53805] = { + itemId = false, + itemPos = { + { x = 33421, y = 32383, z = 12 }, + { x = 33422, y = 32383, z = 12 }, + { x = 33422, y = 32384, z = 12 }, + { x = 33421, y = 32384, z = 12 }, + }, + }, + [53812] = { + itemId = 8646, + itemPos = { + { x = 33626, y = 32621, z = 13 }, + }, + }, + [53813] = { + itemId = 8647, + itemPos = { + { x = 33635, y = 32682, z = 13 }, + }, + }, + [53814] = { + itemId = 8649, + itemPos = { + { x = 33660, y = 32627, z = 13 }, + }, + }, -- Roshamuul Quest [55000] = { itemId = false, @@ -1498,6 +1613,11 @@ ItemUnique = { itemId = 8821, itemPos = { x = 32682, y = 31242, z = 6 }, }, + -- Ferumbras' Ascension Quest + [1035] = { + itemId = 4073, + itemPos = { x = 33388, y = 31409, z = 14 }, + }, -- The Ice Islands Quest [1061] = { itemId = 2576, diff --git a/data-otservbr-global/startup/tables/lever.lua b/data-otservbr-global/startup/tables/lever.lua index beeb35f14ac..86798188a0a 100644 --- a/data-otservbr-global/startup/tables/lever.lua +++ b/data-otservbr-global/startup/tables/lever.lua @@ -171,6 +171,62 @@ LeverAction = { { x = 32600, y = 32105, z = 14 }, }, }, + -- Ferumbras' Ascension Quest + [34305] = { + itemId = 9125, + itemPos = { + { x = 33628, y = 32665, z = 12 }, + }, + }, + [34306] = { + itemId = 9125, + itemPos = { + { x = 33631, y = 32665, z = 12 }, + }, + }, + [34307] = { + itemId = 9125, + itemPos = { + { x = 33628, y = 32683, z = 12 }, + }, + }, + [34308] = { + itemId = 9125, + itemPos = { + { x = 33631, y = 32683, z = 12 }, + }, + }, + [34309] = { + itemId = 9125, + itemPos = { + { x = 33628, y = 32701, z = 12 }, + }, + }, + [34310] = { + itemId = 9125, + itemPos = { + { x = 33631, y = 32701, z = 12 }, + }, + }, + [34311] = { + itemId = 9125, + itemPos = { + { x = 33628, y = 32719, z = 12 }, + }, + }, + [34312] = { + itemId = 9125, + itemPos = { + { x = 33631, y = 32719, z = 12 }, + }, + }, + [34324] = { + itemId = 9125, + itemPos = { + { x = 33628, y = 32616, z = 11 }, + { x = 33671, y = 32623, z = 11 }, + }, + }, -- The Pits of Inferno Quest [50160] = { itemId = 2772, @@ -203,6 +259,63 @@ LeverUnique = { itemId = 2772, itemPos = { x = 33172, y = 31896, z = 8 }, }, + -- Ferumbras' Ascension Quest + [1021] = { + itemId = 8911, + itemPos = { x = 33270, y = 31476, z = 14 }, + }, + [1022] = { + itemId = 8911, + itemPos = { x = 33229, y = 31499, z = 13 }, + }, + [1023] = { + itemId = 8911, + itemPos = { x = 33455, y = 32356, z = 13 }, + }, + [1024] = { + itemId = 8911, + itemPos = { x = 33385, y = 32455, z = 14 }, + }, + [1025] = { + itemId = 8911, + itemPos = { x = 33593, y = 32643, z = 14 }, + }, + [1026] = { + itemId = 8911, + itemPos = { x = 33680, y = 32740, z = 11 }, + }, + [1027] = { + itemId = 8911, + itemPos = { x = 33418, y = 32848, z = 11 }, + }, + [1028] = { + itemId = 8911, + itemPos = { x = 33434, y = 32784, z = 13 }, + }, + [1029] = { + itemId = 8911, + itemPos = { x = 33402, y = 32465, z = 13 }, + }, + [1030] = { + itemId = 8911, + itemPos = { x = 33202, y = 31475, z = 11 }, + }, + [1031] = { + itemId = 8911, + itemPos = { x = 33385, y = 32410, z = 14 }, + }, + [1032] = { + itemId = 8911, + itemPos = { x = 33403, y = 32391, z = 14 }, + }, + [1033] = { + itemId = 8911, + itemPos = { x = 33410, y = 32441, z = 14 }, + }, + [1034] = { + itemId = 8911, + itemPos = { x = 33430, y = 32418, z = 14 }, + }, -- The Pits of Inferno [1037] = { itemId = 2772, diff --git a/data-otservbr-global/world/otservbr-house.xml b/data-otservbr-global/world/otservbr-house.xml index f7e5cd52370..7eff23b4606 100644 --- a/data-otservbr-global/world/otservbr-house.xml +++ b/data-otservbr-global/world/otservbr-house.xml @@ -284,7 +284,7 @@ - + diff --git a/data-otservbr-global/world/otservbr-zones.xml b/data-otservbr-global/world/otservbr-zones.xml index 4740d50385c..44cff897a42 100644 --- a/data-otservbr-global/world/otservbr-zones.xml +++ b/data-otservbr-global/world/otservbr-zones.xml @@ -1,4 +1,4 @@ - + diff --git a/data/items/items.xml b/data/items/items.xml index 7de74b6740b..f6e30a6dd0d 100644 --- a/data/items/items.xml +++ b/data/items/items.xml @@ -44187,7 +44187,7 @@ Awarded by TibiaMisterios.com.br"/> - + @@ -44202,7 +44202,7 @@ Awarded by TibiaMisterios.com.br"/> - + @@ -45274,8 +45274,10 @@ Awarded by TibiaMisterios.com.br"/> + +