1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-23 05:07:47 +00:00
project-meteor-server/FFXIVClassic Map Server/packets/send/Actor/ActorDoEmotePacket.cs

39 lines
1.3 KiB
C#
Raw Normal View History

using System;
using System.IO;
2016-08-22 10:43:04 -04:00
using FFXIVClassic.Common;
namespace FFXIVClassic_Map_Server.packets.send.actor
{
class ActorDoEmotePacket
{
public const ushort OPCODE = 0x00E1;
public const uint PACKET_SIZE = 0x30;
2017-06-15 00:05:14 -04:00
public static SubPacket BuildPacket(uint sourceActorId, uint targetActorId, uint targettedActorId, uint animationId, uint descriptionId)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
2016-06-15 00:08:05 +01:00
if (targettedActorId == 0xC0000000)
targettedActorId = sourceActorId;
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
2017-06-15 00:05:14 -04:00
uint realAnimID = 0x5000000 | (animationId << 12);
if (descriptionId != 10105 && targettedActorId == sourceActorId)
descriptionId++;
binWriter.Write((UInt32)realAnimID);
2016-06-15 00:08:05 +01:00
binWriter.Write((UInt32)targettedActorId);
2017-06-15 00:05:14 -04:00
binWriter.Write((UInt32)descriptionId);
}
}
2016-06-15 00:08:05 +01:00
SubPacket packet = new SubPacket(OPCODE, sourceActorId, targetActorId, data);
packet.DebugPrintSubPacket();
return packet;
}
}
}