2016-06-08 22:29:04 +01:00
|
|
|
|
using System;
|
2016-01-02 18:16:38 -05:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
2016-08-22 10:43:04 -04:00
|
|
|
|
using FFXIVClassic.Common;
|
|
|
|
|
|
|
|
|
|
namespace FFXIVClassic_Map_Server.packets.send.actor
|
2016-01-02 18:16:38 -05:00
|
|
|
|
{
|
2017-05-16 23:43:07 -04:00
|
|
|
|
class SetActorSubStatPacket
|
2017-08-26 17:39:28 +01:00
|
|
|
|
{
|
2016-01-02 18:16:38 -05:00
|
|
|
|
public const ushort OPCODE = 0x144;
|
|
|
|
|
public const uint PACKET_SIZE = 0x28;
|
|
|
|
|
|
2017-08-26 17:39:28 +01:00
|
|
|
|
enum SubStat : int
|
|
|
|
|
{
|
|
|
|
|
Breakage = 0x00, // (index goes high to low, bitflags)
|
|
|
|
|
Chant = 0x01, // [Nibbles: left / right hand = value]) (AKA SubStatObject)
|
|
|
|
|
Guard = 0x02, // [left / right hand = true] 0,1,2,3) ||| High byte also defines how many bools to use as flags for byte 0x4.
|
|
|
|
|
Waste = 0x03, // (High Nibble)
|
|
|
|
|
Mode = 0x04, // ???
|
|
|
|
|
Unknown = 0x05, // ???
|
|
|
|
|
SubStatMotionPack = 0x06,
|
|
|
|
|
Unknown2 = 0x07,
|
|
|
|
|
}
|
2017-06-27 13:23:05 -04:00
|
|
|
|
public static SubPacket BuildPacket(uint sourceActorId, byte breakage, int leftChant, int rightChant, int guard, int wasteStat, int statMode, uint idleAnimationId)
|
2016-01-02 18:16:38 -05:00
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
|
|
|
|
|
|
|
|
|
using (MemoryStream mem = new MemoryStream(data))
|
|
|
|
|
{
|
|
|
|
|
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
|
|
|
|
{
|
2017-05-16 23:43:07 -04:00
|
|
|
|
binWriter.Write((byte)breakage);
|
2017-08-29 22:27:32 -04:00
|
|
|
|
binWriter.Write((byte)(((leftChant & 0xF) << 4) | (rightChant & 0xF)));
|
2017-05-16 23:43:07 -04:00
|
|
|
|
binWriter.Write((byte)(guard & 0xF));
|
2018-07-02 00:45:06 -05:00
|
|
|
|
binWriter.Write((byte)(wasteStat));
|
|
|
|
|
binWriter.Write((byte)(statMode));
|
2017-05-16 23:43:07 -04:00
|
|
|
|
binWriter.Write((byte)0);
|
2016-01-02 18:16:38 -05:00
|
|
|
|
binWriter.Write((UInt16)(idleAnimationId&0xFFFF));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-27 13:23:05 -04:00
|
|
|
|
return new SubPacket(OPCODE, sourceActorId, data);
|
2016-01-02 18:16:38 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|