35 lines
898 B
C#
35 lines
898 B
C#
using System;
|
|
using PSO2SERVER.Models;
|
|
using PSO2SERVER.Zone;
|
|
|
|
namespace PSO2SERVER.Protocol.Packets
|
|
{
|
|
class TeleportTransferPacket : Packet
|
|
{
|
|
/// (0x04, 0x02) Object Teleport Location.
|
|
private PSOObject src;
|
|
private PSOLocation dst;
|
|
|
|
public TeleportTransferPacket(PSOObject srcTeleporter, PSOLocation destination)
|
|
{
|
|
src = srcTeleporter;
|
|
dst = destination;
|
|
}
|
|
|
|
public override byte[] Build()
|
|
{
|
|
PacketWriter pkt = new PacketWriter();
|
|
pkt.Write(new byte[12]);
|
|
pkt.WriteObjectHeader(src.Header);
|
|
pkt.WritePosition(dst);
|
|
pkt.Write(new byte[2]);
|
|
return pkt.ToArray();
|
|
}
|
|
|
|
public override PacketHeader GetHeader()
|
|
{
|
|
return new PacketHeader(0x04, 0x02, PacketFlags.OBJECT_RELATED);
|
|
}
|
|
}
|
|
}
|