fixed xp reduction at max level
This commit is contained in:
parent
9715afee68
commit
a0b945afcd
1 changed files with 16 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue