From 485ede9b535214a2795d30ccf52f8ec0033fc024 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Fri, 27 Jul 2018 01:03:30 +0200 Subject: [PATCH] Core/Spells: fixed Shield Specialization rage amount on reflecting spells --- .../custom/custom_2018_07_27_00_world.sql | 5 ++++ src/server/scripts/Spells/spell_warrior.cpp | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 sql/updates/world/custom/custom_2018_07_27_00_world.sql diff --git a/sql/updates/world/custom/custom_2018_07_27_00_world.sql b/sql/updates/world/custom/custom_2018_07_27_00_world.sql new file mode 100644 index 00000000000..7f96b4d5303 --- /dev/null +++ b/sql/updates/world/custom/custom_2018_07_27_00_world.sql @@ -0,0 +1,5 @@ +UPDATE `spell_proc` SET `HitMask`= 64 | 2048, `ProcFlags`= 0x000002A8 | 0x00020000 WHERE `SpellId`= -12298; + +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_warr_shield_specialization'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-12298, 'spell_warr_shield_specialization'); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index d280ee45e11..0dc269bd0a8 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -1149,6 +1149,30 @@ class spell_warr_thunder_clap : public SpellScriptLoader } }; +class spell_warr_shield_specialization : public AuraScript +{ + PrepareAuraScript(spell_warr_shield_specialization); + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + if (eventInfo.GetHitMask() & PROC_HIT_REFLECT) + { + PreventDefaultAction(); + Unit* target = GetTarget(); + if (SpellInfo const* spell = sSpellMgr->GetSpellInfo((GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell))) + { + int32 bp = spell->Effects[EFFECT_0].CalcValue() * 4; + target->CastCustomSpell(spell->Id, SPELLVALUE_BASE_POINT0, bp, nullptr, true, nullptr, aurEff); + } + } + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_warr_shield_specialization::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL); + } +}; + void AddSC_warrior_spell_scripts() { new spell_warr_bloodthirst(); @@ -1168,6 +1192,7 @@ void AddSC_warrior_spell_scripts() new spell_warr_second_wind_proc(); new spell_warr_second_wind_trigger(); new spell_warr_shattering_throw(); + RegisterAuraScript(spell_warr_shield_specialization); new spell_warr_slam(); new spell_warr_strikes_of_opportunity(); new spell_warr_sudden_death();