@@ -497,9 +497,8 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
497497 SetPvpFlag(UNIT_BYTE2_FLAG_PVP);
498498 SetUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED);
499499 }
500+
500501 SetUnitFlag2(UNIT_FLAG2_REGENERATE_POWER);
501- SetModCastingSpeed(1.0f); // fix cast time showed in spell tooltip on client
502- SetHoverHeight(1.0f); // default for players in 3.0.3
503502
504503 SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1)); // -1 is default value
505504
@@ -510,37 +509,9 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
510509 SetFacialStyle(createInfo->FacialHair);
511510 SetRestState((GetSession()->IsARecruiter() || GetSession()->GetRecruiterId() != 0) ? REST_STATE_RAF_LINKED : REST_STATE_NOT_RAF_LINKED);
512511 SetNativeGender(Gender(createInfo->Gender));
513- SetArenaFaction(0);
514-
515- SetUInt32Value(PLAYER_GUILDID, 0);
516- SetGuildRank(0);
517- SetUInt32Value(PLAYER_GUILD_TIMESTAMP, 0);
518-
519- for (int i = 0; i < KNOWN_TITLES_SIZE; ++i)
520- SetUInt64Value(PLAYER__FIELD_KNOWN_TITLES + i, 0); // 0=disabled
521- SetUInt32Value(PLAYER_CHOSEN_TITLE, 0);
522-
523- SetUInt32Value(PLAYER_FIELD_KILLS, 0);
524- SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0);
525- SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0);
526- SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0);
527512
528513 // set starting level
529- uint32 start_level = GetClass() != CLASS_DEATH_KNIGHT
530- ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
531- : sWorld->getIntConfig(CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL);
532-
533- if (m_session->HasPermission(rbac::RBAC_PERM_USE_START_GM_LEVEL))
534- {
535- uint32 gm_level = GetClass() != CLASS_DEATH_KNIGHT
536- ? sWorld->getIntConfig(CONFIG_START_GM_LEVEL)
537- : std::max(sWorld->getIntConfig(CONFIG_START_GM_LEVEL), sWorld->getIntConfig(CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL));
538-
539- if (gm_level > start_level)
540- start_level = gm_level;
541- }
542-
543- SetLevel(start_level, false);
514+ SetLevel(GetStartLevel(createInfo->Class), false);
544515
545516 InitRunes();
546517
@@ -2677,7 +2648,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
26772648 {
26782649 SetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i, 0);
26792650 SetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, 0);
2680- SetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i, 1.00f );
2651+ SetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i, 1.0f );
26812652 }
26822653
26832654 //reset attack power, damage and attack speed fields
@@ -11296,7 +11267,6 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
1129611267 // Do not allow polearm to be equipped in the offhand (rare case for the only 1h polearm 41750)
1129711268 if (type == INVTYPE_WEAPON && pProto->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM)
1129811269 return EQUIP_ERR_WRONG_SLOT;
11299-
1130011270 else if (type == INVTYPE_WEAPON || type == INVTYPE_WEAPONOFFHAND)
1130111271 {
1130211272 if (!CanDualWield())
@@ -22221,6 +22191,19 @@ void Player::ReportedAfkBy(Player* reporter)
2222122191 reporter->SendDirectMessage(reportAfkResult.Write());
2222222192}
2222322193
22194+ uint8 Player::GetStartLevel(uint8 playerClass) const
22195+ {
22196+ uint8 startLevel = sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL);
22197+
22198+ if (playerClass == CLASS_DEATH_KNIGHT)
22199+ startLevel = std::max<uint8>(sWorld->getIntConfig(CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL), startLevel);
22200+
22201+ if (m_session->HasPermission(rbac::RBAC_PERM_USE_START_GM_LEVEL))
22202+ startLevel = std::max<uint8>(sWorld->getIntConfig(CONFIG_START_GM_LEVEL), startLevel);
22203+
22204+ return startLevel;
22205+ }
22206+
2222422207WorldLocation Player::GetStartPosition() const
2222522208{
2222622209 PlayerInfo const* info = sObjectMgr->GetPlayerInfo(GetRace(), GetClass());
0 commit comments