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:
@@ -546,7 +546,7 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changele
|
||||
}
|
||||
|
||||
SetMeleeDamageSchool(SpellSchools(cInfo->dmgschool));
|
||||
CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(getLevel(), cInfo->unit_class);
|
||||
CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(GetLevel(), cInfo->unit_class);
|
||||
float armor = (float)stats->GenerateArmor(cInfo); // TODO: Why is this treated as uint32 when it's a float?
|
||||
SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, armor);
|
||||
SetModifierValue(UNIT_MOD_RESISTANCE_HOLY, BASE_VALUE, float(cInfo->resistance[SPELL_SCHOOL_HOLY]));
|
||||
@@ -1213,7 +1213,7 @@ bool Creature::isCanInteractWithBattleMaster(Player* player, bool msg) const
|
||||
|
||||
bool Creature::isCanTrainingAndResetTalentsOf(Player* player) const
|
||||
{
|
||||
return player->getLevel() >= 10
|
||||
return player->GetLevel() >= 10
|
||||
&& GetCreatureTemplate()->trainer_type == TRAINER_TYPE_CLASS
|
||||
&& player->getClass() == GetCreatureTemplate()->trainer_class;
|
||||
}
|
||||
@@ -2898,7 +2898,7 @@ uint8 Creature::getLevelForTarget(WorldObject const* target) const
|
||||
if (!isWorldBoss() || !target->ToUnit())
|
||||
return Unit::getLevelForTarget(target);
|
||||
|
||||
uint16 level = target->ToUnit()->getLevel() + sWorld->getIntConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF);
|
||||
uint16 level = target->ToUnit()->GetLevel() + sWorld->getIntConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF);
|
||||
if (level < 1)
|
||||
return 1;
|
||||
if (level > 255)
|
||||
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
|
||||
[[nodiscard]] uint32 GetShieldBlockValue() const override
|
||||
{
|
||||
return (getLevel() / 2 + uint32(GetStat(STAT_STRENGTH) / 20));
|
||||
return (GetLevel() / 2 + uint32(GetStat(STAT_STRENGTH) / 20));
|
||||
}
|
||||
|
||||
[[nodiscard]] SpellSchoolMask GetMeleeDamageSchoolMask(WeaponAttackType /*attackType*/ = BASE_ATTACK, uint8 /*damageIndex*/ = 0) const override { return m_meleeDamageSchoolMask; }
|
||||
|
||||
@@ -452,12 +452,12 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGU
|
||||
|
||||
uint32 moneyRew = 0;
|
||||
Player* player = _session->GetPlayer();
|
||||
uint8 playerLevel = player ? player->getLevel() : 0;
|
||||
uint8 playerLevel = player ? player->GetLevel() : 0;
|
||||
if (player && (player->getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player)))
|
||||
{
|
||||
moneyRew = quest->GetRewMoneyMaxLevel();
|
||||
}
|
||||
moneyRew += quest->GetRewOrReqMoney(player ? player->getLevel() : 0); // reward money (below max lvl)
|
||||
moneyRew += quest->GetRewOrReqMoney(player ? player->GetLevel() : 0); // reward money (below max lvl)
|
||||
data << moneyRew;
|
||||
uint32 questXp;
|
||||
if (player && !sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player))
|
||||
@@ -553,11 +553,11 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
{
|
||||
uint32 moneyRew = 0;
|
||||
Player* player = _session->GetPlayer();
|
||||
if (player && (player->getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player)))
|
||||
if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player)))
|
||||
{
|
||||
moneyRew = quest->GetRewMoneyMaxLevel();
|
||||
}
|
||||
moneyRew += quest->GetRewOrReqMoney(player ? player->getLevel() : 0); // reward money (below max lvl)
|
||||
moneyRew += quest->GetRewOrReqMoney(player ? player->GetLevel() : 0); // reward money (below max lvl)
|
||||
data << moneyRew;
|
||||
}
|
||||
|
||||
@@ -705,12 +705,12 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUI
|
||||
|
||||
uint32 moneyRew = 0;
|
||||
Player* player = _session->GetPlayer();
|
||||
uint8 playerLevel = player ? player->getLevel() : 0;
|
||||
if (player && (player->getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player)))
|
||||
uint8 playerLevel = player ? player->GetLevel() : 0;
|
||||
if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player)))
|
||||
{
|
||||
moneyRew = quest->GetRewMoneyMaxLevel();
|
||||
}
|
||||
moneyRew += quest->GetRewOrReqMoney(player ? player->getLevel() : 0); // reward money (below max lvl)
|
||||
moneyRew += quest->GetRewOrReqMoney(player ? player->GetLevel() : 0); // reward money (below max lvl)
|
||||
data << moneyRew;
|
||||
uint32 questXp;
|
||||
if (player && !sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player))
|
||||
|
||||
@@ -216,7 +216,7 @@ void TempSummon::InitStats(uint32 duration)
|
||||
if (IsTrigger() && m_spells[0])
|
||||
{
|
||||
SetFaction(owner->GetFaction());
|
||||
SetLevel(owner->getLevel());
|
||||
SetLevel(owner->GetLevel());
|
||||
if (owner->GetTypeId() == TYPEID_PLAYER)
|
||||
m_ControlledByPlayer = true;
|
||||
}
|
||||
@@ -412,7 +412,7 @@ void Guardian::InitStats(uint32 duration)
|
||||
|
||||
if (Unit* m_owner = GetOwner())
|
||||
{
|
||||
InitStatsForLevel(m_owner->getLevel());
|
||||
InitStatsForLevel(m_owner->GetLevel());
|
||||
|
||||
if (m_owner->GetTypeId() == TYPEID_PLAYER && HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN))
|
||||
m_charmInfo->InitCharmCreateSpells();
|
||||
@@ -450,7 +450,7 @@ Puppet::Puppet(SummonPropertiesEntry const* properties, ObjectGuid owner) : Mini
|
||||
void Puppet::InitStats(uint32 duration)
|
||||
{
|
||||
Minion::InitStats(duration);
|
||||
SetLevel(GetOwner()->getLevel());
|
||||
SetLevel(GetOwner()->GetLevel());
|
||||
SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
|
||||
@@ -1916,10 +1916,10 @@ void GameObject::Use(Unit* user)
|
||||
return;
|
||||
|
||||
//required lvl checks!
|
||||
uint8 level = player->getLevel();
|
||||
uint8 level = player->GetLevel();
|
||||
if (level < info->meetingstone.minLevel)
|
||||
return;
|
||||
level = targetPlayer->getLevel();
|
||||
level = targetPlayer->GetLevel();
|
||||
if (level < info->meetingstone.minLevel)
|
||||
return;
|
||||
|
||||
@@ -2107,7 +2107,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId)
|
||||
|
||||
if (Unit* owner = GetOwner())
|
||||
{
|
||||
trigger->SetLevel(owner->getLevel(), false);
|
||||
trigger->SetLevel(owner->GetLevel(), false);
|
||||
trigger->SetFaction(owner->GetFaction());
|
||||
// needed for GO casts for proper target validation checks
|
||||
trigger->SetOwnerGUID(owner->GetGUID());
|
||||
|
||||
@@ -2361,7 +2361,7 @@ Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint3
|
||||
if (setLevel && (GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT))
|
||||
{
|
||||
summon->SetFaction(((Unit*)this)->GetFaction());
|
||||
summon->SetLevel(((Unit*)this)->getLevel());
|
||||
summon->SetLevel(((Unit*)this)->GetLevel());
|
||||
}
|
||||
|
||||
// Xinef: correctly set phase mask in case of gameobjects
|
||||
|
||||
@@ -296,7 +296,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
|
||||
switch (getPetType())
|
||||
{
|
||||
case SUMMON_PET:
|
||||
petlevel = owner->getLevel();
|
||||
petlevel = owner->GetLevel();
|
||||
|
||||
if (IsPetGhoul())
|
||||
SetUInt32Value(UNIT_FIELD_BYTES_0, 0x400); // class = rogue
|
||||
@@ -565,7 +565,7 @@ void Pet::SavePetToDB(PetSaveMode mode)
|
||||
stmt->SetData(3, GetNativeDisplayId());
|
||||
stmt->SetData(4, GetUInt32Value(UNIT_CREATED_BY_SPELL));
|
||||
stmt->SetData(5, uint8(getPetType()));
|
||||
stmt->SetData(6, getLevel());
|
||||
stmt->SetData(6, GetLevel());
|
||||
stmt->SetData(7, GetUInt32Value(UNIT_FIELD_PETEXPERIENCE));
|
||||
stmt->SetData(8, uint8(GetReactState()));
|
||||
stmt->SetData(9, GetName());
|
||||
@@ -887,8 +887,8 @@ void Pet::GivePetXP(uint32 xp)
|
||||
if (!IsAlive())
|
||||
return;
|
||||
|
||||
uint8 maxlevel = std::min((uint8)sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL), GetOwner()->getLevel());
|
||||
uint8 petlevel = getLevel();
|
||||
uint8 maxlevel = std::min((uint8)sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL), GetOwner()->GetLevel());
|
||||
uint8 petlevel = GetLevel();
|
||||
|
||||
// If pet is detected to be at, or above(?) the players level, don't hand out XP
|
||||
if (petlevel >= maxlevel)
|
||||
@@ -915,7 +915,7 @@ void Pet::GivePetXP(uint32 xp)
|
||||
|
||||
void Pet::GivePetLevel(uint8 level)
|
||||
{
|
||||
if (!level || level == getLevel())
|
||||
if (!level || level == GetLevel())
|
||||
return;
|
||||
|
||||
if (getPetType() == HUNTER_PET)
|
||||
@@ -992,7 +992,7 @@ bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phas
|
||||
setPowerType(POWER_FOCUS);
|
||||
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
|
||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(getLevel() + 1)* sWorld->getRate(RATE_XP_PET_NEXT_LEVEL)));
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(GetLevel() + 1)* sWorld->getRate(RATE_XP_PET_NEXT_LEVEL)));
|
||||
ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
|
||||
|
||||
if (cinfo->type == CREATURE_TYPE_BEAST)
|
||||
@@ -1078,12 +1078,12 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
if (cFamily && cFamily->minScale > 0.0f && petType == HUNTER_PET)
|
||||
{
|
||||
float scale;
|
||||
if (getLevel() >= cFamily->maxScaleLevel)
|
||||
if (GetLevel() >= cFamily->maxScaleLevel)
|
||||
scale = 1.0f;
|
||||
else if (getLevel() <= cFamily->minScaleLevel)
|
||||
else if (GetLevel() <= cFamily->minScaleLevel)
|
||||
scale = 0.5f;
|
||||
else
|
||||
scale = 0.5f + 0.5f * float(getLevel() - cFamily->minScaleLevel) / float(cFamily->maxScaleLevel - cFamily->minScaleLevel);
|
||||
scale = 0.5f + 0.5f * float(GetLevel() - cFamily->minScaleLevel) / float(cFamily->maxScaleLevel - cFamily->minScaleLevel);
|
||||
|
||||
SetObjectScale(scale);
|
||||
}
|
||||
@@ -1421,13 +1421,13 @@ bool Pet::HaveInDiet(ItemTemplate const* item) const
|
||||
uint32 Pet::GetCurrentFoodBenefitLevel(uint32 itemlevel) const
|
||||
{
|
||||
// -5 or greater food level
|
||||
if (getLevel() <= itemlevel + 5) //possible to feed level 60 pet with level 55 level food for full effect
|
||||
if (GetLevel() <= itemlevel + 5) //possible to feed level 60 pet with level 55 level food for full effect
|
||||
return 35000;
|
||||
// -10..-6
|
||||
else if (getLevel() <= itemlevel + 10) //pure guess, but sounds good
|
||||
else if (GetLevel() <= itemlevel + 10) //pure guess, but sounds good
|
||||
return 17000;
|
||||
// -14..-11
|
||||
else if (getLevel() <= itemlevel + 14) //level 55 food gets green on 70, makes sense to me
|
||||
else if (GetLevel() <= itemlevel + 14) //level 55 food gets green on 70, makes sense to me
|
||||
return 8000;
|
||||
// -15 or less
|
||||
else
|
||||
@@ -1611,7 +1611,7 @@ void Pet::_LoadAuras(PreparedQueryResult result, uint32 timediff)
|
||||
}
|
||||
|
||||
// avoid higher level auras if any, and adjust
|
||||
SpellInfo const* scaledSpellInfo = spellInfo->GetAuraRankForLevel(getLevel());
|
||||
SpellInfo const* scaledSpellInfo = spellInfo->GetAuraRankForLevel(GetLevel());
|
||||
if (scaledSpellInfo != spellInfo)
|
||||
spellInfo = scaledSpellInfo;
|
||||
|
||||
@@ -1864,7 +1864,7 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel
|
||||
uint32 talentCost = GetTalentSpellCost(spellId);
|
||||
if (talentCost)
|
||||
{
|
||||
int32 free_points = GetMaxTalentPointsForLevel(getLevel());
|
||||
int32 free_points = GetMaxTalentPointsForLevel(GetLevel());
|
||||
m_usedTalentCount += talentCost;
|
||||
// update free talent points
|
||||
free_points -= m_usedTalentCount;
|
||||
@@ -1892,7 +1892,7 @@ bool Pet::learnSpell(uint32 spell_id)
|
||||
|
||||
void Pet::InitLevelupSpellsForLevel()
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
|
||||
if (PetLevelupSpellSet const* levelupSpells = GetCreatureTemplate()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureTemplate()->family) : nullptr)
|
||||
{
|
||||
@@ -1970,7 +1970,7 @@ bool Pet::removeSpell(uint32 spell_id, bool learn_prev, bool clear_ab)
|
||||
else
|
||||
m_usedTalentCount = 0;
|
||||
// update free talent points
|
||||
int32 free_points = GetMaxTalentPointsForLevel(getLevel()) - m_usedTalentCount;
|
||||
int32 free_points = GetMaxTalentPointsForLevel(GetLevel()) - m_usedTalentCount;
|
||||
SetFreeTalentPoints(free_points > 0 ? free_points : 0);
|
||||
}
|
||||
|
||||
@@ -2044,7 +2044,7 @@ bool Pet::resetTalents()
|
||||
|
||||
Player* player = owner->ToPlayer();
|
||||
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
uint32 talentPointsForLevel = GetMaxTalentPointsForLevel(level);
|
||||
|
||||
if (m_usedTalentCount == 0)
|
||||
@@ -2166,7 +2166,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* onlinePet /*= nullptr*/)
|
||||
|
||||
void Pet::InitTalentForLevel()
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
uint32 talentPointsForLevel = GetMaxTalentPointsForLevel(level);
|
||||
|
||||
Unit* owner = GetOwner();
|
||||
@@ -2349,14 +2349,14 @@ void Pet::SynchronizeLevelWithOwner()
|
||||
{
|
||||
// always same level
|
||||
case SUMMON_PET:
|
||||
GivePetLevel(owner->getLevel());
|
||||
GivePetLevel(owner->GetLevel());
|
||||
break;
|
||||
// can't be greater owner level
|
||||
case HUNTER_PET:
|
||||
if (getLevel() > owner->getLevel())
|
||||
GivePetLevel(owner->getLevel());
|
||||
else if (getLevel() + 5 < owner->getLevel())
|
||||
GivePetLevel(owner->getLevel() - 5);
|
||||
if (GetLevel() > owner->GetLevel())
|
||||
GivePetLevel(owner->GetLevel());
|
||||
else if (GetLevel() + 5 < owner->GetLevel())
|
||||
GivePetLevel(owner->GetLevel() - 5);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -2421,7 +2421,7 @@ void Pet::FillPetInfo(PetStable::PetInfo* petInfo) const
|
||||
petInfo->PetNumber = m_charmInfo->GetPetNumber();
|
||||
petInfo->CreatureId = GetEntry();
|
||||
petInfo->DisplayId = GetNativeDisplayId();
|
||||
petInfo->Level = getLevel();
|
||||
petInfo->Level = GetLevel();
|
||||
petInfo->Experience = GetUInt32Value(UNIT_FIELD_PETEXPERIENCE);
|
||||
petInfo->ReactState = GetReactState();
|
||||
petInfo->Name = GetName();
|
||||
|
||||
@@ -87,7 +87,7 @@ void KillRewarder::_InitGroupData()
|
||||
if (Player* member = itr->GetSource())
|
||||
if ((_killer == member || member->IsAtGroupRewardDistance(_victim)))
|
||||
{
|
||||
const uint8 lvl = member->getLevel();
|
||||
const uint8 lvl = member->GetLevel();
|
||||
if (member->IsAlive())
|
||||
{
|
||||
// 2.1. _count - number of alive group members within reward distance;
|
||||
@@ -102,7 +102,7 @@ void KillRewarder::_InitGroupData()
|
||||
// 2.4. _maxNotGrayMember - maximum level of alive group member within reward distance,
|
||||
// for whom victim is not gray;
|
||||
uint32 grayLevel = Acore::XP::GetGrayLevel(lvl);
|
||||
if (_victim->getLevel() > grayLevel && (!_maxNotGrayMember || _maxNotGrayMember->getLevel() < lvl))
|
||||
if (_victim->GetLevel() > grayLevel && (!_maxNotGrayMember || _maxNotGrayMember->GetLevel() < lvl))
|
||||
{
|
||||
_maxNotGrayMember = member;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ void KillRewarder::_InitGroupData()
|
||||
}
|
||||
// 2.6. _isFullXP - flag identifying that for all group members victim is not gray,
|
||||
// so 100% XP will be rewarded (50% otherwise).
|
||||
_isFullXP = _maxNotGrayMember && (_maxLevel == _maxNotGrayMember->getLevel());
|
||||
_isFullXP = _maxNotGrayMember && (_maxLevel == _maxNotGrayMember->GetLevel());
|
||||
}
|
||||
else
|
||||
_count = 1;
|
||||
@@ -151,7 +151,7 @@ void KillRewarder::_RewardXP(Player* player, float rate)
|
||||
// * set to 0 if player's level is more than maximum level of not gray member;
|
||||
// * cut XP in half if _isFullXP is false.
|
||||
if (_maxNotGrayMember && player->IsAlive() &&
|
||||
_maxNotGrayMember->getLevel() >= player->getLevel())
|
||||
_maxNotGrayMember->GetLevel() >= player->GetLevel())
|
||||
xp = _isFullXP ?
|
||||
uint32(xp * rate) : // Reward FULL XP if all group members are not gray.
|
||||
uint32(xp * rate / 2) + 1; // Reward only HALF of XP if some of group members are gray.
|
||||
@@ -206,8 +206,8 @@ void KillRewarder::_RewardPlayer(Player* player, bool isDungeon)
|
||||
// Give reputation and kill credit only in PvE.
|
||||
if (!_isPvP || _isBattleGround)
|
||||
{
|
||||
float xpRate = _group ? _groupRate * float(player->getLevel()) / _aliveSumLevel : /*Personal rate is 100%.*/ 1.0f; // Group rate depends on the sum of levels.
|
||||
float reputationRate = _group ? _groupRate * float(player->getLevel()) / _sumLevel : /*Personal rate is 100%.*/ 1.0f; // Group rate depends on the sum of levels.
|
||||
float xpRate = _group ? _groupRate * float(player->GetLevel()) / _aliveSumLevel : /*Personal rate is 100%.*/ 1.0f; // Group rate depends on the sum of levels.
|
||||
float reputationRate = _group ? _groupRate * float(player->GetLevel()) / _sumLevel : /*Personal rate is 100%.*/ 1.0f; // Group rate depends on the sum of levels.
|
||||
sScriptMgr->OnRewardKillRewarder(player, isDungeon, xpRate); // Personal rate is 100%.
|
||||
|
||||
if (_xp)
|
||||
|
||||
@@ -854,7 +854,7 @@ void Player::HandleDrowning(uint32 time_diff)
|
||||
m_MirrorTimer[BREATH_TIMER] += 1 * IN_MILLISECONDS;
|
||||
// Calculate and deal damage
|
||||
// TODO: Check this formula
|
||||
uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel() - 1);
|
||||
uint32 damage = GetMaxHealth() / 5 + urand(0, GetLevel() - 1);
|
||||
EnvironmentalDamage(DAMAGE_DROWNING, damage);
|
||||
}
|
||||
else if (!(m_MirrorTimerFlagsLast & UNDERWATER_INWATER)) // Update time in client if need
|
||||
@@ -890,7 +890,7 @@ void Player::HandleDrowning(uint32 time_diff)
|
||||
m_MirrorTimer[FATIGUE_TIMER] += 1 * IN_MILLISECONDS;
|
||||
if (IsAlive()) // Calculate and deal damage
|
||||
{
|
||||
uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel() - 1);
|
||||
uint32 damage = GetMaxHealth() / 5 + urand(0, GetLevel() - 1);
|
||||
EnvironmentalDamage(DAMAGE_EXHAUSTED, damage);
|
||||
}
|
||||
else if (HasPlayerFlag(PLAYER_FLAGS_GHOST)) // Teleport ghost to graveyard
|
||||
@@ -1850,8 +1850,8 @@ void Player::Regenerate(Powers power)
|
||||
bool recentCast = IsUnderLastManaUseEffect();
|
||||
float ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA);
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_LOW_LEVEL_REGEN_BOOST) && getLevel() < 15)
|
||||
ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA) * (2.066f - (getLevel() * 0.066f));
|
||||
if (sWorld->getBoolConfig(CONFIG_LOW_LEVEL_REGEN_BOOST) && GetLevel() < 15)
|
||||
ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA) * (2.066f - (GetLevel() * 0.066f));
|
||||
|
||||
if (recentCast) // Trinity Updates Mana in intervals of 2s, which is correct
|
||||
addvalue += GetFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER) * ManaIncreaseRate * 0.001f * m_regenTimer;
|
||||
@@ -1960,8 +1960,8 @@ void Player::RegenerateHealth()
|
||||
|
||||
float HealthIncreaseRate = sWorld->getRate(RATE_HEALTH);
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_LOW_LEVEL_REGEN_BOOST) && getLevel() < 15)
|
||||
HealthIncreaseRate = sWorld->getRate(RATE_HEALTH) * (2.066f - (getLevel() * 0.066f));
|
||||
if (sWorld->getBoolConfig(CONFIG_LOW_LEVEL_REGEN_BOOST) && GetLevel() < 15)
|
||||
HealthIncreaseRate = sWorld->getRate(RATE_HEALTH) * (2.066f - (GetLevel() * 0.066f));
|
||||
|
||||
float addvalue = 0.0f;
|
||||
|
||||
@@ -2354,7 +2354,7 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate, bool isLFGReward)
|
||||
return;
|
||||
}
|
||||
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
|
||||
sScriptMgr->OnGivePlayerXP(this, xp, victim);
|
||||
|
||||
@@ -2400,7 +2400,7 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate, bool isLFGReward)
|
||||
if (level < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
GiveLevel(level + 1);
|
||||
|
||||
level = getLevel();
|
||||
level = GetLevel();
|
||||
nextLvlXP = GetUInt32Value(PLAYER_NEXT_LEVEL_XP);
|
||||
}
|
||||
|
||||
@@ -2411,7 +2411,7 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate, bool isLFGReward)
|
||||
// Current player experience not update (must be update by caller)
|
||||
void Player::GiveLevel(uint8 level)
|
||||
{
|
||||
uint8 oldLevel = getLevel();
|
||||
uint8 oldLevel = GetLevel();
|
||||
if (level == oldLevel)
|
||||
return;
|
||||
|
||||
@@ -2532,15 +2532,15 @@ void Player::InitStatsForLevel(bool reapplyMods)
|
||||
_RemoveAllStatBonuses();
|
||||
|
||||
PlayerClassLevelInfo classInfo;
|
||||
sObjectMgr->GetPlayerClassLevelInfo(getClass(), getLevel(), &classInfo);
|
||||
sObjectMgr->GetPlayerClassLevelInfo(getClass(), GetLevel(), &classInfo);
|
||||
|
||||
PlayerLevelInfo info;
|
||||
sObjectMgr->GetPlayerLevelInfo(getRace(true), getClass(), getLevel(), &info);
|
||||
sObjectMgr->GetPlayerLevelInfo(getRace(true), getClass(), GetLevel(), &info);
|
||||
|
||||
uint32 maxPlayerLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
sScriptMgr->OnSetMaxLevel(this, maxPlayerLevel);
|
||||
SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, maxPlayerLevel);
|
||||
SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr->GetXPForLevel(getLevel()));
|
||||
SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr->GetXPForLevel(GetLevel()));
|
||||
|
||||
// reset before any aura state sources (health set/aura apply)
|
||||
SetUInt32Value(UNIT_FIELD_AURASTATE, 0);
|
||||
@@ -3853,7 +3853,7 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
|
||||
return TRAINER_SPELL_RED;
|
||||
|
||||
// check level requirement
|
||||
if (getLevel() < trainer_spell->reqLevel)
|
||||
if (GetLevel() < trainer_spell->reqLevel)
|
||||
return TRAINER_SPELL_RED;
|
||||
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
@@ -4425,15 +4425,15 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
|
||||
//Characters level 20 and up suffer from ten minutes of sickness.
|
||||
int32 startLevel = sWorld->getIntConfig(CONFIG_DEATH_SICKNESS_LEVEL);
|
||||
|
||||
if (int32(getLevel()) >= startLevel)
|
||||
if (int32(GetLevel()) >= startLevel)
|
||||
{
|
||||
// set resurrection sickness
|
||||
CastSpell(this, 15007, true);
|
||||
|
||||
// not full duration
|
||||
if (int32(getLevel()) < startLevel + 9)
|
||||
if (int32(GetLevel()) < startLevel + 9)
|
||||
{
|
||||
int32 delta = (int32(getLevel()) - startLevel + 1) * MINUTE;
|
||||
int32 delta = (int32(GetLevel()) - startLevel + 1) * MINUTE;
|
||||
|
||||
if (Aura* aur = GetAura(15007, GetGUID()))
|
||||
{
|
||||
@@ -4990,7 +4990,7 @@ uint32 Player::GetShieldBlockValue() const
|
||||
|
||||
float Player::GetMeleeCritFromAgility()
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
uint32 pclass = getClass();
|
||||
|
||||
if (level > GT_MAX_LEVEL)
|
||||
@@ -5038,7 +5038,7 @@ void Player::GetDodgeFromAgility(float& diminishing, float& nondiminishing)
|
||||
2.00f / 1.15f // Druid
|
||||
};
|
||||
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
uint32 pclass = getClass();
|
||||
|
||||
if (level > GT_MAX_LEVEL)
|
||||
@@ -5060,7 +5060,7 @@ void Player::GetDodgeFromAgility(float& diminishing, float& nondiminishing)
|
||||
|
||||
float Player::GetSpellCritFromIntellect()
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
uint32 pclass = getClass();
|
||||
|
||||
if (level > GT_MAX_LEVEL)
|
||||
@@ -5077,7 +5077,7 @@ float Player::GetSpellCritFromIntellect()
|
||||
|
||||
float Player::GetRatingMultiplier(CombatRating cr) const
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
|
||||
if (level > GT_MAX_LEVEL)
|
||||
level = GT_MAX_LEVEL;
|
||||
@@ -5112,7 +5112,7 @@ float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const
|
||||
|
||||
float Player::OCTRegenHPPerSpirit()
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
uint32 pclass = getClass();
|
||||
|
||||
if (level > GT_MAX_LEVEL)
|
||||
@@ -5135,7 +5135,7 @@ float Player::OCTRegenHPPerSpirit()
|
||||
|
||||
float Player::OCTRegenMPPerSpirit()
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
uint32 pclass = getClass();
|
||||
|
||||
if (level > GT_MAX_LEVEL)
|
||||
@@ -5687,17 +5687,17 @@ void Player::CheckAreaExploreAndOutdoor()
|
||||
|
||||
if (areaEntry->area_level > 0)
|
||||
{
|
||||
if (getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
SendExplorationExperience(areaId, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
int32 diff = int32(getLevel()) - areaEntry->area_level;
|
||||
int32 diff = int32(GetLevel()) - areaEntry->area_level;
|
||||
uint32 XP = 0;
|
||||
if (diff < -5)
|
||||
{
|
||||
XP = uint32(sObjectMgr->GetBaseXP(getLevel() + 5) * sWorld->getRate(RATE_XP_EXPLORE));
|
||||
XP = uint32(sObjectMgr->GetBaseXP(GetLevel() + 5) * sWorld->getRate(RATE_XP_EXPLORE));
|
||||
}
|
||||
else if (diff > 5)
|
||||
{
|
||||
@@ -5792,7 +5792,7 @@ float Player::CalculateReputationGain(ReputationSource source, uint32 creatureOr
|
||||
break;
|
||||
}
|
||||
|
||||
if (rate != 1.0f && creatureOrQuestLevel <= Acore::XP::GetGrayLevel(getLevel()))
|
||||
if (rate != 1.0f && creatureOrQuestLevel <= Acore::XP::GetGrayLevel(GetLevel()))
|
||||
percent *= rate;
|
||||
|
||||
if (percent <= 0.0f)
|
||||
@@ -5869,7 +5869,7 @@ void Player::RewardReputation(Unit* victim, float rate)
|
||||
|
||||
if (Rep->RepFaction1 && (!Rep->TeamDependent || teamId == TEAM_ALLIANCE))
|
||||
{
|
||||
float donerep1 = CalculateReputationGain(REPUTATION_SOURCE_KILL, victim->getLevel(), static_cast<float>(Rep->RepValue1), ChampioningFaction ? ChampioningFaction : Rep->RepFaction1);
|
||||
float donerep1 = CalculateReputationGain(REPUTATION_SOURCE_KILL, victim->GetLevel(), static_cast<float>(Rep->RepValue1), ChampioningFaction ? ChampioningFaction : Rep->RepFaction1);
|
||||
donerep1 *= rate;
|
||||
|
||||
FactionEntry const* factionEntry1 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->RepFaction1);
|
||||
@@ -5881,7 +5881,7 @@ void Player::RewardReputation(Unit* victim, float rate)
|
||||
|
||||
if (Rep->RepFaction2 && (!Rep->TeamDependent || teamId == TEAM_HORDE))
|
||||
{
|
||||
float donerep2 = CalculateReputationGain(REPUTATION_SOURCE_KILL, victim->getLevel(), static_cast<float>(Rep->RepValue2), ChampioningFaction ? ChampioningFaction : Rep->RepFaction2);
|
||||
float donerep2 = CalculateReputationGain(REPUTATION_SOURCE_KILL, victim->GetLevel(), static_cast<float>(Rep->RepValue2), ChampioningFaction ? ChampioningFaction : Rep->RepFaction2);
|
||||
donerep2 *= rate;
|
||||
|
||||
FactionEntry const* factionEntry2 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->RepFaction2);
|
||||
@@ -6011,9 +6011,9 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
||||
if (GetTeamId() == victim->GetTeamId() && !sWorld->IsFFAPvPRealm())
|
||||
return false;
|
||||
|
||||
uint8 k_level = getLevel();
|
||||
uint8 k_level = GetLevel();
|
||||
uint8 k_grey = Acore::XP::GetGrayLevel(k_level);
|
||||
uint8 v_level = victim->getLevel();
|
||||
uint8 v_level = victim->GetLevel();
|
||||
|
||||
if (v_level <= k_grey)
|
||||
return false;
|
||||
@@ -6103,7 +6103,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
||||
bg->UpdatePlayerScore(this, SCORE_BONUS_HONOR, honor, false); //false: prevent looping
|
||||
// Xinef: Only for BG activities
|
||||
if (!uVictim)
|
||||
GiveXP(uint32(honor * (3 + getLevel() * 0.30f)), nullptr);
|
||||
GiveXP(uint32(honor * (3 + GetLevel() * 0.30f)), nullptr);
|
||||
}
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_PVP_TOKEN_ENABLE))
|
||||
@@ -6492,7 +6492,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
|
||||
return;
|
||||
|
||||
// req. check at equip, but allow use for extended range if range limit max level, set proper level
|
||||
uint32 ssd_level = getLevel();
|
||||
uint32 ssd_level = GetLevel();
|
||||
uint32 CustomScalingStatValue = 0;
|
||||
|
||||
sScriptMgr->OnCustomScalingStatValueBefore(this, proto, slot, apply, CustomScalingStatValue);
|
||||
@@ -6684,7 +6684,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
|
||||
case ITEM_MOD_BLOCK_VALUE:
|
||||
HandleBaseModValue(SHIELD_BLOCK_VALUE, FLAT_MOD, float(val), apply);
|
||||
break;
|
||||
// deprecated item mods
|
||||
/// @deprecated item mods
|
||||
case ITEM_MOD_SPELL_HEALING_DONE:
|
||||
case ITEM_MOD_SPELL_DAMAGE_DONE:
|
||||
break;
|
||||
@@ -6790,7 +6790,7 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt
|
||||
ScalingStatDistributionEntry const* ssd = proto->ScalingStatDistribution ? sScalingStatDistributionStore.LookupEntry(proto->ScalingStatDistribution) : nullptr;
|
||||
|
||||
// req. check at equip, but allow use for extended range if range limit max level, set proper level
|
||||
uint32 ssd_level = getLevel();
|
||||
uint32 ssd_level = GetLevel();
|
||||
|
||||
if (ssd && ssd_level > ssd->MaxLevel)
|
||||
ssd_level = ssd->MaxLevel;
|
||||
@@ -7632,7 +7632,7 @@ void Player::RemovedInsignia(Player* looterPlr)
|
||||
|
||||
// We store the level of our player in the gold field
|
||||
// We retrieve this information at Player::SendLoot()
|
||||
bones->loot.gold = getLevel();
|
||||
bones->loot.gold = GetLevel();
|
||||
bones->lootRecipient = looterPlr;
|
||||
looterPlr->SendLoot(bones->GetGUID(), LOOT_INSIGNIA);
|
||||
}
|
||||
@@ -7883,8 +7883,8 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
|
||||
loot->FillLoot(lootid, LootTemplates_Pickpocketing, this, true);
|
||||
|
||||
// Generate extra money for pick pocket loot
|
||||
const uint32 a = urand(0, creature->getLevel() / 2);
|
||||
const uint32 b = urand(0, getLevel() / 2);
|
||||
const uint32 a = urand(0, creature->GetLevel() / 2);
|
||||
const uint32 b = urand(0, GetLevel() / 2);
|
||||
loot->gold = uint32(10 * (a + b) * sWorld->getRate(RATE_DROP_MONEY));
|
||||
permission = OWNER_PERMISSION;
|
||||
}
|
||||
@@ -8861,7 +8861,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
|
||||
pet->setPowerType(POWER_MANA);
|
||||
pet->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
|
||||
pet->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
pet->InitStatsForLevel(getLevel());
|
||||
pet->InitStatsForLevel(GetLevel());
|
||||
|
||||
SetMinion(pet, true);
|
||||
|
||||
@@ -9110,7 +9110,7 @@ Pet* Player::CreatePet(Creature* creatureTarget, uint32 spellID /*= 0*/)
|
||||
creatureTarget->DespawnOrUnsummon();
|
||||
|
||||
// calculate proper level
|
||||
uint8 level = (creatureTarget->getLevel() < (getLevel() - 5)) ? (getLevel() - 5) : getLevel();
|
||||
uint8 level = (creatureTarget->GetLevel() < (GetLevel() - 5)) ? (GetLevel() - 5) : GetLevel();
|
||||
|
||||
// prepare visual effect for levelup
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, level - 1);
|
||||
@@ -9154,13 +9154,13 @@ Pet* Player::CreatePet(uint32 creatureEntry, uint32 spellID /*= 0*/)
|
||||
}
|
||||
|
||||
// prepare visual effect for levelup
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, getLevel() - 1);
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, GetLevel() - 1);
|
||||
|
||||
// add to world
|
||||
pet->GetMap()->AddToMap(pet->ToCreature());
|
||||
|
||||
// visual effect for levelup
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, getLevel());
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, GetLevel());
|
||||
|
||||
// caster have pet now
|
||||
SetMinion(pet, true);
|
||||
@@ -9939,7 +9939,7 @@ void Player::LeaveAllArenaTeams(ObjectGuid guid)
|
||||
void Player::SetRestBonus(float rest_bonus_new)
|
||||
{
|
||||
// Prevent resting on max level
|
||||
if (getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
rest_bonus_new = 0;
|
||||
|
||||
if (rest_bonus_new < 0)
|
||||
@@ -11652,7 +11652,7 @@ void Player::LearnDefaultSkill(uint32 skillId, uint16 rank)
|
||||
}
|
||||
else if (getClass() == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
skillValue = std::min(std::max<uint16>({ 1, uint16((getLevel() - 1) * 5) }), maxValue);
|
||||
skillValue = std::min(std::max<uint16>({ 1, uint16((GetLevel() - 1) * 5) }), maxValue);
|
||||
}
|
||||
else if (skillId == SKILL_FIST_WEAPONS)
|
||||
{
|
||||
@@ -11685,7 +11685,7 @@ void Player::LearnDefaultSkill(uint32 skillId, uint16 rank)
|
||||
}
|
||||
else if (getClass() == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
skillValue = std::min(std::max<uint16>({ uint16(1), uint16((getLevel() - 1) * 5) }), maxValue);
|
||||
skillValue = std::min(std::max<uint16>({ uint16(1), uint16((GetLevel() - 1) * 5) }), maxValue);
|
||||
}
|
||||
|
||||
SetSkill(skillId, rank, skillValue, maxValue);
|
||||
@@ -12081,7 +12081,7 @@ bool Player::GetBGAccessByLevel(BattlegroundTypeId bgTypeId) const
|
||||
return false;
|
||||
|
||||
// limit check leel to dbc compatible level range
|
||||
uint32 level = getLevel();
|
||||
uint32 level = GetLevel();
|
||||
if (level > DEFAULT_MAX_LEVEL)
|
||||
level = DEFAULT_MAX_LEVEL;
|
||||
|
||||
@@ -12418,8 +12418,8 @@ uint32 Player::GetResurrectionSpellId()
|
||||
// Used in triggers for check "Only to targets that grant experience or honor" req
|
||||
bool Player::isHonorOrXPTarget(Unit* victim) const
|
||||
{
|
||||
uint8 v_level = victim->getLevel();
|
||||
uint8 k_grey = Acore::XP::GetGrayLevel(getLevel());
|
||||
uint8 v_level = victim->GetLevel();
|
||||
uint8 k_grey = Acore::XP::GetGrayLevel(GetLevel());
|
||||
|
||||
// Victim level less gray level
|
||||
if (v_level <= k_grey)
|
||||
@@ -12438,7 +12438,7 @@ bool Player::isHonorOrXPTarget(Unit* victim) const
|
||||
bool Player::GetsRecruitAFriendBonus(bool forXP)
|
||||
{
|
||||
bool recruitAFriend = false;
|
||||
if (getLevel() <= sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL) || !forXP)
|
||||
if (GetLevel() <= sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL) || !forXP)
|
||||
{
|
||||
if (Group* group = this->GetGroup())
|
||||
{
|
||||
@@ -12454,12 +12454,12 @@ bool Player::GetsRecruitAFriendBonus(bool forXP)
|
||||
if (forXP)
|
||||
{
|
||||
// level must be allowed to get RaF bonus
|
||||
if (player->getLevel() > sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL))
|
||||
if (player->GetLevel() > sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL))
|
||||
continue;
|
||||
|
||||
// level difference must be small enough to get RaF bonus, UNLESS we are lower level
|
||||
if (player->getLevel() < getLevel())
|
||||
if (uint8(getLevel() - player->getLevel()) > sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE))
|
||||
if (player->GetLevel() < GetLevel())
|
||||
if (uint8(GetLevel() - player->GetLevel()) > sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE))
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -12978,8 +12978,11 @@ bool Player::CanUseBattlegroundObject(GameObject* gameobject) const
|
||||
return false;
|
||||
}
|
||||
|
||||
// BUG: sometimes when player clicks on flag in AB - client won't send gameobject_use, only gameobject_report_use packet
|
||||
// Note: Mount, stealth and invisibility will be removed when used
|
||||
/**
|
||||
* @bug
|
||||
* sometimes when player clicks on flag in AB - client won't send gameobject_use, only gameobject_report_use packet
|
||||
* Note: Mount, stealth and invisibility will be removed when used
|
||||
*/
|
||||
return (!isTotalImmune() && // Damage immune
|
||||
!HasAura(SPELL_RECENTLY_DROPPED_FLAG) && // Still has recently held flag debuff
|
||||
IsAlive()); // Alive
|
||||
@@ -12995,7 +12998,7 @@ bool Player::CanCaptureTowerPoint() const
|
||||
|
||||
uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, BarberShopStyleEntry const* newSkin)
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
|
||||
if (level > GT_MAX_LEVEL)
|
||||
level = GT_MAX_LEVEL; // max level in this dbc
|
||||
@@ -13037,7 +13040,7 @@ void Player::InitGlyphsForLevel()
|
||||
if (gs->Order)
|
||||
SetGlyphSlot(gs->Order - 1, gs->Id);
|
||||
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
uint32 value = 0;
|
||||
|
||||
// 0x3F = 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 for 80 level
|
||||
@@ -13360,7 +13363,7 @@ LootItem* Player::StoreLootItem(uint8 lootSlot, Loot* loot, InventoryResult& msg
|
||||
|
||||
uint32 Player::CalculateTalentsPoints() const
|
||||
{
|
||||
uint32 base_talent = getLevel() < 10 ? 0 : getLevel() - 9;
|
||||
uint32 base_talent = GetLevel() < 10 ? 0 : GetLevel() - 9;
|
||||
|
||||
uint32 talentPointsForLevel = 0;
|
||||
if (getClass() != CLASS_DEATH_KNIGHT || GetMapId() != 609)
|
||||
@@ -13369,7 +13372,7 @@ uint32 Player::CalculateTalentsPoints() const
|
||||
}
|
||||
else
|
||||
{
|
||||
talentPointsForLevel = getLevel() < 56 ? 0 : getLevel() - 55;
|
||||
talentPointsForLevel = GetLevel() < 56 ? 0 : GetLevel() - 55;
|
||||
talentPointsForLevel += m_questRewardTalentCount;
|
||||
|
||||
if (talentPointsForLevel > base_talent)
|
||||
@@ -14433,7 +14436,7 @@ void Player::_SaveCharacter(bool create, CharacterDatabaseTransaction trans)
|
||||
stmt->SetData(index++, getRace(true));
|
||||
stmt->SetData(index++, getClass());
|
||||
stmt->SetData(index++, GetByteValue(PLAYER_BYTES_3, 0)); // save gender from PLAYER_BYTES_3, UNIT_BYTES_0 changes with every transform effect
|
||||
stmt->SetData(index++, getLevel());
|
||||
stmt->SetData(index++, GetLevel());
|
||||
stmt->SetData(index++, GetUInt32Value(PLAYER_XP));
|
||||
stmt->SetData(index++, GetMoney());
|
||||
stmt->SetData(index++, GetByteValue(PLAYER_BYTES, 0));
|
||||
@@ -14550,7 +14553,7 @@ void Player::_SaveCharacter(bool create, CharacterDatabaseTransaction trans)
|
||||
stmt->SetData(index++, getRace(true));
|
||||
stmt->SetData(index++, getClass());
|
||||
stmt->SetData(index++, GetByteValue(PLAYER_BYTES_3, 0)); // save gender from PLAYER_BYTES_3, UNIT_BYTES_0 changes with every transform effect
|
||||
stmt->SetData(index++, getLevel());
|
||||
stmt->SetData(index++, GetLevel());
|
||||
stmt->SetData(index++, GetUInt32Value(PLAYER_XP));
|
||||
stmt->SetData(index++, GetMoney());
|
||||
stmt->SetData(index++, GetByteValue(PLAYER_BYTES, 0));
|
||||
@@ -15459,7 +15462,7 @@ float Player::GetAverageItemLevel()
|
||||
{
|
||||
float sum = 0;
|
||||
uint32 count = 0;
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
|
||||
for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i)
|
||||
{
|
||||
@@ -15480,7 +15483,7 @@ float Player::GetAverageItemLevelForDF()
|
||||
{
|
||||
float sum = 0;
|
||||
uint32 count = 0;
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
|
||||
for (int i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i)
|
||||
{
|
||||
|
||||
@@ -1121,7 +1121,7 @@ public:
|
||||
PlayerSocial* GetSocial() { return m_social; }
|
||||
|
||||
PlayerTaxi m_taxi;
|
||||
void InitTaxiNodesForLevel() { m_taxi.InitTaxiNodesForLevel(getRace(), getClass(), getLevel()); }
|
||||
void InitTaxiNodesForLevel() { m_taxi.InitTaxiNodesForLevel(getRace(), getClass(), GetLevel()); }
|
||||
bool ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc = nullptr, uint32 spellid = 1);
|
||||
bool ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid = 1);
|
||||
void CleanupAfterTaxiFlight();
|
||||
@@ -1388,7 +1388,7 @@ public:
|
||||
/*** QUEST SYSTEM ***/
|
||||
/*********************************************************/
|
||||
|
||||
int32 GetQuestLevel(Quest const* quest) const { return quest && (quest->GetQuestLevel() > 0) ? quest->GetQuestLevel() : getLevel(); }
|
||||
int32 GetQuestLevel(Quest const* quest) const { return quest && (quest->GetQuestLevel() > 0) ? quest->GetQuestLevel() : GetLevel(); }
|
||||
|
||||
void PrepareQuestMenu(ObjectGuid guid);
|
||||
void SendPreparedQuest(ObjectGuid guid);
|
||||
|
||||
@@ -89,7 +89,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
|
||||
}
|
||||
case GOSSIP_OPTION_LEARNDUALSPEC:
|
||||
case GOSSIP_OPTION_DUALSPEC_INFO:
|
||||
if (!(GetSpecsCount() == 1 && creature->isCanTrainingAndResetTalentsOf(this) && !(getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))))
|
||||
if (!(GetSpecsCount() == 1 && creature->isCanTrainingAndResetTalentsOf(this) && !(GetLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))))
|
||||
canTalk = false;
|
||||
break;
|
||||
case GOSSIP_OPTION_UNLEARNTALENTS:
|
||||
@@ -332,7 +332,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
|
||||
GetSession()->SendTrainerList(guid);
|
||||
break;
|
||||
case GOSSIP_OPTION_LEARNDUALSPEC:
|
||||
if (GetSpecsCount() == 1 && getLevel() >= sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))
|
||||
if (GetSpecsCount() == 1 && GetLevel() >= sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))
|
||||
{
|
||||
// Cast spells that teach dual spec
|
||||
// Both are also ImplicitTarget self and must be cast by player
|
||||
|
||||
@@ -241,7 +241,7 @@ bool Player::CanSeeStartQuest(Quest const* quest)
|
||||
SatisfyQuestPrevChain(quest, false) && SatisfyQuestDay(quest, false) && SatisfyQuestWeek(quest, false) &&
|
||||
SatisfyQuestMonth(quest, false) && SatisfyQuestSeasonal(quest, false))
|
||||
{
|
||||
return getLevel() + sWorld->getIntConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF) >= quest->GetMinLevel();
|
||||
return GetLevel() + sWorld->getIntConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF) >= quest->GetMinLevel();
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -735,7 +735,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
bool rewarded = IsQuestRewarded(quest_id) && !quest->IsDFQuest();
|
||||
|
||||
// Not give XP in case already completed once repeatable quest
|
||||
uint32 XP = rewarded ? 0 : uint32(quest->XPValue(getLevel()) * GetQuestRate(quest->IsDFQuest()));
|
||||
uint32 XP = rewarded ? 0 : uint32(quest->XPValue(GetLevel()) * GetQuestRate(quest->IsDFQuest()));
|
||||
|
||||
// handle SPELL_AURA_MOD_XP_QUEST_PCT auras
|
||||
Unit::AuraEffectList const& ModXPPctAuras = GetAuraEffectsByType(SPELL_AURA_MOD_XP_QUEST_PCT);
|
||||
@@ -744,7 +744,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
|
||||
sScriptMgr->OnQuestComputeXP(this, quest, XP);
|
||||
int32 moneyRew = 0;
|
||||
if (getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(this))
|
||||
if (GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(this))
|
||||
{
|
||||
moneyRew = quest->GetRewMoneyMaxLevel();
|
||||
}
|
||||
@@ -754,7 +754,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
}
|
||||
|
||||
// Give player extra money if GetRewOrReqMoney > 0 and get ReqMoney if negative
|
||||
if (int32 rewOrReqMoney = quest->GetRewOrReqMoney(getLevel()))
|
||||
if (int32 rewOrReqMoney = quest->GetRewOrReqMoney(GetLevel()))
|
||||
{
|
||||
moneyRew += rewOrReqMoney;
|
||||
}
|
||||
@@ -768,7 +768,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
}
|
||||
|
||||
// honor reward
|
||||
if (uint32 honor = quest->CalculateHonorGain(getLevel()))
|
||||
if (uint32 honor = quest->CalculateHonorGain(GetLevel()))
|
||||
RewardHonor(nullptr, 0, honor);
|
||||
|
||||
// title reward
|
||||
@@ -957,13 +957,13 @@ bool Player::SatisfyQuestSkill(Quest const* qInfo, bool msg) const
|
||||
|
||||
bool Player::SatisfyQuestLevel(Quest const* qInfo, bool msg) const
|
||||
{
|
||||
if (getLevel() < qInfo->GetMinLevel())
|
||||
if (GetLevel() < qInfo->GetMinLevel())
|
||||
{
|
||||
if (msg)
|
||||
SendCanTakeQuestResponse(INVALIDREASON_QUEST_FAILED_LOW_LEVEL);
|
||||
return false;
|
||||
}
|
||||
else if (qInfo->GetMaxLevel() > 0 && getLevel() > qInfo->GetMaxLevel())
|
||||
else if (qInfo->GetMaxLevel() > 0 && GetLevel() > qInfo->GetMaxLevel())
|
||||
{
|
||||
if (msg)
|
||||
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ); // There doesn't seem to be a specific response for too high player level
|
||||
@@ -1656,7 +1656,7 @@ QuestGiverStatus Player::GetQuestDialogStatus(Object* questgiver)
|
||||
{
|
||||
if (SatisfyQuestLevel(quest, false))
|
||||
{
|
||||
bool isNotLowLevelQuest = getLevel() <= (GetQuestLevel(quest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF));
|
||||
bool isNotLowLevelQuest = GetLevel() <= (GetQuestLevel(quest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF));
|
||||
|
||||
if (quest->IsRepeatable())
|
||||
{
|
||||
@@ -2339,15 +2339,15 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP)
|
||||
WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4 + 4 + 4 + 4 + 4));
|
||||
data << uint32(questid);
|
||||
|
||||
if (getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (GetLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
data << uint32(XP);
|
||||
data << uint32(quest->GetRewOrReqMoney(getLevel()));
|
||||
data << uint32(quest->GetRewOrReqMoney(GetLevel()));
|
||||
}
|
||||
else
|
||||
{
|
||||
data << uint32(0);
|
||||
data << uint32(quest->GetRewOrReqMoney(getLevel()) + quest->GetRewMoneyMaxLevel());
|
||||
data << uint32(quest->GetRewOrReqMoney(GetLevel()) + quest->GetRewMoneyMaxLevel());
|
||||
}
|
||||
|
||||
data << uint32(10 * quest->CalculateHonorGain(GetQuestLevel(quest)));
|
||||
|
||||
@@ -1890,7 +1890,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16& dest, Item* pItem, bool
|
||||
|
||||
ScalingStatDistributionEntry const* ssd = pProto->ScalingStatDistribution ? sScalingStatDistributionStore.LookupEntry(pProto->ScalingStatDistribution) : 0;
|
||||
// check allowed level (extend range to upper values if MaxLevel more or equal max player level, this let GM set high level with 1...max range items)
|
||||
if (ssd && ssd->MaxLevel < DEFAULT_MAX_LEVEL && ssd->MaxLevel < getLevel())
|
||||
if (ssd && ssd->MaxLevel < DEFAULT_MAX_LEVEL && ssd->MaxLevel < GetLevel())
|
||||
return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
|
||||
|
||||
uint8 eslot = FindEquipSlot(pProto, slot, swap);
|
||||
@@ -2342,7 +2342,7 @@ InventoryResult Player::CanUseItem(ItemTemplate const* proto) const
|
||||
return EQUIP_ERR_NO_REQUIRED_PROFICIENCY;
|
||||
}
|
||||
|
||||
if (getLevel() < proto->RequiredLevel)
|
||||
if (GetLevel() < proto->RequiredLevel)
|
||||
{
|
||||
return EQUIP_ERR_CANT_EQUIP_LEVEL_I;
|
||||
}
|
||||
@@ -4348,7 +4348,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
|
||||
if (!ignore_condition && pEnchant->EnchantmentCondition && !EnchantmentFitsRequirements(pEnchant->EnchantmentCondition, -1))
|
||||
return;
|
||||
|
||||
if (pEnchant->requiredLevel > getLevel())
|
||||
if (pEnchant->requiredLevel > GetLevel())
|
||||
return;
|
||||
|
||||
if (pEnchant->requiredSkill > 0 && pEnchant->requiredSkillValue > GetSkillValue(pEnchant->requiredSkill))
|
||||
@@ -6737,9 +6737,9 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map
|
||||
|
||||
if (!sWorld->getBoolConfig(CONFIG_INSTANCE_IGNORE_LEVEL))
|
||||
{
|
||||
if (ar->levelMin && getLevel() < ar->levelMin)
|
||||
if (ar->levelMin && GetLevel() < ar->levelMin)
|
||||
LevelMin = ar->levelMin;
|
||||
if (ar->levelMax && getLevel() > ar->levelMax)
|
||||
if (ar->levelMax && GetLevel() > ar->levelMax)
|
||||
LevelMax = ar->levelMax;
|
||||
}
|
||||
|
||||
@@ -7758,7 +7758,7 @@ void Player::_SaveSpells(CharacterDatabaseTransaction trans)
|
||||
void Player::_SaveStats(CharacterDatabaseTransaction trans)
|
||||
{
|
||||
// check if stat saving is enabled and if char level is high enough
|
||||
if (!sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE) || getLevel() < sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE))
|
||||
if (!sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE) || GetLevel() < sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE))
|
||||
return;
|
||||
|
||||
CharacterDatabasePreparedStatement* stmt = nullptr;
|
||||
|
||||
@@ -980,7 +980,7 @@ void Player::UpdateWeaponSkill(Unit* victim, WeaponAttackType attType, Item* ite
|
||||
|
||||
void Player::UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool defence, Item* item /*= nullptr*/)
|
||||
{
|
||||
uint8 playerLevel = getLevel();
|
||||
uint8 playerLevel = GetLevel();
|
||||
uint16 currentSkillValue = defence ? GetBaseDefenseSkillValue() : GetBaseWeaponSkillValue(attType);
|
||||
uint16 currentSkillMax = 5 * playerLevel;
|
||||
int32 skillDiff = currentSkillMax - currentSkillValue;
|
||||
@@ -993,7 +993,7 @@ void Player::UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool def
|
||||
}
|
||||
|
||||
uint8 greylevel = Acore::XP::GetGrayLevel(playerLevel);
|
||||
uint8 moblevel = defence ? victim->getLevelForTarget(this) : victim->getLevel(); // if defense than victim == attacker
|
||||
uint8 moblevel = defence ? victim->getLevelForTarget(this) : victim->GetLevel(); // if defense than victim == attacker
|
||||
/*if (moblevel < greylevel)
|
||||
return;*/
|
||||
// Patch 3.0.8 (2009-01-20): You can no longer skill up weapons on mobs that are immune to damage.
|
||||
|
||||
@@ -242,7 +242,7 @@ void SocialMgr::GetFriendInfo(Player* player, ObjectGuid friendGUID, FriendInfo&
|
||||
if (pFriend->isDND())
|
||||
friendInfo.Status = FRIEND_STATUS_DND;
|
||||
friendInfo.Area = pFriend->GetZoneId();
|
||||
friendInfo.Level = pFriend->getLevel();
|
||||
friendInfo.Level = pFriend->GetLevel();
|
||||
friendInfo.Class = pFriend->getClass();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ void Totem::InitStats(uint32 duration)
|
||||
SetDisplayId(owner->GetModelForTotem(PlayerTotemType(m_Properties->Id)));
|
||||
}
|
||||
|
||||
SetLevel(owner->getLevel());
|
||||
SetLevel(owner->GetLevel());
|
||||
}
|
||||
|
||||
Minion::InitStats(duration);
|
||||
|
||||
@@ -330,7 +330,7 @@ void Player::ApplyFeralAPBonus(int32 amount, bool apply)
|
||||
void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
{
|
||||
float val2 = 0.0f;
|
||||
float level = float(getLevel());
|
||||
float level = float(GetLevel());
|
||||
|
||||
sScriptMgr->OnBeforeUpdateAttackPowerAndDamage(this, level, val2, ranged);
|
||||
|
||||
@@ -454,14 +454,14 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
switch (GetShapeshiftForm())
|
||||
{
|
||||
case FORM_CAT:
|
||||
val2 = (getLevel() * mLevelMult) + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) - 20.0f + weapon_bonus + m_baseFeralAP;
|
||||
val2 = (GetLevel() * mLevelMult) + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) - 20.0f + weapon_bonus + m_baseFeralAP;
|
||||
break;
|
||||
case FORM_BEAR:
|
||||
case FORM_DIREBEAR:
|
||||
val2 = (getLevel() * mLevelMult) + GetStat(STAT_STRENGTH) * 2.0f - 20.0f + weapon_bonus + m_baseFeralAP;
|
||||
val2 = (GetLevel() * mLevelMult) + GetStat(STAT_STRENGTH) * 2.0f - 20.0f + weapon_bonus + m_baseFeralAP;
|
||||
break;
|
||||
case FORM_MOONKIN:
|
||||
val2 = (getLevel() * mLevelMult) + GetStat(STAT_STRENGTH) * 2.0f - 20.0f + m_baseFeralAP;
|
||||
val2 = (GetLevel() * mLevelMult) + GetStat(STAT_STRENGTH) * 2.0f - 20.0f + m_baseFeralAP;
|
||||
break;
|
||||
default:
|
||||
val2 = GetStat(STAT_STRENGTH) * 2.0f - 20.0f;
|
||||
@@ -576,7 +576,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo
|
||||
|
||||
if (IsInFeralForm()) // check if player is druid and in cat or bear forms
|
||||
{
|
||||
uint8 lvl = getLevel();
|
||||
uint8 lvl = GetLevel();
|
||||
if (lvl > 60)
|
||||
lvl = 60;
|
||||
|
||||
|
||||
@@ -1707,7 +1707,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, CalcDamageInfo* damageInfo, Weapon
|
||||
damageInfo->HitInfo |= HITINFO_GLANCING;
|
||||
damageInfo->TargetState = VICTIMSTATE_HIT;
|
||||
damageInfo->procEx |= PROC_EX_NORMAL_HIT;
|
||||
int32 leveldif = int32(victim->getLevel()) - int32(getLevel());
|
||||
int32 leveldif = int32(victim->GetLevel()) - int32(GetLevel());
|
||||
if (leveldif > 3)
|
||||
leveldif = 3;
|
||||
float reducePercent = 1 - leveldif * 0.1f;
|
||||
@@ -1880,8 +1880,8 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
||||
float Probability = 20.0f;
|
||||
|
||||
// there is a newbie protection, at level 10 just 7% base chance; assuming linear function
|
||||
if (victim->getLevel() < 30)
|
||||
Probability = 0.65f * victim->getLevel() + 0.5f;
|
||||
if (victim->GetLevel() < 30)
|
||||
Probability = 0.65f * victim->GetLevel() + 0.5f;
|
||||
|
||||
uint32 VictimDefense = victim->GetDefenseSkillValue();
|
||||
uint32 AttackerMeleeSkill = GetUnitMeleeSkill();
|
||||
@@ -2036,10 +2036,10 @@ uint32 Unit::CalcArmorReducedDamage(Unit const* attacker, Unit const* victim, co
|
||||
}
|
||||
|
||||
float maxArmorPen = 0;
|
||||
if (victim->getLevel() < 60)
|
||||
maxArmorPen = float(400 + 85 * victim->getLevel());
|
||||
if (victim->GetLevel() < 60)
|
||||
maxArmorPen = float(400 + 85 * victim->GetLevel());
|
||||
else
|
||||
maxArmorPen = 400 + 85 * victim->getLevel() + 4.5f * 85 * (victim->getLevel() - 59);
|
||||
maxArmorPen = 400 + 85 * victim->GetLevel() + 4.5f * 85 * (victim->GetLevel() - 59);
|
||||
|
||||
// Cap armor penetration to this number
|
||||
maxArmorPen = std::min((armor + maxArmorPen) / 3, armor);
|
||||
@@ -2053,7 +2053,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit const* attacker, Unit const* victim, co
|
||||
if (armor < 0.0f)
|
||||
armor = 0.0f;
|
||||
|
||||
float levelModifier = attacker ? attacker->getLevel() : attackerLevel;
|
||||
float levelModifier = attacker ? attacker->GetLevel() : attackerLevel;
|
||||
if (levelModifier > 59)
|
||||
levelModifier = levelModifier + (4.5f * (levelModifier - 59));
|
||||
|
||||
@@ -2087,11 +2087,11 @@ float Unit::GetEffectiveResistChance(Unit const* owner, SpellSchoolMask schoolMa
|
||||
|
||||
victimResistance = std::max(victimResistance, 0.0f);
|
||||
if (owner)
|
||||
victimResistance += std::max((float(victim->getLevel()) - float(owner->getLevel())) * 5.0f, 0.0f);
|
||||
victimResistance += std::max((float(victim->GetLevel()) - float(owner->GetLevel())) * 5.0f, 0.0f);
|
||||
|
||||
static uint32 const BOSS_LEVEL = 83;
|
||||
static float const BOSS_RESISTANCE_CONSTANT = 510.0f;
|
||||
uint32 level = victim->getLevel();
|
||||
uint32 level = victim->GetLevel();
|
||||
float resistanceConstant = 0.0f;
|
||||
|
||||
if (level == BOSS_LEVEL)
|
||||
@@ -2872,7 +2872,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(Unit const* victim, WeaponAttackTy
|
||||
if (attType != RANGED_ATTACK &&
|
||||
(GetTypeId() == TYPEID_PLAYER || IsPet()) &&
|
||||
victim->GetTypeId() != TYPEID_PLAYER && !victim->IsPet() &&
|
||||
getLevel() < victim->getLevelForTarget(this))
|
||||
GetLevel() < victim->getLevelForTarget(this))
|
||||
{
|
||||
// cap possible value (with bonuses > max skill)
|
||||
int32 skill = attackerWeaponSkill;
|
||||
@@ -3001,7 +3001,7 @@ float Unit::CalculateLevelPenalty(SpellInfo const* spellProto) const
|
||||
if (spellProto->SpellLevel < 20)
|
||||
LvlPenalty = (20.0f - spellProto->SpellLevel) * 3.75f;
|
||||
|
||||
float LvlFactor = (float(spellProto->SpellLevel) + 6.0f) / float(getLevel());
|
||||
float LvlFactor = (float(spellProto->SpellLevel) + 6.0f) / float(GetLevel());
|
||||
if (LvlFactor > 1.0f)
|
||||
LvlFactor = 1.0f;
|
||||
|
||||
@@ -3110,7 +3110,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo
|
||||
int32 attackerWeaponSkill;
|
||||
// skill value for these spells (for example judgements) is 5* level
|
||||
if (spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED && !spellInfo->IsRangedWeaponSpell())
|
||||
attackerWeaponSkill = getLevel() * 5;
|
||||
attackerWeaponSkill = GetLevel() * 5;
|
||||
// bonus from skills is 0.04% per skill Diff
|
||||
else
|
||||
attackerWeaponSkill = int32(GetWeaponSkillValue(attType, victim));
|
||||
@@ -11436,7 +11436,7 @@ float Unit::SpellPctDamageModsDone(Unit* victim, SpellInfo const* spellProto, Da
|
||||
if (victim->HasAuraState(AURA_STATE_FROZEN, spellProto, this))
|
||||
{
|
||||
// Glyph of Ice Lance
|
||||
if (owner->HasAura(56377) && victim->getLevel() > owner->getLevel())
|
||||
if (owner->HasAura(56377) && victim->GetLevel() > owner->GetLevel())
|
||||
DoneTotalMod *= 4.0f;
|
||||
else
|
||||
DoneTotalMod *= 3.0f;
|
||||
@@ -17456,7 +17456,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget, uint32 spell_id)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint8 level = creatureTarget->getLevel() + 5 < getLevel() ? (getLevel() - 5) : creatureTarget->getLevel();
|
||||
uint8 level = creatureTarget->GetLevel() + 5 < GetLevel() ? (GetLevel() - 5) : creatureTarget->GetLevel();
|
||||
|
||||
if (!InitTamedPet(pet, level, spell_id))
|
||||
{
|
||||
@@ -17478,7 +17478,7 @@ Pet* Unit::CreateTamedPetFrom(uint32 creatureEntry, uint32 spell_id)
|
||||
|
||||
Pet* pet = new Pet(ToPlayer(), HUNTER_PET);
|
||||
|
||||
if (!pet->CreateBaseAtCreatureInfo(creatureInfo, this) || !InitTamedPet(pet, getLevel(), spell_id))
|
||||
if (!pet->CreateBaseAtCreatureInfo(creatureInfo, this) || !InitTamedPet(pet, GetLevel(), spell_id))
|
||||
{
|
||||
delete pet;
|
||||
return nullptr;
|
||||
@@ -20208,11 +20208,11 @@ void Unit::RewardRage(uint32 damage, uint32 weaponSpeedHitFactor, bool attacker)
|
||||
{
|
||||
float addRage;
|
||||
|
||||
float rageconversion = ((0.0091107836f * getLevel() * getLevel()) + 3.225598133f * getLevel()) + 4.2652911f;
|
||||
float rageconversion = ((0.0091107836f * GetLevel() * GetLevel()) + 3.225598133f * GetLevel()) + 4.2652911f;
|
||||
|
||||
// Unknown if correct, but lineary adjust rage conversion above level 70
|
||||
if (getLevel() > 70)
|
||||
rageconversion += 13.27f * (getLevel() - 70);
|
||||
if (GetLevel() > 70)
|
||||
rageconversion += 13.27f * (GetLevel() - 70);
|
||||
|
||||
if (attacker)
|
||||
{
|
||||
|
||||
@@ -1415,8 +1415,10 @@ public:
|
||||
[[nodiscard]] bool IsTotem() const { return m_unitTypeMask & UNIT_MASK_TOTEM; }
|
||||
[[nodiscard]] bool IsVehicle() const { return m_unitTypeMask & UNIT_MASK_VEHICLE; }
|
||||
|
||||
/// @deprecated Use GetLevel() instead!
|
||||
[[nodiscard]] uint8 getLevel() const { return uint8(GetUInt32Value(UNIT_FIELD_LEVEL)); }
|
||||
uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return getLevel(); }
|
||||
[[nodiscard]] uint8 GetLevel() const { return getLevel(); }
|
||||
uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return GetLevel(); }
|
||||
void SetLevel(uint8 lvl, bool showLevelChange = true);
|
||||
[[nodiscard]] uint8 getRace(bool original = false) const;
|
||||
void setRace(uint8 race);
|
||||
@@ -1542,7 +1544,7 @@ public:
|
||||
void Mount(uint32 mount, uint32 vehicleId = 0, uint32 creatureEntry = 0);
|
||||
void Dismount();
|
||||
|
||||
uint16 GetMaxSkillValueForLevel(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
|
||||
uint16 GetMaxSkillValueForLevel(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : GetLevel()) * 5; }
|
||||
static void DealDamageMods(Unit const* victim, uint32& damage, uint32* absorb);
|
||||
static uint32 DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage const* cleanDamage = nullptr, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = nullptr, bool durabilityLoss = true, bool allowGM = false, Spell const* spell = nullptr);
|
||||
static void Kill(Unit* killer, Unit* victim, bool durabilityLoss = true, WeaponAttackType attackType = BASE_ATTACK, SpellInfo const* spellProto = nullptr, Spell const* spell = nullptr);
|
||||
@@ -1630,7 +1632,7 @@ public:
|
||||
|
||||
return value;
|
||||
}
|
||||
uint32 GetUnitMeleeSkill(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
|
||||
uint32 GetUnitMeleeSkill(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : GetLevel()) * 5; }
|
||||
uint32 GetDefenseSkillValue(Unit const* target = nullptr) const;
|
||||
uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = nullptr) const;
|
||||
[[nodiscard]] float GetWeaponProcChance() const;
|
||||
|
||||
Reference in New Issue
Block a user