fixed xp reduction at max level

This commit is contained in:
ElderShell 2026-05-03 02:40:01 -06:00
parent 9715afee68
commit a0b945afcd

View file

@ -40,6 +40,7 @@
#include "ConditionMgr.h"
#include "Config.h"
#include "CreatureAI.h"
#include "DBCEnums.h"
#include "DatabaseEnv.h"
#include "DatabaseEnvFwd.h"
#include "DisableMgr.h"
@ -4936,6 +4937,21 @@ void Player::RepopAtGraveyard()
TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation());
uint32 nextLevelXp = GetUInt32Value(PLAYER_NEXT_LEVEL_XP);
if (GetLevel() == DEFAULT_MAX_LEVEL)
{
QueryResult xpResult = WorldDatabase.Query(
"SELECT Experience FROM player_xp_for_level WHERE Level = {} LIMIT 1",
GetLevel() - 1
);
if (xpResult)
{
Field* fields = xpResult->Fetch();
nextLevelXp = fields[0].Get<uint32>();
}
}
uint32 reduction = nextLevelXp / 10;
uint32 currentXp = GetUInt32Value(PLAYER_XP);