Core/Cleanup: refactor honor and arena rating modifying methods:
* simplify wierd logic; * add const modifiers to several getter methods. (Idea based on commit [11187] by zergtmn for Mangos)
This commit is contained in:
@@ -1782,12 +1782,12 @@ class Player : public Unit, public GridObject<Player>
|
||||
{
|
||||
SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + type, value);
|
||||
}
|
||||
uint32 GetArenaTeamId(uint8 slot) { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_ID); }
|
||||
uint32 GetArenaPersonalRating(uint8 slot) { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING); }
|
||||
static uint32 GetArenaTeamIdFromDB(uint64 guid, uint8 slot);
|
||||
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 GetArenaPersonalRating(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING); }
|
||||
void SetArenaTeamIdInvited(uint32 ArenaTeamId) { m_ArenaTeamIdInvited = ArenaTeamId; }
|
||||
uint32 GetArenaTeamIdInvited() { return m_ArenaTeamIdInvited; }
|
||||
static void LeaveAllArenaTeams(uint64 guid);
|
||||
|
||||
Difficulty GetDifficulty(bool isRaid) const { return isRaid ? m_raidDifficulty : m_dungeonDifficulty; }
|
||||
Difficulty GetDungeonDifficulty() const { return m_dungeonDifficulty; }
|
||||
@@ -1992,23 +1992,13 @@ class Player : public Unit, public GridObject<Player>
|
||||
/*********************************************************/
|
||||
void UpdateHonorFields();
|
||||
bool RewardHonor(Unit *pVictim, uint32 groupsize, int32 honor = -1, bool pvptoken = false);
|
||||
uint32 GetHonorPoints() { return GetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY); }
|
||||
uint32 GetArenaPoints() { return GetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY); }
|
||||
uint32 GetHonorPoints() const { return GetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY); }
|
||||
uint32 GetArenaPoints() const { return GetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY); }
|
||||
void ModifyHonorPoints(int32 value);
|
||||
void ModifyArenaPoints(int32 value);
|
||||
uint32 GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot);
|
||||
void SetHonorPoints(uint32 value)
|
||||
{
|
||||
SetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY, value);
|
||||
if (value)
|
||||
AddKnownCurrency(ITEM_HONOR_POINTS_ID); // Arena Points
|
||||
}
|
||||
void SetArenaPoints(uint32 value)
|
||||
{
|
||||
SetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY, value);
|
||||
if (value)
|
||||
AddKnownCurrency(ITEM_ARENA_POINTS_ID); // Arena Points
|
||||
}
|
||||
uint32 GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot) const;
|
||||
void SetHonorPoints(uint32 value);
|
||||
void SetArenaPoints(uint32 value);
|
||||
|
||||
//End of PvP System
|
||||
|
||||
|
||||
Reference in New Issue
Block a user