Core/Battlegrounds: Strand of the Ancients Rework
Port From (https://github.com/TrinityCore/TrinityCore/commit/3d56cdc08413a0682299136a763e13e67d38818b)
This commit is contained in:
@@ -451,7 +451,7 @@ namespace Game.BattleGrounds
|
||||
|
||||
public WorldSafeLocsEntry GetTeamStartPosition(int teamId)
|
||||
{
|
||||
Cypher.Assert(teamId < BatttleGroundTeamId.Neutral);
|
||||
Cypher.Assert(teamId < BattleGroundTeamId.Neutral);
|
||||
return _battlegroundTemplate.StartLocation[teamId];
|
||||
}
|
||||
|
||||
@@ -573,6 +573,11 @@ namespace Game.BattleGrounds
|
||||
Global.WorldStateMgr.SetValue((int)worldStateId, value, hidden, GetBgMap());
|
||||
}
|
||||
|
||||
public void UpdateWorldState(int worldStateId, bool value, bool hidden = false)
|
||||
{
|
||||
Global.WorldStateMgr.SetValue(worldStateId, value ? 1 : 0, hidden, GetBgMap());
|
||||
}
|
||||
|
||||
public virtual void EndBattleground(Team winner)
|
||||
{
|
||||
RemoveFromBGFreeSlotQueue();
|
||||
@@ -905,7 +910,7 @@ namespace Game.BattleGrounds
|
||||
Global.BattlegroundMgr.AddBattleground(this);
|
||||
|
||||
if (m_IsRated)
|
||||
Log.outDebug(LogFilter.Arena, "Arena match type: {0} for Team1Id: {1} - Team2Id: {2} started.", m_ArenaType, m_ArenaTeamIds[BatttleGroundTeamId.Alliance], m_ArenaTeamIds[BatttleGroundTeamId.Horde]);
|
||||
Log.outDebug(LogFilter.Arena, "Arena match type: {0} for Team1Id: {1} - Team2Id: {2} started.", m_ArenaType, m_ArenaTeamIds[BattleGroundTeamId.Alliance], m_ArenaTeamIds[BattleGroundTeamId.Horde]);
|
||||
}
|
||||
|
||||
public void TeleportPlayerToExploitLocation(Player player)
|
||||
@@ -1400,7 +1405,7 @@ namespace Game.BattleGrounds
|
||||
}
|
||||
}
|
||||
|
||||
public virtual Creature AddCreature(uint entry, uint type, float x, float y, float z, float o, int teamIndex = BatttleGroundTeamId.Neutral, uint respawntime = 0, Transport transport = null)
|
||||
public virtual Creature AddCreature(uint entry, uint type, float x, float y, float z, float o, int teamIndex = BattleGroundTeamId.Neutral, uint respawntime = 0, Transport transport = null)
|
||||
{
|
||||
Map map = FindBgMap();
|
||||
if (map == null)
|
||||
@@ -1447,7 +1452,7 @@ namespace Game.BattleGrounds
|
||||
return creature;
|
||||
}
|
||||
|
||||
public Creature AddCreature(uint entry, uint type, Position pos, int teamIndex = BatttleGroundTeamId.Neutral, uint respawntime = 0, Transport transport = null)
|
||||
public Creature AddCreature(uint entry, uint type, Position pos, int teamIndex = BattleGroundTeamId.Neutral, uint respawntime = 0, Transport transport = null)
|
||||
{
|
||||
return AddCreature(entry, type, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teamIndex, respawntime, transport);
|
||||
}
|
||||
@@ -1506,7 +1511,7 @@ namespace Game.BattleGrounds
|
||||
|
||||
public bool AddSpiritGuide(uint type, float x, float y, float z, float o, int teamIndex)
|
||||
{
|
||||
uint entry = (uint)(teamIndex == BatttleGroundTeamId.Alliance ? BattlegroundCreatures.A_SpiritGuide : BattlegroundCreatures.H_SpiritGuide);
|
||||
uint entry = (uint)(teamIndex == BattleGroundTeamId.Alliance ? BattlegroundCreatures.A_SpiritGuide : BattlegroundCreatures.H_SpiritGuide);
|
||||
|
||||
if (AddCreature(entry, type, x, y, z, o) != null)
|
||||
return true;
|
||||
@@ -1516,7 +1521,7 @@ namespace Game.BattleGrounds
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool AddSpiritGuide(uint type, Position pos, int teamIndex = BatttleGroundTeamId.Neutral)
|
||||
public bool AddSpiritGuide(uint type, Position pos, int teamIndex = BattleGroundTeamId.Neutral)
|
||||
{
|
||||
return AddSpiritGuide(type, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teamIndex);
|
||||
}
|
||||
@@ -1702,7 +1707,7 @@ namespace Game.BattleGrounds
|
||||
|
||||
public uint GetTeamScore(int teamIndex)
|
||||
{
|
||||
if (teamIndex == BatttleGroundTeamId.Alliance || teamIndex == BatttleGroundTeamId.Horde)
|
||||
if (teamIndex == BattleGroundTeamId.Alliance || teamIndex == BattleGroundTeamId.Horde)
|
||||
return m_TeamScores[teamIndex];
|
||||
|
||||
Log.outError(LogFilter.Battleground, "GetTeamScore with wrong Team {0} for BG {1}", teamIndex, GetTypeID());
|
||||
@@ -1855,7 +1860,7 @@ namespace Game.BattleGrounds
|
||||
|
||||
Group GetBgRaid(Team team) { return m_BgRaids[GetTeamIndexByTeamId(team)]; }
|
||||
|
||||
public static int GetTeamIndexByTeamId(Team team) { return team == Team.Alliance ? BatttleGroundTeamId.Alliance : BatttleGroundTeamId.Horde; }
|
||||
public static int GetTeamIndexByTeamId(Team team) { return team == Team.Alliance ? BattleGroundTeamId.Alliance : BattleGroundTeamId.Horde; }
|
||||
public uint GetPlayersCountByTeam(Team team) { return m_PlayersCount[GetTeamIndexByTeamId(team)]; }
|
||||
void UpdatePlayersCountByTeam(Team team, bool remove)
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ using Game.BattleGrounds.Zones.AlteracValley;
|
||||
using Game.BattleGrounds.Zones.ArathisBasin;
|
||||
using Game.BattleGrounds.Zones.EyeofStorm;
|
||||
using Game.BattleGrounds.Zones.WarsongGluch;
|
||||
using Game.BattleGrounds.Zones.StrandOfAncients;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Networking.Packets;
|
||||
@@ -147,7 +148,7 @@ namespace Game.BattleGrounds
|
||||
battlefieldStatus = new BattlefieldStatusActive();
|
||||
BuildBattlegroundStatusHeader(battlefieldStatus.Hdr, player, ticketId, joinTime, queueId);
|
||||
battlefieldStatus.ShutdownTimer = bg.GetRemainingTime();
|
||||
battlefieldStatus.ArenaFaction = (byte)(player.GetBGTeam() == Team.Horde ? BatttleGroundTeamId.Horde : BatttleGroundTeamId.Alliance);
|
||||
battlefieldStatus.ArenaFaction = (byte)(player.GetBGTeam() == Team.Horde ? BattleGroundTeamId.Horde : BattleGroundTeamId.Alliance);
|
||||
battlefieldStatus.LeftEarly = false;
|
||||
battlefieldStatus.StartTimer = bg.GetElapsedTime();
|
||||
battlefieldStatus.Mapid = bg.GetMapId();
|
||||
@@ -353,8 +354,8 @@ namespace Game.BattleGrounds
|
||||
uint startId = result.Read<uint>(1);
|
||||
WorldSafeLocsEntry start = Global.ObjectMgr.GetWorldSafeLoc(startId);
|
||||
if (start != null)
|
||||
bgTemplate.StartLocation[BatttleGroundTeamId.Alliance] = start;
|
||||
else if (bgTemplate.StartLocation[BatttleGroundTeamId.Alliance] != null) // reload case
|
||||
bgTemplate.StartLocation[BattleGroundTeamId.Alliance] = start;
|
||||
else if (bgTemplate.StartLocation[BattleGroundTeamId.Alliance] != null) // reload case
|
||||
Log.outError(LogFilter.Sql, $"Table `battleground_template` for id {bgTemplate.Id} contains a non-existing WorldSafeLocs.dbc id {startId} in field `AllianceStartLoc`. Ignoring.");
|
||||
else
|
||||
{
|
||||
@@ -365,8 +366,8 @@ namespace Game.BattleGrounds
|
||||
startId = result.Read<uint>(2);
|
||||
start = Global.ObjectMgr.GetWorldSafeLoc(startId);
|
||||
if (start != null)
|
||||
bgTemplate.StartLocation[BatttleGroundTeamId.Horde] = start;
|
||||
else if (bgTemplate.StartLocation[BatttleGroundTeamId.Horde] != null) // reload case
|
||||
bgTemplate.StartLocation[BattleGroundTeamId.Horde] = start;
|
||||
else if (bgTemplate.StartLocation[BattleGroundTeamId.Horde] != null) // reload case
|
||||
Log.outError(LogFilter.Sql, $"Table `battleground_template` for id {bgTemplate.Id} contains a non-existing WorldSafeLocs.dbc id {startId} in field `HordeStartLoc`. Ignoring.");
|
||||
else
|
||||
{
|
||||
|
||||
@@ -153,16 +153,16 @@ namespace Game.BattleGrounds
|
||||
void PlayerInvitedToBGUpdateAverageWaitTime(GroupQueueInfo ginfo, BattlegroundBracketId bracket_id)
|
||||
{
|
||||
uint timeInQueue = Time.GetMSTimeDiff(ginfo.JoinTime, GameTime.GetGameTimeMS());
|
||||
uint team_index = BatttleGroundTeamId.Alliance; //default set to TeamIndex.Alliance - or non rated arenas!
|
||||
uint team_index = BattleGroundTeamId.Alliance; //default set to TeamIndex.Alliance - or non rated arenas!
|
||||
if (m_queueId.TeamSize == 0)
|
||||
{
|
||||
if (ginfo.Team == Team.Horde)
|
||||
team_index = BatttleGroundTeamId.Horde;
|
||||
team_index = BattleGroundTeamId.Horde;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_queueId.Rated)
|
||||
team_index = BatttleGroundTeamId.Horde; //for rated arenas use TeamIndex.Horde
|
||||
team_index = BattleGroundTeamId.Horde; //for rated arenas use TeamIndex.Horde
|
||||
}
|
||||
|
||||
//store pointer to arrayindex of player that was added first
|
||||
@@ -180,16 +180,16 @@ namespace Game.BattleGrounds
|
||||
|
||||
public uint GetAverageQueueWaitTime(GroupQueueInfo ginfo, BattlegroundBracketId bracket_id)
|
||||
{
|
||||
uint team_index = BatttleGroundTeamId.Alliance; //default set to TeamIndex.Alliance - or non rated arenas!
|
||||
uint team_index = BattleGroundTeamId.Alliance; //default set to TeamIndex.Alliance - or non rated arenas!
|
||||
if (m_queueId.TeamSize == 0)
|
||||
{
|
||||
if (ginfo.Team == Team.Horde)
|
||||
team_index = BatttleGroundTeamId.Horde;
|
||||
team_index = BattleGroundTeamId.Horde;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_queueId.Rated)
|
||||
team_index = BatttleGroundTeamId.Horde; //for rated arenas use TeamIndex.Horde
|
||||
team_index = BattleGroundTeamId.Horde; //for rated arenas use TeamIndex.Horde
|
||||
}
|
||||
//check if there is enought values(we always add values > 0)
|
||||
if (m_WaitTimes[team_index][(int)bracket_id][SharedConst.CountOfPlayersToAverageWaitTime - 1] != 0)
|
||||
@@ -453,7 +453,7 @@ namespace Game.BattleGrounds
|
||||
{
|
||||
int listIndex = 0;
|
||||
var info = m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueueNormalAlliance].FirstOrDefault();
|
||||
for (; alyIndex < aliCount && m_SelectionPools[BatttleGroundTeamId.Alliance].AddGroup(info, aliFree); alyIndex++)
|
||||
for (; alyIndex < aliCount && m_SelectionPools[BattleGroundTeamId.Alliance].AddGroup(info, aliFree); alyIndex++)
|
||||
info = m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueueNormalAlliance][listIndex++];
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@ namespace Game.BattleGrounds
|
||||
{
|
||||
int listIndex = 0;
|
||||
var info = m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueueNormalHorde].FirstOrDefault();
|
||||
for (; hordeIndex < hordeCount && m_SelectionPools[BatttleGroundTeamId.Horde].AddGroup(info, hordeFree); hordeIndex++)
|
||||
for (; hordeIndex < hordeCount && m_SelectionPools[BattleGroundTeamId.Horde].AddGroup(info, hordeFree); hordeIndex++)
|
||||
info = m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueueNormalHorde][listIndex++];
|
||||
}
|
||||
|
||||
@@ -478,45 +478,45 @@ namespace Game.BattleGrounds
|
||||
*/
|
||||
|
||||
// At first we need to compare free space in bg and our selection pool
|
||||
int diffAli = (int)(aliFree - m_SelectionPools[BatttleGroundTeamId.Alliance].GetPlayerCount());
|
||||
int diffHorde = (int)(hordeFree - m_SelectionPools[BatttleGroundTeamId.Horde].GetPlayerCount());
|
||||
while (Math.Abs(diffAli - diffHorde) > 1 && (m_SelectionPools[BatttleGroundTeamId.Horde].GetPlayerCount() > 0 || m_SelectionPools[BatttleGroundTeamId.Alliance].GetPlayerCount() > 0))
|
||||
int diffAli = (int)(aliFree - m_SelectionPools[BattleGroundTeamId.Alliance].GetPlayerCount());
|
||||
int diffHorde = (int)(hordeFree - m_SelectionPools[BattleGroundTeamId.Horde].GetPlayerCount());
|
||||
while (Math.Abs(diffAli - diffHorde) > 1 && (m_SelectionPools[BattleGroundTeamId.Horde].GetPlayerCount() > 0 || m_SelectionPools[BattleGroundTeamId.Alliance].GetPlayerCount() > 0))
|
||||
{
|
||||
//each cycle execution we need to kick at least 1 group
|
||||
if (diffAli < diffHorde)
|
||||
{
|
||||
//kick alliance group, add to pool new group if needed
|
||||
if (m_SelectionPools[BatttleGroundTeamId.Alliance].KickGroup((uint)(diffHorde - diffAli)))
|
||||
if (m_SelectionPools[BattleGroundTeamId.Alliance].KickGroup((uint)(diffHorde - diffAli)))
|
||||
{
|
||||
for (; alyIndex < aliCount && m_SelectionPools[BatttleGroundTeamId.Alliance].AddGroup(m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueueNormalAlliance][alyIndex], (uint)((aliFree >= diffHorde) ? aliFree - diffHorde : 0)); alyIndex++)
|
||||
for (; alyIndex < aliCount && m_SelectionPools[BattleGroundTeamId.Alliance].AddGroup(m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueueNormalAlliance][alyIndex], (uint)((aliFree >= diffHorde) ? aliFree - diffHorde : 0)); alyIndex++)
|
||||
++alyIndex;
|
||||
}
|
||||
//if ali selection is already empty, then kick horde group, but if there are less horde than ali in bg - break;
|
||||
if (m_SelectionPools[BatttleGroundTeamId.Alliance].GetPlayerCount() == 0)
|
||||
if (m_SelectionPools[BattleGroundTeamId.Alliance].GetPlayerCount() == 0)
|
||||
{
|
||||
if (aliFree <= diffHorde + 1)
|
||||
break;
|
||||
m_SelectionPools[BatttleGroundTeamId.Horde].KickGroup((uint)(diffHorde - diffAli));
|
||||
m_SelectionPools[BattleGroundTeamId.Horde].KickGroup((uint)(diffHorde - diffAli));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//kick horde group, add to pool new group if needed
|
||||
if (m_SelectionPools[BatttleGroundTeamId.Horde].KickGroup((uint)(diffAli - diffHorde)))
|
||||
if (m_SelectionPools[BattleGroundTeamId.Horde].KickGroup((uint)(diffAli - diffHorde)))
|
||||
{
|
||||
for (; hordeIndex < hordeCount && m_SelectionPools[BatttleGroundTeamId.Horde].AddGroup(m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueueNormalHorde][hordeIndex], (uint)((hordeFree >= diffAli) ? hordeFree - diffAli : 0)); hordeIndex++)
|
||||
for (; hordeIndex < hordeCount && m_SelectionPools[BattleGroundTeamId.Horde].AddGroup(m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueueNormalHorde][hordeIndex], (uint)((hordeFree >= diffAli) ? hordeFree - diffAli : 0)); hordeIndex++)
|
||||
++hordeIndex;
|
||||
}
|
||||
if (m_SelectionPools[BatttleGroundTeamId.Horde].GetPlayerCount() == 0)
|
||||
if (m_SelectionPools[BattleGroundTeamId.Horde].GetPlayerCount() == 0)
|
||||
{
|
||||
if (hordeFree <= diffAli + 1)
|
||||
break;
|
||||
m_SelectionPools[BatttleGroundTeamId.Alliance].KickGroup((uint)(diffAli - diffHorde));
|
||||
m_SelectionPools[BattleGroundTeamId.Alliance].KickGroup((uint)(diffAli - diffHorde));
|
||||
}
|
||||
}
|
||||
//count diffs after small update
|
||||
diffAli = (int)(aliFree - m_SelectionPools[BatttleGroundTeamId.Alliance].GetPlayerCount());
|
||||
diffHorde = (int)(hordeFree - m_SelectionPools[BatttleGroundTeamId.Horde].GetPlayerCount());
|
||||
diffAli = (int)(aliFree - m_SelectionPools[BattleGroundTeamId.Alliance].GetPlayerCount());
|
||||
diffHorde = (int)(hordeFree - m_SelectionPools[BattleGroundTeamId.Horde].GetPlayerCount());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -547,10 +547,10 @@ namespace Game.BattleGrounds
|
||||
|
||||
if (ali_group != null && horde_group != null)
|
||||
{
|
||||
m_SelectionPools[BatttleGroundTeamId.Alliance].AddGroup(ali_group, MaxPlayersPerTeam);
|
||||
m_SelectionPools[BatttleGroundTeamId.Horde].AddGroup(horde_group, MaxPlayersPerTeam);
|
||||
m_SelectionPools[BattleGroundTeamId.Alliance].AddGroup(ali_group, MaxPlayersPerTeam);
|
||||
m_SelectionPools[BattleGroundTeamId.Horde].AddGroup(horde_group, MaxPlayersPerTeam);
|
||||
//add groups/players from normal queue to size of bigger group
|
||||
uint maxPlayers = Math.Min(m_SelectionPools[BatttleGroundTeamId.Alliance].GetPlayerCount(), m_SelectionPools[BatttleGroundTeamId.Horde].GetPlayerCount());
|
||||
uint maxPlayers = Math.Min(m_SelectionPools[BattleGroundTeamId.Alliance].GetPlayerCount(), m_SelectionPools[BattleGroundTeamId.Horde].GetPlayerCount());
|
||||
for (uint i = 0; i < SharedConst.PvpTeamsCount; i++)
|
||||
{
|
||||
foreach (var groupQueueInfo in m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueueNormalAlliance + i])
|
||||
@@ -605,12 +605,12 @@ namespace Game.BattleGrounds
|
||||
}
|
||||
}
|
||||
//try to invite same number of players - this cycle may cause longer wait time even if there are enough players in queue, but we want ballanced bg
|
||||
uint j = BatttleGroundTeamId.Alliance;
|
||||
if (m_SelectionPools[BatttleGroundTeamId.Horde].GetPlayerCount() < m_SelectionPools[BatttleGroundTeamId.Alliance].GetPlayerCount())
|
||||
j = BatttleGroundTeamId.Horde;
|
||||
uint j = BattleGroundTeamId.Alliance;
|
||||
if (m_SelectionPools[BattleGroundTeamId.Horde].GetPlayerCount() < m_SelectionPools[BattleGroundTeamId.Alliance].GetPlayerCount())
|
||||
j = BattleGroundTeamId.Horde;
|
||||
|
||||
if (WorldConfig.GetIntValue(WorldCfg.BattlegroundInvitationType) != (int)BattlegroundQueueInvitationType.NoBalance
|
||||
&& m_SelectionPools[BatttleGroundTeamId.Horde].GetPlayerCount() >= minPlayers && m_SelectionPools[BatttleGroundTeamId.Alliance].GetPlayerCount() >= minPlayers)
|
||||
&& m_SelectionPools[BattleGroundTeamId.Horde].GetPlayerCount() >= minPlayers && m_SelectionPools[BattleGroundTeamId.Alliance].GetPlayerCount() >= minPlayers)
|
||||
{
|
||||
//we will try to invite more groups to team with less players indexed by j
|
||||
++(teamIndex[j]); //this will not cause a crash, because for cycle above reached break;
|
||||
@@ -622,29 +622,29 @@ namespace Game.BattleGrounds
|
||||
break;
|
||||
}
|
||||
// do not allow to start bg with more than 2 players more on 1 faction
|
||||
if (Math.Abs((m_SelectionPools[BatttleGroundTeamId.Horde].GetPlayerCount() - m_SelectionPools[BatttleGroundTeamId.Alliance].GetPlayerCount())) > 2)
|
||||
if (Math.Abs((m_SelectionPools[BattleGroundTeamId.Horde].GetPlayerCount() - m_SelectionPools[BattleGroundTeamId.Alliance].GetPlayerCount())) > 2)
|
||||
return false;
|
||||
}
|
||||
//allow 1v0 if debug bg
|
||||
if (Global.BattlegroundMgr.IsTesting() && (m_SelectionPools[BatttleGroundTeamId.Alliance].GetPlayerCount() != 0 || m_SelectionPools[BatttleGroundTeamId.Horde].GetPlayerCount() != 0))
|
||||
if (Global.BattlegroundMgr.IsTesting() && (m_SelectionPools[BattleGroundTeamId.Alliance].GetPlayerCount() != 0 || m_SelectionPools[BattleGroundTeamId.Horde].GetPlayerCount() != 0))
|
||||
return true;
|
||||
//return true if there are enough players in selection pools - enable to work .debug bg command correctly
|
||||
return m_SelectionPools[BatttleGroundTeamId.Alliance].GetPlayerCount() >= minPlayers && m_SelectionPools[BatttleGroundTeamId.Horde].GetPlayerCount() >= minPlayers;
|
||||
return m_SelectionPools[BattleGroundTeamId.Alliance].GetPlayerCount() >= minPlayers && m_SelectionPools[BattleGroundTeamId.Horde].GetPlayerCount() >= minPlayers;
|
||||
}
|
||||
|
||||
// this method will check if we can invite players to same faction skirmish match
|
||||
bool CheckSkirmishForSameFaction(BattlegroundBracketId bracket_id, uint minPlayersPerTeam)
|
||||
{
|
||||
if (m_SelectionPools[BatttleGroundTeamId.Alliance].GetPlayerCount() < minPlayersPerTeam && m_SelectionPools[BatttleGroundTeamId.Horde].GetPlayerCount() < minPlayersPerTeam)
|
||||
if (m_SelectionPools[BattleGroundTeamId.Alliance].GetPlayerCount() < minPlayersPerTeam && m_SelectionPools[BattleGroundTeamId.Horde].GetPlayerCount() < minPlayersPerTeam)
|
||||
return false;
|
||||
|
||||
uint teamIndex = BatttleGroundTeamId.Alliance;
|
||||
uint otherTeam = BatttleGroundTeamId.Horde;
|
||||
uint teamIndex = BattleGroundTeamId.Alliance;
|
||||
uint otherTeam = BattleGroundTeamId.Horde;
|
||||
Team otherTeamId = Team.Horde;
|
||||
if (m_SelectionPools[BatttleGroundTeamId.Horde].GetPlayerCount() == minPlayersPerTeam)
|
||||
if (m_SelectionPools[BattleGroundTeamId.Horde].GetPlayerCount() == minPlayersPerTeam)
|
||||
{
|
||||
teamIndex = BatttleGroundTeamId.Horde;
|
||||
otherTeam = BatttleGroundTeamId.Alliance;
|
||||
teamIndex = BattleGroundTeamId.Horde;
|
||||
otherTeam = BattleGroundTeamId.Alliance;
|
||||
otherTeamId = Team.Alliance;
|
||||
}
|
||||
//clear other team's selection
|
||||
@@ -744,17 +744,17 @@ namespace Game.BattleGrounds
|
||||
bg.GetStatus() > BattlegroundStatus.WaitQueue && bg.GetStatus() < BattlegroundStatus.WaitLeave)
|
||||
{
|
||||
// clear selection pools
|
||||
m_SelectionPools[BatttleGroundTeamId.Alliance].Init();
|
||||
m_SelectionPools[BatttleGroundTeamId.Horde].Init();
|
||||
m_SelectionPools[BattleGroundTeamId.Alliance].Init();
|
||||
m_SelectionPools[BattleGroundTeamId.Horde].Init();
|
||||
|
||||
// call a function that does the job for us
|
||||
FillPlayersToBG(bg, bracket_id);
|
||||
|
||||
// now everything is set, invite players
|
||||
foreach (var queueInfo in m_SelectionPools[BatttleGroundTeamId.Alliance].SelectedGroups)
|
||||
foreach (var queueInfo in m_SelectionPools[BattleGroundTeamId.Alliance].SelectedGroups)
|
||||
InviteGroupToBG(queueInfo, bg, queueInfo.Team);
|
||||
|
||||
foreach (var queueInfo in m_SelectionPools[BatttleGroundTeamId.Horde].SelectedGroups)
|
||||
foreach (var queueInfo in m_SelectionPools[BattleGroundTeamId.Horde].SelectedGroups)
|
||||
InviteGroupToBG(queueInfo, bg, queueInfo.Team);
|
||||
|
||||
if (!bg.HasFreeSlots())
|
||||
@@ -777,8 +777,8 @@ namespace Game.BattleGrounds
|
||||
else if (Global.BattlegroundMgr.IsTesting())
|
||||
MinPlayersPerTeam = 1;
|
||||
|
||||
m_SelectionPools[BatttleGroundTeamId.Alliance].Init();
|
||||
m_SelectionPools[BatttleGroundTeamId.Horde].Init();
|
||||
m_SelectionPools[BattleGroundTeamId.Alliance].Init();
|
||||
m_SelectionPools[BattleGroundTeamId.Horde].Init();
|
||||
|
||||
if (!bg_template.IsArena())
|
||||
{
|
||||
@@ -793,13 +793,13 @@ namespace Game.BattleGrounds
|
||||
}
|
||||
// invite those selection pools
|
||||
for (uint i = 0; i < SharedConst.PvpTeamsCount; i++)
|
||||
foreach (var queueInfo in m_SelectionPools[BatttleGroundTeamId.Alliance + i].SelectedGroups)
|
||||
foreach (var queueInfo in m_SelectionPools[BattleGroundTeamId.Alliance + i].SelectedGroups)
|
||||
InviteGroupToBG(queueInfo, bg2, queueInfo.Team);
|
||||
|
||||
bg2.StartBattleground();
|
||||
//clear structures
|
||||
m_SelectionPools[BatttleGroundTeamId.Alliance].Init();
|
||||
m_SelectionPools[BatttleGroundTeamId.Horde].Init();
|
||||
m_SelectionPools[BattleGroundTeamId.Alliance].Init();
|
||||
m_SelectionPools[BattleGroundTeamId.Horde].Init();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -821,7 +821,7 @@ namespace Game.BattleGrounds
|
||||
// invite those selection pools
|
||||
for (uint i = 0; i < SharedConst.PvpTeamsCount; i++)
|
||||
{
|
||||
foreach (var queueInfo in m_SelectionPools[BatttleGroundTeamId.Alliance + i].SelectedGroups)
|
||||
foreach (var queueInfo in m_SelectionPools[BattleGroundTeamId.Alliance + i].SelectedGroups)
|
||||
InviteGroupToBG(queueInfo, bg2, queueInfo.Team);
|
||||
}
|
||||
// start bg
|
||||
@@ -908,8 +908,8 @@ namespace Game.BattleGrounds
|
||||
//if we have 2 teams, then start new arena and invite players!
|
||||
if (found == 2)
|
||||
{
|
||||
GroupQueueInfo aTeam = queueArray[BatttleGroundTeamId.Alliance];
|
||||
GroupQueueInfo hTeam = queueArray[BatttleGroundTeamId.Horde];
|
||||
GroupQueueInfo aTeam = queueArray[BattleGroundTeamId.Alliance];
|
||||
GroupQueueInfo hTeam = queueArray[BattleGroundTeamId.Horde];
|
||||
Battleground arena = Global.BattlegroundMgr.CreateNewBattleground(m_queueId, bracket_id);
|
||||
if (arena == null)
|
||||
{
|
||||
@@ -928,12 +928,12 @@ namespace Game.BattleGrounds
|
||||
if (aTeam.Team != Team.Alliance)
|
||||
{
|
||||
m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueuePremadeAlliance].Insert(0, aTeam);
|
||||
m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueuePremadeHorde].Remove(queueArray[BatttleGroundTeamId.Alliance]);
|
||||
m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueuePremadeHorde].Remove(queueArray[BattleGroundTeamId.Alliance]);
|
||||
}
|
||||
if (hTeam.Team != Team.Horde)
|
||||
{
|
||||
m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueuePremadeHorde].Insert(0, hTeam);
|
||||
m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueuePremadeAlliance].Remove(queueArray[BatttleGroundTeamId.Horde]);
|
||||
m_QueuedGroups[(int)bracket_id][BattlegroundConst.BgQueuePremadeAlliance].Remove(queueArray[BattleGroundTeamId.Horde]);
|
||||
}
|
||||
|
||||
arena.SetArenaMatchmakerRating(Team.Alliance, aTeam.ArenaMatchmakerRating);
|
||||
|
||||
@@ -199,7 +199,7 @@ namespace Game.BattleGrounds.Zones.AlteracValley
|
||||
m_Team_QuestStatus[teamIndex][4]++;
|
||||
if (m_Team_QuestStatus[teamIndex][4] >= 200)
|
||||
Log.outDebug(LogFilter.Battleground, "BG_AV Quest {} completed (need to implement some events here", questid);
|
||||
UpdateWorldState((int)(teamIndex == BatttleGroundTeamId.Alliance ? WorldStateIds.IvusStormCrystalCount : WorldStateIds.LokholarStormpikeSoldiersBloodCount), (int)m_Team_QuestStatus[teamIndex][4]);
|
||||
UpdateWorldState((int)(teamIndex == BattleGroundTeamId.Alliance ? WorldStateIds.IvusStormCrystalCount : WorldStateIds.LokholarStormpikeSoldiersBloodCount), (int)m_Team_QuestStatus[teamIndex][4]);
|
||||
break;
|
||||
case QuestIds.ANearMine:
|
||||
case QuestIds.HNearMine:
|
||||
@@ -253,17 +253,17 @@ namespace Game.BattleGrounds.Zones.AlteracValley
|
||||
int teamindex = GetTeamIndexByTeamId(team);
|
||||
_teamResources[teamindex] += points;
|
||||
|
||||
UpdateWorldState((int)(teamindex == BatttleGroundTeamId.Horde ? WorldStateIds.HordeReinforcements : WorldStateIds.AllianceReinforcements), _teamResources[teamindex]);
|
||||
UpdateWorldState((int)(teamindex == BattleGroundTeamId.Horde ? WorldStateIds.HordeReinforcements : WorldStateIds.AllianceReinforcements), _teamResources[teamindex]);
|
||||
if (points < 0)
|
||||
{
|
||||
if (_teamResources[teamindex] < 1)
|
||||
{
|
||||
_teamResources[teamindex] = 0;
|
||||
EndBattleground(teamindex == BatttleGroundTeamId.Horde ? Team.Alliance : Team.Horde);
|
||||
EndBattleground(teamindex == BattleGroundTeamId.Horde ? Team.Alliance : Team.Horde);
|
||||
}
|
||||
else if (!_isInformedNearVictory[teamindex] && _teamResources[teamindex] < MiscConst.NearLosePoints)
|
||||
{
|
||||
if (teamindex == BatttleGroundTeamId.Alliance)
|
||||
if (teamindex == BattleGroundTeamId.Alliance)
|
||||
SendBroadcastText((uint)BroadcastTextIds.AllianceNearLose, ChatMsg.BgSystemAlliance);
|
||||
else
|
||||
SendBroadcastText((uint)BroadcastTextIds.HordeNearLose, ChatMsg.BgSystemHorde);
|
||||
@@ -292,7 +292,7 @@ namespace Game.BattleGrounds.Zones.AlteracValley
|
||||
_mineResourceTimer.Reset(MiscConst.MineResourceTimer);
|
||||
}
|
||||
|
||||
for (byte i = BatttleGroundTeamId.Alliance; i <= BatttleGroundTeamId.Horde; i++)
|
||||
for (byte i = BattleGroundTeamId.Alliance; i <= BattleGroundTeamId.Horde; i++)
|
||||
{
|
||||
if (!IsCaptainAlive(i))
|
||||
continue;
|
||||
@@ -322,9 +322,9 @@ namespace Game.BattleGrounds.Zones.AlteracValley
|
||||
|
||||
bool IsCaptainAlive(uint teamId)
|
||||
{
|
||||
if (teamId == BatttleGroundTeamId.Horde)
|
||||
if (teamId == BattleGroundTeamId.Horde)
|
||||
return GetBgMap().GetWorldStateValue((int)WorldStateIds.GalvagarAlive) == 1;
|
||||
else if (teamId == BatttleGroundTeamId.Alliance)
|
||||
else if (teamId == BattleGroundTeamId.Alliance)
|
||||
return GetBgMap().GetWorldStateValue((int)WorldStateIds.BalindaAlive) == 1;
|
||||
|
||||
return false;
|
||||
@@ -365,18 +365,18 @@ namespace Game.BattleGrounds.Zones.AlteracValley
|
||||
{
|
||||
if (_nodes[i].Owner == Team.Alliance)
|
||||
{
|
||||
rep[BatttleGroundTeamId.Alliance] += MiscConst.RepGainSurvivingTower;
|
||||
kills[BatttleGroundTeamId.Alliance] += MiscConst.HonorKillBonusSurvivingTower;
|
||||
rep[BattleGroundTeamId.Alliance] += MiscConst.RepGainSurvivingTower;
|
||||
kills[BattleGroundTeamId.Alliance] += MiscConst.HonorKillBonusSurvivingTower;
|
||||
}
|
||||
else
|
||||
{
|
||||
rep[BatttleGroundTeamId.Horde] += MiscConst.RepGainSurvivingTower;
|
||||
kills[BatttleGroundTeamId.Horde] += MiscConst.HonorKillBonusSurvivingTower;
|
||||
rep[BattleGroundTeamId.Horde] += MiscConst.RepGainSurvivingTower;
|
||||
kills[BattleGroundTeamId.Horde] += MiscConst.HonorKillBonusSurvivingTower;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (byte i = BatttleGroundTeamId.Alliance; i <= BatttleGroundTeamId.Horde; ++i)
|
||||
for (byte i = BattleGroundTeamId.Alliance; i <= BattleGroundTeamId.Horde; ++i)
|
||||
{
|
||||
if (IsCaptainAlive(i))
|
||||
{
|
||||
@@ -713,24 +713,24 @@ namespace Game.BattleGrounds.Zones.AlteracValley
|
||||
Team owner = _nodes[(int)node].Owner;
|
||||
AVStates state = _nodes[(int)node].State;
|
||||
|
||||
UpdateWorldState(nodeInfo.AllianceAssault, (owner == Team.Alliance && state == AVStates.PointAssaulted) ? 1 : 0);
|
||||
UpdateWorldState(nodeInfo.AllianceControl, (owner == Team.Alliance && state >= AVStates.PointDestroyed) ? 1 : 0);
|
||||
UpdateWorldState(nodeInfo.HordeAssault, (owner == Team.Horde && state == AVStates.PointAssaulted) ? 1 : 0);
|
||||
UpdateWorldState(nodeInfo.HordeControl, (owner == Team.Horde && state >= AVStates.PointDestroyed) ? 1 : 0);
|
||||
UpdateWorldState(nodeInfo.AllianceAssault, owner == Team.Alliance && state == AVStates.PointAssaulted);
|
||||
UpdateWorldState(nodeInfo.AllianceControl, owner == Team.Alliance && state >= AVStates.PointDestroyed);
|
||||
UpdateWorldState(nodeInfo.HordeAssault, owner == Team.Horde && state == AVStates.PointAssaulted);
|
||||
UpdateWorldState(nodeInfo.HordeControl, owner == Team.Horde && state >= AVStates.PointDestroyed);
|
||||
if (nodeInfo.Owner != 0)
|
||||
UpdateWorldState(nodeInfo.Owner, owner == Team.Horde ? 2 : owner == Team.Alliance ? 1 : 0);
|
||||
}
|
||||
|
||||
if (node == AVNodes.SnowfallGrave)
|
||||
UpdateWorldState((int)WorldStateIds.SnowfallGraveyardUncontrolled, _nodes[(int)node].Owner == Team.Other ? 1 : 0);
|
||||
UpdateWorldState((int)WorldStateIds.SnowfallGraveyardUncontrolled, _nodes[(int)node].Owner == Team.Other);
|
||||
}
|
||||
|
||||
void SendMineWorldStates(AlteracValleyMine mine)
|
||||
{
|
||||
AlteracValleyMineInfo mineInfo = _mineInfo[(byte)mine];
|
||||
UpdateWorldState(mineInfo.StaticInfo.WorldStateHordeControlled, mineInfo.Owner == Team.Horde ? 1 : 0);
|
||||
UpdateWorldState(mineInfo.StaticInfo.WorldStateAllianceControlled, mineInfo.Owner == Team.Alliance ? 1 : 0);
|
||||
UpdateWorldState(mineInfo.StaticInfo.WorldStateNeutralControlled, mineInfo.Owner == Team.Other ? 1 : 0);
|
||||
UpdateWorldState(mineInfo.StaticInfo.WorldStateHordeControlled, mineInfo.Owner == Team.Horde);
|
||||
UpdateWorldState(mineInfo.StaticInfo.WorldStateAllianceControlled, mineInfo.Owner == Team.Alliance);
|
||||
UpdateWorldState(mineInfo.StaticInfo.WorldStateNeutralControlled, mineInfo.Owner == Team.Other);
|
||||
UpdateWorldState(mineInfo.StaticInfo.WorldStateOwner, mineInfo.Owner == Team.Horde ? 2 : mineInfo.Owner == Team.Alliance ? 1 : 0);
|
||||
}
|
||||
|
||||
@@ -842,9 +842,9 @@ namespace Game.BattleGrounds.Zones.AlteracValley
|
||||
switch (dataId)
|
||||
{
|
||||
case MiscConst.DataDefenderTierAlliance:
|
||||
return (uint)getDefenderTierForTeam(BatttleGroundTeamId.Alliance);
|
||||
return (uint)getDefenderTierForTeam(BattleGroundTeamId.Alliance);
|
||||
case MiscConst.DataDefenderTierHorde:
|
||||
return (uint)getDefenderTierForTeam(BatttleGroundTeamId.Horde);
|
||||
return (uint)getDefenderTierForTeam(BattleGroundTeamId.Horde);
|
||||
default:
|
||||
return base.GetData(dataId);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace Game.BattleGrounds.Zones.ArathisBasin
|
||||
|
||||
if (m_ReputationScoreTics[team] >= m_ReputationTics)
|
||||
{
|
||||
if (team == BatttleGroundTeamId.Alliance)
|
||||
if (team == BattleGroundTeamId.Alliance)
|
||||
RewardReputationToTeam(509, 10, Team.Alliance);
|
||||
else
|
||||
RewardReputationToTeam(510, 10, Team.Horde);
|
||||
@@ -72,13 +72,13 @@ namespace Game.BattleGrounds.Zones.ArathisBasin
|
||||
|
||||
if (m_HonorScoreTics[team] >= m_HonorTics)
|
||||
{
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(1), (team == BatttleGroundTeamId.Alliance) ? Team.Alliance : Team.Horde);
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(1), (team == BattleGroundTeamId.Alliance) ? Team.Alliance : Team.Horde);
|
||||
m_HonorScoreTics[team] -= m_HonorTics;
|
||||
}
|
||||
|
||||
if (!m_IsInformedNearVictory && m_TeamScores[team] > MiscConst.WarningNearVictoryScore)
|
||||
{
|
||||
if (team == BatttleGroundTeamId.Alliance)
|
||||
if (team == BattleGroundTeamId.Alliance)
|
||||
{
|
||||
SendBroadcastText((uint)ABBattlegroundBroadcastTexts.AllianceNearVictory, ChatMsg.BgSystemNeutral);
|
||||
PlaySoundToAll((uint)SoundIds.NearVictoryAlliance);
|
||||
@@ -94,7 +94,7 @@ namespace Game.BattleGrounds.Zones.ArathisBasin
|
||||
if (m_TeamScores[team] > MiscConst.MaxTeamScore)
|
||||
m_TeamScores[team] = MiscConst.MaxTeamScore;
|
||||
|
||||
if (team == BatttleGroundTeamId.Alliance)
|
||||
if (team == BattleGroundTeamId.Alliance)
|
||||
UpdateWorldState(WorldStateIds.ResourcesAlly, (int)m_TeamScores[team]);
|
||||
else
|
||||
UpdateWorldState(WorldStateIds.ResourcesHorde, (int)m_TeamScores[team]);
|
||||
@@ -103,7 +103,7 @@ namespace Game.BattleGrounds.Zones.ArathisBasin
|
||||
int otherTeam = (team + 1) % SharedConst.PvpTeamsCount;
|
||||
if (m_TeamScores[team] > m_TeamScores[otherTeam] + 500)
|
||||
{
|
||||
if (team == BatttleGroundTeamId.Alliance)
|
||||
if (team == BattleGroundTeamId.Alliance)
|
||||
UpdateWorldState(WorldStateIds.Had500DisadvantageHorde, 1);
|
||||
else
|
||||
UpdateWorldState(WorldStateIds.Had500DisadvantageAlliance, 1);
|
||||
@@ -115,9 +115,9 @@ namespace Game.BattleGrounds.Zones.ArathisBasin
|
||||
}
|
||||
|
||||
// Test win condition
|
||||
if (m_TeamScores[BatttleGroundTeamId.Alliance] >= MiscConst.MaxTeamScore)
|
||||
if (m_TeamScores[BattleGroundTeamId.Alliance] >= MiscConst.MaxTeamScore)
|
||||
EndBattleground(Team.Alliance);
|
||||
else if (m_TeamScores[BatttleGroundTeamId.Horde] >= MiscConst.MaxTeamScore)
|
||||
else if (m_TeamScores[BattleGroundTeamId.Horde] >= MiscConst.MaxTeamScore)
|
||||
EndBattleground(Team.Horde);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ namespace Game.BattleGrounds.Zones.EyeofStorm
|
||||
{
|
||||
_pointsTimer.Reset(MiscConst.PointsTickTime);
|
||||
|
||||
byte baseCountAlliance = GetControlledBaseCount(BatttleGroundTeamId.Alliance);
|
||||
byte baseCountHorde = GetControlledBaseCount(BatttleGroundTeamId.Horde);
|
||||
byte baseCountAlliance = GetControlledBaseCount(BattleGroundTeamId.Alliance);
|
||||
byte baseCountHorde = GetControlledBaseCount(BattleGroundTeamId.Horde);
|
||||
if (baseCountAlliance > 0)
|
||||
AddPoints(Team.Alliance, MiscConst.TickPoints[baseCountAlliance - 1]);
|
||||
if (baseCountHorde > 0)
|
||||
@@ -108,11 +108,11 @@ namespace Game.BattleGrounds.Zones.EyeofStorm
|
||||
uint point = controlZoneHandler.Value.GetPoint();
|
||||
switch (teamId)
|
||||
{
|
||||
case BatttleGroundTeamId.Alliance:
|
||||
case BattleGroundTeamId.Alliance:
|
||||
if (GetBgMap().GetWorldStateValue(MiscConst.m_PointsIconStruct[point].WorldStateAllianceControlledIndex) == 1)
|
||||
baseCount++;
|
||||
break;
|
||||
case BatttleGroundTeamId.Horde:
|
||||
case BattleGroundTeamId.Horde:
|
||||
if (GetBgMap().GetWorldStateValue(MiscConst.m_PointsIconStruct[point].WorldStateHordeControlledIndex) == 1)
|
||||
baseCount++;
|
||||
break;
|
||||
@@ -177,13 +177,13 @@ namespace Game.BattleGrounds.Zones.EyeofStorm
|
||||
if (score >= ScoreIds.MaxTeamScore)
|
||||
{
|
||||
score = ScoreIds.MaxTeamScore;
|
||||
if (team == BatttleGroundTeamId.Alliance)
|
||||
if (team == BattleGroundTeamId.Alliance)
|
||||
EndBattleground(Team.Alliance);
|
||||
else
|
||||
EndBattleground(Team.Horde);
|
||||
}
|
||||
|
||||
if (team == BatttleGroundTeamId.Alliance)
|
||||
if (team == BattleGroundTeamId.Alliance)
|
||||
UpdateWorldState(WorldStateIds.AllianceResources, (int)score);
|
||||
else
|
||||
UpdateWorldState(WorldStateIds.HordeResources, (int)score);
|
||||
@@ -206,10 +206,10 @@ namespace Game.BattleGrounds.Zones.EyeofStorm
|
||||
|
||||
void UpdatePointsCount(uint teamId)
|
||||
{
|
||||
if (teamId == BatttleGroundTeamId.Alliance)
|
||||
UpdateWorldState(WorldStateIds.AllianceBase, GetControlledBaseCount(BatttleGroundTeamId.Alliance));
|
||||
if (teamId == BattleGroundTeamId.Alliance)
|
||||
UpdateWorldState(WorldStateIds.AllianceBase, GetControlledBaseCount(BattleGroundTeamId.Alliance));
|
||||
else
|
||||
UpdateWorldState(WorldStateIds.HordeBase, GetControlledBaseCount(BatttleGroundTeamId.Horde));
|
||||
UpdateWorldState(WorldStateIds.HordeBase, GetControlledBaseCount(BattleGroundTeamId.Horde));
|
||||
}
|
||||
|
||||
public override void OnGameObjectCreate(GameObject gameobject)
|
||||
@@ -358,8 +358,8 @@ namespace Game.BattleGrounds.Zones.EyeofStorm
|
||||
//call parent's class reset
|
||||
base.Reset();
|
||||
|
||||
m_TeamScores[BatttleGroundTeamId.Alliance] = 0;
|
||||
m_TeamScores[BatttleGroundTeamId.Horde] = 0;
|
||||
m_TeamScores[BattleGroundTeamId.Alliance] = 0;
|
||||
m_TeamScores[BattleGroundTeamId.Horde] = 0;
|
||||
m_HonorScoreTics = [0, 0];
|
||||
m_FlagCapturedBgObjectType = 0;
|
||||
bool isBGWeekend = Global.BattlegroundMgr.IsBGWeekend(GetTypeID());
|
||||
@@ -377,12 +377,12 @@ namespace Game.BattleGrounds.Zones.EyeofStorm
|
||||
|
||||
public void EventTeamLostPoint(uint teamId, uint point, WorldObject controlZone)
|
||||
{
|
||||
if (teamId == BatttleGroundTeamId.Alliance)
|
||||
if (teamId == BattleGroundTeamId.Alliance)
|
||||
{
|
||||
SendBroadcastText(MiscConst.m_LosingPointTypes[point].MessageIdAlliance, ChatMsg.BgSystemAlliance, controlZone);
|
||||
UpdateWorldState(MiscConst.m_PointsIconStruct[point].WorldStateAllianceControlledIndex, 0);
|
||||
}
|
||||
else if (teamId == BatttleGroundTeamId.Horde)
|
||||
else if (teamId == BattleGroundTeamId.Horde)
|
||||
{
|
||||
SendBroadcastText(MiscConst.m_LosingPointTypes[point].MessageIdHorde, ChatMsg.BgSystemHorde, controlZone);
|
||||
UpdateWorldState(MiscConst.m_PointsIconStruct[point].WorldStateHordeControlledIndex, 0);
|
||||
@@ -394,12 +394,12 @@ namespace Game.BattleGrounds.Zones.EyeofStorm
|
||||
|
||||
public void EventTeamCapturedPoint(uint teamId, uint point, WorldObject controlZone)
|
||||
{
|
||||
if (teamId == BatttleGroundTeamId.Alliance)
|
||||
if (teamId == BattleGroundTeamId.Alliance)
|
||||
{
|
||||
SendBroadcastText(MiscConst.m_CapturingPointTypes[point].MessageIdAlliance, ChatMsg.BgSystemAlliance, controlZone);
|
||||
UpdateWorldState(MiscConst.m_PointsIconStruct[point].WorldStateAllianceControlledIndex, 1);
|
||||
}
|
||||
else if (teamId == BatttleGroundTeamId.Horde)
|
||||
else if (teamId == BattleGroundTeamId.Horde)
|
||||
{
|
||||
SendBroadcastText(MiscConst.m_CapturingPointTypes[point].MessageIdHorde, ChatMsg.BgSystemHorde, controlZone);
|
||||
UpdateWorldState(MiscConst.m_PointsIconStruct[point].WorldStateHordeControlledIndex, 1);
|
||||
@@ -416,9 +416,9 @@ namespace Game.BattleGrounds.Zones.EyeofStorm
|
||||
|
||||
public override Team GetPrematureWinner()
|
||||
{
|
||||
if (GetTeamScore(BatttleGroundTeamId.Alliance) > GetTeamScore(BatttleGroundTeamId.Horde))
|
||||
if (GetTeamScore(BattleGroundTeamId.Alliance) > GetTeamScore(BattleGroundTeamId.Horde))
|
||||
return Team.Alliance;
|
||||
else if (GetTeamScore(BatttleGroundTeamId.Horde) > GetTeamScore(BatttleGroundTeamId.Alliance))
|
||||
else if (GetTeamScore(BattleGroundTeamId.Horde) > GetTeamScore(BattleGroundTeamId.Alliance))
|
||||
return Team.Horde;
|
||||
|
||||
return base.GetPrematureWinner();
|
||||
@@ -526,22 +526,22 @@ namespace Game.BattleGrounds.Zones.EyeofStorm
|
||||
|
||||
public override void HandleProgressEventHorde(GameObject controlZone)
|
||||
{
|
||||
_battleground.EventTeamCapturedPoint(BatttleGroundTeamId.Horde, _point, controlZone);
|
||||
_battleground.EventTeamCapturedPoint(BattleGroundTeamId.Horde, _point, controlZone);
|
||||
}
|
||||
|
||||
public override void HandleProgressEventAlliance(GameObject controlZone)
|
||||
{
|
||||
_battleground.EventTeamCapturedPoint(BatttleGroundTeamId.Alliance, _point, controlZone);
|
||||
_battleground.EventTeamCapturedPoint(BattleGroundTeamId.Alliance, _point, controlZone);
|
||||
}
|
||||
|
||||
public override void HandleNeutralEventHorde(GameObject controlZone)
|
||||
{
|
||||
_battleground.EventTeamLostPoint(BatttleGroundTeamId.Horde, _point, controlZone);
|
||||
_battleground.EventTeamLostPoint(BattleGroundTeamId.Horde, _point, controlZone);
|
||||
}
|
||||
|
||||
public override void HandleNeutralEventAlliance(GameObject controlZone)
|
||||
{
|
||||
_battleground.EventTeamLostPoint(BatttleGroundTeamId.Alliance, _point, controlZone);
|
||||
_battleground.EventTeamLostPoint(BattleGroundTeamId.Alliance, _point, controlZone);
|
||||
}
|
||||
|
||||
public uint GetPoint() { return _point; }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -41,18 +41,18 @@ namespace Game.BattleGrounds.Zones.WarsongGluch
|
||||
{
|
||||
if (GetElapsedTime() >= 17 * Time.Minute * Time.InMilliseconds)
|
||||
{
|
||||
if (GetTeamScore(BatttleGroundTeamId.Alliance) == 0)
|
||||
if (GetTeamScore(BattleGroundTeamId.Alliance) == 0)
|
||||
{
|
||||
if (GetTeamScore(BatttleGroundTeamId.Horde) == 0) // No one scored - result is tie
|
||||
if (GetTeamScore(BattleGroundTeamId.Horde) == 0) // No one scored - result is tie
|
||||
EndBattleground(Team.Other);
|
||||
else // Horde has more points and thus wins
|
||||
EndBattleground(Team.Horde);
|
||||
}
|
||||
else if (GetTeamScore(BatttleGroundTeamId.Horde) == 0)
|
||||
else if (GetTeamScore(BattleGroundTeamId.Horde) == 0)
|
||||
EndBattleground(Team.Alliance); // Alliance has > 0, Horde has 0, alliance wins
|
||||
else if (GetTeamScore(BatttleGroundTeamId.Horde) == GetTeamScore(BatttleGroundTeamId.Alliance)) // Team score equal, winner is team that scored the last flag
|
||||
else if (GetTeamScore(BattleGroundTeamId.Horde) == GetTeamScore(BattleGroundTeamId.Alliance)) // Team score equal, winner is team that scored the last flag
|
||||
EndBattleground((Team)_lastFlagCaptureTeam);
|
||||
else if (GetTeamScore(BatttleGroundTeamId.Horde) > GetTeamScore(BatttleGroundTeamId.Alliance)) // Last but not least, check who has the higher score
|
||||
else if (GetTeamScore(BattleGroundTeamId.Horde) > GetTeamScore(BattleGroundTeamId.Alliance)) // Last but not least, check who has the higher score
|
||||
EndBattleground(Team.Horde);
|
||||
else
|
||||
EndBattleground(Team.Alliance);
|
||||
@@ -205,7 +205,7 @@ namespace Game.BattleGrounds.Zones.WarsongGluch
|
||||
|
||||
void UpdateTeamScore(int team)
|
||||
{
|
||||
if (team == BatttleGroundTeamId.Alliance)
|
||||
if (team == BattleGroundTeamId.Alliance)
|
||||
UpdateWorldState((int)WorldStateIds.FlagCapturesAlliance, (int)GetTeamScore(team));
|
||||
else
|
||||
UpdateWorldState((int)WorldStateIds.FlagCapturesHorde, (int)GetTeamScore(team));
|
||||
@@ -221,8 +221,8 @@ namespace Game.BattleGrounds.Zones.WarsongGluch
|
||||
//call parent's class reset
|
||||
base.Reset();
|
||||
|
||||
m_TeamScores[BatttleGroundTeamId.Alliance] = 0;
|
||||
m_TeamScores[BatttleGroundTeamId.Horde] = 0;
|
||||
m_TeamScores[BattleGroundTeamId.Alliance] = 0;
|
||||
m_TeamScores[BattleGroundTeamId.Horde] = 0;
|
||||
|
||||
if (Global.BattlegroundMgr.IsBGWeekend(GetTypeID()))
|
||||
{
|
||||
@@ -284,9 +284,9 @@ namespace Game.BattleGrounds.Zones.WarsongGluch
|
||||
|
||||
public override Team GetPrematureWinner()
|
||||
{
|
||||
if (GetTeamScore(BatttleGroundTeamId.Alliance) > GetTeamScore(BatttleGroundTeamId.Horde))
|
||||
if (GetTeamScore(BattleGroundTeamId.Alliance) > GetTeamScore(BattleGroundTeamId.Horde))
|
||||
return Team.Alliance;
|
||||
else if (GetTeamScore(BatttleGroundTeamId.Horde) > GetTeamScore(BatttleGroundTeamId.Alliance))
|
||||
else if (GetTeamScore(BattleGroundTeamId.Horde) > GetTeamScore(BattleGroundTeamId.Alliance))
|
||||
return Team.Horde;
|
||||
|
||||
return base.GetPrematureWinner();
|
||||
@@ -305,10 +305,10 @@ namespace Game.BattleGrounds.Zones.WarsongGluch
|
||||
_doors.Add(gameObject.GetGUID());
|
||||
break;
|
||||
case GameobjectIds.AllianceFlagInBase:
|
||||
_flags[BatttleGroundTeamId.Alliance] = gameObject.GetGUID();
|
||||
_flags[BattleGroundTeamId.Alliance] = gameObject.GetGUID();
|
||||
break;
|
||||
case GameobjectIds.HordeFlagInBase:
|
||||
_flags[BatttleGroundTeamId.Horde] = gameObject.GetGUID();
|
||||
_flags[BattleGroundTeamId.Horde] = gameObject.GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -323,10 +323,10 @@ namespace Game.BattleGrounds.Zones.WarsongGluch
|
||||
switch (areaTrigger.GetEntry())
|
||||
{
|
||||
case MiscConst.AtCapturePointAlliance:
|
||||
_capturePointAreaTriggers[BatttleGroundTeamId.Alliance] = areaTrigger.GetGUID();
|
||||
_capturePointAreaTriggers[BattleGroundTeamId.Alliance] = areaTrigger.GetGUID();
|
||||
break;
|
||||
case MiscConst.AtCapturePointHorde:
|
||||
_capturePointAreaTriggers[BatttleGroundTeamId.Horde] = areaTrigger.GetGUID();
|
||||
_capturePointAreaTriggers[BattleGroundTeamId.Horde] = areaTrigger.GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user