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

View File

@@ -101,12 +101,7 @@ struct boss_netherspite : public BossAI
BossAI::Reset();
berserk = false;
HandleDoors(true);
for (int i = 0; i < 3; ++i)
{
PortalGUID[i].Clear();
BeamTarget[i].Clear();
}
DestroyPortals();
}
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()
{
Talk(EMOTE_PHASE_BANISH);
@@ -234,16 +247,7 @@ struct boss_netherspite : public BossAI
DoCastSelf(SPELL_BANISH_VISUAL, true);
DoCastSelf(SPELL_BANISH_ROOT, true);
for (uint32 id : PortalID)
{
summons.DespawnEntry(id);
}
for (int i = 0; i < 3; ++i)
{
PortalGUID[i].Clear();
BeamTarget[i].Clear();
}
DestroyPortals();
scheduler.Schedule(30s, [this](TaskContext)
{