Core/Battlegrounds: Strand of the Ancients Rework

Port From (https://github.com/TrinityCore/TrinityCore/commit/3d56cdc08413a0682299136a763e13e67d38818b)
This commit is contained in:
hondacrx
2024-03-06 17:19:02 -05:00
parent faab7ba1f1
commit 69d144c399
27 changed files with 876 additions and 1339 deletions
@@ -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);
}