2016-08-22 10:43:04 -04:00
|
|
|
|
using FFXIVClassic.Common;
|
|
|
|
|
using System;
|
2015-10-13 12:50:23 -04:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
2016-08-22 10:43:04 -04: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
|
|
|
|
|
enum BattleActionX01PacketCommand : ushort
|
|
|
|
|
{
|
|
|
|
|
Disengage = 12002,
|
|
|
|
|
Attack = 22104,
|
|
|
|
|
}
|
2016-02-07 15:28:08 -05:00
|
|
|
|
class BattleActionX01Packet
|
2015-10-13 12:50:23 -04:00
|
|
|
|
{
|
|
|
|
|
public const ushort OPCODE = 0x0139;
|
|
|
|
|
public const uint PACKET_SIZE = 0x58;
|
|
|
|
|
|
2016-06-15 00:08:05 +01:00
|
|
|
|
public static SubPacket BuildPacket(uint playerActorID, uint sourceActorId, uint targetActorId, uint animationId, uint effectId, ushort worldMasterTextId, ushort commandId, ushort amount, byte param)
|
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);
|
|
|
|
|
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);
|
2017-08-16 17:25:32 +01:00
|
|
|
|
binWriter.Write((UInt16)0x810); //?
|
2016-02-07 13:06:04 -05:00
|
|
|
|
|
2016-06-15 00:08:05 +01:00
|
|
|
|
binWriter.Write((UInt32)targetActorId);
|
2016-02-07 13:06:04 -05:00
|
|
|
|
|
|
|
|
|
binWriter.Write((UInt16)amount);
|
|
|
|
|
binWriter.Write((UInt16)worldMasterTextId);
|
|
|
|
|
|
|
|
|
|
binWriter.Write((UInt32)effectId);
|
|
|
|
|
|
2016-02-07 15:28:08 -05:00
|
|
|
|
binWriter.Write((Byte)param);
|
2016-02-07 13:06:04 -05:00
|
|
|
|
binWriter.Write((Byte)1); //?
|
2015-10-13 12:50:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-27 16:55:14 -04:00
|
|
|
|
return new SubPacket(OPCODE, sourceActorId, data);
|
2015-10-13 12:50:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|