Core/Unit: rename several getters to follow codestyle
uint8 GetLevel()
uint8 GetLevelForTarget(WorldObject const* /*target*/)
void SetLevel(uint8 lvl)
uint8 GetRace()
uint32 GetRaceMask()
uint8 GetClass()
uint32 GetClassMask()
uint8 GetGender()
(cherry picked from commit 5c09ff51f7015b775def8d5cc1f678eaef37200f)
This commit is contained in:
@@ -268,7 +268,7 @@ float Player::GetHealthBonusFromStamina() const
|
||||
{
|
||||
// Taken from PaperDollFrame.lua - 6.0.3.19085
|
||||
float ratio = 10.0f;
|
||||
if (GtHpPerStaEntry const* hpBase = sHpPerStaGameTable.GetRow(getLevel()))
|
||||
if (GtHpPerStaEntry const* hpBase = sHpPerStaGameTable.GetRow(GetLevel()))
|
||||
ratio = hpBase->Health;
|
||||
|
||||
float stamina = GetStat(STAT_STAMINA);
|
||||
@@ -283,7 +283,7 @@ Stats Player::GetPrimaryStat() const
|
||||
if (ChrSpecializationEntry const* specialization = sChrSpecializationStore.LookupEntry(GetPrimarySpecialization()))
|
||||
return specialization->PrimaryStatPriority;
|
||||
|
||||
return sChrClassesStore.AssertEntry(getClass())->PrimaryStatPriority;
|
||||
return sChrClassesStore.AssertEntry(GetClass())->PrimaryStatPriority;
|
||||
}();
|
||||
|
||||
if (primaryStatPriority >= 4)
|
||||
@@ -309,7 +309,7 @@ void Player::UpdateMaxHealth()
|
||||
|
||||
uint32 Player::GetPowerIndex(Powers power) const
|
||||
{
|
||||
return sDB2Manager.GetPowerIndexByClass(power, getClass());
|
||||
return sDB2Manager.GetPowerIndexByClass(power, GetClass());
|
||||
}
|
||||
|
||||
void Player::UpdateMaxPower(Powers power)
|
||||
@@ -331,9 +331,9 @@ void Player::UpdateMaxPower(Powers power)
|
||||
void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
{
|
||||
float val2 = 0.0f;
|
||||
float level = float(getLevel());
|
||||
float level = float(GetLevel());
|
||||
|
||||
ChrClassesEntry const* entry = sChrClassesStore.AssertEntry(getClass());
|
||||
ChrClassesEntry const* entry = sChrClassesStore.AssertEntry(GetClass());
|
||||
UnitMods unitMod = ranged ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER;
|
||||
|
||||
if (!HasAuraType(SPELL_AURA_OVERRIDE_ATTACK_POWER_BY_SP_PCT))
|
||||
@@ -562,7 +562,7 @@ void Player::UpdateVersatilityDamageDone()
|
||||
// No proof that CR_VERSATILITY_DAMAGE_DONE is allways = ActivePlayerData::Versatility
|
||||
SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::Versatility), m_activePlayerData->CombatRatings[CR_VERSATILITY_DAMAGE_DONE]);
|
||||
|
||||
if (getClass() == CLASS_HUNTER)
|
||||
if (GetClass() == CLASS_HUNTER)
|
||||
UpdateDamagePhysical(RANGED_ATTACK);
|
||||
else
|
||||
UpdateDamagePhysical(BASE_ATTACK);
|
||||
@@ -640,7 +640,7 @@ void Player::UpdateParryPercentage()
|
||||
{
|
||||
// No parry
|
||||
float value = 0.0f;
|
||||
uint32 pclass = getClass() - 1;
|
||||
uint32 pclass = GetClass() - 1;
|
||||
if (CanParry() && parry_cap[pclass] > 0.0f)
|
||||
{
|
||||
float nondiminishing = 5.0f;
|
||||
@@ -650,7 +650,7 @@ void Player::UpdateParryPercentage()
|
||||
nondiminishing += GetTotalAuraModifier(SPELL_AURA_MOD_PARRY_PERCENT);
|
||||
|
||||
// apply diminishing formula to diminishing parry chance
|
||||
value = CalculateDiminishingReturns(parry_cap, getClass(), nondiminishing, diminishing);
|
||||
value = CalculateDiminishingReturns(parry_cap, GetClass(), nondiminishing, diminishing);
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_PARRY) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_PARRY) : value;
|
||||
@@ -685,7 +685,7 @@ void Player::UpdateDodgePercentage()
|
||||
diminishing += GetRatingBonusValue(CR_DODGE);
|
||||
|
||||
// apply diminishing formula to diminishing dodge chance
|
||||
float value = CalculateDiminishingReturns(dodge_cap, getClass(), nondiminishing, diminishing);
|
||||
float value = CalculateDiminishingReturns(dodge_cap, GetClass(), nondiminishing, diminishing);
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) : value;
|
||||
@@ -804,7 +804,7 @@ void Player::UpdateManaRegen()
|
||||
|
||||
// Get base of Mana Pool in sBaseMPGameTable
|
||||
uint32 basemana = 0;
|
||||
sObjectMgr->GetPlayerClassLevelInfo(getClass(), getLevel(), basemana);
|
||||
sObjectMgr->GetPlayerClassLevelInfo(GetClass(), GetLevel(), basemana);
|
||||
float base_regen = basemana / 100.f;
|
||||
|
||||
base_regen += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA);
|
||||
@@ -821,7 +821,7 @@ void Player::UpdateManaRegen()
|
||||
|
||||
void Player::UpdateAllRunesRegen()
|
||||
{
|
||||
if (getClass() != CLASS_DEATH_KNIGHT)
|
||||
if (GetClass() != CLASS_DEATH_KNIGHT)
|
||||
return;
|
||||
|
||||
uint32 runeIndex = GetPowerIndex(POWER_RUNES);
|
||||
@@ -1047,7 +1047,7 @@ bool Guardian::UpdateStats(Stats stat)
|
||||
//warlock's and mage's pets gain 30% of owner's intellect
|
||||
else if (stat == STAT_INTELLECT)
|
||||
{
|
||||
if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE)
|
||||
if (owner->GetClass() == CLASS_WARLOCK || owner->GetClass() == CLASS_MAGE)
|
||||
{
|
||||
ownersBonus = CalculatePct(owner->GetStat(stat), 30);
|
||||
value += ownersBonus;
|
||||
|
||||
Reference in New Issue
Block a user