diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 65b1872c6..667b83773 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -66,7 +66,8 @@ enum Spells enum Misc { - GO_CAGE = 185474 + GO_CAGE = 185474, + ACTION_RESET_ADDS = 1 }; const Position olumWalk = { 456.17194f, -544.31866f, -7.5470476f, 0.00f }; @@ -75,6 +76,17 @@ struct boss_fathomlord_karathress : public BossAI { boss_fathomlord_karathress(Creature* creature) : BossAI(creature, DATA_FATHOM_LORD_KARATHRESS){ } + void JustReachedHome() override + { + instance->DoForAllMinions(DATA_FATHOM_LORD_KARATHRESS, [&](Creature* fathomguard) + { + if (!fathomguard->IsAlive()) + { + fathomguard->Respawn(true); + } + }); + } + void Reset() override { BossAI::Reset(); @@ -156,6 +168,18 @@ struct boss_fathomlord_karathress : public BossAI DoCastSelf(SPELL_ENRAGE, true); }); } + + void DoAction(int32 action) override + { + if (action == ACTION_RESET_ADDS) + { + EnterEvadeMode(); + instance->DoForAllMinions(DATA_FATHOM_LORD_KARATHRESS, [&](Creature* fathomguard) + { + fathomguard->DespawnOrUnsummon(); + }); + } + } private: bool _recentlySpoken; }; @@ -259,6 +283,15 @@ struct boss_fathomguard_sharkkis : public ScriptedAI DoMeleeAttackIfReady(); } + void EnterEvadeMode(EvadeReason why) override + { + if (Creature* karathress = _instance->GetCreature(DATA_FATHOM_LORD_KARATHRESS)) + { + karathress->AI()->DoAction(ACTION_RESET_ADDS); + } + ScriptedAI::EnterEvadeMode(why); + } + private: InstanceScript* _instance; SummonList _summons; @@ -434,6 +467,15 @@ struct boss_fathomguard_tidalvess : public ScriptedAI DoMeleeAttackIfReady(); } + void EnterEvadeMode(EvadeReason why) override + { + if (Creature* karathress = _instance->GetCreature(DATA_FATHOM_LORD_KARATHRESS)) + { + karathress->AI()->DoAction(ACTION_RESET_ADDS); + } + ScriptedAI::EnterEvadeMode(why); + } + private: TaskScheduler _scheduler; TaskScheduler _totemScheduler; @@ -518,6 +560,15 @@ struct boss_fathomguard_caribdis : public ScriptedAI DoMeleeAttackIfReady(); } + void EnterEvadeMode(EvadeReason why) override + { + if (Creature* karathress = _instance->GetCreature(DATA_FATHOM_LORD_KARATHRESS)) + { + karathress->AI()->DoAction(ACTION_RESET_ADDS); + } + ScriptedAI::EnterEvadeMode(why); + } + private: TaskScheduler _scheduler; InstanceScript* _instance;