From 109e14bee034f9efb0742cb6499ae8e578a2cc47 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Tue, 19 Jun 2018 13:33:32 +0200 Subject: [PATCH] Core/Spells: Crimson Scourge will now proc only if the target is affected by any of the caster's diseases --- .../custom/custom_2018_06_19_03_world.sql | 3 ++ src/server/scripts/Spells/spell_dk.cpp | 32 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 sql/updates/world/custom/custom_2018_06_19_03_world.sql diff --git a/sql/updates/world/custom/custom_2018_06_19_03_world.sql b/sql/updates/world/custom/custom_2018_06_19_03_world.sql new file mode 100644 index 00000000000..c8887de0de6 --- /dev/null +++ b/sql/updates/world/custom/custom_2018_06_19_03_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_dk_crimson_scourge'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-81135, 'spell_dk_crimson_scourge'); diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 393e558ab87..848dc59e8ed 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -1995,6 +1995,37 @@ class spell_dk_blood_rites : public SpellScriptLoader } }; +class spell_dk_crimson_scourge : public SpellScriptLoader +{ + public: + spell_dk_crimson_scourge() : SpellScriptLoader("spell_dk_crimson_scourge") { } + + class spell_dk_crimson_scourge_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_crimson_scourge_AuraScript); + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + if (DamageInfo* damage = eventInfo.GetDamageInfo()) + if (Unit* target = damage->GetVictim()) + if (target->GetDiseasesByCaster(GetTarget()->GetGUID(), false)) + return; + + PreventDefaultAction(); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_dk_crimson_scourge_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dk_crimson_scourge_AuraScript(); + } +}; + void AddSC_deathknight_spell_scripts() { new spell_dk_anti_magic_shell_raid(); @@ -2005,6 +2036,7 @@ void AddSC_deathknight_spell_scripts() new spell_dk_blood_rites(); new spell_dk_butchery(); new spell_dk_chill_of_the_grave(); + new spell_dk_crimson_scourge(); new spell_dk_dark_transformation(); new spell_dk_dark_transformation_aura(); new spell_dk_death_and_decay();