2016-06-08 22:29:04 +01:00
|
|
|
|
using System;
|
2015-09-25 18:52:25 -04:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
2016-08-22 10:43:04 -04:00
|
|
|
|
using FFXIVClassic.Common;
|
|
|
|
|
|
|
|
|
|
namespace FFXIVClassic_Map_Server.packets.send.actor
|
2015-09-25 18:52:25 -04:00
|
|
|
|
{
|
|
|
|
|
class SetActorPositionPacket
|
|
|
|
|
{
|
|
|
|
|
public const ushort OPCODE = 0x00CE;
|
|
|
|
|
public const uint PACKET_SIZE = 0x48;
|
|
|
|
|
|
2015-10-06 23:53:14 -04:00
|
|
|
|
public const uint SPAWNTYPE_FADEIN = 0;
|
|
|
|
|
public const uint SPAWNTYPE_PLAYERWAKE = 1;
|
|
|
|
|
public const uint SPAWNTYPE_WARP_DUTY = 2;
|
2015-10-06 23:08:40 -04:00
|
|
|
|
public const uint SPAWNTYPE_WARP2 = 3;
|
2015-10-06 23:53:14 -04:00
|
|
|
|
public const uint SPAWNTYPE_WARP3 = 4;
|
|
|
|
|
public const uint SPAWNTYPE_WARP_YELLOW = 5;
|
|
|
|
|
public const uint SPAWNTYPE_WARP_DUTY2 = 6;
|
|
|
|
|
public const uint SPAWNTYPE_WARP_LIGHT = 7;
|
2015-10-06 23:08:40 -04:00
|
|
|
|
|
|
|
|
|
public const float INNPOS_X = 157.550003f;
|
|
|
|
|
public const float INNPOS_Y = 000.000000f;
|
|
|
|
|
public const float INNPOS_Z = 165.050003f;
|
|
|
|
|
public const float INNPOS_ROT = -1.530000f;
|
|
|
|
|
|
2016-06-15 00:08:05 +01:00
|
|
|
|
public static SubPacket BuildPacket(uint sourceActorID, uint targetActorID, uint actorId, float x, float y, float z, float rotation, uint spawnType, bool isZoningPlayer)
|
2015-09-25 18:52:25 -04:00
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[PACKET_SIZE-0x20];
|
|
|
|
|
|
|
|
|
|
using (MemoryStream mem = new MemoryStream(data))
|
|
|
|
|
{
|
|
|
|
|
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
|
|
|
|
{
|
2016-01-09 18:52:23 -05:00
|
|
|
|
binWriter.Write((Int32)0);
|
|
|
|
|
binWriter.Write((Int32)actorId);
|
2015-10-06 23:08:40 -04:00
|
|
|
|
binWriter.Write((Single)x);
|
|
|
|
|
binWriter.Write((Single)y);
|
|
|
|
|
binWriter.Write((Single)z);
|
|
|
|
|
binWriter.Write((Single)rotation);
|
2015-10-06 23:53:14 -04:00
|
|
|
|
|
|
|
|
|
binWriter.BaseStream.Seek(0x24, SeekOrigin.Begin);
|
|
|
|
|
|
2016-01-08 21:37:09 -05:00
|
|
|
|
binWriter.Write((UInt16)spawnType);
|
2016-01-09 18:52:23 -05:00
|
|
|
|
binWriter.Write((UInt16)(isZoningPlayer ? 1 : 0));
|
2015-09-25 18:52:25 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 00:08:05 +01:00
|
|
|
|
return new SubPacket(OPCODE, sourceActorID, targetActorID, data);
|
2015-09-25 18:52:25 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|