refactor(Core/Object): getLevel() -> GetLevel() (#14122)

* refactor(Core/Object): getLevel() -> GetLevel()

* fix build and sneak some doxygen in

* codeSTLE

* codestyle
This commit is contained in:
Kitzunu
2022-12-31 17:39:23 +01:00
committed by GitHub
parent 089ce9eb41
commit 4870b14b1f
78 changed files with 326 additions and 314 deletions

View File

@@ -414,7 +414,7 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
// xinef: added basePointsPerLevel check
if (caster && basePointsPerLevel != 0.0f)
{
int32 level = int32(caster->getLevel());
int32 level = int32(caster->GetLevel());
if (level > int32(_spellInfo->MaxLevel) && _spellInfo->MaxLevel > 0)
level = int32(_spellInfo->MaxLevel);
else if (level < int32(_spellInfo->BaseLevel))
@@ -458,7 +458,7 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
// amount multiplication based on caster's level
if (!caster->IsControlledByPlayer() &&
_spellInfo->SpellLevel && _spellInfo->SpellLevel != caster->getLevel() &&
_spellInfo->SpellLevel && _spellInfo->SpellLevel != caster->GetLevel() &&
!basePointsPerLevel && _spellInfo->HasAttribute(SPELL_ATTR0_SCALES_WITH_CREATURE_LEVEL))
{
bool canEffectScale = false;
@@ -502,7 +502,7 @@ 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);
GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.LookupEntry(caster->GetLevel() - 1);
if (spellScaler && casterScaler)
value *= casterScaler->ratio / spellScaler->ratio;
}
@@ -549,7 +549,7 @@ float SpellEffectInfo::CalcRadius(Unit* caster, Spell* spell) const
float radius = RadiusEntry->RadiusMin;
if (caster)
{
radius += RadiusEntry->RadiusPerLevel * caster->getLevel();
radius += RadiusEntry->RadiusPerLevel * caster->GetLevel();
radius = std::min(radius, RadiusEntry->RadiusMax);
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_RADIUS, radius, spell);
@@ -2453,7 +2453,7 @@ int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask, S
if (HasAttribute(SPELL_ATTR0_SCALES_WITH_CREATURE_LEVEL))
{
GtNPCManaCostScalerEntry const* spellScaler = sGtNPCManaCostScalerStore.LookupEntry(SpellLevel - 1);
GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.LookupEntry(caster->getLevel() - 1);
GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.LookupEntry(caster->GetLevel() - 1);
if (spellScaler && casterScaler)
powerCost *= casterScaler->ratio / spellScaler->ratio;
}