fix(Scripts/Ulduar): track Yogg-Saron encounter state and gate phase 2 on engagement (#26581)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Andrew
2026-07-13 16:37:14 -03:00
committed by GitHub
parent a0b6553b5b
commit 80653245d9
2 changed files with 14 additions and 6 deletions

View File

@@ -469,7 +469,7 @@ struct boss_yoggsaron_sara : public ScriptedAI
{
_instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, CRITERIA_NOT_GETTING_OLDER);
_instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_SANITY);
_instance->SetData(BOSS_YOGGSARON, NOT_STARTED);
_instance->SetBossState(BOSS_YOGGSARON, NOT_STARTED);
if (GameObject* go = _instance->GetGameObject(DATA_YOGG_SARON_DOORS))
go->SetGoState(GO_STATE_ACTIVE);
}
@@ -480,12 +480,11 @@ struct boss_yoggsaron_sara : public ScriptedAI
if (!_instance)
return;
// some simple hack checks
if (_instance->GetBossState(BOSS_VEZAX) != DONE || _instance->GetBossState(BOSS_XT002) != DONE)
if (_instance->GetBossState(BOSS_VEZAX) != DONE)
return;
_instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, CRITERIA_NOT_GETTING_OLDER);
_instance->SetData(BOSS_YOGGSARON, IN_PROGRESS);
_instance->SetBossState(BOSS_YOGGSARON, IN_PROGRESS);
me->SetInCombatWithZone();
AttackStart(target);
@@ -702,6 +701,14 @@ struct boss_yoggsaron_sara : public ScriptedAI
void DamageTaken(Unit* who, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
// Guardians can be spawned by walking into Ominous Clouds even when InitFight
// never ran (e.g. Vezax not defeated); their novas must not start phase 2 then.
if (!_instance || _instance->GetBossState(BOSS_YOGGSARON) != IN_PROGRESS)
{
damage = 0;
return;
}
if (who && who->GetEntry() == NPC_GUARDIAN_OF_YS && !_secondPhase)
{
damage = 25000;
@@ -1104,7 +1111,7 @@ struct boss_yoggsaron : public ScriptedAI
if (_instance)
{
_instance->SetData(BOSS_YOGGSARON, DONE);
_instance->SetBossState(BOSS_YOGGSARON, DONE);
if (Creature* sara = _instance->GetCreature(DATA_SARA))
sara->AI()->DoAction(ACTION_YOGG_SARON_DEATH);
if (GameObject* go = _instance->GetGameObject(DATA_YOGG_SARON_DOORS))

View File

@@ -47,7 +47,8 @@ DoorData const doorData[] =
{ GO_KEEPERS_GATE, BOSS_THORIM, DOOR_TYPE_PASSAGE },
{ GO_KEEPERS_GATE, BOSS_FREYA, DOOR_TYPE_PASSAGE },
{ GO_VEZAX_DOOR, BOSS_VEZAX, DOOR_TYPE_PASSAGE },
{ GO_YOGG_SARON_DOORS, BOSS_YOGGSARON, DOOR_TYPE_ROOM },
// GO_YOGG_SARON_DOORS is handled by boss_yoggsaron_sara: it closes 15 seconds
// after the pull, not immediately when the encounter enters IN_PROGRESS.
{ GO_DOODAD_UL_SIGILDOOR_03, BOSS_ALGALON, DOOR_TYPE_ROOM },
{ GO_DOODAD_UL_UNIVERSEFLOOR_01, BOSS_ALGALON, DOOR_TYPE_ROOM },
{ GO_DOODAD_UL_UNIVERSEFLOOR_02, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE },