[8276] Implement achievment ACHIEVEMENT_CRITERIA_TYPE_WIN_BG

* including new achievement createria data type ACHIEVEMENT_CRITERIA_DATA_TYPE_BG_LOSS_TEAM_SCORE

Note: Some achivement creteria for success need data in `achievement_criteria_data`
This commit is contained in:
VladimirMangos 2009-07-29 17:24:02 +04:00
parent 571f94b36a
commit 9002710c93
11 changed files with 146 additions and 22 deletions

View file

@ -118,7 +118,7 @@ void BattleGroundEY::StartingEventOpenDoors()
void BattleGroundEY::AddPoints(uint32 Team, uint32 Points)
{
uint8 team_index = GetTeamIndexByTeamId(Team);
BattleGroundTeamId team_index = GetTeamIndexByTeamId(Team);
m_TeamScores[team_index] += Points;
m_HonorScoreTics[team_index] += Points;
if (m_HonorScoreTics[team_index] >= m_HonorTics )
@ -897,3 +897,13 @@ WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
return nearestEntry;
}
bool BattleGroundEY::IsAllNodesConrolledByTeam(uint32 team) const
{
uint32 count = 0;
for(int i = 0; i < EY_POINTS_MAX; ++i)
if (m_PointOwnedByTeam[i] == team && m_PointState[i] == EY_POINT_UNDER_CONTROL)
++count;
return count == EY_POINTS_MAX;
}