PSO2SERVER/Server/Packets/PSOPackets/TeleportTransferPacket.cs
2024-09-11 17:13:00 +08:00

33 lines
836 B
C#

using System;
using PSO2SERVER.Models;
namespace PSO2SERVER.Packets.PSOPackets
{
class TeleportTransferPacket : Packet
{
private PSOObject src;
private PSOLocation dst;
public TeleportTransferPacket(PSOObject srcTeleporter, PSOLocation destination)
{
src = srcTeleporter;
dst = destination;
}
public override byte[] Build()
{
PacketWriter writer = new PacketWriter();
writer.Write(new byte[12]);
writer.WriteStruct(src.Header);
writer.WritePosition(dst);
writer.Write(new byte[2]);
return writer.ToArray();
}
public override PacketHeader GetHeader()
{
return new PacketHeader(0x4, 0x2, PacketFlags.OBJECT_RELATED);
}
}
}