mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[9358] Not use PLAYER_FIELD_ARENA_TEAM_INFO_1_1 directly.
This commit is contained in:
parent
c3bc0aedbe
commit
2151704669
7 changed files with 51 additions and 44 deletions
|
|
@ -14453,13 +14453,13 @@ void Player::_LoadArenaTeamInfo(QueryResult *result)
|
|||
}
|
||||
uint8 arenaSlot = aTeam->GetSlot();
|
||||
|
||||
m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (arenaSlot * ARENA_TEAM_END) + ARENA_TEAM_ID] = arenateamid; // TeamID
|
||||
m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (arenaSlot * ARENA_TEAM_END) + ARENA_TEAM_TYPE] = aTeam->GetType(); // team type
|
||||
m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (arenaSlot * ARENA_TEAM_END) + ARENA_TEAM_MEMBER] = ((aTeam->GetCaptain() == GetGUID()) ? (uint32)0 : (uint32)1); // Captain 0, member 1
|
||||
m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (arenaSlot * ARENA_TEAM_END) + ARENA_TEAM_GAMES_WEEK] = played_week; // Played Week
|
||||
m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (arenaSlot * ARENA_TEAM_END) + ARENA_TEAM_GAMES_SEASON] = played_season; // Played Season
|
||||
m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (arenaSlot * ARENA_TEAM_END) + ARENA_TEAM_WINS_SEASON] = wons_season; // wins season
|
||||
m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (arenaSlot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING] = personal_rating; // Personal Rating
|
||||
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_ID, arenateamid);
|
||||
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_TYPE, aTeam->GetType());
|
||||
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_MEMBER, (aTeam->GetCaptain() == GetGUID()) ? 0 : 1);
|
||||
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_GAMES_WEEK, played_week);
|
||||
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_GAMES_SEASON, played_season);
|
||||
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_WINS_SEASON, wons_season);
|
||||
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_PERSONAL_RATING, personal_rating);
|
||||
|
||||
} while (result->NextRow());
|
||||
delete result;
|
||||
|
|
@ -14733,7 +14733,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
|||
|
||||
// arena team not exist or not member, cleanup fields
|
||||
for(int j = 0; j < ARENA_TEAM_END; ++j)
|
||||
SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (arena_slot * ARENA_TEAM_END) + j, 0);
|
||||
SetArenaTeamInfoField(arena_slot, ArenaTeamInfoType(j), 0);
|
||||
}
|
||||
|
||||
SetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY, fields[41].GetUInt32());
|
||||
|
|
@ -16724,13 +16724,13 @@ void Player::SaveDataFieldToDB()
|
|||
bool Player::SaveValuesArrayInDB(Tokens const& tokens, uint64 guid)
|
||||
{
|
||||
std::ostringstream ss2;
|
||||
ss2<<"UPDATE characters SET data='";
|
||||
int i=0;
|
||||
ss2 << "UPDATE characters SET data='";
|
||||
int i = 0;
|
||||
for (Tokens::const_iterator iter = tokens.begin(); iter != tokens.end(); ++iter, ++i)
|
||||
{
|
||||
ss2<<tokens[i]<<" ";
|
||||
ss2 << tokens[i] << " ";
|
||||
}
|
||||
ss2<<"' WHERE guid='"<< GUID_LOPART(guid) <<"'";
|
||||
ss2 << "' WHERE guid='" << GUID_LOPART(guid) << "'";
|
||||
|
||||
return CharacterDatabase.Execute(ss2.str().c_str());
|
||||
}
|
||||
|
|
@ -16821,8 +16821,8 @@ void Player::SendAutoRepeatCancel(Unit *target)
|
|||
void Player::SendExplorationExperience(uint32 Area, uint32 Experience)
|
||||
{
|
||||
WorldPacket data( SMSG_EXPLORATION_EXPERIENCE, 8 );
|
||||
data << Area;
|
||||
data << Experience;
|
||||
data << uint32(Area);
|
||||
data << uint32(Experience);
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
|
|
@ -16830,7 +16830,7 @@ void Player::SendDungeonDifficulty(bool IsInGroup)
|
|||
{
|
||||
uint8 val = 0x00000001;
|
||||
WorldPacket data(MSG_SET_DUNGEON_DIFFICULTY, 12);
|
||||
data << (uint32)GetDungeonDifficulty();
|
||||
data << uint32(GetDungeonDifficulty());
|
||||
data << uint32(val);
|
||||
data << uint32(IsInGroup);
|
||||
GetSession()->SendPacket(&data);
|
||||
|
|
@ -16901,7 +16901,7 @@ void Player::ResetInstances(uint8 method, bool isRaid)
|
|||
void Player::SendResetInstanceSuccess(uint32 MapId)
|
||||
{
|
||||
WorldPacket data(SMSG_INSTANCE_RESET, 4);
|
||||
data << MapId;
|
||||
data << uint32(MapId);
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
|
|
@ -16909,8 +16909,8 @@ void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId)
|
|||
{
|
||||
// TODO: find what other fail reasons there are besides players in the instance
|
||||
WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 4);
|
||||
data << reason;
|
||||
data << MapId;
|
||||
data << uint32(reason);
|
||||
data << uint32(MapId);
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
|
|
@ -17324,12 +17324,16 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply)
|
|||
{
|
||||
uint16 Opcode= (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER;
|
||||
|
||||
for(int eff=0;eff<96;++eff)
|
||||
for(int eff = 0; eff < 96; ++eff)
|
||||
{
|
||||
uint64 _mask = 0;
|
||||
uint32 _mask2= 0;
|
||||
if (eff<64) _mask = uint64(1) << (eff- 0);
|
||||
else _mask2= uint32(1) << (eff-64);
|
||||
|
||||
if (eff < 64)
|
||||
_mask = uint64(1) << (eff - 0);
|
||||
else
|
||||
_mask2= uint32(1) << (eff - 64);
|
||||
|
||||
if ( mod->mask & _mask || mod->mask2 & _mask2)
|
||||
{
|
||||
int32 val = 0;
|
||||
|
|
@ -17386,14 +17390,14 @@ void Player::RemoveSpellMods(Spell const* spell)
|
|||
void Player::SendProficiency(uint8 pr1, uint32 pr2)
|
||||
{
|
||||
WorldPacket data(SMSG_SET_PROFICIENCY, 8);
|
||||
data << pr1 << pr2;
|
||||
data << uint8(pr1) << uint32(pr2);
|
||||
GetSession()->SendPacket (&data);
|
||||
}
|
||||
|
||||
void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type)
|
||||
{
|
||||
QueryResult *result = NULL;
|
||||
if(type==10)
|
||||
if(type == 10)
|
||||
result = CharacterDatabase.PQuery("SELECT ownerguid,petitionguid FROM petition_sign WHERE playerguid = '%u'", GUID_LOPART(guid));
|
||||
else
|
||||
result = CharacterDatabase.PQuery("SELECT ownerguid,petitionguid FROM petition_sign WHERE playerguid = '%u' AND type = '%u'", GUID_LOPART(guid), type);
|
||||
|
|
@ -17801,7 +17805,7 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs )
|
|||
{
|
||||
// last check 2.0.10
|
||||
WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+m_spells.size()*8);
|
||||
data << GetGUID();
|
||||
data << uint64(GetGUID());
|
||||
data << uint8(0x0); // flags (0x1, 0x2)
|
||||
time_t curTime = time(NULL);
|
||||
for(PlayerSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
|
||||
|
|
@ -18114,7 +18118,7 @@ uint32 Player::GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot)
|
|||
{
|
||||
if(ArenaTeam * at = sObjectMgr.GetArenaTeamById(GetArenaTeamId(i)))
|
||||
{
|
||||
uint32 p_rating = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (i * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING);
|
||||
uint32 p_rating = GetArenaPersonalRating(i);
|
||||
uint32 t_rating = at->GetRating();
|
||||
p_rating = p_rating < t_rating ? p_rating : t_rating;
|
||||
if(max_personal_rating < p_rating)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue