2016-08-22 10:43:04 -04:00
|
|
|
|
using FFXIVClassic.Common;
|
|
|
|
|
using System;
|
2015-10-13 12:50:23 -04:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
2018-02-15 13:20:46 -06:00
|
|
|
|
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
2015-10-13 12:50:23 -04:00
|
|
|
|
{
|
2017-07-07 22:08:48 +01:00
|
|
|
|
// see xtx_command
|
2019-01-29 00:02:09 -05:00
|
|
|
|
enum CommandResultX01PacketCommand : ushort
|
2017-07-07 22:08:48 +01:00
|
|
|
|
{
|
|
|
|
|
Disengage = 12002,
|
|
|
|
|
Attack = 22104,
|
|
|
|
|
}
|
2017-08-26 17:39:28 +01:00
|
|
|
|
|
2019-01-29 00:02:09 -05:00
|
|
|
|
class CommandResultX01Packet
|
2015-10-13 12:50:23 -04:00
|
|
|
|
{
|
|
|
|
|
public const ushort OPCODE = 0x0139;
|
|
|
|
|
public const uint PACKET_SIZE = 0x58;
|
|
|
|
|
|
2019-01-29 00:02:09 -05:00
|
|
|
|
public static SubPacket BuildPacket(uint sourceActorId, uint animationId, ushort commandId, CommandResult action)
|
2015-10-13 12:50:23 -04:00
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
|
|
|
|
|
|
|
|
|
using (MemoryStream mem = new MemoryStream(data))
|
|
|
|
|
{
|
|
|
|
|
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
|
|
|
|
{
|
2016-02-07 13:06:04 -05:00
|
|
|
|
binWriter.Write((UInt32)sourceActorId);
|
2018-02-15 13:20:46 -06:00
|
|
|
|
|
2016-02-07 13:06:04 -05:00
|
|
|
|
binWriter.Write((UInt32)animationId);
|
|
|
|
|
|
|
|
|
|
//Missing... last value is float, string in here as well?
|
|
|
|
|
|
|
|
|
|
binWriter.Seek(0x20, SeekOrigin.Begin);
|
2016-02-07 15:28:08 -05:00
|
|
|
|
binWriter.Write((UInt32)1); //Num actions (always 1 for this)
|
2016-02-07 13:06:04 -05:00
|
|
|
|
binWriter.Write((UInt16)commandId);
|
2018-04-18 16:06:41 -05:00
|
|
|
|
binWriter.Write((UInt16)0x801); //?
|
2016-02-07 13:06:04 -05:00
|
|
|
|
|
2017-08-28 20:26:21 -04:00
|
|
|
|
binWriter.Write((UInt32)action.targetId);
|
2016-02-07 13:06:04 -05:00
|
|
|
|
|
2017-08-28 20:26:21 -04:00
|
|
|
|
binWriter.Write((UInt16)action.amount);
|
|
|
|
|
binWriter.Write((UInt16)action.worldMasterTextId);
|
2016-02-07 13:06:04 -05:00
|
|
|
|
|
2017-08-28 20:26:21 -04:00
|
|
|
|
binWriter.Write((UInt32)action.effectId);
|
|
|
|
|
binWriter.Write((Byte)action.param);
|
2016-02-07 13:06:04 -05:00
|
|
|
|
binWriter.Write((Byte)1); //?
|
2015-10-13 12:50:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-05-27 14:51:39 -05:00
|
|
|
|
|
2017-06-27 16:55:14 -04:00
|
|
|
|
return new SubPacket(OPCODE, sourceActorId, data);
|
2015-10-13 12:50:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-02-15 13:20:46 -06:00
|
|
|
|
}
|