fix(Scripts/Naxxramas): despawn summons on boss death (#26770)

This commit is contained in:
Andrew
2026-07-24 06:11:39 -03:00
committed by GitHub
parent 6c104dfba0
commit 10f378bc1d
6 changed files with 6 additions and 65 deletions

View File

@@ -76,18 +76,13 @@ public:
struct boss_gluthAI : public BossAI 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 void Reset() override
{ {
BossAI::Reset(); BossAI::Reset();
me->ApplySpellImmune(SPELL_INFECTED_WOUND, IMMUNITY_ID, SPELL_INFECTED_WOUND, true); me->ApplySpellImmune(SPELL_INFECTED_WOUND, IMMUNITY_ID, SPELL_INFECTED_WOUND, true);
events.Reset();
summons.DespawnAll();
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);
} }
@@ -139,12 +134,6 @@ public:
instance->StorePersistentData(PERSISTENT_DATA_IMMORTAL_FAIL, 1); instance->StorePersistentData(PERSISTENT_DATA_IMMORTAL_FAIL, 1);
} }
void JustDied(Unit* killer) override
{
BossAI::JustDied(killer);
summons.DespawnAll();
}
bool SelectPlayerInRoom() bool SelectPlayerInRoom()
{ {
if (me->IsInCombat()) if (me->IsInCombat())

View File

@@ -186,11 +186,9 @@ public:
struct boss_gothikAI : public BossAI 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 secondPhase{};
bool gateOpened{}; bool gateOpened{};
bool lastTeleportDead{}; bool lastTeleportDead{};
@@ -209,8 +207,6 @@ public:
void Reset() override void Reset() override
{ {
BossAI::Reset(); BossAI::Reset();
events.Reset();
summons.DespawnAll();
me->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE); me->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE);
me->SetImmuneToPC(false); me->SetImmuneToPC(false);
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
@@ -275,11 +271,6 @@ public:
} }
} }
void SummonedCreatureDespawn(Creature* cr) override
{
summons.Despawn(cr);
}
void KilledUnit(Unit* who) override void KilledUnit(Unit* who) override
{ {
if (!who->IsPlayer()) if (!who->IsPlayer())
@@ -293,7 +284,6 @@ public:
{ {
BossAI::JustDied(killer); BossAI::JustDied(killer);
Talk(SAY_DEATH); Talk(SAY_DEATH);
summons.DespawnAll();
} }
void SummonHelpers(uint32 entry) void SummonHelpers(uint32 entry)

View File

@@ -67,18 +67,14 @@ public:
struct boss_grobbulusAI : public BossAI 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{}; uint32 dropSludgeTimer{};
void Reset() override void Reset() override
{ {
BossAI::Reset(); BossAI::Reset();
events.Reset();
summons.DespawnAll();
dropSludgeTimer = 0; dropSludgeTimer = 0;
} }
@@ -114,17 +110,6 @@ public:
summons.Summon(cr); 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 void KilledUnit(Unit* who) override
{ {
if (who->IsPlayer()) if (who->IsPlayer())

View File

@@ -58,20 +58,16 @@ public:
struct boss_loathebAI : public BossAI 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()); me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
} }
uint8 doomCounter; uint8 doomCounter;
EventMap events;
SummonList summons;
void Reset() override void Reset() override
{ {
BossAI::Reset(); BossAI::Reset();
events.Reset();
summons.DespawnAll();
doomCounter = 0; doomCounter = 0;
} }

View File

@@ -101,12 +101,9 @@ public:
struct boss_maexxnaAI : public BossAI 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; GuidList wraps;
bool IsInRoom() bool IsInRoom()
@@ -119,13 +116,6 @@ public:
return true; return true;
} }
void Reset() override
{
BossAI::Reset();
events.Reset();
summons.DespawnAll();
}
void JustEngagedWith(Unit* who) override void JustEngagedWith(Unit* who) override
{ {
BossAI::JustEngagedWith(who); BossAI::JustEngagedWith(who);
@@ -157,11 +147,6 @@ public:
instance->StorePersistentData(PERSISTENT_DATA_IMMORTAL_FAIL, 1); instance->StorePersistentData(PERSISTENT_DATA_IMMORTAL_FAIL, 1);
} }
void JustDied(Unit* killer) override
{
BossAI::JustDied(killer);
}
void DoCastWebWrap() void DoCastWebWrap()
{ {
std::list<Unit*> candidates; std::list<Unit*> candidates;

View File

@@ -86,12 +86,10 @@ public:
struct boss_nothAI : public BossAI 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; uint8 timesInBalcony;
EventMap events;
SummonList summons;
void StartGroundPhase() void StartGroundPhase()
{ {
@@ -140,8 +138,6 @@ public:
void Reset() override void Reset() override
{ {
BossAI::Reset(); BossAI::Reset();
events.Reset();
summons.DespawnAll();
me->CastSpell(me, SPELL_TELEPORT_BACK, true); me->CastSpell(me, SPELL_TELEPORT_BACK, true);
me->SetControlled(false, UNIT_STATE_ROOT); me->SetControlled(false, UNIT_STATE_ROOT);
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);