aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index 0254f2abbdb..4e1612b5576 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -47,6 +47,7 @@ enum DeathKnightSpells
SPELL_DK_BLOOD_PLAGUE = 55078,
SPELL_DK_BLOOD_SHIELD_ABSORB = 77535,
SPELL_DK_BLOOD_SHIELD_MASTERY = 77513,
+ SPELL_DK_BONE_SHIELD = 195181,
SPELL_DK_BREATH_OF_SINDRAGOSA = 152279,
SPELL_DK_CORPSE_EXPLOSION_TRIGGERED = 43999,
SPELL_DK_DARK_SIMULACRUM_BUFF = 77616,
@@ -189,6 +190,38 @@ private:
uint32 absorbedAmount;
};
+// 195182 - Marrowrend
+// 195292 - Death's Caress
+class spell_dk_apply_bone_shield : public SpellScript
+{
+public:
+ explicit spell_dk_apply_bone_shield(SpellEffIndex effIndex) : _effIndex(effIndex) { }
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo({ SPELL_DK_BONE_SHIELD })
+ && ValidateSpellEffect({ { spellInfo->Id, _effIndex } })
+ && spellInfo->GetEffect(_effIndex).CalcBaseValue(nullptr, nullptr, 0, 0) <= int32(sSpellMgr->AssertSpellInfo(SPELL_DK_BONE_SHIELD, DIFFICULTY_NONE)->StackAmount);
+ }
+
+ void HandleHitTarget(SpellEffIndex /*effIndex*/) const
+ {
+ Unit* caster = GetCaster();
+ for (int32 i = 0; i < GetEffectValue(); ++i)
+ caster->CastSpell(caster, SPELL_DK_BONE_SHIELD, CastSpellExtraArgs()
+ .SetTriggerFlags(TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR)
+ .SetTriggeringSpell(GetSpell()));
+ }
+
+ void Register() override
+ {
+ OnEffectHit += SpellEffectFn(spell_dk_apply_bone_shield::HandleHitTarget, _effIndex, SPELL_EFFECT_DUMMY);
+ }
+
+private:
+ SpellEffIndex _effIndex;
+};
+
static uint32 const ArmyTransforms[]
{
SPELL_DK_ARMY_FLESH_BEAST_TRANSFORM,
@@ -1015,6 +1048,8 @@ void AddSC_deathknight_spell_scripts()
{
RegisterSpellScript(spell_dk_advantage_t10_4p);
RegisterSpellScript(spell_dk_anti_magic_shell);
+ RegisterSpellScriptWithArgs(spell_dk_apply_bone_shield, "spell_dk_marrowrend_apply_bone_shield", EFFECT_2);
+ RegisterSpellScriptWithArgs(spell_dk_apply_bone_shield, "spell_dk_deaths_caress_apply_bone_shield", EFFECT_2);
RegisterSpellScript(spell_dk_army_transform);
RegisterSpellScript(spell_dk_blinding_sleet);
RegisterSpellScript(spell_dk_blood_boil);