mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-28 21:02:14 +01:00
Core/Unit: rename several getters to follow codestyle
uint8 GetLevel()
uint8 GetLevelForTarget(WorldObject const* /*target*/)
void SetLevel(uint8 lvl)
uint8 GetRace()
uint32 GetRaceMask()
uint8 GetClass()
uint32 GetClassMask()
uint8 GetGender()
(cherry picked from commit 5c09ff51f7)
This commit is contained in:
@@ -880,7 +880,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact
|
||||
{
|
||||
TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Create Character: %s %s", GetAccountId(), GetRemoteAddress().c_str(), newChar->GetName().c_str(), newChar->GetGUID().ToString().c_str());
|
||||
sScriptMgr->OnPlayerCreate(newChar.get());
|
||||
sCharacterCache->AddCharacterCacheEntry(newChar->GetGUID(), GetAccountId(), newChar->GetName(), newChar->GetNativeSex(), newChar->getRace(), newChar->getClass(), newChar->getLevel(), false);
|
||||
sCharacterCache->AddCharacterCacheEntry(newChar->GetGUID(), GetAccountId(), newChar->GetName(), newChar->GetNativeSex(), newChar->GetRace(), newChar->GetClass(), newChar->GetLevel(), false);
|
||||
|
||||
SendCharCreate(CHAR_CREATE_SUCCESS, newChar->GetGUID());
|
||||
}
|
||||
@@ -1117,7 +1117,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
{
|
||||
pCurrChar->setCinematic(1);
|
||||
|
||||
if (PlayerInfo const* playerInfo = sObjectMgr->GetPlayerInfo(pCurrChar->getRace(), pCurrChar->getClass()))
|
||||
if (PlayerInfo const* playerInfo = sObjectMgr->GetPlayerInfo(pCurrChar->GetRace(), pCurrChar->GetClass()))
|
||||
{
|
||||
switch (pCurrChar->GetCreateMode())
|
||||
{
|
||||
@@ -1126,10 +1126,10 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
pCurrChar->SendMovieStart(playerInfo->introMovieId.get());
|
||||
else if (playerInfo->introSceneId)
|
||||
pCurrChar->GetSceneMgr().PlayScene(*playerInfo->introSceneId);
|
||||
else if (sChrClassesStore.AssertEntry(pCurrChar->getClass())->CinematicSequenceID)
|
||||
pCurrChar->SendCinematicStart(sChrClassesStore.AssertEntry(pCurrChar->getClass())->CinematicSequenceID);
|
||||
else if (sChrRacesStore.AssertEntry(pCurrChar->getRace())->CinematicSequenceID)
|
||||
pCurrChar->SendCinematicStart(sChrRacesStore.AssertEntry(pCurrChar->getRace())->CinematicSequenceID);
|
||||
else if (sChrClassesStore.AssertEntry(pCurrChar->GetClass())->CinematicSequenceID)
|
||||
pCurrChar->SendCinematicStart(sChrClassesStore.AssertEntry(pCurrChar->GetClass())->CinematicSequenceID);
|
||||
else if (sChrRacesStore.AssertEntry(pCurrChar->GetRace())->CinematicSequenceID)
|
||||
pCurrChar->SendCinematicStart(sChrRacesStore.AssertEntry(pCurrChar->GetRace())->CinematicSequenceID);
|
||||
break;
|
||||
case PlayerCreateMode::NPE:
|
||||
if (playerInfo->introSceneIdNPE)
|
||||
@@ -1232,7 +1232,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
if (pCurrChar->m_deathState == DEAD)
|
||||
{
|
||||
// not blizz like, we must correctly save and load player instead...
|
||||
if (pCurrChar->getRace() == RACE_NIGHTELF && !pCurrChar->HasAura(20584))
|
||||
if (pCurrChar->GetRace() == RACE_NIGHTELF && !pCurrChar->HasAura(20584))
|
||||
pCurrChar->CastSpell(pCurrChar, 20584, true);// auras SPELL_AURA_INCREASE_SPEED(+speed in wisp form), SPELL_AURA_INCREASE_SWIM_SPEED(+swim speed in wisp form), SPELL_AURA_TRANSFORM (to wisp form)
|
||||
|
||||
if (!pCurrChar->HasAura(8326))
|
||||
@@ -1287,7 +1287,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* 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);
|
||||
|
||||
@@ -1374,7 +1374,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
SendNotification(LANG_GM_ON);
|
||||
|
||||
TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Login Character: [%s] (%s) Level: %d, XP: %u/%u (%u left)",
|
||||
GetAccountId(), GetRemoteAddress().c_str(), pCurrChar->GetName().c_str(), pCurrChar->GetGUID().ToString().c_str(), pCurrChar->getLevel(),
|
||||
GetAccountId(), GetRemoteAddress().c_str(), pCurrChar->GetName().c_str(), pCurrChar->GetGUID().ToString().c_str(), pCurrChar->GetLevel(),
|
||||
_player->GetXP(), _player->GetXPForNextLevel(), std::max(0, (int32)_player->GetXPForNextLevel() - (int32)_player->GetXP()));
|
||||
|
||||
if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STATE_STUNNED))
|
||||
@@ -1682,7 +1682,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPackets::Character::SetPlay
|
||||
|
||||
void WorldSession::HandleAlterAppearance(WorldPackets::Character::AlterApperance& packet)
|
||||
{
|
||||
if (!ValidateAppearance(Races(_player->getRace()), Classes(_player->getClass()), Gender(packet.NewSex), MakeChrCustomizationChoiceRange(packet.Customizations)))
|
||||
if (!ValidateAppearance(Races(_player->GetRace()), Classes(_player->GetClass()), Gender(packet.NewSex), MakeChrCustomizationChoiceRange(packet.Customizations)))
|
||||
return;
|
||||
|
||||
GameObject* go = _player->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_BARBER_CHAIR, 5.0f);
|
||||
@@ -1927,7 +1927,7 @@ void WorldSession::HandleEquipmentSetSave(WorldPackets::EquipmentSet::SaveEquipm
|
||||
if (!sConditionMgr->IsPlayerMeetingCondition(_player, condition))
|
||||
return false;
|
||||
|
||||
if (illusion->ScalingClassRestricted > 0 && uint8(illusion->ScalingClassRestricted) != _player->getClass())
|
||||
if (illusion->ScalingClassRestricted > 0 && uint8(illusion->ScalingClassRestricted) != _player->GetClass())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -2579,11 +2579,11 @@ void WorldSession::HandleOpeningCinematic(WorldPackets::Misc::OpeningCinematic&
|
||||
if (*_player->m_activePlayerData->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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user