aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 4f218a04680..b055c9f6fbe 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -487,6 +487,54 @@ class spell_gen_blood_reserve : public SpellScriptLoader
}
};
+// Blade Warding - 64440
+enum BladeWarding
+{
+ SPELL_GEN_BLADE_WARDING_TRIGGERED = 64442
+};
+
+class spell_gen_blade_warding : public SpellScriptLoader
+{
+ public:
+ spell_gen_blade_warding() : SpellScriptLoader("spell_gen_blade_warding") { }
+
+ class spell_gen_blade_warding_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_blade_warding_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_GEN_BLADE_WARDING_TRIGGERED });
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+
+ Unit* caster = eventInfo.GetActionTarget();
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_GEN_BLADE_WARDING_TRIGGERED);
+
+ uint8 stacks = GetStackAmount();
+ int32 bp = 0;
+
+ for (uint8 i = 0; i < stacks; ++i)
+ bp += spellInfo->Effects[EFFECT_0].CalcValue(caster);
+
+ caster->CastCustomSpell(SPELL_GEN_BLADE_WARDING_TRIGGERED, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetActor(), TRIGGERED_FULL_MASK, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_gen_blade_warding_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_gen_blade_warding_AuraScript();
+ }
+};
+
enum Bonked
{
SPELL_BONKED = 62991,
@@ -4242,6 +4290,7 @@ void AddSC_generic_spell_scripts()
new spell_gen_av_drekthar_presence();
new spell_gen_bandage();
new spell_gen_blood_reserve();
+ new spell_gen_blade_warding();
new spell_gen_bonked();
new spell_gen_break_shield("spell_gen_break_shield");
new spell_gen_break_shield("spell_gen_tournament_counterattack");