mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-04 22:07:52 +00:00
Impl usefull functions
This commit is contained in:
@@ -7391,6 +7391,20 @@ uint32 Player::GetArenaTeamIdFromStorage(uint32 guid, uint8 slot)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type)
|
||||||
|
{
|
||||||
|
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID);
|
||||||
|
stmt->setUInt32(0, GUID_LOPART(guid));
|
||||||
|
stmt->setUInt8(1, type);
|
||||||
|
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||||
|
|
||||||
|
if (!result)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
uint32 id = (*result)[0].GetUInt32();
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
uint32 Player::GetZoneIdFromDB(uint64 guid)
|
uint32 Player::GetZoneIdFromDB(uint64 guid)
|
||||||
{
|
{
|
||||||
uint32 guidLow = GUID_LOPART(guid);
|
uint32 guidLow = GUID_LOPART(guid);
|
||||||
|
|||||||
@@ -1885,6 +1885,7 @@ class Player : public Unit, public GridObject<Player>
|
|||||||
{
|
{
|
||||||
SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + type, value);
|
SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + type, value);
|
||||||
}
|
}
|
||||||
|
static uint32 GetArenaTeamIdFromDB(uint64 guid, uint8 slot);
|
||||||
static void LeaveAllArenaTeams(uint64 guid);
|
static void LeaveAllArenaTeams(uint64 guid);
|
||||||
uint32 GetArenaTeamId(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_ID); }
|
uint32 GetArenaTeamId(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_ID); }
|
||||||
uint32 GetArenaPersonalRating(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING); }
|
uint32 GetArenaPersonalRating(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING); }
|
||||||
@@ -2076,6 +2077,7 @@ class Player : public Unit, public GridObject<Player>
|
|||||||
static TeamId TeamIdForRace(uint8 race);
|
static TeamId TeamIdForRace(uint8 race);
|
||||||
TeamId GetTeamId(bool original = false) const { return original ? TeamIdForRace(getRace()) : m_team; };
|
TeamId GetTeamId(bool original = false) const { return original ? TeamIdForRace(getRace()) : m_team; };
|
||||||
void setFactionForRace(uint8 race);
|
void setFactionForRace(uint8 race);
|
||||||
|
void setTeamId(TeamId teamid) { m_team = teamid; };
|
||||||
|
|
||||||
void InitDisplayIds();
|
void InitDisplayIds();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user