@@ -1885,6 +1885,12 @@ void BattleGround::CheckArenaWinConditions()
|
|||||||
EndBattleGround(ALLIANCE);
|
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 )
|
void BattleGround::SetBgRaid( uint32 TeamID, Group *bg_raid )
|
||||||
{
|
{
|
||||||
Group* &old_raid = TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE];
|
Group* &old_raid = TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE];
|
||||||
|
|||||||
@@ -210,6 +210,12 @@ enum ArenaType
|
|||||||
ARENA_TYPE_5v5 = 5
|
ARENA_TYPE_5v5 = 5
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum ArenaWorldUnitState
|
||||||
|
{
|
||||||
|
HORDE_WORLD_STATE = 0xE10,
|
||||||
|
ALLIANCE_WORLD_STATE = 0xE11
|
||||||
|
};
|
||||||
|
|
||||||
enum BattleGroundType
|
enum BattleGroundType
|
||||||
{
|
{
|
||||||
TYPE_BATTLEGROUND = 3,
|
TYPE_BATTLEGROUND = 3,
|
||||||
@@ -478,6 +484,7 @@ class BattleGround
|
|||||||
void SetArenaTeamRatingChangeForTeam(uint32 Team, int32 RatingChange) { m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)] = RatingChange; }
|
void SetArenaTeamRatingChangeForTeam(uint32 Team, int32 RatingChange) { m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)] = RatingChange; }
|
||||||
int32 GetArenaTeamRatingChangeForTeam(uint32 Team) const { return m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)]; }
|
int32 GetArenaTeamRatingChangeForTeam(uint32 Team) const { return m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)]; }
|
||||||
void CheckArenaWinConditions();
|
void CheckArenaWinConditions();
|
||||||
|
void UpdateArenaUnitWorldState();
|
||||||
|
|
||||||
/* Triggers handle */
|
/* Triggers handle */
|
||||||
// must be implemented in BG subclass
|
// must be implemented in BG subclass
|
||||||
|
|||||||
@@ -82,8 +82,7 @@ void BattleGroundBE::AddPlayer(Player *plr)
|
|||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetGUID()] = sc;
|
||||||
|
|
||||||
UpdateWorldState(0x9f1, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateArenaUnitWorldState();
|
||||||
UpdateWorldState(0x9f0, GetAlivePlayersCountByTeam(HORDE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
void BattleGroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||||
@@ -91,9 +90,7 @@ void BattleGroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
|||||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UpdateWorldState(0x9f1, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateArenaUnitWorldState();
|
||||||
UpdateWorldState(0x9f0, GetAlivePlayersCountByTeam(HORDE));
|
|
||||||
|
|
||||||
CheckArenaWinConditions();
|
CheckArenaWinConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,9 +107,7 @@ void BattleGroundBE::HandleKillPlayer(Player *player, Player *killer)
|
|||||||
|
|
||||||
BattleGround::HandleKillPlayer(player,killer);
|
BattleGround::HandleKillPlayer(player,killer);
|
||||||
|
|
||||||
UpdateWorldState(0x9f1, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateArenaUnitWorldState();
|
||||||
UpdateWorldState(0x9f0, GetAlivePlayersCountByTeam(HORDE));
|
|
||||||
|
|
||||||
CheckArenaWinConditions();
|
CheckArenaWinConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,9 +145,9 @@ void BattleGroundBE::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
|||||||
|
|
||||||
void BattleGroundBE::FillInitialWorldStates(WorldPacket &data)
|
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
|
data << uint32(0x9f3) << uint32(1); // 9
|
||||||
|
|
||||||
|
UpdateArenaUnitWorldState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundBE::Reset()
|
void BattleGroundBE::Reset()
|
||||||
|
|||||||
@@ -79,8 +79,7 @@ void BattleGroundNA::AddPlayer(Player *plr)
|
|||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetGUID()] = sc;
|
||||||
|
|
||||||
UpdateWorldState(0xa0f, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateArenaUnitWorldState();
|
||||||
UpdateWorldState(0xa10, GetAlivePlayersCountByTeam(HORDE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundNA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
void BattleGroundNA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||||
@@ -88,9 +87,7 @@ void BattleGroundNA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
|||||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UpdateWorldState(0xa0f, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateArenaUnitWorldState();
|
||||||
UpdateWorldState(0xa10, GetAlivePlayersCountByTeam(HORDE));
|
|
||||||
|
|
||||||
CheckArenaWinConditions();
|
CheckArenaWinConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,9 +104,7 @@ void BattleGroundNA::HandleKillPlayer(Player *player, Player *killer)
|
|||||||
|
|
||||||
BattleGround::HandleKillPlayer(player,killer);
|
BattleGround::HandleKillPlayer(player,killer);
|
||||||
|
|
||||||
UpdateWorldState(0xa0f, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateArenaUnitWorldState();
|
||||||
UpdateWorldState(0xa10, GetAlivePlayersCountByTeam(HORDE));
|
|
||||||
|
|
||||||
CheckArenaWinConditions();
|
CheckArenaWinConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,9 +138,9 @@ void BattleGroundNA::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
|||||||
|
|
||||||
void BattleGroundNA::FillInitialWorldStates(WorldPacket &data)
|
void BattleGroundNA::FillInitialWorldStates(WorldPacket &data)
|
||||||
{
|
{
|
||||||
data << uint32(0xa0f) << uint32(GetAlivePlayersCountByTeam(ALLIANCE)); // 7
|
data << uint32(0xa11) << uint32(1);
|
||||||
data << uint32(0xa10) << uint32(GetAlivePlayersCountByTeam(HORDE)); // 8
|
|
||||||
data << uint32(0xa11) << uint32(1); // 9
|
UpdateArenaUnitWorldState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundNA::Reset()
|
void BattleGroundNA::Reset()
|
||||||
|
|||||||
@@ -79,8 +79,7 @@ void BattleGroundRL::AddPlayer(Player *plr)
|
|||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetGUID()] = sc;
|
||||||
|
|
||||||
UpdateWorldState(0xbb8, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateArenaUnitWorldState();
|
||||||
UpdateWorldState(0xbb9, GetAlivePlayersCountByTeam(HORDE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
void BattleGroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||||
@@ -88,9 +87,7 @@ void BattleGroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
|||||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UpdateWorldState(0xbb8, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateArenaUnitWorldState();
|
||||||
UpdateWorldState(0xbb9, GetAlivePlayersCountByTeam(HORDE));
|
|
||||||
|
|
||||||
CheckArenaWinConditions();
|
CheckArenaWinConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,9 +104,7 @@ void BattleGroundRL::HandleKillPlayer(Player *player, Player *killer)
|
|||||||
|
|
||||||
BattleGround::HandleKillPlayer(player,killer);
|
BattleGround::HandleKillPlayer(player,killer);
|
||||||
|
|
||||||
UpdateWorldState(0xbb8, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateArenaUnitWorldState();
|
||||||
UpdateWorldState(0xbb9, GetAlivePlayersCountByTeam(HORDE));
|
|
||||||
|
|
||||||
CheckArenaWinConditions();
|
CheckArenaWinConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,9 +139,9 @@ void BattleGroundRL::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
|||||||
|
|
||||||
void BattleGroundRL::FillInitialWorldStates(WorldPacket &data)
|
void BattleGroundRL::FillInitialWorldStates(WorldPacket &data)
|
||||||
{
|
{
|
||||||
data << uint32(0xbb8) << uint32(GetAlivePlayersCountByTeam(ALLIANCE)); // 7
|
data << uint32(0xbba) << uint32(1);
|
||||||
data << uint32(0xbb9) << uint32(GetAlivePlayersCountByTeam(HORDE)); // 8
|
|
||||||
data << uint32(0xbba) << uint32(1); // 9
|
UpdateArenaUnitWorldState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundRL::Reset()
|
void BattleGroundRL::Reset()
|
||||||
|
|||||||
@@ -120,8 +120,7 @@ void BattleGroundRV::AddPlayer(Player *plr)
|
|||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetGUID()] = sc;
|
||||||
|
|
||||||
UpdateWorldState(BG_RV_WORLD_STATE_A, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateArenaUnitWorldState();
|
||||||
UpdateWorldState(BG_RV_WORLD_STATE_H, GetAlivePlayersCountByTeam(HORDE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundRV::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
void BattleGroundRV::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||||
@@ -129,9 +128,7 @@ void BattleGroundRV::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
|||||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UpdateWorldState(BG_RV_WORLD_STATE_A, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateArenaUnitWorldState();
|
||||||
UpdateWorldState(BG_RV_WORLD_STATE_H, GetAlivePlayersCountByTeam(HORDE));
|
|
||||||
|
|
||||||
CheckArenaWinConditions();
|
CheckArenaWinConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,9 +145,7 @@ void BattleGroundRV::HandleKillPlayer(Player *player, Player *killer)
|
|||||||
|
|
||||||
BattleGround::HandleKillPlayer(player, killer);
|
BattleGround::HandleKillPlayer(player, killer);
|
||||||
|
|
||||||
UpdateWorldState(BG_RV_WORLD_STATE_A, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateArenaUnitWorldState();
|
||||||
UpdateWorldState(BG_RV_WORLD_STATE_H, GetAlivePlayersCountByTeam(HORDE));
|
|
||||||
|
|
||||||
CheckArenaWinConditions();
|
CheckArenaWinConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,9 +175,9 @@ void BattleGroundRV::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
|||||||
|
|
||||||
void BattleGroundRV::FillInitialWorldStates(WorldPacket &data)
|
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);
|
data << uint32(BG_RV_WORLD_STATE) << uint32(1);
|
||||||
|
|
||||||
|
UpdateArenaUnitWorldState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundRV::Reset()
|
void BattleGroundRV::Reset()
|
||||||
|
|||||||
@@ -92,9 +92,7 @@ enum BattleGroundRVData
|
|||||||
BG_RV_FIRE_TO_PILAR_TIMER = 20000,
|
BG_RV_FIRE_TO_PILAR_TIMER = 20000,
|
||||||
BG_RV_PILAR_TO_FIRE_TIMER = 5000,
|
BG_RV_PILAR_TO_FIRE_TIMER = 5000,
|
||||||
BG_RV_FIRST_TIMER = 20133,
|
BG_RV_FIRST_TIMER = 20133,
|
||||||
BG_RV_WORLD_STATE_A = 0xe10,
|
BG_RV_WORLD_STATE = 0xE1A,
|
||||||
BG_RV_WORLD_STATE_H = 0xe11,
|
|
||||||
BG_RV_WORLD_STATE = 0xe1a,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class BattleGroundRVScore : public BattleGroundScore
|
class BattleGroundRVScore : public BattleGroundScore
|
||||||
|
|||||||
Reference in New Issue
Block a user