From 9bf2800ca6d2b8f743dd9410b44326b21f0cf943 Mon Sep 17 00:00:00 2001 From: Silker <61223313+Si1ker@users.noreply.github.com> Date: Mon, 29 Mar 2021 08:42:15 -0600 Subject: [PATCH] fix(scripts/DB): Implement "Marked immortal guardian" (#5046) --- .../rev_1616977871251124200.sql | 16 ++++++++ .../Ulduar/Ulduar/boss_yoggsaron.cpp | 40 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1616977871251124200.sql diff --git a/data/sql/updates/pending_db_world/rev_1616977871251124200.sql b/data/sql/updates/pending_db_world/rev_1616977871251124200.sql new file mode 100644 index 000000000..2b4faf472 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1616977871251124200.sql @@ -0,0 +1,16 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1616977871251124200'); + +-- Add IA for 'Marked immortal guardian' +UPDATE `creature_template` SET `ScriptName`='boss_yoggsaron_immortal_guardian' WHERE `entry`=36064; +-- Match "Immortal Guardian" values with "Marked immortal guardian" +UPDATE `creature_template` SET `speed_walk`=1.6, `speed_run`=1.71429, `DamageModifier`=7.5, `mechanic_immune_mask`=617299839, `flags_extra`=1073741824 WHERE `entry` IN (36064, 36067); +UPDATE `creature_template` SET `DamageModifier`=8 WHERE `entry` IN (33989, 36067); -- 25mode +-- Add script into DB +DELETE FROM `spell_script_names` WHERE `spell_id`=64465 AND `ScriptName`='spell_yogg_saron_shadow_beacon'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (64465, 'spell_yogg_saron_shadow_beacon'); +-- Add/rework conditions for effect 'Titanic Storm' +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=64172; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,64172,0,0,31,0,3,33988,0,0,0,0,'','Titanic Storm on Immortal Guardian'), +(13,1,64172,0,1,31,0,3,36064,0,0,0,0,'','Titanic Storm on Marked Immortal Guardian'); + diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp index 07b040f84..6393b8bf8 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp @@ -181,6 +181,7 @@ enum NPCsGOs NPC_LAUGHING_SKULL = 33990, NPC_IMMORTAL_GUARDIAN = 33988, + NPC_MARKED_IMMORTAL_GUARDIAN = 36064, // CHAMBER ILLUSION NPC_CONSORT_FIRST = 33716, @@ -2400,6 +2401,44 @@ public: } }; +class spell_yogg_saron_shadow_beacon : public SpellScriptLoader +{ + public: + spell_yogg_saron_shadow_beacon() : SpellScriptLoader("spell_yogg_saron_shadow_beacon") { } + + class spell_yogg_saron_shadow_beacon_AuraScript : public AuraScript + { + PrepareAuraScript(spell_yogg_saron_shadow_beacon_AuraScript); + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Creature* target = GetTarget()->ToCreature()) + { + target->SetEntry(NPC_MARKED_IMMORTAL_GUARDIAN); + } + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Creature* target = GetTarget()->ToCreature()) + { + target->SetEntry(NPC_IMMORTAL_GUARDIAN); + } + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_yogg_saron_shadow_beacon_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_yogg_saron_shadow_beacon_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_yogg_saron_shadow_beacon_AuraScript(); + } +}; + class spell_yogg_saron_destabilization_matrix : public SpellScriptLoader { public: @@ -2995,6 +3034,7 @@ void AddSC_boss_yoggsaron() // SPELLS new spell_yogg_saron_malady_of_the_mind(); new spell_yogg_saron_brain_link(); + new spell_yogg_saron_shadow_beacon(); new spell_yogg_saron_destabilization_matrix(); new spell_yogg_saron_titanic_storm(); new spell_yogg_saron_lunatic_gaze();