fix(Core/Spells): Correct spell scaling formula. (#17649)

* Replace old spell scaling with revised version.

Co-Authored-By: balakethelock <111737968+balakethelock@users.noreply.github.com>

* Remove a single-use variable.

* Use funky multiply operator.

More similar to original function, if a tad less readable IMO.

---------

Co-authored-by: balakethelock <111737968+balakethelock@users.noreply.github.com>
This commit is contained in:
Benjamin Jackson
2023-11-08 02:44:05 -05:00
committed by GitHub
parent 9e0b420e43
commit f898fa75cd

View File

@@ -502,10 +502,13 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
if (canEffectScale)
{
GtNPCManaCostScalerEntry const* spellScaler = sGtNPCManaCostScalerStore.LookupEntry(_spellInfo->SpellLevel - 1);
GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.LookupEntry(caster->GetLevel() - 1);
if (spellScaler && casterScaler)
value *= casterScaler->ratio / spellScaler->ratio;
CreatureTemplate const* cInfo = caster->ToCreature()->GetCreatureTemplate();
CreatureBaseStats const* pCBS = sObjectMgr->GetCreatureBaseStats(caster->GetLevel(), caster->getClass());
float CBSPowerCreature = pCBS->BaseDamage[cInfo->expansion];
CreatureBaseStats const* spellCBS = sObjectMgr->GetCreatureBaseStats(_spellInfo->SpellLevel, caster->getClass());
float CBSPowerSpell = spellCBS->BaseDamage[cInfo->expansion];
value *= CBSPowerCreature / CBSPowerSpell;
}
}
}