feat: add Player:GetXP() (#77)

This commit is contained in:
Axel Cocat
2022-12-29 11:53:13 +01:00
committed by GitHub
parent 03f1948b2d
commit 900ad17d2e
2 changed files with 12 additions and 0 deletions

View File

@@ -507,6 +507,7 @@ ElunaRegister<Player> PlayerMethods[] =
{ "GetDrunkValue", &LuaPlayer::GetDrunkValue },
{ "GetBattlegroundId", &LuaPlayer::GetBattlegroundId },
{ "GetBattlegroundTypeId", &LuaPlayer::GetBattlegroundTypeId },
{ "GetXP", &LuaPlayer::GetXP },
{ "GetXPRestBonus", &LuaPlayer::GetXPRestBonus },
{ "GetGroupInvite", &LuaPlayer::GetGroupInvite },
{ "GetSubGroup", &LuaPlayer::GetSubGroup },

View File

@@ -960,6 +960,17 @@ namespace LuaPlayer
return 1;
}
/**
* Returns the [Player]'s experience points
*
* @return uint32 xp
*/
int GetXP(lua_State* L, Player* player)
{
Eluna::Push(L, player->GetUInt32Value(PLAYER_XP));
return 1;
}
/**
* Returns rested experience bonus
*