fix(Core): Correct Quest Details Display at Max Level (#13046)

* fix(Core): Quest Details Display at Max Level

* Add OnSetMaxLevel hook
This commit is contained in:
ZhengPeiRu21
2022-12-20 04:14:53 -07:00
committed by GitHub
parent 4ca370d940
commit 7990de44c1
4 changed files with 62 additions and 11 deletions

View File

@@ -2537,7 +2537,9 @@ void Player::InitStatsForLevel(bool reapplyMods)
PlayerLevelInfo info;
sObjectMgr->GetPlayerLevelInfo(getRace(true), getClass(), getLevel(), &info);
SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL));
uint32 maxPlayerLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
sScriptMgr->OnSetMaxLevel(this, maxPlayerLevel);
SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, maxPlayerLevel);
SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr->GetXPForLevel(getLevel()));
// reset before any aura state sources (health set/aura apply)