fix(Scripts/SSC): make adds reset when one leaves the room (#18614)

* init

* Update boss_fathomlord_karathress.cpp
This commit is contained in:
Dan
2024-03-26 22:23:29 +01:00
committed by GitHub
parent 3ea02712d4
commit 16f220253a

View File

@@ -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;