fix(Scripts/Ulduar): apply Yogg-Saron keeper buffs on pull again (#26713)

Co-authored-by: horn <pankrac.ja@seznam.cz>
This commit is contained in:
Andrew
2026-07-21 09:39:15 -03:00
committed by GitHub
parent 09d8066aa4
commit e4dc281746
4 changed files with 60 additions and 15 deletions
@@ -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);
@@ -183,7 +183,6 @@ enum NPCsGOs
NPC_GUARDIAN_OF_YS = 33136, NPC_GUARDIAN_OF_YS = 33136,
NPC_SANITY_WELL = 33991, NPC_SANITY_WELL = 33991,
NPC_YOGG_SARON = 33288, NPC_YOGG_SARON = 33288,
NPC_VOICE_OF_YOGG_SARON = 33280,
NPC_YOGG_SARON_VISION = 33552, NPC_YOGG_SARON_VISION = 33552,
NPC_CRUSHER_TENTACLE = 33966, // 50 secs ? NPC_CRUSHER_TENTACLE = 33966, // 50 secs ?
@@ -230,6 +229,9 @@ enum NPCsGOs
enum Misc enum Misc
{ {
ACTION_ACTIVATE_KEEPER = -19,
ACTION_VOICE_STOP = -18,
ACTION_VOICE_START = -17,
ACTION_UNSUMMON_CLOUDS = -16, ACTION_UNSUMMON_CLOUDS = -16,
ACTION_DESPAWN_ADDS = -15, ACTION_DESPAWN_ADDS = -15,
ACTION_START_SUMMONING = -14, ACTION_START_SUMMONING = -14,
@@ -382,7 +384,7 @@ struct boss_yoggsaron_sara : public ScriptedAI
uint32 _initFight; uint32 _initFight;
uint8 _summonedGuardiansCount; uint8 _summonedGuardiansCount;
uint32 _p2TalkTimer; uint32 _p2TalkTimer;
bool _secondPhase; bool _secondPhase = false;
float _summonSpeed; float _summonSpeed;
uint8 _currentIllusion; uint8 _currentIllusion;
bool _isIllusionReversed; bool _isIllusionReversed;
@@ -437,15 +439,16 @@ struct boss_yoggsaron_sara : public ScriptedAI
void Reset() override 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); voice->AI()->Talk(WHISPER_VOICE_PHASE_1_WIPE, player);
} });
}); }
} }
summons.DoAction(ACTION_DESPAWN_ADDS); 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->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, CRITERIA_NOT_GETTING_OLDER);
_instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_SANITY); _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); _instance->SetBossState(BOSS_YOGGSARON, NOT_STARTED);
if (GameObject* go = _instance->GetGameObject(DATA_YOGG_SARON_DOORS)) if (GameObject* go = _instance->GetGameObject(DATA_YOGG_SARON_DOORS))
go->SetGoState(GO_STATE_ACTIVE); go->SetGoState(GO_STATE_ACTIVE);
@@ -494,9 +499,14 @@ struct boss_yoggsaron_sara : public ScriptedAI
AttackStart(target); AttackStart(target);
DespawnGossipKeepers(); DespawnGossipKeepers();
// Engage Keepers
summons.DoZoneInCombat(); 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_DOORS_CLOSE, 15s, 0, EVENT_PHASE_ONE);
events.ScheduleEvent(EVENT_SARA_P1_BERSERK, 15min, 0, 0); events.ScheduleEvent(EVENT_SARA_P1_BERSERK, 15min, 0, 0);
events.ScheduleEvent(EVENT_SARA_P1_SUMMON, 0ms, 0, EVENT_PHASE_ONE); 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() void InformCloud()
{ {
Creature* cloud = nullptr; Creature* cloud = nullptr;
@@ -634,6 +658,7 @@ struct boss_yoggsaron_sara : public ScriptedAI
if (param == ACTION_SARA_UPDATE_SUMMON_KEEPERS) if (param == ACTION_SARA_UPDATE_SUMMON_KEEPERS)
{ {
UpdateKeeperSpawns(); UpdateKeeperSpawns();
return;
} }
else if (param == ACTION_BRAIN_DAMAGED) else if (param == ACTION_BRAIN_DAMAGED)
{ {
@@ -662,7 +687,6 @@ struct boss_yoggsaron_sara : public ScriptedAI
summons.DespawnEntry(NPC_CRUSHER_TENTACLE); summons.DespawnEntry(NPC_CRUSHER_TENTACLE);
summons.DespawnEntry(NPC_CONSTRICTOR_TENTACLE); summons.DespawnEntry(NPC_CONSTRICTOR_TENTACLE);
summons.DespawnEntry(NPC_CORRUPTOR_TENTACLE); summons.DespawnEntry(NPC_CORRUPTOR_TENTACLE);
summons.DespawnEntry(NPC_VOICE_OF_YOGG_SARON);
summons.DespawnEntry(NPC_BRAIN_OF_YOGG_SARON); summons.DespawnEntry(NPC_BRAIN_OF_YOGG_SARON);
summons.DespawnEntry(NPC_MIMIRON_GOSSIP); summons.DespawnEntry(NPC_MIMIRON_GOSSIP);
summons.DespawnEntry(NPC_HODIR_GOSSIP); summons.DespawnEntry(NPC_HODIR_GOSSIP);
@@ -673,6 +697,8 @@ struct boss_yoggsaron_sara : public ScriptedAI
summons.DespawnEntry(NPC_FREYA_KEEPER); summons.DespawnEntry(NPC_FREYA_KEEPER);
summons.DespawnEntry(NPC_THORIM_KEEPER); summons.DespawnEntry(NPC_THORIM_KEEPER);
summons.DespawnEntry(NPC_SANITY_WELL); 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(); me->KillSelf();
return; return;
} }
@@ -804,9 +830,6 @@ struct boss_yoggsaron_sara : public ScriptedAI
switch (events.ExecuteEvent()) switch (events.ExecuteEvent())
{ {
case EVENT_SARA_P1_DOORS_CLOSE: 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 (_instance)
if (GameObject* go = _instance->GetGameObject(DATA_YOGG_SARON_DOORS)) if (GameObject* go = _instance->GetGameObject(DATA_YOGG_SARON_DOORS))
go->SetGoState(GO_STATE_READY); go->SetGoState(GO_STATE_READY);
@@ -1673,6 +1696,8 @@ struct boss_yoggsaron_keeper : public NullCreatureAI
me->CastSpell(me, SPELL_TITANIC_STORM_PASSIVE, false); me->CastSpell(me, SPELL_TITANIC_STORM_PASSIVE, false);
else if (param == ACTION_DESPAWN_ADDS) else if (param == ACTION_DESPAWN_ADDS)
_summons.DespawnAll(); _summons.DespawnAll();
else if (param == ACTION_ACTIVATE_KEEPER)
Activate();
} }
void JustSummoned(Creature* summon) override void JustSummoned(Creature* summon) override
@@ -1680,7 +1705,7 @@ struct boss_yoggsaron_keeper : public NullCreatureAI
_summons.Summon(summon); _summons.Summon(summon);
} }
void JustEngagedWith(Unit* /*who*/) override void Activate()
{ {
switch (me->GetEntry()) switch (me->GetEntry())
{ {
@@ -2092,8 +2117,21 @@ struct boss_yoggsaron_voice : public NullCreatureAI
void Reset() override void Reset() override
{ {
DoCastSelf(SPELL_INSANE_PERIODIC, true); events.Reset();
DoCastSelf(SPELL_SANITY_BASE, true); _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 void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
@@ -114,6 +114,7 @@ ObjectData const creatureData[] =
// Yogg-Saron helpers // Yogg-Saron helpers
{ NPC_SARA, DATA_SARA }, { NPC_SARA, DATA_SARA },
{ NPC_BRAIN_OF_YOGG_SARON, DATA_BRAIN_OF_YOGG_SARON }, { NPC_BRAIN_OF_YOGG_SARON, DATA_BRAIN_OF_YOGG_SARON },
{ NPC_VOICE_OF_YOGG_SARON, DATA_VOICE_OF_YOGG_SARON },
// Observation Ring Keepers // Observation Ring Keepers
{ NPC_FREYA_GOSSIP, DATA_FREYA_GOSSIP }, { NPC_FREYA_GOSSIP, DATA_FREYA_GOSSIP },
{ NPC_HODIR_GOSSIP, DATA_HODIR_GOSSIP }, { NPC_HODIR_GOSSIP, DATA_HODIR_GOSSIP },
@@ -129,6 +129,7 @@ enum UlduarData
DATA_SARA = 760, DATA_SARA = 760,
DATA_BRAIN_OF_YOGG_SARON = 761, DATA_BRAIN_OF_YOGG_SARON = 761,
DATA_YOGG_SARON_DOORS = 762, DATA_YOGG_SARON_DOORS = 762,
DATA_VOICE_OF_YOGG_SARON = 763,
// Middle section // Middle section
DATA_ASSEMBLY_DOORS = 770, DATA_ASSEMBLY_DOORS = 770,
@@ -204,6 +205,7 @@ enum UlduarNPCs
NPC_ELDER_IRONBRANCH = 32913, NPC_ELDER_IRONBRANCH = 32913,
// Yogg-Saron // Yogg-Saron
NPC_VOICE_OF_YOGG_SARON = 33280,
NPC_FREYA_GOSSIP = 33241, NPC_FREYA_GOSSIP = 33241,
NPC_HODIR_GOSSIP = 33213, NPC_HODIR_GOSSIP = 33213,
NPC_THORIM_GOSSIP = 33242, NPC_THORIM_GOSSIP = 33242,