diff --git a/src/game/ArenaTeam.cpp b/src/game/ArenaTeam.cpp index 6b88ba687..62662718d 100644 --- a/src/game/ArenaTeam.cpp +++ b/src/game/ArenaTeam.cpp @@ -138,11 +138,11 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid) { pl->SetInArenaTeam(Id, GetSlot()); pl->SetArenaTeamIdInvited(0); - pl->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot()*6) + 5, newmember.personal_rating ); + pl->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * 7) + 5, newmember.personal_rating ); // hide promote/remove buttons if(CaptainGuid != PlayerGuid) - pl->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * 6) + 1, 1); + pl->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * 7) + 1, 1); } return true; } @@ -238,7 +238,7 @@ void ArenaTeam::SetCaptain(const uint64& guid) // disable remove/promote buttons Player *oldcaptain = objmgr.GetPlayer(GetCaptain()); if(oldcaptain) - oldcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 + (GetSlot() * 6), 1); + oldcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 + (GetSlot() * 7), 1); // set new captain CaptainGuid = guid; @@ -249,7 +249,7 @@ void ArenaTeam::SetCaptain(const uint64& guid) // enable remove/promote buttons Player *newcaptain = objmgr.GetPlayer(guid); if(newcaptain) - newcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 + (GetSlot() * 6), 0); + newcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 + (GetSlot() * 7), 0); } void ArenaTeam::DelMember(uint64 guid) @@ -272,7 +272,7 @@ void ArenaTeam::DelMember(uint64 guid) // delete all info regarding this team for(int i = 0; i < 6; ++i) { - player->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * 6) + i, 0); + player->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * 7) + i, 0); } } @@ -568,8 +568,8 @@ void ArenaTeam::MemberLost(Player * plr, uint32 againstRating) itr->games_week +=1; itr->games_season +=1; // update the unit fields - plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 6 * GetSlot() + 2, itr->games_week); - plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 6 * GetSlot() + 3, itr->games_season); + plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 7 * GetSlot() + 2, itr->games_week); + plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 7 * GetSlot() + 3, itr->games_season); return; } } @@ -614,8 +614,8 @@ void ArenaTeam::MemberWon(Player * plr, uint32 againstRating) itr->wins_season += 1; itr->wins_week += 1; // update unit fields - plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 6 * GetSlot() + 2, itr->games_week); - plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 6 * GetSlot() + 3, itr->games_season); + plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 7 * GetSlot() + 2, itr->games_week); + plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 7 * GetSlot() + 3, itr->games_season); return; } } diff --git a/src/game/ArenaTeam.h b/src/game/ArenaTeam.h index 9ad3ea618..775dc9b07 100644 --- a/src/game/ArenaTeam.h +++ b/src/game/ArenaTeam.h @@ -101,7 +101,7 @@ struct ArenaTeamMember else personal_rating += mod; if(plr) - plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot*6) + 5, personal_rating); + plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot*7) + 5, personal_rating); } }; diff --git a/src/game/BattleGroundHandler.cpp b/src/game/BattleGroundHandler.cpp index a24ff1bdc..d37a38572 100644 --- a/src/game/BattleGroundHandler.cpp +++ b/src/game/BattleGroundHandler.cpp @@ -726,7 +726,7 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data ) Player *member = itr->getSource(); // calc avg personal rating - avg_pers_rating += member->GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (arenaslot*6) + 5); + avg_pers_rating += member->GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (arenaslot * 7) + 5); } if (arenatype) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 22f1b8f3c..3b3015ad6 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -13868,7 +13868,7 @@ void Player::_LoadDeclinedNames(QueryResult* result) void Player::_LoadArenaTeamInfo(QueryResult *result) { // arenateamid, played_week, played_season, personal_rating - memset((void*)&m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1], 0, sizeof(uint32)*18); + memset((void*)&m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1], 0, sizeof(uint32)*21); if (!result) return; @@ -13889,12 +13889,13 @@ void Player::_LoadArenaTeamInfo(QueryResult *result) } uint8 arenaSlot = aTeam->GetSlot(); - m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arenaSlot * 6] = arenateamid; // TeamID - m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arenaSlot * 6 + 1] = ((aTeam->GetCaptain() == GetGUID()) ? (uint32)0 : (uint32)1); // Captain 0, member 1 - m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arenaSlot * 6 + 2] = played_week; // Played Week - m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arenaSlot * 6 + 3] = played_season; // Played Season - m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arenaSlot * 6 + 4] = 0; // Unk - m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arenaSlot * 6 + 5] = personal_rating; // Personal Rating + m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arenaSlot * 7 + 0] = arenateamid; // TeamID + m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arenaSlot * 7 + 1] = ((aTeam->GetCaptain() == GetGUID()) ? (uint32)0 : (uint32)1); // Captain 0, member 1 + m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arenaSlot * 7 + 2] = played_week; // Played Week + m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arenaSlot * 7 + 3] = played_season; // Played Season + m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arenaSlot * 7 + 4] = 0; // Unk + m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arenaSlot * 7 + 5] = personal_rating; // Personal Rating + m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arenaSlot * 7 + 6] = 0; // unk }while (result->NextRow()); delete result; @@ -14128,8 +14129,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) continue; // arena team not exist or not member, cleanup fields - for(int j =0; j < 6; ++j) - SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arena_slot * 6 + j, 0); + for(int j = 0; j < 7; ++j) + SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + arena_slot * 7 + j, 0); } _LoadBoundInstances(holder->GetResult(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES)); @@ -17394,7 +17395,7 @@ uint32 Player::GetMaxPersonalArenaRatingRequirement() { if(ArenaTeam * at = objmgr.GetArenaTeamById(GetArenaTeamId(i))) { - uint32 p_rating = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (i * 6) + 5); + uint32 p_rating = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (i * 7) + 5); uint32 t_rating = at->GetRating(); p_rating = p_rating