Skip to content

Commit

Permalink
fix(Scripts/Ulduar): update Boss Keepers, Gossip Keepers, Yogg Keeper…
Browse files Browse the repository at this point in the history
…s, Yogg-Saron (#18943)

* gossip keepers, keepers, sara

freya spell

improvements

better gossip

update

converter to update spellscript

refactor sanity wells spawn position, summons zonecombat

make sara summon sanity wells again

thorim casts start again, handle sanity wells only by sanity well spawn
script

refactor sanity

brackets

update comment

gossip keepers, keepers, sara

freya spell

improvements

better gossip

update

converter to update spellscript

refactor sanity wells spawn position, summons zonecombat

make sara summon sanity wells again

thorim casts start again, handle sanity wells only by sanity well spawn
script

refactor sanity

brackets

update comment

gossip keepers, keepers, sara

freya spell

improvements

better gossip

update

converter to update spellscript

refactor sanity wells spawn position, summons zonecombat

make sara summon sanity wells again

thorim casts start again, handle sanity wells only by sanity well spawn
script

refactor sanity

brackets

update comment

gossip keepers, keepers, sara

freya spell

improvements

better gossip

update

converter to update spellscript

refactor sanity wells spawn position, summons zonecombat

make sara summon sanity wells again

thorim casts start again, handle sanity wells only by sanity well spawn
script

refactor sanity

brackets

update comment

* refactor: remove _keepersGUID[4]

* make keeper auras only target players, remove apply scale immunity to well/keepers

include caster in cast

* update keeper flags

* summon and despawn gossip keepers

spawn only if fight done

add intro spell and handle outro

fix off by 1

fix casting simple teleport, only spawn after teleporting

remove empty line

* add teleport to shared ulduar.h

* each keeper triggers their own gossip spawn

* update is called in Reset(), no need to do it here

* add SpellHit override to Freya, Hodir

* Freya, Hodir: use scheduler to schedule post-fight teleport

* JustSummoned rename cr to summon

* sanity well summons are handled by freya instead of sara

* rename pCreature to creature

* keeper use RegisterUlduarCreatureAI

* Freya, Hodir, Thorim: increase despawn time

* despawn tentacles, sanity wells after fight

despawn tentacles after fight

* change order of teleport spells

* am missing header?
  • Loading branch information
sogladev authored May 25, 2024
1 parent df688af commit 845fa07
Show file tree
Hide file tree
Showing 11 changed files with 313 additions and 153 deletions.
20 changes: 20 additions & 0 deletions data/sql/updates/pending_db_world/rev_1716230497379077638.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--
-- Remove encounter auras minus glow aura from Keepers, add glow aura to Gossip Keepers
UPDATE `creature_template_addon` SET `auras` = '62647' WHERE `entry` IN (33410,33411,33412,33413,33213,33241,33242,33244);

DELETE FROM `spell_script_names` WHERE `spell_id` = 64170;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (64170, 'spell_keeper_freya_summon_sanity_well');

DELETE FROM `spell_script_names` WHERE `spell_id` IN (62650,62670,62671,62702);
DELETE FROM `spell_script_names` WHERE `spell_id` = 64174 AND `ScriptName` = 'spell_gen_area_aura_select_players';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(62650, 'spell_gen_area_aura_select_players_and_caster'),
(62670, 'spell_gen_area_aura_select_players_and_caster'),
(62671, 'spell_gen_area_aura_select_players_and_caster'),
(62702, 'spell_gen_area_aura_select_players_and_caster'),
(64174, 'spell_gen_area_aura_select_players');

-- Keeper: handle spawns with script
DELETE FROM `creature` WHERE `id1` IN (33213,33241,33242,33244);
-- Keeper: remove not selectable, immune to pc, immune to player; civilian
UPDATE `creature_template` SET `unit_flags` = `unit_flags` & ~(256 | 512 | 33554432), `flags_extra` = `flags_extra` & ~2 WHERE `entry` IN (33410,33411,33412,33413);
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ enum Spells
SPELL_COSMIC_SMASH_VISUAL_STATE = 62300,
SPELL_SELF_STUN = 65256,
SPELL_KILL_CREDIT = 65184,
SPELL_TELEPORT = 62940,
SPELL_DUAL_WIELD = 42459,

// Algalon Stalker
Expand Down
16 changes: 15 additions & 1 deletion src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ class boss_freya : public CreatureScript
uint32 chestId = RAID_MODE(GO_FREYA_CHEST, GO_FREYA_CHEST_HERO);
chestId -= 2 * _elderCount; // offset

me->DespawnOrUnsummon(5000);
if (GameObject* go = me->SummonGameObject(chestId, 2345.61f, -71.20f, 425.104f, 3.0f, 0, 0, 0, 0, 0))
{
go->ReplaceAllGameObjectFlags((GameObjectFlags)0);
Expand All @@ -360,10 +359,24 @@ class boss_freya : public CreatureScript
me->CastSpell(me, 65074, true); // credit
m_pInstance->SetData(TYPE_FREYA, DONE);
}

scheduler.Schedule(14s, [this](TaskContext /*context*/)
{
DoCastSelf(SPELL_TELEPORT);
});
}
}
}

void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_TELEPORT)
{
me->DespawnOrUnsummon();
m_pInstance->SetData(EVENT_KEEPER_TELEPORTED, DONE);
}
}

void JustSummoned(Creature* cr) override
{
if (cr->GetEntry() == NPC_FREYA_UNSTABLE_SUN_BEAM)
Expand Down Expand Up @@ -547,6 +560,7 @@ class boss_freya : public CreatureScript

void UpdateAI(uint32 diff) override
{
scheduler.Update(diff);
if (!UpdateVictim())
return;

Expand Down
17 changes: 15 additions & 2 deletions src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ class boss_hodir : public CreatureScript
{
pInstance->SetData(TYPE_HODIR, DONE);
me->CastSpell(me, 64899, true); // credit
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BITING_COLD_PLAYER_AURA);
}

me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
Expand All @@ -355,7 +356,6 @@ class boss_hodir : public CreatureScript
me->CombatStop();
me->InterruptNonMeleeSpells(true);
me->RemoveAllAuras();
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BITING_COLD_PLAYER_AURA);

events.Reset();
summons.DespawnAll();
Expand Down Expand Up @@ -383,13 +383,17 @@ class boss_hodir : public CreatureScript
}

Talk(TEXT_DEATH);
me->DespawnOrUnsummon(10000);
scheduler.Schedule(14s, [this](TaskContext /*context*/)
{
DoCastSelf(SPELL_TELEPORT);
});
}
}
}

void UpdateAI(uint32 diff) override
{
scheduler.Update(diff);
if (me->GetPositionY() <= ENTRANCE_DOOR.GetPositionY() || me->GetPositionY() >= EXIT_DOOR.GetPositionY())
{
boss_hodirAI::EnterEvadeMode();
Expand Down Expand Up @@ -497,6 +501,15 @@ class boss_hodir : public CreatureScript
DoMeleeAttackIfReady();
}

void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_TELEPORT)
{
me->DespawnOrUnsummon();
pInstance->SetData(EVENT_KEEPER_TELEPORTED, DONE);
}
}

Creature* GetHelper(uint8 index)
{
return Helpers[index] ? ObjectAccessor::GetCreature(*me, Helpers[index]) : nullptr;
Expand Down
11 changes: 10 additions & 1 deletion src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,12 +802,21 @@ class boss_mimiron : public CreatureScript
case EVENT_DISAPPEAR:
if( pInstance )
pInstance->SetData(TYPE_MIMIRON, DONE);
DoCastSelf(SPELL_TELEPORT);
summons.DespawnAll();
me->DespawnOrUnsummon();
break;
}
}

void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_TELEPORT)
{
me->DespawnOrUnsummon();
pInstance->SetData(EVENT_KEEPER_TELEPORTED, DONE);
}
}

void MoveInLineOfSight(Unit* /*mover*/) override {}

void EnterEvadeMode(EvadeReason why) override
Expand Down
13 changes: 10 additions & 3 deletions src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ enum ThorimEvents
EVENT_THORIM_OUTRO1 = 13,
EVENT_THORIM_OUTRO2 = 14,
EVENT_THORIM_OUTRO3 = 15,
EVENT_THORIM_OUTRO4 = 16,

EVENT_DR_ACOLYTE_GH = 20,
EVENT_DR_ACOLYTE_HS = 21,
Expand Down Expand Up @@ -630,6 +631,11 @@ class boss_thorim : public CreatureScript
me->CastSpell(me, SPELL_LIGHTNING_CHARGE_BUFF, true);
events.RescheduleEvent(EVENT_THORIM_LIGHTNING_CHARGE, 10s, 0, EVENT_PHASE_RING);
}
else if (spellInfo->Id == SPELL_TELEPORT)
{
me->DespawnOrUnsummon();
m_pInstance->SetData(EVENT_KEEPER_TELEPORTED, DONE);
}
}

void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
Expand Down Expand Up @@ -773,12 +779,13 @@ class boss_thorim : public CreatureScript
{
Talk(SAY_END_NORMAL_3);
}

// Defeat credit
if (m_pInstance)
m_pInstance->SetData(TYPE_THORIM, DONE);

me->DespawnOrUnsummon(8000);
events.ScheduleEvent(EVENT_THORIM_OUTRO4, 14s, 0, 3);
break;
case EVENT_THORIM_OUTRO4:
DoCastSelf(SPELL_TELEPORT);
break;
}

Expand Down
Loading

0 comments on commit 845fa07

Please sign in to comment.