aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwin32 <none@none>2009-12-16 23:23:42 +0200
committerwin32 <none@none>2009-12-16 23:23:42 +0200
commitf64a11dfdc1a09e5734e76e87279091af26b04d6 (patch)
tree03b0a3756d5a0801a51e708ffd1a9677570f7ac2 /src
parentc645c993106cddf210d427ff74f8e0828e322dc2 (diff)
Restore work arena unit frame
Closes #289 --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/BattleGround.cpp6
-rw-r--r--src/game/BattleGround.h7
-rw-r--r--src/game/BattleGroundBE.cpp15
-rw-r--r--src/game/BattleGroundNA.cpp17
-rw-r--r--src/game/BattleGroundRL.cpp17
-rw-r--r--src/game/BattleGroundRV.cpp15
-rw-r--r--src/game/BattleGroundRV.h4
7 files changed, 36 insertions, 45 deletions
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp
index c6527584fd3..c9a3eb6be9e 100644
--- a/src/game/BattleGround.cpp
+++ b/src/game/BattleGround.cpp
@@ -1885,6 +1885,12 @@ void BattleGround::CheckArenaWinConditions()
EndBattleGround(ALLIANCE);
}
+void BattleGround::UpdateArenaUnitWorldState()
+{
+ UpdateWorldState(HORDE_WORLD_STATE, GetAlivePlayersCountByTeam(HORDE));
+ UpdateWorldState(ALLIANCE_WORLD_STATE, GetAlivePlayersCountByTeam(ALLIANCE));
+}
+
void BattleGround::SetBgRaid( uint32 TeamID, Group *bg_raid )
{
Group* &old_raid = TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE];
diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h
index 38772f9fd33..275085f4ca7 100644
--- a/src/game/BattleGround.h
+++ b/src/game/BattleGround.h
@@ -210,6 +210,12 @@ enum ArenaType
ARENA_TYPE_5v5 = 5
};
+enum ArenaWorldUnitState
+{
+ HORDE_WORLD_STATE = 0xE10,
+ ALLIANCE_WORLD_STATE = 0xE11
+};
+
enum BattleGroundType
{
TYPE_BATTLEGROUND = 3,
@@ -478,6 +484,7 @@ class BattleGround
void SetArenaTeamRatingChangeForTeam(uint32 Team, int32 RatingChange) { m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)] = RatingChange; }
int32 GetArenaTeamRatingChangeForTeam(uint32 Team) const { return m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)]; }
void CheckArenaWinConditions();
+ void UpdateArenaUnitWorldState();
/* Triggers handle */
// must be implemented in BG subclass
diff --git a/src/game/BattleGroundBE.cpp b/src/game/BattleGroundBE.cpp
index c81042ec2e8..c20af53e013 100644
--- a/src/game/BattleGroundBE.cpp
+++ b/src/game/BattleGroundBE.cpp
@@ -82,8 +82,7 @@ void BattleGroundBE::AddPlayer(Player *plr)
m_PlayerScores[plr->GetGUID()] = sc;
- UpdateWorldState(0x9f1, GetAlivePlayersCountByTeam(ALLIANCE));
- UpdateWorldState(0x9f0, GetAlivePlayersCountByTeam(HORDE));
+ UpdateArenaUnitWorldState();
}
void BattleGroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
@@ -91,9 +90,7 @@ void BattleGroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
if (GetStatus() == STATUS_WAIT_LEAVE)
return;
- UpdateWorldState(0x9f1, GetAlivePlayersCountByTeam(ALLIANCE));
- UpdateWorldState(0x9f0, GetAlivePlayersCountByTeam(HORDE));
-
+ UpdateArenaUnitWorldState();
CheckArenaWinConditions();
}
@@ -110,9 +107,7 @@ void BattleGroundBE::HandleKillPlayer(Player *player, Player *killer)
BattleGround::HandleKillPlayer(player,killer);
- UpdateWorldState(0x9f1, GetAlivePlayersCountByTeam(ALLIANCE));
- UpdateWorldState(0x9f0, GetAlivePlayersCountByTeam(HORDE));
-
+ UpdateArenaUnitWorldState();
CheckArenaWinConditions();
}
@@ -150,9 +145,9 @@ void BattleGroundBE::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattleGroundBE::FillInitialWorldStates(WorldPacket &data)
{
- data << uint32(0x9f1) << uint32(GetAlivePlayersCountByTeam(ALLIANCE)); // 7
- data << uint32(0x9f0) << uint32(GetAlivePlayersCountByTeam(HORDE)); // 8
data << uint32(0x9f3) << uint32(1); // 9
+
+ UpdateArenaUnitWorldState();
}
void BattleGroundBE::Reset()
diff --git a/src/game/BattleGroundNA.cpp b/src/game/BattleGroundNA.cpp
index cbf43117d0a..b08cdd1196e 100644
--- a/src/game/BattleGroundNA.cpp
+++ b/src/game/BattleGroundNA.cpp
@@ -79,8 +79,7 @@ void BattleGroundNA::AddPlayer(Player *plr)
m_PlayerScores[plr->GetGUID()] = sc;
- UpdateWorldState(0xa0f, GetAlivePlayersCountByTeam(ALLIANCE));
- UpdateWorldState(0xa10, GetAlivePlayersCountByTeam(HORDE));
+ UpdateArenaUnitWorldState();
}
void BattleGroundNA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
@@ -88,9 +87,7 @@ void BattleGroundNA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
if (GetStatus() == STATUS_WAIT_LEAVE)
return;
- UpdateWorldState(0xa0f, GetAlivePlayersCountByTeam(ALLIANCE));
- UpdateWorldState(0xa10, GetAlivePlayersCountByTeam(HORDE));
-
+ UpdateArenaUnitWorldState();
CheckArenaWinConditions();
}
@@ -107,9 +104,7 @@ void BattleGroundNA::HandleKillPlayer(Player *player, Player *killer)
BattleGround::HandleKillPlayer(player,killer);
- UpdateWorldState(0xa0f, GetAlivePlayersCountByTeam(ALLIANCE));
- UpdateWorldState(0xa10, GetAlivePlayersCountByTeam(HORDE));
-
+ UpdateArenaUnitWorldState();
CheckArenaWinConditions();
}
@@ -143,9 +138,9 @@ void BattleGroundNA::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattleGroundNA::FillInitialWorldStates(WorldPacket &data)
{
- data << uint32(0xa0f) << uint32(GetAlivePlayersCountByTeam(ALLIANCE)); // 7
- data << uint32(0xa10) << uint32(GetAlivePlayersCountByTeam(HORDE)); // 8
- data << uint32(0xa11) << uint32(1); // 9
+ data << uint32(0xa11) << uint32(1);
+
+ UpdateArenaUnitWorldState();
}
void BattleGroundNA::Reset()
diff --git a/src/game/BattleGroundRL.cpp b/src/game/BattleGroundRL.cpp
index 2890f3698d6..8ed8fd1b5b7 100644
--- a/src/game/BattleGroundRL.cpp
+++ b/src/game/BattleGroundRL.cpp
@@ -79,8 +79,7 @@ void BattleGroundRL::AddPlayer(Player *plr)
m_PlayerScores[plr->GetGUID()] = sc;
- UpdateWorldState(0xbb8, GetAlivePlayersCountByTeam(ALLIANCE));
- UpdateWorldState(0xbb9, GetAlivePlayersCountByTeam(HORDE));
+ UpdateArenaUnitWorldState();
}
void BattleGroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
@@ -88,9 +87,7 @@ void BattleGroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
if (GetStatus() == STATUS_WAIT_LEAVE)
return;
- UpdateWorldState(0xbb8, GetAlivePlayersCountByTeam(ALLIANCE));
- UpdateWorldState(0xbb9, GetAlivePlayersCountByTeam(HORDE));
-
+ UpdateArenaUnitWorldState();
CheckArenaWinConditions();
}
@@ -107,9 +104,7 @@ void BattleGroundRL::HandleKillPlayer(Player *player, Player *killer)
BattleGround::HandleKillPlayer(player,killer);
- UpdateWorldState(0xbb8, GetAlivePlayersCountByTeam(ALLIANCE));
- UpdateWorldState(0xbb9, GetAlivePlayersCountByTeam(HORDE));
-
+ UpdateArenaUnitWorldState();
CheckArenaWinConditions();
}
@@ -144,9 +139,9 @@ void BattleGroundRL::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattleGroundRL::FillInitialWorldStates(WorldPacket &data)
{
- data << uint32(0xbb8) << uint32(GetAlivePlayersCountByTeam(ALLIANCE)); // 7
- data << uint32(0xbb9) << uint32(GetAlivePlayersCountByTeam(HORDE)); // 8
- data << uint32(0xbba) << uint32(1); // 9
+ data << uint32(0xbba) << uint32(1);
+
+ UpdateArenaUnitWorldState();
}
void BattleGroundRL::Reset()
diff --git a/src/game/BattleGroundRV.cpp b/src/game/BattleGroundRV.cpp
index 39ff09fe521..16bdd54ade1 100644
--- a/src/game/BattleGroundRV.cpp
+++ b/src/game/BattleGroundRV.cpp
@@ -120,8 +120,7 @@ void BattleGroundRV::AddPlayer(Player *plr)
m_PlayerScores[plr->GetGUID()] = sc;
- UpdateWorldState(BG_RV_WORLD_STATE_A, GetAlivePlayersCountByTeam(ALLIANCE));
- UpdateWorldState(BG_RV_WORLD_STATE_H, GetAlivePlayersCountByTeam(HORDE));
+ UpdateArenaUnitWorldState();
}
void BattleGroundRV::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
@@ -129,9 +128,7 @@ void BattleGroundRV::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
if (GetStatus() == STATUS_WAIT_LEAVE)
return;
- UpdateWorldState(BG_RV_WORLD_STATE_A, GetAlivePlayersCountByTeam(ALLIANCE));
- UpdateWorldState(BG_RV_WORLD_STATE_H, GetAlivePlayersCountByTeam(HORDE));
-
+ UpdateArenaUnitWorldState();
CheckArenaWinConditions();
}
@@ -148,9 +145,7 @@ void BattleGroundRV::HandleKillPlayer(Player *player, Player *killer)
BattleGround::HandleKillPlayer(player, killer);
- UpdateWorldState(BG_RV_WORLD_STATE_A, GetAlivePlayersCountByTeam(ALLIANCE));
- UpdateWorldState(BG_RV_WORLD_STATE_H, GetAlivePlayersCountByTeam(HORDE));
-
+ UpdateArenaUnitWorldState();
CheckArenaWinConditions();
}
@@ -180,9 +175,9 @@ void BattleGroundRV::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattleGroundRV::FillInitialWorldStates(WorldPacket &data)
{
- data << uint32(BG_RV_WORLD_STATE_A) << uint32(GetAlivePlayersCountByTeam(ALLIANCE));
- data << uint32(BG_RV_WORLD_STATE_H) << uint32(GetAlivePlayersCountByTeam(HORDE));
data << uint32(BG_RV_WORLD_STATE) << uint32(1);
+
+ UpdateArenaUnitWorldState();
}
void BattleGroundRV::Reset()
diff --git a/src/game/BattleGroundRV.h b/src/game/BattleGroundRV.h
index c4309ae93cf..4cc368901dd 100644
--- a/src/game/BattleGroundRV.h
+++ b/src/game/BattleGroundRV.h
@@ -92,9 +92,7 @@ enum BattleGroundRVData
BG_RV_FIRE_TO_PILAR_TIMER = 20000,
BG_RV_PILAR_TO_FIRE_TIMER = 5000,
BG_RV_FIRST_TIMER = 20133,
- BG_RV_WORLD_STATE_A = 0xe10,
- BG_RV_WORLD_STATE_H = 0xe11,
- BG_RV_WORLD_STATE = 0xe1a,
+ BG_RV_WORLD_STATE = 0xE1A,
};
class BattleGroundRVScore : public BattleGroundScore