2016-06-08 22:29:04 +01:00
|
|
|
|
using System;
|
2015-10-12 02:03:47 -04:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
namespace FFXIVClassic_Map_Server.packets.send.actor
|
|
|
|
|
{
|
|
|
|
|
class ActorDoEmotePacket
|
|
|
|
|
{
|
|
|
|
|
public const ushort OPCODE = 0x00E1;
|
|
|
|
|
public const uint PACKET_SIZE = 0x30;
|
|
|
|
|
|
2016-06-14 22:54:02 +01:00
|
|
|
|
public static SubPacket BuildPacket(uint sourceActorId, uint tarGetActorId, uint tarGettedActorId, uint emoteID)
|
2015-10-12 02:03:47 -04:00
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
|
|
|
|
|
2016-06-14 22:54:02 +01:00
|
|
|
|
if (tarGettedActorId == 0xC0000000)
|
|
|
|
|
tarGettedActorId = sourceActorId;
|
2015-10-12 10:45:35 -04:00
|
|
|
|
|
2015-10-12 02:03:47 -04:00
|
|
|
|
using (MemoryStream mem = new MemoryStream(data))
|
|
|
|
|
{
|
|
|
|
|
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
|
|
|
|
{
|
|
|
|
|
uint realAnimID = 0x5000000 | ((emoteID - 100) << 12);
|
2016-06-14 22:54:02 +01:00
|
|
|
|
uint realDescID = 20000 + ((emoteID - 1) * 10) + (tarGettedActorId == sourceActorId ? (uint)2 : (uint)1);
|
2015-10-12 02:03:47 -04:00
|
|
|
|
binWriter.Write((UInt32)realAnimID);
|
2016-06-14 22:54:02 +01:00
|
|
|
|
binWriter.Write((UInt32)tarGettedActorId);
|
2015-10-12 02:03:47 -04:00
|
|
|
|
binWriter.Write((UInt32)realDescID);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-14 22:54:02 +01:00
|
|
|
|
SubPacket packet = new SubPacket(OPCODE, sourceActorId, tarGetActorId, data);
|
2016-06-14 21:29:10 +01:00
|
|
|
|
packet.DebugPrintSubPacket();
|
2015-10-12 02:03:47 -04:00
|
|
|
|
return packet;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|