Core/GameObjects: Implemented GAMEOBJECT_TYPE_CAPTURE_POINT
Port From (https://github.com/TrinityCore/TrinityCore/commit/19f64e66e58d3d7ebed6437a474a134e7c673ed6)
This commit is contained in:
@@ -463,7 +463,7 @@ namespace Game.Networking.Packets
|
||||
|
||||
BracketInfo[] Bracket = new BracketInfo[6];
|
||||
}
|
||||
|
||||
|
||||
class PVPMatchInitialize : ServerPacket
|
||||
{
|
||||
public PVPMatchInitialize() : base(ServerOpcodes.PvpMatchInitialize, ConnectionType.Instance) { }
|
||||
@@ -520,6 +520,34 @@ namespace Game.Networking.Packets
|
||||
public uint SoloShuffleStatus;
|
||||
}
|
||||
|
||||
class UpdateCapturePoint : ServerPacket
|
||||
{
|
||||
public BattlegroundCapturePointInfo CapturePointInfo;
|
||||
|
||||
public UpdateCapturePoint() : base(ServerOpcodes.UpdateCapturePoint) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
CapturePointInfo.Write(_worldPacket);
|
||||
}
|
||||
}
|
||||
|
||||
class CapturePointRemoved : ServerPacket
|
||||
{
|
||||
public ObjectGuid CapturePointGUID;
|
||||
|
||||
public CapturePointRemoved() : base(ServerOpcodes.CapturePointRemoved) { }
|
||||
public CapturePointRemoved(ObjectGuid capturePointGUID) : base(ServerOpcodes.CapturePointRemoved)
|
||||
{
|
||||
CapturePointGUID = capturePointGUID;
|
||||
}
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(CapturePointGUID);
|
||||
}
|
||||
}
|
||||
|
||||
//Structs
|
||||
struct BracketInfo
|
||||
{
|
||||
@@ -747,4 +775,26 @@ namespace Game.Networking.Packets
|
||||
public sbyte IconID;
|
||||
public sbyte ArenaSlot;
|
||||
}
|
||||
|
||||
struct BattlegroundCapturePointInfo
|
||||
{
|
||||
public ObjectGuid Guid;
|
||||
public Vector2 Pos;
|
||||
public BattlegroundCapturePointState State = BattlegroundCapturePointState.Neutral;
|
||||
public long CaptureTime;
|
||||
public TimeSpan CaptureTotalDuration;
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WritePackedGuid(Guid);
|
||||
data.WriteVector2(Pos);
|
||||
data.WriteInt8((sbyte)State);
|
||||
|
||||
if (State == BattlegroundCapturePointState.ContestedHorde || State == BattlegroundCapturePointState.ContestedAlliance)
|
||||
{
|
||||
data.WriteInt64(CaptureTime);
|
||||
data.WriteUInt32((uint)CaptureTotalDuration.TotalMilliseconds);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user