2015-10-12 02:03:47 -04:00
|
|
|
|
using FFXIVClassic_Lobby_Server.packets;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace FFXIVClassic_Map_Server.packets.send.actor
|
|
|
|
|
{
|
|
|
|
|
class ActorDoEmotePacket
|
|
|
|
|
{
|
|
|
|
|
public const ushort OPCODE = 0x00E1;
|
|
|
|
|
public const uint PACKET_SIZE = 0x30;
|
|
|
|
|
|
2016-02-18 22:38:54 -05: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-02-18 22:38:54 -05: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-02-18 22:38:54 -05: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-02-18 22:38:54 -05:00
|
|
|
|
binWriter.Write((UInt32)targettedActorId);
|
2015-10-12 02:03:47 -04:00
|
|
|
|
binWriter.Write((UInt32)realDescID);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-18 22:38:54 -05:00
|
|
|
|
SubPacket packet = new SubPacket(OPCODE, sourceActorId, targetActorId, data);
|
|
|
|
|
packet.debugPrintSubPacket();
|
2015-10-12 02:03:47 -04:00
|
|
|
|
return packet;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|