mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 08:17:56 +00:00
fix(Core/LFG): Hide XP from max players (#18103)
* Cherry-pick Player::IsMaxLevel from TrinityCore * Correctly hide XP reward for max level players in LFG * Closes #18101
This commit is contained in:
@@ -2524,6 +2524,11 @@ void Player::GiveLevel(uint8 level)
|
|||||||
sScriptMgr->OnPlayerLevelChanged(this, oldLevel);
|
sScriptMgr->OnPlayerLevelChanged(this, oldLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Player::IsMaxLevel() const
|
||||||
|
{
|
||||||
|
return GetLevel() >= GetUInt32Value(PLAYER_FIELD_MAX_LEVEL);
|
||||||
|
}
|
||||||
|
|
||||||
void Player::InitTalentForLevel()
|
void Player::InitTalentForLevel()
|
||||||
{
|
{
|
||||||
uint32 talentPointsForLevel = CalculateTalentsPoints();
|
uint32 talentPointsForLevel = CalculateTalentsPoints();
|
||||||
|
|||||||
@@ -1686,6 +1686,7 @@ public:
|
|||||||
void SetFreeTalentPoints(uint32 points);
|
void SetFreeTalentPoints(uint32 points);
|
||||||
bool resetTalents(bool noResetCost = false);
|
bool resetTalents(bool noResetCost = false);
|
||||||
[[nodiscard]] uint32 resetTalentsCost() const;
|
[[nodiscard]] uint32 resetTalentsCost() const;
|
||||||
|
bool IsMaxLevel() const;
|
||||||
void InitTalentForLevel();
|
void InitTalentForLevel();
|
||||||
void BuildPlayerTalentsInfoData(WorldPacket* data);
|
void BuildPlayerTalentsInfoData(WorldPacket* data);
|
||||||
void BuildPetTalentsInfoData(WorldPacket* data);
|
void BuildPetTalentsInfoData(WorldPacket* data);
|
||||||
|
|||||||
@@ -2348,7 +2348,7 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP)
|
|||||||
WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4 + 4 + 4 + 4 + 4));
|
WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4 + 4 + 4 + 4 + 4));
|
||||||
data << uint32(questid);
|
data << uint32(questid);
|
||||||
|
|
||||||
if (GetLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
if (!IsMaxLevel())
|
||||||
{
|
{
|
||||||
data << uint32(XP);
|
data << uint32(XP);
|
||||||
data << uint32(quest->GetRewOrReqMoney(GetLevel()));
|
data << uint32(quest->GetRewOrReqMoney(GetLevel()));
|
||||||
|
|||||||
@@ -188,7 +188,10 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData*
|
|||||||
uint8 playerLevel = GetPlayer() ? GetPlayer()->GetLevel() : 0;
|
uint8 playerLevel = GetPlayer() ? GetPlayer()->GetLevel() : 0;
|
||||||
data << uint8(done);
|
data << uint8(done);
|
||||||
data << uint32(quest->GetRewOrReqMoney(playerLevel));
|
data << uint32(quest->GetRewOrReqMoney(playerLevel));
|
||||||
data << uint32(quest->XPValue(playerLevel));
|
if (!GetPlayer()->IsMaxLevel())
|
||||||
|
data << uint32(quest->XPValue(playerLevel));
|
||||||
|
else
|
||||||
|
data << uint32(0);
|
||||||
data << uint32(0);
|
data << uint32(0);
|
||||||
data << uint32(0);
|
data << uint32(0);
|
||||||
data << uint8(quest->GetRewItemsCount());
|
data << uint8(quest->GetRewItemsCount());
|
||||||
|
|||||||
Reference in New Issue
Block a user