diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 6f0c05a27..7fdf0df91 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -110,6 +110,7 @@ public: uint8 GetCasterLevel() const { return m_casterLevel; } bool CanApplyResilience() const { return m_applyResilience; } float GetPctMods() const { return m_pctMods; } + void SetPctMods(float pctMods) { m_pctMods = pctMods; } // xinef: stacking uint32 GetAuraGroup() const { return m_auraGroup; } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index cd47823c1..8e27678c0 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -1727,6 +1727,16 @@ class spell_dk_pestilence : public SpellScript { PrepareSpellScript(spell_dk_pestilence); + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_DK_GLYPH_OF_DISEASE, + SPELL_DK_BLOOD_PLAGUE, + SPELL_DK_FROST_FEVER + }); + } + void HandleScriptEffect(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); @@ -1743,11 +1753,38 @@ class spell_dk_pestilence : public SpellScript // And spread them on target // Blood Plague - if (target->GetAura(SPELL_DK_BLOOD_PLAGUE, caster->GetGUID())) - caster->CastSpell(hitUnit, SPELL_DK_BLOOD_PLAGUE, true); + if (Aura* disOld = target->GetAura(SPELL_DK_BLOOD_PLAGUE, caster->GetGUID())) + if (AuraEffect* effOld = disOld->GetEffect(EFFECT_0)) + { + float pctMods = effOld->GetPctMods(); + float crit = effOld->GetCritChance(); + caster->CastSpell(hitUnit, SPELL_DK_BLOOD_PLAGUE, true); + + if (Aura* disNew = hitUnit->GetAura(SPELL_DK_BLOOD_PLAGUE, caster->GetGUID())) + if (AuraEffect* effNew = disNew->GetEffect(EFFECT_0)) + { + effNew->SetPctMods(pctMods); + effNew->SetCritChance(crit); + effNew->SetAmount(effNew->CalculateAmount(effNew->GetCaster())); + } + } + // Frost Fever - if (target->GetAura(SPELL_DK_FROST_FEVER, caster->GetGUID())) - caster->CastSpell(hitUnit, SPELL_DK_FROST_FEVER, true); + if (Aura* disOld = target->GetAura(SPELL_DK_FROST_FEVER, caster->GetGUID())) + if (AuraEffect* effOld = disOld->GetEffect(EFFECT_0)) + { + float pctMods = effOld->GetPctMods(); + float crit = effOld->GetCritChance(); + caster->CastSpell(hitUnit, SPELL_DK_FROST_FEVER, true); + + if (Aura* disNew = hitUnit->GetAura(SPELL_DK_FROST_FEVER, caster->GetGUID())) + if (AuraEffect* effNew = disNew->GetEffect(EFFECT_0)) + { + effNew->SetPctMods(pctMods); + effNew->SetCritChance(crit); + effNew->SetAmount(effNew->CalculateAmount(effNew->GetCaster())); + } + } } }