fix(Scripts/Ulduar): keep Yogg-Saron engaged while players are inside portals (#26382)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Andrew
2026-06-29 07:58:08 -03:00
committed by GitHub
parent c975d05eab
commit 0769f095e0

View File

@@ -727,6 +727,23 @@ struct boss_yoggsaron_sara : public ScriptedAI
damage = 0;
}
// Players who descend into a portal are teleported ~100 yd below to the illusion
// realms, out of range of the main-chamber scan in SelectTargetFromPlayerList.
// The fight must keep going while any of them is alive, otherwise the boss resets
// and traps them underground.
bool HasAlivePlayerInIllusion() const
{
bool found = false;
me->GetMap()->DoForAllPlayers([&](Player* player)
{
if (found || !player->IsAlive() || player->IsGameMaster() || player->HasAura(SPELL_INSANE1))
return;
if (player->GetPositionZ() < 300.0f && me->IsWithinDist2d(player, 200.0f))
found = true;
});
return found;
}
void UpdateAI(uint32 diff) override
{
if (_initFight)
@@ -745,7 +762,7 @@ struct boss_yoggsaron_sara : public ScriptedAI
return;
}
if (!SelectTargetFromPlayerList(90, SPELL_INSANE1))
if (!SelectTargetFromPlayerList(90, SPELL_INSANE1) && !HasAlivePlayerInIllusion())
{
_instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_INSANE1);
EnterEvadeMode(EVADE_REASON_OTHER);