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();