summaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorTereneckla <Tereneckla@pm.me>2025-06-22 09:38:09 +0000
committerGitHub <noreply@github.com>2025-06-22 11:38:09 +0200
commit86f460c0ca4cd1e4d0b79bc2177bf0eafae9ba09 (patch)
tree6c70fe1d1e2f14d47884ad94b27f02ec63a85752 /src/server/scripts/Spells
parent90eb27cd1570113930bacc17fec8c5749acee235 (diff)
fix(Scripts/Spell): snapshot %dmg and crit when spreading or refreshing diseases with pestilence (#22306)
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp45
1 files changed, 41 insertions, 4 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index cd47823c13..8e27678c08 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()));
+ }
+ }
}
}