From ac4309e5f992912a09764530109ed6f435831b3f Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:33:29 -0300 Subject: [PATCH 01/22] The Dream Courts Quest - part 1 --- data-otservbr-global/lib/core/quests.lua | 57 +++ data-otservbr-global/lib/core/storages.lua | 108 ++++-- .../bosses/izcandar_champion_of_summer.lua | 140 +++++++ .../bosses/izcandar_champion_of_winter.lua | 140 +++++++ .../the_dream_courts/bosses/alptramun.lua | 10 +- .../the_dream_courts/bosses/faceless_bane.lua | 6 + .../bosses/izcandar_the_banished.lua | 10 +- .../bosses/malofur_mangrinder.lua | 10 +- .../the_dream_courts/bosses/maxxenius.lua | 10 +- .../the_dream_courts/bosses/plagueroot.lua | 10 +- .../bosses/the_nightmare_beast.lua | 9 +- .../the_dream_courts/horrible_dream.lua | 4 + .../the_dream_courts/mind-wrecking_dream.lua | 4 + .../the_dream_courts/nightmarish_dream.lua | 4 + .../the_dream_courts/plant_abomination.lua | 4 + .../the_dream_courts/unpleasant_dream.lua | 4 + .../monster/faceless_bane_immunity.lua | 47 --- .../scripts/lib/register_actions.lua | 47 ++- .../actions_bosses_killed.lua | 24 -- .../actions_dream_courts_lever.lua | 91 ----- .../actions_entrances_dream_courts.lua | 27 -- .../actions_portal_nightmare_beast.lua | 38 -- ...movements_faceless_bane_step_positions.lua | 114 ------ .../the_dream_courts/movements_teleport.lua | 39 -- .../actions_acidFishingRod.lua | 31 ++ .../actions_bookOnTable.lua | 31 ++ .../actions_chargedCompass.lua | 39 ++ .../actions_containerRewards.lua | 153 ++++++++ .../actions_doorInvisible.lua | 29 ++ .../actions_dreamTalisman.lua | 96 +++++ .../actions_dreamcatcher_curse.lua | 78 ++++ .../actions_dreamscarLevers.lua | 362 ++++++++++++++++++ .../actions_facelessLever.lua | 93 +++++ .../actions_goldenAxe.lua | 92 +++++ .../actions_goldenIdol.lua | 37 ++ .../actions_idolCheck.lua | 57 +++ .../actions_keyCheck.lua | 40 ++ .../actions_magicalPaint.lua | 45 +++ .../actions_oldLock.lua | 32 ++ .../actions_questDoors.lua | 157 ++++++++ .../actions_rosebushUse.lua | 34 ++ .../actions_sacrophagusUse.lua | 79 ++++ .../actions_sequenceBooks.lua | 67 ++++ .../actions_sequenceSkulls.lua | 63 +++ .../actions_strangeBucket.lua | 79 ++++ .../actions_sunFruit.lua | 30 ++ .../creaturescripts_Izcandar.lua | 73 ++++ .../creaturescripts_dreamCourtsDeath.lua | 136 +++++++ .../creaturescripts_facelessBane.lua | 65 ++++ .../creaturescripts_nightmareCurse.lua | 68 ++++ .../globalevents_dreamCourts.lua | 88 +++++ .../globalevents_dream_courts_worldchange.lua | 42 ++ .../movements_acessTeleports.lua | 129 +++++++ .../movements_corruptedNature.lua | 29 ++ .../movements_courtsEntrance.lua | 153 ++++++++ .../movements_crackedTile.lua | 17 + .../movements_facelessTiles.lua | 51 +++ .../movements_slimeLooktype.lua | 28 ++ .../movements_spiderSummon.lua | 32 ++ .../spells_alptramun_summon.lua | 59 +++ .../spells_cold_of_winter.lua | 46 +++ .../spells_generator_wave.lua | 49 +++ .../spells_heat_of_summer.lua | 49 +++ .../spells_malofur_explosion.lua | 124 ++++++ .../spells_maxxenius_energy_elemental.lua | 69 ++++ .../spells_nightmare_beast_curse.lua | 34 ++ .../spells_plagueroot_skill_reducer.lua | 30 ++ .../spells_plagueroot_teleport.lua | 89 +++++ .../spells_plant_abomination_wave.lua | 49 +++ .../spells_plant_attendant_wave.lua | 44 +++ .../startup/tables/door_quest.lua | 29 -- data-otservbr-global/startup/tables/item.lua | 211 ++++++++++ data-otservbr-global/startup/tables/lever.lua | 14 + .../world/otservbr-monster.xml | 2 +- 74 files changed, 4024 insertions(+), 466 deletions(-) create mode 100644 data-otservbr-global/monster/bosses/izcandar_champion_of_summer.lua create mode 100644 data-otservbr-global/monster/bosses/izcandar_champion_of_winter.lua delete mode 100644 data-otservbr-global/scripts/creaturescripts/monster/faceless_bane_immunity.lua delete mode 100644 data-otservbr-global/scripts/quests/the_dream_courts/actions_bosses_killed.lua delete mode 100644 data-otservbr-global/scripts/quests/the_dream_courts/actions_dream_courts_lever.lua delete mode 100644 data-otservbr-global/scripts/quests/the_dream_courts/actions_entrances_dream_courts.lua delete mode 100644 data-otservbr-global/scripts/quests/the_dream_courts/actions_portal_nightmare_beast.lua delete mode 100644 data-otservbr-global/scripts/quests/the_dream_courts/movements_faceless_bane_step_positions.lua delete mode 100644 data-otservbr-global/scripts/quests/the_dream_courts/movements_teleport.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_keyCheck.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_magicalPaint.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_oldLock.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_rosebushUse.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sacrophagusUse.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_strangeBucket.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sunFruit.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dreamCourts.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_corruptedNature.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_courtsEntrance.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_crackedTile.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_slimeLooktype.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_cold_of_winter.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_generator_wave.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_heat_of_summer.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_malofur_explosion.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_maxxenius_energy_elemental.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_skill_reducer.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_teleport.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_abomination_wave.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_attendant_wave.lua diff --git a/data-otservbr-global/lib/core/quests.lua b/data-otservbr-global/lib/core/quests.lua index 19b5a058986..f2a984ddcdb 100644 --- a/data-otservbr-global/lib/core/quests.lua +++ b/data-otservbr-global/lib/core/quests.lua @@ -6633,5 +6633,62 @@ if not Quests then }, }, }, + [50] = { + name = "The Dream Courts", + startStorageId = Storage.Quest.U12_00.TheDreamCourts.Main.Questline, + startStorageValue = 1, + missions = { + [1] = { + name = "The Dream Courts", + storageId = Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, + missionId = 10457, + startValue = 1, + endValue = 3, + states = { + [1] = function(player)return string.format("You already got %d/8 energized ward stones.", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count), 0)) end, + [2] = "You must kill the Nightmare Beast.", + [3] = "By defeating the dreadful Nightmare Beast you did the Winter Court and the Summer Court alike a great favor. From now on, the dream elves will regard you as a friend.", + }, + }, + [2] = { + name = "Unsafe Release", + storageId = Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, + missionId = 10458, + startValue = 1, + endValue = 3, + states = { + [1] = "Part I", + [2] = "Part II", + [3] = "Andre was happy to hear that the compass works as intendend. From now on it is possible that he will charge your compass again. It can be used to give acess to mystical chests once a day.", + }, + }, + [3] = { + name = "Haunted House", + storageId = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, + missionId = 10459, + startValue = 1, + endValue = 6, + states = { + [1] = function(player)return string.format("A tormented soul trusted you with the secret of this house: join the passages to the three dungeons it connects to reveal a hidden portal within!\n\nCellar %d/1\nTemple %d/1\nTomb %d/1", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar), 0), math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple), 0), math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb), 0)) end, + [2] = "Part I - burried catedral", + [3] = "Part II - puzzle dos livros", + [4] = "Part III - bosses", + [5] = "Part IV - last stone", + [6] = "Activating the ward stone after defeating the Faceless Bane has gained you acess to the deepest mysteries of the dream courts.", + }, + }, + [4] = { + name = "The Seven Keys", + storageId = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + missionId = 10460, + startValue = 1, + endValue = 2, + states = { + [1] = function(player)return string.format("You already got %d/7 secret keys.", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count), 0)) end, + [2] = "You found the seven keys to unlock the Seven Dream Doors in the Labyrinth of Summer's and Winter's Dreams.", + }, + }, + }, + }, } end diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 4529c64f583..7a2b2ac1abc 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -2712,23 +2712,92 @@ Storage = { MeasuringTibia = {}, }, U12_00 = { -- update 12.00 - Reserved Storages 46301 - 46600 - DreamWarriorOutfits = {}, TheDreamCourts = { - QuestLine = 46401, - HauntedHouseAccess = 46402, - BuriedCathedralAccess = 46403, - DreamScarAccess = 46404, - AndrewDoor = 14900, - AccessDoors = 46309, - ArenaTimer = 46310, - PlaguerootKilled = 46311, - MalofurKilled = 46312, - MaxxeniusKilled = 46313, - AlptramunKilled = 46314, - IzcandarKilled = 46315, - NightmareBeastTimer = 46316, - NightmareBeastKilled = 46317, + Main = { + Questline = 23000, + CourtChest = 23001, + }, + WardStones = { + Questline = 23100, + Count = 23101, + OkolnirStone = 23102, + FoldaStone = 23103, + CalassaStone = 23104, + FeyristStone = 23105, + MerianaStone = 23106, + CormayaStone = 23107, + PortHopeStone = 23108, + CatedralStone = 23109, + }, + UnsafeRelease = { + Questline = 23115, + GotAxe = 23116, + HasBait = 23117, + }, + HauntedHouse = { + Questline = 23130, + SkeletonContainer = 23131, + Cellar = 23132, + Temple = 23133, + Tomb = 23134, + }, + BurriedCatedral = { + FishingRod = 23145, + EstatueWord = 23146, + BarrelWord = 23147, + BedWord = 23148, + LakeWord = 23149, + WordCount = 23150, + SequenceBooks = 23151, + FacelessTimer = 23152, + FacelessLifes = 23153, + }, + TheSevenKeys = { + Questline = 23170, + RoseBush = 23171, + Mushroom = 23172, + Book = 23173, + OrcSkull = 23174, + Recipe = 23175, + MinotaurSkull = 23176, + TrollSkull = 23177, + Lock = 23178, + DoorMedusa = 23179, + DoorInvisible = 23180, + Painting = 23181, + SequenceSkulls = 23182, + Count = 23185, + }, + DreamScar = { + Permission = 23190, + BossCount = 23191, + MaxxeniusTimer = 23192, + AlptramunTimer = 23193, + PlaguerootTimer = 23194, + IzcandarTimer = 23195, + MalofurTimer = 23196, + NightmareTimer = 23197, + LastBossCurse = 23198, + }, + BurriedCatedral = { + FacelessTiles = 531900, + FacelessTimer = 531901, + }, + DreamScar = { + MaxxeniusTimer = 531902, + AlptramunTimer = 531903, + PlaguerootTimer = 531904, + IzcandarTimer = 531905, + MalofurTimer = 531906, + AlptramunSummonsKilled = 531907, + IzcandarOutfit = 531908, + NightmareTimer = 531909, + LastBossCurse = 531910, + }, + NightmareCurse = 531810, + Malofur = 531811, }, + DreamWarriorOutfits = {}, }, U12_02 = { -- update 12.02 - Reserved Storages 46601 - 46800 TibiaAnniversary = {}, @@ -2933,15 +3002,6 @@ GlobalStorage = { DarashiaWest = 60193, }, }, - TheDreamCourts = { - -- Reserved storage from 60194 - 60196 - FacelessBane = { - -- Global - StepsOn = 60194, - Deaths = 60195, - ResetSteps = 60196, - }, - }, FuryGates = 65000, Yakchal = 65001, PitsOfInfernoLevers = 65002, diff --git a/data-otservbr-global/monster/bosses/izcandar_champion_of_summer.lua b/data-otservbr-global/monster/bosses/izcandar_champion_of_summer.lua new file mode 100644 index 00000000000..f1f0f827c36 --- /dev/null +++ b/data-otservbr-global/monster/bosses/izcandar_champion_of_summer.lua @@ -0,0 +1,140 @@ +local mType = Game.createMonsterType("Izcandar Champion of Summer") +local monster = {} + +monster.description = "Izcandar Champion of Summer" +monster.experience = 6900 +monster.outfit = { + lookType = 1137, + lookHead = 43, + lookBody = 78, + lookLegs = 43, + lookFeet = 43, + lookAddons = 3, + lookMount = 0, +} + +monster.health = 130000 +monster.maxHealth = 130000 +monster.race = "blood" +monster.corpse = 25151 +monster.speed = 200 +monster.manaCost = 0 + +monster.events = { + "dreamCourtsDeath", + "izcandarThink", +} + +monster.changeTarget = { + interval = 4000, + chance = 10, +} + +monster.strategiesTarget = { + nearest = 70, + health = 10, + damage = 10, + random = 10, +} + +monster.flags = { + summonable = false, + attackable = true, + hostile = true, + convinceable = false, + pushable = false, + rewardBoss = true, + illusionable = false, + canPushItems = true, + canPushCreatures = true, + staticAttackChance = 90, + targetDistance = 1, + runHealth = 0, + healthHidden = false, + isBlockable = false, + canWalkOnEnergy = true, + canWalkOnFire = true, + canWalkOnPoison = true, +} + +monster.light = { + level = 0, + color = 0, +} + +monster.voices = { + interval = 5000, + chance = 10, + {text = "Dream or nightmare?", yell = false}, +} + +monster.loot = { + { name = "Energy Bar", chance = 100000 }, + { name = "Gold Token", chance = 100000, maxCount = 2 }, + { name = "Piggy Bank", chance = 100000 }, + { name = "Platinum Coin", chance = 100000, maxCount = 5 }, + { name = "Silver Token", chance = 100000, maxCount = 2 }, + { name = "Mysterious Remains", chance = 100000 }, + { name = "Yellow Gem", chance = 69230, maxCount = 2 }, + { name = "Ultimate Spirit Potion", chance = 61540, maxCount = 20 }, + { name = "Supreme Health Potion", chance = 53850, maxCount = 20 }, + { name = "Ultimate Mana Potion", chance = 53850, maxCount = 14 }, + { id = 3039, chance = 46150 }, -- red gem + { id = 23529, chance = 38460 }, -- Ring of Blue Plasma + { name = "Chaos Mace", chance = 23080 }, + { name = "Huge Chunk of Crude Iron", chance = 30777 }, + { name = "Bullseye Potion", chance = 23080, maxCount = 10 }, + { name = "Summerblade", chance = 100, unique = true }, + { id = 281, chance = 23080 }, -- giant shimmering pearl + { name = "Royal Star", chance = 23080, maxCount = 100 }, + { name = "Blue Gem", chance = 15380 }, + { name = "Mastermind Potion", chance = 15380, maxCount = 10 }, + { name = "Skull Staff", chance = 15380 }, + { name = "Berserk Potion", chance = 7690, maxCount = 10 }, + { id = 23543, chance = 7690 }, -- Collar of Green Plasma + { id = 23544, chance = 7690 }, -- Collar of Red Plasma + { name = "Crystal Coin", chance = 7690, maxCount = 2 }, + { name = "Ornate Locket", chance = 7690 }, + { name = "Pomegranate", chance = 7690 }, + { id = 26189, chance = 7690 }, -- Ring of Red Plasma + { name = "Ring of the Sky", chance = 7690 }, + { name = "Izcandar's Snow Globe", chance = 1500 }, +} + +monster.attacks = { + { name = "melee", interval = 2000, chance = 100, minDamage = -320, maxDamage = -750 }, + { name = "combat", interval = 2000, chance = 10, type = COMBAT_ICEDAMAGE, minDamage = -500, maxDamage = -850, radius = 6, effect = false, target = false }, + { name = "combat", interval = 2000, chance = 15, type = COMBAT_DROWNDAMAGE, minDamage = -300, maxDamage = -850, length = 8, spread = 3, effect = false, target = false }, + { name = "combat", interval = 2000, chance = 15, type = COMBAT_MANADRAIN, minDamage = -444, maxDamage = -850, radius = 4, effect = false, shootEffect = CONST_ANI_SUDDENDEATH, target = true }, + { name = "combat", interval = 2000, chance = 15, type = COMBAT_DEATHDAMAGE, minDamage = -410, maxDamage = -850, length = 9, effect = false, target = false }, + { name = "combat", interval = 2000, chance = 15, type = COMBAT_FIREDAMAGE, minDamage = -410, maxDamage = -850, length = 9, effect = false, target = false }, + { name = "combat", interval = 2000, chance = 15, type = COMBAT_ICEDAMAGE, minDamage = -410, maxDamage = -850, length = 9, effect = false, target = false }, + { name = "combat", interval = 2000, chance = 20, type = COMBAT_EARTHDAMAGE, minDamage = -410, maxDamage = -850, radius = 3, shootEffect = CONST_ANI_EARTH, effect = false, target = false }, +} + +monster.defenses = { + defense = 76, + armor = 76, + {name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 310, maxDamage = 640, effect = CONST_ME_REDSPARK}, +} + +monster.elements = { + { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, + { type = COMBAT_ENERGYDAMAGE, percent = 5 }, + { type = COMBAT_EARTHDAMAGE, percent = 0 }, + { type = COMBAT_FIREDAMAGE, percent = 0 }, + { type = COMBAT_LIFEDRAIN, percent = 0 }, + { type = COMBAT_MANADRAIN, percent = 0 }, + { type = COMBAT_DROWNDAMAGE, percent = 0 }, + { type = COMBAT_ICEDAMAGE, percent = 0 }, + { type = COMBAT_HOLYDAMAGE, percent = 0 }, + { type = COMBAT_DEATHDAMAGE, percent = 10 }, +} + +monster.immunities = { + { type = "paralyze", condition = true }, + { type = "invisible", condition = true }, + { type = "fire", condition = true }, +} + +mType:register(monster) diff --git a/data-otservbr-global/monster/bosses/izcandar_champion_of_winter.lua b/data-otservbr-global/monster/bosses/izcandar_champion_of_winter.lua new file mode 100644 index 00000000000..be1e0e89ad9 --- /dev/null +++ b/data-otservbr-global/monster/bosses/izcandar_champion_of_winter.lua @@ -0,0 +1,140 @@ +local mType = Game.createMonsterType("Izcandar Champion of Winter") +local monster = {} + +monster.description = "Izcandar Champion of Winter" +monster.experience = 6900 +monster.outfit = { + lookType = 1137, + lookHead = 48, + lookBody = 38, + lookLegs = 48, + lookFeet = 48, + lookAddons = 3, + lookMount = 0, +} + +monster.health = 130000 +monster.maxHealth = 130000 +monster.race = "blood" +monster.corpse = 25151 +monster.speed = 200 +monster.manaCost = 0 + +monster.events = { + "dreamCourtsDeath", + "izcandarThink", +} + +monster.changeTarget = { + interval = 4000, + chance = 10, +} + +monster.strategiesTarget = { + nearest = 70, + health = 10, + damage = 10, + random = 10, +} + +monster.flags = { + summonable = false, + attackable = true, + hostile = true, + convinceable = false, + pushable = false, + rewardBoss = true, + illusionable = false, + canPushItems = true, + canPushCreatures = true, + staticAttackChance = 90, + targetDistance = 1, + runHealth = 0, + healthHidden = false, + isBlockable = false, + canWalkOnEnergy = true, + canWalkOnFire = true, + canWalkOnPoison = true, +} + +monster.light = { + level = 0, + color = 0, +} + +monster.voices = { + interval = 5000, + chance = 10, + {text = "Dream or nightmare?", yell = false}, +} + +monster.loot = { + { name = "Energy Bar", chance = 100000 }, + { name = "Gold Token", chance = 100000, maxCount = 2 }, + { name = "Piggy Bank", chance = 100000 }, + { name = "Platinum Coin", chance = 100000, maxCount = 5 }, + { name = "Silver Token", chance = 100000, maxCount = 2 }, + { name = "Mysterious Remains", chance = 100000 }, + { name = "Yellow Gem", chance = 69230, maxCount = 2 }, + { name = "Ultimate Spirit Potion", chance = 61540, maxCount = 20 }, + { name = "Supreme Health Potion", chance = 53850, maxCount = 20 }, + { name = "Ultimate Mana Potion", chance = 53850, maxCount = 14 }, + { id = 3039, chance = 46150 }, -- red gem + { id = 23529, chance = 38460 }, -- Ring of Blue Plasma + { name = "Chaos Mace", chance = 23080 }, + { name = "Huge Chunk of Crude Iron", chance = 30777 }, + { name = "Bullseye Potion", chance = 23080, maxCount = 10 }, + { name = "Winterblade", chance = 100, unique = true }, + { id = 281, chance = 23080 }, -- giant shimmering pearl + { name = "Royal Star", chance = 23080, maxCount = 100 }, + { name = "Blue Gem", chance = 15380 }, + { name = "Mastermind Potion", chance = 15380, maxCount = 10 }, + { name = "Skull Staff", chance = 15380 }, + { name = "Berserk Potion", chance = 7690, maxCount = 10 }, + { id = 23543, chance = 7690 }, -- Collar of Green Plasma + { id = 23544, chance = 7690 }, -- Collar of Red Plasma + { name = "Crystal Coin", chance = 7690, maxCount = 2 }, + { name = "Ornate Locket", chance = 7690 }, + { name = "Pomegranate", chance = 7690 }, + { id = 23533, chance = 7690 }, -- Ring of Red Plasma + { name = "Ring of the Sky", chance = 7690 }, + { name = "Izcandar's Snow Globe", chance = 1500 }, +} + +monster.attacks = { + { name = "melee", interval = 2000, chance = 100, minDamage = -320, maxDamage = -750 }, + { name = "combat", interval = 2000, chance = 10, type = COMBAT_ICEDAMAGE, minDamage = -500, maxDamage = -850, radius = 6, effect = false, target = false }, + { name = "combat", interval = 2000, chance = 15, type = COMBAT_DROWNDAMAGE, minDamage = -300, maxDamage = -850, length = 8, spread = 3, effect = false, target = false }, + { name = "combat", interval = 2000, chance = 15, type = COMBAT_MANADRAIN, minDamage = -444, maxDamage = -850, radius = 4, effect = false, shootEffect = CONST_ANI_SUDDENDEATH, target = true }, + { name = "combat", interval = 2000, chance = 15, type = COMBAT_DEATHDAMAGE, minDamage = -410, maxDamage = -850, length = 9, effect = false, target = false }, + { name = "combat", interval = 2000, chance = 15, type = COMBAT_FIREDAMAGE, minDamage = -410, maxDamage = -850, length = 9, effect = false, target = false }, + { name = "combat", interval = 2000, chance = 15, type = COMBAT_ICEDAMAGE, minDamage = -410, maxDamage = -850, length = 9, effect = false, target = false }, + { name = "combat", interval = 2000, chance = 20, type = COMBAT_EARTHDAMAGE, minDamage = -410, maxDamage = -850, radius = 3, shootEffect = CONST_ANI_EARTH, effect = false, target = false }, +} + +monster.defenses = { + defense = 76, + armor = 76, + {name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 310, maxDamage = 640, effect = CONST_ME_MAGIC_BLUE}, +} + +monster.elements = { + { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, + { type = COMBAT_ENERGYDAMAGE, percent = 5 }, + { type = COMBAT_EARTHDAMAGE, percent = 0 }, + { type = COMBAT_FIREDAMAGE, percent = 0 }, + { type = COMBAT_LIFEDRAIN, percent = 0 }, + { type = COMBAT_MANADRAIN, percent = 0 }, + { type = COMBAT_DROWNDAMAGE, percent = 0 }, + { type = COMBAT_ICEDAMAGE, percent = 0 }, + { type = COMBAT_HOLYDAMAGE, percent = 0 }, + { type = COMBAT_DEATHDAMAGE, percent = 10 }, +} + +monster.immunities = { + { type = "paralyze", condition = true }, + { type = "invisible", condition = true }, + { type = "ice", condition = true }, +} + +mType:register(monster) diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua index af8b385ddb2..ecc656ee04e 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua @@ -13,10 +13,6 @@ monster.outfit = { lookMount = 0, } -monster.events = { - "DreamCourtsBossDeath", -} - monster.health = 320000 monster.maxHealth = 320000 monster.race = "blood" @@ -24,6 +20,11 @@ monster.corpse = 30155 monster.speed = 125 monster.manaCost = 0 +monster.events = { + "dreamCourtsDeath", + "facelessHealth", +} + monster.changeTarget = { interval = 4000, chance = 10, @@ -32,7 +33,6 @@ monster.changeTarget = { monster.bosstiary = { bossRaceId = 1698, -- or 1715 need test bossRace = RARITY_NEMESIS, - storage = Storage.Quest.U12_00.TheDreamCourts.ArenaTimer, } monster.strategiesTarget = { diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua index f129a99f00a..0f0c768019e 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua @@ -20,6 +20,12 @@ monster.corpse = 30013 monster.speed = 125 monster.manaCost = 0 +monster.events = { + "dreamCourtsDeath", + "facelessThink", + "facelessHealth", +} + monster.changeTarget = { interval = 4000, chance = 20, diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/izcandar_the_banished.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/izcandar_the_banished.lua index 88688c4fffc..fb4b27530ee 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/izcandar_the_banished.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/izcandar_the_banished.lua @@ -13,14 +13,9 @@ monster.outfit = { lookMount = 0, } -monster.events = { - "DreamCourtsBossDeath", -} - monster.bosstiary = { bossRaceId = 1699, bossRace = RARITY_NEMESIS, - storage = Storage.Quest.U12_00.TheDreamCourts.ArenaTimer, } monster.health = 320000 @@ -30,6 +25,11 @@ monster.corpse = 6068 monster.speed = 125 monster.manaCost = 0 +monster.events = { + "dreamCourtsDeath", + "izcandarThink", +} + monster.changeTarget = { interval = 4000, chance = 10, diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua index 651ee8cb59b..11bdbeed63d 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua @@ -13,10 +13,6 @@ monster.outfit = { lookMount = 0, } -monster.events = { - "DreamCourtsBossDeath", -} - monster.health = 320000 monster.maxHealth = 320000 monster.race = "blood" @@ -24,6 +20,11 @@ monster.corpse = 30017 monster.speed = 125 monster.manaCost = 0 + +monster.events = { + "dreamCourtsDeath", +} + monster.changeTarget = { interval = 4000, chance = 10, @@ -32,7 +33,6 @@ monster.changeTarget = { monster.bosstiary = { bossRaceId = 1696, bossRace = RARITY_NEMESIS, - storage = Storage.Quest.U12_00.TheDreamCourts.ArenaTimer, } monster.strategiesTarget = { diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua index a54257df723..1d1049bd8d8 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua @@ -13,10 +13,6 @@ monster.outfit = { lookMount = 0, } -monster.events = { - "DreamCourtsBossDeath", -} - monster.health = 320000 monster.maxHealth = 320000 monster.race = "blood" @@ -24,6 +20,11 @@ monster.corpse = 30151 monster.speed = 125 monster.manaCost = 0 +monster.events = { + "dreamCourtsDeath", + "facelessHealth", +} + monster.changeTarget = { interval = 4000, chance = 10, @@ -32,7 +33,6 @@ monster.changeTarget = { monster.bosstiary = { bossRaceId = 1697, bossRace = RARITY_NEMESIS, - storage = Storage.Quest.U12_00.TheDreamCourts.ArenaTimer, } monster.strategiesTarget = { diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua index 3d5675c4486..47604fd9c8a 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua @@ -13,10 +13,6 @@ monster.outfit = { lookMount = 0, } -monster.events = { - "DreamCourtsBossDeath", -} - monster.health = 320000 monster.maxHealth = 320000 monster.race = "venom" @@ -24,6 +20,11 @@ monster.corpse = 30022 monster.speed = 85 monster.manaCost = 0 +monster.events = { + "dreamCourtsDeath", + "facelessHealth", +} + monster.changeTarget = { interval = 4000, chance = 10, @@ -32,7 +33,6 @@ monster.changeTarget = { monster.bosstiary = { bossRaceId = 1695, bossRace = RARITY_NEMESIS, - storage = Storage.Quest.U12_00.TheDreamCourts.ArenaTimer, } monster.strategiesTarget = { diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/the_nightmare_beast.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/the_nightmare_beast.lua index 3937edcd2d4..8a6992dd492 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/the_nightmare_beast.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/the_nightmare_beast.lua @@ -13,10 +13,6 @@ monster.outfit = { lookMount = 0, } -monster.events = { - "DreamCourtsBossDeath", -} - monster.health = 850000 monster.maxHealth = 850000 monster.race = "blood" @@ -24,6 +20,10 @@ monster.corpse = 30159 monster.speed = 125 monster.manaCost = 0 +monster.events = { + "dreamCourtsDeath", +} + monster.changeTarget = { interval = 4000, chance = 10, @@ -32,7 +32,6 @@ monster.changeTarget = { monster.bosstiary = { bossRaceId = 1718, bossRace = RARITY_ARCHFOE, - storage = Storage.Quest.U12_00.TheDreamCourts.NightmareBeastTimer, } monster.strategiesTarget = { diff --git a/data-otservbr-global/monster/quests/the_dream_courts/horrible_dream.lua b/data-otservbr-global/monster/quests/the_dream_courts/horrible_dream.lua index ed6c3888dcc..1c6ba422aa2 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/horrible_dream.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/horrible_dream.lua @@ -20,6 +20,10 @@ monster.corpse = 11317 monster.speed = 90 monster.manaCost = 0 +monster.events = { + "dreamCourtsDeath", +} + monster.changeTarget = { interval = 5000, chance = 0, diff --git a/data-otservbr-global/monster/quests/the_dream_courts/mind-wrecking_dream.lua b/data-otservbr-global/monster/quests/the_dream_courts/mind-wrecking_dream.lua index 64c2f952995..d35cc804fe2 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/mind-wrecking_dream.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/mind-wrecking_dream.lua @@ -20,6 +20,10 @@ monster.corpse = 8127 monster.speed = 130 monster.manaCost = 0 +monster.events = { + "dreamCourtsDeath", +} + monster.changeTarget = { interval = 5000, chance = 20, diff --git a/data-otservbr-global/monster/quests/the_dream_courts/nightmarish_dream.lua b/data-otservbr-global/monster/quests/the_dream_courts/nightmarish_dream.lua index dfec10276cd..0ac4f9c48cd 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/nightmarish_dream.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/nightmarish_dream.lua @@ -20,6 +20,10 @@ monster.corpse = 0 monster.speed = 100 monster.manaCost = 0 +monster.events = { + "dreamCourtsDeath", +} + monster.changeTarget = { interval = 4000, chance = 10, diff --git a/data-otservbr-global/monster/quests/the_dream_courts/plant_abomination.lua b/data-otservbr-global/monster/quests/the_dream_courts/plant_abomination.lua index fefb9dc4ce3..0fca2ea78ff 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/plant_abomination.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/plant_abomination.lua @@ -20,6 +20,10 @@ monster.corpse = 0 monster.speed = 110 monster.manaCost = 0 +monster.events = { + "dreamCourtsDeath", +} + monster.changeTarget = { interval = 4000, chance = 10, diff --git a/data-otservbr-global/monster/quests/the_dream_courts/unpleasant_dream.lua b/data-otservbr-global/monster/quests/the_dream_courts/unpleasant_dream.lua index d5afbaf7c4c..2a1e9cb11a2 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/unpleasant_dream.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/unpleasant_dream.lua @@ -20,6 +20,10 @@ monster.corpse = 0 monster.speed = 125 monster.manaCost = 0 +monster.events = { + "dreamCourtsDeath", +} + monster.changeTarget = { interval = 5000, chance = 0, diff --git a/data-otservbr-global/scripts/creaturescripts/monster/faceless_bane_immunity.lua b/data-otservbr-global/scripts/creaturescripts/monster/faceless_bane_immunity.lua deleted file mode 100644 index 36e1ecd11c3..00000000000 --- a/data-otservbr-global/scripts/creaturescripts/monster/faceless_bane_immunity.lua +++ /dev/null @@ -1,47 +0,0 @@ -local bossName = "Faceless Bane" - -local function healBoss(creature) - if creature then - creature:addHealth(creature:getMaxHealth()) - creature:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT) - end -end - -local function createSummons(creature) - if creature then - local pos = creature:getPosition() - Game.createMonster("Gazer Spectre", pos, true, false, creature) - Game.createMonster("Ripper Spectre", pos, true, false, creature) - Game.createMonster("Burster Spectre", pos, true, false, creature) - end -end - -local function resetBoss(creature, deaths) - if creature then - healBoss(creature) - createSummons(creature) - Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.Deaths, deaths + 1) - Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn, 0) - Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.ResetSteps, 1) - end -end - -local facelessBaneImmunity = CreatureEvent("facelessBaneImmunity") - -function facelessBaneImmunity.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) - if creature and creature:isMonster() and creature:getName() == bossName then - local creatureHealthPercent = (creature:getHealth() * 100) / creature:getMaxHealth() - local facelessBaneDeathsStorage = Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.Deaths) - - if creatureHealthPercent <= 20 and facelessBaneDeathsStorage < 1 then - resetBoss(creature, facelessBaneDeathsStorage) - return true - elseif Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn) < 1 then - healBoss(creature) - return true - end - end - return primaryDamage, primaryType, secondaryDamage, secondaryType -end - -facelessBaneImmunity:register() diff --git a/data-otservbr-global/scripts/lib/register_actions.lua b/data-otservbr-global/scripts/lib/register_actions.lua index a65de89e017..52945299144 100644 --- a/data-otservbr-global/scripts/lib/register_actions.lua +++ b/data-otservbr-global/scripts/lib/register_actions.lua @@ -74,6 +74,13 @@ local secret_library = { items = { 27867, 27868, 27869 }, } +local oldTable = { Position(32005, 32002, 14), Position(32005, 32003, 14), Position(32006, 32002, 14), Position(32006, 32003, 14) } +local foundItems = { + { id = 29992, quantity = 1 }, + { id = 953, quantity = 4 } +} +local storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Lock + local function revertItem(position, itemId, transformId) local item = Tile(position):getItemById(itemId) if item then @@ -520,8 +527,26 @@ function onUsePick(player, item, fromPosition, target, toPosition, isHotkey) end end - -- The Secret Library Quest local tPos = toPosition + + -- The Dream Courts Quest + for i = 1, #oldTable do + if tPos == oldTable[i] then + if player:getStorageValue(storage) < 1 then + for j = 1, #foundItems do + player:addItem(foundItems[j].id, foundItems[j].quantity) + end + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This table is made of several old doors. One of them has a noticeable ornate lock. Perhaps you could lever it out with a tool.") + player:setStorageValue(storage, 1) + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already removed the old lock.") + end + + return true + end + end + + -- The Secret Library Quest for _, j in pairs(secret_library.crystals) do if tPos == j.position then if player:getStorageValue(j.storage) < os.time() then @@ -1010,8 +1035,26 @@ function onUseKitchenKnife(player, item, fromPosition, target, toPosition, isHot return false end - -- The Secret Library Quest local tPos = toPosition + + -- The Dream Courts Quest + for i = 1, #oldTable do + if tPos == oldTable[i] then + if player:getStorageValue(storage) < 1 then + for j = 1, #foundItems do + player:addItem(foundItems[j].id, foundItems[j].quantity) + end + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This table is made of several old doors. One of them has a noticeable ornate lock. Perhaps you could lever it out with a tool.") + player:setStorageValue(storage, 1) + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already removed the old lock.") + end + + return true + end + end + + -- The Secret Library Quest for _, j in pairs(secret_library.crystals) do if tPos == j.position then if player:getStorageValue(j.storage) < os.time() then diff --git a/data-otservbr-global/scripts/quests/the_dream_courts/actions_bosses_killed.lua b/data-otservbr-global/scripts/quests/the_dream_courts/actions_bosses_killed.lua deleted file mode 100644 index ebbff0713ef..00000000000 --- a/data-otservbr-global/scripts/quests/the_dream_courts/actions_bosses_killed.lua +++ /dev/null @@ -1,24 +0,0 @@ -local bosses = { - ["plagueroot"] = { storage = Storage.Quest.U12_00.TheDreamCourts.PlaguerootKilled }, - ["malofur mangrinder"] = { storage = Storage.Quest.U12_00.TheDreamCourts.MalofurKilled }, - ["maxxenius"] = { storage = Storage.Quest.U12_00.TheDreamCourts.MaxxeniusKilled }, - ["alptramun"] = { storage = Storage.Quest.U12_00.TheDreamCourts.AlptramunKilled }, - ["izcandar the banished"] = { storage = Storage.Quest.U12_00.TheDreamCourts.IzcandarKilled }, - ["the nightmare beast"] = { storage = Storage.Quest.U12_00.TheDreamCourts.NightmareBeastKilled }, -} - -local bossesDreamCourts = CreatureEvent("DreamCourtsBossDeath") -function bossesDreamCourts.onDeath(creature) - local bossConfig = bosses[creature:getName():lower()] - if not bossConfig then - return true - end - onDeathForDamagingPlayers(creature, function(creature, player) - if bossConfig.storage then - player:setStorageValue(bossConfig.storage, 1) - end - end) - return true -end - -bossesDreamCourts:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts/actions_dream_courts_lever.lua b/data-otservbr-global/scripts/quests/the_dream_courts/actions_dream_courts_lever.lua deleted file mode 100644 index 7c18cd11a80..00000000000 --- a/data-otservbr-global/scripts/quests/the_dream_courts/actions_dream_courts_lever.lua +++ /dev/null @@ -1,91 +0,0 @@ -local config = { - bossName = { - ["Monday"] = "Plagueroot", - ["Tuesday"] = "Malofur Mangrinder", - ["Wednesday"] = "Maxxenius", - ["Thursday"] = "Alptramun", - ["Friday"] = "Izcandar The Banished", - ["Saturday"] = "Maxxenius", - ["Sunday"] = "Alptramun", - }, - requiredLevel = 250, - timeToFightAgain = 10, -- In hour - timeToDefeat = 30, -- In minutes - playerPositions = { - { pos = Position(32208, 32021, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT }, - { pos = Position(32208, 32022, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT }, - { pos = Position(32208, 32023, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT }, - { pos = Position(32208, 32024, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT }, - { pos = Position(32208, 32025, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT }, - }, - bossPosition = Position(32207, 32051, 14), - specPos = { - from = Position(32199, 32039, 14), - to = Position(32229, 32055, 14), - }, - exit = Position(32210, 32035, 13), -} -local bossToday = config.bossName[os.date("%A")] - -local dreamCourtsLever = Action() -function dreamCourtsLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if config.playerPositions[1].pos ~= player:getPosition() then - return false - end - local spec = Spectators() - spec:setOnlyPlayer(false) - spec:setRemoveDestination(config.exit) - spec:setCheckPosition(config.specPos) - spec:check() - if spec:getPlayers() > 0 then - player:say("There's someone fighting with " .. bossToday .. ".", TALKTYPE_MONSTER_SAY) - return true - end - local lever = Lever() - lever:setPositions(config.playerPositions) - lever:setCondition(function(creature) - if not creature or not creature:isPlayer() then - return true - end - if creature:getLevel() < config.requiredLevel then - creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "All the players need to be level " .. config.requiredLevel .. " or higher.") - return false - end - if not lever:canUseLever(player, bossToday, config.timeToFightAgain) then - return false - end - return true - end) - lever:checkPositions() - if lever:checkConditions() then - spec:removeMonsters() - local monster = Game.createMonster(bossToday, config.bossPosition, true, true) - if not monster then - return true - end - lever:teleportPlayers() - lever:setCooldownAllPlayers(bossToday, os.time() + config.timeToFightAgain * 3600) - addEvent(function() - local old_players = lever:getInfoPositions() - spec:clearCreaturesCache() - spec:setOnlyPlayer(true) - spec:check() - local player_remove = {} - for i, v in pairs(spec:getCreatureDetect()) do - for _, v_old in pairs(old_players) do - if v_old.creature == nil or v_old.creature:isMonster() then - break - end - if v:getName() == v_old.creature:getName() then - table.insert(player_remove, v_old.creature) - break - end - end - end - spec:removePlayers(player_remove) - end, config.timeToDefeat * 60 * 1000) - end -end - -dreamCourtsLever:position({ x = 32208, y = 32020, z = 13 }) -dreamCourtsLever:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts/actions_entrances_dream_courts.lua b/data-otservbr-global/scripts/quests/the_dream_courts/actions_entrances_dream_courts.lua deleted file mode 100644 index cdbbb60aa4e..00000000000 --- a/data-otservbr-global/scripts/quests/the_dream_courts/actions_entrances_dream_courts.lua +++ /dev/null @@ -1,27 +0,0 @@ -local config = { - { position = { x = 32042, y = 31938, z = 15 } }, - { position = { x = 32043, y = 31938, z = 15 } }, - { position = { x = 32042, y = 31939, z = 15 } }, - { position = { x = 32043, y = 31939, z = 15 } }, -} - -local entranceDreamCourts = MoveEvent() -function entranceDreamCourts.onStepIn(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then - return false - end - for value in pairs(config) do - if Position(config[value].position) == player:getPosition() then - player:teleportTo(Position(32208, 32093, 13)) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - return true - end - end -end - -entranceDreamCourts:type("stepin") -for value in pairs(config) do - entranceDreamCourts:position(config[value].position) -end -entranceDreamCourts:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts/actions_portal_nightmare_beast.lua b/data-otservbr-global/scripts/quests/the_dream_courts/actions_portal_nightmare_beast.lua deleted file mode 100644 index 87742e54b43..00000000000 --- a/data-otservbr-global/scripts/quests/the_dream_courts/actions_portal_nightmare_beast.lua +++ /dev/null @@ -1,38 +0,0 @@ -local storagesTable = { - { storage = Storage.Quest.U12_00.TheDreamCourts.PlaguerootKilled, bossName = "Plagueroot" }, - { storage = Storage.Quest.U12_00.TheDreamCourts.MalofurKilled, bossName = "Malofur Mangrinder" }, - { storage = Storage.Quest.U12_00.TheDreamCourts.MaxxeniusKilled, bossName = "Maxxenius" }, - { storage = Storage.Quest.U12_00.TheDreamCourts.AlptramunKilled, bossName = "Alptramun" }, - { storage = Storage.Quest.U12_00.TheDreamCourts.IzcandarKilled, bossName = "Izcandar The Banished" }, -} - -local portalNightmareBeast = MoveEvent() -function portalNightmareBeast.onStepIn(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then - return false - end - if player:getLevel() < 250 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need at least level 250 to enter.") - player:teleportTo(fromPosition, true) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - return false - end - local text = "" - for value in pairs(storagesTable) do - if player:getStorageValue(storagesTable[value].storage) < 0 then - text = text .. "\n" .. storagesTable[value].bossName - end - end - if text == "" then - return true - else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You still need to defeat:" .. text) - player:teleportTo(fromPosition, true) - return false - end -end - -portalNightmareBeast:type("stepin") -portalNightmareBeast:position({ x = 32211, y = 32081, z = 15 }) -portalNightmareBeast:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts/movements_faceless_bane_step_positions.lua b/data-otservbr-global/scripts/quests/the_dream_courts/movements_faceless_bane_step_positions.lua deleted file mode 100644 index 8ebdc47ae6f..00000000000 --- a/data-otservbr-global/scripts/quests/the_dream_courts/movements_faceless_bane_step_positions.lua +++ /dev/null @@ -1,114 +0,0 @@ -local walkedPositions = {} -local lastResetTime = os.time() -local checkTime = false - -local function resetWalkedPositions(checkLastResetTime) - if lastResetTime > os.time() and checkLastResetTime then - return true - end - - walkedPositions = {} - Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn, 0) - lastResetTime = os.time() + (1 * 60) -end - -local pipePositions = { - Position(33612, 32568, 13), - Position(33612, 32567, 13), - Position(33612, 32566, 13), - Position(33612, 32565, 13), - Position(33612, 32564, 13), - Position(33612, 32563, 13), - Position(33612, 32562, 13), - Position(33612, 32561, 13), - Position(33612, 32560, 13), - Position(33612, 32559, 13), - Position(33612, 32558, 13), - Position(33612, 32557, 13), - Position(33612, 32556, 13), - Position(33622, 32556, 13), - Position(33622, 32557, 13), - Position(33622, 32558, 13), - Position(33622, 32559, 13), - Position(33622, 32560, 13), - Position(33622, 32561, 13), - Position(33622, 32562, 13), - Position(33622, 32563, 13), - Position(33622, 32564, 13), - Position(33622, 32565, 13), - Position(33622, 32566, 13), - Position(33622, 32567, 13), - Position(33622, 32568, 13), -} - -local function sendEnergyEffect() - for _, position in ipairs(pipePositions) do - position:sendMagicEffect(CONST_ME_PURPLEENERGY) - position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_GREAT_ENERGY_BEAM) - end - - return true -end - -local facelessBaneStepPositions = MoveEvent() - -function facelessBaneStepPositions.onStepIn(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then - return true - end - - if Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.ResetSteps) == 1 then - Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.ResetSteps, 0) - lastResetTime = os.time() - resetWalkedPositions(true) - end - - if not checkTime then - checkTime = addEvent(resetWalkedPositions, 15 * 1000, false) - end - - if Game.getStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn) < 1 then - if #walkedPositions > 0 then - for _, walkedPos in ipairs(walkedPositions) do - if walkedPos == position then - return true - end - end - end - - position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_BUZZ) - position:sendMagicEffect(CONST_ME_YELLOWENERGY) - table.insert(walkedPositions, position) - - if #walkedPositions == 13 then - Game.setStorageValue(GlobalStorage.TheDreamCourts.FacelessBane.StepsOn, 1) - addEvent(resetWalkedPositions, 60 * 1000, true) - sendEnergyEffect() - checkTime = nil - end - end - return true -end - -local facelessBaneSteps = { - Position(33615, 32567, 13), - Position(33613, 32567, 13), - Position(33611, 32563, 13), - Position(33610, 32561, 13), - Position(33611, 32558, 13), - Position(33614, 32557, 13), - Position(33617, 32558, 13), - Position(33620, 32557, 13), - Position(33623, 32558, 13), - Position(33624, 32561, 13), - Position(33623, 32563, 13), - Position(33621, 32567, 13), - Position(33619, 32567, 13), -} - -for _, pos in ipairs(facelessBaneSteps) do - facelessBaneStepPositions:position(pos) -end - -facelessBaneStepPositions:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts/movements_teleport.lua b/data-otservbr-global/scripts/quests/the_dream_courts/movements_teleport.lua deleted file mode 100644 index 2dc6fb7bbe3..00000000000 --- a/data-otservbr-global/scripts/quests/the_dream_courts/movements_teleport.lua +++ /dev/null @@ -1,39 +0,0 @@ -local teleports = { - { - access = Storage.Quest.U12_00.TheDreamCourts.BuriedCathedralAccess, - from = { x = 32720, y = 32270, z = 8 }, -- Haunted house cellar - to = { x = 33618, y = 32545, z = 13 }, -- Buried Cathedral - }, - { - access = Storage.Quest.U12_00.TheDreamCourts.BuriedCathedralAccess, - from = { x = 33618, y = 32546, z = 13 }, -- Buried Cathedral - to = { x = 32720, y = 32269, z = 8 }, -- Haunted house cellar - }, -} - -local teleport = MoveEvent() - -function teleport.onStepIn(creature, item, position, fromPosition) - if not creature:isPlayer() then - return true - end - - local teleportTo = fromPosition - for index, teleportItem in pairs(teleports) do - if creature:getStorageValue(teleportItem.access) == 1 then - if creature:getPosition() == Position(teleportItem.from) then - teleportTo = teleportItem.to - break - end - end - end - - creature:teleportTo(teleportTo) - creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - return true -end - -for index, teleportItem in pairs(teleports) do - teleport:position(teleportItem.from) -end -teleport:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua new file mode 100644 index 00000000000..d29a999101d --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua @@ -0,0 +1,31 @@ +local storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.LakeWord +local count = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount + +local actions_acidFishingRod = Action() + +function actions_acidFishingRod.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + local tPos = target:getPosition() + local fromPos = Position(33553, 32558, 15) + local toPos = Position(33569, 32562, 15) + + if tPos:isInRange(fromPos, toPos) then + if player:getStorageValue(storage) < 1 then + if player:getStorageValue(count) < 0 then + player:setStorageValue(count, 0) + end + player:setStorageValue(count, player:getStorageValue(count) + 1) + player:setStorageValue(storage, 1) + tPos:sendMagicEffect(CONST_ME_GREEN_RINGS) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You dare not touch there remains. A word has been carved into these bones over and over: 'K'muuh'.") + end + end + + return true +end + +actions_acidFishingRod:id(29950) +actions_acidFishingRod:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua new file mode 100644 index 00000000000..bda07311e8a --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua @@ -0,0 +1,31 @@ +local questline = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline +local wordsCount = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount +local facelessTime = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTime + +local actions_bookOnTable = Action() + +function actions_bookOnTable.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + if player:getStorageValue(questline) == 2 and player:getStorageValue(wordsCount) >= 4 then + player:setStorageValue(questline, 3) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'This book tells you about a spell that draws its wielder towards the most energetic being next to him.') + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It consists of four parts wich have been scratched out of this book. They need to be read in conjunction with chants.') + elseif player:getStorageValue(questline) >= 4 then + if player:getStorageValue(facelessTime) > os.time() then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have to wait to challange this enemy again!') + return true + else + player:teleportTo(Position(33640, 32561, 13)) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'All chants have been sung in the right order, you are deemed worthy. You are transported away...') + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + end + end + + return true +end + +actions_bookOnTable:id(29991) +actions_bookOnTable:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua new file mode 100644 index 00000000000..e5a265e0e50 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua @@ -0,0 +1,39 @@ +local wardPosition = Position(32769, 32621, 10) +local storage = Storage.Quest.U12_00.TheDreamCourts.WardStones.porthopeStone +local count = Storage.Quest.U12_00.TheDreamCourts.WardStones.Count + +local function revertStone(position, on, off) + local activeStone = Tile(position):getItemById(on) + + if activeStone then + activeStone:transform(off) + end +end + +local actions_chargedCompass = Action() + +function actions_chargedCompass.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + local tPos = target:getPosition() + local isInQuest = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) + + if tPos == wardPosition then + if isInQuest == 3 and player:getStorageValue(storage) < 1 then + player:setStorageValue(count, player:getStorageValue(count) + 1) + player:setStorageValue(storage, 1) + player:say("The energy is transferred to the rune stone. It glows now!", TALKTYPE_MONSTER_SAY) + target:getPosition():sendMagicEffect(CONST_ME_THUNDER) + target:transform(29335) + item:transform(29291) + addEvent(revertStone, 1000*30, tPos, 33828, 33827) + end + end + + return true +end + +actions_chargedCompass:id(29294) +actions_chargedCompass:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua new file mode 100644 index 00000000000..4704efec079 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua @@ -0,0 +1,153 @@ +local containers = { + [1] = { + uniqueid = 23102, + cPosition = Position(32736, 32282, 8), + storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.skeletonContainer, + value = 1, + reward = 29310, + defaultItem = true + }, + [2] = { + uniqueid = 23103, + cPosition = Position(33693, 32185, 8), + storage = Storage.Quest.U12_00.TheDreamCourts.Main.courtChest, + value = 1, + reward = 30146, + defaultItem = true + }, + [3] = { + uniqueid = 23104, + cPosition = Position(33711, 32108, 4), + storage = Storage.Quest.U12_00.TheDreamCourts.Main.courtChest, + value = 1, + reward = 30146, + defaultItem = true + }, + [4] = { + uniqueid = 23105, + cPosition = Position(33578, 32527, 14), + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.fishingRod, + value = 1, + reward = 29950, + defaultItem = true + }, + [5] = { + uniqueid = 23106, + cPosition = Position(33599, 32533, 14), + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.barrelWord, + value = 1, + defaultItem = false, + text = "The inside of this barrel's lid has a word written onto it: 'O'kteth'." + }, + [6] = { + uniqueid = 23107, + cPosition = Position(33618, 32518, 14), + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.estatueWord, + value = 1, + defaultItem = false, + text = "This statue has a word written on her hand: 'N'ogalu'." + }, + [7] = { + uniqueid = 23108, + cPosition = Position(33638, 32507, 14), + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.bedWord, + value = 1, + defaultItem = false, + text = "This end of the bed has a stack of notes hidden under it. There is only one word on all of them: 'T'sough'." + }, + [8] = { + uniqueid = 23109, + cPosition = Position(33703, 32185, 5), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Rosebush, + value = 1, + reward = 29993, + defaultItem = true + }, + [9] = { + uniqueid = 23110, + cPosition = Position(33663, 32192, 7), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Mushroom, + value = 1, + reward = 30009, + defaultItem = true + }, + [10] = { + uniqueid = 23111, + cPosition = Position(33671, 32203, 7), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Book, + value = 1, + reward = 29991, + defaultItem = true + }, + [11] = { + uniqueid = 23112, + cPosition = Position(33683, 32125, 6), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.OrcSkull, + value = 1, + reward = 29989, + defaultItem = true + }, + [12] = { + uniqueid = 23113, + cPosition = Position(31996, 31981, 13), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Recipe, + value = 1, + reward = 30147, + defaultItem = true + }, + [13] = { + uniqueid = 23114, + cPosition = Position(32017, 31981, 14), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MinotaurSkull, + value = 1, + reward = 29988, + defaultItem = true + }, + [14] = { + uniqueid = 23115, + cPosition = Position(32054, 31936, 13), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.trollSkull, + value = 1, + reward = 29990, + defaultItem = true + }, +} + +local actions_containerRewards = Action() + +function actions_containerRewards.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local iPos = item:getPosition() + + for _, k in pairs(containers) do + if iPos == k.cPosition and item:getUniqueId() == k.uniqueid then + if player:getStorageValue(k.storage) < k.value then + if k.defaultItem then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a " .. ItemType(k.reward):getName() ..".") + player:addItem(k.reward, 1) + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, k.text) + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount) < 0 then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, 0) + end + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount) + 1) + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount) == 4 then + player:addAchievement("Tied the Knot") + end + end + player:setStorageValue(k.storage, k.value) + else + if k.defaultItem then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.") + end + end + end + end + + return true +end + +for _, k in pairs(containers) do + actions_containerRewards:uid(k.uniqueid) +end + +actions_containerRewards:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua new file mode 100644 index 00000000000..07d2bda4b79 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua @@ -0,0 +1,29 @@ +local Count = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count +local Storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.doorInvisible +local lanternId = 23738 + +local actions_doorInvisible = Action() + +function actions_doorInvisible.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local iPos = item:getPosition() + + if player:getStorageValue(Storage) < 1 then + if player:getItemCount(lanternId) >= 1 then + player:setStorageValue(Storage, 1) + player:setStorageValue(Count, player:getStorageValue(Count) + 1) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door opens.") + end + else + if iPos.x < player:getPosition().x then + player:teleportTo(Position(iPos.x - 3, iPos.y, iPos.z)) + else + player:teleportTo(Position(iPos.x + 3, iPos.y, iPos.z)) + end + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + end + + return true +end + +actions_doorInvisible:aid(23111) +actions_doorInvisible:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua new file mode 100644 index 00000000000..db90128b533 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua @@ -0,0 +1,96 @@ +local config = { + [1] = { + on = 29337, + off = 29336, + hisPosition = Position(32251, 31386, 5), + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.okolnirStone, + hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light." + }, + [2] = { + on = 29337, + off = 29336, + hisPosition = Position(31939, 31653, 10), + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.foldaStone, + hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light." + }, + [3] = { + on = 29337, + off = 29336, + hisPosition = Position(32058, 32792, 13), + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.calassaStone, + hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light." + }, + [4] = { + on = 29335, + off = 29334, + hisPosition = Position(33555, 32220, 7), + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.feyristStone, + hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light." + }, + [5] = { + on = 29335, + off = 29334, + hisPosition = Position(32383, 32610, 7), + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.merianaStone, + hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light." + }, + [6] = { + on = 29335, + off = 29334, + hisPosition = Position(33273, 31997, 7), + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.cormayaStone, + hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light." + }, + [7] = { + on = 29335, + off = 29334, + hisPosition = Position(33576, 32537, 15), + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.catedralStone, + hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.", + lastStone = true + }, +} + +local function revertStone(position, on, off) + local activeStone = Tile(position):getItemById(on) + + if activeStone then + activeStone:transform(off) + end +end + +local actions_dreamTalisman = Action() + +function actions_dreamTalisman.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + local tPos = target:getPosition() + + for _, k in pairs(config) do + if tPos == k.hisPosition and target:getId() == k.off then + if player:getStorageValue(k.hisStorage) < 1 then + if k.lastStone then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline) ~= 5 then + return true + else + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 6) + end + end + + player:setStorageValue(k.hisStorage, 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count) + 1) + target:getPosition():sendMagicEffect(CONST_ME_THUNDER) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, k.hisMessage) + target:transform(k.on) + addEvent(revertStone, 1000*30, target:getPosition(), k.on, k.off) + end + end + end + + return true +end + +actions_dreamTalisman:id(30132) +actions_dreamTalisman:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua new file mode 100644 index 00000000000..6bda5071858 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua @@ -0,0 +1,78 @@ +local function placeMask(position, wmask, nmask) + local item = Tile(position):getItemById(nmask) + if item then + item:transform(wmask) + end +end + +local maskId = 29276 + +local function resetArea() + local infectedCount = 0 + local playerCount = 0 + local spectators = Game.getSpectators(Position(32206, 32045, 15), false, true, 14, 14, 14, 14) + + for _, p in pairs(spectators) do + local player = Player(p:getId()) + if player then + playerCount = playerCount + 1 + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse) >= 1 then + infectedCount = infectedCount + 1 + end + end + end + + if playerCount == infectedCount then + return true + else + return false + end +end + +local actions_dreamcatcher_curse = Action() + +function actions_dreamcatcher_curse.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + if item.itemid == 29274 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can rip off a dream catcher!") + item:transform(29275) + local newItem = Game.createItem(maskId, 1, Position(item:getPosition().x, item:getPosition().y+1, item:getPosition().z)) + if newItem then + newItem:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT) + end + addEvent(placeMask, 10*1000, item:getPosition(), 29274, 29275) + elseif item.itemid == 29276 then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse) < 1 then + if (target ~= player) and target:isPlayer() then + if target:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) >= 1 then + target:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, 0) + target:removeCondition(CONDITION_OUTFIT) + target:unregisterEvent(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) + target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have a feeling of dread.") + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, 1) + player:registerEvent(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You take the dreamcurse on yourself!") + item:remove(1) + local j = resetArea() + if j then + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) + end + else + return true + end + else + return true + end + else + return true + end + end + + return true +end + +actions_dreamcatcher_curse:id(29274, 29275, 29276) +actions_dreamcatcher_curse:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua new file mode 100644 index 00000000000..79e91ca74ce --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua @@ -0,0 +1,362 @@ +local transform = { + [9110] = 9111, + [9111] = 9110 +} + +local bossNames = { + "plagueroot", "izcandar the banished", "izcandar champion of summer", "izcandar champion of winter" +} + +local leverInfo = { + [1] = { + byDay = "Monday", + bossName = "Alptramun", + bossPosition = Position(32208, 32048, 14), + leverPosition = Position(32208, 32020, 13), + pushPosition = Position(32208, 32021, 13), + leverFromPos = Position(32208, 32021, 13), + leverToPos = Position(32208, 32025, 13), + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer, + roomFromPosition = Position(32198, 32037, 14), + roomToPosition = Position(32234, 32054, 14), + teleportTo = Position(32224, 32048, 14), + typePush = "y", + exitPosition = Position(32208, 32035, 13), + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer + }, + [2] = { + byDay = "Tuesday", + bossName = "Izcandar the Banished", + bossPosition = Position(32208, 32048, 14), + leverPosition = Position(32208, 32020, 13), + pushPosition = Position(32208, 32021, 13), + leverFromPos = Position(32208, 32021, 13), + leverToPos = Position(32208, 32025, 13), + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + roomFromPosition = Position(32198, 32037, 14), + roomToPosition = Position(32234, 32054, 14), + teleportTo = Position(32224, 32048, 14), + typePush = "y", + exitPosition = Position(32208, 32035, 13), + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer + }, + [3] = { + byDay = "Wednesday", + bossName = "Malofur Mangrinder", + bossPosition = Position(32208, 32048, 14), + leverPosition = Position(32208, 32020, 13), + pushPosition = Position(32208, 32021, 13), + leverFromPos = Position(32208, 32021, 13), + leverToPos = Position(32208, 32025, 13), + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer, + roomFromPosition = Position(32198, 32037, 14), + roomToPosition = Position(32234, 32054, 14), + teleportTo = Position(32224, 32048, 14), + typePush = "y", + exitPosition = Position(32208, 32035, 13), + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer + }, + [4] = { + byDay = "Thursday", + bossName = "Maxxenius", + bossPosition = Position(32208, 32048, 14), + leverPosition = Position(32208, 32020, 13), + pushPosition = Position(32208, 32021, 13), + leverFromPos = Position(32208, 32021, 13), + leverToPos = Position(32208, 32025, 13), + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + roomFromPosition = Position(32198, 32037, 14), + roomToPosition = Position(32234, 32054, 14), + teleportTo = Position(32224, 32048, 14), + typePush = "y", + exitPosition = Position(32208, 32035, 13), + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer + }, + [5] = { + byDay = "Friday", + bossName = "Izcandar the Banished", + bossPosition = Position(32208, 32048, 14), + leverPosition = Position(32208, 32020, 13), + pushPosition = Position(32208, 32021, 13), + leverFromPos = Position(32208, 32021, 13), + leverToPos = Position(32208, 32025, 13), + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + roomFromPosition = Position(32198, 32037, 14), + roomToPosition = Position(32234, 32054, 14), + teleportTo = Position(32224, 32048, 14), + typePush = "y", + exitPosition = Position(32208, 32035, 13), + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer + }, + [6] = { + byDay = "Saturday", + bossName = "Plagueroot", + bossPosition = Position(32208, 32048, 14), + leverPosition = Position(32208, 32020, 13), + pushPosition = Position(32208, 32021, 13), + leverFromPos = Position(32208, 32021, 13), + leverToPos = Position(32208, 32025, 13), + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer, + roomFromPosition = Position(32198, 32037, 14), + roomToPosition = Position(32234, 32054, 14), + teleportTo = Position(32224, 32048, 14), + typePush = "y", + exitPosition = Position(32208, 32035, 13), + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer + }, + [7] = { + byDay = "Sunday", + bossName = "Maxxenius", + bossPosition = Position(32208, 32048, 14), + leverPosition = Position(32208, 32020, 13), + pushPosition = Position(32208, 32021, 13), + leverFromPos = Position(32208, 32021, 13), + leverToPos = Position(32208, 32025, 13), + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + roomFromPosition = Position(32198, 32037, 14), + roomToPosition = Position(32234, 32054, 14), + teleportTo = Position(32224, 32048, 14), + typePush = "y", + exitPosition = Position(32208, 32035, 13), + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer + }, +} + +local function spawnSummons(k, monsterName, eventName, timing, positionTable, middlePosition) + local spectators = Game.getSpectators(middlePosition, false, false, 20, 20, 20, 20) + local maySummon = false + local hasPlayer = false + + for _, c in pairs(spectators) do + for i = 1, #bossNames do + if c and (c:getName():lower() == bossNames[i]) then + maySummon = true + end + if c:isPlayer() then + hasPlayer = true + end + end + end + + if maySummon and hasPlayer then + if k <= 4 then + for i = 1, #positionTable do + local sqm = positionTable[i] + if sqm then sqm:sendMagicEffect(CONST_ME_TELEPORT) end + end + k = k + 1 + addEvent(spawnSummons, 2*1000, k, monsterName, eventName, timing, positionTable, middlePosition) + else + for i = 1, #positionTable do + local monster = Game.createMonster(monsterName, positionTable[i], true, true) + if monster and eventName then monster:registerEvent(eventName) end + end + addEvent(function() + spawnSummons(1, monsterName, eventName, timing, positionTable, middlePosition) + end, timing * 1000) + end + end +end + +local whirlingBlades = { + Position(32200, 32046, 14), + Position(32200, 32050, 14), + Position(32202, 32049, 14), + Position(32202, 32051, 14), + Position(32205, 32043, 14), + Position(32200, 32050, 14), + Position(32205, 32048, 14), + Position(32205, 32055, 14), + Position(32206, 32051, 14), + Position(32206, 32040, 14), + Position(32207, 32043, 14), + Position(32207, 32048, 14), + Position(32208, 32051, 14), + Position(32209, 32048, 14), + Position(32209, 32055, 14), + Position(32210, 32051, 14), + Position(32211, 32042, 14), + Position(32211, 32044, 14), + Position(32211, 32046, 14), + Position(32214, 32043, 14), + Position(32214, 32049, 14), + Position(32214, 32049, 14), + Position(32213, 32052, 14) +} + +local plantAttendants = { + Position(32204, 32047, 14), + Position(32212, 32043, 14), + Position(32212, 32050, 14) +} + +local coldOfWinter = { + Position(32211, 32042, 14), + Position(32214, 32048, 14), + Position(32210, 32053, 14), +} + +local heatOfSummer = { + Position(32204, 32053, 14), + Position(32201, 32047, 14), + Position(32204, 32043, 14), +} + +local lastBoss = { + bossName = "The Nightmare Beast", + bossPosition = Position(32209, 32044, 15), + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.nightmareTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.nightmareTimer, + fromPositionTeleport = Position(32210, 32070, 15), + toPositionTeleport = Position(32214, 32071, 15), + fromPositionPush = Position(32211, 32070, 15), + toPositionPush = Position(32213, 32070, 15), + teleportTo = Position(32208, 32051, 15), + roomFromPosition = Position(32194, 32035, 15), + roomToPosition = Position(32223, 32058, 15), + exitPosition = Position(32212, 32084, 15), +} + +local function startFight(middle, where) + local newPos = Position(where.x, where.y + 5, where.z) + local spectators = Game.getSpectators(middle, false, true, 9, 9, 9, 9) + + for _, p in pairs(spectators) do + if p and p:isPlayer() then + p:teleportTo(newPos) + end + end +end + +local actions_dreamscarLevers = Action() + +function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + local playersTable = {} + local iPos = item:getPosition() + local pPos = player:getPosition() + local nightmareLever = Position(32212, 32069, 15) + + if item.itemid == 9110 then + if iPos == nightmareLever then + if player:doCheckBossRoom(lastBoss.bossName, lastBoss.roomFromPosition, lastBoss.roomToPosition) then + if pPos:isInRange(lastBoss.fromPositionPush, lastBoss.toPositionPush) then + for x = lastBoss.fromPositionTeleport.x, lastBoss.toPositionTeleport.x do + for y = lastBoss.fromPositionTeleport.y, lastBoss.toPositionTeleport.y do + local c = Tile(Position(x, y, 15)):getTopCreature() + if c and c:isPlayer() then + table.insert(playersTable, c:getId()) + c:teleportTo(lastBoss.teleportTo) + c:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + c:setStorageValue(lastBoss.storageTimer, os.time() + 20*60*60) + end + end + end + + local monster = Game.createMonster(lastBoss.bossName, lastBoss.bossPosition, true, true) + + if monster then + monster:registerEvent('dreamCourtsDeath') + end + + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) + + addEvent(kickPlayersAfterTime, 30*60*1000, playersTable, lastBoss.roomFromPosition, lastBoss.roomToPosition, lastBoss.exitPosition) + else + return true + end + end + else + for i = 1, #leverInfo do + if iPos == leverInfo[i].leverPosition and os.sdate("%A") == leverInfo[i].byDay then + local leverTable = leverInfo[i] + if pPos == leverTable.pushPosition then + if player:doCheckBossRoom(leverTable.bossName, leverTable.roomFromPosition, leverTable.roomToPosition) then + if leverTable.typePush == "x" then + for i = leverTable.leverFromPos.x, leverTable.leverToPos.x do + local newPos = Position(i, leverTable.leverFromPos.y, leverTable.leverFromPos.z) + local creature = Tile(newPos):getTopCreature() + if creature and creature:isPlayer() then + creature:teleportTo(leverTable.teleportTo, true) + creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + creature:setStorageValue(leverTable.storageTimer, os.time() + 20*60*60) + table.insert(playersTable, creature:getId()) + end + end + elseif leverTable.typePush == "y" then + for i = leverTable.leverFromPos.y, leverTable.leverToPos.y do + local newPos = Position(leverTable.leverFromPos.x, i, leverTable.leverFromPos.z) + local creature = Tile(newPos):getTopCreature() + if creature and creature:isPlayer() then + creature:teleportTo(leverTable.teleportTo, true) + creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + creature:setStorageValue(leverTable.storageTimer, os.time() + 20*60*60) + table.insert(playersTable, creature:getId()) + end + end + end + + local monster = Game.createMonster(leverTable.bossName, leverTable.bossPosition, true, true) + + if monster then + if leverTable.bossName:lower() == "maxxenius" then + local generators = { + Position(32205, 32048, 14), + Position(32210, 32045, 14), + Position(32210, 32051, 14) + } + + for i = 1, #generators do + Game.createMonster("Generator", generators[i], true, true) + end + + monster:registerEvent("facelessHealth") + elseif leverTable.bossName:lower() == "alptramun" then + for i = 1, 2 do + local summon = Game.createMonster("unpleasant dream", leverTable.bossPosition, true, true) + summon:registerEvent("dreamCourtsDeath") + end + + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled, 0) + + monster:registerEvent("facelessHealth") + elseif leverTable.bossName:lower() == "izcandar the banished" then + monster:registerEvent("izcandarThink") + + spawnSummons(1, "the heat of summer", false, 15, heatOfSummer, leverTable.bossPosition) + spawnSummons(1, "the cold of winter", false, 15, coldOfWinter, leverTable.bossPosition) + + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarOutfit, 0) + elseif leverTable.bossName:lower() == "plagueroot" then + spawnSummons(1, "plant attendant", false, 15, plantAttendants, leverTable.bossPosition) + + monster:registerEvent("facelessHealth") + elseif leverTable.bossName:lower() == "malofur mangrinder" then + for i = 1, #whirlingBlades do + local blade = Game.createMonster("whirling blades", whirlingBlades[i], true, true) + end + end + + monster:registerEvent("dreamCourtsDeath") + + addEvent(startFight, 30 * 1000, leverTable.teleportTo, leverTable.bossPosition) + end + + addEvent(kickPlayersAfterTime, 30*60*1000, playersTable, leverTable.roomFromPosition, leverTable.roomToPosition, leverTable.exitPosition) + end + end + end + end + end + end + + item:transform(transform[item.itemid]) + + return true +end + +actions_dreamscarLevers:aid(23112) +actions_dreamscarLevers:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua new file mode 100644 index 00000000000..eb1d2d07b65 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua @@ -0,0 +1,93 @@ +local transform = { + [9110] = 9111, + [9111] = 9110 +} + +local leverInfo = { + [1] = { + bossName = "Faceless Bane", + bossPosition = Position(33617, 32561, 13), + leverPosition = Position(33637, 32562, 13), + pushPosition = Position(33638, 32562, 13), + leverFromPos = Position(33638, 32562, 13), + leverToPos = Position(33642, 32562, 13), + storageTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTimer, + roomFromPosition = Position(33606, 32552, 13), + roomToPosition = Position(33631, 32572, 13), + teleportTo = Position(33617, 32567, 13), + typePush = "x", + exitPosition = Position(33619, 32522, 15), + globalTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTimer + }, +} + +local actions_facelessLever = Action() + +function actions_facelessLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + local playersTable = {} + local iPos = item:getPosition() + local pPos = player:getPosition() + + if item.itemid == 9110 then + for i = 1, #leverInfo do + if iPos == leverInfo[i].leverPosition then + local leverTable = leverInfo[i] + + if pPos == leverTable.pushPosition then + if doCheckBossRoom(player:getId(), leverTable.bossName, leverTable.roomFromPosition, leverTable.roomToPosition) then + if leverTable.typePush == "x" then + for i = leverTable.leverFromPos.x, leverTable.leverToPos.x do + local newPos = Position(i, leverTable.leverFromPos.y, leverTable.leverFromPos.z) + local creature = Tile(newPos):getTopCreature() + + if creature and creature:isPlayer() then + creature:teleportTo(leverTable.teleportTo) + creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + creature:setStorageValue(leverInfo.storageTimer, os.time() + 20*60*60) + table.insert(playersTable, creature:getId()) + end + end + elseif leverTable.typePush == "y" then + for i = leverTable.leverFromPos.y, leverTable.leverToPos.y do + + local newPos = Position(leverTable.leverFromPos.x, i, leverTable.leverFromPos.z) + local creature = Tile(newPos):getTopCreature() + + if creature and creature:isPlayer() then + creature:teleportTo(leverTable.teleportTo) + creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + creature:setStorageValue(leverInfo.storageTimer, os.time() + 20*60*60) + table.insert(playersTable, creature:getId()) + end + end + end + + local monster = Game.createMonster(leverTable.bossName, leverTable.bossPosition, true, true) + + if monster then + if leverTable.bossName:lower() == "faceless bane" then + monster:registerEvent("facelessThink") + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTiles, 0) + end + + monster:registerEvent("dreamCourtsDeath") + end + + addEvent(kickPlayersAfterTime, 30*60*1000, playersTable, leverTable.roomFromPosition, leverTable.roomToPosition, leverTable.exitPosition) + end + end + end + end + end + + item:transform(transform[item.itemid]) + + return true +end + +actions_facelessLever:aid(23110) +actions_facelessLever:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua new file mode 100644 index 00000000000..8962bf8c0ad --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua @@ -0,0 +1,92 @@ +local firstFloor = { + [1] = { hisPosition = Position(32749, 32628, 8) }, + [2] = { hisPosition = Position(32745, 32613, 8) }, + [3] = { hisPosition = Position(32811, 32645, 8) }, + [4] = { hisPosition = Position(32781, 32641, 8) }, +} + +local secondFloor = { + [1] = { hisPosition = Position(32808, 32612, 9) }, + [2] = { hisPosition = Position(32775, 32600, 9) }, + [3] = { hisPosition = Position(32743, 32612, 9) }, + [4] = { hisPosition = Position(32761, 32630, 9) }, +} + +local thirdFloor = { + [1] = { hisPosition = Position(32742, 32636, 10) }, + [2] = { hisPosition = Position(32757, 32606, 10) }, + [3] = { hisPosition = Position(32767, 32638, 10) }, + [4] = { hisPosition = Position(32789, 32613, 10) }, +} + + +local function setActionId(itemid, position, aid) + local crystal = Tile(position):getItemById(itemid) + + if crystal and crystal:getActionId() ~= aid then + crystal:setActionId(aid) + end +end + +local function tryCrystal(player, itemid, position, actionid, message, rewardid) + local player = Player(player) + local r = math.random(1, 10) + local crystal = Tile(position):getItemById(itemid) + + if player then + if crystal then + if crystal:getActionId() == actionid then + if r == 1 then + player:say(message, TALKTYPE_MONSTER_SAY) + player:addItem(rewardid, 1) + crystal:setActionId(0) + addEvent(setActionId, 1000*30, itemid, position, actionid) + else + crystal:getPosition():sendMagicEffect(CONST_ME_POFF) + end + else + player:sendCancelMessage("You must wait a while to use this item again.") + end + end + end +end + +local storage = Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.gotAxe + +local actions_goldenAxe = Action() + +function actions_goldenAxe.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + local tPos = target:getPosition() + local tId = target:getId() + + if player:getStorageValue(storage) >= 1 then + if target.itemid == 8865 then + for _, k in pairs(firstFloor) do + if tPos == k.hisPosition then + tryCrystal(player:getId(), tId, tPos, 23121, "You got a blue crystal!", 33780) + end + end + elseif target.itemid == 16168 then + for _, k in pairs(secondFloor) do + if tPos == k.hisPosition then + tryCrystal(player:getId(), tId, tPos, 23122, "You got a green crystal!", 33781) + end + end + elseif target.itemid == 14974 then + for _, k in pairs(thirdFloor) do + if tPos == k.hisPosition then + tryCrystal(player:getId(), tId, tPos, 23123, "You got a purple crystal!", 33782) + end + end + end + end + + return true +end + +actions_goldenAxe:id(29286) +actions_goldenAxe:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua new file mode 100644 index 00000000000..6cccd5d7bec --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua @@ -0,0 +1,37 @@ +local altars = { + [1] = { position = Position(32591, 32629, 9) }, + [2] = { position = Position(32591, 32621, 9) }, + [3] = { position = Position(32602, 32629, 9) }, + [4] = { position = Position(32602, 32621, 9) }, +} + +local blockedItem = 29300 + +local actions_goldenIdol = Action() + +function actions_goldenIdol.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + local tPos = target:getPosition() + + for _, altar in pairs(altars) do + if tPos == altar.position then + local checkTile = Tile(altar.position):getItemById(blockedItem) + if not checkTile then + item:remove(1) + Game.createItem(blockedItem, 1, altar.position) + tPos:sendMagicEffect(CONST_ME_POFF) + player:say('**placing idol**', TALKTYPE_MONSTER_SAY) + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There is already an idol here. Try another altar.") + end + end + end + + return true +end + +actions_goldenIdol:id(29299) +actions_goldenIdol:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua new file mode 100644 index 00000000000..2c3e9151848 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua @@ -0,0 +1,57 @@ +local altars = { + [1] = { position = Position(32591, 32629, 9) }, + [2] = { position = Position(32591, 32621, 9) }, + [3] = { position = Position(32602, 32629, 9) }, + [4] = { position = Position(32602, 32621, 9) }, +} + +local blockedItem = 29300 + +local function cleanIdols() + for _, altar in pairs(altars) do + local checkTile = Tile(altar.position):getItemById(blockedItem) + + if checkTile then + checkTile:remove(1) + end + end +end + +local actions_idolCheck = Action() + +function actions_idolCheck.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + local count = 0 + + for _, altar in pairs(altars) do + local checkTile = Tile(altar.position):getItemById(blockedItem) + + if checkTile then + count = count + 1 + end + end + + if count == 4 then + addEvent(cleanIdols, 1*60*1000) + + local spectators = Game.getSpectators(item:getPosition(), false, true, 12, 12, 12, 12) + + for _, spectator in pairs(spectators) do + local p = Player(spectator:getId()) + p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple, 1) + if p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb) == 1 and p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar) == 1 and p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple) == 1 then + p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 2) + end + end + + player:say('REPLACING THE IDOLS FEEDS THE PORTAL BUT DOES NOT FREE ONE FROM THE SACRILEGE OF TAKING THEM AWAY FROM TUKH!', TALKTYPE_MONSTER_SAY) + end + + return true +end + +actions_idolCheck:aid(23107) +actions_idolCheck:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_keyCheck.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_keyCheck.lua new file mode 100644 index 00000000000..d05714a64ff --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_keyCheck.lua @@ -0,0 +1,40 @@ +local storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline +local pillar = { Position(33069, 32317, 8), Position(33070, 32317, 8), Position(33068, 32308, 8) } + +local actions_keyCheck = Action() + +function actions_keyCheck.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + local iPos = item:getPosition() + local isInQuest = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb) + + if player:getStorageValue(storage) == 1 and isInQuest < 1 then + if iPos == pillar[1] or iPos == pillar[2] then + if player:getItemCount(29351) >= 2 then + player:removeItem(29351, 2) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "As soon as you turn the second key a mechanism retracts the locks and swallows the keys, opening a small passage beyond.") + player:teleportTo(Position(33069, 32310, 8)) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to use the mechanism of the pillar itself to turn both keys at once.") + return true + end + elseif iPos == pillar[3] then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You reach for the onyx and trigger and enormous discharge of raw energy. It is now possible to traverse the portal in this tomb.") + player:teleportTo(Position(33068, 32320, 8)) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb, 1) + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb) == 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar) == 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple) == 1 then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 2) + end + end + end + + return true +end + +actions_keyCheck:aid(23105) +actions_keyCheck:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_magicalPaint.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_magicalPaint.lua new file mode 100644 index 00000000000..6267670d439 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_magicalPaint.lua @@ -0,0 +1,45 @@ +local sapphireDust = 30004 +local sunFruitJuice = 30003 +local egg = 30005 +local enchantedBottle = 30006 +local magicalPaint = 29994 +local Count = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count + +local actions_magicalPaint = Action() + +function actions_magicalPaint.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if item.itemid == sapphireDust and target.itemid == sunFruitJuice then + target:remove(1) + item:remove(1) + player:addItem(enchantedBottle) + return true + elseif item.itemid == egg and target.itemid == enchantedBottle then + target:remove(1) + item:remove(1) + player:addItem(magicalPaint) + return true + elseif item.itemid == magicalPaint and target.actionid == 23109 then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Painting) < 1 then + item:remove(1) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Carefully you paint over the picture. As you are doing so the flat paiting deepens. It looks now like a room you can enter.") + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Painting, 1) + player:setStorageValue(Count, player:getStorageValue(Count) + 1) + end + elseif item.actionid == 23109 and (item.itemid == 29997 or item.itemid == 29996) then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Painting) == 2 then + if item.getPosition() == Position(32104, 31921, 13) or item:getPosition() == Position(32103, 31921, 13) then + player:teleportTo(Position(32114, 32014, 13)) + else + player:teleportTo(Position(32103, 31922, 13)) + end + + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Painting) == 1 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This isn't a normal paiting anymore. By using magical paint you transformed it into a portal and can easily pass it.") + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Painting, 2) + end + end +end + +actions_magicalPaint:aid(23109) +actions_magicalPaint:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_oldLock.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_oldLock.lua new file mode 100644 index 00000000000..d978cc20f7b --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_oldLock.lua @@ -0,0 +1,32 @@ +local doorPosition = Position(32091, 31970, 14) +local keysCount = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count + +local actions_oldLock = Action() + +function actions_oldLock.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + local tPos = target:getPosition() + + if tPos == doorPosition then + if player:getStorageValue(keysCount) == 6 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You insert the old lock into the door. It fits perfectly.") + player:addAchievement("Keeper of the 7 Keys") + player:setStorageValue(keysCount, 7) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, 2) + tPos:sendMagicEffect(CONST_ME_MAGIC_BLUE) + return true + else + return true + end + else + return true + end + + return true +end + +actions_oldLock:id(29992) +actions_oldLock:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua new file mode 100644 index 00000000000..f4939e9c10b --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua @@ -0,0 +1,157 @@ +local doors = { + [1] = { + doorPosition = Position(32761, 32630, 7), + storage = Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, + value = 1 + }, + [2] = { + doorPosition = Position(32700, 32244, 9), + storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, + value = 1 + }, + [3] = { + doorPosition = Position(32700, 32255, 9), + storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, + value = 1 + }, + [4] = { + doorPosition = Position(32700, 32275, 8), + storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, + value = 1 + }, + [5] = { + doorPosition = Position(32719, 32264, 8), + storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar, + value = 1 + }, + [6] = { + doorPosition = Position(33088, 32388, 8), + storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, + value = 1 + }, + [7] = { + doorPosition = Position(32606, 32629, 9), + storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple, value = -1, + help = "Tomb" + }, + [8] = { + doorPosition = Position(32671, 32652, 7), + storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, + value = 1 + }, + [9] = { + doorPosition = Position(33625, 32525, 14), + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, + value = 3 + }, + [10] = { + doorPosition = Position(33640, 32551, 14), + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, + value = 3 + }, + [11] = { + doorPosition = Position(33657, 32551, 14), + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, + value = 3 + }, + [12] = { + doorPosition = Position(31983, 31960, 14), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.doorMedusa, + value = 1, + help = "Medusa" + }, + [13] = { + doorPosition = Position(32051, 31998, 14), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Mushroom, + value = 2 + }, + [14] = { + doorPosition = Position(32074, 31974, 14), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.sequenceSkulls, + value = 3 + }, + [15] = { + doorPosition = Position(32091, 31970, 14), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = 2, + help = "Lock" + }, + [16] = { + doorPosition = Position(31983, 32000, 14), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = 2, + help = "Open/Close" + }, +} + +local actions_questDoors = Action() + +function actions_questDoors.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local door = Door(item.itemid) + local usedDoor = item.itemid + 1 + + if door then + usedDoor = door:use() + end + + local iPos = item:getPosition() + + for _, p in pairs(doors) do + if (iPos == p.doorPosition) and not(player:getPosition() == p.doorPosition) then + if p.help == "Tomb" then + if player:getStorageValue(p.storage) < p.value then + player:teleportTo(toPosition, true) + item:transform(usedDoor) + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.") + end + elseif p.help == "Medusa" then + if player:getStorageValue(p.storage) < 1 then + player:setStorageValue(p.storage, 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count) + 1) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "As Medusas's Ointment takes effect the door is unpetrified again. You can use it now.") + end + + if iPos.y < player:getPosition().y then + player:teleportTo(Position(iPos.x, iPos.y - 3, iPos.z)) + else + player:teleportTo(Position(iPos.x, iPos.y + 3, iPos.z)) + end + + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + elseif p.help == "Lock" then + if player:getStorageValue(p.storage) >= p.value then + if iPos.y < player:getPosition().y then + player:teleportTo(Position(iPos.x, iPos.y - 1, iPos.z)) + else + player:teleportTo(Position(iPos.x, iPos.y + 1, iPos.z)) + end + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The lock in this door is missing. Mysteriously, the door is locked nonetheless. Perhaps you can find a matching lock somewhere?") + return true + end + elseif p.help == "Open/Close" then + if player:getStorageValue(p.storage) >= p.value then + if item.itemid == 30033 then + item:transform(30035) + elseif item.itemid == 30035 then + item:transform(30033) + end + end + else + if player:getStorageValue(p.storage) >= p.value then + player:teleportTo(toPosition, true) + item:transform(usedDoor) + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.") + end + end + end + end + + return true +end + +actions_questDoors:aid(23101) +actions_questDoors:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_rosebushUse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_rosebushUse.lua new file mode 100644 index 00000000000..4238357f85f --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_rosebushUse.lua @@ -0,0 +1,34 @@ +local earthPosition = Position(32014, 32035, 13) +local Rosebush = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Rosebush +local keysCount = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count + +local actions_rosebushUse = Action() + +function actions_rosebushUse.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + local tPos = target:getPosition() + + if tPos == earthPosition then + if player:getStorageValue(Rosebush) <= 1 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You plant the rosebush into the fresh soil. The green portal glows brighter. Perhaps you may pass it now.") + player:setStorageValue(Rosebush, 2) + if player:getStorageValue(keysCount) < 0 then + player:setStorageValue(keysCount, 0) + end + player:setStorageValue(keysCount, player:getStorageValue(keysCount) + 1) + tPos:sendMagicEffect(CONST_ME_SMALLPLANTS) + else + return false + end + else + return false + end + + return true +end + +actions_rosebushUse:id(29993) +actions_rosebushUse:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sacrophagusUse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sacrophagusUse.lua new file mode 100644 index 00000000000..d9e874e790a --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sacrophagusUse.lua @@ -0,0 +1,79 @@ +local sacrophagus = { + [1] = { hisPosition = Position(33081, 32355, 8) }, + [2] = { hisPosition = Position(33093, 32356, 8) }, + [3] = { hisPosition = Position(33081, 32349, 8) }, + [4] = { hisPosition = Position(33092, 32347, 8) }, + [5] = { hisPosition = Position(33083, 32338, 8) }, + [6] = { hisPosition = Position(33093, 32338, 8) }, + [7] = { hisPosition = Position(33054, 32335, 8) }, + [8] = { hisPosition = Position(33058, 32323, 8) }, + [9] = { hisPosition = Position(33051, 32309, 8) }, + [10] = { hisPosition = Position(33055, 32297, 8) }, + [11] = { hisPosition = Position(33091, 32301, 8) }, + [12] = { hisPosition = Position(33091, 32319, 8) }, + [13] = { hisPosition = Position(33103, 32344, 8) }, + [14] = { hisPosition = Position(33091, 32319, 8) }, +} + +local function setActionId(itemid, position, aid) + local item = Tile(position):getItemById(itemid) + + if item and item:getActionId() ~= aid then + item:setActionId(aid) + end +end + +local function resetActionId(player, itemid, position, actionid, message, rewardid) + local player = Player(player) + local r = math.random(1, 10) + local check = Tile(position):getItemById(itemid) + + if player then + if check then + if check:getActionId() == actionid then + if r >= 7 then + player:say(message, TALKTYPE_MONSTER_SAY) + local item = player:addItem(rewardid, 1) + item:decay() + else + Game.createMonster("Mummy", check:getPosition()) + check:getPosition():sendMagicEffect(CONST_ME_POFF) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The curse of disturbing this fragile, ancient peace is your price to pay!") + end + + check:setActionId(0) + addEvent(setActionId, 1000*30, itemid, position, actionid) + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The opening of the last sarcophagus still haunts you. Wait some time for your spirits to return.") + end + end + end +end + +local storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline + +local actions_sacrophagusUse = Action() + +function actions_sacrophagusUse.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + local rewardId = 29351 + local tPos = item:getPosition() + local tId = item:getId() + local isInQuest = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb) + + if player:getStorageValue(storage) == 1 and isInQuest < 1 then + for _, k in pairs(sacrophagus) do + if tPos == k.hisPosition then + resetActionId(player:getId(), tId, tPos, 23104, "You got a "..ItemType(rewardId):getName().."!", rewardId) + end + end + end + + return true +end + +actions_sacrophagusUse:id(29349) +actions_sacrophagusUse:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua new file mode 100644 index 00000000000..ee096cb12d4 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua @@ -0,0 +1,67 @@ +local sequenceBooks = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.sequenceBooks +local questline = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline + +local sequence = { + [1] = { + number = 0, + position = Position(33613, 32515, 15), + msg = "The chants in this book often contain the word 'K'muuh'." + }, + [2] = { + number = 1, + position = Position(33621, 32520, 15), + msg = "The chants in this book often contain the word 'N'ogalu'." + }, + [3] = { + number = 2, + position = Position(33616, 32520, 15), + msg = "The chants in this book often contain the word 'O'kteth.'." + }, + [4] = { + number = 3, + position = Position(33624, 32515, 15), + msg = "All chants have been sung in the right order, you are deemed worthy. You are transported away..." + }, +} + +local actions_sequenceBooks = Action() + +function actions_sequenceBooks.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + if player:getStorageValue(sequenceBooks) < 0 then + player:setStorageValue(sequenceBooks, 0) + end + + local tPos = item:getPosition() + + if player:getStorageValue(questline) == 3 then + for _, book in pairs(sequence) do + if tPos == book.position then + if player:getStorageValue(sequenceBooks) == book.number then + player:setStorageValue(sequenceBooks, player:getStorageValue(sequenceBooks) + 1) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, book.msg) + tPos:sendMagicEffect(CONST_ME_SOUND_WHITE) + else + player:setStorageValue(sequenceBooks, 0) + tPos:sendMagicEffect(CONST_ME_SOUND_RED) + end + end + if player:getStorageValue(sequenceBooks) == 4 then + player:teleportTo(Position(33640, 32561, 13)) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:setStorageValue(sequenceBooks, 0) + if player:getStorageValue(questline) < 4 then + player:setStorageValue(questline, 4) + end + end + end + end + + return true +end + +actions_sequenceBooks:id(29957) +actions_sequenceBooks:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua new file mode 100644 index 00000000000..5b7d4b13e1a --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua @@ -0,0 +1,63 @@ +local sequenceSkulls = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.sequenceSkulls +local Count = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count + +local bookId = 29991 + +local sequence = { + [1] = { + id = 29988, + number = 0, + position = Position(32071, 31977, 14), + msg = "You put the minotaur skull into the coffin within the minotaur skeleton. One of the door's locks clicks." + }, + [2] = { + id = 29989, + number = 1, + position = Position(32074, 31977, 14), + msg = "You put the orc skull into the coffin within the orc skeleton. One of the door's locks clicks." + }, + [3] = { + id = 29990, + number = 2, + position = Position(32077, 31977, 14), + msg = "You put the minotaur skull into the coffin within the minotaur skeleton. One of the door's locks clicks." + }, +} + +local actions_sequenceSkulls = Action() + +function actions_sequenceSkulls.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + if player:getStorageValue(sequenceSkulls) < 0 then + player:setStorageValue(sequenceSkulls, 0) + end + + local tPos = target:getPosition() + + if player:getItemCount(bookId) >= 1 and player:getStorageValue(sequenceSkulls) < 3 then + for _, skull in pairs(sequence) do + if tPos == skull.position and skull.id == item.itemid then + if player:getStorageValue(sequenceSkulls) == skull.number then + player:setStorageValue(sequenceSkulls, player:getStorageValue(sequenceSkulls) + 1) + tPos:sendMagicEffect(CONST_ME_MAGIC_GREEN) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, skull.msg) + item:remove(1) + if player:getStorageValue(sequenceSkulls) == 3 then + player:setStorageValue(Count, player:getStorageValue(Count) + 1) + end + end + end + end + end + + return true +end + +for _, k in pairs(sequence) do + actions_sequenceSkulls:id(k.id) +end + +actions_sequenceSkulls:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_strangeBucket.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_strangeBucket.lua new file mode 100644 index 00000000000..6f17f0e94db --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_strangeBucket.lua @@ -0,0 +1,79 @@ +local function revertEgg(position, normalEgg, mutatedEgg) + local activeStone = Tile(position):getItemById(normalEgg) + + if activeStone then + activeStone:transform(mutatedEgg) + end +end + +local actions_strangeBucket = Action() + +function actions_strangeBucket.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + local tPos = target:getPosition() + local tId = target:getId() + local r = math.random(0, 10) + local mutatedEgg = 29305 + local normalEgg = 233 + local emptyBucket = 29310 + local lessBucket = 29307 + local mediumBucket = 29308 + local fullBucket = 29309 + local filled = false + local isInQuest = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline) + local slimeCondition = createConditionObject(CONDITION_OUTFIT) + setConditionParam(slimeCondition, CONDITION_PARAM_TICKS, 2*60*1000) + addOutfitCondition(slimeCondition, {lookType = 19}) + + if isInQuest >= 1 then + if tId == mutatedEgg then + if item.itemid == emptyBucket then + if r >= 5 then + filled = true + item:transform(lessBucket) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There is not enough ectoplasm left to fill it in the bucket.") + end + elseif item.itemid == lessBucket then + if r >= 5 then + filled = true + item:transform(mediumBucket) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There is not enough ectoplasm left to fill it in the bucket.") + end + elseif item.itemid == mediumBucket then + if r >= 5 then + filled = true + item:transform(fullBucket) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The ectoplasm all over this egg was already seeping inside the cocoon itself. You manage to fill soem of it into the bucket.") + end + end + if filled then + player:getPosition():sendMagicEffect(CONST_ME_POISONAREA) + else + target:getPosition():sendMagicEffect(CONST_ME_POFF) + end + + target:transform(normalEgg) + addEvent(revertEgg, r*1000*60, tPos, mutatedEgg, normalEgg) + end + if item.itemid == fullBucket then + if target:isPlayer() then + if target:getId() ~= player:getId() then + return true + else + item:transform(emptyBucket) + doAddCondition(player, slimeCondition) + player:getPosition():sendMagicEffect(CONST_ME_POFF) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You pour all of the ectoplasm over yourself. Without the bucket you cannot stabilise it, you need to hurry until it dissolves!") + end + end + end + end + + return true +end + +actions_strangeBucket:id(29307, 29308, 29309, 29310) +actions_strangeBucket:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sunFruit.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sunFruit.lua new file mode 100644 index 00000000000..0180197bdf8 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sunFruit.lua @@ -0,0 +1,30 @@ +local function placeFruits(position, fruit, nofruit) + local item = Tile(position):getItemById(nofruit) + + if item then + item:transform(fruit) + end +end + +local fruitId = 29995 + +local actions_sunFruit = Action() + +function actions_sunFruit.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player then + return true + end + + local r = math.random(2, 4) + + player:addItem(fruitId, r) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found some "..ItemType(fruitId):getName().."s.") + item:transform(29970) + item:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + addEvent(placeFruits, 1*60*60*1000, item:getPosition(), 29969, 29970) + + return true +end + +actions_sunFruit:id(29969) +actions_sunFruit:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua new file mode 100644 index 00000000000..66288775671 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua @@ -0,0 +1,73 @@ +local sides = { + { fromPosition = Position(32208, 32040, 14), toPosition = Position(32216, 32055, 14) }, + { fromPosition = Position(32198, 32039, 14), toPosition = Position(32207, 32055, 14) } +} + +local changes = { + [1] = "izcandar champion of winter", + [2] = "izcandar champion of summer" +} + +local function transformIzcandar(cid, name, health, position) + local creature = Creature(cid) + + if not creature then return true end + + local id = creature:getId() + + if isInArray({ "izcandar champion of winter", "izcandar champion of summer" }, creature:getName():lower()) then + creature:remove() + local oldIzcandar = Game.createMonster("Izcandar the Banished", position, true, true) + if oldIzcandar then + oldIzcandar:registerEvent("izcandarThink") + oldIzcandar:addHealth(-(oldIzcandar:getHealth() - health)) + id = oldIzcandar:getId() + end + end + + addEvent(function(cid_) + local c = Creature(cid_) + + if not c then return true end + + if isInArray({ "izcandar the banished" }, c:getName():lower()) then + local h_ = c:getHealth() + local p_ = c:getPosition() + + c:remove() + + local newIzcandar = Game.createMonster(name, p_, true, true) + + if newIzcandar then + newIzcandar:registerEvent("izcandarThink") + newIzcandar:addHealth(-(newIzcandar:getHealth() - h_)) + end + else + return true + end + end, math.random(10, 20)*1000, id) +end + +local creaturescripts_Izcandar = CreatureEvent("izcandarThink") + +function creaturescripts_Izcandar.onThink(creature, interval) + if not creature:isMonster() then + return true + end + + local health = creature:getHealth() + local position = creature:getPosition() + local cName = creature:getName():lower() + + if position:isInRange(sides[1].fromPosition, sides[1].toPosition) and not (cName == "izcandar champion of winter") then + transformIzcandar(creature:getId(), "izcandar champion of winter", health, position) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarOutfit, 1) + elseif position:isInRange(sides[2].fromPosition, sides[2].toPosition) and not (cName == "izcandar champion of summer") then + transformIzcandar(creature:getId(), "izcandar champion of summer", health, position) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarOutfit, 2) + end + + return true +end + +creaturescripts_Izcandar:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua new file mode 100644 index 00000000000..d1b40405d87 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua @@ -0,0 +1,136 @@ +local questlog = { + [1] = { + bossName = "Faceless Bane", + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTime, + middlePosition = Position(33617, 32563, 13), + maxValue = 4 + }, + [2] = { + bossName = "Maxxenius", + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + middlePosition = Position(32208, 32048, 14), + maxValue = 5 + }, + [3] = { + bossName = "Alptramun", + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer, + middlePosition = Position(32208, 32048, 14), + maxValue = 5 + }, + [4] = { + bossName = "Izcandar the Banished", + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + middlePosition = Position(32208, 32048, 14), + maxValue = 5 + }, + [5] = { + bossName = "Izcandar Champion of Winter", + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + middlePosition = Position(32208, 32048, 14), + maxValue = 5 + }, + [6] = { + bossName = "Izcandar Champion of Summer", + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + middlePosition = Position(32208, 32048, 14), + maxValue = 5 + }, + [7] = { + bossName = "Plagueroot", + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer, + middlePosition = Position(32208, 32048, 14), + maxValue = 5 + }, + [8] = { + bossName = "Malofur Mangrinder", + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer, + middlePosition = Position(32208, 32048, 14), + maxValue = 5 + }, + [9] = { + bossName = "The Nightmare Beast", + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.nightmareTimer, + middlePosition = Position(32207, 32045, 15), + maxValue = 2 + }, +} + +local alptramunSummons = { + [1] = { + name = "unpleasant dream", + minValue = 0, + maxValue = 9 + }, + [2] = { + name = "horrible dream", + minValue = 9, + maxValue = 18 + }, + [3] = { + name = "nightmarish dream", + minValue = 18, + maxValue = 27 + }, + [4] = { + name = "mind-wrecking dream", + minValue = 27, + maxValue = 36 + } +} + +local creaturescripts_dreamCourtsDeath = CreatureEvent("dreamCourtsDeath") + +function creaturescripts_dreamCourtsDeath.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified) + if not creature:isMonster() or creature:getMaster() then + return true + end + + local cName = creature:getName() + + if cName:lower() == "plant abomination" then + local cPos = creature:getPosition() + Game.createMonster("plant attendant", cPos) + end + + for _, k in pairs(questlog) do + if cName == k.bossName then + for pid, _ in pairs(creature:getDamageMap()) do + local attackerPlayer = Player(pid) + + if attackerPlayer then + if attackerPlayer:getStorageValue(k.storageQuestline) <= k.maxValue then + attackerPlayer:setStorageValue(k.storageQuestline, attackerPlayer:getStorageValue(k.storageQuestline) + 1) + end + attackerPlayer:setStorageValue(k.storageTimer, os.time() + 20 * 60 * 60) + end + end + + if cName:lower() == 'alptramun' then + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled, 0) + end + end + end + + local summonsKilled = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled) + + for _, k in pairs(alptramunSummons) do + if cName:lower() == k.name then + if summonsKilled >= k.minValue and summonsKilled <= k.maxValue then + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled, summonsKilled + 1) + end + end + end + + return true +end + +creaturescripts_dreamCourtsDeath:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua new file mode 100644 index 00000000000..61b4b00b7b1 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua @@ -0,0 +1,65 @@ +local summons = { "Burster Spectre", "Gazer Spectre", "Ripper Spectre" } +local storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessLifes + +local creaturescripts_facelessBane = CreatureEvent("facelessThink") + +function creaturescripts_facelessBane.onThink(creature, interval) + if not creature:isMonster() then + return true + end + + local lifes = creature:getStorageValue(storage) + local percentageHealth = (creature:getHealth()/creature:getMaxHealth())*100 + + if lifes <= 3 then + if lifes < 0 then + creature:setStorageValue(storage, 0) + end + if percentageHealth <= 20 then + creature:addHealth(creature:getMaxHealth()) + creature:registerEvent("facelessHealth") + + for i = 1, #summons do + Game.createMonster(summons[i], creature:getPosition(), true, true) + end + + creature:setStorageValue(storage, lifes + 1) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTiles, 0) + end + end + + return true +end + +creaturescripts_facelessBane:register() + +local creaturescripts_facelessBane = CreatureEvent("facelessHealth") + +function creaturescripts_facelessBane.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin) + if not creature:isMonster() then + return primaryDamage, primaryType, secondaryDamage, secondaryType + end + + if creature:getName():lower() == "maxxenius" then + if primaryType == COMBAT_ENERGYDAMAGE then + creature:addHealth(primaryDamage) + primaryDamage = 0 + end + elseif creature:getName():lower() == "alptramun" then + if primaryType == COMBAT_DEATHDAMAGE then + creature:addHealth(primaryDamage) + primaryDamage = 0 + end + elseif creature:getName():lower() == "faceless bane" then + primaryDamage = 0 + elseif creature:getName():lower() == "plagueroot" then + if primaryType == COMBAT_EARTHDAMAGE then + creature:addHealth(primaryDamage) + primaryDamage = 0 + end + end + + return primaryDamage, primaryType, secondaryDamage, secondaryType +end + +creaturescripts_facelessBane:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua new file mode 100644 index 00000000000..678878bd906 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua @@ -0,0 +1,68 @@ +local spectreTime = 15*1000 +local phantasmTime = 10*1000 +local spectre = createConditionObject(CONDITION_OUTFIT) +setConditionParam(spectre, CONDITION_PARAM_TICKS, spectreTime) +addOutfitCondition(spectre, {lookType = 235}) +local phantasm = createConditionObject(CONDITION_OUTFIT) +setConditionParam(phantasm, CONDITION_PARAM_TICKS, phantasmTime) +addOutfitCondition(phantasm, {lookType = 241}) + +local function resetArea() + local spectators = Game.getSpectators(Position(32206, 32045, 15), false, true, 14, 14, 14, 14) + + for _, p in pairs(spectators) do + local player = Player(p:getId()) + if player then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) + end + end +end + +local creaturescripts_nightmareCurse = CreatureEvent(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) + +function creaturescripts_nightmareCurse.onThink(creature, interval) + if not creature:isPlayer() then + return true + end + + local player = Player(creature) + local stage = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) + + if stage == 1 and not player:getCondition(CONDITION_OUTFIT, spectre) then + doAddCondition(player, spectre) + + addEvent(function(cid) + local p = Player(cid) + + if p then + p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, 2) + end + end, spectreTime, player:getId()) + elseif stage == 2 and not player:getCondition(CONDITION_OUTFIT, phantasm) then + doAddCondition(player, phantasm) + + addEvent(function(cid) + local p = Player(cid) + + if p and p:getCondition(CONDITION_OUTFIT, phantasm) then + resetArea() + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) + p:teleportTo(Position(32213, 32083, 15)) + p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, - 1) + p:unregisterEvent(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) + end + end, phantasmTime, player:getId()) + elseif (stage == 1 or stage == 2) and (player:getCondition(CONDITION_OUTFIT, spectre) or player:getCondition(CONDITION_OUTFIT, phantasm)) then + addEvent(function(cid) + local p = Player(cid) + + if p then + p:getPosition():sendMagicEffect(CONST_ME_SLEEP) + end + end, 1*1000, player:getId()) + end + + return true +end + +creaturescripts_nightmareCurse:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dreamCourts.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dreamCourts.lua new file mode 100644 index 00000000000..c21c8bb3744 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dreamCourts.lua @@ -0,0 +1,88 @@ +local templeEffects = { + Position(32594, 32615, 9), + Position(32595, 32614, 9), + Position(32596, 32615, 9), + Position(32597, 32615, 9), + Position(32598, 32614, 9), + Position(32599, 32614, 9), + Position(32599, 32615, 9), + Position(32600, 32615, 9), + Position(32601, 32614, 9), + Position(32602, 32615, 9), + Position(32603, 32614, 9), + Position(32604, 32614, 9), + Position(32604, 32615, 9), + Position(32605, 32615, 9), + Position(32606, 32614, 9), + Position(32606, 32615, 9), + Position(32608, 32614, 9), + Position(32608, 32615, 9), + Position(32609, 32614, 9), + Position(32611, 32615, 9), + Position(32611, 32614, 9), + Position(32610, 32615, 9), + Position(32610, 32614, 9), + Position(32616, 32615, 9), + Position(32617, 32614, 9), + Position(32618, 32614, 9), + Position(32618, 32615, 9), + Position(32619, 32615, 9), +} + +local maxxeniusEffects = { + fromPosition = Position(32200, 32041, 14), + toPosition = Position(32217, 32057, 14), + tileId = 9192 +} + +local globalevents_dreamCourts = GlobalEvent("earthTrap") + +function globalevents_dreamCourts.onThink(interval) + local creature + local chance = math.random(1, 10) + local templeCenter = Position(32607, 32624, 9) + local templeWatchers = Game.getSpectators(templeCenter, false, true, 20, 20, 20, 20) + + if #templeWatchers > 0 then + for i = 1, #templeEffects do + local position = templeEffects[i] + position:sendMagicEffect(CONST_ME_SMALLPLANTS) + creature = Tile(position):getTopCreature() + if creature and creature:isPlayer() then + doTargetCombatHealth(0, creature, COMBAT_EARTHDAMAGE, -(creature:getHealth()*0.2), -(creature:getHealth()*0.5), CONST_ME_SMALLPLANTS) + end + end + end + + local maxxeniusCenter = Position(32208, 32048, 14) + local maxxeniuswatchers = Game.getSpectators(maxxeniusCenter, false, true, 11, 11, 11, 11) + + if #maxxeniuswatchers > 0 then + for x = maxxeniusEffects.fromPosition.x, maxxeniusEffects.toPosition.x do + for y = maxxeniusEffects.fromPosition.y, maxxeniusEffects.toPosition.y do + local sqm = Tile(Position(x, y, 14)) + + if sqm:getItemById(maxxeniusEffects.tileId) then + sqm:getPosition():sendMagicEffect(CONST_ME_ENERGYHIT) + + local min = -200 + local max = -600 + + if sqm:getTopCreature() then + if sqm:getTopCreature():isMonster() and sqm:getTopCreature():getName():lower() == "maxxenius" then + min = -1111 + max = -3333 + end + + doTargetCombatHealth(0, sqm:getTopCreature(), COMBAT_ENERGYDAMAGE, min, max, CONST_ME_ENERGYHIT) + end + end + end + end + end + + return true +end + +globalevents_dreamCourts:interval(3000) +globalevents_dreamCourts:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua new file mode 100644 index 00000000000..759c826da3b --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua @@ -0,0 +1,42 @@ +local config = { + ['Monday'] = 'Alptramun', + ['Tuesday'] = 'Izcandar_the_Banished', + ['Friday'] = 'Malofur_Mangrinder', + ['Thursday'] = 'Maxxenius', + ['Wednesday'] = 'Malofur_Mangrinder', + ['Saturday'] = 'Plagueroot', + ['Sunday'] = 'Maxxenius' +} + + +local spawnByDay = true + +local globalevents_dream_courts_worldchange = GlobalEvent("startupCourts") + +function globalevents_dream_courts_worldchange.onStartup(interval) + if spawnByDay then + print('>> [dream courts] loaded: ' .. config[os.date("%A")]) + Game.loadMap('data/world/worldchanges/dream_courts_bosses/' .. config[os.date("%A")] ..'.otbm') + else + print('>> dream courts boss: not boss today') + end + return true +end + +globalevents_dream_courts_worldchange:register() + +local globalevents_dream_courts_worldchange = GlobalEvent("fixCourts") + +function globalevents_dream_courts_worldchange.onTime(interval) + if spawnByDay then + print('>> [dream courts] loaded: ' .. config[os.date("%A")]) + Game.loadMap('data/world/worldchanges/dream_courts_bosses/' .. config[os.date("%A")] ..'.otbm') + else + print('>> dream courts boss: not boss today') + end + + return true +end + +globalevents_dream_courts_worldchange:time("00:00") +globalevents_dream_courts_worldchange:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua new file mode 100644 index 00000000000..90f8c9a2544 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua @@ -0,0 +1,129 @@ +local default = { + [1] = { + itemPosition = Position(33618, 32546, 13), + toPosition = Position(32723, 32270, 8), + neededStorage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, + value = 2, + blockedText = 'Connect all three gateways to restore the circle of energy sustaining this nexus.' + }, + [2] = { + itemPosition = Position(32720, 32270, 8), + toPosition = Position(33618, 32544, 13), + neededStorage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, + value = 2, + blockedText = 'Connect all three gateways to restore the circle of energy sustaining this nexus.' + }, + [3] = { + itemPosition = Position(33619, 32526, 15), + toPosition = Position(33619, 32528, 15), + neededStorage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, + value = 2, + msg = 'You traverse the rubble with ease but more of it falls down behind you, essentially blocking your path once again.' + }, +} + +local dreamScar = { + [1] = { + day = "Monday", + bossName = "Alptramun", + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer + }, + [2] = { + day = "Tuesday", + bossName = "Izcandar the Banished", + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer + }, + [3] = { + day = "Wednesday", + bossName = "Malofur Mangrinder", + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer + }, + [4] = { + day = "Thursday", + bossName = "Maxxenius", + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer + }, + [5] = { + day = "Friday", + bossName = "Izcandar the Banished", + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer + }, + [6] = { + day = "Saturday", + bossName = "Plagueroot", + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer + }, + [7] = { + day = "Sunday", + bossName = "Maxxenius", + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer + }, +} + +local permission = Storage.Quest.U12_00.TheDreamCourts.DreamScar.Permission + +local movements_acessTeleports = MoveEvent() + +function movements_acessTeleports.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + + if not player then + return true + end + + local iPos = item:getPosition() + local dreamScarTeleport = Position(32208, 32033, 13) + local nightmareTeleport = Position(32211, 32081, 15) + + if item:getPosition() == nightmareTeleport then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount) >= 5 then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.nightmareTimer) > os.time() then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have to wait to challenge The Nightmare Beast again!') + player:teleportTo(fromPosition) + else + player:teleportTo(Position(32211, 32075, 15)) + end + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You can not use this teleport yet.') + player:teleportTo(fromPosition) + end + end + + for _, k in pairs(default) do + if k.itemPosition == iPos then + if player:getStorageValue(k.neededStorage) >= k.value then + player:teleportTo(k.toPosition) + if k.msg then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, k.msg) + end + else + player:teleportTo(fromPosition) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, k.blockedText) + end + end + end + + if iPos == dreamScarTeleport then + if player:getStorageValue(permission) >= 1 then + for i = 1, #dreamScar do + if os.sdate("%A") == dreamScar[i].day then + if player:getStorageValue(dreamScar[i].storageTimer) > os.time() then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have to wait to challenge '..dreamScar[i].bossName..' again!') + player:teleportTo(fromPosition) + else + player:teleportTo(Position(32208, 32026, 13)) + end + end + end + else + player:teleportTo(fromPosition) + end + end + + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + + return true +end + +movements_acessTeleports:aid(23103) +movements_acessTeleports:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_corruptedNature.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_corruptedNature.lua new file mode 100644 index 00000000000..5741bab5766 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_corruptedNature.lua @@ -0,0 +1,29 @@ +local movements_corruptedNature = MoveEvent() + +function movements_corruptedNature.onStepIn(creature, item, position, fromPosition) + if not creature or not creature:isMonster() then + return true + end + + local r = math.random(7000, 10000) + local cName = creature:getName() + local cPos = creature:getPosition() + + if cName:lower() == "plant attendant" then + creature:remove() + + local abomination = Game.createMonster("Plant Abomination", cPos) + + if abomination then + abomination:registerEvent('dreamCourtsDeath') + abomination:say("The vile energy changes the attendant horribly!", TALKTYPE_MONSTER_SAY) + end + elseif cName:lower() == "plagueroot" then + creature:addHealth(r) + end + + return true +end + +movements_corruptedNature:id(28951) +movements_corruptedNature:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_courtsEntrance.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_courtsEntrance.lua new file mode 100644 index 00000000000..2dabfa47eee --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_courtsEntrance.lua @@ -0,0 +1,153 @@ +local config = { + [1] = { + hisPosition = Position(33675, 32147, 7), + toPosition = Position(32354, 31249, 3), + storage = Storage.Quest.U12_00.TheDreamCourts.Main.Questline, + value = 1 + }, + [2] = { + hisPosition = Position(32354, 31247, 3), + toPosition = Position(33675, 32149, 7), + storage = Storage.Quest.U12_00.TheDreamCourts.Main.Questline, + value = 1 + }, + [3] = { + hisPosition = Position(33672, 32227, 7), + toPosition = Position(33584, 32209, 7), + storage = Storage.Quest.U12_00.TheDreamCourts.Main.Questline, + value = 1 + }, + [4] = { + hisPosition = Position(33584, 32207, 7), + toPosition = Position(33672, 32229, 7), + storage = Storage.Quest.U12_00.TheDreamCourts.Main.Questline, + value = 1 + }, + [5] = { + hisPosition = Position(32014, 31946, 13), + toPosition = Position(33695, 32189, 5), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = 1 + }, + [6] = { + hisPosition = Position(33695, 32191, 5), + toPosition = Position(32014, 31948, 13), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = 1 + }, + [7] = { + hisPosition = Position(32066, 31949, 13), + toPosition = Position(33688, 32113, 5), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = 1 + }, + [8] = { + hisPosition = Position(33688, 32111, 5), + toPosition = Position(32066, 31951, 13), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = 1 + }, + [9] = { + hisPosition = Position(32016, 32037, 13), + toPosition = Position(32057, 32001, 13), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Rosebush, + value = -1 + }, + [10] = { + hisPosition = Position(32055, 32001, 13), + toPosition = Position(32016, 32035, 13), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Rosebush, + value = -1 + }, + [11] = { + hisPosition = Position(32041, 32022, 14), + toPosition = Position(32042, 31924, 15), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = -1 + }, + [12] = { + hisPosition = Position(32042, 31922, 15), + toPosition = Position(32041, 32024, 14), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = -1 + }, + [13] = { + hisPosition = Position(32043, 31954, 15), + toPosition = Position(32095, 32038, 13), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = -1 + }, + [14] = { + hisPosition = Position(32042, 31938, 15), + toPosition = Position(32208, 32093, 13), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = -1 + }, + [15] = { + hisPosition = Position(32042, 31939, 15), + toPosition = Position(32208, 32093, 13), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = -1 + }, + [16] = { + hisPosition = Position(32043, 31938, 15), + toPosition = Position(32208, 32093, 13), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = -1 + }, + [17] = { + hisPosition = Position(32043, 31939, 15), + toPosition = Position(32208, 32093, 13), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = -1 + }, + [18] = { + hisPosition = Position(32208, 32091, 13), + toPosition = Position(32043, 31943, 15), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = -1 + }, + [19] = { + hisPosition = Position(32203, 32078, 14), + toPosition = Position(33672, 32118, 7), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = -1 + }, + [20] = { + hisPosition = Position(32217, 32071, 14), + toPosition = Position(33718, 32182, 7), + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, + value = -1 + }, +} + +local storage = Storage.Quest.U12_00.TheDreamCourts.Main.Questline + +local movements_courtsEntrance = MoveEvent() + +function movements_courtsEntrance.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + + if not player then + return true + end + + local posItem = item:getPosition() + + for _, k in pairs(config) do + if k.hisPosition == posItem then + if player:getStorageValue(k.storage) >= k.value then + player:teleportTo(k.toPosition) + else + player:teleportTo(fromPosition) + end + end + end + + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + + return true +end + +movements_courtsEntrance:aid(23100) +movements_courtsEntrance:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_crackedTile.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_crackedTile.lua new file mode 100644 index 00000000000..fe5606d4941 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_crackedTile.lua @@ -0,0 +1,17 @@ +local movements_crackedTile = MoveEvent() + +function movements_crackedTile.onStepIn(creature, item, position, fromPosition) + local player = Player(creature:getId()) + + if not player then return true end + + local min = player:getMaxHealth()*0.2 + local max = player:getMaxHealth()*0.5 + + doTargetCombat(0, player, COMBAT_DEATHDAMAGE, -min, -max, CONST_ME_MORTAREA, ORIGIN_NONE) + + return true +end + +movements_crackedTile:aid(23106) +movements_crackedTile:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua new file mode 100644 index 00000000000..167a6c1fa7b --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua @@ -0,0 +1,51 @@ +local storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTiles + +local function setActionId(itemid, position, aid) + local item = Tile(position):getItemById(itemid) + + if item and item:getActionId() ~= aid then + item:setActionId(aid) + end +end + +local function isnotImmortal() + local spectators = Game.getSpectators(Position(33617, 32563, 13), false, false, 10, 10, 10, 10) + + for _, c in pairs(spectators) do + if c:isMonster() then + if c:getName():lower() == "faceless bane" then + c:unregisterEvent("facelessHealth") + end + end + end +end + +local movements_facelessTiles = MoveEvent() + +function movements_facelessTiles.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + + if not player then + return true + end + + local isImmortal = Game.getStorageValue(storage) + + if isImmortal == 5 then + Game.setStorageValue(storage, 0) + creature:getPosition():sendMagicEffect(CONST_ME_HOLYAREA) + isnotImmortal() + elseif isImmortal < 0 then + Game.setStorageValue(storage, 0) + elseif isImmortal >= 0 and isImmortal < 5 then + Game.setStorageValue(storage, isImmortal + 1) + creature:getPosition():sendMagicEffect(CONST_ME_YELLOWENERGY) + item:setActionId(0) + addEvent(setActionId, (10*1000), item.itemid, position, 23108) + end + + return true +end + +movements_facelessTiles:aid(23108) +movements_facelessTiles:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_slimeLooktype.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_slimeLooktype.lua new file mode 100644 index 00000000000..b842555484e --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_slimeLooktype.lua @@ -0,0 +1,28 @@ +local movements_library_mazzinor = MoveEvent() + +function movements_library_mazzinor.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + + if not player then + return true + end + + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline) >= 1 then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar) < 1 then + if creature:getOutfit().lookType == 19 and player:getItemCount(29310) >= 1 then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar, 1) + player:teleportTo(Position(32727, 32280, 8)) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:removeCondition(CONDITION_OUTFIT) + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb) == 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar) == 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple) == 1 then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 2) + end + end + end + end + + return true +end + +movements_library_mazzinor:aid(23102) +movements_library_mazzinor:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua new file mode 100644 index 00000000000..ee8908b4baa --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua @@ -0,0 +1,32 @@ +local storage = Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline +local spiderName = "Lucifuga Aranea" + +local function setActionId(itemid, position, aid) + local item = Tile(position):getItemById(itemid) + + if item and item:getActionId() ~= aid then + item:setActionId(aid) + end +end + +local movements_spiderSummon = MoveEvent() + +function movements_spiderSummon.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + + if not player then + return true + end + + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.hasBait) == 1 then + local r = math.random(1, 10) + Game.createMonster(spiderName, position) + item:setActionId(0) + addEvent(setActionId, r*(1000*60), item.itemid, position, 23120) + end + + return true +end + +movements_spiderSummon:aid(23120) +movements_spiderSummon:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua new file mode 100644 index 00000000000..7f25e724923 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua @@ -0,0 +1,59 @@ +local combat = Combat() +combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_NONE) +combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SOUND_PURPLE) + +local area = createCombatArea(AREA_CIRCLE2X2) +combat:setArea(area) + +local config = { + [1] = { name = "unpleasant dream" }, + [2] = { name = "horrible dream" }, + [3] = { name = "nightmarish dream" }, + [4] = { name = "mind-wrecking dream" } +} + +local maxsummons = 5 + +local spell = Spell("instant") + +function spell.onCastSpell(creature, var) + local monsterName = "" + local randomName = math.random(1, #config) + local randomSummon = math.random(1, 4) + local summonsKilled = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled) or -1 + + if summonsKilled >= 0 and summonsKilled <= 9 then + monsterName = config[1].name + elseif summonsKilled > 9 and summonsKilled <= 18 then + monsterName = config[2].name + elseif summonsKilled > 18 and summonsKilled <= 27 then + monsterName = config[3].name + elseif summonsKilled > 27 and summonsKilled <= 36 then + monsterName = config[4].name + else + monsterName = config[randomName].name + end + + local summoncount = creature:getSummons() + + if #summoncount < maxsummons then + for i = 1, randomSummon do + local mid = Game.createMonster(monsterName, creature:getPosition()) + if not mid then + return + end + mid:setMaster(creature) + mid:registerEvent("dreamCourtsDeath") + end + end + + return combat:execute(creature, var) +end + +spell:name("alptramun summon") +spell:words("###553") +spell:isAggressive(false) +spell:blockWalls(true) +spell:needTarget(false) +spell:needLearn(true) +spell:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_cold_of_winter.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_cold_of_winter.lua new file mode 100644 index 00000000000..883f6bb91d4 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_cold_of_winter.lua @@ -0,0 +1,46 @@ +local combat = Combat() +combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) +combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SNOWBALL) +combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) + +combat:setArea(createCombatArea({ +{0, 1, 0}, +{1, 3, 1}, +{0, 1, 0} +})) + +function spellCallbackColdOfWinter(param) + local tile = Tile(Position(param.pos)) + if tile then + if tile:getTopCreature() and tile:getTopCreature():isMonster() then + if tile:getTopCreature():getName():lower():find("izcandar") then + tile:getTopCreature():addHealth(math.random(0, 1500)) + end + end + end +end + +function onTargetTileColdOfWinter(cid, pos) + local param = {} + param.cid = cid + param.pos = pos + param.count = 0 + spellCallbackColdOfWinter(param) +end + +setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileColdOfWinter") + +local spell = Spell("instant") + +function spell.onCastSpell(creature, var) + return combat:execute(creature, var) +end + +spell:name("cold of winter") +spell:words("###555") +spell:needDirection(true) +spell:isAggressive(false) +spell:blockWalls(true) +spell:needTarget(false) +spell:needLearn(true) +spell:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_generator_wave.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_generator_wave.lua new file mode 100644 index 00000000000..bc953e2246d --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_generator_wave.lua @@ -0,0 +1,49 @@ +local combat = Combat() +combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) +combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA) + +combat:setArea(createCombatArea({ +{0, 0, 0, 1, 0, 0, 0}, +{0, 0, 1, 1, 1, 0, 0}, +{0, 1, 1, 1, 1, 1, 0}, +{1, 1, 1, 3, 1, 1, 1}, +{0, 1, 1, 1, 1, 1, 0}, +{0, 0, 1, 1, 1, 0, 0}, +{0, 0, 0, 1, 0, 0, 0} +})) + +function spellCallbackGenerator(param) + local sqm = Tile(Position(param.pos)) + + if sqm then + local monster = sqm:getTopCreature() + if monster and monster:getName():lower() == 'maxxenius' then + doTargetCombatHealth(0, monster, COMBAT_ENERGYDAMAGE, -999, -1999, CONST_ME_ENERGYAREA) + end + end +end + +function onTargetTileGenerator(cid, pos) + local param = {} + + param.cid = cid + param.pos = pos + param.count = 0 + spellCallbackGenerator(param) +end + +setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileGenerator") + +local spell = Spell("instant") + +function spell.onCastSpell(creature, var) + return combat:execute(creature, var) +end + +spell:name("generator wave") +spell:words("###551") +spell:needDirection(false) +spell:isSelfTarget(true) +spell:needTarget(false) +spell:needLearn(true) +spell:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_heat_of_summer.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_heat_of_summer.lua new file mode 100644 index 00000000000..0edfa5caa60 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_heat_of_summer.lua @@ -0,0 +1,49 @@ +local combat = Combat() +combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) +combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) + +combat:setArea(createCombatArea({ +{0, 1, 0}, +{0, 1, 0}, +{0, 1, 0}, +{0, 1, 0}, +{0, 3, 0} +})) + +function spellCallbackHeatOfSummer(param) + local tile = Tile(Position(param.pos)) + + if tile then + if tile:getTopCreature() and tile:getTopCreature():isMonster() then + if tile:getTopCreature():getName():lower():find("izcandar") then + tile:getTopCreature():addHealth(math.random(0, 1500)) + end + end + end +end + +function onTargetTileHeatOfSummer(cid, pos) + local param = {} + + param.cid = cid + param.pos = pos + param.count = 0 + spellCallbackHeatOfSummer(param) +end + +setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileHeatOfSummer") + +local spell = Spell("instant") + +function spell.onCastSpell(creature, var) + return combat:execute(creature, var) +end + +spell:name("heat of summer") +spell:words("###554") +spell:needDirection(true) +spell:isAggressive(false) +spell:blockWalls(true) +spell:needTarget(false) +spell:needLearn(true) +spell:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_malofur_explosion.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_malofur_explosion.lua new file mode 100644 index 00000000000..74e51fa45a9 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_malofur_explosion.lua @@ -0,0 +1,124 @@ +local BOOOM = Combat() +BOOOM:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) +BOOOM:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER) +BOOOM:setFormula(COMBAT_FORMULA_DAMAGE, -200, -600, -10000, -20000) +BOOOM:setArea(createCombatArea({ + {0, 1, 1, 1, 0}, + {0, 1, 3, 1, 0}, + {0, 1, 1, 1, 0}, +})) + +local BOOOOM = Combat() +BOOOOM:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) +BOOOOM:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER) +BOOOOM:setFormula(COMBAT_FORMULA_DAMAGE, -200, -600, -10000, -20000) +BOOOOM:setArea(createCombatArea({ + {0, 0, 0, 0, 0, 0, 0}, + {0, 0, 1, 1, 1, 0, 0}, + {0, 1, 1, 1, 1, 1, 0}, + {0, 1, 1, 3, 1, 1, 0}, + {0, 1, 1, 1, 1, 1, 0}, + {0, 0, 1, 1, 1, 0, 0}, + {0, 0, 0, 0, 0, 0, 0}, +})) + +local BOOOOOM = Combat() +BOOOOOM:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) +BOOOOOM:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER) +BOOOOOM:setFormula(COMBAT_FORMULA_DAMAGE, -200, -600, -10000, -20000) +BOOOOOM:setArea(createCombatArea({ + {0, 0, 1, 1, 1, 0, 0}, + {0, 1, 1, 1, 1, 1, 0}, + {1, 1, 1, 1, 1, 1, 1}, + {1, 1, 1, 3, 1, 1, 1}, + {1, 1, 1, 1, 1, 1, 1}, + {0, 1, 1, 1, 1, 1, 0}, + {0, 0, 1, 1, 1, 0, 0}, +})) + +local BOOOOOOM = Combat() +BOOOOOOM:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) +BOOOOOOM:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER) +BOOOOOOM:setFormula(COMBAT_FORMULA_DAMAGE, -200, -600, -10000, -20000) +BOOOOOOM:setArea(createCombatArea({ + {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, + {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, + {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, + {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, + {1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1}, + {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, + {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, + {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, + {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, +})) + +local spell = Spell("instant") + +function spell.onCastSpell(creature, var) + if not creature:isMonster() then + return false + end + + local exaust = math.random(11, 41) + + if creature:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Malofur) ~= 1 then + creature:say("RAAAARGH! I'M MASHING YE TO DUST!", TALKTYPE_MONSTER_SAY) + creature:say("BOOM!", TALKTYPE_MONSTER_SAY) + creature:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Malofur, 1) + + addEvent(function(cid) + local c = Creature(cid) + if c then + local var = Variant(c:getPosition()) + BOOOM:execute(c, var) + c:say("BOOOM!", TALKTYPE_MONSTER_SAY) + end + end, 3*1000, creature:getId()) + + addEvent(function(cid) + local c = Creature(cid) + if c then + local var = Variant(c:getPosition()) + BOOOOM:execute(c, var) + c:say("BOOOOM!", TALKTYPE_MONSTER_SAY) + end + end, 5*1000, creature:getId()) + + addEvent(function(cid) + local c = Creature(cid) + if c then + local var = Variant(c:getPosition()) + BOOOOOM:execute(c, var) + c:say("BOOOOOM!", TALKTYPE_MONSTER_SAY) + end + end, 7*1000, creature:getId()) + + addEvent(function(cid) + local c = Creature(cid) + if c then + local var = Variant(c:getPosition()) + BOOOOOOM:execute(c, var) + c:say("BOOOOOOM!", TALKTYPE_MONSTER_SAY) + end + end, 9*1000, creature:getId()) + + addEvent(function(cid) + local c = Creature(cid) + if c then + c:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Malofur, 0) + end + end, exaust * 1000, creature:getId()) + end + + return true +end + +spell:name("malofur explosion") +spell:words("###559") +spell:isAggressive(false) +spell:blockWalls(true) +spell:needTarget(false) +spell:needLearn(true) +spell:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_maxxenius_energy_elemental.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_maxxenius_energy_elemental.lua new file mode 100644 index 00000000000..7e7d7a85786 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_maxxenius_energy_elemental.lua @@ -0,0 +1,69 @@ +local arrayArea = { + {0, -4}, + {-1, -3}, {0, -3}, {1, -3}, + {-2, -2}, {-1, -2}, {0, -2}, {1, -2}, {2, -2}, + {3, -1}, {-2, -1}, {-1, -1}, {0, -1}, {1, -1}, {2, -1}, {3, -1}, + {-4, 0}, {-3, 0}, {-2, 0}, {-1, 0}, {0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, + {-3, 1}, {-2, 1}, {-1, 1}, {0, 1}, {1, 1}, {2, 1}, {3, 1}, + {-2, 2}, {-1, 2}, {0, 2}, {1, 2}, {2, 2}, + {-1, 3}, {0, 3}, {1, 3}, + {0, 4} +} + +local area = createCombatArea(arrayArea) + +local function spellDamage(id, centerpos, target) + local damage = math.random(1000, 2000) + local target = Creature(target) + local monster = Monster(id) + + if not target and monster then + centerpos = monster:getPosition() + elseif target then + centerpos = target:getPosition() + end + + for _, pos in pairs(arrayArea) do + local newpos = Position(centerpos.x + pos[1], centerpos.y + pos[2], centerpos.z) + if newpos then + local creature = Tile(newpos):getTopCreature() + if creature then + doTargetCombatHealth(0, creature, COMBAT_ENERGYDAMAGE, -1000, -2000, CONST_ME_ENERGYHIT) + end + newpos:sendMagicEffect(CONST_ME_ENERGYHIT) + end + end +end + +local combat = Combat() +combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT) +combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL) + +local looktype = createConditionObject(CONDITION_OUTFIT) +setConditionParam(looktype, CONDITION_PARAM_TICKS, 5000) +addOutfitCondition(looktype, {lookType = 290}) + +local spell = Spell("instant") + +function spell.onCastSpell(creature, var) + local target = creature:getTarget() + + if target:isPlayer() then + target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel a powerfull eletric charge building up!") + doAddCondition(target, looktype) + end + + addEvent(spellDamage, 5 * 1000, creature:getId(), creature:getPosition(), target and target:getId() or 0) + + return combat:execute(creature, var) +end + +spell:name("maxxenius energy elemental") +spell:words("###552") +spell:needDirection(true) +spell:isAggressive(false) +spell:blockWalls(true) +spell:needTarget(true) +spell:needLearn(true) +spell:register() + diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua new file mode 100644 index 00000000000..3fdf009b8f0 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua @@ -0,0 +1,34 @@ +local spell = Spell("instant") + +function spell.onCastSpell(creature, var) + local hasCasted = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse) + + if hasCasted == 0 then + local players = Game.getSpectators(cid:getPosition(), false, true, 14, 14, 14, 14) + local randomNumber = math.random(1, #players) + + for _, k in pairs(players) do + local player = Player(k) + if player then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, - 1) + end + end + + local newPlayer = Player(players[randomNumber]:getId()) + + newPlayer:registerEvent('nightmareCurse') + newPlayer:setStorageValue('nightmareCurse', 1) + newPlayer:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 1) + newPlayer:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The beast laid a terrible curse on you!") + + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 1) + end +end + +spell:name("nightmare beast curse") +spell:words("###560") +spell:isAggressive(false) +spell:blockWalls(true) +spell:needTarget(true) +spell:needLearn(true) +spell:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_skill_reducer.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_skill_reducer.lua new file mode 100644 index 00000000000..14bf81c5829 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_skill_reducer.lua @@ -0,0 +1,30 @@ +local combat = {} + +for i = 60, 85 do + combat[i] = Combat() + combat[i]:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER) + + local condition = Condition(CONDITION_ATTRIBUTES) + condition:setParameter(CONDITION_PARAM_TICKS, 25000) + condition:setParameter(CONDITION_PARAM_SKILL_DISTANCEPERCENT, i) + condition:setParameter(CONDITION_PARAM_SKILL_MELEEPERCENT, i) + condition:setParameter(CONDITION_PARAM_SKILL_FISTPERCENT, i) + + local area = createCombatArea(AREA_CIRCLE3X3) + combat[i]:setArea(area) + combat[i]:addCondition(condition) +end + +local spell = Spell("instant") + +function spell.onCastSpell(creature, var) + return combat[math.random(60, 85)]:execute(creature, var) +end + +spell:name("plagueroot skill reducer") +spell:words("###561") +spell:isAggressive(false) +spell:blockWalls(true) +spell:needTarget(false) +spell:needLearn(true) +spell:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_teleport.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_teleport.lua new file mode 100644 index 00000000000..bf04630cca3 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_teleport.lua @@ -0,0 +1,89 @@ +local combat = Combat() +combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) +combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLPLANTS) + +combat:setArea(createCombatArea({ +{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, +{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, +{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, +{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, +{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, +{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, +{1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1}, +{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, +{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, +{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, +{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, +{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, +{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0} +})) + +function spellCallbackPlaguerootTeleport(param) +end + +function onTargetTilePlaguerootTeleport(cid, pos) + local param = {} + + param.cid = cid + param.pos = pos + param.count = 0 + spellCallbackPlaguerootTeleport(param) +end + +setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTilePlaguerootTeleport") + +local function teleportMonster(creature, centerPos, fromPos, toPos) + local position = {x = math.random(fromPos.x, toPos.x), y = math.random(fromPos.y, toPos.y), z = centerPos.z } + local tile = Tile(Position(position)) + local count = 1 + + while(not tile or tile:getItemByType(ITEM_TYPE_TELEPORT) or not tile:getGround() or tile:hasFlag(TILESTATE_BLOCKPATH) or tile:hasFlag(TILESTATE_PROTECTIONZONE) or tile:hasFlag(TILESTATE_BLOCKSOLID) or count < 5) do + position = Position(math.random(fromPos.x, toPos.x), math.random(fromPos.y, toPos.y), centerPos.z) + tile = Tile(position) + count = count + 1 + end + + if tile then + if position:isInRange(Position(32199, 32039, 14), Position(32216, 32057, 14)) then + creature:getPosition():sendMagicEffect(CONST_ME_POFF) + creature:teleportTo(position) + Position(position):sendMagicEffect(CONST_ME_TELEPORT) + end + end +end + +local spell = Spell("instant") + +function spell.onCastSpell(creature, var) + if not creature:isMonster() then + return false + end + + local centerPos = creature:getPosition() + local fromPos = {x = centerPos.x - 7, y = centerPos.y - 5, z = centerPos.z} + local toPos = {x = centerPos.x + 7, y = centerPos.y + 5, z = centerPos.z} + + creature:say("PLAGUEROOT TUNNELS TO ANOTHER PLACE!", TALKTYPE_MONSTER_SAY) + teleportMonster(creature, centerPos, fromPos, toPos) + + var = {type = 2, pos = {x = creature:getPosition().x, y = creature:getPosition().y, z = creature:getPosition().z}} + + combat:execute(creature, var) + + addEvent(function() + if creature then + var = {type = 2, pos = {x = creature:getPosition().x, y = creature:getPosition().y, z = creature:getPosition().z}} + combat:execute(creature, var) + end + end, 2*1000) + + return true +end + +spell:name("plagueroot teleport") +spell:words("###558") +spell:isAggressive(false) +spell:blockWalls(true) +spell:needTarget(false) +spell:needLearn(true) +spell:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_abomination_wave.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_abomination_wave.lua new file mode 100644 index 00000000000..bfec3697cf7 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_abomination_wave.lua @@ -0,0 +1,49 @@ +local combat = Combat() +combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) +combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYPOISON) +combat:setParameter(COMBAT_PARAM_SHOOT, CONST_ANI_EARTH) + +combat:setArea(createCombatArea({ +{0, 0, 1, 0, 0}, +{0, 1, 1, 1, 0}, +{1, 1, 3, 1, 1}, +{0, 1, 1, 1, 0}, +{0, 0, 1, 0, 0} +})) + +function spellCallbackAbominationWave(param) + local tile = Tile(Position(param.pos)) + + if tile then + if tile:getTopCreature() and tile:getTopCreature():isMonster() then + if tile:getTopCreature():getName():lower() == "plagueroot" then + tile:getTopCreature():addHealth(math.random(0, 1500)) + end + end + end +end + +function onTargetTileAbominationWave(cid, pos) + local param = {} + + param.cid = cid + param.pos = pos + param.count = 0 + spellCallbackAbominationWave(param) +end + +setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileAbominationWave") + +local spell = Spell("instant") + +function spell.onCastSpell(creature, var) + return combat:execute(creature, var) +end + +spell:name("plant abomination wave") +spell:words("###557") +spell:isAggressive(false) +spell:blockWalls(true) +spell:needTarget(true) +spell:needLearn(true) +spell:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_attendant_wave.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_attendant_wave.lua new file mode 100644 index 00000000000..34a87306eda --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_attendant_wave.lua @@ -0,0 +1,44 @@ +local combat = Combat() +combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) +combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLPLANTS) + +combat:setArea(createCombatArea({ +{1, 1, 1}, +{1, 3, 1}, +{1, 1, 1} +})) + +function spellCallbackAttendantWave(param) + local tile = Tile(Position(param.pos)) + if tile then + if tile:getTopCreature() and tile:getTopCreature():isMonster() then + if tile:getTopCreature():getName():lower() == "plagueroot" then + tile:getTopCreature():addHealth(math.random(0, 1500)) + end + end + end +end + +function onTargetTileAttendantWave(cid, pos) + local param = {} + param.cid = cid + param.pos = pos + param.count = 0 + spellCallbackAttendantWave(param) +end + +setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileAttendantWave") + +local spell = Spell("instant") + +function spell.onCastSpell(creature, var) + return combat:execute(creature, var) +end + +spell:name("plant attendant wave") +spell:words("###556") +spell:isAggressive(false) +spell:blockWalls(true) +spell:needTarget(false) +spell:needLearn(true) +spell:register() diff --git a/data-otservbr-global/startup/tables/door_quest.lua b/data-otservbr-global/startup/tables/door_quest.lua index 374f3c9a61f..c2933933595 100644 --- a/data-otservbr-global/startup/tables/door_quest.lua +++ b/data-otservbr-global/startup/tables/door_quest.lua @@ -667,11 +667,6 @@ QuestDoorAction = { { x = 32169, y = 31933, z = 7 }, }, }, - -- The dream courts door (Andrew Lyze npc) - [Storage.Quest.U12_00.TheDreamCourts.AndrewDoor] = { - itemId = 20450, - itemPos = { { x = 32761, y = 32630, z = 7 } }, - }, -- Kilmaresh doors -- [Storage.Kilmaresh.First.Title] = { -- itemId = false, @@ -818,30 +813,6 @@ QuestDoorAction = { itemId = false, itemPos = { { x = 33793, y = 31388, z = 6 } }, }, - [Storage.Quest.U12_00.TheDreamCourts.HauntedHouseAccess] = { - itemId = false, - itemPos = { - { x = 32700, y = 32244, z = 9 }, - { x = 32700, y = 32255, z = 9 }, - { x = 32700, y = 32275, z = 8 }, - { x = 33088, y = 32388, z = 8 }, - { x = 32671, y = 32652, z = 7 }, - { x = 32606, y = 32629, z = 9 }, - }, - }, - [Storage.Quest.U12_00.TheDreamCourts.BuriedCathedralAccess] = { - itemId = false, - itemPos = { - { x = 32719, y = 32264, z = 8 }, - { x = 32728, y = 32280, z = 8 }, - }, - }, - [Storage.Quest.U12_00.TheDreamCourts.DreamScarAccess] = { - itemId = false, - itemPos = { - { x = 31983, y = 32000, z = 14 }, - }, - }, [Storage.Quest.U12_40.TheOrderOfTheLion.AccessEastSide] = { itemId = false, itemPos = { diff --git a/data-otservbr-global/startup/tables/item.lua b/data-otservbr-global/startup/tables/item.lua index 5868efcd31b..5fb3368db39 100644 --- a/data-otservbr-global/startup/tables/item.lua +++ b/data-otservbr-global/startup/tables/item.lua @@ -1187,6 +1187,160 @@ ItemAction = { { x = 32741, y = 32382, z = 15 }, }, }, + -- The Dream Courts Quest + [23100] = { + itemId = false, + itemPos = { + {x = 32217, y = 32071, z = 14}, + {x = 32043, y = 31954, z = 15}, + {x = 32203, y = 32078, z = 14}, + {x = 32066, y = 31949, z = 13}, + {x = 32042, y = 31922, z = 15}, + {x = 32354, y = 31247, z = 3}, + {x = 32055, y = 32001, z = 13}, + {x = 33688, y = 32111, z = 5}, + {x = 32043, y = 31939, z = 15}, + {x = 33675, y = 32147, z = 7}, + {x = 33695, y = 32191, z = 5}, + {x = 33584, y = 32207, z = 7}, + {x = 33672, y = 32227, z = 7}, + {x = 32042, y = 31938, z = 15}, + {x = 32043, y = 31938, z = 15}, + {x = 32014, y = 31946, z = 13}, + {x = 32042, y = 31939, z = 15}, + {x = 32016, y = 32037, z = 13}, + {x = 32041, y = 32022, z = 14}, + {x = 32208, y = 32091, z = 13}, + }, + }, + [23101] = { + itemId = false, + itemPos = { + {x = 33088, y = 32388, z = 8}, + {x = 32606, y = 32629, z = 9}, + {x = 31983, y = 31960, z = 14}, + {x = 33625, y = 32525, z = 14}, + {x = 33657, y = 32551, z = 14}, + {x = 33640, y = 32551, z = 14}, + {x = 32671, y = 32652, z = 7}, + {x = 32074, y = 31974, z = 14}, + {x = 32091, y = 31970, z = 14}, + {x = 31983, y = 32000, z = 14}, + {x = 32051, y = 31998, z = 14}, + {x = 32700, y = 32255, z = 9}, + {x = 32700, y = 32244, z = 9}, + {x = 32693, y = 32238, z = 8}, + {x = 32700, y = 32275, z = 8}, + {x = 32761, y = 32630, z = 7}, + {x = 32719, y = 32264, z = 8}, + }, + }, + [23102] = { + itemId = false, + itemPos = { + {x = 32729, y = 32280, z = 8}, + {x = 32729, y = 32279, z = 8}, + {x = 32729, y = 32281, z = 8}, + }, + }, + [23103] = { + itemId = false, + itemPos = { + {x = 33619, y = 32526, z = 15}, + {x = 32211, y = 32081, z = 15}, + {x = 32720, y = 32270, z = 8}, + {x = 33618, y = 32546, z = 13}, + }, + }, + [23105] = { + itemId = false, + itemPos = { + { x = 33070, y = 32317, z = 8 }, + { x = 33069, y = 32317, z = 8 }, + }, + }, + [23106] = { + itemId = false, + itemPos = { + {x = 32616, y = 32620, z = 8}, + {x = 32663, y = 32645, z = 8}, + {x = 32667, y = 32656, z = 8}, + {x = 32662, y = 32658, z = 8}, + {x = 32641, y = 32647, z = 8}, + {x = 32643, y = 32633, z = 8}, + {x = 32640, y = 32631, z = 8}, + {x = 32628, y = 32635, z = 8}, + {x = 32635, y = 32618, z = 8}, + }, + }, + [23107] = { + itemId = 2082, + itemPos = { + { x = 32596, y = 32627, z = 9 }, + }, + }, + [23108] = { + itemId = false, + itemPos = { + {x = 33623, y = 32563, z = 13}, + {x = 33611, y = 32558, z = 13}, + {x = 33619, y = 32567, z = 13}, + {x = 33614, y = 32557, z = 13}, + {x = 33620, y = 32557, z = 13}, + {x = 33623, y = 32558, z = 13}, + {x = 33610, y = 32561, z = 13}, + {x = 33611, y = 32563, z = 13}, + {x = 33624, y = 32561, z = 13}, + {x = 33621, y = 32567, z = 13}, + {x = 33613, y = 32567, z = 13}, + {x = 33617, y = 32558, z = 13}, + {x = 33615, y = 32567, z = 13}, + }, + }, + [23109] = { + itemId = false, + itemPos = { + { x = 32104, y = 31921, z = 13 }, + { x = 32103, y = 31921, z = 13 }, + }, + }, + [23111] = { + itemId = false, + itemPos = { + { x = 32062, y = 31938, z = 14 }, + { x = 32062, y = 31937, z = 14 }, + { x = 32061, y = 31939, z = 14 }, + { x = 32061, y = 31938, z = 14 }, + { x = 32061, y = 31937, z = 14 }, + { x = 32062, y = 31939, z = 14 }, + }, + }, + [23120] = { + itemId = false, + itemPos = { + {x = 32772, y = 32644, z = 10}, + {x = 32787, y = 32634, z = 10}, + {x = 32791, y = 32625, z = 10}, + {x = 32769, y = 32613, z = 10}, + {x = 32773, y = 32626, z = 10}, + {x = 32750, y = 32605, z = 10}, + {x = 32751, y = 32638, z = 10}, + {x = 32740, y = 32619, z = 10}, + {x = 32749, y = 32622, z = 10}, + {x = 32785, y = 32603, z = 10}, + {x = 32805, y = 32619, z = 10}, + {x = 32758, y = 32622, z = 10}, + {x = 32756, y = 32632, z = 10}, + {x = 32804, y = 32628, z = 10}, + {x = 32764, y = 32634, z = 10}, + {x = 32779, y = 32636, z = 10}, + {x = 32784, y = 32619, z = 10}, + {x = 32771, y = 32602, z = 10}, + {x = 32770, y = 32621, z = 10}, + {x = 32792, y = 32606, z = 10}, + {x = 32757, y = 32643, z = 10}, + }, + }, -- Ferumbras' Ascension Quest [24837] = { itemId = 1949, @@ -2697,6 +2851,63 @@ ItemUnique = { itemId = 1949, itemPos = { x = 33926, y = 31477, z = 5 }, }, + -- Threatened Dreams Quest + [23102] = { + itemId = 4024, + itemPos = {x = 32736, y = 32282, z = 8}, + }, + [23103] = { + itemId = 2471, + itemPos = {x = 33693, y = 32185, z = 8}, + }, + [23104] = { + itemId = 29435, + itemPos = {x = 33711, y = 32108, z = 4}, + }, + [23105] = { + itemId = 2523, + itemPos = {x = 33578, y = 32527, z = 14}, + }, + [23106] = { + itemId = 29952, + itemPos = {x = 33599, y = 32533, z = 14}, + }, + [23107] = { + itemId = 29951, + itemPos = {x = 33618, y = 32518, z = 14}, + }, + [23108] = { + itemId = 5501, + itemPos = {x = 33638, y = 32507, z = 14}, + }, + [23109] = { + itemId = 2478, + itemPos = {x = 33703, y = 32185, z = 5}, + }, + [23110] = { + itemId = 25762, + itemPos = {x = 33663, y = 32192, z = 7}, + }, + [23111] = { + itemId = 2438, + itemPos = {x = 33671, y = 32203, z = 7}, + }, + [23112] = { + itemId = 30145, + itemPos = {x = 33683, y = 32125, z = 6}, + }, + [23113] = { + itemId = 28522, + itemPos = {x = 31996, y = 31981, z = 13}, + }, + [23114] = { + itemId = 23740, + itemPos = {x = 32017, y = 31981, z = 14}, + }, + [23115] = { + itemId = 4077, + itemPos = {x = 32054, y = 31936, z = 13}, + }, -- The shattered isles [40001] = { itemId = 6118, diff --git a/data-otservbr-global/startup/tables/lever.lua b/data-otservbr-global/startup/tables/lever.lua index ab887209866..ee301379f21 100644 --- a/data-otservbr-global/startup/tables/lever.lua +++ b/data-otservbr-global/startup/tables/lever.lua @@ -129,6 +129,20 @@ LeverAction = { { x = 32576, y = 31862, z = 14 }, }, }, + -- The Dream Courts Quest + [23110] = { + itemId = 9111, + itemPos = { + {x = 33637, y = 32562, z = 13}, + }, + }, + [23112] = { + itemId = 8911, + itemPos = { + { x = 32212, y = 32069, z = 15 }, + { x = 32208, y = 32020, z = 13 }, + }, + }, -- Forgotten Knowledge Quest [26663] = { itemId = 9125, diff --git a/data-otservbr-global/world/otservbr-monster.xml b/data-otservbr-global/world/otservbr-monster.xml index 424e4210b80..cf0a71fb1f5 100644 --- a/data-otservbr-global/world/otservbr-monster.xml +++ b/data-otservbr-global/world/otservbr-monster.xml @@ -68038,7 +68038,7 @@ - + From 3a864da7ab8fce3dc8bb76441765842eff68347f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 31 Oct 2024 17:34:53 +0000 Subject: [PATCH 02/22] Lua code format - (Stylua) --- data-otservbr-global/lib/core/quests.lua | 17 +- .../bosses/izcandar_champion_of_summer.lua | 4 +- .../bosses/izcandar_champion_of_winter.lua | 4 +- .../bosses/malofur_mangrinder.lua | 1 - .../scripts/lib/register_actions.lua | 2 +- .../actions_acidFishingRod.lua | 2 +- .../actions_bookOnTable.lua | 8 +- .../actions_chargedCompass.lua | 4 +- .../actions_containerRewards.lua | 34 +-- .../actions_dreamTalisman.lua | 18 +- .../actions_dreamcatcher_curse.lua | 4 +- .../actions_dreamscarLevers.lua | 49 +++-- .../actions_facelessLever.lua | 11 +- .../actions_goldenAxe.lua | 3 +- .../actions_goldenIdol.lua | 2 +- .../actions_idolCheck.lua | 4 +- .../actions_questDoors.lua | 37 ++-- .../actions_sacrophagusUse.lua | 4 +- .../actions_sequenceBooks.lua | 8 +- .../actions_sequenceSkulls.lua | 6 +- .../actions_strangeBucket.lua | 6 +- .../actions_sunFruit.lua | 4 +- .../creaturescripts_Izcandar.lua | 14 +- .../creaturescripts_dreamCourtsDeath.lua | 32 +-- .../creaturescripts_facelessBane.lua | 4 +- .../creaturescripts_nightmareCurse.lua | 72 +++---- .../globalevents_dreamCourts.lua | 4 +- .../globalevents_dream_courts_worldchange.lua | 29 ++- .../movements_acessTeleports.lua | 26 +-- .../movements_corruptedNature.lua | 2 +- .../movements_courtsEntrance.lua | 40 ++-- .../movements_crackedTile.lua | 8 +- .../movements_facelessTiles.lua | 2 +- .../movements_spiderSummon.lua | 2 +- .../spells_alptramun_summon.lua | 10 +- .../spells_cold_of_winter.lua | 8 +- .../spells_generator_wave.lua | 18 +- .../spells_heat_of_summer.lua | 10 +- .../spells_malofur_explosion.lua | 66 +++--- .../spells_maxxenius_energy_elemental.lua | 53 ++++- .../spells_nightmare_beast_curse.lua | 8 +- .../spells_plagueroot_skill_reducer.lua | 2 +- .../spells_plagueroot_teleport.lua | 45 ++-- .../spells_plant_abomination_wave.lua | 14 +- .../spells_plant_attendant_wave.lua | 6 +- data-otservbr-global/startup/tables/item.lua | 202 +++++++++--------- data-otservbr-global/startup/tables/lever.lua | 2 +- 47 files changed, 481 insertions(+), 430 deletions(-) diff --git a/data-otservbr-global/lib/core/quests.lua b/data-otservbr-global/lib/core/quests.lua index f2a984ddcdb..63b085a8ff1 100644 --- a/data-otservbr-global/lib/core/quests.lua +++ b/data-otservbr-global/lib/core/quests.lua @@ -6645,7 +6645,9 @@ if not Quests then startValue = 1, endValue = 3, states = { - [1] = function(player)return string.format("You already got %d/8 energized ward stones.", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count), 0)) end, + [1] = function(player) + return string.format("You already got %d/8 energized ward stones.", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count), 0)) + end, [2] = "You must kill the Nightmare Beast.", [3] = "By defeating the dreadful Nightmare Beast you did the Winter Court and the Summer Court alike a great favor. From now on, the dream elves will regard you as a friend.", }, @@ -6669,7 +6671,14 @@ if not Quests then startValue = 1, endValue = 6, states = { - [1] = function(player)return string.format("A tormented soul trusted you with the secret of this house: join the passages to the three dungeons it connects to reveal a hidden portal within!\n\nCellar %d/1\nTemple %d/1\nTomb %d/1", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar), 0), math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple), 0), math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb), 0)) end, + [1] = function(player) + return string.format( + "A tormented soul trusted you with the secret of this house: join the passages to the three dungeons it connects to reveal a hidden portal within!\n\nCellar %d/1\nTemple %d/1\nTomb %d/1", + math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar), 0), + math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple), 0), + math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb), 0) + ) + end, [2] = "Part I - burried catedral", [3] = "Part II - puzzle dos livros", [4] = "Part III - bosses", @@ -6684,7 +6693,9 @@ if not Quests then startValue = 1, endValue = 2, states = { - [1] = function(player)return string.format("You already got %d/7 secret keys.", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count), 0)) end, + [1] = function(player) + return string.format("You already got %d/7 secret keys.", math.max(player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count), 0)) + end, [2] = "You found the seven keys to unlock the Seven Dream Doors in the Labyrinth of Summer's and Winter's Dreams.", }, }, diff --git a/data-otservbr-global/monster/bosses/izcandar_champion_of_summer.lua b/data-otservbr-global/monster/bosses/izcandar_champion_of_summer.lua index f1f0f827c36..af2b7d549aa 100644 --- a/data-otservbr-global/monster/bosses/izcandar_champion_of_summer.lua +++ b/data-otservbr-global/monster/bosses/izcandar_champion_of_summer.lua @@ -65,7 +65,7 @@ monster.light = { monster.voices = { interval = 5000, chance = 10, - {text = "Dream or nightmare?", yell = false}, + { text = "Dream or nightmare?", yell = false }, } monster.loot = { @@ -115,7 +115,7 @@ monster.attacks = { monster.defenses = { defense = 76, armor = 76, - {name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 310, maxDamage = 640, effect = CONST_ME_REDSPARK}, + { name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 310, maxDamage = 640, effect = CONST_ME_REDSPARK }, } monster.elements = { diff --git a/data-otservbr-global/monster/bosses/izcandar_champion_of_winter.lua b/data-otservbr-global/monster/bosses/izcandar_champion_of_winter.lua index be1e0e89ad9..9ede1095581 100644 --- a/data-otservbr-global/monster/bosses/izcandar_champion_of_winter.lua +++ b/data-otservbr-global/monster/bosses/izcandar_champion_of_winter.lua @@ -65,7 +65,7 @@ monster.light = { monster.voices = { interval = 5000, chance = 10, - {text = "Dream or nightmare?", yell = false}, + { text = "Dream or nightmare?", yell = false }, } monster.loot = { @@ -115,7 +115,7 @@ monster.attacks = { monster.defenses = { defense = 76, armor = 76, - {name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 310, maxDamage = 640, effect = CONST_ME_MAGIC_BLUE}, + { name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 310, maxDamage = 640, effect = CONST_ME_MAGIC_BLUE }, } monster.elements = { diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua index 11bdbeed63d..02d613095da 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/malofur_mangrinder.lua @@ -20,7 +20,6 @@ monster.corpse = 30017 monster.speed = 125 monster.manaCost = 0 - monster.events = { "dreamCourtsDeath", } diff --git a/data-otservbr-global/scripts/lib/register_actions.lua b/data-otservbr-global/scripts/lib/register_actions.lua index 52945299144..8df1b85a212 100644 --- a/data-otservbr-global/scripts/lib/register_actions.lua +++ b/data-otservbr-global/scripts/lib/register_actions.lua @@ -77,7 +77,7 @@ local secret_library = { local oldTable = { Position(32005, 32002, 14), Position(32005, 32003, 14), Position(32006, 32002, 14), Position(32006, 32003, 14) } local foundItems = { { id = 29992, quantity = 1 }, - { id = 953, quantity = 4 } + { id = 953, quantity = 4 }, } local storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Lock diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua index d29a999101d..3d89eb52136 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua @@ -28,4 +28,4 @@ function actions_acidFishingRod.onUse(player, item, fromPosition, target, toPosi end actions_acidFishingRod:id(29950) -actions_acidFishingRod:register() \ No newline at end of file +actions_acidFishingRod:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua index bda07311e8a..a2e4a930059 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua @@ -11,15 +11,15 @@ function actions_bookOnTable.onUse(player, item, fromPosition, target, toPositio if player:getStorageValue(questline) == 2 and player:getStorageValue(wordsCount) >= 4 then player:setStorageValue(questline, 3) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'This book tells you about a spell that draws its wielder towards the most energetic being next to him.') - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It consists of four parts wich have been scratched out of this book. They need to be read in conjunction with chants.') + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This book tells you about a spell that draws its wielder towards the most energetic being next to him.") + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It consists of four parts wich have been scratched out of this book. They need to be read in conjunction with chants.") elseif player:getStorageValue(questline) >= 4 then if player:getStorageValue(facelessTime) > os.time() then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have to wait to challange this enemy again!') + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to wait to challange this enemy again!") return true else player:teleportTo(Position(33640, 32561, 13)) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'All chants have been sung in the right order, you are deemed worthy. You are transported away...') + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "All chants have been sung in the right order, you are deemed worthy. You are transported away...") player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) end end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua index e5a265e0e50..574dbaea545 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua @@ -28,7 +28,7 @@ function actions_chargedCompass.onUse(player, item, fromPosition, target, toPosi target:getPosition():sendMagicEffect(CONST_ME_THUNDER) target:transform(29335) item:transform(29291) - addEvent(revertStone, 1000*30, tPos, 33828, 33827) + addEvent(revertStone, 1000 * 30, tPos, 33828, 33827) end end @@ -36,4 +36,4 @@ function actions_chargedCompass.onUse(player, item, fromPosition, target, toPosi end actions_chargedCompass:id(29294) -actions_chargedCompass:register() \ No newline at end of file +actions_chargedCompass:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua index 4704efec079..ca1f2018d1f 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua @@ -1,11 +1,11 @@ -local containers = { +local containers = { [1] = { uniqueid = 23102, cPosition = Position(32736, 32282, 8), storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.skeletonContainer, value = 1, reward = 29310, - defaultItem = true + defaultItem = true, }, [2] = { uniqueid = 23103, @@ -13,7 +13,7 @@ local containers = { storage = Storage.Quest.U12_00.TheDreamCourts.Main.courtChest, value = 1, reward = 30146, - defaultItem = true + defaultItem = true, }, [3] = { uniqueid = 23104, @@ -21,7 +21,7 @@ local containers = { storage = Storage.Quest.U12_00.TheDreamCourts.Main.courtChest, value = 1, reward = 30146, - defaultItem = true + defaultItem = true, }, [4] = { uniqueid = 23105, @@ -29,7 +29,7 @@ local containers = { storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.fishingRod, value = 1, reward = 29950, - defaultItem = true + defaultItem = true, }, [5] = { uniqueid = 23106, @@ -37,7 +37,7 @@ local containers = { storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.barrelWord, value = 1, defaultItem = false, - text = "The inside of this barrel's lid has a word written onto it: 'O'kteth'." + text = "The inside of this barrel's lid has a word written onto it: 'O'kteth'.", }, [6] = { uniqueid = 23107, @@ -45,7 +45,7 @@ local containers = { storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.estatueWord, value = 1, defaultItem = false, - text = "This statue has a word written on her hand: 'N'ogalu'." + text = "This statue has a word written on her hand: 'N'ogalu'.", }, [7] = { uniqueid = 23108, @@ -53,7 +53,7 @@ local containers = { storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.bedWord, value = 1, defaultItem = false, - text = "This end of the bed has a stack of notes hidden under it. There is only one word on all of them: 'T'sough'." + text = "This end of the bed has a stack of notes hidden under it. There is only one word on all of them: 'T'sough'.", }, [8] = { uniqueid = 23109, @@ -61,7 +61,7 @@ local containers = { storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Rosebush, value = 1, reward = 29993, - defaultItem = true + defaultItem = true, }, [9] = { uniqueid = 23110, @@ -69,7 +69,7 @@ local containers = { storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Mushroom, value = 1, reward = 30009, - defaultItem = true + defaultItem = true, }, [10] = { uniqueid = 23111, @@ -77,7 +77,7 @@ local containers = { storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Book, value = 1, reward = 29991, - defaultItem = true + defaultItem = true, }, [11] = { uniqueid = 23112, @@ -85,7 +85,7 @@ local containers = { storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.OrcSkull, value = 1, reward = 29989, - defaultItem = true + defaultItem = true, }, [12] = { uniqueid = 23113, @@ -93,7 +93,7 @@ local containers = { storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Recipe, value = 1, reward = 30147, - defaultItem = true + defaultItem = true, }, [13] = { uniqueid = 23114, @@ -101,15 +101,15 @@ local containers = { storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MinotaurSkull, value = 1, reward = 29988, - defaultItem = true + defaultItem = true, }, - [14] = { + [14] = { uniqueid = 23115, cPosition = Position(32054, 31936, 13), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.trollSkull, value = 1, reward = 29990, - defaultItem = true + defaultItem = true, }, } @@ -122,7 +122,7 @@ function actions_containerRewards.onUse(player, item, fromPosition, target, toPo if iPos == k.cPosition and item:getUniqueId() == k.uniqueid then if player:getStorageValue(k.storage) < k.value then if k.defaultItem then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a " .. ItemType(k.reward):getName() ..".") + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a " .. ItemType(k.reward):getName() .. ".") player:addItem(k.reward, 1) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, k.text) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua index db90128b533..c61df597305 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua @@ -4,42 +4,42 @@ local config = { off = 29336, hisPosition = Position(32251, 31386, 5), hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.okolnirStone, - hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light." + hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.", }, [2] = { on = 29337, off = 29336, hisPosition = Position(31939, 31653, 10), hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.foldaStone, - hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light." + hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.", }, [3] = { on = 29337, off = 29336, hisPosition = Position(32058, 32792, 13), hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.calassaStone, - hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light." + hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.", }, [4] = { on = 29335, off = 29334, hisPosition = Position(33555, 32220, 7), hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.feyristStone, - hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light." + hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.", }, [5] = { on = 29335, off = 29334, hisPosition = Position(32383, 32610, 7), hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.merianaStone, - hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light." + hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.", }, [6] = { on = 29335, off = 29334, hisPosition = Position(33273, 31997, 7), hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.cormayaStone, - hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light." + hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.", }, [7] = { on = 29335, @@ -47,7 +47,7 @@ local config = { hisPosition = Position(33576, 32537, 15), hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.catedralStone, hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.", - lastStone = true + lastStone = true, }, } @@ -84,7 +84,7 @@ function actions_dreamTalisman.onUse(player, item, fromPosition, target, toPosit target:getPosition():sendMagicEffect(CONST_ME_THUNDER) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, k.hisMessage) target:transform(k.on) - addEvent(revertStone, 1000*30, target:getPosition(), k.on, k.off) + addEvent(revertStone, 1000 * 30, target:getPosition(), k.on, k.off) end end end @@ -93,4 +93,4 @@ function actions_dreamTalisman.onUse(player, item, fromPosition, target, toPosit end actions_dreamTalisman:id(30132) -actions_dreamTalisman:register() \ No newline at end of file +actions_dreamTalisman:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua index 6bda5071858..80eb86cba18 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua @@ -39,11 +39,11 @@ function actions_dreamcatcher_curse.onUse(player, item, fromPosition, target, to if item.itemid == 29274 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can rip off a dream catcher!") item:transform(29275) - local newItem = Game.createItem(maskId, 1, Position(item:getPosition().x, item:getPosition().y+1, item:getPosition().z)) + local newItem = Game.createItem(maskId, 1, Position(item:getPosition().x, item:getPosition().y + 1, item:getPosition().z)) if newItem then newItem:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT) end - addEvent(placeMask, 10*1000, item:getPosition(), 29274, 29275) + addEvent(placeMask, 10 * 1000, item:getPosition(), 29274, 29275) elseif item.itemid == 29276 then if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse) < 1 then if (target ~= player) and target:isPlayer() then diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua index 79e91ca74ce..e1c29e81166 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua @@ -1,10 +1,13 @@ local transform = { [9110] = 9111, - [9111] = 9110 + [9111] = 9110, } local bossNames = { - "plagueroot", "izcandar the banished", "izcandar champion of summer", "izcandar champion of winter" + "plagueroot", + "izcandar the banished", + "izcandar champion of summer", + "izcandar champion of winter", } local leverInfo = { @@ -22,7 +25,7 @@ local leverInfo = { teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer, }, [2] = { byDay = "Tuesday", @@ -38,7 +41,7 @@ local leverInfo = { teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, }, [3] = { byDay = "Wednesday", @@ -54,7 +57,7 @@ local leverInfo = { teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer, }, [4] = { byDay = "Thursday", @@ -70,7 +73,7 @@ local leverInfo = { teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, }, [5] = { byDay = "Friday", @@ -86,7 +89,7 @@ local leverInfo = { teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, }, [6] = { byDay = "Saturday", @@ -102,7 +105,7 @@ local leverInfo = { teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer, }, [7] = { byDay = "Sunday", @@ -118,7 +121,7 @@ local leverInfo = { teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, }, } @@ -142,14 +145,18 @@ local function spawnSummons(k, monsterName, eventName, timing, positionTable, mi if k <= 4 then for i = 1, #positionTable do local sqm = positionTable[i] - if sqm then sqm:sendMagicEffect(CONST_ME_TELEPORT) end + if sqm then + sqm:sendMagicEffect(CONST_ME_TELEPORT) + end end k = k + 1 - addEvent(spawnSummons, 2*1000, k, monsterName, eventName, timing, positionTable, middlePosition) + addEvent(spawnSummons, 2 * 1000, k, monsterName, eventName, timing, positionTable, middlePosition) else for i = 1, #positionTable do local monster = Game.createMonster(monsterName, positionTable[i], true, true) - if monster and eventName then monster:registerEvent(eventName) end + if monster and eventName then + monster:registerEvent(eventName) + end end addEvent(function() spawnSummons(1, monsterName, eventName, timing, positionTable, middlePosition) @@ -181,13 +188,13 @@ local whirlingBlades = { Position(32214, 32043, 14), Position(32214, 32049, 14), Position(32214, 32049, 14), - Position(32213, 32052, 14) + Position(32213, 32052, 14), } local plantAttendants = { Position(32204, 32047, 14), Position(32212, 32043, 14), - Position(32212, 32050, 14) + Position(32212, 32050, 14), } local coldOfWinter = { @@ -251,7 +258,7 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos table.insert(playersTable, c:getId()) c:teleportTo(lastBoss.teleportTo) c:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - c:setStorageValue(lastBoss.storageTimer, os.time() + 20*60*60) + c:setStorageValue(lastBoss.storageTimer, os.time() + 20 * 60 * 60) end end end @@ -259,12 +266,12 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos local monster = Game.createMonster(lastBoss.bossName, lastBoss.bossPosition, true, true) if monster then - monster:registerEvent('dreamCourtsDeath') + monster:registerEvent("dreamCourtsDeath") end Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) - addEvent(kickPlayersAfterTime, 30*60*1000, playersTable, lastBoss.roomFromPosition, lastBoss.roomToPosition, lastBoss.exitPosition) + addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, lastBoss.roomFromPosition, lastBoss.roomToPosition, lastBoss.exitPosition) else return true end @@ -282,7 +289,7 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos if creature and creature:isPlayer() then creature:teleportTo(leverTable.teleportTo, true) creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - creature:setStorageValue(leverTable.storageTimer, os.time() + 20*60*60) + creature:setStorageValue(leverTable.storageTimer, os.time() + 20 * 60 * 60) table.insert(playersTable, creature:getId()) end end @@ -293,7 +300,7 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos if creature and creature:isPlayer() then creature:teleportTo(leverTable.teleportTo, true) creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - creature:setStorageValue(leverTable.storageTimer, os.time() + 20*60*60) + creature:setStorageValue(leverTable.storageTimer, os.time() + 20 * 60 * 60) table.insert(playersTable, creature:getId()) end end @@ -306,7 +313,7 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos local generators = { Position(32205, 32048, 14), Position(32210, 32045, 14), - Position(32210, 32051, 14) + Position(32210, 32051, 14), } for i = 1, #generators do @@ -345,7 +352,7 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos addEvent(startFight, 30 * 1000, leverTable.teleportTo, leverTable.bossPosition) end - addEvent(kickPlayersAfterTime, 30*60*1000, playersTable, leverTable.roomFromPosition, leverTable.roomToPosition, leverTable.exitPosition) + addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, leverTable.roomFromPosition, leverTable.roomToPosition, leverTable.exitPosition) end end end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua index eb1d2d07b65..08b2839162f 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua @@ -1,6 +1,6 @@ local transform = { [9110] = 9111, - [9111] = 9110 + [9111] = 9110, } local leverInfo = { @@ -17,7 +17,7 @@ local leverInfo = { teleportTo = Position(33617, 32567, 13), typePush = "x", exitPosition = Position(33619, 32522, 15), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTimer + globalTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTimer, }, } @@ -47,20 +47,19 @@ function actions_facelessLever.onUse(player, item, fromPosition, target, toPosit if creature and creature:isPlayer() then creature:teleportTo(leverTable.teleportTo) creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - creature:setStorageValue(leverInfo.storageTimer, os.time() + 20*60*60) + creature:setStorageValue(leverInfo.storageTimer, os.time() + 20 * 60 * 60) table.insert(playersTable, creature:getId()) end end elseif leverTable.typePush == "y" then for i = leverTable.leverFromPos.y, leverTable.leverToPos.y do - local newPos = Position(leverTable.leverFromPos.x, i, leverTable.leverFromPos.z) local creature = Tile(newPos):getTopCreature() if creature and creature:isPlayer() then creature:teleportTo(leverTable.teleportTo) creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - creature:setStorageValue(leverInfo.storageTimer, os.time() + 20*60*60) + creature:setStorageValue(leverInfo.storageTimer, os.time() + 20 * 60 * 60) table.insert(playersTable, creature:getId()) end end @@ -77,7 +76,7 @@ function actions_facelessLever.onUse(player, item, fromPosition, target, toPosit monster:registerEvent("dreamCourtsDeath") end - addEvent(kickPlayersAfterTime, 30*60*1000, playersTable, leverTable.roomFromPosition, leverTable.roomToPosition, leverTable.exitPosition) + addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, leverTable.roomFromPosition, leverTable.roomToPosition, leverTable.exitPosition) end end end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua index 8962bf8c0ad..bde57709505 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua @@ -19,7 +19,6 @@ local thirdFloor = { [4] = { hisPosition = Position(32789, 32613, 10) }, } - local function setActionId(itemid, position, aid) local crystal = Tile(position):getItemById(itemid) @@ -40,7 +39,7 @@ local function tryCrystal(player, itemid, position, actionid, message, rewardid) player:say(message, TALKTYPE_MONSTER_SAY) player:addItem(rewardid, 1) crystal:setActionId(0) - addEvent(setActionId, 1000*30, itemid, position, actionid) + addEvent(setActionId, 1000 * 30, itemid, position, actionid) else crystal:getPosition():sendMagicEffect(CONST_ME_POFF) end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua index 6cccd5d7bec..e0a867468f3 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua @@ -23,7 +23,7 @@ function actions_goldenIdol.onUse(player, item, fromPosition, target, toPosition item:remove(1) Game.createItem(blockedItem, 1, altar.position) tPos:sendMagicEffect(CONST_ME_POFF) - player:say('**placing idol**', TALKTYPE_MONSTER_SAY) + player:say("**placing idol**", TALKTYPE_MONSTER_SAY) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There is already an idol here. Try another altar.") end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua index 2c3e9151848..29ea48d18b1 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua @@ -35,7 +35,7 @@ function actions_idolCheck.onUse(player, item, fromPosition, target, toPosition, end if count == 4 then - addEvent(cleanIdols, 1*60*1000) + addEvent(cleanIdols, 1 * 60 * 1000) local spectators = Game.getSpectators(item:getPosition(), false, true, 12, 12, 12, 12) @@ -47,7 +47,7 @@ function actions_idolCheck.onUse(player, item, fromPosition, target, toPosition, end end - player:say('REPLACING THE IDOLS FEEDS THE PORTAL BUT DOES NOT FREE ONE FROM THE SACRILEGE OF TAKING THEM AWAY FROM TUKH!', TALKTYPE_MONSTER_SAY) + player:say("REPLACING THE IDOLS FEEDS THE PORTAL BUT DOES NOT FREE ONE FROM THE SACRILEGE OF TAKING THEM AWAY FROM TUKH!", TALKTYPE_MONSTER_SAY) end return true diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua index f4939e9c10b..860d7bc8b7a 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua @@ -2,85 +2,86 @@ local doors = { [1] = { doorPosition = Position(32761, 32630, 7), storage = Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, - value = 1 + value = 1, }, [2] = { doorPosition = Position(32700, 32244, 9), storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, - value = 1 + value = 1, }, [3] = { doorPosition = Position(32700, 32255, 9), storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, - value = 1 + value = 1, }, [4] = { doorPosition = Position(32700, 32275, 8), storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, - value = 1 + value = 1, }, [5] = { doorPosition = Position(32719, 32264, 8), storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar, - value = 1 + value = 1, }, [6] = { doorPosition = Position(33088, 32388, 8), storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, - value = 1 + value = 1, }, [7] = { doorPosition = Position(32606, 32629, 9), - storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple, value = -1, - help = "Tomb" + storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple, + value = -1, + help = "Tomb", }, [8] = { doorPosition = Position(32671, 32652, 7), storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, - value = 1 + value = 1, }, [9] = { doorPosition = Position(33625, 32525, 14), storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, - value = 3 + value = 3, }, [10] = { doorPosition = Position(33640, 32551, 14), storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, - value = 3 + value = 3, }, [11] = { doorPosition = Position(33657, 32551, 14), storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, - value = 3 + value = 3, }, [12] = { doorPosition = Position(31983, 31960, 14), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.doorMedusa, value = 1, - help = "Medusa" + help = "Medusa", }, [13] = { doorPosition = Position(32051, 31998, 14), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Mushroom, - value = 2 + value = 2, }, [14] = { doorPosition = Position(32074, 31974, 14), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.sequenceSkulls, - value = 3 + value = 3, }, [15] = { doorPosition = Position(32091, 31970, 14), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, value = 2, - help = "Lock" + help = "Lock", }, [16] = { doorPosition = Position(31983, 32000, 14), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, value = 2, - help = "Open/Close" + help = "Open/Close", }, } @@ -97,7 +98,7 @@ function actions_questDoors.onUse(player, item, fromPosition, target, toPosition local iPos = item:getPosition() for _, p in pairs(doors) do - if (iPos == p.doorPosition) and not(player:getPosition() == p.doorPosition) then + if (iPos == p.doorPosition) and not (player:getPosition() == p.doorPosition) then if p.help == "Tomb" then if player:getStorageValue(p.storage) < p.value then player:teleportTo(toPosition, true) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sacrophagusUse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sacrophagusUse.lua index d9e874e790a..49496f0e86f 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sacrophagusUse.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sacrophagusUse.lua @@ -42,7 +42,7 @@ local function resetActionId(player, itemid, position, actionid, message, reward end check:setActionId(0) - addEvent(setActionId, 1000*30, itemid, position, actionid) + addEvent(setActionId, 1000 * 30, itemid, position, actionid) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The opening of the last sarcophagus still haunts you. Wait some time for your spirits to return.") end @@ -67,7 +67,7 @@ function actions_sacrophagusUse.onUse(player, item, fromPosition, target, toPosi if player:getStorageValue(storage) == 1 and isInQuest < 1 then for _, k in pairs(sacrophagus) do if tPos == k.hisPosition then - resetActionId(player:getId(), tId, tPos, 23104, "You got a "..ItemType(rewardId):getName().."!", rewardId) + resetActionId(player:getId(), tId, tPos, 23104, "You got a " .. ItemType(rewardId):getName() .. "!", rewardId) end end end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua index ee096cb12d4..d8d5f97d71f 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua @@ -5,22 +5,22 @@ local sequence = { [1] = { number = 0, position = Position(33613, 32515, 15), - msg = "The chants in this book often contain the word 'K'muuh'." + msg = "The chants in this book often contain the word 'K'muuh'.", }, [2] = { number = 1, position = Position(33621, 32520, 15), - msg = "The chants in this book often contain the word 'N'ogalu'." + msg = "The chants in this book often contain the word 'N'ogalu'.", }, [3] = { number = 2, position = Position(33616, 32520, 15), - msg = "The chants in this book often contain the word 'O'kteth.'." + msg = "The chants in this book often contain the word 'O'kteth.'.", }, [4] = { number = 3, position = Position(33624, 32515, 15), - msg = "All chants have been sung in the right order, you are deemed worthy. You are transported away..." + msg = "All chants have been sung in the right order, you are deemed worthy. You are transported away...", }, } diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua index 5b7d4b13e1a..40b1cdd56db 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua @@ -8,19 +8,19 @@ local sequence = { id = 29988, number = 0, position = Position(32071, 31977, 14), - msg = "You put the minotaur skull into the coffin within the minotaur skeleton. One of the door's locks clicks." + msg = "You put the minotaur skull into the coffin within the minotaur skeleton. One of the door's locks clicks.", }, [2] = { id = 29989, number = 1, position = Position(32074, 31977, 14), - msg = "You put the orc skull into the coffin within the orc skeleton. One of the door's locks clicks." + msg = "You put the orc skull into the coffin within the orc skeleton. One of the door's locks clicks.", }, [3] = { id = 29990, number = 2, position = Position(32077, 31977, 14), - msg = "You put the minotaur skull into the coffin within the minotaur skeleton. One of the door's locks clicks." + msg = "You put the minotaur skull into the coffin within the minotaur skeleton. One of the door's locks clicks.", }, } diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_strangeBucket.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_strangeBucket.lua index 6f17f0e94db..b72241f251c 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_strangeBucket.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_strangeBucket.lua @@ -25,8 +25,8 @@ function actions_strangeBucket.onUse(player, item, fromPosition, target, toPosit local filled = false local isInQuest = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline) local slimeCondition = createConditionObject(CONDITION_OUTFIT) - setConditionParam(slimeCondition, CONDITION_PARAM_TICKS, 2*60*1000) - addOutfitCondition(slimeCondition, {lookType = 19}) + setConditionParam(slimeCondition, CONDITION_PARAM_TICKS, 2 * 60 * 1000) + addOutfitCondition(slimeCondition, { lookType = 19 }) if isInQuest >= 1 then if tId == mutatedEgg then @@ -56,7 +56,7 @@ function actions_strangeBucket.onUse(player, item, fromPosition, target, toPosit end target:transform(normalEgg) - addEvent(revertEgg, r*1000*60, tPos, mutatedEgg, normalEgg) + addEvent(revertEgg, r * 1000 * 60, tPos, mutatedEgg, normalEgg) end if item.itemid == fullBucket then if target:isPlayer() then diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sunFruit.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sunFruit.lua index 0180197bdf8..c6319c4cf01 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sunFruit.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sunFruit.lua @@ -18,10 +18,10 @@ function actions_sunFruit.onUse(player, item, fromPosition, target, toPosition, local r = math.random(2, 4) player:addItem(fruitId, r) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found some "..ItemType(fruitId):getName().."s.") + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found some " .. ItemType(fruitId):getName() .. "s.") item:transform(29970) item:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - addEvent(placeFruits, 1*60*60*1000, item:getPosition(), 29969, 29970) + addEvent(placeFruits, 1 * 60 * 60 * 1000, item:getPosition(), 29969, 29970) return true end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua index 66288775671..8fd2c7b278e 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua @@ -1,17 +1,19 @@ local sides = { { fromPosition = Position(32208, 32040, 14), toPosition = Position(32216, 32055, 14) }, - { fromPosition = Position(32198, 32039, 14), toPosition = Position(32207, 32055, 14) } + { fromPosition = Position(32198, 32039, 14), toPosition = Position(32207, 32055, 14) }, } local changes = { [1] = "izcandar champion of winter", - [2] = "izcandar champion of summer" + [2] = "izcandar champion of summer", } local function transformIzcandar(cid, name, health, position) local creature = Creature(cid) - if not creature then return true end + if not creature then + return true + end local id = creature:getId() @@ -28,7 +30,9 @@ local function transformIzcandar(cid, name, health, position) addEvent(function(cid_) local c = Creature(cid_) - if not c then return true end + if not c then + return true + end if isInArray({ "izcandar the banished" }, c:getName():lower()) then local h_ = c:getHealth() @@ -45,7 +49,7 @@ local function transformIzcandar(cid, name, health, position) else return true end - end, math.random(10, 20)*1000, id) + end, math.random(10, 20) * 1000, id) end local creaturescripts_Izcandar = CreatureEvent("izcandarThink") diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua index d1b40405d87..804b1faa69c 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua @@ -4,63 +4,63 @@ local questlog = { storageQuestline = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, storageTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTime, middlePosition = Position(33617, 32563, 13), - maxValue = 4 + maxValue = 4, }, [2] = { bossName = "Maxxenius", storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, middlePosition = Position(32208, 32048, 14), - maxValue = 5 + maxValue = 5, }, [3] = { bossName = "Alptramun", storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer, middlePosition = Position(32208, 32048, 14), - maxValue = 5 + maxValue = 5, }, [4] = { bossName = "Izcandar the Banished", storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, middlePosition = Position(32208, 32048, 14), - maxValue = 5 + maxValue = 5, }, [5] = { bossName = "Izcandar Champion of Winter", storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, middlePosition = Position(32208, 32048, 14), - maxValue = 5 + maxValue = 5, }, [6] = { bossName = "Izcandar Champion of Summer", storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, middlePosition = Position(32208, 32048, 14), - maxValue = 5 + maxValue = 5, }, [7] = { bossName = "Plagueroot", storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer, middlePosition = Position(32208, 32048, 14), - maxValue = 5 + maxValue = 5, }, [8] = { bossName = "Malofur Mangrinder", storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer, middlePosition = Position(32208, 32048, 14), - maxValue = 5 + maxValue = 5, }, [9] = { bossName = "The Nightmare Beast", storageQuestline = Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.nightmareTimer, middlePosition = Position(32207, 32045, 15), - maxValue = 2 + maxValue = 2, }, } @@ -68,23 +68,23 @@ local alptramunSummons = { [1] = { name = "unpleasant dream", minValue = 0, - maxValue = 9 + maxValue = 9, }, [2] = { name = "horrible dream", minValue = 9, - maxValue = 18 + maxValue = 18, }, [3] = { name = "nightmarish dream", minValue = 18, - maxValue = 27 + maxValue = 27, }, [4] = { name = "mind-wrecking dream", minValue = 27, - maxValue = 36 - } + maxValue = 36, + }, } local creaturescripts_dreamCourtsDeath = CreatureEvent("dreamCourtsDeath") @@ -114,7 +114,7 @@ function creaturescripts_dreamCourtsDeath.onDeath(creature, corpse, killer, most end end - if cName:lower() == 'alptramun' then + if cName:lower() == "alptramun" then Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled, 0) end end @@ -124,7 +124,7 @@ function creaturescripts_dreamCourtsDeath.onDeath(creature, corpse, killer, most for _, k in pairs(alptramunSummons) do if cName:lower() == k.name then - if summonsKilled >= k.minValue and summonsKilled <= k.maxValue then + if summonsKilled >= k.minValue and summonsKilled <= k.maxValue then Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled, summonsKilled + 1) end end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua index 61b4b00b7b1..e8ab7f48368 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua @@ -9,7 +9,7 @@ function creaturescripts_facelessBane.onThink(creature, interval) end local lifes = creature:getStorageValue(storage) - local percentageHealth = (creature:getHealth()/creature:getMaxHealth())*100 + local percentageHealth = (creature:getHealth() / creature:getMaxHealth()) * 100 if lifes <= 3 then if lifes < 0 then @@ -59,7 +59,7 @@ function creaturescripts_facelessBane.onHealthChange(creature, attacker, primary end end - return primaryDamage, primaryType, secondaryDamage, secondaryType + return primaryDamage, primaryType, secondaryDamage, secondaryType end creaturescripts_facelessBane:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua index 678878bd906..10147f43a49 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua @@ -1,11 +1,11 @@ -local spectreTime = 15*1000 -local phantasmTime = 10*1000 +local spectreTime = 15 * 1000 +local phantasmTime = 10 * 1000 local spectre = createConditionObject(CONDITION_OUTFIT) setConditionParam(spectre, CONDITION_PARAM_TICKS, spectreTime) -addOutfitCondition(spectre, {lookType = 235}) +addOutfitCondition(spectre, { lookType = 235 }) local phantasm = createConditionObject(CONDITION_OUTFIT) setConditionParam(phantasm, CONDITION_PARAM_TICKS, phantasmTime) -addOutfitCondition(phantasm, {lookType = 241}) +addOutfitCondition(phantasm, { lookType = 241 }) local function resetArea() local spectators = Game.getSpectators(Position(32206, 32045, 15), false, true, 14, 14, 14, 14) @@ -23,46 +23,46 @@ local creaturescripts_nightmareCurse = CreatureEvent(Storage.Quest.U12_00.TheDre function creaturescripts_nightmareCurse.onThink(creature, interval) if not creature:isPlayer() then return true - end + end - local player = Player(creature) - local stage = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) + local player = Player(creature) + local stage = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) - if stage == 1 and not player:getCondition(CONDITION_OUTFIT, spectre) then - doAddCondition(player, spectre) + if stage == 1 and not player:getCondition(CONDITION_OUTFIT, spectre) then + doAddCondition(player, spectre) - addEvent(function(cid) - local p = Player(cid) + addEvent(function(cid) + local p = Player(cid) - if p then - p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, 2) - end - end, spectreTime, player:getId()) - elseif stage == 2 and not player:getCondition(CONDITION_OUTFIT, phantasm) then - doAddCondition(player, phantasm) + if p then + p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, 2) + end + end, spectreTime, player:getId()) + elseif stage == 2 and not player:getCondition(CONDITION_OUTFIT, phantasm) then + doAddCondition(player, phantasm) - addEvent(function(cid) - local p = Player(cid) + addEvent(function(cid) + local p = Player(cid) - if p and p:getCondition(CONDITION_OUTFIT, phantasm) then - resetArea() - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) - p:teleportTo(Position(32213, 32083, 15)) - p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, - 1) - p:unregisterEvent(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) - end - end, phantasmTime, player:getId()) - elseif (stage == 1 or stage == 2) and (player:getCondition(CONDITION_OUTFIT, spectre) or player:getCondition(CONDITION_OUTFIT, phantasm)) then - addEvent(function(cid) - local p = Player(cid) + if p and p:getCondition(CONDITION_OUTFIT, phantasm) then + resetArea() + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) + p:teleportTo(Position(32213, 32083, 15)) + p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, -1) + p:unregisterEvent(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) + end + end, phantasmTime, player:getId()) + elseif (stage == 1 or stage == 2) and (player:getCondition(CONDITION_OUTFIT, spectre) or player:getCondition(CONDITION_OUTFIT, phantasm)) then + addEvent(function(cid) + local p = Player(cid) - if p then - p:getPosition():sendMagicEffect(CONST_ME_SLEEP) - end - end, 1*1000, player:getId()) - end + if p then + p:getPosition():sendMagicEffect(CONST_ME_SLEEP) + end + end, 1 * 1000, player:getId()) + end - return true + return true end creaturescripts_nightmareCurse:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dreamCourts.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dreamCourts.lua index c21c8bb3744..ec97b338bba 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dreamCourts.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dreamCourts.lua @@ -32,7 +32,7 @@ local templeEffects = { local maxxeniusEffects = { fromPosition = Position(32200, 32041, 14), toPosition = Position(32217, 32057, 14), - tileId = 9192 + tileId = 9192, } local globalevents_dreamCourts = GlobalEvent("earthTrap") @@ -49,7 +49,7 @@ function globalevents_dreamCourts.onThink(interval) position:sendMagicEffect(CONST_ME_SMALLPLANTS) creature = Tile(position):getTopCreature() if creature and creature:isPlayer() then - doTargetCombatHealth(0, creature, COMBAT_EARTHDAMAGE, -(creature:getHealth()*0.2), -(creature:getHealth()*0.5), CONST_ME_SMALLPLANTS) + doTargetCombatHealth(0, creature, COMBAT_EARTHDAMAGE, -(creature:getHealth() * 0.2), -(creature:getHealth() * 0.5), CONST_ME_SMALLPLANTS) end end end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua index 759c826da3b..525d59b1f39 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua @@ -1,24 +1,23 @@ local config = { - ['Monday'] = 'Alptramun', - ['Tuesday'] = 'Izcandar_the_Banished', - ['Friday'] = 'Malofur_Mangrinder', - ['Thursday'] = 'Maxxenius', - ['Wednesday'] = 'Malofur_Mangrinder', - ['Saturday'] = 'Plagueroot', - ['Sunday'] = 'Maxxenius' + ["Monday"] = "Alptramun", + ["Tuesday"] = "Izcandar_the_Banished", + ["Friday"] = "Malofur_Mangrinder", + ["Thursday"] = "Maxxenius", + ["Wednesday"] = "Malofur_Mangrinder", + ["Saturday"] = "Plagueroot", + ["Sunday"] = "Maxxenius", } - local spawnByDay = true local globalevents_dream_courts_worldchange = GlobalEvent("startupCourts") function globalevents_dream_courts_worldchange.onStartup(interval) if spawnByDay then - print('>> [dream courts] loaded: ' .. config[os.date("%A")]) - Game.loadMap('data/world/worldchanges/dream_courts_bosses/' .. config[os.date("%A")] ..'.otbm') + print(">> [dream courts] loaded: " .. config[os.date("%A")]) + Game.loadMap("data/world/worldchanges/dream_courts_bosses/" .. config[os.date("%A")] .. ".otbm") else - print('>> dream courts boss: not boss today') + print(">> dream courts boss: not boss today") end return true end @@ -29,14 +28,14 @@ local globalevents_dream_courts_worldchange = GlobalEvent("fixCourts") function globalevents_dream_courts_worldchange.onTime(interval) if spawnByDay then - print('>> [dream courts] loaded: ' .. config[os.date("%A")]) - Game.loadMap('data/world/worldchanges/dream_courts_bosses/' .. config[os.date("%A")] ..'.otbm') + print(">> [dream courts] loaded: " .. config[os.date("%A")]) + Game.loadMap("data/world/worldchanges/dream_courts_bosses/" .. config[os.date("%A")] .. ".otbm") else - print('>> dream courts boss: not boss today') + print(">> dream courts boss: not boss today") end return true end globalevents_dream_courts_worldchange:time("00:00") -globalevents_dream_courts_worldchange:register() \ No newline at end of file +globalevents_dream_courts_worldchange:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua index 90f8c9a2544..29e9ef1f9f4 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua @@ -4,21 +4,21 @@ local default = { toPosition = Position(32723, 32270, 8), neededStorage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, value = 2, - blockedText = 'Connect all three gateways to restore the circle of energy sustaining this nexus.' + blockedText = "Connect all three gateways to restore the circle of energy sustaining this nexus.", }, [2] = { itemPosition = Position(32720, 32270, 8), toPosition = Position(33618, 32544, 13), neededStorage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, value = 2, - blockedText = 'Connect all three gateways to restore the circle of energy sustaining this nexus.' + blockedText = "Connect all three gateways to restore the circle of energy sustaining this nexus.", }, [3] = { itemPosition = Position(33619, 32526, 15), toPosition = Position(33619, 32528, 15), neededStorage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, value = 2, - msg = 'You traverse the rubble with ease but more of it falls down behind you, essentially blocking your path once again.' + msg = "You traverse the rubble with ease but more of it falls down behind you, essentially blocking your path once again.", }, } @@ -26,37 +26,37 @@ local dreamScar = { [1] = { day = "Monday", bossName = "Alptramun", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer, }, [2] = { day = "Tuesday", bossName = "Izcandar the Banished", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, }, [3] = { day = "Wednesday", bossName = "Malofur Mangrinder", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer, }, [4] = { day = "Thursday", bossName = "Maxxenius", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, }, [5] = { day = "Friday", bossName = "Izcandar the Banished", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, }, [6] = { day = "Saturday", bossName = "Plagueroot", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer, }, [7] = { day = "Sunday", bossName = "Maxxenius", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, }, } @@ -78,13 +78,13 @@ function movements_acessTeleports.onStepIn(creature, item, position, fromPositio if item:getPosition() == nightmareTeleport then if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount) >= 5 then if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.nightmareTimer) > os.time() then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have to wait to challenge The Nightmare Beast again!') + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to wait to challenge The Nightmare Beast again!") player:teleportTo(fromPosition) else player:teleportTo(Position(32211, 32075, 15)) end else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You can not use this teleport yet.') + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can not use this teleport yet.") player:teleportTo(fromPosition) end end @@ -108,7 +108,7 @@ function movements_acessTeleports.onStepIn(creature, item, position, fromPositio for i = 1, #dreamScar do if os.sdate("%A") == dreamScar[i].day then if player:getStorageValue(dreamScar[i].storageTimer) > os.time() then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have to wait to challenge '..dreamScar[i].bossName..' again!') + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to wait to challenge " .. dreamScar[i].bossName .. " again!") player:teleportTo(fromPosition) else player:teleportTo(Position(32208, 32026, 13)) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_corruptedNature.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_corruptedNature.lua index 5741bab5766..41b85bcd20f 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_corruptedNature.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_corruptedNature.lua @@ -15,7 +15,7 @@ function movements_corruptedNature.onStepIn(creature, item, position, fromPositi local abomination = Game.createMonster("Plant Abomination", cPos) if abomination then - abomination:registerEvent('dreamCourtsDeath') + abomination:registerEvent("dreamCourtsDeath") abomination:say("The vile energy changes the attendant horribly!", TALKTYPE_MONSTER_SAY) end elseif cName:lower() == "plagueroot" then diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_courtsEntrance.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_courtsEntrance.lua index 2dabfa47eee..060d438dd20 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_courtsEntrance.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_courtsEntrance.lua @@ -3,121 +3,121 @@ local config = { hisPosition = Position(33675, 32147, 7), toPosition = Position(32354, 31249, 3), storage = Storage.Quest.U12_00.TheDreamCourts.Main.Questline, - value = 1 + value = 1, }, [2] = { hisPosition = Position(32354, 31247, 3), toPosition = Position(33675, 32149, 7), storage = Storage.Quest.U12_00.TheDreamCourts.Main.Questline, - value = 1 + value = 1, }, [3] = { hisPosition = Position(33672, 32227, 7), toPosition = Position(33584, 32209, 7), storage = Storage.Quest.U12_00.TheDreamCourts.Main.Questline, - value = 1 + value = 1, }, [4] = { hisPosition = Position(33584, 32207, 7), toPosition = Position(33672, 32229, 7), storage = Storage.Quest.U12_00.TheDreamCourts.Main.Questline, - value = 1 + value = 1, }, [5] = { hisPosition = Position(32014, 31946, 13), toPosition = Position(33695, 32189, 5), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, - value = 1 + value = 1, }, [6] = { hisPosition = Position(33695, 32191, 5), toPosition = Position(32014, 31948, 13), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, - value = 1 + value = 1, }, [7] = { hisPosition = Position(32066, 31949, 13), toPosition = Position(33688, 32113, 5), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, - value = 1 + value = 1, }, [8] = { hisPosition = Position(33688, 32111, 5), toPosition = Position(32066, 31951, 13), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, - value = 1 + value = 1, }, [9] = { hisPosition = Position(32016, 32037, 13), toPosition = Position(32057, 32001, 13), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Rosebush, - value = -1 + value = -1, }, [10] = { hisPosition = Position(32055, 32001, 13), toPosition = Position(32016, 32035, 13), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Rosebush, - value = -1 + value = -1, }, [11] = { hisPosition = Position(32041, 32022, 14), toPosition = Position(32042, 31924, 15), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, - value = -1 + value = -1, }, [12] = { hisPosition = Position(32042, 31922, 15), toPosition = Position(32041, 32024, 14), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, - value = -1 + value = -1, }, [13] = { hisPosition = Position(32043, 31954, 15), toPosition = Position(32095, 32038, 13), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, - value = -1 + value = -1, }, [14] = { hisPosition = Position(32042, 31938, 15), toPosition = Position(32208, 32093, 13), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, - value = -1 + value = -1, }, [15] = { hisPosition = Position(32042, 31939, 15), toPosition = Position(32208, 32093, 13), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, - value = -1 + value = -1, }, [16] = { hisPosition = Position(32043, 31938, 15), toPosition = Position(32208, 32093, 13), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, - value = -1 + value = -1, }, [17] = { hisPosition = Position(32043, 31939, 15), toPosition = Position(32208, 32093, 13), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, - value = -1 + value = -1, }, [18] = { hisPosition = Position(32208, 32091, 13), toPosition = Position(32043, 31943, 15), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, - value = -1 + value = -1, }, [19] = { hisPosition = Position(32203, 32078, 14), toPosition = Position(33672, 32118, 7), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, - value = -1 + value = -1, }, [20] = { hisPosition = Position(32217, 32071, 14), toPosition = Position(33718, 32182, 7), storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, - value = -1 + value = -1, }, } diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_crackedTile.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_crackedTile.lua index fe5606d4941..40baa621402 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_crackedTile.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_crackedTile.lua @@ -3,10 +3,12 @@ local movements_crackedTile = MoveEvent() function movements_crackedTile.onStepIn(creature, item, position, fromPosition) local player = Player(creature:getId()) - if not player then return true end + if not player then + return true + end - local min = player:getMaxHealth()*0.2 - local max = player:getMaxHealth()*0.5 + local min = player:getMaxHealth() * 0.2 + local max = player:getMaxHealth() * 0.5 doTargetCombat(0, player, COMBAT_DEATHDAMAGE, -min, -max, CONST_ME_MORTAREA, ORIGIN_NONE) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua index 167a6c1fa7b..45ed31a7ea0 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua @@ -41,7 +41,7 @@ function movements_facelessTiles.onStepIn(creature, item, position, fromPosition Game.setStorageValue(storage, isImmortal + 1) creature:getPosition():sendMagicEffect(CONST_ME_YELLOWENERGY) item:setActionId(0) - addEvent(setActionId, (10*1000), item.itemid, position, 23108) + addEvent(setActionId, (10 * 1000), item.itemid, position, 23108) end return true diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua index ee8908b4baa..241dd183a3e 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua @@ -22,7 +22,7 @@ function movements_spiderSummon.onStepIn(creature, item, position, fromPosition) local r = math.random(1, 10) Game.createMonster(spiderName, position) item:setActionId(0) - addEvent(setActionId, r*(1000*60), item.itemid, position, 23120) + addEvent(setActionId, r * (1000 * 60), item.itemid, position, 23120) end return true diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua index 7f25e724923..ab27dabde4e 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua @@ -9,7 +9,7 @@ local config = { [1] = { name = "unpleasant dream" }, [2] = { name = "horrible dream" }, [3] = { name = "nightmarish dream" }, - [4] = { name = "mind-wrecking dream" } + [4] = { name = "mind-wrecking dream" }, } local maxsummons = 5 @@ -39,9 +39,9 @@ function spell.onCastSpell(creature, var) if #summoncount < maxsummons then for i = 1, randomSummon do local mid = Game.createMonster(monsterName, creature:getPosition()) - if not mid then - return - end + if not mid then + return + end mid:setMaster(creature) mid:registerEvent("dreamCourtsDeath") end @@ -56,4 +56,4 @@ spell:isAggressive(false) spell:blockWalls(true) spell:needTarget(false) spell:needLearn(true) -spell:register() \ No newline at end of file +spell:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_cold_of_winter.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_cold_of_winter.lua index 883f6bb91d4..7d816cd4e87 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_cold_of_winter.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_cold_of_winter.lua @@ -4,9 +4,9 @@ combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SNOWBALL) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) combat:setArea(createCombatArea({ -{0, 1, 0}, -{1, 3, 1}, -{0, 1, 0} + { 0, 1, 0 }, + { 1, 3, 1 }, + { 0, 1, 0 }, })) function spellCallbackColdOfWinter(param) @@ -43,4 +43,4 @@ spell:isAggressive(false) spell:blockWalls(true) spell:needTarget(false) spell:needLearn(true) -spell:register() \ No newline at end of file +spell:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_generator_wave.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_generator_wave.lua index bc953e2246d..79680c08e79 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_generator_wave.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_generator_wave.lua @@ -3,13 +3,13 @@ combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA) combat:setArea(createCombatArea({ -{0, 0, 0, 1, 0, 0, 0}, -{0, 0, 1, 1, 1, 0, 0}, -{0, 1, 1, 1, 1, 1, 0}, -{1, 1, 1, 3, 1, 1, 1}, -{0, 1, 1, 1, 1, 1, 0}, -{0, 0, 1, 1, 1, 0, 0}, -{0, 0, 0, 1, 0, 0, 0} + { 0, 0, 0, 1, 0, 0, 0 }, + { 0, 0, 1, 1, 1, 0, 0 }, + { 0, 1, 1, 1, 1, 1, 0 }, + { 1, 1, 1, 3, 1, 1, 1 }, + { 0, 1, 1, 1, 1, 1, 0 }, + { 0, 0, 1, 1, 1, 0, 0 }, + { 0, 0, 0, 1, 0, 0, 0 }, })) function spellCallbackGenerator(param) @@ -17,7 +17,7 @@ function spellCallbackGenerator(param) if sqm then local monster = sqm:getTopCreature() - if monster and monster:getName():lower() == 'maxxenius' then + if monster and monster:getName():lower() == "maxxenius" then doTargetCombatHealth(0, monster, COMBAT_ENERGYDAMAGE, -999, -1999, CONST_ME_ENERGYAREA) end end @@ -46,4 +46,4 @@ spell:needDirection(false) spell:isSelfTarget(true) spell:needTarget(false) spell:needLearn(true) -spell:register() \ No newline at end of file +spell:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_heat_of_summer.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_heat_of_summer.lua index 0edfa5caa60..60f8c096ec2 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_heat_of_summer.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_heat_of_summer.lua @@ -3,11 +3,11 @@ combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) combat:setArea(createCombatArea({ -{0, 1, 0}, -{0, 1, 0}, -{0, 1, 0}, -{0, 1, 0}, -{0, 3, 0} + { 0, 1, 0 }, + { 0, 1, 0 }, + { 0, 1, 0 }, + { 0, 1, 0 }, + { 0, 3, 0 }, })) function spellCallbackHeatOfSummer(param) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_malofur_explosion.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_malofur_explosion.lua index 74e51fa45a9..5d3a743976e 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_malofur_explosion.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_malofur_explosion.lua @@ -3,9 +3,9 @@ BOOOM:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) BOOOM:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER) BOOOM:setFormula(COMBAT_FORMULA_DAMAGE, -200, -600, -10000, -20000) BOOOM:setArea(createCombatArea({ - {0, 1, 1, 1, 0}, - {0, 1, 3, 1, 0}, - {0, 1, 1, 1, 0}, + { 0, 1, 1, 1, 0 }, + { 0, 1, 3, 1, 0 }, + { 0, 1, 1, 1, 0 }, })) local BOOOOM = Combat() @@ -13,13 +13,13 @@ BOOOOM:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) BOOOOM:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER) BOOOOM:setFormula(COMBAT_FORMULA_DAMAGE, -200, -600, -10000, -20000) BOOOOM:setArea(createCombatArea({ - {0, 0, 0, 0, 0, 0, 0}, - {0, 0, 1, 1, 1, 0, 0}, - {0, 1, 1, 1, 1, 1, 0}, - {0, 1, 1, 3, 1, 1, 0}, - {0, 1, 1, 1, 1, 1, 0}, - {0, 0, 1, 1, 1, 0, 0}, - {0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, 1, 1, 0, 0 }, + { 0, 1, 1, 1, 1, 1, 0 }, + { 0, 1, 1, 3, 1, 1, 0 }, + { 0, 1, 1, 1, 1, 1, 0 }, + { 0, 0, 1, 1, 1, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0 }, })) local BOOOOOM = Combat() @@ -27,13 +27,13 @@ BOOOOOM:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) BOOOOOM:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER) BOOOOOM:setFormula(COMBAT_FORMULA_DAMAGE, -200, -600, -10000, -20000) BOOOOOM:setArea(createCombatArea({ - {0, 0, 1, 1, 1, 0, 0}, - {0, 1, 1, 1, 1, 1, 0}, - {1, 1, 1, 1, 1, 1, 1}, - {1, 1, 1, 3, 1, 1, 1}, - {1, 1, 1, 1, 1, 1, 1}, - {0, 1, 1, 1, 1, 1, 0}, - {0, 0, 1, 1, 1, 0, 0}, + { 0, 0, 1, 1, 1, 0, 0 }, + { 0, 1, 1, 1, 1, 1, 0 }, + { 1, 1, 1, 1, 1, 1, 1 }, + { 1, 1, 1, 3, 1, 1, 1 }, + { 1, 1, 1, 1, 1, 1, 1 }, + { 0, 1, 1, 1, 1, 1, 0 }, + { 0, 0, 1, 1, 1, 0, 0 }, })) local BOOOOOOM = Combat() @@ -41,17 +41,17 @@ BOOOOOOM:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) BOOOOOOM:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER) BOOOOOOM:setFormula(COMBAT_FORMULA_DAMAGE, -200, -600, -10000, -20000) BOOOOOOM:setArea(createCombatArea({ - {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, - {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, - {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, - {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, - {1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1}, - {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, - {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, - {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, - {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0 }, + { 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0 }, + { 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0 }, + { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 }, + { 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1 }, + { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 }, + { 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0 }, + { 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, })) local spell = Spell("instant") @@ -75,7 +75,7 @@ function spell.onCastSpell(creature, var) BOOOM:execute(c, var) c:say("BOOOM!", TALKTYPE_MONSTER_SAY) end - end, 3*1000, creature:getId()) + end, 3 * 1000, creature:getId()) addEvent(function(cid) local c = Creature(cid) @@ -84,7 +84,7 @@ function spell.onCastSpell(creature, var) BOOOOM:execute(c, var) c:say("BOOOOM!", TALKTYPE_MONSTER_SAY) end - end, 5*1000, creature:getId()) + end, 5 * 1000, creature:getId()) addEvent(function(cid) local c = Creature(cid) @@ -93,7 +93,7 @@ function spell.onCastSpell(creature, var) BOOOOOM:execute(c, var) c:say("BOOOOOM!", TALKTYPE_MONSTER_SAY) end - end, 7*1000, creature:getId()) + end, 7 * 1000, creature:getId()) addEvent(function(cid) local c = Creature(cid) @@ -102,7 +102,7 @@ function spell.onCastSpell(creature, var) BOOOOOOM:execute(c, var) c:say("BOOOOOOM!", TALKTYPE_MONSTER_SAY) end - end, 9*1000, creature:getId()) + end, 9 * 1000, creature:getId()) addEvent(function(cid) local c = Creature(cid) @@ -121,4 +121,4 @@ spell:isAggressive(false) spell:blockWalls(true) spell:needTarget(false) spell:needLearn(true) -spell:register() \ No newline at end of file +spell:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_maxxenius_energy_elemental.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_maxxenius_energy_elemental.lua index 7e7d7a85786..927efd9a6e4 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_maxxenius_energy_elemental.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_maxxenius_energy_elemental.lua @@ -1,13 +1,45 @@ local arrayArea = { - {0, -4}, - {-1, -3}, {0, -3}, {1, -3}, - {-2, -2}, {-1, -2}, {0, -2}, {1, -2}, {2, -2}, - {3, -1}, {-2, -1}, {-1, -1}, {0, -1}, {1, -1}, {2, -1}, {3, -1}, - {-4, 0}, {-3, 0}, {-2, 0}, {-1, 0}, {0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, - {-3, 1}, {-2, 1}, {-1, 1}, {0, 1}, {1, 1}, {2, 1}, {3, 1}, - {-2, 2}, {-1, 2}, {0, 2}, {1, 2}, {2, 2}, - {-1, 3}, {0, 3}, {1, 3}, - {0, 4} + { 0, -4 }, + { -1, -3 }, + { 0, -3 }, + { 1, -3 }, + { -2, -2 }, + { -1, -2 }, + { 0, -2 }, + { 1, -2 }, + { 2, -2 }, + { 3, -1 }, + { -2, -1 }, + { -1, -1 }, + { 0, -1 }, + { 1, -1 }, + { 2, -1 }, + { 3, -1 }, + { -4, 0 }, + { -3, 0 }, + { -2, 0 }, + { -1, 0 }, + { 0, 0 }, + { 1, 0 }, + { 2, 0 }, + { 3, 0 }, + { 4, 0 }, + { -3, 1 }, + { -2, 1 }, + { -1, 1 }, + { 0, 1 }, + { 1, 1 }, + { 2, 1 }, + { 3, 1 }, + { -2, 2 }, + { -1, 2 }, + { 0, 2 }, + { 1, 2 }, + { 2, 2 }, + { -1, 3 }, + { 0, 3 }, + { 1, 3 }, + { 0, 4 }, } local area = createCombatArea(arrayArea) @@ -41,7 +73,7 @@ combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL) local looktype = createConditionObject(CONDITION_OUTFIT) setConditionParam(looktype, CONDITION_PARAM_TICKS, 5000) -addOutfitCondition(looktype, {lookType = 290}) +addOutfitCondition(looktype, { lookType = 290 }) local spell = Spell("instant") @@ -66,4 +98,3 @@ spell:blockWalls(true) spell:needTarget(true) spell:needLearn(true) spell:register() - diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua index 3fdf009b8f0..0c486038a71 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua @@ -10,14 +10,14 @@ function spell.onCastSpell(creature, var) for _, k in pairs(players) do local player = Player(k) if player then - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, - 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, -1) end end local newPlayer = Player(players[randomNumber]:getId()) - newPlayer:registerEvent('nightmareCurse') - newPlayer:setStorageValue('nightmareCurse', 1) + newPlayer:registerEvent("nightmareCurse") + newPlayer:setStorageValue("nightmareCurse", 1) newPlayer:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 1) newPlayer:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The beast laid a terrible curse on you!") @@ -31,4 +31,4 @@ spell:isAggressive(false) spell:blockWalls(true) spell:needTarget(true) spell:needLearn(true) -spell:register() \ No newline at end of file +spell:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_skill_reducer.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_skill_reducer.lua index 14bf81c5829..acc9ff01785 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_skill_reducer.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_skill_reducer.lua @@ -27,4 +27,4 @@ spell:isAggressive(false) spell:blockWalls(true) spell:needTarget(false) spell:needLearn(true) -spell:register() \ No newline at end of file +spell:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_teleport.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_teleport.lua index bf04630cca3..7f6075cf177 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_teleport.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_teleport.lua @@ -3,23 +3,22 @@ combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLPLANTS) combat:setArea(createCombatArea({ -{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, -{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, -{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, -{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, -{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, -{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, -{1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1}, -{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, -{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, -{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, -{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, -{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, -{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0} + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1 }, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, })) -function spellCallbackPlaguerootTeleport(param) -end +function spellCallbackPlaguerootTeleport(param) end function onTargetTilePlaguerootTeleport(cid, pos) local param = {} @@ -33,11 +32,11 @@ end setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTilePlaguerootTeleport") local function teleportMonster(creature, centerPos, fromPos, toPos) - local position = {x = math.random(fromPos.x, toPos.x), y = math.random(fromPos.y, toPos.y), z = centerPos.z } + local position = { x = math.random(fromPos.x, toPos.x), y = math.random(fromPos.y, toPos.y), z = centerPos.z } local tile = Tile(Position(position)) local count = 1 - while(not tile or tile:getItemByType(ITEM_TYPE_TELEPORT) or not tile:getGround() or tile:hasFlag(TILESTATE_BLOCKPATH) or tile:hasFlag(TILESTATE_PROTECTIONZONE) or tile:hasFlag(TILESTATE_BLOCKSOLID) or count < 5) do + while not tile or tile:getItemByType(ITEM_TYPE_TELEPORT) or not tile:getGround() or tile:hasFlag(TILESTATE_BLOCKPATH) or tile:hasFlag(TILESTATE_PROTECTIONZONE) or tile:hasFlag(TILESTATE_BLOCKSOLID) or count < 5 do position = Position(math.random(fromPos.x, toPos.x), math.random(fromPos.y, toPos.y), centerPos.z) tile = Tile(position) count = count + 1 @@ -60,22 +59,22 @@ function spell.onCastSpell(creature, var) end local centerPos = creature:getPosition() - local fromPos = {x = centerPos.x - 7, y = centerPos.y - 5, z = centerPos.z} - local toPos = {x = centerPos.x + 7, y = centerPos.y + 5, z = centerPos.z} + local fromPos = { x = centerPos.x - 7, y = centerPos.y - 5, z = centerPos.z } + local toPos = { x = centerPos.x + 7, y = centerPos.y + 5, z = centerPos.z } creature:say("PLAGUEROOT TUNNELS TO ANOTHER PLACE!", TALKTYPE_MONSTER_SAY) teleportMonster(creature, centerPos, fromPos, toPos) - var = {type = 2, pos = {x = creature:getPosition().x, y = creature:getPosition().y, z = creature:getPosition().z}} + var = { type = 2, pos = { x = creature:getPosition().x, y = creature:getPosition().y, z = creature:getPosition().z } } combat:execute(creature, var) addEvent(function() if creature then - var = {type = 2, pos = {x = creature:getPosition().x, y = creature:getPosition().y, z = creature:getPosition().z}} + var = { type = 2, pos = { x = creature:getPosition().x, y = creature:getPosition().y, z = creature:getPosition().z } } combat:execute(creature, var) end - end, 2*1000) + end, 2 * 1000) return true end @@ -86,4 +85,4 @@ spell:isAggressive(false) spell:blockWalls(true) spell:needTarget(false) spell:needLearn(true) -spell:register() \ No newline at end of file +spell:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_abomination_wave.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_abomination_wave.lua index bfec3697cf7..84b2f0e1061 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_abomination_wave.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_abomination_wave.lua @@ -4,16 +4,16 @@ combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYPOISON) combat:setParameter(COMBAT_PARAM_SHOOT, CONST_ANI_EARTH) combat:setArea(createCombatArea({ -{0, 0, 1, 0, 0}, -{0, 1, 1, 1, 0}, -{1, 1, 3, 1, 1}, -{0, 1, 1, 1, 0}, -{0, 0, 1, 0, 0} + { 0, 0, 1, 0, 0 }, + { 0, 1, 1, 1, 0 }, + { 1, 1, 3, 1, 1 }, + { 0, 1, 1, 1, 0 }, + { 0, 0, 1, 0, 0 }, })) function spellCallbackAbominationWave(param) local tile = Tile(Position(param.pos)) - + if tile then if tile:getTopCreature() and tile:getTopCreature():isMonster() then if tile:getTopCreature():getName():lower() == "plagueroot" then @@ -46,4 +46,4 @@ spell:isAggressive(false) spell:blockWalls(true) spell:needTarget(true) spell:needLearn(true) -spell:register() \ No newline at end of file +spell:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_attendant_wave.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_attendant_wave.lua index 34a87306eda..d315e0ff692 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_attendant_wave.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_attendant_wave.lua @@ -3,9 +3,9 @@ combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLPLANTS) combat:setArea(createCombatArea({ -{1, 1, 1}, -{1, 3, 1}, -{1, 1, 1} + { 1, 1, 1 }, + { 1, 3, 1 }, + { 1, 1, 1 }, })) function spellCallbackAttendantWave(param) diff --git a/data-otservbr-global/startup/tables/item.lua b/data-otservbr-global/startup/tables/item.lua index 5fb3368db39..f8188ad3847 100644 --- a/data-otservbr-global/startup/tables/item.lua +++ b/data-otservbr-global/startup/tables/item.lua @@ -1191,65 +1191,65 @@ ItemAction = { [23100] = { itemId = false, itemPos = { - {x = 32217, y = 32071, z = 14}, - {x = 32043, y = 31954, z = 15}, - {x = 32203, y = 32078, z = 14}, - {x = 32066, y = 31949, z = 13}, - {x = 32042, y = 31922, z = 15}, - {x = 32354, y = 31247, z = 3}, - {x = 32055, y = 32001, z = 13}, - {x = 33688, y = 32111, z = 5}, - {x = 32043, y = 31939, z = 15}, - {x = 33675, y = 32147, z = 7}, - {x = 33695, y = 32191, z = 5}, - {x = 33584, y = 32207, z = 7}, - {x = 33672, y = 32227, z = 7}, - {x = 32042, y = 31938, z = 15}, - {x = 32043, y = 31938, z = 15}, - {x = 32014, y = 31946, z = 13}, - {x = 32042, y = 31939, z = 15}, - {x = 32016, y = 32037, z = 13}, - {x = 32041, y = 32022, z = 14}, - {x = 32208, y = 32091, z = 13}, + { x = 32217, y = 32071, z = 14 }, + { x = 32043, y = 31954, z = 15 }, + { x = 32203, y = 32078, z = 14 }, + { x = 32066, y = 31949, z = 13 }, + { x = 32042, y = 31922, z = 15 }, + { x = 32354, y = 31247, z = 3 }, + { x = 32055, y = 32001, z = 13 }, + { x = 33688, y = 32111, z = 5 }, + { x = 32043, y = 31939, z = 15 }, + { x = 33675, y = 32147, z = 7 }, + { x = 33695, y = 32191, z = 5 }, + { x = 33584, y = 32207, z = 7 }, + { x = 33672, y = 32227, z = 7 }, + { x = 32042, y = 31938, z = 15 }, + { x = 32043, y = 31938, z = 15 }, + { x = 32014, y = 31946, z = 13 }, + { x = 32042, y = 31939, z = 15 }, + { x = 32016, y = 32037, z = 13 }, + { x = 32041, y = 32022, z = 14 }, + { x = 32208, y = 32091, z = 13 }, }, }, [23101] = { itemId = false, itemPos = { - {x = 33088, y = 32388, z = 8}, - {x = 32606, y = 32629, z = 9}, - {x = 31983, y = 31960, z = 14}, - {x = 33625, y = 32525, z = 14}, - {x = 33657, y = 32551, z = 14}, - {x = 33640, y = 32551, z = 14}, - {x = 32671, y = 32652, z = 7}, - {x = 32074, y = 31974, z = 14}, - {x = 32091, y = 31970, z = 14}, - {x = 31983, y = 32000, z = 14}, - {x = 32051, y = 31998, z = 14}, - {x = 32700, y = 32255, z = 9}, - {x = 32700, y = 32244, z = 9}, - {x = 32693, y = 32238, z = 8}, - {x = 32700, y = 32275, z = 8}, - {x = 32761, y = 32630, z = 7}, - {x = 32719, y = 32264, z = 8}, + { x = 33088, y = 32388, z = 8 }, + { x = 32606, y = 32629, z = 9 }, + { x = 31983, y = 31960, z = 14 }, + { x = 33625, y = 32525, z = 14 }, + { x = 33657, y = 32551, z = 14 }, + { x = 33640, y = 32551, z = 14 }, + { x = 32671, y = 32652, z = 7 }, + { x = 32074, y = 31974, z = 14 }, + { x = 32091, y = 31970, z = 14 }, + { x = 31983, y = 32000, z = 14 }, + { x = 32051, y = 31998, z = 14 }, + { x = 32700, y = 32255, z = 9 }, + { x = 32700, y = 32244, z = 9 }, + { x = 32693, y = 32238, z = 8 }, + { x = 32700, y = 32275, z = 8 }, + { x = 32761, y = 32630, z = 7 }, + { x = 32719, y = 32264, z = 8 }, }, }, [23102] = { itemId = false, itemPos = { - {x = 32729, y = 32280, z = 8}, - {x = 32729, y = 32279, z = 8}, - {x = 32729, y = 32281, z = 8}, + { x = 32729, y = 32280, z = 8 }, + { x = 32729, y = 32279, z = 8 }, + { x = 32729, y = 32281, z = 8 }, }, }, [23103] = { itemId = false, itemPos = { - {x = 33619, y = 32526, z = 15}, - {x = 32211, y = 32081, z = 15}, - {x = 32720, y = 32270, z = 8}, - {x = 33618, y = 32546, z = 13}, + { x = 33619, y = 32526, z = 15 }, + { x = 32211, y = 32081, z = 15 }, + { x = 32720, y = 32270, z = 8 }, + { x = 33618, y = 32546, z = 13 }, }, }, [23105] = { @@ -1262,15 +1262,15 @@ ItemAction = { [23106] = { itemId = false, itemPos = { - {x = 32616, y = 32620, z = 8}, - {x = 32663, y = 32645, z = 8}, - {x = 32667, y = 32656, z = 8}, - {x = 32662, y = 32658, z = 8}, - {x = 32641, y = 32647, z = 8}, - {x = 32643, y = 32633, z = 8}, - {x = 32640, y = 32631, z = 8}, - {x = 32628, y = 32635, z = 8}, - {x = 32635, y = 32618, z = 8}, + { x = 32616, y = 32620, z = 8 }, + { x = 32663, y = 32645, z = 8 }, + { x = 32667, y = 32656, z = 8 }, + { x = 32662, y = 32658, z = 8 }, + { x = 32641, y = 32647, z = 8 }, + { x = 32643, y = 32633, z = 8 }, + { x = 32640, y = 32631, z = 8 }, + { x = 32628, y = 32635, z = 8 }, + { x = 32635, y = 32618, z = 8 }, }, }, [23107] = { @@ -1282,19 +1282,19 @@ ItemAction = { [23108] = { itemId = false, itemPos = { - {x = 33623, y = 32563, z = 13}, - {x = 33611, y = 32558, z = 13}, - {x = 33619, y = 32567, z = 13}, - {x = 33614, y = 32557, z = 13}, - {x = 33620, y = 32557, z = 13}, - {x = 33623, y = 32558, z = 13}, - {x = 33610, y = 32561, z = 13}, - {x = 33611, y = 32563, z = 13}, - {x = 33624, y = 32561, z = 13}, - {x = 33621, y = 32567, z = 13}, - {x = 33613, y = 32567, z = 13}, - {x = 33617, y = 32558, z = 13}, - {x = 33615, y = 32567, z = 13}, + { x = 33623, y = 32563, z = 13 }, + { x = 33611, y = 32558, z = 13 }, + { x = 33619, y = 32567, z = 13 }, + { x = 33614, y = 32557, z = 13 }, + { x = 33620, y = 32557, z = 13 }, + { x = 33623, y = 32558, z = 13 }, + { x = 33610, y = 32561, z = 13 }, + { x = 33611, y = 32563, z = 13 }, + { x = 33624, y = 32561, z = 13 }, + { x = 33621, y = 32567, z = 13 }, + { x = 33613, y = 32567, z = 13 }, + { x = 33617, y = 32558, z = 13 }, + { x = 33615, y = 32567, z = 13 }, }, }, [23109] = { @@ -1318,27 +1318,27 @@ ItemAction = { [23120] = { itemId = false, itemPos = { - {x = 32772, y = 32644, z = 10}, - {x = 32787, y = 32634, z = 10}, - {x = 32791, y = 32625, z = 10}, - {x = 32769, y = 32613, z = 10}, - {x = 32773, y = 32626, z = 10}, - {x = 32750, y = 32605, z = 10}, - {x = 32751, y = 32638, z = 10}, - {x = 32740, y = 32619, z = 10}, - {x = 32749, y = 32622, z = 10}, - {x = 32785, y = 32603, z = 10}, - {x = 32805, y = 32619, z = 10}, - {x = 32758, y = 32622, z = 10}, - {x = 32756, y = 32632, z = 10}, - {x = 32804, y = 32628, z = 10}, - {x = 32764, y = 32634, z = 10}, - {x = 32779, y = 32636, z = 10}, - {x = 32784, y = 32619, z = 10}, - {x = 32771, y = 32602, z = 10}, - {x = 32770, y = 32621, z = 10}, - {x = 32792, y = 32606, z = 10}, - {x = 32757, y = 32643, z = 10}, + { x = 32772, y = 32644, z = 10 }, + { x = 32787, y = 32634, z = 10 }, + { x = 32791, y = 32625, z = 10 }, + { x = 32769, y = 32613, z = 10 }, + { x = 32773, y = 32626, z = 10 }, + { x = 32750, y = 32605, z = 10 }, + { x = 32751, y = 32638, z = 10 }, + { x = 32740, y = 32619, z = 10 }, + { x = 32749, y = 32622, z = 10 }, + { x = 32785, y = 32603, z = 10 }, + { x = 32805, y = 32619, z = 10 }, + { x = 32758, y = 32622, z = 10 }, + { x = 32756, y = 32632, z = 10 }, + { x = 32804, y = 32628, z = 10 }, + { x = 32764, y = 32634, z = 10 }, + { x = 32779, y = 32636, z = 10 }, + { x = 32784, y = 32619, z = 10 }, + { x = 32771, y = 32602, z = 10 }, + { x = 32770, y = 32621, z = 10 }, + { x = 32792, y = 32606, z = 10 }, + { x = 32757, y = 32643, z = 10 }, }, }, -- Ferumbras' Ascension Quest @@ -2854,59 +2854,59 @@ ItemUnique = { -- Threatened Dreams Quest [23102] = { itemId = 4024, - itemPos = {x = 32736, y = 32282, z = 8}, + itemPos = { x = 32736, y = 32282, z = 8 }, }, [23103] = { itemId = 2471, - itemPos = {x = 33693, y = 32185, z = 8}, + itemPos = { x = 33693, y = 32185, z = 8 }, }, [23104] = { itemId = 29435, - itemPos = {x = 33711, y = 32108, z = 4}, + itemPos = { x = 33711, y = 32108, z = 4 }, }, [23105] = { itemId = 2523, - itemPos = {x = 33578, y = 32527, z = 14}, + itemPos = { x = 33578, y = 32527, z = 14 }, }, [23106] = { itemId = 29952, - itemPos = {x = 33599, y = 32533, z = 14}, + itemPos = { x = 33599, y = 32533, z = 14 }, }, [23107] = { itemId = 29951, - itemPos = {x = 33618, y = 32518, z = 14}, + itemPos = { x = 33618, y = 32518, z = 14 }, }, [23108] = { itemId = 5501, - itemPos = {x = 33638, y = 32507, z = 14}, + itemPos = { x = 33638, y = 32507, z = 14 }, }, [23109] = { itemId = 2478, - itemPos = {x = 33703, y = 32185, z = 5}, + itemPos = { x = 33703, y = 32185, z = 5 }, }, [23110] = { itemId = 25762, - itemPos = {x = 33663, y = 32192, z = 7}, + itemPos = { x = 33663, y = 32192, z = 7 }, }, [23111] = { itemId = 2438, - itemPos = {x = 33671, y = 32203, z = 7}, + itemPos = { x = 33671, y = 32203, z = 7 }, }, [23112] = { itemId = 30145, - itemPos = {x = 33683, y = 32125, z = 6}, + itemPos = { x = 33683, y = 32125, z = 6 }, }, [23113] = { itemId = 28522, - itemPos = {x = 31996, y = 31981, z = 13}, + itemPos = { x = 31996, y = 31981, z = 13 }, }, [23114] = { itemId = 23740, - itemPos = {x = 32017, y = 31981, z = 14}, + itemPos = { x = 32017, y = 31981, z = 14 }, }, [23115] = { itemId = 4077, - itemPos = {x = 32054, y = 31936, z = 13}, + itemPos = { x = 32054, y = 31936, z = 13 }, }, -- The shattered isles [40001] = { diff --git a/data-otservbr-global/startup/tables/lever.lua b/data-otservbr-global/startup/tables/lever.lua index ee301379f21..62c40d05d82 100644 --- a/data-otservbr-global/startup/tables/lever.lua +++ b/data-otservbr-global/startup/tables/lever.lua @@ -133,7 +133,7 @@ LeverAction = { [23110] = { itemId = 9111, itemPos = { - {x = 33637, y = 32562, z = 13}, + { x = 33637, y = 32562, z = 13 }, }, }, [23112] = { From 9f44e80111aa16ecfa0d75eb0f2ce3e92e833a01 Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:27:18 -0300 Subject: [PATCH 03/22] The Dream Courts Quest - part 2 I stopped at "The Seven Keys". --- data-otservbr-global/lib/core/storages.lua | 11 +- .../the_dream_courts/bosses/faceless_bane.lua | 1 - data-otservbr-global/npc/andrew_lyze.lua | 214 ++++++++++++++---- data-otservbr-global/npc/myzzi.lua | 110 +++++++++ data-otservbr-global/npc/stricken_soul.lua | 59 ++++- data-otservbr-global/npc/vanys.lua | 176 +++++++------- .../actions/bosses_levers/faceless_bane.lua | 24 -- .../scripts/actions/other/enchanting.lua | 4 + .../actions_acidFishingRod.lua | 1 + .../actions_bookOnTable.lua | 6 +- .../actions_chargedCompass.lua | 2 +- .../actions_containerRewards.lua | 28 +-- .../actions_doorInvisible.lua | 2 +- .../actions_dreamTalisman.lua | 14 +- .../actions_dreamcatcher_curse.lua | 6 +- .../actions_dreamscarLevers.lua | 40 ++-- .../actions_facelessLever.lua | 12 +- .../actions_goldenAxe.lua | 10 +- .../actions_goldenIdol.lua | 26 +++ .../actions_idolCheck.lua | 57 ----- .../actions_questDoors.lua | 66 +++--- .../actions_sequenceBooks.lua | 2 +- .../actions_sequenceSkulls.lua | 2 +- .../creaturescripts_Izcandar.lua | 4 +- .../creaturescripts_dreamCourtsDeath.lua | 38 ++-- .../creaturescripts_facelessBane.lua | 4 +- .../creaturescripts_nightmareCurse.lua | 8 +- .../movements_acessTeleports.lua | 20 +- .../movements_facelessTiles.lua | 2 +- .../movements_spiderSummon.lua | 3 +- .../spells_alptramun_summon.lua | 2 +- .../spells_nightmare_beast_curse.lua | 8 +- data-otservbr-global/startup/tables/item.lua | 46 ++++ data-otservbr-global/startup/tables/lever.lua | 2 +- .../startup/tables/teleport_item.lua | 7 - data-otservbr-global/world/otservbr-npc.xml | 3 + data/items/items.xml | 1 + 37 files changed, 656 insertions(+), 365 deletions(-) create mode 100644 data-otservbr-global/npc/myzzi.lua delete mode 100644 data-otservbr-global/scripts/actions/bosses_levers/faceless_bane.lua delete mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 7a2b2ac1abc..e1c2f913539 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -2740,6 +2740,7 @@ Storage = { Cellar = 23132, Temple = 23133, Tomb = 23134, + IdolCount = 2313555, }, BurriedCatedral = { FishingRod = 23145, @@ -2755,7 +2756,7 @@ Storage = { TheSevenKeys = { Questline = 23170, RoseBush = 23171, - Mushroom = 23172, + MushRoom = 23172, Book = 23173, OrcSkull = 23174, Recipe = 23175, @@ -2773,20 +2774,20 @@ Storage = { BossCount = 23191, MaxxeniusTimer = 23192, AlptramunTimer = 23193, - PlaguerootTimer = 23194, + PlagueRootTimer = 23194, IzcandarTimer = 23195, MalofurTimer = 23196, NightmareTimer = 23197, LastBossCurse = 23198, }, - BurriedCatedral = { + BurriedCatedralGlobal = { FacelessTiles = 531900, FacelessTimer = 531901, }, - DreamScar = { + DreamScarGlobal = { MaxxeniusTimer = 531902, AlptramunTimer = 531903, - PlaguerootTimer = 531904, + PlagueRootTimer = 531904, IzcandarTimer = 531905, MalofurTimer = 531906, AlptramunSummonsKilled = 531907, diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua index 0f0c768019e..09aac84822e 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/faceless_bane.lua @@ -23,7 +23,6 @@ monster.manaCost = 0 monster.events = { "dreamCourtsDeath", "facelessThink", - "facelessHealth", } monster.changeTarget = { diff --git a/data-otservbr-global/npc/andrew_lyze.lua b/data-otservbr-global/npc/andrew_lyze.lua index 82b1f9a61ce..2438ef792f5 100644 --- a/data-otservbr-global/npc/andrew_lyze.lua +++ b/data-otservbr-global/npc/andrew_lyze.lua @@ -64,6 +64,52 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local brokenCompass = 25746 +local chargeableCompass = 29291 +local chargedCompass = 29294 +local goldenAxe = 29286 +local CompassValue = 10000 + +local buildCompass = { + [1] = {id = 29346, qnt = 15}, + [2] = {id = 29345, qnt = 50}, + [3] = {id = 29347, qnt = 5}, + [4] = {id = 25746, qnt = 1}, +} + +local chargeCompass = { + [1] = {id = 29287, qnt = 5}, + [2] = {id = 29288, qnt = 3}, + [3] = {id = 29289, qnt = 1}, + [4] = {id = 29348, qnt = 1}, + [5] = {id = 29291, qnt = 1}, +} + +local function removeBait(player) + local player = Player(player) + + if player and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait) == 1 then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait, - 1) + end +end + +local function greetCallback(npc, creature) + local player = Player(creature) + local playerId = player:getId() + + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) < 1 then + npcHandler:setMessage(MESSAGE_GREET, "Hello, I am the warden of this {monument}. The {sarcophagus} in front of you was established to prevent people from going {down} there. But I doubt that this step is sufficient.") + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 1 then + npcHandler:setMessage(MESSAGE_GREET, "Well, let's see if your mission was successful. Just bring me all needed {materials}.") + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 2 then + npcHandler:setMessage(MESSAGE_GREET, "If you dug up all three crystals of sufficient quantity and obtained the poison gland, the charging of your compass can start! For the very first time it will be charged by the violet crystal. Ready to {unleash} the power of the crystals?") + else + npcHandler:setMessage(MESSAGE_GREET, "Greetings.") + end + + return true +end + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -72,62 +118,154 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "monument") then + if MsgContains(message, "monument") and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) < 1 then npcHandler:say({ "Well, a while ago powerful magic devices were used all around Tibia. These are chargeable compasses. There was but one problem: they offered the possibility to make people rich in a quite easy way. ...", "Therefore, these instruments were very coveted. People tried to get their hands on them at all costs. And so it happened what everybody feared - bloody battles forged ahead. ...", - "To put an end to these cruel escalations, eventually all of the devices were collected and destroyed. The remains were buried {deep} in the earth.", - }, npc, creature, 10) - npcHandler:setTopic(playerId, 0) - elseif MsgContains(message, "deep") then + "To put an end to these cruel escalations, eventually all of the devices were collected and destroyed. The remains were buried {deep} in the earth." + }, npc, creature) + npcHandler:setTopic(playerId, 2) + elseif MsgContains(message, "deep") and npcHandler:getTopic(playerId) == 2 then npcHandler:say("As far as I know it is a place of helish heat with bloodthirsty monsters of all kinds.", npc, creature) - npcHandler:setTopic(playerId, 0) - elseif MsgContains(message, "sarcophagus") then + npcHandler:setTopic(playerId, 1) + elseif MsgContains(message, "sarcophagus") and npcHandler:getTopic(playerId) == 1 then npcHandler:say("This sarcophagus seals the entrance to the caves down there. Only here you can get all the {materials} you need for a working compass of this kind. So no entrance here - no further magic compasses in Tibia. In theory.", npc, creature) + npcHandler:setTopic(playerId, 4) + elseif MsgContains(message, "down") and npcHandler:getTopic(playerId) == 10 then + npcHandler:say("On first glance, this cave does not look very spectacular, but the things you find in there, are. You have to know that this is the only place where you can find the respective materials to build the compass.", npc, creature) npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "materials") then - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.AndrewDoor) ~= 1 then - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.AndrewDoor, 1) + if npcHandler:getTopic(playerId) == 4 then + npcHandler:say({ + "Only in the cave down there you will find the materials you need to repair the {compass}. Now you know why the entrance is sealed. There's the seal, but I have a deal for you: ...", + "I can repair the compass for you if you deliver what I need. Besides the broken compass you have to bring me the following materials: 50 blue glas plates, 15 green glas plates and 5 violet glas plates. ...", + "They all can be found in this closed cave in front of you. I should have destroyed this seal key but things have changed. The entrance is opened now, go down and do what has to be done." + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, 1) + npcHandler:setTopic(playerId, 0) + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 1 then + npcHandler:say("May I repair your compass if possible?", npc, creature) + npcHandler:setTopic(playerId, 11) + end + elseif MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 11 then + local haveItens = false + + for _, k in pairs(buildCompass) do + if player:getItemCount(k.id) >= k.qnt then + haveItens = true + else + haveItens = false + end + end + + if haveItens then + for _, k in pairs(buildCompass) do + if player:getItemCount(k.id) >= k.qnt then + player:removeItem(k.id, k.qnt) + end + end + + npcHandler:say({ + "Alright, I put the glasses into the right pattern and can repair the compass. ...", + "There we are! The next step is the charging of the compass. For this you have to dig three different crystals down there: 5 blue, 3 green and one violet crystal. Are you ready to do that?" + }, npc, creature) + player:addItem(chargeableCompass, 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, 2) + npcHandler:setTopic(playerId, 12) + else + npcHandler:say("You don't have the needed itens yet.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + elseif npcHandler:getTopic(playerId) == 12 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.GotAxe) < 1 then + npcHandler:say({ + "Nice! To do so, take this golden axe and mine the prominent crystals in the cave. Besides, I need a poison gland of quite rare spiders, they are called lucifuga araneae. ...", + "These are quite shy, but I have a {bait} for you to lure them. But take care not to face too many of them at once. And hurry, the effect won't last forever!" + }, npc, creature) + player:addItem(goldenAxe, 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.GotAxe, 1) + npcHandler:setTopic(playerId, 0) + elseif npcHandler:getTopic(playerId) == 51 then + if (player:getMoney() + player:getBankBalance()) >= CompassValue then + npcHandler:say("Here's your broken compass!", npc, creature) + player:removeMoneyBank(CompassValue) + player:addItem(brokenCompass, 1) + npcHandler:setTopic(playerId, 10) + else + npcHandler:say("You don't have enough money.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + end + elseif MsgContains(message, "unleash") then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 2 then + local haveItens = false + + for _, k in pairs(chargeCompass) do + if player:getItemCount(k.id) >= k.qnt then + haveItens = true + else + haveItens = false + end + end + + if haveItens then + for _, k in pairs(chargeCompass) do + if player:getItemCount(k.id) >= k.qnt then + player:removeItem(k.id, k.qnt) + end + end + + npcHandler:say({ + "I put these crystals onto the top of compass. As you can see, the compass is now pulsating in a warm, violet colour. ...", + "Now this compass is ready for usage. It can transfer the bound energy to other inanimate objects to open certain gates or chests." + }, npc, creature) + player:addItem(chargedCompass, 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, 3) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("You don't have the needed itens yet.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + end + elseif MsgContains(message, "bait") then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline) == 2 then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait) < 1 then + npcHandler:say("Done. Worry, the effect won't last forever!", npc, creature) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait, 1) + addEvent(removeBait, 3*60*1000, player:getId()) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("You're already with my bait!", npc, creature) + npcHandler:setTopic(playerId, 0) + end + else + npcHandler:say("You cannot do that yet.", npc, creature) + npcHandler:setTopic(playerId, 0) end - npcHandler:say({ - "Only in the cave down there you will find the materials you need to repair the compass. Now you know why the entrance is sealed. There's the seal, but I have a deal for you: ...", - "I can repair the compass for you if you deliver what I need. Besides the broken compass you have to bring me the following materials: 50 blue glas plates, 15 green glas plates and 5 violet glas plates. ...", - "They all can be found in this closed cave in front of you. I should have destroyed this seal key but things have changed. The entrance is opened now, go down and do what has to be done.", - }, npc, creature, 10) - npcHandler:setTopic(playerId, 2) - elseif MsgContains(message, "down") then - npcHandler:say("On first glance, this cave does not look very spectacular, but the things you find in there, are. You have to know that this is the only place where you can find the respective materials to build the {compass}.", npc, creature) - npcHandler:setTopic(playerId, 0) elseif MsgContains(message, "compass") then - npcHandler:say("It was decided to collect all of the compasses, destroy them and throw them in the fiery {depths} of Tibia. I still have some of them here. I {sell} them for a low price if you want.", npc, creature) - npcHandler:setTopic(playerId, 0) - elseif MsgContains(message, "depths") then - npcHandler:say("As far as I know it is a place of helish heat with bloodthirsty monsters of all kinds.", npc, creature) - npcHandler:setTopic(playerId, 0) + npcHandler:say("It was decided to collect all of the compasses, destroy them and throw them in the fiery depths of Tibia. I still have some of them here. I {sell} them for a low price if you want.", npc, creature) + npcHandler:setTopic(playerId, 50) elseif MsgContains(message, "sell") then - npcHandler:say("Would you like to buy a broken compass for 10.000 gold?", npc, creature) - npcHandler:setTopic(playerId, 1) - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 then - local message = "You have bought a compass" - if not checkWeightAndBackpackRoom(player, 80, message) then - npcHandler:say("You not have room or capacity to take it.", npc, creature) - return true - end - if player:getMoney() + player:getBankBalance() >= 5000 then - player:removeMoneyBank(5000) - player:addItem(10302, 1) + if npcHandler:getTopic(playerId) == 50 then + npcHandler:say("Would you like to buy a broken compass for 10.000 gold?", npc, creature) + npcHandler:setTopic(playerId, 51) end + elseif MsgContains(message, "no") then + npcHandler:say({"Don't waste my time."}, npc, creature) npcHandler:setTopic(playerId, 0) + else + npcHandler:say("Sorry, I didn't understand.", npc, creature) end + return true end -npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) - -npcHandler:setMessage(MESSAGE_GREET, "Hello, I am the warden of this {monument}. The {sarcophagus} in front of you was established to prevent people from going {down} there. But I {doubt} that this step is sufficient.") - +npcHandler:setMessage(MESSAGE_WALKAWAY, 'Well, bye then.') npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye.") +npcHandler:setCallback(CALLBACK_GREET, greetCallback) +npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) + npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) -- npcType registering the npcConfig table diff --git a/data-otservbr-global/npc/myzzi.lua b/data-otservbr-global/npc/myzzi.lua new file mode 100644 index 00000000000..275768b8430 --- /dev/null +++ b/data-otservbr-global/npc/myzzi.lua @@ -0,0 +1,110 @@ +local internalNpcName = "Myzzi" +local npcType = Game.createNpcType(internalNpcName) +local npcConfig = {} + +npcConfig.name = internalNpcName +npcConfig.description = internalNpcName + +npcConfig.health = 100 +npcConfig.maxHealth = npcConfig.health +npcConfig.walkInterval = 2000 +npcConfig.walkRadius = 2 + +npcConfig.outfit = { + lookType = 982, + lookHead = 0, + lookBody = 0, + lookLegs = 0, + lookFeet = 0, + lookAddons = 0, +} + +npcConfig.flags = { + floorchange = false, +} + +npcConfig.voices = { + interval = 15000, + chance = 50, + { text = "You need to find some heroes. Find, find, find!!" }, +} + +local keywordHandler = KeywordHandler:new() +local npcHandler = NpcHandler:new(keywordHandler) + +npcType.onThink = function(npc, interval) + npcHandler:onThink(npc, interval) +end + +npcType.onAppear = function(npc, creature) + npcHandler:onAppear(npc, creature) +end + +npcType.onDisappear = function(npc, creature) + npcHandler:onDisappear(npc, creature) +end + +npcType.onMove = function(npc, creature, fromPosition, toPosition) + npcHandler:onMove(npc, creature, fromPosition, toPosition) +end + +npcType.onSay = function(npc, creature, type, message) + npcHandler:onSay(npc, creature, type, message) +end + +npcType.onCloseChannel = function(npc, creature) + npcHandler:onCloseChannel(npc, creature) +end + +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline) < 1 then + if MsgContains(message, "good") then + npcHandler:say("I'm just a mere messenger and I'm here to find brave adventurers that might {help} my friends in this time of need.", npc, creature) + npcHandler:setTopic(playerId, 2) + elseif MsgContains(message, "help") and npcHandler:getTopic(playerId) == 2 then + npcHandler:say("Lady Alivar of the Summer Court and Lord Cadion of the Winter Court are in need of brave adventurers to avert a great {threat} for the whole world.", npc, creature) + npcHandler:setTopic(playerId, 3) + elseif MsgContains(message, "threat") and npcHandler:getTopic(playerId) == 3 then + npcHandler:say({ + "I know only little and I forget so much. So many things going around my mind! ...", + "However, I can grant you access to the {Courts} of Summer and Winter if you promise to help! There you can meet with Undal or Vanys, the servants of Lord Cadion and Lady Alivar. They will be able to tell you more about the issue." + }, npc, creature) + npcHandler:setTopic(playerId, 4) + elseif MsgContains(message, "courts") and npcHandler:getTopic(playerId) == 4 then + npcHandler:say({"There are {entrances} to the hidden Courts of Summer and Winter in secluded places. You can find the portal to the Winter Court high in the mountains of Tyrsung and the portal to the Summer Court in the meadows of Feyrist. ...", + "With my magic you will be able to enter the Courts. Find Undal or Vanys and talk to them."}, npc, creature) + npcHandler:setTopic(playerId, 5) + elseif MsgContains(message, "entrances") and npcHandler:getTopic(playerId) == 5 then + npcHandler:say("So, are you willing to help in this time of need?", npc, creature) + npcHandler:setTopic(playerId, 6) + elseif npcHandler:getTopic(playerId) == 6 then + if MsgContains(message, "yes") then + npcHandler:say({"You are a true hero! Here, take my enchantment and you will be able to pass the portals. Now hurry, my friends are waiting."}, npc, creature) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline, 1) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("What?!", npc, creature) + end + end + end + + return true +end + +npcHandler:setMessage(MESSAGE_GREET, "Hello adventurer. It is {good} to see you.") +npcHandler:setMessage(MESSAGE_FAREWELL, "Well, bye then.") +npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") + +npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) + +npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) + +-- npcType registering the npcConfig table +npcType:register(npcConfig) diff --git a/data-otservbr-global/npc/stricken_soul.lua b/data-otservbr-global/npc/stricken_soul.lua index 88857dfb1e1..2e1448fd300 100644 --- a/data-otservbr-global/npc/stricken_soul.lua +++ b/data-otservbr-global/npc/stricken_soul.lua @@ -45,8 +45,63 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end -keywordHandler:addKeyword({ "job" }, StdModule.say, { npcHandler = npcHandler, text = "Esperando Script." }) -npcHandler:setMessage(MESSAGE_GREET, "Greetings, |PLAYERNAME|.") +local function greetCallback(npc, creature) + local player = Player(creature) + local playerId = player:getId() + + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline) < 1 then + npcHandler:setMessage(MESSAGE_GREET, "This place is... haunted... heed my warning... there are... ghooooooosts here...! Why are you giving me that... look? I am certain, there aaaaaaare ghosts here - I've seen them! Do you believe me?") + else + npcHandler:setMessage(MESSAGE_GREET, "Gree... tings.") + end + + return true +end + +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + local playerName = player:getName() + + if MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 2 then + npcHandler:say("Excellent... I hope they will haaaaaaunt my house no longer. What was your... naaaaaame again, tell me?", npc, creature) + npcHandler:setTopic(playerId, 3) + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline) < 1 then + npcHandler:say("Yeeeees... you need to help meeeeeee. I want those ghosts gone... this is my home and I need it to teach my students. Will you take care of the... ghosts?", npc, creature) + npcHandler:setTopic(playerId, 2) + end + elseif MsgContains(message, playerName) then + if npcHandler:getTopic(playerId) == 3 then + npcHandler:say({ + " Ah yeeeeees, ".. playerName .. ". I will remember you. Now, lessons are every day in the morning and once a week in the evening... ...", + "Oh, you're not here for this, are you? So about the ghoooosts, yes. You seeeee, there are 3 secret passages here. ...", + "Thiiiiis is no ordinary house... it is a nexus, a gateway to a once hidden cathedral. Sheltering a small and peaceful society of scholars and monks. Secluded from every distraction. ...", + "I was one of them and ordered to hold contact to the outside woooorld. But then, something... happened. ...", + "Outsiders managed to sneak in, infiltrate and influence the society... for the worse. Who knows for what ends. They chaaaaanged... ...", + "Shortly after, contact was lost... the nexus broken and sealed, ghosts appeared... eeeeeeeverywhere. ...", + "Find the three passages... one is right here in the cellars, one in the jungles of Tiquanda and one in the deserts of Darama. ...", + "Restore their connection and open this nexus to access the buried cathedral and find the cause to this... eliminate all remainders there if you must, "..playerName.."." + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 1) + npcHandler:setTopic(playerId, 0) + end + else + npcHandler:say("Sorry, I didn't understand.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + + return true +end + +npcHandler:setCallback(CALLBACK_GREET, greetCallback) +npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) + npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) -- npcType registering the npcConfig table diff --git a/data-otservbr-global/npc/vanys.lua b/data-otservbr-global/npc/vanys.lua index c922ce8c8cd..b3b3cf8eb58 100644 --- a/data-otservbr-global/npc/vanys.lua +++ b/data-otservbr-global/npc/vanys.lua @@ -53,36 +53,6 @@ end npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) -local outfits = { 1147, 1146 } - -local function hasOutfit(player) - for _, outfit in ipairs(outfits) do - if player:hasOutfit(outfit) then - return true - end - end - return false -end - -local function hasAddon(player, addon) - for _, outfit in ipairs(outfits) do - if player:hasOutfit(outfit, addon) then - return true - end - end - return false -end - -local function hasKllledTheNightmareBeast(player) - return player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareBeastKilled) == 1 -end - -local function checkAchievement(player) - if hasAddon(player, 3) then - player:addAchievement("Dream Warrior") - end -end - local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -91,82 +61,112 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if npcHandler:getTopic(playerId) == 0 then - if MsgContains(message, "task") or MsgContains(message, "outfit") then - if hasOutfit(player) then - npcHandler:say("You already have the Dream Warrior outfit.", npc, creature) - return true - end - - if not hasKllledTheNightmareBeast(player) then - npcHandler:say("You need to kill the Nightmare Beast first.", npc, creature) - return true - end + local dreamTalisman = 30132 - npcHandler:say("The Nightmare Beast is slain. You have done well. The Courts of Summer and Winter will be forever grateful. For your efforts I want to reward you with our traditional dream warrior outfit. May it suit you well!", npc, creature) - for _, outfit in ipairs(outfits) do - player:addOutfit(outfit, 0) - end - return true + if MsgContains(message, "talk") then + npcHandler:say("So do you want to learn the {story} behind of this or rather talk about the {task} at hand? ", npc, creature) + npcHandler:setTopic(playerId, 2) + elseif MsgContains(message, "story") then + if npcHandler:getTopic(playerId) == 2 then + npcHandler:say("Do you prefer the {long} version or the {short} version?", npc, creature) + npcHandler:setTopic(playerId, 3) end - - if MsgContains(message, "addon") then - if not hasOutfit(player) then - npcHandler:say("You don't have the Dream Warrior outfit.", npc, creature) - return true + elseif MsgContains(message, "short") and npcHandler:getTopic(playerId) == 3 then + npcHandler:say({ + "You will have to re-empower several wardstones all over the world, to weaken the beast of nightmares. ...", + "The next step would be to enter a place known as dream scar and participate in battles, to gain access to the lower areas. ...", + "There the nightmare beast can be challenged and defeated.", + "So do you want to learn the story behind of this or rather talk about the {task} at hand?" + }, npc, creature) + npcHandler:setTopic(playerId, 4) + elseif npcHandler:getTopic(playerId) == 4 or npcHandler:getTopic(playerId) == 2 then + if MsgContains(message, "task") then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) >= 3 and not (player:hasOutfit(1146) or player:hasOutfit(1147)) then + npcHandler:say("The Nightmare Beast is slain. You have done well. The Courts of Summer and Winter will be forever grateful. For your efforts I want to reward you with our traditional dream warrior outfit. May it suit you well!", npc, creature) + for i = 1146, 1147 do + player:addOutfit(i) + end + npcHandler:setTopic(playerId, 0) + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count) >= 8 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) == 1 then + npcHandler:say({ + "You empowered all eight ward stones. Well done! You may now enter the Dream Labyrinth via the portal here in the Court. Beneath it you will find the Nightmare Beast's lair. But the labyrinth is protected by seven so called Dream Doors. ...", + "You have to find the Seven {Keys} to unlock the Seven Dream Doors down there. Only then you will be able to enter the Nightmare Beast's lair." + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, 2) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, 1) + npcHandler:setTopic(playerId, 5) + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) < 1 then + npcHandler:say({ + "You have to empower eight ward stones. Once charged with arcane energy, they will strengthen the Nightmare Beast's prison and at the same time weaken this terrible creature. We know about the specific location of six of those stones. ...", + "You can find them in the mountains of the island Okolnir, in a water elemental cave beneath Folda, in the depths of Calassa, in the forests of Feyrist and on the islands Meriana and Cormaya. ..." , + "The location of the other two ward stones is a bit more obscure, however. We are not completely sure where they are. You should make inquiries at an abandoned house in the Plains of Havoc. You may find it east of an outlaw camp. ..." , + "The other stone seems to be somewhere in Tiquanda. Search for a small stone building south-west of Banuta. Take this talisman to empower the ward stones. It will work with the six stones at the known locations. ..." , + "However, the empowering of the two hidden stones could be a bit more complicated. But you have to find out on yourself what to do with those stones." + }, npc, creature) + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline) < 1 then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline, 1) + end + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count, 0) + player:addItem(dreamTalisman, 1) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("I already gave your task.", npc, creature) + npcHandler:setTopic(playerId, 0) end - npcHandler:say("Are you interested in one or two addons to your dream warrior outfit?", npc, creature) - npcHandler:setTopic(playerId, 1) - return true end - elseif npcHandler:getTopic(playerId) == 1 then - if MsgContains(message, "yes") then - npcHandler:say("I provide two addons. For the first one I need you to bring me five pomegranates. For the second addon you need an ice shield. Which one would you like? {Pomegranate} or {shield}?", npc, creature) - npcHandler:setTopic(playerId, 2) + elseif MsgContains(message, "keys") and npcHandler:getTopic(playerId) == 5 then + npcHandler:say("They are not literally keys but rather puzzles you have to solve or a secret mechanism you have to discover in order to open the Dream Doors. A parchment in the chest here can tell you more about it.", npc, creature) + elseif MsgContains(message, "addon") then + if player:hasOutfit(1146) or player:hasOutfit(1147) then + npcHandler:say("Are you interested in one or two addons to your dream warrior outfit?", npc, creature) + npcHandler:setTopic(playerId, 6) else - npcHandler:say("Alright then. Come back if you change your mind.", npc, creature) - npcHandler:setTopic(playerId, 0) + npcHandler:say("You don't even have the outfit.", npc, creature) end - elseif npcHandler:getTopic(playerId) == 2 then - if MsgContains(message, "pomegranate") then - if hasAddon(player, 1) then - npcHandler:say("You already have this addon.", npc, creature) - return true - end - if player:removeItem(30169, 5) then - npcHandler:say("Great! Here is the addon.", npc, creature) - for _, outfit in ipairs(outfits) do - player:addOutfitAddon(outfit, 1) + elseif MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 6 then + npcHandler:say("I provide two addons. For the first one I need you to bring me five pomegranates. For the second addon you need an ice shield. Do you want one of these addons?", npc, creature) + npcHandler:setTopic(playerId, 7) + elseif npcHandler:getTopic(playerId) == 7 then + npcHandler:say("What do you have for me: the {pomegranates} or the {ice shield}?", npc, creature) + npcHandler:setTopic(playerId, 8) + end + elseif npcHandler:getTopic(playerId) == 8 then + if MsgContains(message, "pomegranates") then + if player:getItemCount(30169) >= 5 then + npcHandler:say("Very good! You gained the second addon to the dream warrior outfit.", npc, creature) + player:removeItem(30169, 5) + for i = 1146, 1147 do + player:addOutfitAddon(i, 2) end - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - checkAchievement(player) npcHandler:setTopic(playerId, 0) else - npcHandler:say("Sorry, you don't have the required items.", npc, creature) - end - elseif MsgContains(message, "shield") then - if hasAddon(player, 2) then - npcHandler:say("You already have this addon.", npc, creature) - return true + npcHandler:say("You do not have enough items.", npc, creature) + npcHandler:setTopic(playerId, 0) end - if player:removeItem(30168, 1) then - npcHandler:say("Great! Here is the addon.", npc, creature) - for _, outfit in ipairs(outfits) do - player:addOutfitAddon(outfit, 2) + elseif MsgContains(message, "ice shield") then + if player:getItemCount(30168) >= 1 then + npcHandler:say("Very good! You gained the first addon to the dream warrior outfit.", npc, creature) + player:removeItem(30168, 1) + for i = 1146, 1147 do + player:addOutfitAddon(i, 1) end - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - checkAchievement(player) npcHandler:setTopic(playerId, 0) else - npcHandler:say("Sorry, you don't have the required items.", npc, creature) + npcHandler:say("You do not have enough items.", npc, creature) + npcHandler:setTopic(playerId, 0) end - else - npcHandler:say("Sorry, I didn't understand.", npc, creature) - return true end + else + npcHandler:say("Sorry, I didn't understand.", npc, creature) end end +npcHandler:setMessage(MESSAGE_GREET, "Greetings hero. I guess you came to {talk}.") +npcHandler:setMessage(MESSAGE_FAREWELL, "Well, bye then.") +npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") + npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) -- npcType registering the npcConfig table diff --git a/data-otservbr-global/scripts/actions/bosses_levers/faceless_bane.lua b/data-otservbr-global/scripts/actions/bosses_levers/faceless_bane.lua deleted file mode 100644 index 75dcc91bbb9..00000000000 --- a/data-otservbr-global/scripts/actions/bosses_levers/faceless_bane.lua +++ /dev/null @@ -1,24 +0,0 @@ -local config = { - boss = { - name = "Faceless Bane", - position = Position(33617, 32561, 13), - }, - requiredLevel = 250, - timeToDefeat = 15 * 60, - playerPositions = { - { pos = Position(33638, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33639, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33640, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33641, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33642, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, - }, - specPos = { - from = Position(33607, 32553, 13), - to = Position(33627, 32570, 13), - }, - exit = Position(33618, 32523, 15), -} - -local lever = BossLever(config) -lever:uid(1039) -lever:register() diff --git a/data-otservbr-global/scripts/actions/other/enchanting.lua b/data-otservbr-global/scripts/actions/other/enchanting.lua index ef6d648d15e..1db4448f921 100644 --- a/data-otservbr-global/scripts/actions/other/enchanting.lua +++ b/data-otservbr-global/scripts/actions/other/enchanting.lua @@ -44,6 +44,10 @@ local enchantedItems = { local enchanting = Action() function enchanting.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if item.itemid == 675 and target.itemid == 21573 then + return onGrindItem(player, item, fromPosition, target, toPosition) + end + if table.contains({ 33268, 33269 }, toPosition.x) and toPosition.y == 31830 and toPosition.z == 10 and player:getStorageValue(Storage.Quest.U8_2.ElementalSpheres.QuestLine) > 0 then if not table.contains(spheres[item.itemid], player:getVocation():getBaseId()) then return false diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua index 3d89eb52136..2f1502bd063 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_acidFishingRod.lua @@ -28,4 +28,5 @@ function actions_acidFishingRod.onUse(player, item, fromPosition, target, toPosi end actions_acidFishingRod:id(29950) +actions_acidFishingRod:allowFarUse(true) actions_acidFishingRod:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua index a2e4a930059..a16bc0bc930 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_bookOnTable.lua @@ -1,6 +1,6 @@ local questline = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline -local wordsCount = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount -local facelessTime = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTime +local wordsCount = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount +local facelessTime = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FacelessTime local actions_bookOnTable = Action() @@ -27,5 +27,5 @@ function actions_bookOnTable.onUse(player, item, fromPosition, target, toPositio return true end -actions_bookOnTable:id(29991) +actions_bookOnTable:id(29954) actions_bookOnTable:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua index 574dbaea545..92267a99d47 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_chargedCompass.lua @@ -1,5 +1,5 @@ local wardPosition = Position(32769, 32621, 10) -local storage = Storage.Quest.U12_00.TheDreamCourts.WardStones.porthopeStone +local storage = Storage.Quest.U12_00.TheDreamCourts.WardStones.PortHopeStone local count = Storage.Quest.U12_00.TheDreamCourts.WardStones.Count local function revertStone(position, on, off) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua index ca1f2018d1f..a543149b648 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_containerRewards.lua @@ -2,7 +2,7 @@ local containers = { [1] = { uniqueid = 23102, cPosition = Position(32736, 32282, 8), - storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.skeletonContainer, + storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.SkeletonContainer, value = 1, reward = 29310, defaultItem = true, @@ -10,7 +10,7 @@ local containers = { [2] = { uniqueid = 23103, cPosition = Position(33693, 32185, 8), - storage = Storage.Quest.U12_00.TheDreamCourts.Main.courtChest, + storage = Storage.Quest.U12_00.TheDreamCourts.Main.CourtChest, value = 1, reward = 30146, defaultItem = true, @@ -18,7 +18,7 @@ local containers = { [3] = { uniqueid = 23104, cPosition = Position(33711, 32108, 4), - storage = Storage.Quest.U12_00.TheDreamCourts.Main.courtChest, + storage = Storage.Quest.U12_00.TheDreamCourts.Main.CourtChest, value = 1, reward = 30146, defaultItem = true, @@ -26,7 +26,7 @@ local containers = { [4] = { uniqueid = 23105, cPosition = Position(33578, 32527, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.fishingRod, + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FishingRod, value = 1, reward = 29950, defaultItem = true, @@ -34,7 +34,7 @@ local containers = { [5] = { uniqueid = 23106, cPosition = Position(33599, 32533, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.barrelWord, + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.BarrelWord, value = 1, defaultItem = false, text = "The inside of this barrel's lid has a word written onto it: 'O'kteth'.", @@ -42,7 +42,7 @@ local containers = { [6] = { uniqueid = 23107, cPosition = Position(33618, 32518, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.estatueWord, + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.EstatueWord, value = 1, defaultItem = false, text = "This statue has a word written on her hand: 'N'ogalu'.", @@ -50,7 +50,7 @@ local containers = { [7] = { uniqueid = 23108, cPosition = Position(33638, 32507, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.bedWord, + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.BedWord, value = 1, defaultItem = false, text = "This end of the bed has a stack of notes hidden under it. There is only one word on all of them: 'T'sough'.", @@ -58,7 +58,7 @@ local containers = { [8] = { uniqueid = 23109, cPosition = Position(33703, 32185, 5), - storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Rosebush, + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.RoseBush, value = 1, reward = 29993, defaultItem = true, @@ -66,7 +66,7 @@ local containers = { [9] = { uniqueid = 23110, cPosition = Position(33663, 32192, 7), - storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Mushroom, + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MushRoom, value = 1, reward = 30009, defaultItem = true, @@ -106,7 +106,7 @@ local containers = { [14] = { uniqueid = 23115, cPosition = Position(32054, 31936, 13), - storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.trollSkull, + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.TrollSkull, value = 1, reward = 29990, defaultItem = true, @@ -126,11 +126,11 @@ function actions_containerRewards.onUse(player, item, fromPosition, target, toPo player:addItem(k.reward, 1) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, k.text) - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount) < 0 then - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, 0) + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount) < 0 then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount, 0) end - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount) + 1) - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount) == 4 then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount) + 1) + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount) == 4 then player:addAchievement("Tied the Knot") end end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua index 07d2bda4b79..7d0bbb7a85a 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_doorInvisible.lua @@ -1,5 +1,5 @@ local Count = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count -local Storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.doorInvisible +local Storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.DoorInvisible local lanternId = 23738 local actions_doorInvisible = Action() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua index c61df597305..26309a69749 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamTalisman.lua @@ -3,49 +3,49 @@ local config = { on = 29337, off = 29336, hisPosition = Position(32251, 31386, 5), - hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.okolnirStone, + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.OkolnirStone, hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.", }, [2] = { on = 29337, off = 29336, hisPosition = Position(31939, 31653, 10), - hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.foldaStone, + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.FoldaStone, hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.", }, [3] = { on = 29337, off = 29336, hisPosition = Position(32058, 32792, 13), - hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.calassaStone, + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.CalassaStone, hisMessage = "You charge the winter ward stone and the engraved ice crystal glows in a blue light.", }, [4] = { on = 29335, off = 29334, hisPosition = Position(33555, 32220, 7), - hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.feyristStone, + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.FeyristStone, hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.", }, [5] = { on = 29335, off = 29334, hisPosition = Position(32383, 32610, 7), - hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.merianaStone, + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.MerianaStone, hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.", }, [6] = { on = 29335, off = 29334, hisPosition = Position(33273, 31997, 7), - hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.cormayaStone, + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.CormayaStone, hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.", }, [7] = { on = 29335, off = 29334, hisPosition = Position(33576, 32537, 15), - hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.catedralStone, + hisStorage = Storage.Quest.U12_00.TheDreamCourts.WardStones.CatedralStone, hisMessage = "You charge the summer ward stone and the engraved sun crystal glows in a golden light.", lastStone = true, }, diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua index 80eb86cba18..69a9f78965c 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamcatcher_curse.lua @@ -16,7 +16,7 @@ local function resetArea() local player = Player(p:getId()) if player then playerCount = playerCount + 1 - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse) >= 1 then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse) >= 1 then infectedCount = infectedCount + 1 end end @@ -45,7 +45,7 @@ function actions_dreamcatcher_curse.onUse(player, item, fromPosition, target, to end addEvent(placeMask, 10 * 1000, item:getPosition(), 29274, 29275) elseif item.itemid == 29276 then - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse) < 1 then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse) < 1 then if (target ~= player) and target:isPlayer() then if target:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) >= 1 then target:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, 0) @@ -58,7 +58,7 @@ function actions_dreamcatcher_curse.onUse(player, item, fromPosition, target, to item:remove(1) local j = resetArea() if j then - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse, 0) end else return true diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua index e1c29e81166..531bee268a9 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua @@ -19,13 +19,13 @@ local leverInfo = { pushPosition = Position(32208, 32021, 13), leverFromPos = Position(32208, 32021, 13), leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.AlptramunTimer, roomFromPosition = Position(32198, 32037, 14), roomToPosition = Position(32234, 32054, 14), teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunTimer, }, [2] = { byDay = "Tuesday", @@ -35,13 +35,13 @@ local leverInfo = { pushPosition = Position(32208, 32021, 13), leverFromPos = Position(32208, 32021, 13), leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.IzcandarTimer, roomFromPosition = Position(32198, 32037, 14), roomToPosition = Position(32234, 32054, 14), teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, }, [3] = { byDay = "Wednesday", @@ -51,13 +51,13 @@ local leverInfo = { pushPosition = Position(32208, 32021, 13), leverFromPos = Position(32208, 32021, 13), leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.MalofurTimer, roomFromPosition = Position(32198, 32037, 14), roomToPosition = Position(32234, 32054, 14), teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MalofurTimer, }, [4] = { byDay = "Thursday", @@ -67,13 +67,13 @@ local leverInfo = { pushPosition = Position(32208, 32021, 13), leverFromPos = Position(32208, 32021, 13), leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.MaxxeniusTimer, roomFromPosition = Position(32198, 32037, 14), roomToPosition = Position(32234, 32054, 14), teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer, }, [5] = { byDay = "Friday", @@ -83,13 +83,13 @@ local leverInfo = { pushPosition = Position(32208, 32021, 13), leverFromPos = Position(32208, 32021, 13), leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.IzcandarTimer, roomFromPosition = Position(32198, 32037, 14), roomToPosition = Position(32234, 32054, 14), teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, }, [6] = { byDay = "Saturday", @@ -99,13 +99,13 @@ local leverInfo = { pushPosition = Position(32208, 32021, 13), leverFromPos = Position(32208, 32021, 13), leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.PlagueRootTimer, roomFromPosition = Position(32198, 32037, 14), roomToPosition = Position(32234, 32054, 14), teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.PlagueRootTimer, }, [7] = { byDay = "Sunday", @@ -115,13 +115,13 @@ local leverInfo = { pushPosition = Position(32208, 32021, 13), leverFromPos = Position(32208, 32021, 13), leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.MaxxeniusTimer, roomFromPosition = Position(32198, 32037, 14), roomToPosition = Position(32234, 32054, 14), teleportTo = Position(32224, 32048, 14), typePush = "y", exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer, }, } @@ -212,8 +212,8 @@ local heatOfSummer = { local lastBoss = { bossName = "The Nightmare Beast", bossPosition = Position(32209, 32044, 15), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.nightmareTimer, - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.nightmareTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.NightmareTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.NightmareTimer, fromPositionTeleport = Position(32210, 32070, 15), toPositionTeleport = Position(32214, 32071, 15), fromPositionPush = Position(32211, 32070, 15), @@ -269,7 +269,7 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos monster:registerEvent("dreamCourtsDeath") end - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse, 0) addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, lastBoss.roomFromPosition, lastBoss.roomToPosition, lastBoss.exitPosition) else @@ -278,7 +278,7 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos end else for i = 1, #leverInfo do - if iPos == leverInfo[i].leverPosition and os.sdate("%A") == leverInfo[i].byDay then + if iPos == leverInfo[i].leverPosition and os.date("%A") == leverInfo[i].byDay then local leverTable = leverInfo[i] if pPos == leverTable.pushPosition then if player:doCheckBossRoom(leverTable.bossName, leverTable.roomFromPosition, leverTable.roomToPosition) then @@ -327,7 +327,7 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos summon:registerEvent("dreamCourtsDeath") end - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, 0) monster:registerEvent("facelessHealth") elseif leverTable.bossName:lower() == "izcandar the banished" then @@ -336,7 +336,7 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos spawnSummons(1, "the heat of summer", false, 15, heatOfSummer, leverTable.bossPosition) spawnSummons(1, "the cold of winter", false, 15, coldOfWinter, leverTable.bossPosition) - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarOutfit, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarOutfit, 0) elseif leverTable.bossName:lower() == "plagueroot" then spawnSummons(1, "plant attendant", false, 15, plantAttendants, leverTable.bossPosition) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua index 08b2839162f..01b254c00f7 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua @@ -11,13 +11,13 @@ local leverInfo = { pushPosition = Position(33638, 32562, 13), leverFromPos = Position(33638, 32562, 13), leverToPos = Position(33642, 32562, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FacelessTimer, roomFromPosition = Position(33606, 32552, 13), roomToPosition = Position(33631, 32572, 13), teleportTo = Position(33617, 32567, 13), typePush = "x", exitPosition = Position(33619, 32522, 15), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTimer, + globalTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedralGlobal.FacelessTimer, }, } @@ -38,7 +38,7 @@ function actions_facelessLever.onUse(player, item, fromPosition, target, toPosit local leverTable = leverInfo[i] if pPos == leverTable.pushPosition then - if doCheckBossRoom(player:getId(), leverTable.bossName, leverTable.roomFromPosition, leverTable.roomToPosition) then + if player:doCheckBossRoom(leverTable.bossName, leverTable.roomFromPosition, leverTable.roomToPosition) then if leverTable.typePush == "x" then for i = leverTable.leverFromPos.x, leverTable.leverToPos.x do local newPos = Position(i, leverTable.leverFromPos.y, leverTable.leverFromPos.z) @@ -47,7 +47,7 @@ function actions_facelessLever.onUse(player, item, fromPosition, target, toPosit if creature and creature:isPlayer() then creature:teleportTo(leverTable.teleportTo) creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - creature:setStorageValue(leverInfo.storageTimer, os.time() + 20 * 60 * 60) + creature:setStorageValue(leverTable.storageTimer, os.time() + 20 * 60 * 60) table.insert(playersTable, creature:getId()) end end @@ -59,7 +59,7 @@ function actions_facelessLever.onUse(player, item, fromPosition, target, toPosit if creature and creature:isPlayer() then creature:teleportTo(leverTable.teleportTo) creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - creature:setStorageValue(leverInfo.storageTimer, os.time() + 20 * 60 * 60) + creature:setStorageValue(leverTable.storageTimer, os.time() + 20 * 60 * 60) table.insert(playersTable, creature:getId()) end end @@ -70,7 +70,7 @@ function actions_facelessLever.onUse(player, item, fromPosition, target, toPosit if monster then if leverTable.bossName:lower() == "faceless bane" then monster:registerEvent("facelessThink") - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTiles, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedralGlobal.FacelessTiles, 0) end monster:registerEvent("dreamCourtsDeath") diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua index bde57709505..91757dbe7fb 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenAxe.lua @@ -50,7 +50,7 @@ local function tryCrystal(player, itemid, position, actionid, message, rewardid) end end -local storage = Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.gotAxe +local storage = Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.GotAxe local actions_goldenAxe = Action() @@ -66,19 +66,19 @@ function actions_goldenAxe.onUse(player, item, fromPosition, target, toPosition, if target.itemid == 8865 then for _, k in pairs(firstFloor) do if tPos == k.hisPosition then - tryCrystal(player:getId(), tId, tPos, 23121, "You got a blue crystal!", 33780) + tryCrystal(player:getId(), tId, tPos, 23121, "You got a blue crystal!", 29287) end end - elseif target.itemid == 16168 then + elseif target.itemid == 14940 then for _, k in pairs(secondFloor) do if tPos == k.hisPosition then - tryCrystal(player:getId(), tId, tPos, 23122, "You got a green crystal!", 33781) + tryCrystal(player:getId(), tId, tPos, 23122, "You got a green crystal!", 29288) end end elseif target.itemid == 14974 then for _, k in pairs(thirdFloor) do if tPos == k.hisPosition then - tryCrystal(player:getId(), tId, tPos, 23123, "You got a purple crystal!", 33782) + tryCrystal(player:getId(), tId, tPos, 23123, "You got a purple crystal!", 29289) end end end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua index e0a867468f3..cf59b96e9ea 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua @@ -6,6 +6,17 @@ local altars = { } local blockedItem = 29300 +local storageIdolCount = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.IdolCount +local finalStorage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple +local totalAltars = 4 +local resetTime = 1 * 60 * 1000 + +local function removeIdol(position) + local idol = Tile(position):getItemById(blockedItem) + if idol then + idol:remove() + end +end local actions_goldenIdol = Action() @@ -24,6 +35,21 @@ function actions_goldenIdol.onUse(player, item, fromPosition, target, toPosition Game.createItem(blockedItem, 1, altar.position) tPos:sendMagicEffect(CONST_ME_POFF) player:say("**placing idol**", TALKTYPE_MONSTER_SAY) + + local currentCount = player:getStorageValue(storageIdolCount) + + if currentCount < 0 then currentCount = 0 end + player:setStorageValue(storageIdolCount, currentCount + 1) + + if currentCount + 1 == totalAltars then + player:setStorageValue(finalStorage, 1) + if p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb) == 1 and p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar) == 1 and p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple) == 1 then + p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 2) + end + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have placed all the idols on the altars and unlocked the temple!") + end + + addEvent(removeIdol, resetTime, altar.position) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There is already an idol here. Try another altar.") end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua deleted file mode 100644 index 29ea48d18b1..00000000000 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_idolCheck.lua +++ /dev/null @@ -1,57 +0,0 @@ -local altars = { - [1] = { position = Position(32591, 32629, 9) }, - [2] = { position = Position(32591, 32621, 9) }, - [3] = { position = Position(32602, 32629, 9) }, - [4] = { position = Position(32602, 32621, 9) }, -} - -local blockedItem = 29300 - -local function cleanIdols() - for _, altar in pairs(altars) do - local checkTile = Tile(altar.position):getItemById(blockedItem) - - if checkTile then - checkTile:remove(1) - end - end -end - -local actions_idolCheck = Action() - -function actions_idolCheck.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if not player then - return true - end - - local count = 0 - - for _, altar in pairs(altars) do - local checkTile = Tile(altar.position):getItemById(blockedItem) - - if checkTile then - count = count + 1 - end - end - - if count == 4 then - addEvent(cleanIdols, 1 * 60 * 1000) - - local spectators = Game.getSpectators(item:getPosition(), false, true, 12, 12, 12, 12) - - for _, spectator in pairs(spectators) do - local p = Player(spectator:getId()) - p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple, 1) - if p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Tomb) == 1 and p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Cellar) == 1 and p:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple) == 1 then - p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 2) - end - end - - player:say("REPLACING THE IDOLS FEEDS THE PORTAL BUT DOES NOT FREE ONE FROM THE SACRILEGE OF TAKING THEM AWAY FROM TUKH!", TALKTYPE_MONSTER_SAY) - end - - return true -end - -actions_idolCheck:aid(23107) -actions_idolCheck:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua index 860d7bc8b7a..6fbbd95636e 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua @@ -32,7 +32,7 @@ local doors = { [7] = { doorPosition = Position(32606, 32629, 9), storage = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Temple, - value = -1, + value = 1, help = "Tomb", }, [8] = { @@ -42,22 +42,22 @@ local doors = { }, [9] = { doorPosition = Position(33625, 32525, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount, value = 3, }, [10] = { doorPosition = Position(33640, 32551, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount, value = 3, }, [11] = { doorPosition = Position(33657, 32551, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.wordCount, + storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.WordCount, value = 3, }, [12] = { doorPosition = Position(31983, 31960, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.doorMedusa, + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.DoorMedusa, value = 1, help = "Medusa", }, @@ -68,7 +68,7 @@ local doors = { }, [14] = { doorPosition = Position(32074, 31974, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.sequenceSkulls, + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.SequenceSkulls, value = 3, }, [15] = { @@ -85,65 +85,61 @@ local doors = { }, } -local actions_questDoors = Action() - -function actions_questDoors.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local door = Door(item.itemid) - local usedDoor = item.itemid + 1 - +local function closeDoor(position, closedId) + local door = Tile(position):getItemById(closedId + 1) if door then - usedDoor = door:use() + door:transform(closedId) end +end +local actions_questDoors = Action() + +function actions_questDoors.onUse(player, item, fromPosition, target, toPosition, isHotkey) local iPos = item:getPosition() for _, p in pairs(doors) do - if (iPos == p.doorPosition) and not (player:getPosition() == p.doorPosition) then + if iPos == p.doorPosition and not (player:getPosition() == p.doorPosition) then if p.help == "Tomb" then if player:getStorageValue(p.storage) < p.value then player:teleportTo(toPosition, true) - item:transform(usedDoor) + item:transform(item.itemid + 1) + addEvent(closeDoor, 2000, iPos, item.itemid) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.") end elseif p.help == "Medusa" then if player:getStorageValue(p.storage) < 1 then player:setStorageValue(p.storage, 1) - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count) + 1) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "As Medusas's Ointment takes effect the door is unpetrified again. You can use it now.") - end - - if iPos.y < player:getPosition().y then - player:teleportTo(Position(iPos.x, iPos.y - 3, iPos.z)) - else - player:teleportTo(Position(iPos.x, iPos.y + 3, iPos.z)) + local count = player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count, (count < 0 and 1 or count + 1)) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "As Medusa's Ointment takes effect, the door is unpetrified. You can use it now.") end + local newPos = (iPos.y < player:getPosition().y) and Position(iPos.x, iPos.y - 3, iPos.z) or Position(iPos.x, iPos.y + 3, iPos.z) + player:teleportTo(newPos) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + item:transform(item.itemid + 1) + addEvent(closeDoor, 2000, iPos, item.itemid) elseif p.help == "Lock" then if player:getStorageValue(p.storage) >= p.value then - if iPos.y < player:getPosition().y then - player:teleportTo(Position(iPos.x, iPos.y - 1, iPos.z)) - else - player:teleportTo(Position(iPos.x, iPos.y + 1, iPos.z)) - end + local newPos = (iPos.y < player:getPosition().y) and Position(iPos.x, iPos.y - 1, iPos.z) or Position(iPos.x, iPos.y + 1, iPos.z) + player:teleportTo(newPos) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + item:transform(item.itemid + 1) + addEvent(closeDoor, 2000, iPos, item.itemid) else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The lock in this door is missing. Mysteriously, the door is locked nonetheless. Perhaps you can find a matching lock somewhere?") + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The lock in this door is missing. Perhaps you can find a matching lock somewhere?") return true end elseif p.help == "Open/Close" then if player:getStorageValue(p.storage) >= p.value then - if item.itemid == 30033 then - item:transform(30035) - elseif item.itemid == 30035 then - item:transform(30033) - end + item:transform((item.itemid == 30033) and 30035 or 30033) end else if player:getStorageValue(p.storage) >= p.value then player:teleportTo(toPosition, true) - item:transform(usedDoor) + item:transform(item.itemid + 1) + addEvent(closeDoor, 2000, iPos, item.itemid) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.") end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua index d8d5f97d71f..6a11f8d3596 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceBooks.lua @@ -1,4 +1,4 @@ -local sequenceBooks = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.sequenceBooks +local sequenceBooks = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.SequenceBooks local questline = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline local sequence = { diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua index 40b1cdd56db..fde13982e2e 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_sequenceSkulls.lua @@ -1,4 +1,4 @@ -local sequenceSkulls = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.sequenceSkulls +local sequenceSkulls = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.SequenceSkulls local Count = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count local bookId = 29991 diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua index 8fd2c7b278e..f529108e076 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_Izcandar.lua @@ -65,10 +65,10 @@ function creaturescripts_Izcandar.onThink(creature, interval) if position:isInRange(sides[1].fromPosition, sides[1].toPosition) and not (cName == "izcandar champion of winter") then transformIzcandar(creature:getId(), "izcandar champion of winter", health, position) - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarOutfit, 1) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.izcandarOutfit, 1) elseif position:isInRange(sides[2].fromPosition, sides[2].toPosition) and not (cName == "izcandar champion of summer") then transformIzcandar(creature:getId(), "izcandar champion of summer", health, position) - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarOutfit, 2) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.izcandarOutfit, 2) end return true diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua index 804b1faa69c..0ed9afb6060 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua @@ -2,63 +2,63 @@ local questlog = { [1] = { bossName = "Faceless Bane", storageQuestline = Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTime, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedralGlobal.FacelessTime, middlePosition = Position(33617, 32563, 13), maxValue = 4, }, [2] = { bossName = "Maxxenius", - storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, [3] = { bossName = "Alptramun", - storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer, + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, [4] = { bossName = "Izcandar the Banished", - storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, [5] = { bossName = "Izcandar Champion of Winter", - storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, [6] = { bossName = "Izcandar Champion of Summer", - storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, [7] = { bossName = "Plagueroot", - storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer, + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.PlaguerootTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, [8] = { bossName = "Malofur Mangrinder", - storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer, + storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MalofurTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, [9] = { bossName = "The Nightmare Beast", storageQuestline = Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.nightmareTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.NightmareTimer, middlePosition = Position(32207, 32045, 15), maxValue = 2, }, @@ -115,17 +115,17 @@ function creaturescripts_dreamCourtsDeath.onDeath(creature, corpse, killer, most end if cName:lower() == "alptramun" then - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, 0) end end end - local summonsKilled = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled) + local summonsKilled = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled) for _, k in pairs(alptramunSummons) do if cName:lower() == k.name then if summonsKilled >= k.minValue and summonsKilled <= k.maxValue then - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled, summonsKilled + 1) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, summonsKilled + 1) end end end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua index e8ab7f48368..268166d61e0 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_facelessBane.lua @@ -1,5 +1,5 @@ local summons = { "Burster Spectre", "Gazer Spectre", "Ripper Spectre" } -local storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessLifes +local storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FacelessLifes local creaturescripts_facelessBane = CreatureEvent("facelessThink") @@ -24,7 +24,7 @@ function creaturescripts_facelessBane.onThink(creature, interval) end creature:setStorageValue(storage, lifes + 1) - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTiles, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FacelessLifes, 0) end end diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua index 10147f43a49..9325e2a48e4 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_nightmareCurse.lua @@ -13,12 +13,12 @@ local function resetArea() for _, p in pairs(spectators) do local player = Player(p:getId()) if player then - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse, 0) end end end -local creaturescripts_nightmareCurse = CreatureEvent(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) +local creaturescripts_nightmareCurse = CreatureEvent("nightmareCurse") function creaturescripts_nightmareCurse.onThink(creature, interval) if not creature:isPlayer() then @@ -46,10 +46,10 @@ function creaturescripts_nightmareCurse.onThink(creature, interval) if p and p:getCondition(CONDITION_OUTFIT, phantasm) then resetArea() - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 0) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse, 0) p:teleportTo(Position(32213, 32083, 15)) p:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse, -1) - p:unregisterEvent(Storage.Quest.U12_00.TheDreamCourts.NightmareCurse) + p:unregisterEvent("nightmareCurse") end end, phantasmTime, player:getId()) elseif (stage == 1 or stage == 2) and (player:getCondition(CONDITION_OUTFIT, spectre) or player:getCondition(CONDITION_OUTFIT, phantasm)) then diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua index 29e9ef1f9f4..d3d524f4b79 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_acessTeleports.lua @@ -26,37 +26,37 @@ local dreamScar = { [1] = { day = "Monday", bossName = "Alptramun", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunTimer, }, [2] = { day = "Tuesday", bossName = "Izcandar the Banished", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, }, [3] = { day = "Wednesday", bossName = "Malofur Mangrinder", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.malofurTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MalofurTimer, }, [4] = { day = "Thursday", bossName = "Maxxenius", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer, }, [5] = { day = "Friday", bossName = "Izcandar the Banished", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.izcandarTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, }, [6] = { day = "Saturday", bossName = "Plagueroot", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.plaguerootTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.PlaguerootTimer, }, [7] = { day = "Sunday", bossName = "Maxxenius", - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.maxxeniusTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer, }, } @@ -76,8 +76,8 @@ function movements_acessTeleports.onStepIn(creature, item, position, fromPositio local nightmareTeleport = Position(32211, 32081, 15) if item:getPosition() == nightmareTeleport then - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.bossCount) >= 5 then - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.nightmareTimer) > os.time() then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount) >= 5 then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.NightmareTimer) > os.time() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to wait to challenge The Nightmare Beast again!") player:teleportTo(fromPosition) else @@ -106,7 +106,7 @@ function movements_acessTeleports.onStepIn(creature, item, position, fromPositio if iPos == dreamScarTeleport then if player:getStorageValue(permission) >= 1 then for i = 1, #dreamScar do - if os.sdate("%A") == dreamScar[i].day then + if os.date("%A") == dreamScar[i].day then if player:getStorageValue(dreamScar[i].storageTimer) > os.time() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to wait to challenge " .. dreamScar[i].bossName .. " again!") player:teleportTo(fromPosition) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua index 45ed31a7ea0..d5f61ae2bd1 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_facelessTiles.lua @@ -1,4 +1,4 @@ -local storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.facelessTiles +local storage = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedralGlobal.FacelessTiles local function setActionId(itemid, position, aid) local item = Tile(position):getItemById(itemid) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua index 241dd183a3e..00562a98375 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/movements_spiderSummon.lua @@ -1,4 +1,3 @@ -local storage = Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline local spiderName = "Lucifuga Aranea" local function setActionId(itemid, position, aid) @@ -18,7 +17,7 @@ function movements_spiderSummon.onStepIn(creature, item, position, fromPosition) return true end - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.hasBait) == 1 then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait) == 1 then local r = math.random(1, 10) Game.createMonster(spiderName, position) item:setActionId(0) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua index ab27dabde4e..2b5f1c91023 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua @@ -20,7 +20,7 @@ function spell.onCastSpell(creature, var) local monsterName = "" local randomName = math.random(1, #config) local randomSummon = math.random(1, 4) - local summonsKilled = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.alptramunSummonsKilled) or -1 + local summonsKilled = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled) or -1 if summonsKilled >= 0 and summonsKilled <= 9 then monsterName = config[1].name diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua index 0c486038a71..2a405c74748 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua @@ -1,7 +1,7 @@ local spell = Spell("instant") function spell.onCastSpell(creature, var) - local hasCasted = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse) + local hasCasted = Game.getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse) if hasCasted == 0 then local players = Game.getSpectators(cid:getPosition(), false, true, 14, 14, 14, 14) @@ -10,7 +10,7 @@ function spell.onCastSpell(creature, var) for _, k in pairs(players) do local player = Player(k) if player then - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, -1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse, -1) end end @@ -18,10 +18,10 @@ function spell.onCastSpell(creature, var) newPlayer:registerEvent("nightmareCurse") newPlayer:setStorageValue("nightmareCurse", 1) - newPlayer:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 1) + newPlayer:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.LastBossCurse, 1) newPlayer:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The beast laid a terrible curse on you!") - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.lastBossCurse, 1) + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse, 1) end end diff --git a/data-otservbr-global/startup/tables/item.lua b/data-otservbr-global/startup/tables/item.lua index f8188ad3847..2b33c30d21f 100644 --- a/data-otservbr-global/startup/tables/item.lua +++ b/data-otservbr-global/startup/tables/item.lua @@ -1252,11 +1252,30 @@ ItemAction = { { x = 33618, y = 32546, z = 13 }, }, }, + [23104] = { + itemId = 29349, + itemPos = { + {x = 33054, y = 32335, z = 8}, + {x = 33081, y = 32355, z = 8}, + {x = 33091, y = 32319, z = 8}, + {x = 33091, y = 32301, z = 8}, + {x = 33092, y = 32347, z = 8}, + {x = 33051, y = 32309, z = 8}, + {x = 33081, y = 32349, z = 8}, + {x = 33083, y = 32338, z = 8}, + {x = 33058, y = 32323, z = 8}, + {x = 33103, y = 32344, z = 8}, + {x = 33093, y = 32338, z = 8}, + {x = 33093, y = 32356, z = 8}, + {x = 33055, y = 32297, z = 8}, + }, + }, [23105] = { itemId = false, itemPos = { { x = 33070, y = 32317, z = 8 }, { x = 33069, y = 32317, z = 8 }, + { x = 33068, y = 32308, z = 8 }, }, }, [23106] = { @@ -1341,6 +1360,33 @@ ItemAction = { { x = 32757, y = 32643, z = 10 }, }, }, + [23121] = { + itemId = 8865, + itemPos = { + {x = 32745, y = 32613, z = 8}, + {x = 32811, y = 32645, z = 8}, + {x = 32749, y = 32628, z = 8}, + {x = 32781, y = 32641, z = 8}, + }, + }, + [23122] = { + itemId = 14940, + itemPos = { + {x = 32808, y = 32612, z = 9}, + {x = 32743, y = 32612, z = 9}, + {x = 32775, y = 32600, z = 9}, + {x = 32761, y = 32630, z = 9}, + }, + }, + [23123] = { + itemId = 14974, + itemPos = { + {x = 32789, y = 32613, z = 10}, + {x = 32767, y = 32638, z = 10}, + {x = 32742, y = 32636, z = 10}, + {x = 32757, y = 32606, z = 10}, + }, + }, -- Ferumbras' Ascension Quest [24837] = { itemId = 1949, diff --git a/data-otservbr-global/startup/tables/lever.lua b/data-otservbr-global/startup/tables/lever.lua index 62c40d05d82..4edba7bcd34 100644 --- a/data-otservbr-global/startup/tables/lever.lua +++ b/data-otservbr-global/startup/tables/lever.lua @@ -131,7 +131,7 @@ LeverAction = { }, -- The Dream Courts Quest [23110] = { - itemId = 9111, + itemId = 9110, itemPos = { { x = 33637, y = 32562, z = 13 }, }, diff --git a/data-otservbr-global/startup/tables/teleport_item.lua b/data-otservbr-global/startup/tables/teleport_item.lua index c09dd9e22fa..395a3c18e80 100644 --- a/data-otservbr-global/startup/tables/teleport_item.lua +++ b/data-otservbr-global/startup/tables/teleport_item.lua @@ -161,11 +161,4 @@ TeleportItemUnique = { destination = { x = 33916, y = 31466, z = 8 }, effect = CONST_ME_TELEPORT, }, - -- Faceless Bane entrance - [15004] = { - itemId = 29954, - itemPos = { x = 33619, y = 32518, z = 15 }, - destination = { x = 33640, y = 32561, z = 13 }, - effect = CONST_ME_TELEPORT, - }, } diff --git a/data-otservbr-global/world/otservbr-npc.xml b/data-otservbr-global/world/otservbr-npc.xml index 5c53601aa9c..1e94b2e50ef 100644 --- a/data-otservbr-global/world/otservbr-npc.xml +++ b/data-otservbr-global/world/otservbr-npc.xml @@ -1353,6 +1353,9 @@ + + + diff --git a/data/items/items.xml b/data/items/items.xml index c1b8e8a63ba..26610b6cf83 100644 --- a/data/items/items.xml +++ b/data/items/items.xml @@ -55707,6 +55707,7 @@ hands of its owner. Granted by TibiaRoyal.com"/> + From 4104adec12a88450643f89b47a2cbd3507959f85 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 1 Nov 2024 21:28:44 +0000 Subject: [PATCH 04/22] Lua code format - (Stylua) --- data-otservbr-global/npc/andrew_lyze.lua | 36 ++++++------- data-otservbr-global/npc/myzzi.lua | 29 ++++++----- data-otservbr-global/npc/stricken_soul.lua | 8 +-- data-otservbr-global/npc/vanys.lua | 28 +++++------ .../scripts/actions/other/enchanting.lua | 4 +- .../actions_goldenIdol.lua | 4 +- data-otservbr-global/startup/tables/item.lua | 50 +++++++++---------- 7 files changed, 80 insertions(+), 79 deletions(-) diff --git a/data-otservbr-global/npc/andrew_lyze.lua b/data-otservbr-global/npc/andrew_lyze.lua index 2438ef792f5..440b23ebfc0 100644 --- a/data-otservbr-global/npc/andrew_lyze.lua +++ b/data-otservbr-global/npc/andrew_lyze.lua @@ -71,25 +71,25 @@ local goldenAxe = 29286 local CompassValue = 10000 local buildCompass = { - [1] = {id = 29346, qnt = 15}, - [2] = {id = 29345, qnt = 50}, - [3] = {id = 29347, qnt = 5}, - [4] = {id = 25746, qnt = 1}, + [1] = { id = 29346, qnt = 15 }, + [2] = { id = 29345, qnt = 50 }, + [3] = { id = 29347, qnt = 5 }, + [4] = { id = 25746, qnt = 1 }, } local chargeCompass = { - [1] = {id = 29287, qnt = 5}, - [2] = {id = 29288, qnt = 3}, - [3] = {id = 29289, qnt = 1}, - [4] = {id = 29348, qnt = 1}, - [5] = {id = 29291, qnt = 1}, + [1] = { id = 29287, qnt = 5 }, + [2] = { id = 29288, qnt = 3 }, + [3] = { id = 29289, qnt = 1 }, + [4] = { id = 29348, qnt = 1 }, + [5] = { id = 29291, qnt = 1 }, } local function removeBait(player) local player = Player(player) if player and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait) == 1 then - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait, - 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait, -1) end end @@ -122,7 +122,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say({ "Well, a while ago powerful magic devices were used all around Tibia. These are chargeable compasses. There was but one problem: they offered the possibility to make people rich in a quite easy way. ...", "Therefore, these instruments were very coveted. People tried to get their hands on them at all costs. And so it happened what everybody feared - bloody battles forged ahead. ...", - "To put an end to these cruel escalations, eventually all of the devices were collected and destroyed. The remains were buried {deep} in the earth." + "To put an end to these cruel escalations, eventually all of the devices were collected and destroyed. The remains were buried {deep} in the earth.", }, npc, creature) npcHandler:setTopic(playerId, 2) elseif MsgContains(message, "deep") and npcHandler:getTopic(playerId) == 2 then @@ -139,7 +139,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say({ "Only in the cave down there you will find the materials you need to repair the {compass}. Now you know why the entrance is sealed. There's the seal, but I have a deal for you: ...", "I can repair the compass for you if you deliver what I need. Besides the broken compass you have to bring me the following materials: 50 blue glas plates, 15 green glas plates and 5 violet glas plates. ...", - "They all can be found in this closed cave in front of you. I should have destroyed this seal key but things have changed. The entrance is opened now, go down and do what has to be done." + "They all can be found in this closed cave in front of you. I should have destroyed this seal key but things have changed. The entrance is opened now, go down and do what has to be done.", }, npc, creature) player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, 1) npcHandler:setTopic(playerId, 0) @@ -168,7 +168,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say({ "Alright, I put the glasses into the right pattern and can repair the compass. ...", - "There we are! The next step is the charging of the compass. For this you have to dig three different crystals down there: 5 blue, 3 green and one violet crystal. Are you ready to do that?" + "There we are! The next step is the charging of the compass. For this you have to dig three different crystals down there: 5 blue, 3 green and one violet crystal. Are you ready to do that?", }, npc, creature) player:addItem(chargeableCompass, 1) player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, 2) @@ -180,7 +180,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif npcHandler:getTopic(playerId) == 12 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.GotAxe) < 1 then npcHandler:say({ "Nice! To do so, take this golden axe and mine the prominent crystals in the cave. Besides, I need a poison gland of quite rare spiders, they are called lucifuga araneae. ...", - "These are quite shy, but I have a {bait} for you to lure them. But take care not to face too many of them at once. And hurry, the effect won't last forever!" + "These are quite shy, but I have a {bait} for you to lure them. But take care not to face too many of them at once. And hurry, the effect won't last forever!", }, npc, creature) player:addItem(goldenAxe, 1) player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.GotAxe, 1) @@ -217,7 +217,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say({ "I put these crystals onto the top of compass. As you can see, the compass is now pulsating in a warm, violet colour. ...", - "Now this compass is ready for usage. It can transfer the bound energy to other inanimate objects to open certain gates or chests." + "Now this compass is ready for usage. It can transfer the bound energy to other inanimate objects to open certain gates or chests.", }, npc, creature) player:addItem(chargedCompass, 1) player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.Questline, 3) @@ -232,7 +232,7 @@ local function creatureSayCallback(npc, creature, type, message) if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait) < 1 then npcHandler:say("Done. Worry, the effect won't last forever!", npc, creature) player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.UnsafeRelease.HasBait, 1) - addEvent(removeBait, 3*60*1000, player:getId()) + addEvent(removeBait, 3 * 60 * 1000, player:getId()) npcHandler:setTopic(playerId, 0) else npcHandler:say("You're already with my bait!", npc, creature) @@ -251,7 +251,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 51) end elseif MsgContains(message, "no") then - npcHandler:say({"Don't waste my time."}, npc, creature) + npcHandler:say({ "Don't waste my time." }, npc, creature) npcHandler:setTopic(playerId, 0) else npcHandler:say("Sorry, I didn't understand.", npc, creature) @@ -260,7 +260,7 @@ local function creatureSayCallback(npc, creature, type, message) return true end -npcHandler:setMessage(MESSAGE_WALKAWAY, 'Well, bye then.') +npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye.") npcHandler:setCallback(CALLBACK_GREET, greetCallback) diff --git a/data-otservbr-global/npc/myzzi.lua b/data-otservbr-global/npc/myzzi.lua index 275768b8430..6ed01df64e5 100644 --- a/data-otservbr-global/npc/myzzi.lua +++ b/data-otservbr-global/npc/myzzi.lua @@ -66,27 +66,26 @@ local function creatureSayCallback(npc, creature, type, message) if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline) < 1 then if MsgContains(message, "good") then - npcHandler:say("I'm just a mere messenger and I'm here to find brave adventurers that might {help} my friends in this time of need.", npc, creature) - npcHandler:setTopic(playerId, 2) + npcHandler:say("I'm just a mere messenger and I'm here to find brave adventurers that might {help} my friends in this time of need.", npc, creature) + npcHandler:setTopic(playerId, 2) elseif MsgContains(message, "help") and npcHandler:getTopic(playerId) == 2 then - npcHandler:say("Lady Alivar of the Summer Court and Lord Cadion of the Winter Court are in need of brave adventurers to avert a great {threat} for the whole world.", npc, creature) - npcHandler:setTopic(playerId, 3) + npcHandler:say("Lady Alivar of the Summer Court and Lord Cadion of the Winter Court are in need of brave adventurers to avert a great {threat} for the whole world.", npc, creature) + npcHandler:setTopic(playerId, 3) elseif MsgContains(message, "threat") and npcHandler:getTopic(playerId) == 3 then - npcHandler:say({ - "I know only little and I forget so much. So many things going around my mind! ...", - "However, I can grant you access to the {Courts} of Summer and Winter if you promise to help! There you can meet with Undal or Vanys, the servants of Lord Cadion and Lady Alivar. They will be able to tell you more about the issue." - }, npc, creature) - npcHandler:setTopic(playerId, 4) + npcHandler:say({ + "I know only little and I forget so much. So many things going around my mind! ...", + "However, I can grant you access to the {Courts} of Summer and Winter if you promise to help! There you can meet with Undal or Vanys, the servants of Lord Cadion and Lady Alivar. They will be able to tell you more about the issue.", + }, npc, creature) + npcHandler:setTopic(playerId, 4) elseif MsgContains(message, "courts") and npcHandler:getTopic(playerId) == 4 then - npcHandler:say({"There are {entrances} to the hidden Courts of Summer and Winter in secluded places. You can find the portal to the Winter Court high in the mountains of Tyrsung and the portal to the Summer Court in the meadows of Feyrist. ...", - "With my magic you will be able to enter the Courts. Find Undal or Vanys and talk to them."}, npc, creature) - npcHandler:setTopic(playerId, 5) + npcHandler:say({ "There are {entrances} to the hidden Courts of Summer and Winter in secluded places. You can find the portal to the Winter Court high in the mountains of Tyrsung and the portal to the Summer Court in the meadows of Feyrist. ...", "With my magic you will be able to enter the Courts. Find Undal or Vanys and talk to them." }, npc, creature) + npcHandler:setTopic(playerId, 5) elseif MsgContains(message, "entrances") and npcHandler:getTopic(playerId) == 5 then - npcHandler:say("So, are you willing to help in this time of need?", npc, creature) - npcHandler:setTopic(playerId, 6) + npcHandler:say("So, are you willing to help in this time of need?", npc, creature) + npcHandler:setTopic(playerId, 6) elseif npcHandler:getTopic(playerId) == 6 then if MsgContains(message, "yes") then - npcHandler:say({"You are a true hero! Here, take my enchantment and you will be able to pass the portals. Now hurry, my friends are waiting."}, npc, creature) + npcHandler:say({ "You are a true hero! Here, take my enchantment and you will be able to pass the portals. Now hurry, my friends are waiting." }, npc, creature) player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline, 1) npcHandler:setTopic(playerId, 0) else diff --git a/data-otservbr-global/npc/stricken_soul.lua b/data-otservbr-global/npc/stricken_soul.lua index 2e1448fd300..e09621b6f4c 100644 --- a/data-otservbr-global/npc/stricken_soul.lua +++ b/data-otservbr-global/npc/stricken_soul.lua @@ -73,20 +73,20 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("Excellent... I hope they will haaaaaaunt my house no longer. What was your... naaaaaame again, tell me?", npc, creature) npcHandler:setTopic(playerId, 3) elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline) < 1 then - npcHandler:say("Yeeeees... you need to help meeeeeee. I want those ghosts gone... this is my home and I need it to teach my students. Will you take care of the... ghosts?", npc, creature) - npcHandler:setTopic(playerId, 2) + npcHandler:say("Yeeeees... you need to help meeeeeee. I want those ghosts gone... this is my home and I need it to teach my students. Will you take care of the... ghosts?", npc, creature) + npcHandler:setTopic(playerId, 2) end elseif MsgContains(message, playerName) then if npcHandler:getTopic(playerId) == 3 then npcHandler:say({ - " Ah yeeeeees, ".. playerName .. ". I will remember you. Now, lessons are every day in the morning and once a week in the evening... ...", + " Ah yeeeeees, " .. playerName .. ". I will remember you. Now, lessons are every day in the morning and once a week in the evening... ...", "Oh, you're not here for this, are you? So about the ghoooosts, yes. You seeeee, there are 3 secret passages here. ...", "Thiiiiis is no ordinary house... it is a nexus, a gateway to a once hidden cathedral. Sheltering a small and peaceful society of scholars and monks. Secluded from every distraction. ...", "I was one of them and ordered to hold contact to the outside woooorld. But then, something... happened. ...", "Outsiders managed to sneak in, infiltrate and influence the society... for the worse. Who knows for what ends. They chaaaaanged... ...", "Shortly after, contact was lost... the nexus broken and sealed, ghosts appeared... eeeeeeeverywhere. ...", "Find the three passages... one is right here in the cellars, one in the jungles of Tiquanda and one in the deserts of Darama. ...", - "Restore their connection and open this nexus to access the buried cathedral and find the cause to this... eliminate all remainders there if you must, "..playerName.."." + "Restore their connection and open this nexus to access the buried cathedral and find the cause to this... eliminate all remainders there if you must, " .. playerName .. ".", }, npc, creature) player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.HauntedHouse.Questline, 1) npcHandler:setTopic(playerId, 0) diff --git a/data-otservbr-global/npc/vanys.lua b/data-otservbr-global/npc/vanys.lua index b3b3cf8eb58..94abf61010d 100644 --- a/data-otservbr-global/npc/vanys.lua +++ b/data-otservbr-global/npc/vanys.lua @@ -64,21 +64,21 @@ local function creatureSayCallback(npc, creature, type, message) local dreamTalisman = 30132 if MsgContains(message, "talk") then - npcHandler:say("So do you want to learn the {story} behind of this or rather talk about the {task} at hand? ", npc, creature) - npcHandler:setTopic(playerId, 2) + npcHandler:say("So do you want to learn the {story} behind of this or rather talk about the {task} at hand? ", npc, creature) + npcHandler:setTopic(playerId, 2) elseif MsgContains(message, "story") then if npcHandler:getTopic(playerId) == 2 then npcHandler:say("Do you prefer the {long} version or the {short} version?", npc, creature) npcHandler:setTopic(playerId, 3) end elseif MsgContains(message, "short") and npcHandler:getTopic(playerId) == 3 then - npcHandler:say({ - "You will have to re-empower several wardstones all over the world, to weaken the beast of nightmares. ...", - "The next step would be to enter a place known as dream scar and participate in battles, to gain access to the lower areas. ...", - "There the nightmare beast can be challenged and defeated.", - "So do you want to learn the story behind of this or rather talk about the {task} at hand?" - }, npc, creature) - npcHandler:setTopic(playerId, 4) + npcHandler:say({ + "You will have to re-empower several wardstones all over the world, to weaken the beast of nightmares. ...", + "The next step would be to enter a place known as dream scar and participate in battles, to gain access to the lower areas. ...", + "There the nightmare beast can be challenged and defeated.", + "So do you want to learn the story behind of this or rather talk about the {task} at hand?", + }, npc, creature) + npcHandler:setTopic(playerId, 4) elseif npcHandler:getTopic(playerId) == 4 or npcHandler:getTopic(playerId) == 2 then if MsgContains(message, "task") then if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) >= 3 and not (player:hasOutfit(1146) or player:hasOutfit(1147)) then @@ -90,7 +90,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count) >= 8 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) == 1 then npcHandler:say({ "You empowered all eight ward stones. Well done! You may now enter the Dream Labyrinth via the portal here in the Court. Beneath it you will find the Nightmare Beast's lair. But the labyrinth is protected by seven so called Dream Doors. ...", - "You have to find the Seven {Keys} to unlock the Seven Dream Doors down there. Only then you will be able to enter the Nightmare Beast's lair." + "You have to find the Seven {Keys} to unlock the Seven Dream Doors down there. Only then you will be able to enter the Nightmare Beast's lair.", }, npc, creature) player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, 2) player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, 1) @@ -98,10 +98,10 @@ local function creatureSayCallback(npc, creature, type, message) elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) < 1 then npcHandler:say({ "You have to empower eight ward stones. Once charged with arcane energy, they will strengthen the Nightmare Beast's prison and at the same time weaken this terrible creature. We know about the specific location of six of those stones. ...", - "You can find them in the mountains of the island Okolnir, in a water elemental cave beneath Folda, in the depths of Calassa, in the forests of Feyrist and on the islands Meriana and Cormaya. ..." , - "The location of the other two ward stones is a bit more obscure, however. We are not completely sure where they are. You should make inquiries at an abandoned house in the Plains of Havoc. You may find it east of an outlaw camp. ..." , - "The other stone seems to be somewhere in Tiquanda. Search for a small stone building south-west of Banuta. Take this talisman to empower the ward stones. It will work with the six stones at the known locations. ..." , - "However, the empowering of the two hidden stones could be a bit more complicated. But you have to find out on yourself what to do with those stones." + "You can find them in the mountains of the island Okolnir, in a water elemental cave beneath Folda, in the depths of Calassa, in the forests of Feyrist and on the islands Meriana and Cormaya. ...", + "The location of the other two ward stones is a bit more obscure, however. We are not completely sure where they are. You should make inquiries at an abandoned house in the Plains of Havoc. You may find it east of an outlaw camp. ...", + "The other stone seems to be somewhere in Tiquanda. Search for a small stone building south-west of Banuta. Take this talisman to empower the ward stones. It will work with the six stones at the known locations. ...", + "However, the empowering of the two hidden stones could be a bit more complicated. But you have to find out on yourself what to do with those stones.", }, npc, creature) if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline) < 1 then player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline, 1) diff --git a/data-otservbr-global/scripts/actions/other/enchanting.lua b/data-otservbr-global/scripts/actions/other/enchanting.lua index 1db4448f921..6d0a3607d5a 100644 --- a/data-otservbr-global/scripts/actions/other/enchanting.lua +++ b/data-otservbr-global/scripts/actions/other/enchanting.lua @@ -45,8 +45,8 @@ local enchanting = Action() function enchanting.onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 675 and target.itemid == 21573 then - return onGrindItem(player, item, fromPosition, target, toPosition) - end + return onGrindItem(player, item, fromPosition, target, toPosition) + end if table.contains({ 33268, 33269 }, toPosition.x) and toPosition.y == 31830 and toPosition.z == 10 and player:getStorageValue(Storage.Quest.U8_2.ElementalSpheres.QuestLine) > 0 then if not table.contains(spheres[item.itemid], player:getVocation():getBaseId()) then diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua index cf59b96e9ea..2f87b8e50ba 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_goldenIdol.lua @@ -38,7 +38,9 @@ function actions_goldenIdol.onUse(player, item, fromPosition, target, toPosition local currentCount = player:getStorageValue(storageIdolCount) - if currentCount < 0 then currentCount = 0 end + if currentCount < 0 then + currentCount = 0 + end player:setStorageValue(storageIdolCount, currentCount + 1) if currentCount + 1 == totalAltars then diff --git a/data-otservbr-global/startup/tables/item.lua b/data-otservbr-global/startup/tables/item.lua index 2b33c30d21f..7a1afb788ae 100644 --- a/data-otservbr-global/startup/tables/item.lua +++ b/data-otservbr-global/startup/tables/item.lua @@ -1255,19 +1255,19 @@ ItemAction = { [23104] = { itemId = 29349, itemPos = { - {x = 33054, y = 32335, z = 8}, - {x = 33081, y = 32355, z = 8}, - {x = 33091, y = 32319, z = 8}, - {x = 33091, y = 32301, z = 8}, - {x = 33092, y = 32347, z = 8}, - {x = 33051, y = 32309, z = 8}, - {x = 33081, y = 32349, z = 8}, - {x = 33083, y = 32338, z = 8}, - {x = 33058, y = 32323, z = 8}, - {x = 33103, y = 32344, z = 8}, - {x = 33093, y = 32338, z = 8}, - {x = 33093, y = 32356, z = 8}, - {x = 33055, y = 32297, z = 8}, + { x = 33054, y = 32335, z = 8 }, + { x = 33081, y = 32355, z = 8 }, + { x = 33091, y = 32319, z = 8 }, + { x = 33091, y = 32301, z = 8 }, + { x = 33092, y = 32347, z = 8 }, + { x = 33051, y = 32309, z = 8 }, + { x = 33081, y = 32349, z = 8 }, + { x = 33083, y = 32338, z = 8 }, + { x = 33058, y = 32323, z = 8 }, + { x = 33103, y = 32344, z = 8 }, + { x = 33093, y = 32338, z = 8 }, + { x = 33093, y = 32356, z = 8 }, + { x = 33055, y = 32297, z = 8 }, }, }, [23105] = { @@ -1363,28 +1363,28 @@ ItemAction = { [23121] = { itemId = 8865, itemPos = { - {x = 32745, y = 32613, z = 8}, - {x = 32811, y = 32645, z = 8}, - {x = 32749, y = 32628, z = 8}, - {x = 32781, y = 32641, z = 8}, + { x = 32745, y = 32613, z = 8 }, + { x = 32811, y = 32645, z = 8 }, + { x = 32749, y = 32628, z = 8 }, + { x = 32781, y = 32641, z = 8 }, }, }, [23122] = { itemId = 14940, itemPos = { - {x = 32808, y = 32612, z = 9}, - {x = 32743, y = 32612, z = 9}, - {x = 32775, y = 32600, z = 9}, - {x = 32761, y = 32630, z = 9}, + { x = 32808, y = 32612, z = 9 }, + { x = 32743, y = 32612, z = 9 }, + { x = 32775, y = 32600, z = 9 }, + { x = 32761, y = 32630, z = 9 }, }, }, [23123] = { itemId = 14974, itemPos = { - {x = 32789, y = 32613, z = 10}, - {x = 32767, y = 32638, z = 10}, - {x = 32742, y = 32636, z = 10}, - {x = 32757, y = 32606, z = 10}, + { x = 32789, y = 32613, z = 10 }, + { x = 32767, y = 32638, z = 10 }, + { x = 32742, y = 32636, z = 10 }, + { x = 32757, y = 32606, z = 10 }, }, }, -- Ferumbras' Ascension Quest From 61915ce54dc4a9c8002880b5d36b8830ba97f287 Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Sat, 2 Nov 2024 10:37:02 -0300 Subject: [PATCH 05/22] The Dream Courts Quest - part 3 --- data-otservbr-global/lib/core/storages.lua | 139 +++++++------- .../npc/farhilorn_of_the_winter_court.lua | 91 +++++++++ .../npc/shirtalis_of_the_summer_court.lua | 91 +++++++++ data-otservbr-global/npc/undal.lua | 177 +++++++++--------- data-otservbr-global/npc/vanys.lua | 7 +- .../scripts/actions/other/enchanting.lua | 1 + .../scripts/actions/tools/juice_squeezer.lua | 6 + .../actions_colourfulMushroom.lua | 13 ++ .../actions_magicalPaint.lua | 2 +- .../actions_questDoors.lua | 5 +- .../actions_rosebushUse.lua | 2 +- .../monster/alptramun_summon.lua} | 0 .../monster/cold_of_winter.lua} | 0 .../monster/generator_wave.lua} | 0 .../monster/heat_of_summer.lua} | 0 .../monster/malofur_explosion.lua} | 0 .../monster/maxxenius_energy_elemental.lua} | 0 .../monster/nightmare_beast_curse.lua} | 0 .../monster/plagueroot_skill_reducer.lua} | 0 .../monster/plagueroot_teleport.lua} | 0 .../monster/plant_abomination_wave.lua} | 0 .../monster/plant_attendant_wave.lua} | 0 .../startup/tables/door_level.lua | 7 + data-otservbr-global/world/otservbr-npc.xml | 6 + 24 files changed, 381 insertions(+), 166 deletions(-) create mode 100644 data-otservbr-global/npc/farhilorn_of_the_winter_court.lua create mode 100644 data-otservbr-global/npc/shirtalis_of_the_summer_court.lua create mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_colourfulMushroom.lua rename data-otservbr-global/scripts/{quests/the_dream_courts_quest/spells_alptramun_summon.lua => spells/monster/alptramun_summon.lua} (100%) rename data-otservbr-global/scripts/{quests/the_dream_courts_quest/spells_cold_of_winter.lua => spells/monster/cold_of_winter.lua} (100%) rename data-otservbr-global/scripts/{quests/the_dream_courts_quest/spells_generator_wave.lua => spells/monster/generator_wave.lua} (100%) rename data-otservbr-global/scripts/{quests/the_dream_courts_quest/spells_heat_of_summer.lua => spells/monster/heat_of_summer.lua} (100%) rename data-otservbr-global/scripts/{quests/the_dream_courts_quest/spells_malofur_explosion.lua => spells/monster/malofur_explosion.lua} (100%) rename data-otservbr-global/scripts/{quests/the_dream_courts_quest/spells_maxxenius_energy_elemental.lua => spells/monster/maxxenius_energy_elemental.lua} (100%) rename data-otservbr-global/scripts/{quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua => spells/monster/nightmare_beast_curse.lua} (100%) rename data-otservbr-global/scripts/{quests/the_dream_courts_quest/spells_plagueroot_skill_reducer.lua => spells/monster/plagueroot_skill_reducer.lua} (100%) rename data-otservbr-global/scripts/{quests/the_dream_courts_quest/spells_plagueroot_teleport.lua => spells/monster/plagueroot_teleport.lua} (100%) rename data-otservbr-global/scripts/{quests/the_dream_courts_quest/spells_plant_abomination_wave.lua => spells/monster/plant_abomination_wave.lua} (100%) rename data-otservbr-global/scripts/{quests/the_dream_courts_quest/spells_plant_attendant_wave.lua => spells/monster/plant_attendant_wave.lua} (100%) diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index e1c2f913539..b7fbab65af4 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -2714,91 +2714,92 @@ Storage = { U12_00 = { -- update 12.00 - Reserved Storages 46301 - 46600 TheDreamCourts = { Main = { - Questline = 23000, - CourtChest = 23001, + Questline = 46301, + CourtChest = 46302, + TheSummerCourt = 46303, + TheWinterCourt = 46304, }, WardStones = { - Questline = 23100, - Count = 23101, - OkolnirStone = 23102, - FoldaStone = 23103, - CalassaStone = 23104, - FeyristStone = 23105, - MerianaStone = 23106, - CormayaStone = 23107, - PortHopeStone = 23108, - CatedralStone = 23109, + Questline = 46305, + Count = 46306, + OkolnirStone = 46307, + FoldaStone = 46308, + CalassaStone = 46309, + FeyristStone = 46310, + MerianaStone = 46311, + CormayaStone = 46312, + PortHopeStone = 46313, + CatedralStone = 46314, }, UnsafeRelease = { - Questline = 23115, - GotAxe = 23116, - HasBait = 23117, + Questline = 46315, + GotAxe = 46316, + HasBait = 46317, }, HauntedHouse = { - Questline = 23130, - SkeletonContainer = 23131, - Cellar = 23132, - Temple = 23133, - Tomb = 23134, - IdolCount = 2313555, + Questline = 46318, + SkeletonContainer = 46319, + Cellar = 46320, + Temple = 46321, + Tomb = 46322, + IdolCount = 46323, }, BurriedCatedral = { - FishingRod = 23145, - EstatueWord = 23146, - BarrelWord = 23147, - BedWord = 23148, - LakeWord = 23149, - WordCount = 23150, - SequenceBooks = 23151, - FacelessTimer = 23152, - FacelessLifes = 23153, + FishingRod = 46324, + EstatueWord = 46325, + BarrelWord = 46326, + BedWord = 46327, + LakeWord = 46328, + WordCount = 46329, + SequenceBooks = 46330, + FacelessTimer = 46331, + FacelessLifes = 46332, }, TheSevenKeys = { - Questline = 23170, - RoseBush = 23171, - MushRoom = 23172, - Book = 23173, - OrcSkull = 23174, - Recipe = 23175, - MinotaurSkull = 23176, - TrollSkull = 23177, - Lock = 23178, - DoorMedusa = 23179, - DoorInvisible = 23180, - Painting = 23181, - SequenceSkulls = 23182, - Count = 23185, + Questline = 46333, + RoseBush = 46334, + MushRoom = 46335, + Book = 46336, + OrcSkull = 46337, + Recipe = 46338, + MinotaurSkull = 46339, + TrollSkull = 46340, + Lock = 46341, + DoorMedusa = 46342, + DoorInvisible = 46343, + Painting = 46344, + SequenceSkulls = 46345, + Count = 46346, }, DreamScar = { - Permission = 23190, - BossCount = 23191, - MaxxeniusTimer = 23192, - AlptramunTimer = 23193, - PlagueRootTimer = 23194, - IzcandarTimer = 23195, - MalofurTimer = 23196, - NightmareTimer = 23197, - LastBossCurse = 23198, + Permission = 46347, + BossCount = 46348, + MaxxeniusTimer = 46349, + AlptramunTimer = 46350, + PlagueRootTimer = 46351, + IzcandarTimer = 46352, + MalofurTimer = 46353, + NightmareTimer = 46354, + LastBossCurse = 46355, }, BurriedCatedralGlobal = { - FacelessTiles = 531900, - FacelessTimer = 531901, + FacelessTiles = 46356, + FacelessTimer = 46357, }, DreamScarGlobal = { - MaxxeniusTimer = 531902, - AlptramunTimer = 531903, - PlagueRootTimer = 531904, - IzcandarTimer = 531905, - MalofurTimer = 531906, - AlptramunSummonsKilled = 531907, - IzcandarOutfit = 531908, - NightmareTimer = 531909, - LastBossCurse = 531910, - }, - NightmareCurse = 531810, - Malofur = 531811, - }, - DreamWarriorOutfits = {}, + MaxxeniusTimer = 46358, + AlptramunTimer = 46359, + PlagueRootTimer = 46360, + IzcandarTimer = 46361, + MalofurTimer = 46362, + AlptramunSummonsKilled = 46363, + IzcandarOutfit = 46364, + NightmareTimer = 46365, + LastBossCurse = 46366, + }, + NightmareCurse = 46367, + Malofur = 46368, + }, }, U12_02 = { -- update 12.02 - Reserved Storages 46601 - 46800 TibiaAnniversary = {}, diff --git a/data-otservbr-global/npc/farhilorn_of_the_winter_court.lua b/data-otservbr-global/npc/farhilorn_of_the_winter_court.lua new file mode 100644 index 00000000000..545e4f88406 --- /dev/null +++ b/data-otservbr-global/npc/farhilorn_of_the_winter_court.lua @@ -0,0 +1,91 @@ +local internalNpcName = "Farhilorn Of The Winter Court" +local npcType = Game.createNpcType(internalNpcName) +local npcConfig = {} + +npcConfig.name = internalNpcName +npcConfig.description = internalNpcName + +npcConfig.health = 100 +npcConfig.maxHealth = npcConfig.health +npcConfig.walkInterval = 2000 +npcConfig.walkRadius = 2 + +npcConfig.outfit = { + lookType = 990, + lookHead = 0, + lookBody = 0, + lookLegs = 0, + lookFeet = 0, + lookAddons = 0, +} + +npcConfig.flags = { + floorchange = false, +} + +local keywordHandler = KeywordHandler:new() +local npcHandler = NpcHandler:new(keywordHandler) + +npcType.onThink = function(npc, interval) + npcHandler:onThink(npc, interval) +end + +npcType.onAppear = function(npc, creature) + npcHandler:onAppear(npc, creature) +end + +npcType.onDisappear = function(npc, creature) + npcHandler:onDisappear(npc, creature) +end + +npcType.onMove = function(npc, creature, fromPosition, toPosition) + npcHandler:onMove(npc, creature, fromPosition, toPosition) +end + +npcType.onSay = function(npc, creature, type, message) + npcHandler:onSay(npc, creature, type, message) +end + +npcType.onCloseChannel = function(npc, creature) + npcHandler:onCloseChannel(npc, creature) +end + +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "fight") then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.Permission) < 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheWinterCourt) == 1 then + npcHandler:say("We allow able champions of all races to fight for our cause against the challenges of the {arena}. So are you interested? I'm not interested in fancy'wordplay, so a simple {yes} or {no} will suffice!", npc, creature) + npcHandler:setTopic(playerId, 2) + end + elseif MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 2 then + npcHandler:say("You are now able to enter the teleport.", npc, creature) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.Permission, 1) + npcHandler:setTopic(playerId, 0) + end + elseif MsgContains(message, "no") then + npcHandler:say("As you wish.", npc, creature) + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "arena") then + npcHandler:say("This place has always been a site where the champions of summer and winter have clashed in battle. Over the centuries this spectacle has drawn many creatures here to watch, participate and indulge in less savory activities.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + + return true +end + +npcHandler:setMessage(MESSAGE_GREET, "Hello fighter. I guess you are here to {fight} for our noble {cause}.") +npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") + +npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) + +npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) + +-- npcType registering the npcConfig table +npcType:register(npcConfig) diff --git a/data-otservbr-global/npc/shirtalis_of_the_summer_court.lua b/data-otservbr-global/npc/shirtalis_of_the_summer_court.lua new file mode 100644 index 00000000000..bc4534f0cf8 --- /dev/null +++ b/data-otservbr-global/npc/shirtalis_of_the_summer_court.lua @@ -0,0 +1,91 @@ +local internalNpcName = "Shirtalis Of The Summer Court" +local npcType = Game.createNpcType(internalNpcName) +local npcConfig = {} + +npcConfig.name = internalNpcName +npcConfig.description = internalNpcName + +npcConfig.health = 100 +npcConfig.maxHealth = npcConfig.health +npcConfig.walkInterval = 2000 +npcConfig.walkRadius = 2 + +npcConfig.outfit = { + lookType = 990, + lookHead = 0, + lookBody = 0, + lookLegs = 0, + lookFeet = 0, + lookAddons = 0, +} + +npcConfig.flags = { + floorchange = false, +} + +local keywordHandler = KeywordHandler:new() +local npcHandler = NpcHandler:new(keywordHandler) + +npcType.onThink = function(npc, interval) + npcHandler:onThink(npc, interval) +end + +npcType.onAppear = function(npc, creature) + npcHandler:onAppear(npc, creature) +end + +npcType.onDisappear = function(npc, creature) + npcHandler:onDisappear(npc, creature) +end + +npcType.onMove = function(npc, creature, fromPosition, toPosition) + npcHandler:onMove(npc, creature, fromPosition, toPosition) +end + +npcType.onSay = function(npc, creature, type, message) + npcHandler:onSay(npc, creature, type, message) +end + +npcType.onCloseChannel = function(npc, creature) + npcHandler:onCloseChannel(npc, creature) +end + +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "fight") then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.Permission) < 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheSummerCourt) == 1 then + npcHandler:say("We allow able champions of all races to fight for our cause against the challenges of the {arena}. So are you interested? I'm not interested in fancy'wordplay, so a simple {yes} or {no} will suffice!", npc, creature) + npcHandler:setTopic(playerId, 2) + end + elseif MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 2 then + npcHandler:say("You are now able to enter the teleport.", npc, creature) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScar.Permission, 1) + npcHandler:setTopic(playerId, 0) + end + elseif MsgContains(message, "no") then + npcHandler:say("As you wish.", npc, creature) + npcHandler:setTopic(playerId, 0) + elseif MsgContains(message, "arena") then + npcHandler:say("This place has always been a site where the champions of summer and winter have clashed in battle. Over the centuries this spectacle has drawn many creatures here to watch, participate and indulge in less savory activities.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + + return true +end + +npcHandler:setMessage(MESSAGE_GREET, "Hello fighter. I guess you are here to {fight} for our noble {cause}.") +npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") + +npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) + +npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) + +-- npcType registering the npcConfig table +npcType:register(npcConfig) diff --git a/data-otservbr-global/npc/undal.lua b/data-otservbr-global/npc/undal.lua index ad0346e7e77..b4c44d3369a 100644 --- a/data-otservbr-global/npc/undal.lua +++ b/data-otservbr-global/npc/undal.lua @@ -53,36 +53,6 @@ end npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) -local outfits = { 1147, 1146 } - -local function hasOutfit(player) - for _, outfit in ipairs(outfits) do - if player:hasOutfit(outfit) then - return true - end - end - return false -end - -local function hasAddon(player, addon) - for _, outfit in ipairs(outfits) do - if player:hasOutfit(outfit, addon) then - return true - end - end - return false -end - -local function hasKllledTheNightmareBeast(player) - return player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.NightmareBeastKilled) == 1 -end - -local function checkAchievement(player) - if hasAddon(player, 3) then - player:addAchievement("Dream Warrior") - end -end - local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -91,82 +61,113 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if npcHandler:getTopic(playerId) == 0 then - if MsgContains(message, "task") or MsgContains(message, "outfit") then - if hasOutfit(player) then - npcHandler:say("You already have the Dream Warrior outfit.", npc, creature) - return true - end - - if not hasKllledTheNightmareBeast(player) then - npcHandler:say("You need to kill the Nightmare Beast first.", npc, creature) - return true - end + local dreamTalisman = 30132 - npcHandler:say("The Nightmare Beast is slain. You have done well. The Courts of Summer and Winter will be forever grateful. For your efforts I want to reward you with our traditional dream warrior outfit. May it suit you well!", npc, creature) - for _, outfit in ipairs(outfits) do - player:addOutfit(outfit, 0) - end - return true + if MsgContains(message, "talk") then + npcHandler:say("So do you want to learn the {story} behind of this or rather talk about the {task} at hand? ", npc, creature) + npcHandler:setTopic(playerId, 2) + elseif MsgContains(message, "story") then + if npcHandler:getTopic(playerId) == 2 then + npcHandler:say("Do you prefer the {long} version or the {short} version?", npc, creature) + npcHandler:setTopic(playerId, 3) end - - if MsgContains(message, "addon") then - if not hasOutfit(player) then - npcHandler:say("You don't have the Dream Warrior outfit.", npc, creature) - return true + elseif MsgContains(message, "short") and npcHandler:getTopic(playerId) == 3 then + npcHandler:say({ + "You will have to re-empower several wardstones all over the world, to weaken the beast of nightmares. ...", + "The next step would be to enter a place known as dream scar and participate in battles, to gain access to the lower areas. ...", + "There the nightmare beast can be challenged and defeated.", + "So do you want to learn the story behind of this or rather talk about the {task} at hand?", + }, npc, creature) + npcHandler:setTopic(playerId, 4) + elseif npcHandler:getTopic(playerId) == 4 or npcHandler:getTopic(playerId) == 2 then + if MsgContains(message, "task") then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) >= 3 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheWinterCourt) == 1 and not (player:hasOutfit(1146) or player:hasOutfit(1147)) then + npcHandler:say("The Nightmare Beast is slain. You have done well. The Courts of Summer and Winter will be forever grateful. For your efforts I want to reward you with our traditional dream warrior outfit. May it suit you well!", npc, creature) + for i = 1146, 1147 do + player:addOutfit(i) + end + npcHandler:setTopic(playerId, 0) + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count) >= 8 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheWinterCourt) == 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) == 1 then + npcHandler:say({ + "You empowered all eight ward stones. Well done! You may now enter the Dream Labyrinth via the portal here in the Court. Beneath it you will find the Nightmare Beast's lair. But the labyrinth is protected by seven so called Dream Doors. ...", + "You have to find the Seven {Keys} to unlock the Seven Dream Doors down there. Only then you will be able to enter the Nightmare Beast's lair.", + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, 2) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, 1) + npcHandler:setTopic(playerId, 5) + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) < 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheSummerCourt) < 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheWinterCourt) < 1 then + npcHandler:say({ + "You have to empower eight ward stones. Once charged with arcane energy, they will strengthen the Nightmare Beast's prison and at the same time weaken this terrible creature. We know about the specific location of six of those stones. ...", + "You can find them in the mountains of the island Okolnir, in a water elemental cave beneath Folda, in the depths of Calassa, in the forests of Feyrist and on the islands Meriana and Cormaya. ...", + "The location of the other two ward stones is a bit more obscure, however. We are not completely sure where they are. You should make inquiries at an abandoned house in the Plains of Havoc. You may find it east of an outlaw camp. ...", + "The other stone seems to be somewhere in Tiquanda. Search for a small stone building south-west of Banuta. Take this talisman to empower the ward stones. It will work with the six stones at the known locations. ...", + "However, the empowering of the two hidden stones could be a bit more complicated. But you have to find out on yourself what to do with those stones.", + }, npc, creature) + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline) < 1 then + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline, 1) + end + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheWinterCourt, 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count, 0) + player:addItem(dreamTalisman, 1) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("I already gave your task.", npc, creature) + npcHandler:setTopic(playerId, 0) end - npcHandler:say("Are you interested in one or two addons to your dream warrior outfit?", npc, creature) - npcHandler:setTopic(playerId, 1) - return true end - elseif npcHandler:getTopic(playerId) == 1 then - if MsgContains(message, "yes") then - npcHandler:say("I provide two addons. For the first one I need you to bring me five pomegranates. For the second addon you need an ice shield. Which one would you like? {Pomegranate} or {shield}?", npc, creature) - npcHandler:setTopic(playerId, 2) + elseif MsgContains(message, "keys") and npcHandler:getTopic(playerId) == 5 then + npcHandler:say("They are not literally keys but rather puzzles you have to solve or a secret mechanism you have to discover in order to open the Dream Doors. A parchment in the chest here can tell you more about it.", npc, creature) + elseif MsgContains(message, "addon") then + if player:hasOutfit(1146) or player:hasOutfit(1147) then + npcHandler:say("Are you interested in one or two addons to your dream warrior outfit?", npc, creature) + npcHandler:setTopic(playerId, 6) else - npcHandler:say("Alright then. Come back if you change your mind.", npc, creature) - npcHandler:setTopic(playerId, 0) + npcHandler:say("You don't even have the outfit.", npc, creature) end - elseif npcHandler:getTopic(playerId) == 2 then - if MsgContains(message, "pomegranate") then - if hasAddon(player, 1) then - npcHandler:say("You already have this addon.", npc, creature) - return true - end - if player:removeItem(30169, 5) then - npcHandler:say("Great! Here is the addon.", npc, creature) - for _, outfit in ipairs(outfits) do - player:addOutfitAddon(outfit, 1) + elseif MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 6 then + npcHandler:say("I provide two addons. For the first one I need you to bring me five pomegranates. For the second addon you need an ice shield. Do you want one of these addons?", npc, creature) + npcHandler:setTopic(playerId, 7) + elseif npcHandler:getTopic(playerId) == 7 then + npcHandler:say("What do you have for me: the {pomegranates} or the {ice shield}?", npc, creature) + npcHandler:setTopic(playerId, 8) + end + elseif npcHandler:getTopic(playerId) == 8 then + if MsgContains(message, "pomegranates") then + if player:getItemCount(30169) >= 5 then + npcHandler:say("Very good! You gained the second addon to the dream warrior outfit.", npc, creature) + player:removeItem(30169, 5) + for i = 1146, 1147 do + player:addOutfitAddon(i, 2) end - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - checkAchievement(player) npcHandler:setTopic(playerId, 0) else - npcHandler:say("Sorry, you don't have the required items.", npc, creature) - end - elseif MsgContains(message, "shield") then - if hasAddon(player, 2) then - npcHandler:say("You already have this addon.", npc, creature) - return true + npcHandler:say("You do not have enough items.", npc, creature) + npcHandler:setTopic(playerId, 0) end - if player:removeItem(30168, 1) then - npcHandler:say("Great! Here is the addon.", npc, creature) - for _, outfit in ipairs(outfits) do - player:addOutfitAddon(outfit, 2) + elseif MsgContains(message, "ice shield") then + if player:getItemCount(30168) >= 1 then + npcHandler:say("Very good! You gained the first addon to the dream warrior outfit.", npc, creature) + player:removeItem(30168, 1) + for i = 1146, 1147 do + player:addOutfitAddon(i, 1) end - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) - checkAchievement(player) npcHandler:setTopic(playerId, 0) else - npcHandler:say("Sorry, you don't have the required items.", npc, creature) + npcHandler:say("You do not have enough items.", npc, creature) + npcHandler:setTopic(playerId, 0) end - else - npcHandler:say("Sorry, I didn't understand.", npc, creature) - return true end + else + npcHandler:say("Sorry, I didn't understand.", npc, creature) end end +npcHandler:setMessage(MESSAGE_GREET, "Greetings hero. I guess you came to {talk}.") +npcHandler:setMessage(MESSAGE_FAREWELL, "Well, bye then.") +npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") + npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) -- npcType registering the npcConfig table diff --git a/data-otservbr-global/npc/vanys.lua b/data-otservbr-global/npc/vanys.lua index 94abf61010d..643af953d9c 100644 --- a/data-otservbr-global/npc/vanys.lua +++ b/data-otservbr-global/npc/vanys.lua @@ -81,13 +81,13 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 4) elseif npcHandler:getTopic(playerId) == 4 or npcHandler:getTopic(playerId) == 2 then if MsgContains(message, "task") then - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) >= 3 and not (player:hasOutfit(1146) or player:hasOutfit(1147)) then + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) >= 3 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheSummerCourt) == 1 and not (player:hasOutfit(1146) or player:hasOutfit(1147)) then npcHandler:say("The Nightmare Beast is slain. You have done well. The Courts of Summer and Winter will be forever grateful. For your efforts I want to reward you with our traditional dream warrior outfit. May it suit you well!", npc, creature) for i = 1146, 1147 do player:addOutfit(i) end npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count) >= 8 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) == 1 then + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count) >= 8 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheSummerCourt) == 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) == 1 then npcHandler:say({ "You empowered all eight ward stones. Well done! You may now enter the Dream Labyrinth via the portal here in the Court. Beneath it you will find the Nightmare Beast's lair. But the labyrinth is protected by seven so called Dream Doors. ...", "You have to find the Seven {Keys} to unlock the Seven Dream Doors down there. Only then you will be able to enter the Nightmare Beast's lair.", @@ -95,7 +95,7 @@ local function creatureSayCallback(npc, creature, type, message) player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, 2) player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Questline, 1) npcHandler:setTopic(playerId, 5) - elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) < 1 then + elseif player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline) < 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheSummerCourt) < 1 and player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheWinterCourt) < 1 then npcHandler:say({ "You have to empower eight ward stones. Once charged with arcane energy, they will strengthen the Nightmare Beast's prison and at the same time weaken this terrible creature. We know about the specific location of six of those stones. ...", "You can find them in the mountains of the island Okolnir, in a water elemental cave beneath Folda, in the depths of Calassa, in the forests of Feyrist and on the islands Meriana and Cormaya. ...", @@ -106,6 +106,7 @@ local function creatureSayCallback(npc, creature, type, message) if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline) < 1 then player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.Questline, 1) end + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.Main.TheSummerCourt, 1) player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Questline, 1) player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.WardStones.Count, 0) player:addItem(dreamTalisman, 1) diff --git a/data-otservbr-global/scripts/actions/other/enchanting.lua b/data-otservbr-global/scripts/actions/other/enchanting.lua index 6d0a3607d5a..c1eada42b98 100644 --- a/data-otservbr-global/scripts/actions/other/enchanting.lua +++ b/data-otservbr-global/scripts/actions/other/enchanting.lua @@ -44,6 +44,7 @@ local enchantedItems = { local enchanting = Action() function enchanting.onUse(player, item, fromPosition, target, toPosition, isHotkey) + -- The Dream Courts Quest if item.itemid == 675 and target.itemid == 21573 then return onGrindItem(player, item, fromPosition, target, toPosition) end diff --git a/data-otservbr-global/scripts/actions/tools/juice_squeezer.lua b/data-otservbr-global/scripts/actions/tools/juice_squeezer.lua index 127ad921b13..6af4a962881 100644 --- a/data-otservbr-global/scripts/actions/tools/juice_squeezer.lua +++ b/data-otservbr-global/scripts/actions/tools/juice_squeezer.lua @@ -3,6 +3,12 @@ local fruits = { 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 359 local juiceSqueezer = Action() function juiceSqueezer.onUse(player, item, fromPosition, target, toPosition, isHotkey) + -- The Dream Courts Quest + if target.itemid == 29995 then + target:transform(30003) + return true + end + if table.contains(fruits, target.itemid) and player:removeItem(2874, 1, 0) then target:remove(1) player:addItem(2874, target.itemid == 3589 and 14 or 21) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_colourfulMushroom.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_colourfulMushroom.lua new file mode 100644 index 00000000000..2ad3c2c1049 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_colourfulMushroom.lua @@ -0,0 +1,13 @@ +local actions_colourfulMushroom = Action() + +function actions_colourfulMushroom.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MushRoom) == 1 then + player:removeItem(30009, 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MushRoom, 2) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count) + 1) + return true + end +end + +actions_colourfulMushroom:id(30009) +actions_colourfulMushroom:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_magicalPaint.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_magicalPaint.lua index 6267670d439..241fce4b2e9 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_magicalPaint.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_magicalPaint.lua @@ -41,5 +41,5 @@ function actions_magicalPaint.onUse(player, item, fromPosition, target, toPositi end end -actions_magicalPaint:aid(23109) +actions_magicalPaint:id(29994, 30003, 30004, 30005, 30006) actions_magicalPaint:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua index 6fbbd95636e..2b681f578cb 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_questDoors.lua @@ -63,7 +63,7 @@ local doors = { }, [13] = { doorPosition = Position(32051, 31998, 14), - storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Mushroom, + storage = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MushRoom, value = 2, }, [14] = { @@ -114,18 +114,15 @@ function actions_questDoors.onUse(player, item, fromPosition, target, toPosition player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count, (count < 0 and 1 or count + 1)) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "As Medusa's Ointment takes effect, the door is unpetrified. You can use it now.") end - local newPos = (iPos.y < player:getPosition().y) and Position(iPos.x, iPos.y - 3, iPos.z) or Position(iPos.x, iPos.y + 3, iPos.z) player:teleportTo(newPos) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - item:transform(item.itemid + 1) addEvent(closeDoor, 2000, iPos, item.itemid) elseif p.help == "Lock" then if player:getStorageValue(p.storage) >= p.value then local newPos = (iPos.y < player:getPosition().y) and Position(iPos.x, iPos.y - 1, iPos.z) or Position(iPos.x, iPos.y + 1, iPos.z) player:teleportTo(newPos) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - item:transform(item.itemid + 1) addEvent(closeDoor, 2000, iPos, item.itemid) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The lock in this door is missing. Perhaps you can find a matching lock somewhere?") diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_rosebushUse.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_rosebushUse.lua index 4238357f85f..9a077595cc7 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_rosebushUse.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_rosebushUse.lua @@ -1,5 +1,5 @@ local earthPosition = Position(32014, 32035, 13) -local Rosebush = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Rosebush +local Rosebush = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.RoseBush local keysCount = Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count local actions_rosebushUse = Action() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua b/data-otservbr-global/scripts/spells/monster/alptramun_summon.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_alptramun_summon.lua rename to data-otservbr-global/scripts/spells/monster/alptramun_summon.lua diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_cold_of_winter.lua b/data-otservbr-global/scripts/spells/monster/cold_of_winter.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_cold_of_winter.lua rename to data-otservbr-global/scripts/spells/monster/cold_of_winter.lua diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_generator_wave.lua b/data-otservbr-global/scripts/spells/monster/generator_wave.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_generator_wave.lua rename to data-otservbr-global/scripts/spells/monster/generator_wave.lua diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_heat_of_summer.lua b/data-otservbr-global/scripts/spells/monster/heat_of_summer.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_heat_of_summer.lua rename to data-otservbr-global/scripts/spells/monster/heat_of_summer.lua diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_malofur_explosion.lua b/data-otservbr-global/scripts/spells/monster/malofur_explosion.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_malofur_explosion.lua rename to data-otservbr-global/scripts/spells/monster/malofur_explosion.lua diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_maxxenius_energy_elemental.lua b/data-otservbr-global/scripts/spells/monster/maxxenius_energy_elemental.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_maxxenius_energy_elemental.lua rename to data-otservbr-global/scripts/spells/monster/maxxenius_energy_elemental.lua diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua b/data-otservbr-global/scripts/spells/monster/nightmare_beast_curse.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_nightmare_beast_curse.lua rename to data-otservbr-global/scripts/spells/monster/nightmare_beast_curse.lua diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_skill_reducer.lua b/data-otservbr-global/scripts/spells/monster/plagueroot_skill_reducer.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_skill_reducer.lua rename to data-otservbr-global/scripts/spells/monster/plagueroot_skill_reducer.lua diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_teleport.lua b/data-otservbr-global/scripts/spells/monster/plagueroot_teleport.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plagueroot_teleport.lua rename to data-otservbr-global/scripts/spells/monster/plagueroot_teleport.lua diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_abomination_wave.lua b/data-otservbr-global/scripts/spells/monster/plant_abomination_wave.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_abomination_wave.lua rename to data-otservbr-global/scripts/spells/monster/plant_abomination_wave.lua diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_attendant_wave.lua b/data-otservbr-global/scripts/spells/monster/plant_attendant_wave.lua similarity index 100% rename from data-otservbr-global/scripts/quests/the_dream_courts_quest/spells_plant_attendant_wave.lua rename to data-otservbr-global/scripts/spells/monster/plant_attendant_wave.lua diff --git a/data-otservbr-global/startup/tables/door_level.lua b/data-otservbr-global/startup/tables/door_level.lua index 4739b040753..dd8285f4174 100644 --- a/data-otservbr-global/startup/tables/door_level.lua +++ b/data-otservbr-global/startup/tables/door_level.lua @@ -100,4 +100,11 @@ LevelDoorAction = { { x = 33214, y = 31671, z = 13 }, }, }, + -- Doors for level 250 + [1250] = { + itemId = false, + itemPos = { + { x = 32016, y = 32023, z = 13 }, + }, + }, } diff --git a/data-otservbr-global/world/otservbr-npc.xml b/data-otservbr-global/world/otservbr-npc.xml index 1e94b2e50ef..16600fdb4a1 100644 --- a/data-otservbr-global/world/otservbr-npc.xml +++ b/data-otservbr-global/world/otservbr-npc.xml @@ -2791,6 +2791,12 @@ + + + + + + From c12c262be4d3ea97dca2c01c9f143659ba0e32ec Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 2 Nov 2024 13:38:37 +0000 Subject: [PATCH 06/22] Lua code format - (Stylua) --- .../scripts/actions/tools/juice_squeezer.lua | 8 ++++---- .../actions_colourfulMushroom.lua | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/data-otservbr-global/scripts/actions/tools/juice_squeezer.lua b/data-otservbr-global/scripts/actions/tools/juice_squeezer.lua index 6af4a962881..311485c1c42 100644 --- a/data-otservbr-global/scripts/actions/tools/juice_squeezer.lua +++ b/data-otservbr-global/scripts/actions/tools/juice_squeezer.lua @@ -5,10 +5,10 @@ local juiceSqueezer = Action() function juiceSqueezer.onUse(player, item, fromPosition, target, toPosition, isHotkey) -- The Dream Courts Quest if target.itemid == 29995 then - target:transform(30003) - return true - end - + target:transform(30003) + return true + end + if table.contains(fruits, target.itemid) and player:removeItem(2874, 1, 0) then target:remove(1) player:addItem(2874, target.itemid == 3589 and 14 or 21) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_colourfulMushroom.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_colourfulMushroom.lua index 2ad3c2c1049..4fba50d7cb3 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_colourfulMushroom.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_colourfulMushroom.lua @@ -1,12 +1,12 @@ local actions_colourfulMushroom = Action() function actions_colourfulMushroom.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MushRoom) == 1 then - player:removeItem(30009, 1) - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MushRoom, 2) - player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count) + 1) - return true - end + if player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MushRoom) == 1 then + player:removeItem(30009, 1) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.MushRoom, 2) + player:setStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count, player:getStorageValue(Storage.Quest.U12_00.TheDreamCourts.TheSevenKeys.Count) + 1) + return true + end end actions_colourfulMushroom:id(30009) From fd083289a2835a50325c1b3cb29305d736acf777 Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Sat, 2 Nov 2024 11:29:59 -0300 Subject: [PATCH 07/22] The Dream Courts Quest - part 4 --- data-otservbr-global/startup/tables/door_level.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data-otservbr-global/startup/tables/door_level.lua b/data-otservbr-global/startup/tables/door_level.lua index dd8285f4174..4108d0a044e 100644 --- a/data-otservbr-global/startup/tables/door_level.lua +++ b/data-otservbr-global/startup/tables/door_level.lua @@ -105,6 +105,8 @@ LevelDoorAction = { itemId = false, itemPos = { { x = 32016, y = 32023, z = 13 }, + { x = 32017, y = 31978, z = 13 }, + { x = 32041, y = 31938, z = 13 }, }, }, } From 89fb651640b0990f81129614b5af0a2987101dc5 Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Sat, 2 Nov 2024 12:33:54 -0300 Subject: [PATCH 08/22] Update globalevents_dream_courts_worldchange.lua --- .../globalevents_dream_courts_worldchange.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua index 525d59b1f39..348f1e4bfb0 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua @@ -14,10 +14,10 @@ local globalevents_dream_courts_worldchange = GlobalEvent("startupCourts") function globalevents_dream_courts_worldchange.onStartup(interval) if spawnByDay then - print(">> [dream courts] loaded: " .. config[os.date("%A")]) + logger.info("[The Dream Courts Quest] loaded: " .. config[os.date("%A")]) Game.loadMap("data/world/worldchanges/dream_courts_bosses/" .. config[os.date("%A")] .. ".otbm") else - print(">> dream courts boss: not boss today") + logger.warn("[The Dream Courts Quest] bosses: not boss today") end return true end @@ -28,10 +28,10 @@ local globalevents_dream_courts_worldchange = GlobalEvent("fixCourts") function globalevents_dream_courts_worldchange.onTime(interval) if spawnByDay then - print(">> [dream courts] loaded: " .. config[os.date("%A")]) + logger.info("[The Dream Courts Quest] loaded: " .. config[os.date("%A")]) Game.loadMap("data/world/worldchanges/dream_courts_bosses/" .. config[os.date("%A")] .. ".otbm") else - print(">> dream courts boss: not boss today") + logger.warn("[The Dream Courts Quest] bosses: not boss today") end return true From fa5db169ebc61d9cc355051a013bfbcddc6deed5 Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Sat, 2 Nov 2024 14:28:48 -0300 Subject: [PATCH 09/22] The Dream Courts Quest - End --- .../the_dream_courts/bosses/alptramun.lua | 1 - .../the_dream_courts/bosses/maxxenius.lua | 1 - .../the_dream_courts/bosses/plagueroot.lua | 1 - .../actions_dreamscarLevers.lua | 9 ++-- .../creaturescripts_dreamCourtsDeath.lua | 2 +- .../globalevents_dream_courts_worldchange.lua | 41 ------------------- .../globalevents_the_dream_courts.lua} | 13 +++--- data-otservbr-global/startup/tables/item.lua | 1 + 8 files changed, 12 insertions(+), 57 deletions(-) delete mode 100644 data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua rename data-otservbr-global/scripts/{world_changes/the_dream_courts.lua => quests/the_dream_courts_quest/globalevents_the_dream_courts.lua} (61%) diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua index ecc656ee04e..a32a08f0409 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua @@ -22,7 +22,6 @@ monster.manaCost = 0 monster.events = { "dreamCourtsDeath", - "facelessHealth", } monster.changeTarget = { diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua index 1d1049bd8d8..03459e0dc59 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/maxxenius.lua @@ -22,7 +22,6 @@ monster.manaCost = 0 monster.events = { "dreamCourtsDeath", - "facelessHealth", } monster.changeTarget = { diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua index 47604fd9c8a..bbe6eb790b2 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua @@ -22,7 +22,6 @@ monster.manaCost = 0 monster.events = { "dreamCourtsDeath", - "facelessHealth", } monster.changeTarget = { diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua index 531bee268a9..a130f090453 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua @@ -1,6 +1,6 @@ local transform = { - [9110] = 9111, - [9111] = 9110, + [8911] = 8912, + [8912] = 8911, } local bossNames = { @@ -247,7 +247,7 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos local pPos = player:getPosition() local nightmareLever = Position(32212, 32069, 15) - if item.itemid == 9110 then + if item.itemid == 8911 then if iPos == nightmareLever then if player:doCheckBossRoom(lastBoss.bossName, lastBoss.roomFromPosition, lastBoss.roomToPosition) then if pPos:isInRange(lastBoss.fromPositionPush, lastBoss.toPositionPush) then @@ -332,14 +332,11 @@ function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPos monster:registerEvent("facelessHealth") elseif leverTable.bossName:lower() == "izcandar the banished" then monster:registerEvent("izcandarThink") - spawnSummons(1, "the heat of summer", false, 15, heatOfSummer, leverTable.bossPosition) spawnSummons(1, "the cold of winter", false, 15, coldOfWinter, leverTable.bossPosition) - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarOutfit, 0) elseif leverTable.bossName:lower() == "plagueroot" then spawnSummons(1, "plant attendant", false, 15, plantAttendants, leverTable.bossPosition) - monster:registerEvent("facelessHealth") elseif leverTable.bossName:lower() == "malofur mangrinder" then for i = 1, #whirlingBlades do diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua index 0ed9afb6060..a2005f8641d 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/creaturescripts_dreamCourtsDeath.lua @@ -44,7 +44,7 @@ local questlog = { [7] = { bossName = "Plagueroot", storageQuestline = Storage.Quest.U12_00.TheDreamCourts.DreamScar.BossCount, - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.PlaguerootTimer, + storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.PlagueRootTimer, middlePosition = Position(32208, 32048, 14), maxValue = 5, }, diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua deleted file mode 100644 index 348f1e4bfb0..00000000000 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_dream_courts_worldchange.lua +++ /dev/null @@ -1,41 +0,0 @@ -local config = { - ["Monday"] = "Alptramun", - ["Tuesday"] = "Izcandar_the_Banished", - ["Friday"] = "Malofur_Mangrinder", - ["Thursday"] = "Maxxenius", - ["Wednesday"] = "Malofur_Mangrinder", - ["Saturday"] = "Plagueroot", - ["Sunday"] = "Maxxenius", -} - -local spawnByDay = true - -local globalevents_dream_courts_worldchange = GlobalEvent("startupCourts") - -function globalevents_dream_courts_worldchange.onStartup(interval) - if spawnByDay then - logger.info("[The Dream Courts Quest] loaded: " .. config[os.date("%A")]) - Game.loadMap("data/world/worldchanges/dream_courts_bosses/" .. config[os.date("%A")] .. ".otbm") - else - logger.warn("[The Dream Courts Quest] bosses: not boss today") - end - return true -end - -globalevents_dream_courts_worldchange:register() - -local globalevents_dream_courts_worldchange = GlobalEvent("fixCourts") - -function globalevents_dream_courts_worldchange.onTime(interval) - if spawnByDay then - logger.info("[The Dream Courts Quest] loaded: " .. config[os.date("%A")]) - Game.loadMap("data/world/worldchanges/dream_courts_bosses/" .. config[os.date("%A")] .. ".otbm") - else - logger.warn("[The Dream Courts Quest] bosses: not boss today") - end - - return true -end - -globalevents_dream_courts_worldchange:time("00:00") -globalevents_dream_courts_worldchange:register() diff --git a/data-otservbr-global/scripts/world_changes/the_dream_courts.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_the_dream_courts.lua similarity index 61% rename from data-otservbr-global/scripts/world_changes/the_dream_courts.lua rename to data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_the_dream_courts.lua index bb3bcc3a6a8..b6a340e1e68 100644 --- a/data-otservbr-global/scripts/world_changes/the_dream_courts.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/globalevents_the_dream_courts.lua @@ -1,11 +1,11 @@ local dreamCourtsConfig = { - ["Monday"] = { map = "plagueroot", bossName = "Plagueroot" }, - ["Tuesday"] = { map = "malofur_mangrinder", bossName = "Malofur Mangrinder" }, - ["Wednesday"] = { map = "maxxenius", bossName = "Maxxenius" }, - ["Thursday"] = { map = "alptramun", bossName = "Alptramun" }, + ["Monday"] = { map = "alptramun", bossName = "Alptramun" }, + ["Tuesday"] = { map = "izcandar_the_banished", bossName = "Izcandar the Banished" }, + ["Wednesday"] = { map = "malofur_mangrinder", bossName = "Malofur Mangrinder" }, + ["Thursday"] = { map = "maxxenius", bossName = "Maxxenius" }, ["Friday"] = { map = "izcandar_the_banished", bossName = "Izcandar the Banished" }, - ["Saturday"] = { map = "maxxenius", bossName = "Maxxenius" }, - ["Sunday"] = { map = "alptramun", bossName = "Alptramun" }, + ["Saturday"] = { map = "plagueroot", bossName = "Plagueroot" }, + ["Sunday"] = { map = "maxxenius", bossName = "Maxxenius" }, } local dreamCourtsEvent = GlobalEvent("DreamCourts") @@ -20,6 +20,7 @@ function dreamCourtsEvent.onStartup() Game.loadMap(DATA_DIRECTORY .. "/world/quest/the_dream_courts/" .. dayConfig.map .. ".otbm") logger.info("[World Change] The Dream Courts today's boss is: {}!", dayConfig.bossName) + return true end diff --git a/data-otservbr-global/startup/tables/item.lua b/data-otservbr-global/startup/tables/item.lua index 7a1afb788ae..99854dad8c8 100644 --- a/data-otservbr-global/startup/tables/item.lua +++ b/data-otservbr-global/startup/tables/item.lua @@ -1250,6 +1250,7 @@ ItemAction = { { x = 32211, y = 32081, z = 15 }, { x = 32720, y = 32270, z = 8 }, { x = 33618, y = 32546, z = 13 }, + { x = 32208, y = 32033, z = 13 }, }, }, [23104] = { From 9d395bd3af79673833d092fe94d1fa3d51538362 Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:01:58 -0300 Subject: [PATCH 10/22] Grave Danger Quest It's not perfect, just the inclusion of some bosses that weren't on the server, and it lacks more details about the quest itself and more mechanics. --- data-otservbr-global/lib/core/quests.lua | 4 +- data-otservbr-global/lib/core/storages.lua | 87 ++++-- .../monster/bosses/custodian.lua | 4 + .../monster/bosses/gaffir.lua | 1 + .../monster/bosses/guard_captain_quaid.lua | 1 + .../quests/grave_danger/azarams_soul.lua | 84 ++++++ .../grave_danger/bosses/count_vlarkorth.lua | 3 +- .../quests/grave_danger/bosses/duke_krule.lua | 2 +- .../quests/grave_danger/bosses/earl_osam.lua | 3 +- .../quests/grave_danger/bosses/king_zelos.lua | 11 +- .../grave_danger/bosses/lord_azaram.lua | 3 +- .../grave_danger/bosses/scarlett_etzel.lua | 1 + .../quests/grave_danger/bosses/sir_baeloc.lua | 10 +- .../grave_danger/bosses/sir_nictros.lua | 5 + .../quests/grave_danger/condensed_sin.lua | 100 +++++++ .../quests/grave_danger/dark_druid.lua | 2 +- .../quests/grave_danger/dark_knight.lua | 2 +- .../quests/grave_danger/dark_paladin.lua | 2 +- .../quests/grave_danger/dark_sorcerer.lua | 2 +- .../monster/quests/grave_danger/fetter.lua | 4 + .../quests/grave_danger/magical_sphere.lua | 84 ++++++ .../grave_danger/magnor_mournbringer.lua | 122 ++++++++ .../grave_danger/nargol_the_impaler.lua | 125 +++++++++ .../quests/grave_danger/regenerating_mass.lua | 92 ++++++ .../quests/grave_danger/rewar_the_bloody.lua | 125 +++++++++ .../grave_danger/rewar_the_bloody_inv.lua | 124 ++++++++ .../quests/grave_danger/shard_of_magnor.lua | 4 + .../grave_danger/tainted_soul_splinter.lua | 80 ++++++ .../quests/grave_danger/the_red_knight.lua | 117 ++++++++ data-otservbr-global/npc/jack_springer.lua | 201 ++++++++++--- .../grave_danger/actions_bosses_killed.lua | 33 --- .../grave_danger/creaturescripts_sirs.lua | 29 -- .../creaturescripts_zelosDeath.lua | 26 -- .../globalevents_cobra_minis_custodian.lua | 16 -- .../globalevents_cobra_minis_gaffir.lua | 16 -- .../globalevents_cobra_minis_quaid.lua | 16 -- .../movements_firewall_gaffir.lua | 47 ---- .../movements_teleport_king_zelos.lua | 14 - .../actions_azaram_fight.lua | 28 ++ .../actions_baeloc_fight.lua | 85 ++++++ .../actions_custodian_door.lua | 21 ++ .../actions_dark_remains.lua | 28 ++ .../grave_danger_quest/actions_duke_fight.lua | 129 +++++++++ .../grave_danger_quest/actions_earl_fight.lua | 24 ++ .../actions_grave_sanctify.lua | 71 +++++ .../grave_danger_quest/actions_king_zelos.lua | 79 ++++++ .../actions_vlarkorth_fight.lua | 25 ++ .../cobra_bastion/actions_scarlett.lua | 10 +- .../creaturescripts_scarlett.lua | 2 +- .../creaturescripts_ugly_monster.lua | 0 .../creaturescripts_baeloc_nictros_fight.lua | 119 ++++++++ .../creaturescripts_boss_kill.lua | 84 ++++++ .../creaturescripts_count_vlarkorth_fight.lua | 91 ++++++ .../creaturescripts_earl_osam_fight.lua | 163 +++++++++++ .../creaturescripts_king_zelos_fight.lua | 264 ++++++++++++++++++ .../creaturescripts_lord_azaram_fight.lua | 121 ++++++++ .../creaturescripts_sir_baeloc_health.lua | 38 +++ .../movements_cobra_mini_bosses.lua | 33 +++ .../movements_duke_exit_tp.lua | 14 + .../movements_enter_tps.lua | 67 +++++ .../grave_danger_quest/movements_quaidDen.lua | 17 ++ .../movements_soul_cleanse.lua | 29 ++ .../grave_danger_quest/movements_zelos_tp.lua | 20 ++ .../startup/tables/door_quest.lua | 6 +- data-otservbr-global/startup/tables/lever.lua | 37 +++ .../startup/tables/teleport.lua | 165 +++++++++++ .../world/otservbr-monster.xml | 9 + 67 files changed, 3095 insertions(+), 286 deletions(-) create mode 100644 data-otservbr-global/monster/quests/grave_danger/azarams_soul.lua create mode 100644 data-otservbr-global/monster/quests/grave_danger/condensed_sin.lua create mode 100644 data-otservbr-global/monster/quests/grave_danger/magical_sphere.lua create mode 100644 data-otservbr-global/monster/quests/grave_danger/magnor_mournbringer.lua create mode 100644 data-otservbr-global/monster/quests/grave_danger/nargol_the_impaler.lua create mode 100644 data-otservbr-global/monster/quests/grave_danger/regenerating_mass.lua create mode 100644 data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody.lua create mode 100644 data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody_inv.lua create mode 100644 data-otservbr-global/monster/quests/grave_danger/tainted_soul_splinter.lua create mode 100644 data-otservbr-global/monster/quests/grave_danger/the_red_knight.lua delete mode 100644 data-otservbr-global/scripts/quests/grave_danger/actions_bosses_killed.lua delete mode 100644 data-otservbr-global/scripts/quests/grave_danger/creaturescripts_sirs.lua delete mode 100644 data-otservbr-global/scripts/quests/grave_danger/creaturescripts_zelosDeath.lua delete mode 100644 data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_custodian.lua delete mode 100644 data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_gaffir.lua delete mode 100644 data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_quaid.lua delete mode 100644 data-otservbr-global/scripts/quests/grave_danger/movements_firewall_gaffir.lua delete mode 100644 data-otservbr-global/scripts/quests/grave_danger/movements_teleport_king_zelos.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/actions_azaram_fight.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/actions_custodian_door.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/actions_dark_remains.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/actions_earl_fight.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/actions_grave_sanctify.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/actions_king_zelos.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/actions_vlarkorth_fight.lua rename data-otservbr-global/scripts/quests/{grave_danger => grave_danger_quest}/cobra_bastion/actions_scarlett.lua (86%) rename data-otservbr-global/scripts/quests/{grave_danger => grave_danger_quest}/cobra_bastion/creaturescripts_scarlett.lua (98%) rename data-otservbr-global/scripts/quests/{grave_danger => grave_danger_quest}/cobra_bastion/creaturescripts_ugly_monster.lua (100%) create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_baeloc_nictros_fight.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_boss_kill.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_count_vlarkorth_fight.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_earl_osam_fight.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_king_zelos_fight.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_lord_azaram_fight.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_sir_baeloc_health.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/movements_cobra_mini_bosses.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/movements_duke_exit_tp.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/movements_enter_tps.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/movements_quaidDen.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/movements_soul_cleanse.lua create mode 100644 data-otservbr-global/scripts/quests/grave_danger_quest/movements_zelos_tp.lua diff --git a/data-otservbr-global/lib/core/quests.lua b/data-otservbr-global/lib/core/quests.lua index 63b085a8ff1..19dacee7a9a 100644 --- a/data-otservbr-global/lib/core/quests.lua +++ b/data-otservbr-global/lib/core/quests.lua @@ -6343,12 +6343,12 @@ if not Quests then }, [47] = { name = "Grave Danger", - startStorageId = Storage.Quest.U12_20.GraveDanger.QuestLine, + startStorageId = Storage.Quest.U12_20.GraveDanger.Questline, startStorageValue = 1, missions = { [1] = { name = "* Grave Danger - The Lich Knights", - storageId = Storage.Quest.U12_20.GraveDanger.QuestLine, + storageId = Storage.Quest.U12_20.GraveDanger.Questline, missionId = 10437, startValue = 1, endValue = 2, diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index b7fbab65af4..05f3a9b655f 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -302,13 +302,6 @@ Storage = { Lever = 52278, Mainland = 52279, }, - GraveDanger = { - -- Reserved storage from 52310 - 52339 - Questline = 52310, - CobraBastion = { - Questline = 52311, - }, - }, TheMummysCurse = { -- Reserved storage from 52350 - 52359 Time1 = 52351, @@ -2810,35 +2803,69 @@ Storage = { }, U12_20 = { -- update 12.20 - Reserved Storages 46851 - 47000 GraveDanger = { - QuestLine = 46851, + Questline = 46851, + Stage = 46852, + Cobra = 46853, + GaffirKilled = 46854, + CustodianKilled = 46855, + QuaidKilled = 46856, + ScarlettKilled = 46857, + FireWall = 46858, Graves = { - Edron = 46852, - DarkCathedral = 46853, - Ghostlands = 46854, - Cormaya = 46855, - FemorHills = 46856, - Ankrahmun = 46857, - Kilmaresh = 46858, - Vengoth = 46859, - Darashia = 46860, - Thais = 46861, - Orclands = 46862, - IceIslands = 46863, + Progress = 46859, + Edron = 46860, + DarkCathedral = 46861, + Ghostlands = 46862, + Cormaya = 46863, + FemorHills = 46864, + Ankrahmun = 46865, + Kilmaresh = 46866, + Vengoth = 46867, + Darashia = 46868, + Thais = 46869, + Orclands = 46870, + IceIslands = 46871, }, Bosses = { - BaelocNictrosKilled = 46866, - CountVlarkorthKilled = 46868, - DukeKruleKilled = 46870, - EarlOsamKilled = 46872, - LordAzaramKilled = 46874, - KingZelosDoor = 46875, - KingZelosKilled = 46877, - InquisitionOutfitReceived = 46878, + LordAzaram = { + Killed = 46872, + Timer = 46873, + Room = 46874, + }, + CountVlarkorth = { + Killed = 46875, + Timer = 46876, + Room = 46877, + }, + EarlOsam = { + Killed = 46878, + Timer = 46879, + Room = 46880, + }, + BaelocNictros = { + Timer = 46881, + Room = 46882, + Killed = 46883, + }, + DukeKrule = { + Timer = 46884, + Room = 46885, + TransformCD = 46886, + Killed = 46887, + }, + KingZelos = { + Killed = 46888, + Timer = 46889, + Room = 46890, + }, + }, + CobraBastion = { + Questline = 52311, }, - Cobra = 46864, }, HandOfTheInquisitionOutfits = {}, - -- Kilmaresh = {}, done earlier in the file + Kilmaresh = {}, + Orcsoberfest = {}, }, U12_30 = { -- update 12.30 - Reserved Storages 47001 - 47200 FalconerOutfits = {}, diff --git a/data-otservbr-global/monster/bosses/custodian.lua b/data-otservbr-global/monster/bosses/custodian.lua index 2a2e414d3d9..ea976a9b265 100644 --- a/data-otservbr-global/monster/bosses/custodian.lua +++ b/data-otservbr-global/monster/bosses/custodian.lua @@ -25,6 +25,10 @@ monster.corpse = 31923 monster.speed = 105 monster.manaCost = 0 +monster.events = { + "grave_danger_death", +} + monster.changeTarget = { interval = 4000, chance = 10, diff --git a/data-otservbr-global/monster/bosses/gaffir.lua b/data-otservbr-global/monster/bosses/gaffir.lua index a51115cb094..735eefd0f60 100644 --- a/data-otservbr-global/monster/bosses/gaffir.lua +++ b/data-otservbr-global/monster/bosses/gaffir.lua @@ -28,6 +28,7 @@ monster.manaCost = 0 monster.events = { "UglyMonsterSpawn", "UglyMonsterCleanup", + "grave_danger_death", } monster.changeTarget = { diff --git a/data-otservbr-global/monster/bosses/guard_captain_quaid.lua b/data-otservbr-global/monster/bosses/guard_captain_quaid.lua index 85507170974..e84f9b9fd83 100644 --- a/data-otservbr-global/monster/bosses/guard_captain_quaid.lua +++ b/data-otservbr-global/monster/bosses/guard_captain_quaid.lua @@ -28,6 +28,7 @@ monster.manaCost = 0 monster.events = { "UglyMonsterSpawn", "UglyMonsterCleanup", + "grave_danger_death", } monster.changeTarget = { diff --git a/data-otservbr-global/monster/quests/grave_danger/azarams_soul.lua b/data-otservbr-global/monster/quests/grave_danger/azarams_soul.lua new file mode 100644 index 00000000000..9746fdc030c --- /dev/null +++ b/data-otservbr-global/monster/quests/grave_danger/azarams_soul.lua @@ -0,0 +1,84 @@ +local mType = Game.createMonsterType("Azaram's Soul") +local monster = {} + +monster.description = "azaram's soul" +monster.experience = 0 +monster.outfit = { + lookType = 1219, + lookHead = 0, + lookBody = 0, + lookLegs = 0, + lookFeet = 0, + lookAddons = 0, + lookMount = 0 +} + +monster.health = 1 +monster.maxHealth = 100000 +monster.race = "undead" +monster.corpse = 0 +monster.speed = 150 +monster.manaCost = 0 +monster.maxSummons = 0 + +monster.events = { + "soul_heal" +} + +monster.changeTarget = { + interval = 5000, + chance = 20 +} + +monster.flags = { + summonable = false, + attackable = true, + hostile = true, + convinceable = false, + pushable = false, + rewardBoss = false, + illusionable = false, + canPushItems = true, + canPushCreatures = false, + staticAttackChance = 95, + targetDistance = 0, + runHealth = 0, + healthHidden = false, + isBlockable = false, + canWalkOnEnergy = true, + canWalkOnFire = true, + canWalkOnPoison = true, + pet = false +} + +monster.light = { + level = 0, + color = 0 +} + +monster.defenses = { + defense = 40, + armor = 40 +} + +monster.elements = { + {type = COMBAT_PHYSICALDAMAGE, percent = 100}, + {type = COMBAT_ENERGYDAMAGE, percent = 100}, + {type = COMBAT_EARTHDAMAGE, percent = 100}, + {type = COMBAT_FIREDAMAGE, percent = 100}, + {type = COMBAT_LIFEDRAIN, percent = 100}, + {type = COMBAT_MANADRAIN, percent = 100}, + {type = COMBAT_DROWNDAMAGE, percent = 100}, + {type = COMBAT_ICEDAMAGE, percent = 100}, + {type = COMBAT_HOLYDAMAGE , percent = 100}, + {type = COMBAT_DEATHDAMAGE , percent = 100} +} + +monster.immunities = { + {type = "paralyze", condition = true}, + {type = "outfit", condition = false}, + {type = "invisible", condition = true}, + {type = "bleed", condition = false} +} + +mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/count_vlarkorth.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/count_vlarkorth.lua index f2de105033d..f4f9292fb8c 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/count_vlarkorth.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/count_vlarkorth.lua @@ -14,7 +14,8 @@ monster.outfit = { } monster.events = { - "GraveDangerBossDeath", + "count_vlarkorth_transform", + "grave_danger_death", } monster.health = 75000 diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/duke_krule.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/duke_krule.lua index 851867e0161..7c99c057d57 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/duke_krule.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/duke_krule.lua @@ -14,7 +14,7 @@ monster.outfit = { } monster.events = { - "GraveDangerBossDeath", + "grave_danger_death", } monster.health = 75000 diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/earl_osam.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/earl_osam.lua index 930a744f326..22e8e6c06c9 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/earl_osam.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/earl_osam.lua @@ -14,7 +14,8 @@ monster.outfit = { } monster.events = { - "GraveDangerBossDeath", + "earl_osam_transform", + "grave_danger_death", } monster.health = 75000 diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/king_zelos.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/king_zelos.lua index b723715c55d..1aa71839638 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/king_zelos.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/king_zelos.lua @@ -13,17 +13,18 @@ monster.outfit = { lookMount = 0, } -monster.events = { - "GraveDangerBossDeath", - "zelosDeath", -} - monster.health = 480000 monster.maxHealth = 480000 monster.race = "venom" monster.corpse = 31611 monster.speed = 212 +monster.events = { + "zelos_damage", + "zelos_init", + "grave_danger_death", +} + monster.bosstiary = { bossRaceId = 1784, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/lord_azaram.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/lord_azaram.lua index 188f11c9dc6..69d64039a85 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/lord_azaram.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/lord_azaram.lua @@ -14,7 +14,8 @@ monster.outfit = { } monster.events = { - "GraveDangerBossDeath", + "azaram_health", + "azaram_summon", } monster.health = 300000 diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/scarlett_etzel.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/scarlett_etzel.lua index 9dcb6503d38..e27c10d1b24 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/scarlett_etzel.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/scarlett_etzel.lua @@ -16,6 +16,7 @@ monster.outfit = { monster.events = { "scarlettThink", "scarlettHealth", + "grave_danger_death", } monster.bosstiary = { diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/sir_baeloc.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/sir_baeloc.lua index 957ad10e5ff..7e05cbdb61d 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/sir_baeloc.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/sir_baeloc.lua @@ -13,10 +13,6 @@ monster.outfit = { lookMount = 0, } -monster.events = { - "GraveDangerBossDeath", -} - monster.health = 75000 monster.maxHealth = 75000 monster.race = "venom" @@ -24,6 +20,12 @@ monster.corpse = 31599 monster.speed = 125 monster.manaCost = 0 +monster.events = { + "sir_baeloc_health", + "brothers_summon", + "grave_danger_death", +} + monster.changeTarget = { interval = 4000, chance = 10, diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/sir_nictros.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/sir_nictros.lua index 921c63ad286..9f671133049 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/sir_nictros.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/sir_nictros.lua @@ -20,6 +20,11 @@ monster.corpse = 31599 monster.speed = 125 monster.manaCost = 0 +monster.events = { + "sir_nictros_health", + "brothers_summon" +} + monster.changeTarget = { interval = 4000, chance = 10, diff --git a/data-otservbr-global/monster/quests/grave_danger/condensed_sin.lua b/data-otservbr-global/monster/quests/grave_danger/condensed_sin.lua new file mode 100644 index 00000000000..21ec6157d98 --- /dev/null +++ b/data-otservbr-global/monster/quests/grave_danger/condensed_sin.lua @@ -0,0 +1,100 @@ +local mType = Game.createMonsterType("Condensed Sin") +local monster = {} + +monster.description = "a condensed sin" +monster.experience = 0 +monster.outfit = { + lookType = 315, + lookHead = 0, + lookBody = 0, + lookLegs = 0, + lookFeet = 0, + lookAddons = 0, + lookMount = 0 +} + +monster.health = 12000 +monster.maxHealth = 12000 +monster.race = "undead" +monster.corpse = 0 +monster.speed = 160 +monster.manaCost = 0 +monster.maxSummons = 0 + +monster.changeTarget = { + interval = 5000, + chance = 0 +} + +monster.strategiesTarget = { + nearest = 100, +} + +monster.flags = { + summonable = false, + attackable = true, + hostile = true, + convinceable = false, + pushable = false, + rewardBoss = false, + illusionable = false, + canPushItems = true, + canPushCreatures = true, + staticAttackChance = 90, + targetDistance = 1, + runHealth = 0, + healthHidden = false, + isBlockable = false, + canWalkOnEnergy = true, + canWalkOnFire = true, + canWalkOnPoison = true, + pet = false +} + +monster.light = { + level = 0, + color = 0 +} + +monster.voices = { + interval = 5000, + chance = 10, +} + +monster.loot = { +} + +monster.attacks = { + {name ="melee", interval = 2000, chance = 100, minDamage = -100, maxDamage = -500}, + {name ="combat", interval = 5000, chance = 40, type = COMBAT_MANADRAIN, minDamage = -450, maxDamage = -550, length = 3, effect = CONST_ME_SLEEP, target = false}, + {name ="combat", interval = 2000, chance = 30, type = COMBAT_DEATHDAMAGE, minDamage = -250, maxDamage = -450, range = 1, shootEffect = CONST_ANI_DEATH, target = true}, + {name ="combat", interval = 2000, chance = 30, type = COMBAT_EARTHDAMAGE, minDamage = -250, maxDamage = -450, range = 1, shootEffect = CONST_ANI_POISON, target = true}, + {name ="combat", interval = 4000, chance = 50, type = COMBAT_EARTHDAMAGE, minDamage = -600, maxDamage = -800, range = 3, radius = 2, effect = CONST_ME_HITBYPOISON, target = false} +} + +monster.defenses = { + defense = 10, + armor = 10 +} + +monster.elements = { + {type = COMBAT_PHYSICALDAMAGE, percent = 0}, + {type = COMBAT_ENERGYDAMAGE, percent = -10}, + {type = COMBAT_EARTHDAMAGE, percent = 100}, + {type = COMBAT_FIREDAMAGE, percent = -10}, + {type = COMBAT_LIFEDRAIN, percent = 100}, + {type = COMBAT_MANADRAIN, percent = 0}, + {type = COMBAT_DROWNDAMAGE, percent = 0}, + {type = COMBAT_ICEDAMAGE, percent = 20}, + {type = COMBAT_HOLYDAMAGE , percent = 0}, + {type = COMBAT_DEATHDAMAGE , percent = 100} +} + +monster.immunities = { + {type = "paralyze", condition = false}, + {type = "outfit", condition = false}, + {type = "invisible", condition = false}, + {type = "bleed", condition = false} +} + +mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/dark_druid.lua b/data-otservbr-global/monster/quests/grave_danger/dark_druid.lua index 0d3004706ed..ad0cba66509 100644 --- a/data-otservbr-global/monster/quests/grave_danger/dark_druid.lua +++ b/data-otservbr-global/monster/quests/grave_danger/dark_druid.lua @@ -16,7 +16,7 @@ monster.outfit = { monster.health = 1800 monster.maxHealth = 1800 monster.race = "blood" -monster.corpse = 0 +monster.corpse = 31205 monster.speed = 125 monster.manaCost = 0 diff --git a/data-otservbr-global/monster/quests/grave_danger/dark_knight.lua b/data-otservbr-global/monster/quests/grave_danger/dark_knight.lua index 2115f46947b..dcd07cded8d 100644 --- a/data-otservbr-global/monster/quests/grave_danger/dark_knight.lua +++ b/data-otservbr-global/monster/quests/grave_danger/dark_knight.lua @@ -16,7 +16,7 @@ monster.outfit = { monster.health = 1800 monster.maxHealth = 1800 monster.race = "blood" -monster.corpse = 0 +monster.corpse = 31203 monster.speed = 125 monster.manaCost = 0 diff --git a/data-otservbr-global/monster/quests/grave_danger/dark_paladin.lua b/data-otservbr-global/monster/quests/grave_danger/dark_paladin.lua index f53a9fec76a..a0821fb4917 100644 --- a/data-otservbr-global/monster/quests/grave_danger/dark_paladin.lua +++ b/data-otservbr-global/monster/quests/grave_danger/dark_paladin.lua @@ -16,7 +16,7 @@ monster.outfit = { monster.health = 1800 monster.maxHealth = 1800 monster.race = "blood" -monster.corpse = 0 +monster.corpse = 31204 monster.speed = 125 monster.manaCost = 0 diff --git a/data-otservbr-global/monster/quests/grave_danger/dark_sorcerer.lua b/data-otservbr-global/monster/quests/grave_danger/dark_sorcerer.lua index f3f7fb478b9..9f6791d0232 100644 --- a/data-otservbr-global/monster/quests/grave_danger/dark_sorcerer.lua +++ b/data-otservbr-global/monster/quests/grave_danger/dark_sorcerer.lua @@ -16,7 +16,7 @@ monster.outfit = { monster.health = 1800 monster.maxHealth = 1800 monster.race = "blood" -monster.corpse = 0 +monster.corpse = 31206 monster.speed = 125 monster.manaCost = 0 diff --git a/data-otservbr-global/monster/quests/grave_danger/fetter.lua b/data-otservbr-global/monster/quests/grave_danger/fetter.lua index 9eb8ca308ac..203f1e14a8d 100644 --- a/data-otservbr-global/monster/quests/grave_danger/fetter.lua +++ b/data-otservbr-global/monster/quests/grave_danger/fetter.lua @@ -20,6 +20,10 @@ monster.corpse = 0 monster.speed = 140 monster.manaCost = 0 +monster.events = { + "fetter_death", +} + monster.changeTarget = { interval = 4000, chance = 10, diff --git a/data-otservbr-global/monster/quests/grave_danger/magical_sphere.lua b/data-otservbr-global/monster/quests/grave_danger/magical_sphere.lua new file mode 100644 index 00000000000..f513a567a34 --- /dev/null +++ b/data-otservbr-global/monster/quests/grave_danger/magical_sphere.lua @@ -0,0 +1,84 @@ +local mType = Game.createMonsterType("Magical Sphere") +local monster = {} + +monster.description = "Magical Sphere" +monster.experience = 0 +monster.outfit = { + lookType = 979, + lookHead = 0, + lookBody = 0, + lookLegs = 0, + lookFeet = 0, + lookAddons = 0, + lookMount = 0 +} + +monster.health = 20000 +monster.maxHealth = 20000 +monster.race = "energy" +monster.corpse = 0 +monster.speed = 0 +monster.manaCost = 0 +monster.maxSummons = 0 + +monster.events = { + "sphere_death" +} + +monster.changeTarget = { + interval = 5000, + chance = 20 +} + +monster.flags = { + summonable = false, + attackable = true, + hostile = true, + convinceable = false, + pushable = false, + rewardBoss = false, + illusionable = true, + canPushItems = false, + canPushCreatures = false, + staticAttackChance = 95, + targetDistance = 1, + runHealth = 0, + healthHidden = false, + isBlockable = false, + canWalkOnEnergy = false, + canWalkOnFire = true, + canWalkOnPoison = false, + pet = false +} + +monster.light = { + level = 0, + color = 0 +} + +monster.defenses = { + defense = 40, + armor = 40 +} + +monster.elements = { + {type = COMBAT_PHYSICALDAMAGE, percent = 0}, + {type = COMBAT_ENERGYDAMAGE, percent = 0}, + {type = COMBAT_EARTHDAMAGE, percent = 0}, + {type = COMBAT_FIREDAMAGE, percent = 0}, + {type = COMBAT_LIFEDRAIN, percent = 0}, + {type = COMBAT_MANADRAIN, percent = 0}, + {type = COMBAT_DROWNDAMAGE, percent = 0}, + {type = COMBAT_ICEDAMAGE, percent = 0}, + {type = COMBAT_HOLYDAMAGE , percent = 0}, + {type = COMBAT_DEATHDAMAGE , percent = -20} +} + +monster.immunities = { + {type = "paralyze", condition = true}, + {type = "outfit", condition = false}, + {type = "invisible", condition = true}, + {type = "bleed", condition = false} +} + +mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/magnor_mournbringer.lua b/data-otservbr-global/monster/quests/grave_danger/magnor_mournbringer.lua new file mode 100644 index 00000000000..d730579b9a3 --- /dev/null +++ b/data-otservbr-global/monster/quests/grave_danger/magnor_mournbringer.lua @@ -0,0 +1,122 @@ +local mType = Game.createMonsterType("Magnor Mournbringer") +local monster = {} + +monster.description = "a magnor mournbringer" +monster.experience = 0 +monster.outfit = { + lookType = 1221, + lookHead = 95, + lookBody = 0, + lookLegs = 0, + lookFeet = 95, + lookAddons = 3, + lookMount = 0 +} + +monster.health = 250000 +monster.maxHealth = 250000 +monster.race = "venom" +monster.corpse = 0 +monster.speed = 250 +monster.manaCost = 0 +monster.maxSummons = 0 + +monster.events = { + "magnor_death", +} + +monster.changeTarget = { + interval = 4000, + chance = 10 +} + +monster.strategiesTarget = { + nearest = 100, +} + +monster.flags = { + summonable = false, + attackable = true, + hostile = true, + convinceable = false, + pushable = false, + rewardBoss = false, + illusionable = false, + canPushItems = true, + canPushCreatures = true, + staticAttackChance = 90, + targetDistance = 1, + runHealth = 0, + healthHidden = false, + isBlockable = false, + canWalkOnEnergy = true, + canWalkOnFire = true, + canWalkOnPoison = true, + pet = false +} + +monster.light = { + level = 0, + color = 0 +} + +monster.voices = { + interval = 5000, + chance = 10, +} + +monster.attacks = { + {name ="melee", interval = 2000, chance = 100, minDamage = -200, maxDamage = -600}, + {name ="combat", interval = 4000, chance = 70, type = COMBAT_ENERGYDAMAGE, minDamage = -1000, maxDamage = -1200, length = 5, effect = CONST_ME_BIGCLOUDS, target = false}, + {name ="combat", interval = 3000, chance = 50, type = COMBAT_ENERGYDAMAGE, minDamage = -400, maxDamage = -900, length = 7, spread = 5, effect = CONST_ME_TELEPORT, target = false} +} + +monster.defenses = { + defense = 25, + armor = 78, + {name ="combat", interval = 2000, chance = 54, type = COMBAT_HEALING, minDamage = 150, maxDamage = 950, effect = CONST_ME_MAGIC_BLUE, target = false} +} + +monster.elements = { + {type = COMBAT_PHYSICALDAMAGE, percent = 0}, + {type = COMBAT_ENERGYDAMAGE, percent = 0}, + {type = COMBAT_EARTHDAMAGE, percent = 100}, + {type = COMBAT_FIREDAMAGE, percent = -15}, + {type = COMBAT_LIFEDRAIN, percent = 0}, + {type = COMBAT_MANADRAIN, percent = 0}, + {type = COMBAT_DROWNDAMAGE, percent = 0}, + {type = COMBAT_ICEDAMAGE, percent = 0}, + {type = COMBAT_HOLYDAMAGE , percent = 0}, + {type = COMBAT_DEATHDAMAGE , percent = 100} +} + +monster.immunities = { + {type = "paralyze", condition = true}, + {type = "outfit", condition = false}, + {type = "invisible", condition = true}, + {type = "bleed", condition = false} +} + +monster.heals = { + {type = COMBAT_EARTHDAMAGE, percent = 100} +} + +mType.onThink = function(monster, interval) +end + +mType.onAppear = function(monster, creature) + if monster:getType():isRewardBoss() then + monster:setReward(true) + end +end + +mType.onDisappear = function(monster, creature) +end + +mType.onMove = function(monster, creature, fromPosition, toPosition) +end + +mType.onSay = function(monster, creature, type, message) +end + +mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/nargol_the_impaler.lua b/data-otservbr-global/monster/quests/grave_danger/nargol_the_impaler.lua new file mode 100644 index 00000000000..9274d3e65e9 --- /dev/null +++ b/data-otservbr-global/monster/quests/grave_danger/nargol_the_impaler.lua @@ -0,0 +1,125 @@ +local mType = Game.createMonsterType("Nargol The Impaler") +local monster = {} + +monster.description = "a nargol the impaler" +monster.experience = 0 +monster.outfit = { + lookType = 1222, + lookHead = 0, + lookBody = 0, + lookLegs = 94, + lookFeet = 0, + lookAddons = 3, + lookMount = 0 +} + +monster.health = 250000 +monster.maxHealth = 250000 +monster.race = "venom" +monster.corpse = 0 +monster.speed = 250 +monster.manaCost = 0 +monster.maxSummons = 0 + +monster.events = { + "nargol_death", +} + +monster.changeTarget = { + interval = 4000, + chance = 10 +} + +monster.strategiesTarget = { + nearest = 100, +} + +monster.flags = { + summonable = false, + attackable = true, + hostile = true, + convinceable = false, + pushable = false, + rewardBoss = true, + illusionable = false, + canPushItems = true, + canPushCreatures = true, + staticAttackChance = 90, + targetDistance = 1, + runHealth = 0, + healthHidden = false, + isBlockable = false, + canWalkOnEnergy = true, + canWalkOnFire = true, + canWalkOnPoison = true, + pet = false +} + +monster.light = { + level = 0, + color = 0 +} + +monster.voices = { + interval = 5000, + chance = 10, +} + +monster.loot = { +} + +monster.attacks = { + {name ="melee", interval = 2000, chance = 100, minDamage = -800, maxDamage = -1200}, + {name ="combat", interval = 6000, chance = 56, type = COMBAT_EARTHDAMAGE, minDamage = -1000, maxDamage = -1200, length = 7, spread = 5, effect = CONST_ME_POISONAREA, target = false}, + {name ="combat", interval = 5000, chance = 70, type = COMBAT_LIFEDRAIN, minDamage = -700, maxDamage = -900, length = 7, effect = CONST_ME_MORTAREA, target = false}, +} + +monster.defenses = { + defense = 25, + armor = 78, + {name ="combat", interval = 2000, chance = 55, type = COMBAT_HEALING, minDamage = 350, maxDamage = 950, effect = CONST_ME_MAGIC_BLUE, target = false} +} + +monster.elements = { + {type = COMBAT_PHYSICALDAMAGE, percent = 0}, + {type = COMBAT_ENERGYDAMAGE, percent = 0}, + {type = COMBAT_EARTHDAMAGE, percent = 100}, + {type = COMBAT_FIREDAMAGE, percent = -20}, + {type = COMBAT_LIFEDRAIN, percent = 0}, + {type = COMBAT_MANADRAIN, percent = 0}, + {type = COMBAT_DROWNDAMAGE, percent = 0}, + {type = COMBAT_ICEDAMAGE, percent = 0}, + {type = COMBAT_HOLYDAMAGE , percent = 0}, + {type = COMBAT_DEATHDAMAGE , percent = 100} +} + +monster.immunities = { + {type = "paralyze", condition = true}, + {type = "outfit", condition = false}, + {type = "invisible", condition = true}, + {type = "bleed", condition = false} +} + +monster.heals = { + {type = COMBAT_EARTHDAMAGE, percent = 100} +} + +mType.onThink = function(monster, interval) +end + +mType.onAppear = function(monster, creature) + if monster:getType():isRewardBoss() then + monster:setReward(true) + end +end + +mType.onDisappear = function(monster, creature) +end + +mType.onMove = function(monster, creature, fromPosition, toPosition) +end + +mType.onSay = function(monster, creature, type, message) +end + +mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/regenerating_mass.lua b/data-otservbr-global/monster/quests/grave_danger/regenerating_mass.lua new file mode 100644 index 00000000000..727c053bccd --- /dev/null +++ b/data-otservbr-global/monster/quests/grave_danger/regenerating_mass.lua @@ -0,0 +1,92 @@ +local mType = Game.createMonsterType("Regenerating Mass") +local monster = {} + +monster.description = "a regenerating mass" +monster.experience = 0 +monster.outfit = { + lookType = 238, + lookHead = 0, + lookBody = 0, + lookLegs = 0, + lookFeet = 0, + lookAddons = 0, + lookMount = 0 +} + +monster.health = 100000 +monster.maxHealth = 100000 +monster.race = "venom" +monster.corpse = 0 +monster.speed = 160 +monster.manaCost = 0 +monster.maxSummons = 0 + +monster.changeTarget = { + interval = 4000, + chance = 10 +} + +monster.strategiesTarget = { + nearest = 70, + health = 10, + damage = 10, + random = 10, +} + +monster.flags = { + summonable = false, + attackable = true, + hostile = true, + convinceable = false, + pushable = false, + rewardBoss = false, + illusionable = true, + canPushItems = true, + canPushCreatures = true, + staticAttackChance = 80, + targetDistance = 1, + runHealth = 85, + healthHidden = false, + isBlockable = false, + canWalkOnEnergy = false, + canWalkOnFire = false, + canWalkOnPoison = true, + pet = false +} + +monster.light = { + level = 0, + color = 0 +} + +monster.attacks = { + {name ="melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -440}, +} + +monster.defenses = { + defense = 20, + armor = 20, + {name ="combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 880, maxDamage = 1050, effect = CONST_ME_MAGIC_BLUE, target = false} +} + +monster.elements = { + {type = COMBAT_PHYSICALDAMAGE, percent = 0}, + {type = COMBAT_ENERGYDAMAGE, percent = 10}, + {type = COMBAT_EARTHDAMAGE, percent = 100}, + {type = COMBAT_FIREDAMAGE, percent = -25}, + {type = COMBAT_LIFEDRAIN, percent = 0}, + {type = COMBAT_MANADRAIN, percent = 0}, + {type = COMBAT_DROWNDAMAGE, percent = 0}, + {type = COMBAT_ICEDAMAGE, percent = 20}, + {type = COMBAT_HOLYDAMAGE , percent = 0}, + {type = COMBAT_DEATHDAMAGE , percent = 0} +} + +monster.immunities = { + {type = "paralyze", condition = true}, + {type = "outfit", condition = false}, + {type = "invisible", condition = true}, + {type = "bleed", condition = false} +} + +mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody.lua b/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody.lua new file mode 100644 index 00000000000..e3ad3ce5210 --- /dev/null +++ b/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody.lua @@ -0,0 +1,125 @@ +local mType = Game.createMonsterType("Rewar The Bloody") +local monster = {} + +monster.name = "Rewar The Bloody" +monster.description = "a rewar the bloody" +monster.experience = 0 +monster.outfit = { + lookType = 1221, + lookHead = 0, + lookBody = 95, + lookLegs = 0, + lookFeet = 0, + lookAddons = 1, + lookMount = 0 +} + +monster.health = 250000 +monster.maxHealth = 250000 +monster.race = "venom" +monster.corpse = 0 +monster.speed = 250 +monster.manaCost = 0 +monster.maxSummons = 0 + +monster.events = { + "blood_death", + "rewar_the_bloody", +} + +monster.changeTarget = { + interval = 4000, + chance = 10 +} + +monster.strategiesTarget = { + nearest = 100, +} + +monster.flags = { + summonable = false, + attackable = true, + hostile = true, + convinceable = false, + pushable = false, + rewardBoss = false, + illusionable = false, + canPushItems = true, + canPushCreatures = true, + staticAttackChance = 90, + targetDistance = 1, + runHealth = 0, + healthHidden = false, + isBlockable = false, + canWalkOnEnergy = true, + canWalkOnFire = true, + canWalkOnPoison = true, + pet = false +} + +monster.light = { + level = 0, + color = 0 +} + +monster.voices = { + interval = 5000, + chance = 10, +} + +monster.attacks = { + {name ="melee", interval = 2000, chance = 100, minDamage = -800, maxDamage = -1200}, + {name ="combat", interval = 3000, chance = 46, type = COMBAT_DROWNDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_BUBBLES, target = false}, + {name ="combat", interval = 5000, chance = 70, type = COMBAT_LIFEDRAIN, minDamage = -700, maxDamage = -900, length = 7, effect = CONST_ME_MAGIC_RED, target = false}, + {name ="combat", interval = 6000, chance = 46, type = COMBAT_EARTHDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_POISONAREA, target = false} +} + +monster.defenses = { + defense = 25, + armor = 78, + {name ="combat", interval = 2000, chance = 54, type = COMBAT_HEALING, minDamage = 900, maxDamage = 1000, effect = CONST_ME_MAGIC_BLUE, target = false} +} + +monster.elements = { + {type = COMBAT_PHYSICALDAMAGE, percent = 0}, + {type = COMBAT_ENERGYDAMAGE, percent = 0}, + {type = COMBAT_EARTHDAMAGE, percent = 100}, + {type = COMBAT_FIREDAMAGE, percent = -20}, + {type = COMBAT_LIFEDRAIN, percent = 0}, + {type = COMBAT_MANADRAIN, percent = 0}, + {type = COMBAT_DROWNDAMAGE, percent = 0}, + {type = COMBAT_ICEDAMAGE, percent = 0}, + {type = COMBAT_HOLYDAMAGE , percent = 0}, + {type = COMBAT_DEATHDAMAGE , percent = 100} +} + +monster.immunities = { + {type = "paralyze", condition = true}, + {type = "outfit", condition = false}, + {type = "invisible", condition = true}, + {type = "bleed", condition = false} +} + +monster.heals = { + {type = COMBAT_EARTHDAMAGE, percent = 100} +} + +mType.onThink = function(monster, interval) +end + +mType.onAppear = function(monster, creature) + if monster:getType():isRewardBoss() then + monster:setReward(true) + end +end + +mType.onDisappear = function(monster, creature) +end + +mType.onMove = function(monster, creature, fromPosition, toPosition) +end + +mType.onSay = function(monster, creature, type, message) +end + +mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody_inv.lua b/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody_inv.lua new file mode 100644 index 00000000000..b4616401f10 --- /dev/null +++ b/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody_inv.lua @@ -0,0 +1,124 @@ +local mType = Game.createMonsterType("Rewar The Bloody Inv") +local monster = {} + +monster.name = "Rewar The Bloody" +monster.description = "a rewar the bloody" +monster.experience = 0 +monster.outfit = { + lookType = 633, + lookHead = 79, + lookBody = 94, + lookLegs = 57, + lookFeet = 0, + lookAddons = 3, + lookMount = 0 +} + +monster.health = 250000 +monster.maxHealth = 250000 +monster.race = "venom" +monster.corpse = 0 +monster.speed = 250 +monster.manaCost = 0 +monster.maxSummons = 0 + +monster.events = { + "rewar_the_bloody", +} + +monster.changeTarget = { + interval = 4000, + chance = 10 +} + +monster.strategiesTarget = { + nearest = 100, +} + +monster.flags = { + summonable = false, + attackable = true, + hostile = true, + convinceable = false, + pushable = false, + rewardBoss = false, + illusionable = false, + canPushItems = true, + canPushCreatures = true, + staticAttackChance = 90, + targetDistance = 1, + runHealth = 0, + healthHidden = false, + isBlockable = false, + canWalkOnEnergy = true, + canWalkOnFire = true, + canWalkOnPoison = true, + pet = false +} + +monster.light = { + level = 0, + color = 0 +} + +monster.voices = { + interval = 5000, + chance = 10, +} + +monster.attacks = { + {name ="melee", interval = 2000, chance = 100, minDamage = -800, maxDamage = -1200}, + {name ="combat", interval = 3000, chance = 46, type = COMBAT_DROWNDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_BUBBLES, target = false}, + {name ="combat", interval = 5000, chance = 70, type = COMBAT_LIFEDRAIN, minDamage = -700, maxDamage = -900, length = 7, effect = CONST_ME_MAGIC_RED, target = false}, + {name ="combat", interval = 6000, chance = 46, type = COMBAT_EARTHDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_POISONAREA, target = false} +} + +monster.defenses = { + defense = 25, + armor = 78, + {name ="combat", interval = 2000, chance = 54, type = COMBAT_HEALING, minDamage = 900, maxDamage = 1000, effect = CONST_ME_MAGIC_BLUE, target = false} +} + +monster.elements = { + {type = COMBAT_PHYSICALDAMAGE, percent = 100}, + {type = COMBAT_ENERGYDAMAGE, percent = 100}, + {type = COMBAT_EARTHDAMAGE, percent = 100}, + {type = COMBAT_FIREDAMAGE, percent = 100}, + {type = COMBAT_LIFEDRAIN, percent = 100}, + {type = COMBAT_MANADRAIN, percent = 100}, + {type = COMBAT_DROWNDAMAGE, percent = 100}, + {type = COMBAT_ICEDAMAGE, percent = 100}, + {type = COMBAT_HOLYDAMAGE , percent = 100}, + {type = COMBAT_DEATHDAMAGE , percent = 100} +} + +monster.immunities = { + {type = "paralyze", condition = true}, + {type = "outfit", condition = false}, + {type = "invisible", condition = true}, + {type = "bleed", condition = false} +} + +monster.heals = { + {type = COMBAT_EARTHDAMAGE, percent = 100} +} + +mType.onThink = function(monster, interval) +end + +mType.onAppear = function(monster, creature) + if monster:getType():isRewardBoss() then + monster:setReward(true) + end +end + +mType.onDisappear = function(monster, creature) +end + +mType.onMove = function(monster, creature, fromPosition, toPosition) +end + +mType.onSay = function(monster, creature, type, message) +end + +mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/shard_of_magnor.lua b/data-otservbr-global/monster/quests/grave_danger/shard_of_magnor.lua index 8f0671ebe21..f504cb7d47c 100644 --- a/data-otservbr-global/monster/quests/grave_danger/shard_of_magnor.lua +++ b/data-otservbr-global/monster/quests/grave_danger/shard_of_magnor.lua @@ -20,6 +20,10 @@ monster.corpse = 0 monster.speed = 125 monster.manaCost = 0 +monster.events = { + "shard_death", +} + monster.changeTarget = { interval = 4000, chance = 10, diff --git a/data-otservbr-global/monster/quests/grave_danger/tainted_soul_splinter.lua b/data-otservbr-global/monster/quests/grave_danger/tainted_soul_splinter.lua new file mode 100644 index 00000000000..4360b76465c --- /dev/null +++ b/data-otservbr-global/monster/quests/grave_danger/tainted_soul_splinter.lua @@ -0,0 +1,80 @@ +local mType = Game.createMonsterType("Tainted Soul Splinter") +local monster = {} + +monster.description = "tainted soul splinter" +monster.experience = 0 +monster.outfit = { + lookType = 1219, + lookHead = 94, + lookBody = 94, + lookLegs = 94, + lookFeet = 94, + lookAddons = 0, + lookMount = 0 +} + +monster.health = 10000 +monster.maxHealth = 10000 +monster.race = "undead" +monster.corpse = 35995 +monster.speed = 200 +monster.manaCost = 0 +monster.maxSummons = 0 + +monster.changeTarget = { + interval = 5000, + chance = 20 +} + +monster.flags = { + summonable = false, + attackable = true, + hostile = true, + convinceable = false, + pushable = false, + rewardBoss = false, + illusionable = false, + canPushItems = true, + canPushCreatures = false, + staticAttackChance = 95, + targetDistance = 0, + runHealth = 0, + healthHidden = false, + isBlockable = false, + canWalkOnEnergy = true, + canWalkOnFire = true, + canWalkOnPoison = true, + pet = false +} + +monster.light = { + level = 0, + color = 0 +} + +monster.defenses = { + defense = 40, + armor = 40 +} + +monster.elements = { + {type = COMBAT_PHYSICALDAMAGE, percent = 0}, + {type = COMBAT_ENERGYDAMAGE, percent = 0}, + {type = COMBAT_EARTHDAMAGE, percent = 0}, + {type = COMBAT_FIREDAMAGE, percent = 0}, + {type = COMBAT_LIFEDRAIN, percent = 0}, + {type = COMBAT_MANADRAIN, percent = 0}, + {type = COMBAT_DROWNDAMAGE, percent = 0}, + {type = COMBAT_ICEDAMAGE, percent = 0}, + {type = COMBAT_HOLYDAMAGE , percent = 0}, + {type = COMBAT_DEATHDAMAGE , percent = 0} +} + +monster.immunities = { + {type = "paralyze", condition = true}, + {type = "outfit", condition = false}, + {type = "invisible", condition = true}, + {type = "bleed", condition = false} +} + +mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/the_red_knight.lua b/data-otservbr-global/monster/quests/grave_danger/the_red_knight.lua new file mode 100644 index 00000000000..c343164d131 --- /dev/null +++ b/data-otservbr-global/monster/quests/grave_danger/the_red_knight.lua @@ -0,0 +1,117 @@ +local mType = Game.createMonsterType("The Red Knight") +local monster = {} + +monster.description = "a the red knight" +monster.experience = 0 +monster.outfit = { + lookType = 1223, + lookHead = 94, + lookBody = 38, + lookLegs = 94, + lookFeet = 76, + lookAddons = 3, + lookMount = 0 +} + +monster.health = 250000 +monster.maxHealth = 250000 +monster.race = "venom" +monster.corpse = 36434 +monster.speed = 250 +monster.manaCost = 0 + +monster.changeTarget = { + interval = 4000, + chance = 10 +} + +monster.strategiesTarget = { + nearest = 100, +} + +monster.flags = { + summonable = false, + attackable = true, + hostile = true, + convinceable = false, + pushable = false, + rewardBoss = false, + illusionable = false, + canPushItems = true, + canPushCreatures = true, + staticAttackChance = 90, + targetDistance = 1, + runHealth = 0, + healthHidden = false, + isBlockable = false, + canWalkOnEnergy = true, + canWalkOnFire = true, + canWalkOnPoison = true, + pet = false +} + +monster.light = { + level = 0, + color = 0 +} + +monster.voices = { + interval = 5000, + chance = 10, +} + +monster.attacks = { + {name ="melee", interval = 2000, chance = 100, minDamage = -200, maxDamage = -1000}, + {name ="combat", interval = 2000, chance = 15, type = COMBAT_EARTHDAMAGE, minDamage = -400, maxDamage = -1000, length = 7, spread = 3, effect = CONST_ME_POISONAREA, target = false}, +} + +monster.defenses = { + defense = 25, + armor = 78, + {name ="combat", interval = 2000, chance = 50, type = COMBAT_HEALING, minDamage = 150, maxDamage = 950, effect = CONST_ME_MAGIC_BLUE, target = false} +} + +monster.elements = { + {type = COMBAT_PHYSICALDAMAGE, percent = 100}, + {type = COMBAT_ENERGYDAMAGE, percent = 100}, + {type = COMBAT_EARTHDAMAGE, percent = 100}, + {type = COMBAT_FIREDAMAGE, percent = 100}, + {type = COMBAT_LIFEDRAIN, percent = 100}, + {type = COMBAT_MANADRAIN, percent = 100}, + {type = COMBAT_DROWNDAMAGE, percent = 0}, + {type = COMBAT_ICEDAMAGE, percent = 100}, + {type = COMBAT_HOLYDAMAGE , percent = 100}, + {type = COMBAT_DEATHDAMAGE , percent = 100} +} + +monster.immunities = { + {type = "paralyze", condition = true}, + {type = "outfit", condition = false}, + {type = "invisible", condition = true}, + {type = "bleed", condition = false} +} + +monster.heals = { + {type = COMBAT_EARTHDAMAGE, percent = 100} +} + + +mType.onThink = function(monster, interval) +end + +mType.onAppear = function(monster, creature) + if monster:getType():isRewardBoss() then + monster:setReward(true) + end +end + +mType.onDisappear = function(monster, creature) +end + +mType.onMove = function(monster, creature, fromPosition, toPosition) +end + +mType.onSay = function(monster, creature, type, message) +end + +mType:register(monster) diff --git a/data-otservbr-global/npc/jack_springer.lua b/data-otservbr-global/npc/jack_springer.lua index 73cd671a47d..5b49dc59f05 100644 --- a/data-otservbr-global/npc/jack_springer.lua +++ b/data-otservbr-global/npc/jack_springer.lua @@ -30,6 +30,23 @@ npcConfig.voices = { { text = "Hmm." }, } +npcConfig.shop = { + { itemName = "vial of potent holy water", clientId = 31612, buy = 100 }, +} + +-- On buy npc shop message +npcType.onBuyItem = function(npc, player, itemId, subType, amount, ignore, inBackpacks, totalCost) + npc:sellItem(player, itemId, amount, subType, 0, ignore, inBackpacks) +end + +-- On sell npc shop message +npcType.onSellItem = function(npc, player, itemId, subtype, amount, ignore, name, totalCost) + player:sendTextMessage(MESSAGE_TRADE, string.format("Sold %ix %s for %i gold.", amount, name, totalCost)) +end + +-- On check npc shop message (look item) +npcType.onCheckItem = function(npc, player, clientId, subType) end + local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) @@ -57,63 +74,175 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end -local GraveDanger = Storage.Quest.U12_20.GraveDanger local function greetCallback(npc, creature) local player = Player(creature) - if player:getStorageValue(GraveDanger.QuestLine) < 1 then - npcHandler:setMessage(MESSAGE_GREET, "Welcome, |PLAYERNAME|! There is much we have to {discuss}.") - elseif player:getStorageValue(GraveDanger.QuestLine) >= 1 then - npcHandler:setMessage(MESSAGE_GREET, "Welcome, |PLAYERNAME|! Is there anything to {report}?") + if player then + if player:getLevel() >= 250 then + if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) < 1 then + npcHandler:setMessage(MESSAGE_GREET, "Welcome, |PLAYERNAME|! There is much we have to {discuss}.") + elseif player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) >= 3 then + npcHandler:setMessage(MESSAGE_GREET, "Hello, stranger! You look suspicious to me. I don't think we have anything to discuss.") + else + npcHandler:setMessage(MESSAGE_GREET, "Welcome, |PLAYERNAME|! Is there anything to {report}?") + end + else + npcHandler:setMessage(MESSAGE_GREET, "Hello, stranger! Sorry, but I never heard about you. I'm looking for more experienced help.") + end end + return true end local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + local storages = { + Storage.Quest.U12_20.GraveDanger.ScarlettKilled, + Storage.Quest.U12_20.GraveDanger.Graves.Progress, + Storage.Quest.U12_20.GraveDanger.Graves.Edron, + Storage.Quest.U12_20.GraveDanger.Graves.DarkCathedral, + Storage.Quest.U12_20.GraveDanger.Graves.Ghostlands, + Storage.Quest.U12_20.GraveDanger.Graves.Cormaya, + Storage.Quest.U12_20.GraveDanger.Graves.FemorHills, + Storage.Quest.U12_20.GraveDanger.Graves.Ankrahmun, + Storage.Quest.U12_20.GraveDanger.Graves.Kilmaresh, + Storage.Quest.U12_20.GraveDanger.Graves.Vengoth, + Storage.Quest.U12_20.GraveDanger.Graves.Darashia, + Storage.Quest.U12_20.GraveDanger.Graves.Thais, + Storage.Quest.U12_20.GraveDanger.Graves.Orclands, + Storage.Quest.U12_20.GraveDanger.Graves.IceIslands, + } if MsgContains(message, "late") then - if player:getStorageValue(GraveDanger.QuestLine) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) < 1 then + npcHandler:say({ + "While you travel and fight the threat where it arises, we will put all our resources into researching the ultimate plans of the legion. Perhaps I can tell you more when you {report} back. ...", + "Don't forget that you'll need very potent holy water for your task. If you need some, just ask me for a {trade}." + }, npc, creature) + for _, stor in pairs(storages) do + player:setStorageValue(stor, 0) + end + player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Stage, 0) + player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Questline, 1) + npcHandler:setTopic(playerId, 2) + else npcHandler:say({ "While you travel and fight the threat where it arises, we will put all our resources into researching the ultimate plans of the legion. Perhaps I can tell you more when you {report} back. ...", - "Don't forget that you'll need very potent holy water for your task. If you need some, just ask me for a {trade}.", + "Don't forget that you'll need very potent holy water for your task. If you need some, just ask me for a {trade}." }, npc, creature) - player:setStorageValue(GraveDanger.QuestLine, 1) - player:setStorageValue(GraveDanger.Graves.Edron, 1) - player:setStorageValue(GraveDanger.Graves.DarkCathedral, 1) - player:setStorageValue(GraveDanger.Graves.Ghostlands, 1) - player:setStorageValue(GraveDanger.Graves.Cormaya, 1) - player:setStorageValue(GraveDanger.Graves.FemorHills, 1) - player:setStorageValue(GraveDanger.Graves.Ankrahmun, 1) - player:setStorageValue(GraveDanger.Graves.Kilmaresh, 1) - player:setStorageValue(GraveDanger.Graves.Vengoth, 1) - player:setStorageValue(GraveDanger.Graves.Darashia, 1) - player:setStorageValue(GraveDanger.Graves.Thais, 1) - player:setStorageValue(GraveDanger.Graves.Orclands, 1) - player:setStorageValue(GraveDanger.Graves.IceIslands, 1) + npcHandler:setTopic(playerId, 2) + end + elseif MsgContains(message, "report") and npcHandler:getTopic(playerId) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Stage) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Graves.Progress) >= 12 then + npcHandler:say("By now the cultists of the Shiron'Fal seem to have abandoned their search. But this is sadly no good news. It seems they gathered enough lich-knights to proceed with their {ultimate} plan.", npc, creature) + npcHandler:setTopic(playerId, 3) + else + npcHandler:say("Sadly, I have no news yet. But I can give you information about the {locations} of the graves that we learned about. If you need more holy water just ask me for a {trade}.", npc, creature) + end + else + if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Killed) >= 1 then + if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) < 3 then + npcHandler:say("Incredible! You averted a crisis that would have utterly crippled our defences aganist any other threat that is arising. Let me grant you the honor to be one of the hands of the inquisition alongside with the according outfit as a reward.", npc, creature) + player:addOutfit(1243, 0) + player:addOutfit(1244, 0) + player:addAchievement("Inquisition's Hand") + player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Stage, 2) + player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Questline, 3) + else + npcHandler:say("Indeed you averted us a great danger! We will ever be greatful to you hand of the inquisition!", npc, creature) + end + else + npcHandler:say("You need to travel to the isle of the kings and end this threat before they raise king Zelos!", npc, creature) + end end + elseif MsgContains(message, "ultimate") and npcHandler:getTopic(playerId) == 3 then + npcHandler:say({ + "It became obvious that their goal is to raise an ancient and fallen king, to lead their lich-knights and raise even more of them. ...", + " With each lich-knight being able to raise and control lesser undead, this would lead to a chain-reaction. If they succeed, we might face an undead {threat} not seen since the corpse wars." + }, npc, creature) + npcHandler:setTopic(playerId, 4) + elseif MsgContains(message, "threat") and npcHandler:getTopic(playerId) == 4 then + npcHandler:say({ + "You have to travel to the isle of the kings. There, hidden beneath the isle of the kings is the shamefully hidden grave of king Zelos. It is him, they are trying to raise. ...", + "With some luck you will arrive before the ritual's completion. But be warned. At least four risen lich-knights will be present, to raise 'their king'. ...", + "Hopefully the ritual will bind some of their powers but they will still be formidable foes. You will have to act quick because with each moment you take to defeat the knights ...", + "The ritual will progress and the king will become stronger up to a point where you might be unable to defeat him. Due to the efforts and sacrifices of the death cultists, the king will be active at some capacity and you will have to confront him. ...", + "Remember, the further the ritual progresses when you face him, he will become considerably more powerful. So time is of the essence. ...", + "All I can do right now is to wish you good luck and may the gods bless you." + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Stage, 1) + player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Questline, 2) end - return true + + return true end ---Basic npcHandler:setMessage(MESSAGE_SENDTRADE, "Of course, my friend.") + npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) -npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) -npcConfig.shop = { - { itemName = "vial of potent holy water", clientId = 31612, buy = 100 }, -} --- On buy npc shop message -npcType.onBuyItem = function(npc, player, itemId, subType, amount, ignore, inBackpacks, totalCost) - npc:sellItem(player, itemId, amount, subType, 0, ignore, inBackpacks) -end --- On sell npc shop message -npcType.onSellItem = function(npc, player, itemId, subtype, amount, ignore, name, totalCost) - player:sendTextMessage(MESSAGE_TRADE, string.format("Sold %ix %s for %i gold.", amount, name, totalCost)) -end --- On check npc shop message (look item) -npcType.onCheckItem = function(npc, player, clientId, subType) end +keywordHandler:addKeyword({'discuss'}, StdModule.say, {npcHandler = npcHandler, text = "I need your help in a matter of utmost {urgency}."}) +keywordHandler:addKeyword({'urgency'}, StdModule.say, {npcHandler = npcHandler, text = "The situation is complicated and it's even hard to say where to {start} best, just to describe it to you."}) +keywordHandler:addKeyword({'start'}, StdModule.say, {npcHandler = npcHandler, text = "You see, several incidents in history can be traced back to a single {source}."}) +keywordHandler:addKeyword({'source'}, StdModule.say, {npcHandler = npcHandler, text = "Things get murkier the further you go down in history, but that's not even necessary. Even today we can discern a certain pattern in recent {events}."}) +keywordHandler:addKeyword({'events'}, StdModule.say, {npcHandler = npcHandler, text = { + "Well, in Rathleton there was an individual at work, looking for some ancient artefact of power. ...", + "To cover its escape the creature left another creature, known as the ravager to cover his tracks. But there is {more}." +}}) +keywordHandler:addKeyword({'more'}, StdModule.say, {npcHandler = npcHandler, text = { + "Only recently someone was trying to manipulate the elven dream courts into releasing a monstrosity of nightmares, probably planning to control or recruit this creature. ....", + "But those incidents were just some of {many}." +}}) +keywordHandler:addKeyword({'many'}, StdModule.say, {npcHandler = npcHandler, text = "The recent rise of lycanthropy, the robbery of certain forbidden arcane texts and the vanishing of at least three dangerous individuals, targeted by the inquisition are just the tip of the {iceberg}."}) +keywordHandler:addKeyword({'iceberg'}, StdModule.say, {npcHandler = npcHandler, text = { + "There is a scheming going on behind the scenes. Powerful good people were corrupted. Evil-doers got backup and resources from a hidden ally. ...", + "Powerful malignant creatures, gathering their kind under their banner and so much more. These things are not happening by chance. There is a pattern, a guiding {hand}." +}}) +keywordHandler:addKeyword({'hand'}, StdModule.say, {npcHandler = npcHandler, text = "This outside force is moving behind the scenes since ages. Our research suggests that this force probably even {predates} the rise of humanity."}) +keywordHandler:addKeyword({'predates'}, StdModule.say, {npcHandler = npcHandler, text = "Well, we are sure that the puppeteer behind all these events is an organisation. So old that even its name, the Shiron'Fal, has lost its meaning, because the {language} it originates from is long dead."}) +keywordHandler:addKeyword({'language'}, StdModule.say, {npcHandler = npcHandler, text = { + "It has a rather complex meaning and as far as we can tell it translates to 'army of those who are many, dedicated to the ultimate time of mayhem and despair'. ...", + "Other, more handy names are army of the last battlefield, army of the last days, legion of mayhem, dread legion or simply the {legion}." +}}) +keywordHandler:addKeyword({'legion'}, StdModule.say, {npcHandler = npcHandler, text = { + "We know little for sure. You can look into our books to see some of our sources. But most are vague and some even contradictory. ...", + "To summarise what we know, let me tell you this: The Shiron'Fal is an extremely old organisation. It seeks to accumulate power for some unknown but certainly sinister {goal}." +}}) +keywordHandler:addKeyword({'goal'}, StdModule.say, {npcHandler = npcHandler, text = { + "For this purpose, the members gather knowledge, artefacts and powerful individuals. The members are formidable at certain fields of expertise. They are cunning and powerful and act with no regard for others, with no remorse or mercy. ...", + "As they are doing this since ages, they must have acquired tremendous powers and knowledge. Their members often operate alone but are usually well funded with the necessary resources. ...", + "Whatever their endgame might be, each of their operations pose a grave danger to the whole world and have to be {stopped}." +}}) +keywordHandler:addKeyword({'stopped'}, StdModule.say, {npcHandler = npcHandler, text = "Here is where you come into play. We could identify the most recent plot of the Shiron'Fal and already had some {clashes}."}) +keywordHandler:addKeyword({'clashes'}, StdModule.say, {npcHandler = npcHandler, text = "In our efforts to hinder their plot, we achieved mixed results at best. But now things are escalating fast and we have to {hurry}."}) +keywordHandler:addKeyword({'hurry'}, StdModule.say, {npcHandler = npcHandler, text = "Our resources are already stretched thin, so we need your help with the most recent {problem}."}) +keywordHandler:addKeyword({'problem'}, StdModule.say, {npcHandler = npcHandler, text = "The legion tries to use a new form of twisted rituals to raise the bodies of well-known {knights}."}) +keywordHandler:addKeyword({'knights'}, StdModule.say, {npcHandler = npcHandler, text = { + "The knights they aim at were tainted in life by their actions or happenstance. ...", + "This leaves their bodies vulnerable to their special breed of necromancy that would raise them as powerful {lich}-knights." +}}) +keywordHandler:addKeyword({'lich'}, StdModule.say, {npcHandler = npcHandler, text = "These powerful undead were a terrible threat on their own but it seems even they are just part of some larger {scheme} that we cannot make out yet."}) +keywordHandler:addKeyword({'scheme'}, StdModule.say, {npcHandler = npcHandler, text = "We are still working feverishly to uncover their goals but for now more imminent {threats} are at hand."}) +keywordHandler:addKeyword({'threats'}, StdModule.say, {npcHandler = npcHandler, text = "Death cultists of the Shiron'Fal are trying to locate the bodies of fallen knights and raise them in blasphemous {rituals}."}) +keywordHandler:addKeyword({'rituals'}, StdModule.say, {npcHandler = npcHandler, text = "The churches of the gods worked hand in hand to supply us with the means to {purge} the graves of those knights."}) +keywordHandler:addKeyword({'purge'}, StdModule.say, {npcHandler = npcHandler, text = { + "Reaching the graves will not be without danger and if you encounter the death cultists you will have to fight them. Even worse, they might have even succeeded in some cases. ...", + "As a newly risen lich-knight is not able to leave the site of its resurrection for some time, you might have to fight some of them. ...", + "Let us pray that you never come too {late} or else some of the fiends might be able to leave their crypts." +}}) +keywordHandler:addKeyword({'locations'}, StdModule.say, {npcHandler = npcHandler, text = { + "We have located twelve graves that have to be secured: In the old northern Edron graveyard, in the dark cathedral of the plains of havoc, in the ghostlands, on Cormaya, Somewhere in the Femor Hills, on Vengoth, ...", + "in the graveyard of Darashia, in the old temple north of Thais, at the entrance to the orcland, one is on the southern ice islands, in a mountain on Kilmaresh, one on an island north-east of Ankrahmun." +}}) + +npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) npcType:register(npcConfig) diff --git a/data-otservbr-global/scripts/quests/grave_danger/actions_bosses_killed.lua b/data-otservbr-global/scripts/quests/grave_danger/actions_bosses_killed.lua deleted file mode 100644 index 8b1ed5b2c89..00000000000 --- a/data-otservbr-global/scripts/quests/grave_danger/actions_bosses_killed.lua +++ /dev/null @@ -1,33 +0,0 @@ -local bosses = { - ["sir baeloc"] = { storage = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictrosKilled }, - ["count vlarkorth"] = { storage = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorthKilled }, - ["duke krule"] = { storage = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKruleKilled }, - ["earl osam"] = { storage = Storage.Quest.U12_20.GraveDanger.Bosses.EarlOsamKilled }, - ["lord azaram"] = { storage = Storage.Quest.U12_20.GraveDanger.Bosses.LordAzaramKilled }, - ["king zelos"] = { storage = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelosKilled }, -} - -local bossesGraveDanger = CreatureEvent("GraveDangerBossDeath") -function bossesGraveDanger.onDeath(creature) - local bossConfig = bosses[creature:getName():lower()] - if not bossConfig then - return true - end - onDeathForDamagingPlayers(creature, function(creature, player) - if bossConfig.storage then - player:setStorageValue(bossConfig.storage, 1) - end - local bossesKilled = 0 - for value in pairs(bosses) do - if player:getStorageValue(bosses[value].storage) > 0 then - bossesKilled = bossesKilled + 1 - end - end - if bossesKilled >= 5 then -- number of mini bosses - player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Bosses.KingZelosDoor, 1) - end - end) - return true -end - -bossesGraveDanger:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger/creaturescripts_sirs.lua b/data-otservbr-global/scripts/quests/grave_danger/creaturescripts_sirs.lua deleted file mode 100644 index 539fe5a979f..00000000000 --- a/data-otservbr-global/scripts/quests/grave_danger/creaturescripts_sirs.lua +++ /dev/null @@ -1,29 +0,0 @@ -local sirNictrosThink = CreatureEvent("SirNictrosThink") -function sirNictrosThink.onThink(creature) - local maxhealth = creature:getMaxHealth() - if maxhealth * 0.65 > creature:getHealth() then - creature:say("Now it's your chance for entertainment, dear brother!", TALKTYPE_MONSTER_SAY) - creature:teleportTo(Position({ x = 33427, y = 31428, z = 13 })) - local boss = Tile(Position({ x = 33422, y = 31428, z = 13 })):getTopCreature() - if boss and boss:isMonster() then - boss:teleportTo(Position({ x = 33423, y = 31437, z = 13 })) - end - creature:unregisterEvent("SirNictrosThink") - end - return true -end - -sirNictrosThink:register() - -local sirBaelocThink = CreatureEvent("SirBaelocThink") -function sirBaelocThink.onThink(creature) - local maxhealth = creature:getMaxHealth() - if maxhealth * 0.65 > creature:getHealth() then - creature:say("Join me in battle, my brother. Let's share the fun!", TALKTYPE_MONSTER_SAY) - Tile(Position({ x = 33427, y = 31428, z = 13 })):getTopCreature():teleportTo(Position({ x = 33424, y = 31437, z = 13 })) - creature:unregisterEvent("SirBaelocThink") - end - return true -end - -sirBaelocThink:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger/creaturescripts_zelosDeath.lua b/data-otservbr-global/scripts/quests/grave_danger/creaturescripts_zelosDeath.lua deleted file mode 100644 index ce65f46c9ef..00000000000 --- a/data-otservbr-global/scripts/quests/grave_danger/creaturescripts_zelosDeath.lua +++ /dev/null @@ -1,26 +0,0 @@ -local config = { - centerPosition = Position(33443, 31545, 13), - rangeX = 11, - rangeY = 11, -} - -local KingzelosDeath = CreatureEvent("zelosDeath") - -function KingzelosDeath.onPrepareDeath(creature) - local spectators = Game.getSpectators(config.centerPosition, false, false, config.rangeX, config.rangeX, config.rangeY, config.rangeY) - for _, specCreature in pairs(spectators) do - if specCreature:isPlayer() then - if specCreature:getStorageValue(Storage.Quest.U12_20.GraveDanger.Bosses.InquisitionOutfitReceived) == -1 then - specCreature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations you received the Hand of the Inquisition Outfit.") - specCreature:addOutfit(1244, 0) - specCreature:addOutfit(1243, 0) - specCreature:setStorageValue(Storage.Quest.U12_20.GraveDanger.Bosses.InquisitionOutfitReceived, 1) - end - specCreature:addAchievement("Inquisition's Hand") - end - end - - return true -end - -KingzelosDeath:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_custodian.lua b/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_custodian.lua deleted file mode 100644 index c21f58bb90e..00000000000 --- a/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_custodian.lua +++ /dev/null @@ -1,16 +0,0 @@ -local config = { - monsterName = "Custodian", - bossPosition = Position(33376, 32825, 8), - centerPosition = Position(33376, 32825, 8), - rangeX = 50, - rangeY = 50, -} - -local miniBoss = GlobalEvent("custodian") -function miniBoss.onThink(interval, lastExecution) - checkBoss(config.centerPosition, config.rangeX, config.rangeY, config.monsterName, config.bossPosition) - return true -end - -miniBoss:interval(15 * 60 * 1000) -miniBoss:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_gaffir.lua b/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_gaffir.lua deleted file mode 100644 index c6f814cbc04..00000000000 --- a/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_gaffir.lua +++ /dev/null @@ -1,16 +0,0 @@ -local config = { - monsterName = "Gaffir", - bossPosition = Position(33394, 32674, 4), - centerPosition = Position(33394, 32674, 4), - rangeX = 50, - rangeY = 50, -} - -local miniBoss = GlobalEvent("gaffir") -function miniBoss.onThink(interval, lastExecution) - checkBoss(config.centerPosition, config.rangeX, config.rangeY, config.monsterName, config.bossPosition) - return true -end - -miniBoss:interval(15 * 60 * 1000) -miniBoss:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_quaid.lua b/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_quaid.lua deleted file mode 100644 index 3aeded3beee..00000000000 --- a/data-otservbr-global/scripts/quests/grave_danger/globalevents_cobra_minis_quaid.lua +++ /dev/null @@ -1,16 +0,0 @@ -local config = { - monsterName = "Guard Captain Quaid", - bossPosition = Position(33392, 32660, 3), - centerPosition = Position(33392, 32660, 3), - rangeX = 50, - rangeY = 50, -} - -local miniBoss = GlobalEvent("guard captain quaid") -function miniBoss.onThink(interval, lastExecution) - checkBoss(config.centerPosition, config.rangeX, config.rangeY, config.monsterName, config.bossPosition) - return true -end - -miniBoss:interval(15 * 60 * 1000) -miniBoss:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger/movements_firewall_gaffir.lua b/data-otservbr-global/scripts/quests/grave_danger/movements_firewall_gaffir.lua deleted file mode 100644 index c5b3902c1e0..00000000000 --- a/data-otservbr-global/scripts/quests/grave_danger/movements_firewall_gaffir.lua +++ /dev/null @@ -1,47 +0,0 @@ -local above = { [32021] = 5062 } -local outside = { [5062] = 32021 } - --- onStepIn -local gaffirwall = MoveEvent() - -function gaffirwall.onStepIn(creature, item, position, fromPosition) - if not above[item.itemid] then - return true - end - - local player = creature:getPlayer() - if not player or player:isInGhostMode() then - return true - end - item:transform(above[item.itemid]) -end - -gaffirwall:type("stepin") - -for index, value in pairs(above) do - gaffirwall:id(index) -end -gaffirwall:register() - -gaffirwall = MoveEvent() - -function gaffirwall.onStepOut(creature, item, position, fromPosition) - if not outside[item.itemid] then - return false - end - - local player = creature:getPlayer() - if not player or player:isInGhostMode() then - return true - end - - item:transform(outside[item.itemid]) - player:setSpecialContainersAvailable(false, false) - return true -end - -gaffirwall:type("stepout") -for index, value in pairs(outside) do - gaffirwall:id(index) -end -gaffirwall:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger/movements_teleport_king_zelos.lua b/data-otservbr-global/scripts/quests/grave_danger/movements_teleport_king_zelos.lua deleted file mode 100644 index e5742bdddfb..00000000000 --- a/data-otservbr-global/scripts/quests/grave_danger/movements_teleport_king_zelos.lua +++ /dev/null @@ -1,14 +0,0 @@ -local Teleport = MoveEvent() - -function Teleport.onStepIn(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then - return true - end - player:teleportTo(Position(33492, 31546, 13)) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - return true -end - -Teleport:position({ x = 32174, y = 31916, z = 8 }) -Teleport:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_azaram_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_azaram_fight.lua new file mode 100644 index 00000000000..14e479f6fe3 --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_azaram_fight.lua @@ -0,0 +1,28 @@ +local config = { + boss = { + name = "Lord Azaram", + position = Position(33424, 31472, 13), + }, + timeAfterKill = 30 * 60, + playerPositions = { + { pos = Position(33422, 31493, 13), teleport = Position(33424, 31478, 13) }, + { pos = Position(33423, 31493, 13), teleport = Position(33424, 31478, 13) }, + { pos = Position(33424, 31493, 13), teleport = Position(33424, 31478, 13) }, + { pos = Position(33425, 31493, 13), teleport = Position(33424, 31478, 13) }, + { pos = Position(33426, 31493, 13), teleport = Position(33424, 31478, 13) }, + }, + specPos = { + from = Position(33414, 31463, 13), + to = Position(33433, 31481, 13), + }, + monsters = { + { name = "Condensed Sin", pos = Position(33426, 31471, 13) }, + { name = "Condensed Sin", pos = Position(33422, 31471, 13) }, + }, + exit = Position(32190, 31819, 8), + exitTeleporter = Position(32192, 31819, 8), +} + +local lever = BossLever(config) +lever:aid(14561) +lever:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua new file mode 100644 index 00000000000..55d752011df --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua @@ -0,0 +1,85 @@ +local config = { + centerRoom = Position(33424, 31439, 13), + newPosition = Position(33425, 31431, 13), + exitPos = Position(33290, 32474, 9), + x = 12, + y = 12, + baelocPos = Position(33422, 31428, 13), + nictrosPos = Position(33427, 31428, 13), + timer = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Timer, + room = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Room, + fromPos = Position(33415, 31426, 13), + toPos = Position(33434, 31450, 13), +} + +local function brothers_play() + local baeloc = Creature('Sir Baeloc') + local nictros = Creature('Sir Nictros') + + if baeloc then + baeloc:say('Ah look my Brother! Challengers! After all this time finally a chance to prove our skills!') + addEvent(function() + local nictros = Creature('Sir Nictros') + if nictros then + nictros:say('Indeed! It has been a while! As the elder one I request the right of the first battle!') + end + end, 6 * 1000) + end + + addEvent(function() + local baeloc = Creature('Sir Baeloc') + local nictros = Creature('Sir Nictros') + if baeloc then + baeloc:say('Oh, man! You always get the fun!') + if nictros then + nictros:teleportTo(Position(33426, 31437, 13)) + nictros:setMoveLocked(false) + end + end + end, 12 * 1000) +end + +local baeloc_fight = Action() + +function baeloc_fight.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player:doCheckBossRoom("Sir Baeloc", config.fromPos, config.toPos) then + player:sendCancelMessage('The room is already in use. Please wait.') + return true + end + + local baeloc = Game.createMonster('Sir Baeloc', config.baelocPos, true, true) + local nictros = Game.createMonster('Sir Nictros', config.nictrosPos, true, true) + + if baeloc then + baeloc:setMoveLocked(true) + baeloc:registerEvent('sir_baeloc_health') + baeloc:registerEvent('brothers_summon') + end + + if nictros then + nictros:setMoveLocked(true) + nictros:registerEvent('sir_nictros_health') + nictros:registerEvent('brothers_summon') + end + + addEvent(brothers_play, 4 * 1000) + + for x = 33424, 33428 do + local playerTile = Tile(Position(x, 31413, 13)):getTopCreature() + if playerTile and playerTile:isPlayer() then + playerTile:getPosition():sendMagicEffect(CONST_ME_POFF) + playerTile:teleportTo(config.newPosition) + playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + playerTile:setStorageValue(config.timer, os.time() + 20 * 3600) + playerTile:setStorageValue(config.room, os.time() + 30 * 60) + playerTile:say('You have 30 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.', TALKTYPE_MONSTER_SAY, false, playerTile) + end + end + + addEvent(clearForgotten, 30 * 60 * 1000, config.centerRoom, config.x, config.y, config.exitPos, config.room) + + return true +end + +baeloc_fight:aid(14559) +baeloc_fight:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_custodian_door.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_custodian_door.lua new file mode 100644 index 00000000000..e87dd9d9b2a --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_custodian_door.lua @@ -0,0 +1,21 @@ +local custodian_door = Action() + +function custodian_door.onUse(player, item, isHotkey) + if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.GaffirKilled) < 1 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The power of Gaffir won't let you pass this door!") + return true + end + + local pos = player:getPosition() + + if pos.x == 33365 then + player:teleportTo(Position(pos.x + 2, pos.y, pos.z)) + elseif pos.x == 33367 then + player:teleportTo(Position(pos.x - 2, pos.y, pos.z)) + end + + return true +end + +custodian_door:aid(36569) +custodian_door:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_dark_remains.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_dark_remains.lua new file mode 100644 index 00000000000..03605b21041 --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_dark_remains.lua @@ -0,0 +1,28 @@ +local voc_table = { + [31203] = {voc = 4}, + [31204] = {voc = 3}, + [31205] = {voc = 2}, + [31206] = {voc = 1} +} + +local dark_remains = Action() + +function dark_remains.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local canUse = voc_table[item.itemid] + + if target:isPlayer() or player:getVocation():getBase():getId() ~= canUse.voc then + return false + end + + if target:getName():lower() == 'count vlarkorth' then + item:remove(1) + target:setStorageValue(3, target:getStorageValue(3) - 1) + target:say('The magic shield of protection is weakened!') + toPosition:sendMagicEffect(CONST_ME_HOLYAREA) + end + + return true +end + +dark_remains:id(31203, 31204, 31205, 31206) +dark_remains:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua new file mode 100644 index 00000000000..fbb83b93fc1 --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua @@ -0,0 +1,129 @@ +local config = { + centerRoom = Position(33456, 31472, 13), + newPosition = Position(33456, 31478, 13), + exitPos = Position(32344, 32168, 12), + x = 10, + y = 10, + timer = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.Timer, + room = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.Room, + transformCD = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.TransformCD, + fromPos = Position(33415, 31426, 13), + toPos = Position(33434, 31450, 13), +} + +local duke_water = Combat() +duke_water:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO) +duke_water:setArea(createCombatArea(AREA_CIRCLE3X3)) + +function onTargetTile(cid, pos) + local tile = Tile(pos) + local target = tile:getTopCreature() + if tile then + if target and target:isPlayer() and target:getOutfit().lookType == 49 then + doTargetCombatHealth(0, target, COMBAT_ICEDAMAGE, -1500, -2000) + end + end +end + +duke_water:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") + +local duke_fire = Combat() +duke_fire:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) +duke_fire:setArea(createCombatArea(AREA_CIRCLE3X3)) + +function onTargetTile(cid, pos) + local tile = Tile(pos) + local target = tile:getTopCreature() + if tile then + if target and target:isPlayer() and target:getOutfit().lookType == 286 then + doTargetCombatHealth(0, target, COMBAT_FIREDAMAGE, -1500, -2000) + end + end +end + +duke_fire:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") + +local function hitArea(creature) + local player = Player(creature) + + if player then + if player:getStorageValue(config.transformCD) <= os.time() then + if player:getOutfit().lookType == 49 then + local var = {type = 1, number = creature} + duke_fire:execute(player, var) + player:setStorageValue(config.transformCD, os.time() + 3) + addEvent(hitArea, 3 * 1000, creature) + elseif player:getOutfit().lookType == 286 then + local var = {type = 1, number = creature} + duke_water:execute(player, var) + player:setStorageValue(config.transformCD, os.time() + 3) + addEvent(hitArea, 3 * 1000, creature) + end + end + end + + return true +end + +local function transformPlayers(id) + local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) + local form = {49, 286} + local boss = Creature('Duke Krule') + + if boss and boss:getStorageValue(1) == id then + if #spectators > 0 then + for _, player in pairs(spectators) do + doSetCreatureOutfit(player, {lookType = form[math.random(#form)]}, 30 * 1000) + addEvent(hitArea, 3 * 1000, player:getId()) + end + addEvent(transformPlayers, 36 * 1000, id) + end + end + + return true +end + +local duke_fight = Action() + +function duke_fight.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player:doCheckBossRoom("Duke Krule", config.fromPos, config.toPos) then + player:sendCancelMessage('The room is already in use. Please wait.') + return true + end + + local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) + + if player:getPosition() ~= Position(33455, 31493, 13) then + player:sendCancelMessage('Sorry, not possible.') + return true + end + + if #spectators > 0 then + player:say("The room is occupied by another team, please wait.", TALKTYPE_MONSTER_SAY, false, player) + return true + end + + local boss = Game.createMonster('Duke Krule', config.centerRoom, true, true) + local id = os.time() + boss:setStorageValue(1, id) + addEvent(transformPlayers, 30 * 1000, id) + + for x = 33455, 33459 do + local playerTile = Tile(Position(x, 31493, 13)):getTopCreature() + if playerTile and playerTile:isPlayer() then + playerTile:getPosition():sendMagicEffect(CONST_ME_POFF) + playerTile:teleportTo(config.newPosition) + playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + playerTile:setStorageValue(config.timer, os.time() + 20 * 3600) + playerTile:setStorageValue(config.room, os.time() + 30 * 60) + playerTile:say('You have 30 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.', TALKTYPE_MONSTER_SAY, false, playerTile) + end + end + + addEvent(clearForgotten, 30 * 60 * 1000, config.centerRoom, config.x, config.y, config.exitPos, config.room) + + return true +end + +duke_fight:aid(14560) +duke_fight:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_earl_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_earl_fight.lua new file mode 100644 index 00000000000..0d40c7d8593 --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_earl_fight.lua @@ -0,0 +1,24 @@ +local config = { + boss = { + name = "Earl Osam", + position = Position(33488, 31438, 13), + }, + timeAfterKill = 30 * 60, + playerPositions = { + { pos = Position(33516, 31444, 13), teleport = Position(33489, 31441, 13) }, + { pos = Position(33517, 31444, 13), teleport = Position(33489, 31441, 13) }, + { pos = Position(33518, 31444, 13), teleport = Position(33489, 31441, 13) }, + { pos = Position(33519, 31444, 13), teleport = Position(33489, 31441, 13) }, + { pos = Position(33520, 31444, 13), teleport = Position(33489, 31441, 13) }, + }, + specPos = { + from = Position(33479, 31429, 13), + to = Position(33497, 31447, 13), + }, + exit = Position(33261, 31985, 8), + exitTeleporter = Position(33263, 31985, 8), +} + +local lever = BossLever(config) +lever:aid(14558) +lever:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_grave_sanctify.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_grave_sanctify.lua new file mode 100644 index 00000000000..2da0f57928b --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_grave_sanctify.lua @@ -0,0 +1,71 @@ +local config = { + [1] = { + pos = Position(32644, 32394, 8), + stor = Storage.Quest.U12_20.GraveDanger.Graves.DarkCathedral, + msg = "This grave now been sanctified and is safe!" + }, + [2] = { + pos = Position(32542, 31846, 6), + stor = Storage.Quest.U12_20.GraveDanger.Graves.FemorHills, + msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here." + }, + [3] = { + pos = Position(33376, 32806, 8), + stor = Storage.Quest.U12_20.GraveDanger.Graves.Ankrahmun, + msg = "This grave now been sanctified and is safe!" + }, + [4] = { + pos = Position(32959, 31534, 7), + stor = Storage.Quest.U12_20.GraveDanger.Graves.Vengoth, + msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here." + }, + [5] = { + pos = Position(32776, 31817, 8), + stor = Storage.Quest.U12_20.GraveDanger.Graves.Orclands, + msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here." + }, + [6] = { + pos = Position(32012, 31558, 7), + stor = Storage.Quest.U12_20.GraveDanger.Graves.IceIslands, + msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here." + }, + [7] = { + pos = Position(33813, 31624, 9), + stor = Storage.Quest.U12_20.GraveDanger.Graves.Kilmaresh, + msg = "This grave now been sanctified and is safe!" + } +} + +local function getGrave(pos) + for i = 1, #config do + if pos == config[i].pos then + return i + end + end + + return true +end + +local grave_sanctify = Action() + +function grave_sanctify.onUse(player, item, fromPosition, itemEx, toPosition) + local thing = config[getGrave(itemEx:getPosition())] + + if not thing then + return true + end + + if player:getStorageValue(thing.stor) < 1 then + player:setStorageValue(thing.stor, 1) + itemEx:getPosition():sendMagicEffect(CONST_ME_HOLYAREA) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, thing.msg) + player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Graves.Progress, player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Graves.Progress) + 1) + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, thing.msg) + end + + return true +end + +grave_sanctify:id(31612) +grave_sanctify:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_king_zelos.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_king_zelos.lua new file mode 100644 index 00000000000..85bb3006bf2 --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_king_zelos.lua @@ -0,0 +1,79 @@ +local config = { + centerRoom = Position(33443, 31545, 13), + newPosition = Position(33436, 31572, 13), + exitPos = Position(32172, 31917, 8), + x = 30, + y = 30, + summons = { + { + name = 'Rewar The Bloody', + pos = Position(33463, 31562, 13) + }, + { + name = 'The Red Knight', + pos = Position(33423, 31562, 13) + }, + { + name = 'Magnor Mournbringer', + pos = Position(33463, 31529, 13) + }, + { + name = 'Nargol the Impaler', + pos = Position(33423, 31529, 13) + }, + { + name = 'King Zelos', + pos = Position(33443, 31545, 13) + } + }, + timer = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Timer, + room = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Room, + fromPos = Position(33414, 31520, 13), + toPos = Position(33474, 31574, 13), +} + +local king_zelos = Action() + +function king_zelos.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not player:doCheckBossRoom("King Zelos", config.fromPos, config.toPos) then + player:sendCancelMessage('The room is already in use. Please wait.') + return true + end + + local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) + + if player:getPosition() ~= Position(33485, 31546, 13) then + player:sendCancelMessage('Sorry, not possible.') + return true + end + + if #spectators > 0 then + player:say("The room is occupied by another team, please wait.", TALKTYPE_MONSTER_SAY, false, player) + return true + end + + for _, boss in pairs(config.summons) do + Game.createMonster(boss.name, boss.pos, false, true) + end + + for x = 33485, 33486 do + for y = 31544, 31548 do + local playerTile = Tile(Position(x, y, 13)):getTopCreature() + if playerTile and playerTile:isPlayer() then + playerTile:getPosition():sendMagicEffect(CONST_ME_POFF) + playerTile:teleportTo(config.newPosition) + playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + playerTile:setStorageValue(config.timer, os.time() + 20 * 3600) + playerTile:setStorageValue(config.room, os.time() + 24 * 60) + playerTile:say('You have 24 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.', TALKTYPE_MONSTER_SAY, false, playerTile) + end + end + end + + addEvent(clearForgotten, 24 * 60 * 1000, config.centerRoom, config.x, config.y, config.exitPos, config.room) + + return true +end + +king_zelos:aid(14568) +king_zelos:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_vlarkorth_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_vlarkorth_fight.lua new file mode 100644 index 00000000000..c589c9ae692 --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_vlarkorth_fight.lua @@ -0,0 +1,25 @@ +local config = { + boss = { + name = "Count Vlarkorth", + position = Position(33456, 31437, 13), + }, + timeAfterKill = 30 * 60, + playerPositions = { + { pos = Position(33455, 31413, 13), teleport = Position(33457, 31442, 13) }, + { pos = Position(33456, 31413, 13), teleport = Position(33457, 31442, 13) }, + { pos = Position(33457, 31413, 13), teleport = Position(33457, 31442, 13) }, + { pos = Position(33458, 31413, 13), teleport = Position(33457, 31442, 13) }, + { pos = Position(33459, 31413, 13), teleport = Position(33457, 31442, 13) }, + }, + specPos = { + from = Position(33451, 31432, 13), + to = Position(33461, 31442, 13), + }, + exit = Position(33195, 31696, 8), + exitTeleporter = Position(33456, 31446, 13), +} + +local lever = BossLever(config) +lever:aid(14557) +lever:register() + diff --git a/data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/actions_scarlett.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/actions_scarlett.lua similarity index 86% rename from data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/actions_scarlett.lua rename to data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/actions_scarlett.lua index 8a25b60c3d1..4495173c2f5 100644 --- a/data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/actions_scarlett.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/actions_scarlett.lua @@ -14,7 +14,7 @@ local config = { name = "Scarlett Etzel", createFunction = function() local scarlett = Game.createMonster("Scarlett Etzel", Position(33396, 32643, 6), true, true) - scarlett:setStorageValue(Storage.GraveDanger.CobraBastion.Questline, 1) + scarlett:setStorageValue(Storage.Quest.U12_20.GraveDanger.CobraBastion.Questline, 1) return scarlett end, }, @@ -56,6 +56,7 @@ local function backMirror() for x = mirror.fromPos.x, mirror.toPos.x do for y = mirror.fromPos.y, mirror.toPos.y do local sqm = Tile(Position(x, y, 6)) + if sqm then for _, id in pairs(mirror.mirrors) do local item = sqm:getItemById(id) @@ -70,7 +71,13 @@ local function backMirror() end local graveScarlettAid = Action() + function graveScarlettAid.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.GaffirKilled) ~= 1 and player:getStorageValue(Storage.Quest.U12_20.GraveDanger.CustodianKilled) ~= 1 and player:getStorageValue(Storage.Quest.U12_20.GraveDanger.QuaidKilled) ~= 1 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are not allowed to use this yet.") + return true + end + if table.contains(transformTo, item.itemid) then local pilar = transformTo[item.itemid] if pilar then @@ -94,6 +101,7 @@ function graveScarlettAid.onUse(player, item, fromPosition, target, toPosition, player:teleportTo(Position(33395, 32666, 6)) end end + return true end diff --git a/data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/creaturescripts_scarlett.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/creaturescripts_scarlett.lua similarity index 98% rename from data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/creaturescripts_scarlett.lua rename to data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/creaturescripts_scarlett.lua index f68cdfc155d..cd5d4e8ef3e 100644 --- a/data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/creaturescripts_scarlett.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/creaturescripts_scarlett.lua @@ -20,7 +20,7 @@ end combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") -local storage = Storage.GraveDanger.CobraBastion.Questline +local storage = Storage.Quest.U12_20.GraveDanger.CobraBastion.Questline local rooms = { [1] = { fromPos = Position(33390, 32642, 6), toPos = Position(33394, 32646, 6) }, [2] = { fromPos = Position(33390, 32646, 6), toPos = Position(33394, 32650, 6) }, diff --git a/data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/creaturescripts_ugly_monster.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/creaturescripts_ugly_monster.lua similarity index 100% rename from data-otservbr-global/scripts/quests/grave_danger/cobra_bastion/creaturescripts_ugly_monster.lua rename to data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/creaturescripts_ugly_monster.lua diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_baeloc_nictros_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_baeloc_nictros_fight.lua new file mode 100644 index 00000000000..7bd34a7cf26 --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_baeloc_nictros_fight.lua @@ -0,0 +1,119 @@ +local config = { + centerRoom = Position(33424, 31439, 13), + newPosition = Position(33425, 31431, 13), + exitPos = Position(33290, 32474, 9), + x = 12, + y = 12, + baelocPos = Position(33422, 31428, 13), + nictrosPos = Position(33427, 31428, 13), + timer = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Timer, + room = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Room, + fromPos = Position(33418, 31434, 13), + toPos = Position(33431, 31445, 13) +} + +local brothers_summon = CreatureEvent('brothers_summon') + +function brothers_summon.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) + local chance = math.random(1, 100) + local position = Position(math.random(config.fromPos.x, config.toPos.x), math.random(config.fromPos.y, config.toPos.y), config.fromPos.z) + local tile = Tile(position) + + if chance >= 90 then + if tile:isWalkable(false, false, false, true, false) then + local summon = creature:getName():lower() == 'sir nictros' and 'Squire Of Nictros' or 'Retainer Of Baeloc' + Game.createMonster(summon, position, false, true) + end + end + + return primaryDamage, primaryType, -secondaryDamage, secondaryType +end + +brothers_summon:register() + +local sir_nictros_health = CreatureEvent('sir_nictros_health') + +function sir_nictros_health.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) + local players = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) + for _, player in pairs(players) do + if player:isPlayer() then + if player:getStorageValue(config.timer) < os.time() then + player:setStorageValue(config.timer, os.time() + 20 * 3600) + end + if player:getStorageValue(config.room) < os.time() then + player:setStorageValue(config.room, os.time() + 30 * 60) + end + end + end + + if primaryType == COMBAT_HEALING then + return primaryDamage, primaryType, -secondaryDamage, secondaryType + end + + local health = creature:getMaxHealth() * 0.60 + local brother_diff = (creature:getHealth() / creature:getMaxHealth()) * 100 + local brother = Creature('Sir Baeloc') + + if brother then + if brother_diff < 55 then + local brother_percent = (brother:getHealth() / brother:getMaxHealth()) * 100 + if (brother_percent - brother_diff) > 5 then + creature:addHealth(28000) + end + end + end + + creature:setStorageValue(1, creature:getStorageValue(1) + primaryDamage + secondaryDamage) + if creature:getStorageValue(2) < 1 and creature:getStorageValue(1) >= health then + creature:setStorageValue(2, 1) + creature:say("Now it's your chance for entertaiment, dear brother!") + creature:teleportTo(config.nictrosPos) + creature:setMoveLocked(true) + local baeloc = Creature('Sir Baeloc') + if baeloc then + baeloc:teleportTo(Position(33424, 31436, 13)) + baeloc:setMoveLocked(false) + end + end + + return primaryDamage, primaryType, -secondaryDamage, secondaryType +end + +sir_nictros_health:register() + +local sir_baeloc_health = CreatureEvent('sir_baeloc_health') + +function sir_baeloc_health.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) + if primaryType == COMBAT_HEALING then + return primaryDamage, primaryType, -secondaryDamage, secondaryType + end + + local health = creature:getMaxHealth() * 0.60 + local brother_diff = (creature:getHealth() / creature:getMaxHealth()) * 100 + local brother = Creature('Sir Nictros') + + if brother then + if brother_diff < 55 then + local brother_percent = (brother:getHealth() / brother:getMaxHealth()) * 100 + if (brother_percent - brother_diff) > 5 then + creature:addHealth(28000) + end + end + end + + creature:setStorageValue(1, creature:getStorageValue(1) + primaryDamage + secondaryDamage) + + if creature:getStorageValue(2) < 1 and creature:getStorageValue(1) >= health then + creature:setStorageValue(2, 1) + creature:say("Join me in battle my brother. Let's share the fun!") + local nictros = Creature('Sir Nictros') + if nictros then + nictros:teleportTo(Position(33426, 31438, 13)) + nictros:setMoveLocked(false) + end + end + + return primaryDamage, primaryType, -secondaryDamage, secondaryType +end + +sir_baeloc_health:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_boss_kill.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_boss_kill.lua new file mode 100644 index 00000000000..a307986ce34 --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_boss_kill.lua @@ -0,0 +1,84 @@ +local config = { + ['gaffir'] = { + stor = Storage.Quest.U12_20.GraveDanger.GaffirKilled + }, + ['custodian'] = { + stor = Storage.Quest.U12_20.GraveDanger.CustodianKilled + }, + ['guard captain quaid'] = { + stor = Storage.Quest.U12_20.GraveDanger.QuaidKilled + }, + ['scarlett etzel'] = { + stor = Storage.Quest.U12_20.GraveDanger.ScarlettKilled + }, + ['earl osam'] = { + stor = Storage.Quest.U12_20.GraveDanger.Bosses.EarlOsam.Killed, + extra = { + stor = Storage.Quest.U12_20.GraveDanger.Graves.Cormaya, + value = 1 + } + }, + ['count vlarkorth'] = { + stor = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorth.Killed, + extra = { + stor = Storage.Quest.U12_20.GraveDanger.Graves.Edron, + value = 1 + } + }, + ['sir baeloc'] = { + stor = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Killed, + extra = { + stor = Storage.Quest.U12_20.GraveDanger.Graves.Darashia, + value = 1 + } + }, + ['duke krule'] = { + stor = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.Killed, + extra = { + stor = Storage.Quest.U12_20.GraveDanger.Graves.Thais, + value = 1 + } + }, + ['lord azaram'] = { + stor = Storage.Quest.U12_20.GraveDanger.Bosses.LordAzaram.Killed, + extra = { + stor = Storage.Quest.U12_20.GraveDanger.Graves.Ghostlands, + value = 1 + } + }, + ['king zelos'] = { + stor = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Killed + } +} + +local grave_danger_death = CreatureEvent("grave_danger_death") + +function grave_danger_death.onDeath(creature, corpse, killer, mostDamageKiller) + local bossConfig = config[creature:getName():lower()] + + if not bossConfig then + return true + end + + local attackers = creature:getDamageMap() + for attackerId, _ in pairs(attackers) do + local player = Player(attackerId) + if player and player:getStorageValue(bossConfig.stor) < 1 then + player:setStorageValue(bossConfig.stor, 1) + + if creature:getName():lower() == 'scarlett etzel' then + player:addAchievement("A Study in Scarlett") + end + + if bossConfig.extra then + player:setStorageValue(bossConfig.extra.stor, bossConfig.extra.value) + local graves = player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Graves.Progress) + player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Graves.Progress, graves + 1) + end + end + end + + return true +end + +grave_danger_death:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_count_vlarkorth_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_count_vlarkorth_fight.lua new file mode 100644 index 00000000000..9eab1fd9137 --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_count_vlarkorth_fight.lua @@ -0,0 +1,91 @@ +local config = { + centerRoom = Position(33456, 31437, 13), + newPosition = Position(33457, 31442, 13), + exitPos = Position(33195, 31696, 8), + x = 10, + y = 10, + summons = { + [1] = {summon = 'Dark Sorcerer'}, + [2] = {summon = 'Dark Druid'}, + [3] = {summon = 'Dark Paladin'}, + [4] = {summon = 'Dark Knight'} + }, + timer = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorth.Timer, + room = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorth.Room +} + +local function summonDarks() + local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) + local boss = Creature('Count Vlarkorth') + if not boss then + return false + end + + if #spectators > 0 then + for _, player in pairs(spectators) do + local vocationId = player:getVocation():getBase():getId() + local toSummon = config.summons[vocationId] + if toSummon then + local newPosition = boss:getClosestFreePosition(boss:getPosition(), true) + if newPosition then + local dark = Game.createMonster(toSummon.summon, newPosition, false, true) + if dark then + local summonCount = boss:getStorageValue(3) + boss:setStorageValue(3, math.max(0, summonCount) + 1) + end + end + end + end + boss:say('Face your own darkness!') + end + + return true +end + +local count_vlarkorth_transform = CreatureEvent('count_vlarkorth_transform') + +function count_vlarkorth_transform.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) + local players = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) + for _, player in pairs(players) do + if player:isPlayer() then + if player:getStorageValue(config.timer) < os.time() then + player:setStorageValue(config.timer, os.time() + 20 * 3600) + end + if player:getStorageValue(config.room) < os.time() then + player:setStorageValue(config.room, os.time() + 30 * 60) + end + end + end + + if primaryType == COMBAT_HEALING then + return primaryDamage, primaryType, -secondaryDamage, secondaryType + end + + if not creature then + return primaryDamage, primaryType, secondaryDamage, secondaryType + end + + local health = creature:getMaxHealth() * 0.15 + local damageStorage = creature:getStorageValue(1) + if damageStorage < 0 then + creature:setStorageValue(1, 0) + damageStorage = 0 + end + + if creature:getStorageValue(3) > 0 then + creature:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT) + return primaryDamage, primaryType, secondaryDamage, secondaryType + end + + creature:setStorageValue(1, damageStorage + primaryDamage + secondaryDamage) + + if creature:getStorageValue(1) >= health then + creature:setStorageValue(1, 0) + creature:setStorageValue(3, 0) + summonDarks() + end + + return primaryDamage, primaryType, -secondaryDamage, secondaryType +end + +count_vlarkorth_transform:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_earl_osam_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_earl_osam_fight.lua new file mode 100644 index 00000000000..a4339c920a4 --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_earl_osam_fight.lua @@ -0,0 +1,163 @@ +local config = { + centerRoom = Position(33488, 31438, 13), + newPosition = Position(33489, 31441, 13), + exitPos = Position(33261, 31985, 8), + x = 10, + y = 10, + timer = Storage.Quest.U12_20.GraveDanger.Bosses.EarlOsam.Timer, + room = Storage.Quest.U12_20.GraveDanger.Bosses.EarlOsam.Room, + fromPos = Position(33479, 31429, 13), + toPos = Position(33497, 31447, 13), + spheres = { + Position(33480, 31438, 13), + Position(33488, 31430, 13), + Position(33496, 31438, 13), + Position(33488, 31446, 13) + } +} + +local function moveSphere() + local spectators = Game.getSpectators(config.centerRoom, false, false, config.x, config.x, config.y, config.y) + local nextPos = nil + local boss = Creature('Earl Osam') + + if boss and boss:getStorageValue(3) > 0 then + for _, spheres in pairs(spectators) do + if spheres:isMonster() and spheres:getName():lower() == 'magical sphere' then + local pos = spheres:getPosition() + + if pos.y == 31438 then + if pos.x > 33488 then + nextPos = Position(pos.x - 1, pos.y, pos.z) + elseif pos.x < 33488 then + nextPos = Position(pos.x + 1, pos.y, pos.z) + end + elseif pos.x == 33488 then + if pos.y > 31438 then + nextPos = Position(pos.x, pos.y - 1, pos.z) + elseif pos.y < 31438 then + nextPos = Position(pos.x, pos.y + 1, pos.z) + end + end + + if nextPos then + local nextTile = Tile(nextPos) + if nextTile then + local nextCreature = nextTile:getTopCreature() + if nextCreature then + if nextPos == config.centerRoom and nextCreature:getName():lower() == 'earl osam' then + spheres:remove() + nextCreature:addHealth(80000) + nextCreature:setStorageValue(3, nextCreature:getStorageValue(3) - 1) + if nextCreature:isMoveLocked() then + nextCreature:setMoveLocked(false) + end + else + spheres:remove() + end + else + spheres:teleportTo(nextPos) + end + end + end + end + end + + if boss:getHealth() > 0 then + addEvent(moveSphere, 4 * 1000) + end + end + + return true +end + +local function initMech() + local boss = Creature('Earl Osam') + if boss then + local topCenter = Tile(config.centerRoom):getTopCreature() + if topCenter and topCenter ~= boss then + topCenter:teleportTo(Position(config.centerRoom.x, config.centerRoom.y + 2, config.centerRoom.z)) + end + + boss:teleportTo(config.centerRoom) + boss:setMoveLocked(true) + + for _, sphereSpot in pairs(config.spheres) do + local sphere = Game.createMonster('Magical Sphere', sphereSpot, false, true) + if sphere then + boss:setStorageValue(3, math.max(0, boss:getStorageValue(3)) + 1) + end + end + + addEvent(moveSphere, 4 * 1000) + end + + return true +end + +local earl_osam_transform = CreatureEvent('earl_osam_transform') + +function earl_osam_transform.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) + local players = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) + for _, player in pairs(players) do + if player:isPlayer() then + if player:getStorageValue(config.timer) < os.time() then + player:setStorageValue(config.timer, os.time() + 20 * 3600) + end + if player:getStorageValue(config.room) < os.time() then + player:setStorageValue(config.room, os.time() + 30 * 60) + end + end + end + + if primaryType == COMBAT_HEALING then + return primaryDamage, primaryType, -secondaryDamage, secondaryType + end + + local chance = math.random(1, 100) + local position = Position(math.random(config.fromPos.x, config.toPos.x), math.random(config.fromPos.y, config.toPos.y), config.fromPos.z) + local tile = Tile(position) + + if chance >= 95 and tile and tile:isWalkable() then + Game.createMonster('Frozen Soul', position) + end + + local healthThreshold = creature:getMaxHealth() * 0.15 + local currentDamage = creature:getStorageValue(1) + if currentDamage < 0 then + creature:setStorageValue(1, 0) + end + + if creature:getStorageValue(3) > 0 then + creature:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT) + return primaryDamage, primaryType, secondaryDamage, secondaryType + end + + creature:setStorageValue(1, currentDamage + primaryDamage + secondaryDamage) + + if creature:getStorageValue(1) >= healthThreshold then + creature:setStorageValue(1, 0) + creature:setStorageValue(3, 0) + initMech() + end + + return primaryDamage, primaryType, -secondaryDamage, secondaryType +end + +earl_osam_transform:register() + +local sphere_death = CreatureEvent("sphere_death") + +function sphere_death.onDeath(creature) + local boss = Creature('Earl Osam') + if boss then + local currentSphereCount = boss:getStorageValue(3) + boss:setStorageValue(3, math.max(0, currentSphereCount - 1)) + if boss:getStorageValue(3) <= 0 and boss:isMoveLocked() then + boss:setMoveLocked(false) + end + end + return true +end + +sphere_death:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_king_zelos_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_king_zelos_fight.lua new file mode 100644 index 00000000000..aef490f4a9b --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_king_zelos_fight.lua @@ -0,0 +1,264 @@ +local config = { + centerRoom = Position(33443, 31545, 13), + newPosition = Position(33436, 31572, 13), + exitPos = Position(32172, 31917, 8), + x = 30, + y = 30, + summons = { + { + name = 'Rewar The Bloody', + pos = Position(33463, 31562, 13) + }, + { + name = 'The Red Knight', + pos = Position(33423, 31562, 13) + }, + { + name = 'Magnor Mournbringer', + pos = Position(33463, 31529, 13) + }, + { + name = 'Nargol the Impaler', + pos = Position(33423, 31529, 13) + }, + { + name = 'King Zelos', + pos = Position(33443, 31545, 13) + } + }, + timer = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Timer, + room = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Room, + fromPos = Position(33414, 31520, 13), + toPos = Position(33474, 31574, 13), +} + +local zelos_damage = CreatureEvent('zelos_damage') + +function zelos_damage.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) + if primaryType ~= COMBAT_HEALING then + local storage = creature:getStorageValue(1) + + if storage < 800 then + primaryDamage = (primaryDamage + secondaryDamage) - ((primaryDamage + secondaryDamage) * (storage / 800)) + secondaryDamage = 0 + else + primaryDamage = (primaryDamage + secondaryDamage) - ((primaryDamage + secondaryDamage) * 0.99) + secondaryDamage = 0 + end + end + + return primaryDamage, primaryType, -secondaryDamage, secondaryType +end + +zelos_damage:register() + +local zelos_init = CreatureEvent("zelos_init") + +function zelos_init.onDeath(creature) + + local targetMonster = creature:getMonster() + + if not targetMonster or targetMonster:getMaster() then + return true + end + + local knights = {'Nargol The Impaler', 'Magnor Mournbringer', 'The Red Knight', 'Rewar The Bloody', 'Shard Of Magnor', 'Regenerating Mass'} + + for _, knight in pairs(knights) do + local boss = Creature(knight) + if boss and boss:getId() ~= creature:getId() then + return true + end + end + + local zelos = Creature('King Zelos') + + if zelos then + local eq = os.time() - zelos:getStorageValue(1) + + zelos:setStorageValue(1, eq) + end + + return true +end + +zelos_init:register() + +local blood_explode = Combat() +local area = createCombatArea(AREA_SQUARE1X1) +blood_explode:setArea(area) + +function onTargetTile(cid, pos) + local tile = Tile(pos) + local target = tile:getTopCreature() + if tile then + if target and target:getId() ~= cid:getId() then + if target:isMonster() and target:getName():lower() == 'the red knight' or target:isPlayer() then + doTargetCombatHealth(0, target, COMBAT_DROWNDAMAGE, -20000, -25000) + end + end + end +end + +blood_explode:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") + +local blood_death = CreatureEvent("blood_death") + +function blood_death.onDeath(creature) + local targetMonster = creature:getMonster() + + if not targetMonster or targetMonster:getMaster() then + return true + end + + local var = {type = 1, number = creature:getId()} + + blood_explode:execute(creature, var) + + return true +end + +blood_death:register() + +local nargol_death = CreatureEvent("nargol_death") + +function nargol_death.onDeath(creature) + local targetMonster = creature:getMonster() + + if not targetMonster or targetMonster:getMaster() then + return true + end + + Game.createMonster('Regenerating Mass', Position(33423, 31529, 13), false, true) + + addEvent(function() + local mass = Creature('Regenerating Mass') + if mass then + mass:remove() + Game.createMonster('Nargol The Impaler', Position(33423, 31529, 13), false, true) + end + end, 30 * 1000) + + return true +end + +nargol_death:register() + +local shard_explode = Combat() +shard_explode:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) + +local area = createCombatArea(AREA_CIRCLE2X2) +shard_explode:setArea(area) + +function onTargetTile(cid, pos) + local tile = Tile(pos) + local target = tile:getTopCreature() + + if tile then + if target and target:isPlayer() then + doTargetCombatHealth(0, target, COMBAT_LIFEDRAIN, -2000, -2500) + end + end +end + +shard_explode:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") + +local shard_death = CreatureEvent("shard_death") + +function shard_death.onDeath(creature) + local targetMonster = creature:getMonster() + + if not targetMonster or targetMonster:getMaster() then + return true + end + + local var = {type = 1, number = creature:getId()} + + shard_explode:execute(creature, var) + + return true +end + +shard_death:register() + +local magnor_death = CreatureEvent("magnor_death") + +function magnor_death.onDeath(creature) + local targetMonster = creature:getMonster() + + if not targetMonster or targetMonster:getMaster() then + return true + end + + local id = os.time() + + for i = 1, 4 do + local shards = Game.createMonster('Shard Of Magnor', creature:getClosestFreePosition(creature:getPosition(), true)) + shards:beginSharedLife(id) + shards:registerEvent("SharedLife") + shards:registerEvent("shard_death") + end + + return true +end + +magnor_death:register() + +local fetter_death = CreatureEvent("fetter_death") + +function fetter_death.onDeath(creature) + local targetMonster = creature:getMonster() + + if not targetMonster or targetMonster:getMaster() then + return true + end + + local boss = Creature('Rewar The Bloody') + + if boss then + boss:setStorageValue(2, boss:getStorageValue(2) - 1) + + if boss:getStorageValue(2) <= 0 then + boss:setType('Rewar The Bloody') + end + end + + return true +end + +fetter_death:register() + +local rewar_the_bloody = CreatureEvent('rewar_the_bloody') + +rewar_the_bloody:type('healthchange') + +function rewar_the_bloody.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) + if primaryType == COMBAT_HEALING then + return primaryDamage, primaryType, -secondaryDamage, secondaryType + end + + local health = creature:getMaxHealth() * 0.05 + + creature:setStorageValue(1, creature:getStorageValue(1) + primaryDamage + secondaryDamage) + + if creature:getStorageValue(1) >= health then + creature:setStorageValue(1, 0) + creature:setStorageValue(2, 0) + + local fetters = math.random(1, 3) + local fromPos, toPos = Position(33458, 31556, 13), Position(33467, 31566, 13) + + for i = 1, fetters do + local position = Position(math.random(fromPos.x, toPos.x), math.random(fromPos.y, toPos.y), fromPos.z) + local fetter = Game.createMonster('Fetter', position, true, true) + if fetter then + creature:setStorageValue(2, creature:getStorageValue(2) + 1) + end + end + creature:setType('Rewar The Bloody Inv') + end + + return primaryDamage, primaryType, -secondaryDamage, secondaryType +end + +rewar_the_bloody:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_lord_azaram_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_lord_azaram_fight.lua new file mode 100644 index 00000000000..705907d4c2e --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_lord_azaram_fight.lua @@ -0,0 +1,121 @@ +local config = { + centerRoom = Position(33424, 31472, 13), + newPosition = Position(33424, 31478, 13), + exitPos = Position(32190, 31819, 8), + x = 10, + y = 10, + timer = Storage.Quest.U12_20.GraveDanger.Bosses.LordAzaram.Timer, + room = Storage.Quest.U12_20.GraveDanger.Bosses.LordAzaram.Room, + soulPos = Position(33426, 31471, 13), + bossPos = Position(33423, 31471, 13), + tainted = { + Position(33422, 31470, 13), + Position(33427, 31470, 13), + Position(33422, 31476, 13), + Position(33427, 31476, 13), + }, + fromPos = Position(33414, 31463, 13), + toPos = Position(33433, 31481, 13) +} + +local function removeTainted() + local spectators = Game.getSpectators(config.centerRoom, false, false, config.x, config.x, config.y, config.y) + for _, creature in pairs(spectators) do + if creature:isMonster() and creature:getName():lower() == 'tainted soul splinter' then + creature:remove() + end + end + return true +end + +local azaram_health = CreatureEvent('azaram_health') + +function azaram_health.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) + local players = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) + for _, player in pairs(players) do + if player:isPlayer() then + if player:getStorageValue(config.timer) < os.time() then + player:setStorageValue(config.timer, os.time() + 20 * 3600) + end + if player:getStorageValue(config.room) < os.time() then + player:setStorageValue(config.room, os.time() + 30 * 60) + end + end + end + + if not creature then return primaryDamage, primaryType, secondaryDamage, secondaryType end + local health = creature:getMaxHealth() * 0.10 + local damageStorage = creature:getStorageValue(1) + if damageStorage == -1 then creature:setStorageValue(1, 0) end + + creature:setStorageValue(1, damageStorage + primaryDamage) + local stor = creature:getStorageValue(1) + if stor >= health then + local bossTile = Tile(config.bossPos) + if bossTile and bossTile:isWalkable() then + creature:teleportTo(config.bossPos) + end + creature:setStorageValue(1, 0) + local soul = Creature("Azaram's Soul") + if soul then + soul:teleportTo(config.centerRoom) + for _, pos in pairs(config.tainted) do + Game.createMonster('Tainted Soul Splinter', pos, true, true) + end + end + end + return primaryDamage, primaryType, -secondaryDamage, secondaryType +end + +azaram_health:register() + +local azaram_summon = CreatureEvent('azaram_summon') + +function azaram_summon.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) + if not creature then return primaryDamage, primaryType, secondaryDamage, secondaryType end + local chance = math.random(1, 100) + if chance < 90 then return primaryDamage, primaryType, secondaryDamage, secondaryType end + + local position = Position(math.random(config.fromPos.x, config.toPos.x), math.random(config.fromPos.y, config.toPos.y), config.fromPos.z) + local tile = Tile(position) + if tile and tile:isWalkable() then + local topThing = tile:getTopCreature() + if topThing then + local newPosition = topThing:getClosestFreePosition(topThing:getPosition(), true) + if newPosition then + Game.createMonster('Condensed Sin', newPosition, false, true) + end + else + Game.createMonster('Condensed Sin', position, false, true) + end + end + return primaryDamage, primaryType, -secondaryDamage, secondaryType +end + +azaram_summon:register() + +local soul_heal = CreatureEvent('soul_heal') + +function soul_heal.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) + if not attacker or not attacker:isPlayer() then return primaryDamage, primaryType, secondaryDamage, secondaryType end + if primaryType == COMBAT_HEALING then + local health = (creature:getHealth() / creature:getMaxHealth()) * 100 + local healStorage = creature:getStorageValue(2) + if healStorage == -1 then creature:setStorageValue(2, 0) end + + if health < 100 and health >= healStorage * 15 then + creature:setStorageValue(2, healStorage + 1) + if config.soulPos:isWalkable() then + creature:teleportTo(config.soulPos) + end + removeTainted() + local boss = Creature('Lord Azaram') + if boss and config.centerRoom:isWalkable() then + boss:teleportTo(config.centerRoom) + end + end + end + return primaryDamage, primaryType, -secondaryDamage, secondaryType +end + +soul_heal:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_sir_baeloc_health.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_sir_baeloc_health.lua new file mode 100644 index 00000000000..14931cdfb57 --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_sir_baeloc_health.lua @@ -0,0 +1,38 @@ +local sir_baeloc_health = CreatureEvent('sir_baeloc_health') + +sir_baeloc_health:type('healthchange') + +function sir_baeloc_health.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) + if primaryType == COMBAT_HEALING then + return primaryDamage, primaryType, -secondaryDamage, secondaryType + end + + local health = creature:getMaxHealth() * 0.60 + local brother_diff = (creature:getHealth() / creature:getMaxHealth()) * 100 + local brother = Creature('Sir Nictros') + + if brother then + if brother_diff < 55 then + local brother_percent = (brother:getHealth() / brother:getMaxHealth()) * 100 + if (brother_percent - brother_diff) > 5 then + creature:addHealth(28000) + end + end + end + + creature:setStorageValue(1, creature:getStorageValue(1) + primaryDamage + secondaryDamage) + + if creature:getStorageValue(2) < 1 and creature:getStorageValue(1) >= health then + creature:setStorageValue(2, 1) + creature:say("Join me in battle my brother. Let's share the fun!") + local nictros = Creature('Sir Nictros') + if nictros then + nictros:teleportTo(Position(33426, 31438, 13)) + nictros:setMoveLocked(false) + end + end + + return primaryDamage, primaryType, -secondaryDamage, secondaryType +end + +sir_baeloc_health:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_cobra_mini_bosses.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_cobra_mini_bosses.lua new file mode 100644 index 00000000000..f80f84fbcc1 --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_cobra_mini_bosses.lua @@ -0,0 +1,33 @@ +local FireWall = MoveEvent() + +function FireWall.onStepIn(creature, item, position, fromPosition) + if creature:isMonster() then + return true + end + + if fromPosition.y == 32691 then + if creature:getStorageValue(Storage.Quest.U12_20.GraveDanger.FireWall) >= 1 then + creature:teleportTo(Position(position.x, position.y + 2, position.z)) + else + creature:teleportTo(fromPosition) + end + elseif fromPosition.y == 32693 then + creature:teleportTo(Position(position.x, position.y - 2, position.z)) + elseif fromPosition.x == 33385 then + if creature:getStorageValue(Storage.Quest.U12_20.GraveDanger.CustodianKilled) >= 1 then + creature:setStorageValue(Storage.Quest.U12_20.GraveDanger.FireWall, 1) + creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You pass the fire without taking any damage. It's now or never...") + else + creature:teleportTo(fromPosition) + end + creature:teleportTo(Position(position.x + 2, position.y, position.z)) + elseif fromPosition.x == 33387 then + creature:teleportTo(Position(position.x - 2, position.y, position.z)) + end + creature:getPosition():sendMagicEffect(CONST_ME_HITBYFIRE) + + return true +end + +FireWall:aid(36568) +FireWall:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_duke_exit_tp.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_duke_exit_tp.lua new file mode 100644 index 00000000000..8fbdf2fb0b7 --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_duke_exit_tp.lua @@ -0,0 +1,14 @@ +local duke_exit_tp = MoveEvent() + +function duke_exit_tp.onStepIn(creature, item, position, fromPosition) + if not creature:isPlayer() then + return false + end + + creature:removeCondition(CONDITION_OUTFIT) + + return true +end + +duke_exit_tp:aid(14561) +duke_exit_tp:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_enter_tps.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_enter_tps.lua new file mode 100644 index 00000000000..70874e3e1dd --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_enter_tps.lua @@ -0,0 +1,67 @@ +local portals = { + [14562] = { + boss = 'Lord Azaram', + stor = Storage.Quest.U12_20.GraveDanger.Bosses.LordAzaram.Timer, + newPos = Position(33425, 31499, 13) + }, + [14563] = { + boss = 'Duke Krule', + stor = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.Timer, + newPos = Position(33456, 31499, 13) + }, + [14564] = { + boss = 'Sir Baeloc', + stor = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Timer, + newPos = Position(33428, 31406, 13) + }, + [14565] = { + boss = 'Earl Osam', + stor = Storage.Quest.U12_20.GraveDanger.Bosses.EarlOsam.Timer, + newPos = Position(33519, 31439, 13), + }, + [14566] = { + boss = 'Count Vlarkorth', + stor = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorth.Timer, + newPos = Position(33458, 31406, 13), + }, + [14567] = { + boss = 'King Zelos', + stor = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Timer, + newPos = Position(33491, 31546, 13), + }, +} + +function secondsToClock(seconds) + local hours = math.floor(seconds / 3600) + local mins = math.floor((seconds % 3600) / 60) + local secs = seconds % 60 + return string.format("%02d:%02d:%02d", hours, mins, secs) +end + +local grave_enter = MoveEvent() + +function grave_enter.onStepIn(creature, item, position, fromPosition) + if creature:isMonster() then + return true + end + + local thing = portals[item.actionid] + + if not thing then + return true + end + + if creature:getStorageValue(thing.stor) > os.time() then + local eq = creature:getStorageValue(thing.stor) - os.time() + creature:say('You need to wait '.. secondsToClock(eq) ..' before trying to challenge '.. thing.boss ..' again!', TALKTYPE_MONSTER_SAY, false, creature) + creature:teleportTo(fromPosition) + return true + end + + creature:teleportTo(thing.newPos) + + return true +end + +grave_enter:aid(14562, 14563, 14564, 14565, 14566, 14567) +grave_enter:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_quaidDen.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_quaidDen.lua new file mode 100644 index 00000000000..f2ac9fbfc5d --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_quaidDen.lua @@ -0,0 +1,17 @@ +local quaidDen = MoveEvent() + +function quaidDen.onStepIn(creature, item, position, fromPosition) + if creature:isMonster() then + return true + end + + if creature:getStorageValue(Storage.Quest.U12_20.GraveDanger.CustodianKilled) < 1 then + creature:teleportTo(Position(33401, 32658, 3)) + creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "With the power of the dark Custodian still holding away, the fog is keeping you from entering Quaid's den.") + end + + return true +end + +quaidDen:id(31636) +quaidDen:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_soul_cleanse.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_soul_cleanse.lua new file mode 100644 index 00000000000..226a687e94b --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_soul_cleanse.lua @@ -0,0 +1,29 @@ +local soul_cleanse = MoveEvent() + +function soul_cleanse.onStepIn(creature, item, position, fromPosition) + if creature:isPlayer() then + return true + end + + if creature:getName():lower() == "azaram's soul" then + local health = (creature:getHealth() / creature:getMaxHealth()) * 100 + + if health == 100 then + creature:say('The broken Soul absorbs the power of the soul splinter and gains strength!') + creature:teleportTo(config.soulPos) + item:remove() + removeTainted() + + local boss = Creature('Lord Azaram') + + if boss then + boss:teleportTo(config.centerRoom) + end + end + end + + return true +end + +soul_cleanse:id(31160) +soul_cleanse:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_zelos_tp.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_zelos_tp.lua new file mode 100644 index 00000000000..3cb8d899dfe --- /dev/null +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_zelos_tp.lua @@ -0,0 +1,20 @@ +local zelos_tp = MoveEvent() + +function zelos_tp.onStepIn(creature, item, position, fromPosition) + if not creature:isPlayer() then + return false + end + + local knights = Creature('Nargol The Impaler') or Creature('Magnor Mournbringer') or Creature('The Red Knight') or Creature('Rewar The Bloody') or Creature('Shard Of Magnor') or Creature('Regenerating Mass') + + if knights then + creature:teleportTo(fromPosition) + else + creature:teleportTo(Position(33443, 31536, 13)) + end + + return true +end + +zelos_tp:aid(14579) +zelos_tp:register() diff --git a/data-otservbr-global/startup/tables/door_quest.lua b/data-otservbr-global/startup/tables/door_quest.lua index c2933933595..d175ac61b90 100644 --- a/data-otservbr-global/startup/tables/door_quest.lua +++ b/data-otservbr-global/startup/tables/door_quest.lua @@ -754,7 +754,8 @@ QuestDoorAction = { itemId = false, itemPos = { { x = 33083, y = 31216, z = 8 } }, }, - [Storage.Quest.U12_20.GraveDanger.QuestLine] = { + + [Storage.Quest.U12_20.GraveDanger.Questline] = { itemId = false, itemPos = { { x = 33264, y = 31993, z = 7 }, @@ -771,10 +772,11 @@ QuestDoorAction = { { x = 32012, y = 31565, z = 7 }, }, }, - [Storage.Quest.U12_20.GraveDanger.Bosses.KingZelosDoor] = { + [Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Room] = { itemId = false, itemPos = { { x = 32173, y = 31922, z = 8 } }, }, + [Storage.Quest.U12_70.AdventuresOfGalthen.AccessDoor] = { itemId = false, itemPos = { { x = 32466, y = 32494, z = 8 } }, diff --git a/data-otservbr-global/startup/tables/lever.lua b/data-otservbr-global/startup/tables/lever.lua index 4edba7bcd34..efea18ac832 100644 --- a/data-otservbr-global/startup/tables/lever.lua +++ b/data-otservbr-global/startup/tables/lever.lua @@ -129,6 +129,43 @@ LeverAction = { { x = 32576, y = 31862, z = 14 }, }, }, + -- Grave Danger Quest + [14557] = { + itemId = 8911, + itemPos = { + { x = 33454, y = 31413, z = 13 }, + }, + }, + [14558] = { + itemId = 8911, + itemPos = { + { x = 33515, y = 31444, z = 13 }, + }, + }, + [14559] = { + itemId = 8911, + itemPos = { + { x = 33423, y = 31413, z = 13 }, + }, + }, + [14560] = { + itemId = 8911, + itemPos = { + { x = 33454, y = 31493, z = 13 }, + }, + }, + [14561] = { + itemId = 8911, + itemPos = { + { x = 33421, y = 31493, z = 13 }, + }, + }, + [14568] = { + itemId = 8911, + itemPos = { + { x = 33484, y = 31546, z = 13 }, + }, + }, -- The Dream Courts Quest [23110] = { itemId = 9110, diff --git a/data-otservbr-global/startup/tables/teleport.lua b/data-otservbr-global/startup/tables/teleport.lua index 94a7d57e822..a04d00188b8 100644 --- a/data-otservbr-global/startup/tables/teleport.lua +++ b/data-otservbr-global/startup/tables/teleport.lua @@ -41,6 +41,50 @@ TeleportAction = { { x = 33449, y = 32241, z = 7 }, }, }, + -- Grave Danger Quest + [14562] = { + itemId = 23482, + itemPos = { + { x = 32190, y = 31817, z = 8 }, + }, + }, + [14563] = { + itemId = 23482, + itemPos = { + { x = 32345, y = 32168, z = 12 }, + }, + }, + [14564] = { + itemId = 23482, + itemPos = { + { x = 33288, y = 32472, z = 9 }, + }, + }, + [14565] = { + itemId = 23482, + itemPos = { + { x = 33261, y = 31984, z = 8 }, + }, + }, + [14566] = { + itemId = 23482, + itemPos = { + { x = 33196, y = 31694, z = 8 }, + }, + }, + [14567] = { + itemId = 23482, + itemPos = { + { x = 32174, y = 31916, z = 8 }, + }, + }, + -- Grave Danger Quest + [14579] = { + itemId = 22761, + itemPos = { + { x = 33443, y = 31532, z = 13 }, + }, + }, -- Barbarian Test - Temple Citizen Svargrond [30032] = { itemId = 1949, @@ -418,4 +462,125 @@ TeleportUnique = { destination = { x = 33618, y = 32523, z = 15 }, effect = CONST_ME_TELEPORT, }, + -- Grave Dange Quest + [39009] = { + itemId = 22761, + itemPos = { x = 33451, y = 31562, z = 13 }, + destination = { x = 33456, y = 31564, z = 13 }, + effect = CONST_ME_TELEPORT, + }, + [39010] = { + itemId = 22761, + itemPos = { x = 33465, y = 31570, z = 13 }, + destination = { x = 32172, y = 31917, z = 8 }, + effect = CONST_ME_TELEPORT, + }, + [39011] = { + itemId = 22761, + itemPos = { x = 33463, y = 31553, z = 13 }, + destination = { x = 33462, y = 31548, z = 13 }, + effect = CONST_ME_TELEPORT, + }, + [39012] = { + itemId = 22761, + itemPos = { x = 33454, y = 31562, z = 13 }, + destination = { x = 33449, y = 31561, z = 13 }, + effect = CONST_ME_TELEPORT, + }, + [39013] = { + itemId = 22761, + itemPos = { x = 33463, y = 31541, z = 13 }, + destination = { x = 33465, y = 31536, z = 13 }, + effect = CONST_ME_TELEPORT, + }, + [39014] = { + itemId = 22761, + itemPos = { x = 33463, y = 31538, z = 13 }, + destination = { x = 33462, y = 31543, z = 13 }, + effect = CONST_ME_TELEPORT, + }, + [39015] = { + itemId = 22761, + itemPos = { x = 33454, y = 31529, z = 13 }, + destination = { x = 33449, y = 31530, z = 13 }, + effect = CONST_ME_TELEPORT, + }, + [39016] = { + itemId = 22761, + itemPos = { x = 33465, y = 31521, z = 13 }, + destination = { x = 32172, y = 31917, z = 8 }, + effect = CONST_ME_TELEPORT, + }, + [39017] = { + itemId = 22761, + itemPos = { x = 33451, y = 31529, z = 13 }, + destination = { x = 33456, y = 31531, z = 13 }, + effect = CONST_ME_TELEPORT, + }, + [39018] = { + itemId = 32415, + itemPos = { x = 33443, y = 31539, z = 13 }, + destination = { x = 32172, y = 31917, z = 8 }, + effect = CONST_ME_TELEPORT, + }, + [39019] = { + itemId = 22761, + itemPos = { x = 33435, y = 31529, z = 13 }, + destination = { x = 33430, y = 31531, z = 13 }, + effect = CONST_ME_TELEPORT, + }, + [39020] = { + itemId = 22761, + itemPos = { x = 33432, y = 31529, z = 13 }, + destination = { x = 33437, y = 31530, z = 13 }, + effect = CONST_ME_TELEPORT, + }, + [39021] = { + itemId = 22761, + itemPos = { x = 33421, y = 31521, z = 13 }, + destination = { x = 32172, y = 31917, z = 8 }, + effect = CONST_ME_TELEPORT, + }, + [39022] = { + itemId = 22761, + itemPos = { x = 33423, y = 31538, z = 13 }, + destination = { x = 33424, y = 31543, z = 13 }, + effect = CONST_ME_TELEPORT, + }, + [39023] = { + itemId = 22761, + itemPos = { x = 33423, y = 31541, z = 13 }, + destination = { x = 33425, y = 31536, z = 13 }, + effect = CONST_ME_TELEPORT, + }, + [39024] = { + itemId = 22761, + itemPos = { x = 33423, y = 31551, z = 13 }, + destination = { x = 33425, y = 31556, z = 13 }, + effect = CONST_ME_TELEPORT, + }, + [39025] = { + itemId = 22761, + itemPos = { x = 33423, y = 31554, z = 13 }, + destination = { x = 33424, y = 31549, z = 13 }, + effect = CONST_ME_TELEPORT, + }, + [39026] = { + itemId = 22761, + itemPos = { x = 33421, y = 31570, z = 13 }, + destination = { x = 32172, y = 31917, z = 8 }, + effect = CONST_ME_TELEPORT, + }, + [39027] = { + itemId = 22761, + itemPos = { x = 33432, y = 31562, z = 13 }, + destination = { x = 33437, y = 31563, z = 13 }, + effect = CONST_ME_TELEPORT, + }, + [39028] = { + itemId = 22761, + itemPos = { x = 33435, y = 31562, z = 13 }, + destination = { x = 33430, y = 31564, z = 13 }, + effect = CONST_ME_TELEPORT, + }, } diff --git a/data-otservbr-global/world/otservbr-monster.xml b/data-otservbr-global/world/otservbr-monster.xml index cf0a71fb1f5..d1cc7cfaf7e 100644 --- a/data-otservbr-global/world/otservbr-monster.xml +++ b/data-otservbr-global/world/otservbr-monster.xml @@ -4071,6 +4071,9 @@ + + + @@ -6948,6 +6951,9 @@ + + + @@ -71857,6 +71863,9 @@ + + + From 540424b9d889161e40af15dc2439b1991a25f73f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 6 Nov 2024 16:03:41 +0000 Subject: [PATCH 11/22] Lua code format - (Stylua) --- .../quests/grave_danger/azarams_soul.lua | 40 ++--- .../grave_danger/bosses/sir_nictros.lua | 2 +- .../quests/grave_danger/condensed_sin.lua | 51 +++--- .../quests/grave_danger/magical_sphere.lua | 40 ++--- .../grave_danger/magnor_mournbringer.lua | 58 +++--- .../grave_danger/nargol_the_impaler.lua | 61 +++---- .../quests/grave_danger/regenerating_mass.lua | 40 ++--- .../quests/grave_danger/rewar_the_bloody.lua | 60 +++---- .../grave_danger/rewar_the_bloody_inv.lua | 60 +++---- .../grave_danger/tainted_soul_splinter.lua | 38 ++-- .../quests/grave_danger/the_red_knight.lua | 57 +++--- data-otservbr-global/npc/jack_springer.lua | 165 +++++++++++------- .../actions_baeloc_fight.lua | 32 ++-- .../actions_custodian_door.lua | 22 +-- .../actions_dark_remains.lua | 14 +- .../grave_danger_quest/actions_duke_fight.lua | 34 ++-- .../actions_grave_sanctify.lua | 108 ++++++------ .../grave_danger_quest/actions_king_zelos.lua | 32 ++-- .../actions_vlarkorth_fight.lua | 1 - .../cobra_bastion/actions_scarlett.lua | 6 +- .../creaturescripts_baeloc_nictros_fight.lua | 30 ++-- .../creaturescripts_boss_kill.lua | 54 +++--- .../creaturescripts_count_vlarkorth_fight.lua | 16 +- .../creaturescripts_earl_osam_fight.lua | 20 +-- .../creaturescripts_king_zelos_fight.lua | 95 +++++----- .../creaturescripts_lord_azaram_fight.lua | 46 +++-- .../creaturescripts_sir_baeloc_health.lua | 10 +- .../movements_cobra_mini_bosses.lua | 48 ++--- .../movements_duke_exit_tp.lua | 8 +- .../movements_enter_tps.lua | 98 +++++------ .../grave_danger_quest/movements_quaidDen.lua | 18 +- .../movements_soul_cleanse.lua | 16 +- .../grave_danger_quest/movements_zelos_tp.lua | 16 +- 33 files changed, 708 insertions(+), 688 deletions(-) diff --git a/data-otservbr-global/monster/quests/grave_danger/azarams_soul.lua b/data-otservbr-global/monster/quests/grave_danger/azarams_soul.lua index 9746fdc030c..04c001df211 100644 --- a/data-otservbr-global/monster/quests/grave_danger/azarams_soul.lua +++ b/data-otservbr-global/monster/quests/grave_danger/azarams_soul.lua @@ -10,7 +10,7 @@ monster.outfit = { lookLegs = 0, lookFeet = 0, lookAddons = 0, - lookMount = 0 + lookMount = 0, } monster.health = 1 @@ -22,12 +22,12 @@ monster.manaCost = 0 monster.maxSummons = 0 monster.events = { - "soul_heal" + "soul_heal", } monster.changeTarget = { interval = 5000, - chance = 20 + chance = 20, } monster.flags = { @@ -48,37 +48,37 @@ monster.flags = { canWalkOnEnergy = true, canWalkOnFire = true, canWalkOnPoison = true, - pet = false + pet = false, } monster.light = { level = 0, - color = 0 + color = 0, } monster.defenses = { defense = 40, - armor = 40 + armor = 40, } monster.elements = { - {type = COMBAT_PHYSICALDAMAGE, percent = 100}, - {type = COMBAT_ENERGYDAMAGE, percent = 100}, - {type = COMBAT_EARTHDAMAGE, percent = 100}, - {type = COMBAT_FIREDAMAGE, percent = 100}, - {type = COMBAT_LIFEDRAIN, percent = 100}, - {type = COMBAT_MANADRAIN, percent = 100}, - {type = COMBAT_DROWNDAMAGE, percent = 100}, - {type = COMBAT_ICEDAMAGE, percent = 100}, - {type = COMBAT_HOLYDAMAGE , percent = 100}, - {type = COMBAT_DEATHDAMAGE , percent = 100} + { type = COMBAT_PHYSICALDAMAGE, percent = 100 }, + { type = COMBAT_ENERGYDAMAGE, percent = 100 }, + { type = COMBAT_EARTHDAMAGE, percent = 100 }, + { type = COMBAT_FIREDAMAGE, percent = 100 }, + { type = COMBAT_LIFEDRAIN, percent = 100 }, + { type = COMBAT_MANADRAIN, percent = 100 }, + { type = COMBAT_DROWNDAMAGE, percent = 100 }, + { type = COMBAT_ICEDAMAGE, percent = 100 }, + { type = COMBAT_HOLYDAMAGE, percent = 100 }, + { type = COMBAT_DEATHDAMAGE, percent = 100 }, } monster.immunities = { - {type = "paralyze", condition = true}, - {type = "outfit", condition = false}, - {type = "invisible", condition = true}, - {type = "bleed", condition = false} + { type = "paralyze", condition = true }, + { type = "outfit", condition = false }, + { type = "invisible", condition = true }, + { type = "bleed", condition = false }, } mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/bosses/sir_nictros.lua b/data-otservbr-global/monster/quests/grave_danger/bosses/sir_nictros.lua index 9f671133049..60b14f17b24 100644 --- a/data-otservbr-global/monster/quests/grave_danger/bosses/sir_nictros.lua +++ b/data-otservbr-global/monster/quests/grave_danger/bosses/sir_nictros.lua @@ -22,7 +22,7 @@ monster.manaCost = 0 monster.events = { "sir_nictros_health", - "brothers_summon" + "brothers_summon", } monster.changeTarget = { diff --git a/data-otservbr-global/monster/quests/grave_danger/condensed_sin.lua b/data-otservbr-global/monster/quests/grave_danger/condensed_sin.lua index 21ec6157d98..69ea6358e15 100644 --- a/data-otservbr-global/monster/quests/grave_danger/condensed_sin.lua +++ b/data-otservbr-global/monster/quests/grave_danger/condensed_sin.lua @@ -10,7 +10,7 @@ monster.outfit = { lookLegs = 0, lookFeet = 0, lookAddons = 0, - lookMount = 0 + lookMount = 0, } monster.health = 12000 @@ -23,7 +23,7 @@ monster.maxSummons = 0 monster.changeTarget = { interval = 5000, - chance = 0 + chance = 0, } monster.strategiesTarget = { @@ -48,12 +48,12 @@ monster.flags = { canWalkOnEnergy = true, canWalkOnFire = true, canWalkOnPoison = true, - pet = false + pet = false, } monster.light = { level = 0, - color = 0 + color = 0, } monster.voices = { @@ -61,40 +61,39 @@ monster.voices = { chance = 10, } -monster.loot = { -} +monster.loot = {} monster.attacks = { - {name ="melee", interval = 2000, chance = 100, minDamage = -100, maxDamage = -500}, - {name ="combat", interval = 5000, chance = 40, type = COMBAT_MANADRAIN, minDamage = -450, maxDamage = -550, length = 3, effect = CONST_ME_SLEEP, target = false}, - {name ="combat", interval = 2000, chance = 30, type = COMBAT_DEATHDAMAGE, minDamage = -250, maxDamage = -450, range = 1, shootEffect = CONST_ANI_DEATH, target = true}, - {name ="combat", interval = 2000, chance = 30, type = COMBAT_EARTHDAMAGE, minDamage = -250, maxDamage = -450, range = 1, shootEffect = CONST_ANI_POISON, target = true}, - {name ="combat", interval = 4000, chance = 50, type = COMBAT_EARTHDAMAGE, minDamage = -600, maxDamage = -800, range = 3, radius = 2, effect = CONST_ME_HITBYPOISON, target = false} + { name = "melee", interval = 2000, chance = 100, minDamage = -100, maxDamage = -500 }, + { name = "combat", interval = 5000, chance = 40, type = COMBAT_MANADRAIN, minDamage = -450, maxDamage = -550, length = 3, effect = CONST_ME_SLEEP, target = false }, + { name = "combat", interval = 2000, chance = 30, type = COMBAT_DEATHDAMAGE, minDamage = -250, maxDamage = -450, range = 1, shootEffect = CONST_ANI_DEATH, target = true }, + { name = "combat", interval = 2000, chance = 30, type = COMBAT_EARTHDAMAGE, minDamage = -250, maxDamage = -450, range = 1, shootEffect = CONST_ANI_POISON, target = true }, + { name = "combat", interval = 4000, chance = 50, type = COMBAT_EARTHDAMAGE, minDamage = -600, maxDamage = -800, range = 3, radius = 2, effect = CONST_ME_HITBYPOISON, target = false }, } monster.defenses = { defense = 10, - armor = 10 + armor = 10, } monster.elements = { - {type = COMBAT_PHYSICALDAMAGE, percent = 0}, - {type = COMBAT_ENERGYDAMAGE, percent = -10}, - {type = COMBAT_EARTHDAMAGE, percent = 100}, - {type = COMBAT_FIREDAMAGE, percent = -10}, - {type = COMBAT_LIFEDRAIN, percent = 100}, - {type = COMBAT_MANADRAIN, percent = 0}, - {type = COMBAT_DROWNDAMAGE, percent = 0}, - {type = COMBAT_ICEDAMAGE, percent = 20}, - {type = COMBAT_HOLYDAMAGE , percent = 0}, - {type = COMBAT_DEATHDAMAGE , percent = 100} + { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, + { type = COMBAT_ENERGYDAMAGE, percent = -10 }, + { type = COMBAT_EARTHDAMAGE, percent = 100 }, + { type = COMBAT_FIREDAMAGE, percent = -10 }, + { type = COMBAT_LIFEDRAIN, percent = 100 }, + { type = COMBAT_MANADRAIN, percent = 0 }, + { type = COMBAT_DROWNDAMAGE, percent = 0 }, + { type = COMBAT_ICEDAMAGE, percent = 20 }, + { type = COMBAT_HOLYDAMAGE, percent = 0 }, + { type = COMBAT_DEATHDAMAGE, percent = 100 }, } monster.immunities = { - {type = "paralyze", condition = false}, - {type = "outfit", condition = false}, - {type = "invisible", condition = false}, - {type = "bleed", condition = false} + { type = "paralyze", condition = false }, + { type = "outfit", condition = false }, + { type = "invisible", condition = false }, + { type = "bleed", condition = false }, } mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/magical_sphere.lua b/data-otservbr-global/monster/quests/grave_danger/magical_sphere.lua index f513a567a34..d17f881f3f9 100644 --- a/data-otservbr-global/monster/quests/grave_danger/magical_sphere.lua +++ b/data-otservbr-global/monster/quests/grave_danger/magical_sphere.lua @@ -10,7 +10,7 @@ monster.outfit = { lookLegs = 0, lookFeet = 0, lookAddons = 0, - lookMount = 0 + lookMount = 0, } monster.health = 20000 @@ -22,12 +22,12 @@ monster.manaCost = 0 monster.maxSummons = 0 monster.events = { - "sphere_death" + "sphere_death", } monster.changeTarget = { interval = 5000, - chance = 20 + chance = 20, } monster.flags = { @@ -48,37 +48,37 @@ monster.flags = { canWalkOnEnergy = false, canWalkOnFire = true, canWalkOnPoison = false, - pet = false + pet = false, } monster.light = { level = 0, - color = 0 + color = 0, } monster.defenses = { defense = 40, - armor = 40 + armor = 40, } monster.elements = { - {type = COMBAT_PHYSICALDAMAGE, percent = 0}, - {type = COMBAT_ENERGYDAMAGE, percent = 0}, - {type = COMBAT_EARTHDAMAGE, percent = 0}, - {type = COMBAT_FIREDAMAGE, percent = 0}, - {type = COMBAT_LIFEDRAIN, percent = 0}, - {type = COMBAT_MANADRAIN, percent = 0}, - {type = COMBAT_DROWNDAMAGE, percent = 0}, - {type = COMBAT_ICEDAMAGE, percent = 0}, - {type = COMBAT_HOLYDAMAGE , percent = 0}, - {type = COMBAT_DEATHDAMAGE , percent = -20} + { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, + { type = COMBAT_ENERGYDAMAGE, percent = 0 }, + { type = COMBAT_EARTHDAMAGE, percent = 0 }, + { type = COMBAT_FIREDAMAGE, percent = 0 }, + { type = COMBAT_LIFEDRAIN, percent = 0 }, + { type = COMBAT_MANADRAIN, percent = 0 }, + { type = COMBAT_DROWNDAMAGE, percent = 0 }, + { type = COMBAT_ICEDAMAGE, percent = 0 }, + { type = COMBAT_HOLYDAMAGE, percent = 0 }, + { type = COMBAT_DEATHDAMAGE, percent = -20 }, } monster.immunities = { - {type = "paralyze", condition = true}, - {type = "outfit", condition = false}, - {type = "invisible", condition = true}, - {type = "bleed", condition = false} + { type = "paralyze", condition = true }, + { type = "outfit", condition = false }, + { type = "invisible", condition = true }, + { type = "bleed", condition = false }, } mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/magnor_mournbringer.lua b/data-otservbr-global/monster/quests/grave_danger/magnor_mournbringer.lua index d730579b9a3..53882f6af5b 100644 --- a/data-otservbr-global/monster/quests/grave_danger/magnor_mournbringer.lua +++ b/data-otservbr-global/monster/quests/grave_danger/magnor_mournbringer.lua @@ -10,7 +10,7 @@ monster.outfit = { lookLegs = 0, lookFeet = 95, lookAddons = 3, - lookMount = 0 + lookMount = 0, } monster.health = 250000 @@ -27,7 +27,7 @@ monster.events = { monster.changeTarget = { interval = 4000, - chance = 10 + chance = 10, } monster.strategiesTarget = { @@ -52,12 +52,12 @@ monster.flags = { canWalkOnEnergy = true, canWalkOnFire = true, canWalkOnPoison = true, - pet = false + pet = false, } monster.light = { level = 0, - color = 0 + color = 0, } monster.voices = { @@ -66,43 +66,42 @@ monster.voices = { } monster.attacks = { - {name ="melee", interval = 2000, chance = 100, minDamage = -200, maxDamage = -600}, - {name ="combat", interval = 4000, chance = 70, type = COMBAT_ENERGYDAMAGE, minDamage = -1000, maxDamage = -1200, length = 5, effect = CONST_ME_BIGCLOUDS, target = false}, - {name ="combat", interval = 3000, chance = 50, type = COMBAT_ENERGYDAMAGE, minDamage = -400, maxDamage = -900, length = 7, spread = 5, effect = CONST_ME_TELEPORT, target = false} + { name = "melee", interval = 2000, chance = 100, minDamage = -200, maxDamage = -600 }, + { name = "combat", interval = 4000, chance = 70, type = COMBAT_ENERGYDAMAGE, minDamage = -1000, maxDamage = -1200, length = 5, effect = CONST_ME_BIGCLOUDS, target = false }, + { name = "combat", interval = 3000, chance = 50, type = COMBAT_ENERGYDAMAGE, minDamage = -400, maxDamage = -900, length = 7, spread = 5, effect = CONST_ME_TELEPORT, target = false }, } monster.defenses = { defense = 25, armor = 78, - {name ="combat", interval = 2000, chance = 54, type = COMBAT_HEALING, minDamage = 150, maxDamage = 950, effect = CONST_ME_MAGIC_BLUE, target = false} + { name = "combat", interval = 2000, chance = 54, type = COMBAT_HEALING, minDamage = 150, maxDamage = 950, effect = CONST_ME_MAGIC_BLUE, target = false }, } monster.elements = { - {type = COMBAT_PHYSICALDAMAGE, percent = 0}, - {type = COMBAT_ENERGYDAMAGE, percent = 0}, - {type = COMBAT_EARTHDAMAGE, percent = 100}, - {type = COMBAT_FIREDAMAGE, percent = -15}, - {type = COMBAT_LIFEDRAIN, percent = 0}, - {type = COMBAT_MANADRAIN, percent = 0}, - {type = COMBAT_DROWNDAMAGE, percent = 0}, - {type = COMBAT_ICEDAMAGE, percent = 0}, - {type = COMBAT_HOLYDAMAGE , percent = 0}, - {type = COMBAT_DEATHDAMAGE , percent = 100} + { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, + { type = COMBAT_ENERGYDAMAGE, percent = 0 }, + { type = COMBAT_EARTHDAMAGE, percent = 100 }, + { type = COMBAT_FIREDAMAGE, percent = -15 }, + { type = COMBAT_LIFEDRAIN, percent = 0 }, + { type = COMBAT_MANADRAIN, percent = 0 }, + { type = COMBAT_DROWNDAMAGE, percent = 0 }, + { type = COMBAT_ICEDAMAGE, percent = 0 }, + { type = COMBAT_HOLYDAMAGE, percent = 0 }, + { type = COMBAT_DEATHDAMAGE, percent = 100 }, } monster.immunities = { - {type = "paralyze", condition = true}, - {type = "outfit", condition = false}, - {type = "invisible", condition = true}, - {type = "bleed", condition = false} + { type = "paralyze", condition = true }, + { type = "outfit", condition = false }, + { type = "invisible", condition = true }, + { type = "bleed", condition = false }, } monster.heals = { - {type = COMBAT_EARTHDAMAGE, percent = 100} + { type = COMBAT_EARTHDAMAGE, percent = 100 }, } -mType.onThink = function(monster, interval) -end +mType.onThink = function(monster, interval) end mType.onAppear = function(monster, creature) if monster:getType():isRewardBoss() then @@ -110,13 +109,10 @@ mType.onAppear = function(monster, creature) end end -mType.onDisappear = function(monster, creature) -end +mType.onDisappear = function(monster, creature) end -mType.onMove = function(monster, creature, fromPosition, toPosition) -end +mType.onMove = function(monster, creature, fromPosition, toPosition) end -mType.onSay = function(monster, creature, type, message) -end +mType.onSay = function(monster, creature, type, message) end mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/nargol_the_impaler.lua b/data-otservbr-global/monster/quests/grave_danger/nargol_the_impaler.lua index 9274d3e65e9..c985b745ad6 100644 --- a/data-otservbr-global/monster/quests/grave_danger/nargol_the_impaler.lua +++ b/data-otservbr-global/monster/quests/grave_danger/nargol_the_impaler.lua @@ -10,7 +10,7 @@ monster.outfit = { lookLegs = 94, lookFeet = 0, lookAddons = 3, - lookMount = 0 + lookMount = 0, } monster.health = 250000 @@ -27,7 +27,7 @@ monster.events = { monster.changeTarget = { interval = 4000, - chance = 10 + chance = 10, } monster.strategiesTarget = { @@ -52,12 +52,12 @@ monster.flags = { canWalkOnEnergy = true, canWalkOnFire = true, canWalkOnPoison = true, - pet = false + pet = false, } monster.light = { level = 0, - color = 0 + color = 0, } monster.voices = { @@ -65,47 +65,45 @@ monster.voices = { chance = 10, } -monster.loot = { -} +monster.loot = {} monster.attacks = { - {name ="melee", interval = 2000, chance = 100, minDamage = -800, maxDamage = -1200}, - {name ="combat", interval = 6000, chance = 56, type = COMBAT_EARTHDAMAGE, minDamage = -1000, maxDamage = -1200, length = 7, spread = 5, effect = CONST_ME_POISONAREA, target = false}, - {name ="combat", interval = 5000, chance = 70, type = COMBAT_LIFEDRAIN, minDamage = -700, maxDamage = -900, length = 7, effect = CONST_ME_MORTAREA, target = false}, + { name = "melee", interval = 2000, chance = 100, minDamage = -800, maxDamage = -1200 }, + { name = "combat", interval = 6000, chance = 56, type = COMBAT_EARTHDAMAGE, minDamage = -1000, maxDamage = -1200, length = 7, spread = 5, effect = CONST_ME_POISONAREA, target = false }, + { name = "combat", interval = 5000, chance = 70, type = COMBAT_LIFEDRAIN, minDamage = -700, maxDamage = -900, length = 7, effect = CONST_ME_MORTAREA, target = false }, } monster.defenses = { defense = 25, armor = 78, - {name ="combat", interval = 2000, chance = 55, type = COMBAT_HEALING, minDamage = 350, maxDamage = 950, effect = CONST_ME_MAGIC_BLUE, target = false} + { name = "combat", interval = 2000, chance = 55, type = COMBAT_HEALING, minDamage = 350, maxDamage = 950, effect = CONST_ME_MAGIC_BLUE, target = false }, } monster.elements = { - {type = COMBAT_PHYSICALDAMAGE, percent = 0}, - {type = COMBAT_ENERGYDAMAGE, percent = 0}, - {type = COMBAT_EARTHDAMAGE, percent = 100}, - {type = COMBAT_FIREDAMAGE, percent = -20}, - {type = COMBAT_LIFEDRAIN, percent = 0}, - {type = COMBAT_MANADRAIN, percent = 0}, - {type = COMBAT_DROWNDAMAGE, percent = 0}, - {type = COMBAT_ICEDAMAGE, percent = 0}, - {type = COMBAT_HOLYDAMAGE , percent = 0}, - {type = COMBAT_DEATHDAMAGE , percent = 100} + { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, + { type = COMBAT_ENERGYDAMAGE, percent = 0 }, + { type = COMBAT_EARTHDAMAGE, percent = 100 }, + { type = COMBAT_FIREDAMAGE, percent = -20 }, + { type = COMBAT_LIFEDRAIN, percent = 0 }, + { type = COMBAT_MANADRAIN, percent = 0 }, + { type = COMBAT_DROWNDAMAGE, percent = 0 }, + { type = COMBAT_ICEDAMAGE, percent = 0 }, + { type = COMBAT_HOLYDAMAGE, percent = 0 }, + { type = COMBAT_DEATHDAMAGE, percent = 100 }, } monster.immunities = { - {type = "paralyze", condition = true}, - {type = "outfit", condition = false}, - {type = "invisible", condition = true}, - {type = "bleed", condition = false} + { type = "paralyze", condition = true }, + { type = "outfit", condition = false }, + { type = "invisible", condition = true }, + { type = "bleed", condition = false }, } monster.heals = { - {type = COMBAT_EARTHDAMAGE, percent = 100} + { type = COMBAT_EARTHDAMAGE, percent = 100 }, } -mType.onThink = function(monster, interval) -end +mType.onThink = function(monster, interval) end mType.onAppear = function(monster, creature) if monster:getType():isRewardBoss() then @@ -113,13 +111,10 @@ mType.onAppear = function(monster, creature) end end -mType.onDisappear = function(monster, creature) -end +mType.onDisappear = function(monster, creature) end -mType.onMove = function(monster, creature, fromPosition, toPosition) -end +mType.onMove = function(monster, creature, fromPosition, toPosition) end -mType.onSay = function(monster, creature, type, message) -end +mType.onSay = function(monster, creature, type, message) end mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/regenerating_mass.lua b/data-otservbr-global/monster/quests/grave_danger/regenerating_mass.lua index 727c053bccd..2daba01aef4 100644 --- a/data-otservbr-global/monster/quests/grave_danger/regenerating_mass.lua +++ b/data-otservbr-global/monster/quests/grave_danger/regenerating_mass.lua @@ -10,7 +10,7 @@ monster.outfit = { lookLegs = 0, lookFeet = 0, lookAddons = 0, - lookMount = 0 + lookMount = 0, } monster.health = 100000 @@ -23,7 +23,7 @@ monster.maxSummons = 0 monster.changeTarget = { interval = 4000, - chance = 10 + chance = 10, } monster.strategiesTarget = { @@ -51,42 +51,42 @@ monster.flags = { canWalkOnEnergy = false, canWalkOnFire = false, canWalkOnPoison = true, - pet = false + pet = false, } monster.light = { level = 0, - color = 0 + color = 0, } monster.attacks = { - {name ="melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -440}, + { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -440 }, } monster.defenses = { defense = 20, armor = 20, - {name ="combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 880, maxDamage = 1050, effect = CONST_ME_MAGIC_BLUE, target = false} + { name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 880, maxDamage = 1050, effect = CONST_ME_MAGIC_BLUE, target = false }, } monster.elements = { - {type = COMBAT_PHYSICALDAMAGE, percent = 0}, - {type = COMBAT_ENERGYDAMAGE, percent = 10}, - {type = COMBAT_EARTHDAMAGE, percent = 100}, - {type = COMBAT_FIREDAMAGE, percent = -25}, - {type = COMBAT_LIFEDRAIN, percent = 0}, - {type = COMBAT_MANADRAIN, percent = 0}, - {type = COMBAT_DROWNDAMAGE, percent = 0}, - {type = COMBAT_ICEDAMAGE, percent = 20}, - {type = COMBAT_HOLYDAMAGE , percent = 0}, - {type = COMBAT_DEATHDAMAGE , percent = 0} + { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, + { type = COMBAT_ENERGYDAMAGE, percent = 10 }, + { type = COMBAT_EARTHDAMAGE, percent = 100 }, + { type = COMBAT_FIREDAMAGE, percent = -25 }, + { type = COMBAT_LIFEDRAIN, percent = 0 }, + { type = COMBAT_MANADRAIN, percent = 0 }, + { type = COMBAT_DROWNDAMAGE, percent = 0 }, + { type = COMBAT_ICEDAMAGE, percent = 20 }, + { type = COMBAT_HOLYDAMAGE, percent = 0 }, + { type = COMBAT_DEATHDAMAGE, percent = 0 }, } monster.immunities = { - {type = "paralyze", condition = true}, - {type = "outfit", condition = false}, - {type = "invisible", condition = true}, - {type = "bleed", condition = false} + { type = "paralyze", condition = true }, + { type = "outfit", condition = false }, + { type = "invisible", condition = true }, + { type = "bleed", condition = false }, } mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody.lua b/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody.lua index e3ad3ce5210..92cc0b7dcf5 100644 --- a/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody.lua +++ b/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody.lua @@ -11,7 +11,7 @@ monster.outfit = { lookLegs = 0, lookFeet = 0, lookAddons = 1, - lookMount = 0 + lookMount = 0, } monster.health = 250000 @@ -29,7 +29,7 @@ monster.events = { monster.changeTarget = { interval = 4000, - chance = 10 + chance = 10, } monster.strategiesTarget = { @@ -54,12 +54,12 @@ monster.flags = { canWalkOnEnergy = true, canWalkOnFire = true, canWalkOnPoison = true, - pet = false + pet = false, } monster.light = { level = 0, - color = 0 + color = 0, } monster.voices = { @@ -68,44 +68,43 @@ monster.voices = { } monster.attacks = { - {name ="melee", interval = 2000, chance = 100, minDamage = -800, maxDamage = -1200}, - {name ="combat", interval = 3000, chance = 46, type = COMBAT_DROWNDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_BUBBLES, target = false}, - {name ="combat", interval = 5000, chance = 70, type = COMBAT_LIFEDRAIN, minDamage = -700, maxDamage = -900, length = 7, effect = CONST_ME_MAGIC_RED, target = false}, - {name ="combat", interval = 6000, chance = 46, type = COMBAT_EARTHDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_POISONAREA, target = false} + { name = "melee", interval = 2000, chance = 100, minDamage = -800, maxDamage = -1200 }, + { name = "combat", interval = 3000, chance = 46, type = COMBAT_DROWNDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_BUBBLES, target = false }, + { name = "combat", interval = 5000, chance = 70, type = COMBAT_LIFEDRAIN, minDamage = -700, maxDamage = -900, length = 7, effect = CONST_ME_MAGIC_RED, target = false }, + { name = "combat", interval = 6000, chance = 46, type = COMBAT_EARTHDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_POISONAREA, target = false }, } monster.defenses = { defense = 25, armor = 78, - {name ="combat", interval = 2000, chance = 54, type = COMBAT_HEALING, minDamage = 900, maxDamage = 1000, effect = CONST_ME_MAGIC_BLUE, target = false} + { name = "combat", interval = 2000, chance = 54, type = COMBAT_HEALING, minDamage = 900, maxDamage = 1000, effect = CONST_ME_MAGIC_BLUE, target = false }, } monster.elements = { - {type = COMBAT_PHYSICALDAMAGE, percent = 0}, - {type = COMBAT_ENERGYDAMAGE, percent = 0}, - {type = COMBAT_EARTHDAMAGE, percent = 100}, - {type = COMBAT_FIREDAMAGE, percent = -20}, - {type = COMBAT_LIFEDRAIN, percent = 0}, - {type = COMBAT_MANADRAIN, percent = 0}, - {type = COMBAT_DROWNDAMAGE, percent = 0}, - {type = COMBAT_ICEDAMAGE, percent = 0}, - {type = COMBAT_HOLYDAMAGE , percent = 0}, - {type = COMBAT_DEATHDAMAGE , percent = 100} + { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, + { type = COMBAT_ENERGYDAMAGE, percent = 0 }, + { type = COMBAT_EARTHDAMAGE, percent = 100 }, + { type = COMBAT_FIREDAMAGE, percent = -20 }, + { type = COMBAT_LIFEDRAIN, percent = 0 }, + { type = COMBAT_MANADRAIN, percent = 0 }, + { type = COMBAT_DROWNDAMAGE, percent = 0 }, + { type = COMBAT_ICEDAMAGE, percent = 0 }, + { type = COMBAT_HOLYDAMAGE, percent = 0 }, + { type = COMBAT_DEATHDAMAGE, percent = 100 }, } monster.immunities = { - {type = "paralyze", condition = true}, - {type = "outfit", condition = false}, - {type = "invisible", condition = true}, - {type = "bleed", condition = false} + { type = "paralyze", condition = true }, + { type = "outfit", condition = false }, + { type = "invisible", condition = true }, + { type = "bleed", condition = false }, } monster.heals = { - {type = COMBAT_EARTHDAMAGE, percent = 100} + { type = COMBAT_EARTHDAMAGE, percent = 100 }, } -mType.onThink = function(monster, interval) -end +mType.onThink = function(monster, interval) end mType.onAppear = function(monster, creature) if monster:getType():isRewardBoss() then @@ -113,13 +112,10 @@ mType.onAppear = function(monster, creature) end end -mType.onDisappear = function(monster, creature) -end +mType.onDisappear = function(monster, creature) end -mType.onMove = function(monster, creature, fromPosition, toPosition) -end +mType.onMove = function(monster, creature, fromPosition, toPosition) end -mType.onSay = function(monster, creature, type, message) -end +mType.onSay = function(monster, creature, type, message) end mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody_inv.lua b/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody_inv.lua index b4616401f10..d2bfa1fa1be 100644 --- a/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody_inv.lua +++ b/data-otservbr-global/monster/quests/grave_danger/rewar_the_bloody_inv.lua @@ -11,7 +11,7 @@ monster.outfit = { lookLegs = 57, lookFeet = 0, lookAddons = 3, - lookMount = 0 + lookMount = 0, } monster.health = 250000 @@ -28,7 +28,7 @@ monster.events = { monster.changeTarget = { interval = 4000, - chance = 10 + chance = 10, } monster.strategiesTarget = { @@ -53,12 +53,12 @@ monster.flags = { canWalkOnEnergy = true, canWalkOnFire = true, canWalkOnPoison = true, - pet = false + pet = false, } monster.light = { level = 0, - color = 0 + color = 0, } monster.voices = { @@ -67,44 +67,43 @@ monster.voices = { } monster.attacks = { - {name ="melee", interval = 2000, chance = 100, minDamage = -800, maxDamage = -1200}, - {name ="combat", interval = 3000, chance = 46, type = COMBAT_DROWNDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_BUBBLES, target = false}, - {name ="combat", interval = 5000, chance = 70, type = COMBAT_LIFEDRAIN, minDamage = -700, maxDamage = -900, length = 7, effect = CONST_ME_MAGIC_RED, target = false}, - {name ="combat", interval = 6000, chance = 46, type = COMBAT_EARTHDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_POISONAREA, target = false} + { name = "melee", interval = 2000, chance = 100, minDamage = -800, maxDamage = -1200 }, + { name = "combat", interval = 3000, chance = 46, type = COMBAT_DROWNDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_BUBBLES, target = false }, + { name = "combat", interval = 5000, chance = 70, type = COMBAT_LIFEDRAIN, minDamage = -700, maxDamage = -900, length = 7, effect = CONST_ME_MAGIC_RED, target = false }, + { name = "combat", interval = 6000, chance = 46, type = COMBAT_EARTHDAMAGE, minDamage = -700, maxDamage = -800, length = 7, spread = 5, effect = CONST_ME_POISONAREA, target = false }, } monster.defenses = { defense = 25, armor = 78, - {name ="combat", interval = 2000, chance = 54, type = COMBAT_HEALING, minDamage = 900, maxDamage = 1000, effect = CONST_ME_MAGIC_BLUE, target = false} + { name = "combat", interval = 2000, chance = 54, type = COMBAT_HEALING, minDamage = 900, maxDamage = 1000, effect = CONST_ME_MAGIC_BLUE, target = false }, } monster.elements = { - {type = COMBAT_PHYSICALDAMAGE, percent = 100}, - {type = COMBAT_ENERGYDAMAGE, percent = 100}, - {type = COMBAT_EARTHDAMAGE, percent = 100}, - {type = COMBAT_FIREDAMAGE, percent = 100}, - {type = COMBAT_LIFEDRAIN, percent = 100}, - {type = COMBAT_MANADRAIN, percent = 100}, - {type = COMBAT_DROWNDAMAGE, percent = 100}, - {type = COMBAT_ICEDAMAGE, percent = 100}, - {type = COMBAT_HOLYDAMAGE , percent = 100}, - {type = COMBAT_DEATHDAMAGE , percent = 100} + { type = COMBAT_PHYSICALDAMAGE, percent = 100 }, + { type = COMBAT_ENERGYDAMAGE, percent = 100 }, + { type = COMBAT_EARTHDAMAGE, percent = 100 }, + { type = COMBAT_FIREDAMAGE, percent = 100 }, + { type = COMBAT_LIFEDRAIN, percent = 100 }, + { type = COMBAT_MANADRAIN, percent = 100 }, + { type = COMBAT_DROWNDAMAGE, percent = 100 }, + { type = COMBAT_ICEDAMAGE, percent = 100 }, + { type = COMBAT_HOLYDAMAGE, percent = 100 }, + { type = COMBAT_DEATHDAMAGE, percent = 100 }, } monster.immunities = { - {type = "paralyze", condition = true}, - {type = "outfit", condition = false}, - {type = "invisible", condition = true}, - {type = "bleed", condition = false} + { type = "paralyze", condition = true }, + { type = "outfit", condition = false }, + { type = "invisible", condition = true }, + { type = "bleed", condition = false }, } monster.heals = { - {type = COMBAT_EARTHDAMAGE, percent = 100} + { type = COMBAT_EARTHDAMAGE, percent = 100 }, } -mType.onThink = function(monster, interval) -end +mType.onThink = function(monster, interval) end mType.onAppear = function(monster, creature) if monster:getType():isRewardBoss() then @@ -112,13 +111,10 @@ mType.onAppear = function(monster, creature) end end -mType.onDisappear = function(monster, creature) -end +mType.onDisappear = function(monster, creature) end -mType.onMove = function(monster, creature, fromPosition, toPosition) -end +mType.onMove = function(monster, creature, fromPosition, toPosition) end -mType.onSay = function(monster, creature, type, message) -end +mType.onSay = function(monster, creature, type, message) end mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/tainted_soul_splinter.lua b/data-otservbr-global/monster/quests/grave_danger/tainted_soul_splinter.lua index 4360b76465c..e20558b5c1e 100644 --- a/data-otservbr-global/monster/quests/grave_danger/tainted_soul_splinter.lua +++ b/data-otservbr-global/monster/quests/grave_danger/tainted_soul_splinter.lua @@ -10,7 +10,7 @@ monster.outfit = { lookLegs = 94, lookFeet = 94, lookAddons = 0, - lookMount = 0 + lookMount = 0, } monster.health = 10000 @@ -23,7 +23,7 @@ monster.maxSummons = 0 monster.changeTarget = { interval = 5000, - chance = 20 + chance = 20, } monster.flags = { @@ -44,37 +44,37 @@ monster.flags = { canWalkOnEnergy = true, canWalkOnFire = true, canWalkOnPoison = true, - pet = false + pet = false, } monster.light = { level = 0, - color = 0 + color = 0, } monster.defenses = { defense = 40, - armor = 40 + armor = 40, } monster.elements = { - {type = COMBAT_PHYSICALDAMAGE, percent = 0}, - {type = COMBAT_ENERGYDAMAGE, percent = 0}, - {type = COMBAT_EARTHDAMAGE, percent = 0}, - {type = COMBAT_FIREDAMAGE, percent = 0}, - {type = COMBAT_LIFEDRAIN, percent = 0}, - {type = COMBAT_MANADRAIN, percent = 0}, - {type = COMBAT_DROWNDAMAGE, percent = 0}, - {type = COMBAT_ICEDAMAGE, percent = 0}, - {type = COMBAT_HOLYDAMAGE , percent = 0}, - {type = COMBAT_DEATHDAMAGE , percent = 0} + { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, + { type = COMBAT_ENERGYDAMAGE, percent = 0 }, + { type = COMBAT_EARTHDAMAGE, percent = 0 }, + { type = COMBAT_FIREDAMAGE, percent = 0 }, + { type = COMBAT_LIFEDRAIN, percent = 0 }, + { type = COMBAT_MANADRAIN, percent = 0 }, + { type = COMBAT_DROWNDAMAGE, percent = 0 }, + { type = COMBAT_ICEDAMAGE, percent = 0 }, + { type = COMBAT_HOLYDAMAGE, percent = 0 }, + { type = COMBAT_DEATHDAMAGE, percent = 0 }, } monster.immunities = { - {type = "paralyze", condition = true}, - {type = "outfit", condition = false}, - {type = "invisible", condition = true}, - {type = "bleed", condition = false} + { type = "paralyze", condition = true }, + { type = "outfit", condition = false }, + { type = "invisible", condition = true }, + { type = "bleed", condition = false }, } mType:register(monster) diff --git a/data-otservbr-global/monster/quests/grave_danger/the_red_knight.lua b/data-otservbr-global/monster/quests/grave_danger/the_red_knight.lua index c343164d131..3849bb8d877 100644 --- a/data-otservbr-global/monster/quests/grave_danger/the_red_knight.lua +++ b/data-otservbr-global/monster/quests/grave_danger/the_red_knight.lua @@ -10,7 +10,7 @@ monster.outfit = { lookLegs = 94, lookFeet = 76, lookAddons = 3, - lookMount = 0 + lookMount = 0, } monster.health = 250000 @@ -22,7 +22,7 @@ monster.manaCost = 0 monster.changeTarget = { interval = 4000, - chance = 10 + chance = 10, } monster.strategiesTarget = { @@ -47,12 +47,12 @@ monster.flags = { canWalkOnEnergy = true, canWalkOnFire = true, canWalkOnPoison = true, - pet = false + pet = false, } monster.light = { level = 0, - color = 0 + color = 0, } monster.voices = { @@ -61,43 +61,41 @@ monster.voices = { } monster.attacks = { - {name ="melee", interval = 2000, chance = 100, minDamage = -200, maxDamage = -1000}, - {name ="combat", interval = 2000, chance = 15, type = COMBAT_EARTHDAMAGE, minDamage = -400, maxDamage = -1000, length = 7, spread = 3, effect = CONST_ME_POISONAREA, target = false}, + { name = "melee", interval = 2000, chance = 100, minDamage = -200, maxDamage = -1000 }, + { name = "combat", interval = 2000, chance = 15, type = COMBAT_EARTHDAMAGE, minDamage = -400, maxDamage = -1000, length = 7, spread = 3, effect = CONST_ME_POISONAREA, target = false }, } monster.defenses = { defense = 25, armor = 78, - {name ="combat", interval = 2000, chance = 50, type = COMBAT_HEALING, minDamage = 150, maxDamage = 950, effect = CONST_ME_MAGIC_BLUE, target = false} + { name = "combat", interval = 2000, chance = 50, type = COMBAT_HEALING, minDamage = 150, maxDamage = 950, effect = CONST_ME_MAGIC_BLUE, target = false }, } monster.elements = { - {type = COMBAT_PHYSICALDAMAGE, percent = 100}, - {type = COMBAT_ENERGYDAMAGE, percent = 100}, - {type = COMBAT_EARTHDAMAGE, percent = 100}, - {type = COMBAT_FIREDAMAGE, percent = 100}, - {type = COMBAT_LIFEDRAIN, percent = 100}, - {type = COMBAT_MANADRAIN, percent = 100}, - {type = COMBAT_DROWNDAMAGE, percent = 0}, - {type = COMBAT_ICEDAMAGE, percent = 100}, - {type = COMBAT_HOLYDAMAGE , percent = 100}, - {type = COMBAT_DEATHDAMAGE , percent = 100} + { type = COMBAT_PHYSICALDAMAGE, percent = 100 }, + { type = COMBAT_ENERGYDAMAGE, percent = 100 }, + { type = COMBAT_EARTHDAMAGE, percent = 100 }, + { type = COMBAT_FIREDAMAGE, percent = 100 }, + { type = COMBAT_LIFEDRAIN, percent = 100 }, + { type = COMBAT_MANADRAIN, percent = 100 }, + { type = COMBAT_DROWNDAMAGE, percent = 0 }, + { type = COMBAT_ICEDAMAGE, percent = 100 }, + { type = COMBAT_HOLYDAMAGE, percent = 100 }, + { type = COMBAT_DEATHDAMAGE, percent = 100 }, } monster.immunities = { - {type = "paralyze", condition = true}, - {type = "outfit", condition = false}, - {type = "invisible", condition = true}, - {type = "bleed", condition = false} + { type = "paralyze", condition = true }, + { type = "outfit", condition = false }, + { type = "invisible", condition = true }, + { type = "bleed", condition = false }, } monster.heals = { - {type = COMBAT_EARTHDAMAGE, percent = 100} + { type = COMBAT_EARTHDAMAGE, percent = 100 }, } - -mType.onThink = function(monster, interval) -end +mType.onThink = function(monster, interval) end mType.onAppear = function(monster, creature) if monster:getType():isRewardBoss() then @@ -105,13 +103,10 @@ mType.onAppear = function(monster, creature) end end -mType.onDisappear = function(monster, creature) -end +mType.onDisappear = function(monster, creature) end -mType.onMove = function(monster, creature, fromPosition, toPosition) -end +mType.onMove = function(monster, creature, fromPosition, toPosition) end -mType.onSay = function(monster, creature, type, message) -end +mType.onSay = function(monster, creature, type, message) end mType:register(monster) diff --git a/data-otservbr-global/npc/jack_springer.lua b/data-otservbr-global/npc/jack_springer.lua index 5b49dc59f05..a5e4c1e08db 100644 --- a/data-otservbr-global/npc/jack_springer.lua +++ b/data-otservbr-global/npc/jack_springer.lua @@ -78,17 +78,17 @@ local function greetCallback(npc, creature) local player = Player(creature) if player then - if player:getLevel() >= 250 then - if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) < 1 then - npcHandler:setMessage(MESSAGE_GREET, "Welcome, |PLAYERNAME|! There is much we have to {discuss}.") - elseif player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) >= 3 then - npcHandler:setMessage(MESSAGE_GREET, "Hello, stranger! You look suspicious to me. I don't think we have anything to discuss.") - else - npcHandler:setMessage(MESSAGE_GREET, "Welcome, |PLAYERNAME|! Is there anything to {report}?") - end - else - npcHandler:setMessage(MESSAGE_GREET, "Hello, stranger! Sorry, but I never heard about you. I'm looking for more experienced help.") - end + if player:getLevel() >= 250 then + if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) < 1 then + npcHandler:setMessage(MESSAGE_GREET, "Welcome, |PLAYERNAME|! There is much we have to {discuss}.") + elseif player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) >= 3 then + npcHandler:setMessage(MESSAGE_GREET, "Hello, stranger! You look suspicious to me. I don't think we have anything to discuss.") + else + npcHandler:setMessage(MESSAGE_GREET, "Welcome, |PLAYERNAME|! Is there anything to {report}?") + end + else + npcHandler:setMessage(MESSAGE_GREET, "Hello, stranger! Sorry, but I never heard about you. I'm looking for more experienced help.") + end end return true @@ -123,7 +123,7 @@ local function creatureSayCallback(npc, creature, type, message) if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) < 1 then npcHandler:say({ "While you travel and fight the threat where it arises, we will put all our resources into researching the ultimate plans of the legion. Perhaps I can tell you more when you {report} back. ...", - "Don't forget that you'll need very potent holy water for your task. If you need some, just ask me for a {trade}." + "Don't forget that you'll need very potent holy water for your task. If you need some, just ask me for a {trade}.", }, npc, creature) for _, stor in pairs(storages) do player:setStorageValue(stor, 0) @@ -134,7 +134,7 @@ local function creatureSayCallback(npc, creature, type, message) else npcHandler:say({ "While you travel and fight the threat where it arises, we will put all our resources into researching the ultimate plans of the legion. Perhaps I can tell you more when you {report} back. ...", - "Don't forget that you'll need very potent holy water for your task. If you need some, just ask me for a {trade}." + "Don't forget that you'll need very potent holy water for your task. If you need some, just ask me for a {trade}.", }, npc, creature) npcHandler:setTopic(playerId, 2) end @@ -165,7 +165,7 @@ local function creatureSayCallback(npc, creature, type, message) elseif MsgContains(message, "ultimate") and npcHandler:getTopic(playerId) == 3 then npcHandler:say({ "It became obvious that their goal is to raise an ancient and fallen king, to lead their lich-knights and raise even more of them. ...", - " With each lich-knight being able to raise and control lesser undead, this would lead to a chain-reaction. If they succeed, we might face an undead {threat} not seen since the corpse wars." + " With each lich-knight being able to raise and control lesser undead, this would lead to a chain-reaction. If they succeed, we might face an undead {threat} not seen since the corpse wars.", }, npc, creature) npcHandler:setTopic(playerId, 4) elseif MsgContains(message, "threat") and npcHandler:getTopic(playerId) == 4 then @@ -175,13 +175,13 @@ local function creatureSayCallback(npc, creature, type, message) "Hopefully the ritual will bind some of their powers but they will still be formidable foes. You will have to act quick because with each moment you take to defeat the knights ...", "The ritual will progress and the king will become stronger up to a point where you might be unable to defeat him. Due to the efforts and sacrifices of the death cultists, the king will be active at some capacity and you will have to confront him. ...", "Remember, the further the ritual progresses when you face him, he will become considerably more powerful. So time is of the essence. ...", - "All I can do right now is to wish you good luck and may the gods bless you." + "All I can do right now is to wish you good luck and may the gods bless you.", }, npc, creature) player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Stage, 1) player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Questline, 2) end - return true + return true end npcHandler:setMessage(MESSAGE_SENDTRADE, "Of course, my friend.") @@ -189,59 +189,92 @@ npcHandler:setMessage(MESSAGE_SENDTRADE, "Of course, my friend.") npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) -keywordHandler:addKeyword({'discuss'}, StdModule.say, {npcHandler = npcHandler, text = "I need your help in a matter of utmost {urgency}."}) -keywordHandler:addKeyword({'urgency'}, StdModule.say, {npcHandler = npcHandler, text = "The situation is complicated and it's even hard to say where to {start} best, just to describe it to you."}) -keywordHandler:addKeyword({'start'}, StdModule.say, {npcHandler = npcHandler, text = "You see, several incidents in history can be traced back to a single {source}."}) -keywordHandler:addKeyword({'source'}, StdModule.say, {npcHandler = npcHandler, text = "Things get murkier the further you go down in history, but that's not even necessary. Even today we can discern a certain pattern in recent {events}."}) -keywordHandler:addKeyword({'events'}, StdModule.say, {npcHandler = npcHandler, text = { +keywordHandler:addKeyword({ "discuss" }, StdModule.say, { npcHandler = npcHandler, text = "I need your help in a matter of utmost {urgency}." }) +keywordHandler:addKeyword({ "urgency" }, StdModule.say, { npcHandler = npcHandler, text = "The situation is complicated and it's even hard to say where to {start} best, just to describe it to you." }) +keywordHandler:addKeyword({ "start" }, StdModule.say, { npcHandler = npcHandler, text = "You see, several incidents in history can be traced back to a single {source}." }) +keywordHandler:addKeyword({ "source" }, StdModule.say, { npcHandler = npcHandler, text = "Things get murkier the further you go down in history, but that's not even necessary. Even today we can discern a certain pattern in recent {events}." }) +keywordHandler:addKeyword({ "events" }, StdModule.say, { npcHandler = npcHandler, text = { "Well, in Rathleton there was an individual at work, looking for some ancient artefact of power. ...", - "To cover its escape the creature left another creature, known as the ravager to cover his tracks. But there is {more}." -}}) -keywordHandler:addKeyword({'more'}, StdModule.say, {npcHandler = npcHandler, text = { + "To cover its escape the creature left another creature, known as the ravager to cover his tracks. But there is {more}.", +} }) +keywordHandler:addKeyword({ "more" }, StdModule.say, { npcHandler = npcHandler, text = { "Only recently someone was trying to manipulate the elven dream courts into releasing a monstrosity of nightmares, probably planning to control or recruit this creature. ....", - "But those incidents were just some of {many}." -}}) -keywordHandler:addKeyword({'many'}, StdModule.say, {npcHandler = npcHandler, text = "The recent rise of lycanthropy, the robbery of certain forbidden arcane texts and the vanishing of at least three dangerous individuals, targeted by the inquisition are just the tip of the {iceberg}."}) -keywordHandler:addKeyword({'iceberg'}, StdModule.say, {npcHandler = npcHandler, text = { - "There is a scheming going on behind the scenes. Powerful good people were corrupted. Evil-doers got backup and resources from a hidden ally. ...", - "Powerful malignant creatures, gathering their kind under their banner and so much more. These things are not happening by chance. There is a pattern, a guiding {hand}." -}}) -keywordHandler:addKeyword({'hand'}, StdModule.say, {npcHandler = npcHandler, text = "This outside force is moving behind the scenes since ages. Our research suggests that this force probably even {predates} the rise of humanity."}) -keywordHandler:addKeyword({'predates'}, StdModule.say, {npcHandler = npcHandler, text = "Well, we are sure that the puppeteer behind all these events is an organisation. So old that even its name, the Shiron'Fal, has lost its meaning, because the {language} it originates from is long dead."}) -keywordHandler:addKeyword({'language'}, StdModule.say, {npcHandler = npcHandler, text = { - "It has a rather complex meaning and as far as we can tell it translates to 'army of those who are many, dedicated to the ultimate time of mayhem and despair'. ...", - "Other, more handy names are army of the last battlefield, army of the last days, legion of mayhem, dread legion or simply the {legion}." -}}) -keywordHandler:addKeyword({'legion'}, StdModule.say, {npcHandler = npcHandler, text = { - "We know little for sure. You can look into our books to see some of our sources. But most are vague and some even contradictory. ...", - "To summarise what we know, let me tell you this: The Shiron'Fal is an extremely old organisation. It seeks to accumulate power for some unknown but certainly sinister {goal}." -}}) -keywordHandler:addKeyword({'goal'}, StdModule.say, {npcHandler = npcHandler, text = { - "For this purpose, the members gather knowledge, artefacts and powerful individuals. The members are formidable at certain fields of expertise. They are cunning and powerful and act with no regard for others, with no remorse or mercy. ...", - "As they are doing this since ages, they must have acquired tremendous powers and knowledge. Their members often operate alone but are usually well funded with the necessary resources. ...", - "Whatever their endgame might be, each of their operations pose a grave danger to the whole world and have to be {stopped}." -}}) -keywordHandler:addKeyword({'stopped'}, StdModule.say, {npcHandler = npcHandler, text = "Here is where you come into play. We could identify the most recent plot of the Shiron'Fal and already had some {clashes}."}) -keywordHandler:addKeyword({'clashes'}, StdModule.say, {npcHandler = npcHandler, text = "In our efforts to hinder their plot, we achieved mixed results at best. But now things are escalating fast and we have to {hurry}."}) -keywordHandler:addKeyword({'hurry'}, StdModule.say, {npcHandler = npcHandler, text = "Our resources are already stretched thin, so we need your help with the most recent {problem}."}) -keywordHandler:addKeyword({'problem'}, StdModule.say, {npcHandler = npcHandler, text = "The legion tries to use a new form of twisted rituals to raise the bodies of well-known {knights}."}) -keywordHandler:addKeyword({'knights'}, StdModule.say, {npcHandler = npcHandler, text = { + "But those incidents were just some of {many}.", +} }) +keywordHandler:addKeyword({ "many" }, StdModule.say, { npcHandler = npcHandler, text = "The recent rise of lycanthropy, the robbery of certain forbidden arcane texts and the vanishing of at least three dangerous individuals, targeted by the inquisition are just the tip of the {iceberg}." }) +keywordHandler:addKeyword( + { "iceberg" }, + StdModule.say, + { npcHandler = npcHandler, text = { + "There is a scheming going on behind the scenes. Powerful good people were corrupted. Evil-doers got backup and resources from a hidden ally. ...", + "Powerful malignant creatures, gathering their kind under their banner and so much more. These things are not happening by chance. There is a pattern, a guiding {hand}.", + } } +) +keywordHandler:addKeyword({ "hand" }, StdModule.say, { npcHandler = npcHandler, text = "This outside force is moving behind the scenes since ages. Our research suggests that this force probably even {predates} the rise of humanity." }) +keywordHandler:addKeyword({ "predates" }, StdModule.say, { npcHandler = npcHandler, text = "Well, we are sure that the puppeteer behind all these events is an organisation. So old that even its name, the Shiron'Fal, has lost its meaning, because the {language} it originates from is long dead." }) +keywordHandler:addKeyword( + { "language" }, + StdModule.say, + { npcHandler = npcHandler, text = { + "It has a rather complex meaning and as far as we can tell it translates to 'army of those who are many, dedicated to the ultimate time of mayhem and despair'. ...", + "Other, more handy names are army of the last battlefield, army of the last days, legion of mayhem, dread legion or simply the {legion}.", + } } +) +keywordHandler:addKeyword( + { "legion" }, + StdModule.say, + { npcHandler = npcHandler, text = { + "We know little for sure. You can look into our books to see some of our sources. But most are vague and some even contradictory. ...", + "To summarise what we know, let me tell you this: The Shiron'Fal is an extremely old organisation. It seeks to accumulate power for some unknown but certainly sinister {goal}.", + } } +) +keywordHandler:addKeyword( + { "goal" }, + StdModule.say, + { + npcHandler = npcHandler, + text = { + "For this purpose, the members gather knowledge, artefacts and powerful individuals. The members are formidable at certain fields of expertise. They are cunning and powerful and act with no regard for others, with no remorse or mercy. ...", + "As they are doing this since ages, they must have acquired tremendous powers and knowledge. Their members often operate alone but are usually well funded with the necessary resources. ...", + "Whatever their endgame might be, each of their operations pose a grave danger to the whole world and have to be {stopped}.", + }, + } +) +keywordHandler:addKeyword({ "stopped" }, StdModule.say, { npcHandler = npcHandler, text = "Here is where you come into play. We could identify the most recent plot of the Shiron'Fal and already had some {clashes}." }) +keywordHandler:addKeyword({ "clashes" }, StdModule.say, { npcHandler = npcHandler, text = "In our efforts to hinder their plot, we achieved mixed results at best. But now things are escalating fast and we have to {hurry}." }) +keywordHandler:addKeyword({ "hurry" }, StdModule.say, { npcHandler = npcHandler, text = "Our resources are already stretched thin, so we need your help with the most recent {problem}." }) +keywordHandler:addKeyword({ "problem" }, StdModule.say, { npcHandler = npcHandler, text = "The legion tries to use a new form of twisted rituals to raise the bodies of well-known {knights}." }) +keywordHandler:addKeyword({ "knights" }, StdModule.say, { npcHandler = npcHandler, text = { "The knights they aim at were tainted in life by their actions or happenstance. ...", - "This leaves their bodies vulnerable to their special breed of necromancy that would raise them as powerful {lich}-knights." -}}) -keywordHandler:addKeyword({'lich'}, StdModule.say, {npcHandler = npcHandler, text = "These powerful undead were a terrible threat on their own but it seems even they are just part of some larger {scheme} that we cannot make out yet."}) -keywordHandler:addKeyword({'scheme'}, StdModule.say, {npcHandler = npcHandler, text = "We are still working feverishly to uncover their goals but for now more imminent {threats} are at hand."}) -keywordHandler:addKeyword({'threats'}, StdModule.say, {npcHandler = npcHandler, text = "Death cultists of the Shiron'Fal are trying to locate the bodies of fallen knights and raise them in blasphemous {rituals}."}) -keywordHandler:addKeyword({'rituals'}, StdModule.say, {npcHandler = npcHandler, text = "The churches of the gods worked hand in hand to supply us with the means to {purge} the graves of those knights."}) -keywordHandler:addKeyword({'purge'}, StdModule.say, {npcHandler = npcHandler, text = { - "Reaching the graves will not be without danger and if you encounter the death cultists you will have to fight them. Even worse, they might have even succeeded in some cases. ...", - "As a newly risen lich-knight is not able to leave the site of its resurrection for some time, you might have to fight some of them. ...", - "Let us pray that you never come too {late} or else some of the fiends might be able to leave their crypts." -}}) -keywordHandler:addKeyword({'locations'}, StdModule.say, {npcHandler = npcHandler, text = { - "We have located twelve graves that have to be secured: In the old northern Edron graveyard, in the dark cathedral of the plains of havoc, in the ghostlands, on Cormaya, Somewhere in the Femor Hills, on Vengoth, ...", - "in the graveyard of Darashia, in the old temple north of Thais, at the entrance to the orcland, one is on the southern ice islands, in a mountain on Kilmaresh, one on an island north-east of Ankrahmun." -}}) + "This leaves their bodies vulnerable to their special breed of necromancy that would raise them as powerful {lich}-knights.", +} }) +keywordHandler:addKeyword({ "lich" }, StdModule.say, { npcHandler = npcHandler, text = "These powerful undead were a terrible threat on their own but it seems even they are just part of some larger {scheme} that we cannot make out yet." }) +keywordHandler:addKeyword({ "scheme" }, StdModule.say, { npcHandler = npcHandler, text = "We are still working feverishly to uncover their goals but for now more imminent {threats} are at hand." }) +keywordHandler:addKeyword({ "threats" }, StdModule.say, { npcHandler = npcHandler, text = "Death cultists of the Shiron'Fal are trying to locate the bodies of fallen knights and raise them in blasphemous {rituals}." }) +keywordHandler:addKeyword({ "rituals" }, StdModule.say, { npcHandler = npcHandler, text = "The churches of the gods worked hand in hand to supply us with the means to {purge} the graves of those knights." }) +keywordHandler:addKeyword( + { "purge" }, + StdModule.say, + { + npcHandler = npcHandler, + text = { + "Reaching the graves will not be without danger and if you encounter the death cultists you will have to fight them. Even worse, they might have even succeeded in some cases. ...", + "As a newly risen lich-knight is not able to leave the site of its resurrection for some time, you might have to fight some of them. ...", + "Let us pray that you never come too {late} or else some of the fiends might be able to leave their crypts.", + }, + } +) +keywordHandler:addKeyword( + { "locations" }, + StdModule.say, + { + npcHandler = npcHandler, + text = { + "We have located twelve graves that have to be secured: In the old northern Edron graveyard, in the dark cathedral of the plains of havoc, in the ghostlands, on Cormaya, Somewhere in the Femor Hills, on Vengoth, ...", + "in the graveyard of Darashia, in the old temple north of Thais, at the entrance to the orcland, one is on the southern ice islands, in a mountain on Kilmaresh, one on an island north-east of Ankrahmun.", + }, + } +) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua index 55d752011df..18a55092d2f 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua @@ -13,24 +13,24 @@ local config = { } local function brothers_play() - local baeloc = Creature('Sir Baeloc') - local nictros = Creature('Sir Nictros') + local baeloc = Creature("Sir Baeloc") + local nictros = Creature("Sir Nictros") if baeloc then - baeloc:say('Ah look my Brother! Challengers! After all this time finally a chance to prove our skills!') + baeloc:say("Ah look my Brother! Challengers! After all this time finally a chance to prove our skills!") addEvent(function() - local nictros = Creature('Sir Nictros') + local nictros = Creature("Sir Nictros") if nictros then - nictros:say('Indeed! It has been a while! As the elder one I request the right of the first battle!') + nictros:say("Indeed! It has been a while! As the elder one I request the right of the first battle!") end end, 6 * 1000) end addEvent(function() - local baeloc = Creature('Sir Baeloc') - local nictros = Creature('Sir Nictros') + local baeloc = Creature("Sir Baeloc") + local nictros = Creature("Sir Nictros") if baeloc then - baeloc:say('Oh, man! You always get the fun!') + baeloc:say("Oh, man! You always get the fun!") if nictros then nictros:teleportTo(Position(33426, 31437, 13)) nictros:setMoveLocked(false) @@ -43,23 +43,23 @@ local baeloc_fight = Action() function baeloc_fight.onUse(player, item, fromPosition, target, toPosition, isHotkey) if not player:doCheckBossRoom("Sir Baeloc", config.fromPos, config.toPos) then - player:sendCancelMessage('The room is already in use. Please wait.') + player:sendCancelMessage("The room is already in use. Please wait.") return true end - local baeloc = Game.createMonster('Sir Baeloc', config.baelocPos, true, true) - local nictros = Game.createMonster('Sir Nictros', config.nictrosPos, true, true) + local baeloc = Game.createMonster("Sir Baeloc", config.baelocPos, true, true) + local nictros = Game.createMonster("Sir Nictros", config.nictrosPos, true, true) if baeloc then baeloc:setMoveLocked(true) - baeloc:registerEvent('sir_baeloc_health') - baeloc:registerEvent('brothers_summon') + baeloc:registerEvent("sir_baeloc_health") + baeloc:registerEvent("brothers_summon") end if nictros then nictros:setMoveLocked(true) - nictros:registerEvent('sir_nictros_health') - nictros:registerEvent('brothers_summon') + nictros:registerEvent("sir_nictros_health") + nictros:registerEvent("brothers_summon") end addEvent(brothers_play, 4 * 1000) @@ -72,7 +72,7 @@ function baeloc_fight.onUse(player, item, fromPosition, target, toPosition, isHo playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT) playerTile:setStorageValue(config.timer, os.time() + 20 * 3600) playerTile:setStorageValue(config.room, os.time() + 30 * 60) - playerTile:say('You have 30 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.', TALKTYPE_MONSTER_SAY, false, playerTile) + playerTile:say("You have 30 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.", TALKTYPE_MONSTER_SAY, false, playerTile) end end diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_custodian_door.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_custodian_door.lua index e87dd9d9b2a..79cf805dd56 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_custodian_door.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_custodian_door.lua @@ -1,20 +1,20 @@ local custodian_door = Action() function custodian_door.onUse(player, item, isHotkey) - if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.GaffirKilled) < 1 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The power of Gaffir won't let you pass this door!") - return true - end + if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.GaffirKilled) < 1 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The power of Gaffir won't let you pass this door!") + return true + end - local pos = player:getPosition() + local pos = player:getPosition() - if pos.x == 33365 then - player:teleportTo(Position(pos.x + 2, pos.y, pos.z)) - elseif pos.x == 33367 then - player:teleportTo(Position(pos.x - 2, pos.y, pos.z)) - end + if pos.x == 33365 then + player:teleportTo(Position(pos.x + 2, pos.y, pos.z)) + elseif pos.x == 33367 then + player:teleportTo(Position(pos.x - 2, pos.y, pos.z)) + end - return true + return true end custodian_door:aid(36569) diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_dark_remains.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_dark_remains.lua index 03605b21041..2580a209fba 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_dark_remains.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_dark_remains.lua @@ -1,8 +1,8 @@ local voc_table = { - [31203] = {voc = 4}, - [31204] = {voc = 3}, - [31205] = {voc = 2}, - [31206] = {voc = 1} + [31203] = { voc = 4 }, + [31204] = { voc = 3 }, + [31205] = { voc = 2 }, + [31206] = { voc = 1 }, } local dark_remains = Action() @@ -14,14 +14,14 @@ function dark_remains.onUse(player, item, fromPosition, target, toPosition, isHo return false end - if target:getName():lower() == 'count vlarkorth' then + if target:getName():lower() == "count vlarkorth" then item:remove(1) target:setStorageValue(3, target:getStorageValue(3) - 1) - target:say('The magic shield of protection is weakened!') + target:say("The magic shield of protection is weakened!") toPosition:sendMagicEffect(CONST_ME_HOLYAREA) end - return true + return true end dark_remains:id(31203, 31204, 31205, 31206) diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua index fbb83b93fc1..551aad55c29 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua @@ -1,7 +1,7 @@ local config = { centerRoom = Position(33456, 31472, 13), - newPosition = Position(33456, 31478, 13), - exitPos = Position(32344, 32168, 12), + newPosition = Position(33456, 31478, 13), + exitPos = Position(32344, 32168, 12), x = 10, y = 10, timer = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.Timer, @@ -17,10 +17,10 @@ duke_water:setArea(createCombatArea(AREA_CIRCLE3X3)) function onTargetTile(cid, pos) local tile = Tile(pos) - local target = tile:getTopCreature() + local target = tile:getTopCreature() if tile then - if target and target:isPlayer() and target:getOutfit().lookType == 49 then - doTargetCombatHealth(0, target, COMBAT_ICEDAMAGE, -1500, -2000) + if target and target:isPlayer() and target:getOutfit().lookType == 49 then + doTargetCombatHealth(0, target, COMBAT_ICEDAMAGE, -1500, -2000) end end end @@ -33,10 +33,10 @@ duke_fire:setArea(createCombatArea(AREA_CIRCLE3X3)) function onTargetTile(cid, pos) local tile = Tile(pos) - local target = tile:getTopCreature() + local target = tile:getTopCreature() if tile then - if target and target:isPlayer() and target:getOutfit().lookType == 286 then - doTargetCombatHealth(0, target, COMBAT_FIREDAMAGE, -1500, -2000) + if target and target:isPlayer() and target:getOutfit().lookType == 286 then + doTargetCombatHealth(0, target, COMBAT_FIREDAMAGE, -1500, -2000) end end end @@ -49,12 +49,12 @@ local function hitArea(creature) if player then if player:getStorageValue(config.transformCD) <= os.time() then if player:getOutfit().lookType == 49 then - local var = {type = 1, number = creature} + local var = { type = 1, number = creature } duke_fire:execute(player, var) player:setStorageValue(config.transformCD, os.time() + 3) addEvent(hitArea, 3 * 1000, creature) elseif player:getOutfit().lookType == 286 then - local var = {type = 1, number = creature} + local var = { type = 1, number = creature } duke_water:execute(player, var) player:setStorageValue(config.transformCD, os.time() + 3) addEvent(hitArea, 3 * 1000, creature) @@ -67,13 +67,13 @@ end local function transformPlayers(id) local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) - local form = {49, 286} - local boss = Creature('Duke Krule') + local form = { 49, 286 } + local boss = Creature("Duke Krule") if boss and boss:getStorageValue(1) == id then if #spectators > 0 then for _, player in pairs(spectators) do - doSetCreatureOutfit(player, {lookType = form[math.random(#form)]}, 30 * 1000) + doSetCreatureOutfit(player, { lookType = form[math.random(#form)] }, 30 * 1000) addEvent(hitArea, 3 * 1000, player:getId()) end addEvent(transformPlayers, 36 * 1000, id) @@ -87,14 +87,14 @@ local duke_fight = Action() function duke_fight.onUse(player, item, fromPosition, target, toPosition, isHotkey) if not player:doCheckBossRoom("Duke Krule", config.fromPos, config.toPos) then - player:sendCancelMessage('The room is already in use. Please wait.') + player:sendCancelMessage("The room is already in use. Please wait.") return true end local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) if player:getPosition() ~= Position(33455, 31493, 13) then - player:sendCancelMessage('Sorry, not possible.') + player:sendCancelMessage("Sorry, not possible.") return true end @@ -103,7 +103,7 @@ function duke_fight.onUse(player, item, fromPosition, target, toPosition, isHotk return true end - local boss = Game.createMonster('Duke Krule', config.centerRoom, true, true) + local boss = Game.createMonster("Duke Krule", config.centerRoom, true, true) local id = os.time() boss:setStorageValue(1, id) addEvent(transformPlayers, 30 * 1000, id) @@ -116,7 +116,7 @@ function duke_fight.onUse(player, item, fromPosition, target, toPosition, isHotk playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT) playerTile:setStorageValue(config.timer, os.time() + 20 * 3600) playerTile:setStorageValue(config.room, os.time() + 30 * 60) - playerTile:say('You have 30 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.', TALKTYPE_MONSTER_SAY, false, playerTile) + playerTile:say("You have 30 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.", TALKTYPE_MONSTER_SAY, false, playerTile) end end diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_grave_sanctify.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_grave_sanctify.lua index 2da0f57928b..d0526ba9050 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_grave_sanctify.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_grave_sanctify.lua @@ -1,70 +1,70 @@ local config = { - [1] = { - pos = Position(32644, 32394, 8), - stor = Storage.Quest.U12_20.GraveDanger.Graves.DarkCathedral, - msg = "This grave now been sanctified and is safe!" - }, - [2] = { - pos = Position(32542, 31846, 6), - stor = Storage.Quest.U12_20.GraveDanger.Graves.FemorHills, - msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here." - }, - [3] = { - pos = Position(33376, 32806, 8), - stor = Storage.Quest.U12_20.GraveDanger.Graves.Ankrahmun, - msg = "This grave now been sanctified and is safe!" - }, - [4] = { - pos = Position(32959, 31534, 7), - stor = Storage.Quest.U12_20.GraveDanger.Graves.Vengoth, - msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here." - }, - [5] = { - pos = Position(32776, 31817, 8), - stor = Storage.Quest.U12_20.GraveDanger.Graves.Orclands, - msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here." - }, - [6] = { - pos = Position(32012, 31558, 7), - stor = Storage.Quest.U12_20.GraveDanger.Graves.IceIslands, - msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here." - }, - [7] = { - pos = Position(33813, 31624, 9), - stor = Storage.Quest.U12_20.GraveDanger.Graves.Kilmaresh, - msg = "This grave now been sanctified and is safe!" - } + [1] = { + pos = Position(32644, 32394, 8), + stor = Storage.Quest.U12_20.GraveDanger.Graves.DarkCathedral, + msg = "This grave now been sanctified and is safe!", + }, + [2] = { + pos = Position(32542, 31846, 6), + stor = Storage.Quest.U12_20.GraveDanger.Graves.FemorHills, + msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here.", + }, + [3] = { + pos = Position(33376, 32806, 8), + stor = Storage.Quest.U12_20.GraveDanger.Graves.Ankrahmun, + msg = "This grave now been sanctified and is safe!", + }, + [4] = { + pos = Position(32959, 31534, 7), + stor = Storage.Quest.U12_20.GraveDanger.Graves.Vengoth, + msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here.", + }, + [5] = { + pos = Position(32776, 31817, 8), + stor = Storage.Quest.U12_20.GraveDanger.Graves.Orclands, + msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here.", + }, + [6] = { + pos = Position(32012, 31558, 7), + stor = Storage.Quest.U12_20.GraveDanger.Graves.IceIslands, + msg = "This grave is already defiled and the lich knight has left! There is nothing you can do here.", + }, + [7] = { + pos = Position(33813, 31624, 9), + stor = Storage.Quest.U12_20.GraveDanger.Graves.Kilmaresh, + msg = "This grave now been sanctified and is safe!", + }, } local function getGrave(pos) - for i = 1, #config do - if pos == config[i].pos then - return i - end - end + for i = 1, #config do + if pos == config[i].pos then + return i + end + end - return true + return true end local grave_sanctify = Action() function grave_sanctify.onUse(player, item, fromPosition, itemEx, toPosition) - local thing = config[getGrave(itemEx:getPosition())] + local thing = config[getGrave(itemEx:getPosition())] - if not thing then - return true - end + if not thing then + return true + end - if player:getStorageValue(thing.stor) < 1 then - player:setStorageValue(thing.stor, 1) - itemEx:getPosition():sendMagicEffect(CONST_ME_HOLYAREA) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, thing.msg) - player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Graves.Progress, player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Graves.Progress) + 1) - else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, thing.msg) - end + if player:getStorageValue(thing.stor) < 1 then + player:setStorageValue(thing.stor, 1) + itemEx:getPosition():sendMagicEffect(CONST_ME_HOLYAREA) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, thing.msg) + player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Graves.Progress, player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Graves.Progress) + 1) + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, thing.msg) + end - return true + return true end grave_sanctify:id(31612) diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_king_zelos.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_king_zelos.lua index 85bb3006bf2..f1c571de7f8 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_king_zelos.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_king_zelos.lua @@ -1,30 +1,30 @@ local config = { centerRoom = Position(33443, 31545, 13), - newPosition = Position(33436, 31572, 13), - exitPos = Position(32172, 31917, 8), + newPosition = Position(33436, 31572, 13), + exitPos = Position(32172, 31917, 8), x = 30, y = 30, summons = { { - name = 'Rewar The Bloody', - pos = Position(33463, 31562, 13) + name = "Rewar The Bloody", + pos = Position(33463, 31562, 13), }, { - name = 'The Red Knight', - pos = Position(33423, 31562, 13) + name = "The Red Knight", + pos = Position(33423, 31562, 13), }, { - name = 'Magnor Mournbringer', - pos = Position(33463, 31529, 13) + name = "Magnor Mournbringer", + pos = Position(33463, 31529, 13), }, { - name = 'Nargol the Impaler', - pos = Position(33423, 31529, 13) + name = "Nargol the Impaler", + pos = Position(33423, 31529, 13), }, { - name = 'King Zelos', - pos = Position(33443, 31545, 13) - } + name = "King Zelos", + pos = Position(33443, 31545, 13), + }, }, timer = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Timer, room = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Room, @@ -36,14 +36,14 @@ local king_zelos = Action() function king_zelos.onUse(player, item, fromPosition, target, toPosition, isHotkey) if not player:doCheckBossRoom("King Zelos", config.fromPos, config.toPos) then - player:sendCancelMessage('The room is already in use. Please wait.') + player:sendCancelMessage("The room is already in use. Please wait.") return true end local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) if player:getPosition() ~= Position(33485, 31546, 13) then - player:sendCancelMessage('Sorry, not possible.') + player:sendCancelMessage("Sorry, not possible.") return true end @@ -65,7 +65,7 @@ function king_zelos.onUse(player, item, fromPosition, target, toPosition, isHotk playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT) playerTile:setStorageValue(config.timer, os.time() + 20 * 3600) playerTile:setStorageValue(config.room, os.time() + 24 * 60) - playerTile:say('You have 24 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.', TALKTYPE_MONSTER_SAY, false, playerTile) + playerTile:say("You have 24 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.", TALKTYPE_MONSTER_SAY, false, playerTile) end end end diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_vlarkorth_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_vlarkorth_fight.lua index c589c9ae692..86711ac8382 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_vlarkorth_fight.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_vlarkorth_fight.lua @@ -22,4 +22,3 @@ local config = { local lever = BossLever(config) lever:aid(14557) lever:register() - diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/actions_scarlett.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/actions_scarlett.lua index 4495173c2f5..94c1c333a53 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/actions_scarlett.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/cobra_bastion/actions_scarlett.lua @@ -74,9 +74,9 @@ local graveScarlettAid = Action() function graveScarlettAid.onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.GaffirKilled) ~= 1 and player:getStorageValue(Storage.Quest.U12_20.GraveDanger.CustodianKilled) ~= 1 and player:getStorageValue(Storage.Quest.U12_20.GraveDanger.QuaidKilled) ~= 1 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are not allowed to use this yet.") - return true - end + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are not allowed to use this yet.") + return true + end if table.contains(transformTo, item.itemid) then local pilar = transformTo[item.itemid] diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_baeloc_nictros_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_baeloc_nictros_fight.lua index 7bd34a7cf26..2bebddca492 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_baeloc_nictros_fight.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_baeloc_nictros_fight.lua @@ -1,7 +1,7 @@ local config = { centerRoom = Position(33424, 31439, 13), - newPosition = Position(33425, 31431, 13), - exitPos = Position(33290, 32474, 9), + newPosition = Position(33425, 31431, 13), + exitPos = Position(33290, 32474, 9), x = 12, y = 12, baelocPos = Position(33422, 31428, 13), @@ -9,10 +9,10 @@ local config = { timer = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Timer, room = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Room, fromPos = Position(33418, 31434, 13), - toPos = Position(33431, 31445, 13) + toPos = Position(33431, 31445, 13), } -local brothers_summon = CreatureEvent('brothers_summon') +local brothers_summon = CreatureEvent("brothers_summon") function brothers_summon.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) local chance = math.random(1, 100) @@ -21,17 +21,17 @@ function brothers_summon.onHealthChange(creature, attacker, primaryDamage, prima if chance >= 90 then if tile:isWalkable(false, false, false, true, false) then - local summon = creature:getName():lower() == 'sir nictros' and 'Squire Of Nictros' or 'Retainer Of Baeloc' + local summon = creature:getName():lower() == "sir nictros" and "Squire Of Nictros" or "Retainer Of Baeloc" Game.createMonster(summon, position, false, true) end end - return primaryDamage, primaryType, -secondaryDamage, secondaryType + return primaryDamage, primaryType, -secondaryDamage, secondaryType end brothers_summon:register() -local sir_nictros_health = CreatureEvent('sir_nictros_health') +local sir_nictros_health = CreatureEvent("sir_nictros_health") function sir_nictros_health.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) local players = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) @@ -52,7 +52,7 @@ function sir_nictros_health.onHealthChange(creature, attacker, primaryDamage, pr local health = creature:getMaxHealth() * 0.60 local brother_diff = (creature:getHealth() / creature:getMaxHealth()) * 100 - local brother = Creature('Sir Baeloc') + local brother = Creature("Sir Baeloc") if brother then if brother_diff < 55 then @@ -69,19 +69,19 @@ function sir_nictros_health.onHealthChange(creature, attacker, primaryDamage, pr creature:say("Now it's your chance for entertaiment, dear brother!") creature:teleportTo(config.nictrosPos) creature:setMoveLocked(true) - local baeloc = Creature('Sir Baeloc') + local baeloc = Creature("Sir Baeloc") if baeloc then baeloc:teleportTo(Position(33424, 31436, 13)) baeloc:setMoveLocked(false) end end - return primaryDamage, primaryType, -secondaryDamage, secondaryType + return primaryDamage, primaryType, -secondaryDamage, secondaryType end sir_nictros_health:register() -local sir_baeloc_health = CreatureEvent('sir_baeloc_health') +local sir_baeloc_health = CreatureEvent("sir_baeloc_health") function sir_baeloc_health.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) if primaryType == COMBAT_HEALING then @@ -90,7 +90,7 @@ function sir_baeloc_health.onHealthChange(creature, attacker, primaryDamage, pri local health = creature:getMaxHealth() * 0.60 local brother_diff = (creature:getHealth() / creature:getMaxHealth()) * 100 - local brother = Creature('Sir Nictros') + local brother = Creature("Sir Nictros") if brother then if brother_diff < 55 then @@ -106,14 +106,14 @@ function sir_baeloc_health.onHealthChange(creature, attacker, primaryDamage, pri if creature:getStorageValue(2) < 1 and creature:getStorageValue(1) >= health then creature:setStorageValue(2, 1) creature:say("Join me in battle my brother. Let's share the fun!") - local nictros = Creature('Sir Nictros') + local nictros = Creature("Sir Nictros") if nictros then nictros:teleportTo(Position(33426, 31438, 13)) nictros:setMoveLocked(false) end end - return primaryDamage, primaryType, -secondaryDamage, secondaryType + return primaryDamage, primaryType, -secondaryDamage, secondaryType end -sir_baeloc_health:register() \ No newline at end of file +sir_baeloc_health:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_boss_kill.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_boss_kill.lua index a307986ce34..f6bf30d50a8 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_boss_kill.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_boss_kill.lua @@ -1,54 +1,54 @@ local config = { - ['gaffir'] = { - stor = Storage.Quest.U12_20.GraveDanger.GaffirKilled + ["gaffir"] = { + stor = Storage.Quest.U12_20.GraveDanger.GaffirKilled, }, - ['custodian'] = { - stor = Storage.Quest.U12_20.GraveDanger.CustodianKilled + ["custodian"] = { + stor = Storage.Quest.U12_20.GraveDanger.CustodianKilled, }, - ['guard captain quaid'] = { - stor = Storage.Quest.U12_20.GraveDanger.QuaidKilled + ["guard captain quaid"] = { + stor = Storage.Quest.U12_20.GraveDanger.QuaidKilled, }, - ['scarlett etzel'] = { - stor = Storage.Quest.U12_20.GraveDanger.ScarlettKilled + ["scarlett etzel"] = { + stor = Storage.Quest.U12_20.GraveDanger.ScarlettKilled, }, - ['earl osam'] = { + ["earl osam"] = { stor = Storage.Quest.U12_20.GraveDanger.Bosses.EarlOsam.Killed, extra = { stor = Storage.Quest.U12_20.GraveDanger.Graves.Cormaya, - value = 1 - } + value = 1, + }, }, - ['count vlarkorth'] = { + ["count vlarkorth"] = { stor = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorth.Killed, extra = { stor = Storage.Quest.U12_20.GraveDanger.Graves.Edron, - value = 1 - } + value = 1, + }, }, - ['sir baeloc'] = { + ["sir baeloc"] = { stor = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Killed, extra = { stor = Storage.Quest.U12_20.GraveDanger.Graves.Darashia, - value = 1 - } + value = 1, + }, }, - ['duke krule'] = { + ["duke krule"] = { stor = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.Killed, extra = { stor = Storage.Quest.U12_20.GraveDanger.Graves.Thais, - value = 1 - } + value = 1, + }, }, - ['lord azaram'] = { + ["lord azaram"] = { stor = Storage.Quest.U12_20.GraveDanger.Bosses.LordAzaram.Killed, extra = { stor = Storage.Quest.U12_20.GraveDanger.Graves.Ghostlands, - value = 1 - } + value = 1, + }, + }, + ["king zelos"] = { + stor = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Killed, }, - ['king zelos'] = { - stor = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Killed - } } local grave_danger_death = CreatureEvent("grave_danger_death") @@ -66,7 +66,7 @@ function grave_danger_death.onDeath(creature, corpse, killer, mostDamageKiller) if player and player:getStorageValue(bossConfig.stor) < 1 then player:setStorageValue(bossConfig.stor, 1) - if creature:getName():lower() == 'scarlett etzel' then + if creature:getName():lower() == "scarlett etzel" then player:addAchievement("A Study in Scarlett") end diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_count_vlarkorth_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_count_vlarkorth_fight.lua index 9eab1fd9137..d6f15d08cb0 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_count_vlarkorth_fight.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_count_vlarkorth_fight.lua @@ -5,18 +5,18 @@ local config = { x = 10, y = 10, summons = { - [1] = {summon = 'Dark Sorcerer'}, - [2] = {summon = 'Dark Druid'}, - [3] = {summon = 'Dark Paladin'}, - [4] = {summon = 'Dark Knight'} + [1] = { summon = "Dark Sorcerer" }, + [2] = { summon = "Dark Druid" }, + [3] = { summon = "Dark Paladin" }, + [4] = { summon = "Dark Knight" }, }, timer = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorth.Timer, - room = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorth.Room + room = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorth.Room, } local function summonDarks() local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) - local boss = Creature('Count Vlarkorth') + local boss = Creature("Count Vlarkorth") if not boss then return false end @@ -36,13 +36,13 @@ local function summonDarks() end end end - boss:say('Face your own darkness!') + boss:say("Face your own darkness!") end return true end -local count_vlarkorth_transform = CreatureEvent('count_vlarkorth_transform') +local count_vlarkorth_transform = CreatureEvent("count_vlarkorth_transform") function count_vlarkorth_transform.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) local players = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_earl_osam_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_earl_osam_fight.lua index a4339c920a4..dee6479531c 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_earl_osam_fight.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_earl_osam_fight.lua @@ -12,18 +12,18 @@ local config = { Position(33480, 31438, 13), Position(33488, 31430, 13), Position(33496, 31438, 13), - Position(33488, 31446, 13) - } + Position(33488, 31446, 13), + }, } local function moveSphere() local spectators = Game.getSpectators(config.centerRoom, false, false, config.x, config.x, config.y, config.y) local nextPos = nil - local boss = Creature('Earl Osam') + local boss = Creature("Earl Osam") if boss and boss:getStorageValue(3) > 0 then for _, spheres in pairs(spectators) do - if spheres:isMonster() and spheres:getName():lower() == 'magical sphere' then + if spheres:isMonster() and spheres:getName():lower() == "magical sphere" then local pos = spheres:getPosition() if pos.y == 31438 then @@ -45,7 +45,7 @@ local function moveSphere() if nextTile then local nextCreature = nextTile:getTopCreature() if nextCreature then - if nextPos == config.centerRoom and nextCreature:getName():lower() == 'earl osam' then + if nextPos == config.centerRoom and nextCreature:getName():lower() == "earl osam" then spheres:remove() nextCreature:addHealth(80000) nextCreature:setStorageValue(3, nextCreature:getStorageValue(3) - 1) @@ -72,7 +72,7 @@ local function moveSphere() end local function initMech() - local boss = Creature('Earl Osam') + local boss = Creature("Earl Osam") if boss then local topCenter = Tile(config.centerRoom):getTopCreature() if topCenter and topCenter ~= boss then @@ -83,7 +83,7 @@ local function initMech() boss:setMoveLocked(true) for _, sphereSpot in pairs(config.spheres) do - local sphere = Game.createMonster('Magical Sphere', sphereSpot, false, true) + local sphere = Game.createMonster("Magical Sphere", sphereSpot, false, true) if sphere then boss:setStorageValue(3, math.max(0, boss:getStorageValue(3)) + 1) end @@ -95,7 +95,7 @@ local function initMech() return true end -local earl_osam_transform = CreatureEvent('earl_osam_transform') +local earl_osam_transform = CreatureEvent("earl_osam_transform") function earl_osam_transform.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) local players = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) @@ -119,7 +119,7 @@ function earl_osam_transform.onHealthChange(creature, attacker, primaryDamage, p local tile = Tile(position) if chance >= 95 and tile and tile:isWalkable() then - Game.createMonster('Frozen Soul', position) + Game.createMonster("Frozen Soul", position) end local healthThreshold = creature:getMaxHealth() * 0.15 @@ -149,7 +149,7 @@ earl_osam_transform:register() local sphere_death = CreatureEvent("sphere_death") function sphere_death.onDeath(creature) - local boss = Creature('Earl Osam') + local boss = Creature("Earl Osam") if boss then local currentSphereCount = boss:getStorageValue(3) boss:setStorageValue(3, math.max(0, currentSphereCount - 1)) diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_king_zelos_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_king_zelos_fight.lua index aef490f4a9b..40e9bce49be 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_king_zelos_fight.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_king_zelos_fight.lua @@ -1,30 +1,30 @@ local config = { centerRoom = Position(33443, 31545, 13), - newPosition = Position(33436, 31572, 13), - exitPos = Position(32172, 31917, 8), + newPosition = Position(33436, 31572, 13), + exitPos = Position(32172, 31917, 8), x = 30, y = 30, summons = { { - name = 'Rewar The Bloody', - pos = Position(33463, 31562, 13) + name = "Rewar The Bloody", + pos = Position(33463, 31562, 13), }, { - name = 'The Red Knight', - pos = Position(33423, 31562, 13) + name = "The Red Knight", + pos = Position(33423, 31562, 13), }, { - name = 'Magnor Mournbringer', - pos = Position(33463, 31529, 13) + name = "Magnor Mournbringer", + pos = Position(33463, 31529, 13), }, { - name = 'Nargol the Impaler', - pos = Position(33423, 31529, 13) + name = "Nargol the Impaler", + pos = Position(33423, 31529, 13), }, { - name = 'King Zelos', - pos = Position(33443, 31545, 13) - } + name = "King Zelos", + pos = Position(33443, 31545, 13), + }, }, timer = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Timer, room = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Room, @@ -32,7 +32,7 @@ local config = { toPos = Position(33474, 31574, 13), } -local zelos_damage = CreatureEvent('zelos_damage') +local zelos_damage = CreatureEvent("zelos_damage") function zelos_damage.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) if primaryType ~= COMBAT_HEALING then @@ -47,7 +47,7 @@ function zelos_damage.onHealthChange(creature, attacker, primaryDamage, primaryT end end - return primaryDamage, primaryType, -secondaryDamage, secondaryType + return primaryDamage, primaryType, -secondaryDamage, secondaryType end zelos_damage:register() @@ -55,14 +55,13 @@ zelos_damage:register() local zelos_init = CreatureEvent("zelos_init") function zelos_init.onDeath(creature) - - local targetMonster = creature:getMonster() + local targetMonster = creature:getMonster() if not targetMonster or targetMonster:getMaster() then return true end - local knights = {'Nargol The Impaler', 'Magnor Mournbringer', 'The Red Knight', 'Rewar The Bloody', 'Shard Of Magnor', 'Regenerating Mass'} + local knights = { "Nargol The Impaler", "Magnor Mournbringer", "The Red Knight", "Rewar The Bloody", "Shard Of Magnor", "Regenerating Mass" } for _, knight in pairs(knights) do local boss = Creature(knight) @@ -71,7 +70,7 @@ function zelos_init.onDeath(creature) end end - local zelos = Creature('King Zelos') + local zelos = Creature("King Zelos") if zelos then local eq = os.time() - zelos:getStorageValue(1) @@ -79,7 +78,7 @@ function zelos_init.onDeath(creature) zelos:setStorageValue(1, eq) end - return true + return true end zelos_init:register() @@ -90,11 +89,11 @@ blood_explode:setArea(area) function onTargetTile(cid, pos) local tile = Tile(pos) - local target = tile:getTopCreature() + local target = tile:getTopCreature() if tile then if target and target:getId() ~= cid:getId() then - if target:isMonster() and target:getName():lower() == 'the red knight' or target:isPlayer() then - doTargetCombatHealth(0, target, COMBAT_DROWNDAMAGE, -20000, -25000) + if target:isMonster() and target:getName():lower() == "the red knight" or target:isPlayer() then + doTargetCombatHealth(0, target, COMBAT_DROWNDAMAGE, -20000, -25000) end end end @@ -105,17 +104,17 @@ blood_explode:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") local blood_death = CreatureEvent("blood_death") function blood_death.onDeath(creature) - local targetMonster = creature:getMonster() + local targetMonster = creature:getMonster() if not targetMonster or targetMonster:getMaster() then return true end - local var = {type = 1, number = creature:getId()} + local var = { type = 1, number = creature:getId() } blood_explode:execute(creature, var) - return true + return true end blood_death:register() @@ -123,23 +122,23 @@ blood_death:register() local nargol_death = CreatureEvent("nargol_death") function nargol_death.onDeath(creature) - local targetMonster = creature:getMonster() + local targetMonster = creature:getMonster() if not targetMonster or targetMonster:getMaster() then return true end - Game.createMonster('Regenerating Mass', Position(33423, 31529, 13), false, true) + Game.createMonster("Regenerating Mass", Position(33423, 31529, 13), false, true) addEvent(function() - local mass = Creature('Regenerating Mass') + local mass = Creature("Regenerating Mass") if mass then mass:remove() - Game.createMonster('Nargol The Impaler', Position(33423, 31529, 13), false, true) + Game.createMonster("Nargol The Impaler", Position(33423, 31529, 13), false, true) end end, 30 * 1000) - return true + return true end nargol_death:register() @@ -152,11 +151,11 @@ shard_explode:setArea(area) function onTargetTile(cid, pos) local tile = Tile(pos) - local target = tile:getTopCreature() + local target = tile:getTopCreature() if tile then if target and target:isPlayer() then - doTargetCombatHealth(0, target, COMBAT_LIFEDRAIN, -2000, -2500) + doTargetCombatHealth(0, target, COMBAT_LIFEDRAIN, -2000, -2500) end end end @@ -166,17 +165,17 @@ shard_explode:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") local shard_death = CreatureEvent("shard_death") function shard_death.onDeath(creature) - local targetMonster = creature:getMonster() + local targetMonster = creature:getMonster() if not targetMonster or targetMonster:getMaster() then return true end - local var = {type = 1, number = creature:getId()} + local var = { type = 1, number = creature:getId() } shard_explode:execute(creature, var) - return true + return true end shard_death:register() @@ -184,7 +183,7 @@ shard_death:register() local magnor_death = CreatureEvent("magnor_death") function magnor_death.onDeath(creature) - local targetMonster = creature:getMonster() + local targetMonster = creature:getMonster() if not targetMonster or targetMonster:getMaster() then return true @@ -193,13 +192,13 @@ function magnor_death.onDeath(creature) local id = os.time() for i = 1, 4 do - local shards = Game.createMonster('Shard Of Magnor', creature:getClosestFreePosition(creature:getPosition(), true)) + local shards = Game.createMonster("Shard Of Magnor", creature:getClosestFreePosition(creature:getPosition(), true)) shards:beginSharedLife(id) shards:registerEvent("SharedLife") shards:registerEvent("shard_death") end - return true + return true end magnor_death:register() @@ -207,30 +206,30 @@ magnor_death:register() local fetter_death = CreatureEvent("fetter_death") function fetter_death.onDeath(creature) - local targetMonster = creature:getMonster() + local targetMonster = creature:getMonster() if not targetMonster or targetMonster:getMaster() then return true end - local boss = Creature('Rewar The Bloody') + local boss = Creature("Rewar The Bloody") if boss then boss:setStorageValue(2, boss:getStorageValue(2) - 1) if boss:getStorageValue(2) <= 0 then - boss:setType('Rewar The Bloody') + boss:setType("Rewar The Bloody") end end - return true + return true end fetter_death:register() -local rewar_the_bloody = CreatureEvent('rewar_the_bloody') +local rewar_the_bloody = CreatureEvent("rewar_the_bloody") -rewar_the_bloody:type('healthchange') +rewar_the_bloody:type("healthchange") function rewar_the_bloody.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) if primaryType == COMBAT_HEALING then @@ -250,15 +249,15 @@ function rewar_the_bloody.onHealthChange(creature, attacker, primaryDamage, prim for i = 1, fetters do local position = Position(math.random(fromPos.x, toPos.x), math.random(fromPos.y, toPos.y), fromPos.z) - local fetter = Game.createMonster('Fetter', position, true, true) + local fetter = Game.createMonster("Fetter", position, true, true) if fetter then creature:setStorageValue(2, creature:getStorageValue(2) + 1) end end - creature:setType('Rewar The Bloody Inv') + creature:setType("Rewar The Bloody Inv") end - return primaryDamage, primaryType, -secondaryDamage, secondaryType + return primaryDamage, primaryType, -secondaryDamage, secondaryType end rewar_the_bloody:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_lord_azaram_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_lord_azaram_fight.lua index 705907d4c2e..a06d0fa9702 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_lord_azaram_fight.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_lord_azaram_fight.lua @@ -1,7 +1,7 @@ local config = { centerRoom = Position(33424, 31472, 13), - newPosition = Position(33424, 31478, 13), - exitPos = Position(32190, 31819, 8), + newPosition = Position(33424, 31478, 13), + exitPos = Position(32190, 31819, 8), x = 10, y = 10, timer = Storage.Quest.U12_20.GraveDanger.Bosses.LordAzaram.Timer, @@ -15,20 +15,20 @@ local config = { Position(33427, 31476, 13), }, fromPos = Position(33414, 31463, 13), - toPos = Position(33433, 31481, 13) + toPos = Position(33433, 31481, 13), } local function removeTainted() local spectators = Game.getSpectators(config.centerRoom, false, false, config.x, config.x, config.y, config.y) for _, creature in pairs(spectators) do - if creature:isMonster() and creature:getName():lower() == 'tainted soul splinter' then + if creature:isMonster() and creature:getName():lower() == "tainted soul splinter" then creature:remove() end end return true end -local azaram_health = CreatureEvent('azaram_health') +local azaram_health = CreatureEvent("azaram_health") function azaram_health.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) local players = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) @@ -43,10 +43,14 @@ function azaram_health.onHealthChange(creature, attacker, primaryDamage, primary end end - if not creature then return primaryDamage, primaryType, secondaryDamage, secondaryType end + if not creature then + return primaryDamage, primaryType, secondaryDamage, secondaryType + end local health = creature:getMaxHealth() * 0.10 local damageStorage = creature:getStorageValue(1) - if damageStorage == -1 then creature:setStorageValue(1, 0) end + if damageStorage == -1 then + creature:setStorageValue(1, 0) + end creature:setStorageValue(1, damageStorage + primaryDamage) local stor = creature:getStorageValue(1) @@ -60,7 +64,7 @@ function azaram_health.onHealthChange(creature, attacker, primaryDamage, primary if soul then soul:teleportTo(config.centerRoom) for _, pos in pairs(config.tainted) do - Game.createMonster('Tainted Soul Splinter', pos, true, true) + Game.createMonster("Tainted Soul Splinter", pos, true, true) end end end @@ -69,12 +73,16 @@ end azaram_health:register() -local azaram_summon = CreatureEvent('azaram_summon') +local azaram_summon = CreatureEvent("azaram_summon") function azaram_summon.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) - if not creature then return primaryDamage, primaryType, secondaryDamage, secondaryType end + if not creature then + return primaryDamage, primaryType, secondaryDamage, secondaryType + end local chance = math.random(1, 100) - if chance < 90 then return primaryDamage, primaryType, secondaryDamage, secondaryType end + if chance < 90 then + return primaryDamage, primaryType, secondaryDamage, secondaryType + end local position = Position(math.random(config.fromPos.x, config.toPos.x), math.random(config.fromPos.y, config.toPos.y), config.fromPos.z) local tile = Tile(position) @@ -83,10 +91,10 @@ function azaram_summon.onHealthChange(creature, attacker, primaryDamage, primary if topThing then local newPosition = topThing:getClosestFreePosition(topThing:getPosition(), true) if newPosition then - Game.createMonster('Condensed Sin', newPosition, false, true) + Game.createMonster("Condensed Sin", newPosition, false, true) end else - Game.createMonster('Condensed Sin', position, false, true) + Game.createMonster("Condensed Sin", position, false, true) end end return primaryDamage, primaryType, -secondaryDamage, secondaryType @@ -94,14 +102,18 @@ end azaram_summon:register() -local soul_heal = CreatureEvent('soul_heal') +local soul_heal = CreatureEvent("soul_heal") function soul_heal.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) - if not attacker or not attacker:isPlayer() then return primaryDamage, primaryType, secondaryDamage, secondaryType end + if not attacker or not attacker:isPlayer() then + return primaryDamage, primaryType, secondaryDamage, secondaryType + end if primaryType == COMBAT_HEALING then local health = (creature:getHealth() / creature:getMaxHealth()) * 100 local healStorage = creature:getStorageValue(2) - if healStorage == -1 then creature:setStorageValue(2, 0) end + if healStorage == -1 then + creature:setStorageValue(2, 0) + end if health < 100 and health >= healStorage * 15 then creature:setStorageValue(2, healStorage + 1) @@ -109,7 +121,7 @@ function soul_heal.onHealthChange(creature, attacker, primaryDamage, primaryType creature:teleportTo(config.soulPos) end removeTainted() - local boss = Creature('Lord Azaram') + local boss = Creature("Lord Azaram") if boss and config.centerRoom:isWalkable() then boss:teleportTo(config.centerRoom) end diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_sir_baeloc_health.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_sir_baeloc_health.lua index 14931cdfb57..c7ab5345da2 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_sir_baeloc_health.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/creaturescripts_sir_baeloc_health.lua @@ -1,6 +1,6 @@ -local sir_baeloc_health = CreatureEvent('sir_baeloc_health') +local sir_baeloc_health = CreatureEvent("sir_baeloc_health") -sir_baeloc_health:type('healthchange') +sir_baeloc_health:type("healthchange") function sir_baeloc_health.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) if primaryType == COMBAT_HEALING then @@ -9,7 +9,7 @@ function sir_baeloc_health.onHealthChange(creature, attacker, primaryDamage, pri local health = creature:getMaxHealth() * 0.60 local brother_diff = (creature:getHealth() / creature:getMaxHealth()) * 100 - local brother = Creature('Sir Nictros') + local brother = Creature("Sir Nictros") if brother then if brother_diff < 55 then @@ -25,14 +25,14 @@ function sir_baeloc_health.onHealthChange(creature, attacker, primaryDamage, pri if creature:getStorageValue(2) < 1 and creature:getStorageValue(1) >= health then creature:setStorageValue(2, 1) creature:say("Join me in battle my brother. Let's share the fun!") - local nictros = Creature('Sir Nictros') + local nictros = Creature("Sir Nictros") if nictros then nictros:teleportTo(Position(33426, 31438, 13)) nictros:setMoveLocked(false) end end - return primaryDamage, primaryType, -secondaryDamage, secondaryType + return primaryDamage, primaryType, -secondaryDamage, secondaryType end sir_baeloc_health:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_cobra_mini_bosses.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_cobra_mini_bosses.lua index f80f84fbcc1..ca4ff69d0d0 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_cobra_mini_bosses.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_cobra_mini_bosses.lua @@ -1,32 +1,32 @@ local FireWall = MoveEvent() function FireWall.onStepIn(creature, item, position, fromPosition) - if creature:isMonster() then - return true - end + if creature:isMonster() then + return true + end - if fromPosition.y == 32691 then - if creature:getStorageValue(Storage.Quest.U12_20.GraveDanger.FireWall) >= 1 then - creature:teleportTo(Position(position.x, position.y + 2, position.z)) - else - creature:teleportTo(fromPosition) - end - elseif fromPosition.y == 32693 then - creature:teleportTo(Position(position.x, position.y - 2, position.z)) - elseif fromPosition.x == 33385 then - if creature:getStorageValue(Storage.Quest.U12_20.GraveDanger.CustodianKilled) >= 1 then - creature:setStorageValue(Storage.Quest.U12_20.GraveDanger.FireWall, 1) - creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You pass the fire without taking any damage. It's now or never...") - else - creature:teleportTo(fromPosition) - end - creature:teleportTo(Position(position.x + 2, position.y, position.z)) - elseif fromPosition.x == 33387 then - creature:teleportTo(Position(position.x - 2, position.y, position.z)) - end - creature:getPosition():sendMagicEffect(CONST_ME_HITBYFIRE) + if fromPosition.y == 32691 then + if creature:getStorageValue(Storage.Quest.U12_20.GraveDanger.FireWall) >= 1 then + creature:teleportTo(Position(position.x, position.y + 2, position.z)) + else + creature:teleportTo(fromPosition) + end + elseif fromPosition.y == 32693 then + creature:teleportTo(Position(position.x, position.y - 2, position.z)) + elseif fromPosition.x == 33385 then + if creature:getStorageValue(Storage.Quest.U12_20.GraveDanger.CustodianKilled) >= 1 then + creature:setStorageValue(Storage.Quest.U12_20.GraveDanger.FireWall, 1) + creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You pass the fire without taking any damage. It's now or never...") + else + creature:teleportTo(fromPosition) + end + creature:teleportTo(Position(position.x + 2, position.y, position.z)) + elseif fromPosition.x == 33387 then + creature:teleportTo(Position(position.x - 2, position.y, position.z)) + end + creature:getPosition():sendMagicEffect(CONST_ME_HITBYFIRE) - return true + return true end FireWall:aid(36568) diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_duke_exit_tp.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_duke_exit_tp.lua index 8fbdf2fb0b7..99795e72a17 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_duke_exit_tp.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_duke_exit_tp.lua @@ -1,14 +1,14 @@ local duke_exit_tp = MoveEvent() function duke_exit_tp.onStepIn(creature, item, position, fromPosition) - if not creature:isPlayer() then + if not creature:isPlayer() then return false end - creature:removeCondition(CONDITION_OUTFIT) + creature:removeCondition(CONDITION_OUTFIT) - return true + return true end duke_exit_tp:aid(14561) -duke_exit_tp:register() \ No newline at end of file +duke_exit_tp:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_enter_tps.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_enter_tps.lua index 70874e3e1dd..beda8793ad1 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_enter_tps.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_enter_tps.lua @@ -1,66 +1,66 @@ local portals = { - [14562] = { - boss = 'Lord Azaram', - stor = Storage.Quest.U12_20.GraveDanger.Bosses.LordAzaram.Timer, - newPos = Position(33425, 31499, 13) - }, - [14563] = { - boss = 'Duke Krule', - stor = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.Timer, - newPos = Position(33456, 31499, 13) - }, - [14564] = { - boss = 'Sir Baeloc', - stor = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Timer, - newPos = Position(33428, 31406, 13) - }, - [14565] = { - boss = 'Earl Osam', - stor = Storage.Quest.U12_20.GraveDanger.Bosses.EarlOsam.Timer, - newPos = Position(33519, 31439, 13), - }, - [14566] = { - boss = 'Count Vlarkorth', - stor = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorth.Timer, - newPos = Position(33458, 31406, 13), - }, - [14567] = { - boss = 'King Zelos', - stor = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Timer, - newPos = Position(33491, 31546, 13), - }, + [14562] = { + boss = "Lord Azaram", + stor = Storage.Quest.U12_20.GraveDanger.Bosses.LordAzaram.Timer, + newPos = Position(33425, 31499, 13), + }, + [14563] = { + boss = "Duke Krule", + stor = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.Timer, + newPos = Position(33456, 31499, 13), + }, + [14564] = { + boss = "Sir Baeloc", + stor = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Timer, + newPos = Position(33428, 31406, 13), + }, + [14565] = { + boss = "Earl Osam", + stor = Storage.Quest.U12_20.GraveDanger.Bosses.EarlOsam.Timer, + newPos = Position(33519, 31439, 13), + }, + [14566] = { + boss = "Count Vlarkorth", + stor = Storage.Quest.U12_20.GraveDanger.Bosses.CountVlarkorth.Timer, + newPos = Position(33458, 31406, 13), + }, + [14567] = { + boss = "King Zelos", + stor = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Timer, + newPos = Position(33491, 31546, 13), + }, } function secondsToClock(seconds) - local hours = math.floor(seconds / 3600) - local mins = math.floor((seconds % 3600) / 60) - local secs = seconds % 60 - return string.format("%02d:%02d:%02d", hours, mins, secs) + local hours = math.floor(seconds / 3600) + local mins = math.floor((seconds % 3600) / 60) + local secs = seconds % 60 + return string.format("%02d:%02d:%02d", hours, mins, secs) end local grave_enter = MoveEvent() function grave_enter.onStepIn(creature, item, position, fromPosition) - if creature:isMonster() then - return true - end + if creature:isMonster() then + return true + end - local thing = portals[item.actionid] + local thing = portals[item.actionid] - if not thing then - return true - end + if not thing then + return true + end - if creature:getStorageValue(thing.stor) > os.time() then - local eq = creature:getStorageValue(thing.stor) - os.time() - creature:say('You need to wait '.. secondsToClock(eq) ..' before trying to challenge '.. thing.boss ..' again!', TALKTYPE_MONSTER_SAY, false, creature) - creature:teleportTo(fromPosition) - return true - end + if creature:getStorageValue(thing.stor) > os.time() then + local eq = creature:getStorageValue(thing.stor) - os.time() + creature:say("You need to wait " .. secondsToClock(eq) .. " before trying to challenge " .. thing.boss .. " again!", TALKTYPE_MONSTER_SAY, false, creature) + creature:teleportTo(fromPosition) + return true + end - creature:teleportTo(thing.newPos) + creature:teleportTo(thing.newPos) - return true + return true end grave_enter:aid(14562, 14563, 14564, 14565, 14566, 14567) diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_quaidDen.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_quaidDen.lua index f2ac9fbfc5d..46367a52e90 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_quaidDen.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_quaidDen.lua @@ -1,17 +1,17 @@ local quaidDen = MoveEvent() function quaidDen.onStepIn(creature, item, position, fromPosition) - if creature:isMonster() then - return true - end + if creature:isMonster() then + return true + end - if creature:getStorageValue(Storage.Quest.U12_20.GraveDanger.CustodianKilled) < 1 then - creature:teleportTo(Position(33401, 32658, 3)) - creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "With the power of the dark Custodian still holding away, the fog is keeping you from entering Quaid's den.") - end + if creature:getStorageValue(Storage.Quest.U12_20.GraveDanger.CustodianKilled) < 1 then + creature:teleportTo(Position(33401, 32658, 3)) + creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "With the power of the dark Custodian still holding away, the fog is keeping you from entering Quaid's den.") + end - return true + return true end quaidDen:id(31636) -quaidDen:register() \ No newline at end of file +quaidDen:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_soul_cleanse.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_soul_cleanse.lua index 226a687e94b..5c99dede384 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_soul_cleanse.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_soul_cleanse.lua @@ -1,20 +1,20 @@ local soul_cleanse = MoveEvent() function soul_cleanse.onStepIn(creature, item, position, fromPosition) - if creature:isPlayer() then - return true - end + if creature:isPlayer() then + return true + end - if creature:getName():lower() == "azaram's soul" then + if creature:getName():lower() == "azaram's soul" then local health = (creature:getHealth() / creature:getMaxHealth()) * 100 if health == 100 then - creature:say('The broken Soul absorbs the power of the soul splinter and gains strength!') + creature:say("The broken Soul absorbs the power of the soul splinter and gains strength!") creature:teleportTo(config.soulPos) item:remove() removeTainted() - local boss = Creature('Lord Azaram') + local boss = Creature("Lord Azaram") if boss then boss:teleportTo(config.centerRoom) @@ -22,8 +22,8 @@ function soul_cleanse.onStepIn(creature, item, position, fromPosition) end end - return true + return true end soul_cleanse:id(31160) -soul_cleanse:register() \ No newline at end of file +soul_cleanse:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_zelos_tp.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_zelos_tp.lua index 3cb8d899dfe..75a0412cb60 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/movements_zelos_tp.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/movements_zelos_tp.lua @@ -1,19 +1,19 @@ local zelos_tp = MoveEvent() function zelos_tp.onStepIn(creature, item, position, fromPosition) - if not creature:isPlayer() then + if not creature:isPlayer() then return false end - local knights = Creature('Nargol The Impaler') or Creature('Magnor Mournbringer') or Creature('The Red Knight') or Creature('Rewar The Bloody') or Creature('Shard Of Magnor') or Creature('Regenerating Mass') + local knights = Creature("Nargol The Impaler") or Creature("Magnor Mournbringer") or Creature("The Red Knight") or Creature("Rewar The Bloody") or Creature("Shard Of Magnor") or Creature("Regenerating Mass") - if knights then - creature:teleportTo(fromPosition) - else - creature:teleportTo(Position(33443, 31536, 13)) - end + if knights then + creature:teleportTo(fromPosition) + else + creature:teleportTo(Position(33443, 31536, 13)) + end - return true + return true end zelos_tp:aid(14579) From ffb3afbc4ba1fcc951e2a61b1082639256c33cc8 Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:25:02 -0300 Subject: [PATCH 12/22] Hand of the Inquisition Outfits Quest You need to review the answers, as I couldn't find them on the internet. --- data-otservbr-global/lib/core/storages.lua | 6 +++++- data-otservbr-global/npc/jack_springer.lua | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 05f3a9b655f..bc0aaba5e7c 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -2863,7 +2863,11 @@ Storage = { Questline = 52311, }, }, - HandOfTheInquisitionOutfits = {}, + HandOfTheInquisitionOutfits = { + Outfits = 52312, + Addon1 = 52313, + Addon2 = 52314, + }, Kilmaresh = {}, Orcsoberfest = {}, }, diff --git a/data-otservbr-global/npc/jack_springer.lua b/data-otservbr-global/npc/jack_springer.lua index a5e4c1e08db..663e61c77e7 100644 --- a/data-otservbr-global/npc/jack_springer.lua +++ b/data-otservbr-global/npc/jack_springer.lua @@ -148,13 +148,28 @@ local function creatureSayCallback(npc, creature, type, message) end else if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Bosses.KingZelos.Killed) >= 1 then - if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) < 3 then + if player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) >= 3 and player:getStorageValue(Storage.Quest.U12_20.HandOfTheInquisitionOutfits.Addon2) < 1 and player:removeItem(31737, 1) then + npcHandler:say("Here is your second addon for your efforts!", npc, creature) + player:addOutfit(1243, 2) + player:addOutfit(1244, 2) + player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Stage, 2) + player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Questline, 3) + player:setStorageValue(Storage.Quest.U12_20.HandOfTheInquisitionOutfits.Addon2, 1) + elseif player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) >= 3 and player:getStorageValue(Storage.Quest.U12_20.HandOfTheInquisitionOutfits.Addon1) < 1 and player:removeItem(31738, 1) then + npcHandler:say("Here is your first addon for your efforts!", npc, creature) + player:addOutfit(1243, 1) + player:addOutfit(1244, 1) + player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Stage, 2) + player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Questline, 3) + player:setStorageValue(Storage.Quest.U12_20.HandOfTheInquisitionOutfits.Addon1, 1) + elseif player:getStorageValue(Storage.Quest.U12_20.GraveDanger.Questline) < 3 and player:getStorageValue(Storage.Quest.U12_20.HandOfTheInquisitionOutfits.Outfits) < 1 then npcHandler:say("Incredible! You averted a crisis that would have utterly crippled our defences aganist any other threat that is arising. Let me grant you the honor to be one of the hands of the inquisition alongside with the according outfit as a reward.", npc, creature) player:addOutfit(1243, 0) player:addOutfit(1244, 0) player:addAchievement("Inquisition's Hand") player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Stage, 2) player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Questline, 3) + player:setStorageValue(Storage.Quest.U12_20.HandOfTheInquisitionOutfits.Outfits, 1) else npcHandler:say("Indeed you averted us a great danger! We will ever be greatful to you hand of the inquisition!", npc, creature) end From 4ea316ab8c79168fc3f69ec94032b5d87ece2d43 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 6 Nov 2024 18:26:37 +0000 Subject: [PATCH 13/22] Lua code format - (Stylua) --- data-otservbr-global/npc/jack_springer.lua | 58 +++++++++------------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/data-otservbr-global/npc/jack_springer.lua b/data-otservbr-global/npc/jack_springer.lua index 663e61c77e7..19fe3441291 100644 --- a/data-otservbr-global/npc/jack_springer.lua +++ b/data-otservbr-global/npc/jack_springer.lua @@ -243,18 +243,14 @@ keywordHandler:addKeyword( "To summarise what we know, let me tell you this: The Shiron'Fal is an extremely old organisation. It seeks to accumulate power for some unknown but certainly sinister {goal}.", } } ) -keywordHandler:addKeyword( - { "goal" }, - StdModule.say, - { - npcHandler = npcHandler, - text = { - "For this purpose, the members gather knowledge, artefacts and powerful individuals. The members are formidable at certain fields of expertise. They are cunning and powerful and act with no regard for others, with no remorse or mercy. ...", - "As they are doing this since ages, they must have acquired tremendous powers and knowledge. Their members often operate alone but are usually well funded with the necessary resources. ...", - "Whatever their endgame might be, each of their operations pose a grave danger to the whole world and have to be {stopped}.", - }, - } -) +keywordHandler:addKeyword({ "goal" }, StdModule.say, { + npcHandler = npcHandler, + text = { + "For this purpose, the members gather knowledge, artefacts and powerful individuals. The members are formidable at certain fields of expertise. They are cunning and powerful and act with no regard for others, with no remorse or mercy. ...", + "As they are doing this since ages, they must have acquired tremendous powers and knowledge. Their members often operate alone but are usually well funded with the necessary resources. ...", + "Whatever their endgame might be, each of their operations pose a grave danger to the whole world and have to be {stopped}.", + }, +}) keywordHandler:addKeyword({ "stopped" }, StdModule.say, { npcHandler = npcHandler, text = "Here is where you come into play. We could identify the most recent plot of the Shiron'Fal and already had some {clashes}." }) keywordHandler:addKeyword({ "clashes" }, StdModule.say, { npcHandler = npcHandler, text = "In our efforts to hinder their plot, we achieved mixed results at best. But now things are escalating fast and we have to {hurry}." }) keywordHandler:addKeyword({ "hurry" }, StdModule.say, { npcHandler = npcHandler, text = "Our resources are already stretched thin, so we need your help with the most recent {problem}." }) @@ -267,29 +263,21 @@ keywordHandler:addKeyword({ "lich" }, StdModule.say, { npcHandler = npcHandler, keywordHandler:addKeyword({ "scheme" }, StdModule.say, { npcHandler = npcHandler, text = "We are still working feverishly to uncover their goals but for now more imminent {threats} are at hand." }) keywordHandler:addKeyword({ "threats" }, StdModule.say, { npcHandler = npcHandler, text = "Death cultists of the Shiron'Fal are trying to locate the bodies of fallen knights and raise them in blasphemous {rituals}." }) keywordHandler:addKeyword({ "rituals" }, StdModule.say, { npcHandler = npcHandler, text = "The churches of the gods worked hand in hand to supply us with the means to {purge} the graves of those knights." }) -keywordHandler:addKeyword( - { "purge" }, - StdModule.say, - { - npcHandler = npcHandler, - text = { - "Reaching the graves will not be without danger and if you encounter the death cultists you will have to fight them. Even worse, they might have even succeeded in some cases. ...", - "As a newly risen lich-knight is not able to leave the site of its resurrection for some time, you might have to fight some of them. ...", - "Let us pray that you never come too {late} or else some of the fiends might be able to leave their crypts.", - }, - } -) -keywordHandler:addKeyword( - { "locations" }, - StdModule.say, - { - npcHandler = npcHandler, - text = { - "We have located twelve graves that have to be secured: In the old northern Edron graveyard, in the dark cathedral of the plains of havoc, in the ghostlands, on Cormaya, Somewhere in the Femor Hills, on Vengoth, ...", - "in the graveyard of Darashia, in the old temple north of Thais, at the entrance to the orcland, one is on the southern ice islands, in a mountain on Kilmaresh, one on an island north-east of Ankrahmun.", - }, - } -) +keywordHandler:addKeyword({ "purge" }, StdModule.say, { + npcHandler = npcHandler, + text = { + "Reaching the graves will not be without danger and if you encounter the death cultists you will have to fight them. Even worse, they might have even succeeded in some cases. ...", + "As a newly risen lich-knight is not able to leave the site of its resurrection for some time, you might have to fight some of them. ...", + "Let us pray that you never come too {late} or else some of the fiends might be able to leave their crypts.", + }, +}) +keywordHandler:addKeyword({ "locations" }, StdModule.say, { + npcHandler = npcHandler, + text = { + "We have located twelve graves that have to be secured: In the old northern Edron graveyard, in the dark cathedral of the plains of havoc, in the ghostlands, on Cormaya, Somewhere in the Femor Hills, on Vengoth, ...", + "in the graveyard of Darashia, in the old temple north of Thais, at the entrance to the orcland, one is on the southern ice islands, in a mountain on Kilmaresh, one on an island north-east of Ankrahmun.", + }, +}) npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) From c500a9851898ebcdbe1444a58308a971b78e1193 Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:39:02 -0300 Subject: [PATCH 14/22] Golden Outfits Quest --- data-otservbr-global/lib/core/storages.lua | 4 +--- data-otservbr-global/npc/emperor_kruzak.lua | 16 ++++++++-------- data-otservbr-global/npc/king_tibianus.lua | 16 ++++++++-------- data-otservbr-global/npc/queen_eloise.lua | 16 ++++++++-------- 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index bc0aaba5e7c..cbc4f493748 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -214,8 +214,6 @@ Storage = { -- Until all outfit quests are completed DefaultStart = 50960, Ref = 50961, - -- Golden Outfit - GoldenOutfit = 51015, RoyalCostumeOutfit = 51026, }, TheHuntForTheSeaSerpent = { @@ -2799,7 +2797,7 @@ Storage = { WinterlightSolstice = {}, }, U12_15 = { -- update 12.15.8659 - Reserved Storages 46801 - 46850 - GoldenOutfits = {}, + GoldenOutfits = 46801, }, U12_20 = { -- update 12.20 - Reserved Storages 46851 - 47000 GraveDanger = { diff --git a/data-otservbr-global/npc/emperor_kruzak.lua b/data-otservbr-global/npc/emperor_kruzak.lua index daf0742f615..0b38aa1e956 100644 --- a/data-otservbr-global/npc/emperor_kruzak.lua +++ b/data-otservbr-global/npc/emperor_kruzak.lua @@ -78,7 +78,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 0) -- Inicio do outfit elseif npcHandler:getTopic(playerId) == 3 then -- ARMOR/OUTFIT - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 1 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 1 then if player:getMoney() + player:getBankBalance() >= 500000000 then local inbox = player:getStoreInbox() local inboxItems = inbox:getItems() @@ -92,7 +92,7 @@ local function creatureSayCallback(npc, creature, type, message) player:addOutfit(1211) player:addOutfit(1210) player:getPosition():sendMagicEffect(171) - player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 1) + player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 1) else npcHandler:say("Please make sure you have free slots in your store inbox.", npc, creature) end @@ -106,15 +106,15 @@ local function creatureSayCallback(npc, creature, type, message) -- Fim do outfit -- Inicio do helmet elseif npcHandler:getTopic(playerId) == 4 then - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) == 1 then - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 2 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) == 1 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 2 then if player:getMoney() + player:getBankBalance() >= 250000000 then npcHandler:say("Take this helmet as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:removeMoneyBank(250000000) player:addOutfitAddon(1210, 1) player:addOutfitAddon(1211, 1) player:getPosition():sendMagicEffect(171) - player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 2) + player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 2) npcHandler:setTopic(playerId, 2) else npcHandler:say("You do not have enough money to donate that amount.", npc, creature) @@ -132,15 +132,15 @@ local function creatureSayCallback(npc, creature, type, message) -- Fim do helmet -- Inicio da boots elseif npcHandler:getTopic(playerId) == 5 then - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) == 2 then - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 3 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) == 2 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 3 then if player:getMoney() + player:getBankBalance() >= 250000000 then npcHandler:say("Take this boots as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:removeMoneyBank(250000000) player:addOutfitAddon(1210, 2) player:addOutfitAddon(1211, 2) player:getPosition():sendMagicEffect(171) - player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 3) + player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 3) npcHandler:setTopic(playerId, 2) else npcHandler:say("You do not have enough money to donate that amount.", npc, creature) diff --git a/data-otservbr-global/npc/king_tibianus.lua b/data-otservbr-global/npc/king_tibianus.lua index d9968357fa1..cf966761cc1 100644 --- a/data-otservbr-global/npc/king_tibianus.lua +++ b/data-otservbr-global/npc/king_tibianus.lua @@ -83,7 +83,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 0) -- Inicio do outfit elseif npcHandler:getTopic(playerId) == 3 then -- ARMOR/OUTFIT - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 1 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 1 then if player:getMoney() + player:getBankBalance() >= 500000000 then local inbox = player:getStoreInbox() local inboxItems = inbox:getItems() @@ -97,7 +97,7 @@ local function creatureSayCallback(npc, creature, type, message) player:addOutfit(1211) player:addOutfit(1210) player:getPosition():sendMagicEffect(171) - player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 1) + player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 1) else npcHandler:say("Please make sure you have free slots in your store inbox.", npc, creature) end @@ -111,15 +111,15 @@ local function creatureSayCallback(npc, creature, type, message) -- Fim do outfit -- Inicio do helmet elseif npcHandler:getTopic(playerId) == 4 then - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) == 1 then - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 2 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) == 1 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 2 then if player:getMoney() + player:getBankBalance() >= 250000000 then npcHandler:say("Take this helmet as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:removeMoneyBank(250000000) player:addOutfitAddon(1210, 2) player:addOutfitAddon(1211, 2) player:getPosition():sendMagicEffect(171) - player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 2) + player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 2) npcHandler:setTopic(playerId, 2) else npcHandler:say("You do not have enough money to donate that amount.", npc, creature) @@ -137,15 +137,15 @@ local function creatureSayCallback(npc, creature, type, message) -- Fim do helmet -- Inicio da boots elseif npcHandler:getTopic(playerId) == 5 then - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) == 2 then - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 3 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) == 2 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 3 then if player:getMoney() + player:getBankBalance() >= 250000000 then npcHandler:say("Take this boots as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:removeMoneyBank(250000000) player:addOutfitAddon(1210, 1) player:addOutfitAddon(1211, 1) player:getPosition():sendMagicEffect(171) - player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 3) + player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 3) npcHandler:setTopic(playerId, 2) else npcHandler:say("You do not have enough money to donate that amount.", npc, creature) diff --git a/data-otservbr-global/npc/queen_eloise.lua b/data-otservbr-global/npc/queen_eloise.lua index e4fd566e422..b4ae195bb94 100644 --- a/data-otservbr-global/npc/queen_eloise.lua +++ b/data-otservbr-global/npc/queen_eloise.lua @@ -73,7 +73,7 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 0) -- Inicio do outfit elseif npcHandler:getTopic(playerId) == 3 then -- ARMOR/OUTFIT - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 1 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 1 then if player:getMoney() + player:getBankBalance() >= 500000000 then local inbox = player:getStoreInbox() local inboxItems = inbox:getItems() @@ -87,7 +87,7 @@ local function creatureSayCallback(npc, creature, type, message) player:addOutfit(1211) player:addOutfit(1210) player:getPosition():sendMagicEffect(171) - player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 1) + player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 1) else npcHandler:say("Please make sure you have free slots in your store inbox.", npc, creature) end @@ -101,15 +101,15 @@ local function creatureSayCallback(npc, creature, type, message) -- Fim do outfit -- Inicio do helmet elseif npcHandler:getTopic(playerId) == 4 then - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) == 1 then - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 2 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) == 1 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 2 then if player:getMoney() + player:getBankBalance() >= 250000000 then npcHandler:say("Take this helmet as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:removeMoneyBank(250000000) player:addOutfitAddon(1210, 1) player:addOutfitAddon(1211, 1) player:getPosition():sendMagicEffect(171) - player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 2) + player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 2) npcHandler:setTopic(playerId, 2) else npcHandler:say("You do not have enough money to donate that amount.", npc, creature) @@ -127,15 +127,15 @@ local function creatureSayCallback(npc, creature, type, message) -- Fim do helmet -- Inicio da boots elseif npcHandler:getTopic(playerId) == 5 then - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) == 2 then - if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) < 3 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) == 2 then + if player:getStorageValue(Storage.Quest.U12_15.GoldenOutfits) < 3 then if player:getMoney() + player:getBankBalance() >= 250000000 then npcHandler:say("Take this boots as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:removeMoneyBank(250000000) player:addOutfitAddon(1210, 2) player:addOutfitAddon(1211, 2) player:getPosition():sendMagicEffect(171) - player:setStorageValue(Storage.OutfitQuest.GoldenOutfit, 3) + player:setStorageValue(Storage.Quest.U12_15.GoldenOutfits, 3) npcHandler:setTopic(playerId, 2) else npcHandler:say("You do not have enough money to donate that amount.", npc, creature) From eead3e83be9192114d7871992f037428b4237dff Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Thu, 7 Nov 2024 19:10:16 -0300 Subject: [PATCH 15/22] Kilmaresh Quest - Fafnar's Wrath and Organization Storages --- data-otservbr-global/lib/core/storages.lua | 131 +++++++-------- .../kilmaresh/urmahlullu_the_immaculate.lua | 7 +- data-otservbr-global/npc/alyxo.lua | 86 +++++----- .../npc/ambassador_of_rathleton.lua | 42 +++-- data-otservbr-global/npc/eshaya.lua | 153 +++++++++--------- data-otservbr-global/npc/faloriel.lua | 53 +++--- data-otservbr-global/npc/gail.lua | 8 +- data-otservbr-global/npc/kallimae.lua | 48 +++--- data-otservbr-global/npc/moe.lua | 104 ++++++------ data-otservbr-global/npc/narsai.lua | 28 ++-- data-otservbr-global/npc/saideh.lua | 12 +- data-otservbr-global/npc/shimun.lua | 28 ++-- data-otservbr-global/npc/tefrit.lua | 28 ++-- data-otservbr-global/npc/the_empress.lua | 41 ++--- data-otservbr-global/npc/the_librarian.lua | 37 +++-- data-otservbr-global/npc/yonan.lua | 28 ++-- .../scripts/actions/other/gems.lua | 7 +- .../1-fafnars-wrath/2-ambassadors-treason.lua | 18 +-- .../1-fafnars-wrath/6-mind-travel.lua | 8 +- .../1-fafnars-wrath/7-four-masks.lua | 13 +- .../8-blessing-the-statues.lua | 6 +- .../quests/kilmaresh/actions_augerfun.lua | 2 +- .../quests/kilmaresh/actions_basin.lua | 4 +- .../quests/kilmaresh/actions_books.lua | 14 -- .../quests/kilmaresh/actions_cagekey.lua | 4 +- .../quests/kilmaresh/actions_coruja.lua | 4 +- .../kilmaresh/actions_glasshoneyfun.lua | 2 +- .../scripts/quests/kilmaresh/actions_lyre.lua | 4 +- .../quests/kilmaresh/actions_peeler.lua | 4 +- .../quests/kilmaresh/actions_peelerfun.lua | 2 +- .../kilmaresh/actions_pickenchanted.lua | 2 +- .../quests/kilmaresh/actions_sangra.lua | 4 +- .../quests/kilmaresh/actions_scissors.lua | 4 +- .../quests/kilmaresh/actions_scissorsfun.lua | 76 ++++----- .../quests/kilmaresh/actions_tortoise.lua | 4 +- .../quests/kilmaresh/actions_tumulo.lua | 4 +- .../quests/kilmaresh/actions_tumuloerro.lua | 4 +- .../actions_urmahlullu_the_immaculate.lua} | 0 .../kilmaresh/creaturescripts_bragrumol.lua | 4 +- .../kilmaresh/creaturescripts_fafnar.lua | 4 +- .../kilmaresh/creaturescripts_mozradek.lua | 4 +- .../creaturescripts_urmahlullu_change.lua} | 0 .../kilmaresh/creaturescripts_xogixath.lua | 4 +- .../startup/tables/door_quest.lua | 52 +++--- data-otservbr-global/startup/tables/item.lua | 13 ++ data-otservbr-global/startup/tables/tile.lua | 3 +- 46 files changed, 559 insertions(+), 549 deletions(-) delete mode 100644 data-otservbr-global/scripts/quests/kilmaresh/actions_books.lua rename data-otservbr-global/scripts/{actions/bosses_levers/urmahlullu_the_immaculate.lua => quests/kilmaresh/actions_urmahlullu_the_immaculate.lua} (100%) rename data-otservbr-global/scripts/{creaturescripts/monster/urmahlullu_change.lua => quests/kilmaresh/creaturescripts_urmahlullu_change.lua} (100%) diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index cbc4f493748..84209c26eec 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -127,66 +127,6 @@ Storage = { ThirdStage = 50003, Crystal = 50004, }, - Kilmaresh = { - -- Reserved storage from 50015 - 50049 - Questline = 50015, - First = { - Title = 50016, - }, - Second = { - Investigating = 50017, - }, - Third = { - Recovering = 50018, - }, - Fourth = { - Moe = 50019, - MoeTimer = 50020, - }, - Fifth = { - Memories = 50021, - MemoriesShards = 50022, - }, - Sixth = { - Favor = 50023, - FourMasks = 50024, - BlessedStatues = 50025, - }, - Set = { - Ritual = 50026, - }, - Eighth = { - Yonan = 50027, - Narsai = 50028, - Shimun = 50029, - Tefrit = 50030, - }, - Nine = { - Owl = 50031, - }, - Tem = { - Bleeds = 50032, - }, - Eleven = { - Basin = 50033, - }, - Twelve = { - Boss = 50034, - Bragrumol = 50035, - Mozradek = 50036, - Xogixath = 50037, - }, - Thirteen = { - Fafnar = 50038, - Lyre = 50039, - Presente = 50040, - }, - Fourteen = { - Remains = 50041, - }, - AccessDoor = 50043, - CatacombDoors = 55047, - }, DeeplingBosses = { -- Reserved storage from 50075 - 50079 Jaul = 50075, @@ -2858,15 +2798,76 @@ Storage = { }, }, CobraBastion = { - Questline = 52311, + Questline = 46891, }, }, HandOfTheInquisitionOutfits = { - Outfits = 52312, - Addon1 = 52313, - Addon2 = 52314, + Outfits = 46892, + Addon1 = 46893, + Addon2 = 46894, + }, + KilmareshQuest = { + Questline = 46895, + First = { + Title = 46896, + }, + Second = { + Investigating = 46897, + }, + Third = { + Recovering = 46898, + }, + Fourth = { + Moe = 46899, + MoeTimer = 46890, + }, + Fifth = { + Memories = 46891, + MemoriesShards = 46892, + }, + Sixth = { + Favor = 46893, + FourMasks = 46894, + BlessedStatues = 46895, + IvoryMask = 46896, + MirrorMask = 46897, + SilverMask = 46898, + GryphonMask = 46899, + }, + Set = { + Ritual = 46900, + }, + Eighth = { + Yonan = 46901, + Narsai = 46903, + Shimun = 46904, + Tefrit = 46905, + }, + Nine = { + Owl = 46906, + }, + Tem = { + Bleeds = 46907, + }, + Eleven = { + Basin = 46908, + }, + Twelve = { + Boss = 46909, + Bragrumol = 46910, + Mozradek = 46911, + Xogixath = 46912, + }, + Thirteen = { + Fafnar = 46913, + Lyre = 46914, + Presente = 46915, + }, + Fourteen = { + Remains = 46916, + }, + AccessDoor = 46917, }, - Kilmaresh = {}, Orcsoberfest = {}, }, U12_30 = { -- update 12.30 - Reserved Storages 47001 - 47200 diff --git a/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_immaculate.lua b/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_immaculate.lua index 8f41b9c404b..2cefeec88e2 100644 --- a/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_immaculate.lua +++ b/data-otservbr-global/monster/quests/kilmaresh/urmahlullu_the_immaculate.lua @@ -20,6 +20,10 @@ monster.corpse = 0 monster.speed = 95 monster.manaCost = 0 +monster.events = { + "UrmahlulluChanges", +} + monster.changeTarget = { interval = 4000, chance = 10, @@ -57,9 +61,6 @@ monster.flags = { canWalkOnPoison = true, } -monster.events = { - "UrmahlulluChanges", -} monster.light = { level = 0, color = 0, diff --git a/data-otservbr-global/npc/alyxo.lua b/data-otservbr-global/npc/alyxo.lua index f8fd752ba48..35a8f759252 100644 --- a/data-otservbr-global/npc/alyxo.lua +++ b/data-otservbr-global/npc/alyxo.lua @@ -49,15 +49,15 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) - elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then + elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.First.Mission, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5) npcHandler:setTopic(playerId, 20) end return true @@ -73,17 +73,17 @@ local function creatureSayCallback(npc, creature, type, message) -- Mission 3 Steal The Ambassador Ring if MsgContains(message, "mission") then - if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 1 then npcHandler:setTopic(playerId, 1) end npcHandler:say({ "Could you kill 3 bosses for me?" }, npc, creature) -- needs review, this is not the speech of the global elseif MsgContains(message, "yes") then - if npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 1 then + if npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 1 then npcHandler:say({ "Come back as soon as you kill all 3 bosses." }, npc, creature) -- needs review, this is not the speech of the global - player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 2) - player:setStorageValue(Storage.Kilmaresh.Twelve.Bragrumol, 1) - player:setStorageValue(Storage.Kilmaresh.Twelve.Mozradek, 1) - player:setStorageValue(Storage.Kilmaresh.Twelve.Xogixath, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Bragrumol, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Mozradek, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Xogixath, 1) npcHandler:setTopic(playerId, 2) else npcHandler:say({ "Sorry, you do not have access." }, npc, creature) @@ -91,80 +91,80 @@ local function creatureSayCallback(npc, creature, type, message) end end -- Mission 3 Steal The Ambassador Ring - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 2 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 2 then npcHandler:say({ "Did you manage to face all 3 bosses?" }, npc, creature) -- needs review, this is not the speech of the global npcHandler:setTopic(playerId, 3) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Twelve.Bragrumol) == 2 and player:getStorageValue(Storage.Kilmaresh.Twelve.Mozradek) == 2 and player:getStorageValue(Storage.Kilmaresh.Twelve.Xogixath) == 2 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Bragrumol) == 2 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Mozradek) == 2 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Xogixath) == 2 then npcHandler:say({ "I am very satisfied." }, npc, creature) -- needs review, this is not the speech of the global - player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 3) npcHandler:setTopic(playerId, 4) else npcHandler:say({ "Sorry." }, npc, creature) npcHandler:setTopic(playerId, 0) end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then - if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then npcHandler:say({ "Could you help me with some more work?" }, npc, creature) -- needs review, this is not the speech of the global npcHandler:setTopic(playerId, 5) npcHandler:setTopic(playerId, 5) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then - if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then npcHandler:say({ "Kill 300 members of the Fafnar cult, help me find Ivory Lyre and help me find an animal to stone." }, npc, creature) -- needs review, this is not the speech of the global - player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 4) - player:setStorageValue(Storage.Kilmaresh.Thirteen.Fafnar, 1) - player:setStorageValue(Storage.Kilmaresh.Thirteen.Lyre, 1) - player:setStorageValue(Storage.Kilmaresh.Thirteen.Presente, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 4) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente, 1) npcHandler:setTopic(playerId, 6) else npcHandler:say({ "Sorry." }, npc, creature) npcHandler:setTopic(playerId, 0) end end - if MsgContains(message, "report") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then + if MsgContains(message, "report") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then npcHandler:say({ "Have you finished killing the 300 members of Fafnar's cult?" }, npc, creature) -- needs review, this is not the speech of the global npcHandler:setTopic(playerId, 7) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 7 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 7 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then npcHandler:say({ "Thanks. You killed the 300 members of the Fafnar cult." }, npc, creature) -- needs review, this is not the speech of the global - player:setStorageValue(Storage.Kilmaresh.Thirteen.Fafnar, 301) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar, 301) npcHandler:setTopic(playerId, 8) else npcHandler:say({ "Sorry." }, npc, creature) npcHandler:setTopic(playerId, 0) end end - if MsgContains(message, "report") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 then + if MsgContains(message, "report") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 then npcHandler:say({ "Did you manage to find Lyre?" }, npc, creature) -- needs review, this is not the speech of the global npcHandler:setTopic(playerId, 9) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 9 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 and player:getItemById(31447, 1) then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 9 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 and player:getItemById(31447, 1) then player:removeItem(31447, 1) npcHandler:say({ "Thanks. I was looking for Lyre for a long time." }, npc, creature) -- needs review, this is not the speech of the global - player:setStorageValue(Storage.Kilmaresh.Thirteen.Lyre, 4) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 4) else npcHandler:say({ "Sorry." }, npc, creature) npcHandler:setTopic(playerId, 0) end end - if MsgContains(message, "report") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 then + if MsgContains(message, "report") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 then npcHandler:say({ "Did you manage to find Small Tortoise?" }, npc, creature) -- needs review, this is not the speech of the global npcHandler:setTopic(playerId, 11) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 11 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 and player:getItemById(31445, 1) then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 11 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 and player:getItemById(31445, 1) then player:removeItem(31445, 1) npcHandler:say({ "Thanks. I was looking for Small Tortoise." }, npc, creature) -- needs review, this is not the speech of the global - player:setStorageValue(Storage.Kilmaresh.Thirteen.Presente, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente, 3) npcHandler:setTopic(playerId, 12) else npcHandler:say({ "Sorry." }, npc, creature) @@ -187,17 +187,17 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 0) end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then npcHandler:say({ "Did you finish the 3 jobs I gave you?" }, npc, creature) -- needs review, this is not the speech of the global npcHandler:setTopic(playerId, 13) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 13 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 13 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then player:addAchievement("Sculptor Apprentice", 'Congratulations! You earned the achievement "Sculptor Apprentice".') player:addItem(31574, 1) npcHandler:say({ "Congratulations, you have completed the 3 jobs I gave you." }, npc, creature) -- needs review, this is not the speech of the global - player:setStorageValue(Storage.Kilmaresh.Fourteen.Remains, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains, 1) npcHandler:setTopic(playerId, 14) else npcHandler:say({ "Sorry." }, npc, creature) diff --git a/data-otservbr-global/npc/ambassador_of_rathleton.lua b/data-otservbr-global/npc/ambassador_of_rathleton.lua index fa120c51941..0e9e1953d30 100644 --- a/data-otservbr-global/npc/ambassador_of_rathleton.lua +++ b/data-otservbr-global/npc/ambassador_of_rathleton.lua @@ -58,23 +58,31 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end -keywordHandler:addKeyword({ "present" }, StdModule.say, { - npcHandler = npcHandler, - text = "This is a very beautiful ring. Thank you for this generous present!", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Third.Recovering) == 2 and player:getItemById(31263, true) -end, function(player) - player:removeItem(31263, 1) - player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 1) - player:setStorageValue(Storage.Kilmaresh.Third.Recovering, 3) -end) - -keywordHandler:addKeyword({ "present" }, StdModule.say, { - npcHandler = npcHandler, - text = "Didn't you bring my gift?", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Third.Recovering) == 2 -end) +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "present") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering) == 2 then + if player:getItemById(31263, true) then + npcHandler:say("This is a very beautiful ring. Thank you for this generous present!", npc, creature) + player:removeItem(31263, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering, 3) + else + npcHandler:say("Didn't you bring my gift?", npc, creature) + end + else + npcHandler:say("I don't need a present right now. Thank you.", npc, creature) + end + end + + return true +end + npcHandler:setMessage(MESSAGE_GREET, "Greetings, friend.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") diff --git a/data-otservbr-global/npc/eshaya.lua b/data-otservbr-global/npc/eshaya.lua index 20f39c50dd8..b5038680f99 100644 --- a/data-otservbr-global/npc/eshaya.lua +++ b/data-otservbr-global/npc/eshaya.lua @@ -58,86 +58,78 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end --- First - -local firstMission = keywordHandler:addKeyword({ "mission" }, StdModule.say, { - npcHandler = npcHandler, - text = "I'm willing to admit that I need help. And the help of someone who is not from {Issavi} at that. But the task could be dangerous and you would become embroiled in the politics and court intrigues of {Kilmaresh}. Will you help me anyhow?", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == -1 -end, function(player) - player:setStorageValue(Storage.Kilmaresh.First.Title, 1) -end) - -firstMission:addChildKeyword( - { "yes" }, - StdModule.say, - { - npcHandler = npcHandler, - text = { - "You are a noble soul! So listen: for many decades, over a century actually, the city of {Rathleton} had an Ambassador here in {Issavi}. ...", - "Kilmaresh and Oramond maintain important commercial relations, and for this reason Rathleton has an envoy here. In the past, the relations were good but now ...", - "I hate to admit it but I heavily suspect that the current Ambassador is a traitor and consorts with the forbidden cult of Fafnar. I have several hints and Kallimae saw it in one of her visions ...", - "But the vision of a Kilmareshian seer is no proof they will ever accept in Rathleton. And without proof we can't banish the Ambassador, this would cause major diplomatic fallout or even a war. I can't risk that. ...", - "I need unequivocal evidence that the Ambassador conspires with the Fafnar cultists. Please go to his residence in the eastern part of the city and search for letters, journals ... anything that could prove him guilty.", - }, - }, - nil, - function(player) - player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 1) - end -) - --- Second - -keywordHandler:addKeyword({ "mission" }, StdModule.say, { - npcHandler = npcHandler, - text = { - "It seems that he destroyed every visible evidence of his treason. That's very unfortunate and I see only one remaining possibility: You need to see the {Ambassador}'s memories. ...", - "But there is only one way to achieve this: You have to find a Ring of {Secret Thoughts}. Legend has it that a monstrous being called {Urmahlullu} has such a ring. If the myths are true you can find this creature in a subterranean tomb south of Issavi.", - }, -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 5 -end, function(player) - player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 6) - player:setStorageValue(Storage.Kilmaresh.Third.Recovering, 1) -end) - -keywordHandler:addKeyword({ "mission" }, StdModule.say, { - npcHandler = npcHandler, - text = "You haven't investigated all the evidence.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Second.Investigating) >= 0 and player:getStorageValue(Storage.Kilmaresh.Second.Investigating) < 5 -end) - --- Third - -keywordHandler:addKeyword({ "ring" }, StdModule.say, { - npcHandler = npcHandler, - text = "You found the Ring of {Secret Thoughts}! Well done! Now give it to the {Ambassador} as a present. He's a peacock and will accept such a precious gift for sure. As soon as he wears it, his memories will be stored in the ring.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Third.Recovering) == 1 and player:getItemById(31263, true) -end, function(player) - player:setStorageValue(Storage.Kilmaresh.Third.Recovering, 2) -end) - -keywordHandler:addKeyword({ "ring" }, StdModule.say, { - npcHandler = npcHandler, - text = "You don't have the ring I need.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Third.Recovering) == 1 -end) - --- Fifth - -keywordHandler:addKeyword({ "mission" }, StdModule.say, { - npcHandler = npcHandler, - text = "This is the proof we need! Very well done! You have to report this to our {Empress}. She will grant you an audience now.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fifth.Memories) == 4 -end, function(player) - player:setStorageValue(Storage.Kilmaresh.Fifth.Memories, 5) -end) +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "mission") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) < 1 then + npcHandler:say("Very good. But now you need the Ring of Secret Thoughts back in order to extract the Ambassador's memories.", npc, creature) + npcHandler:setTopic(playerId, 2) + elseif player:getItemById(31263, true) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering) < 2 then + npcHandler:say("You found the Ring of Secret Thoughts! Well done! Now give it to the Ambassador as a present. He's a peacock and will accept such a precious gift for sure. As soon as he wears it, his memories will be stored in the ring.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering, 2) + npcHandler:setTopic(playerId, 0) + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Title) < 1 then + npcHandler:say("I'm willing to admit that I need help. And the help of someone who is not from {Issavi} at that. But the task could be dangerous and you would become embroiled in the politics and court intrigues of {Kilmaresh}. Will you help me anyhow?", npc, creature) + npcHandler:setTopic(playerId, 1) + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 5 then + npcHandler:say({ + "It seems that he destroyed every visible evidence of his treason. That's very unfortunate and I see only one remaining possibility: You need to see the {Ambassador}'s memories. ...", + "But there is only one way to achieve this: You have to find a Ring of {Secret Thoughts}. Legend has it that a monstrous being called {Urmahlullu} has such a ring. If the myths are true you can find this creature in a subterranean tomb south of Issavi.", + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 6) + npcHandler:setTopic(playerId, 0) + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) == 4 then + npcHandler:say("This is the proof we need! Very well done! You have to report this to our {Empress}. She will grant you an audience now.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, 5) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("You haven't completed your mission yet. Keep searching!", npc, creature) + npcHandler:setTopic(playerId, 0) + end + elseif MsgContains(message, "yes") then + if npcHandler:getTopic(playerId) == 1 then + npcHandler:say({ + "You are a noble soul! So listen: for many decades, over a century actually, the city of {Rathleton} had an Ambassador here in {Issavi}. ...", + "{Kilmaresh} and {Oramond} maintain important commercial relations, and for this reason Rathleton has an envoy here. In the past, the relations were good but now ..", + "I hate to admit it but I heavily suspect that the current {Ambassador} is a traitor and consorts with the forbidden cult of {Fafnar}. I have several hints and {Kallimae} saw it in one of her visions. ...", + "But the vision of a Kilmareshian seer is no proof they will ever accept in Rathleton. And without proof we can't banish the {Ambassador}, this would cause major diplomatic fallout or even a war. I can't risk that. ...", + "I need unequivocal evidence that the {Ambassador} conspires with the Fafnar cultists. Please go to his residence in the eastern part of the city and search for letters, journals ... anything that could prove him guilty.", + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Title, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 1) + npcHandler:setTopic(playerId, 0) + end + elseif MsgContains(message, "theft") then + if npcHandler:getTopic(playerId) == 3 then + npcHandler:say("I don't know whether you are experienced in such things. If not, you could ask somebody who is. But I'm not sure where in Issavi you should look to hire a thief.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 1) + npcHandler:setTopic(playerId, 0) + end + elseif MsgContains(message, "ring of secret thoughts back") then + if npcHandler:getTopic(playerId) == 2 then + npcHandler:say("I guess claiming back a present would be a bit suspicious. You'll have to find another way. I resent thinking about theft but sometimes, desperate times call for desperate measures.", npc, creature) + npcHandler:setTopic(playerId, 3) + end + elseif MsgContains(message, "ring") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 4 then + npcHandler:say("You got the ring back? Very well done! Now search for the memories that will prove the Ambassador's treason. I don't know much about ancient artefacts but you could ask the librarian in the palace. I'm sure he knows something helpful.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 5) + npcHandler:setTopic(playerId, 0) + end + elseif MsgContains(message, "empress") then + npcHandler:say("Good luck on your audience with the Empress. May Kilmaresh prosper.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + + return true +end + npcHandler:setMessage(MESSAGE_GREET, "Suon's and Bastesh's blessing, dear guest!") npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") @@ -145,6 +137,7 @@ npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") npcHandler:setCallback(CALLBACK_SET_INTERACTION, onAddFocus) npcHandler:setCallback(CALLBACK_REMOVE_INTERACTION, onReleaseFocus) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) + npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) -- npcType registering the npcConfig table diff --git a/data-otservbr-global/npc/faloriel.lua b/data-otservbr-global/npc/faloriel.lua index 7d259c72ea3..edf7fc68a0a 100644 --- a/data-otservbr-global/npc/faloriel.lua +++ b/data-otservbr-global/npc/faloriel.lua @@ -57,29 +57,36 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end -local potionTalk = keywordHandler:addKeyword({ "ring" }, StdModule.say, { - npcHandler = npcHandler, - text = "So, the Librarian sent you. Well, yes, I have a vial of the hallucinogen you need. I'll give it to you for 1000 gold. Do you agree?", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fifth.Memories) == 1 -end) - -potionTalk:addChildKeyword({ "yes" }, StdModule.say, { - npcHandler = npcHandler, - text = "Great. Here, take it.", -}, function(player) - return player:getMoney() + player:getBankBalance() >= 1000 -end, function(player) - player:removeMoneyBank(1000) - player:addItem(31350, 1) -- flask of hallucinogen -end) - -potionTalk:addChildKeyword({ "yes" }, StdModule.say, { - npcHandler = npcHandler, - text = "You do not have enough money.", -}, function(player) - return player:getMoney() + player:getBankBalance() < 1000 -end) +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "ring") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) == 1 then + npcHandler:say("So, the Librarian sent you. Well, yes, I have a vial of the hallucinogen you need. I'll give it to you for 1000 gold. Do you agree?", npc, creature) + npcHandler:setTopic(playerId, 1) + else + npcHandler:say("I don't have anything to offer you regarding a ring.", npc, creature) + end + + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 then + if player:getMoney() + player:getBankBalance() >= 1000 then + npcHandler:say("Great. Here, take it.", npc, creature) + player:removeMoneyBank(1000) + player:addItem(31350, 1) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("You do not have enough money.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + end + + return true +end npcHandler:setMessage(MESSAGE_GREET, "Greetings, dear guest and welcome to my {potion} shop.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") diff --git a/data-otservbr-global/npc/gail.lua b/data-otservbr-global/npc/gail.lua index e0b6062908b..13cf1eff716 100644 --- a/data-otservbr-global/npc/gail.lua +++ b/data-otservbr-global/npc/gail.lua @@ -54,15 +54,15 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) - elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then + elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.First.Mission, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5) npcHandler:setTopic(playerId, 20) end return true diff --git a/data-otservbr-global/npc/kallimae.lua b/data-otservbr-global/npc/kallimae.lua index 61be4cb34a9..b85062c760d 100644 --- a/data-otservbr-global/npc/kallimae.lua +++ b/data-otservbr-global/npc/kallimae.lua @@ -54,15 +54,15 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) - elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then + elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.First.Mission, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5) npcHandler:setTopic(playerId, 20) end return true @@ -76,55 +76,55 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) == 11 then - if player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) == 11 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) == 11 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) == 11 then npcHandler:say({ "Some residents are in need of ingredients to finish a ritual. You can help?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) npcHandler:setTopic(playerId, 1) end elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) == 11 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) == 11 then npcHandler:say({ "Search for the NPCs Yonan, Narsai, Shimun and Tefrit." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Set.Ritual, 1) - player:setStorageValue(Storage.Kilmaresh.Set.Yonan, 1) - player:setStorageValue(Storage.Kilmaresh.Set.Narsai, 1) - player:setStorageValue(Storage.Kilmaresh.Set.Shimun, 1) - player:setStorageValue(Storage.Kilmaresh.Set.Tefrit, 1) - player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, 12) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Yonan, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Narsai, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Shimun, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Tefrit, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, 12) npcHandler:setTopic(playerId, 2) npcHandler:setTopic(playerId, 2) else npcHandler:say({ "Sorry." }, npc, creature) -- It needs to be revised, it's not the same as the global end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 3 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 3 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3 then npcHandler:say({ "Did you help some residents with ingredients?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 3) npcHandler:setTopic(playerId, 3) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 3 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 3 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3 then npcHandler:say({ "Thanks. I need you to go to 4 places indicated by Goddess Bastesh." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Nine.Owl, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Nine.Owl, 1) npcHandler:setTopic(playerId, 4) npcHandler:setTopic(playerId, 4) else npcHandler:say({ "Sorry." }, npc, creature) -- It needs to be revised, it's not the same as the global end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eleven.Basin) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eleven.Basin) == 1 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin) == 1 then npcHandler:say({ "Did you check all the points and bring the Symbol of Sun and Sea?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 5) npcHandler:setTopic(playerId, 5) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Kilmaresh.Eleven.Basin) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eleven.Basin) == 1 and player:getItemById(31431, 1) then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin) == 1 and player:getItemById(31431, 1) then player:addItem(31572, 1) npcHandler:say({ "Thanks. Here is your reward." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 1) - player:setStorageValue(Storage.Kilmaresh.Eleven.Basin, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin, 2) npcHandler:setTopic(playerId, 6) npcHandler:setTopic(playerId, 6) else diff --git a/data-otservbr-global/npc/moe.lua b/data-otservbr-global/npc/moe.lua index c96c03da8af..bf6672b8035 100644 --- a/data-otservbr-global/npc/moe.lua +++ b/data-otservbr-global/npc/moe.lua @@ -58,57 +58,59 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end -keywordHandler:addKeyword({ "help" }, StdModule.say, { - npcHandler = npcHandler, - text = "I guess I could do this, yes. But I have to impose a condition. If you bring me ten sphinx {feathers} I will steal this ring for you.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 1 -end, function(player) - player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 2) -end) - -keywordHandler:addKeyword({ "feathers" }, StdModule.say, { - npcHandler = npcHandler, - text = "Thank you! They look so pretty, I'm very pleased. Agreed, now I will steal the ring from the Ambassador of Rathleton. Just be patient, I have to wait for a good moment.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 2 and player:getItemById(31437, 10) -end, function(player) - player:removeItem(31437, 10) - player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 3) - player:setStorageValue(Storage.Kilmaresh.Fourth.MoeTimer, os.time() + 60 * 60) -- one hour -end) - -keywordHandler:addKeyword({ "feathers" }, StdModule.say, { - npcHandler = npcHandler, - text = "If you bring me ten sphinx {feathers} I will steal this ring for you.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 2 and not player:getItemById(31437, 10) -end) - -keywordHandler:addKeyword({ "ring" }, StdModule.say, { - npcHandler = npcHandler, - text = "You're arriving at the right time. I have the ring you asked for. It was not too difficult. I just had to wait until the Ambassador left his residence and then I climbed in through the window. Here it is.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 3 and player:getStorageValue(Storage.Kilmaresh.Fourth.MoeTimer) - os.time() <= 0 -end, function(player) - player:addItem(31306, 1) - player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 4) -end) - -keywordHandler:addKeyword({ "ring" }, StdModule.say, { - npcHandler = npcHandler, - text = "I will steal it, promised. I'm just waiting for a good moment.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 3 and player:getStorageValue(Storage.Kilmaresh.Fourth.MoeTimer) - os.time() > 0 -end) -keywordHandler:addKeyword({ "lyre" }, StdModule.say, { - npcHandler = npcHandler, - text = "I'm upset to accuse myself, the lyre is hidden in a tomb west of Kilmaresh.", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 1 -end, function(player) - player:setStorageValue(Storage.Kilmaresh.Thirteen.Lyre, 2) -end) +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "help") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 1 then + npcHandler:say("I guess I could do this, yes. But I have to impose a condition. If you bring me ten sphinx feathers I will steal this ring for you.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 2) + end + elseif MsgContains(message, "feathers") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 2 then + if player:getItemById(31437, 10) then + npcHandler:say("Thank you! They look so pretty, I'm very pleased. Agreed, now I will steal the ring from the Ambassador of Rathleton. Just be patient, I have to wait for a good moment.", npc, creature) + player:removeItem(31437, 10) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.MoeTimer, os.time() + 60 * 60) + else + npcHandler:say("If you bring me ten sphinx feathers, I will steal this ring for you.", npc, creature) + end + else + npcHandler:say("You already delivered the feathers. Be patient while I steal the ring.", npc, creature) + end + elseif MsgContains(message, "ring") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 3 then + local timeLeft = player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.MoeTimer) - os.time() + if timeLeft <= 0 then + npcHandler:say("You're arriving at the right time. I have the ring you asked for. It was not too difficult. I just had to wait until the Ambassador left his residence and then I climbed in through the window. Here it is.", npc, creature) + player:addItem(31306, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 4) + else + npcHandler:say("I will steal it, promised. I'm just waiting for a good moment.", npc, creature) + end + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 1 then + npcHandler:say("I guess I could do this, yes. But I have to impose a condition. If you bring me ten sphinx feathers I will steal this ring for you.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 2) + else + npcHandler:say("You don't need this ring anymore.", npc, creature) + end + elseif MsgContains(message, "lyre") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 1 then + npcHandler:say("I'm upset to accuse myself, the lyre is hidden in a tomb west of Kilmaresh.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 2) + else + npcHandler:say("You already know about the lyre's location.", npc, creature) + end + end + + return true +end npcHandler:setMessage(MESSAGE_GREET, "Greetings, traveller. It seems, you're a {guest} here, just like me.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") diff --git a/data-otservbr-global/npc/narsai.lua b/data-otservbr-global/npc/narsai.lua index 42e375956f3..aed1a3e3576 100644 --- a/data-otservbr-global/npc/narsai.lua +++ b/data-otservbr-global/npc/narsai.lua @@ -54,15 +54,15 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) - elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then + elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.First.Mission, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5) npcHandler:setTopic(playerId, 20) end return true @@ -76,36 +76,36 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 1 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 1 then npcHandler:say({ "Could you help me do a ritual?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) npcHandler:setTopic(playerId, 1) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 1 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 1 then player:addItem(31714, 1) npcHandler:say({ "Here is the list of ingredients that are missing to complete the ritual. " }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Narsai, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai, 2) npcHandler:setTopic(playerId, 2) npcHandler:setTopic(playerId, 2) else npcHandler:say({ "Sorry." }, npc, creature) -- It needs to be revised, it's not the same as the global end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then npcHandler:say({ "Did you bring all the materials I informed you about?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 3) npcHandler:setTopic(playerId, 3) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 and player:getItemById(31335, 10) and player:getItemById(10279, 2) and player:getItemById(31332, 5) then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 and player:getItemById(31335, 10) and player:getItemById(10279, 2) and player:getItemById(31332, 5) then player:removeItem(31335, 10) player:removeItem(10279, 2) player:removeItem(31332, 5) npcHandler:say({ "Thank you this stage of the ritual is complete." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Narsai, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai, 3) npcHandler:setTopic(playerId, 4) npcHandler:setTopic(playerId, 4) else diff --git a/data-otservbr-global/npc/saideh.lua b/data-otservbr-global/npc/saideh.lua index 7b28c754a59..855a0616ff9 100644 --- a/data-otservbr-global/npc/saideh.lua +++ b/data-otservbr-global/npc/saideh.lua @@ -49,7 +49,7 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "Hello, my name is Saideh. Once this was the entry to the crypt of our heroes. One of the graves belongs to our beloved hero Dayyan. Nowadays it is not a good idea to visit this place.") npcHandler:setTopic(playerId, 1) end @@ -64,16 +64,16 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 1 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 1 then npcHandler:say({ " I would like you to visit the grave of our beloved hero Dayyan. His remains have to be reburied, because a horde of ogres controls this place. Do you want to start this holy mission?" }, npc, creature) npcHandler:setTopic(playerId, 1) npcHandler:setTopic(playerId, 1) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 1 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 1 then npcHandler:say({ "Well, I appreciate that. Good luck!" }, npc, creature) - player:setStorageValue(Storage.Kilmaresh.Fourteen.Remains, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains, 2) npcHandler:setTopic(playerId, 2) npcHandler:setTopic(playerId, 2) else diff --git a/data-otservbr-global/npc/shimun.lua b/data-otservbr-global/npc/shimun.lua index c3607feccd8..3d0281d98a4 100644 --- a/data-otservbr-global/npc/shimun.lua +++ b/data-otservbr-global/npc/shimun.lua @@ -54,15 +54,15 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) - elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then + elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.First.Mission, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5) npcHandler:setTopic(playerId, 20) end return true @@ -76,36 +76,36 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 1 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 1 then npcHandler:say({ "Could you help me do a ritual?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) npcHandler:setTopic(playerId, 1) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 1 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 1 then player:addItem(31715, 1) npcHandler:say({ "Here is the list with the missing ingredients to complete the ritual." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Shimun, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun, 2) npcHandler:setTopic(playerId, 2) npcHandler:setTopic(playerId, 2) else npcHandler:say({ "Sorry." }, npc, creature) -- It needs to be revised, it's not the same as the global end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 2 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 2 then npcHandler:say({ "Did you bring all the materials I informed you about? " }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 3) npcHandler:setTopic(playerId, 3) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Shimun) == 2 and player:getItemById(31340, 1) and player:getItemById(31336, 12) and player:getItemById(2874, 5) then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 2 and player:getItemById(31340, 1) and player:getItemById(31336, 12) and player:getItemById(2874, 5) then player:removeItem(31340, 1) player:removeItem(31336, 12) player:removeItem(2874, 5) npcHandler:say({ "Thank you this stage of the ritual is complete." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Shimun, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun, 3) npcHandler:setTopic(playerId, 4) npcHandler:setTopic(playerId, 4) else diff --git a/data-otservbr-global/npc/tefrit.lua b/data-otservbr-global/npc/tefrit.lua index 8ef2c821bd6..d30248282b8 100644 --- a/data-otservbr-global/npc/tefrit.lua +++ b/data-otservbr-global/npc/tefrit.lua @@ -54,15 +54,15 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) - elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then + elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.First.Mission, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5) npcHandler:setTopic(playerId, 20) end return true @@ -76,37 +76,37 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 1 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 1 then npcHandler:say({ "Could you help me do a ritual?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) npcHandler:setTopic(playerId, 1) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 1 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 1 then player:addItem(31716, 1) npcHandler:say({ "Here is the list with the missing ingredients to complete the ritual." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Tefrit, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, 2) npcHandler:setTopic(playerId, 2) npcHandler:setTopic(playerId, 2) else npcHandler:say({ "Sorry." }, npc, creature) end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 then npcHandler:say({ "Did you bring all the materials I informed you about?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 3) npcHandler:setTopic(playerId, 3) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 and player:getItemById(31329, 20) and player:getItemById(31339, 25) and player:getItemById(31330, 15) then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 and player:getItemById(31329, 20) and player:getItemById(31339, 25) and player:getItemById(31330, 15) then player:removeItem(10272, 5) player:removeItem(31329, 20) player:removeItem(31339, 25) player:removeItem(31330, 15) npcHandler:say({ "Thank you this stage of the ritual is complete." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Tefrit, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, 3) npcHandler:setTopic(playerId, 4) npcHandler:setTopic(playerId, 4) else diff --git a/data-otservbr-global/npc/the_empress.lua b/data-otservbr-global/npc/the_empress.lua index fdc475b546e..7b6fb8fd2b6 100644 --- a/data-otservbr-global/npc/the_empress.lua +++ b/data-otservbr-global/npc/the_empress.lua @@ -54,7 +54,14 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.Fifth.Memories) == 4 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) == 10 then + npcHandler:setMessage(MESSAGE_GREET, { + "You succeeded! Issavi is safe again. Take this as a sign of our grace and gratitude, brave mortal being. It is a precious relic from earlier times. More precisely, it is one of four parts of the relic called the Regalia of Suon. ...", + "Should you ever find the other three parts, a talented jeweler might be able to combine them and recreate the regalia for you.", + }) + player:addItem(31573, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, 11) + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) == 5 then player:addItem(31414, 1) npcHandler:setMessage(MESSAGE_GREET, { "I see. There is enough and adequate evidence that the Ambassador of Rathleton is indeed an arch traitor. So, Eshaya was right. Well done, mortal being. You have proven your loyalty and bravery, therefore allow me to ask you one more favour. ...", @@ -63,43 +70,23 @@ local function greetCallback(npc, creature) "Well, they want to activate five Fafnar statues which they have already enchanted. They are hidden in the catacombs underneath the city. Please go down and search for the statues. ...", "Then use this sceptre to bless them in the name of Suon and Bastesh. This will destroy the disastrous enchantment and Issavi will be safe again.", }) - player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, 1) - player:setStorageValue(Storage.Kilmaresh.Sixth.FourMasks, 0) - player:setStorageValue(Storage.Kilmaresh.Sixth.BlessedStatues, 0) - player:setStorageValue(Storage.Kilmaresh.Fifth.Memories, 6) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks, 0) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.BlessedStatues, 0) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, 6) else npcHandler:setMessage(MESSAGE_GREET, "Greetings.") end + return true end -local masksDialogue = keywordHandler:addKeyword({ "mission" }, StdModule.say, { - npcHandler = npcHandler, - text = "Did you take all the masks and enchant all the statues?", -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) == 10 -end) - -masksDialogue:addChildKeyword( - { "yes" }, - StdModule.say, - { - npcHandler = npcHandler, - text = "Thank you.", - }, - nil, - function(player) - player:addItem(31573, 1) -- Sun Medal - player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, 11) - end -) - npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") npcHandler:setCallback(CALLBACK_SET_INTERACTION, onAddFocus) npcHandler:setCallback(CALLBACK_REMOVE_INTERACTION, onReleaseFocus) npcHandler:setCallback(CALLBACK_GREET, greetCallback) -npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) + npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true) -- npcType registering the npcConfig table diff --git a/data-otservbr-global/npc/the_librarian.lua b/data-otservbr-global/npc/the_librarian.lua index 45b786342de..192c4c79393 100644 --- a/data-otservbr-global/npc/the_librarian.lua +++ b/data-otservbr-global/npc/the_librarian.lua @@ -58,19 +58,30 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end -keywordHandler:addKeyword({ "ring" }, StdModule.say, { - npcHandler = npcHandler, - text = { - "To extract memories from the ring, you have to enter a trance-like state with the help of a hallucinogen. Like this you can see all memories that are stored in the ring. Ask {Faloriel} for a respective potion. ...", - "Drink it while wearing the ring in the Temple of {Bastesh} and say: 'Sa Katesa Tarsani na'. If the legends are true you will be able to take memories with you in the form of memory shards.", - }, -}, function(player) - return player:getStorageValue(Storage.Kilmaresh.Fourth.Moe) == 4 -end, function(player) - player:setStorageValue(Storage.Kilmaresh.Fifth.Memories, 1) - player:setStorageValue(Storage.Kilmaresh.Fifth.MemoriesShards, 0) - player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 5) -end) +local function creatureSayCallback(npc, creature, type, message) + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "ring") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 5 then + npcHandler:say({ + "To extract memories from the ring, you have to enter a trance-like state with the help of a hallucinogen. Like this you can see all memories that are stored in the ring. Ask Faloriel for a respective potion. ...", + "Drink it while wearing the ring in the Temple of Bastesh and say: 'Sa Katesa Tarsani na'. If the legends are true you will be able to take memories with you in the form of memory shards.", + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.MemoriesShards, 0) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 6) + else + npcHandler:say("You don't need any instructions about the ring right now.", npc, creature) + end + end + + return true +end npcHandler:setMessage(MESSAGE_GREET, "Greetings, dear guest. If you are interested in paperware such as books or scrolls, ask me for a trade.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") diff --git a/data-otservbr-global/npc/yonan.lua b/data-otservbr-global/npc/yonan.lua index 1b85ecc7c17..c31fe9b93da 100644 --- a/data-otservbr-global/npc/yonan.lua +++ b/data-otservbr-global/npc/yonan.lua @@ -133,15 +133,15 @@ local function greetCallback(npc, creature) local player = Player(creature) local playerId = player:getId() - if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) - elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then + elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 15) - elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.First.Mission, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5) npcHandler:setTopic(playerId, 20) end return true @@ -155,37 +155,37 @@ local function creatureSayCallback(npc, creature, type, message) return false end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 1 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 1 then npcHandler:say({ "Could you help me do a ritual?" }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 1) npcHandler:setTopic(playerId, 1) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 1 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 1 then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 1 then player:addItem(31717, 1) -- Yonans List player:addItem(31613, 1) -- Pick Enchanted npcHandler:say({ "Here is the list with the missing ingredients to complete the ritual." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Yonan, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan, 2) npcHandler:setTopic(playerId, 2) npcHandler:setTopic(playerId, 2) else npcHandler:say({ "Sorry." }, npc, creature) end end - if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 then + if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 then npcHandler:say({ "Did you bring all the materials I informed you about? " }, npc, creature) -- It needs to be revised, it's not the same as the global npcHandler:setTopic(playerId, 3) npcHandler:setTopic(playerId, 3) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 then - if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 and player:getItemById(9651, 3) and player:getItemById(31325, 12) and player:getItemById(31333, 10) then + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 and player:getItemById(9651, 3) and player:getItemById(31325, 12) and player:getItemById(31333, 10) then player:removeItem(9651, 3) player:removeItem(31325, 12) player:removeItem(31333, 10) npcHandler:say({ "Thank you this stage of the ritual is complete." }, npc, creature) -- It needs to be revised, it's not the same as the global - player:setStorageValue(Storage.Kilmaresh.Eighth.Yonan, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan, 3) npcHandler:setTopic(playerId, 4) npcHandler:setTopic(playerId, 4) else diff --git a/data-otservbr-global/scripts/actions/other/gems.lua b/data-otservbr-global/scripts/actions/other/gems.lua index e56ea30e896..51d40165a9c 100644 --- a/data-otservbr-global/scripts/actions/other/gems.lua +++ b/data-otservbr-global/scripts/actions/other/gems.lua @@ -85,12 +85,13 @@ function gems.onUse(player, item, fromPosition, target, toPosition, isHotkey) -- Small emerald for Kilmaresh quest -- see data\scripts\quests\kilmaresh\1-fafnars-wrath\7-four-masks.lua - if item.itemid == 3032 and target.uid == 40032 and player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) >= 1 and not testFlag(player:getStorageValue(Storage.Kilmaresh.Sixth.FourMasks), 4) then + if item.itemid == 3032 and target.uid == 40032 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) >= 1 and not testFlag(player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks), 4) then player:addItem(31371, 1) -- Ivory mask item:remove(1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You hear a *click*. You can now lift the floor tile and discover a secret compartment. A mask made of ivory lies in it.") - player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) + 1) - player:setStorageValue(Storage.Kilmaresh.Sixth.FourMasks, setFlag(player:getStorageValue(Storage.Kilmaresh.Sixth.FourMasks), 4)) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) + 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks, setFlag(player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks), 4)) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.IvoryMask, 1) return true -- Enchanted helmet of the ancients elseif player:getItemCount(3030) >= 1 and target.itemid == 3229 then diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua index ff6d3950028..25d055f5482 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua @@ -3,9 +3,9 @@ local paper = Action() function paper.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 2 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Documents were burnt here recently. Only the part of one scroll still lies in front of the chimney but it's too sooted to read.") - player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 3) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already investigated this.") end @@ -20,9 +20,9 @@ paper:register() local paperScraps = Action() function paperScraps.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 3 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 3 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Paper scraps lie scattered on the floor. It takes some time to put them back together. But it's only a badly written poem.") - player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 4) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 4) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already investigated this.") end @@ -37,9 +37,9 @@ paperScraps:register() local scrolls = Action() function scrolls.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 1 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You examine the scrolls carefully. Those are orders from Rathleton for the Ambassador. No sign of treason here.") - player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 2) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already investigated this.") end @@ -54,12 +54,12 @@ scrolls:register() local roofTop = MoveEvent() function roofTop.onStepIn(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 4 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 4 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You find nothing in the Ambassador's house. If he's in fact a traitor he got rid of any evidence that could incriminate him.") - player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 5) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 5) end return true end roofTop:aid(50307) -roofTop:register() +roofTop:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/6-mind-travel.lua b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/6-mind-travel.lua index cc0d24c7281..d36288eca79 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/6-mind-travel.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/6-mind-travel.lua @@ -89,8 +89,8 @@ local memoryShardsItemIdsBitmasks = { local memoryShards = Action() function memoryShards.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local memoryStorage = player:getStorageValue(Storage.Kilmaresh.Fifth.Memories) - local memoriesShardsStorage = player:getStorageValue(Storage.Kilmaresh.Fifth.MemoriesShards) + local memoryStorage = player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) + local memoriesShardsStorage = player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.MemoriesShards) local hasUsedShard = testFlag(memoriesShardsStorage, memoryShardsItemIdsBitmasks[item:getId()]) if @@ -99,8 +99,8 @@ function memoryShards.onUse(player, item, fromPosition, target, toPosition, isHo and target.uid == 57507 -- is it the shrine? then player:say(memoriesWords[memoryStorage], TALKTYPE_MONSTER_SAY, false, player, toPosition) - player:setStorageValue(Storage.Kilmaresh.Fifth.Memories, memoryStorage + 1) - player:setStorageValue(Storage.Kilmaresh.Fifth.MemoriesShards, setFlag(memoriesShardsStorage, memoryShardsItemIdsBitmasks[item:getId()])) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, memoryStorage + 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.MemoriesShards, setFlag(memoriesShardsStorage, memoryShardsItemIdsBitmasks[item:getId()])) toPosition:sendMagicEffect(CONST_ME_ENERGYAREA) return true end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/7-four-masks.lua b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/7-four-masks.lua index b3dc0585bce..3ab075a2f4d 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/7-four-masks.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/7-four-masks.lua @@ -3,19 +3,23 @@ local masks = { storage = 1, successMessage = "You have found a gryphon mask.", -- TODO Gryphon Mask emptyMessage = "The gryphon nest is empty.", + storageKey = Storage.Quest.U12_20.KilmareshQuest.Sixth.GryphonMask, }, [31370] = { -- Silver mask storage = 2, successMessage = "You have found a silver mask.", emptyMessage = "This palm is empty.", + storageKey = Storage.Quest.U12_20.KilmareshQuest.Sixth.SilverMask, }, [31371] = { -- For Ivory mask action see data\scripts\actions\other\gems.lua storage = 4, + storageKey = Storage.Quest.U12_20.KilmareshQuest.Sixth.IvoryMask, }, [31372] = { -- Mirror Mask storage = 8, successMessage = "You have found a mirror mask.", emptyMessage = "The sarcophagus is empty.", + storageKey = Storage.Quest.U12_20.KilmareshQuest.Sixth.MirrorMask, }, } @@ -31,12 +35,13 @@ function masksAction.onUse(player, item, fromPosition, target, toPosition, isHot local maskDiscovered = uidRewards[item.uid] local mask = masks[maskDiscovered] - if player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) >= 1 and not testFlag(player:getStorageValue(Storage.Kilmaresh.Sixth.FourMasks), mask.storage) then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) >= 1 and not testFlag(player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks), mask.storage) then player:addItem(maskDiscovered, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, mask.successMessage) - player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) + 1) - player:setStorageValue(Storage.Kilmaresh.Sixth.FourMasks, player:getStorageValue(Storage.Kilmaresh.Sixth.FourMasks) + mask.storage) - elseif player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) >= 1 then + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) + 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.FourMasks) + mask.storage) + player:setStorageValue(mask.storageKey, 1) + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) >= 1 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, mask.emptyMessage) else return false diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/8-blessing-the-statues.lua b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/8-blessing-the-statues.lua index 1c5bc1964bc..b113a191ad3 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/8-blessing-the-statues.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/8-blessing-the-statues.lua @@ -30,10 +30,10 @@ function statuesActions.onUse(player, item, fromPosition, target, toPosition, is return false end - if player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) >= 5 and not testFlag(player:getStorageValue(Storage.Kilmaresh.Sixth.BlessedStatues), key.storage) then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) >= 5 and not testFlag(player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.BlessedStatues), key.storage) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You bless the statue.") - player:setStorageValue(Storage.Kilmaresh.Sixth.Favor, player:getStorageValue(Storage.Kilmaresh.Sixth.Favor) + 1) - player:setStorageValue(Storage.Kilmaresh.Sixth.BlessedStatues, player:getStorageValue(Storage.Kilmaresh.Sixth.BlessedStatues) + key.storage) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor) + 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.BlessedStatues, player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.BlessedStatues) + key.storage) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already blessed this statue.") end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_augerfun.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_augerfun.lua index 4ab6691ab6c..699cf1957b8 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_augerfun.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_augerfun.lua @@ -1,7 +1,7 @@ local augerfun = Action() function augerfun.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then if table.contains({ 31377 }, target.itemid) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are gathering some catus milk.") player:addItem(31335, 1) diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_basin.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_basin.lua index 613bd5a2f79..9628f9f26d5 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_basin.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_basin.lua @@ -1,10 +1,10 @@ local basin = Action() function basin.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Tem.Bleeds) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Tem.Bleeds) == 1 then player:addItem(31431, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You find a golden symbol at the bottom of the blood-filled basin.") - player:setStorageValue(Storage.Kilmaresh.Eleven.Basin, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eleven.Basin, 1) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sorry") end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_books.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_books.lua deleted file mode 100644 index c068fcadb88..00000000000 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_books.lua +++ /dev/null @@ -1,14 +0,0 @@ -local books = Action() - -function books.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Second.Investigating) == 4 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You find nothing in the Ambassador's house. If he's in fact a traitor he got rid of any evidence that could incriminate him.") - player:setStorageValue(Storage.Kilmaresh.Second.Investigating, 5) - else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.") - end - return true -end - -books:uid(57504) -books:register() diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_cagekey.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_cagekey.lua index d4a01248e57..67a3f56cadc 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_cagekey.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_cagekey.lua @@ -1,10 +1,10 @@ local cagekey = Action() function cagekey.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Fourteen.Remains) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains) == 2 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a wooden cage key.") player:addItem(31379, 1) -- Wooden Cage Key - player:setStorageValue(Storage.Kilmaresh.Fourteen.Remains, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains, 3) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.") end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_coruja.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_coruja.lua index 367ee462a05..0ab72a6d1ba 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_coruja.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_coruja.lua @@ -1,9 +1,9 @@ local coruja = Action() function coruja.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Nine.Owl) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Nine.Owl) == 1 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You discover an owl resting in a tree. Thats special, because you have never seen an owl in all of Kilmaresh.") - player:setStorageValue(Storage.Kilmaresh.Nine.Owl, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Nine.Owl, 2) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sorry") end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_glasshoneyfun.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_glasshoneyfun.lua index b106aa6cab9..e0911e2a695 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_glasshoneyfun.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_glasshoneyfun.lua @@ -1,7 +1,7 @@ local glasshoneyfun = Action() function glasshoneyfun.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.Kilmaresh.Eighth.Narsai) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 2 then if table.contains({ 31376 }, target.itemid) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are gently squishing some of the honey palm blossoms and golden honey is depping into the jug.") player:removeItem(31331, 1) diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_lyre.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_lyre.lua index bdac82d88ef..878caaed444 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_lyre.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_lyre.lua @@ -1,10 +1,10 @@ local lyre = Action() function lyre.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 2 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found Lyre.") player:addItem(31447, 1) - player:setStorageValue(Storage.Kilmaresh.Thirteen.Lyre, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 3) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The bag can not be opened.") end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_peeler.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_peeler.lua index 8507ac946f9..ed5f337e92c 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_peeler.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_peeler.lua @@ -1,9 +1,9 @@ local peeler = Action() function peeler.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Set.Ritual) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual) == 2 then player:addItem(31328, 1) - player:setStorageValue(Storage.Kilmaresh.Set.Ritual, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual, 3) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a bark peeler.") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.") diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_peelerfun.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_peelerfun.lua index 330f838543e..dc1837c2996 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_peelerfun.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_peelerfun.lua @@ -1,7 +1,7 @@ local peelerfun = Action() function peelerfun.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.Kilmaresh.Eighth.Tefrit) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 2 then if table.contains({ 31376 }, target.itemid) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are peeling a piece of tark off the again tree.") player:addItem(31329, 1) diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_pickenchanted.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_pickenchanted.lua index 6cc2ad57f46..29cff3c03a5 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_pickenchanted.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_pickenchanted.lua @@ -1,7 +1,7 @@ local pickenchanted = Action() function pickenchanted.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:getStorageValue(Storage.Kilmaresh.Eighth.Yonan) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 2 then if table.contains({ 30438 }, target.itemid) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are quarrying some tagralt.") player:addItem(31333, 1) diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_sangra.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_sangra.lua index f1b0b37a698..3ca1f37b0db 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_sangra.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_sangra.lua @@ -1,9 +1,9 @@ local sangra = Action() function sangra.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Nine.Owl) == 2 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Nine.Owl) == 2 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The arrow is still sticking in the tree. Fresh blood keeps trickling from the spot where the arrow hit the trunk.") - player:setStorageValue(Storage.Kilmaresh.Tem.Bleeds, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Tem.Bleeds, 1) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sorry") end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_scissors.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_scissors.lua index d1d16fa1c30..5d6fae1c98c 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_scissors.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_scissors.lua @@ -1,9 +1,9 @@ local scissors = Action() function scissors.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Set.Ritual) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual) == 1 then player:addItem(31327, 1) - player:setStorageValue(Storage.Kilmaresh.Set.Ritual, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Set.Ritual, 2) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a ritual scissors.") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.") diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_scissorsfun.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_scissorsfun.lua index 1e4975e705a..0f255445baf 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_scissorsfun.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_scissorsfun.lua @@ -2,266 +2,266 @@ local config = { [30426] = { itemId = 30426, msg = "You are cutting some veldt flowers.", - storage = Storage.Kilmaresh.Eighth.Yonan, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan, getValue = 2, addItemId = 31325, }, -- Veldt Flower [30422] = { itemId = 30422, msg = "You are cutting some snake maw.", - storage = Storage.Kilmaresh.Eighth.Shimun, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun, getValue = 2, addItemId = 31336, }, -- Sanke Maw [30427] = { itemId = 30427, msg = "You are cutting some desert rose blossoms.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31330, }, -- Rose Blossoms [12747] = { itemId = 12747, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12748] = { itemId = 12748, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12749] = { itemId = 12749, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12750] = { itemId = 12750, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12751] = { itemId = 12751, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12752] = { itemId = 12752, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12753] = { itemId = 12753, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12754] = { itemId = 12754, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12755] = { itemId = 12755, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12756] = { itemId = 12756, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12757] = { itemId = 12757, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12758] = { itemId = 12758, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12759] = { itemId = 12759, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12760] = { itemId = 12760, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12761] = { itemId = 12761, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12762] = { itemId = 12762, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12763] = { itemId = 12763, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12764] = { itemId = 12764, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12765] = { itemId = 12765, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12766] = { itemId = 12766, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12767] = { itemId = 12767, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12768] = { itemId = 12768, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12769] = { itemId = 12769, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12770] = { itemId = 12770, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12771] = { itemId = 12771, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12772] = { itemId = 12772, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12773] = { itemId = 12773, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12774] = { itemId = 12774, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12775] = { itemId = 12775, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12776] = { itemId = 12776, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12777] = { itemId = 12777, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12778] = { itemId = 12778, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12779] = { itemId = 12779, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12780] = { itemId = 12780, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds [12781] = { itemId = 12781, msg = "You are gathering some spiderweb cloud shreds. But you become entangled.", - storage = Storage.Kilmaresh.Eighth.Tefrit, + storage = Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit, getValue = 2, addItemId = 31339, }, -- Spider Cloud Shreds diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_tortoise.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_tortoise.lua index 3d2f67bb489..ea5158719da 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_tortoise.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_tortoise.lua @@ -1,10 +1,10 @@ local tortoise = Action() function tortoise.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 1 then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 1 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Tortoise.") player:addItem(31445, 1) - player:setStorageValue(Storage.Kilmaresh.Thirteen.Presente, 2) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente, 2) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The tortoise nest empty.") end diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_tumulo.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_tumulo.lua index 80724b7b876..2b993b41b9c 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_tumulo.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_tumulo.lua @@ -1,8 +1,8 @@ local tumulo = Action() function tumulo.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 1 then - -- player:setStorageValue(Storage.Kilmaresh.Treze.Presente, 2) + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 1 then + -- player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Treze.Presente, 2) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The grave is empty. Nothing than gaping void.") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.") diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_tumuloerro.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_tumuloerro.lua index 07ce019e84b..8148603b01a 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/actions_tumuloerro.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/actions_tumuloerro.lua @@ -1,8 +1,8 @@ local tumuloerro = Action() function tumuloerro.onUse(player, item, frompos, item2, topos) - if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 1 then - -- player:setStorageValue(Storage.Kilmaresh.Treze.Presente, 2) + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 1 then + -- player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Treze.Presente, 2) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The grave is empty. Nothing than gaping void.") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Empty.") diff --git a/data-otservbr-global/scripts/actions/bosses_levers/urmahlullu_the_immaculate.lua b/data-otservbr-global/scripts/quests/kilmaresh/actions_urmahlullu_the_immaculate.lua similarity index 100% rename from data-otservbr-global/scripts/actions/bosses_levers/urmahlullu_the_immaculate.lua rename to data-otservbr-global/scripts/quests/kilmaresh/actions_urmahlullu_the_immaculate.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_bragrumol.lua b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_bragrumol.lua index 02846ec6cfd..4b0f04a885d 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_bragrumol.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_bragrumol.lua @@ -2,8 +2,8 @@ local bragrumol = CreatureEvent("BragrumolDeath") function bragrumol.onDeath(creature) onDeathForDamagingPlayers(creature, function(creature, player) - if player:getStorageValue(Storage.Kilmaresh.Twelve.Bragrumol) == 1 then - player:setStorageValue(Storage.Kilmaresh.Twelve.Bragrumol, 2) + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Bragrumol) == 1 then + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Bragrumol, 2) end end) return true diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_fafnar.lua b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_fafnar.lua index 4d94f0e6d3b..495c1e4136c 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_fafnar.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_fafnar.lua @@ -1,6 +1,6 @@ local monster = { - ["burning gladiator"] = Storage.Kilmaresh.Thirteen.Fafnar, - ["priestess of the wild sun"] = Storage.Kilmaresh.Thirteen.Fafnar, + ["burning gladiator"] = Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar, + ["priestess of the wild sun"] = Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar, } local fafnar = CreatureEvent("FafnarMissionsDeath") diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_mozradek.lua b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_mozradek.lua index 23507b878b0..fdfc876634d 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_mozradek.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_mozradek.lua @@ -2,8 +2,8 @@ local mozradek = CreatureEvent("MozradekDeath") function mozradek.onDeath(creature) onDeathForDamagingPlayers(creature, function(creature, player) - if player:getStorageValue(Storage.Kilmaresh.Twelve.Mozradek) == 1 then - player:setStorageValue(Storage.Kilmaresh.Twelve.Mozradek, 2) + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Mozradek) == 1 then + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Mozradek, 2) end end) return true diff --git a/data-otservbr-global/scripts/creaturescripts/monster/urmahlullu_change.lua b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_urmahlullu_change.lua similarity index 100% rename from data-otservbr-global/scripts/creaturescripts/monster/urmahlullu_change.lua rename to data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_urmahlullu_change.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_xogixath.lua b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_xogixath.lua index cbfe0daeb3b..41dc703989f 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_xogixath.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_xogixath.lua @@ -2,8 +2,8 @@ local xogixath = CreatureEvent("XogixathDeath") function xogixath.onDeath(creature) onDeathForDamagingPlayers(creature, function(creature, player) - if player:getStorageValue(Storage.Kilmaresh.Twelve.Xogixath) == 1 then - player:setStorageValue(Storage.Kilmaresh.Twelve.Xogixath, 2) + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Xogixath) == 1 then + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Xogixath, 2) end end) return true diff --git a/data-otservbr-global/startup/tables/door_quest.lua b/data-otservbr-global/startup/tables/door_quest.lua index d175ac61b90..3a0837fa8d1 100644 --- a/data-otservbr-global/startup/tables/door_quest.lua +++ b/data-otservbr-global/startup/tables/door_quest.lua @@ -50,18 +50,6 @@ QuestDoorAction = { itemId = false, itemPos = { { x = 32467, y = 31969, z = 5 } }, }, - -- Edron - [Storage.Kilmaresh.Sixth.Favor] = { - itemId = false, - itemPos = { - { x = 33855, y = 31450, z = 9 }, - { x = 33855, y = 31496, z = 9 }, - { x = 33884, y = 31510, z = 9 }, - { x = 33884, y = 31536, z = 9 }, - { x = 33911, y = 31496, z = 9 }, - { x = 33912, y = 31466, z = 9 }, - }, - }, -- Rathleton quest door [Storage.HeroRathleton.AccessDoor] = { itemId = false, @@ -667,16 +655,6 @@ QuestDoorAction = { { x = 32169, y = 31933, z = 7 }, }, }, - -- Kilmaresh doors - -- [Storage.Kilmaresh.First.Title] = { - -- itemId = false, - -- itemPos = { - -- {x = 33959, y = 31501, z = 4}, - -- {x = 33375, y = 31346, z = 5}, - -- {x = 33371, y = 31349, z = 4}, - -- {x = 33376, y = 31335, z = 3} - -- } - -- }, -- The Rookie Guard Quest - Mission 07: Attack! -- The library vault door [Storage.Quest.U9_1.TheRookieGuard.LibraryDoor] = { @@ -796,19 +774,35 @@ QuestDoorAction = { { x = 33470, y = 32786, z = 11 }, }, }, - [Storage.Kilmaresh.AccessDoor] = { + -- Kilmaresh Quest + [Storage.Quest.U12_20.KilmareshQuest.AccessDoor] = { itemId = false, itemPos = { { x = 33886, y = 31476, z = 7 } }, }, - [Storage.Kilmaresh.CatacombDoors] = { - itemId = false, + [Storage.Quest.U12_20.KilmareshQuest.Second.Investigating] = { + itemId = 31568, + itemPos = { { x = 33959, y = 31501, z = 4 } }, + }, + [Storage.Quest.U12_20.KilmareshQuest.Sixth.GryphonMask] = { + itemId = 9558, + itemPos = { { x = 33884, y = 31536, z = 9 } }, + }, + [Storage.Quest.U12_20.KilmareshQuest.Sixth.MirrorMask] = { + itemId = 9558, + itemPos = { { x = 33884, y = 31510, z = 9 } }, + }, + [Storage.Quest.U12_20.KilmareshQuest.Sixth.IvoryMask] = { + itemId = 9558, + itemPos = { + { x = 33911, y = 31496, z = 9 }, + { x = 33855, y = 31496, z = 9 }, + }, + }, + [Storage.Quest.U12_20.KilmareshQuest.Sixth.SilverMask] = { + itemId = 9558, itemPos = { { x = 33855, y = 31450, z = 9 }, { x = 33912, y = 31466, z = 9 }, - { x = 33855, y = 31496, z = 9 }, - { x = 33911, y = 31496, z = 9 }, - { x = 33884, y = 31510, z = 9 }, - { x = 33884, y = 31536, z = 9 }, }, }, [Storage.Quest.U12_60.APiratesTail.TentuglyDoor] = { diff --git a/data-otservbr-global/startup/tables/item.lua b/data-otservbr-global/startup/tables/item.lua index 99854dad8c8..883fe90ce48 100644 --- a/data-otservbr-global/startup/tables/item.lua +++ b/data-otservbr-global/startup/tables/item.lua @@ -3447,4 +3447,17 @@ ItemUnique = { itemId = 9253, itemPos = { x = 33755, y = 32161, z = 14 }, }, + -- Kilmaresh Quest + [57505] = { + itemId = 31349, + itemPos = { x = 33899, y = 31643, z = 9 }, + }, + [57506] = { + itemId = 31349, + itemPos = { x = 33936, y = 31647, z = 9 }, + }, + [57507] = { + itemId = 31357, + itemPos = { x = 33914, y = 31639, z = 9 }, + }, } diff --git a/data-otservbr-global/startup/tables/tile.lua b/data-otservbr-global/startup/tables/tile.lua index 59d9d3be69f..5246b290c37 100644 --- a/data-otservbr-global/startup/tables/tile.lua +++ b/data-otservbr-global/startup/tables/tile.lua @@ -296,8 +296,9 @@ TileAction = { [50307] = { itemId = false, itemPos = { + { x = 33955, y = 31503, z = 2 }, { x = 33956, y = 31503, z = 2 }, - { x = 33957, y = 31503, z = 2 }, + { x = 33956, y = 31504, z = 2 }, }, }, -- The paradox tower quest From 7a3c297947856ef25ef82bb606f3ccb2d4f6c175 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 7 Nov 2024 22:11:54 +0000 Subject: [PATCH 16/22] Lua code format - (Stylua) --- .../npc/ambassador_of_rathleton.lua | 44 ++++---- data-otservbr-global/npc/eshaya.lua | 57 +++++----- data-otservbr-global/npc/faloriel.lua | 55 +++++----- data-otservbr-global/npc/kallimae.lua | 9 +- data-otservbr-global/npc/moe.lua | 102 +++++++++--------- data-otservbr-global/npc/the_empress.lua | 2 +- data-otservbr-global/npc/the_librarian.lua | 44 ++++---- .../1-fafnars-wrath/2-ambassadors-treason.lua | 2 +- .../startup/tables/door_quest.lua | 4 +- 9 files changed, 162 insertions(+), 157 deletions(-) diff --git a/data-otservbr-global/npc/ambassador_of_rathleton.lua b/data-otservbr-global/npc/ambassador_of_rathleton.lua index 0e9e1953d30..deee159907b 100644 --- a/data-otservbr-global/npc/ambassador_of_rathleton.lua +++ b/data-otservbr-global/npc/ambassador_of_rathleton.lua @@ -59,28 +59,28 @@ npcType.onCloseChannel = function(npc, creature) end local function creatureSayCallback(npc, creature, type, message) - local player = Player(creature) - local playerId = player:getId() - - if not npcHandler:checkInteraction(npc, creature) then - return false - end - - if MsgContains(message, "present") then - if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering) == 2 then - if player:getItemById(31263, true) then - npcHandler:say("This is a very beautiful ring. Thank you for this generous present!", npc, creature) - player:removeItem(31263, 1) - player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering, 3) - else - npcHandler:say("Didn't you bring my gift?", npc, creature) - end - else - npcHandler:say("I don't need a present right now. Thank you.", npc, creature) - end - end - - return true + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "present") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering) == 2 then + if player:getItemById(31263, true) then + npcHandler:say("This is a very beautiful ring. Thank you for this generous present!", npc, creature) + player:removeItem(31263, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering, 3) + else + npcHandler:say("Didn't you bring my gift?", npc, creature) + end + else + npcHandler:say("I don't need a present right now. Thank you.", npc, creature) + end + end + + return true end npcHandler:setMessage(MESSAGE_GREET, "Greetings, friend.") diff --git a/data-otservbr-global/npc/eshaya.lua b/data-otservbr-global/npc/eshaya.lua index b5038680f99..ea02aa4c120 100644 --- a/data-otservbr-global/npc/eshaya.lua +++ b/data-otservbr-global/npc/eshaya.lua @@ -59,14 +59,14 @@ npcType.onCloseChannel = function(npc, creature) end local function creatureSayCallback(npc, creature, type, message) - local player = Player(creature) - local playerId = player:getId() + local player = Player(creature) + local playerId = player:getId() - if not npcHandler:checkInteraction(npc, creature) then - return false - end + if not npcHandler:checkInteraction(npc, creature) then + return false + end - if MsgContains(message, "mission") then + if MsgContains(message, "mission") then if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) < 1 then npcHandler:say("Very good. But now you need the Ring of Secret Thoughts back in order to extract the Ambassador's memories.", npc, creature) npcHandler:setTopic(playerId, 2) @@ -74,25 +74,25 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("You found the Ring of Secret Thoughts! Well done! Now give it to the Ambassador as a present. He's a peacock and will accept such a precious gift for sure. As soon as he wears it, his memories will be stored in the ring.", npc, creature) player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering, 2) npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Title) < 1 then - npcHandler:say("I'm willing to admit that I need help. And the help of someone who is not from {Issavi} at that. But the task could be dangerous and you would become embroiled in the politics and court intrigues of {Kilmaresh}. Will you help me anyhow?", npc, creature) - npcHandler:setTopic(playerId, 1) - elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 5 then - npcHandler:say({ - "It seems that he destroyed every visible evidence of his treason. That's very unfortunate and I see only one remaining possibility: You need to see the {Ambassador}'s memories. ...", - "But there is only one way to achieve this: You have to find a Ring of {Secret Thoughts}. Legend has it that a monstrous being called {Urmahlullu} has such a ring. If the myths are true you can find this creature in a subterranean tomb south of Issavi.", - }, npc, creature) + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Title) < 1 then + npcHandler:say("I'm willing to admit that I need help. And the help of someone who is not from {Issavi} at that. But the task could be dangerous and you would become embroiled in the politics and court intrigues of {Kilmaresh}. Will you help me anyhow?", npc, creature) + npcHandler:setTopic(playerId, 1) + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating) == 5 then + npcHandler:say({ + "It seems that he destroyed every visible evidence of his treason. That's very unfortunate and I see only one remaining possibility: You need to see the {Ambassador}'s memories. ...", + "But there is only one way to achieve this: You have to find a Ring of {Secret Thoughts}. Legend has it that a monstrous being called {Urmahlullu} has such a ring. If the myths are true you can find this creature in a subterranean tomb south of Issavi.", + }, npc, creature) player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 6) - npcHandler:setTopic(playerId, 0) - elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) == 4 then - npcHandler:say("This is the proof we need! Very well done! You have to report this to our {Empress}. She will grant you an audience now.", npc, creature) - player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, 5) npcHandler:setTopic(playerId, 0) - else - npcHandler:say("You haven't completed your mission yet. Keep searching!", npc, creature) + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) == 4 then + npcHandler:say("This is the proof we need! Very well done! You have to report this to our {Empress}. She will grant you an audience now.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, 5) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("You haven't completed your mission yet. Keep searching!", npc, creature) npcHandler:setTopic(playerId, 0) - end - elseif MsgContains(message, "yes") then + end + elseif MsgContains(message, "yes") then if npcHandler:getTopic(playerId) == 1 then npcHandler:say({ "You are a noble soul! So listen: for many decades, over a century actually, the city of {Rathleton} had an Ambassador here in {Issavi}. ...", @@ -105,32 +105,31 @@ local function creatureSayCallback(npc, creature, type, message) player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, 1) npcHandler:setTopic(playerId, 0) end - elseif MsgContains(message, "theft") then + elseif MsgContains(message, "theft") then if npcHandler:getTopic(playerId) == 3 then npcHandler:say("I don't know whether you are experienced in such things. If not, you could ask somebody who is. But I'm not sure where in Issavi you should look to hire a thief.", npc, creature) player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 1) npcHandler:setTopic(playerId, 0) end - elseif MsgContains(message, "ring of secret thoughts back") then + elseif MsgContains(message, "ring of secret thoughts back") then if npcHandler:getTopic(playerId) == 2 then npcHandler:say("I guess claiming back a present would be a bit suspicious. You'll have to find another way. I resent thinking about theft but sometimes, desperate times call for desperate measures.", npc, creature) npcHandler:setTopic(playerId, 3) end elseif MsgContains(message, "ring") then if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 4 then - npcHandler:say("You got the ring back? Very well done! Now search for the memories that will prove the Ambassador's treason. I don't know much about ancient artefacts but you could ask the librarian in the palace. I'm sure he knows something helpful.", npc, creature) + npcHandler:say("You got the ring back? Very well done! Now search for the memories that will prove the Ambassador's treason. I don't know much about ancient artefacts but you could ask the librarian in the palace. I'm sure he knows something helpful.", npc, creature) player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 5) npcHandler:setTopic(playerId, 0) end elseif MsgContains(message, "empress") then - npcHandler:say("Good luck on your audience with the Empress. May Kilmaresh prosper.", npc, creature) + npcHandler:say("Good luck on your audience with the Empress. May Kilmaresh prosper.", npc, creature) npcHandler:setTopic(playerId, 0) - end + end - return true + return true end - npcHandler:setMessage(MESSAGE_GREET, "Suon's and Bastesh's blessing, dear guest!") npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.") diff --git a/data-otservbr-global/npc/faloriel.lua b/data-otservbr-global/npc/faloriel.lua index edf7fc68a0a..76a1cace665 100644 --- a/data-otservbr-global/npc/faloriel.lua +++ b/data-otservbr-global/npc/faloriel.lua @@ -58,34 +58,33 @@ npcType.onCloseChannel = function(npc, creature) end local function creatureSayCallback(npc, creature, type, message) - local player = Player(creature) - local playerId = player:getId() - - if not npcHandler:checkInteraction(npc, creature) then - return false - end - - if MsgContains(message, "ring") then - if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) == 1 then - npcHandler:say("So, the Librarian sent you. Well, yes, I have a vial of the hallucinogen you need. I'll give it to you for 1000 gold. Do you agree?", npc, creature) - npcHandler:setTopic(playerId, 1) - else - npcHandler:say("I don't have anything to offer you regarding a ring.", npc, creature) - end - - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 then - if player:getMoney() + player:getBankBalance() >= 1000 then - npcHandler:say("Great. Here, take it.", npc, creature) - player:removeMoneyBank(1000) - player:addItem(31350, 1) - npcHandler:setTopic(playerId, 0) - else - npcHandler:say("You do not have enough money.", npc, creature) - npcHandler:setTopic(playerId, 0) - end - end - - return true + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "ring") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) == 1 then + npcHandler:say("So, the Librarian sent you. Well, yes, I have a vial of the hallucinogen you need. I'll give it to you for 1000 gold. Do you agree?", npc, creature) + npcHandler:setTopic(playerId, 1) + else + npcHandler:say("I don't have anything to offer you regarding a ring.", npc, creature) + end + elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 then + if player:getMoney() + player:getBankBalance() >= 1000 then + npcHandler:say("Great. Here, take it.", npc, creature) + player:removeMoneyBank(1000) + player:addItem(31350, 1) + npcHandler:setTopic(playerId, 0) + else + npcHandler:say("You do not have enough money.", npc, creature) + npcHandler:setTopic(playerId, 0) + end + end + + return true end npcHandler:setMessage(MESSAGE_GREET, "Greetings, dear guest and welcome to my {potion} shop.") diff --git a/data-otservbr-global/npc/kallimae.lua b/data-otservbr-global/npc/kallimae.lua index b85062c760d..7d41e955886 100644 --- a/data-otservbr-global/npc/kallimae.lua +++ b/data-otservbr-global/npc/kallimae.lua @@ -103,7 +103,14 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:setTopic(playerId, 3) npcHandler:setTopic(playerId, 3) end - elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3 then + elseif + MsgContains(message, "yes") + and npcHandler:getTopic(playerId) == 3 + and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3 + and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3 + and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3 + and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3 + then if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Yonan) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Narsai) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Shimun) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Eighth.Tefrit) == 3 then npcHandler:say({ "Thanks. I need you to go to 4 places indicated by Goddess Bastesh." }, npc, creature) -- It needs to be revised, it's not the same as the global player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Nine.Owl, 1) diff --git a/data-otservbr-global/npc/moe.lua b/data-otservbr-global/npc/moe.lua index bf6672b8035..62932f3ffd6 100644 --- a/data-otservbr-global/npc/moe.lua +++ b/data-otservbr-global/npc/moe.lua @@ -59,57 +59,57 @@ npcType.onCloseChannel = function(npc, creature) end local function creatureSayCallback(npc, creature, type, message) - local player = Player(creature) - local playerId = player:getId() - - if not npcHandler:checkInteraction(npc, creature) then - return false - end - - if MsgContains(message, "help") then - if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 1 then - npcHandler:say("I guess I could do this, yes. But I have to impose a condition. If you bring me ten sphinx feathers I will steal this ring for you.", npc, creature) - player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 2) - end - elseif MsgContains(message, "feathers") then - if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 2 then - if player:getItemById(31437, 10) then - npcHandler:say("Thank you! They look so pretty, I'm very pleased. Agreed, now I will steal the ring from the Ambassador of Rathleton. Just be patient, I have to wait for a good moment.", npc, creature) - player:removeItem(31437, 10) - player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 3) - player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.MoeTimer, os.time() + 60 * 60) - else - npcHandler:say("If you bring me ten sphinx feathers, I will steal this ring for you.", npc, creature) - end - else - npcHandler:say("You already delivered the feathers. Be patient while I steal the ring.", npc, creature) - end - elseif MsgContains(message, "ring") then - if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 3 then - local timeLeft = player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.MoeTimer) - os.time() - if timeLeft <= 0 then - npcHandler:say("You're arriving at the right time. I have the ring you asked for. It was not too difficult. I just had to wait until the Ambassador left his residence and then I climbed in through the window. Here it is.", npc, creature) - player:addItem(31306, 1) - player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 4) - else - npcHandler:say("I will steal it, promised. I'm just waiting for a good moment.", npc, creature) - end - elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 1 then - npcHandler:say("I guess I could do this, yes. But I have to impose a condition. If you bring me ten sphinx feathers I will steal this ring for you.", npc, creature) - player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 2) - else - npcHandler:say("You don't need this ring anymore.", npc, creature) - end - elseif MsgContains(message, "lyre") then - if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 1 then - npcHandler:say("I'm upset to accuse myself, the lyre is hidden in a tomb west of Kilmaresh.", npc, creature) - player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 2) - else - npcHandler:say("You already know about the lyre's location.", npc, creature) - end - end - - return true + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "help") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 1 then + npcHandler:say("I guess I could do this, yes. But I have to impose a condition. If you bring me ten sphinx feathers I will steal this ring for you.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 2) + end + elseif MsgContains(message, "feathers") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 2 then + if player:getItemById(31437, 10) then + npcHandler:say("Thank you! They look so pretty, I'm very pleased. Agreed, now I will steal the ring from the Ambassador of Rathleton. Just be patient, I have to wait for a good moment.", npc, creature) + player:removeItem(31437, 10) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 3) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.MoeTimer, os.time() + 60 * 60) + else + npcHandler:say("If you bring me ten sphinx feathers, I will steal this ring for you.", npc, creature) + end + else + npcHandler:say("You already delivered the feathers. Be patient while I steal the ring.", npc, creature) + end + elseif MsgContains(message, "ring") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 3 then + local timeLeft = player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.MoeTimer) - os.time() + if timeLeft <= 0 then + npcHandler:say("You're arriving at the right time. I have the ring you asked for. It was not too difficult. I just had to wait until the Ambassador left his residence and then I climbed in through the window. Here it is.", npc, creature) + player:addItem(31306, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 4) + else + npcHandler:say("I will steal it, promised. I'm just waiting for a good moment.", npc, creature) + end + elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 1 then + npcHandler:say("I guess I could do this, yes. But I have to impose a condition. If you bring me ten sphinx feathers I will steal this ring for you.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 2) + else + npcHandler:say("You don't need this ring anymore.", npc, creature) + end + elseif MsgContains(message, "lyre") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 1 then + npcHandler:say("I'm upset to accuse myself, the lyre is hidden in a tomb west of Kilmaresh.", npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 2) + else + npcHandler:say("You already know about the lyre's location.", npc, creature) + end + end + + return true end npcHandler:setMessage(MESSAGE_GREET, "Greetings, traveller. It seems, you're a {guest} here, just like me.") diff --git a/data-otservbr-global/npc/the_empress.lua b/data-otservbr-global/npc/the_empress.lua index 7b6fb8fd2b6..98ab3fdaf11 100644 --- a/data-otservbr-global/npc/the_empress.lua +++ b/data-otservbr-global/npc/the_empress.lua @@ -60,7 +60,7 @@ local function greetCallback(npc, creature) "Should you ever find the other three parts, a talented jeweler might be able to combine them and recreate the regalia for you.", }) player:addItem(31573, 1) - player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, 11) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Sixth.Favor, 11) elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories) == 5 then player:addItem(31414, 1) npcHandler:setMessage(MESSAGE_GREET, { diff --git a/data-otservbr-global/npc/the_librarian.lua b/data-otservbr-global/npc/the_librarian.lua index 192c4c79393..47a220dcc8b 100644 --- a/data-otservbr-global/npc/the_librarian.lua +++ b/data-otservbr-global/npc/the_librarian.lua @@ -59,28 +59,28 @@ npcType.onCloseChannel = function(npc, creature) end local function creatureSayCallback(npc, creature, type, message) - local player = Player(creature) - local playerId = player:getId() - - if not npcHandler:checkInteraction(npc, creature) then - return false - end - - if MsgContains(message, "ring") then - if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 5 then - npcHandler:say({ - "To extract memories from the ring, you have to enter a trance-like state with the help of a hallucinogen. Like this you can see all memories that are stored in the ring. Ask Faloriel for a respective potion. ...", - "Drink it while wearing the ring in the Temple of Bastesh and say: 'Sa Katesa Tarsani na'. If the legends are true you will be able to take memories with you in the form of memory shards.", - }, npc, creature) - player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, 1) - player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.MemoriesShards, 0) - player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 6) - else - npcHandler:say("You don't need any instructions about the ring right now.", npc, creature) - end - end - - return true + local player = Player(creature) + local playerId = player:getId() + + if not npcHandler:checkInteraction(npc, creature) then + return false + end + + if MsgContains(message, "ring") then + if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe) == 5 then + npcHandler:say({ + "To extract memories from the ring, you have to enter a trance-like state with the help of a hallucinogen. Like this you can see all memories that are stored in the ring. Ask Faloriel for a respective potion. ...", + "Drink it while wearing the ring in the Temple of Bastesh and say: 'Sa Katesa Tarsani na'. If the legends are true you will be able to take memories with you in the form of memory shards.", + }, npc, creature) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.Memories, 1) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fifth.MemoriesShards, 0) + player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourth.Moe, 6) + else + npcHandler:say("You don't need any instructions about the ring right now.", npc, creature) + end + end + + return true end npcHandler:setMessage(MESSAGE_GREET, "Greetings, dear guest. If you are interested in paperware such as books or scrolls, ask me for a trade.") diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua index 25d055f5482..daf7dfb8f4f 100644 --- a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua +++ b/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua @@ -62,4 +62,4 @@ function roofTop.onStepIn(player, item, frompos, item2, topos) end roofTop:aid(50307) -roofTop:register() \ No newline at end of file +roofTop:register() diff --git a/data-otservbr-global/startup/tables/door_quest.lua b/data-otservbr-global/startup/tables/door_quest.lua index 3a0837fa8d1..3fee0ec470c 100644 --- a/data-otservbr-global/startup/tables/door_quest.lua +++ b/data-otservbr-global/startup/tables/door_quest.lua @@ -785,11 +785,11 @@ QuestDoorAction = { }, [Storage.Quest.U12_20.KilmareshQuest.Sixth.GryphonMask] = { itemId = 9558, - itemPos = { { x = 33884, y = 31536, z = 9 } }, + itemPos = { { x = 33884, y = 31536, z = 9 } }, }, [Storage.Quest.U12_20.KilmareshQuest.Sixth.MirrorMask] = { itemId = 9558, - itemPos = { { x = 33884, y = 31510, z = 9 } }, + itemPos = { { x = 33884, y = 31510, z = 9 } }, }, [Storage.Quest.U12_20.KilmareshQuest.Sixth.IvoryMask] = { itemId = 9558, From 5e45061f9355337ecaf3cd78c72d90bd8389e7b7 Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Thu, 7 Nov 2024 19:17:02 -0300 Subject: [PATCH 17/22] Update storages.lua --- data-otservbr-global/lib/core/storages.lua | 54 +++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index 84209c26eec..c78b9135c32 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -2819,54 +2819,54 @@ Storage = { }, Fourth = { Moe = 46899, - MoeTimer = 46890, + MoeTimer = 46900, }, Fifth = { - Memories = 46891, - MemoriesShards = 46892, + Memories = 46901, + MemoriesShards = 46902, }, Sixth = { - Favor = 46893, - FourMasks = 46894, - BlessedStatues = 46895, - IvoryMask = 46896, - MirrorMask = 46897, - SilverMask = 46898, - GryphonMask = 46899, + Favor = 46903, + FourMasks = 46904, + BlessedStatues = 46905, + IvoryMask = 46906, + MirrorMask = 46907, + SilverMask = 46908, + GryphonMask = 46909, }, Set = { - Ritual = 46900, + Ritual = 46910, }, Eighth = { - Yonan = 46901, - Narsai = 46903, - Shimun = 46904, - Tefrit = 46905, + Yonan = 46911, + Narsai = 46912, + Shimun = 46913, + Tefrit = 46914, }, Nine = { - Owl = 46906, + Owl = 46915, }, Tem = { - Bleeds = 46907, + Bleeds = 46916, }, Eleven = { - Basin = 46908, + Basin = 46917, }, Twelve = { - Boss = 46909, - Bragrumol = 46910, - Mozradek = 46911, - Xogixath = 46912, + Boss = 46918, + Bragrumol = 46919, + Mozradek = 46920, + Xogixath = 46921, }, Thirteen = { - Fafnar = 46913, - Lyre = 46914, - Presente = 46915, + Fafnar = 46922, + Lyre = 46923, + Presente = 46924, }, Fourteen = { - Remains = 46916, + Remains = 46925, }, - AccessDoor = 46917, + AccessDoor = 46926, }, Orcsoberfest = {}, }, From f125d97f558420344ebbede1a2eb59b0c75998c0 Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Fri, 8 Nov 2024 10:20:39 -0300 Subject: [PATCH 18/22] More organization --- .../1-fafnars-wrath/2-ambassadors-treason.lua | 0 .../1-fafnars-wrath/6-mind-travel.lua | 0 .../1-fafnars-wrath/7-four-masks.lua | 0 .../1-fafnars-wrath/8-blessing-the-statues.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/actions_augerfun.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/actions_basin.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/actions_cagekey.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/actions_coruja.lua | 0 .../{kilmaresh => kilmaresh_quest}/actions_glasshoneyfun.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/actions_lyre.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/actions_peeler.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/actions_peelerfun.lua | 0 .../{kilmaresh => kilmaresh_quest}/actions_pickenchanted.lua | 0 .../actions_portal_minis_kilmaresh.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/actions_sangra.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/actions_scissors.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/actions_scissorsfun.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/actions_tortoise.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/actions_tumulo.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/actions_tumuloerro.lua | 0 .../actions_urmahlullu_the_immaculate.lua | 0 .../{kilmaresh => kilmaresh_quest}/creaturescripts_bragrumol.lua | 0 .../{kilmaresh => kilmaresh_quest}/creaturescripts_fafnar.lua | 0 .../{kilmaresh => kilmaresh_quest}/creaturescripts_mozradek.lua | 0 .../creaturescripts_urmahlullu_change.lua | 0 .../{kilmaresh => kilmaresh_quest}/creaturescripts_xogixath.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/movements_firetp.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/movements_steptile.lua | 0 .../quests/{kilmaresh => kilmaresh_quest}/movements_tpvoc.lua | 0 29 files changed, 0 insertions(+), 0 deletions(-) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/1-fafnars-wrath/2-ambassadors-treason.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/1-fafnars-wrath/6-mind-travel.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/1-fafnars-wrath/7-four-masks.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/1-fafnars-wrath/8-blessing-the-statues.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_augerfun.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_basin.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_cagekey.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_coruja.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_glasshoneyfun.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_lyre.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_peeler.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_peelerfun.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_pickenchanted.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_portal_minis_kilmaresh.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_sangra.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_scissors.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_scissorsfun.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_tortoise.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_tumulo.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_tumuloerro.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/actions_urmahlullu_the_immaculate.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/creaturescripts_bragrumol.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/creaturescripts_fafnar.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/creaturescripts_mozradek.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/creaturescripts_urmahlullu_change.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/creaturescripts_xogixath.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/movements_firetp.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/movements_steptile.lua (100%) rename data-otservbr-global/scripts/quests/{kilmaresh => kilmaresh_quest}/movements_tpvoc.lua (100%) diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/2-ambassadors-treason.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/2-ambassadors-treason.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/2-ambassadors-treason.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/6-mind-travel.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/6-mind-travel.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/6-mind-travel.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/6-mind-travel.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/7-four-masks.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/7-four-masks.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/7-four-masks.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/7-four-masks.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/8-blessing-the-statues.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/8-blessing-the-statues.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/1-fafnars-wrath/8-blessing-the-statues.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/1-fafnars-wrath/8-blessing-the-statues.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_augerfun.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_augerfun.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_augerfun.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_augerfun.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_basin.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_basin.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_basin.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_basin.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_cagekey.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_cagekey.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_cagekey.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_cagekey.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_coruja.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_coruja.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_coruja.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_coruja.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_glasshoneyfun.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_glasshoneyfun.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_glasshoneyfun.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_glasshoneyfun.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_lyre.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_lyre.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_lyre.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_lyre.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_peeler.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_peeler.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_peeler.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_peeler.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_peelerfun.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_peelerfun.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_peelerfun.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_peelerfun.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_pickenchanted.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_pickenchanted.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_pickenchanted.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_pickenchanted.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_portal_minis_kilmaresh.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_portal_minis_kilmaresh.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_portal_minis_kilmaresh.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_portal_minis_kilmaresh.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_sangra.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_sangra.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_sangra.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_sangra.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_scissors.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_scissors.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_scissors.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_scissors.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_scissorsfun.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_scissorsfun.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_scissorsfun.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_scissorsfun.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_tortoise.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tortoise.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_tortoise.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tortoise.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_tumulo.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tumulo.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_tumulo.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tumulo.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_tumuloerro.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tumuloerro.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_tumuloerro.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_tumuloerro.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/actions_urmahlullu_the_immaculate.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/actions_urmahlullu_the_immaculate.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/actions_urmahlullu_the_immaculate.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/actions_urmahlullu_the_immaculate.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_bragrumol.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_bragrumol.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_bragrumol.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_bragrumol.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_fafnar.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_fafnar.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_fafnar.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_fafnar.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_mozradek.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_mozradek.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_mozradek.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_mozradek.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_urmahlullu_change.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_urmahlullu_change.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_urmahlullu_change.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_urmahlullu_change.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_xogixath.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_xogixath.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/creaturescripts_xogixath.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/creaturescripts_xogixath.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/movements_firetp.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/movements_firetp.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/movements_firetp.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/movements_firetp.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/movements_steptile.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/movements_steptile.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/movements_steptile.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/movements_steptile.lua diff --git a/data-otservbr-global/scripts/quests/kilmaresh/movements_tpvoc.lua b/data-otservbr-global/scripts/quests/kilmaresh_quest/movements_tpvoc.lua similarity index 100% rename from data-otservbr-global/scripts/quests/kilmaresh/movements_tpvoc.lua rename to data-otservbr-global/scripts/quests/kilmaresh_quest/movements_tpvoc.lua From eab60ef580a31ded2759b4bd8c3ad6d2344815a3 Mon Sep 17 00:00:00 2001 From: Glatharth Date: Fri, 8 Nov 2024 23:29:31 -0300 Subject: [PATCH 19/22] converted the lever logic to the new bossLever() pattern --- .../the_dream_courts/bosses/alptramun.lua | 1 + .../the_dream_courts/bosses/plagueroot.lua | 1 + .../the_dream_courts/unpleasant_dream.lua | 4 + .../actions/bosses_levers/duke_krule.lua | 23 - .../bosses_levers/sir_baeloc_sir_nictros.lua | 39 -- .../actions_baeloc_fight.lua | 137 +++--- .../grave_danger_quest/actions_duke_fight.lua | 190 ++++---- .../actions_dreamscarLevers.lua | 451 ++++-------------- .../actions_facelessLever.lua | 110 +---- data-otservbr-global/startup/tables/lever.lua | 26 - data/libs/functions/boss_lever.lua | 16 +- 11 files changed, 270 insertions(+), 728 deletions(-) delete mode 100644 data-otservbr-global/scripts/actions/bosses_levers/duke_krule.lua delete mode 100644 data-otservbr-global/scripts/actions/bosses_levers/sir_baeloc_sir_nictros.lua diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua index a32a08f0409..0c7854e6f19 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua @@ -22,6 +22,7 @@ monster.manaCost = 0 monster.events = { "dreamCourtsDeath", + "facelessHealth" } monster.changeTarget = { diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua index bbe6eb790b2..70ca4634314 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua @@ -22,6 +22,7 @@ monster.manaCost = 0 monster.events = { "dreamCourtsDeath", + "facelessHealth" } monster.changeTarget = { diff --git a/data-otservbr-global/monster/quests/the_dream_courts/unpleasant_dream.lua b/data-otservbr-global/monster/quests/the_dream_courts/unpleasant_dream.lua index 2a1e9cb11a2..ed86f01eac1 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/unpleasant_dream.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/unpleasant_dream.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "dreamCourtsDeath", +} + monster.health = 50 monster.maxHealth = 50 monster.race = "blood" diff --git a/data-otservbr-global/scripts/actions/bosses_levers/duke_krule.lua b/data-otservbr-global/scripts/actions/bosses_levers/duke_krule.lua deleted file mode 100644 index 11c3d36a231..00000000000 --- a/data-otservbr-global/scripts/actions/bosses_levers/duke_krule.lua +++ /dev/null @@ -1,23 +0,0 @@ -local config = { - boss = { - name = "Duke Krule", - position = Position(33456, 31473, 13), - }, - requiredLevel = 250, - playerPositions = { - { pos = Position(33455, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33456, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33457, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33458, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33459, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - }, - specPos = { - from = Position(33447, 31464, 13), - to = Position(33464, 31481, 13), - }, - exit = Position(32347, 32167, 12), -} - -local lever = BossLever(config) -lever:position({ x = 33454, y = 31493, z = 13 }) -lever:register() diff --git a/data-otservbr-global/scripts/actions/bosses_levers/sir_baeloc_sir_nictros.lua b/data-otservbr-global/scripts/actions/bosses_levers/sir_baeloc_sir_nictros.lua deleted file mode 100644 index 30b5cff1409..00000000000 --- a/data-otservbr-global/scripts/actions/bosses_levers/sir_baeloc_sir_nictros.lua +++ /dev/null @@ -1,39 +0,0 @@ -local nictrosPosition = Position(33427, 31428, 13) -local baelocPosition = Position(33422, 31428, 13) - -local config = { - boss = { - name = "Sir Nictros", - createFunction = function() - local nictros = Game.createMonster("Sir Nictros", nictrosPosition, true, true):registerEvent("SirNictrosThink") - local baeloc = Game.createMonster("Sir Baeloc", baelocPosition, true, true):registerEvent("SirBaelocThink") - return nictros and baeloc - end, - }, - requiredLevel = 250, - playerPositions = { - { pos = Position(33424, 31413, 13), teleport = Position(33423, 31448, 13) }, - { pos = Position(33425, 31413, 13), teleport = Position(33423, 31448, 13) }, - { pos = Position(33426, 31413, 13), teleport = Position(33423, 31448, 13) }, - { pos = Position(33427, 31413, 13), teleport = Position(33423, 31448, 13) }, - { pos = Position(33428, 31413, 13), teleport = Position(33423, 31448, 13) }, - }, - specPos = { - from = Position(33414, 31426, 13), - to = Position(33433, 31449, 13), - }, - onUseExtra = function(player) - addEvent(function() - local nictros = Tile(nictrosPosition):getTopCreature() - if not nictros then - return - end - nictros:teleportTo(Position(33427, 31436, 13)) - end, 5 * 1000) - end, - exit = Position(33290, 32474, 9), -} - -local lever = BossLever(config) -lever:position(Position(33423, 31413, 13)) -lever:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua index 18a55092d2f..c0c12ca9db9 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua @@ -1,85 +1,58 @@ +local nictrosPosition = Position(33427, 31428, 13) +local baelocPosition = Position(33422, 31428, 13) + local config = { - centerRoom = Position(33424, 31439, 13), - newPosition = Position(33425, 31431, 13), - exitPos = Position(33290, 32474, 9), - x = 12, - y = 12, - baelocPos = Position(33422, 31428, 13), - nictrosPos = Position(33427, 31428, 13), - timer = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Timer, - room = Storage.Quest.U12_20.GraveDanger.Bosses.BaelocNictros.Room, - fromPos = Position(33415, 31426, 13), - toPos = Position(33434, 31450, 13), + boss = { + name = "Sir Nictros", + createFunction = function() + local nictros = Game.createMonster("Sir Nictros", nictrosPosition, true, true) + local baeloc = Game.createMonster("Sir Baeloc", baelocPosition, true, true) + return nictros and baeloc + end, + }, + requiredLevel = 250, + playerPositions = { + { pos = Position(33424, 31413, 13), teleport = Position(33423, 31448, 13) }, + { pos = Position(33425, 31413, 13), teleport = Position(33423, 31448, 13) }, + { pos = Position(33426, 31413, 13), teleport = Position(33423, 31448, 13) }, + { pos = Position(33427, 31413, 13), teleport = Position(33423, 31448, 13) }, + { pos = Position(33428, 31413, 13), teleport = Position(33423, 31448, 13) }, + }, + specPos = { + from = Position(33414, 31426, 13), + to = Position(33433, 31449, 13), + }, + onUseExtra = function(player) + addEvent(function() + local baeloc = Creature("Sir Baeloc") + local nictros = Creature("Sir Nictros") + + if baeloc then + baeloc:say("Ah look my Brother! Challengers! After all this time finally a chance to prove our skills!") + addEvent(function() + local nictros = Creature("Sir Nictros") + if nictros then + nictros:say("Indeed! It has been a while! As the elder one I request the right of the first battle!") + end + end, 6 * 1000) + end + + addEvent(function() + local baeloc = Creature("Sir Baeloc") + local nictros = Creature("Sir Nictros") + if baeloc then + baeloc:say("Oh, man! You always get the fun!") + if nictros then + nictros:teleportTo(Position(33426, 31437, 13)) + nictros:setMoveLocked(false) + end + end + end, 12 * 1000) + end, 4 * 1000) + end, + exit = Position(33290, 32474, 9), } -local function brothers_play() - local baeloc = Creature("Sir Baeloc") - local nictros = Creature("Sir Nictros") - - if baeloc then - baeloc:say("Ah look my Brother! Challengers! After all this time finally a chance to prove our skills!") - addEvent(function() - local nictros = Creature("Sir Nictros") - if nictros then - nictros:say("Indeed! It has been a while! As the elder one I request the right of the first battle!") - end - end, 6 * 1000) - end - - addEvent(function() - local baeloc = Creature("Sir Baeloc") - local nictros = Creature("Sir Nictros") - if baeloc then - baeloc:say("Oh, man! You always get the fun!") - if nictros then - nictros:teleportTo(Position(33426, 31437, 13)) - nictros:setMoveLocked(false) - end - end - end, 12 * 1000) -end - -local baeloc_fight = Action() - -function baeloc_fight.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if not player:doCheckBossRoom("Sir Baeloc", config.fromPos, config.toPos) then - player:sendCancelMessage("The room is already in use. Please wait.") - return true - end - - local baeloc = Game.createMonster("Sir Baeloc", config.baelocPos, true, true) - local nictros = Game.createMonster("Sir Nictros", config.nictrosPos, true, true) - - if baeloc then - baeloc:setMoveLocked(true) - baeloc:registerEvent("sir_baeloc_health") - baeloc:registerEvent("brothers_summon") - end - - if nictros then - nictros:setMoveLocked(true) - nictros:registerEvent("sir_nictros_health") - nictros:registerEvent("brothers_summon") - end - - addEvent(brothers_play, 4 * 1000) - - for x = 33424, 33428 do - local playerTile = Tile(Position(x, 31413, 13)):getTopCreature() - if playerTile and playerTile:isPlayer() then - playerTile:getPosition():sendMagicEffect(CONST_ME_POFF) - playerTile:teleportTo(config.newPosition) - playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - playerTile:setStorageValue(config.timer, os.time() + 20 * 3600) - playerTile:setStorageValue(config.room, os.time() + 30 * 60) - playerTile:say("You have 30 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.", TALKTYPE_MONSTER_SAY, false, playerTile) - end - end - - addEvent(clearForgotten, 30 * 60 * 1000, config.centerRoom, config.x, config.y, config.exitPos, config.room) - - return true -end - -baeloc_fight:aid(14559) -baeloc_fight:register() +local lever = BossLever(config) +lever:position(Position(33423, 31413, 13)) +lever:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua index 551aad55c29..18d54f3986e 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua @@ -1,14 +1,25 @@ local config = { - centerRoom = Position(33456, 31472, 13), - newPosition = Position(33456, 31478, 13), - exitPos = Position(32344, 32168, 12), - x = 10, - y = 10, - timer = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.Timer, - room = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.Room, - transformCD = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.TransformCD, - fromPos = Position(33415, 31426, 13), - toPos = Position(33434, 31450, 13), + boss = { + name = "Duke Krule", + createFunction = function() + local boss = Game.createMonster("Duke Krule", Position(33456, 31473, 13), true, true) + boss:setStorageValue(1, os.time()) + return boss + end, + }, + requiredLevel = 250, + playerPositions = { + { pos = Position(33455, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33456, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33457, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33458, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33459, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + }, + specPos = { + from = Position(33447, 31464, 13), + to = Position(33464, 31481, 13), + }, + exit = Position(32347, 32167, 12), } local duke_water = Combat() @@ -16,13 +27,13 @@ duke_water:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO) duke_water:setArea(createCombatArea(AREA_CIRCLE3X3)) function onTargetTile(cid, pos) - local tile = Tile(pos) - local target = tile:getTopCreature() - if tile then - if target and target:isPlayer() and target:getOutfit().lookType == 49 then - doTargetCombatHealth(0, target, COMBAT_ICEDAMAGE, -1500, -2000) - end - end + local tile = Tile(pos) + local target = tile:getTopCreature() + if tile then + if target and target:isPlayer() and target:getOutfit().lookType == 49 then + doTargetCombatHealth(0, target, COMBAT_ICEDAMAGE, -1500, -2000) + end + end end duke_water:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") @@ -32,98 +43,65 @@ duke_fire:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) duke_fire:setArea(createCombatArea(AREA_CIRCLE3X3)) function onTargetTile(cid, pos) - local tile = Tile(pos) - local target = tile:getTopCreature() - if tile then - if target and target:isPlayer() and target:getOutfit().lookType == 286 then - doTargetCombatHealth(0, target, COMBAT_FIREDAMAGE, -1500, -2000) - end - end + local tile = Tile(pos) + local target = tile:getTopCreature() + if tile then + if target and target:isPlayer() and target:getOutfit().lookType == 286 then + doTargetCombatHealth(0, target, COMBAT_FIREDAMAGE, -1500, -2000) + end + end end duke_fire:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") -local function hitArea(creature) - local player = Player(creature) - - if player then - if player:getStorageValue(config.transformCD) <= os.time() then - if player:getOutfit().lookType == 49 then - local var = { type = 1, number = creature } - duke_fire:execute(player, var) - player:setStorageValue(config.transformCD, os.time() + 3) - addEvent(hitArea, 3 * 1000, creature) - elseif player:getOutfit().lookType == 286 then - local var = { type = 1, number = creature } - duke_water:execute(player, var) - player:setStorageValue(config.transformCD, os.time() + 3) - addEvent(hitArea, 3 * 1000, creature) - end - end - end - - return true -end - -local function transformPlayers(id) - local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) - local form = { 49, 286 } - local boss = Creature("Duke Krule") - - if boss and boss:getStorageValue(1) == id then - if #spectators > 0 then - for _, player in pairs(spectators) do - doSetCreatureOutfit(player, { lookType = form[math.random(#form)] }, 30 * 1000) - addEvent(hitArea, 3 * 1000, player:getId()) - end - addEvent(transformPlayers, 36 * 1000, id) - end - end - - return true -end - -local duke_fight = Action() - -function duke_fight.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if not player:doCheckBossRoom("Duke Krule", config.fromPos, config.toPos) then - player:sendCancelMessage("The room is already in use. Please wait.") - return true - end - - local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) - - if player:getPosition() ~= Position(33455, 31493, 13) then - player:sendCancelMessage("Sorry, not possible.") - return true - end - - if #spectators > 0 then - player:say("The room is occupied by another team, please wait.", TALKTYPE_MONSTER_SAY, false, player) - return true - end - - local boss = Game.createMonster("Duke Krule", config.centerRoom, true, true) - local id = os.time() - boss:setStorageValue(1, id) - addEvent(transformPlayers, 30 * 1000, id) - - for x = 33455, 33459 do - local playerTile = Tile(Position(x, 31493, 13)):getTopCreature() - if playerTile and playerTile:isPlayer() then - playerTile:getPosition():sendMagicEffect(CONST_ME_POFF) - playerTile:teleportTo(config.newPosition) - playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - playerTile:setStorageValue(config.timer, os.time() + 20 * 3600) - playerTile:setStorageValue(config.room, os.time() + 30 * 60) - playerTile:say("You have 30 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.", TALKTYPE_MONSTER_SAY, false, playerTile) - end - end - - addEvent(clearForgotten, 30 * 60 * 1000, config.centerRoom, config.x, config.y, config.exitPos, config.room) - - return true +config.onUseExtra = function() + local config = { + centerRoom = Position(33456, 31472, 13), + x = 10, + y = 10, + transformCD = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.TransformCD, + } + local function hitArea(creature) + local player = Player(creature) + + if player then + if player:getStorageValue(config.transformCD) <= os.time() then + if player:getOutfit().lookType == 49 then + local var = { type = 1, number = creature } + duke_fire:execute(player, var) + player:setStorageValue(config.transformCD, os.time() + 3) + addEvent(hitArea, 3 * 1000, creature) + elseif player:getOutfit().lookType == 286 then + local var = { type = 1, number = creature } + duke_water:execute(player, var) + player:setStorageValue(config.transformCD, os.time() + 3) + addEvent(hitArea, 3 * 1000, creature) + end + end + end + + return true + end + + local function transformPlayers(id) + local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) + local form = { 49, 286 } + local boss = Creature("Duke Krule") + + if boss and boss:getStorageValue(1) == id then + if #spectators > 0 then + for _, player in pairs(spectators) do + doSetCreatureOutfit(player, { lookType = form[math.random(#form)] }, 30 * 1000) + addEvent(hitArea, 3 * 1000, player:getId()) + end + addEvent(transformPlayers, 36 * 1000, id) + end + end + return true + end + addEvent(transformPlayers, 30 * 1000, os.time()) end -duke_fight:aid(14560) -duke_fight:register() +local lever = BossLever(config) +lever:position({ x = 33454, y = 31493, z = 13 }) +lever:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua index a130f090453..9efb945b2f9 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua @@ -1,366 +1,99 @@ -local transform = { - [8911] = 8912, - [8912] = 8911, -} - -local bossNames = { - "plagueroot", - "izcandar the banished", - "izcandar champion of summer", - "izcandar champion of winter", -} - -local leverInfo = { - [1] = { - byDay = "Monday", - bossName = "Alptramun", - bossPosition = Position(32208, 32048, 14), - leverPosition = Position(32208, 32020, 13), - pushPosition = Position(32208, 32021, 13), - leverFromPos = Position(32208, 32021, 13), - leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.AlptramunTimer, - roomFromPosition = Position(32198, 32037, 14), - roomToPosition = Position(32234, 32054, 14), - teleportTo = Position(32224, 32048, 14), - typePush = "y", - exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunTimer, - }, - [2] = { - byDay = "Tuesday", - bossName = "Izcandar the Banished", - bossPosition = Position(32208, 32048, 14), - leverPosition = Position(32208, 32020, 13), - pushPosition = Position(32208, 32021, 13), - leverFromPos = Position(32208, 32021, 13), - leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.IzcandarTimer, - roomFromPosition = Position(32198, 32037, 14), - roomToPosition = Position(32234, 32054, 14), - teleportTo = Position(32224, 32048, 14), - typePush = "y", - exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, - }, - [3] = { - byDay = "Wednesday", - bossName = "Malofur Mangrinder", - bossPosition = Position(32208, 32048, 14), - leverPosition = Position(32208, 32020, 13), - pushPosition = Position(32208, 32021, 13), - leverFromPos = Position(32208, 32021, 13), - leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.MalofurTimer, - roomFromPosition = Position(32198, 32037, 14), - roomToPosition = Position(32234, 32054, 14), - teleportTo = Position(32224, 32048, 14), - typePush = "y", - exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MalofurTimer, +local config = { + boss = { + name = "", + position = Position(32208, 32048, 14), }, - [4] = { - byDay = "Thursday", - bossName = "Maxxenius", - bossPosition = Position(32208, 32048, 14), - leverPosition = Position(32208, 32020, 13), - pushPosition = Position(32208, 32021, 13), - leverFromPos = Position(32208, 32021, 13), - leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.MaxxeniusTimer, - roomFromPosition = Position(32198, 32037, 14), - roomToPosition = Position(32234, 32054, 14), - teleportTo = Position(32224, 32048, 14), - typePush = "y", - exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer, + requiredLevel = 250, + timeToFightAgain = 20 * 60 * 60, + timeToDefeat = 30 * 60, + playerPositions = { + { pos = Position(32208, 32021, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(32208, 32022, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(32208, 32023, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(32208, 32024, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT }, + { pos = Position(32208, 32025, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT }, }, - [5] = { - byDay = "Friday", - bossName = "Izcandar the Banished", - bossPosition = Position(32208, 32048, 14), - leverPosition = Position(32208, 32020, 13), - pushPosition = Position(32208, 32021, 13), - leverFromPos = Position(32208, 32021, 13), - leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.IzcandarTimer, - roomFromPosition = Position(32198, 32037, 14), - roomToPosition = Position(32234, 32054, 14), - teleportTo = Position(32224, 32048, 14), - typePush = "y", - exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarTimer, + monsters = { + ["Maxxenius"] = { + { name = "Generator", pos = Position(32205, 32048, 14) }, + { name = "Generator", pos = Position(32210, 32045, 14) }, + { name = "Generator", pos = Position(32210, 32051, 14) }, + }, + ["Alptramun"] = { + { name = "unpleasant dream", pos = Position(32208, 32048, 14) }, + { name = "unpleasant dream", pos = Position(32208, 32048, 14) }, + }, + ["Izcandar The Banished"] = { + { name = "the heat of summer", pos = Position(32204, 32053, 14), delay = 15 * 1000 }, + { name = "the heat of summer", pos = Position(32201, 32047, 14), delay = 15 * 1000 }, + { name = "the heat of summer", pos = Position(32204, 32043, 14), delay = 15 * 1000 }, + { name = "the cold of winter", pos = Position(32211, 32042, 14), delay = 15 * 1000 }, + { name = "the cold of winter", pos = Position(32214, 32048, 14), delay = 15 * 1000 }, + { name = "the cold of winter", pos = Position(32210, 32053, 14), delay = 15 * 1000 }, + }, + ["Plagueroot"] = { + { name = "plant attendant", pos = Position(32204, 32047, 14), delay = 15 * 1000 }, + { name = "plant attendant", pos = Position(32212, 32043, 14), delay = 15 * 1000 }, + { name = "plant attendant", pos = Position(32212, 32050, 14), delay = 15 * 1000 }, + }, + ["Malofur Mangrinder"] = { + { name = "whirling blades", pos = Position(32200, 32046, 14) }, + { name = "whirling blades", pos = Position(32200, 32050, 14) }, + { name = "whirling blades", pos = Position(32202, 32049, 14) }, + { name = "whirling blades", pos = Position(32202, 32051, 14) }, + { name = "whirling blades", pos = Position(32205, 32043, 14) }, + { name = "whirling blades", pos = Position(32200, 32050, 14) }, + { name = "whirling blades", pos = Position(32205, 32048, 14) }, + { name = "whirling blades", pos = Position(32205, 32055, 14) }, + { name = "whirling blades", pos = Position(32206, 32051, 14) }, + { name = "whirling blades", pos = Position(32206, 32040, 14) }, + { name = "whirling blades", pos = Position(32207, 32043, 14) }, + { name = "whirling blades", pos = Position(32207, 32048, 14) }, + { name = "whirling blades", pos = Position(32208, 32051, 14) }, + { name = "whirling blades", pos = Position(32209, 32048, 14) }, + { name = "whirling blades", pos = Position(32209, 32055, 14) }, + { name = "whirling blades", pos = Position(32210, 32051, 14) }, + { name = "whirling blades", pos = Position(32211, 32042, 14) }, + { name = "whirling blades", pos = Position(32211, 32044, 14) }, + { name = "whirling blades", pos = Position(32211, 32046, 14) }, + { name = "whirling blades", pos = Position(32214, 32043, 14) }, + { name = "whirling blades", pos = Position(32214, 32049, 14) }, + { name = "whirling blades", pos = Position(32213, 32052, 14) } + } + }, + bossPosition = Position(32207, 32051, 14), + specPos = { + from = Position(32199, 32039, 14), + to = Position(32229, 32055, 14), }, - [6] = { - byDay = "Saturday", - bossName = "Plagueroot", - bossPosition = Position(32208, 32048, 14), - leverPosition = Position(32208, 32020, 13), - pushPosition = Position(32208, 32021, 13), - leverFromPos = Position(32208, 32021, 13), - leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.PlagueRootTimer, - roomFromPosition = Position(32198, 32037, 14), - roomToPosition = Position(32234, 32054, 14), - teleportTo = Position(32224, 32048, 14), - typePush = "y", - exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.PlagueRootTimer, - }, - [7] = { - byDay = "Sunday", - bossName = "Maxxenius", - bossPosition = Position(32208, 32048, 14), - leverPosition = Position(32208, 32020, 13), - pushPosition = Position(32208, 32021, 13), - leverFromPos = Position(32208, 32021, 13), - leverToPos = Position(32208, 32025, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.MaxxeniusTimer, - roomFromPosition = Position(32198, 32037, 14), - roomToPosition = Position(32234, 32054, 14), - teleportTo = Position(32224, 32048, 14), - typePush = "y", - exitPosition = Position(32208, 32035, 13), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.MaxxeniusTimer, - }, -} - -local function spawnSummons(k, monsterName, eventName, timing, positionTable, middlePosition) - local spectators = Game.getSpectators(middlePosition, false, false, 20, 20, 20, 20) - local maySummon = false - local hasPlayer = false - - for _, c in pairs(spectators) do - for i = 1, #bossNames do - if c and (c:getName():lower() == bossNames[i]) then - maySummon = true - end - if c:isPlayer() then - hasPlayer = true - end - end - end - - if maySummon and hasPlayer then - if k <= 4 then - for i = 1, #positionTable do - local sqm = positionTable[i] - if sqm then - sqm:sendMagicEffect(CONST_ME_TELEPORT) - end - end - k = k + 1 - addEvent(spawnSummons, 2 * 1000, k, monsterName, eventName, timing, positionTable, middlePosition) - else - for i = 1, #positionTable do - local monster = Game.createMonster(monsterName, positionTable[i], true, true) - if monster and eventName then - monster:registerEvent(eventName) - end - end - addEvent(function() - spawnSummons(1, monsterName, eventName, timing, positionTable, middlePosition) - end, timing * 1000) - end - end -end - -local whirlingBlades = { - Position(32200, 32046, 14), - Position(32200, 32050, 14), - Position(32202, 32049, 14), - Position(32202, 32051, 14), - Position(32205, 32043, 14), - Position(32200, 32050, 14), - Position(32205, 32048, 14), - Position(32205, 32055, 14), - Position(32206, 32051, 14), - Position(32206, 32040, 14), - Position(32207, 32043, 14), - Position(32207, 32048, 14), - Position(32208, 32051, 14), - Position(32209, 32048, 14), - Position(32209, 32055, 14), - Position(32210, 32051, 14), - Position(32211, 32042, 14), - Position(32211, 32044, 14), - Position(32211, 32046, 14), - Position(32214, 32043, 14), - Position(32214, 32049, 14), - Position(32214, 32049, 14), - Position(32213, 32052, 14), -} - -local plantAttendants = { - Position(32204, 32047, 14), - Position(32212, 32043, 14), - Position(32212, 32050, 14), -} - -local coldOfWinter = { - Position(32211, 32042, 14), - Position(32214, 32048, 14), - Position(32210, 32053, 14), -} - -local heatOfSummer = { - Position(32204, 32053, 14), - Position(32201, 32047, 14), - Position(32204, 32043, 14), -} - -local lastBoss = { - bossName = "The Nightmare Beast", - bossPosition = Position(32209, 32044, 15), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScar.NightmareTimer, - globalTimer = Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.NightmareTimer, - fromPositionTeleport = Position(32210, 32070, 15), - toPositionTeleport = Position(32214, 32071, 15), - fromPositionPush = Position(32211, 32070, 15), - toPositionPush = Position(32213, 32070, 15), - teleportTo = Position(32208, 32051, 15), - roomFromPosition = Position(32194, 32035, 15), - roomToPosition = Position(32223, 32058, 15), - exitPosition = Position(32212, 32084, 15), + exit = Position(32210, 32035, 13), } -local function startFight(middle, where) - local newPos = Position(where.x, where.y + 5, where.z) - local spectators = Game.getSpectators(middle, false, true, 9, 9, 9, 9) - - for _, p in pairs(spectators) do - if p and p:isPlayer() then - p:teleportTo(newPos) - end - end -end - -local actions_dreamscarLevers = Action() - -function actions_dreamscarLevers.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if not player then - return true - end - - local playersTable = {} - local iPos = item:getPosition() - local pPos = player:getPosition() - local nightmareLever = Position(32212, 32069, 15) - - if item.itemid == 8911 then - if iPos == nightmareLever then - if player:doCheckBossRoom(lastBoss.bossName, lastBoss.roomFromPosition, lastBoss.roomToPosition) then - if pPos:isInRange(lastBoss.fromPositionPush, lastBoss.toPositionPush) then - for x = lastBoss.fromPositionTeleport.x, lastBoss.toPositionTeleport.x do - for y = lastBoss.fromPositionTeleport.y, lastBoss.toPositionTeleport.y do - local c = Tile(Position(x, y, 15)):getTopCreature() - if c and c:isPlayer() then - table.insert(playersTable, c:getId()) - c:teleportTo(lastBoss.teleportTo) - c:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - c:setStorageValue(lastBoss.storageTimer, os.time() + 20 * 60 * 60) - end - end - end - - local monster = Game.createMonster(lastBoss.bossName, lastBoss.bossPosition, true, true) - - if monster then - monster:registerEvent("dreamCourtsDeath") - end - - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.LastBossCurse, 0) - - addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, lastBoss.roomFromPosition, lastBoss.roomToPosition, lastBoss.exitPosition) - else - return true - end - end - else - for i = 1, #leverInfo do - if iPos == leverInfo[i].leverPosition and os.date("%A") == leverInfo[i].byDay then - local leverTable = leverInfo[i] - if pPos == leverTable.pushPosition then - if player:doCheckBossRoom(leverTable.bossName, leverTable.roomFromPosition, leverTable.roomToPosition) then - if leverTable.typePush == "x" then - for i = leverTable.leverFromPos.x, leverTable.leverToPos.x do - local newPos = Position(i, leverTable.leverFromPos.y, leverTable.leverFromPos.z) - local creature = Tile(newPos):getTopCreature() - if creature and creature:isPlayer() then - creature:teleportTo(leverTable.teleportTo, true) - creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - creature:setStorageValue(leverTable.storageTimer, os.time() + 20 * 60 * 60) - table.insert(playersTable, creature:getId()) - end - end - elseif leverTable.typePush == "y" then - for i = leverTable.leverFromPos.y, leverTable.leverToPos.y do - local newPos = Position(leverTable.leverFromPos.x, i, leverTable.leverFromPos.z) - local creature = Tile(newPos):getTopCreature() - if creature and creature:isPlayer() then - creature:teleportTo(leverTable.teleportTo, true) - creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - creature:setStorageValue(leverTable.storageTimer, os.time() + 20 * 60 * 60) - table.insert(playersTable, creature:getId()) - end - end - end - - local monster = Game.createMonster(leverTable.bossName, leverTable.bossPosition, true, true) - - if monster then - if leverTable.bossName:lower() == "maxxenius" then - local generators = { - Position(32205, 32048, 14), - Position(32210, 32045, 14), - Position(32210, 32051, 14), - } - - for i = 1, #generators do - Game.createMonster("Generator", generators[i], true, true) - end - - monster:registerEvent("facelessHealth") - elseif leverTable.bossName:lower() == "alptramun" then - for i = 1, 2 do - local summon = Game.createMonster("unpleasant dream", leverTable.bossPosition, true, true) - summon:registerEvent("dreamCourtsDeath") - end - - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, 0) - - monster:registerEvent("facelessHealth") - elseif leverTable.bossName:lower() == "izcandar the banished" then - monster:registerEvent("izcandarThink") - spawnSummons(1, "the heat of summer", false, 15, heatOfSummer, leverTable.bossPosition) - spawnSummons(1, "the cold of winter", false, 15, coldOfWinter, leverTable.bossPosition) - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarOutfit, 0) - elseif leverTable.bossName:lower() == "plagueroot" then - spawnSummons(1, "plant attendant", false, 15, plantAttendants, leverTable.bossPosition) - monster:registerEvent("facelessHealth") - elseif leverTable.bossName:lower() == "malofur mangrinder" then - for i = 1, #whirlingBlades do - local blade = Game.createMonster("whirling blades", whirlingBlades[i], true, true) - end - end - - monster:registerEvent("dreamCourtsDeath") - - addEvent(startFight, 30 * 1000, leverTable.teleportTo, leverTable.bossPosition) - end - - addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, leverTable.roomFromPosition, leverTable.roomToPosition, leverTable.exitPosition) - end - end - end - end - end - end - - item:transform(transform[item.itemid]) - - return true +local function configureLever() + local bossDate = { + ["Monday"] = "Plagueroot", + ["Tuesday"] = "Malofur Mangrinder", + ["Wednesday"] = "Maxxenius", + ["Thursday"] = "Alptramun", + ["Friday"] = "Izcandar The Banished", + ["Saturday"] = "Maxxenius", + ["Sunday"] = "Alptramun", + } + local bossName = bossDate[os.date("%A")] + config.boss.name = bossName + config.monsters = config.monsters[bossName] + if bossName == "Maxxenius" then + config.onUseExtra = function() + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, 0) + end + elseif bossName == "Izcandar The Banished" then + config.onUseExtra = function() + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarOutfit, 0) + end + end end -actions_dreamscarLevers:aid(23112) -actions_dreamscarLevers:register() +configureLever() +local dreamCourtsLever = BossLever(config) +dreamCourtsLever:position({ x = 32208, y = 32020, z = 13 }) +dreamCourtsLever:register() \ No newline at end of file diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua index 01b254c00f7..43814ea808a 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua @@ -1,92 +1,24 @@ -local transform = { - [9110] = 9111, - [9111] = 9110, -} - -local leverInfo = { - [1] = { - bossName = "Faceless Bane", - bossPosition = Position(33617, 32561, 13), - leverPosition = Position(33637, 32562, 13), - pushPosition = Position(33638, 32562, 13), - leverFromPos = Position(33638, 32562, 13), - leverToPos = Position(33642, 32562, 13), - storageTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedral.FacelessTimer, - roomFromPosition = Position(33606, 32552, 13), - roomToPosition = Position(33631, 32572, 13), - teleportTo = Position(33617, 32567, 13), - typePush = "x", - exitPosition = Position(33619, 32522, 15), - globalTimer = Storage.Quest.U12_00.TheDreamCourts.BurriedCatedralGlobal.FacelessTimer, +local config = { + boss = { + name = "Faceless Bane", + position = Position(33617, 32561, 13), + }, + requiredLevel = 250, + timeToDefeat = 15 * 60, + playerPositions = { + { pos = Position(33638, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33639, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33640, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33641, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33642, 32562, 13), teleport = Position(33617, 32567, 13), effect = CONST_ME_TELEPORT }, }, + specPos = { + from = Position(33607, 32553, 13), + to = Position(33627, 32570, 13), + }, + exit = Position(33618, 32523, 15), } -local actions_facelessLever = Action() - -function actions_facelessLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if not player then - return true - end - - local playersTable = {} - local iPos = item:getPosition() - local pPos = player:getPosition() - - if item.itemid == 9110 then - for i = 1, #leverInfo do - if iPos == leverInfo[i].leverPosition then - local leverTable = leverInfo[i] - - if pPos == leverTable.pushPosition then - if player:doCheckBossRoom(leverTable.bossName, leverTable.roomFromPosition, leverTable.roomToPosition) then - if leverTable.typePush == "x" then - for i = leverTable.leverFromPos.x, leverTable.leverToPos.x do - local newPos = Position(i, leverTable.leverFromPos.y, leverTable.leverFromPos.z) - local creature = Tile(newPos):getTopCreature() - - if creature and creature:isPlayer() then - creature:teleportTo(leverTable.teleportTo) - creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - creature:setStorageValue(leverTable.storageTimer, os.time() + 20 * 60 * 60) - table.insert(playersTable, creature:getId()) - end - end - elseif leverTable.typePush == "y" then - for i = leverTable.leverFromPos.y, leverTable.leverToPos.y do - local newPos = Position(leverTable.leverFromPos.x, i, leverTable.leverFromPos.z) - local creature = Tile(newPos):getTopCreature() - - if creature and creature:isPlayer() then - creature:teleportTo(leverTable.teleportTo) - creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - creature:setStorageValue(leverTable.storageTimer, os.time() + 20 * 60 * 60) - table.insert(playersTable, creature:getId()) - end - end - end - - local monster = Game.createMonster(leverTable.bossName, leverTable.bossPosition, true, true) - - if monster then - if leverTable.bossName:lower() == "faceless bane" then - monster:registerEvent("facelessThink") - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.BurriedCatedralGlobal.FacelessTiles, 0) - end - - monster:registerEvent("dreamCourtsDeath") - end - - addEvent(kickPlayersAfterTime, 30 * 60 * 1000, playersTable, leverTable.roomFromPosition, leverTable.roomToPosition, leverTable.exitPosition) - end - end - end - end - end - - item:transform(transform[item.itemid]) - - return true -end - -actions_facelessLever:aid(23110) -actions_facelessLever:register() +local lever = BossLever(config) +lever:uid(1039) +lever:register() \ No newline at end of file diff --git a/data-otservbr-global/startup/tables/lever.lua b/data-otservbr-global/startup/tables/lever.lua index efea18ac832..bcf98109646 100644 --- a/data-otservbr-global/startup/tables/lever.lua +++ b/data-otservbr-global/startup/tables/lever.lua @@ -142,18 +142,6 @@ LeverAction = { { x = 33515, y = 31444, z = 13 }, }, }, - [14559] = { - itemId = 8911, - itemPos = { - { x = 33423, y = 31413, z = 13 }, - }, - }, - [14560] = { - itemId = 8911, - itemPos = { - { x = 33454, y = 31493, z = 13 }, - }, - }, [14561] = { itemId = 8911, itemPos = { @@ -166,20 +154,6 @@ LeverAction = { { x = 33484, y = 31546, z = 13 }, }, }, - -- The Dream Courts Quest - [23110] = { - itemId = 9110, - itemPos = { - { x = 33637, y = 32562, z = 13 }, - }, - }, - [23112] = { - itemId = 8911, - itemPos = { - { x = 32212, y = 32069, z = 15 }, - { x = 32208, y = 32020, z = 13 }, - }, - }, -- Forgotten Knowledge Quest [26663] = { itemId = 9125, diff --git a/data/libs/functions/boss_lever.lua b/data/libs/functions/boss_lever.lua index 40bc8e0b4b0..92901d66f4f 100644 --- a/data/libs/functions/boss_lever.lua +++ b/data/libs/functions/boss_lever.lua @@ -14,7 +14,7 @@ ---@field private _aid number ---@field private playerPositions {pos: Position, teleport: Position}[] ---@field private area {from: Position, to: Position} ----@field private monsters {name: string, pos: Position}[] +---@field private monsters {name: string, pos: Position, delay: number}[] ---@field private exitTeleporter Position ---@field private exit Position ---@field private encounter Encounter @@ -42,6 +42,10 @@ local config = { from = Position(33607, 32553, 13), to = Position(33627, 32570, 13) }, + monsters = { + { name = "rat", pos = Position(33615, 32563, 13) }, + { name = "rat", pos = Position(33615, 32563, 13), delay = 5000 }, + }, onUseExtra = function(player, infoPositions) player:teleportTo(Position(33618, 32523, 15)) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) @@ -223,9 +227,6 @@ function BossLever:onUse(player) end if lever:checkConditions() then zone:removeMonsters() - for _, monster in pairs(self.monsters) do - Game.createMonster(monster.name, monster.pos, true, true) - end if self.createBoss then if not self.createBoss() then return true @@ -238,6 +239,13 @@ function BossLever:onUse(player) end monster:registerEvent("BossLeverOnDeath") end + for _, monster in pairs(self.monsters) do + if monster.delay then + addEvent(Game.createMonster, monster.delay, monster.name, monster.pos, true, true) + else + Game.createMonster(monster.name, monster.pos, true, true) + end + end lever:teleportPlayers() if self.encounter then local encounter = Encounter(self.encounter) From 04053f34804063fbbf041164e3fc3ac4cddb1c9c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 9 Nov 2024 02:30:27 +0000 Subject: [PATCH 20/22] Lua code format - (Stylua) --- .../the_dream_courts/bosses/alptramun.lua | 2 +- .../the_dream_courts/bosses/plagueroot.lua | 2 +- .../actions_baeloc_fight.lua | 50 +++--- .../grave_danger_quest/actions_duke_fight.lua | 152 +++++++++--------- .../actions_dreamscarLevers.lua | 140 ++++++++-------- .../actions_facelessLever.lua | 2 +- data/libs/functions/boss_lever.lua | 12 +- 7 files changed, 180 insertions(+), 180 deletions(-) diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua index 0c7854e6f19..ecc656ee04e 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/alptramun.lua @@ -22,7 +22,7 @@ monster.manaCost = 0 monster.events = { "dreamCourtsDeath", - "facelessHealth" + "facelessHealth", } monster.changeTarget = { diff --git a/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua b/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua index 70ca4634314..47604fd9c8a 100644 --- a/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua +++ b/data-otservbr-global/monster/quests/the_dream_courts/bosses/plagueroot.lua @@ -22,7 +22,7 @@ monster.manaCost = 0 monster.events = { "dreamCourtsDeath", - "facelessHealth" + "facelessHealth", } monster.changeTarget = { diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua index c0c12ca9db9..b7e6bd0725c 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_baeloc_fight.lua @@ -23,36 +23,36 @@ local config = { to = Position(33433, 31449, 13), }, onUseExtra = function(player) - addEvent(function() - local baeloc = Creature("Sir Baeloc") - local nictros = Creature("Sir Nictros") + addEvent(function() + local baeloc = Creature("Sir Baeloc") + local nictros = Creature("Sir Nictros") - if baeloc then - baeloc:say("Ah look my Brother! Challengers! After all this time finally a chance to prove our skills!") - addEvent(function() - local nictros = Creature("Sir Nictros") - if nictros then - nictros:say("Indeed! It has been a while! As the elder one I request the right of the first battle!") - end - end, 6 * 1000) - end + if baeloc then + baeloc:say("Ah look my Brother! Challengers! After all this time finally a chance to prove our skills!") + addEvent(function() + local nictros = Creature("Sir Nictros") + if nictros then + nictros:say("Indeed! It has been a while! As the elder one I request the right of the first battle!") + end + end, 6 * 1000) + end - addEvent(function() - local baeloc = Creature("Sir Baeloc") - local nictros = Creature("Sir Nictros") - if baeloc then - baeloc:say("Oh, man! You always get the fun!") - if nictros then - nictros:teleportTo(Position(33426, 31437, 13)) - nictros:setMoveLocked(false) - end - end - end, 12 * 1000) - end, 4 * 1000) + addEvent(function() + local baeloc = Creature("Sir Baeloc") + local nictros = Creature("Sir Nictros") + if baeloc then + baeloc:say("Oh, man! You always get the fun!") + if nictros then + nictros:teleportTo(Position(33426, 31437, 13)) + nictros:setMoveLocked(false) + end + end + end, 12 * 1000) + end, 4 * 1000) end, exit = Position(33290, 32474, 9), } local lever = BossLever(config) lever:position(Position(33423, 31413, 13)) -lever:register() \ No newline at end of file +lever:register() diff --git a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua index 18d54f3986e..283547db05e 100644 --- a/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua +++ b/data-otservbr-global/scripts/quests/grave_danger_quest/actions_duke_fight.lua @@ -1,25 +1,25 @@ local config = { - boss = { - name = "Duke Krule", - createFunction = function() - local boss = Game.createMonster("Duke Krule", Position(33456, 31473, 13), true, true) - boss:setStorageValue(1, os.time()) - return boss - end, - }, - requiredLevel = 250, - playerPositions = { - { pos = Position(33455, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33456, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33457, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33458, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - { pos = Position(33459, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, - }, - specPos = { - from = Position(33447, 31464, 13), - to = Position(33464, 31481, 13), - }, - exit = Position(32347, 32167, 12), + boss = { + name = "Duke Krule", + createFunction = function() + local boss = Game.createMonster("Duke Krule", Position(33456, 31473, 13), true, true) + boss:setStorageValue(1, os.time()) + return boss + end, + }, + requiredLevel = 250, + playerPositions = { + { pos = Position(33455, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33456, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33457, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33458, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + { pos = Position(33459, 31493, 13), teleport = Position(33455, 31464, 13), effect = CONST_ME_TELEPORT }, + }, + specPos = { + from = Position(33447, 31464, 13), + to = Position(33464, 31481, 13), + }, + exit = Position(32347, 32167, 12), } local duke_water = Combat() @@ -27,13 +27,13 @@ duke_water:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO) duke_water:setArea(createCombatArea(AREA_CIRCLE3X3)) function onTargetTile(cid, pos) - local tile = Tile(pos) - local target = tile:getTopCreature() - if tile then - if target and target:isPlayer() and target:getOutfit().lookType == 49 then - doTargetCombatHealth(0, target, COMBAT_ICEDAMAGE, -1500, -2000) - end - end + local tile = Tile(pos) + local target = tile:getTopCreature() + if tile then + if target and target:isPlayer() and target:getOutfit().lookType == 49 then + doTargetCombatHealth(0, target, COMBAT_ICEDAMAGE, -1500, -2000) + end + end end duke_water:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") @@ -43,63 +43,63 @@ duke_fire:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) duke_fire:setArea(createCombatArea(AREA_CIRCLE3X3)) function onTargetTile(cid, pos) - local tile = Tile(pos) - local target = tile:getTopCreature() - if tile then - if target and target:isPlayer() and target:getOutfit().lookType == 286 then - doTargetCombatHealth(0, target, COMBAT_FIREDAMAGE, -1500, -2000) - end - end + local tile = Tile(pos) + local target = tile:getTopCreature() + if tile then + if target and target:isPlayer() and target:getOutfit().lookType == 286 then + doTargetCombatHealth(0, target, COMBAT_FIREDAMAGE, -1500, -2000) + end + end end duke_fire:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") config.onUseExtra = function() - local config = { - centerRoom = Position(33456, 31472, 13), - x = 10, - y = 10, - transformCD = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.TransformCD, - } - local function hitArea(creature) - local player = Player(creature) + local config = { + centerRoom = Position(33456, 31472, 13), + x = 10, + y = 10, + transformCD = Storage.Quest.U12_20.GraveDanger.Bosses.DukeKrule.TransformCD, + } + local function hitArea(creature) + local player = Player(creature) - if player then - if player:getStorageValue(config.transformCD) <= os.time() then - if player:getOutfit().lookType == 49 then - local var = { type = 1, number = creature } - duke_fire:execute(player, var) - player:setStorageValue(config.transformCD, os.time() + 3) - addEvent(hitArea, 3 * 1000, creature) - elseif player:getOutfit().lookType == 286 then - local var = { type = 1, number = creature } - duke_water:execute(player, var) - player:setStorageValue(config.transformCD, os.time() + 3) - addEvent(hitArea, 3 * 1000, creature) - end - end - end + if player then + if player:getStorageValue(config.transformCD) <= os.time() then + if player:getOutfit().lookType == 49 then + local var = { type = 1, number = creature } + duke_fire:execute(player, var) + player:setStorageValue(config.transformCD, os.time() + 3) + addEvent(hitArea, 3 * 1000, creature) + elseif player:getOutfit().lookType == 286 then + local var = { type = 1, number = creature } + duke_water:execute(player, var) + player:setStorageValue(config.transformCD, os.time() + 3) + addEvent(hitArea, 3 * 1000, creature) + end + end + end - return true - end + return true + end - local function transformPlayers(id) - local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) - local form = { 49, 286 } - local boss = Creature("Duke Krule") + local function transformPlayers(id) + local spectators = Game.getSpectators(config.centerRoom, false, true, config.x, config.x, config.y, config.y) + local form = { 49, 286 } + local boss = Creature("Duke Krule") - if boss and boss:getStorageValue(1) == id then - if #spectators > 0 then - for _, player in pairs(spectators) do - doSetCreatureOutfit(player, { lookType = form[math.random(#form)] }, 30 * 1000) - addEvent(hitArea, 3 * 1000, player:getId()) - end - addEvent(transformPlayers, 36 * 1000, id) - end - end - return true - end - addEvent(transformPlayers, 30 * 1000, os.time()) + if boss and boss:getStorageValue(1) == id then + if #spectators > 0 then + for _, player in pairs(spectators) do + doSetCreatureOutfit(player, { lookType = form[math.random(#form)] }, 30 * 1000) + addEvent(hitArea, 3 * 1000, player:getId()) + end + addEvent(transformPlayers, 36 * 1000, id) + end + end + return true + end + addEvent(transformPlayers, 30 * 1000, os.time()) end local lever = BossLever(config) diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua index 9efb945b2f9..e659f384c12 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_dreamscarLevers.lua @@ -1,6 +1,6 @@ local config = { boss = { - name = "", + name = "", position = Position(32208, 32048, 14), }, requiredLevel = 250, @@ -14,53 +14,53 @@ local config = { { pos = Position(32208, 32025, 13), teleport = Position(32207, 32041, 14), effect = CONST_ME_TELEPORT }, }, monsters = { - ["Maxxenius"] = { - { name = "Generator", pos = Position(32205, 32048, 14) }, - { name = "Generator", pos = Position(32210, 32045, 14) }, - { name = "Generator", pos = Position(32210, 32051, 14) }, - }, - ["Alptramun"] = { - { name = "unpleasant dream", pos = Position(32208, 32048, 14) }, - { name = "unpleasant dream", pos = Position(32208, 32048, 14) }, - }, - ["Izcandar The Banished"] = { - { name = "the heat of summer", pos = Position(32204, 32053, 14), delay = 15 * 1000 }, - { name = "the heat of summer", pos = Position(32201, 32047, 14), delay = 15 * 1000 }, - { name = "the heat of summer", pos = Position(32204, 32043, 14), delay = 15 * 1000 }, - { name = "the cold of winter", pos = Position(32211, 32042, 14), delay = 15 * 1000 }, - { name = "the cold of winter", pos = Position(32214, 32048, 14), delay = 15 * 1000 }, - { name = "the cold of winter", pos = Position(32210, 32053, 14), delay = 15 * 1000 }, - }, - ["Plagueroot"] = { - { name = "plant attendant", pos = Position(32204, 32047, 14), delay = 15 * 1000 }, - { name = "plant attendant", pos = Position(32212, 32043, 14), delay = 15 * 1000 }, - { name = "plant attendant", pos = Position(32212, 32050, 14), delay = 15 * 1000 }, - }, - ["Malofur Mangrinder"] = { - { name = "whirling blades", pos = Position(32200, 32046, 14) }, - { name = "whirling blades", pos = Position(32200, 32050, 14) }, - { name = "whirling blades", pos = Position(32202, 32049, 14) }, - { name = "whirling blades", pos = Position(32202, 32051, 14) }, - { name = "whirling blades", pos = Position(32205, 32043, 14) }, - { name = "whirling blades", pos = Position(32200, 32050, 14) }, - { name = "whirling blades", pos = Position(32205, 32048, 14) }, - { name = "whirling blades", pos = Position(32205, 32055, 14) }, - { name = "whirling blades", pos = Position(32206, 32051, 14) }, - { name = "whirling blades", pos = Position(32206, 32040, 14) }, - { name = "whirling blades", pos = Position(32207, 32043, 14) }, - { name = "whirling blades", pos = Position(32207, 32048, 14) }, - { name = "whirling blades", pos = Position(32208, 32051, 14) }, - { name = "whirling blades", pos = Position(32209, 32048, 14) }, - { name = "whirling blades", pos = Position(32209, 32055, 14) }, - { name = "whirling blades", pos = Position(32210, 32051, 14) }, - { name = "whirling blades", pos = Position(32211, 32042, 14) }, - { name = "whirling blades", pos = Position(32211, 32044, 14) }, - { name = "whirling blades", pos = Position(32211, 32046, 14) }, - { name = "whirling blades", pos = Position(32214, 32043, 14) }, - { name = "whirling blades", pos = Position(32214, 32049, 14) }, - { name = "whirling blades", pos = Position(32213, 32052, 14) } - } - }, + ["Maxxenius"] = { + { name = "Generator", pos = Position(32205, 32048, 14) }, + { name = "Generator", pos = Position(32210, 32045, 14) }, + { name = "Generator", pos = Position(32210, 32051, 14) }, + }, + ["Alptramun"] = { + { name = "unpleasant dream", pos = Position(32208, 32048, 14) }, + { name = "unpleasant dream", pos = Position(32208, 32048, 14) }, + }, + ["Izcandar The Banished"] = { + { name = "the heat of summer", pos = Position(32204, 32053, 14), delay = 15 * 1000 }, + { name = "the heat of summer", pos = Position(32201, 32047, 14), delay = 15 * 1000 }, + { name = "the heat of summer", pos = Position(32204, 32043, 14), delay = 15 * 1000 }, + { name = "the cold of winter", pos = Position(32211, 32042, 14), delay = 15 * 1000 }, + { name = "the cold of winter", pos = Position(32214, 32048, 14), delay = 15 * 1000 }, + { name = "the cold of winter", pos = Position(32210, 32053, 14), delay = 15 * 1000 }, + }, + ["Plagueroot"] = { + { name = "plant attendant", pos = Position(32204, 32047, 14), delay = 15 * 1000 }, + { name = "plant attendant", pos = Position(32212, 32043, 14), delay = 15 * 1000 }, + { name = "plant attendant", pos = Position(32212, 32050, 14), delay = 15 * 1000 }, + }, + ["Malofur Mangrinder"] = { + { name = "whirling blades", pos = Position(32200, 32046, 14) }, + { name = "whirling blades", pos = Position(32200, 32050, 14) }, + { name = "whirling blades", pos = Position(32202, 32049, 14) }, + { name = "whirling blades", pos = Position(32202, 32051, 14) }, + { name = "whirling blades", pos = Position(32205, 32043, 14) }, + { name = "whirling blades", pos = Position(32200, 32050, 14) }, + { name = "whirling blades", pos = Position(32205, 32048, 14) }, + { name = "whirling blades", pos = Position(32205, 32055, 14) }, + { name = "whirling blades", pos = Position(32206, 32051, 14) }, + { name = "whirling blades", pos = Position(32206, 32040, 14) }, + { name = "whirling blades", pos = Position(32207, 32043, 14) }, + { name = "whirling blades", pos = Position(32207, 32048, 14) }, + { name = "whirling blades", pos = Position(32208, 32051, 14) }, + { name = "whirling blades", pos = Position(32209, 32048, 14) }, + { name = "whirling blades", pos = Position(32209, 32055, 14) }, + { name = "whirling blades", pos = Position(32210, 32051, 14) }, + { name = "whirling blades", pos = Position(32211, 32042, 14) }, + { name = "whirling blades", pos = Position(32211, 32044, 14) }, + { name = "whirling blades", pos = Position(32211, 32046, 14) }, + { name = "whirling blades", pos = Position(32214, 32043, 14) }, + { name = "whirling blades", pos = Position(32214, 32049, 14) }, + { name = "whirling blades", pos = Position(32213, 32052, 14) }, + }, + }, bossPosition = Position(32207, 32051, 14), specPos = { from = Position(32199, 32039, 14), @@ -70,30 +70,30 @@ local config = { } local function configureLever() - local bossDate = { - ["Monday"] = "Plagueroot", - ["Tuesday"] = "Malofur Mangrinder", - ["Wednesday"] = "Maxxenius", - ["Thursday"] = "Alptramun", - ["Friday"] = "Izcandar The Banished", - ["Saturday"] = "Maxxenius", - ["Sunday"] = "Alptramun", - } - local bossName = bossDate[os.date("%A")] - config.boss.name = bossName - config.monsters = config.monsters[bossName] - if bossName == "Maxxenius" then - config.onUseExtra = function() - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, 0) - end - elseif bossName == "Izcandar The Banished" then - config.onUseExtra = function() - Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarOutfit, 0) - end - end + local bossDate = { + ["Monday"] = "Plagueroot", + ["Tuesday"] = "Malofur Mangrinder", + ["Wednesday"] = "Maxxenius", + ["Thursday"] = "Alptramun", + ["Friday"] = "Izcandar The Banished", + ["Saturday"] = "Maxxenius", + ["Sunday"] = "Alptramun", + } + local bossName = bossDate[os.date("%A")] + config.boss.name = bossName + config.monsters = config.monsters[bossName] + if bossName == "Maxxenius" then + config.onUseExtra = function() + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.AlptramunSummonsKilled, 0) + end + elseif bossName == "Izcandar The Banished" then + config.onUseExtra = function() + Game.setStorageValue(Storage.Quest.U12_00.TheDreamCourts.DreamScarGlobal.IzcandarOutfit, 0) + end + end end configureLever() local dreamCourtsLever = BossLever(config) dreamCourtsLever:position({ x = 32208, y = 32020, z = 13 }) -dreamCourtsLever:register() \ No newline at end of file +dreamCourtsLever:register() diff --git a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua index 43814ea808a..75dcc91bbb9 100644 --- a/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua +++ b/data-otservbr-global/scripts/quests/the_dream_courts_quest/actions_facelessLever.lua @@ -21,4 +21,4 @@ local config = { local lever = BossLever(config) lever:uid(1039) -lever:register() \ No newline at end of file +lever:register() diff --git a/data/libs/functions/boss_lever.lua b/data/libs/functions/boss_lever.lua index 92901d66f4f..1d1318dc690 100644 --- a/data/libs/functions/boss_lever.lua +++ b/data/libs/functions/boss_lever.lua @@ -240,12 +240,12 @@ function BossLever:onUse(player) monster:registerEvent("BossLeverOnDeath") end for _, monster in pairs(self.monsters) do - if monster.delay then - addEvent(Game.createMonster, monster.delay, monster.name, monster.pos, true, true) - else - Game.createMonster(monster.name, monster.pos, true, true) - end - end + if monster.delay then + addEvent(Game.createMonster, monster.delay, monster.name, monster.pos, true, true) + else + Game.createMonster(monster.name, monster.pos, true, true) + end + end lever:teleportPlayers() if self.encounter then local encounter = Encounter(self.encounter) From c56a77b88e13eed1019cf02db8e06d58aa5c95d0 Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Tue, 19 Nov 2024 20:32:34 -0300 Subject: [PATCH 21/22] KilmareshQuest - freequest --- .../scripts/creaturescripts/customs/freequests.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua b/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua index bfeac7acad0..ad20027cd40 100644 --- a/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua +++ b/data-otservbr-global/scripts/creaturescripts/customs/freequests.lua @@ -290,8 +290,12 @@ local questTable = { { storageName = "ForgottenKnowledge.AccessGolden", storage = Storage.Quest.U11_02.ForgottenKnowledge.AccessGolden, storageValue = 1 }, { storageName = "GrimvaleQuest.AncientFeudDoors", storage = Storage.Quest.U10_80.GrimvaleQuest.AncientFeudDoors, storageValue = 1 }, { storageName = "GrimvaleQuest.AncientFeudShortcut", storage = Storage.Quest.U10_80.GrimvaleQuest.AncientFeudShortcut, storageValue = 1 }, - { storageName = "Kilmaresh.AccessDoor", storage = Storage.Kilmaresh.AccessDoor, storageValue = 1 }, - { storageName = "Kilmaresh.CatacombDoors", storage = Storage.Kilmaresh.CatacombDoors, storageValue = 1 }, + { storageName = "KilmareshQuest.AccessDoor", storage = Storage.Quest.U12_20.KilmareshQuest.AccessDoor, storageValue = 1 }, + { storageName = "KilmareshQuest.Second.Investigating", storage = Storage.Quest.U12_20.KilmareshQuest.Second.Investigating, storageValue = 1 }, + { storageName = "KilmareshQuest.Sixth.GryphonMask", storage = Storage.Quest.U12_20.KilmareshQuest.Sixth.GryphonMask, storageValue = 1 }, + { storageName = "KilmareshQuest.Sixth.MirrorMask", storage = Storage.Quest.U12_20.KilmareshQuest.Sixth.MirrorMask, storageValue = 1 }, + { storageName = "KilmareshQuest.Sixth.IvoryMask", storage = Storage.Quest.U12_20.KilmareshQuest.Sixth.IvoryMask, storageValue = 1 }, + { storageName = "KilmareshQuest.Sixth.SilverMask", storage = Storage.Quest.U12_20.KilmareshQuest.Sixth.SilverMask, storageValue = 1 }, { storageName = "TheOrderOfTheLion.AccessEastSide", storage = Storage.Quest.U12_40.TheOrderOfTheLion.AccessEastSide, storageValue = 1 }, { storageName = "TheOrderOfTheLion.AccessSouthernSide", storage = Storage.Quest.U12_40.TheOrderOfTheLion.AccessSouthernSide, storageValue = 1 }, { storageName = "APiratesTail.TentuglyDoor", storage = Storage.Quest.U12_60.APiratesTail.TentuglyDoor, storageValue = 1 }, From 90c4320f4eacfce63a166584cfeefe36c2cbe5bd Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:03:26 -0300 Subject: [PATCH 22/22] Fix The Secret Library Quest --- data-otservbr-global/lib/core/storages.lua | 141 +++++++++--------- .../actions/other/others/quest_system2.lua | 2 +- 2 files changed, 72 insertions(+), 71 deletions(-) diff --git a/data-otservbr-global/lib/core/storages.lua b/data-otservbr-global/lib/core/storages.lua index c78b9135c32..8a48ff75451 100644 --- a/data-otservbr-global/lib/core/storages.lua +++ b/data-otservbr-global/lib/core/storages.lua @@ -2556,88 +2556,89 @@ Storage = { UndergroundBastion = 46028, Key0909 = 46029, }, + FalconBastionAccess = 46030, }, Darashia = { - Questline = 46030, - PuzzleSqm = 46031, - FirstChest = 46032, - SecondChest = 46033, - ThirdChest = 46034, - FourthChest = 46035, - RedColor = 46036, - GreenColor = 46037, - BlueColor = 46038, - ColorPuzzle = 46039, - EatenFood = 46040, - FirstTotem = 46041, - SecondTotem = 46042, - ThirdTotem = 46043, - FourthTotem = 46044, - FifthChest = 46045, - ScorpionTimer = 46046, + Questline = 46031, + PuzzleSqm = 46032, + FirstChest = 46033, + SecondChest = 46034, + ThirdChest = 46035, + FourthChest = 46036, + RedColor = 46037, + GreenColor = 46038, + BlueColor = 46039, + ColorPuzzle = 46040, + EatenFood = 46041, + FirstTotem = 46042, + SecondTotem = 46043, + ThirdTotem = 46044, + FourthTotem = 46045, + FifthChest = 46046, + ScorpionTimer = 46047, }, LiquidDeath = { - Questline = 46047, - Statue1 = 46048, - Statue2 = 46049, - Statue3 = 46050, - Statue4 = 46051, - Statue5 = 46052, - Statue6 = 46053, - Statue7 = 46054, - Statue8 = 46055, - Statue9 = 46056, - StatueCount = 46057, - BrokulTimer = 46058, - BrokulTimerGlobal = 46059, + Questline = 46048, + Statue1 = 46049, + Statue2 = 46050, + Statue3 = 46051, + Statue4 = 46052, + Statue5 = 46053, + Statue6 = 46054, + Statue7 = 46055, + Statue8 = 46056, + Statue9 = 46057, + StatueCount = 46058, + BrokulTimer = 46059, + BrokulTimerGlobal = 46060, }, MoTA = { - Questline = 46060, - LeverPermission = 46061, - SampleBlood = 46062, - BonyRod = 46063, - BrokenCompass = 46064, - Crystal1 = 46065, - Crystal2 = 46066, - Crystal3 = 46067, - Crystal4 = 46068, - Crystal5 = 46069, - Crystal6 = 46070, - Crystal7 = 46071, - Crystal8 = 46072, - YellowGem = 46073, - GreenGem = 46074, - RedGem = 46075, - FinalBasin = 46076, - SkullSample = 46077, - TakenRod = 46078, - TrialTimer = 46079, - MuseumTimer = 46080, + Questline = 46061, + LeverPermission = 46062, + SampleBlood = 46063, + BonyRod = 46064, + BrokenCompass = 46065, + Crystal1 = 46066, + Crystal2 = 46067, + Crystal3 = 46068, + Crystal4 = 46069, + Crystal5 = 46070, + Crystal6 = 46071, + Crystal7 = 46072, + Crystal8 = 46073, + YellowGem = 46074, + GreenGem = 46075, + RedGem = 46076, + FinalBasin = 46077, + SkullSample = 46078, + TakenRod = 46079, + TrialTimer = 46080, + MuseumTimer = 46081, }, SmallIslands = { - Questline = 46081, - Parchment = 46082, - Sapphire = 46083, - Shovel = 46084, - Fishing = 46085, - RaxiasTimer = 46086, - BoatStages = 46087, - Hawser = 46088, - Turtle = 46089, - }, - LibraryPermission = 46090, + Questline = 46082, + Parchment = 46083, + Sapphire = 46084, + Shovel = 46085, + Fishing = 46086, + RaxiasTimer = 46087, + BoatStages = 46088, + Hawser = 46089, + Turtle = 46090, + }, + LibraryPermission = 46091, Library = { - Questline = 46091, - MazzinorTimer = 46092, - LokathmorTimer = 46093, - GhuloshTimer = 46094, - GorzindelTimer = 46095, - Ghulosh = 46096, + Questline = 46092, + MazzinorTimer = 46093, + LokathmorTimer = 46094, + GhuloshTimer = 46095, + GorzindelTimer = 46096, + Ghulosh = 46097, }, }, BattleMageOutfits = { - Addon1 = 46097, - Addon2 = 46098, + Addon1 = 46098, + Addon2 = 46099, }, DiscovererOutfits = {}, MeasuringTibia = {}, diff --git a/data-otservbr-global/scripts/actions/other/others/quest_system2.lua b/data-otservbr-global/scripts/actions/other/others/quest_system2.lua index 89b61977dfc..3508b585eba 100644 --- a/data-otservbr-global/scripts/actions/other/others/quest_system2.lua +++ b/data-otservbr-global/scripts/actions/other/others/quest_system2.lua @@ -309,7 +309,7 @@ This page seems to be part of a book about ancient rituals, mystic incantations name = "Falcon Bastion Access", }, }, - storage = Storage.Quest.U11_80.TheSecretLibrary.FalconBastionAccess, + storage = Storage.Quest.U11_80.TheSecretLibrary.FalconBastion.FalconBastionAccess, }, [20002] = { items = {