mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
fix(Scripts/SSC): make adds reset when one leaves the room (#18614)
* init * Update boss_fathomlord_karathress.cpp
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user