Core/WorldStates: Migrate Wintergrasp worldstates to new system
Port From (https://github.com/TrinityCore/TrinityCore/commit/6285033ed5ba8f67330eca40c1ae4840882a98d3)
This commit is contained in:
@@ -2952,9 +2952,9 @@ namespace Framework.Constants
|
|||||||
BattlefieldWgWorkshopNe = 3701,
|
BattlefieldWgWorkshopNe = 3701,
|
||||||
BattlefieldWgWorkshopSw = 3702,
|
BattlefieldWgWorkshopSw = 3702,
|
||||||
BattlefieldWgWorkshopSe = 3703,
|
BattlefieldWgWorkshopSe = 3703,
|
||||||
BattlefieldWgShowWorldstate = 3710,
|
BattlefieldWgShowTimeBattleEnd = 3710,
|
||||||
BattlefieldWgTimeBattleEnd = 3781,
|
BattlefieldWgTimeBattleEnd = 3781,
|
||||||
BattlefieldWgActive = 3801,
|
BattlefieldWgShowTimeNextBattle = 3801,
|
||||||
BattlefieldWgDefender = 3802,
|
BattlefieldWgDefender = 3802,
|
||||||
BattlefieldWgAttacker = 3803,
|
BattlefieldWgAttacker = 3803,
|
||||||
BattlefieldWgAttackedH = 4022,
|
BattlefieldWgAttackedH = 4022,
|
||||||
|
|||||||
@@ -348,11 +348,10 @@ namespace Game.BattleFields
|
|||||||
if (!endByTimer)
|
if (!endByTimer)
|
||||||
SetDefenderTeam(GetAttackerTeam());
|
SetDefenderTeam(GetAttackerTeam());
|
||||||
|
|
||||||
OnBattleEnd(endByTimer);
|
|
||||||
|
|
||||||
// Reset battlefield timer
|
// Reset battlefield timer
|
||||||
m_Timer = m_NoWarBattleTime;
|
m_Timer = m_NoWarBattleTime;
|
||||||
SendInitWorldStatesToAll();
|
|
||||||
|
OnBattleEnd(endByTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoPlaySoundToAll(uint soundID)
|
void DoPlaySoundToAll(uint soundID)
|
||||||
@@ -749,6 +748,8 @@ namespace Game.BattleFields
|
|||||||
|
|
||||||
public uint GetTypeId() { return m_TypeId; }
|
public uint GetTypeId() { return m_TypeId; }
|
||||||
public uint GetZoneId() { return m_ZoneId; }
|
public uint GetZoneId() { return m_ZoneId; }
|
||||||
|
public uint GetMapId() { return m_MapId; }
|
||||||
|
public Map GetMap() { return m_Map; }
|
||||||
public ulong GetQueueId() { return MathFunctions.MakePair64(m_BattleId | 0x20000, 0x1F100000); }
|
public ulong GetQueueId() { return MathFunctions.MakePair64(m_BattleId | 0x20000, 0x1F100000); }
|
||||||
|
|
||||||
// Return true if battle is start, false if battle is not started
|
// Return true if battle is start, false if battle is not started
|
||||||
|
|||||||
@@ -741,17 +741,6 @@ namespace Game.Entities
|
|||||||
void SendBattlefieldWorldStates()
|
void SendBattlefieldWorldStates()
|
||||||
{
|
{
|
||||||
// Send misc stuff that needs to be sent on every login, like the battle timers.
|
// Send misc stuff that needs to be sent on every login, like the battle timers.
|
||||||
if (WorldConfig.GetBoolValue(WorldCfg.WintergraspEnable))
|
|
||||||
{
|
|
||||||
BattleField wg = Global.BattleFieldMgr.GetBattlefieldByBattleId(BattlefieldIds.WG);
|
|
||||||
if (wg != null)
|
|
||||||
{
|
|
||||||
SendUpdateWorldState(WorldStates.BattlefieldWgActive, (uint)(wg.IsWarTime() ? 0 : 1));
|
|
||||||
uint timer = wg.IsWarTime() ? 0 : (wg.GetTimer() / 1000); // 0 - Time to next battle
|
|
||||||
SendUpdateWorldState(WorldStates.BattlefieldWgTimeNextBattle, (uint)(GameTime.GetGameTime() + timer));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (WorldConfig.GetBoolValue(WorldCfg.TolbaradEnable))
|
if (WorldConfig.GetBoolValue(WorldCfg.TolbaradEnable))
|
||||||
{
|
{
|
||||||
BattleField tb = Global.BattleFieldMgr.GetBattlefieldByBattleId(BattlefieldIds.TB);
|
BattleField tb = Global.BattleFieldMgr.GetBattlefieldByBattleId(BattlefieldIds.TB);
|
||||||
|
|||||||
@@ -3466,10 +3466,6 @@ namespace Game.Entities
|
|||||||
packet.AddState(4882, 0); // WORLD_STATE_HOR_WAVE_COUNT
|
packet.AddState(4882, 0); // WORLD_STATE_HOR_WAVE_COUNT
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (uint)AreaId.Wintergrasp: // Wintergrasp
|
|
||||||
if (battlefield != null && battlefield.GetTypeId() == (uint)BattleFieldTypes.WinterGrasp)
|
|
||||||
battlefield.FillInitialWorldStates(packet);
|
|
||||||
break;
|
|
||||||
// Zul Aman
|
// Zul Aman
|
||||||
case 3805:
|
case 3805:
|
||||||
if (instance != null && mapid == 568)
|
if (instance != null && mapid == 568)
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ using Game.Maps;
|
|||||||
using Game.Networking.Packets;
|
using Game.Networking.Packets;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Framework.Constants;
|
||||||
|
|
||||||
namespace Game
|
namespace Game
|
||||||
{
|
{
|
||||||
@@ -112,6 +113,16 @@ namespace Game
|
|||||||
return map.GetWorldStateValue(worldStateId);
|
return map.GetWorldStateValue(worldStateId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetValue(WorldStates worldStateId, int value, Map map)
|
||||||
|
{
|
||||||
|
SetValue((int)worldStateId, value, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetValue(uint worldStateId, int value, Map map)
|
||||||
|
{
|
||||||
|
SetValue((int)worldStateId, value, map);
|
||||||
|
}
|
||||||
|
|
||||||
public void SetValue(int worldStateId, int value, Map map)
|
public void SetValue(int worldStateId, int value, Map map)
|
||||||
{
|
{
|
||||||
WorldStateTemplate worldStateTemplate = GetWorldStateTemplate(worldStateId);
|
WorldStateTemplate worldStateTemplate = GetWorldStateTemplate(worldStateId);
|
||||||
|
|||||||
@@ -63,14 +63,14 @@ namespace Game.BattleFields
|
|||||||
m_saveTimer = 60000;
|
m_saveTimer = 60000;
|
||||||
|
|
||||||
// Load from db
|
// Load from db
|
||||||
if ((Global.WorldMgr.GetWorldState(WorldStates.BattlefieldWgActive) == 0) && (Global.WorldMgr.GetWorldState(WorldStates.BattlefieldWgDefender) == 0) && (Global.WorldMgr.GetWorldState(WGConst.ClockWorldState[0]) == 0))
|
if ((Global.WorldMgr.GetWorldState(WorldStates.BattlefieldWgShowTimeNextBattle) == 0) && (Global.WorldMgr.GetWorldState(WorldStates.BattlefieldWgDefender) == 0) && (Global.WorldMgr.GetWorldState(WGConst.ClockWorldState[0]) == 0))
|
||||||
{
|
{
|
||||||
Global.WorldMgr.SetWorldState(WorldStates.BattlefieldWgActive, 0);
|
Global.WorldMgr.SetWorldState(WorldStates.BattlefieldWgShowTimeNextBattle, 0);
|
||||||
Global.WorldMgr.SetWorldState(WorldStates.BattlefieldWgDefender, RandomHelper.URand(0, 1));
|
Global.WorldMgr.SetWorldState(WorldStates.BattlefieldWgDefender, RandomHelper.URand(0, 1));
|
||||||
Global.WorldMgr.SetWorldState(WGConst.ClockWorldState[0], m_NoWarBattleTime);
|
Global.WorldMgr.SetWorldState(WGConst.ClockWorldState[0], m_NoWarBattleTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_isActive = Global.WorldMgr.GetWorldState(WorldStates.BattlefieldWgActive) != 0;
|
m_isActive = Global.WorldMgr.GetWorldState(WorldStates.BattlefieldWgShowTimeNextBattle) == 0;
|
||||||
m_DefenderTeam = Global.WorldMgr.GetWorldState(WorldStates.BattlefieldWgDefender);
|
m_DefenderTeam = Global.WorldMgr.GetWorldState(WorldStates.BattlefieldWgDefender);
|
||||||
|
|
||||||
m_Timer = Global.WorldMgr.GetWorldState(WGConst.ClockWorldState[0]);
|
m_Timer = Global.WorldMgr.GetWorldState(WGConst.ClockWorldState[0]);
|
||||||
@@ -80,10 +80,20 @@ namespace Game.BattleFields
|
|||||||
m_Timer = m_RestartAfterCrash;
|
m_Timer = m_RestartAfterCrash;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetData(WGData.WonA, Global.WorldMgr.GetWorldState(WorldStates.BattlefieldWgAttackedA));
|
void loadSavedWorldState(WorldStates id)
|
||||||
SetData(WGData.DefA, Global.WorldMgr.GetWorldState(WorldStates.BattlefieldWgDefendedA));
|
{
|
||||||
SetData(WGData.WonH, Global.WorldMgr.GetWorldState(WorldStates.BattlefieldWgAttackedH));
|
Global.WorldStateMgr.SetValue(id, (int)Global.WorldMgr.GetWorldState(id), m_Map);
|
||||||
SetData(WGData.DefH, Global.WorldMgr.GetWorldState(WorldStates.BattlefieldWgDefendedH));
|
}
|
||||||
|
|
||||||
|
loadSavedWorldState(WorldStates.BattlefieldWgShowTimeNextBattle);
|
||||||
|
loadSavedWorldState(WorldStates.BattlefieldWgDefender);
|
||||||
|
Global.WorldStateMgr.SetValue(WorldStates.BattlefieldWgAttacker, (int)GetAttackerTeam(), m_Map);
|
||||||
|
Global.WorldStateMgr.SetValue(WGConst.ClockWorldState[0], (int)(GameTime.GetGameTime() + m_Timer / Time.InMilliseconds), m_Map);
|
||||||
|
Global.WorldStateMgr.SetValue(WGConst.ClockWorldState[1], (int)(GameTime.GetGameTime() + m_Timer / Time.InMilliseconds), m_Map);
|
||||||
|
loadSavedWorldState(WorldStates.BattlefieldWgAttackedA);
|
||||||
|
loadSavedWorldState(WorldStates.BattlefieldWgDefendedA);
|
||||||
|
loadSavedWorldState(WorldStates.BattlefieldWgAttackedH);
|
||||||
|
loadSavedWorldState(WorldStates.BattlefieldWgDefendedH);
|
||||||
|
|
||||||
foreach (var gy in WGConst.WGGraveYard)
|
foreach (var gy in WGConst.WGGraveYard)
|
||||||
{
|
{
|
||||||
@@ -165,13 +175,18 @@ namespace Game.BattleFields
|
|||||||
bool m_return = base.Update(diff);
|
bool m_return = base.Update(diff);
|
||||||
if (m_saveTimer <= diff)
|
if (m_saveTimer <= diff)
|
||||||
{
|
{
|
||||||
Global.WorldMgr.SetWorldState(WorldStates.BattlefieldWgActive, m_isActive);
|
void saveWorldState(WorldStates id)
|
||||||
|
{
|
||||||
|
Global.WorldMgr.SetWorldState(id, Global.WorldStateMgr.GetValue((int)id, m_Map));
|
||||||
|
}
|
||||||
|
|
||||||
|
Global.WorldMgr.SetWorldState(WorldStates.BattlefieldWgShowTimeNextBattle, !m_isActive);
|
||||||
Global.WorldMgr.SetWorldState(WorldStates.BattlefieldWgDefender, m_DefenderTeam);
|
Global.WorldMgr.SetWorldState(WorldStates.BattlefieldWgDefender, m_DefenderTeam);
|
||||||
Global.WorldMgr.SetWorldState(WGConst.ClockWorldState[0], m_Timer);
|
Global.WorldMgr.SetWorldState(WGConst.ClockWorldState[0], m_Timer);
|
||||||
Global.WorldMgr.SetWorldState(WorldStates.BattlefieldWgAttackedA, GetData(WGData.WonA));
|
saveWorldState(WorldStates.BattlefieldWgAttackedA);
|
||||||
Global.WorldMgr.SetWorldState(WorldStates.BattlefieldWgDefendedA, GetData(WGData.DefA));
|
saveWorldState(WorldStates.BattlefieldWgDefendedA);
|
||||||
Global.WorldMgr.SetWorldState(WorldStates.BattlefieldWgAttackedH, GetData(WGData.WonH));
|
saveWorldState(WorldStates.BattlefieldWgAttackedH);
|
||||||
Global.WorldMgr.SetWorldState(WorldStates.BattlefieldWgDefendedH, GetData(WGData.DefH));
|
saveWorldState(WorldStates.BattlefieldWgDefendedH);
|
||||||
m_saveTimer = 60 * Time.InMilliseconds;
|
m_saveTimer = 60 * Time.InMilliseconds;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -195,6 +210,11 @@ namespace Game.BattleFields
|
|||||||
else
|
else
|
||||||
Log.outError(LogFilter.Battlefield, "WG: Failed to spawn titan relic.");
|
Log.outError(LogFilter.Battlefield, "WG: Failed to spawn titan relic.");
|
||||||
|
|
||||||
|
Global.WorldStateMgr.SetValue(WorldStates.BattlefieldWgAttacker, (int)GetAttackerTeam(), m_Map);
|
||||||
|
Global.WorldStateMgr.SetValue(WorldStates.BattlefieldWgDefender, (int)GetDefenderTeam(), m_Map);
|
||||||
|
Global.WorldStateMgr.SetValue(WorldStates.BattlefieldWgShowTimeNextBattle, 0, m_Map);
|
||||||
|
Global.WorldStateMgr.SetValue(WorldStates.BattlefieldWgShowTimeBattleEnd, 1, m_Map);
|
||||||
|
Global.WorldStateMgr.SetValue(WGConst.ClockWorldState[0], (int)(GameTime.GetGameTime() + m_Timer / Time.InMilliseconds), m_Map);
|
||||||
|
|
||||||
// Update tower visibility and update faction
|
// Update tower visibility and update faction
|
||||||
foreach (var guid in CanonList)
|
foreach (var guid in CanonList)
|
||||||
@@ -287,12 +307,22 @@ namespace Game.BattleFields
|
|||||||
foreach (BfWGGameObjectBuilding building in BuildingsInZone)
|
foreach (BfWGGameObjectBuilding building in BuildingsInZone)
|
||||||
building.RebuildGate();
|
building.RebuildGate();
|
||||||
|
|
||||||
// successful defense
|
// update win statistics
|
||||||
if (endByTimer)
|
{
|
||||||
UpdateData(GetDefenderTeam() == TeamId.Horde ? WGData.DefH : WGData.DefA, 1);
|
WorldStates worldStateId;
|
||||||
// successful attack (note that teams have already been swapped, so defender team is the one who won)
|
// successful defense
|
||||||
else
|
if (endByTimer)
|
||||||
UpdateData(GetDefenderTeam() == TeamId.Horde ? WGData.WonH : WGData.WonA, 1);
|
worldStateId = GetDefenderTeam() == TeamId.Horde ? WorldStates.BattlefieldWgDefendedH : WorldStates.BattlefieldWgDefendedA;
|
||||||
|
// successful attack (note that teams have already been swapped, so defender team is the one who won)
|
||||||
|
else
|
||||||
|
worldStateId = GetDefenderTeam() == TeamId.Horde ? WorldStates.BattlefieldWgAttackedH : WorldStates.BattlefieldWgAttackedA;
|
||||||
|
|
||||||
|
Global.WorldStateMgr.SetValue(worldStateId, Global.WorldStateMgr.GetValue((int)worldStateId, m_Map) + 1, m_Map);
|
||||||
|
}
|
||||||
|
|
||||||
|
Global.WorldStateMgr.SetValue(WorldStates.BattlefieldWgShowTimeNextBattle, 1, m_Map);
|
||||||
|
Global.WorldStateMgr.SetValue(WorldStates.BattlefieldWgShowTimeBattleEnd, 0, m_Map);
|
||||||
|
Global.WorldStateMgr.SetValue(WGConst.ClockWorldState[1], (int)(GameTime.GetGameTime() + m_Timer / Time.InMilliseconds), m_Map);
|
||||||
|
|
||||||
// Remove turret
|
// Remove turret
|
||||||
foreach (var guid in CanonList)
|
foreach (var guid in CanonList)
|
||||||
@@ -763,41 +793,8 @@ namespace Game.BattleFields
|
|||||||
return base.GetData(data);
|
return base.GetData(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void FillInitialWorldStates(InitWorldStates packet)
|
//todo remove
|
||||||
{
|
public override void SendInitWorldStatesToAll() { }
|
||||||
packet.AddState(WorldStates.BattlefieldWgAttacker, GetAttackerTeam());
|
|
||||||
packet.AddState(WorldStates.BattlefieldWgDefender, GetDefenderTeam());
|
|
||||||
// Note: cleanup these two, their names look awkward
|
|
||||||
packet.AddState(WorldStates.BattlefieldWgActive, IsWarTime());
|
|
||||||
packet.AddState(WorldStates.BattlefieldWgShowWorldstate, IsWarTime());
|
|
||||||
|
|
||||||
for (uint i = 0; i < 2; ++i)
|
|
||||||
packet.AddState(WGConst.ClockWorldState[i], (uint)(GameTime.GetGameTime() + (m_Timer / 1000)));
|
|
||||||
|
|
||||||
packet.AddState(WorldStates.BattlefieldWgVehicleH, GetData(WGData.VehicleH));
|
|
||||||
packet.AddState(WorldStates.BattlefieldWgMaxVehicleH, GetData(WGData.MaxVehicleH));
|
|
||||||
packet.AddState(WorldStates.BattlefieldWgVehicleA, GetData(WGData.VehicleA));
|
|
||||||
packet.AddState(WorldStates.BattlefieldWgMaxVehicleA, GetData(WGData.MaxVehicleA));
|
|
||||||
|
|
||||||
foreach (BfWGGameObjectBuilding building in BuildingsInZone)
|
|
||||||
building.FillInitialWorldStates(packet);
|
|
||||||
|
|
||||||
foreach (WGWorkshop workshop in Workshops)
|
|
||||||
workshop.FillInitialWorldStates(packet);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void SendInitWorldStatesToAll()
|
|
||||||
{
|
|
||||||
for (byte team = 0; team < SharedConst.PvpTeamsCount; team++)
|
|
||||||
{
|
|
||||||
foreach (var guid in m_players[team])
|
|
||||||
{
|
|
||||||
Player player = Global.ObjAccessor.FindPlayer(guid);
|
|
||||||
if (player)
|
|
||||||
SendInitWorldStatesTo(player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void BrokenWallOrTower(uint team, BfWGGameObjectBuilding building)
|
public void BrokenWallOrTower(uint team, BfWGGameObjectBuilding building)
|
||||||
{
|
{
|
||||||
@@ -850,7 +847,8 @@ namespace Game.BattleFields
|
|||||||
m_Timer = 0;
|
m_Timer = 0;
|
||||||
else
|
else
|
||||||
m_Timer -= 600000;
|
m_Timer -= 600000;
|
||||||
SendInitWorldStatesToAll();
|
|
||||||
|
Global.WorldStateMgr.SetValue(WGConst.ClockWorldState[0], (int)(GameTime.GetGameTime() + m_Timer / Time.InMilliseconds), m_Map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // Keep tower
|
else // Keep tower
|
||||||
@@ -912,10 +910,10 @@ namespace Game.BattleFields
|
|||||||
// Update vehicle count WorldState to player
|
// Update vehicle count WorldState to player
|
||||||
void UpdateVehicleCountWG()
|
void UpdateVehicleCountWG()
|
||||||
{
|
{
|
||||||
SendUpdateWorldState(WorldStates.BattlefieldWgVehicleH, GetData(WGData.VehicleH));
|
Global.WorldStateMgr.SetValue(WorldStates.BattlefieldWgVehicleH, (int)GetData(WGData.VehicleH), m_Map);
|
||||||
SendUpdateWorldState(WorldStates.BattlefieldWgMaxVehicleH, GetData(WGData.MaxVehicleH));
|
Global.WorldStateMgr.SetValue(WorldStates.BattlefieldWgMaxVehicleH, (int)GetData(WGData.MaxVehicleH), m_Map);
|
||||||
SendUpdateWorldState(WorldStates.BattlefieldWgVehicleA, GetData(WGData.VehicleA));
|
Global.WorldStateMgr.SetValue(WorldStates.BattlefieldWgVehicleA, (int)GetData(WGData.VehicleA), m_Map);
|
||||||
SendUpdateWorldState(WorldStates.BattlefieldWgMaxVehicleA, GetData(WGData.MaxVehicleA));
|
Global.WorldStateMgr.SetValue(WorldStates.BattlefieldWgMaxVehicleA, (int)GetData(WGData.MaxVehicleA), m_Map);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateTenacity()
|
void UpdateTenacity()
|
||||||
@@ -1089,7 +1087,7 @@ namespace Game.BattleFields
|
|||||||
|
|
||||||
// Update worldstate
|
// Update worldstate
|
||||||
_state = WGGameObjectState.AllianceIntact - ((int)_teamControl * 3);
|
_state = WGGameObjectState.AllianceIntact - ((int)_teamControl * 3);
|
||||||
_wg.SendUpdateWorldState(_worldState, (uint)_state);
|
Global.WorldStateMgr.SetValue(_worldState, (int)_state, _wg.GetMap());
|
||||||
}
|
}
|
||||||
UpdateCreatureAndGo();
|
UpdateCreatureAndGo();
|
||||||
build.SetFaction(WGConst.WintergraspFaction[_teamControl]);
|
build.SetFaction(WGConst.WintergraspFaction[_teamControl]);
|
||||||
@@ -1115,7 +1113,7 @@ namespace Game.BattleFields
|
|||||||
{
|
{
|
||||||
// Update worldstate
|
// Update worldstate
|
||||||
_state = WGGameObjectState.AllianceDamage - ((int)_teamControl * 3);
|
_state = WGGameObjectState.AllianceDamage - ((int)_teamControl * 3);
|
||||||
_wg.SendUpdateWorldState(_worldState, (uint)_state);
|
Global.WorldStateMgr.SetValue(_worldState, (int)_state, _wg.GetMap());
|
||||||
|
|
||||||
// Send warning message
|
// Send warning message
|
||||||
if (_staticTowerInfo != null) // tower damage + name
|
if (_staticTowerInfo != null) // tower damage + name
|
||||||
@@ -1146,7 +1144,7 @@ namespace Game.BattleFields
|
|||||||
{
|
{
|
||||||
// Update worldstate
|
// Update worldstate
|
||||||
_state = WGGameObjectState.AllianceDestroy - ((int)_teamControl * 3);
|
_state = WGGameObjectState.AllianceDestroy - ((int)_teamControl * 3);
|
||||||
_wg.SendUpdateWorldState(_worldState, (uint)_state);
|
Global.WorldStateMgr.SetValue(_worldState, (int)_state, _wg.GetMap());
|
||||||
|
|
||||||
// Warn players
|
// Warn players
|
||||||
if (_staticTowerInfo != null)
|
if (_staticTowerInfo != null)
|
||||||
@@ -1203,6 +1201,7 @@ namespace Game.BattleFields
|
|||||||
}
|
}
|
||||||
|
|
||||||
_state = (WGGameObjectState)Global.WorldMgr.GetWorldState(_worldState);
|
_state = (WGGameObjectState)Global.WorldMgr.GetWorldState(_worldState);
|
||||||
|
Global.WorldStateMgr.SetValue(_worldState, (int)_state, _wg.GetMap());
|
||||||
switch (_state)
|
switch (_state)
|
||||||
{
|
{
|
||||||
case WGGameObjectState.NeutralIntact:
|
case WGGameObjectState.NeutralIntact:
|
||||||
@@ -1450,10 +1449,8 @@ namespace Game.BattleFields
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FillInitialWorldStates(InitWorldStates packet)
|
// todo remove
|
||||||
{
|
public void FillInitialWorldStates(InitWorldStates packet) { }
|
||||||
packet.AddState(_worldState, (uint)_state);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Save()
|
public void Save()
|
||||||
{
|
{
|
||||||
@@ -1518,7 +1515,7 @@ namespace Game.BattleFields
|
|||||||
{
|
{
|
||||||
// Updating worldstate
|
// Updating worldstate
|
||||||
_state = WGGameObjectState.AllianceIntact;
|
_state = WGGameObjectState.AllianceIntact;
|
||||||
_wg.SendUpdateWorldState(_staticInfo.WorldStateId, (uint)_state);
|
Global.WorldStateMgr.SetValue(_staticInfo.WorldStateId, (int)_state, _wg.GetMap());
|
||||||
|
|
||||||
// Warning message
|
// Warning message
|
||||||
if (!init)
|
if (!init)
|
||||||
@@ -1538,7 +1535,7 @@ namespace Game.BattleFields
|
|||||||
{
|
{
|
||||||
// Update worldstate
|
// Update worldstate
|
||||||
_state = WGGameObjectState.HordeIntact;
|
_state = WGGameObjectState.HordeIntact;
|
||||||
_wg.SendUpdateWorldState(_staticInfo.WorldStateId, (uint)_state);
|
Global.WorldStateMgr.SetValue(_staticInfo.WorldStateId, (int)_state, _wg.GetMap());
|
||||||
|
|
||||||
// Warning message
|
// Warning message
|
||||||
if (!init)
|
if (!init)
|
||||||
@@ -1569,11 +1566,6 @@ namespace Game.BattleFields
|
|||||||
GiveControlTo(_wg.GetDefenderTeam(), true);
|
GiveControlTo(_wg.GetDefenderTeam(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FillInitialWorldStates(InitWorldStates packet)
|
|
||||||
{
|
|
||||||
packet.AddState(_staticInfo.WorldStateId, (uint)_state);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Save()
|
public void Save()
|
||||||
{
|
{
|
||||||
Global.WorldMgr.SetWorldState(_staticInfo.WorldStateId, (uint)_state);
|
Global.WorldMgr.SetWorldState(_staticInfo.WorldStateId, (uint)_state);
|
||||||
|
|||||||
@@ -369,11 +369,7 @@ namespace Game.BattleFields
|
|||||||
public const int MaxVehicleH = 5;
|
public const int MaxVehicleH = 5;
|
||||||
public const int VehicleA = 6;
|
public const int VehicleA = 6;
|
||||||
public const int VehicleH = 7;
|
public const int VehicleH = 7;
|
||||||
public const int WonA = 8;
|
public const int Max = 8;
|
||||||
public const int DefA = 9;
|
|
||||||
public const int WonH = 10;
|
|
||||||
public const int DefH = 11;
|
|
||||||
public const int Max = 12;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct WGAchievements
|
struct WGAchievements
|
||||||
|
|||||||
Reference in New Issue
Block a user