From e4dc2817463a326ea8a32441dbd5ba41866dac19 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 21 Jul 2026 09:39:15 -0300 Subject: [PATCH] fix(Scripts/Ulduar): apply Yogg-Saron keeper buffs on pull again (#26713) Co-authored-by: horn --- .../rev_1784596450250937900.sql | 4 ++ .../Ulduar/Ulduar/boss_yoggsaron.cpp | 68 +++++++++++++++---- .../Ulduar/Ulduar/instance_ulduar.cpp | 1 + .../scripts/Northrend/Ulduar/Ulduar/ulduar.h | 2 + 4 files changed, 60 insertions(+), 15 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1784596450250937900.sql diff --git a/data/sql/updates/pending_db_world/rev_1784596450250937900.sql b/data/sql/updates/pending_db_world/rev_1784596450250937900.sql new file mode 100644 index 000000000..e02131746 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1784596450250937900.sql @@ -0,0 +1,4 @@ +-- Spawn Voice of Yogg-Saron in Ulduar (spawn data from TrinityCore) +DELETE FROM `creature` WHERE `id` = 33280 AND `map` = 603; +INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `MovementType`, `ScriptName`, `Comment`, `VerifiedBuild`) VALUES +(62015, 33280, 603, 0, 0, 3, 1, 0, 1980.14, -25.7438, 326.467, 0, 604800, 0, 0, '', 'Voice of Yogg-Saron', 0); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp index 05a4f45b0..0ef98e42a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp @@ -183,7 +183,6 @@ enum NPCsGOs NPC_GUARDIAN_OF_YS = 33136, NPC_SANITY_WELL = 33991, NPC_YOGG_SARON = 33288, - NPC_VOICE_OF_YOGG_SARON = 33280, NPC_YOGG_SARON_VISION = 33552, NPC_CRUSHER_TENTACLE = 33966, // 50 secs ? @@ -230,6 +229,9 @@ enum NPCsGOs enum Misc { + ACTION_ACTIVATE_KEEPER = -19, + ACTION_VOICE_STOP = -18, + ACTION_VOICE_START = -17, ACTION_UNSUMMON_CLOUDS = -16, ACTION_DESPAWN_ADDS = -15, ACTION_START_SUMMONING = -14, @@ -382,7 +384,7 @@ struct boss_yoggsaron_sara : public ScriptedAI uint32 _initFight; uint8 _summonedGuardiansCount; uint32 _p2TalkTimer; - bool _secondPhase; + bool _secondPhase = false; float _summonSpeed; uint8 _currentIllusion; bool _isIllusionReversed; @@ -437,15 +439,16 @@ struct boss_yoggsaron_sara : public ScriptedAI void Reset() override { - if (!_secondPhase) // Phase 1 wipe + // Whisper only on a real phase 1 wipe, not on the initial reset + if (!_secondPhase && _instance && _instance->GetBossState(BOSS_YOGGSARON) == IN_PROGRESS) { - me->GetMap()->DoForAllPlayers([&](Player* player) + if (Creature* voice = _instance->GetCreature(DATA_VOICE_OF_YOGG_SARON)) { - if (Creature* voice = me->FindNearestCreature(NPC_VOICE_OF_YOGG_SARON, 10.0f)) + me->GetMap()->DoForAllPlayers([&](Player* player) { voice->AI()->Talk(WHISPER_VOICE_PHASE_1_WIPE, player); - } - }); + }); + } } summons.DoAction(ACTION_DESPAWN_ADDS); @@ -474,6 +477,8 @@ struct boss_yoggsaron_sara : public ScriptedAI { _instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, CRITERIA_NOT_GETTING_OLDER); _instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_SANITY); + if (Creature* voice = _instance->GetCreature(DATA_VOICE_OF_YOGG_SARON)) + voice->AI()->DoAction(ACTION_VOICE_STOP); _instance->SetBossState(BOSS_YOGGSARON, NOT_STARTED); if (GameObject* go = _instance->GetGameObject(DATA_YOGG_SARON_DOORS)) go->SetGoState(GO_STATE_ACTIVE); @@ -494,9 +499,14 @@ struct boss_yoggsaron_sara : public ScriptedAI AttackStart(target); DespawnGossipKeepers(); - // Engage Keepers summons.DoZoneInCombat(); + if (Creature* voice = _instance->GetCreature(DATA_VOICE_OF_YOGG_SARON)) + voice->AI()->DoAction(ACTION_VOICE_START); + + // Keepers are friendly to players and never enter combat, activate them directly + ActivateKeepers(); + events.ScheduleEvent(EVENT_SARA_P1_DOORS_CLOSE, 15s, 0, EVENT_PHASE_ONE); events.ScheduleEvent(EVENT_SARA_P1_BERSERK, 15min, 0, 0); events.ScheduleEvent(EVENT_SARA_P1_SUMMON, 0ms, 0, EVENT_PHASE_ONE); @@ -535,6 +545,20 @@ struct boss_yoggsaron_sara : public ScriptedAI } } + void ActivateKeepers() + { + for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr) + { + Creature* summon = ObjectAccessor::GetCreature(*me, *itr); + if (!summon) + continue; + + for (uint8 i = KEEPER_FREYA; i <= KEEPER_THORIM; i++) + if (summon->GetEntry() == TABLE_KEEPER_ENTRY[i]) + summon->AI()->DoAction(ACTION_ACTIVATE_KEEPER); + } + } + void InformCloud() { Creature* cloud = nullptr; @@ -634,6 +658,7 @@ struct boss_yoggsaron_sara : public ScriptedAI if (param == ACTION_SARA_UPDATE_SUMMON_KEEPERS) { UpdateKeeperSpawns(); + return; } else if (param == ACTION_BRAIN_DAMAGED) { @@ -662,7 +687,6 @@ struct boss_yoggsaron_sara : public ScriptedAI summons.DespawnEntry(NPC_CRUSHER_TENTACLE); summons.DespawnEntry(NPC_CONSTRICTOR_TENTACLE); summons.DespawnEntry(NPC_CORRUPTOR_TENTACLE); - summons.DespawnEntry(NPC_VOICE_OF_YOGG_SARON); summons.DespawnEntry(NPC_BRAIN_OF_YOGG_SARON); summons.DespawnEntry(NPC_MIMIRON_GOSSIP); summons.DespawnEntry(NPC_HODIR_GOSSIP); @@ -673,6 +697,8 @@ struct boss_yoggsaron_sara : public ScriptedAI summons.DespawnEntry(NPC_FREYA_KEEPER); summons.DespawnEntry(NPC_THORIM_KEEPER); summons.DespawnEntry(NPC_SANITY_WELL); + if (Creature* voice = _instance ? _instance->GetCreature(DATA_VOICE_OF_YOGG_SARON) : nullptr) + voice->AI()->DoAction(ACTION_VOICE_STOP); me->KillSelf(); return; } @@ -804,9 +830,6 @@ struct boss_yoggsaron_sara : public ScriptedAI switch (events.ExecuteEvent()) { case EVENT_SARA_P1_DOORS_CLOSE: - // Whispers of YS - me->SummonCreature(NPC_VOICE_OF_YOGG_SARON, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); - if (_instance) if (GameObject* go = _instance->GetGameObject(DATA_YOGG_SARON_DOORS)) go->SetGoState(GO_STATE_READY); @@ -1673,6 +1696,8 @@ struct boss_yoggsaron_keeper : public NullCreatureAI me->CastSpell(me, SPELL_TITANIC_STORM_PASSIVE, false); else if (param == ACTION_DESPAWN_ADDS) _summons.DespawnAll(); + else if (param == ACTION_ACTIVATE_KEEPER) + Activate(); } void JustSummoned(Creature* summon) override @@ -1680,7 +1705,7 @@ struct boss_yoggsaron_keeper : public NullCreatureAI _summons.Summon(summon); } - void JustEngagedWith(Unit* /*who*/) override + void Activate() { switch (me->GetEntry()) { @@ -2092,8 +2117,21 @@ struct boss_yoggsaron_voice : public NullCreatureAI void Reset() override { - DoCastSelf(SPELL_INSANE_PERIODIC, true); - DoCastSelf(SPELL_SANITY_BASE, true); + events.Reset(); + _targets.clear(); + _current = 0; + me->RemoveAllAuras(); + } + + void DoAction(int32 param) override + { + if (param == ACTION_VOICE_START) + { + DoCastSelf(SPELL_INSANE_PERIODIC, true); + DoCastSelf(SPELL_SANITY_BASE, true); + } + else if (param == ACTION_VOICE_STOP) + Reset(); } void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index c2d28b23d..c3e04ed89 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -114,6 +114,7 @@ ObjectData const creatureData[] = // Yogg-Saron helpers { NPC_SARA, DATA_SARA }, { NPC_BRAIN_OF_YOGG_SARON, DATA_BRAIN_OF_YOGG_SARON }, + { NPC_VOICE_OF_YOGG_SARON, DATA_VOICE_OF_YOGG_SARON }, // Observation Ring Keepers { NPC_FREYA_GOSSIP, DATA_FREYA_GOSSIP }, { NPC_HODIR_GOSSIP, DATA_HODIR_GOSSIP }, diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index 5dbb434cb..2ec9ba83c 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -129,6 +129,7 @@ enum UlduarData DATA_SARA = 760, DATA_BRAIN_OF_YOGG_SARON = 761, DATA_YOGG_SARON_DOORS = 762, + DATA_VOICE_OF_YOGG_SARON = 763, // Middle section DATA_ASSEMBLY_DOORS = 770, @@ -204,6 +205,7 @@ enum UlduarNPCs NPC_ELDER_IRONBRANCH = 32913, // Yogg-Saron + NPC_VOICE_OF_YOGG_SARON = 33280, NPC_FREYA_GOSSIP = 33241, NPC_HODIR_GOSSIP = 33213, NPC_THORIM_GOSSIP = 33242,