mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-04 13:57:52 +00:00
fix(Scripts/Naxxramas): despawn summons on boss death (#26770)
This commit is contained in:
@@ -76,18 +76,13 @@ public:
|
||||
|
||||
struct boss_gluthAI : public BossAI
|
||||
{
|
||||
explicit boss_gluthAI(Creature* c) : BossAI(c, BOSS_GLUTH), summons(me)
|
||||
explicit boss_gluthAI(Creature* c) : BossAI(c, BOSS_GLUTH)
|
||||
{}
|
||||
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
BossAI::Reset();
|
||||
me->ApplySpellImmune(SPELL_INFECTED_WOUND, IMMUNITY_ID, SPELL_INFECTED_WOUND, true);
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
|
||||
@@ -139,12 +134,6 @@ public:
|
||||
instance->StorePersistentData(PERSISTENT_DATA_IMMORTAL_FAIL, 1);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
bool SelectPlayerInRoom()
|
||||
{
|
||||
if (me->IsInCombat())
|
||||
|
||||
@@ -186,11 +186,9 @@ public:
|
||||
|
||||
struct boss_gothikAI : public BossAI
|
||||
{
|
||||
explicit boss_gothikAI(Creature* c) : BossAI(c, BOSS_GOTHIK), summons(me)
|
||||
explicit boss_gothikAI(Creature* c) : BossAI(c, BOSS_GOTHIK)
|
||||
{}
|
||||
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
bool secondPhase{};
|
||||
bool gateOpened{};
|
||||
bool lastTeleportDead{};
|
||||
@@ -209,8 +207,6 @@ public:
|
||||
void Reset() override
|
||||
{
|
||||
BossAI::Reset();
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
me->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE);
|
||||
me->SetImmuneToPC(false);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
@@ -275,11 +271,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void SummonedCreatureDespawn(Creature* cr) override
|
||||
{
|
||||
summons.Despawn(cr);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
{
|
||||
if (!who->IsPlayer())
|
||||
@@ -293,7 +284,6 @@ public:
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
Talk(SAY_DEATH);
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
void SummonHelpers(uint32 entry)
|
||||
|
||||
@@ -67,18 +67,14 @@ public:
|
||||
|
||||
struct boss_grobbulusAI : public BossAI
|
||||
{
|
||||
explicit boss_grobbulusAI(Creature* c) : BossAI(c, BOSS_GROBBULUS), summons(me)
|
||||
explicit boss_grobbulusAI(Creature* c) : BossAI(c, BOSS_GROBBULUS)
|
||||
{}
|
||||
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
uint32 dropSludgeTimer{};
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
BossAI::Reset();
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
dropSludgeTimer = 0;
|
||||
}
|
||||
|
||||
@@ -114,17 +110,6 @@ public:
|
||||
summons.Summon(cr);
|
||||
}
|
||||
|
||||
void SummonedCreatureDespawn(Creature* summon) override
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
{
|
||||
if (who->IsPlayer())
|
||||
|
||||
@@ -58,20 +58,16 @@ public:
|
||||
|
||||
struct boss_loathebAI : public BossAI
|
||||
{
|
||||
explicit boss_loathebAI(Creature* c) : BossAI(c, BOSS_LOATHEB), summons(me)
|
||||
explicit boss_loathebAI(Creature* c) : BossAI(c, BOSS_LOATHEB)
|
||||
{
|
||||
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
|
||||
}
|
||||
|
||||
uint8 doomCounter;
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
BossAI::Reset();
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
doomCounter = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,12 +101,9 @@ public:
|
||||
|
||||
struct boss_maexxnaAI : public BossAI
|
||||
{
|
||||
explicit boss_maexxnaAI(Creature* c) : BossAI(c, BOSS_MAEXXNA), summons(me)
|
||||
explicit boss_maexxnaAI(Creature* c) : BossAI(c, BOSS_MAEXXNA)
|
||||
{}
|
||||
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
|
||||
GuidList wraps;
|
||||
|
||||
bool IsInRoom()
|
||||
@@ -119,13 +116,6 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
BossAI::Reset();
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
@@ -157,11 +147,6 @@ public:
|
||||
instance->StorePersistentData(PERSISTENT_DATA_IMMORTAL_FAIL, 1);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
}
|
||||
|
||||
void DoCastWebWrap()
|
||||
{
|
||||
std::list<Unit*> candidates;
|
||||
|
||||
@@ -86,12 +86,10 @@ public:
|
||||
|
||||
struct boss_nothAI : public BossAI
|
||||
{
|
||||
explicit boss_nothAI(Creature* c) : BossAI(c, BOSS_NOTH), summons(me)
|
||||
explicit boss_nothAI(Creature* c) : BossAI(c, BOSS_NOTH)
|
||||
{}
|
||||
|
||||
uint8 timesInBalcony;
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
|
||||
void StartGroundPhase()
|
||||
{
|
||||
@@ -140,8 +138,6 @@ public:
|
||||
void Reset() override
|
||||
{
|
||||
BossAI::Reset();
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
me->CastSpell(me, SPELL_TELEPORT_BACK, true);
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
|
||||
Reference in New Issue
Block a user