This commit is contained in:
Tahir Akhlaq 2016-06-15 00:08:05 +01:00
parent b633126568
commit ba13d5798d
47 changed files with 144 additions and 144 deletions

View file

@ -8,26 +8,26 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
public const ushort OPCODE = 0x00E1;
public const uint PACKET_SIZE = 0x30;
public static SubPacket BuildPacket(uint sourceActorId, uint tarGetActorId, uint tarGettedActorId, uint emoteID)
public static SubPacket BuildPacket(uint sourceActorId, uint targetActorId, uint targettedActorId, uint emoteID)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
if (tarGettedActorId == 0xC0000000)
tarGettedActorId = sourceActorId;
if (targettedActorId == 0xC0000000)
targettedActorId = sourceActorId;
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
uint realAnimID = 0x5000000 | ((emoteID - 100) << 12);
uint realDescID = 20000 + ((emoteID - 1) * 10) + (tarGettedActorId == sourceActorId ? (uint)2 : (uint)1);
uint realDescID = 20000 + ((emoteID - 1) * 10) + (targettedActorId == sourceActorId ? (uint)2 : (uint)1);
binWriter.Write((UInt32)realAnimID);
binWriter.Write((UInt32)tarGettedActorId);
binWriter.Write((UInt32)targettedActorId);
binWriter.Write((UInt32)realDescID);
}
}
SubPacket packet = new SubPacket(OPCODE, sourceActorId, tarGetActorId, data);
SubPacket packet = new SubPacket(OPCODE, sourceActorId, targetActorId, data);
packet.DebugPrintSubPacket();
return packet;
}