Core/Spells: calculate crit chance only for spells that do damage/healing

Port From (https://github.com/TrinityCore/TrinityCore/commit/85e5509e91a1370b16851d375a26121797870921)
This commit is contained in:
hondacrx
2021-06-23 22:06:49 -04:00
parent 89586e9495
commit 9e23ca4b04
6 changed files with 80 additions and 43 deletions
-13
View File
@@ -355,19 +355,6 @@ namespace Game.Spells
_effects[effect.EffectIndex] = new AuraEffect(this, effect, baseAmount != null ? baseAmount[effect.EffectIndex] : (int?)null, caster);
}
}
public float CalcPeriodicCritChance(Unit caster)
{
if (!caster)
return 0.0f;
Player modOwner = caster.GetSpellModOwner();
if (modOwner == null)
return 0.0f;
float critChance = modOwner.SpellCritChanceDone(GetSpellInfo(), GetSpellInfo().GetSchoolMask(), GetSpellInfo().GetAttackType());
return Math.Max(0.0f, critChance);
}
public Unit GetCaster()
{