mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
fix(Scripts/Spell): snapshot %dmg and crit when spreading or refreshing diseases with pestilence (#22306)
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user