mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-05 12:03:48 +00:00
fix(Scripts/Spell): snapshot %dmg and crit when spreading or refreshing diseases with pestilence (#22306)
This commit is contained in:
@@ -110,6 +110,7 @@ public:
|
|||||||
uint8 GetCasterLevel() const { return m_casterLevel; }
|
uint8 GetCasterLevel() const { return m_casterLevel; }
|
||||||
bool CanApplyResilience() const { return m_applyResilience; }
|
bool CanApplyResilience() const { return m_applyResilience; }
|
||||||
float GetPctMods() const { return m_pctMods; }
|
float GetPctMods() const { return m_pctMods; }
|
||||||
|
void SetPctMods(float pctMods) { m_pctMods = pctMods; }
|
||||||
|
|
||||||
// xinef: stacking
|
// xinef: stacking
|
||||||
uint32 GetAuraGroup() const { return m_auraGroup; }
|
uint32 GetAuraGroup() const { return m_auraGroup; }
|
||||||
|
|||||||
@@ -1727,6 +1727,16 @@ class spell_dk_pestilence : public SpellScript
|
|||||||
{
|
{
|
||||||
PrepareSpellScript(spell_dk_pestilence);
|
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*/)
|
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||||
{
|
{
|
||||||
Unit* caster = GetCaster();
|
Unit* caster = GetCaster();
|
||||||
@@ -1743,11 +1753,38 @@ class spell_dk_pestilence : public SpellScript
|
|||||||
|
|
||||||
// And spread them on target
|
// And spread them on target
|
||||||
// Blood Plague
|
// Blood Plague
|
||||||
if (target->GetAura(SPELL_DK_BLOOD_PLAGUE, caster->GetGUID()))
|
if (Aura* disOld = target->GetAura(SPELL_DK_BLOOD_PLAGUE, caster->GetGUID()))
|
||||||
caster->CastSpell(hitUnit, SPELL_DK_BLOOD_PLAGUE, true);
|
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
|
// Frost Fever
|
||||||
if (target->GetAura(SPELL_DK_FROST_FEVER, caster->GetGUID()))
|
if (Aura* disOld = target->GetAura(SPELL_DK_FROST_FEVER, caster->GetGUID()))
|
||||||
caster->CastSpell(hitUnit, SPELL_DK_FROST_FEVER, true);
|
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