Corrected points per level calculation for some spells (#19105)

This commit is contained in:
xinef1
2017-02-19 06:30:04 +01:00
committed by ariel-
parent e261754c9c
commit 9142c778dd

View File

@@ -411,14 +411,16 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
int32 randomPoints = int32(DieSides);
// base amount modification based on spell lvl vs caster lvl
if (caster)
if (caster && basePointsPerLevel != 0.0f)
{
int32 level = int32(caster->getLevel());
if (level > int32(_spellInfo->MaxLevel) && _spellInfo->MaxLevel > 0)
level = int32(_spellInfo->MaxLevel);
else if (level < int32(_spellInfo->BaseLevel))
level = int32(_spellInfo->BaseLevel);
level -= int32(_spellInfo->SpellLevel);
// if base level is greater than spell level, reduce by base level (eg. pilgrims foods)
level -= int32(std::max(_spellInfo->BaseLevel, _spellInfo->SpellLevel));
basePoints += int32(level * basePointsPerLevel);
}