fix(Scripts/Karazhan): Restore Netherspite DestroyPortals() function (#17392)

This commit is contained in:
Skjalf
2023-09-30 15:34:18 -03:00
committed by GitHub
parent 1004dae7e5
commit f583dbe98c
@@ -101,12 +101,7 @@ struct boss_netherspite : public BossAI
BossAI::Reset(); BossAI::Reset();
berserk = false; berserk = false;
HandleDoors(true); HandleDoors(true);
DestroyPortals();
for (int i = 0; i < 3; ++i)
{
PortalGUID[i].Clear();
BeamTarget[i].Clear();
}
} }
void SummonPortals() void SummonPortals()
@@ -225,6 +220,24 @@ struct boss_netherspite : public BossAI
}); });
} }
void DestroyPortals()
{
for (int i = 0; i < 3; ++i)
{
if (Creature* portal = ObjectAccessor::GetCreature(*me, PortalGUID[i]))
{
portal->DisappearAndDie();
}
if (Creature* portal = ObjectAccessor::GetCreature(*me, BeamerGUID[i]))
{
portal->DisappearAndDie();
}
PortalGUID[i].Clear();
BeamTarget[i].Clear();
}
}
void SwitchToBanishPhase() void SwitchToBanishPhase()
{ {
Talk(EMOTE_PHASE_BANISH); Talk(EMOTE_PHASE_BANISH);
@@ -234,16 +247,7 @@ struct boss_netherspite : public BossAI
DoCastSelf(SPELL_BANISH_VISUAL, true); DoCastSelf(SPELL_BANISH_VISUAL, true);
DoCastSelf(SPELL_BANISH_ROOT, true); DoCastSelf(SPELL_BANISH_ROOT, true);
for (uint32 id : PortalID) DestroyPortals();
{
summons.DespawnEntry(id);
}
for (int i = 0; i < 3; ++i)
{
PortalGUID[i].Clear();
BeamTarget[i].Clear();
}
scheduler.Schedule(30s, [this](TaskContext) scheduler.Schedule(30s, [this](TaskContext)
{ {