Misc fixes.

This commit is contained in:
tomrus88 2009-09-14 18:11:15 +04:00
parent 6f2b9a7e80
commit 2d86aa4535
15 changed files with 53 additions and 76 deletions

View file

@ -99,7 +99,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
return false;
}
plClass = (uint8)pl->getClass();
plClass = pl->getClass();
plName = pl->GetName();
}
else
@ -150,7 +150,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
if(pl)
{
pl->SetInArenaTeam(m_TeamId, GetSlot());
pl->SetInArenaTeam(m_TeamId, GetSlot(), GetType());
pl->SetArenaTeamIdInvited(0);
pl->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING, newmember.personal_rating );
@ -277,17 +277,12 @@ void ArenaTeam::DelMember(uint64 guid)
}
}
Player *player = objmgr.GetPlayer(guid);
if(player)
if(Player *player = objmgr.GetPlayer(guid))
{
player->SetInArenaTeam(0, GetSlot());
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
// delete all info regarding this team
for(int i = 0; i < ARENA_TEAM_END; ++i)
{
player->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * ARENA_TEAM_END) + i, 0);
}
}
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), GUID_LOPART(guid));
@ -537,14 +532,12 @@ void ArenaTeam::FinishGame(int32 mod)
if (i->second->GetType() == this->m_Type && i->second->GetStats().rating > m_stats.rating)
++m_stats.rank;
}
}
int32 ArenaTeam::WonAgainst(uint32 againstRating)
{
// called when the team has won
//'chance' calculation - to beat the opponent
// 'chance' calculation - to beat the opponent
float chance = GetChanceAgainst(m_stats.rating, againstRating);
// calculate the rating modification (ELO system with k=32)
int32 mod = (int32)floor(32.0f * (1.0f - chance));
@ -704,25 +697,3 @@ bool ArenaTeam::IsFighting() const
}
return false;
}
/*
arenateam fields (id from 2.3.3 client):
1414 - arena team id 2v2
1415 - 0=captain, 1=member
1416 - played this week
1417 - played this season
1418 - unk - rank?
1419 - personal arena rating
1420 - arena team id 3v3
1421 - 0=captain, 1=member
1422 - played this week
1423 - played this season
1424 - unk - rank?
1425 - personal arena rating
1426 - arena team id 5v5
1427 - 0=captain, 1=member
1428 - played this week
1429 - played this season
1430 - unk - rank?
1431 - personal arena rating
*/