mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user