diff options
author | megamage <none@none> | 2009-07-31 11:36:02 +0800 |
---|---|---|
committer | megamage <none@none> | 2009-07-31 11:36:02 +0800 |
commit | 70e31cce3fc41cc5ebfbc9f0a69a1757ea4ec42a (patch) | |
tree | a35de670296d3fa287bfa88d457d6eed237c1e73 /src/game/BattleGroundEY.cpp | |
parent | d96642c92fbeab49ae613a78c3fb578934288d2f (diff) |
[8276] Implement achievment ACHIEVEMENT_CRITERIA_TYPE_WIN_BG Author: VladimirMangos
* 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`
--HG--
branch : trunk
Diffstat (limited to 'src/game/BattleGroundEY.cpp')
-rw-r--r-- | src/game/BattleGroundEY.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/game/BattleGroundEY.cpp b/src/game/BattleGroundEY.cpp index 9b54ecce643..39ef126d9e2 100644 --- a/src/game/BattleGroundEY.cpp +++ b/src/game/BattleGroundEY.cpp @@ -128,7 +128,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 ) @@ -908,3 +908,12 @@ 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; +} |