Core/Script: Implement CalcCritChance hooks for spell and aura scripts

Port From (https://github.com/TrinityCore/TrinityCore/commit/f8255b15419cd1efdd2ccaf77298c8598322288f)
This commit is contained in:
hondacrx
2021-03-29 16:04:29 -04:00
parent 487aad55df
commit 3d40c868f6
6 changed files with 86 additions and 11 deletions
+3 -3
View File
@@ -4923,7 +4923,7 @@ namespace Game.Spells
}
}
bool crit = RandomHelper.randChance(isAreaAura ? caster.GetUnitSpellCriticalChance(target, m_spellInfo, m_spellInfo.GetSchoolMask()) : m_critChance);
bool crit = RandomHelper.randChance(isAreaAura ? caster.GetUnitSpellCriticalChance(target, null, this, m_spellInfo.GetSchoolMask()) : m_critChance);
if (crit)
damage = caster.SpellCriticalDamageBonus(m_spellInfo, damage, target);
@@ -5010,7 +5010,7 @@ namespace Game.Spells
}
}
bool crit = RandomHelper.randChance(isAreaAura ? caster.GetUnitSpellCriticalChance(target, m_spellInfo, m_spellInfo.GetSchoolMask()) : m_critChance);
bool crit = RandomHelper.randChance(isAreaAura ? caster.GetUnitSpellCriticalChance(target, null, this, m_spellInfo.GetSchoolMask()) : m_critChance);
if (crit)
damage = caster.SpellCriticalDamageBonus(m_spellInfo, damage, target);
@@ -5150,7 +5150,7 @@ namespace Game.Spells
damage = (int)target.SpellHealingBonusTaken(caster, GetSpellInfo(), (uint)damage, DamageEffectType.DOT, GetSpellEffectInfo(), GetBase().GetStackAmount());
}
bool crit = RandomHelper.randChance(isAreaAura ? caster.GetUnitSpellCriticalChance(target, m_spellInfo, m_spellInfo.GetSchoolMask()) : m_critChance);
bool crit = RandomHelper.randChance(isAreaAura ? caster.GetUnitSpellCriticalChance(target, null, this, m_spellInfo.GetSchoolMask()) : m_critChance);
if (crit)
damage = caster.SpellCriticalHealingBonus(m_spellInfo, damage, target);