@@ -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];
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user