From 4d3663dd4a00c5c02933c3dd73046677e3a313e8 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Tue, 19 Jun 2018 12:44:15 +0200 Subject: [PATCH] Core/Spells: fixed Unholy Death Knight's Reaping passive --- .../custom/custom_2018_06_19_00_world.sql | 7 ++++ src/server/scripts/Spells/spell_dk.cpp | 41 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 sql/updates/world/custom/custom_2018_06_19_00_world.sql diff --git a/sql/updates/world/custom/custom_2018_06_19_00_world.sql b/sql/updates/world/custom/custom_2018_06_19_00_world.sql new file mode 100644 index 0000000000..5bcd910a23 --- /dev/null +++ b/sql/updates/world/custom/custom_2018_06_19_00_world.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_dk_reaping'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(56835, 'spell_dk_reaping'); + +DELETE FROM `spell_proc` WHERE `spellId`= 56835; +INSERT INTO `spell_proc` (`SpellId`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`) VALUES +(56835, 15, 0x00400000, 0x00010000, 0x00000200, 0x00011010, 0x1, 0x1, 0x0, 0x0); diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 407524b535..0341d9a4e6 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -1914,6 +1914,46 @@ class spell_dk_threat_of_thassarian : public SpellScriptLoader } }; +class spell_dk_reaping : public SpellScriptLoader +{ + public: + spell_dk_reaping() : SpellScriptLoader("spell_dk_reaping") { } + + class spell_dk_reaping_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_reaping_AuraScript); + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Player* player = GetTarget()->ToPlayer(); + if (!player) + return; + + uint8 runeMask = player->GetLastUsedRuneMask(); + + for (uint8 i = 0; i < MAX_RUNES; i++) + { + if (runeMask & (1 << i) && player->GetCurrentRune(i) == RUNE_BLOOD) + player->AddRuneByAuraEffect(i, RUNE_DEATH, aurEff, SPELL_AURA_PERIODIC_DUMMY, GetSpellInfo()); + } + + GetEffect(EFFECT_0)->ResetPeriodic(true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_dk_reaping_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dk_reaping_AuraScript(); + } +}; + void AddSC_deathknight_spell_scripts() { new spell_dk_anti_magic_shell_raid(); @@ -1942,6 +1982,7 @@ void AddSC_deathknight_spell_scripts() new spell_dk_pestilence(); new spell_dk_presence(); new spell_dk_raise_dead(); + new spell_dk_reaping(); new spell_dk_rune_tap_party(); new spell_dk_runic_empowerment(); new spell_dk_scent_of_blood();