diff --git a/data-otservbr-global/monster/bosses/black_knight.lua b/data-otservbr-global/monster/bosses/black_knight.lua index fe50d74af3f..2905e1a7814 100644 --- a/data-otservbr-global/monster/bosses/black_knight.lua +++ b/data-otservbr-global/monster/bosses/black_knight.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "BlackKnightDeath", +} + monster.bosstiary = { bossRaceId = 46, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/bosses/diseased_bill.lua b/data-otservbr-global/monster/bosses/diseased_bill.lua index b8982c4e259..c2524dd8267 100644 --- a/data-otservbr-global/monster/bosses/diseased_bill.lua +++ b/data-otservbr-global/monster/bosses/diseased_bill.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "DiseasedTrioDeath", +} + monster.bosstiary = { bossRaceId = 485, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/bosses/diseased_dan.lua b/data-otservbr-global/monster/bosses/diseased_dan.lua index 8eb9d3a1535..7ee84a080a1 100644 --- a/data-otservbr-global/monster/bosses/diseased_dan.lua +++ b/data-otservbr-global/monster/bosses/diseased_dan.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "DiseasedTrioDeath", +} + monster.bosstiary = { bossRaceId = 486, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/bosses/diseased_fred.lua b/data-otservbr-global/monster/bosses/diseased_fred.lua index e516fd9e2df..d2ab31a5578 100644 --- a/data-otservbr-global/monster/bosses/diseased_fred.lua +++ b/data-otservbr-global/monster/bosses/diseased_fred.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "DiseasedTrioDeath", +} + monster.bosstiary = { bossRaceId = 484, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/bosses/energized_raging_mage.lua b/data-otservbr-global/monster/bosses/energized_raging_mage.lua index d8d7d4809e8..0d3aea8aaf0 100644 --- a/data-otservbr-global/monster/bosses/energized_raging_mage.lua +++ b/data-otservbr-global/monster/bosses/energized_raging_mage.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "EnergizedRagingMageDeath", +} + monster.health = 3500 monster.maxHealth = 3500 monster.race = "blood" diff --git a/data-otservbr-global/monster/bosses/kroazur.lua b/data-otservbr-global/monster/bosses/kroazur.lua index 78357fbf8e7..14740f8f522 100644 --- a/data-otservbr-global/monster/bosses/kroazur.lua +++ b/data-otservbr-global/monster/bosses/kroazur.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ThreatenedDreamsNightmareMonstersDeath", +} + monster.bosstiary = { bossRaceId = 1515, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/bosses/pythius_the_rotten.lua b/data-otservbr-global/monster/bosses/pythius_the_rotten.lua index 3331d64e027..b635ea69133 100644 --- a/data-otservbr-global/monster/bosses/pythius_the_rotten.lua +++ b/data-otservbr-global/monster/bosses/pythius_the_rotten.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "PythiusTheRottenDeath", +} + monster.health = 9000 monster.maxHealth = 9000 monster.race = "undead" diff --git a/data-otservbr-global/monster/bosses/raging_mage.lua b/data-otservbr-global/monster/bosses/raging_mage.lua index 39518d5431a..5fd30131b8a 100644 --- a/data-otservbr-global/monster/bosses/raging_mage.lua +++ b/data-otservbr-global/monster/bosses/raging_mage.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "RagingMageDeath", +} + monster.health = 3500 monster.maxHealth = 3500 monster.race = "blood" diff --git a/data-otservbr-global/monster/bosses/renegade_orc.lua b/data-otservbr-global/monster/bosses/renegade_orc.lua index c12f3d73e39..53f075751ae 100644 --- a/data-otservbr-global/monster/bosses/renegade_orc.lua +++ b/data-otservbr-global/monster/bosses/renegade_orc.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "RenegadeOrcDeath", +} + monster.health = 450 monster.maxHealth = 450 monster.race = "blood" diff --git a/data-otservbr-global/monster/bosses/splasher.lua b/data-otservbr-global/monster/bosses/splasher.lua index 670c402c859..b579d921327 100644 --- a/data-otservbr-global/monster/bosses/splasher.lua +++ b/data-otservbr-global/monster/bosses/splasher.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "QuaraLeadersDeath", +} + monster.health = 1700 monster.maxHealth = 1700 monster.race = "blood" diff --git a/data-otservbr-global/monster/constructs/diamond_servant_replica.lua b/data-otservbr-global/monster/constructs/diamond_servant_replica.lua index 487811413e1..733ea51c2fe 100644 --- a/data-otservbr-global/monster/constructs/diamond_servant_replica.lua +++ b/data-otservbr-global/monster/constructs/diamond_servant_replica.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ReplicaServantDeath", +} + monster.raceId = 1326 monster.Bestiary = { class = "Construct", diff --git a/data-otservbr-global/monster/constructs/golden_servant_replica.lua b/data-otservbr-global/monster/constructs/golden_servant_replica.lua index dbf2b07dfeb..4a93d0d9635 100644 --- a/data-otservbr-global/monster/constructs/golden_servant_replica.lua +++ b/data-otservbr-global/monster/constructs/golden_servant_replica.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ReplicaServantDeath", +} + monster.raceId = 1327 monster.Bestiary = { class = "Construct", diff --git a/data-otservbr-global/monster/dawnport/mountain_troll.lua b/data-otservbr-global/monster/dawnport/mountain_troll.lua index 86e38adf4cd..fab1ebf82b5 100644 --- a/data-otservbr-global/monster/dawnport/mountain_troll.lua +++ b/data-otservbr-global/monster/dawnport/mountain_troll.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "MorrisTrollDeath", +} + monster.health = 30 monster.maxHealth = 30 monster.race = "blood" diff --git a/data-otservbr-global/monster/dawnport/muglex_clan_footman.lua b/data-otservbr-global/monster/dawnport/muglex_clan_footman.lua index 53bc52730f5..2695c29aea9 100644 --- a/data-otservbr-global/monster/dawnport/muglex_clan_footman.lua +++ b/data-otservbr-global/monster/dawnport/muglex_clan_footman.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "MorrisGoblinDeath", +} + monster.health = 50 monster.maxHealth = 50 monster.race = "blood" diff --git a/data-otservbr-global/monster/dragons/dragon.lua b/data-otservbr-global/monster/dragons/dragon.lua index 52ca6324429..16dd2aa26c7 100644 --- a/data-otservbr-global/monster/dragons/dragon.lua +++ b/data-otservbr-global/monster/dragons/dragon.lua @@ -13,6 +13,11 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "TheGreatDragonHuntDeath", + "TheFirstDragonDragonTaskDeath", +} + monster.raceId = 34 monster.Bestiary = { class = "Dragon", diff --git a/data-otservbr-global/monster/dragons/dragon_lord.lua b/data-otservbr-global/monster/dragons/dragon_lord.lua index 57ce3725109..65d7e225e47 100644 --- a/data-otservbr-global/monster/dragons/dragon_lord.lua +++ b/data-otservbr-global/monster/dragons/dragon_lord.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "TheGreatDragonHuntDeath", +} + monster.raceId = 39 monster.Bestiary = { class = "Dragon", diff --git a/data-otservbr-global/monster/extra_dimensional/yielothax.lua b/data-otservbr-global/monster/extra_dimensional/yielothax.lua index 76b1194cd07..487a8d5c30d 100644 --- a/data-otservbr-global/monster/extra_dimensional/yielothax.lua +++ b/data-otservbr-global/monster/extra_dimensional/yielothax.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "YielothaxDeath", +} + monster.raceId = 717 monster.Bestiary = { class = "Extra Dimensional", diff --git a/data-otservbr-global/monster/humanoids/lost_exile.lua b/data-otservbr-global/monster/humanoids/lost_exile.lua index 8fc53213306..d1bb52aaa09 100644 --- a/data-otservbr-global/monster/humanoids/lost_exile.lua +++ b/data-otservbr-global/monster/humanoids/lost_exile.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "LastExileDeath", +} + monster.raceId = 1529 monster.Bestiary = { class = "Humanoid", diff --git a/data-otservbr-global/monster/humanoids/minotaur_bruiser.lua b/data-otservbr-global/monster/humanoids/minotaur_bruiser.lua index b704e765d2c..51eb241298c 100644 --- a/data-otservbr-global/monster/humanoids/minotaur_bruiser.lua +++ b/data-otservbr-global/monster/humanoids/minotaur_bruiser.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "MorrisMinotaurDeath", +} + monster.health = 100 monster.maxHealth = 100 monster.race = "blood" diff --git a/data-otservbr-global/monster/humanoids/minotaur_cult_follower.lua b/data-otservbr-global/monster/humanoids/minotaur_cult_follower.lua index 1aff1c992c6..18883c46827 100644 --- a/data-otservbr-global/monster/humanoids/minotaur_cult_follower.lua +++ b/data-otservbr-global/monster/humanoids/minotaur_cult_follower.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "MinotaurCultTaskDeath", +} + monster.raceId = 1508 monster.Bestiary = { class = "Humanoid", diff --git a/data-otservbr-global/monster/humanoids/minotaur_cult_prophet.lua b/data-otservbr-global/monster/humanoids/minotaur_cult_prophet.lua index 13e823fa17a..5f86e2de209 100644 --- a/data-otservbr-global/monster/humanoids/minotaur_cult_prophet.lua +++ b/data-otservbr-global/monster/humanoids/minotaur_cult_prophet.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "MinotaurCultTaskDeath", +} + monster.raceId = 1509 monster.Bestiary = { class = "Humanoid", diff --git a/data-otservbr-global/monster/humanoids/minotaur_cult_zealot.lua b/data-otservbr-global/monster/humanoids/minotaur_cult_zealot.lua index be4fc8a4bdc..571d3faa060 100644 --- a/data-otservbr-global/monster/humanoids/minotaur_cult_zealot.lua +++ b/data-otservbr-global/monster/humanoids/minotaur_cult_zealot.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "MinotaurCultTaskDeath", +} + monster.raceId = 1510 monster.Bestiary = { class = "Humanoid", diff --git a/data-otservbr-global/monster/humans/burning_gladiator.lua b/data-otservbr-global/monster/humans/burning_gladiator.lua index 70f9f4f0c1d..8923d0928cb 100644 --- a/data-otservbr-global/monster/humans/burning_gladiator.lua +++ b/data-otservbr-global/monster/humans/burning_gladiator.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "FafnarMissionsDeath", +} + monster.raceId = 1798 monster.Bestiary = { class = "Human", diff --git a/data-otservbr-global/monster/humans/nomad.lua b/data-otservbr-global/monster/humans/nomad.lua index d656857b42f..9c34282bf80 100644 --- a/data-otservbr-global/monster/humans/nomad.lua +++ b/data-otservbr-global/monster/humans/nomad.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "NomadDeath", +} + monster.raceId = 310 monster.Bestiary = { class = "Human", diff --git a/data-otservbr-global/monster/humans/nomad_blue.lua b/data-otservbr-global/monster/humans/nomad_blue.lua index 02465d966f7..07ba7aff29a 100644 --- a/data-otservbr-global/monster/humans/nomad_blue.lua +++ b/data-otservbr-global/monster/humans/nomad_blue.lua @@ -14,6 +14,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "NomadDeath", +} + monster.raceId = 777 monster.Bestiary = { class = "Human", diff --git a/data-otservbr-global/monster/humans/nomad_female.lua b/data-otservbr-global/monster/humans/nomad_female.lua index 2703f84d4c6..9460aab59cf 100644 --- a/data-otservbr-global/monster/humans/nomad_female.lua +++ b/data-otservbr-global/monster/humans/nomad_female.lua @@ -14,6 +14,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "NomadDeath", +} + monster.raceId = 776 monster.Bestiary = { class = "Human", diff --git a/data-otservbr-global/monster/humans/priestess_of_the_wild_sun.lua b/data-otservbr-global/monster/humans/priestess_of_the_wild_sun.lua index 25eea0d8723..a97c9a3c56d 100644 --- a/data-otservbr-global/monster/humans/priestess_of_the_wild_sun.lua +++ b/data-otservbr-global/monster/humans/priestess_of_the_wild_sun.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "FafnarMissionsDeath", +} + monster.raceId = 1799 monster.Bestiary = { class = "Human", diff --git a/data-otservbr-global/monster/magicals/crystalcrusher.lua b/data-otservbr-global/monster/magicals/crystalcrusher.lua index c0698ab34b5..4da886c9df3 100644 --- a/data-otservbr-global/monster/magicals/crystalcrusher.lua +++ b/data-otservbr-global/monster/magicals/crystalcrusher.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "MiddleSpikeDeath", +} + monster.raceId = 869 monster.Bestiary = { class = "Magical", diff --git a/data-otservbr-global/monster/magicals/enfeebled_silencer.lua b/data-otservbr-global/monster/magicals/enfeebled_silencer.lua index 95bd1948831..c631f75d0cb 100644 --- a/data-otservbr-global/monster/magicals/enfeebled_silencer.lua +++ b/data-otservbr-global/monster/magicals/enfeebled_silencer.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ThreatenedDreamsNightmareMonstersDeath", +} + monster.raceId = 1443 monster.Bestiary = { class = "Magical", diff --git a/data-otservbr-global/monster/magicals/frazzlemaw.lua b/data-otservbr-global/monster/magicals/frazzlemaw.lua index 50927628608..32a053b1dcc 100644 --- a/data-otservbr-global/monster/magicals/frazzlemaw.lua +++ b/data-otservbr-global/monster/magicals/frazzlemaw.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "RoshamuulKillsDeath", +} + monster.raceId = 1022 monster.Bestiary = { class = "Magical", diff --git a/data-otservbr-global/monster/magicals/silencer.lua b/data-otservbr-global/monster/magicals/silencer.lua index e71ec572cef..b2399ce294d 100644 --- a/data-otservbr-global/monster/magicals/silencer.lua +++ b/data-otservbr-global/monster/magicals/silencer.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "RoshamuulKillsDeath", +} + monster.raceId = 1014 monster.Bestiary = { class = "Magical", diff --git a/data-otservbr-global/monster/magicals/weakened_frazzlemaw.lua b/data-otservbr-global/monster/magicals/weakened_frazzlemaw.lua index d44126f9518..d7e8eba093f 100644 --- a/data-otservbr-global/monster/magicals/weakened_frazzlemaw.lua +++ b/data-otservbr-global/monster/magicals/weakened_frazzlemaw.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ThreatenedDreamsNightmareMonstersDeath", +} + monster.raceId = 1442 monster.Bestiary = { class = "Magical", diff --git a/data-otservbr-global/monster/mammals/husky.lua b/data-otservbr-global/monster/mammals/husky.lua index 314d948e454..dae58bcc664 100644 --- a/data-otservbr-global/monster/mammals/husky.lua +++ b/data-otservbr-global/monster/mammals/husky.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "HuskyDeath", +} + monster.raceId = 325 monster.Bestiary = { class = "Mammal", diff --git a/data-otservbr-global/monster/mammals/rat.lua b/data-otservbr-global/monster/mammals/rat.lua index 17747658eea..205888f9a55 100644 --- a/data-otservbr-global/monster/mammals/rat.lua +++ b/data-otservbr-global/monster/mammals/rat.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "RationalRequestRatDeath", +} + monster.raceId = 21 monster.Bestiary = { class = "Mammal", diff --git a/data-otservbr-global/monster/quests/bigfoots_burden/bosses/abyssador.lua b/data-otservbr-global/monster/quests/bigfoots_burden/bosses/abyssador.lua index 177700eedf9..24c993fda5b 100644 --- a/data-otservbr-global/monster/quests/bigfoots_burden/bosses/abyssador.lua +++ b/data-otservbr-global/monster/quests/bigfoots_burden/bosses/abyssador.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "BossesWarzoneDeath", +} + monster.bosstiary = { bossRaceId = 887, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/bigfoots_burden/bosses/deathstrike.lua b/data-otservbr-global/monster/quests/bigfoots_burden/bosses/deathstrike.lua index 9fef07f960d..b7e88ede791 100644 --- a/data-otservbr-global/monster/quests/bigfoots_burden/bosses/deathstrike.lua +++ b/data-otservbr-global/monster/quests/bigfoots_burden/bosses/deathstrike.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "BossesWarzoneDeath", +} + monster.bosstiary = { bossRaceId = 892, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/bigfoots_burden/bosses/gnomevil.lua b/data-otservbr-global/monster/quests/bigfoots_burden/bosses/gnomevil.lua index b0d0a7487a1..cd287d83709 100644 --- a/data-otservbr-global/monster/quests/bigfoots_burden/bosses/gnomevil.lua +++ b/data-otservbr-global/monster/quests/bigfoots_burden/bosses/gnomevil.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "BossesWarzoneDeath", +} + monster.bosstiary = { bossRaceId = 893, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/bigfoots_burden/versperoth.lua b/data-otservbr-global/monster/quests/bigfoots_burden/versperoth.lua index d8e260236fd..c422f817bb2 100644 --- a/data-otservbr-global/monster/quests/bigfoots_burden/versperoth.lua +++ b/data-otservbr-global/monster/quests/bigfoots_burden/versperoth.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "VesperothDeath", +} + monster.health = 100000 monster.maxHealth = 100000 monster.race = "venom" diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/dorokoll_the_mystic.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/dorokoll_the_mystic.lua index 018dc2c092e..926fb0c79ac 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/dorokoll_the_mystic.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/dorokoll_the_mystic.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "EssenceOfMaliceSpawnsDeath", +} + monster.health = 30000 monster.maxHealth = 30000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/eliz_the_unyielding.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/eliz_the_unyielding.lua index bc6aa5b1741..41c7815e73c 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/eliz_the_unyielding.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/eliz_the_unyielding.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "EssenceOfMaliceSpawnsDeath", +} + monster.health = 30000 monster.maxHealth = 30000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/eshtaba_the_conjurer.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/eshtaba_the_conjurer.lua index 175b0df635e..b6190942dbc 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/eshtaba_the_conjurer.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/eshtaba_the_conjurer.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "EssenceOfMaliceSpawnsDeath", +} + monster.health = 30000 monster.maxHealth = 30000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/essence_of_malice.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/essence_of_malice.lua index e9b7c7d9105..ef49131374d 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/essence_of_malice.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/essence_of_malice.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "CultsOfTibiaBossDeath", +} + monster.bosstiary = { bossRaceId = 1487, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/malkhar_deathbringer.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/malkhar_deathbringer.lua index 14013f130ec..7b800bd8f22 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/malkhar_deathbringer.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/malkhar_deathbringer.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "EssenceOfMaliceSpawnsDeath", +} + monster.health = 30000 monster.maxHealth = 30000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/mezlon_the_defiler.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/mezlon_the_defiler.lua index 425ae3cc725..3576693ea0f 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/mezlon_the_defiler.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/mezlon_the_defiler.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "EssenceOfMaliceSpawnsDeath", +} + monster.health = 30000 monster.maxHealth = 30000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_death.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_death.lua index 9ef05c56c67..5ad9d82334b 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_death.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_death.lua @@ -14,6 +14,10 @@ monster.corpse = 0 monster.speed = 0 monster.manaCost = 0 +monster.events = { + "DestroyedPillar", +} + monster.changeTarget = { interval = 4000, chance = 20, diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_draining.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_draining.lua index ec8fb38d78e..c2bb501e3b6 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_draining.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_draining.lua @@ -14,6 +14,10 @@ monster.corpse = 0 monster.speed = 0 monster.manaCost = 0 +monster.events = { + "DestroyedPillar", +} + monster.changeTarget = { interval = 4000, chance = 20, diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_healing.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_healing.lua index fff5544ece4..95c185f7d4c 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_healing.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_healing.lua @@ -14,6 +14,10 @@ monster.corpse = 0 monster.speed = 0 monster.manaCost = 0 +monster.events = { + "DestroyedPillar", +} + monster.changeTarget = { interval = 4000, chance = 20, diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_protection.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_protection.lua index d8d103b22f3..5729390a4d8 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_protection.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_protection.lua @@ -14,6 +14,10 @@ monster.corpse = 0 monster.speed = 0 monster.manaCost = 0 +monster.events = { + "DestroyedPillar", +} + monster.changeTarget = { interval = 4000, chance = 20, diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_summoning.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_summoning.lua index a6e02db4fbc..27937b85537 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_summoning.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/pillars/pillar_of_summoning.lua @@ -14,6 +14,10 @@ monster.corpse = 0 monster.speed = 0 monster.manaCost = 0 +monster.events = { + "DestroyedPillar", +} + monster.changeTarget = { interval = 4000, chance = 20, diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/ravenous_hunger.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/ravenous_hunger.lua index cee0dd32fc6..ee9b5d37a66 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/ravenous_hunger.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/ravenous_hunger.lua @@ -13,6 +13,11 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "LeidenHeal", + "CultsOfTibiaBossDeath", +} + monster.bosstiary = { bossRaceId = 1427, bossRace = RARITY_ARCHFOE, @@ -57,10 +62,6 @@ monster.flags = { canWalkOnPoison = true, } -monster.events = { - "LeidenHeal", -} - monster.light = { level = 0, color = 0, diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_corruptor_of_souls.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_corruptor_of_souls.lua index dfcc46ab6d7..adc1b89d393 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_corruptor_of_souls.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_corruptor_of_souls.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "CultsOfTibiaBossDeath", +} + monster.health = 290000 monster.maxHealth = 290000 monster.race = "venom" diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_false_god.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_false_god.lua index 888f068159b..a1ec678bdf0 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_false_god.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_false_god.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "CultsOfTibiaBossDeath", +} + monster.bosstiary = { bossRaceId = 1409, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_sandking.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_sandking.lua index 89ef694e51a..3e0914007db 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_sandking.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_sandking.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "CultsOfTibiaBossDeath", +} + monster.bosstiary = { bossRaceId = 1444, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_souldespoiler.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_souldespoiler.lua index abcf4d8fc27..35878eae9bf 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_souldespoiler.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_souldespoiler.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "CultsOfTibiaBossDeath", +} + monster.bosstiary = { bossRaceId = 1422, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_source_of_corruption.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_source_of_corruption.lua index ef660075883..83f14ead593 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_source_of_corruption.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_source_of_corruption.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "CultsOfTibiaBossDeath", +} + monster.bosstiary = { bossRaceId = 1500, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_unarmored_voidborn.lua b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_unarmored_voidborn.lua index 40c70d77fb7..0dbf6743e2d 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_unarmored_voidborn.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/bosses/the_unarmored_voidborn.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "CultsOfTibiaBossDeath", +} + monster.bosstiary = { bossRaceId = 1406, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/cult_believer.lua b/data-otservbr-global/monster/quests/cults_of_tibia/cult_believer.lua index 71a717df8f3..18c727b1eab 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/cult_believer.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/cult_believer.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "CarlinVortexDeath", +} + monster.raceId = 1512 monster.Bestiary = { class = "Human", diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/cult_enforcer.lua b/data-otservbr-global/monster/quests/cults_of_tibia/cult_enforcer.lua index 27b33840d4c..abe7c8d4a9a 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/cult_enforcer.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/cult_enforcer.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "CarlinVortexDeath", +} + monster.raceId = 1513 monster.Bestiary = { class = "Human", diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/cult_scholar.lua b/data-otservbr-global/monster/quests/cults_of_tibia/cult_scholar.lua index e4d9b02ada5..bd743a11076 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/cult_scholar.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/cult_scholar.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "CarlinVortexDeath", +} + monster.raceId = 1514 monster.Bestiary = { class = "Human", diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/misguided_bully.lua b/data-otservbr-global/monster/quests/cults_of_tibia/misguided_bully.lua index 8f653d2f2dd..5cf1c3b8582 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/misguided_bully.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/misguided_bully.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "GlowingRubbishAmuletDeath", +} + monster.raceId = 1412 monster.Bestiary = { class = "Humanoid", diff --git a/data-otservbr-global/monster/quests/cults_of_tibia/misguided_shadow.lua b/data-otservbr-global/monster/quests/cults_of_tibia/misguided_shadow.lua index 5886f068e97..547c67f7cf1 100644 --- a/data-otservbr-global/monster/quests/cults_of_tibia/misguided_shadow.lua +++ b/data-otservbr-global/monster/quests/cults_of_tibia/misguided_shadow.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "GlowingRubbishAmuletDeath", +} + monster.health = 3000 monster.maxHealth = 3000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_baron_from_below.lua b/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_baron_from_below.lua index 12c461e44a3..e780ac65c8b 100644 --- a/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_baron_from_below.lua +++ b/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_baron_from_below.lua @@ -13,6 +13,11 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "DepthWarzoneBossDeath", + "TheBaronFromBelowThink", +} + monster.health = 350000 monster.maxHealth = 350000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_count_of_the_core.lua b/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_count_of_the_core.lua index 3a9b1726e29..80878aaa360 100644 --- a/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_count_of_the_core.lua +++ b/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_count_of_the_core.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "DepthWarzoneBossDeath", +} + monster.health = 350000 monster.maxHealth = 350000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_duke_of_the_depths.lua b/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_duke_of_the_depths.lua index eb960a171e0..31c354f7667 100644 --- a/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_duke_of_the_depths.lua +++ b/data-otservbr-global/monster/quests/dangerous_depth/bosses/the_duke_of_the_depths.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "DepthWarzoneBossDeath", +} + monster.health = 350000 monster.maxHealth = 350000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/dangerous_depth/makeshift_home.lua b/data-otservbr-global/monster/quests/dangerous_depth/makeshift_home.lua index fc70f937f66..0b64ccee736 100644 --- a/data-otservbr-global/monster/quests/dangerous_depth/makeshift_home.lua +++ b/data-otservbr-global/monster/quests/dangerous_depth/makeshift_home.lua @@ -14,6 +14,10 @@ monster.corpse = 0 monster.speed = 0 monster.manaCost = 0 +monster.events = { + "MakeshiftHomeDeath", +} + monster.changeTarget = { interval = 5000, chance = 10, diff --git a/data-otservbr-global/monster/quests/dangerous_depth/organic_matter.lua b/data-otservbr-global/monster/quests/dangerous_depth/organic_matter.lua index a7d5ec477be..bf292570fb8 100644 --- a/data-otservbr-global/monster/quests/dangerous_depth/organic_matter.lua +++ b/data-otservbr-global/monster/quests/dangerous_depth/organic_matter.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "OrganicMatterDeath", +} + monster.health = 10000 monster.maxHealth = 10000 monster.race = "venom" diff --git a/data-otservbr-global/monster/quests/dangerous_depth/snail_slime.lua b/data-otservbr-global/monster/quests/dangerous_depth/snail_slime.lua index e5e4942e6d4..2bfa943c47a 100644 --- a/data-otservbr-global/monster/quests/dangerous_depth/snail_slime.lua +++ b/data-otservbr-global/monster/quests/dangerous_depth/snail_slime.lua @@ -13,6 +13,11 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "SnailSlimeDeath", + "SnailSlimeThink", +} + monster.health = 4500 monster.maxHealth = 4500 monster.race = "venom" diff --git a/data-otservbr-global/monster/quests/dark_trails/death_priest_shargon.lua b/data-otservbr-global/monster/quests/dark_trails/death_priest_shargon.lua index 13fd2f07c51..c64a01061b9 100644 --- a/data-otservbr-global/monster/quests/dark_trails/death_priest_shargon.lua +++ b/data-otservbr-global/monster/quests/dark_trails/death_priest_shargon.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ShargonDeath", +} + monster.bosstiary = { bossRaceId = 1047, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/quests/dark_trails/the_ravager.lua b/data-otservbr-global/monster/quests/dark_trails/the_ravager.lua index 1c10ace0db9..a8683a6f92e 100644 --- a/data-otservbr-global/monster/quests/dark_trails/the_ravager.lua +++ b/data-otservbr-global/monster/quests/dark_trails/the_ravager.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "TheRavagerDeath", +} + monster.bosstiary = { bossRaceId = 1035, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/quests/feaster_of_souls/the_dread_maiden.lua b/data-otservbr-global/monster/quests/feaster_of_souls/the_dread_maiden.lua index 9ca5ba11862..83308c9c2fc 100644 --- a/data-otservbr-global/monster/quests/feaster_of_souls/the_dread_maiden.lua +++ b/data-otservbr-global/monster/quests/feaster_of_souls/the_dread_maiden.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "FeasterOfSoulsBossDeath", +} + monster.bosstiary = { bossRaceId = 1872, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/feaster_of_souls/the_fear_feaster.lua b/data-otservbr-global/monster/quests/feaster_of_souls/the_fear_feaster.lua index 058842c7089..b5f69b05e3f 100644 --- a/data-otservbr-global/monster/quests/feaster_of_souls/the_fear_feaster.lua +++ b/data-otservbr-global/monster/quests/feaster_of_souls/the_fear_feaster.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "FeasterOfSoulsBossDeath", +} + monster.health = 300000 monster.maxHealth = 300000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/feaster_of_souls/the_pale_worm.lua b/data-otservbr-global/monster/quests/feaster_of_souls/the_pale_worm.lua index 41bf63ad767..bde610ee680 100644 --- a/data-otservbr-global/monster/quests/feaster_of_souls/the_pale_worm.lua +++ b/data-otservbr-global/monster/quests/feaster_of_souls/the_pale_worm.lua @@ -22,6 +22,7 @@ monster.manaCost = 0 monster.events = { "paleWormDeath", + "FeasterOfSoulsBossDeath", } monster.changeTarget = { diff --git a/data-otservbr-global/monster/quests/feaster_of_souls/the_unwelcome.lua b/data-otservbr-global/monster/quests/feaster_of_souls/the_unwelcome.lua index 383795d8bbe..7c0cd052961 100644 --- a/data-otservbr-global/monster/quests/feaster_of_souls/the_unwelcome.lua +++ b/data-otservbr-global/monster/quests/feaster_of_souls/the_unwelcome.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "FeasterOfSoulsBossDeath", +} + monster.health = 300000 monster.maxHealth = 300000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ferumbras_mortal_shell.lua b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ferumbras_mortal_shell.lua index 0d1cb775768..27160109571 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ferumbras_mortal_shell.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ferumbras_mortal_shell.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "AscendantBossesDeath", +} + monster.health = 300000 monster.maxHealth = 300000 monster.race = "venom" diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/mazoran.lua b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/mazoran.lua index e412a2af7c3..1a25d435223 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/mazoran.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/mazoran.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "AscendantBossesDeath", +} + monster.bosstiary = { bossRaceId = 1186, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/plagirath.lua b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/plagirath.lua index e0cb0b883ff..b86ac1a47bd 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/plagirath.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/plagirath.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "AscendantBossesDeath", +} + monster.bosstiary = { bossRaceId = 1199, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ragiaz.lua b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ragiaz.lua index 0f196297f4a..e9f97824c97 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ragiaz.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/ragiaz.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "AscendantBossesDeath", +} + monster.bosstiary = { bossRaceId = 1180, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/razzagorn.lua b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/razzagorn.lua index 480df7868fa..07d2a55b07b 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/razzagorn.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/razzagorn.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "AscendantBossesDeath", +} + monster.bosstiary = { bossRaceId = 1177, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/shulgrax.lua b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/shulgrax.lua index 2ad81b631c7..69eae8f369b 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/shulgrax.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/shulgrax.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "AscendantBossesDeath", +} + monster.health = 40000 monster.maxHealth = 40000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/tarbaz.lua b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/tarbaz.lua index 9b6bf3492f0..16fd12f63e8 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/tarbaz.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/tarbaz.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "AscendantBossesDeath", +} + monster.health = 290000 monster.maxHealth = 290000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/the_lord_of_the_lice.lua b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/the_lord_of_the_lice.lua index 1a9d2504c4d..08b0fd0a836 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/the_lord_of_the_lice.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/the_lord_of_the_lice.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "AscendantBossesDeath", +} + monster.bosstiary = { bossRaceId = 1179, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/the_shatterer.lua b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/the_shatterer.lua index 76a70e53189..eb414a427f3 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/the_shatterer.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/the_shatterer.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "TheShattererDeath", +} + monster.health = 220000 monster.maxHealth = 220000 monster.race = "fire" diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh.lua b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh.lua index 00d02c7c38d..f3bbd04efd4 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "AscendantBossesDeath", +} + monster.health = 300000 monster.maxHealth = 300000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh2.lua b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh2.lua index e3f7a2cfceb..5adb3a046bc 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh2.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh2.lua @@ -14,6 +14,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "AscendantBossesDeath", +} + monster.health = 300000 monster.maxHealth = 300000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh3.lua b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh3.lua index 3d8b71189eb..ec8cb0ade3a 100644 --- a/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh3.lua +++ b/data-otservbr-global/monster/quests/ferumbras_ascendant/bosses/zamulosh3.lua @@ -14,6 +14,11 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "AscendantBossesDeath", + "ZamuloshClone", +} + monster.health = 1000 monster.maxHealth = 1000 monster.race = "undead" @@ -53,10 +58,6 @@ monster.flags = { canWalkOnPoison = true, } -monster.events = { - "ZamuloshClone", -} - monster.light = { level = 0, color = 0, diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lady_tenebris.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lady_tenebris.lua index 40452abcabe..c7087a421ba 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lady_tenebris.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lady_tenebris.lua @@ -13,6 +13,11 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ForgottenKnowledgeBossDeath", + "HealthForgotten", +} + monster.bosstiary = { bossRaceId = 1315, bossRace = RARITY_ARCHFOE, @@ -57,10 +62,6 @@ monster.flags = { canWalkOnPoison = true, } -monster.events = { - "HealthForgotten", -} - monster.light = { level = 0, color = 0, diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lloyd.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lloyd.lua index 4cb143dd933..2cd9bdcd5b0 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lloyd.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/lloyd.lua @@ -13,6 +13,11 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ForgottenKnowledgeBossDeath", + "LloydPrepareDeath", +} + monster.bosstiary = { bossRaceId = 1329, bossRace = RARITY_ARCHFOE, @@ -57,10 +62,6 @@ monster.flags = { canWalkOnPoison = true, } -monster.events = { - "LloydPrepareDeath", -} - monster.light = { level = 0, color = 0, diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/melting_frozen_horror.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/melting_frozen_horror.lua index d856af4495c..6fa44fff690 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/melting_frozen_horror.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/melting_frozen_horror.lua @@ -13,6 +13,11 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ForgottenKnowledgeBossDeath", + "MeltingDeath", +} + monster.health = 70000 monster.maxHealth = 70000 monster.race = "undead" @@ -57,10 +62,6 @@ monster.flags = { canWalkOnPoison = true, } -monster.events = { - "MeltingDeath", -} - monster.light = { level = 0, color = 0, diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/soul_of_dragonking_zyrtarch.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/soul_of_dragonking_zyrtarch.lua index 030838fa5d5..2def55d9283 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/soul_of_dragonking_zyrtarch.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/soul_of_dragonking_zyrtarch.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ForgottenKnowledgeBossDeath", +} + monster.bosstiary = { bossRaceId = 1289, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_blazing_time_guardian.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_blazing_time_guardian.lua index 736c3233d4e..dd4144c4aad 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_blazing_time_guardian.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_blazing_time_guardian.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ForgottenKnowledgeBossDeath", +} + monster.health = 150000 monster.maxHealth = 150000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_enraged_thorn_knight.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_enraged_thorn_knight.lua index 6e74ec8281e..38d27e009af 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_enraged_thorn_knight.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_enraged_thorn_knight.lua @@ -13,6 +13,11 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ForgottenKnowledgeBossDeath", + "HealthForgotten", +} + monster.bosstiary = { bossRaceId = 1297, bossRace = RARITY_ARCHFOE, @@ -57,10 +62,6 @@ monster.flags = { canWalkOnPoison = true, } -monster.events = { - "HealthForgotten", -} - monster.light = { level = 0, color = 0, diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_freezing_time_guardian.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_freezing_time_guardian.lua index e43d501838b..ec4aac0f9fa 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_freezing_time_guardian.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_freezing_time_guardian.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ForgottenKnowledgeBossDeath", +} + monster.health = 150000 monster.maxHealth = 150000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_last_lore_keeper.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_last_lore_keeper.lua index 893cade4723..a875379d558 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_last_lore_keeper.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_last_lore_keeper.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ForgottenKnowledgeBossDeath", +} + monster.health = 750000 monster.maxHealth = 750000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_time_guardian.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_time_guardian.lua index 86d45d2d7ff..53d7eee517a 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_time_guardian.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bosses/the_time_guardian.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ForgottenKnowledgeBossDeath", +} + monster.health = 150000 monster.maxHealth = 150000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/bound_astral_power.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/bound_astral_power.lua index f012b1c1185..42be68d8ebe 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/bound_astral_power.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/bound_astral_power.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "BoundAstralPowerDeath", +} + monster.health = 70000 monster.maxHealth = 70000 monster.race = "venom" diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_a.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_a.lua index c85eda464fe..7dde9b15691 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_a.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_a.lua @@ -14,6 +14,11 @@ monster.corpse = 0 monster.speed = 0 monster.manaCost = 0 +monster.events = { + "EnergyPrismDeath", + "EnergyPrismHealthChange", +} + monster.changeTarget = { interval = 2000, chance = 0, @@ -43,10 +48,6 @@ monster.flags = { canWalkOnPoison = true, } -monster.events = { - "EnergyPrism", -} - monster.light = { level = 0, color = 0, diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_b.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_b.lua index eb90930545e..cfd5dd674a3 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_b.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_b.lua @@ -14,6 +14,11 @@ monster.corpse = 0 monster.speed = 0 monster.manaCost = 0 +monster.events = { + "EnergyPrismHealthChange", + "EnergyPrismDeath", +} + monster.changeTarget = { interval = 2000, chance = 0, @@ -43,10 +48,6 @@ monster.flags = { canWalkOnPoison = true, } -monster.events = { - "EnergyPrism", -} - monster.light = { level = 0, color = 0, diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_c.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_c.lua index b8de11033d7..92045bac1b9 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_c.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_c.lua @@ -44,7 +44,7 @@ monster.flags = { } monster.events = { - "EnergyPrism", + "EnergyPrismHealthChange", } monster.light = { diff --git a/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_d.lua b/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_d.lua index cf53e32a384..ec58b3ead68 100644 --- a/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_d.lua +++ b/data-otservbr-global/monster/quests/forgotten_knowledge/cosmic_energy_prism_d.lua @@ -14,6 +14,11 @@ monster.corpse = 0 monster.speed = 0 monster.manaCost = 0 +monster.events = { + "EnergyPrismHealthChange", + "EnergyPrismDeath", +} + monster.changeTarget = { interval = 2000, chance = 0, @@ -43,10 +48,6 @@ monster.flags = { canWalkOnPoison = true, } -monster.events = { - "EnergyPrism", -} - monster.light = { level = 0, color = 0, 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 929bd2f90b6..ebe04c8ec92 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 @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "GraveDangerBossDeath", +} + monster.health = 75000 monster.maxHealth = 75000 monster.race = "venom" 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 121f09f2d4b..0760491d1bc 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 @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "GraveDangerBossDeath", +} + monster.health = 75000 monster.maxHealth = 75000 monster.race = "venom" 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 ccc260d201e..c996116a336 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 @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "GraveDangerBossDeath", +} + monster.health = 75000 monster.maxHealth = 75000 monster.race = "venom" 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 7b3adde7c04..0201e821448 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 @@ -14,6 +14,7 @@ monster.outfit = { } monster.events = { + "GraveDangerBossDeath", "zelosDeath", } 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 8e47689c9e5..701a0b6f92b 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 @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "GraveDangerBossDeath", +} + monster.health = 75000 monster.maxHealth = 75000 monster.race = "venom" 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 d9a43a7dc01..042ce32e981 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,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "GraveDangerBossDeath", +} + monster.health = 75000 monster.maxHealth = 75000 monster.race = "venom" diff --git a/data-otservbr-global/monster/quests/hero_of_rathleton/deep_terror.lua b/data-otservbr-global/monster/quests/hero_of_rathleton/deep_terror.lua index d5715452efa..534175a881a 100644 --- a/data-otservbr-global/monster/quests/hero_of_rathleton/deep_terror.lua +++ b/data-otservbr-global/monster/quests/hero_of_rathleton/deep_terror.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "RathletonBossDeath", +} + monster.bosstiary = { bossRaceId = 1087, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/quests/hero_of_rathleton/empowered_glooth_horror.lua b/data-otservbr-global/monster/quests/hero_of_rathleton/empowered_glooth_horror.lua index 8f3e9d0e482..b99cd1f87d7 100644 --- a/data-otservbr-global/monster/quests/hero_of_rathleton/empowered_glooth_horror.lua +++ b/data-otservbr-global/monster/quests/hero_of_rathleton/empowered_glooth_horror.lua @@ -13,6 +13,11 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "RathletonBossDeath", + "GloothHorror", +} + monster.health = 25000 monster.maxHealth = 25000 monster.race = "venom" @@ -52,10 +57,6 @@ monster.flags = { canWalkOnPoison = true, } -monster.events = { - "GloothHorror", -} - monster.light = { level = 0, color = 0, diff --git a/data-otservbr-global/monster/quests/hero_of_rathleton/professor_maxxen.lua b/data-otservbr-global/monster/quests/hero_of_rathleton/professor_maxxen.lua index 8bb03ae7631..8a1ec35e913 100644 --- a/data-otservbr-global/monster/quests/hero_of_rathleton/professor_maxxen.lua +++ b/data-otservbr-global/monster/quests/hero_of_rathleton/professor_maxxen.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "RathletonBossDeath", +} + monster.health = 90000 monster.maxHealth = 90000 monster.race = "venom" diff --git a/data-otservbr-global/monster/quests/in_service_of_yalahar/azerus.lua b/data-otservbr-global/monster/quests/in_service_of_yalahar/azerus.lua index cd5ad5ae043..87329f07738 100644 --- a/data-otservbr-global/monster/quests/in_service_of_yalahar/azerus.lua +++ b/data-otservbr-global/monster/quests/in_service_of_yalahar/azerus.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "AzerusDeath", +} + monster.health = 26000 monster.maxHealth = 26000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/in_service_of_yalahar/azerus2.lua b/data-otservbr-global/monster/quests/in_service_of_yalahar/azerus2.lua index ef0b7d49807..19f074c17eb 100644 --- a/data-otservbr-global/monster/quests/in_service_of_yalahar/azerus2.lua +++ b/data-otservbr-global/monster/quests/in_service_of_yalahar/azerus2.lua @@ -14,6 +14,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "AzerusDeath", +} + monster.health = 26000 monster.maxHealth = 26000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/in_service_of_yalahar/inky.lua b/data-otservbr-global/monster/quests/in_service_of_yalahar/inky.lua index 7326ed59abc..bcb266254fe 100644 --- a/data-otservbr-global/monster/quests/in_service_of_yalahar/inky.lua +++ b/data-otservbr-global/monster/quests/in_service_of_yalahar/inky.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "QuaraLeadersDeath", +} + monster.health = 750 monster.maxHealth = 750 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/in_service_of_yalahar/sharptooth.lua b/data-otservbr-global/monster/quests/in_service_of_yalahar/sharptooth.lua index d707fc89581..583df08b8b5 100644 --- a/data-otservbr-global/monster/quests/in_service_of_yalahar/sharptooth.lua +++ b/data-otservbr-global/monster/quests/in_service_of_yalahar/sharptooth.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "QuaraLeadersDeath", +} + monster.health = 3100 monster.maxHealth = 3100 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/kilmaresh/an_astral_glyph.lua b/data-otservbr-global/monster/quests/kilmaresh/an_astral_glyph.lua index 5b76352b45d..a9c8792332a 100644 --- a/data-otservbr-global/monster/quests/kilmaresh/an_astral_glyph.lua +++ b/data-otservbr-global/monster/quests/kilmaresh/an_astral_glyph.lua @@ -14,6 +14,11 @@ monster.corpse = 0 monster.speed = 235 monster.manaCost = 0 +monster.events = { + "ForgottenKnowledgeBossDeath", + "AstralGlyphDeath", +} + monster.changeTarget = { interval = 2000, chance = 0, @@ -46,10 +51,6 @@ monster.flags = { canWalkOnPoison = true, } -monster.events = { - "AstralGlyphDeath", -} - monster.light = { level = 0, color = 0, diff --git a/data-otservbr-global/monster/quests/kilmaresh/bragrumol.lua b/data-otservbr-global/monster/quests/kilmaresh/bragrumol.lua index b653df68c89..bb7ef950744 100644 --- a/data-otservbr-global/monster/quests/kilmaresh/bragrumol.lua +++ b/data-otservbr-global/monster/quests/kilmaresh/bragrumol.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "BragrumolDeath", +} + monster.health = 38000 monster.maxHealth = 38000 monster.race = "fire" diff --git a/data-otservbr-global/monster/quests/kilmaresh/mozradek.lua b/data-otservbr-global/monster/quests/kilmaresh/mozradek.lua index 093b8d7ceeb..8602923a08b 100644 --- a/data-otservbr-global/monster/quests/kilmaresh/mozradek.lua +++ b/data-otservbr-global/monster/quests/kilmaresh/mozradek.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "MozradekDeath", +} + monster.bosstiary = { bossRaceId = 1829, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/quests/kilmaresh/xogixath.lua b/data-otservbr-global/monster/quests/kilmaresh/xogixath.lua index 886b7632944..3c77465e1ab 100644 --- a/data-otservbr-global/monster/quests/kilmaresh/xogixath.lua +++ b/data-otservbr-global/monster/quests/kilmaresh/xogixath.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "XogixathDeath", +} + monster.health = 28000 monster.maxHealth = 28000 monster.race = "fire" diff --git a/data-otservbr-global/monster/quests/liquid_black/jaul.lua b/data-otservbr-global/monster/quests/liquid_black/jaul.lua index c9fa8b2c7fe..965bbacb14c 100644 --- a/data-otservbr-global/monster/quests/liquid_black/jaul.lua +++ b/data-otservbr-global/monster/quests/liquid_black/jaul.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "DeeplingBossDeath", +} + monster.bosstiary = { bossRaceId = 773, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/quests/liquid_black/obujos.lua b/data-otservbr-global/monster/quests/liquid_black/obujos.lua index b8c84b54c61..1f32fd54f1c 100644 --- a/data-otservbr-global/monster/quests/liquid_black/obujos.lua +++ b/data-otservbr-global/monster/quests/liquid_black/obujos.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "DeeplingBossDeath", +} + monster.bosstiary = { bossRaceId = 774, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/quests/liquid_black/tanjis.lua b/data-otservbr-global/monster/quests/liquid_black/tanjis.lua index 4313a4a74ab..586af950be3 100644 --- a/data-otservbr-global/monster/quests/liquid_black/tanjis.lua +++ b/data-otservbr-global/monster/quests/liquid_black/tanjis.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "DeeplingBossDeath", +} + monster.bosstiary = { bossRaceId = 775, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/quests/primal_ordeal_quest/magma_bubble.lua b/data-otservbr-global/monster/quests/primal_ordeal_quest/magma_bubble.lua index eb7d9a7aeff..8f3bf7f6166 100644 --- a/data-otservbr-global/monster/quests/primal_ordeal_quest/magma_bubble.lua +++ b/data-otservbr-global/monster/quests/primal_ordeal_quest/magma_bubble.lua @@ -15,6 +15,7 @@ monster.outfit = { monster.events = { "MagmaBubbleDeath", + "ThePrimeOrdealBossDeath", } monster.bosstiary = { diff --git a/data-otservbr-global/monster/quests/primal_ordeal_quest/the_primal_menace.lua b/data-otservbr-global/monster/quests/primal_ordeal_quest/the_primal_menace.lua index c6a7eb46164..b81e83f7af7 100644 --- a/data-otservbr-global/monster/quests/primal_ordeal_quest/the_primal_menace.lua +++ b/data-otservbr-global/monster/quests/primal_ordeal_quest/the_primal_menace.lua @@ -66,6 +66,7 @@ monster.outfit = { monster.events = { "ThePrimalMenaceDeath", + "ThePrimeOrdealBossDeath", } monster.health = 400000 diff --git a/data-otservbr-global/monster/quests/soul_war/goshnars_cruelty.lua b/data-otservbr-global/monster/quests/soul_war/goshnars_cruelty.lua index 502c11e7db8..40957e0bde4 100644 --- a/data-otservbr-global/monster/quests/soul_war/goshnars_cruelty.lua +++ b/data-otservbr-global/monster/quests/soul_war/goshnars_cruelty.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "SoulwarsBossDeath", +} + monster.health = 300000 monster.maxHealth = 300000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua b/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua index 834edccf59f..0c8ddbbac42 100644 --- a/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua +++ b/data-otservbr-global/monster/quests/soul_war/goshnars_greed.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "SoulwarsBossDeath", +} + monster.health = 300000 monster.maxHealth = 300000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/soul_war/goshnars_malice.lua b/data-otservbr-global/monster/quests/soul_war/goshnars_malice.lua index ce6699ea39a..5e79dcccbdd 100644 --- a/data-otservbr-global/monster/quests/soul_war/goshnars_malice.lua +++ b/data-otservbr-global/monster/quests/soul_war/goshnars_malice.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "SoulwarsBossDeath", +} + monster.health = 300000 monster.maxHealth = 300000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/soul_war/goshnars_megalomania.lua b/data-otservbr-global/monster/quests/soul_war/goshnars_megalomania.lua index 1c871919b87..18cfdeacd90 100644 --- a/data-otservbr-global/monster/quests/soul_war/goshnars_megalomania.lua +++ b/data-otservbr-global/monster/quests/soul_war/goshnars_megalomania.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "SoulwarsBossDeath", +} + monster.health = 500000 monster.maxHealth = 500000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/soul_war/goshnars_spite.lua b/data-otservbr-global/monster/quests/soul_war/goshnars_spite.lua index f6180e7ff6d..cf46b89a76d 100644 --- a/data-otservbr-global/monster/quests/soul_war/goshnars_spite.lua +++ b/data-otservbr-global/monster/quests/soul_war/goshnars_spite.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "SoulwarsBossDeath", +} + monster.health = 300000 monster.maxHealth = 300000 monster.race = "undead" 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 a46b6610aff..76275c2cd0f 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,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "DreamCourtsBossDeath", +} + monster.health = 320000 monster.maxHealth = 320000 monster.race = "blood" 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 26b2c837282..9c693024899 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,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "DreamCourtsBossDeath", +} + monster.bosstiary = { bossRaceId = 1699, bossRace = RARITY_NEMESIS, 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 4e85ee19d95..2bd63f042be 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,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "DreamCourtsBossDeath", +} + monster.health = 320000 monster.maxHealth = 320000 monster.race = "blood" 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 d5dd3890976..8db50108f56 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,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "DreamCourtsBossDeath", +} + monster.health = 320000 monster.maxHealth = 320000 monster.race = "blood" 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 c8c3f8da275..d0520193aad 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,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "DreamCourtsBossDeath", +} + monster.health = 850000 monster.maxHealth = 850000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/the_elemental_spheres/earth_overlord.lua b/data-otservbr-global/monster/quests/the_elemental_spheres/earth_overlord.lua index c651694c21e..33251b292d5 100644 --- a/data-otservbr-global/monster/quests/the_elemental_spheres/earth_overlord.lua +++ b/data-otservbr-global/monster/quests/the_elemental_spheres/earth_overlord.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ElementalOverlordDeath", +} + monster.health = 4000 monster.maxHealth = 4000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/the_elemental_spheres/energy_overlord.lua b/data-otservbr-global/monster/quests/the_elemental_spheres/energy_overlord.lua index 10846df7c35..844a6504d33 100644 --- a/data-otservbr-global/monster/quests/the_elemental_spheres/energy_overlord.lua +++ b/data-otservbr-global/monster/quests/the_elemental_spheres/energy_overlord.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ElementalOverlordDeath", +} + monster.health = 4000 monster.maxHealth = 4000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/the_elemental_spheres/fire_overlord.lua b/data-otservbr-global/monster/quests/the_elemental_spheres/fire_overlord.lua index c3b7d152a96..7364324263d 100644 --- a/data-otservbr-global/monster/quests/the_elemental_spheres/fire_overlord.lua +++ b/data-otservbr-global/monster/quests/the_elemental_spheres/fire_overlord.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ElementalOverlordDeath", +} + monster.health = 4000 monster.maxHealth = 4000 monster.race = "fire" diff --git a/data-otservbr-global/monster/quests/the_elemental_spheres/ice_overlord.lua b/data-otservbr-global/monster/quests/the_elemental_spheres/ice_overlord.lua index 7da731c90ab..9a65a1c8ef2 100644 --- a/data-otservbr-global/monster/quests/the_elemental_spheres/ice_overlord.lua +++ b/data-otservbr-global/monster/quests/the_elemental_spheres/ice_overlord.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ElementalOverlordDeath", +} + monster.health = 4000 monster.maxHealth = 4000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/the_elemental_spheres/lord_of_the_elements.lua b/data-otservbr-global/monster/quests/the_elemental_spheres/lord_of_the_elements.lua index eba6b1c9412..7bdc28f7421 100644 --- a/data-otservbr-global/monster/quests/the_elemental_spheres/lord_of_the_elements.lua +++ b/data-otservbr-global/monster/quests/the_elemental_spheres/lord_of_the_elements.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ElementalOverlordDeath", +} + monster.bosstiary = { bossRaceId = 454, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/the_inquisition/annihilon.lua b/data-otservbr-global/monster/quests/the_inquisition/annihilon.lua index e35249ea832..26013b74ece 100644 --- a/data-otservbr-global/monster/quests/the_inquisition/annihilon.lua +++ b/data-otservbr-global/monster/quests/the_inquisition/annihilon.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "InquisitionBossDeath", +} + monster.bosstiary = { bossRaceId = 418, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/quests/the_inquisition/golgordan.lua b/data-otservbr-global/monster/quests/the_inquisition/golgordan.lua index 7da1ca0e093..59a74148ed6 100644 --- a/data-otservbr-global/monster/quests/the_inquisition/golgordan.lua +++ b/data-otservbr-global/monster/quests/the_inquisition/golgordan.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "InquisitionBossDeath", +} + monster.bosstiary = { bossRaceId = 416, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/quests/the_inquisition/hellgorak.lua b/data-otservbr-global/monster/quests/the_inquisition/hellgorak.lua index 2fcb10ece1f..79209cb8560 100644 --- a/data-otservbr-global/monster/quests/the_inquisition/hellgorak.lua +++ b/data-otservbr-global/monster/quests/the_inquisition/hellgorak.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "InquisitionBossDeath", +} + monster.bosstiary = { bossRaceId = 403, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/quests/the_inquisition/latrivan.lua b/data-otservbr-global/monster/quests/the_inquisition/latrivan.lua index 9854d2060b4..be2d46288fa 100644 --- a/data-otservbr-global/monster/quests/the_inquisition/latrivan.lua +++ b/data-otservbr-global/monster/quests/the_inquisition/latrivan.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "InquisitionBossDeath", +} + monster.health = 25000 monster.maxHealth = 25000 monster.race = "fire" diff --git a/data-otservbr-global/monster/quests/the_inquisition/madareth.lua b/data-otservbr-global/monster/quests/the_inquisition/madareth.lua index 344609d71bf..66caf4329f5 100644 --- a/data-otservbr-global/monster/quests/the_inquisition/madareth.lua +++ b/data-otservbr-global/monster/quests/the_inquisition/madareth.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "InquisitionBossDeath", +} + monster.bosstiary = { bossRaceId = 414, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/quests/the_inquisition/ungreez.lua b/data-otservbr-global/monster/quests/the_inquisition/ungreez.lua index be3f10a6e37..c19b2199920 100644 --- a/data-otservbr-global/monster/quests/the_inquisition/ungreez.lua +++ b/data-otservbr-global/monster/quests/the_inquisition/ungreez.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "UngreezDeath", +} + monster.health = 8200 monster.maxHealth = 8200 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/the_inquisition/ushuriel.lua b/data-otservbr-global/monster/quests/the_inquisition/ushuriel.lua index 25b14bd6298..35c7d81b030 100644 --- a/data-otservbr-global/monster/quests/the_inquisition/ushuriel.lua +++ b/data-otservbr-global/monster/quests/the_inquisition/ushuriel.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "InquisitionBossDeath", +} + monster.health = 31500 monster.maxHealth = 31500 monster.race = "fire" diff --git a/data-otservbr-global/monster/quests/the_inquisition/zugurosh.lua b/data-otservbr-global/monster/quests/the_inquisition/zugurosh.lua index 796346d7a31..fedf47e5fe1 100644 --- a/data-otservbr-global/monster/quests/the_inquisition/zugurosh.lua +++ b/data-otservbr-global/monster/quests/the_inquisition/zugurosh.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "InquisitionBossDeath", +} + monster.bosstiary = { bossRaceId = 434, bossRace = RARITY_BANE, diff --git a/data-otservbr-global/monster/quests/the_new_frontier/shard_of_corruption.lua b/data-otservbr-global/monster/quests/the_new_frontier/shard_of_corruption.lua index a818d413269..c7ba3fa0e02 100644 --- a/data-otservbr-global/monster/quests/the_new_frontier/shard_of_corruption.lua +++ b/data-otservbr-global/monster/quests/the_new_frontier/shard_of_corruption.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ShardOfCorruptionDeath", +} + monster.health = 600 monster.maxHealth = 600 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/the_new_frontier/tirecz.lua b/data-otservbr-global/monster/quests/the_new_frontier/tirecz.lua index 8bd994210c8..42cbd1f2b9f 100644 --- a/data-otservbr-global/monster/quests/the_new_frontier/tirecz.lua +++ b/data-otservbr-global/monster/quests/the_new_frontier/tirecz.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "TireczDeath", +} + monster.health = 25000 monster.maxHealth = 25000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/the_secret_library/bosses/ghulosh.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/ghulosh.lua index 789d59fc8fd..4324a573ec4 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/bosses/ghulosh.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/bosses/ghulosh.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "SecretLibraryBossDeath", +} + monster.bosstiary = { bossRaceId = 1608, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/the_secret_library/bosses/gorzindel.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/gorzindel.lua index bd05efbfc7c..b00bffd6d60 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/bosses/gorzindel.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/bosses/gorzindel.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "SecretLibraryBossDeath", +} + monster.bosstiary = { bossRaceId = 1591, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/the_secret_library/bosses/the_scourge_of_oblivion.lua b/data-otservbr-global/monster/quests/the_secret_library/bosses/the_scourge_of_oblivion.lua index 9529a00cedb..5965afef0a3 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/bosses/the_scourge_of_oblivion.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/bosses/the_scourge_of_oblivion.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "SecretLibraryBossDeath", +} + monster.bosstiary = { bossRaceId = 1642, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/the_secret_library/lokathmor.lua b/data-otservbr-global/monster/quests/the_secret_library/lokathmor.lua index 47484e5dc22..537b2584d82 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/lokathmor.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/lokathmor.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "SecretLibraryBossDeath", +} + monster.bosstiary = { bossRaceId = 1574, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/the_secret_library/mazzinor.lua b/data-otservbr-global/monster/quests/the_secret_library/mazzinor.lua index bbf93c31425..a9be1bc3221 100644 --- a/data-otservbr-global/monster/quests/the_secret_library/mazzinor.lua +++ b/data-otservbr-global/monster/quests/the_secret_library/mazzinor.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "SecretLibraryBossDeath", +} + monster.bosstiary = { bossRaceId = 1605, bossRace = RARITY_ARCHFOE, diff --git a/data-otservbr-global/monster/quests/wrath_of_the_emperor/fury_of_the_emperor.lua b/data-otservbr-global/monster/quests/wrath_of_the_emperor/fury_of_the_emperor.lua index 463d57908da..46f365304c3 100644 --- a/data-otservbr-global/monster/quests/wrath_of_the_emperor/fury_of_the_emperor.lua +++ b/data-otservbr-global/monster/quests/wrath_of_the_emperor/fury_of_the_emperor.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "WrathOfTheEmperorBossDeath", +} + monster.health = 51000 monster.maxHealth = 51000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/wrath_of_the_emperor/lizard_abomination.lua b/data-otservbr-global/monster/quests/wrath_of_the_emperor/lizard_abomination.lua index eab957f402d..9b0e18c6cc3 100644 --- a/data-otservbr-global/monster/quests/wrath_of_the_emperor/lizard_abomination.lua +++ b/data-otservbr-global/monster/quests/wrath_of_the_emperor/lizard_abomination.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ZalamonDeath", +} + monster.health = 95000 monster.maxHealth = 95000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/wrath_of_the_emperor/mutated_zalamon.lua b/data-otservbr-global/monster/quests/wrath_of_the_emperor/mutated_zalamon.lua index ad7c98a1abe..39aa68ae966 100644 --- a/data-otservbr-global/monster/quests/wrath_of_the_emperor/mutated_zalamon.lua +++ b/data-otservbr-global/monster/quests/wrath_of_the_emperor/mutated_zalamon.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ZalamonDeath", +} + monster.health = 155000 monster.maxHealth = 155000 monster.race = "venom" diff --git a/data-otservbr-global/monster/quests/wrath_of_the_emperor/scorn_of_the_emperor.lua b/data-otservbr-global/monster/quests/wrath_of_the_emperor/scorn_of_the_emperor.lua index bbb474fa652..7b0b97c6354 100644 --- a/data-otservbr-global/monster/quests/wrath_of_the_emperor/scorn_of_the_emperor.lua +++ b/data-otservbr-global/monster/quests/wrath_of_the_emperor/scorn_of_the_emperor.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "WrathOfTheEmperorBossDeath", +} + monster.health = 45000 monster.maxHealth = 45000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/wrath_of_the_emperor/snake_god_essence.lua b/data-otservbr-global/monster/quests/wrath_of_the_emperor/snake_god_essence.lua index 9d7e4f4fbaa..8479eeba806 100644 --- a/data-otservbr-global/monster/quests/wrath_of_the_emperor/snake_god_essence.lua +++ b/data-otservbr-global/monster/quests/wrath_of_the_emperor/snake_god_essence.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ZalamonDeath", +} + monster.health = 65000 monster.maxHealth = 65000 monster.race = "blood" diff --git a/data-otservbr-global/monster/quests/wrath_of_the_emperor/snake_thing.lua b/data-otservbr-global/monster/quests/wrath_of_the_emperor/snake_thing.lua index 272ef668f54..0085b08ca09 100644 --- a/data-otservbr-global/monster/quests/wrath_of_the_emperor/snake_thing.lua +++ b/data-otservbr-global/monster/quests/wrath_of_the_emperor/snake_thing.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ZalamonDeath", +} + monster.health = 70000 monster.maxHealth = 70000 monster.race = "venom" diff --git a/data-otservbr-global/monster/quests/wrath_of_the_emperor/spite_of_the_emperor.lua b/data-otservbr-global/monster/quests/wrath_of_the_emperor/spite_of_the_emperor.lua index f0951ea2dbc..2ab41632582 100644 --- a/data-otservbr-global/monster/quests/wrath_of_the_emperor/spite_of_the_emperor.lua +++ b/data-otservbr-global/monster/quests/wrath_of_the_emperor/spite_of_the_emperor.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "WrathOfTheEmperorBossDeath", +} + monster.health = 48000 monster.maxHealth = 48000 monster.race = "undead" diff --git a/data-otservbr-global/monster/quests/wrath_of_the_emperor/the_keeper.lua b/data-otservbr-global/monster/quests/wrath_of_the_emperor/the_keeper.lua index 43d731d6bdd..3062b6f2f5e 100644 --- a/data-otservbr-global/monster/quests/wrath_of_the_emperor/the_keeper.lua +++ b/data-otservbr-global/monster/quests/wrath_of_the_emperor/the_keeper.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "TheKeeperDeath", +} + monster.health = 40000 monster.maxHealth = 40000 monster.race = "venom" diff --git a/data-otservbr-global/monster/quests/wrath_of_the_emperor/wrath_of_the_emperor.lua b/data-otservbr-global/monster/quests/wrath_of_the_emperor/wrath_of_the_emperor.lua index 70494aee5f9..99ad2361003 100644 --- a/data-otservbr-global/monster/quests/wrath_of_the_emperor/wrath_of_the_emperor.lua +++ b/data-otservbr-global/monster/quests/wrath_of_the_emperor/wrath_of_the_emperor.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "WrathOfTheEmperorBossDeath", +} + monster.health = 55000 monster.maxHealth = 55000 monster.race = "undead" diff --git a/data-otservbr-global/monster/reptiles/lizard_magistratus.lua b/data-otservbr-global/monster/reptiles/lizard_magistratus.lua index 410adcacc4b..cce60cb8d2d 100644 --- a/data-otservbr-global/monster/reptiles/lizard_magistratus.lua +++ b/data-otservbr-global/monster/reptiles/lizard_magistratus.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "LizardMagistratusDeath", +} + monster.raceId = 655 monster.Bestiary = { class = "Reptile", diff --git a/data-otservbr-global/monster/reptiles/lizard_noble.lua b/data-otservbr-global/monster/reptiles/lizard_noble.lua index 18847211c0a..1dcfe3d2873 100644 --- a/data-otservbr-global/monster/reptiles/lizard_noble.lua +++ b/data-otservbr-global/monster/reptiles/lizard_noble.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "LizardNobleDeath", +} + monster.raceId = 656 monster.Bestiary = { class = "Reptile", diff --git a/data-otservbr-global/monster/undeads/demon_skeleton.lua b/data-otservbr-global/monster/undeads/demon_skeleton.lua index 7e133b866cc..c40806e299b 100644 --- a/data-otservbr-global/monster/undeads/demon_skeleton.lua +++ b/data-otservbr-global/monster/undeads/demon_skeleton.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "UpperSpikeDeath", +} + monster.raceId = 37 monster.Bestiary = { class = "Undead", diff --git a/data-otservbr-global/monster/vermins/deepworm.lua b/data-otservbr-global/monster/vermins/deepworm.lua index 1127359392b..91b2ded8752 100644 --- a/data-otservbr-global/monster/vermins/deepworm.lua +++ b/data-otservbr-global/monster/vermins/deepworm.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "WarzoneWormDeath", +} + monster.raceId = 1531 monster.Bestiary = { class = "Vermin", diff --git a/data-otservbr-global/monster/vermins/diremaw.lua b/data-otservbr-global/monster/vermins/diremaw.lua index 530c3203922..1e3accb0fd3 100644 --- a/data-otservbr-global/monster/vermins/diremaw.lua +++ b/data-otservbr-global/monster/vermins/diremaw.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "WarzoneWormDeath", +} + monster.raceId = 1532 monster.Bestiary = { class = "Vermin", diff --git a/data-otservbr-global/monster/vermins/drillworm.lua b/data-otservbr-global/monster/vermins/drillworm.lua index f1ae51b1df4..3cf92fce18a 100644 --- a/data-otservbr-global/monster/vermins/drillworm.lua +++ b/data-otservbr-global/monster/vermins/drillworm.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "LowerSpikeDeath", +} + monster.raceId = 878 monster.Bestiary = { class = "Vermin", diff --git a/data-otservbr-global/monster/vermins/parasite.lua b/data-otservbr-global/monster/vermins/parasite.lua index da981020291..65e83dbb7f2 100644 --- a/data-otservbr-global/monster/vermins/parasite.lua +++ b/data-otservbr-global/monster/vermins/parasite.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "ParasiteDeath", +} + monster.health = 550 monster.maxHealth = 550 monster.race = "venom" diff --git a/data-otservbr-global/monster/vermins/wiggler.lua b/data-otservbr-global/monster/vermins/wiggler.lua index 3c438edb4bc..76c994cdff5 100644 --- a/data-otservbr-global/monster/vermins/wiggler.lua +++ b/data-otservbr-global/monster/vermins/wiggler.lua @@ -13,6 +13,10 @@ monster.outfit = { lookMount = 0, } +monster.events = { + "WigglerDeath", +} + monster.raceId = 899 monster.Bestiary = { class = "Vermin", diff --git a/data-otservbr-global/scripts/actions/quests/dangerous_depth/using_crystals.lua b/data-otservbr-global/scripts/actions/quests/dangerous_depth/using_crystals.lua index ca95fa99bc9..68a348fc08f 100644 --- a/data-otservbr-global/scripts/actions/quests/dangerous_depth/using_crystals.lua +++ b/data-otservbr-global/scripts/actions/quests/dangerous_depth/using_crystals.lua @@ -370,10 +370,7 @@ end local function startWarzoneIV() addEvent(function() - local monstro = Game.createMonster("The Baron From Below", Position(33648, 32303, 15)) - if monstro then - monstro:registerEvent("TheBaronFromBelowThink") - end + Game.createMonster("The Baron From Below", Position(33648, 32303, 15)) addEvent(sumonarLavasIV, 15 * 1000, 5) addEvent(lavaHoles, 15 * 1000, 1) end, 10 * 1000) diff --git a/data-otservbr-global/scripts/actions/quests/feaster_of_souls/bosses_killed.lua b/data-otservbr-global/scripts/actions/quests/feaster_of_souls/bosses_killed.lua index b77304f5627..b08abd9a2d2 100644 --- a/data-otservbr-global/scripts/actions/quests/feaster_of_souls/bosses_killed.lua +++ b/data-otservbr-global/scripts/actions/quests/feaster_of_souls/bosses_killed.lua @@ -5,9 +5,9 @@ local bosses = { ["the pale worm"] = { storage = Storage.Quest.U12_30.FeasterOfSouls.PaleWormKilled }, } -local bossesFeasterOfSouls = CreatureEvent("FeasterOfSoulsKill") -function bossesFeasterOfSouls.onKill(creature, target) - local targetMonster = target:getMonster() +local bossesFeasterOfSouls = CreatureEvent("FeasterOfSoulsBossDeath") +function bossesFeasterOfSouls.onDeath(creature) + local targetMonster = creature:getMonster() if not targetMonster or targetMonster:getMaster() then return true end @@ -15,14 +15,11 @@ function bossesFeasterOfSouls.onKill(creature, target) if not bossConfig then return true end - for key, value in pairs(targetMonster:getDamageMap()) do - local attackerPlayer = Player(key) - if attackerPlayer then - if bossConfig.storage then - attackerPlayer:setStorageValue(bossConfig.storage, 1) - end + onDeathForDamagingPlayers(creature, function(creature, player) + if bossConfig.storage then + player:setStorageValue(bossConfig.storage, 1) end - end + end) return true end diff --git a/data-otservbr-global/scripts/actions/quests/grave_danger/bosses_killed.lua b/data-otservbr-global/scripts/actions/quests/grave_danger/bosses_killed.lua index 60716e7ab6b..3142f9e1a04 100644 --- a/data-otservbr-global/scripts/actions/quests/grave_danger/bosses_killed.lua +++ b/data-otservbr-global/scripts/actions/quests/grave_danger/bosses_killed.lua @@ -7,9 +7,9 @@ local bosses = { ["king zelos"] = { storage = Storage.Quest.U12_20.GraveDanger.Bosses.KingZelosKilled }, } -local bossesGraveDanger = CreatureEvent("GraveDangerKill") -function bossesGraveDanger.onKill(creature, target) - local targetMonster = target:getMonster() +local bossesGraveDanger = CreatureEvent("GraveDangerKillGraveDangerBossDeath") +function bossesGraveDanger.onDeath(creature) + local targetMonster = creature:getMonster() if not targetMonster or targetMonster:getMaster() then return true end @@ -17,23 +17,20 @@ function bossesGraveDanger.onKill(creature, target) if not bossConfig then return true end - for key, value in pairs(targetMonster:getDamageMap()) do - local attackerPlayer = Player(key) - if attackerPlayer then - if bossConfig.storage then - attackerPlayer:setStorageValue(bossConfig.storage, 1) + 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 - end - local bossesKilled = 0 - for value in pairs(bosses) do - if creature:getStorageValue(bosses[value].storage) > 0 then - bossesKilled = bossesKilled + 1 + if bossesKilled >= 5 then -- number of mini bosses + player:setStorageValue(Storage.Quest.U12_20.GraveDanger.Bosses.KingZelosDoor, 1) end - end - if bossesKilled >= 5 then -- number of mini bosses - creature:setStorageValue(Storage.Quest.U12_20.GraveDanger.Bosses.KingZelosDoor, 1) - end + end) return true end diff --git a/data-otservbr-global/scripts/actions/quests/secret_library/bosses_killed.lua b/data-otservbr-global/scripts/actions/quests/secret_library/bosses_killed.lua index a825983987c..b7154ec9f0f 100644 --- a/data-otservbr-global/scripts/actions/quests/secret_library/bosses_killed.lua +++ b/data-otservbr-global/scripts/actions/quests/secret_library/bosses_killed.lua @@ -6,9 +6,9 @@ local bosses = { ["scourge of oblivion"] = { storage = Storage.Quest.U11_80.TheSecretLibrary.ScourgeOfOblivionKilled }, } -local bossesSecretLibrary = CreatureEvent("SecretLibraryKill") -function bossesSecretLibrary.onKill(player, target) - local targetMonster = target:getMonster() +local bossesSecretLibrary = CreatureEvent("SecretLibraryBossDeath") +function bossesSecretLibrary.onDeath(creature) + local targetMonster = creature:getMonster() if not targetMonster or targetMonster:getMaster() then return true end @@ -16,23 +16,20 @@ function bossesSecretLibrary.onKill(player, target) if not bossConfig then return true end - for key, value in pairs(targetMonster:getDamageMap()) do - local attackerPlayer = Player(key) - if attackerPlayer then - if bossConfig.storage then - attackerPlayer:setStorageValue(bossConfig.storage, 1) + 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 - end - local bossesKilled = 0 - for value in pairs(bosses) do - if player:getStorageValue(bosses[value].storage) > 0 then - bossesKilled = bossesKilled + 1 + if bossesKilled >= 4 then -- number of mini bosses + player:setStorageValue(Storage.Quest.U11_80.TheSecretLibrary.ScourgeOfOblivionDoor, 1) end - end - if bossesKilled >= 4 then -- number of mini bosses - player:setStorageValue(Storage.Quest.U11_80.TheSecretLibrary.ScourgeOfOblivionDoor, 1) - end + end) return true end diff --git a/data-otservbr-global/scripts/actions/quests/soul_war/bosses_killed.lua b/data-otservbr-global/scripts/actions/quests/soul_war/bosses_killed.lua index 06aeff3c652..ea8612cc7e8 100644 --- a/data-otservbr-global/scripts/actions/quests/soul_war/bosses_killed.lua +++ b/data-otservbr-global/scripts/actions/quests/soul_war/bosses_killed.lua @@ -7,9 +7,9 @@ local bosses = { ["goshnar's megalomania"] = { storage = Storage.Quest.U12_40.SoulWar.GoshnarMegalomaniaKilled }, } -local bossesSoulWar = CreatureEvent("SoulWarKill") -function bossesSoulWar.onKill(creature, target) - local targetMonster = target:getMonster() +local bossesSoulWar = CreatureEvent("SoulwarsBossDeath") +function bossesSoulWar.onDeath(creature) + local targetMonster = creature:getMonster() if not targetMonster or targetMonster:getMaster() then return true end @@ -17,14 +17,11 @@ function bossesSoulWar.onKill(creature, target) if not bossConfig then return true end - for key, value in pairs(targetMonster:getDamageMap()) do - local attackerPlayer = Player(key) - if attackerPlayer then - if bossConfig.storage then - attackerPlayer:setStorageValue(bossConfig.storage, 1) - end + onDeathForDamagingPlayers(creature, function(creature, player) + if bossConfig.storage then + player:setStorageValue(bossConfig.storage, 1) end - end + end) return true end diff --git a/data-otservbr-global/scripts/actions/quests/the_dream_courts/bosses_killed.lua b/data-otservbr-global/scripts/actions/quests/the_dream_courts/bosses_killed.lua index cd6eb327972..c296a419741 100644 --- a/data-otservbr-global/scripts/actions/quests/the_dream_courts/bosses_killed.lua +++ b/data-otservbr-global/scripts/actions/quests/the_dream_courts/bosses_killed.lua @@ -7,9 +7,9 @@ local bosses = { ["the nightmare beast"] = { storage = Storage.Quest.U12_00.TheDreamCourts.NightmareBeastKilled }, } -local bossesDreamCourts = CreatureEvent("DreamCourtsKill") -function bossesDreamCourts.onKill(creature, target) - local targetMonster = target:getMonster() +local bossesDreamCourts = CreatureEvent("DreamCourtsBossDeath") +function bossesDreamCourts.onDeath(creature) + local targetMonster = creature:getMonster() if not targetMonster or targetMonster:getMaster() then return true end @@ -17,14 +17,11 @@ function bossesDreamCourts.onKill(creature, target) if not bossConfig then return true end - for key, value in pairs(targetMonster:getDamageMap()) do - local attackerPlayer = Player(key) - if attackerPlayer then - if bossConfig.storage then - attackerPlayer:setStorageValue(bossConfig.storage, 1) - end + onDeathForDamagingPlayers(creature, function(creature, player) + if bossConfig.storage then + player:setStorageValue(bossConfig.storage, 1) end - end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/monster/lower_roshamuul.lua b/data-otservbr-global/scripts/creaturescripts/monster/lower_roshamuul.lua index c27c83a21b1..a7a6ef8f1f0 100644 --- a/data-otservbr-global/scripts/creaturescripts/monster/lower_roshamuul.lua +++ b/data-otservbr-global/scripts/creaturescripts/monster/lower_roshamuul.lua @@ -1,14 +1,18 @@ local setting = { - ["frazzlemaw"] = roshamuul_killed_frazzlemaws, + ["frazzlemaw"] = ROSHAMUUL_KILLED_FRAZZLEMAWS, ["silencer"] = ROSHAMUUL_KILLED_SILENCERS, } -local lowerRoshamuul = CreatureEvent("LowerRoshamuul") -function lowerRoshamuul.onKill(creature, target) - local monster = setting[target:getName():lower()] - if monster then - creature:setStorageValue(monster, math.max(0, creature:getStorageValue(monster)) + 1) +local lowerRoshamuul = CreatureEvent("RoshamuulKillsDeath") +function lowerRoshamuul.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + local monster = setting[creature:getName():lower()] + if not monster then + return true end + + onDeathForParty(creature, mostDamageKiller, function(creature, player) + player:setStorageValue(monster, math.max(0, player:getStorageValue(monster)) + 1) + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/others/login_events.lua b/data-otservbr-global/scripts/creaturescripts/others/login_events.lua index f61182bea3f..7adef4c07a1 100644 --- a/data-otservbr-global/scripts/creaturescripts/others/login_events.lua +++ b/data-otservbr-global/scripts/creaturescripts/others/login_events.lua @@ -1,12 +1,8 @@ local loginEvents = CreatureEvent("LoginEvents") function loginEvents.onLogin(player) local events = { - --Monster - "LowerRoshamuul", --Others "AdvanceSave", - "BestiaryOnKill", - "BosstiaryOnKill", "BossParticipation", "DropLoot", "PlayerDeath", @@ -14,114 +10,10 @@ function loginEvents.onLogin(player) "FamiliarLogin", "FamiliarAdvance", --Quests - --Adventurers Guild Quest - "Thegreatdragonhuntkill", - --Bigfoot Burden Quest - "BossesWarzone", - "ParasiteWarzone", - "VersperothKill", - "WigglerKill", --Cults Of Tibia Quest - "BossesCults", - "MinotaurTask", - "VortexCarlin", "LeidenHeal", - "GlowingRubbishAmulet", - "DestroyedPillar", "HealthPillar", "YalahariHealth", - "EssenceOfMalice", - --Dangerous Depths Quest - "LostExileKill", - "SnailSlimeKill", - "TheBaronFromBelowKill", - --Dawnport Quest - "MorrisMinotaurKill", - "MorrisGoblinKill", - "MorrisTrollKill", - --Elemental Spheres Quest - "OverlordKill", - --Ferumbras Ascendant Quest - "AscendantBossesKill", - "TheShattererKill", - --Firewalker Boots - "PythiusTheRottenKill", - --Forgotten Knowledge Quest - "BossesForgottenKill", - "AstralPower", - "EnergyPrismDeath", - "ReplicaServant", - --Hero Of Rathleton - "RathletonBossKill", - --Secret Service - "BlackKnightKill", - --Service Of Yalahar - "DiseasedTrio", - "Azerus", - "QuaraLeaders", - --Inquisition - "InquisitionBossKill", - "UngreezKill", - --Killing In The Name Of - "KillingInTheNameOfKill", - "KillingInTheNameOfMinotaurKill", - "TiquandasRevengeKill", - "DemodrasKill", - --Kilmaresh - "BragrumolKill", - "MozradekKill", - "XogixathKill", - "FafnarKill", - --Liquid Black - "DeeplingBosses", - --Raging Mage Worldchange - "EnergizedRagingMageKill", - "RagingMageKill", - "YielothaxKill", - --Spike Tasks - "LowerSpikeKill", - "UpperSpikeKill", - "MiddleSpikeKill", - --Svargrond Arena - "SvargrondArenaKill", - --The Ice Islands Quest - "HuskyKill", - --The First Dragon - "KillDragon", - "SomewhatBeatableDeath", - --The New Frontier - "ShardOfCorruptionKill", - "TireczKill", - --Thieves Guild - "NomadKill", - --Threatened Dreams - Nightmare Intruders - "ThreatenedDreamsNightmareMonstersKills", - --Wrath of the Emperor - "LizardMagistratusKill", - "LizardNobleKill", - "KeeperKill", - "BossesKill", - "ZalamonKill", - -- The Rookie Guard - "VascalirRatKills", - -- An Uneasy Alliance - "RenegadeOrcKill", - -- Grave Danger - "GraveDangerKill", - -- Feaster of Souls - "FeasterOfSoulsKill", - -- Soul War - "SoulWarKill", - -- Secret Library - "SecretLibraryKill", - -- The Dream Courts - "DreamCourtsKill", - -- Prime Ordeal - "PrimeOrdealKill", - -- Concoctions - "ConcoctionsOnLogin", - -- Hazard System - "PrimalHazardKill", } for i = 1, #events do diff --git a/data-otservbr-global/scripts/creaturescripts/quests/adventurers_guild/the_great_dragon_hunt.lua b/data-otservbr-global/scripts/creaturescripts/quests/adventurers_guild/the_great_dragon_hunt.lua index d4011bbfc8a..75cd6f92366 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/adventurers_guild/the_great_dragon_hunt.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/adventurers_guild/the_great_dragon_hunt.lua @@ -8,24 +8,21 @@ local areas = { { from = Position(32993, 32632, 7), to = Position(33042, 32688, 7) }, } -local adventurersGuildHunt = CreatureEvent("TheGreatDragonHuntKill") -function adventurersGuildHunt.onKill(creature, target) - if not creature or not creature:isPlayer() then - return true +local adventurersGuildHunt = CreatureEvent("TheGreatDragonHuntDeath") +function adventurersGuildHunt.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + local valid = false + for _, area in ipairs(areas) do + if creature:getPosition():isInRange(area.from, area.to) then + valid = true + break + end end - - if not target or not target:isMonster() then + if not valid then return true end - - if table.contains({ "dragon lord", "dragon" }, target:getName():lower()) then - for _, area in ipairs(areas) do - if creature:getPosition():isInRange(area.from, area.to) then - creature:setStorageValue(Storage.AdventurersGuild.GreatDragonHunt.DragonCounter, creature:getStorageValue(Storage.AdventurersGuild.GreatDragonHunt.DragonCounter) + 1) - break - end - end - end + onDeathForParty(creature, mostDamageKiller, function(creature, player) + player:setStorageValue(Storage.AdventurersGuild.GreatDragonHunt.DragonCounter, math.max(0, player:getStorageValue(Storage.AdventurersGuild.GreatDragonHunt.DragonCounter)) + 1) + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/an_uneasy_alliance/renegade_orc_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/an_uneasy_alliance/renegade_orc_kill.lua index 90fcb9c5ae0..dbff7a11b45 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/an_uneasy_alliance/renegade_orc_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/an_uneasy_alliance/renegade_orc_kill.lua @@ -1,16 +1,10 @@ -local renegadeOrcKill = CreatureEvent("RenegadeOrcKill") -function renegadeOrcKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - if targetMonster:getName():lower() ~= "renegade orc" then - return true - end - local player = creature:getPlayer() - if player:getStorageValue(Storage.Quest.U8_54.AnUneasyAlliance.QuestDoor) == 0 then - player:setStorageValue(Storage.Quest.U8_54.AnUneasyAlliance.QuestDoor, 1) - end +local renegadeOrcKill = CreatureEvent("RenegadeOrcDeath") +function renegadeOrcKill.onDeath(creature, _corpse, _lastHitKiller, player, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + if player:getStorageValue(Storage.Quest.U8_54.AnUneasyAlliance.QuestDoor) == 0 then + player:setStorageValue(Storage.Quest.U8_54.AnUneasyAlliance.QuestDoor, 1) + end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/bosses_warzone.lua b/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/bosses_warzone.lua index b123a941a37..f526f67b171 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/bosses_warzone.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/bosses_warzone.lua @@ -5,31 +5,24 @@ local bosses = { } -- This will set the status of warzone (killing 1, 2 and 3 wz bosses in order you can open the chest and get "some golden fruits") and the reward chest storages -local bossesWarzone = CreatureEvent("BossesWarzone") -function bossesWarzone.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - local bossConfig = bosses[targetMonster:getName():lower()] +local bossesWarzone = CreatureEvent("BossesWarzoneDeath") +function bossesWarzone.onDeath(target) + local bossConfig = bosses[creature:getName():lower()] if not bossConfig then return true end - for index, value in pairs(targetMonster:getDamageMap()) do - local attackerPlayer = Player(index) - if attackerPlayer then - if (attackerPlayer:getStorageValue(Storage.BigfootBurden.WarzoneStatus) + 1) == bossConfig.status then - attackerPlayer:setStorageValue(Storage.BigfootBurden.WarzoneStatus, bossConfig.status) - if bossConfig.status == 4 then - attackerPlayer:setStorageValue(Storage.BigfootBurden.DoorGoldenFruits, 1) - end + onDeathForDamagingPlayers(creature, function(creature, player) + if (player:getStorageValue(Storage.BigfootBurden.WarzoneStatus) + 1) == bossConfig.status then + player:setStorageValue(Storage.BigfootBurden.WarzoneStatus, bossConfig.status) + if bossConfig.status == 4 then + player:setStorageValue(Storage.BigfootBurden.DoorGoldenFruits, 1) end - attackerPlayer:setStorageValue(bossConfig.storage, 1) - attackerPlayer:setStorageValue(Storage.BigfootBurden.BossKills, attackerPlayer:getStorageValue(Storage.BigfootBurden.BossKills) + 1) end - end + player:setStorageValue(bossConfig.storage, 1) + player:setStorageValue(Storage.BigfootBurden.BossKills, player:getStorageValue(Storage.BigfootBurden.BossKills) + 1) + end) + return true end bossesWarzone:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/parasite.lua b/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/parasite.lua index 912e6704225..35cd862a602 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/parasite.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/parasite.lua @@ -25,31 +25,21 @@ local function recreateCrystals(c) end end -local parasiteWarzone = CreatureEvent("ParasiteWarzone") -function parasiteWarzone.onKill(player, target) - local targetMonster = target:getMonster() - if not targetMonster then - return false - end - - local targetName = targetMonster:getName():lower() - if targetName ~= "parasite" then - return false - end - - local master = targetMonster:getMaster() +local parasiteWarzone = CreatureEvent("ParasiteDeath") +function parasiteWarzone.onDeath(creature) + local master = creature:getMaster() if not master or master:isPlayer() then return false end - local pos = targetMonster:getPosition() + local pos = creature:getPosition() if pos.x ~= 33097 or pos.y > 31979 or pos.y < 31976 or pos.z ~= 11 then return false end local config = warzoneConfig.findByName("Gnomevil") if config.locked then - targetMonster:say("It seems that someone has already destroyed the walls in the last 30 minutes.", TALKTYPE_MONSTER_SAY) + creature:say("It seems that someone has already destroyed the walls in the last 30 minutes.", TALKTYPE_MONSTER_SAY) return false end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/versperoth_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/versperoth_kill.lua index 4c7df5f6f43..c736981bd4d 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/versperoth_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/versperoth_kill.lua @@ -15,18 +15,9 @@ local function transformTeleport(open) end end -local versperothKill = CreatureEvent("VersperothKill") -function versperothKill.onKill(creature, target) +local versperothKill = CreatureEvent("VersperothDeath") +function versperothKill.onDeath(creature) local config = warzoneConfig.findByName("Abyssador") - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - if targetMonster:getName():lower() ~= "versperoth" then - return true - end - Game.setStorageValue(GlobalStorage.BigfootBurden.Versperoth.Battle, 2) addEvent(Game.setStorageValue, 30 * 60 * 1000, GlobalStorage.BigfootBurden.Versperoth.Battle, 0) diff --git a/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/wiggler_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/wiggler_kill.lua index 72421a59925..41e41ca1e66 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/wiggler_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/bigfoot_burden/wiggler_kill.lua @@ -1,19 +1,11 @@ -local wigglerKill = CreatureEvent("WigglerKill") -function wigglerKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - if targetMonster:getName():lower() ~= "wiggler" then - return true - end - - local player = creature:getPlayer() - local value = player:getStorageValue(Storage.BigfootBurden.ExterminatedCount) - if value < 10 and player:getStorageValue(Storage.BigfootBurden.MissionExterminators) == 1 then - player:setStorageValue(Storage.BigfootBurden.ExterminatedCount, value + 1) - end +local wigglerKill = CreatureEvent("WigglerDeath") +function wigglerKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + local value = player:getStorageValue(Storage.BigfootBurden.ExterminatedCount) + if value < 10 and player:getStorageValue(Storage.BigfootBurden.MissionExterminators) == 1 then + player:setStorageValue(Storage.BigfootBurden.ExterminatedCount, value + 1) + end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/bosses_mission_cults.lua b/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/bosses_mission_cults.lua index a0186fa664d..54e4511eb47 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/bosses_mission_cults.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/bosses_mission_cults.lua @@ -1,16 +1,16 @@ -local bossesCults = CreatureEvent("BossesCults") -function bossesCults.onKill(player, creature) - local bosses = { - ["ravenous hunger"] = { storage = Storage.CultsOfTibia.Barkless.Mission, value = 6 }, - ["the souldespoiler"] = { storage = Storage.CultsOfTibia.Misguided.Mission, value = 4 }, - ["essence of malice"] = { storage = Storage.CultsOfTibia.Humans.Mission, value = 2 }, - ["the unarmored voidborn"] = { storage = Storage.CultsOfTibia.Orcs.Mission, value = 2 }, - ["the false god"] = { storage = Storage.CultsOfTibia.Minotaurs.Mission, value = 4 }, - ["the sandking"] = { storage = Storage.CultsOfTibia.Life.Mission, value = 8, global = "sandking", g_value = 5 }, - ["the corruptor of souls"] = { createNew = "The Source Of Corruption", pos = Position(33039, 31922, 15), removeMonster = "zarcorix of yalahar", area1 = Position(33073, 31885, 15), area2 = Position(33075, 31887, 15) }, - ["the source of corruption"] = { storage = Storage.CultsOfTibia.FinalBoss.Mission, value = 2 }, - } +local bosses = { + ["ravenous hunger"] = { storage = Storage.CultsOfTibia.Barkless.Mission, value = 6 }, + ["the souldespoiler"] = { storage = Storage.CultsOfTibia.Misguided.Mission, value = 4 }, + ["essence of malice"] = { storage = Storage.CultsOfTibia.Humans.Mission, value = 2 }, + ["the unarmored voidborn"] = { storage = Storage.CultsOfTibia.Orcs.Mission, value = 2 }, + ["the false god"] = { storage = Storage.CultsOfTibia.Minotaurs.Mission, value = 4 }, + ["the sandking"] = { storage = Storage.CultsOfTibia.Life.Mission, value = 8, global = "sandking", g_value = 5 }, + ["the corruptor of souls"] = { createNew = "The Source Of Corruption", pos = Position(33039, 31922, 15), removeMonster = "zarcorix of yalahar", area1 = Position(33073, 31885, 15), area2 = Position(33075, 31887, 15) }, + ["the source of corruption"] = { storage = Storage.CultsOfTibia.FinalBoss.Mission, value = 2 }, +} +local bossesCults = CreatureEvent("CultsOfTibiaBossDeath") +function bossesCults.onDeath(creature) if not player:isPlayer() then return true end @@ -21,40 +21,36 @@ function bossesCults.onKill(player, creature) local monsterName = creature:getName():lower() local boss = bosses[monsterName] - if boss then - if boss.global and Game.getStorageValue(boss.global) < boss.g_value then - return true - end - if boss.createNew then - Game.setStorageValue("CheckTile", -1) - Game.createMonster(boss.createNew, boss.pos) - if removeMonster then - for _x = boss.area1.x, boss.area2.x, 1 do - for _y = boss.area1.y, boss.area2.y, 1 do - for _z = boss.area1.z, boss.area2.z, 1 do - if Tile(Position(_x, _y, _z)) then - local monster = Tile(Position(_x, _y, _z)):getTopCreature() - if monster and monster:isMonster() and monster:getName():lower() == string.lower(boss.removeMonster) then - monster:remove() - end + if not boss then + return true + end + if boss.global and Game.getStorageValue(boss.global) < boss.g_value then + return true + end + if boss.createNew then + Game.setStorageValue("CheckTile", -1) + Game.createMonster(boss.createNew, boss.pos) + if removeMonster then + for _x = boss.area1.x, boss.area2.x, 1 do + for _y = boss.area1.y, boss.area2.y, 1 do + for _z = boss.area1.z, boss.area2.z, 1 do + if Tile(Position(_x, _y, _z)) then + local monster = Tile(Position(_x, _y, _z)):getTopCreature() + if monster and monster:isMonster() and monster:getName():lower() == string.lower(boss.removeMonster) then + monster:remove() end end end end end - return true - end - for playerid, damage in pairs(creature:getDamageMap()) do - -- broadcastMessage(playerid.." damage:"..damage.total) - local p = Player(playerid) - if p then - -- broadcastMessage(p:getName()) - if p:getStorageValue(boss.storage) < boss.value then - p:setStorageValue(boss.storage, boss.value) - end - end end + return true end + onDeathForDamagingPlayers(creature, function(creature, player) + if player:getStorageValue(boss.storage) < boss.value then + player:setStorageValue(boss.storage, boss.value) + end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/carlin_vortex_spawn.lua b/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/carlin_vortex_spawn.lua index 9b4037c31e3..43c0b4332f0 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/carlin_vortex_spawn.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/carlin_vortex_spawn.lua @@ -1,24 +1,14 @@ -local vortexCarlin = CreatureEvent("VortexCarlin") -function vortexCarlin.onKill(creature, target, item) - if not creature or not creature:isPlayer() then - return true - end - - if not target or not target:isMonster() then - return true - end - - if table.contains({ "cult enforcer", "cult believer", "cult scholar" }, target:getName():lower()) then - local corpsePosition = target:getPosition() - local rand = math.random(32414, 32415) - Game.createItem(rand, 1, corpsePosition):setActionId(5580) - addEvent(function() - local teleport1 = Tile(corpsePosition):getItemById(rand) - if teleport1 then - teleport1:remove(1) - end - end, (1 * 60 * 1000), rand, 1, corpsePosition) - end +local vortexCarlin = CreatureEvent("CarlinVortexDeath") +function vortexCarlin.onDeath(creature) + local corpsePosition = creature:getPosition() + local rand = math.random(32414, 32415) + Game.createItem(rand, 1, corpsePosition):setActionId(5580) + addEvent(function() + local teleport = Tile(corpsePosition):getItemById(rand) + if teleport then + teleport:remove(1) + end + end, (1 * 60 * 1000), rand, 1, corpsePosition) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/destroyed_pillar.lua b/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/destroyed_pillar.lua index 2c2bd08dfc8..a727a877b23 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/destroyed_pillar.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/destroyed_pillar.lua @@ -1,28 +1,21 @@ -local destroyedPillar = CreatureEvent("DestroyedPillar") -function destroyedPillar.onKill(creature, target) - if not creature or not creature:isPlayer() then - return true - end - if not target or not target:isMonster() then - return true - end +local pillar = { + [1] = "pillar of summoning", + [2] = "pillar of death", + [3] = "pillar of protection", + [4] = "pillar of healing", + [5] = "pillar of draining", +} - local pillar = { - [1] = "pillar of summoning", - [2] = "pillar of death", - [3] = "pillar of protection", - [4] = "pillar of healing", - [5] = "pillar of draining", - } - - local monsterName = target:getName():lower() +local destroyedPillar = CreatureEvent("DestroyedPillar") +function destroyedPillar.onDeath(creature) + local monsterName = creature:getName():lower() local summoning = "summoning" local death = "death" local healing = "healing" local protection = "protection" local draining = "draining" for i = 1, #pillar do - local position = target:getPosition() + local position = creature:getPosition() local pilar = "" local newpos = {} pilar = pillar[i] diff --git a/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/essence_of_malice.lua b/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/essence_of_malice.lua index c107bd7957b..207b64345a6 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/essence_of_malice.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/essence_of_malice.lua @@ -1,6 +1,7 @@ -local essenceOfMalice = CreatureEvent("EssenceOfMalice") -function essenceOfMalice.onKill(creature, target) - local boss = { "eshtaba the conjurer", "mezlon the defiler", "eliz the unyielding", "malkhar deathbringer", "dorokoll the mystic" } +local boss = { "eshtaba the conjurer", "mezlon the defiler", "eliz the unyielding", "malkhar deathbringer", "dorokoll the mystic" } + +local essenceOfMalice = CreatureEvent("EssenceOfMaliceSpawnsDeath") +function essenceOfMalice.onDeath(creature) local newBoss = 0 local fromPos = Position(33087, 31909, 15) local toPos = Position(33112, 31932, 15) @@ -19,7 +20,7 @@ function essenceOfMalice.onKill(creature, target) end end end - if table.contains(boss, target:getName():lower()) and newBoss == 1 then + if table.contains(boss, creature:getName():lower()) and newBoss == 1 then Game.createMonster("Essence Of Malice", Position(33098, 31920, 15)) end return true diff --git a/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/glowing_rubbish_amulet.lua b/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/glowing_rubbish_amulet.lua index bdedfae09bb..55a16295bb3 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/glowing_rubbish_amulet.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/glowing_rubbish_amulet.lua @@ -1,43 +1,35 @@ -local glowingRubbishAmulet = CreatureEvent("GlowingRubbishAmulet") -function glowingRubbishAmulet.onKill(creature, killed) - local player = Player(creature) - if not player then - return true - end - - local monster = Monster(killed) - if not monster then - return true - end - - local amulet = player:getSlotItem(CONST_SLOT_NECKLACE) - if not amulet or amulet:getId() ~= 25296 then - return true - end +local glowingRubbishAmulet = CreatureEvent("GlowingRubbishAmuletDeath") +function glowingRubbishAmulet.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + local amulet = player:getSlotItem(CONST_SLOT_NECKLACE) + if not amulet or amulet:getId() ~= 25296 then + return true + end - if player:getStorageValue(Storage.CultsOfTibia.Misguided.Mission) ~= 3 then - return true - end + if player:getStorageValue(Storage.CultsOfTibia.Misguided.Mission) ~= 3 then + return true + end - local mStg = math.max(player:getStorageValue(Storage.CultsOfTibia.Misguided.Monsters), 0) - local eStg = math.max(player:getStorageValue(Storage.CultsOfTibia.Misguided.Exorcisms), 0) - if monster:getName():lower() == "misguided shadow" then - if eStg < 5 then - player:setStorageValue(Storage.CultsOfTibia.Misguided.Exorcisms, eStg + 1) + local mStg = math.max(player:getStorageValue(Storage.CultsOfTibia.Misguided.Monsters), 0) + local eStg = math.max(player:getStorageValue(Storage.CultsOfTibia.Misguided.Exorcisms), 0) + if monster:getName():lower() == "misguided shadow" then + if eStg < 5 then + player:setStorageValue(Storage.CultsOfTibia.Misguided.Exorcisms, eStg + 1) + end + return true end - return true - end - if monster:getName():lower() == "misguided bully" or monster:getName():lower() == "misguided thief" then - player:setStorageValue(Storage.CultsOfTibia.Misguided.Monsters, mStg + 1) - if player:getStorageValue(Storage.CultsOfTibia.Misguided.Monsters) >= 10 then - amulet:remove() - local it = player:addItem(25297, 1) - if it then - it:decay() + if monster:getName():lower() == "misguided bully" or monster:getName():lower() == "misguided thief" then + player:setStorageValue(Storage.CultsOfTibia.Misguided.Monsters, mStg + 1) + if player:getStorageValue(Storage.CultsOfTibia.Misguided.Monsters) >= 10 then + amulet:remove() + local it = player:addItem(25297, 1) + if it then + it:decay() + end end end - end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/minotaur_task_count.lua b/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/minotaur_task_count.lua index 83c5e2000cc..68f3a0f93a1 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/minotaur_task_count.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/cults_of_tibia/minotaur_task_count.lua @@ -1,17 +1,11 @@ -local minotaurTask = CreatureEvent("MinotaurTask") -function minotaurTask.onKill(creature, target) - if not creature or not creature:isPlayer() then - return true - end - - if not target or not target:isMonster() then - return true - end - - local storage = creature:getStorageValue(Storage.CultsOfTibia.Minotaurs.JamesfrancisTask) - if table.contains({ "minotaur cult follower", "minotaur cult zealot", "minotaur cult prophet" }, target:getName():lower()) and storage >= 0 and storage < 50 then - creature:setStorageValue(Storage.CultsOfTibia.Minotaurs.JamesfrancisTask, storage + 1) - end +local minotaurTask = CreatureEvent("MinotaurCultTaskDeath") +function minotaurTask.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + local storage = player:getStorageValue(Storage.CultsOfTibia.Minotaurs.JamesfrancisTask) + if storage >= 0 and storage < 50 then + player:setStorageValue(Storage.CultsOfTibia.Minotaurs.JamesfrancisTask, storage + 1) + end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/bosses_mission_depths.lua b/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/bosses_mission_depths.lua index 15d23787b7a..63ffa3c6ffd 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/bosses_mission_depths.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/bosses_mission_depths.lua @@ -1,3 +1,9 @@ +local bosses = { + ["the count of the core"] = { storage = Storage.DangerousDepths.Bosses.TheCountOfTheCore, value = os.time() + configManager.getNumber(configKeys.BOSS_DEFAULT_TIME_TO_FIGHT_AGAIN), teleportPosition = Position(33681, 32340, 15), toPosition = Position(33682, 32315, 15), toPositionBack = Position(33324, 32111, 15) }, + ["the duke of the depths"] = { storage = Storage.DangerousDepths.Bosses.TheDukeOfTheDepths, value = os.time() + configManager.getNumber(configKeys.BOSS_DEFAULT_TIME_TO_FIGHT_AGAIN), teleportPosition = Position(33719, 32302, 15), toPosition = Position(33691, 32301, 15), toPositionBack = Position(33275, 32318, 15) }, + ["the baron from below"] = { storage = Storage.DangerousDepths.Bosses.TheBaronFromBelow, value = os.time() + configManager.getNumber(configKeys.BOSS_DEFAULT_TIME_TO_FIGHT_AGAIN), teleportPosition = Position(33650, 32312, 15), toPosition = Position(33668, 32301, 15), toPositionBack = Position(33462, 32267, 15) }, +} + local function revert(position, toPosition) local teleport = Tile(position):getItemById(22761) if teleport then @@ -6,38 +12,23 @@ local function revert(position, toPosition) end end -local bossesMissionDepth = CreatureEvent("BossesMissionDepth") -function bossesMissionDepth.onKill(creature, creature) - if not creature or not creature:isPlayer() then +local bossesMissionDepth = CreatureEvent("DepthWarzoneBossDeath") +function bossesMissionDepth.onDeath(creature) + local boss = bosses[player:getName():lower()] + if not boss then return true end - - if not target or not target:isMonster() then - return true - end - - local bosses = { - ["the count of the core"] = { stg = Storage.DangerousDepths.Bosses.TheCountOfTheCore, value = os.time() + configManager.getNumber(configKeys.BOSS_DEFAULT_TIME_TO_FIGHT_AGAIN), teleportPosition = Position(33681, 32340, 15), toPosition = Position(33682, 32315, 15), toPositionBack = Position(33324, 32111, 15) }, - ["the duke of the depths"] = { stg = Storage.DangerousDepths.Bosses.TheDukeOfTheDepths, value = os.time() + configManager.getNumber(configKeys.BOSS_DEFAULT_TIME_TO_FIGHT_AGAIN), teleportPosition = Position(33719, 32302, 15), toPosition = Position(33691, 32301, 15), toPositionBack = Position(33275, 32318, 15) }, - ["the baron from below"] = { stg = Storage.DangerousDepths.Bosses.TheBaronFromBelow, value = os.time() + configManager.getNumber(configKeys.BOSS_DEFAULT_TIME_TO_FIGHT_AGAIN), teleportPosition = Position(33650, 32312, 15), toPosition = Position(33668, 32301, 15), toPositionBack = Position(33462, 32267, 15) }, - } - - local boss = bosses[creature:getName():lower()] - if boss then - for playerid, damage in pairs(creature:getDamageMap()) do - local player = Player(playerid) - if player then - if player:getStorageValue(boss.stg) < boss.value then - player:setStorageValue(boss.stg, boss.value) - end - end - end - local teleport = Tile(boss.teleportPosition):getItemById(1949) - if teleport then - teleport:transform(22761) - teleport:setDestination(boss.toPosition) - addEvent(revert, 20 * 60 * 1000, boss.teleportPosition, boss.toPositionBack) + onDeathForDamagingPlayers(creature, function(player, _value) + if player:getStorageValue(boss.storage) < boss.value then + player:setStorageValue(boss.storage, boss.value) end + end) + + local teleport = Tile(boss.teleportPosition):getItemById(1949) + if teleport then + teleport:transform(22761) + teleport:setDestination(boss.toPosition) + addEvent(revert, 20 * 60 * 1000, boss.teleportPosition, boss.toPositionBack) end return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/lost_exile_task.lua b/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/lost_exile_task.lua index ce1062785e0..de627fc2229 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/lost_exile_task.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/lost_exile_task.lua @@ -1,44 +1,53 @@ -local lostExileKill = CreatureEvent("LostExileKill") -function lostExileKill.onKill(creature, target) - if not creature or not creature:isPlayer() then - return true - end +local fromPos = Position(33768, 32227, 14) +local toPos = Position(33781, 32249, 14) - if not target or not target:isMonster() then - return true - end +local lostExileKill = CreatureEvent("LastExileDeath") +function lostExileKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + if player:getStorageValue(Storage.DangerousDepths.Dwarves.Home) ~= 1 then + return + end + if not creature:getPosition():isInRange(fromPos, toPos) then + return + end + local storage = player:getStorageValue(Storage.DangerousDepths.Dwarves.LostExiles) + if storage < 20 then + if storage < 0 then + player:setStorageValue(Storage.DangerousDepths.Dwarves.LostExiles, 1) + end + player:setStorageValue(Storage.DangerousDepths.Dwarves.LostExiles, storage + 1) + end + end) + return true +end - local fromPos = Position(33768, 32227, 14) - local toPos = Position(33781, 32249, 14) - local monsterName = target:getName():lower() +lostExileKill:register() - local storage = creature:getStorageValue(Storage.DangerousDepths.Dwarves.LostExiles) - local storage2 = creature:getStorageValue(Storage.DangerousDepths.Dwarves.Organisms) - if table.contains({ "lost exile" }, monsterName) then - if creature:getStorageValue(Storage.DangerousDepths.Dwarves.Home) == 1 then - if target:getPosition():isInRange(fromPos, toPos) then - if storage < 20 then - if storage < 0 then - creature:setStorageValue(Storage.DangerousDepths.Dwarves.LostExiles, 1) - end - creature:setStorageValue(Storage.DangerousDepths.Dwarves.LostExiles, storage + 1) - end - end +local wormKill = CreatureEvent("WarzoneWormDeath") +function wormKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + local storage = player:getStorageValue(Storage.DangerousDepths.Dwarves.Organisms) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + if player:getStorageValue(Storage.DangerousDepths.Dwarves.Subterranean) ~= 1 then + return end - elseif table.contains({ "deepworm", "diremaw" }, monsterName) then - if creature:getStorageValue(Storage.DangerousDepths.Dwarves.Subterranean) == 1 then - if storage2 < 50 then - if storage2 < 0 then - creature:setStorageValue(Storage.DangerousDepths.Dwarves.Organisms, 1) - end - creature:setStorageValue(Storage.DangerousDepths.Dwarves.Organisms, storage2 + 1) + if storage < 50 then + if storage < 0 then + player:setStorageValue(Storage.DangerousDepths.Dwarves.Organisms, 1) end + player:setStorageValue(Storage.DangerousDepths.Dwarves.Organisms, storage + 1) end - elseif table.contains({ "makeshift home" }, monsterName) then - local woodenTrash = Game.createItem(398, 1, target:getPosition()) - woodenTrash:setActionId(57233) - end + end) + return true end -lostExileKill:register() +wormKill:register() + +local makeshiftKill = CreatureEvent("MakeshiftHomeDeath") +function makeshiftKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + local woodenTrash = Game.createItem(398, 1, creature:getPosition()) + woodenTrash:setActionId(57233) + return true +end + +makeshiftKill:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/snail_slime_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/snail_slime_kill.lua index c6886b27128..2134758a8e5 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/snail_slime_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/snail_slime_kill.lua @@ -27,20 +27,17 @@ end combat:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") local function summonSlimes(master) - local contador = 0 + local count = 0 local slimeCheck = Game.getSpectators(master:getPosition(), false, false, 20, 20, 20, 20) for _, slime in pairs(slimeCheck) do if slime:isMonster() then if slime:getName():lower() == "snail slime" then - contador = contador + 1 + count = count + 1 end end end - if contador < 3 then - local summon = Game.createMonster("Snail Slime", master:getPosition(), true) - if summon then - summon:registerEvent("SnailSlimeKill") - end + if count < 3 then + Game.createMonster("Snail Slime", master:getPosition(), true) end end @@ -60,24 +57,11 @@ end snailSlimeThink:register() -local snailSlimeKill = CreatureEvent("SnailSlimeKill") -function snailSlimeKill.onKill(player, creature) - if not player:isPlayer() then - return true - end - if not creature:isMonster() or creature:getMaster() then - return true - end - - local monsterName = creature:getName():lower() - if monsterName == "snail slime" then - if not creature then - return - end - creature:say("!!", TALKTYPE_ORANGE_2) - local var = { type = 1, number = creature:getId() } - combat:execute(creature, var) - end +local snailSlimeKill = CreatureEvent("SnailSlimeDeath") +function snailSlimeKill.onDeath(creature) + creature:say("!!", TALKTYPE_ORANGE_2) + local var = { type = 1, number = creature:getId() } + combat:execute(creature, var) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/the_baron_from_below.lua b/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/the_baron_from_below.lua index be3bcca38cd..22963bfb56b 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/the_baron_from_below.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/dangerous_depths/the_baron_from_below.lua @@ -9,8 +9,8 @@ local function summonHungry(creature) monster:addHealth(-(monster:getHealth() - oldBossHealth)) monster:teleportTo(Position(33648, 32300, 15)) local organicMatter = Game.createMonster("organic matter", Position(33647, 32300, 15), true, true) - if organicMatter then - organicMatter:registerEvent("OrganicMatterKill") + if not organicMatter then + return false end if monster and monster:getName():lower() == "the hungry baron from below" then monster:addHealth(-(monster:getHealth() - oldBossHealth)) @@ -52,34 +52,18 @@ end local theBaronFromBelowThink = CreatureEvent("TheBaronFromBelowThink") function theBaronFromBelowThink.onThink(creature) - if not creature:isMonster() then - return true - end - - if creature:getName():lower() == "the baron from below" then - if not timers[creature:getId()] then - timers[creature:getId()] = addEvent(summonHungry, 30 * 1000, creature:getId()) - end + if not timers[creature:getId()] then + timers[creature:getId()] = addEvent(summonHungry, 30 * 1000, creature:getId()) end return true end theBaronFromBelowThink:register() -local organicMatterKill = CreatureEvent("OrganicMatterKill") -function organicMatterKill.onKill(player, creature) - if not player:isPlayer() then - return true - end - - if not creature:isMonster() then - return true - end - - if creature:getName():lower() == "organic matter" then - for i = 1, 4 do - Game.createMonster("aggressive matter", creature:getPosition(), true, false) - end +local organicMatterKill = CreatureEvent("OrganicMatterDeath") +function organicMatterKill.onDeath(creature) + for i = 1, 4 do + Game.createMonster("aggressive matter", creature:getPosition(), true, false) end end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/dark_trails/kill_death_priest_shargon.lua b/data-otservbr-global/scripts/creaturescripts/quests/dark_trails/kill_death_priest_shargon.lua index 489c033bc33..1cd88f5243c 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/dark_trails/kill_death_priest_shargon.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/dark_trails/kill_death_priest_shargon.lua @@ -15,23 +15,21 @@ local function removeTeleport(position) end end -local deathPriestShargon = CreatureEvent("ShargonKill") -function deathPriestShargon.onKill(creature, target) - if target:isPlayer() or target:getMaster() or target:getName():lower() ~= "death priest shargon" then - return true - end - - local position = target:getPosition() +local deathPriestShargon = CreatureEvent("ShargonDeath") +function deathPriestShargon.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + local position = creature:getPosition() position:sendMagicEffect(CONST_ME_TELEPORT) local item = Game.createItem(config.teleportId, 1, config.teleportPosition) if item:isTeleport() then item:setDestination(config.destinationPosition) end - if config.storageKey ~= nil then - if creature:getStorageValue(config.storageKey) < config.getStorageValue then - creature:setStorageValue(config.storageKey, config.setStorageValue) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + if config.storageKey ~= nil then + if player:getStorageValue(config.storageKey) < config.getStorageValue then + player:setStorageValue(config.storageKey, config.setStorageValue) + end end - end + end) addEvent(removeTeleport, 5 * 60 * 1000, position) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/dark_trails/kill_the_ravager.lua b/data-otservbr-global/scripts/creaturescripts/quests/dark_trails/kill_the_ravager.lua index 0cc355f90c9..97798dadfeb 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/dark_trails/kill_the_ravager.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/dark_trails/kill_the_ravager.lua @@ -6,21 +6,19 @@ local function removeTeleport(position) end end -local theRavager = CreatureEvent("TheRavager") -function theRavager.onKill(creature, target) - if target:isPlayer() or target:getMaster() or target:getName():lower() ~= "the ravager" then - return true - end - - local position = target:getPosition() +local theRavager = CreatureEvent("TheRavagerDeath") +function theRavager.onDeath(player, creature) + local position = creature:getPosition() position:sendMagicEffect(CONST_ME_TELEPORT) local item = Game.createItem(1949, 1, { x = 33496, y = 32070, z = 8 }) if item:isTeleport() then item:setDestination(Position(33459, 32083, 8)) end - if creature:getStorageValue(Storage.DarkTrails.Mission11) < 1 then - creature:setStorageValue(Storage.DarkTrails.Mission11, 1) - end + onDeathForDamagingPlayers(creature, function(creature, player) + if player:getStorageValue(Storage.DarkTrails.Mission11) < 1 then + player:setStorageValue(Storage.DarkTrails.Mission11, 1) + end + end) addEvent(removeTeleport, 5 * 60 * 1000, position) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/dawnport/goblin_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/dawnport/goblin_kill.lua index 9d847279991..3464d10e90e 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/dawnport/goblin_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/dawnport/goblin_kill.lua @@ -1,17 +1,11 @@ -local goblinKill = CreatureEvent("MorrisGoblinKill") -function goblinKill.onKill(player, target) - if target:isPlayer() or target:getMaster() then - return true - end - - if target:getName():lower() ~= "muglex clan footman" then - return true - end - - local killAmount = player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorrisGoblinCount) - if player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorrisGoblin) == 1 and killAmount < 20 then - player:setStorageValue(Storage.Quest.U10_55.Dawnport.MorrisGoblinCount, killAmount + 1) - end +local goblinKill = CreatureEvent("MorrisGoblinDeath") +function goblinKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + local killAmount = player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorrisGoblinCount) + if player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorrisGoblin) == 1 and killAmount < 20 then + player:setStorageValue(Storage.Quest.U10_55.Dawnport.MorrisGoblinCount, killAmount + 1) + end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/dawnport/minotaur_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/dawnport/minotaur_kill.lua index f1b11b45895..dd8718aa0ee 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/dawnport/minotaur_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/dawnport/minotaur_kill.lua @@ -1,17 +1,11 @@ -local minotaurKill = CreatureEvent("MorrisMinotaurKill") -function minotaurKill.onKill(player, target) - if target:isPlayer() or target:getMaster() then - return true - end - - if target:getName():lower() ~= "minotaur bruiser" then - return true - end - - local killAmount = player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorrisMinosCount) - if player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorrisMinos) == 1 and killAmount < 20 then - player:setStorageValue(Storage.Quest.U10_55.Dawnport.MorrisMinosCount, killAmount + 1) - end +local minotaurKill = CreatureEvent("MorrisMinotaurDeath") +function minotaurKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + local killAmount = player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorrisMinosCount) + if player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorrisMinos) == 1 and killAmount < 20 then + player:setStorageValue(Storage.Quest.U10_55.Dawnport.MorrisMinosCount, killAmount + 1) + end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/dawnport/troll_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/dawnport/troll_kill.lua index 6e43a8a5e79..ce7fbeeb252 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/dawnport/troll_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/dawnport/troll_kill.lua @@ -1,17 +1,11 @@ -local trollKill = CreatureEvent("MorrisTrollKill") -function trollKill.onKill(player, target) - if target:isPlayer() or target:getMaster() then - return true - end - - if target:getName():lower() ~= "mountain troll" then - return true - end - - local killAmount = player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorrisTrollCount) - if player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorriskTroll) == 1 and killAmount < 20 then - player:setStorageValue(Storage.Quest.U10_55.Dawnport.MorrisTrollCount, killAmount + 1) - end +local trollKill = CreatureEvent("MorrisTrollDeath") +function trollKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + local killAmount = player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorrisTrollCount) + if player:getStorageValue(Storage.Quest.U10_55.Dawnport.MorriskTroll) == 1 and killAmount < 20 then + player:setStorageValue(Storage.Quest.U10_55.Dawnport.MorrisTrollCount, killAmount + 1) + end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/elemental_spheres/overlord_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/elemental_spheres/overlord_kill.lua index 206923c3328..2d5b7b98f91 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/elemental_spheres/overlord_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/elemental_spheres/overlord_kill.lua @@ -6,13 +6,9 @@ local overlords = { ["lord of the elements"] = {}, } -local elementalSpheresOver = CreatureEvent("OverlordKill") -function elementalSpheresOver.onKill(creature, target) - if not target:isMonster() then - return true - end - - local bossName = target:getName() +local elementalSpheresOver = CreatureEvent("ElementalOverlordDeath") +function elementalSpheresOver.onDeath(creature) + local bossName = creature:getName() local bossConfig = overlords[bossName:lower()] if not bossConfig then return true @@ -21,12 +17,17 @@ function elementalSpheresOver.onKill(creature, target) if bossConfig.globalStorage then Game.setStorageValue(bossConfig.globalStorage, 0) end - - if bossConfig.storage and creature:getStorageValue(bossConfig.storage) < 1 then - creature:setStorageValue(bossConfig.storage, 1) + if not bossConfig.storage then + return true end - creature:say("You slayed " .. bossName .. ".", TALKTYPE_MONSTER_SAY) + onDeathForDamagingPlayers(creature, function(creature, player) + if player:getStorageValue(bossConfig.storage) < 1 then + player:setStorageValue(bossConfig.storage, 1) + end + player:say("You slayed " .. bossName .. ".", TALKTYPE_MONSTER_SAY) + end) + return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/bosses_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/bosses_kill.lua index b0a2f27aba5..9babbd3a0ed 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/bosses_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/bosses_kill.lua @@ -41,27 +41,19 @@ local function revertTeleport(position, itemId, transformId, destination) end local ascendantBossesKill = CreatureEvent("AscendantBossesKill") -function ascendantBossesKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster or targetMonster:getMaster() then - return true - end - - local bossConfig = bosses[targetMonster:getName():lower()] +function ascendantBossesKill.onDeath(creature) + local bossConfig = bosses[creature:getName():lower()] if not bossConfig then return true end - for player, _ in pairs(targetMonster:getDamageMap()) do - local attackerPlayer = Player(player) - if attackerPlayer then - if targetMonster:getName():lower() == "ferumbras mortal shell" then - attackerPlayer:setBossCooldown(targetMonster:getName(), os.time() + 60 * 60 * 14 * 24) - elseif targetMonster:getName():lower() == "the lord of the lice" then - attackerPlayer:setStorageValue(Storage.FerumbrasAscension.TheLordOfTheLiceAccess, 1) - end + onDeathForDamagingPlayers(creature, function(creature, player) + if creature:getName():lower() == "ferumbras mortal shell" then + player:setBossCooldown(creature:getName(), os.time() + 60 * 60 * 14 * 24) + elseif creature:getName():lower() == "the lord of the lice" then + player:setStorageValue(Storage.FerumbrasAscension.TheLordOfTheLiceAccess, 1) end - end + end) local teleport = Tile(bossConfig.teleportPos):getItemById(1949) if not teleport then @@ -70,12 +62,12 @@ function ascendantBossesKill.onKill(creature, target) if teleport then teleport:transform(22761) - targetMonster:getPosition():sendMagicEffect(CONST_ME_THUNDER) + creature:getPosition():sendMagicEffect(CONST_ME_THUNDER) teleport:setDestination(bossConfig.godbreakerPos) addEvent(revertTeleport, 2 * 60 * 1000, bossConfig.teleportPos, 22761, 1949, Position(33319, 32318, 13)) end - if targetMonster:getName():lower() == "ferumbras mortal shell" then + if creature:getName():lower() == "ferumbras mortal shell" then addEvent(transformCrystal, 2 * 60 * 1000) end return true diff --git a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/the_shatterer_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/the_shatterer_kill.lua index 3267107d8f5..a132bf68f17 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/the_shatterer_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/ferumbras_ascendant/the_shatterer_kill.lua @@ -45,12 +45,14 @@ local chains = { [7] = { itemid = 2126, position = Position(33406, 32421, 14) }, }, } + local levers = { [1] = { position = Position(33385, 32410, 14) }, [2] = { position = Position(33403, 32391, 14) }, [3] = { position = Position(33430, 32418, 14) }, [4] = { position = Position(33410, 32441, 14) }, } + local function revert() for i = 1, #chains.West do local chainWest = chains.West[i] @@ -77,27 +79,20 @@ local function revert() end end -local theShattererKill = CreatureEvent("TheShattererKill") -function theShattererKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster or targetMonster:getMaster() or targetMonster:getName():lower() ~= "the shatterer" then - return true - end - for pid, _ in pairs(targetMonster:getDamageMap()) do - local attackerPlayer = Player(pid) - if attackerPlayer then - if targetMonster:getName():lower() == "the shatterer" then - attackerPlayer:setStorageValue(Storage.FerumbrasAscension.TheShatterer, 1) - end - end - end +local teleportPos = Position(33393, 32438, 14) +local newPos = Position(33436, 32443, 15) + +local theShattererKill = CreatureEvent("TheShattererDeath") +function theShattererKill.onDeath(creature) + onDeathForDamagingPlayers(creature, function(creature, player) + player:setStorageValue(Storage.FerumbrasAscension.TheShatterer, 1) + end) + local teleport = Tile(Position(33393, 32438, 14)):getItemById(1949) if not teleport then return true end local oldPos = teleport:getDestination() - local teleportPos = Position(33393, 32438, 14) - local newPos = Position(33436, 32443, 15) if teleport then teleport:transform(22761) targetMonster:getPosition():sendMagicEffect(CONST_ME_THUNDER) diff --git a/data-otservbr-global/scripts/creaturescripts/quests/firewalker_boots/pythius_the_rotten_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/firewalker_boots/pythius_the_rotten_kill.lua index 43543a8cbd7..d1c3f1e7232 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/firewalker_boots/pythius_the_rotten_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/firewalker_boots/pythius_the_rotten_kill.lua @@ -1,11 +1,8 @@ -local firewalkerBootsKill = CreatureEvent("PythiusTheRottenKill") -function firewalkerBootsKill.onKill(player, target) - if not target:isMonster() or target:getName():lower() ~= "pythius the rotten" then - return true - end - - target:say("NICE FIGHTING LITTLE WORM, YOUR VICTORY SHALL BE REWARDED!", TALKTYPE_MONSTER_SAY, false, player, Position(32572, 31405, 15)) +local firewalkerBootsKill = CreatureEvent("PythiusTheRottenDeath") +function firewalkerBootsKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + creature:say("NICE FIGHTING LITTLE WORM, YOUR VICTORY SHALL BE REWARDED!", TALKTYPE_MONSTER_SAY, false, player, Position(32572, 31405, 15)) + local player = Player(mostDamageKiller) player:teleportTo(Position(32577, 31403, 15)) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) return true diff --git a/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/bosses_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/bosses_kill.lua index 047da278310..cf573ea81d7 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/bosses_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/bosses_kill.lua @@ -13,38 +13,32 @@ local bosses = { ["an astral glyph"] = {}, } -local bossesForgottenKill = CreatureEvent("BossesForgottenKill") -function bossesForgottenKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster or targetMonster:getMaster() then - return true - end - +local bossesForgottenKill = CreatureEvent("ForgottenKnowledgeBossDeath") +function bossesForgottenKill.onDeath(creature) local bossConfig = bosses[targetMonster:getName():lower()] if not bossConfig then return true end - for key, value in pairs(targetMonster:getDamageMap()) do - local attackerPlayer = Player(key) - if attackerPlayer then - if bossConfig.storage then - attackerPlayer:setStorageValue(bossConfig.storage, os.time() + 20 * 3600) - elseif targetMonster:getName():lower() == "the enraged thorn knight" then - attackerPlayer:setStorageValue(Storage.ForgottenKnowledge.PlantCounter, 0) - attackerPlayer:setStorageValue(Storage.ForgottenKnowledge.BirdCounter, 0) - elseif targetMonster:getName():lower() == "melting frozen horror" then - local egg = Tile(Position(32269, 31084, 14)):getTopCreature() - if egg then - local pos = egg:getPosition() - egg:remove() - Game.createMonster("baby dragon", pos, true, true) - end - local horror = Tile(Position(32267, 31071, 14)):getTopCreature() - if horror then - horror:remove() - end - end + onDeathForDamagingPlayers(creature, function(creature, player) + if bossConfig.storage then + player:setStorageValue(bossConfig.storage, os.time() + 20 * 3600) + elseif targetMonster:getName():lower() == "the enraged thorn knight" then + player:setStorageValue(Storage.ForgottenKnowledge.PlantCounter, 0) + player:setStorageValue(Storage.ForgottenKnowledge.BirdCounter, 0) + end + end) + + if targetMonster:getName():lower() == "melting frozen horror" then + local egg = Tile(Position(32269, 31084, 14)):getTopCreature() + if egg then + local pos = egg:getPosition() + egg:remove() + Game.createMonster("baby dragon", pos, true, true) + end + local horror = Tile(Position(32267, 31071, 14)):getTopCreature() + if horror then + horror:remove() end end return true diff --git a/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/bound_astral_power.lua b/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/bound_astral_power.lua index c0c327f92ab..3709d5c559a 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/bound_astral_power.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/bound_astral_power.lua @@ -5,31 +5,21 @@ local positions = { [4] = { pos = Position(31995, 32856, 15), nextPos = Position(31975, 32856, 15) }, } -local astralPower = CreatureEvent("AstralPower") -function astralPower.onKill(creature, target) - local player = creature:getPlayer() - if not player then - return true - end - - local targetMonster = target:getMonster() - if not targetMonster or targetMonster:getMaster() then - return true - end - - local bossConfig = targetMonster:getName():lower() == "bound astral power" - if not bossConfig then - return true - end +local astralPower = CreatureEvent("BoundAstralPowerDeath") +function astralPower.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) Game.setStorageValue(GlobalStorage.ForgottenKnowledge.AstralPowerCounter, Game.getStorageValue(GlobalStorage.ForgottenKnowledge.AstralPowerCounter) + 1) if Game.getStorageValue(GlobalStorage.ForgottenKnowledge.AstralPowerCounter) >= 4 then Game.setStorageValue(GlobalStorage.ForgottenKnowledge.AstralPowerCounter, 1) end local msg = "The destruction of the power source gained you more time until the glyph is powered up!" + local player = Player(mostDamageKiller) + if not player then + return true + end for i = 1, #positions do - if creature:getPosition():getDistance(positions[i].pos) < 7 then - target:say(msg, TALKTYPE_MONSTER_SAY, false, nil, positions[i].pos) + if player:getPosition():getDistance(positions[i].pos) < 7 then + creature:say(msg, TALKTYPE_MONSTER_SAY, false, nil, positions[i].pos) Game.createMonster("bound astral power", positions[i].nextPos, true, true) Game.setStorageValue(GlobalStorage.ForgottenKnowledge.AstralGlyph, 1) addEvent(Game.setStorageValue, 1 * 60 * 1000, GlobalStorage.ForgottenKnowledge.AstralGlyph, 0) diff --git a/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/energy_prism.lua b/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/energy_prism.lua index 52ac5e0dc7f..c6611448f83 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/energy_prism.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/energy_prism.lua @@ -1,4 +1,4 @@ -local energyPrism = CreatureEvent("EnergyPrism") +local energyPrism = CreatureEvent("EnergyPrismHealthChange") function energyPrism.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin) if not Tile(Position(32799, 32826, 14)):getTopCreature() then if creature:getHealth() < creature:getMaxHealth() then diff --git a/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/energy_prism_death.lua b/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/energy_prism_death.lua index ecdc212f69a..140362d92b3 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/energy_prism_death.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/energy_prism_death.lua @@ -1,6 +1,5 @@ local energyPrismDeath = CreatureEvent("EnergyPrismDeath") - -function energyPrismDeath.onKill(creature, target) +function energyPrismDeath.onDeath(creature) stopEvent(Storage.ForgottenKnowledge.LloydEvent) local tile = Tile(Position(32799, 32826, 14)) if not tile then diff --git a/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/replica_servants.lua b/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/replica_servants.lua index 6c8811a29fc..f15ee99f3a1 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/replica_servants.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/forgotten_knowledge/replica_servants.lua @@ -8,18 +8,8 @@ local servants = { playerStorage = Storage.ForgottenKnowledge.DiamondServantCounter, }, } -local replicaServant = CreatureEvent("ReplicaServant") -function replicaServant.onKill(creature, target) - local player = creature:getPlayer() - if not player then - return true - end - - local targetMonster = target:getMonster() - if not targetMonster or targetMonster:getMaster() then - return true - end - +local replicaServant = CreatureEvent("ReplicaServantDeath") +function replicaServant.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) local bossConfig = servants[targetMonster:getName():lower()] if not bossConfig then return true @@ -36,6 +26,10 @@ function replicaServant.onKill(creature, target) end end end + local player = Player(mostDamageKiller) + if not player then + return true + end if player:getStorageValue(bossConfig.playerStorage) < 0 then player:setStorageValue(bossConfig.playerStorage, 0) end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/hero_of_rathleton/bosses_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/hero_of_rathleton/bosses_kill.lua index 99478b3b603..db11a05fd13 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/hero_of_rathleton/bosses_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/hero_of_rathleton/bosses_kill.lua @@ -45,12 +45,8 @@ local function revertTeleport(position, itemId, transformId, destination) end end -local rathletonBossKill = CreatureEvent("RathletonBossKill") -function rathletonBossKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not target or not targetMonster or targetMonster:getMaster() then - return true - end +local rathletonBossKill = CreatureEvent("RathletonBossDeath") +function rathletonBossKill.onDeath(creature) local bossConfig = bosses[targetMonster:getName():lower()] if not bossConfig then return true diff --git a/data-otservbr-global/scripts/creaturescripts/quests/in_service_of_yalahar/azerus_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/in_service_of_yalahar/azerus_kill.lua index d150950da65..478dafc6e68 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/in_service_of_yalahar/azerus_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/in_service_of_yalahar/azerus_kill.lua @@ -6,13 +6,8 @@ local function removeTeleport(position) end end -local azerus = CreatureEvent("Azerus") -function azerus.onKill(creature, target) - local targetMonster = target:getMonster() - if not target or not targetMonster or targetMonster:getName():lower() ~= "azerus" then - return true - end - +local azerus = CreatureEvent("AzerusDeath") +function azerus.onDeath(creature) local position = targetMonster:getPosition() position:sendMagicEffect(CONST_ME_TELEPORT) local item = Game.createItem(1949, 1, position) diff --git a/data-otservbr-global/scripts/creaturescripts/quests/in_service_of_yalahar/diseased_trio_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/in_service_of_yalahar/diseased_trio_kill.lua index d0d92ac7c08..7c020aec611 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/in_service_of_yalahar/diseased_trio_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/in_service_of_yalahar/diseased_trio_kill.lua @@ -4,27 +4,23 @@ local diseasedTrio = { ["diseased fred"] = Storage.InServiceofYalahar.DiseasedFred, } -local diseasedTrioKill = CreatureEvent("DiseasedTrio") -function diseasedTrioKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - +local diseasedTrioKill = CreatureEvent("DiseasedTrioDeath") +function diseasedTrioKill.onDeath(creature) local bossStorage = diseasedTrio[targetMonster:getName():lower()] if not bossStorage then return true end - local player = creature:getPlayer() - if player:getStorageValue(bossStorage) < 1 then - player:setStorageValue(bossStorage, 1) - player:say("You slayed " .. targetMonster:getName() .. ".", TALKTYPE_MONSTER_SAY) - end + onDeathForDamagingPlayers(creature, function(creature, player) + if player:getStorageValue(bossStorage) < 1 then + player:setStorageValue(bossStorage, 1) + player:say("You slayed " .. targetMonster:getName() .. ".", TALKTYPE_MONSTER_SAY) + end - if player:getStorageValue(Storage.InServiceofYalahar.DiseasedDan) == 1 and player:getStorageValue(Storage.InServiceofYalahar.DiseasedBill) == 1 and player:getStorageValue(Storage.InServiceofYalahar.DiseasedFred) == 1 and player:getStorageValue(Storage.InServiceofYalahar.AlchemistFormula) ~= 1 then - player:setStorageValue(Storage.InServiceofYalahar.AlchemistFormula, 0) - end + if player:getStorageValue(Storage.InServiceofYalahar.DiseasedDan) == 1 and player:getStorageValue(Storage.InServiceofYalahar.DiseasedBill) == 1 and player:getStorageValue(Storage.InServiceofYalahar.DiseasedFred) == 1 and player:getStorageValue(Storage.InServiceofYalahar.AlchemistFormula) ~= 1 then + player:setStorageValue(Storage.InServiceofYalahar.AlchemistFormula, 0) + end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/in_service_of_yalahar/quara_leader_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/in_service_of_yalahar/quara_leader_kill.lua index 51eb420a80f..91f2faeb951 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/in_service_of_yalahar/quara_leader_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/in_service_of_yalahar/quara_leader_kill.lua @@ -4,27 +4,23 @@ local quaraLeaders = { ["splasher"] = Storage.InServiceofYalahar.QuaraSplasher, } -local quaraLeadersKill = CreatureEvent("QuaraLeaders") -function quaraLeadersKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - local bossStorage = quaraLeaders[targetMonster:getName():lower()] +local quaraLeadersKill = CreatureEvent("QuaraLeadersDeath") +function quaraLeadersKill.onDeath(creature) + local bossStorage = quaraLeaders[creature:getName():lower()] if not bossStorage then return true end - local player = creature:getPlayer() - if player:getStorageValue(bossStorage) < 1 then - player:setStorageValue(bossStorage, 1) - player:say("You slayed " .. targetMonster:getName() .. ".", TALKTYPE_MONSTER_SAY) - player:setStorageValue(Storage.InServiceofYalahar.QuaraState, 2) - player:setStorageValue(Storage.InServiceofYalahar.Questline, 41) - -- StorageValue for Questlog 'Mission 07: A Fishy Mission' - player:setStorageValue(Storage.InServiceofYalahar.Mission07, 4) - end + onDeathForDamagingPlayers(creature, function(creature, player) + if player:getStorageValue(bossStorage) < 1 then + player:setStorageValue(bossStorage, 1) + player:say("You slayed " .. creature:getName() .. ".", TALKTYPE_MONSTER_SAY) + player:setStorageValue(Storage.InServiceofYalahar.QuaraState, 2) + player:setStorageValue(Storage.InServiceofYalahar.Questline, 41) + -- StorageValue for Questlog 'Mission 07: A Fishy Mission' + player:setStorageValue(Storage.InServiceofYalahar.Mission07, 4) + end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/inquisition/inquisition_boss.lua b/data-otservbr-global/scripts/creaturescripts/quests/inquisition/inquisition_boss.lua index e2b15b60137..21546e005ad 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/inquisition/inquisition_boss.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/inquisition/inquisition_boss.lua @@ -8,14 +8,9 @@ local bosses = { ["hellgorak"] = 205, } -local inquisitionBossKill = CreatureEvent("InquisitionBossKill") -function inquisitionBossKill.onKill(player, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - local targetName = targetMonster:getName():lower() +local inquisitionBossKill = CreatureEvent("InquisitionBossDeath") +function inquisitionBossKill.onDeath(creature) + local targetName = creature:getName():lower() local bossStorage = bosses[targetName] if not bossStorage then return true @@ -28,7 +23,9 @@ function inquisitionBossKill.onKill(player, target) Game.setStorageValue(bossStorage, newValue) if newValue == 2 then - player:say("You now have 10 minutes to exit this room through the teleporter. It will bring you to the next room.", TALKTYPE_MONSTER_SAY) + onDeathForDamagingPlayers(creature, function(creature, player) + player:say("You now have 10 minutes to exit this room through the teleporter. It will bring you to the next room.", TALKTYPE_MONSTER_SAY) + end) addEvent(Game.setStorageValue, 10 * 60 * 1000, bossStorage, 0) end return true diff --git a/data-otservbr-global/scripts/creaturescripts/quests/inquisition/inquisition_ungreez.lua b/data-otservbr-global/scripts/creaturescripts/quests/inquisition/inquisition_ungreez.lua index 22cdf8b76fb..6859446d9d4 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/inquisition/inquisition_ungreez.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/inquisition/inquisition_ungreez.lua @@ -1,15 +1,9 @@ -local ungreezKill = CreatureEvent("UngreezKill") -function ungreezKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then +local ungreezKill = CreatureEvent("UngreezDeath") +function ungreezKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + local player = Player(mostDamageKiller) + if not player then return true end - - if targetMonster:getName():lower() ~= "ungreez" then - return true - end - - local player = creature:getPlayer() if player:getStorageValue(Storage.TheInquisition.Questline) == 18 then -- The Inquisition Questlog- 'Mission 6: The Demon Ungreez' player:setStorageValue(Storage.TheInquisition.Mission06, 2) diff --git a/data-otservbr-global/scripts/creaturescripts/quests/killing_in_the_name_of/boss_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/killing_in_the_name_of/boss_kill.lua new file mode 100644 index 00000000000..9fa65883199 --- /dev/null +++ b/data-otservbr-global/scripts/creaturescripts/quests/killing_in_the_name_of/boss_kill.lua @@ -0,0 +1,68 @@ +local taskBoss = { + [0] = "the snapper", + [1] = "hide", + [2] = "deathbine", + [3] = "the bloodtusk", + [4] = "shardhead", + [5] = "esmeralda", + [6] = "fleshcrawler", + [7] = "ribstride", + [8] = "the bloodweb", + [9] = "thul", + [10] = "the old widow", + [11] = "hemming", + [12] = "tormentor", + [13] = "flameborn", + [14] = "fazzrah", + [15] = "tromphonyte", + [16] = "sulphur scuttler", + [17] = "bruise payne", + [18] = "the many", + [19] = "the noxious spawn", + [20] = "gorgo", + [21] = "stonecracker", + [22] = "leviathan", + [23] = "kerberos", + [24] = "ethershreck", + [25] = "paiz the pauperizer", + [26] = "bretzecutioner", + [27] = "zanakeph", + [28] = "tiquandas revenge", + [29] = "demodras", + [30] = "necropharus", + [31] = "the horned fox", +} + +local bossKillCount = Storage.Quest.U8_5.KillingInTheNameOf.BossKillCount.SnapperCount + +local deathEvent = CreatureEvent("KillingInTheNameOfBossDeath") +function deathEvent.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + local targetName = creature:getName():lower() + + onDeathForParty(creature, mostDamageKiller, function(creature, player) + for i, bossName in ipairs(taskBoss) do + if targetName == bossName then + if player:getStorageValue(bossKillCount + i) == 0 then + player:setStorageValue(bossKillCount + i, 1) + end + return true + end + end + end) + return true +end + +deathEvent:register() + +local serverstartup = GlobalEvent("KillingInTheNameOfBossDeathStartup") +function serverstartup.onStartup() + for _, bossName in pairs(taskBoss) do + local mType = MonsterType(bossName) + if not mType then + logger.error("[KillingInTheNameOfBossDeathStartup] boss with name {} is not a valid MonsterType", bossName) + else + mType:registerEvent("KillingInTheNameOfBossDeath") + end + end +end +serverstartup:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/killing_in_the_name_of/kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/killing_in_the_name_of/kill.lua deleted file mode 100644 index 254e72273d4..00000000000 --- a/data-otservbr-global/scripts/creaturescripts/quests/killing_in_the_name_of/kill.lua +++ /dev/null @@ -1,121 +0,0 @@ -local taskBoss = { - [0] = "the snapper", - [1] = "hide", - [2] = "deathbine", - [3] = "the bloodtusk", - [4] = "shardhead", - [5] = "esmeralda", - [6] = "fleshcrawler", - [7] = "ribstride", - [8] = "the bloodweb", - [9] = "thul", - [10] = "the old widow", - [11] = "hemming", - [12] = "tormentor", - [13] = "flameborn", - [14] = "fazzrah", - [15] = "tromphonyte", - [16] = "sulphur scuttler", - [17] = "bruise payne", - [18] = "the many", - [19] = "the noxious spawn", - [20] = "gorgo", - [21] = "stonecracker", - [22] = "leviathan", - [23] = "kerberos", - [24] = "ethershreck", - [25] = "paiz the pauperizer", - [26] = "bretzecutioner", - [27] = "zanakeph", - [28] = "tiquandas revenge", - [29] = "demodras", - [30] = "necropharus", - [31] = "the horned fox", -} -local function killCheck(player, targetName, taskName, taskStage, taskInfo, taskAltKillCount, taskkillCount) - if player:getStorageValue(taskName) == taskStage then - if table.contains(taskInfo, targetName) then - for k = 1, #taskInfo do - if taskAltKillCount ~= nil and targetName == taskInfo[k] then - player:setStorageValue(taskAltKillCount + k - 1, player:getStorageValue(taskAltKillCount + k - 1) + 1) - end - end - player:setStorageValue(taskkillCount, player:getStorageValue(taskkillCount) + 1) - player:setStorageValue(taskName, player:getStorageValue(taskName)) -- fake update quest tracker - end - end -end -local killCounter = Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.KillCount -local BossKillCount = Storage.Quest.U8_5.KillingInTheNameOf.BossKillCount.SnapperCount -local killingInTheNameOfKill = CreatureEvent("KillingInTheNameOfKill") -function killingInTheNameOfKill.onKill(player, target) - if target:isPlayer() or target:getMaster() then - return true - end - local targetName, startedTasks, taskId = target:getName():lower(), player:getStartedTasks() - for i = 1, #startedTasks do - taskId = startedTasks[i] - if table.contains(tasks.GrizzlyAdams[taskId].creatures, targetName) then - if #tasks.GrizzlyAdams[taskId].creatures > 1 then - for a = 1, #tasks.GrizzlyAdams[taskId].creatures do - if targetName == tasks.GrizzlyAdams[taskId].creatures[a] then - if tasks.GrizzlyAdams[taskId].raceName == "Apes" then - local apes = Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.KongraCount + a - 1 - player:setStorageValue(apes, player:getStorageValue(apes) + 1) - elseif tasks.GrizzlyAdams[taskId].raceName == "Quara Scouts" then - local scouts = Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.QuaraConstrictorScoutCount + a - 1 - player:setStorageValue(scouts, player:getStorageValue(scouts) + 1) - elseif tasks.GrizzlyAdams[taskId].raceName == "Underwater Quara" then - local underwater = Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.QuaraConstrictorCount + a - 1 - player:setStorageValue(underwater, player:getStorageValue(underwater) + 1) - elseif tasks.GrizzlyAdams[taskId].raceName == "Nightmares" then - local nightmares = Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.NightmareCount + a - 1 - player:setStorageValue(nightmares, player:getStorageValue(nightmares) + 1) - elseif tasks.GrizzlyAdams[taskId].raceName == "High Class Lizards" then - local lizards = Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.LizardChosenCount + a - 1 - player:setStorageValue(lizards, player:getStorageValue(lizards) + 1) - elseif tasks.GrizzlyAdams[taskId].raceName == "Sea Serpents" then - local serpents = Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.SeaSerpentCount + a - 1 - player:setStorageValue(serpents, player:getStorageValue(serpents) + 1) - elseif tasks.GrizzlyAdams[taskId].raceName == "Drakens" then - local drakens = Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.DrakenAbominationCount + a - 1 - player:setStorageValue(drakens, player:getStorageValue(drakens) + 1) - end - end - end - end - local killAmount = player:getStorageValue(killCounter + taskId) - player:setStorageValue(killCounter + taskId, killAmount + 1) - player:setStorageValue(KILLSSTORAGE_BASE + taskId, player:getStorageValue(KILLSSTORAGE_BASE + taskId)) -- fake update quest tracker - end - end - for j = 0, #taskBoss do - if targetName == taskBoss[j] then - if player:getStorageValue(BossKillCount + j) == 0 then - player:setStorageValue(BossKillCount + j, 1) - end - end - end - -- Minotaurs - killCheck(player, targetName, Storage.KillingInTheNameOf.BudrikMinos, 0, tasks.Budrik[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.MinotaurCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.MinotaurCount) - -- Necromancers and Priestesses - killCheck(player, targetName, Storage.KillingInTheNameOf.LugriNecromancers, 0, tasks.Lugri[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.NecromancerCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.NecromancerCount) - killCheck(player, targetName, Storage.KillingInTheNameOf.LugriNecromancers, 3, tasks.Lugri[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.NecromancerCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.NecromancerCount) - -- Green Djinns or Efreets - killCheck(player, targetName, Storage.KillingInTheNameOf.GreenDjinnTask, 0, tasks.Gabel[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.GreenDjinnCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.GreenDjinnCount) - -- Blue Djinns or Marids - killCheck(player, targetName, Storage.KillingInTheNameOf.BlueDjinnTask, 0, tasks.Malor[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.BlueDjinnCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.BlueDjinnCount) - -- Pirates - killCheck(player, targetName, Storage.KillingInTheNameOf.PirateTask, 0, tasks.RaymondStriker[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.PirateMarauderCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.PirateCount) - -- Trolls - killCheck(player, targetName, Storage.KillingInTheNameOf.TrollTask, 0, tasks.DanielSteelsoul[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.TrollCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.TrollCount) - -- Goblins - killCheck(player, targetName, Storage.KillingInTheNameOf.GoblinTask, 0, tasks.DanielSteelsoul[2].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.GoblinCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.GoblinCount) - -- Rotworms - killCheck(player, targetName, Storage.KillingInTheNameOf.RotwormTask, 0, tasks.DanielSteelsoul[3].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.RotwormCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.RotwormCount) - -- Cyclops - killCheck(player, targetName, Storage.KillingInTheNameOf.CyclopsTask, 0, tasks.DanielSteelsoul[4].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.CyclopsCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.CyclopsCount) - return true -end - -killingInTheNameOfKill:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/killing_in_the_name_of/monster_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/killing_in_the_name_of/monster_kill.lua new file mode 100644 index 00000000000..01b1648c25b --- /dev/null +++ b/data-otservbr-global/scripts/creaturescripts/quests/killing_in_the_name_of/monster_kill.lua @@ -0,0 +1,111 @@ +local function killCheck(player, targetName, taskName, taskStage, taskInfo, taskAltKillCount, taskkillCount) + if player:getStorageValue(taskName) == taskStage then + if table.contains(taskInfo, targetName) then + for k = 1, #taskInfo do + if taskAltKillCount ~= nil and targetName == taskInfo[k] then + player:setStorageValue(taskAltKillCount + k - 1, player:getStorageValue(taskAltKillCount + k - 1) + 1) + end + end + player:setStorageValue(taskkillCount, player:getStorageValue(taskkillCount) + 1) + player:setStorageValue(taskName, player:getStorageValue(taskName)) -- fake update quest tracker + end + end +end + +local killCounter = Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.KillCount + +local deathEvent = CreatureEvent("KillingInTheNameOfMonsterDeath") +function deathEvent.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + local targetName = creature:getName():lower() + + onDeathForParty(creature, mostDamageKiller, function(creature, player) + local startedTasks, taskId = player:getStartedTasks() + for i = 1, #startedTasks do + taskId = startedTasks[i] + if table.contains(tasks.GrizzlyAdams[taskId].creatures, targetName) then + if #tasks.GrizzlyAdams[taskId].creatures > 1 then + for a = 1, #tasks.GrizzlyAdams[taskId].creatures do + if targetName == tasks.GrizzlyAdams[taskId].creatures[a] then + if tasks.GrizzlyAdams[taskId].raceName == "Apes" then + local apes = Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.KongraCount + a - 1 + player:setStorageValue(apes, player:getStorageValue(apes) + 1) + elseif tasks.GrizzlyAdams[taskId].raceName == "Quara Scouts" then + local scouts = Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.QuaraConstrictorScoutCount + a - 1 + player:setStorageValue(scouts, player:getStorageValue(scouts) + 1) + elseif tasks.GrizzlyAdams[taskId].raceName == "Underwater Quara" then + local underwater = Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.QuaraConstrictorCount + a - 1 + player:setStorageValue(underwater, player:getStorageValue(underwater) + 1) + elseif tasks.GrizzlyAdams[taskId].raceName == "Nightmares" then + local nightmares = Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.NightmareCount + a - 1 + player:setStorageValue(nightmares, player:getStorageValue(nightmares) + 1) + elseif tasks.GrizzlyAdams[taskId].raceName == "High Class Lizards" then + local lizards = Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.LizardChosenCount + a - 1 + player:setStorageValue(lizards, player:getStorageValue(lizards) + 1) + elseif tasks.GrizzlyAdams[taskId].raceName == "Sea Serpents" then + local serpents = Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.SeaSerpentCount + a - 1 + player:setStorageValue(serpents, player:getStorageValue(serpents) + 1) + elseif tasks.GrizzlyAdams[taskId].raceName == "Drakens" then + local drakens = Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.DrakenAbominationCount + a - 1 + player:setStorageValue(drakens, player:getStorageValue(drakens) + 1) + end + end + end + end + local killAmount = player:getStorageValue(killCounter + taskId) + player:setStorageValue(killCounter + taskId, killAmount + 1) + player:setStorageValue(KILLSSTORAGE_BASE + taskId, player:getStorageValue(KILLSSTORAGE_BASE + taskId)) -- fake update quest tracker + end + end + -- Minotaurs + killCheck(player, targetName, Storage.KillingInTheNameOf.BudrikMinos, 0, tasks.Budrik[1].creatures, nil, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.MinotaurCount) + -- Necromancers and Priestesses + killCheck(player, targetName, Storage.KillingInTheNameOf.LugriNecromancers, 0, tasks.Lugri[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.NecromancerCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.NecromancerCount) + killCheck(player, targetName, Storage.KillingInTheNameOf.LugriNecromancers, 3, tasks.Lugri[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.NecromancerCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.NecromancerCount) + -- Green Djinns or Efreets + killCheck(player, targetName, Storage.KillingInTheNameOf.GreenDjinnTask, 0, tasks.Gabel[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.GreenDjinnCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.GreenDjinnCount) + -- Blue Djinns or Marids + killCheck(player, targetName, Storage.KillingInTheNameOf.BlueDjinnTask, 0, tasks.Malor[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.BlueDjinnCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.BlueDjinnCount) + -- Pirates + killCheck(player, targetName, Storage.KillingInTheNameOf.PirateTask, 0, tasks.RaymondStriker[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.PirateMarauderCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.PirateCount) + -- Trolls + killCheck(player, targetName, Storage.KillingInTheNameOf.TrollTask, 0, tasks.DanielSteelsoul[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.TrollCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.TrollCount) + -- Goblins + killCheck(player, targetName, Storage.KillingInTheNameOf.GoblinTask, 0, tasks.DanielSteelsoul[2].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.GoblinCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.GoblinCount) + -- Rotworms + killCheck(player, targetName, Storage.KillingInTheNameOf.RotwormTask, 0, tasks.DanielSteelsoul[3].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.RotwormCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.RotwormCount) + -- Cyclops + killCheck(player, targetName, Storage.KillingInTheNameOf.CyclopsTask, 0, tasks.DanielSteelsoul[4].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.CyclopsCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.CyclopsCount) + end) + return true +end + +deathEvent:register() + +local serverstartup = GlobalEvent("KillingInTheNameOfMonsterDeathStartup") +function serverstartup.onStartup() + logger.info("[KillingInTheNameOfMonsterDeathStartup] registering monsters") + local monsters = Set({}, { insensitive = true }) + for _, task in pairs(tasks.GrizzlyAdams) do + monsters = monsters:union(task.creatures) + end + + monsters = monsters:union(tasks.Budrik[1].creatures) + monsters = monsters:union(tasks.Lugri[1].creatures) + monsters = monsters:union(tasks.Gabel[1].creatures) + monsters = monsters:union(tasks.Malor[1].creatures) + monsters = monsters:union(tasks.RaymondStriker[1].creatures) + monsters = monsters:union(tasks.DanielSteelsoul[1].creatures) + monsters = monsters:union(tasks.DanielSteelsoul[2].creatures) + monsters = monsters:union(tasks.DanielSteelsoul[3].creatures) + monsters = monsters:union(tasks.DanielSteelsoul[4].creatures) + + for monster in monsters:iter() do + local mType = MonsterType(monster) + if not mType then + logger.error("[KillingInTheNameOfMonsterDeathStartup] monster with name {} is not a valid MonsterType", monster) + else + mType:registerEvent("KillingInTheNameOfMonsterDeath") + end + end +end +serverstartup:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/bragrumol.lua b/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/bragrumol.lua index 9310a34737c..02846ec6cfd 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/bragrumol.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/bragrumol.lua @@ -1,16 +1,11 @@ -local bragrumol = CreatureEvent("BragrumolKill") +local bragrumol = CreatureEvent("BragrumolDeath") -function bragrumol.onKill(cid, target, damage, flags, corpse) - if isMonster(target) then - if string.lower(getCreatureName(target)) == "bragrumol" then - for attackerUid, damage in pairs(target:getDamageMap()) do - local player = Player(attackerUid) - if player and player:getStorageValue(Storage.Kilmaresh.Twelve.Bragrumol) == 1 then - player:setStorageValue(Storage.Kilmaresh.Twelve.Bragrumol, 2) - end - end +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) end - end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/fafnar.lua b/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/fafnar.lua index 157b2302848..4d94f0e6d3b 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/fafnar.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/fafnar.lua @@ -3,22 +3,25 @@ local monster = { ["priestess of the wild sun"] = Storage.Kilmaresh.Thirteen.Fafnar, } -local fafnar = CreatureEvent("FafnarKill") +local fafnar = CreatureEvent("FafnarMissionsDeath") -function fafnar.onKill(creature, target) - local storage = monster[target:getName():lower()] - if target:isPlayer() or target:getMaster() or not storage then +function fafnar.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + local storage = monster[creature:getName():lower()] + if not storage then return false end - local kills = creature:getStorageValue(storage) - if kills == 300 and creature:getStorageValue(storage) == 1 then - creature:say("You slayed " .. target:getName() .. ".", TALKTYPE_MONSTER_SAY) - else - kills = kills + 1 - creature:say("You have slayed " .. target:getName() .. " " .. kills .. " times!", TALKTYPE_MONSTER_SAY) - creature:setStorageValue(storage, kills) - end + onDeathForParty(creature, mostDamageKiller, function(creature, player) + local kills = player:getStorageValue(storage) + if kills == 300 and player:getStorageValue(storage) == 1 then + player:say("You slayed " .. creature:getName() .. ".", TALKTYPE_MONSTER_SAY) + else + kills = kills + 1 + player:say("You have slayed " .. creature:getName() .. " " .. kills .. " times!", TALKTYPE_MONSTER_SAY) + player:setStorageValue(storage, kills) + end + end) + return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/mozradek.lua b/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/mozradek.lua index e87fef037eb..23507b878b0 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/mozradek.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/mozradek.lua @@ -1,16 +1,11 @@ -local mozradek = CreatureEvent("MozradekKill") +local mozradek = CreatureEvent("MozradekDeath") -function mozradek.onKill(cid, target, damage, flags, corpse) - if isMonster(target) then - if string.lower(getCreatureName(target)) == "mozradek" then - for attackerUid, damage in pairs(target:getDamageMap()) do - local player = Player(attackerUid) - if player and player:getStorageValue(Storage.Kilmaresh.Twelve.Mozradek) == 1 then - player:setStorageValue(Storage.Kilmaresh.Twelve.Mozradek, 2) - end - end +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) end - end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/xogixath.lua b/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/xogixath.lua index d9e2dba2e5e..cbfe0daeb3b 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/xogixath.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/kilmaresh/xogixath.lua @@ -1,16 +1,11 @@ -local xogixath = CreatureEvent("XogixathKill") +local xogixath = CreatureEvent("XogixathDeath") -function xogixath.onKill(cid, target, damage, flags, corpse) - if isMonster(target) then - if string.lower(getCreatureName(target)) == "xogixath" then - for attackerUid, damage in pairs(target:getDamageMap()) do - local player = Player(attackerUid) - if player and player:getStorageValue(Storage.Kilmaresh.Twelve.Xogixath) == 1 then - player:setStorageValue(Storage.Kilmaresh.Twelve.Xogixath, 2) - end - end +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) end - end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/liquid_black/deepling_boss_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/liquid_black/deepling_boss_kill.lua index 369d57155ca..6916f3dfa5a 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/liquid_black/deepling_boss_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/liquid_black/deepling_boss_kill.lua @@ -4,27 +4,19 @@ local bosses = { ["obujos"] = { status = 4, storage = Storage.DeeplingBosses.Obujos }, } -local deeplingBosses = CreatureEvent("DeeplingBosses") -function deeplingBosses.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - local bossConfig = bosses[targetMonster:getName():lower()] +local deeplingBosses = CreatureEvent("DeeplingBossDeath") +function deeplingBosses.onDeath(player, creature) + local bossConfig = bosses[creature:getName():lower()] if not bossConfig then return true end - for pid, _ in pairs(targetMonster:getDamageMap()) do - local attackerPlayer = Player(pid) - if attackerPlayer then - if attackerPlayer:getStorageValue(Storage.DeeplingBosses.DeeplingStatus) < bossConfig.status then - attackerPlayer:setStorageValue(Storage.DeeplingBosses.DeeplingStatus, bossConfig.status) - end - attackerPlayer:setStorageValue(bossConfig.storage, 1) + onDeathForDamagingPlayers(creature, function(creature, player) + if player:getStorageValue(Storage.DeeplingBosses.DeeplingStatus) < bossConfig.status then + player:setStorageValue(Storage.DeeplingBosses.DeeplingStatus, bossConfig.status) end - end + player:setStorageValue(bossConfig.storage, 1) + end) end deeplingBosses:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/raging_mage_tower/energized_raging_mage_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/raging_mage_tower/energized_raging_mage_kill.lua index 95cf707a712..d04b37bf6ee 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/raging_mage_tower/energized_raging_mage_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/raging_mage_tower/energized_raging_mage_kill.lua @@ -1,13 +1,5 @@ -local energizedRagingMageKill = CreatureEvent("EnergizedRagingMageKill") -function energizedRagingMageKill.onKill(player, creature, damage, flags) - if not creature or not creature:isMonster() then - return true - end - - if creature:getName():lower() ~= "energized raging mage" then - return true - end - +local deathEvent = CreatureEvent("EnergizedRagingMageDeath") +function deathEvent.onDeath(creature) if getGlobalStorageValue(673003) < 2000 then return true end @@ -15,10 +7,10 @@ function energizedRagingMageKill.onKill(player, creature, damage, flags) local monster = Game.createMonster("Raging Mage", creature:getPosition()) monster:setReward(true) - doCreatureSayWithRadius(player, "GNAAAAAHRRRG!! WHAT? WHAT DID YOU DO TO ME!! I... I feel the energies crawling away... from me... DIE!!!", TALKTYPE_ORANGE_1, 35, 71) + doCreatureSayWithRadius(creature, "GNAAAAAHRRRG!! WHAT? WHAT DID YOU DO TO ME!! I... I feel the energies crawling away... from me... DIE!!!", TALKTYPE_ORANGE_1, 35, 71) setGlobalStorageValue(673003, 0) return true end -energizedRagingMageKill:register() +deathEvent:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/raging_mage_tower/raging_mage_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/raging_mage_tower/raging_mage_kill.lua index a99341b7eaa..a24f174f5e7 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/raging_mage_tower/raging_mage_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/raging_mage_tower/raging_mage_kill.lua @@ -1,26 +1,20 @@ -local ragingMageKill = CreatureEvent("ragingMageKill") +local deathEvent = CreatureEvent("RagingMageDeath") -function ragingMageKill.onKill(cid, target, damage, flags, corpse) - if not target or type(target) ~= "userdata" or not target:isMonster() then - return true - end +function deathEvent.onDeath(creature) + broadcastMessage("The remains of the Raging Mage are scattered on the floor of his Tower. The dimensional portal quakes.", MESSAGE_EVENT_ADVANCE) + doCreatureSay(creature, "I WILL RETURN!! My death will just be a door to await my homecoming, my physical hull will be... my... argh...", TALKTYPE_ORANGE_1) - if target:getName():lower() == "raging mage" then - broadcastMessage("The remains of the Raging Mage are scattered on the floor of his Tower. The dimensional portal quakes.", MESSAGE_EVENT_ADVANCE) - doCreatureSay(target, "I WILL RETURN!! My death will just be a door to await my homecoming, my physical hull will be... my... argh...", TALKTYPE_ORANGE_1) - - addEvent(function() - broadcastMessage("With a great bang the dimensional portal in Zao collapsed and with it the connection to the other dimension shattered.", MESSAGE_EVENT_ADVANCE) - local tile = Tile(Position({ x = 33143, y = 31527, z = 2 })) - if tile then - local item = tile:getItemById(11796) - if item then - item:remove(1) - end + addEvent(function() + broadcastMessage("With a great bang the dimensional portal in Zao collapsed and with it the connection to the other dimension shattered.", MESSAGE_EVENT_ADVANCE) + local tile = Tile(Position({ x = 33143, y = 31527, z = 2 })) + if tile then + local item = tile:getItemById(11796) + if item then + item:remove(1) end - end, 5 * 60 * 1000) - end + end + end, 5 * 60 * 1000) return true end -ragingMageKill:register() +deathEvent:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/raging_mage_tower/yielothax_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/raging_mage_tower/yielothax_kill.lua index c22332db7a2..8ff28ceb824 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/raging_mage_tower/yielothax_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/raging_mage_tower/yielothax_kill.lua @@ -1,10 +1,6 @@ -local yielothaxKill = CreatureEvent("YielothaxKill") -function yielothaxKill.onKill(cid, target, damage, flags) - if isMonster(target) then - if string.lower(getCreatureName(target)) == "yielothax" then - setGlobalStorageValue(673003, getGlobalStorageValue(673003) + 1) - end - end +local yielothaxKill = CreatureEvent("YielothaxDeath") +function yielothaxKill.onDeath(creature) + setGlobalStorageValue(673003, getGlobalStorageValue(673003) + 1) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/secret_service/black_knight_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/secret_service/black_knight_kill.lua index 611de73ce09..d63dac6a194 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/secret_service/black_knight_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/secret_service/black_knight_kill.lua @@ -1,19 +1,10 @@ -local blackKnightKill = CreatureEvent("BlackKnightKill") -function blackKnightKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - if targetMonster:getName():lower() ~= "black knight" then - return true - end - - local player = creature:getPlayer() - if player:getStorageValue(Storage.SecretService.AVINMission04) == 1 then - player:setStorageValue(Storage.SecretService.AVINMission04, 2) - end - +local blackKnightKill = CreatureEvent("BlackKnightDeath") +function blackKnightKill.onDeath(creature) + onDeathForDamagingPlayers(creature, function(creature, player) + if player:getStorageValue(Storage.SecretService.AVINMission04) == 1 then + player:setStorageValue(Storage.SecretService.AVINMission04, 2) + end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/spike_tasks/lower_spike_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/spike_tasks/lower_spike_kill.lua index 02282ff3f37..16c79963c42 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/spike_tasks/lower_spike_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/spike_tasks/lower_spike_kill.lua @@ -4,20 +4,23 @@ local range = { to = Position(32345, 32710, 15), } -local lowerSpikeKill = CreatureEvent("LowerSpikeKill") -function lowerSpikeKill.onKill(creature, target) - if not table.contains({ -1, 7 }, creature:getStorageValue(SPIKE_LOWER_KILL_MAIN)) then - if creature:getPosition():isInRange(range.from, range.to) then - if target:isMonster() and (target:getMaster() == nil) and (target:getName():lower() == "drillworm") then - local sum = creature:getStorageValue(SPIKE_LOWER_KILL_MAIN) + 1 - creature:setStorageValue(SPIKE_LOWER_KILL_MAIN, sum) - creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have slayed " .. sum .. " out of 7 Drillworms.") - if sum == 7 then - creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Report the task to Gnomargery.") - end +local lowerSpikeKill = CreatureEvent("LowerSpikeDeath") +function lowerSpikeKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + if not creature:getPosition():isInRange(range.from, range.to) then + return true + end + + onDeathForParty(creature, mostDamageKiller, function(creature, player) + if not table.contains({ -1, 7 }, player:getStorageValue(SPIKE_LOWER_KILL_MAIN)) then + local sum = player:getStorageValue(SPIKE_LOWER_KILL_MAIN) + 1 + player:setStorageValue(SPIKE_LOWER_KILL_MAIN, sum) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have slayed " .. sum .. " out of 7 Drillworms.") + if sum == 7 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Report the task to Gnomargery.") end end - end + end) + return true end lowerSpikeKill:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/spike_tasks/middle_spike_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/spike_tasks/middle_spike_kill.lua index f5f8e0b673f..2dd6017d106 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/spike_tasks/middle_spike_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/spike_tasks/middle_spike_kill.lua @@ -4,20 +4,22 @@ local range = { to = Position(32380, 32725, 12), } -local middleSpikeKill = CreatureEvent("MiddleSpikeKill") -function middleSpikeKill.onKill(creature, target) - if not table.contains({ -1, 7 }, creature:getStorageValue(SPIKE_MIDDLE_KILL_MAIN)) then - if creature:getPosition():isInRange(range.from, range.to) then - if target:isMonster() and (target:getMaster() == nil) and (target:getName():lower() == "crystalcrusher") then - local sum = creature:getStorageValue(SPIKE_MIDDLE_KILL_MAIN) + 1 - creature:setStorageValue(SPIKE_MIDDLE_KILL_MAIN, sum) - creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have slayed " .. sum .. " out of 7 Crystalcrushers.") - if sum == 7 then - creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Report the task to Gnombold.") - end +local middleSpikeKill = CreatureEvent("MiddleSpikeDeath") +function middleSpikeKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + if not creature:getPosition():isInRange(range.from, range.to) then + return true + end + onDeathForParty(creature, mostDamageKiller, function(creature, player) + if not table.contains({ -1, 7 }, player:getStorageValue(SPIKE_MIDDLE_KILL_MAIN)) then + local sum = player:getStorageValue(SPIKE_MIDDLE_KILL_MAIN) + 1 + player:setStorageValue(SPIKE_MIDDLE_KILL_MAIN, sum) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have slayed " .. sum .. " out of 7 Crystalcrushers.") + if sum == 7 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Report the task to Gnombold.") end end - end + end) + return true end middleSpikeKill:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/spike_tasks/upper_spike_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/spike_tasks/upper_spike_kill.lua index d06f4e2c94f..96f9dc6b397 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/spike_tasks/upper_spike_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/spike_tasks/upper_spike_kill.lua @@ -4,20 +4,23 @@ local range = { to = Position(32365, 32759, 10), } -local upperSpikeKill = CreatureEvent("UpperSpikeKill") -function upperSpikeKill.onKill(creature, target) - if not table.contains({ -1, 7 }, creature:getStorageValue(SPIKE_UPPER_KILL_MAIN)) then - if creature:getPosition():isInRange(range.from, range.to) then - if target:isMonster() and (target:getMaster() == nil) and (target:getName():lower() == "demon skeleton") then - local sum = creature:getStorageValue(SPIKE_UPPER_KILL_MAIN) + 1 - creature:setStorageValue(SPIKE_UPPER_KILL_MAIN, sum) - creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have slayed " .. sum .. " out of 7 Demon Skeletons.") - if sum == 7 then - creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Report the task to Gnomilly.") - end +local upperSpikeKill = CreatureEvent("UpperSpikeDeath") +function upperSpikeKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + if not creature:getPosition():isInRange(range.from, range.to) then + return false + end + + onDeathForParty(creature, mostDamageKiller, function(creature, player) + if not table.contains({ -1, 7 }, player:getStorageValue(SPIKE_UPPER_KILL_MAIN)) then + local sum = player:getStorageValue(SPIKE_UPPER_KILL_MAIN) + 1 + player:setStorageValue(SPIKE_UPPER_KILL_MAIN, sum) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have slayed " .. sum .. " out of 7 Demon Skeletons.") + if sum == 7 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Report the task to Gnomilly.") end end - end + end) + return true end upperSpikeKill:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/svargrond_arena/arena_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/svargrond_arena/arena_kill.lua index 7798c4b3738..674dc5d27d5 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/svargrond_arena/arena_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/svargrond_arena/arena_kill.lua @@ -1,11 +1,10 @@ -local svargrondArenaKill = CreatureEvent("SvargrondArenaKill") -function svargrondArenaKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return +local deathEvent = CreatureEvent("SvargrondArenaBossDeath") +function deathEvent.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + local player = Player(mostDamageKiller) + if not player then + return true end - local player = creature:getPlayer() local pit = player:getStorageValue(Storage.SvargrondArena.PitDoor) if pit < 1 or pit > 10 then return @@ -16,7 +15,7 @@ function svargrondArenaKill.onKill(creature, target) return end - if not table.contains(ARENA[arena].creatures, targetMonster:getName():lower()) then + if not table.contains(ARENA[arena].creatures, creature:getName():lower()) then return end @@ -40,4 +39,19 @@ function svargrondArenaKill.onKill(creature, target) return true end -svargrondArenaKill:register() +deathEvent:register() + +local serverstartup = GlobalEvent("SvargrondArenaBossDeathStartup") +function serverstartup.onStartup() + for _, arena in pairs(ARENA) do + for _, bossName in pairs(arena.creatures) do + local mType = MonsterType(bossName) + if not mType then + logger.error("[SvargrondArenaBossDeathStartup] boss with name {} is not a valid MonsterType", bossName) + else + mType:registerEvent("SvargrondArenaBossDeath") + end + end + end +end +serverstartup:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/the_first_dragon/kill_dragon.lua b/data-otservbr-global/scripts/creaturescripts/quests/the_first_dragon/kill_dragon.lua index eae77dc5437..55045c65e9d 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/the_first_dragon/kill_dragon.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/the_first_dragon/kill_dragon.lua @@ -1,18 +1,12 @@ -local killDragon = CreatureEvent("KillDragon") +local killDragon = CreatureEvent("TheFirstDragonDragonTaskDeath") -function killDragon.onKill(player, target) - if target:isPlayer() or target:getMaster() then - return true - end - if target:getName():lower() == "dragon" then +function killDragon.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) local storage = player:getStorageValue(Storage.FirstDragon.DragonCounter) if storage >= 0 and storage < 200 then player:setStorageValue(Storage.FirstDragon.DragonCounter, player:getStorageValue(Storage.FirstDragon.DragonCounter) + 1) end - end - if player:getStorageValue(Storage.FirstDragon.TazhadurTimer) >= os.time() then - return true - end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/the_ice_islands/husky_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/the_ice_islands/husky_kill.lua index 3103f924e44..b5a3f4c4dff 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/the_ice_islands/husky_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/the_ice_islands/husky_kill.lua @@ -1,13 +1,10 @@ -local huskyKill = CreatureEvent("HuskyKill") +local huskyKill = CreatureEvent("HuskyDeath") -function huskyKill.onKill(player, target) - if target:isPlayer() or target:getMaster() then - return true - end - - if target:getName():lower() == "husky" then - player:setStorageValue(Storage.TheIceIslands.HuskyKill, player:getStorageValue(Storage.TheIceIslands.HuskyKill) + 1) - end +function huskyKill.onDeath(creature) + onDeathForDamagingPlayers(creature, function(creature, player) + local value = player:getStorageValue(Storage.TheIceIslands.HuskyKill) or 0 + player:setStorageValue(Storage.TheIceIslands.HuskyKill, value + 1) + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/the_primal_ordeal/the_primal_menace_killed.lua b/data-otservbr-global/scripts/creaturescripts/quests/the_primal_ordeal/the_primal_menace_killed.lua index 2f5af644afa..3cafb041e31 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/the_primal_ordeal/the_primal_menace_killed.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/the_primal_ordeal/the_primal_menace_killed.lua @@ -1,29 +1,21 @@ local thePrimalMenaceDeath = CreatureEvent("ThePrimalMenaceDeath") -function thePrimalMenaceDeath.onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamage_unjustified) - if not creature then - return - end - +function thePrimalMenaceDeath.onDeath(creature) local damageMap = creature:getMonster():getDamageMap() local hazard = Hazard.getByName("hazard.gnomprona-gardens") if not hazard then return end local _, hazardPoints = hazard:getHazardPlayerAndPoints(damageMap) + onDeathForDamagingPlayers(creature, function(creature, player) + if player:getStorageValue(Storage.Quest.U12_90.PrimalOrdeal.Bosses.ThePrimalMenaceKilled) < 1 then + player:setStorageValue(Storage.Quest.U12_90.PrimalOrdeal.Bosses.ThePrimalMenaceKilled, 1) + end - for key, value in pairs(damageMap) do - local player = Player(key) - if player then - if player:getStorageValue(Storage.Quest.U12_90.PrimalOrdeal.Bosses.ThePrimalMenaceKilled) < 1 then - player:setStorageValue(Storage.Quest.U12_90.PrimalOrdeal.Bosses.ThePrimalMenaceKilled, 1) - end - - if hazard:getPlayerMaxLevel(player) == hazardPoints then - hazard:levelUp(player) - end + if hazard:getPlayerMaxLevel(player) == hazardPoints then + hazard:levelUp(player) end - end + end) end thePrimalMenaceDeath:register() diff --git a/data-otservbr-global/scripts/creaturescripts/quests/thieves_guild/nomad_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/thieves_guild/nomad_kill.lua index 1bf05869998..6f9c3d32547 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/thieves_guild/nomad_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/thieves_guild/nomad_kill.lua @@ -1,19 +1,10 @@ -local nomadKill = CreatureEvent("NomadKill") -function nomadKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - if targetMonster:getName():lower() ~= "nomad" then - return true - end - - local player = creature:getPlayer() - if player:getStorageValue(Storage.ThievesGuild.Mission04) == 3 then - player:setStorageValue(Storage.ThievesGuild.Mission04, 4) - end - +local nomadKill = CreatureEvent("NomadDeath") +function nomadKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + if player:getStorageValue(Storage.ThievesGuild.Mission04) == 3 then + player:setStorageValue(Storage.ThievesGuild.Mission04, 4) + end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/bosses_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/bosses_kill.lua index 2cb2db29438..37a823a67ac 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/bosses_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/bosses_kill.lua @@ -17,14 +17,9 @@ local bosses = { }, } -local bossesKill = CreatureEvent("BossesKill") -function bossesKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - local bossConfig = bosses[targetMonster:getName():lower()] +local bossesKill = CreatureEvent("WrathOfTheEmperorBossDeat") +function bossesKill.onDeath(creature) + local bossConfig = bosses[creature:getName():lower()] if not bossConfig then return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/keeper_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/keeper_kill.lua index f43204ce59c..5be3f6f6dbe 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/keeper_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/keeper_kill.lua @@ -1,13 +1,6 @@ -local keeperKill = CreatureEvent("KeeperKill") -function keeperKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - if targetMonster:getName():lower() == "the keeper" then - Game.setStorageValue(Storage.WrathoftheEmperor.Mission03, 0) - end +local keeperKill = CreatureEvent("TheKeeperDeath") +function keeperKill.onDeath(creature) + Game.setStorageValue(Storage.WrathoftheEmperor.Mission03, 0) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/lizard_magistratus_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/lizard_magistratus_kill.lua index e526a699b20..8be99184fda 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/lizard_magistratus_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/lizard_magistratus_kill.lua @@ -1,20 +1,11 @@ -local lizardMagistratusKill = CreatureEvent("LizardMagistratusKill") -function lizardMagistratusKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - if targetMonster:getName():lower() ~= "lizard magistratus" then - return true - end - - local player = creature:getPlayer() - local storage = player:getStorageValue(Storage.WrathoftheEmperor.Mission06) - if storage >= 0 and storage < 4 then - player:setStorageValue(Storage.WrathoftheEmperor.Mission06, math.max(1, storage) + 1) - end - +local lizardMagistratusKill = CreatureEvent("LizardMagistratusDeath") +function lizardMagistratusKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + local storage = player:getStorageValue(Storage.WrathoftheEmperor.Mission06) + if storage >= 0 and storage < 4 then + player:setStorageValue(Storage.WrathoftheEmperor.Mission06, math.max(1, storage) + 1) + end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/lizard_noble_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/lizard_noble_kill.lua index ab45524fba1..112feffa73f 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/lizard_noble_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/lizard_noble_kill.lua @@ -1,20 +1,11 @@ -local lizardNobleKill = CreatureEvent("LizardNobleKill") -function lizardNobleKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - if targetMonster:getName():lower() ~= "lizard noble" then - return true - end - - local player = creature:getPlayer() - local storage = player:getStorageValue(Storage.WrathoftheEmperor.Mission07) - if storage >= 0 and storage < 6 then - player:setStorageValue(Storage.WrathoftheEmperor.Mission07, math.max(1, storage) + 1) - end - +local lizardNobleKill = CreatureEvent("LizardNobleDeath") +function lizardNobleKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + local storage = player:getStorageValue(Storage.WrathoftheEmperor.Mission07) + if storage >= 0 and storage < 6 then + player:setStorageValue(Storage.WrathoftheEmperor.Mission07, math.max(1, storage) + 1) + end + end) return true end diff --git a/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/zalamon_kill.lua b/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/zalamon_kill.lua index 143049aaece..349c704ca64 100644 --- a/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/zalamon_kill.lua +++ b/data-otservbr-global/scripts/creaturescripts/quests/wrath_of_the_emperor/zalamon_kill.lua @@ -13,26 +13,21 @@ local bossForms = { }, } -local zalamonKill = CreatureEvent("ZalamonKill") -function zalamonKill.onKill(player, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - if targetMonster:getName():lower() == "mutated zalamon" then +local zalamonKill = CreatureEvent("ZalamonDeath") +function zalamonKill.onDeath(creature) + if creature:getName():lower() == "mutated zalamon" then Game.setStorageValue(Storage.WrathoftheEmperor.Mission11, -1) return true end - local name = targetMonster:getName():lower() + local name = creature:getName():lower() local bossConfig = bossForms[name] if not bossConfig then return true end local found = false - for k, v in ipairs(Game.getSpectators(targetMonster:getPosition())) do + for k, v in ipairs(Game.getSpectators(creature:getPosition())) do if v:getName():lower() == bossConfig.newForm then found = true break @@ -40,8 +35,10 @@ function zalamonKill.onKill(player, target) end if not found then - Game.createMonster(bossConfig.newForm, targetMonster:getPosition(), false, true) - player:say(bossConfig.text, TALKTYPE_MONSTER_SAY) + local monster = Game.createMonster(bossConfig.newForm, creature:getPosition(), false, true) + if monster then + monster:say(bossConfig.text, TALKTYPE_MONSTER_SAY) + end end return true end diff --git a/data-otservbr-global/scripts/hazard/primal.lua b/data-otservbr-global/scripts/hazard/primal.lua index 8aeb80a555c..e4309b78f67 100644 --- a/data-otservbr-global/scripts/hazard/primal.lua +++ b/data-otservbr-global/scripts/hazard/primal.lua @@ -82,8 +82,14 @@ function createPrimalPod(position) end end -local primalKill = CreatureEvent("PrimalHazardKill") -function primalKill.onKill(_player, creature) +local spawnEvent = ZoneEvent(hazardZone) +function spawnEvent.onSpawn(monster, position) + monster:registerEvent("PrimalHazardDeath") +end +spawnEvent:register() + +local deathEvent = CreatureEvent("PrimalHazardDeath") +function deathEvent.onDeath(creature) if not configManager.getBoolean(configKeys.TOGGLE_HAZARDSYSTEM) then return true end @@ -123,4 +129,4 @@ function primalKill.onKill(_player, creature) return true end -primalKill:register() +deathEvent:register() diff --git a/data-otservbr-global/scripts/quests/primal_ordeal_quest/bosses_killed.lua b/data-otservbr-global/scripts/quests/primal_ordeal_quest/bosses_killed.lua new file mode 100644 index 00000000000..cb0c34b6401 --- /dev/null +++ b/data-otservbr-global/scripts/quests/primal_ordeal_quest/bosses_killed.lua @@ -0,0 +1,18 @@ +local bosses = { + ["magma bubble"] = { storage = Storage.Quest.U12_90.PrimalOrdeal.Bosses.MagmaBubbleKilled }, + ["the primal menace"] = { storage = Storage.Quest.U12_90.PrimalOrdeal.Bosses.ThePrimalMenaceKilled }, +} + +local bossesPrimeOrdeal = CreatureEvent("ThePrimeOrdealBossDeath") +function bossesPrimeOrdeal.onDeath(creature) + local bossConfig = bosses[creature:getName():lower()] + if not bossConfig or not bossConfig.storage then + return true + end + onDeathForDamagingPlayers(creature, function(creature, player) + player:setStorageValue(bossConfig.storage, 1) + end) + return true +end + +bossesPrimeOrdeal:register() diff --git a/data-otservbr-global/scripts/quests/the_new_frontier/creaturescripts-shard_of_corruption_kill.lua b/data-otservbr-global/scripts/quests/the_new_frontier/creaturescripts-shard_of_corruption_kill.lua deleted file mode 100644 index 4d97191766a..00000000000 --- a/data-otservbr-global/scripts/quests/the_new_frontier/creaturescripts-shard_of_corruption_kill.lua +++ /dev/null @@ -1,22 +0,0 @@ -local TheNewFrontier = Storage.Quest.U8_54.TheNewFrontier - -local shardOfCorruptionKill = CreatureEvent("ShardOfCorruptionKill") - -function shardOfCorruptionKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - if targetMonster:getName():lower() ~= "shard of corruption" then - return true - end - - local player = creature:getPlayer() - if player:getStorageValue(TheNewFrontier.Questline) == 11 then - player:setStorageValue(TheNewFrontier.Questline, 12) - end - return true -end - -shardOfCorruptionKill:register() diff --git a/data-otservbr-global/scripts/quests/the_new_frontier/shard_of_corruption_kill.lua b/data-otservbr-global/scripts/quests/the_new_frontier/shard_of_corruption_kill.lua new file mode 100644 index 00000000000..24d4a02922c --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_new_frontier/shard_of_corruption_kill.lua @@ -0,0 +1,14 @@ +local TheNewFrontier = Storage.Quest.U8_54.TheNewFrontier + +local shardOfCorruptionKill = CreatureEvent("ShardOfCorruptionDeath") + +function shardOfCorruptionKill.onDeath(creature) + onDeathForDamagingPlayers(creature, function(creature, player) + if player:getStorageValue(TheNewFrontier.Questline) == 11 then + player:setStorageValue(TheNewFrontier.Questline, 12) + end + end) + return true +end + +shardOfCorruptionKill:register() diff --git a/data-otservbr-global/scripts/quests/the_new_frontier/creaturescripts-tirecz_kill.lua b/data-otservbr-global/scripts/quests/the_new_frontier/tirecz_kill.lua similarity index 83% rename from data-otservbr-global/scripts/quests/the_new_frontier/creaturescripts-tirecz_kill.lua rename to data-otservbr-global/scripts/quests/the_new_frontier/tirecz_kill.lua index 3bd59a34450..5de50bf0eb1 100644 --- a/data-otservbr-global/scripts/quests/the_new_frontier/creaturescripts-tirecz_kill.lua +++ b/data-otservbr-global/scripts/quests/the_new_frontier/tirecz_kill.lua @@ -14,18 +14,9 @@ local function clearArena() end end -local tireczKill = CreatureEvent("TireczKill") - -function tireczKill.onKill(creature, target) - local targetMonster = target:getMonster() - if not targetMonster then - return true - end - - if targetMonster:getName():lower() ~= "tirecz" then - return true - end +local tireczKill = CreatureEvent("TireczDeath") +function tireczKill.onDeath(creature) local spectators, spectator = Game.getSpectators(Position({ x = 33063, y = 31034, z = 3 }), false, true, 10, 10, 10, 10) for i = 1, #spectators do spectator = spectators[i] diff --git a/data-otservbr-global/scripts/quests/the_rookie_guard/mission03_rational_request.lua b/data-otservbr-global/scripts/quests/the_rookie_guard/mission03_rational_request.lua index 7bd56fbd633..ee2e814656e 100644 --- a/data-otservbr-global/scripts/quests/the_rookie_guard/mission03_rational_request.lua +++ b/data-otservbr-global/scripts/quests/the_rookie_guard/mission03_rational_request.lua @@ -2,21 +2,17 @@ -- Mission Kills -local ratKill = CreatureEvent("VascalirRatKills") +local ratKill = CreatureEvent("RationalRequestRatDeath") -function ratKill.onKill(player, target) - if target:isPlayer() or target:getMaster() then - return true - end - if not target:getName():lower() == "rat" then - return true - end - if player:getStorageValue(Storage.TheRookieGuard.Mission03) == 1 then - local counter = player:getStorageValue(Storage.TheRookieGuard.RatKills) - if counter < 5 then - player:setStorageValue(Storage.TheRookieGuard.RatKills, counter + 1) +function ratKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + if player:getStorageValue(Storage.TheRookieGuard.Mission03) == 1 then + local counter = player:getStorageValue(Storage.TheRookieGuard.RatKills) + if counter < 5 then + player:setStorageValue(Storage.TheRookieGuard.RatKills, counter + 1) + end end - end + end) return true end diff --git a/data-otservbr-global/scripts/quests/threatened_dreams/creaturescript-nightmare_monsters_kills.lua b/data-otservbr-global/scripts/quests/threatened_dreams/creaturescript-nightmare_monsters_kills.lua deleted file mode 100644 index 42aa18e5471..00000000000 --- a/data-otservbr-global/scripts/quests/threatened_dreams/creaturescript-nightmare_monsters_kills.lua +++ /dev/null @@ -1,33 +0,0 @@ -local nightmareMonsters = { - "enfeebled silencer", - "weakened frazzlemaw", - "kroazur", -} -local ThreatenedDreams = Storage.Quest.U11_40.ThreatenedDreams - -local threatenedDreamsNightmareMonstersKills = CreatureEvent("ThreatenedDreamsNightmareMonstersKills") -function threatenedDreamsNightmareMonstersKills.onKill(player, target) - if target:isPlayer() or target:getMaster() then - return true - end - - if not table.contains(nightmareMonsters, target:getName():lower()) then - return true - end - - local enfeebledKills = player:getStorageValue(ThreatenedDreams.Mission02.EnfeebledCount) - local frazzlemawsKills = player:getStorageValue(ThreatenedDreams.Mission02.FrazzlemawsCount) - if player:getStorageValue(ThreatenedDreams.Mission02[1]) == 1 then - player:setStorageValue(ThreatenedDreams.Mission02[1], 1) - if target:getName():lower() == nightmareMonsters[1] then - player:setStorageValue(ThreatenedDreams.Mission02.EnfeebledCount, enfeebledKills + 1) - elseif target:getName():lower() == nightmareMonsters[2] then - player:setStorageValue(ThreatenedDreams.Mission02.FrazzlemawsCount, frazzlemawsKills + 1) - elseif target:getName():lower() == nightmareMonsters[3] then - player:setStorageValue(ThreatenedDreams.Mission02.KroazurKill, 1) - end - end - return true -end - -threatenedDreamsNightmareMonstersKills:register() diff --git a/data-otservbr-global/scripts/quests/threatened_dreams/nightmare_monsters_kills.lua b/data-otservbr-global/scripts/quests/threatened_dreams/nightmare_monsters_kills.lua new file mode 100644 index 00000000000..2b66a2c1eb7 --- /dev/null +++ b/data-otservbr-global/scripts/quests/threatened_dreams/nightmare_monsters_kills.lua @@ -0,0 +1,31 @@ +local nightmareMonsters = { + "enfeebled silencer", + "weakened frazzlemaw", + "kroazur", +} +local ThreatenedDreams = Storage.Quest.U11_40.ThreatenedDreams + +local deathEvent = CreatureEvent("ThreatenedDreamsNightmareMonstersDeath") +function deathEvent.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + if not table.contains(nightmareMonsters, creature:getName():lower()) then + return true + end + + onDeathForParty(creature, mostDamageKiller, function(creature, player) + local enfeebledKills = player:getStorageValue(ThreatenedDreams.Mission02.EnfeebledCount) + local frazzlemawsKills = player:getStorageValue(ThreatenedDreams.Mission02.FrazzlemawsCount) + if player:getStorageValue(ThreatenedDreams.Mission02[1]) == 1 then + player:setStorageValue(ThreatenedDreams.Mission02[1], 1) + if creature:getName():lower() == nightmareMonsters[1] then + player:setStorageValue(ThreatenedDreams.Mission02.EnfeebledCount, enfeebledKills + 1) + elseif creature:getName():lower() == nightmareMonsters[2] then + player:setStorageValue(ThreatenedDreams.Mission02.FrazzlemawsCount, frazzlemawsKills + 1) + elseif creature:getName():lower() == nightmareMonsters[3] then + player:setStorageValue(ThreatenedDreams.Mission02.KroazurKill, 1) + end + end + end) + return true +end + +deathEvent:register() diff --git a/data/libs/functions/set.lua b/data/libs/functions/set.lua new file mode 100644 index 00000000000..e3e6b6f921d --- /dev/null +++ b/data/libs/functions/set.lua @@ -0,0 +1,146 @@ +---@class Set +---@field values table +---@field options table +---@field options.insensitive boolean +---@method contains(key: any): boolean +---@method insert(key: any): void +---@method remove(key: any): void +---@method union(other: Set): Set +---@method intersection(other: Set): Set +---@method iter(): function +---@method __eq(other: Set): boolean +---@method __key(k: any): any +---@method __len(): number +---@method __tostring(): string +Set = {} + +---@param initial table|Set +---@param options table +---@return Set +setmetatable(Set, { + __call = function(self, initial, options) + local set = setmetatable({ + values = {}, + options = options or {}, + }, { __index = Set }) + if Set.isSet(initial) then + for k in initial:iter() do + set:insert(k) + end + elseif type(initial) == "table" then + for _, k in ipairs(initial) do + set:insert(k) + end + end + return set + end, +}) + +function Set.isSet(t) + local meta = getmetatable(t) + return meta and (meta == Set or meta.__index == Set) +end + +function Set:contains(key) + key = self:__key(key) + return self.values[key] ~= nil +end + +function Set:insert(key) + key = self:__key(key) + self.values[key] = true +end + +function Set:remove(key) + key = self:__key(key) + self.values[key] = nil +end + +function Set:union(other) + local set = Set(self, self.options) + for k in Set(other, self.options):iter() do + set:insert(k) + end + return set +end + +function Set:intersection(other) + local set = Set({}, self.options) + for k in Set(other, self.options):iter() do + if self:contains(k) then + set:insert(k) + end + end + return set +end + +function Set:__eq(other) + if #self ~= #other then + return false + end + for k in pairs(self.values) do + if not other:contains(k) then + return false + end + end + return true +end + +function Set:__key(k) + if self.options.insensitive then + if type(k) ~= "string" then + logger.error("key must be a string when insensitive option is enabled") + end + k = k:lower() + end + return k +end + +function Set:iter() + return pairs(self.values) +end + +function Set:__len() + return #self.values +end + +function Set:__tostring() + local t = {} + for k in self:iter() do + table.insert(t, k) + end + return "{ " .. table.concat(t, ", ") .. " }" +end + +function Set:tostring() + return self:__tostring() +end + +-- Usage: +-- local s = Set({ 1, 2, 3 }) +-- s:insert(4) +-- s:remove(2) +-- print(s:contains(1)) -- true +-- print(s:contains(2)) -- false +-- print(s:contains(3)) -- true +-- print(s:contains(4)) -- true +-- print(s:contains(5)) -- false +-- print(#s) -- 3 +-- print(s) -- { 1, 3, 4 } +-- for k in s:iter() do +-- print(k) +-- end +-- local s2 = Set({ 3, 4, 5 }) +-- print(s:union(s2)) -- { 1, 3, 4, 5 } +-- print(s2:union(s)) -- { 3, 4, 5, 1 } +-- print(s:union(s2) == s2:union(s)) -- true +-- +-- Strings +-- local s = Set({}, { insensitive = true }) +-- s:insert("a") +-- s:insert("B") +-- s:insert("c") +-- print(s) -- { a, b, c } +-- print(s:contains("a")) -- true +-- print(s:contains("A")) -- true +-- print(s:contains("b")) -- true diff --git a/data/libs/kill_lib.lua b/data/libs/kill_lib.lua new file mode 100644 index 00000000000..257be4722de --- /dev/null +++ b/data/libs/kill_lib.lua @@ -0,0 +1,21 @@ +-- Utility to combine onDeath event with a "kill" event for a player with a party (or not). + +function onDeathForParty(creature, player, func) + if not player or not player:isPlayer() then + return + end + + local participants = Participants(player, true) + for _, participant in ipairs(participants) do + func(creature, participant) + end +end + +function onDeathForDamagingPlayers(creature, func) + for key, value in pairs(creature:getDamageMap()) do + local player = Player(key) + if player then + func(creature, player) + end + end +end diff --git a/data/libs/libs.lua b/data/libs/libs.lua index ccc71dc8961..bd6164111de 100644 --- a/data/libs/libs.lua +++ b/data/libs/libs.lua @@ -32,3 +32,4 @@ dofile(CORE_DIRECTORY .. "/libs/loyalty_lib.lua") dofile(CORE_DIRECTORY .. "/libs/encounters_lib.lua") dofile(CORE_DIRECTORY .. "/libs/raids_lib.lua") dofile(CORE_DIRECTORY .. "/libs/concoctions_lib.lua") +dofile(CORE_DIRECTORY .. "/libs/kill_lib.lua") diff --git a/src/lua/creature/creatureevent.cpp b/src/lua/creature/creatureevent.cpp index b1984be2fd6..29feb652036 100644 --- a/src/lua/creature/creatureevent.cpp +++ b/src/lua/creature/creatureevent.cpp @@ -326,8 +326,14 @@ bool CreatureEvent::executeAdvance(std::shared_ptr player, skills_t skil return getScriptInterface()->callFunction(4); } +/** + * @deprecated Prefer using registered onDeath events instead for better performance. + */ void CreatureEvent::executeOnKill(std::shared_ptr creature, std::shared_ptr target, bool lastHit) const { // onKill(creature, target, lastHit) + g_logger().warn("[CreatureEvent::executeOnKill - Creature {} target {} event {}] " + "Deprecated use of onKill event. Use registered onDeath events instead for better performance.", + creature->getName(), target->getName(), getName()); if (!getScriptInterface()->reserveScriptEnv()) { g_logger().error("[CreatureEvent::executeOnKill - Creature {} target {} event {}] " "Call stack overflow. Too many lua script calls being nested.", diff --git a/src/lua/functions/creatures/monster/monster_type_functions.cpp b/src/lua/functions/creatures/monster/monster_type_functions.cpp index e08d322189c..0db51998ea7 100644 --- a/src/lua/functions/creatures/monster/monster_type_functions.cpp +++ b/src/lua/functions/creatures/monster/monster_type_functions.cpp @@ -13,6 +13,7 @@ #include "io/io_bosstiary.hpp" #include "creatures/combat/spells.hpp" #include "creatures/monsters/monsters.hpp" +#include "creatures/monsters/monster.hpp" #include "lua/functions/creatures/monster/monster_type_functions.hpp" #include "lua/scripts/scripts.hpp" @@ -1002,7 +1003,13 @@ int MonsterTypeFunctions::luaMonsterTypeRegisterEvent(lua_State* L) { // monsterType:registerEvent(name) const auto monsterType = getUserdataShared(L, 1); if (monsterType) { - monsterType->info.scripts.push_back(getString(L, 2)); + auto eventName = getString(L, 2); + monsterType->info.scripts.push_back(eventName); + for (const auto &[_, monster] : g_game().getMonsters()) { + if (monster->getMonsterType() == monsterType) { + monster->registerCreatureEvent(eventName); + } + } pushBoolean(L, true); } else { lua_pushnil(L);