diff --git a/src/server/game/AI/PlayerAI/PlayerAI.cpp b/src/server/game/AI/PlayerAI/PlayerAI.cpp index 454537e7b52..b4854736491 100644 --- a/src/server/game/AI/PlayerAI/PlayerAI.cpp +++ b/src/server/game/AI/PlayerAI/PlayerAI.cpp @@ -467,7 +467,7 @@ bool PlayerAI::IsPlayerHealer(Player const* who) if (!who) return false; - switch (who->getClass()) + switch (who->GetClass()) { case CLASS_WARRIOR: case CLASS_HUNTER: @@ -493,7 +493,7 @@ bool PlayerAI::IsPlayerRangedAttacker(Player const* who) if (!who) return false; - switch (who->getClass()) + switch (who->GetClass()) { case CLASS_WARRIOR: case CLASS_PALADIN: @@ -748,7 +748,7 @@ PlayerAI::TargetedSpell SimpleCharmedPlayerAI::SelectAppropriateCastForSpec() { PossibleSpellVector spells; - switch (me->getClass()) + switch (me->GetClass()) { case CLASS_WARRIOR: if (!me->IsWithinMeleeRange(me->GetVictim())) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index fd4aee50d53..512413aeeb6 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -838,7 +838,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (e.action.fleeAssist.withEmote) { - Trinity::BroadcastTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, BROADCAST_TEXT_FLEE_FOR_ASSIST, me->getGender()); + Trinity::BroadcastTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, BROADCAST_TEXT_FLEE_FOR_ASSIST, me->GetGender()); sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE); } TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature %u DoFleeToGetAssistance", me->GetGUID().GetCounter()); @@ -1072,7 +1072,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->CallForHelp(float(e.action.callHelp.range)); if (e.action.callHelp.withEmote) { - Trinity::BroadcastTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, BROADCAST_TEXT_CALL_FOR_HELP, me->getGender()); + Trinity::BroadcastTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, BROADCAST_TEXT_CALL_FOR_HELP, me->GetGender()); sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE); } TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature %u", me->GetGUID().GetCounter()); @@ -2024,7 +2024,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { for (WorldObject* target : targets) if (IsCreature(target)) - target->ToCreature()->setRegeneratingHealth(e.action.setHealthRegen.regenHealth != 0); + target->ToCreature()->SetRegenerateHealth(e.action.setHealthRegen.regenHealth != 0); break; } diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 08558411f39..ddf7ccd020d 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -293,17 +293,17 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Wo case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE: if (!target || target->GetTypeId() != TYPEID_PLAYER) return false; - if (classRace.class_id && classRace.class_id != target->ToPlayer()->getClass()) + if (classRace.class_id && classRace.class_id != target->ToPlayer()->GetClass()) return false; - if (classRace.race_id && classRace.race_id != target->ToPlayer()->getRace()) + if (classRace.race_id && classRace.race_id != target->ToPlayer()->GetRace()) return false; return true; case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE: if (source->GetTypeId() != TYPEID_PLAYER) return false; - if (classRace.class_id && classRace.class_id != source->ToPlayer()->getClass()) + if (classRace.class_id && classRace.class_id != source->ToPlayer()->GetClass()) return false; - if (classRace.race_id && classRace.race_id != source->ToPlayer()->getRace()) + if (classRace.race_id && classRace.race_id != source->ToPlayer()->GetRace()) return false; return true; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH: @@ -326,7 +326,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Wo case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL: if (!target || !target->IsUnit()) return false; - return target->ToUnit()->getLevel() >= level.minlevel; + return target->ToUnit()->GetLevel() >= level.minlevel; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER: { if (!target) @@ -334,7 +334,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Wo Unit const* unitTarget = target->ToUnit(); if (!unitTarget) return false; - return unitTarget->getGender() == gender.gender; + return unitTarget->GetGender() == gender.gender; } case ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT: { @@ -677,7 +677,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, P // title achievement rewards are retroactive if (AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement)) - if (uint32 titleId = reward->TitleID[Player::TeamForRace(GetOwner()->getRace()) == ALLIANCE ? 0 : 1]) + if (uint32 titleId = reward->TitleID[Player::TeamForRace(GetOwner()->GetRace()) == ALLIANCE ? 0 : 1]) if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(titleId)) GetOwner()->SetTitle(titleEntry); @@ -860,7 +860,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievemen if (Guild* guild = sGuildMgr->GetGuildById(GetOwner()->GetGuildId())) { - Trinity::BroadcastTextBuilder _builder(GetOwner(), CHAT_MSG_GUILD_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, GetOwner()->getGender(), _owner, achievement->ID); + Trinity::BroadcastTextBuilder _builder(GetOwner(), CHAT_MSG_GUILD_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, GetOwner()->GetGender(), _owner, achievement->ID); Trinity::LocalizedPacketDo _localizer(_builder); guild->BroadcastWorker(_localizer, GetOwner()); } @@ -878,7 +878,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievemen // if player is in world he can tell his friends about new achievement else if (GetOwner()->IsInWorld()) { - Trinity::BroadcastTextBuilder _builder(GetOwner(), CHAT_MSG_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, GetOwner()->getGender(), _owner, achievement->ID); + Trinity::BroadcastTextBuilder _builder(GetOwner(), CHAT_MSG_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, GetOwner()->GetGender(), _owner, achievement->ID); Trinity::LocalizedPacketDo _localizer(_builder); Trinity::PlayerDistWorker> _worker(GetOwner(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), _localizer); Cell::VisitWorldObjects(GetOwner(), _worker, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY)); @@ -1263,7 +1263,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_HIGHEST); break; case ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL: - SetCriteriaProgress(achievementCriteria, referencePlayer->getLevel(), referencePlayer); + SetCriteriaProgress(achievementCriteria, referencePlayer->GetLevel(), referencePlayer); break; case ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL: if (uint32 skillvalue = referencePlayer->GetBaseSkillValue(achievementCriteria->Asset.SkillID)) @@ -2877,19 +2877,19 @@ bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_RACE: // 25 - if (referencePlayer->getRace() != reqValue) + if (referencePlayer->GetRace() != reqValue) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_CLASS: // 26 - if (referencePlayer->getClass() != reqValue) + if (referencePlayer->GetClass() != reqValue) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_RACE: // 27 - if (!ref || !ref->IsUnit() || ref->ToUnit()->getRace() != reqValue) + if (!ref || !ref->IsUnit() || ref->ToUnit()->GetRace() != reqValue) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CLASS: // 28 - if (!ref || !ref->IsUnit() || ref->ToUnit()->getClass() != reqValue) + if (!ref || !ref->IsUnit() || ref->ToUnit()->GetClass() != reqValue) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAX_GROUP_MEMBERS: // 29 @@ -2936,11 +2936,11 @@ bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_LEVEL: // 39 - if (referencePlayer->getLevel() != reqValue) + if (referencePlayer->GetLevel() != reqValue) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_LEVEL: // 40 - if (!ref || !ref->IsUnit() || ref->ToUnit()->getLevel() != reqValue) + if (!ref || !ref->IsUnit() || ref->ToUnit()->GetLevel() != reqValue) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_ZONE: // 41 diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index f8d0fe9704a..b9cabadbb54 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -268,7 +268,7 @@ void Battlefield::InvitePlayerToWar(Player* player) return; // If the player does not match minimal level requirements for the battlefield, kick him - if (player->getLevel() < m_MinLevel) + if (player->GetLevel() < m_MinLevel) { if (m_PlayersWillBeKick[player->GetTeamId()].count(player->GetGUID()) == 0) m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = GameTime::GetGameTime() + 10; diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index 4059faa8f87..09585478ac0 100644 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -103,7 +103,7 @@ bool ArenaTeam::AddMember(ObjectGuid playerGuid) Player* player = ObjectAccessor::FindPlayer(playerGuid); if (player) { - playerClass = player->getClass(); + playerClass = player->GetClass(); playerName = player->GetName(); } else @@ -442,7 +442,7 @@ void ArenaTeam::Roster(WorldSession* session) data << uint8((player ? 1 : 0)); // online flag data << itr->Name; // member name data << uint32((itr->Guid == GetCaptain() ? 0 : 1)); // captain flag 0 captain 1 member - data << uint8((player ? player->getLevel() : 0)); // unknown, level? + data << uint8((player ? player->GetLevel() : 0)); // unknown, level? data << uint8(itr->Class); // class data << uint32(itr->WeekGames); // played this week data << uint32(itr->WeekWins); // wins this week diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 686e400ca03..bd4f487ccd0 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -893,7 +893,7 @@ void BattlegroundMgr::SendBattlegroundList(ObjectGuid guid, Player* player, Batt BattlegroundDataContainer::iterator it = bgDataStore.find(bgTypeId); if (it != bgDataStore.end()) { - PvPDifficultyEntry const* bracketEntry = sDBCManager.GetBattlegroundBracketByLevel(it->second.m_Battlegrounds.begin()->second->GetMapId(), player->getLevel()); + PvPDifficultyEntry const* bracketEntry = sDBCManager.GetBattlegroundBracketByLevel(it->second.m_Battlegrounds.begin()->second->GetMapId(), player->GetLevel()); if (bracketEntry) { BattlegroundBracketId bracketId = bracketEntry->GetBracketId(); diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index 9f5fc6c3c01..c26ac145e4f 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -439,7 +439,7 @@ void CalendarMgr::SendCalendarEventInvite(CalendarInvite const& invite) ObjectGuid invitee = invite.GetInviteeGUID(); Player* player = ObjectAccessor::FindConnectedPlayer(invitee); - uint8 level = player ? player->getLevel() : sCharacterCache->GetCharacterLevelByGuid(invitee); + uint8 level = player ? player->GetLevel() : sCharacterCache->GetCharacterLevelByGuid(invitee); WorldPacket data(SMSG_CALENDAR_EVENT_INVITE, 8 + 8 + 8 + 1 + 1 + 1 + (statusTime ? 4 : 0) + 1); data << invitee.WriteAsPacked(); @@ -591,7 +591,7 @@ void CalendarMgr::SendCalendarEvent(ObjectGuid guid, CalendarEvent const& calend ObjectGuid inviteeGuid = calendarInvite->GetInviteeGUID(); Player* invitee = ObjectAccessor::FindPlayer(inviteeGuid); - uint8 inviteeLevel = invitee ? invitee->getLevel() : sCharacterCache->GetCharacterLevelByGuid(inviteeGuid); + uint8 inviteeLevel = invitee ? invitee->GetLevel() : sCharacterCache->GetCharacterLevelByGuid(inviteeGuid); ObjectGuid::LowType inviteeGuildId = invitee ? invitee->GetGuildId() : sCharacterCache->GetCharacterGuildIdByGuid(inviteeGuid); data << inviteeGuid.WriteAsPacked(); diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 15993d233a5..714a8158df6 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -272,19 +272,19 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const case CONDITION_CLASS: { if (Unit* unit = object->ToUnit()) - condMeets = (unit->getClassMask() & ConditionValue1) != 0; + condMeets = (unit->GetClassMask() & ConditionValue1) != 0; break; } case CONDITION_RACE: { if (Unit* unit = object->ToUnit()) - condMeets = (unit->getRaceMask() & ConditionValue1) != 0; + condMeets = (unit->GetRaceMask() & ConditionValue1) != 0; break; } case CONDITION_GENDER: { if (Player* player = object->ToPlayer()) - condMeets = player->getGender() == ConditionValue1; + condMeets = player->GetGender() == ConditionValue1; break; } case CONDITION_SKILL: @@ -338,7 +338,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const case CONDITION_LEVEL: { if (Unit* unit = object->ToUnit()) - condMeets = CompareValues(static_cast(ConditionValue2), static_cast(unit->getLevel()), ConditionValue1); + condMeets = CompareValues(static_cast(ConditionValue2), static_cast(unit->GetLevel()), ConditionValue1); break; } case CONDITION_DRUNKENSTATE: diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 9eab3973ed0..cf65783f355 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -482,11 +482,11 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const joinData.result = LFG_JOIN_NOT_MEET_REQS; else if (player->HasAura(9454)) // check Freeze debuff joinData.result = LFG_JOIN_NOT_MEET_REQS; - else if (!CanPerformSelectedRoles(player->getClass(), roles)) + else if (!CanPerformSelectedRoles(player->GetClass(), roles)) joinData.result = LFG_JOIN_INTERNAL_ERROR; else if (grp) { - if (grp->GetMembersCount() > MAXGROUPSIZE) + if (grp->GetMembersCount() > MAX_GROUP_SIZE) joinData.result = LFG_JOIN_TOO_MUCH_MEMBERS; else { @@ -1574,7 +1574,7 @@ void LFGMgr::FinishDungeon(ObjectGuid gguid, const uint32 dungeonId, Map const* if (dungeon->difficulty == DUNGEON_DIFFICULTY_HEROIC) player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS, 1); - LfgReward const* reward = GetRandomDungeonReward(rDungeonId, player->getLevel()); + LfgReward const* reward = GetRandomDungeonReward(rDungeonId, player->GetLevel()); if (!reward) continue; @@ -1781,7 +1781,7 @@ LfgLockMap const LFGMgr::GetLockedDungeons(ObjectGuid guid) return lock; } - uint8 level = player->getLevel(); + uint8 level = player->GetLevel(); uint8 expansion = player->GetSession()->GetExpansion(); LfgDungeonSet const& dungeons = GetDungeonsByRandom(0); bool denyJoin = !player->GetSession()->HasPermission(rbac::RBAC_PERM_JOIN_DUNGEON_FINDER); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 5df35840979..3ae05af9df0 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1234,13 +1234,13 @@ bool Creature::isCanInteractWithBattleMaster(Player* player, bool msg) const bool Creature::CanResetTalents(Player* player) const { - return player->getLevel() >= 10 - && player->getClass() == GetCreatureTemplate()->trainer_class; + return player->GetLevel() >= 10 + && player->GetClass() == GetCreatureTemplate()->trainer_class; } bool Creature::IsClassTrainerOf(Player const* player) const { - return player->getClass() == GetCreatureTemplate()->trainer_class; + return player->GetClass() == GetCreatureTemplate()->trainer_class; } Player* Creature::GetLootRecipient() const @@ -1440,7 +1440,7 @@ void Creature::UpdateLevelDependantStats() { CreatureTemplate const* cInfo = GetCreatureTemplate(); uint32 rank = IsPet() ? 0 : cInfo->rank; - CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(getLevel(), cInfo->unit_class); + CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(GetLevel(), cInfo->unit_class); // health float healthmod = _GetHealthMod(rank); @@ -1461,7 +1461,7 @@ void Creature::UpdateLevelDependantStats() SetStatPctModifier(UnitMods(UNIT_MOD_POWER_START + AsUnderlyingType(powerType)), BASE_PCT, cInfo->ModMana * cInfo->ModManaExtra); SetPowerType(powerType); - switch (getClass()) + switch (GetClass()) { case UNIT_CLASS_PALADIN: case UNIT_CLASS_MAGE: @@ -1913,8 +1913,8 @@ float Creature::GetAttackDistance(Unit const* player) const float aggroRate = sWorld->getRate(RATE_CREATURE_AGGRO); uint8 expansionMaxLevel = uint8(DBCManager::GetMaxLevelForExpansion(GetCreatureTemplate()->expansion)); - uint32 playerLevel = player->getLevel(); - uint32 creatureLevel = getLevel(); + uint32 playerLevel = player->GetLevel(); + uint32 creatureLevel = GetLevel(); if (aggroRate == 0.0f) return 0.0f; @@ -2803,7 +2803,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) diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 2f3293f6fcf..fcb6a92a087 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -290,7 +290,7 @@ class TC_GAME_API Creature : public Unit, public GridObject, public Ma bool hasInvolvedQuest(uint32 quest_id) const override; bool isRegeneratingHealth() { return m_regenHealth; } - void setRegeneratingHealth(bool regenHealth) { m_regenHealth = regenHealth; } + void SetRegenerateHealth(bool regenHealth) { m_regenHealth = regenHealth; } virtual uint8 GetPetAutoSpellSize() const { return MAX_SPELL_CHARM; } virtual uint32 GetPetAutoSpellOnPos(uint8 pos) const; float GetPetChaseDistance() const; diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index b644a69faf1..1706b111c3a 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.cpp +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp @@ -172,7 +172,7 @@ void TempSummon::InitStats(uint32 duration) if (owner && IsTrigger() && m_spells[0]) { SetFaction(owner->GetFaction()); - SetLevel(owner->getLevel()); + SetLevel(owner->GetLevel()); if (owner->GetTypeId() == TYPEID_PLAYER) m_ControlledByPlayer = true; } @@ -392,7 +392,7 @@ void Guardian::InitStats(uint32 duration) { Minion::InitStats(duration); - InitStatsForLevel(GetOwner()->getLevel()); + InitStatsForLevel(GetOwner()->GetLevel()); if (GetOwner()->GetTypeId() == TYPEID_PLAYER && HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN)) m_charmInfo->InitCharmCreateSpells(); @@ -422,7 +422,7 @@ Puppet::Puppet(SummonPropertiesEntry const* properties, Unit* owner) void Puppet::InitStats(uint32 duration) { Minion::InitStats(duration); - SetLevel(GetOwner()->getLevel()); + SetLevel(GetOwner()->GetLevel()); SetReactState(REACT_PASSIVE); } diff --git a/src/server/game/Entities/Creature/Trainer.cpp b/src/server/game/Entities/Creature/Trainer.cpp index 41ab624a75a..a8efdf96471 100644 --- a/src/server/game/Entities/Creature/Trainer.cpp +++ b/src/server/game/Entities/Creature/Trainer.cpp @@ -70,7 +70,7 @@ namespace Trainer trainerListSpell.Usable = AsUnderlyingType(GetSpellState(player, &trainerSpell)); trainerListSpell.MoneyCost = int32(trainerSpell.MoneyCost * reputationDiscount); - if (_type != Type::Class || (_type == Type::Class && player->getLevel() < trainerSpell.ReqLevel)) + if (_type != Type::Class || (_type == Type::Class && player->GetLevel() < trainerSpell.ReqLevel)) trainerListSpell.ReqLevel = trainerSpell.ReqLevel; trainerListSpell.ReqSkillLine = trainerSpell.ReqSkillLine; @@ -166,7 +166,7 @@ namespace Trainer return SpellState::Unavailable; // check level requirement - if (player->getLevel() < trainerSpell->ReqLevel) + if (player->GetLevel() < trainerSpell->ReqLevel) return SpellState::Unavailable; // check ranks @@ -214,10 +214,10 @@ namespace Trainer case Type::Class: case Type::Pet: // check class for class trainers - return player->getClass() == GetTrainerRequirement(); + return player->GetClass() == GetTrainerRequirement(); case Type::Mount: // check race for mount trainers - return player->getRace() == GetTrainerRequirement(); + return player->GetRace() == GetTrainerRequirement(); case Type::Tradeskill: // check spell for profession trainers return player->HasSpell(GetTrainerRequirement()); diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index d64df0ac825..8d810fce0d2 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -1664,7 +1664,7 @@ uint8 GameObject::getLevelForTarget(WorldObject const* target) const if (GetGOInfo()->trap.Unused != 0) return GetGOInfo()->trap.Unused; if (const Unit* targetUnit = target->ToUnit()) - return targetUnit->getLevel(); + return targetUnit->GetLevel(); } return 1; @@ -2329,10 +2329,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; diff --git a/src/server/game/Entities/Item/ItemTemplate.cpp b/src/server/game/Entities/Item/ItemTemplate.cpp index 835ca17b448..f0d6fe6efdf 100644 --- a/src/server/game/Entities/Item/ItemTemplate.cpp +++ b/src/server/game/Entities/Item/ItemTemplate.cpp @@ -193,7 +193,7 @@ uint32 ItemTemplate::GetStatValue(uint32 index, Player const* owner /*= nullptr* ScalingStatDistributionEntry const* ssd = GetScalingStatDistribution() ? sScalingStatDistributionStore.LookupEntry(GetScalingStatDistribution()) : nullptr; // req. check at equip, but allow use for extended range if range limit max level, set proper level - uint32 ssdLevel = owner->getLevel(); + uint32 ssdLevel = owner->GetLevel(); if (ssd && ssdLevel > ssd->Maxlevel) ssdLevel = ssd->Maxlevel; diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index b6c0f7ab14a..d7e65d4bd8b 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2277,7 +2277,7 @@ Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint3 if (GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT) { summon->SetFaction(((Unit*)this)->GetFaction()); - summon->SetLevel(((Unit*)this)->getLevel()); + summon->SetLevel(((Unit*)this)->GetLevel()); } if (GetAI) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index dbae9d9c428..a98e5cee179 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -197,7 +197,7 @@ bool Pet::LoadPetData(Player* owner, uint32 petEntry, uint32 petnumber, bool cur switch (getPetType()) { case SUMMON_PET: - petlevel = owner->getLevel(); + petlevel = owner->GetLevel(); SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS, uint8(CLASS_MAGE)); SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); break; @@ -415,7 +415,7 @@ void Pet::SavePetToDB(PetSaveMode mode) stmt->setUInt32(1, GetEntry()); stmt->setUInt64(2, ownerLowGUID); stmt->setUInt32(3, GetNativeDisplayId()); - stmt->setUInt8(4, getLevel()); + stmt->setUInt8(4, GetLevel()); stmt->setUInt32(5, GetUInt32Value(UNIT_FIELD_PETEXPERIENCE)); stmt->setUInt8(6, GetReactState()); stmt->setInt16(7, m_petSlot); @@ -441,7 +441,7 @@ void Pet::SavePetToDB(PetSaveMode mode) playerPetData->CreatureId = GetEntry(); playerPetData->Owner = ownerLowGUID; playerPetData->DisplayId = GetNativeDisplayId(); - playerPetData->Petlevel = getLevel(); + playerPetData->Petlevel = GetLevel(); playerPetData->PetExp = GetUInt32Value(UNIT_FIELD_PETEXPERIENCE); playerPetData->Reactstate = GetReactState(); playerPetData->Slot = m_petSlot; @@ -593,8 +593,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) @@ -621,7 +621,7 @@ void Pet::GivePetXP(uint32 xp) void Pet::GivePetLevel(uint8 level) { - if (!level || level == getLevel()) + if (!level || level == GetLevel()) return; if (!IsHunterPet()) @@ -691,7 +691,7 @@ bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map) SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0); SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0); - SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(getLevel()+1)*PET_XP_FACTOR)); + SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(GetLevel()+1)*PET_XP_FACTOR)); SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); if (cinfo->type == CREATURE_TYPE_BEAST) @@ -717,7 +717,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) PetType petType = MAX_PET_TYPE; if (IsPet() && GetOwner()->GetTypeId() == TYPEID_PLAYER) { - switch (m_owner->getClass()) + switch (m_owner->GetClass()) { case CLASS_WARLOCK: case CLASS_SHAMAN: @@ -732,7 +732,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) break; default: TC_LOG_ERROR("entities.pet", "Unknown type pet %u is summoned by player class %u", - GetEntry(), GetOwner()->getClass()); + GetEntry(), GetOwner()->GetClass()); break; } } @@ -1024,13 +1024,13 @@ bool Pet::HaveInDiet(ItemTemplate const* item) const uint32 Pet::GetCurrentFoodBenefitLevel(uint32 itemlevel) const { // -10 or greater food level - if (getLevel() <= itemlevel + 10) // possible to feed level 85 pet with ilevel 75 level food for full effect + if (GetLevel() <= itemlevel + 10) // possible to feed level 85 pet with ilevel 75 level food for full effect return 50; // -10 to -20 - else if (getLevel() <= itemlevel + 20) + else if (GetLevel() <= itemlevel + 20) return 25; // -20 to -30 - else if (getLevel() <= itemlevel + 30) + else if (GetLevel() <= itemlevel + 30) return 13; // -30 or more difference else @@ -1390,7 +1390,7 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel uint32 talentCost = sDBCManager.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; @@ -1417,7 +1417,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) { @@ -1493,7 +1493,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); } @@ -1559,7 +1559,7 @@ bool Pet::resetTalents() if (!pet_family || pet_family->PetTalentType < 0) return false; - uint8 level = getLevel(); + uint8 level = GetLevel(); uint32 talentPointsForLevel = GetMaxTalentPointsForLevel(level); if (m_usedTalentCount == 0) @@ -1697,7 +1697,7 @@ void Pet::resetTalentsForAllPetsOf(Player* /*owner*/, Pet* /*onlinePet*/ /*= nul void Pet::InitTalentForLevel() { - uint8 level = getLevel(); + uint8 level = GetLevel(); uint32 talentPointsForLevel = GetMaxTalentPointsForLevel(level); // Reset talents in case low level (on level down) or wrong points for level (hunter can unlearn TP increase talent) if (talentPointsForLevel == 0 || m_usedTalentCount > talentPointsForLevel) @@ -1771,7 +1771,7 @@ bool Pet::IsPermanentPetFor(Player* owner) const switch (getPetType()) { case SUMMON_PET: - switch (owner->getClass()) + switch (owner->GetClass()) { case CLASS_WARLOCK: return GetCreatureTemplate()->type == CREATURE_TYPE_DEMON; @@ -1909,7 +1909,7 @@ void Pet::SynchronizeLevelWithOwner() // always same level case SUMMON_PET: case HUNTER_PET: - GivePetLevel(owner->getLevel()); + GivePetLevel(owner->GetLevel()); break; default: break; @@ -1935,7 +1935,7 @@ float Pet::GetNativeObjectScale() const scale = 1.f; float minScaleLevel = creatureFamily->MinScaleLevel; - uint8 level = getLevel(); + uint8 level = GetLevel(); float minLevelScaleMod = level >= minScaleLevel ? level - minScaleLevel : 0.f; float maxScaleMod = creatureFamily->MaxScaleLevel - minScaleLevel; diff --git a/src/server/game/Entities/Player/KillRewarder.cpp b/src/server/game/Entities/Player/KillRewarder.cpp index a5637b37e38..aa37d1151de 100644 --- a/src/server/game/Entities/Player/KillRewarder.cpp +++ b/src/server/game/Entities/Player/KillRewarder.cpp @@ -95,7 +95,7 @@ inline void KillRewarder::_InitGroupData() if (Player* member = itr->GetSource()) if (_killer == member || (member->IsAtGroupRewardDistance(_victim) && member->IsAlive())) { - const uint8 lvl = member->getLevel(); + const uint8 lvl = member->GetLevel(); // 2.1. _count - number of alive group members within reward distance; ++_count; // 2.2. _sumLevel - sum of levels of alive group members within reward distance; @@ -106,12 +106,12 @@ inline void KillRewarder::_InitGroupData() // 2.4. _maxNotGrayMember - maximum level of alive group member within reward distance, // for whom victim is not gray; uint32 grayLevel = Trinity::XP::GetGrayLevel(lvl); - if (_victim->getLevel() > grayLevel && (!_maxNotGrayMember || _maxNotGrayMember->getLevel() < lvl)) + if (_victim->GetLevel() > grayLevel && (!_maxNotGrayMember || _maxNotGrayMember->GetLevel() < lvl)) _maxNotGrayMember = member; } // 2.5. _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; @@ -144,7 +144,7 @@ inline 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. @@ -199,7 +199,7 @@ void KillRewarder::_RewardPlayer(Player* player, bool isDungeon) if (!_isPvP || _isBattleGround) { float const rate = _group ? - _groupRate * float(player->getLevel()) / _sumLevel : // Group rate depends on summary level. + _groupRate * float(player->GetLevel()) / _sumLevel : // Group rate depends on summary level. 1.0f; // Personal rate is 100%. if (_xp) { diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 038bac126df..7837fca654f 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -493,7 +493,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0); // set starting level - uint32 start_level = getClass() != CLASS_DEATH_KNIGHT + uint32 start_level = GetClass() != CLASS_DEATH_KNIGHT ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL) : sWorld->getIntConfig(CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL); @@ -565,7 +565,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo switch (iProto->Effects[0].Category) { case SPELL_CATEGORY_FOOD: // food - count = getClass() == CLASS_DEATH_KNIGHT ? 10 : 4; + count = GetClass() == CLASS_DEATH_KNIGHT ? 10 : 4; break; case SPELL_CATEGORY_DRINK: // drink count = 2; @@ -650,7 +650,7 @@ bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount) // item can't be added TC_LOG_ERROR("entities.player.items", "Player::StoreNewItemInBestSlots: Player '%s' (%s) can't equip or store initial item (ItemID: %u, Race: %u, Class: %u, InventoryResult: %u)", - GetName().c_str(), GetGUID().ToString().c_str(), titem_id, getRace(), getClass(), msg); + GetName().c_str(), GetGUID().ToString().c_str(), titem_id, GetRace(), GetClass(), msg); return false; } @@ -805,7 +805,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 @@ -841,7 +841,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 (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) // Teleport ghost to graveyard @@ -1254,7 +1254,7 @@ void Player::Update(uint32 p_time) } } - if (getClass() == CLASS_DEATH_KNIGHT) + if (GetClass() == CLASS_DEATH_KNIGHT) { // Update rune timers for (uint8 i = 0; i < MAX_RUNES; ++i) @@ -1513,17 +1513,17 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati { if (!IsGameMaster()) { - if (getClass() == CLASS_DEATH_KNIGHT && GetMapId() == 609 && !HasSpell(50977)) + if (GetClass() == CLASS_DEATH_KNIGHT && GetMapId() == 609 && !HasSpell(50977)) { SendTransferAborted(mapid, TRANSFER_ABORT_UNIQUE_MESSAGE, AsUnderlyingType(TransferAbortedUniqueMessageArgs::StillWithinTheLichKingsGrasp)); return false; } - else if (getRace() == RACE_GOBLIN && GetMapId() == 648 && GetQuestStatus(25265) != QUEST_STATUS_REWARDED) + else if (GetRace() == RACE_GOBLIN && GetMapId() == 648 && GetQuestStatus(25265) != QUEST_STATUS_REWARDED) { SendTransferAborted(mapid, TRANSFER_ABORT_UNIQUE_MESSAGE, AsUnderlyingType(TransferAbortedUniqueMessageArgs::DestinyOfTheBilgewaterCartelStillUndecided)); return false; } - else if (getRace() == RACE_WORGEN && GetMapId() == 654 && GetQuestStatus(26706) != QUEST_STATUS_REWARDED) + else if (GetRace() == RACE_WORGEN && GetMapId() == 654 && GetQuestStatus(26706) != QUEST_STATUS_REWARDED) { SendTransferAborted(mapid, TRANSFER_ABORT_UNIQUE_MESSAGE, AsUnderlyingType(TransferAbortedUniqueMessageArgs::FateOfGilneasHasNotBeenDecidedYet)); return false; @@ -1826,7 +1826,7 @@ void Player::RegenerateAll(uint32 diff) Regenerate(POWER_ALTERNATE_POWER, diff); // Runes act as cooldowns, and they don't need to send any data - if (getClass() == CLASS_DEATH_KNIGHT) + if (GetClass() == CLASS_DEATH_KNIGHT) { for (uint8 i = 0; i < MAX_RUNES; i += 2) { @@ -1903,8 +1903,8 @@ void Player::RegenerateHealth() if (!IsInCombat()) { - if (getLevel() < 15) - addValue = (0.20f * ((float)GetMaxHealth()) / getLevel() * HealthIncreaseRate); + if (GetLevel() < 15) + addValue = (0.20f * ((float)GetMaxHealth()) / GetLevel() * HealthIncreaseRate); else addValue = 0.015f * ((float)GetMaxHealth()) * HealthIncreaseRate; @@ -2106,7 +2106,7 @@ void Player::SetGameMaster(bool on) PhasingHandler::SetAlwaysVisible(GetPhaseShift(), false); m_ExtraFlags &= ~ PLAYER_EXTRA_GM_ON; - SetFactionForRace(getRace()); + SetFactionForRace(GetRace()); RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM); RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_CHEAT_SPELLS); @@ -2221,7 +2221,7 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate) if (victim && victim->GetTypeId() == TYPEID_UNIT && !victim->ToCreature()->hasLootRecipient()) return; - uint8 level = getLevel(); + uint8 level = GetLevel(); sScriptMgr->OnGivePlayerXP(this, xp, victim); @@ -2258,7 +2258,7 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate) if (!IsMaxLevel()) GiveLevel(level + 1); - level = getLevel(); + level = GetLevel(); nextLvlXP = GetUInt32Value(PLAYER_NEXT_LEVEL_XP); } @@ -2269,7 +2269,7 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate) // 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; @@ -2277,10 +2277,10 @@ void Player::GiveLevel(uint8 level) guild->UpdateMemberData(this, GUILD_MEMBER_DATA_LEVEL, level); PlayerLevelInfo info; - sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), level, &info); + sObjectMgr->GetPlayerLevelInfo(GetRace(), GetClass(), level, &info); uint32 basehp = 0, basemana = 0; - sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, basehp, basemana); + sObjectMgr->GetPlayerClassLevelInfo(GetClass(), level, basehp, basemana); WorldPackets::Misc::LevelUpInfo packet; @@ -2338,7 +2338,7 @@ void Player::GiveLevel(uint8 level) //Update QuestGivers SendQuestGiverStatusMultiple(); - if (MailLevelReward const* mailReward = sObjectMgr->GetMailLevelReward(level, getRaceMask())) + if (MailLevelReward const* mailReward = sObjectMgr->GetMailLevelReward(level, GetRaceMask())) { /// @todo Poor design of mail system CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction(); @@ -2365,12 +2365,12 @@ void Player::GiveLevel(uint8 level) bool Player::IsMaxLevel() const { - return getLevel() >= GetUInt32Value(PLAYER_FIELD_MAX_LEVEL); + return GetLevel() >= GetUInt32Value(PLAYER_FIELD_MAX_LEVEL); } void Player::InitTalentForLevel() { - uint8 level = getLevel(); + uint8 level = GetLevel(); // talents base at level diff (talents = level - 9 but some can be used already) if (level < 10) { @@ -2414,10 +2414,10 @@ void Player::InitStatsForLevel(bool reapplyMods) _RemoveAllStatBonuses(); uint32 basehp = 0, basemana = 0; - sObjectMgr->GetPlayerClassLevelInfo(getClass(), getLevel(), basehp, basemana); + sObjectMgr->GetPlayerClassLevelInfo(GetClass(), GetLevel(), basehp, basemana); PlayerLevelInfo info; - sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), getLevel(), &info); + sObjectMgr->GetPlayerLevelInfo(GetRace(), GetClass(), GetLevel(), &info); uint8 exp_max_lvl = DBCManager::GetMaxLevelForExpansion(GetSession()->GetExpansion()); uint8 conf_max_lvl = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); @@ -2425,7 +2425,7 @@ void Player::InitStatsForLevel(bool reapplyMods) SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, conf_max_lvl); else SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, exp_max_lvl); - 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); @@ -3481,7 +3481,7 @@ bool Player::ResetTalents(bool no_cost) // unlearn only talents for character class // some spell learned by one class as normal spells or know at creation but another class learn it as talent, // to prevent unexpected lost normal learned spell skip another class talents - if ((getClassMask() & talentTabInfo->ClassMask) == 0) + if ((GetClassMask() & talentTabInfo->ClassMask) == 0) continue; for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) @@ -3505,7 +3505,7 @@ bool Player::ResetTalents(bool no_cost) } // Remove spec specific spells - uint32 const* talentTabs = sDBCManager.GetTalentTabPages(getClass()); + uint32 const* talentTabs = sDBCManager.GetTalentTabPages(GetClass()); for (uint32 i = 0; i < MAX_TALENT_TABS; ++i) { if (std::vector const* specSpells = sDBCManager.GetTalentTreePrimarySpells(talentTabs[i])) @@ -4181,15 +4181,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())) { @@ -4263,7 +4263,7 @@ Corpse* Player::CreateCorpse() uint8 haircolor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID); uint8 facialStyle = GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE); - _cfb1 = ((0x00) | (getRace() << 8) | (GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER) << 16) | (skin << 24)); + _cfb1 = ((0x00) | (GetRace() << 8) | (GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER) << 16) | (skin << 24)); _cfb2 = ((face) | (hairstyle << 8) | (haircolor << 16) | (facialStyle << 24)); corpse->SetUInt32Value(CORPSE_FIELD_BYTES_1, _cfb1); @@ -4817,7 +4817,7 @@ void Player::UpdateDamageDoneMods(WeaponAttackType attackType, int32 skipEnchant amount += enchantmentEntry->EffectPointsMin[i]; break; case ITEM_ENCHANTMENT_TYPE_TOTEM: - if (getClass() == CLASS_SHAMAN) + if (GetClass() == CLASS_SHAMAN) amount += enchantmentEntry->EffectPointsMin[i] * item->GetTemplate()->GetDelay() / 1000.0f; break; default: @@ -4869,8 +4869,8 @@ float Player::GetTotalBaseModValue(BaseModGroup modGroup) const float Player::GetMeleeCritFromAgility() const { - uint8 level = getLevel(); - uint32 pclass = getClass(); + uint8 level = GetLevel(); + uint32 pclass = GetClass(); if (level > GT_MAX_LEVEL) level = GT_MAX_LEVEL; @@ -4890,7 +4890,7 @@ void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing) cons "Patch 4.2.0 (2011-06-28): Death Knights, Paladins, and Warriors no longer receive any bonus to their chance to dodge from Agility. Their base chance to dodge is now a fixed 5%." */ - if (getClass() == CLASS_WARRIOR || getClass() == CLASS_PALADIN || getClass() == CLASS_DEATH_KNIGHT) + if (GetClass() == CLASS_WARRIOR || GetClass() == CLASS_PALADIN || GetClass() == CLASS_DEATH_KNIGHT) { nondiminishing += 5.f; return; @@ -4928,8 +4928,8 @@ void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing) cons 1.32f // Druid }; - uint8 level = getLevel(); - uint32 playerClass = getClass(); + uint8 level = GetLevel(); + uint32 playerClass = GetClass(); if (level > GT_MAX_LEVEL) level = GT_MAX_LEVEL; @@ -4949,8 +4949,8 @@ void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing) cons float Player::GetSpellCritFromIntellect() const { - uint8 level = getLevel(); - uint32 pclass = getClass(); + uint8 level = GetLevel(); + uint32 pclass = GetClass(); if (level > GT_MAX_LEVEL) level = GT_MAX_LEVEL; @@ -4966,14 +4966,14 @@ float Player::GetSpellCritFromIntellect() const float Player::GetRatingMultiplier(CombatRating cr) const { - uint8 level = getLevel(); + uint8 level = GetLevel(); if (level > GT_MAX_LEVEL) level = GT_MAX_LEVEL; GtCombatRatingsEntry const* Rating = sGtCombatRatingsStore.LookupEntry(cr*GT_MAX_LEVEL+level-1); // gtOCTClassCombatRatingScalarStore.dbc starts with 1, CombatRating with zero, so cr+1 - GtOCTClassCombatRatingScalarEntry const* classRating = sGtOCTClassCombatRatingScalarStore.LookupEntry((getClass()-1)*GT_MAX_RATING+cr+1); + GtOCTClassCombatRatingScalarEntry const* classRating = sGtOCTClassCombatRatingScalarStore.LookupEntry((GetClass()-1)*GT_MAX_RATING+cr+1); if (!Rating || !classRating) return 1.0f; // By default use minimum coefficient (not must be called) @@ -5004,8 +5004,8 @@ float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const float Player::OCTRegenMPPerSpirit() const { - uint8 level = getLevel(); - uint32 pclass = getClass(); + uint8 level = GetLevel(); + uint32 pclass = GetClass(); if (level > GT_MAX_LEVEL) level = GT_MAX_LEVEL; @@ -5456,7 +5456,7 @@ void Player::UpdateSkillsForLevel() continue; uint32 pskill = itr->first; - SkillRaceClassInfoEntry const* rcEntry = sDBCManager.GetSkillRaceClassInfo(pskill, getRace(), getClass()); + SkillRaceClassInfoEntry const* rcEntry = sDBCManager.GetSkillRaceClassInfo(pskill, GetRace(), GetClass()); if (!rcEntry) continue; @@ -5483,7 +5483,7 @@ void Player::InitializeSkillFields() uint32 i = 0; for (SkillLineEntry const* skillLine : sSkillLineStore) { - if (sDBCManager.GetSkillRaceClassInfo(skillLine->ID, getRace(), getClass())) + if (sDBCManager.GetSkillRaceClassInfo(skillLine->ID, GetRace(), GetClass())) { SetSkillLineId(i, skillLine->ID); mSkillStatus.insert(SkillStatusMap::value_type(skillLine->ID, SkillStatusData(i, SKILL_UNCHANGED))); @@ -6037,11 +6037,11 @@ void Player::SetAreaExplored(uint32 areaId) SendExplorationExperience(areaId, 0); else { - int32 diff = int32(getLevel()) - areaEntry->ExplorationLevel; + int32 diff = int32(GetLevel()) - areaEntry->ExplorationLevel; uint32 XP; 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) { @@ -6133,7 +6133,7 @@ int32 Player::CalculateReputationGain(ReputationSource source, uint32 creatureOr break; } - if (rate != 1.0f && creatureOrQuestLevel <= Trinity::XP::GetGrayLevel(getLevel())) + if (rate != 1.0f && creatureOrQuestLevel <= Trinity::XP::GetGrayLevel(GetLevel())) percent *= rate; if (percent <= 0.0f) @@ -6240,7 +6240,7 @@ void Player::RewardOnKill(Unit* victim, float rate) if (rewFactionEntry1->Expansion && !ChampioningFaction) factionId1 = 0; - int32 donerep1 = CalculateReputationGain(REPUTATION_SOURCE_KILL, victim->getLevel(), Rew->RepValue1, factionId1); + int32 donerep1 = CalculateReputationGain(REPUTATION_SOURCE_KILL, victim->GetLevel(), Rew->RepValue1, factionId1); donerep1 = int32(donerep1 * rate); FactionEntry const* factionEntry1 = sFactionStore.LookupEntry(factionId1); @@ -6270,7 +6270,7 @@ void Player::RewardOnKill(Unit* victim, float rate) if (rewFactionEntry2->Expansion && !ChampioningFaction) factionId2 = 0; - int32 donerep2 = CalculateReputationGain(REPUTATION_SOURCE_KILL, victim->getLevel(), Rew->RepValue2, factionId2); + int32 donerep2 = CalculateReputationGain(REPUTATION_SOURCE_KILL, victim->GetLevel(), Rew->RepValue2, factionId2); donerep2 = int32(donerep2 * rate); FactionEntry const* factionEntry2 = sFactionStore.LookupEntry(factionId2); @@ -6430,9 +6430,9 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto if (GetTeam() == plrVictim->GetTeam() && !sWorld->IsFFAPvPRealm()) return false; - uint8 k_level = getLevel(); + uint8 k_level = GetLevel(); uint8 k_grey = Trinity::XP::GetGrayLevel(k_level); - uint8 v_level = victim->getLevel(); + uint8 v_level = victim->GetLevel(); if (v_level <= k_grey && !sWorld->getIntConfig(CONFIG_MIN_CREATURE_SCALED_XP_RATIO)) return false; @@ -6465,8 +6465,8 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto // and those in a lifetime ApplyModUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 1, true); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS, victim->getClass()); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_RACE, victim->getRace()); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS, victim->GetClass()); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_RACE, victim->GetRace()); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA, GetAreaId()); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, 1, 0, 0, victim); if (Guild* guild = GetGuild()) @@ -7262,7 +7262,7 @@ void Player::DuelComplete(DuelCompleteType type) duel->opponent->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL, 1); // Credit for quest Death's Challenge - if (getClass() == CLASS_DEATH_KNIGHT && duel->opponent->GetQuestStatus(12733) == QUEST_STATUS_INCOMPLETE) + if (GetClass() == CLASS_DEATH_KNIGHT && duel->opponent->GetQuestStatus(12733) == QUEST_STATUS_INCOMPLETE) duel->opponent->CastSpell(duel->opponent, 52994, true); // Honor points after duel (the winner) - ImpConfig @@ -7381,7 +7381,7 @@ ScalingStatValuesEntry const* Player::GetScalingStatValuesFor(ItemTemplate const return nullptr; // req. check at equip, but allow use for extended range if range limit max level, set proper level - uint32 const ssd_level = std::min(uint32(getLevel()), ssd->Maxlevel); + uint32 const ssd_level = std::min(uint32(GetLevel()), ssd->Maxlevel); return sScalingStatValuesStore.LookupEntry(ssd_level); } @@ -8060,9 +8060,9 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT // reduce effect values if enchant is limited CastSpellExtraArgs args(item); - if (entry && (entry->AttributesMask & ENCHANT_PROC_ATTR_LIMIT_60) && target->getLevel() > 60) + if (entry && (entry->AttributesMask & ENCHANT_PROC_ATTR_LIMIT_60) && target->GetLevel() > 60) { - int32 const lvlDifference = target->getLevel() - 60; + int32 const lvlDifference = target->GetLevel() - 60; int32 const lvlPenaltyFactor = 4; // 4% lost effectiveness per level int32 const effectPct = std::max(0, 100 - (lvlDifference * lvlPenaltyFactor)); @@ -8299,7 +8299,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); } @@ -8567,8 +8567,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; } @@ -8858,7 +8858,7 @@ void Player::SetSheath(SheathState sheathed) uint8 Player::FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool swap) const { - uint8 playerClass = getClass(); + uint8 playerClass = GetClass(); uint8 slots[4]; slots[0] = NULL_SLOT; @@ -10354,7 +10354,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool ScalingStatDistributionEntry const* ssd = pProto->GetScalingStatDistribution() ? sScalingStatDistributionStore.LookupEntry(pProto->GetScalingStatDistribution()) : 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_NOT_EQUIPPABLE; uint8 eslot = FindEquipSlot(pProto, slot, swap); @@ -10731,7 +10731,7 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const // In fact it's a visual bug, everything works properly... I need sniffs of operations with // binded to account items from off server. - switch (getClass()) + switch (GetClass()) { case CLASS_HUNTER: case CLASS_SHAMAN: @@ -10767,7 +10767,7 @@ InventoryResult Player::CanUseItem(ItemTemplate const* proto) const (((proto->GetFlags2() & ITEM_FLAG2_FACTION_ALLIANCE) && GetTeam() != ALLIANCE))) return EQUIP_ERR_CANT_EQUIP_EVER; - if ((proto->GetAllowableClass() & getClassMask()) == 0 || (proto->GetAllowableRace() & getRaceMask()) == 0) + if ((proto->GetAllowableClass() & GetClassMask()) == 0 || (proto->GetAllowableRace() & GetRaceMask()) == 0) return EQUIP_ERR_CANT_EQUIP_EVER; if (proto->GetRequiredSkill() != 0) @@ -10781,7 +10781,7 @@ InventoryResult Player::CanUseItem(ItemTemplate const* proto) const if (proto->GetRequiredSpell() != 0 && !HasSpell(proto->GetRequiredSpell())) return EQUIP_ERR_PROFICIENCY_NEEDED; - if (getLevel() < proto->GetRequiredLevel()) + if (GetLevel() < proto->GetRequiredLevel()) return EQUIP_ERR_CANT_EQUIP_LEVEL_I; // If World Event is not active, prevent using event dependant items @@ -10821,7 +10821,7 @@ bool Player::CanRollNeedForItem(ItemTemplate const* itemTemplate) const return false; // Race and class requirement checks - if ((itemTemplate->GetAllowableClass() & getClassMask()) == 0 || (itemTemplate->GetAllowableRace() & getRaceMask()) == 0) + if ((itemTemplate->GetAllowableClass() & GetClassMask()) == 0 || (itemTemplate->GetAllowableRace() & GetRaceMask()) == 0) return false; // Spell requirement check @@ -10842,13 +10842,13 @@ bool Player::CanRollNeedForItem(ItemTemplate const* itemTemplate) const && itemTemplate->GetSubClass() < ITEM_SUBCLASS_ARMOR_BUCKLER && itemTemplate->GetInventoryType() != INVTYPE_CLOAK) { - switch (getClass()) + switch (GetClass()) { // Paladins, Warriors and Death Knights can no longer roll for mail when >= level 40 and can only roll for plate case CLASS_WARRIOR: case CLASS_DEATH_KNIGHT: case CLASS_PALADIN: - if (getLevel() < 40 && itemTemplate->GetSubClass() != ITEM_SUBCLASS_ARMOR_MAIL) + if (GetLevel() < 40 && itemTemplate->GetSubClass() != ITEM_SUBCLASS_ARMOR_MAIL) return false; else if (itemTemplate->GetSubClass() != ITEM_SUBCLASS_ARMOR_PLATE) return false; @@ -10856,7 +10856,7 @@ bool Player::CanRollNeedForItem(ItemTemplate const* itemTemplate) const // Hunter and Shamans can no longer roll for leather when >= level 40 and can only roll for mail case CLASS_HUNTER: case CLASS_SHAMAN: - if (getLevel() < 40 && itemTemplate->GetSubClass() != ITEM_SUBCLASS_ARMOR_LEATHER) + if (GetLevel() < 40 && itemTemplate->GetSubClass() != ITEM_SUBCLASS_ARMOR_LEATHER) return false; else if (itemTemplate->GetSubClass() != ITEM_SUBCLASS_ARMOR_MAIL) return false; @@ -11091,7 +11091,7 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) if (pProto && IsInCombat() && (pProto->GetClass() == ITEM_CLASS_WEAPON || pProto->GetInventoryType() == INVTYPE_RELIC) && m_weaponChangeTimer == 0) { - uint32 cooldownSpell = getClass() == CLASS_ROGUE ? 6123 : 6119; + uint32 cooldownSpell = GetClass() == CLASS_ROGUE ? 6123 : 6119; SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(cooldownSpell); if (!spellProto) @@ -12891,7 +12891,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool if (!ignore_condition && pEnchant->Condition_ID && !EnchantmentFitsRequirements(pEnchant->Condition_ID, -1)) return; - if (pEnchant->MinLevel > getLevel()) + if (pEnchant->MinLevel > GetLevel()) return; if (pEnchant->RequiredSkillID > 0 && pEnchant->RequiredSkillRank > GetSkillValue(pEnchant->RequiredSkillID)) @@ -13372,7 +13372,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool break; case GOSSIP_OPTION_LEARNDUALSPEC: case GOSSIP_OPTION_DUALSPEC_INFO: - if (!(GetSpecsCount() == 1 && creature->CanResetTalents(this) && !(getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)))) + if (!(GetSpecsCount() == 1 && creature->CanResetTalents(this) && !(GetLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)))) canTalk = false; break; case GOSSIP_OPTION_UNLEARNTALENTS: @@ -13392,7 +13392,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool canTalk = false; break; case GOSSIP_OPTION_STABLEPET: - if (getClass() != CLASS_HUNTER) + if (GetClass() != CLASS_HUNTER) canTalk = false; break; case GOSSIP_OPTION_ARMORER: @@ -13444,12 +13444,12 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool LocaleConstant locale = GetSession()->GetSessionDbLocaleIndex(); if (optionBroadcastText) - strOptionText = optionBroadcastText->GetText(locale, getGender()); + strOptionText = optionBroadcastText->GetText(locale, GetGender()); else strOptionText = itr->second.OptionText; if (boxBroadcastText) - strBoxText = boxBroadcastText->GetText(locale, getGender()); + strBoxText = boxBroadcastText->GetText(locale, GetGender()); else strBoxText = itr->second.BoxText; @@ -13586,7 +13586,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men GetSession()->SendTrainerList(source->ToCreature(), sObjectMgr->GetCreatureTrainerForGossipOption(source->GetEntry(), menuId, gossipListId)); 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 @@ -13882,7 +13882,7 @@ bool Player::CanSeeStartQuest(Quest const* quest) const 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; @@ -14423,7 +14423,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 @@ -14679,7 +14679,7 @@ 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) { @@ -14690,7 +14690,7 @@ bool Player::SatisfyQuestLevel(Quest const* qInfo, bool msg) const return false; } - if (qInfo->GetMaxLevel() > 0 && getLevel() > qInfo->GetMaxLevel()) + if (qInfo->GetMaxLevel() > 0 && GetLevel() > qInfo->GetMaxLevel()) { if (msg) { @@ -14861,7 +14861,7 @@ bool Player::SatisfyQuestClass(Quest const* qInfo, bool msg) const if (reqClass == 0) return true; - if ((reqClass & getClassMask()) == 0) + if ((reqClass & GetClassMask()) == 0) { if (msg) { @@ -14881,7 +14881,7 @@ bool Player::SatisfyQuestRace(Quest const* qInfo, bool msg) const uint32 reqraces = qInfo->GetAllowableRaces(); if (reqraces == 0) return true; - if ((reqraces & getRaceMask()) == 0) + if ((reqraces & GetRaceMask()) == 0) { if (msg) { @@ -15414,7 +15414,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()) { if (quest->IsDaily()) @@ -16518,10 +16518,10 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder const& hol SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, gender); // check if race/class combination is valid - PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass()); + PlayerInfo const* info = sObjectMgr->GetPlayerInfo(GetRace(), GetClass()); if (!info) { - TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) has wrong race/class (%u/%u), can't load.", guid.ToString().c_str(), getRace(), getClass()); + TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) has wrong race/class (%u/%u), can't load.", guid.ToString().c_str(), GetRace(), GetClass()); return false; } @@ -16591,7 +16591,7 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder const& hol //Need to call it to initialize m_team (m_team can be calculated from race) //Other way is to saves m_team into characters table. - SetFactionForRace(getRace()); + SetFactionForRace(GetRace()); // load home bind and check in same time class/race pair, it used later for restore broken positions if (!_LoadHomeBind(holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_HOME_BIND))) @@ -18324,7 +18324,7 @@ void Player::_LoadGroup(PreparedQueryResult result) uint8 subgroup = group->GetMemberGroup(GetGUID()); SetGroup(group, subgroup); - if (getLevel() >= LEVELREQUIREMENT_HEROIC) + if (GetLevel() >= LEVELREQUIREMENT_HEROIC) { // the group leader may change the instance difficulty while the player is offline SetDungeonDifficulty(group->GetDungeonDifficulty()); @@ -18680,9 +18680,9 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report 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; } @@ -18823,11 +18823,11 @@ void Player::AddInstanceEnterTime(uint32 instanceId, time_t enterTime) bool Player::_LoadHomeBind(PreparedQueryResult result) { - PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass()); + PlayerInfo const* info = sObjectMgr->GetPlayerInfo(GetRace(), GetClass()); if (!info) { TC_LOG_ERROR("entities.player", "Player (Name %s) has incorrect race/class (%u/%u) pair. Can't be loaded.", - GetName().c_str(), uint32(getRace()), uint32(getClass())); + GetName().c_str(), uint32(GetRace()), uint32(GetClass())); return false; } @@ -18932,10 +18932,10 @@ void Player::SaveToDB(CharacterDatabaseTransaction trans, bool create /* = false stmt->setUInt32(index++, GetGUID().GetCounter()); stmt->setUInt32(index++, GetSession()->GetAccountId()); stmt->setString(index++, GetName()); - stmt->setUInt8(index++, getRace()); - stmt->setUInt8(index++, getClass()); + stmt->setUInt8(index++, GetRace()); + stmt->setUInt8(index++, GetClass()); stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER)); // save gender from PLAYER_BYTES_3, UNIT_BYTES_0 changes with every transform effect - stmt->setUInt8(index++, getLevel()); + stmt->setUInt8(index++, GetLevel()); stmt->setUInt32(index++, GetUInt32Value(PLAYER_XP)); stmt->setUInt64(index++, GetMoney()); stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID)); @@ -19052,10 +19052,10 @@ void Player::SaveToDB(CharacterDatabaseTransaction trans, bool create /* = false // Update query stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER); stmt->setString(index++, GetName()); - stmt->setUInt8(index++, getRace()); - stmt->setUInt8(index++, getClass()); + stmt->setUInt8(index++, GetRace()); + stmt->setUInt8(index++, GetClass()); stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER)); // save gender from PLAYER_BYTES_3, UNIT_BYTES_0 changes with every transform effect - stmt->setUInt8(index++, getLevel()); + stmt->setUInt8(index++, GetLevel()); stmt->setUInt32(index++, GetUInt32Value(PLAYER_XP)); stmt->setUInt64(index++, GetMoney()); stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID)); @@ -19943,7 +19943,7 @@ void Player::_SaveSpells(CharacterDatabaseTransaction& trans) void Player::_SaveStats(CharacterDatabaseTransaction& trans) const { // 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; @@ -20406,7 +20406,7 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent) if (GetGroup()) SetGroupUpdateFlag(GROUP_UPDATE_PET); - if (mode == PET_SAVE_DISMISS && getClass() == CLASS_WARLOCK) + if (mode == PET_SAVE_DISMISS && GetClass() == CLASS_WARLOCK) { if (CreatureDisplayInfoEntry const* creatureDisplay = sCreatureDisplayInfoStore.LookupEntry(pet->GetDisplayId())) { @@ -20583,7 +20583,7 @@ void Player::Whisper(uint32 textId, Player* target, bool isBossWhisper) LocaleConstant locale = target->GetSession()->GetSessionDbLocaleIndex(); WorldPacket data; - ChatHandler::BuildChatPacket(data, isBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, getGender()), 0, "", locale); + ChatHandler::BuildChatPacket(data, isBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, GetGender()), 0, "", locale); target->SendDirectMessage(&data); } @@ -20619,16 +20619,16 @@ bool Player::CanControlPet(uint32 spellId) const switch (spellId) { case 93321: // Control Pet - return getClass() == CLASS_HUNTER; + return GetClass() == CLASS_HUNTER; case 93375: // Control Demon - return getClass() == CLASS_WARLOCK; + return GetClass() == CLASS_WARLOCK; } } else { - if (getClass() == CLASS_HUNTER && !HasAura(93321)) + if (GetClass() == CLASS_HUNTER && !HasAura(93321)) return false; - if (getClass() == CLASS_WARLOCK && !HasAura(93375)) + if (GetClass() == CLASS_WARLOCK && !HasAura(93375)) return false; } @@ -20789,7 +20789,7 @@ void Player::CharmSpellInitialize() if (charm->GetTypeId() != TYPEID_PLAYER) { //CreatureInfo const* cinfo = charm->ToCreature()->GetCreatureTemplate(); - //if (cinfo && cinfo->type == CREATURE_TYPE_DEMON && getClass() == CLASS_WARLOCK) + //if (cinfo && cinfo->type == CREATURE_TYPE_DEMON && GetClass() == CLASS_WARLOCK) { for (uint32 i = 0; i < MAX_SPELL_CHARM; ++i) if (charmInfo->GetCharmSpell(i)->GetAction()) @@ -21264,7 +21264,7 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc // only one mount ID for both sides. Probably not good to use 315 in case DBC nodes // change but I couldn't find a suitable alternative. OK to use class because only DK // can use this taxi. - uint32 mount_display_id = sObjectMgr->GetTaxiMountDisplayId(sourcenode, GetTeam(), npc == nullptr || (sourcenode == 315 && getClass() == CLASS_DEATH_KNIGHT)); + uint32 mount_display_id = sObjectMgr->GetTaxiMountDisplayId(sourcenode, GetTeam(), npc == nullptr || (sourcenode == 315 && GetClass() == CLASS_DEATH_KNIGHT)); // in spell case allow 0 model if ((mount_display_id == 0 && spellid == 0) || sourcepath == 0) @@ -21435,7 +21435,7 @@ void Player::InitDataForForm(bool reapplyMods) void Player::InitDisplayIds() { - PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass()); + PlayerInfo const* info = sObjectMgr->GetPlayerInfo(GetRace(), GetClass()); if (!info) { TC_LOG_ERROR("entities.player", "Player::InitDisplayIds: Player '%s' (%s) has incorrect race/class pair. Can't init display ids.", GetName().c_str(), GetGUID().ToString().c_str()); @@ -21699,7 +21699,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin return false; } - if (!(pProto->GetAllowableClass() & getClassMask()) && pProto->GetBonding() == BIND_ON_ACQUIRE && !IsGameMaster()) + if (!(pProto->GetAllowableClass() & GetClassMask()) && pProto->GetBonding() == BIND_ON_ACQUIRE && !IsGameMaster()) { SendBuyError(BUY_ERR_CANT_FIND_ITEM, nullptr, item, 0); return false; @@ -22390,10 +22390,10 @@ void Player::ReportedAfkBy(Player* reporter) WorldLocation Player::GetStartPosition() const { - PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass()); + PlayerInfo const* info = sObjectMgr->GetPlayerInfo(GetRace(), GetClass()); ASSERT(info); uint32 mapId = info->mapId; - if (getClass() == CLASS_DEATH_KNIGHT && HasSpell(50977)) + if (GetClass() == CLASS_DEATH_KNIGHT && HasSpell(50977)) mapId = 0; return WorldLocation(mapId, info->positionX, info->positionY, info->positionZ, 0); } @@ -22791,7 +22791,7 @@ void Player::SendInitialPacketsBeforeAddToMap(bool firstLogin /*= false*/) // Handled in WorldSession::HandlePlayerLogin /// SMSG_RESYNC_RUNES - if (getClass() == CLASS_DEATH_KNIGHT) + if (GetClass() == CLASS_DEATH_KNIGHT) { // Initialize rune cooldowns ResyncRunes(); @@ -23010,7 +23010,7 @@ void Player::ResetSpells(bool myClassOnly) if (myClassOnly) { - ChrClassesEntry const* clsEntry = sChrClassesStore.LookupEntry(getClass()); + ChrClassesEntry const* clsEntry = sChrClassesStore.LookupEntry(GetClass()); if (!clsEntry) return; family = clsEntry->SpellClassSet; @@ -23058,13 +23058,13 @@ void Player::LearnCustomSpells() return; // learn default race/class spells - PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass()); + PlayerInfo const* info = sObjectMgr->GetPlayerInfo(GetRace(), GetClass()); ASSERT(info); for (PlayerCreateInfoSpells::const_iterator itr = info->customSpells.begin(); itr != info->customSpells.end(); ++itr) { uint32 tspell = *itr; TC_LOG_DEBUG("entities.player.loading", "Player::LearnCustomSpells: Player '%s' (%s, Class: %u Race: %u): Adding initial spell (SpellID: %u)", - GetName().c_str(), GetGUID().ToString().c_str(), uint32(getClass()), uint32(getRace()), tspell); + GetName().c_str(), GetGUID().ToString().c_str(), uint32(GetClass()), uint32(GetRace()), tspell); if (!IsInWorld()) // will send in INITIAL_SPELLS in list anyway at map add AddSpell(tspell, true, true, true, false); else // but send in normal spell in game learn case @@ -23075,7 +23075,7 @@ void Player::LearnCustomSpells() void Player::LearnDefaultSkills() { // learn default race/class skills - PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass()); + PlayerInfo const* info = sObjectMgr->GetPlayerInfo(GetRace(), GetClass()); ASSERT(info); for (PlayerCreateInfoSkills::const_iterator itr = info->skills.begin(); itr != info->skills.end(); ++itr) { @@ -23089,11 +23089,11 @@ void Player::LearnDefaultSkills() void Player::LearnDefaultSkill(uint32 skillId, uint16 rank) { - SkillRaceClassInfoEntry const* rcInfo = sDBCManager.GetSkillRaceClassInfo(skillId, getRace(), getClass()); + SkillRaceClassInfoEntry const* rcInfo = sDBCManager.GetSkillRaceClassInfo(skillId, GetRace(), GetClass()); if (!rcInfo) return; - TC_LOG_DEBUG("entities.player.loading", "PLAYER (Class: %u Race: %u): Adding initial skill, id = %u", uint32(getClass()), uint32(getRace()), skillId); + TC_LOG_DEBUG("entities.player.loading", "PLAYER (Class: %u Race: %u): Adding initial skill, id = %u", uint32(GetClass()), uint32(GetRace()), skillId); switch (GetSkillRangeType(rcInfo)) { case SKILL_RANGE_LANGUAGE: @@ -23105,8 +23105,8 @@ void Player::LearnDefaultSkill(uint32 skillId, uint16 rank) uint16 maxValue = GetMaxSkillValueForLevel(); if (rcInfo->Flags & SKILL_FLAG_ALWAYS_MAX_VALUE) skillValue = maxValue; - else if (getClass() == CLASS_DEATH_KNIGHT) - skillValue = std::min(std::max({ 1, uint16((getLevel() - 1) * 5) }), maxValue); + else if (GetClass() == CLASS_DEATH_KNIGHT) + skillValue = std::min(std::max({ 1, uint16((GetLevel() - 1) * 5) }), maxValue); else if (skillId == SKILL_FIST_WEAPONS) skillValue = std::max(1, GetSkillValue(SKILL_UNARMED)); else if (skillId == SKILL_LOCKPICKING) @@ -23128,8 +23128,8 @@ void Player::LearnDefaultSkill(uint32 skillId, uint16 rank) uint16 skillValue = 1; if (rcInfo->Flags & SKILL_FLAG_ALWAYS_MAX_VALUE) skillValue = maxValue; - else if (getClass() == CLASS_DEATH_KNIGHT) - skillValue = std::min(std::max({ uint16(1), uint16((getLevel() - 1) * 5) }), maxValue); + else if (GetClass() == CLASS_DEATH_KNIGHT) + skillValue = std::min(std::max({ uint16(1), uint16((GetLevel() - 1) * 5) }), maxValue); SetSkill(skillId, 1, skillValue, maxValue); break; @@ -23204,8 +23204,8 @@ void Player::LearnQuestRewardedSpells() void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue) { - uint32 raceMask = getRaceMask(); - uint32 classMask = getClassMask(); + uint32 raceMask = GetRaceMask(); + uint32 classMask = GetClassMask(); std::vector const* skillLineAbilities = sDBCManager.GetSkillLineAbilitiesBySkill(skillId); if (!skillLineAbilities) return; @@ -23238,7 +23238,7 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue) continue; // check level, skip class spells if not high enough - if (getLevel() < spellInfo->SpellLevel) + if (GetLevel() < spellInfo->SpellLevel) continue; // need unlearn spell @@ -23626,7 +23626,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; @@ -23638,7 +23638,7 @@ bool Player::GetBGAccessByLevel(BattlegroundTypeId bgTypeId) const float Player::GetReputationPriceDiscount(Creature const* creature) const { - ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(getRace()); + ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(GetRace()); if (raceEntry->Flags & 0x100) return 0.8f; @@ -23660,8 +23660,8 @@ Player* Player::GetTrader() const bool Player::IsSpellFitByClassAndRace(uint32 spell_id) const { - uint32 racemask = getRaceMask(); - uint32 classmask = getClassMask(); + uint32 racemask = GetRaceMask(); + uint32 classmask = GetClassMask(); SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spell_id); if (bounds.first == bounds.second) @@ -23678,7 +23678,7 @@ bool Player::IsSpellFitByClassAndRace(uint32 spell_id) const continue; // skip wrong class and race skill saved in SkillRaceClassInfo.dbc - if (!sDBCManager.GetSkillRaceClassInfo(_spell_idx->second->SkillLine, getRace(), getClass())) + if (!sDBCManager.GetSkillRaceClassInfo(_spell_idx->second->SkillLine, GetRace(), GetClass())) continue; return true; @@ -24048,8 +24048,8 @@ uint32 Player::GetResurrectionSpellId() // Used in triggers for check "Only to targets that grant experience or honor" req bool Player::isHonorOrXPTarget(Unit const* victim) const { - uint8 v_level = victim->getLevel(); - uint8 k_grey = Trinity::XP::GetGrayLevel(getLevel()); + uint8 v_level = victim->GetLevel(); + uint8 k_grey = Trinity::XP::GetGrayLevel(GetLevel()); // Victim level less gray level if (v_level <= k_grey) @@ -24066,7 +24066,7 @@ bool Player::isHonorOrXPTarget(Unit const* 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 = GetGroup()) { @@ -24082,12 +24082,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; } @@ -24540,7 +24540,7 @@ void Player::AtExitCombat() Unit::AtExitCombat(); UpdatePotionCooldown(); - if (getClass() == CLASS_DEATH_KNIGHT) + if (GetClass() == CLASS_DEATH_KNIGHT) for (uint8 i = 0; i < MAX_RUNES; ++i) { SetRuneTimer(i, 0xFFFFFFFF); @@ -24662,7 +24662,7 @@ bool Player::CanCaptureTowerPoint() const uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, BarberShopStyleEntry const* newSkin) const { - uint8 level = getLevel(); + uint8 level = GetLevel(); if (level > GT_MAX_LEVEL) level = GT_MAX_LEVEL; // max level in this dbc @@ -24704,7 +24704,7 @@ void Player::InitGlyphsForLevel() if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(i)) SetGlyphSlot(slot++, gs->ID); - uint8 level = getLevel(); + uint8 level = GetLevel(); uint32 slotMask = 0; if (level >= 25) @@ -24913,7 +24913,7 @@ static RuneType runeSlotTypes[MAX_RUNES] = void Player::InitRunes() { - if (getClass() != CLASS_DEATH_KNIGHT) + if (GetClass() != CLASS_DEATH_KNIGHT) return; m_runes = std::make_unique(); @@ -25072,18 +25072,18 @@ void Player::StoreLootItem(ObjectGuid lootWorldObjectGuid, uint8 lootSlot, Loot* uint32 Player::CalculateTalentsPoints() const { // this dbc file has entries only up to level 100 - NumTalentsAtLevelEntry const* count = sNumTalentsAtLevelStore.LookupEntry(std::min(getLevel(), 100)); + NumTalentsAtLevelEntry const* count = sNumTalentsAtLevelStore.LookupEntry(std::min(GetLevel(), 100)); if (!count) return 0; float baseForLevel = count->NumberOfTalents; - if (getClass() != CLASS_DEATH_KNIGHT || GetMapId() != 609) + if (GetClass() != CLASS_DEATH_KNIGHT || GetMapId() != 609) return uint32(baseForLevel * sWorld->getRate(RATE_TALENT)); // Death Knight starting level // hardcoded here - number of quest awarded talents is equal to number of talents any other class would have at level 55 - if (getLevel() < 55) + if (GetLevel() < 55) return 0; NumTalentsAtLevelEntry const* dkBase = sNumTalentsAtLevelStore.LookupEntry(55); @@ -25130,11 +25130,11 @@ void Player::_LoadSkills(PreparedQueryResult result) uint16 value = fields[1].GetUInt16(); uint16 max = fields[2].GetUInt16(); - SkillRaceClassInfoEntry const* rcEntry = sDBCManager.GetSkillRaceClassInfo(skill, getRace(), getClass()); + SkillRaceClassInfoEntry const* rcEntry = sDBCManager.GetSkillRaceClassInfo(skill, GetRace(), GetClass()); if (!rcEntry) { TC_LOG_ERROR("entities.player", "Player::_LoadSkills: Player '%s' (%s, Race: %u, Class: %u) has forbidden skill %u for his race/class combination", - GetName().c_str(), GetGUID().ToString().c_str(), uint32(getRace()), uint32(getClass()), skill); + GetName().c_str(), GetGUID().ToString().c_str(), uint32(GetRace()), uint32(GetClass()), skill); mSkillStatus.insert(SkillStatusMap::value_type(skill, SkillStatusData(mSkillStatus.size(), SKILL_DELETED))); continue; @@ -25437,7 +25437,7 @@ bool Player::LearnTalent(uint32 talentId, uint32 talentRank) return false; // prevent learn talent for different class (cheating) - if ((getClassMask() & talentTabInfo->ClassMask) == 0) + if ((GetClassMask() & talentTabInfo->ClassMask) == 0) return false; // find current max talent rank (0~5) @@ -25796,7 +25796,7 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data) *data << uint8(talentIdCount); // [PH], talentIdCount // find class talent tabs (all players have 3 talent tabs) - uint32 const* talentTabIds = sDBCManager.GetTalentTabPages(getClass()); + uint32 const* talentTabIds = sDBCManager.GetTalentTabPages(GetClass()); for (uint8 i = 0; i < MAX_TALENT_TABS; ++i) { @@ -26355,7 +26355,7 @@ void Player::ActivateSpec(uint8 spec) // unlearn only talents for character class // some spell learned by one class as normal spells or know at creation but another class learn it as talent, // to prevent unexpected lost normal learned spell skip another class talents - if ((getClassMask() & talentTabInfo->ClassMask) == 0) + if ((GetClassMask() & talentTabInfo->ClassMask) == 0) continue; for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) @@ -26378,7 +26378,7 @@ void Player::ActivateSpec(uint8 spec) // Remove spec specific spells for (uint32 i = 0; i < MAX_TALENT_TABS; ++i) { - uint32 const* talentTabs = sDBCManager.GetTalentTabPages(getClass()); + uint32 const* talentTabs = sDBCManager.GetTalentTabPages(GetClass()); std::vector const* specSpells = sDBCManager.GetTalentTreePrimarySpells(talentTabs[i]); if (specSpells) for (size_t i = 0; i < specSpells->size(); ++i) @@ -26413,7 +26413,7 @@ void Player::ActivateSpec(uint8 spec) continue; // learn only talents for character class - if ((getClassMask() & talentTabInfo->ClassMask) == 0) + if ((GetClassMask() & talentTabInfo->ClassMask) == 0) continue; // learn highest talent rank that exists in newly activated spec @@ -26888,7 +26888,7 @@ float Player::GetAverageItemLevel() const uint32 offHandItemLevel = 0; uint32 mainHandItemLevel = 0; - if (getClass() == CLASS_WARRIOR || getClass() == CLASS_ROGUE || getClass() == CLASS_SHAMAN || getClass() == CLASS_HUNTER || getClass() == CLASS_DEATH_KNIGHT) + if (GetClass() == CLASS_WARRIOR || GetClass() == CLASS_ROGUE || GetClass() == CLASS_SHAMAN || GetClass() == CLASS_HUNTER || GetClass() == CLASS_DEATH_KNIGHT) { uint8 const weaponSorterSize = 6; std::array weaponSorter; @@ -26904,7 +26904,7 @@ float Player::GetAverageItemLevel() const weaponSorter[2] = itemLevelPerInvType[INVTYPE_WEAPON]; weaponSorter[3] = weaponItemLevel; - if (getClass() == CLASS_WARRIOR) + if (GetClass() == CLASS_WARRIOR) { weaponSorter[4] = itemLevelPerInvType[INVTYPE_2HWEAPON]; weaponSorter[5] = weapon2HItemLevel; @@ -27198,7 +27198,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy pet->SetUInt64Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); pet->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pet->InitStatsForLevel(getLevel()); + pet->InitStatsForLevel(GetLevel()); pet->SetReactState(REACT_ASSIST); SetMinion(pet, true); @@ -27224,7 +27224,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy pet->InitPetCreateSpells(); pet->SavePetToDB(PET_SAVE_NEW_PET); PetSpellInitialize(); - GetSession()->SendPetAdded(pet->GetSlot(), pet->GetCharmInfo()->GetPetNumber(), pet->GetEntry(), pet->getLevel(), pet->GetName()); + GetSession()->SendPetAdded(pet->GetSlot(), pet->GetCharmInfo()->GetPetNumber(), pet->GetEntry(), pet->GetLevel(), pet->GetName()); break; default: break; @@ -27256,7 +27256,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy bool Player::CanUseMastery() const { - return HasSpell(MasterySpells[getClass()]); + return HasSpell(MasterySpells[GetClass()]); } void Player::ValidateMovementInfo(MovementInfo* mi) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 156ba5c4ba6..d16f15d7925 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1074,7 +1074,7 @@ class TC_GAME_API Player : public Unit, public GridObject void SendTamePetFailure(PetTameFailureReason reason); PlayerTaxi m_taxi; - void InitTaxiNodesForLevel() { m_taxi.InitTaxiNodesForLevel(getRace(), getClass(), getLevel()); } + void InitTaxiNodesForLevel() { m_taxi.InitTaxiNodesForLevel(GetRace(), GetClass(), GetLevel()); } bool ActivateTaxiPathTo(std::vector const& nodes, Creature* npc = nullptr, uint32 spellid = 0); bool ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid = 0); void CleanupAfterTaxiFlight(); @@ -1326,7 +1326,7 @@ class TC_GAME_API Player : public Unit, public GridObject /*** 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); diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index c89e7782ced..022e3c9dc0d 100644 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -233,8 +233,8 @@ void SocialMgr::GetFriendInfo(Player* player, ObjectGuid const& friendGUID, Frie } friendInfo.Area = target->GetZoneId(); - friendInfo.Level = target->getLevel(); - friendInfo.Class = target->getClass(); + friendInfo.Level = target->GetLevel(); + friendInfo.Class = target->GetClass(); } } diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp index 0913356517e..93daef33914 100644 --- a/src/server/game/Entities/Totem/Totem.cpp +++ b/src/server/game/Entities/Totem/Totem.cpp @@ -72,12 +72,12 @@ void Totem::InitStats(uint32 duration) // Get spell cast by totem if (SpellInfo const* totemSpell = sSpellMgr->GetSpellInfo(GetSpell())) - if (totemSpell->CalcCastTime(getLevel())) // If spell has cast time -> its an active totem + if (totemSpell->CalcCastTime(GetLevel())) // If spell has cast time -> its an active totem m_type = TOTEM_ACTIVE; m_duration = duration; - SetLevel(GetOwner()->getLevel()); + SetLevel(GetOwner()->GetLevel()); } void Totem::InitSummon() diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 2983967bb5c..2834323206f 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -310,7 +310,7 @@ float Player::GetHealthBonusFromStamina() { // Taken from PaperDollFrame.lua - 4.3.4.15595 float ratio = 10.0f; - if (gtOCTHpPerStaminaEntry const* hpBase = sGtOCTHpPerStaminaStore.LookupEntry((getClass() - 1) * GT_MAX_LEVEL + getLevel() - 1)) + if (gtOCTHpPerStaminaEntry const* hpBase = sGtOCTHpPerStaminaStore.LookupEntry((GetClass() - 1) * GT_MAX_LEVEL + GetLevel() - 1)) ratio = hpBase->ratio; float stamina = GetStat(STAT_STAMINA); @@ -345,7 +345,7 @@ void Player::UpdateMaxHealth() uint32 Player::GetPowerIndex(Powers power) const { - return sDBCManager.GetPowerIndexByClass(power, getClass()); + return sDBCManager.GetPowerIndexByClass(power, GetClass()); } void Player::UpdateMaxPower(Powers power) @@ -369,9 +369,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.LookupEntry(getClass()); + ChrClassesEntry const* entry = sChrClassesStore.LookupEntry(GetClass()); UnitMods unitMod = ranged ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER; uint16 index = ranged ? UNIT_FIELD_RANGED_ATTACK_POWER : UNIT_FIELD_ATTACK_POWER; @@ -664,7 +664,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; @@ -673,7 +673,7 @@ void Player::UpdateParryPercentage() // Parry from SPELL_AURA_MOD_PARRY_PERCENT aura 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; @@ -707,7 +707,7 @@ void Player::UpdateDodgePercentage() // Dodge from rating 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; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ca58753488b..2621abad7ed 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1281,7 +1281,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, CalcDamageInfo* damageInfo, Weapon { damageInfo->HitInfo |= HITINFO_GLANCING; damageInfo->TargetState = VICTIMSTATE_HIT; - int32 leveldif = int32(victim->getLevel()) - int32(getLevel()); + int32 leveldif = int32(victim->GetLevel()) - int32(GetLevel()); if (leveldif > 3) leveldif = 3; @@ -1385,8 +1385,8 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) float chance = 20.0f; // there is a newbie protection, at level 10 just 7% base chance; assuming linear function - if (victim->getLevel() < 30) - chance = 0.65f * victim->getLevel() + 0.5f; + if (victim->GetLevel() < 30) + chance = 0.65f * victim->GetLevel() + 0.5f; uint32 const victimDefense = victim->GetMaxSkillValueForLevel(this); uint32 const attackerMeleeSkill = GetMaxSkillValueForLevel(); @@ -1528,7 +1528,7 @@ static float GetArmorReduction(float armor, uint8 attackerLevel) armor = 0.0f; } - float armorReduction = 100.f - GetArmorReduction(armor, attacker ? attacker->getLevel() : attackerLevel); + float armorReduction = 100.f - GetArmorReduction(armor, attacker ? attacker->GetLevel() : attackerLevel); return std::max(std::ceil(damage * armorReduction / 100.f), 0); } @@ -1622,7 +1622,7 @@ static float GetArmorReduction(float armor, uint8 attackerLevel) 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) @@ -2133,7 +2133,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy // Max 40% chance to score a glancing blow against mobs of the same or higher level (only players and pets, not for ranged weapons). if ((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 = attackerMaxSkillValueForLevel; @@ -5255,7 +5255,7 @@ Powers Unit::CalculateDisplayPowerType() const break; default: { - ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(getClass()); + ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(GetClass()); if (cEntry && cEntry->DisplayPower < MAX_POWERS) displayPower = Powers(cEntry->DisplayPower); @@ -5263,7 +5263,7 @@ Powers Unit::CalculateDisplayPowerType() const { if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(vehicle->GetVehicleInfo()->PowerDisplayID[0])) // To-do: 4.x has 3 power display id fields. displayPower = Powers(powerDisplay->ActualType); - else if (getClass() == CLASS_ROGUE) + else if (GetClass() == CLASS_ROGUE) displayPower = POWER_ENERGY; } else if (Pet const* pet = ToPet()) @@ -6863,7 +6863,7 @@ float Unit::SpellCritChanceTaken(Unit const* caster, SpellInfo const* spellInfo, // Spell crit suppression if (GetTypeId() == TYPEID_UNIT) { - int32 const levelDiff = static_cast(getLevelForTarget(caster)) - caster->getLevel(); + int32 const levelDiff = static_cast(getLevelForTarget(caster)) - caster->GetLevel(); if (levelDiff > 0) crit_chance -= levelDiff * 0.7f; } @@ -10061,7 +10061,7 @@ void Unit::ProcSkillsAndReactives(bool isVictim, Unit* procTarget, uint32 typeMa if (isVictim) { // Skip checks for Death Knights when in Blood Presence (Rune Strike) - if (getClass() == CLASS_DEATH_KNIGHT && hitMask & (PROC_HIT_DODGE | PROC_HIT_PARRY | PROC_HIT_BLOCK)) + if (GetClass() == CLASS_DEATH_KNIGHT && hitMask & (PROC_HIT_DODGE | PROC_HIT_PARRY | PROC_HIT_BLOCK)) if (GetAuraEffect(SPELL_AURA_MOD_BASE_RESISTANCE_PCT, SPELLFAMILY_DEATHKNIGHT, 0x800000, 0, 0, GetGUID())) return; @@ -10069,7 +10069,7 @@ void Unit::ProcSkillsAndReactives(bool isVictim, Unit* procTarget, uint32 typeMa if (hitMask & PROC_HIT_DODGE) { // Update AURA_STATE on dodge - if (getClass() != CLASS_ROGUE) // skip Rogue Riposte + if (GetClass() != CLASS_ROGUE) // skip Rogue Riposte { ModifyAuraState(AURA_STATE_DEFENSE, true); StartReactiveTimer(REACTIVE_DEFENSE); @@ -10079,7 +10079,7 @@ void Unit::ProcSkillsAndReactives(bool isVictim, Unit* procTarget, uint32 typeMa if (hitMask & PROC_HIT_PARRY) { // For Hunters only Counterattack (skip Mongoose bite) - if (getClass() == CLASS_HUNTER) + if (GetClass() == CLASS_HUNTER) { ModifyAuraState(AURA_STATE_HUNTER_PARRY, true); StartReactiveTimer(REACTIVE_HUNTER_PARRY); @@ -10100,7 +10100,7 @@ void Unit::ProcSkillsAndReactives(bool isVictim, Unit* procTarget, uint32 typeMa else // For attacker { // Overpower on victim dodge - if ((hitMask & PROC_HIT_DODGE) && GetTypeId() == TYPEID_PLAYER && getClass() == CLASS_WARRIOR) + if ((hitMask & PROC_HIT_DODGE) && GetTypeId() == TYPEID_PLAYER && GetClass() == CLASS_WARRIOR) { ToPlayer()->AddComboPoints(procTarget, 1); StartReactiveTimer(REACTIVE_OVERPOWER); @@ -10520,9 +10520,9 @@ void Unit::ClearAllReactives() if (HasAuraState(AURA_STATE_DEFENSE)) ModifyAuraState(AURA_STATE_DEFENSE, false); - if (getClass() == CLASS_HUNTER && HasAuraState(AURA_STATE_HUNTER_PARRY)) + if (GetClass() == CLASS_HUNTER && HasAuraState(AURA_STATE_HUNTER_PARRY)) ModifyAuraState(AURA_STATE_HUNTER_PARRY, false); - if (getClass() == CLASS_WARRIOR && GetTypeId() == TYPEID_PLAYER) + if (GetClass() == CLASS_WARRIOR && GetTypeId() == TYPEID_PLAYER) ToPlayer()->ClearComboPoints(); } @@ -10546,11 +10546,11 @@ void Unit::UpdateReactives(uint32 p_time) ModifyAuraState(AURA_STATE_DEFENSE, false); break; case REACTIVE_HUNTER_PARRY: - if (getClass() == CLASS_HUNTER && HasAuraState(AURA_STATE_HUNTER_PARRY)) + if (GetClass() == CLASS_HUNTER && HasAuraState(AURA_STATE_HUNTER_PARRY)) ModifyAuraState(AURA_STATE_HUNTER_PARRY, false); break; case REACTIVE_OVERPOWER: - if (getClass() == CLASS_WARRIOR && GetTypeId() == TYPEID_PLAYER) + if (GetClass() == CLASS_WARRIOR && GetTypeId() == TYPEID_PLAYER) ToPlayer()->ClearComboPoints(); break; } @@ -10652,22 +10652,22 @@ void Unit::ApplyHasteRegenMod(WeaponAttackType att, float val, bool apply) if (val > 0.f) { - if (att == BASE_ATTACK && getClass() != CLASS_HUNTER) + if (att == BASE_ATTACK && GetClass() != CLASS_HUNTER) ApplyPercentModFloatVar(amount, val, !apply); - else if (att == RANGED_ATTACK && getClass() == CLASS_HUNTER) + else if (att == RANGED_ATTACK && GetClass() == CLASS_HUNTER) ApplyPercentModFloatVar(amount, val, !apply); } else { - if (att == BASE_ATTACK && getClass() != CLASS_HUNTER) + if (att == BASE_ATTACK && GetClass() != CLASS_HUNTER) ApplyPercentModFloatVar(amount, -val, apply); - else if (att == RANGED_ATTACK && getClass() == CLASS_HUNTER) + else if (att == RANGED_ATTACK && GetClass() == CLASS_HUNTER) ApplyPercentModFloatVar(amount, -val, apply); } SetFloatValue(PLAYER_FIELD_MOD_HASTE_REGEN, amount); - if (getClass() == CLASS_DEATH_KNIGHT) + if (GetClass() == CLASS_DEATH_KNIGHT) ToPlayer()->UpdatePowerRegeneration(POWER_RUNE); } @@ -10751,7 +10751,7 @@ uint32 Unit::GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectTyp if (overTime > 0 && CastingTime > 0 && DirectDamage) { // mainly for DoTs which are 3500 here otherwise - uint32 OriginalCastTime = spellProto->CalcCastTime(getLevel()); + uint32 OriginalCastTime = spellProto->CalcCastTime(GetLevel()); if (OriginalCastTime > 7000) OriginalCastTime = 7000; if (OriginalCastTime < 1500) OriginalCastTime = 1500; // Portion to Over Time @@ -10840,7 +10840,7 @@ float Unit::CalculateDefaultCoefficient(SpellInfo const* spellInfo, DamageEffect DotFactor /= DotTicks; } - int32 CastingTime = spellInfo->IsChanneled() ? spellInfo->GetDuration() : spellInfo->CalcCastTime(getLevel()); + int32 CastingTime = spellInfo->IsChanneled() ? spellInfo->GetDuration() : spellInfo->CalcCastTime(GetLevel()); // Distribute Damage over multiple effects, reduce by AoE CastingTime = GetCastingTimeForBonus(spellInfo, damagetype, CastingTime); @@ -10901,7 +10901,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget, uint32 spell_id) return nullptr; } - uint8 level = getLevel(); + uint8 level = GetLevel(); InitTamedPet(pet, level, spell_id); @@ -10919,7 +10919,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; @@ -11617,7 +11617,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au AddUnitState(UNIT_STATE_POSSESSED); break; case CHARM_TYPE_CHARM: - if (GetTypeId() == TYPEID_UNIT && charmer->getClass() == CLASS_WARLOCK) + if (GetTypeId() == TYPEID_UNIT && charmer->GetClass() == CLASS_WARLOCK) { CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate(); if (cinfo && cinfo->type == CREATURE_TYPE_DEMON) @@ -11716,7 +11716,7 @@ void Unit::RemoveCharmedBy(Unit* charmer) RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_POSSESSED); break; case CHARM_TYPE_CHARM: - if (GetTypeId() == TYPEID_UNIT && charmer->getClass() == CLASS_WARLOCK) + if (GetTypeId() == TYPEID_UNIT && charmer->GetClass() == CLASS_WARLOCK) { CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate(); if (cinfo && cinfo->type == CREATURE_TYPE_DEMON) @@ -11761,7 +11761,7 @@ void Unit::RemoveCharmedBy(Unit* charmer) void Unit::RestoreFaction() { if (GetTypeId() == TYPEID_PLAYER) - ToPlayer()->SetFactionForRace(getRace()); + ToPlayer()->SetFactionForRace(GetRace()); else { if (HasUnitTypeMask(UNIT_MASK_MINION)) @@ -12213,7 +12213,7 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const { case FORM_CAT: // Based on Hair color - if (getRace() == RACE_NIGHTELF) + if (GetRace() == RACE_NIGHTELF) { uint8 hairColor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID); switch (hairColor) @@ -12233,7 +12233,7 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const return 892; } } - else if (getRace() == RACE_TROLL) + else if (GetRace() == RACE_TROLL) { uint8 hairColor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID); switch (hairColor) @@ -12255,12 +12255,12 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const return 33669; } } - else if (getRace() == RACE_WORGEN) + else if (GetRace() == RACE_WORGEN) { // Based on Skin color uint8 skinColor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID); // Male - if (getGender() == GENDER_MALE) + if (GetGender() == GENDER_MALE) { switch (skinColor) { @@ -12300,11 +12300,11 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const } } // Based on Skin color - else if (getRace() == RACE_TAUREN) + else if (GetRace() == RACE_TAUREN) { uint8 skinColor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID); // Male - if (getGender() == GENDER_MALE) + if (GetGender() == GENDER_MALE) { switch (skinColor) { @@ -12355,13 +12355,13 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const } } } - else if (Player::TeamForRace(getRace()) == ALLIANCE) + else if (Player::TeamForRace(GetRace()) == ALLIANCE) return 892; else return 8571; case FORM_BEAR: // Based on Hair color - if (getRace() == RACE_NIGHTELF) + if (GetRace() == RACE_NIGHTELF) { uint8 hairColor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID); switch (hairColor) @@ -12380,7 +12380,7 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const return 2281; } } - else if (getRace() == RACE_TROLL) + else if (GetRace() == RACE_TROLL) { uint8 hairColor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID); switch (hairColor) @@ -12403,12 +12403,12 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const return 33655; } } - else if (getRace() == RACE_WORGEN) + else if (GetRace() == RACE_WORGEN) { // Based on Skin color uint8 skinColor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID); // Male - if (getGender() == GENDER_MALE) + if (GetGender() == GENDER_MALE) { switch (skinColor) { @@ -12448,11 +12448,11 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const } } // Based on Skin color - else if (getRace() == RACE_TAUREN) + else if (GetRace() == RACE_TAUREN) { uint8 skinColor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID); // Male - if (getGender() == GENDER_MALE) + if (GetGender() == GENDER_MALE) { switch (skinColor) { @@ -12503,24 +12503,24 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const } } } - else if (Player::TeamForRace(getRace()) == ALLIANCE) + else if (Player::TeamForRace(GetRace()) == ALLIANCE) return 2281; else return 2289; case FORM_FLIGHT: - if (Player::TeamForRace(getRace()) == ALLIANCE) + if (Player::TeamForRace(GetRace()) == ALLIANCE) return 20857; return 20872; case FORM_FLIGHT_EPIC: - if (Player::TeamForRace(getRace()) == ALLIANCE) - return (getRace() == RACE_WORGEN ? 37729 : 21243); - if (getRace() == RACE_TROLL) + if (Player::TeamForRace(GetRace()) == ALLIANCE) + return (GetRace() == RACE_WORGEN ? 37729 : 21243); + if (GetRace() == RACE_TROLL) return 37730; return 21244; case FORM_MOONKIN: - if (getRace() == RACE_TROLL) + if (GetRace() == RACE_TROLL) return 37174; - if (getRace() == RACE_WORGEN) + if (GetRace() == RACE_WORGEN) return 37173; return 15374; case FORM_GHOSTWOLF: @@ -12541,13 +12541,13 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const return formEntry->CreatureDisplayID[0]; else { - if (Player::TeamForRace(getRace()) == ALLIANCE) + if (Player::TeamForRace(GetRace()) == ALLIANCE) modelid = formEntry->CreatureDisplayID[0]; else modelid = formEntry->CreatureDisplayID[1]; // If the player is horde but there are no values for the horde modelid - take the alliance modelid - if (!modelid && Player::TeamForRace(getRace()) == HORDE) + if (!modelid && Player::TeamForRace(GetRace()) == HORDE) modelid = formEntry->CreatureDisplayID[0]; } } @@ -12557,7 +12557,7 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const uint32 Unit::GetModelForTotem(PlayerTotemType totemType) { - switch (getRace()) + switch (GetRace()) { case RACE_ORC: { @@ -14196,7 +14196,7 @@ void Unit::Talk(uint32 textId, ChatMsg msgType, float textRange, WorldObject con return; } - Trinity::BroadcastTextBuilder builder(this, msgType, textId, getGender(), target); + Trinity::BroadcastTextBuilder builder(this, msgType, textId, GetGender(), target); Trinity::LocalizedPacketDo localizer(builder); Trinity::PlayerDistWorker > worker(this, textRange, localizer); Cell::VisitWorldObjects(this, worker, textRange); @@ -14231,7 +14231,7 @@ void Unit::Whisper(uint32 textId, Player* target, bool isBossWhisper /*= false*/ LocaleConstant locale = target->GetSession()->GetSessionDbLocaleIndex(); WorldPacket data; - ChatHandler::BuildChatPacket(data, isBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, getGender()), 0, "", locale); + ChatHandler::BuildChatPacket(data, isBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, GetGender()), 0, "", locale); target->SendDirectMessage(&data); } @@ -14455,7 +14455,7 @@ void Unit::ProcessPendingSpellCastRequest() { if (Unit* target = targets.GetUnitTarget()) { - SpellInfo const* actualSpellInfo = spellInfo->GetAuraRankForLevel(target->getLevel()); + SpellInfo const* actualSpellInfo = spellInfo->GetAuraRankForLevel(target->GetLevel()); // if rank not found then function return NULL but in explicit cast case original spell can be cast and later failed with appropriate error message if (actualSpellInfo) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 701575b97a8..3818f3d864b 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -886,14 +886,14 @@ class TC_GAME_API Unit : public WorldObject bool IsVehicle() const { return (m_unitTypeMask & UNIT_MASK_VEHICLE) != 0; } bool IsControlableGuardian() const { return (m_unitTypeMask & UNIT_MASK_CONTROLABLE_GUARDIAN) != 0; } - uint8 getLevel() const { return uint8(GetUInt32Value(UNIT_FIELD_LEVEL)); } - uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return getLevel(); } + uint8 GetLevel() const { return uint8(GetUInt32Value(UNIT_FIELD_LEVEL)); } + uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return GetLevel(); } void SetLevel(uint8 lvl); - uint8 getRace() const { return GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_RACE); } - uint32 getRaceMask() const { return 1 << (getRace()-1); } - uint8 getClass() const { return GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS); } - uint32 getClassMask() const { return 1 << (getClass()-1); } - uint8 getGender() const { return GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER); } + uint8 GetRace() const { return GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_RACE); } + uint32 GetRaceMask() const { return 1 << (GetRace()-1); } + uint8 GetClass() const { return GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS); } + uint32 GetClassMask() const { return 1 << (GetClass()-1); } + uint8 GetGender() const { return GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER); } float GetStat(Stats stat) const { return float(GetUInt32Value(UNIT_FIELD_STAT0 + AsUnderlyingType(stat))); } void SetStat(Stats stat, int32 val) { SetStatInt32Value(UNIT_FIELD_STAT0 + AsUnderlyingType(stat), val); } @@ -982,7 +982,7 @@ class TC_GAME_API Unit : public WorldObject void RemoveStandFlags(uint8 flags) { RemoveByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_VIS_FLAG, flags); } bool IsMounted() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT); } - uint32 GetMountID() const { return GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID); } + uint32 GetMountDisplayId() const { return GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID); } void Mount(uint32 mount, uint32 vehicleId = 0, uint32 creatureEntry = 0); void Dismount(); MountCapabilityEntry const* GetMountCapability(uint32 mountType) const; @@ -991,7 +991,7 @@ class TC_GAME_API Unit : public WorldObject void SendDurabilityLoss(Player* receiver, uint32 percent); void PlayOneShotAnimKitId(uint16 animKitId); - uint32 GetMaxSkillValueForLevel(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; } + uint32 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, uint32 unmitigatedDamage = 0, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = nullptr, bool durabilityLoss = true); static void Kill(Unit* attacker, Unit* victim, bool durabilityLoss = true); @@ -1113,7 +1113,7 @@ class TC_GAME_API Unit : public WorldObject bool HasStealthAura() const { return HasAuraType(SPELL_AURA_MOD_STEALTH); } bool HasInvisibilityAura() const { return HasAuraType(SPELL_AURA_MOD_INVISIBILITY); } bool isFeared() const { return HasAuraType(SPELL_AURA_MOD_FEAR); } - bool isInRoots() const { return HasAuraType(SPELL_AURA_MOD_ROOT); } + bool IsRooted() const { return HasAuraType(SPELL_AURA_MOD_ROOT); } bool IsPolymorphed() const; bool isFrozen() const; diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 93d5e8b8389..8a640122be9 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -71,7 +71,7 @@ m_masterLooterGuid(), m_subGroupsCounts(nullptr), m_guid(), m_counter(0), m_dbSt { m_disenchantInfo.Initialize(); - for (uint8 i = 0; i < TARGETICONCOUNT; ++i) + for (uint8 i = 0; i < TARGET_ICONS_COUNT; ++i) m_targetIcons[i].Clear(); } @@ -179,7 +179,7 @@ void Group::LoadGroupFromDB(Field* fields) m_looterGuid = ObjectGuid(HighGuid::Player, fields[2].GetUInt32()); m_lootThreshold = ItemQualities(fields[3].GetUInt8()); - for (uint8 i = 0; i < TARGETICONCOUNT; ++i) + for (uint8 i = 0; i < TARGET_ICONS_COUNT; ++i) m_targetIcons[i].Set(fields[4 + i].GetUInt64()); m_groupFlags = GroupFlags(fields[12].GetUInt8()); @@ -400,7 +400,7 @@ bool Group::AddMember(Player* player) bool groupFound = false; for (; subGroup < MAX_RAID_SUBGROUPS; ++subGroup) { - if (m_subGroupsCounts[subGroup] < MAXGROUPSIZE) + if (m_subGroupsCounts[subGroup] < MAX_GROUP_SIZE) { groupFound = true; break; @@ -438,7 +438,7 @@ bool Group::AddMember(Player* player) if (!isRaidGroup()) // reset targetIcons for non-raid-groups { - for (uint8 i = 0; i < TARGETICONCOUNT; ++i) + for (uint8 i = 0; i < TARGET_ICONS_COUNT; ++i) m_targetIcons[i].Clear(); } @@ -467,7 +467,7 @@ bool Group::AddMember(Player* player) player->ResetInstances(INSTANCE_RESET_GROUP_JOIN, false); player->ResetInstances(INSTANCE_RESET_GROUP_JOIN, true); - if (player->getLevel() >= LEVELREQUIREMENT_HEROIC) + if (player->GetLevel() >= LEVELREQUIREMENT_HEROIC) { if (player->GetDungeonDifficulty() != GetDungeonDifficulty()) { @@ -1615,12 +1615,12 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap) void Group::SetTargetIcon(uint8 id, ObjectGuid whoGuid, ObjectGuid targetGuid) { - if (id >= TARGETICONCOUNT) + if (id >= TARGET_ICONS_COUNT) return; // clean other icons if (targetGuid) - for (int i=0; igetLevel() < levelMin || member->getLevel() > levelMax) + if (member->GetLevel() < levelMin || member->GetLevel() > levelMax) return false; return true; @@ -2172,7 +2172,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* if (!reference) return ERR_BATTLEGROUND_JOIN_FAILED; - PvPDifficultyEntry const* bracketEntry = sDBCManager.GetBattlegroundBracketByLevel(bgOrTemplate->GetMapId(), reference->getLevel()); + PvPDifficultyEntry const* bracketEntry = sDBCManager.GetBattlegroundBracketByLevel(bgOrTemplate->GetMapId(), reference->GetLevel()); if (!bracketEntry) return ERR_BATTLEGROUND_JOIN_FAILED; @@ -2193,7 +2193,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* if (member->GetTeam() != team) return ERR_BATTLEGROUND_JOIN_TIMED_OUT; // not in the same battleground level braket, don't let join - PvPDifficultyEntry const* memberBracketEntry = sDBCManager.GetBattlegroundBracketByLevel(bracketEntry->MapID, member->getLevel()); + PvPDifficultyEntry const* memberBracketEntry = sDBCManager.GetBattlegroundBracketByLevel(bracketEntry->MapID, member->GetLevel()); if (memberBracketEntry != bracketEntry) return ERR_BATTLEGROUND_JOIN_RANGE_INDEX; // don't let join rated matches if the arena team id doesn't match @@ -2589,7 +2589,7 @@ uint8 Group::GetLfgRoles(ObjectGuid guid) bool Group::IsFull() const { - return isRaidGroup() ? (m_memberSlots.size() >= MAXRAIDSIZE) : (m_memberSlots.size() >= MAXGROUPSIZE); + return isRaidGroup() ? (m_memberSlots.size() >= MAXRAIDSIZE) : (m_memberSlots.size() >= MAX_GROUP_SIZE); } bool Group::isLFGGroup() const @@ -2708,7 +2708,7 @@ bool Group::SameSubGroup(ObjectGuid guid1, MemberSlot const* slot2) const bool Group::HasFreeSlotSubGroup(uint8 subgroup) const { - return (m_subGroupsCounts && m_subGroupsCounts[subgroup] < MAXGROUPSIZE); + return (m_subGroupsCounts && m_subGroupsCounts[subgroup] < MAX_GROUP_SIZE); } diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index 5d2e051e1b3..a97a1b5bf37 100644 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -39,10 +39,10 @@ class WorldSession; struct MapEntry; -#define MAXGROUPSIZE 5 +#define MAX_GROUP_SIZE 5 #define MAXRAIDSIZE 40 -#define MAX_RAID_SUBGROUPS MAXRAIDSIZE/MAXGROUPSIZE -#define TARGETICONCOUNT 8 +#define MAX_RAID_SUBGROUPS MAXRAIDSIZE/MAX_GROUP_SIZE +#define TARGET_ICONS_COUNT 8 #define SPELL_RAID_MARKER 84996 enum RollVote @@ -421,7 +421,7 @@ class TC_GAME_API Group Difficulty m_raidDifficulty; Battleground* m_bgGroup; Battlefield* m_bfGroup; - ObjectGuid m_targetIcons[TARGETICONCOUNT]; + ObjectGuid m_targetIcons[TARGET_ICONS_COUNT]; LootMethod m_lootMethod; ItemQualities m_lootThreshold; ObjectGuid m_looterGuid; diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index a9513b71ff8..75e6df594d1 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -593,8 +593,8 @@ Guild::Member::Member(ObjectGuid::LowType guildId, ObjectGuid guid, uint8 rankId void Guild::Member::SetStats(Player* player) { m_name = player->GetName(); - m_level = player->getLevel(); - m_class = player->getClass(); + m_level = player->GetLevel(); + m_class = player->GetClass(); m_zoneId = player->GetZoneId(); _gender = player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER); m_accountId = player->GetSession()->GetAccountId(); diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index c2620a3b28d..d56d7c04e35 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -58,7 +58,7 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket& recvData) //this void causes that auction window is opened void WorldSession::SendAuctionHello(ObjectGuid guid, Creature* unit) { - if (GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ)) + if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ)) { SendNotification(GetTrinityString(LANG_AUCTION_REQ), sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ)); return; diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index f3964d1845e..80445bf46f1 100644 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -138,7 +138,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData) return; // expected bracket entry - PvPDifficultyEntry const* bracketEntry = sDBCManager.GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel()); + PvPDifficultyEntry const* bracketEntry = sDBCManager.GetBattlegroundBracketByLevel(bg->GetMapId(), _player->GetLevel()); if (!bracketEntry) return; @@ -494,7 +494,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) bgTypeId = bg->GetTypeID(); // expected bracket entry - PvPDifficultyEntry const* bracketEntry = sDBCManager.GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel()); + PvPDifficultyEntry const* bracketEntry = sDBCManager.GetBattlegroundBracketByLevel(bg->GetMapId(), _player->GetLevel()); if (!bracketEntry) return; @@ -512,10 +512,10 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) TC_LOG_DEBUG("bg.battleground", "Player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName().c_str(), _player->GetGUID().GetCounter()); } //if player don't match battleground max level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue - if (_player->getLevel() > bg->GetMaxLevel()) + if (_player->GetLevel() > bg->GetMaxLevel()) { TC_LOG_DEBUG("network", "Player %s (%u) has level (%u) higher than maxlevel (%u) of battleground (%u)! Do not port him to battleground!", - _player->GetName().c_str(), _player->GetGUID().GetCounter(), _player->getLevel(), bg->GetMaxLevel(), bg->GetTypeID()); + _player->GetName().c_str(), _player->GetGUID().GetCounter(), _player->GetLevel(), bg->GetMaxLevel(), bg->GetTypeID()); action = 0; } } @@ -669,7 +669,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/) continue; // expected bracket entry - PvPDifficultyEntry const* bracketEntry = sDBCManager.GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel()); + PvPDifficultyEntry const* bracketEntry = sDBCManager.GetBattlegroundBracketByLevel(bg->GetMapId(), _player->GetLevel()); if (!bracketEntry) continue; @@ -714,7 +714,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData) BattlegroundTypeId bgTypeId = bg->GetTypeID(); BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, arenatype); - PvPDifficultyEntry const* bracketEntry = sDBCManager.GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel()); + PvPDifficultyEntry const* bracketEntry = sDBCManager.GetBattlegroundBracketByLevel(bg->GetMapId(), _player->GetLevel()); if (!bracketEntry) return; diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 32218268772..b484364184b 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -645,7 +645,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData) { TC_LOG_INFO("entities.player.character", "Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), GetRemoteAddress().c_str(), newChar->GetName().c_str(), newChar->GetGUID().GetCounter()); sScriptMgr->OnPlayerCreate(newChar.get()); - sCharacterCache->AddCharacterCacheEntry(newChar->GetGUID(), GetAccountId(), newChar->GetName(), newChar->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER), newChar->getRace(), newChar->getClass(), newChar->getLevel()); + sCharacterCache->AddCharacterCacheEntry(newChar->GetGUID(), GetAccountId(), newChar->GetName(), newChar->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER), newChar->GetRace(), newChar->GetClass(), newChar->GetLevel()); SendCharCreate(CHAR_CREATE_SUCCESS); } @@ -891,11 +891,11 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder const& holder) { pCurrChar->setCinematic(1); - if (ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(pCurrChar->getClass())) + if (ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(pCurrChar->GetClass())) { if (cEntry->CinematicSequenceID) pCurrChar->SendCinematicStart(cEntry->CinematicSequenceID); - else if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(pCurrChar->getRace())) + else if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(pCurrChar->GetRace())) pCurrChar->SendCinematicStart(rEntry->CinematicSequenceID); // send new char string if not empty @@ -1003,7 +1003,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder const& holder) { pCurrChar->RemoveAtLoginFlag(AT_LOGIN_FIRST); - PlayerInfo const* info = sObjectMgr->GetPlayerInfo(pCurrChar->getRace(), pCurrChar->getClass()); + PlayerInfo const* info = sObjectMgr->GetPlayerInfo(pCurrChar->GetRace(), pCurrChar->GetClass()); for (uint32 spellId : info->castSpells) pCurrChar->CastSpell(pCurrChar, spellId, true); @@ -1086,7 +1086,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder const& holder) } } - if (pCurrChar->getClass() == CLASS_HUNTER) + if (pCurrChar->GetClass() == CLASS_HUNTER) pCurrChar->GetSession()->SendStablePet(ObjectGuid::Empty); // show time before shutdown if shutdown planned. @@ -1101,7 +1101,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder const& holder) std::string IP_str = GetRemoteAddress(); TC_LOG_INFO("entities.player.character", "Account: %d (IP: %s) Login Character:[%s] (GUID: %u) Level: %d", - GetAccountId(), IP_str.c_str(), pCurrChar->GetName().c_str(), pCurrChar->GetGUID().GetCounter(), pCurrChar->getLevel()); + GetAccountId(), IP_str.c_str(), pCurrChar->GetName().c_str(), pCurrChar->GetGUID().GetCounter(), pCurrChar->GetLevel()); if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STATE_STUNNED)) pCurrChar->SetStandState(UNIT_STAND_STATE_STAND); @@ -1379,20 +1379,20 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData) BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair); - if (!bs_hair || bs_hair->Type != 0 || bs_hair->Race != _player->getRace() || bs_hair->Sex != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER)) + if (!bs_hair || bs_hair->Type != 0 || bs_hair->Race != _player->GetRace() || bs_hair->Sex != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER)) return; BarberShopStyleEntry const* bs_facialHair = sBarberShopStyleStore.LookupEntry(FacialHair); - if (!bs_facialHair || bs_facialHair->Type != 2 || bs_facialHair->Race != _player->getRace() || bs_facialHair->Sex != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER)) + if (!bs_facialHair || bs_facialHair->Type != 2 || bs_facialHair->Race != _player->GetRace() || bs_facialHair->Sex != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER)) return; BarberShopStyleEntry const* bs_skinColor = sBarberShopStyleStore.LookupEntry(SkinColor); - if (bs_skinColor && (bs_skinColor->Type != 3 || bs_skinColor->Race != _player->getRace() || bs_skinColor->Sex != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER))) + if (bs_skinColor && (bs_skinColor->Type != 3 || bs_skinColor->Race != _player->GetRace() || bs_skinColor->Sex != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER))) return; - if (!Player::ValidateAppearance(_player->getRace(), _player->getClass(), _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER), + if (!Player::ValidateAppearance(_player->GetRace(), _player->GetClass(), _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER), bs_hair->Data, Color, _player->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID), diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 8df27ce44ce..1e7713d87cf 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -311,7 +311,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) if (!sender->IsAlive()) return; - if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ)) + if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ)) { SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ)); return; @@ -331,7 +331,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) if (!sender->IsAlive()) return; - if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_EMOTE_LEVEL_REQ)) + if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_EMOTE_LEVEL_REQ)) { SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_EMOTE_LEVEL_REQ)); return; @@ -351,7 +351,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) if (!sender->IsAlive()) return; - if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_YELL_LEVEL_REQ)) + if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_YELL_LEVEL_REQ)) { SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_YELL_LEVEL_REQ)); return; @@ -379,7 +379,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) SendPlayerNotFoundNotice(to); return; } - if (!sender->IsGameMaster() && sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) && !receiver->IsInWhisperWhiteList(sender->GetGUID())) + if (!sender->IsGameMaster() && sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) && !receiver->IsInWhisperWhiteList(sender->GetGUID())) { SendNotification(GetTrinityString(LANG_WHISPER_REQ), sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ)); return; @@ -399,7 +399,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) // If player is a Gamemaster and doesn't accept whisper, we auto-whitelist every player that the Gamemaster is talking to // We also do that if a player is under the required level for whispers. - if (receiver->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) || + if (receiver->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) || (HasPermission(rbac::RBAC_PERM_CAN_FILTER_WHISPERS) && !sender->isAcceptWhispers() && !sender->IsInWhisperWhiteList(receiver->GetGUID()))) sender->AddWhisperWhiteList(receiver->GetGUID()); @@ -540,7 +540,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) { if (!HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHAT_CHANNEL_REQ)) { - if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ)) + if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ)) { SendNotification(GetTrinityString(LANG_CHANNEL_REQ), sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ)); return; diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 2781ddf851f..f914ec7f9fa 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -121,7 +121,7 @@ void WorldSession::HandlePartyInviteOpcode(WorldPackets::Party::PartyInviteClien return; } - if (!invitedPlayer->GetSocial()->HasFriend(invitingPlayer->GetGUID()) && invitingPlayer->getLevel() < sWorld->getIntConfig(CONFIG_PARTY_LEVEL_REQ)) + if (!invitedPlayer->GetSocial()->HasFriend(invitingPlayer->GetGUID()) && invitingPlayer->GetLevel() < sWorld->getIntConfig(CONFIG_PARTY_LEVEL_REQ)) { SendPartyResult(PARTY_OP_INVITE, packet.TargetName, ERR_INVITE_RESTRICTED); return; diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 5d8fef61d5f..b69355c35c7 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -649,7 +649,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid) if (!_player->IsGameMaster()) // ignore conditions if GM on { // Respect allowed class - if (!(itemTemplate->GetAllowableClass() & _player->getClassMask()) && itemTemplate->GetBonding() == BIND_ON_ACQUIRE) + if (!(itemTemplate->GetAllowableClass() & _player->GetClassMask()) && itemTemplate->GetBonding() == BIND_ON_ACQUIRE) continue; // Only display items in vendor lists for the team the player is on diff --git a/src/server/game/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp index d26903504d3..c927a0255b9 100644 --- a/src/server/game/Handlers/LFGHandler.cpp +++ b/src/server/game/Handlers/LFGHandler.cpp @@ -33,7 +33,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPackets::LFG::LFGJoin& lfgJoin) { if (!sLFGMgr->isOptionEnabled(lfg::LFG_OPTION_ENABLE_DUNGEON_FINDER | lfg::LFG_OPTION_ENABLE_RAID_BROWSER) || (GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->GetLeaderGUID() != GetPlayer()->GetGUID() && - (GetPlayer()->GetGroup()->GetMembersCount() == MAXGROUPSIZE || !GetPlayer()->GetGroup()->isLFGGroup()))) + (GetPlayer()->GetGroup()->GetMembersCount() == MAX_GROUP_SIZE || !GetPlayer()->GetGroup()->isLFGGroup()))) return; if (!lfgJoin.Slots.size()) @@ -89,7 +89,7 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPackets::LFG::LFGSetRoles& lfgSe gguid.ToString().c_str(), GetPlayerInfo().c_str(), lfgSetRoles.RolesDesired); // Role validation - if (!sLFGMgr->CanPerformSelectedRoles(GetPlayer()->getClass(), lfgSetRoles.RolesDesired)) + if (!sLFGMgr->CanPerformSelectedRoles(GetPlayer()->GetClass(), lfgSetRoles.RolesDesired)) lfgSetRoles.RolesDesired = 0; sLFGMgr->UpdateRoleCheck(gguid, guid, lfgSetRoles.RolesDesired); @@ -133,7 +133,7 @@ void WorldSession::SendLfgPlayerLockInfo() TC_LOG_DEBUG("lfg", "SMSG_LFG_PLAYER_INFO %s", GetPlayerInfo().c_str()); // Get Random dungeons that can be done at a certain level and expansion - uint8 level = _player->getLevel(); + uint8 level = _player->GetLevel(); lfg::LfgDungeonSet const& randomDungeons = sLFGMgr->GetRandomAndSeasonalDungeons(level, GetExpansion()); WorldPackets::LFG::LFGPlayerInfo lfgPlayerInfo; @@ -194,7 +194,7 @@ void WorldSession::SendLfgPlayerLockInfo() if (currentQuest) { playerDungeonInfo.Rewards.RewardMoney = currentQuest->GetRewOrReqMoney(_player); - playerDungeonInfo.Rewards.RewardXP = _player->getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) ? currentQuest->GetXPReward(_player) : 0; + playerDungeonInfo.Rewards.RewardXP = _player->GetLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) ? currentQuest->GetXPReward(_player) : 0; for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) if (uint32 itemId = currentQuest->RewardItemId[i]) playerDungeonInfo.Rewards.Item.emplace_back(itemId, currentQuest->RewardItemIdCount[i]); @@ -214,7 +214,7 @@ void WorldSession::SendLfgPlayerLockInfo() { playerDungeonInfo.ShortageEligible = true; playerDungeonInfo.ShortageReward.RewardMoney = shortageQuest->GetRewOrReqMoney(_player);; - playerDungeonInfo.ShortageReward.RewardXP = _player->getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) ? shortageQuest->GetXPReward(_player) : 0; + playerDungeonInfo.ShortageReward.RewardXP = _player->GetLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) ? shortageQuest->GetXPReward(_player) : 0; for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) if (uint32 itemId = shortageQuest->RewardItemId[i]) playerDungeonInfo.ShortageReward.Item.emplace_back(itemId, shortageQuest->RewardItemIdCount[i]); @@ -412,7 +412,7 @@ void WorldSession::SendLfgRoleCheckUpdate(lfg::LfgRoleCheck const& roleCheck) { // Leader info MUST be sent 1st :S uint8 roles = roleCheck.roles.find(roleCheck.leader)->second; - lfgRoleCheckUpdate.Members.emplace_back(roleCheck.leader, roles, ASSERT_NOTNULL(ObjectAccessor::FindConnectedPlayer(roleCheck.leader))->getLevel(), roles > 0); + lfgRoleCheckUpdate.Members.emplace_back(roleCheck.leader, roles, ASSERT_NOTNULL(ObjectAccessor::FindConnectedPlayer(roleCheck.leader))->GetLevel(), roles > 0); for (lfg::LfgRolesMap::const_iterator it = roleCheck.roles.begin(); it != roleCheck.roles.end(); ++it) { @@ -420,7 +420,7 @@ void WorldSession::SendLfgRoleCheckUpdate(lfg::LfgRoleCheck const& roleCheck) continue; roles = it->second; - lfgRoleCheckUpdate.Members.emplace_back(it->first, roles, ASSERT_NOTNULL(ObjectAccessor::FindConnectedPlayer(roleCheck.leader))->getLevel(), roles > 0); + lfgRoleCheckUpdate.Members.emplace_back(it->first, roles, ASSERT_NOTNULL(ObjectAccessor::FindConnectedPlayer(roleCheck.leader))->GetLevel(), roles > 0); } } @@ -494,12 +494,12 @@ void WorldSession::SendLfgPlayerReward(lfg::LfgPlayerRewardData const& rewardDat lfgPlayerReward.QueuedSlot = rewardData.rdungeonEntry; lfgPlayerReward.ActualSlot = rewardData.sdungeonEntry; uint32 rewardMoney = rewardData.quest->GetRewOrReqMoney(_player); - uint32 rewardExp = _player->getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) ? rewardData.quest->GetXPReward(_player) : 0; + uint32 rewardExp = _player->GetLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) ? rewardData.quest->GetXPReward(_player) : 0; if (rewardData.shortageQuest) { rewardMoney += rewardData.shortageQuest->GetRewOrReqMoney(_player); - rewardExp += _player->getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) ? rewardData.shortageQuest->GetXPReward(_player) : 0; + rewardExp += _player->GetLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) ? rewardData.shortageQuest->GetXPReward(_player) : 0; } lfgPlayerReward.RewardMoney = rewardMoney; diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 0be31fae0e8..912afbbfcd7 100644 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -89,7 +89,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData) { Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid); - bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING); + bool lootAllowed = creature && creature->IsAlive() == (player->GetClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING); if (!lootAllowed || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) { player->SendLootError(lguid, lootAllowed ? LOOT_ERROR_TOO_FAR : LOOT_ERROR_DIDNT_KILL); @@ -197,7 +197,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) case HighGuid::Vehicle: { Creature* creature = player->GetMap()->GetCreature(guid); - bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING); + bool lootAllowed = creature && creature->IsAlive() == (player->GetClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING); if (lootAllowed && creature->IsWithinDistInMap(player, INTERACTION_DISTANCE)) { loot = &creature->loot; @@ -412,7 +412,7 @@ void WorldSession::DoLootRelease(ObjectGuid lguid) { Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid); - bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING); + bool lootAllowed = creature && creature->IsAlive() == (player->GetClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING); if (!lootAllowed || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) return; diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 2a66ff7b1c2..85fb5aa15b0 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -154,7 +154,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) Player* player = _player; - if (player->getLevel() < sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ)) + if (player->GetLevel() < sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ)) { SendNotification(GetTrinityString(LANG_MAIL_SENDER_REQ), sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ)); return; @@ -214,7 +214,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) { receiverTeam = receiver->GetTeam(); mailsCount = receiver->GetMailSize(); - receiverLevel = receiver->getLevel(); + receiverLevel = receiver->GetLevel(); receiverAccountId = receiver->GetSession()->GetAccountId(); receiverBnetAccountId = receiver->GetSession()->GetBattlenetAccountId(); } diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index c75f2e49805..2a032868c8c 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1687,11 +1687,11 @@ void WorldSession::HandleOpeningCinematic(WorldPackets::Misc::OpeningCinematic& if (_player->GetUInt32Value(PLAYER_XP)) return; - if (ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(_player->getClass())) + if (ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(_player->GetClass())) { if (classEntry->CinematicSequenceID) _player->SendCinematicStart(classEntry->CinematicSequenceID); - else if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(_player->getRace())) + else if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(_player->GetRace())) _player->SendCinematicStart(raceEntry->CinematicSequenceID); } } diff --git a/src/server/game/Handlers/ReferAFriendHandler.cpp b/src/server/game/Handlers/ReferAFriendHandler.cpp index 07cbf86f9c2..5bf7c7a01e8 100644 --- a/src/server/game/Handlers/ReferAFriendHandler.cpp +++ b/src/server/game/Handlers/ReferAFriendHandler.cpp @@ -42,9 +42,9 @@ void WorldSession::HandleGrantLevel(WorldPacket& recvData) error = ERR_REFER_A_FRIEND_NOT_REFERRED_BY; else if (target->GetTeamId() != _player->GetTeamId()) error = ERR_REFER_A_FRIEND_DIFFERENT_FACTION; - else if (target->getLevel() >= _player->getLevel()) + else if (target->GetLevel() >= _player->GetLevel()) error = ERR_REFER_A_FRIEND_TARGET_TOO_HIGH; - else if (target->getLevel() >= sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL)) + else if (target->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL)) error = ERR_REFER_A_FRIEND_GRANT_LEVEL_MAX_I; else if (target->GetGroup() != _player->GetGroup()) error = ERR_REFER_A_FRIEND_NOT_IN_GROUP; @@ -85,5 +85,5 @@ void WorldSession::HandleAcceptGrantLevel(WorldPacket& recvData) else return; - _player->GiveLevel(_player->getLevel() + 1); + _player->GiveLevel(_player->GetLevel() + 1); } diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp index 43b1e0aafac..57b3fcdc56f 100644 --- a/src/server/game/Handlers/SkillHandler.cpp +++ b/src/server/game/Handlers/SkillHandler.cpp @@ -115,7 +115,7 @@ void WorldSession::HandleUnlearnSkillOpcode(WorldPacket& recvData) uint32 skillId; recvData >> skillId; - SkillRaceClassInfoEntry const* rcEntry = sDBCManager.GetSkillRaceClassInfo(skillId, GetPlayer()->getRace(), GetPlayer()->getClass()); + SkillRaceClassInfoEntry const* rcEntry = sDBCManager.GetSkillRaceClassInfo(skillId, GetPlayer()->GetRace(), GetPlayer()->GetClass()); if (!rcEntry || !(rcEntry->Flags & SKILL_FLAG_UNLEARNABLE)) return; diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 1b29f7e7a8f..e82234e1b96 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -496,9 +496,9 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket& recvData) WorldPacket data(SMSG_MIRRORIMAGE_DATA, 68); data << uint64(guid); data << uint32(creator->GetDisplayId()); - data << uint8(creator->getRace()); - data << uint8(creator->getGender()); - data << uint8(creator->getClass()); + data << uint8(creator->GetRace()); + data << uint8(creator->GetGender()); + data << uint8(creator->GetClass()); if (creator->GetTypeId() == TYPEID_PLAYER) { diff --git a/src/server/game/Handlers/TicketHandler.cpp b/src/server/game/Handlers/TicketHandler.cpp index f35697e5697..0e9c236cfe2 100644 --- a/src/server/game/Handlers/TicketHandler.cpp +++ b/src/server/game/Handlers/TicketHandler.cpp @@ -38,7 +38,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recvData) if (sTicketMgr->GetStatus() == GMTICKET_QUEUE_STATUS_DISABLED) return; - if (GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ)) + if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ)) { SendNotification(GetTrinityString(LANG_TICKET_REQ), sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ)); return; diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 1b68cb39b46..deeded7b6bf 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -614,7 +614,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPackets::Trade::InitiateTrade& return; } - if (GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ)) + if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ)) { SendNotification(GetTrinityString(LANG_TRADE_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ)); return; @@ -687,7 +687,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPackets::Trade::InitiateTrade& return; } - if (pOther->getLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ)) + if (pOther->GetLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ)) { SendNotification(GetTrinityString(LANG_TRADE_OTHER_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ)); return; diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index cb6fb71f821..a0fbc678d9e 100644 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -763,7 +763,7 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi ObjectGuid::LowType guildId = guild->GetId(); playersByGuild[guildId] = player; - uint8 playerLevel = player->getLevel(); + uint8 playerLevel = player->GetLevel(); // Determine the highest player level of the guild group auto it = minlevelByGuild.find(guildId); diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index b8b4c1a9ef0..22bc3b1559e 100644 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -180,7 +180,7 @@ namespace Trinity { float xpMod = 1.0f; - gain = BaseGain(player->getLevel(), u->getLevel(), sDBCManager.GetContentLevelsForMapAndZone(u->GetMapId(), u->GetZoneId())); + gain = BaseGain(player->GetLevel(), u->GetLevel(), sDBCManager.GetContentLevelsForMapAndZone(u->GetMapId(), u->GetZoneId())); if (gain && creature) { diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index b607546f2b4..1d193d788c7 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -245,7 +245,7 @@ uint32 Quest::GetXPReward(Player const* player) const if (!player) return 0; - return Quest::CalcXPReward(player->getLevel(), _level, _rewardXPDifficulty); + return Quest::CalcXPReward(player->GetLevel(), _level, _rewardXPDifficulty); } /*static*/ uint32 Quest::CalcXPReward(uint8 playerLevel, int32 targetLevel, uint8 xpDifficulty) diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index 27d3c5e91f2..23725fa78fe 100644 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -85,8 +85,8 @@ int32 ReputationMgr::GetBaseReputation(FactionEntry const* factionEntry) const if (!factionEntry) return 0; - uint32 raceMask = _player->getRaceMask(); - uint32 classMask = _player->getClassMask(); + uint32 raceMask = _player->GetRaceMask(); + uint32 classMask = _player->GetClassMask(); for (int i=0; i < 4; i++) { if ((factionEntry->ReputationRaceMask[i] & raceMask || @@ -140,8 +140,8 @@ uint32 ReputationMgr::GetDefaultStateFlags(FactionEntry const* factionEntry) con if (!factionEntry) return 0; - uint32 raceMask = _player->getRaceMask(); - uint32 classMask = _player->getClassMask(); + uint32 raceMask = _player->GetRaceMask(); + uint32 classMask = _player->GetClassMask(); for (int i=0; i < 4; i++) { if ((factionEntry->ReputationRaceMask[i] & raceMask || @@ -413,7 +413,7 @@ void ReputationMgr::SetVisible(FactionTemplateEntry const*factionTemplateEntry) if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->Faction)) // Never show factions of the opposing team - if (!(factionEntry->ReputationRaceMask[1] & _player->getRaceMask() && factionEntry->ReputationBase[1] == Reputation_Bottom)) + if (!(factionEntry->ReputationRaceMask[1] & _player->GetRaceMask() && factionEntry->ReputationBase[1] == Reputation_Bottom)) SetVisible(factionEntry); } diff --git a/src/server/game/Server/Packets/PartyPackets.cpp b/src/server/game/Server/Packets/PartyPackets.cpp index c731defc063..22c5e9d6211 100644 --- a/src/server/game/Server/Packets/PartyPackets.cpp +++ b/src/server/game/Server/Packets/PartyPackets.cpp @@ -88,7 +88,7 @@ void WorldPackets::Party::PartyMemberState::Initialize(Player const* player) MemberStats.Status |= MEMBER_STATUS_DND; // Level - MemberStats.Level = player->getLevel(); + MemberStats.Level = player->GetLevel(); // Health MemberStats.CurrentHealth = player->GetHealth(); diff --git a/src/server/game/Server/Packets/QueryPackets.cpp b/src/server/game/Server/Packets/QueryPackets.cpp index 2772de5d823..f45787a9107 100644 --- a/src/server/game/Server/Packets/QueryPackets.cpp +++ b/src/server/game/Server/Packets/QueryPackets.cpp @@ -171,10 +171,10 @@ bool WorldPackets::Query::PlayerGuidLookupData::Initialize(ObjectGuid const& gui ASSERT(player->GetGUID() == guid); Name = player->GetName(); - Race = player->getRace(); - Sex = player->getGender(); - ClassID = player->getClass(); - Level = player->getLevel(); + Race = player->GetRace(); + Sex = player->GetGender(); + ClassID = player->GetClass(); + Level = player->GetLevel(); if (DeclinedName const* names = player->GetDeclinedNames()) DeclinedNames = *names; diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index c36152888e1..1cb2c3e5e20 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -684,7 +684,7 @@ void WorldSession::LogoutPlayer(bool save) _player->SetDestroyedObject(true); _player->CleanupsBeforeDelete(); TC_LOG_INFO("entities.player.character", "Account: %d (IP: %s) Logout Character:[%s] (GUID: %u) Level: %d", - GetAccountId(), GetRemoteAddress().c_str(), _player->GetName().c_str(), _player->GetGUID().GetCounter(), _player->getLevel()); + GetAccountId(), GetRemoteAddress().c_str(), _player->GetName().c_str(), _player->GetGUID().GetCounter(), _player->GetLevel()); sBattlenetServer.SendChangeToonOnlineState(GetBattlenetAccountId(), GetAccountId(), _player->GetGUID(), _player->GetName(), false); diff --git a/src/server/game/Skills/Archaeology/ArchaeologySites.cpp b/src/server/game/Skills/Archaeology/ArchaeologySites.cpp index b98fb8d01ba..c6b87fa12b1 100644 --- a/src/server/game/Skills/Archaeology/ArchaeologySites.cpp +++ b/src/server/game/Skills/Archaeology/ArchaeologySites.cpp @@ -222,7 +222,7 @@ void Archaeology::RegeneratePosition(uint32 position, Continent continent) if (_site[position].Entry && sResearchSiteStore.LookupEntry(_site[position].Entry) && _site[position].State < DIGS_PER_SITE) return; - uint16 entry = sArchaeologyMgr->GetNewSite(continent, _site, _continentState[continent] == STATE_EXT, _player->getLevel()); + uint16 entry = sArchaeologyMgr->GetNewSite(continent, _site, _continentState[continent] == STATE_EXT, _player->GetLevel()); SetSite(position, entry); CharacterDatabase.PExecute("REPLACE INTO character_archaeology_sites values (%u, %u, %u, %u);", _player->GetGUID().GetCounter(), position, entry, _site[position].State); } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 796276dc029..ed132d056b3 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -564,7 +564,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (caster) { // if Level <= 70 resist = player level - int32 resist = caster->getLevel(); + int32 resist = caster->GetLevel(); if (resist > 70 && resist < 81) resist += (resist - 70) * 5; @@ -1920,7 +1920,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo if (!target->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT)) { target->SetShapeshiftForm(FORM_NONE); - if (target->getClass() == CLASS_DRUID) + if (target->GetClass() == CLASS_DRUID) { // Remove movement impairing effects also when shifting out target->RemoveAurasByShapeShift(); @@ -1988,7 +1988,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo else target->UpdateDisplayPower(); - if (target->getClass() == CLASS_DRUID) + if (target->GetClass() == CLASS_DRUID) { // Dash if (AuraEffect* aurEff = target->GetAuraEffect(SPELL_AURA_MOD_INCREASE_SPEED, SPELLFAMILY_DRUID, 0, 0, 0x8)) @@ -2050,47 +2050,47 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode, if (target->GetTypeId() != TYPEID_PLAYER) return; - switch (target->getRace()) + switch (target->GetRace()) { // Blood Elf case RACE_BLOODELF: - target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 17830 : 17829); + target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 17830 : 17829); break; // Orc case RACE_ORC: - target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10140 : 10139); + target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10140 : 10139); break; // Troll case RACE_TROLL: - target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10134 : 10135); + target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10134 : 10135); break; // Tauren case RACE_TAUREN: - target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10147 : 10136); + target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10147 : 10136); break; // Undead case RACE_UNDEAD_PLAYER: - target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10145 : 10146); + target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10145 : 10146); break; // Draenei case RACE_DRAENEI: - target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 17828 : 17827); + target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 17828 : 17827); break; // Dwarf case RACE_DWARF: - target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10142 : 10141); + target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10142 : 10141); break; // Gnome case RACE_GNOME: - target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10149 : 10148); + target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10149 : 10148); break; // Human case RACE_HUMAN: - target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10138 : 10137); + target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10138 : 10137); break; // Night Elf case RACE_NIGHTELF: - target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10144 : 10143); + target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10144 : 10143); break; default: break; @@ -2109,47 +2109,47 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode, if (target->GetTypeId() != TYPEID_PLAYER) return; - switch (target->getRace()) + switch (target->GetRace()) { // Blood Elf case RACE_BLOODELF: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 25032 : 25043); + target->SetDisplayId(target->GetGender() == GENDER_MALE ? 25032 : 25043); break; // Orc case RACE_ORC: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 25039 : 25050); + target->SetDisplayId(target->GetGender() == GENDER_MALE ? 25039 : 25050); break; // Troll case RACE_TROLL: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 25041 : 25052); + target->SetDisplayId(target->GetGender() == GENDER_MALE ? 25041 : 25052); break; // Tauren case RACE_TAUREN: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 25040 : 25051); + target->SetDisplayId(target->GetGender() == GENDER_MALE ? 25040 : 25051); break; // Undead case RACE_UNDEAD_PLAYER: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 25042 : 25053); + target->SetDisplayId(target->GetGender() == GENDER_MALE ? 25042 : 25053); break; // Draenei case RACE_DRAENEI: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 25033 : 25044); + target->SetDisplayId(target->GetGender() == GENDER_MALE ? 25033 : 25044); break; // Dwarf case RACE_DWARF: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 25034 : 25045); + target->SetDisplayId(target->GetGender() == GENDER_MALE ? 25034 : 25045); break; // Gnome case RACE_GNOME: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 25035 : 25046); + target->SetDisplayId(target->GetGender() == GENDER_MALE ? 25035 : 25046); break; // Human case RACE_HUMAN: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 25037 : 25048); + target->SetDisplayId(target->GetGender() == GENDER_MALE ? 25037 : 25048); break; // Night Elf case RACE_NIGHTELF: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 25038 : 25049); + target->SetDisplayId(target->GetGender() == GENDER_MALE ? 25038 : 25049); break; default: break; @@ -2163,15 +2163,15 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode, // Honor the Dead case 65386: case 65495: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 29203 : 29204); + target->SetDisplayId(target->GetGender() == GENDER_MALE ? 29203 : 29204); break; // Darkspear Pride case 75532: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 31737 : 31738); + target->SetDisplayId(target->GetGender() == GENDER_MALE ? 31737 : 31738); break; // Gnomeregan Pride case 75531: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 31654 : 31655); + target->SetDisplayId(target->GetGender() == GENDER_MALE ? 31654 : 31655); break; default: break; @@ -2208,7 +2208,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode, target->SetDisplayId(model_id); // Dragonmaw Illusion (set mount model also) - if (GetId() == 42016 && target->GetMountID() && !target->GetAuraEffectsByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED).empty()) + if (GetId() == 42016 && target->GetMountDisplayId() && !target->GetAuraEffectsByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED).empty()) target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 16314); } } @@ -2233,7 +2233,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode, target->RestoreDisplayId(); // Dragonmaw Illusion (restore mount model) - if (GetId() == 42016 && target->GetMountID() == 16314) + if (GetId() == 42016 && target->GetMountDisplayId() == 16314) { if (!target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).empty()) { @@ -3201,7 +3201,7 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply); // Dragonmaw Illusion (overwrite mount model, mounted aura already applied) - if (apply && target->HasAuraEffect(42016, 0) && target->GetMountID()) + if (apply && target->HasAuraEffect(42016, 0) && target->GetMountDisplayId()) target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 16314); } } @@ -4275,7 +4275,7 @@ void AuraEffect::HandleAuraModRangedAttackPower(AuraApplication const* aurApp, u Unit* target = aurApp->GetTarget(); - if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0) + if ((target->GetClassMask() & CLASSMASK_WAND_USERS) != 0) return; target->HandleStatFlatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(GetAmount()), apply); @@ -4305,7 +4305,7 @@ void AuraEffect::HandleAuraModRangedAttackPowerPercent(AuraApplication const* au Unit* target = aurApp->GetTarget(); - if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0) + if ((target->GetClassMask() & CLASSMASK_WAND_USERS) != 0) return; //UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1 @@ -4588,7 +4588,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool { if (caster) { - if (caster->getGender() == GENDER_FEMALE) + if (caster->GetGender() == GENDER_FEMALE) caster->CastSpell(target, 37095, this); // Blood Elf Disguise else caster->CastSpell(target, 37093, this); @@ -4605,7 +4605,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool case 46354: // Blood Elf Illusion if (caster) { - if (caster->getGender() == GENDER_FEMALE) + if (caster->GetGender() == GENDER_FEMALE) caster->CastSpell(target, 46356, this); else caster->CastSpell(target, 46355, this); @@ -5062,7 +5062,7 @@ void AuraEffect::HandleAuraConvertRune(AuraApplication const* aurApp, uint8 mode if (!player) return; - if (player->getClass() != CLASS_DEATH_KNIGHT) + if (player->GetClass() != CLASS_DEATH_KNIGHT) return; /* @@ -5385,7 +5385,7 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const { if (target->GetTypeId() != TYPEID_PLAYER) return; - if (target->ToPlayer()->getClass() != CLASS_DEATH_KNIGHT) + if (target->ToPlayer()->GetClass() != CLASS_DEATH_KNIGHT) return; // timer expired - remove death runes diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 0c860a39f99..6e7a0a68a34 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -463,7 +463,7 @@ m_procCooldown(std::chrono::steady_clock::time_point::min()) _casterInfo.Level = m_spellInfo->SpellLevel; if (createInfo.Caster) { - _casterInfo.Level = createInfo.Caster->getLevel(); + _casterInfo.Level = createInfo.Caster->GetLevel(); _casterInfo.ApplyResilience = createInfo.Caster->CanApplyResilience(); SaveCasterInfo(createInfo.Caster); } @@ -1529,7 +1529,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b break; if (target->GetTypeId() != TYPEID_PLAYER) break; - if (target->ToPlayer()->getClass() != CLASS_DEATH_KNIGHT) + if (target->ToPlayer()->GetClass() != CLASS_DEATH_KNIGHT) break; // aura removed - remove death runes @@ -1970,8 +1970,8 @@ float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& event } // proc chance is reduced by an additional 3.333% per level past 60 - if ((procEntry.AttributesMask & PROC_ATTR_REDUCE_PROC_60) && eventInfo.GetActor()->getLevel() > 60) - chance = std::max(0.f, (1.f - ((eventInfo.GetActor()->getLevel() - 60) * 1.f / 30.f)) * chance); + if ((procEntry.AttributesMask & PROC_ATTR_REDUCE_PROC_60) && eventInfo.GetActor()->GetLevel() > 60) + chance = std::max(0.f, (1.f - ((eventInfo.GetActor()->GetLevel() - 60) * 1.f / 30.f)) * chance); return chance; } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index e8da74545c3..261b8f12ed9 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -602,7 +602,7 @@ m_caster((info->HasAttribute(SPELL_ATTR6_ORIGINATE_FROM_CONTROLLER) && caster->G { // wand case if (m_attackType == RANGED_ATTACK) - if ((playerCaster->getClassMask() & CLASSMASK_WAND_USERS) != 0) + if ((playerCaster->GetClassMask() & CLASSMASK_WAND_USERS) != 0) if (Item* pItem = playerCaster->GetWeaponForAttack(RANGED_ATTACK)) m_spellSchoolMask = SpellSchoolMask(1 << pItem->GetTemplate()->GetDamageType()); } @@ -2292,7 +2292,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= if (m_auraScaleMask && ihit->EffectMask == m_auraScaleMask && m_caster != target) { SpellInfo const* auraSpell = m_spellInfo->GetFirstRankSpell(); - if (uint32(target->getLevel() + 10) >= auraSpell->SpellLevel) + if (uint32(target->GetLevel() + 10) >= auraSpell->SpellLevel) ihit->ScaleAura = true; } return; @@ -2312,7 +2312,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= if (m_auraScaleMask && targetInfo.EffectMask == m_auraScaleMask && m_caster != target) { SpellInfo const* auraSpell = m_spellInfo->GetFirstRankSpell(); - if (uint32(target->getLevel() + 10) >= auraSpell->SpellLevel) + if (uint32(target->GetLevel() + 10) >= auraSpell->SpellLevel) targetInfo.ScaleAura = true; } @@ -2991,7 +2991,7 @@ SpellMissInfo Spell::PreprocessSpellHit(Unit* unit, bool scaleAura, TargetInfo& hitInfo.AuraSpellInfo = m_spellInfo; if (scaleAura) { - if (SpellInfo const* actualSpellInfo = m_spellInfo->GetAuraRankForLevel(unitTarget->getLevel())) + if (SpellInfo const* actualSpellInfo = m_spellInfo->GetAuraRankForLevel(unitTarget->GetLevel())) hitInfo.AuraSpellInfo = actualSpellInfo; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) @@ -3381,13 +3381,13 @@ SpellCastResult Spell::prepare(SpellCastTargets const& targets, AuraEffect const if (!player->GetCommandStatus(CHEAT_CASTTIME)) { // calculate cast time (calculated after first CheckCast check to prevent charge counting for first CheckCast fail) - m_casttime = m_spellInfo->CalcCastTime(player->getLevel(), this); + m_casttime = m_spellInfo->CalcCastTime(player->GetLevel(), this); } else m_casttime = 0; // Set cast time to 0 if .cheat casttime is enabled. } else - m_casttime = m_spellInfo->CalcCastTime(m_caster->IsUnit() ? m_caster->ToUnit()->getLevel() : 0, this); + m_casttime = m_spellInfo->CalcCastTime(m_caster->IsUnit() ? m_caster->ToUnit()->GetLevel() : 0, this); if (m_caster->IsUnit() && m_caster->ToUnit()->isMoving()) { @@ -4014,7 +4014,7 @@ void Spell::_handle_finish_phase() if (m_comboPointGain) mover->GainSpellComboPoints(m_comboPointGain); - if (m_spellInfo->PowerType == POWER_HOLY_POWER && mover->getClass() == CLASS_PALADIN) + if (m_spellInfo->PowerType == POWER_HOLY_POWER && mover->GetClass() == CLASS_PALADIN) HandleHolyPower(mover); } @@ -4589,7 +4589,7 @@ void Spell::SendSpellGo() castFlags |= CAST_FLAG_POWER_LEFT_SELF; if ((m_caster->GetTypeId() == TYPEID_PLAYER) - && (m_caster->ToPlayer()->getClass() == CLASS_DEATH_KNIGHT) + && (m_caster->ToPlayer()->GetClass() == CLASS_DEATH_KNIGHT) && m_spellInfo->RuneCostID && m_spellInfo->PowerType == POWER_RUNE && !(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_AND_REAGENT_COST)) @@ -5290,7 +5290,7 @@ SpellCastResult Spell::CheckRuneCost(uint32 runeCostID) const if (!player) return SPELL_CAST_OK; - if (player->getClass() != CLASS_DEATH_KNIGHT) + if (player->GetClass() != CLASS_DEATH_KNIGHT) return SPELL_CAST_OK; SpellRuneCostEntry const* src = sSpellRuneCostStore.LookupEntry(runeCostID); @@ -5330,7 +5330,7 @@ SpellCastResult Spell::CheckRuneCost(uint32 runeCostID) const void Spell::TakeRunePower(SpellMissInfo hitInfo) { - if (!m_caster->IsPlayer() || m_caster->ToPlayer()->getClass() != CLASS_DEATH_KNIGHT) + if (!m_caster->IsPlayer() || m_caster->ToPlayer()->GetClass() != CLASS_DEATH_KNIGHT) return; SpellRuneCostEntry const* runeCostData = sSpellRuneCostStore.LookupEntry(m_spellInfo->RuneCostID); @@ -5628,12 +5628,12 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint if (playerCaster->HasAuraType(SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES) && !m_spellInfo->HasAttribute(SPELL_ATTR0_USES_RANGED_SLOT) && !m_spellInfo->HasEffect(SPELL_EFFECT_ATTACK) - && !playerCaster->HasAuraTypeWithFamilyFlags(SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES, sChrClassesStore.AssertEntry(playerCaster->getClass())->SpellClassSet, m_spellInfo->SpellFamilyFlags)) + && !playerCaster->HasAuraTypeWithFamilyFlags(SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES, sChrClassesStore.AssertEntry(playerCaster->GetClass())->SpellClassSet, m_spellInfo->SpellFamilyFlags)) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; if (playerCaster->HasAuraType(SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES)) { - if (!playerCaster->HasAuraTypeWithFamilyFlags(SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES, sChrClassesStore.AssertEntry(playerCaster->getClass())->SpellClassSet, m_spellInfo->SpellFamilyFlags)) + if (!playerCaster->HasAuraTypeWithFamilyFlags(SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES, sChrClassesStore.AssertEntry(playerCaster->GetClass())->SpellClassSet, m_spellInfo->SpellFamilyFlags)) { if (m_spellInfo->HasAttribute(SPELL_ATTR0_USES_RANGED_SLOT) || m_spellInfo->IsNextMeleeSwingSpell() @@ -6021,7 +6021,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint if (!learn_spellproto) return SPELL_FAILED_NOT_KNOWN; - if (m_spellInfo->SpellLevel > pet->getLevel()) + if (m_spellInfo->SpellLevel > pet->GetLevel()) return SPELL_FAILED_LOWLEVEL; break; @@ -6052,7 +6052,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint if (!learn_spellproto) return SPELL_FAILED_NOT_KNOWN; - if (m_spellInfo->SpellLevel > pet->getLevel()) + if (m_spellInfo->SpellLevel > pet->GetLevel()) return SPELL_FAILED_LOWLEVEL; } break; @@ -6160,7 +6160,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint uint32 skill = creature->GetCreatureTemplate()->GetRequiredLootSkill(); int32 skillValue = m_caster->ToPlayer()->GetSkillValue(skill); - int32 TargetLevel = m_targets.GetUnitTarget()->getLevel(); + int32 TargetLevel = m_targets.GetUnitTarget()->GetLevel(); int32 ReqValue = (skillValue < 100 ? (TargetLevel-10) * 10 : TargetLevel * 5); if (ReqValue > skillValue) return SPELL_FAILED_LOW_CASTLEVEL; @@ -6445,7 +6445,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint return SPELL_FAILED_TARGET_IS_PLAYER_CONTROLLED; int32 value = CalculateDamage(i, target); - if (value && int32(target->getLevel()) > value) + if (value && int32(target->GetLevel()) > value) return SPELL_FAILED_HIGHLEVEL; } @@ -7744,7 +7744,7 @@ bool Spell::CheckEffectTarget(Unit const* target, uint32 eff, Position const* lo if (target->GetCharmerGUID()) return false; if (int32 value = CalculateDamage(eff, target)) - if ((int32)target->getLevel() > value) + if ((int32)target->GetLevel() > value) return false; break; default: @@ -8185,7 +8185,7 @@ SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& sk // Pickpocketing is based on Playerlevels if (m_spellInfo->Id == 1804 && skillId == SKILL_LOCKPICKING) - skillValue = 5 * unitCaster->getLevel(); + skillValue = 5 * unitCaster->GetLevel(); // skill bonus provided by casting spell (mostly item spells) // add the effect base points modifier from the spell cast (cheat lock / skeleton key etc.) @@ -8759,7 +8759,7 @@ bool WorldObjectSpellTargetCheck::operator()(WorldObject* target) const case TARGET_CHECK_RAID_CLASS: if (!refUnit) return false; - if (refUnit->getClass() != unitTarget->getClass()) + if (refUnit->GetClass() != unitTarget->GetClass()) return false; [[fallthrough]]; case TARGET_CHECK_RAID: diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index db1cdcdeb03..a3bea29877a 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -412,8 +412,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) { damage = 60; // about +4 base spell dmg per level - if (unitCaster && unitCaster->getLevel() >= 60) - damage += (unitCaster->getLevel() - 60) * 4; + if (unitCaster && unitCaster->GetLevel() >= 60) + damage += (unitCaster->GetLevel() - 60) * 4; break; } case 88082: // Fireball (Mirror Image) @@ -1544,15 +1544,15 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) switch (m_spellInfo->Id) { case 9512: // Restore Energy - level_diff = unitCaster->getLevel() - 40; + level_diff = unitCaster->GetLevel() - 40; level_multiplier = 2; break; case 24571: // Blood Fury - level_diff = unitCaster->getLevel() - 60; + level_diff = unitCaster->GetLevel() - 60; level_multiplier = 10; break; case 24532: // Burst of Energy - level_diff = unitCaster->getLevel() - 60; + level_diff = unitCaster->GetLevel() - 60; level_multiplier = 4; break; case 31930: // Judgements of the Wise @@ -1789,7 +1789,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex) if (uint8 xpDifficulty = goInfo->chest.xpDifficulty) { int32 xpLevel = goInfo->chest.xpMinLevel; - player->GiveXP(Quest::CalcXPReward(player->getLevel(), xpLevel, xpDifficulty), nullptr); + player->GiveXP(Quest::CalcXPReward(player->GetLevel(), xpLevel, xpDifficulty), nullptr); } } } @@ -2297,7 +2297,7 @@ void Spell::EffectLearnSkill(SpellEffIndex effIndex) return; uint32 skillid = m_spellInfo->Effects[effIndex].MiscValue; - SkillRaceClassInfoEntry const* rcEntry = sDBCManager.GetSkillRaceClassInfo(skillid, unitTarget->getRace(), unitTarget->getClass()); + SkillRaceClassInfoEntry const* rcEntry = sDBCManager.GetSkillRaceClassInfo(skillid, unitTarget->GetRace(), unitTarget->GetClass()); if (!rcEntry) return; @@ -2561,7 +2561,7 @@ void Spell::EffectTameCreature(SpellEffIndex /*effIndex*/) if (creatureTarget->IsPet()) return; - if (unitCaster->getClass() != CLASS_HUNTER) + if (unitCaster->GetClass() != CLASS_HUNTER) return; // cast finish successfully @@ -2572,7 +2572,7 @@ void Spell::EffectTameCreature(SpellEffIndex /*effIndex*/) if (!pet) // in very specific state like near world end/etc. return; - uint8 level = unitCaster->getLevel(); + uint8 level = unitCaster->GetLevel(); // prepare visual effect for levelup pet->SetUInt32Value(UNIT_FIELD_LEVEL, level - 1); @@ -2589,7 +2589,7 @@ void Spell::EffectTameCreature(SpellEffIndex /*effIndex*/) pet->SavePetToDB(PET_SAVE_NEW_PET); if (pet->GetSlot() <= PET_SLOT_LAST_ACTIVE_SLOT) { - unitCaster->ToPlayer()->GetSession()->SendPetAdded(pet->GetSlot(), pet->GetCharmInfo()->GetPetNumber(), creatureTarget->GetEntry(), creatureTarget->getLevel(), pet->GetName()); + unitCaster->ToPlayer()->GetSession()->SendPetAdded(pet->GetSlot(), pet->GetCharmInfo()->GetPetNumber(), creatureTarget->GetEntry(), creatureTarget->GetLevel(), pet->GetName()); unitCaster->ToPlayer()->PetSpellInitialize(); } else @@ -3679,7 +3679,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex) PhasingHandler::InheritPhaseShift(pGameObj, caster); pGameObj->SetFaction(caster->GetFaction()); - pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, caster->getLevel() + 1); + pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, caster->GetLevel() + 1); int32 duration = m_spellInfo->GetDuration(); pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); pGameObj->SetSpellId(m_spellInfo->Id); @@ -3921,7 +3921,7 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) case 8: minLevel = 75; break; } - if (minLevel && player->getLevel() < minLevel) + if (minLevel && player->GetLevel() < minLevel) { SendCastResult(SPELL_FAILED_GLYPH_SOCKET_LOCKED); return; @@ -4146,7 +4146,7 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex) PhasingHandler::InheritPhaseShift(go, m_caster); - //pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel()); + //pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->GetLevel()); int32 duration = m_spellInfo->GetDuration(); go->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); go->SetSpellId(m_spellInfo->Id); @@ -4422,7 +4422,7 @@ void Spell::EffectSkinning(SpellEffIndex /*effIndex*/) return; Creature* creature = unitTarget->ToCreature(); - int32 targetLevel = creature->getLevel(); + int32 targetLevel = creature->GetLevel(); uint32 skill = creature->GetCreatureTemplate()->GetRequiredLootSkill(); @@ -5007,7 +5007,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) go->SetOwnerGUID(unitCaster->GetGUID()); - //pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, unitCaster->getLevel()); + //pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, unitCaster->GetLevel()); go->SetSpellId(m_spellInfo->Id); ExecuteLogEffectSummonObject(effIndex, go); @@ -5023,7 +5023,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) PhasingHandler::InheritPhaseShift(linkedTrap, m_caster); linkedTrap->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); - //linkedTrap->SetUInt32Value(GAMEOBJECT_LEVEL, unitCaster->getLevel()); + //linkedTrap->SetUInt32Value(GAMEOBJECT_LEVEL, unitCaster->GetLevel()); linkedTrap->SetSpellId(m_spellInfo->Id); linkedTrap->SetOwnerGUID(unitCaster->GetGUID()); @@ -5321,7 +5321,7 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex) return; Player* player = m_caster->ToPlayer(); - if (player->getClass() != CLASS_DEATH_KNIGHT) + if (player->GetClass() != CLASS_DEATH_KNIGHT) return; // needed later @@ -5353,7 +5353,7 @@ void Spell::EffectCreateTamedPet(SpellEffIndex effIndex) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || unitTarget->GetPetGUID() || unitTarget->getClass() != CLASS_HUNTER) + if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || unitTarget->GetPetGUID() || unitTarget->GetClass() != CLASS_HUNTER) return; uint32 creatureEntry = m_spellInfo->Effects[effIndex].MiscValue; diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 54461c018df..18da5c4d1d0 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -450,9 +450,9 @@ int32 SpellEffectInfo::CalcValue(WorldObject const* caster, int32 const* bp, Uni { int32 level = _spellInfo->SpellLevel; if (target && _spellInfo->HasAttribute(SPELL_ATTR8_USE_TARGETS_LEVEL_FOR_SPELL_SCALING)) - level = target->getLevel(); + level = target->GetLevel(); else if (casterUnit) - level = casterUnit->getLevel(); + level = casterUnit->GetLevel(); if (_spellInfo->HasAttribute(SPELL_ATTR10_USE_SPELL_BASE_LEVEL_FOR_SCALING)) level = _spellInfo->BaseLevel; @@ -494,9 +494,9 @@ int32 SpellEffectInfo::CalcValue(WorldObject const* caster, int32 const* bp, Uni { int32 level = 1; if (target && _spellInfo->HasAttribute(SPELL_ATTR8_USE_TARGETS_LEVEL_FOR_SPELL_SCALING)) - level = target->getLevel(); + level = target->GetLevel(); else if (caster && caster->IsUnit()) - level = casterUnit->getLevel(); + level = casterUnit->GetLevel(); if (level > int32(_spellInfo->MaxLevel) && _spellInfo->MaxLevel > 0) level = int32(_spellInfo->MaxLevel); @@ -539,7 +539,7 @@ int32 SpellEffectInfo::CalcValue(WorldObject const* caster, int32 const* bp, Uni value = casterUnit->ApplyEffectModifiers(_spellInfo, _effIndex, value); if (!casterUnit->IsControlledByPlayer() && - _spellInfo->SpellLevel && _spellInfo->SpellLevel != casterUnit->getLevel() && + _spellInfo->SpellLevel && _spellInfo->SpellLevel != casterUnit->GetLevel() && !basePointsPerLevel && _spellInfo->HasAttribute(SPELL_ATTR0_SCALES_WITH_CREATURE_LEVEL)) { bool canEffectScale = false; @@ -583,12 +583,12 @@ int32 SpellEffectInfo::CalcValue(WorldObject const* caster, int32 const* bp, Uni if (canEffectScale) { GtNPCManaCostScalerEntry const* spellScaler = sGtNPCManaCostScalerStore.LookupEntry(_spellInfo->SpellLevel - 1); - GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.LookupEntry(casterUnit->getLevel() - 1); + GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.LookupEntry(casterUnit->GetLevel() - 1); if (spellScaler && casterScaler) { value *= casterScaler->ratio / spellScaler->ratio; - if (casterUnit->getLevel() > 80) - value *= (casterUnit->getLevel() - 80) * 4.4f; // Cataclysm creatures have a way higher jump in stats than previous expansions so we use this estimated value based on combat log packet research + if (casterUnit->GetLevel() > 80) + value *= (casterUnit->GetLevel() - 80) * 4.4f; // Cataclysm creatures have a way higher jump in stats than previous expansions so we use this estimated value based on combat log packet research } } } @@ -664,7 +664,7 @@ float SpellEffectInfo::CalcRadius(WorldObject* caster /*= nullptr*/, SpellTarget if (caster) { if (Unit* casterUnit = caster->ToUnit()) - radius += entry->RadiusPerLevel * casterUnit->getLevel(); + radius += entry->RadiusPerLevel * casterUnit->GetLevel(); radius = std::min(radius, entry->RadiusMax); @@ -3453,7 +3453,7 @@ int32 SpellInfo::CalcDuration(WorldObject const* caster /*= nullptr*/) const if (!unitCaster) return std::min(GetMaxDuration(), DurationEntry->Duration); - uint32 level = unitCaster->getLevel(); + uint32 level = unitCaster->GetLevel(); if (MaxLevel > 0 && level > MaxLevel) level = MaxLevel; if (BaseLevel > 0) @@ -3545,7 +3545,7 @@ uint32 SpellInfo::CalcCastTime(uint8 level, Spell* spell /*= nullptr*/) const { int32 castTime = 0; if (!level && spell && spell->GetCaster()->IsUnit()) - level = spell->GetCaster()->ToUnit()->getLevel(); + level = spell->GetCaster()->ToUnit()->GetLevel(); // not all spells have cast time index and this is all is passive abilities if (level && Scaling.CastTimeMax > 0) @@ -3730,7 +3730,7 @@ int32 SpellInfo::CalcPowerCost(WorldObject const* caster, SpellSchoolMask school if (HasAttribute(SPELL_ATTR0_SCALES_WITH_CREATURE_LEVEL)) { GtNPCManaCostScalerEntry const* spellScaler = sGtNPCManaCostScalerStore.LookupEntry(SpellLevel - 1); - GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.LookupEntry(unitCaster->getLevel() - 1); + GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.LookupEntry(unitCaster->GetLevel() - 1); if (spellScaler && spellScaler->ratio > 0.f && casterScaler && casterScaler->ratio > 0.f) powerCost *= casterScaler->ratio / spellScaler->ratio; } @@ -3762,7 +3762,7 @@ float SpellInfo::GetSpellScalingMultiplier(WorldObject const* caster, bool isPow float multiplier = 1.f; float scalingMultiplier = 1.f; - uint8 casterLevel = caster->ToUnit()->getLevel(); + uint8 casterLevel = caster->ToUnit()->GetLevel(); if (casterLevel < Scaling.CastTimeMaxLevel && Scaling.CastTimeMax) { diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 336741ab442..0b82cb7f9ea 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -682,11 +682,11 @@ SpellAreaForAreaMapBounds SpellMgr::GetSpellAreaForAreaMapBounds(uint32 area_id) bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 newArea) const { if (gender != GENDER_NONE) // is not expected gender - if (!player || gender != player->getGender()) + if (!player || gender != player->GetGender()) return false; if (raceMask) // is not expected race - if (!player || !(raceMask & player->getRaceMask())) + if (!player || !(raceMask & player->GetRaceMask())) return false; if (areaId) // is not in expected zone diff --git a/src/server/game/Storages/WhoListStorage.cpp b/src/server/game/Storages/WhoListStorage.cpp index bb80e75210e..507959773a2 100644 --- a/src/server/game/Storages/WhoListStorage.cpp +++ b/src/server/game/Storages/WhoListStorage.cpp @@ -54,8 +54,8 @@ void WhoListStorageMgr::Update() wstrToLower(wideGuildName); - _whoListStorage.emplace_back(itr->second->GetGUID(), itr->second->GetTeam(), itr->second->GetSession()->GetSecurity(), itr->second->getLevel(), - itr->second->getClass(), itr->second->getRace(), itr->second->GetZoneId(), itr->second->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER), itr->second->IsVisible(), + _whoListStorage.emplace_back(itr->second->GetGUID(), itr->second->GetTeam(), itr->second->GetSession()->GetSecurity(), itr->second->GetLevel(), + itr->second->GetClass(), itr->second->GetRace(), itr->second->GetZoneId(), itr->second->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER), itr->second->IsVisible(), widePlayerName, wideGuildName, playerName, guildName); } } diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 0a08e103132..d010bb6600a 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -276,12 +276,12 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject if (srcPlr) { - PlayerTextBuilder builder(source, finalSource, finalSource->getGender(), finalType, iter->groupId, iter->id, finalLang, whisperTarget); + PlayerTextBuilder builder(source, finalSource, finalSource->GetGender(), finalType, iter->groupId, iter->id, finalLang, whisperTarget); SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly); } else { - CreatureTextBuilder builder(finalSource, finalSource->getGender(), finalType, iter->groupId, iter->id, finalLang, whisperTarget); + CreatureTextBuilder builder(finalSource, finalSource->GetGender(), finalType, iter->groupId, iter->id, finalLang, whisperTarget); SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly); } diff --git a/src/server/scripts/Battlefield/BattlefieldWG.cpp b/src/server/scripts/Battlefield/BattlefieldWG.cpp index 873e43c4109..ee176405a6b 100644 --- a/src/server/scripts/Battlefield/BattlefieldWG.cpp +++ b/src/server/scripts/Battlefield/BattlefieldWG.cpp @@ -1253,7 +1253,7 @@ void BattlefieldWG::UpdateTenacity() { for (auto itr = m_players[m_tenacityTeam].begin(); itr != m_players[m_tenacityTeam].end(); ++itr) if (Player* player = ObjectAccessor::FindPlayer(*itr)) - if (player->getLevel() >= m_MinLevel) + if (player->GetLevel() >= m_MinLevel) player->RemoveAurasDueToSpell(SPELL_TENACITY); for (auto itr = m_vehicles[m_tenacityTeam].begin(); itr != m_vehicles[m_tenacityTeam].end(); ++itr) diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index 8830629970a..9f6ce41d292 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -280,7 +280,7 @@ class character_commandscript : public CommandScript { if (target->HasTitle(titleInfo)) { - std::string name = target->getGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1; + std::string name = target->GetGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1; if (name.empty()) continue; @@ -452,7 +452,7 @@ class character_commandscript : public CommandScript if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName)) return false; - int32 oldlevel = target ? target->getLevel() : sCharacterCache->GetCharacterLevelByGuid(targetGuid); + int32 oldlevel = target ? target->GetLevel() : sCharacterCache->GetCharacterLevelByGuid(targetGuid); int32 newlevel = levelStr ? atoi(levelStr) : oldlevel; if (newlevel < 1) @@ -906,7 +906,7 @@ class character_commandscript : public CommandScript if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName)) return false; - int32 oldlevel = target ? target->getLevel() : sCharacterCache->GetCharacterLevelByGuid(targetGuid); + int32 oldlevel = target ? target->GetLevel() : sCharacterCache->GetCharacterLevelByGuid(targetGuid); int32 addlevel = levelStr ? atoi(levelStr) : 1; int32 newlevel = oldlevel + addlevel; diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 7db837069e6..d1f858615d2 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -148,7 +148,7 @@ class learn_commandscript : public CommandScript static bool HandleLearnAllMySpellsCommand(ChatHandler* handler, char const* /*args*/) { - ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(handler->GetSession()->GetPlayer()->getClass()); + ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(handler->GetSession()->GetPlayer()->GetClass()); if (!classEntry) return true; uint32 family = classEntry->SpellClassSet; @@ -189,7 +189,7 @@ class learn_commandscript : public CommandScript static bool HandleLearnAllMyTalentsCommand(ChatHandler* handler, char const* /*args*/) { Player* player = handler->GetSession()->GetPlayer(); - uint32 classMask = player->getClassMask(); + uint32 classMask = player->GetClassMask(); for (TalentEntry const* talentInfo : sTalentStore) { @@ -410,7 +410,7 @@ class learn_commandscript : public CommandScript static void HandleLearnSkillRecipesHelper(Player* player, uint32 skillId) { - uint32 classmask = player->getClassMask(); + uint32 classmask = player->GetClassMask(); for (SkillLineAbilityEntry const* skillLine : sSkillLineAbilityStore) { diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 9589a5a8092..485c54de190 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -1027,7 +1027,7 @@ class lookup_commandscript : public CommandScript CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id); if (titleInfo) { - std::string name = target->getGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1; + std::string name = target->GetGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1; if (name.empty()) continue; diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 100a50c75bb..75a6f93941d 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1627,15 +1627,15 @@ class misc_commandscript : public CommandScript accId = target->GetSession()->GetAccountId(); money = target->GetMoney(); totalPlayerTime = target->GetTotalPlayedTime(); - level = target->getLevel(); + level = target->GetLevel(); latency = target->GetSession()->GetLatency(); - raceid = target->getRace(); - classid = target->getClass(); + raceid = target->GetRace(); + classid = target->GetClass(); muteTime = target->GetSession()->m_muteTime; mapId = target->GetMapId(); areaId = target->GetAreaId(); alive = target->IsAlive() ? handler->GetTrinityString(LANG_YES) : handler->GetTrinityString(LANG_NO); - gender = target->getGender(); + gender = target->GetGender(); } // get additional information from DB else diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index a10256e12c1..2e1b5a56b33 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -902,7 +902,7 @@ class modify_commandscript : public CommandScript return false; } - PlayerInfo const* info = sObjectMgr->GetPlayerInfo(target->getRace(), target->getClass()); + PlayerInfo const* info = sObjectMgr->GetPlayerInfo(target->GetRace(), target->GetClass()); if (!info) return false; @@ -913,14 +913,14 @@ class modify_commandscript : public CommandScript if (!strncmp(gender_str, "male", gender_len)) // MALE { - if (target->getGender() == GENDER_MALE) + if (target->GetGender() == GENDER_MALE) return true; gender = GENDER_MALE; } else if (!strncmp(gender_str, "female", gender_len)) // FEMALE { - if (target->getGender() == GENDER_FEMALE) + if (target->GetGender() == GENDER_FEMALE) return true; gender = GENDER_FEMALE; diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index d2bdb4a7adc..9f4b11970de 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -809,7 +809,7 @@ class npc_commandscript : public CommandScript handler->PSendSysMessage(LANG_SPAWNINFO_GROUP_ID, groupData->name.c_str(), groupData->groupId, groupData->flags, target->GetMap()->IsSpawnGroupActive(groupData->groupId)); } handler->PSendSysMessage(LANG_SPAWNINFO_COMPATIBILITY_MODE, target->GetRespawnCompatibilityMode()); - handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->getLevel()); + handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->GetLevel()); handler->PSendSysMessage(LANG_NPCINFO_EQUIPMENT, target->GetCurrentEquipmentId(), target->GetOriginalEquipmentId()); handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth()); handler->PSendSysMessage(LANG_NPCINFO_MOVEMENT_DATA, target->GetMovementTemplate().ToString().c_str()); @@ -1517,7 +1517,7 @@ class npc_commandscript : public CommandScript pet->SetReactState(REACT_DEFENSIVE); // calculate proper level - uint8 level = std::max(player->getLevel()-5, creatureTarget->getLevel()); + uint8 level = std::max(player->GetLevel()-5, creatureTarget->GetLevel()); // prepare visual effect for levelup pet->SetUInt32Value(UNIT_FIELD_LEVEL, level - 1); diff --git a/src/server/scripts/Commands/cs_pet.cpp b/src/server/scripts/Commands/cs_pet.cpp index f6937dff699..c0edcf15593 100644 --- a/src/server/scripts/Commands/cs_pet.cpp +++ b/src/server/scripts/Commands/cs_pet.cpp @@ -105,7 +105,7 @@ class pet_commandscript : public CommandScript pet->SetGuidValue(UNIT_FIELD_CREATEDBY, player->GetGUID()); pet->SetFaction(player->GetFaction()); - if (!pet->InitStatsForLevel(creatureTarget->getLevel())) + if (!pet->InitStatsForLevel(creatureTarget->GetLevel())) { TC_LOG_ERROR("misc", "InitStatsForLevel() in EffectTameCreature failed! Pet deleted."); handler->PSendSysMessage("Error 2"); @@ -114,7 +114,7 @@ class pet_commandscript : public CommandScript } // prepare visual effect for levelup - pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1); + pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->GetLevel()-1); pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true); // this enables pet details window (Shift+P) @@ -124,7 +124,7 @@ class pet_commandscript : public CommandScript pet->GetMap()->AddToMap(pet->ToCreature()); // visual effect for levelup - pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()); + pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->GetLevel()); player->SetMinion(pet, true); pet->SavePetToDB(PET_SAVE_NEW_PET); @@ -211,7 +211,7 @@ class pet_commandscript : public CommandScript int32 level = args ? atoi(args) : 0; if (level == 0) - level = owner->getLevel() - pet->getLevel(); + level = owner->GetLevel() - pet->GetLevel(); if (level == 0 || level < -STRONG_MAX_LEVEL || level > STRONG_MAX_LEVEL) { handler->SendSysMessage(LANG_BAD_VALUE); @@ -219,11 +219,11 @@ class pet_commandscript : public CommandScript return false; } - int32 newLevel = pet->getLevel() + level; + int32 newLevel = pet->GetLevel() + level; if (newLevel < 1) newLevel = 1; - else if (newLevel > owner->getLevel()) - newLevel = owner->getLevel(); + else if (newLevel > owner->GetLevel()) + newLevel = owner->GetLevel(); pet->GivePetLevel(newLevel); return true; diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index b85cbaa0f2a..c1c9a705d67 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -89,10 +89,10 @@ class reset_commandscript : public CommandScript static bool HandleResetStatsOrLevelHelper(Player* player) { - ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(player->getClass()); + ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(player->GetClass()); if (!classEntry) { - TC_LOG_ERROR("misc", "Class %u not found in DBC (Wrong DBC files?)", player->getClass()); + TC_LOG_ERROR("misc", "Class %u not found in DBC (Wrong DBC files?)", player->GetClass()); return false; } @@ -102,7 +102,7 @@ class reset_commandscript : public CommandScript if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT)) player->SetShapeshiftForm(FORM_NONE); - player->SetFactionForRace(player->getRace()); + player->SetFactionForRace(player->GetRace()); player->SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_POWER_TYPE, powerType); @@ -128,10 +128,10 @@ class reset_commandscript : public CommandScript if (!HandleResetStatsOrLevelHelper(target)) return false; - uint8 oldLevel = target->getLevel(); + uint8 oldLevel = target->GetLevel(); // set starting level - uint32 startLevel = target->getClass() != CLASS_DEATH_KNIGHT + uint32 startLevel = target->GetClass() != CLASS_DEATH_KNIGHT ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL) : sWorld->getIntConfig(CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL); diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp index f24d82f6890..a0cd2a95cc2 100644 --- a/src/server/scripts/Commands/cs_titles.cpp +++ b/src/server/scripts/Commands/cs_titles.cpp @@ -95,7 +95,7 @@ class titles_commandscript : public CommandScript target->SetTitle(titleInfo); // to be sure that title now known target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->Mask_ID); - handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, target->getGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1, tNameLink.c_str()); + handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, target->GetGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1, tNameLink.c_str()); return true; } @@ -135,7 +135,7 @@ class titles_commandscript : public CommandScript } std::string tNameLink = handler->GetNameLink(target); - std::string titleNameStr = Trinity::StringFormat(target->getGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1, target->GetName().c_str()); + std::string titleNameStr = Trinity::StringFormat(target->GetGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1, target->GetName().c_str()); target->SetTitle(titleInfo); handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr.c_str(), tNameLink.c_str()); @@ -183,7 +183,7 @@ class titles_commandscript : public CommandScript std::string tNameLink = handler->GetNameLink(target); char titleNameStr[80]; - snprintf(titleNameStr, 80, target->getGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1, target->GetName().c_str()); + snprintf(titleNameStr, 80, target->GetGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1, target->GetName().c_str()); handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, id, titleNameStr, tNameLink.c_str()); diff --git a/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_theralion_and_valiona.cpp b/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_theralion_and_valiona.cpp index 096ea5674dd..88bf366895a 100644 --- a/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_theralion_and_valiona.cpp +++ b/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_theralion_and_valiona.cpp @@ -1018,9 +1018,9 @@ class EngulfingMagicCheck bool operator()(WorldObject* object) { if (Unit* target = object->ToUnit()) - return ((target->getClass() == CLASS_HUNTER - || target->getClass() == CLASS_WARRIOR - || target->getClass() == CLASS_DEATH_KNIGHT) + return ((target->GetClass() == CLASS_HUNTER + || target->GetClass() == CLASS_WARRIOR + || target->GetClass() == CLASS_DEATH_KNIGHT) || target->HasAura(SPELL_TWILIGHT_METEORITE_TARGETING)); return false; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp index 924a4e9d96c..2567fcb5138 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp @@ -580,7 +580,7 @@ class at_nearby_scarshield_infiltrator : public AreaTriggerScript if (InstanceScript* instance = player->GetInstanceScript()) if (Creature* infiltrator = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_SCARSHIELD_INFILTRATOR))) { - if (player->getLevel() >= 57) + if (player->GetLevel() >= 57) infiltrator->AI()->SetData(1, 1); else if (infiltrator->GetEntry() == NPC_SCARSHIELD_INFILTRATOR) infiltrator->AI()->Talk(0, player); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp index 30fdc0b3a06..9d20e01d919 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp @@ -515,7 +515,7 @@ class boss_nefarian : public CreatureScript break; case EVENT_CLASSCALL: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true)) - switch (target->getClass()) + switch (target->GetClass()) { case CLASS_MAGE: Talk(SAY_MAGE); diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp index 33399f0f0d5..dc4f6225cc0 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp @@ -67,7 +67,7 @@ struct npc_deadmines_defias_watcher : public ScriptedAI me->SetFaction(FACTION_CONTROLLABLE); DoCastSelf(SPELL_ON_FIRE); DoCastAOE(SPELL_ENERGIZE); - me->setRegeneratingHealth(false); + me->SetRegenerateHealth(false); _isOnFire = true; } } diff --git a/src/server/scripts/EasternKingdoms/GrimBatol/grim_batol.cpp b/src/server/scripts/EasternKingdoms/GrimBatol/grim_batol.cpp index 02b8aecefa4..35f7ef53487 100644 --- a/src/server/scripts/EasternKingdoms/GrimBatol/grim_batol.cpp +++ b/src/server/scripts/EasternKingdoms/GrimBatol/grim_batol.cpp @@ -281,7 +281,7 @@ class spell_grim_batol_engulfing_flames : public SpellScript void HandleEffect(SpellEffIndex /*effIndex*/) { if (Creature* creature = GetHitCreature()) - creature->setRegeneratingHealth(false); + creature->SetRegenerateHealth(false); } void Register() override diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index b251ed2351f..d96707b7766 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -313,7 +313,7 @@ struct boss_kalecgos : public BossAI case EVENT_OUTRO_START: events.Reset(); events.SetPhase(PHASE_OUTRO); - me->setRegeneratingHealth(false); + me->SetRegenerateHealth(false); me->SetReactState(REACT_PASSIVE); me->InterruptNonMeleeSpells(true); me->RemoveAllAttackers(); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index b45c53b6358..e450770a724 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -625,7 +625,7 @@ class boss_kiljaeden : public CreatureScript // summoned->SetVisibility(VISIBILITY_OFF); //with this we cant see the armageddon visuals } else - summoned->SetLevel(me->getLevel()); + summoned->SetLevel(me->GetLevel()); summoned->SetFaction(me->GetFaction()); summons.Summon(summoned); @@ -954,7 +954,7 @@ class npc_hand_of_the_deceiver : public CreatureScript void JustSummoned(Creature* summoned) override { summoned->SetFaction(me->GetFaction()); - summoned->SetLevel(me->getLevel()); + summoned->SetLevel(me->GetLevel()); } void JustEngagedWith(Unit* who) override @@ -1042,7 +1042,7 @@ class npc_felfire_portal : public CreatureScript void JustSummoned(Creature* summoned) override { summoned->SetFaction(me->GetFaction()); - summoned->SetLevel(me->getLevel()); + summoned->SetLevel(me->GetLevel()); } void UpdateAI(uint32 diff) override @@ -1324,7 +1324,7 @@ class npc_sinster_reflection : public CreatureScript if ((victimClass == 0) && me->GetVictim()) { - victimClass = me->EnsureVictim()->getClass(); + victimClass = me->EnsureVictim()->GetClass(); switch (victimClass) { case CLASS_DRUID: diff --git a/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp b/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp index 051569afc37..7ae538c649d 100644 --- a/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp +++ b/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp @@ -439,7 +439,7 @@ class spell_low_health: public SpellScriptLoader { if (Creature* target = GetHitCreature()) { - target->setRegeneratingHealth(false); + target->SetRegenerateHealth(false); target->SetHealth(target->CountPctFromMaxHealth(10)); } } diff --git a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp index 2ec4d8af4eb..09952861bdb 100644 --- a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp +++ b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp @@ -289,7 +289,7 @@ struct npc_hogger : public ScriptedAI me->RemoveAllAuras(); me->KillSelf(); me->setDeathState(ALIVE); - me->setRegeneratingHealth(false); + me->SetRegenerateHealth(false); me->SetHealth(1); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); Talk(SAY_SURRENDER); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index c6976db730c..dc06ff1cc4f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -427,7 +427,7 @@ class boss_archimonde : public CreatureScript if (victim->GetTypeId() == TYPEID_PLAYER) { - switch (victim->getClass()) + switch (victim->GetClass()) { case CLASS_PRIEST: case CLASS_PALADIN: diff --git a/src/server/scripts/Kalimdor/Firelands/boss_majordomo_staghelm.cpp b/src/server/scripts/Kalimdor/Firelands/boss_majordomo_staghelm.cpp index beef4ed7fd4..e3e6148819a 100644 --- a/src/server/scripts/Kalimdor/Firelands/boss_majordomo_staghelm.cpp +++ b/src/server/scripts/Kalimdor/Firelands/boss_majordomo_staghelm.cpp @@ -424,7 +424,7 @@ class spell_majordomo_staghelm_leaping_flames_targeting : public SpellScript return true; // Leaping Flames will prioritize ranged classes and specs - switch (player->getClass()) + switch (player->GetClass()) { case CLASS_HUNTER: case CLASS_MAGE: diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_ammunae.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_ammunae.cpp index e7e8823a372..0d5c070649f 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_ammunae.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_ammunae.cpp @@ -472,7 +472,7 @@ class spell_ammunae_consume_life_energy : public SpellScript return; uint32 spellId = SPELL_CONSUME_LIFE_ENERGY_BURN_MANA; - switch (player->getClass()) + switch (player->GetClass()) { case CLASS_WARRIOR: spellId = SPELL_CONSUME_LIFE_ENERGY_BURN_RAGE; diff --git a/src/server/scripts/Kalimdor/VortexPinnacle/vortex_pinnacle.cpp b/src/server/scripts/Kalimdor/VortexPinnacle/vortex_pinnacle.cpp index baca4d8b439..f321ac037c8 100644 --- a/src/server/scripts/Kalimdor/VortexPinnacle/vortex_pinnacle.cpp +++ b/src/server/scripts/Kalimdor/VortexPinnacle/vortex_pinnacle.cpp @@ -109,7 +109,7 @@ struct npc_lurking_tempest : public NullCreatureAI { npc_lurking_tempest(Creature* creature) : NullCreatureAI(creature) { - me->setRegeneratingHealth(false); + me->SetRegenerateHealth(false); } void JustAppeared() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index e6b24fbee0a..d6663c1a3e0 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -553,7 +553,7 @@ struct gunship_npc_AI : public ScriptedAI Instance(creature->GetInstanceScript()), Slot(nullptr), Index(uint32(-1)) { BurningPitchId = Instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE ? SPELL_BURNING_PITCH_A : SPELL_BURNING_PITCH_H; - me->setRegeneratingHealth(false); + me->SetRegenerateHealth(false); } void SetData(uint32 type, uint32 data) override @@ -677,7 +677,7 @@ class npc_gunship : public CreatureScript _teamInInstance(creature->GetInstanceScript()->GetData(DATA_TEAM_IN_INSTANCE)), _summonedFirstMage(false), _died(false) { - me->setRegeneratingHealth(false); + me->SetRegenerateHealth(false); } void DamageTaken(Unit* /*source*/, uint32& damage) override @@ -852,7 +852,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript { _controller.ResetSlots(HORDE); _controller.SetTransport(dynamic_cast(creature->GetTransport())); - me->setRegeneratingHealth(false); + me->SetRegenerateHealth(false); me->m_CombatDistance = 70.0f; _firstMageCooldown = GameTime::GetGameTime() + 60; _axethrowersYellCooldown = time_t(0); @@ -1117,7 +1117,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript { _controller.ResetSlots(ALLIANCE); _controller.SetTransport(dynamic_cast(creature->GetTransport())); - me->setRegeneratingHealth(false); + me->SetRegenerateHealth(false); me->m_CombatDistance = 70.0f; _firstMageCooldown = GameTime::GetGameTime() + 60; _riflemanYellCooldown = time_t(0); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index fc3ecd1eef6..2bf54f8497f 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -342,7 +342,7 @@ class npc_grauf : public CreatureScript void Reset() override { me->SetReactState(REACT_PASSIVE); - me->setRegeneratingHealth(false); + me->SetRegenerateHealth(false); me->SetSpeedRate(MOVE_RUN, 2.5f); } diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index e4841e32b5d..ccb6e03c763 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -438,7 +438,7 @@ class npc_blessed_banner : public CreatureScript void Reset() override { - me->setRegeneratingHealth(false); + me->SetRegenerateHealth(false); DoCast(SPELL_THREAT_PULSE); Talk(BANNER_SAY); events.ScheduleEvent(EVENT_SPAWN, 3000); diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp index 008193e773b..4696eb14e70 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp @@ -285,7 +285,7 @@ class boss_exarch_maladaar : public CreatureScript soulmodel = target->GetDisplayId(); soulholder = target->GetGUID(); - soulclass = target->getClass(); + soulclass = target->GetClass(); DoCast(target, SPELL_STOLEN_SOUL); me->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index 05beb0e2f76..04b729fe86e 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -99,7 +99,7 @@ class boss_shirrak_the_dead_watcher : public CreatureScript { summoned->CastSpell(summoned, SPELL_FOCUS_FIRE_VISUAL, false); summoned->SetFaction(me->GetFaction()); - summoned->SetLevel(me->getLevel()); + summoned->SetLevel(me->GetLevel()); summoned->AddUnitState(UNIT_STATE_ROOT); if (Unit* pFocusedTarget = ObjectAccessor::GetUnit(*me, FocusedTargetGUID)) diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp index 11ce59acd13..5d2db9ec186 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp @@ -309,7 +309,7 @@ class npc_frozen_core : public CreatureScript void Initialize() { me->SetReactState(REACT_PASSIVE); - me->setRegeneratingHealth(false); + me->SetRegenerateHealth(false); DoCast(me, SPELL_FROZEN_CORE_GETS_HIT); DoCast(me, SPELL_ICE_SPEAR_AURA); } diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index efb704f12fa..502629d68f6 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -105,7 +105,7 @@ class boss_nazan : public CreatureScript { if (summoned && summoned->GetEntry() == NPC_LIQUID_FIRE) { - summoned->SetLevel(me->getLevel()); + summoned->SetLevel(me->GetLevel()); summoned->SetFaction(me->GetFaction()); summoned->CastSpell(summoned, DUNGEON_MODE(SPELL_SUMMON_LIQUID_FIRE, SPELL_SUMMON_LIQUID_FIRE_H), true); summoned->CastSpell(summoned, SPELL_FIRE_NOVA_VISUAL, true); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index af84974b7d7..b220f259e6b 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -413,7 +413,7 @@ class boss_alar : public CreatureScript Summoned->SetObjectScale(Summoned->GetObjectScale() * 2.5f); Summoned->SetDisplayId(11686); Summoned->SetFaction(me->GetFaction()); - Summoned->SetLevel(me->getLevel()); + Summoned->SetLevel(me->GetLevel()); Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false); } } diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp index 94f72ec21d1..f7b8f9abefb 100644 --- a/src/server/scripts/Pet/pet_hunter.cpp +++ b/src/server/scripts/Pet/pet_hunter.cpp @@ -66,7 +66,7 @@ class npc_pet_hunter_snake_trap : public CreatureScript { _isViper = me->GetEntry() == NPC_HUNTER_VIPER ? true : false; - me->SetMaxHealth(uint32(107 * (me->getLevel() - 40) * 0.025f)); + me->SetMaxHealth(uint32(107 * (me->GetLevel() - 40) * 0.025f)); // Add delta to make them not all hit the same time me->SetAttackTime(BASE_ATTACK, me->GetAttackTime(BASE_ATTACK) + urandms(0,6)); diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 85ebd9ffcb9..fa7f29d196a 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -208,7 +208,7 @@ class spell_dk_blood_boil : public SpellScript bool Load() override { _executed = false; - return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCaster()->getClass() == CLASS_DEATH_KNIGHT; + return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCaster()->GetClass() == CLASS_DEATH_KNIGHT; } void HandleAfterHit() @@ -381,7 +381,7 @@ class spell_dk_death_gate_teleport : public SpellScript { SpellCastResult CheckClass() { - if (GetCaster()->getClass() != CLASS_DEATH_KNIGHT) + if (GetCaster()->GetClass() != CLASS_DEATH_KNIGHT) { SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_BE_DEATH_KNIGHT); return SPELL_FAILED_CUSTOM_ERROR; diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index c0a57e08f26..344ae2ec0c4 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -1469,7 +1469,7 @@ class spell_dru_ferocious_bite : public SpellScript if (GetCaster()->GetTypeId() != TYPEID_PLAYER) return false; - if (GetCaster()->ToPlayer()->getClass() != CLASS_DRUID) + if (GetCaster()->ToPlayer()->GetClass() != CLASS_DRUID) return false; return true; @@ -2051,7 +2051,7 @@ class spell_dru_entangling_roots : public AuraScript return; // Every two level difference increase or reduce the chance of breaking. Tree of Life enhances this effect - int16 offset = (caster->getLevel() - GetTarget()->getLevel()) / 2; + int16 offset = (caster->GetLevel() - GetTarget()->GetLevel()) / 2; _allowedProcs = std::max(MINIMUM_PROCS, DEFAULT_PROCS + offset); if (caster->GetShapeshiftForm() == FORM_TREE) ++_allowedProcs; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 071ce131adf..ab8e6905b82 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -358,7 +358,7 @@ class spell_gen_aura_service_uniform : public SpellScriptLoader Unit* target = GetTarget(); if (target->GetTypeId() == TYPEID_PLAYER) { - if (target->getGender() == GENDER_MALE) + if (target->GetGender() == GENDER_MALE) target->SetDisplayId(MODEL_GOBLIN_MALE); else target->SetDisplayId(MODEL_GOBLIN_FEMALE); @@ -1245,7 +1245,7 @@ class spell_gen_dalaran_disguise : public SpellScriptLoader { if (Player* player = GetHitPlayer()) { - uint8 gender = player->getGender(); + uint8 gender = player->GetGender(); uint32 spellId = GetSpellInfo()->Id; @@ -1697,7 +1697,7 @@ class spell_ethereal_pet_aura : public AuraScript { bool CheckProc(ProcEventInfo& eventInfo) { - uint32 levelDiff = std::abs(GetTarget()->getLevel() - eventInfo.GetProcTarget()->getLevel()); + uint32 levelDiff = std::abs(GetTarget()->GetLevel() - eventInfo.GetProcTarget()->GetLevel()); return levelDiff <= 9; } @@ -2446,7 +2446,7 @@ class spell_gen_orc_disguise : public SpellScriptLoader Unit* caster = GetCaster(); if (Player* target = GetHitPlayer()) { - uint8 gender = target->getGender(); + uint8 gender = target->GetGender(); if (!gender) caster->CastSpell(target, SPELL_ORC_DISGUISE_MALE, true); else @@ -2619,7 +2619,7 @@ class spell_gen_pet_summoned : public SpellScriptLoader Player* player = GetCaster()->ToPlayer(); if (player->GetLastPetNumber()) { - PetType newPetType = (player->getClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET; + PetType newPetType = (player->GetClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET; Pet* newPet = new Pet(player, newPetType); if (newPet->LoadPetData(player, 0, player->GetLastPetNumber(), true)) { @@ -2810,7 +2810,7 @@ class spell_gen_running_wild_AuraScript : public AuraScript Unit* target = GetTarget(); PreventDefaultAction(); - target->Mount(target->getGender() == GENDER_FEMALE ? RUNNING_WILD_MODEL_FEMALE : RUNNING_WILD_MODEL_MALE, 0, 0); + target->Mount(target->GetGender() == GENDER_FEMALE ? RUNNING_WILD_MODEL_FEMALE : RUNNING_WILD_MODEL_MALE, 0, 0); // cast speed aura if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(aurEff->GetAmount())) @@ -3482,7 +3482,7 @@ class spell_gen_gm_freeze : public AuraScript player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // if player class = hunter || warlock remove pet if alive - if ((player->getClass() == CLASS_HUNTER) || (player->getClass() == CLASS_WARLOCK)) + if ((player->GetClass() == CLASS_HUNTER) || (player->GetClass() == CLASS_WARLOCK)) { if (Pet* pet = player->GetPet()) { @@ -3501,7 +3501,7 @@ class spell_gen_gm_freeze : public AuraScript if (Player* player = GetTarget()->ToPlayer()) { // Reset player faction + allow combat + allow duels - player->SetFactionForRace(player->getRace()); + player->SetFactionForRace(player->GetRace()); player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // save player player->SaveToDB(); @@ -4780,7 +4780,7 @@ class spell_gen_flask_of_battle : public SpellScript uint32 spellId = 0; uint32 primaryTalentTree = player->GetPrimaryTalentTree(player->GetActiveSpec()); - switch (player->getClass()) + switch (player->GetClass()) { case CLASS_WARLOCK: case CLASS_MAGE: @@ -4959,9 +4959,9 @@ class spell_gen_rocket_barrage : public SpellScript void HandleDamage(SpellEffIndex effIndex) { Unit* caster = GetCaster(); - int32 basePoints = GetEffectValue() + caster->getLevel() * 2; + int32 basePoints = GetEffectValue() + caster->GetLevel() * 2; basePoints += caster->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask()) * GetSpellInfo()->Effects[effIndex].BonusMultiplier; - basePoints += caster->GetTotalAttackPowerValue(caster->getClass() != CLASS_HUNTER ? BASE_ATTACK : RANGED_ATTACK) * GetSpellInfo()->BonusCoefficient; + basePoints += caster->GetTotalAttackPowerValue(caster->GetClass() != CLASS_HUNTER ? BASE_ATTACK : RANGED_ATTACK) * GetSpellInfo()->BonusCoefficient; SetEffectValue(basePoints); } diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index 81d5517efc9..747035e411c 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -185,13 +185,13 @@ class spell_hallow_end_candy_pirate : public SpellScriptLoader void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - uint32 spell = GetTarget()->getGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE; + uint32 spell = GetTarget()->GetGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE; GetTarget()->CastSpell(GetTarget(), spell, true); } void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - uint32 spell = GetTarget()->getGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE; + uint32 spell = GetTarget()->GetGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE; GetTarget()->RemoveAurasDueToSpell(spell); } @@ -252,7 +252,7 @@ class spell_hallow_end_trick : public SpellScriptLoader Unit* caster = GetCaster(); if (Player* target = GetHitPlayer()) { - uint8 gender = target->getGender(); + uint8 gender = target->GetGender(); uint32 spellId = SPELL_TRICK_BUFF; switch (urand(0, 5)) { @@ -414,7 +414,7 @@ class spell_hallow_end_wand : public SpellScriptLoader Unit* target = GetHitUnit(); uint32 spellId = 0; - uint8 gender = target->getGender(); + uint8 gender = target->GetGender(); switch (GetSpellInfo()->Id) { diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 4007587bb44..26f4b104268 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -745,7 +745,7 @@ class spell_hun_tame_beast : public SpellScript if (!GetExplTargetUnit()) return SPELL_FAILED_BAD_IMPLICIT_TARGETS; - if (player->getClass() != CLASS_HUNTER) + if (player->GetClass() != CLASS_HUNTER) return SendTameFailResult(PET_TAME_FAILURE_CANNOT_TAME_CREATURES); if (!player->GetFirstUnusedActivePetSlot()) @@ -757,7 +757,7 @@ class spell_hun_tame_beast : public SpellScript if (Creature* target = GetExplTargetUnit()->ToCreature()) { - if (target->getLevel() > player->getLevel()) + if (target->GetLevel() > player->GetLevel()) return SendTameFailResult(PET_TAME_FAILURE_TOO_HIGH_LEVEL); if (!target->GetCreatureTemplate()->IsTameable(player->ToPlayer()->CanTameExoticPets())) diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index db360632e98..68a3f4cc1d4 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -259,7 +259,7 @@ class spell_item_arcane_shroud : public SpellScriptLoader { void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { - int32 diff = GetUnitOwner()->getLevel() - 60; + int32 diff = GetUnitOwner()->GetLevel() - 60; if (diff > 0) amount += 2 * diff; } @@ -351,7 +351,7 @@ class spell_item_aura_of_madness : public SpellScriptLoader PreventDefaultAction(); Unit* caster = eventInfo.GetActor(); - uint32 spellId = Trinity::Containers::SelectRandomContainerElement(triggeredSpells[caster->getClass()]); + uint32 spellId = Trinity::Containers::SelectRandomContainerElement(triggeredSpells[caster->GetClass()]); caster->CastSpell(caster, spellId, aurEff); if (roll_chance_i(10)) @@ -611,7 +611,7 @@ class spell_item_deathbringers_will : public SpellScriptLoader PreventDefaultAction(); Unit* caster = eventInfo.GetActor(); - std::vector const& randomSpells = triggeredSpells[caster->getClass()]; + std::vector const& randomSpells = triggeredSpells[caster->GetClass()]; if (randomSpells.empty()) return; @@ -913,7 +913,7 @@ class spell_item_flask_of_the_north : public SpellScriptLoader { Unit* caster = GetCaster(); std::vector possibleSpells; - switch (caster->getClass()) + switch (caster->GetClass()) { case CLASS_WARLOCK: case CLASS_MAGE: @@ -1765,9 +1765,9 @@ class spell_item_savory_deviate_delight : public SpellScriptLoader switch (urand(1, 2)) { // Flip Out - ninja - case 1: spellId = (caster->getGender() == GENDER_MALE ? SPELL_FLIP_OUT_MALE : SPELL_FLIP_OUT_FEMALE); break; + case 1: spellId = (caster->GetGender() == GENDER_MALE ? SPELL_FLIP_OUT_MALE : SPELL_FLIP_OUT_FEMALE); break; // Yaaarrrr - pirate - case 2: spellId = (caster->getGender() == GENDER_MALE ? SPELL_YAAARRRR_MALE : SPELL_YAAARRRR_FEMALE); break; + case 2: spellId = (caster->GetGender() == GENDER_MALE ? SPELL_YAAARRRR_MALE : SPELL_YAAARRRR_FEMALE); break; } caster->CastSpell(caster, spellId, true); } @@ -1828,7 +1828,7 @@ class spell_item_scroll_of_recall : public SpellScriptLoader break; } - if (caster->getLevel() > maxSafeLevel) + if (caster->GetLevel() > maxSafeLevel) { caster->CastSpell(caster, SPELL_LOST, true); @@ -2209,7 +2209,7 @@ class spell_item_the_eye_of_diminution : public SpellScriptLoader { void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { - int32 diff = GetUnitOwner()->getLevel() - 60; + int32 diff = GetUnitOwner()->GetLevel() - 60; if (diff > 0) amount += diff; } @@ -3679,7 +3679,7 @@ class spell_item_soul_preserver : public SpellScriptLoader Unit* caster = eventInfo.GetActor(); - switch (caster->getClass()) + switch (caster->GetClass()) { case CLASS_DRUID: caster->CastSpell(caster, SPELL_SOUL_PRESERVER_DRUID, aurEff); @@ -3801,7 +3801,7 @@ class spell_item_toy_train_set_pulse : public SpellScriptLoader if (Player* target = GetHitUnit()->ToPlayer()) { target->HandleEmoteCommand(EMOTE_ONESHOT_TRAIN); - if (EmotesTextSoundEntry const* soundEntry = sDBCManager.FindTextSoundEmoteFor(TEXT_EMOTE_TRAIN, target->getRace(), target->getGender())) + if (EmotesTextSoundEntry const* soundEntry = sDBCManager.FindTextSoundEmoteFor(TEXT_EMOTE_TRAIN, target->GetRace(), target->GetGender())) target->PlayDistanceSound(soundEntry->ID); } } diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index c343197b60b..7081ce394b5 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -361,7 +361,7 @@ class spell_mage_conjure_refreshment : public SpellScript void HandleDummy(SpellEffIndex /*effIndex*/) { - uint8 level = GetHitUnit()->getLevel(); + uint8 level = GetHitUnit()->GetLevel(); for (uint8 i = 0; i < MAX_CONJURE_REFRESHMENT_SPELLS; ++i) { ConjureRefreshmentData const& spellData = _conjureData[i]; diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 1794663fbf7..2d63e527e2e 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -256,7 +256,7 @@ class spell_pal_blessing_of_faith : public SpellScript { Unit* target = GetHitUnit(); uint32 spellId = 0; - switch (target->getClass()) + switch (target->GetClass()) { case CLASS_DRUID: spellId = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID; break; case CLASS_PALADIN: spellId = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN; break; @@ -806,7 +806,7 @@ class spell_pal_shield_of_the_righteous : public SpellScript { bool Load() override { - return GetCaster()->IsPlayer() && GetCaster()->getClass() == CLASS_PALADIN; + return GetCaster()->IsPlayer() && GetCaster()->GetClass() == CLASS_PALADIN; } void ChangeDamage(SpellEffIndex /*effIndex*/) @@ -836,7 +836,7 @@ class spell_pal_templar_s_verdict : public SpellScript { bool Load() override { - return GetCaster()->IsPlayer() && GetCaster()->getClass() == CLASS_PALADIN; + return GetCaster()->IsPlayer() && GetCaster()->GetClass() == CLASS_PALADIN; } void HandleDamageBonus(SpellEffIndex /*effIndex*/) @@ -1155,7 +1155,7 @@ class spell_pal_word_of_glory: public SpellScript if (GetCaster()->GetTypeId() != TYPEID_PLAYER) return false; - if (GetCaster()->ToPlayer()->getClass() != CLASS_PALADIN) + if (GetCaster()->ToPlayer()->GetClass() != CLASS_PALADIN) return false; return true; @@ -1536,7 +1536,7 @@ class spell_pal_light_of_dawn: public SpellScript if (GetCaster()->GetTypeId() != TYPEID_PLAYER) return false; - if (GetCaster()->ToPlayer()->getClass() != CLASS_PALADIN) + if (GetCaster()->ToPlayer()->GetClass() != CLASS_PALADIN) return false; return true; @@ -1586,7 +1586,7 @@ class spell_pal_holy_radiance: public SpellScript if (GetCaster()->GetTypeId() != TYPEID_PLAYER) return false; - if (GetCaster()->ToPlayer()->getClass() != CLASS_PALADIN) + if (GetCaster()->ToPlayer()->GetClass() != CLASS_PALADIN) return false; _targetCount = 0; diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 0cb4826cab6..022bd7f8856 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -769,7 +769,7 @@ class spell_q10041_q10040_who_are_they : public SpellScriptLoader PreventHitDefaultEffect(effIndex); if (Player* target = GetHitPlayer()) { - target->CastSpell(target, target->getGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true); + target->CastSpell(target, target->GetGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true); target->CastSpell(target, SPELL_GENERIC_DISGUISE, true); } } diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index ab7c546048f..5396d6a8a39 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -869,7 +869,7 @@ class spell_rog_eviscerate : public SpellScript if (GetCaster()->GetTypeId() != TYPEID_PLAYER) return false; - if (GetCaster()->ToPlayer()->getClass() != CLASS_ROGUE) + if (GetCaster()->ToPlayer()->GetClass() != CLASS_ROGUE) return false; return true; @@ -936,7 +936,7 @@ class spell_rog_envenom : public SpellScript bool Load() override { - return (GetCaster()->IsPlayer() && GetCaster()->ToPlayer()->getClass() == CLASS_ROGUE); + return (GetCaster()->IsPlayer() && GetCaster()->ToPlayer()->GetClass() == CLASS_ROGUE); } void ChangeDamage(SpellEffIndex /*effIndex*/) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 96229cd3756..9fe2d8dafd6 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -1554,7 +1554,7 @@ class spell_warl_curse_of_weakness : public AuraScript { if (Player* target = GetTarget()->ToPlayer()) { - switch (target->getClass()) + switch (target->GetClass()) { case CLASS_WARRIOR: _debuffSpellId = SPELL_WARLOCK_JINX_TRIGGERED_RAGE; diff --git a/src/server/scripts/World/duel_reset.cpp b/src/server/scripts/World/duel_reset.cpp index 577031fca39..fd2575ab6f7 100644 --- a/src/server/scripts/World/duel_reset.cpp +++ b/src/server/scripts/World/duel_reset.cpp @@ -80,11 +80,11 @@ class DuelResetScript : public PlayerScript loser->RestoreHealthAfterDuel(); // check if player1 class uses mana - if (winner->GetPowerType() == POWER_MANA || winner->getClass() == CLASS_DRUID) + if (winner->GetPowerType() == POWER_MANA || winner->GetClass() == CLASS_DRUID) winner->RestoreManaAfterDuel(); // check if player2 class uses mana - if (loser->GetPowerType() == POWER_MANA || loser->getClass() == CLASS_DRUID) + if (loser->GetPowerType() == POWER_MANA || loser->GetClass() == CLASS_DRUID) loser->RestoreManaAfterDuel(); } } diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 479fc074e30..e220e83d4e8 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -1217,7 +1217,7 @@ class go_amberpine_outhouse : public GameObjectScript Creature* target = player->FindNearestCreature(NPC_OUTHOUSE_BUNNY, 3.0f); if (target) { - target->AI()->SetData(1, player->getGender()); + target->AI()->SetData(1, player->GetGender()); me->CastSpell(target, SPELL_INDISPOSED_III); } me->CastSpell(player, SPELL_INDISPOSED); diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index 8786cb2a704..ac8b1006f75 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -399,11 +399,11 @@ class item_generic_limit_chance_above_60 : public ItemScript bool OnCastItemCombatSpell(Player* /*player*/, Unit* victim, SpellInfo const* /*spellInfo*/, Item* /*item*/) override { // spell proc chance gets severely reduced on victims > 60 (formula unknown) - if (victim->getLevel() > 60) + if (victim->GetLevel() > 60) { // gives ~0.1% proc chance at lvl 70 float const lvlPenaltyFactor = 9.93f; - float const failureChance = (victim->getLevel() - 60) * lvlPenaltyFactor; + float const failureChance = (victim->GetLevel() - 60) * lvlPenaltyFactor; // base ppm chance was already rolled, only roll success chance return !roll_chance_f(failureChance); diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index f70ec2352d0..9c0cfd3de0c 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -206,7 +206,7 @@ int32 DoHighUnlearnCost(Player* /*player*/) //tailor int32 DoMedUnlearnCost(Player* player) //blacksmith, leatherwork { - uint8 level = player->getLevel(); + uint8 level = player->GetLevel(); if (level < 51) return 250000; else if (level < 66) @@ -217,7 +217,7 @@ int32 DoMedUnlearnCost(Player* player) //blacksmith, leather int32 DoLowUnlearnCost(Player* player) //blacksmith { - uint8 level = player->getLevel(); + uint8 level = player->GetLevel(); if (level < 66) return 50000; else @@ -430,7 +430,7 @@ class npc_prof_blacksmith : public CreatureScript } } //WEAPONSMITH SPEC - if (player->HasSpell(S_WEAPON) && player->getLevel() > 49 && player->GetBaseSkillValue(SKILL_BLACKSMITHING) >= 250) + if (player->HasSpell(S_WEAPON) && player->GetLevel() > 49 && player->GetBaseSkillValue(SKILL_BLACKSMITHING) >= 250) { switch (creatureId) { @@ -775,7 +775,7 @@ class npc_prof_leather : public CreatureScript if (me->IsTrainer()) AddGossipItemFor(player, GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); - if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING) >= 250 && player->getLevel() > 49) + if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING) >= 250 && player->GetLevel() > 49) { switch (me->GetEntry()) { @@ -907,7 +907,7 @@ class npc_prof_tailor : public CreatureScript AddGossipItemFor(player, GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); //TAILORING SPEC - if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 350 && player->getLevel() > 59) + if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 350 && player->GetLevel() > 59) { if (player->GetQuestRewardStatus(10831) || player->GetQuestRewardStatus(10832) || player->GetQuestRewardStatus(10833)) { diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index b9909ea794b..b3864152bb0 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1656,11 +1656,11 @@ class npc_tournament_mount : public CreatureScript case NPC_ARGENT_WARHORSE: { if (player->HasAchieved(ACHIEVEMENT_CHAMPION_ALLIANCE) || player->HasAchieved(ACHIEVEMENT_CHAMPION_HORDE)) - return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_CHAMPION : SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION; + return player->GetClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_CHAMPION : SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION; else if (player->HasAchieved(ACHIEVEMENT_ARGENT_VALOR)) - return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_VALIANT : SPELL_PENNANT_ARGENT_CRUSADE_VALIANT; + return player->GetClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_VALIANT : SPELL_PENNANT_ARGENT_CRUSADE_VALIANT; else - return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_ASPIRANT : SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT; + return player->GetClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_ASPIRANT : SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT; } default: return 0;