From 3b48ed1f742d4f3345ad49a0f9bf3f8b2a3dc906 Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Sat, 23 Jan 2016 20:12:04 -0500 Subject: [PATCH] Added actor event packets. --- .../FFXIVClassic Map Server.csproj | 1 + .../Actor/events/SetEmoteEventCondition.cs | 36 +++++++++++++++++ .../send/Actor/events/SetEventStatus.cs | 34 ++++++++++++++++ .../Actor/events/SetNoticeEventCondition.cs | 35 ++++++++++++++++ .../events/SetPushEventConditionWithCircle.cs | 40 +++++++++++++++++++ .../events/SetPushEventConditionWithFan.cs | 40 +++++++++++++++++++ .../SetPushEventConditionWithTriggerBox.cs | 40 +++++++++++++++++++ .../Actor/events/SetTalkEventCondition.cs | 35 ++++++++++++++++ 8 files changed, 261 insertions(+) create mode 100644 FFXIVClassic Map Server/packets/send/Actor/events/SetEmoteEventCondition.cs create mode 100644 FFXIVClassic Map Server/packets/send/Actor/events/SetEventStatus.cs create mode 100644 FFXIVClassic Map Server/packets/send/Actor/events/SetNoticeEventCondition.cs create mode 100644 FFXIVClassic Map Server/packets/send/Actor/events/SetPushEventConditionWithCircle.cs create mode 100644 FFXIVClassic Map Server/packets/send/Actor/events/SetPushEventConditionWithFan.cs create mode 100644 FFXIVClassic Map Server/packets/send/Actor/events/SetPushEventConditionWithTriggerBox.cs create mode 100644 FFXIVClassic Map Server/packets/send/Actor/events/SetTalkEventCondition.cs diff --git a/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj b/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj index 7c7ff0b3..e7f74093 100644 --- a/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj +++ b/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj @@ -122,6 +122,7 @@ + diff --git a/FFXIVClassic Map Server/packets/send/Actor/events/SetEmoteEventCondition.cs b/FFXIVClassic Map Server/packets/send/Actor/events/SetEmoteEventCondition.cs new file mode 100644 index 00000000..db73a2a7 --- /dev/null +++ b/FFXIVClassic Map Server/packets/send/Actor/events/SetEmoteEventCondition.cs @@ -0,0 +1,36 @@ +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.events +{ + class SetEmoteEventCondition + { + public const ushort OPCODE = 0x016C; + public const uint PACKET_SIZE = 0x48; + + public static SubPacket buildPacket(uint playerActorID, uint targetActorID) + { + byte[] data = new byte[PACKET_SIZE - 0x20]; + + string eventName = ""; + + using (MemoryStream mem = new MemoryStream(data)) + { + using (BinaryWriter binWriter = new BinaryWriter(mem)) + { + binWriter.Write((Byte)0); + binWriter.Write((Byte)0); + binWriter.Write((UInt16)0); + binWriter.Write(Encoding.ASCII.GetBytes(eventName), 0, Encoding.ASCII.GetByteCount(eventName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(eventName)); + } + } + + return new SubPacket(OPCODE, playerActorID, playerActorID, data); + } + } +} diff --git a/FFXIVClassic Map Server/packets/send/Actor/events/SetEventStatus.cs b/FFXIVClassic Map Server/packets/send/Actor/events/SetEventStatus.cs new file mode 100644 index 00000000..be678eb9 --- /dev/null +++ b/FFXIVClassic Map Server/packets/send/Actor/events/SetEventStatus.cs @@ -0,0 +1,34 @@ +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.events +{ + class SetEventStatus + { + public const ushort OPCODE = 0x0136; + public const uint PACKET_SIZE = 0x48; + + public static SubPacket buildPacket(uint playerActorID, uint targetActorID) + { + byte[] data = new byte[PACKET_SIZE - 0x20]; + + string eventName = ""; + + using (MemoryStream mem = new MemoryStream(data)) + { + using (BinaryWriter binWriter = new BinaryWriter(mem)) + { + binWriter.Write((UInt32)0); + binWriter.Write(Encoding.ASCII.GetBytes(eventName), 0, Encoding.ASCII.GetByteCount(eventName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(eventName)); + } + } + + return new SubPacket(OPCODE, playerActorID, playerActorID, data); + } + } +} diff --git a/FFXIVClassic Map Server/packets/send/Actor/events/SetNoticeEventCondition.cs b/FFXIVClassic Map Server/packets/send/Actor/events/SetNoticeEventCondition.cs new file mode 100644 index 00000000..da1ccebe --- /dev/null +++ b/FFXIVClassic Map Server/packets/send/Actor/events/SetNoticeEventCondition.cs @@ -0,0 +1,35 @@ +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.events +{ + class SetNoticeEventCondition + { + public const ushort OPCODE = 0x016B; + public const uint PACKET_SIZE = 0x48; + + public static SubPacket buildPacket(uint playerActorID, uint targetActorID) + { + byte[] data = new byte[PACKET_SIZE - 0x20]; + + string eventName = ""; + + using (MemoryStream mem = new MemoryStream(data)) + { + using (BinaryWriter binWriter = new BinaryWriter(mem)) + { + binWriter.Write((Byte)0); + binWriter.Write((Byte)0); + binWriter.Write(Encoding.ASCII.GetBytes(eventName), 0, Encoding.ASCII.GetByteCount(eventName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(eventName)); + } + } + + return new SubPacket(OPCODE, playerActorID, playerActorID, data); + } + } +} diff --git a/FFXIVClassic Map Server/packets/send/Actor/events/SetPushEventConditionWithCircle.cs b/FFXIVClassic Map Server/packets/send/Actor/events/SetPushEventConditionWithCircle.cs new file mode 100644 index 00000000..d29bd240 --- /dev/null +++ b/FFXIVClassic Map Server/packets/send/Actor/events/SetPushEventConditionWithCircle.cs @@ -0,0 +1,40 @@ +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.events +{ + class SetPushEventConditionWithCircle + { + public const ushort OPCODE = 0x016F; + public const uint PACKET_SIZE = 0x58; + + public static SubPacket buildPacket(uint playerActorID, uint targetActorID) + { + byte[] data = new byte[PACKET_SIZE - 0x20]; + + string eventName = ""; + + using (MemoryStream mem = new MemoryStream(data)) + { + using (BinaryWriter binWriter = new BinaryWriter(mem)) + { + binWriter.Write((Single)0.0f); + binWriter.Write((UInt32)0); + binWriter.Write((Single)0.0f); + binWriter.Seek(4, SeekOrigin.Current); + binWriter.Write((Byte)0); + binWriter.Write((Byte)0); + binWriter.Write((Byte)0); + binWriter.Write(Encoding.ASCII.GetBytes(eventName), 0, Encoding.ASCII.GetByteCount(eventName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(eventName)); + } + } + + return new SubPacket(OPCODE, playerActorID, playerActorID, data); + } + } +} diff --git a/FFXIVClassic Map Server/packets/send/Actor/events/SetPushEventConditionWithFan.cs b/FFXIVClassic Map Server/packets/send/Actor/events/SetPushEventConditionWithFan.cs new file mode 100644 index 00000000..5af69878 --- /dev/null +++ b/FFXIVClassic Map Server/packets/send/Actor/events/SetPushEventConditionWithFan.cs @@ -0,0 +1,40 @@ +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.events +{ + class SetPushEventConditionWithFan + { + public const ushort OPCODE = 0x0170; + public const uint PACKET_SIZE = 0x60; + + public static SubPacket buildPacket(uint playerActorID, uint targetActorID) + { + byte[] data = new byte[PACKET_SIZE - 0x20]; + + string eventName = ""; + + using (MemoryStream mem = new MemoryStream(data)) + { + using (BinaryWriter binWriter = new BinaryWriter(mem)) + { + binWriter.Write((Single)0.0f); + binWriter.Write((UInt32)0); + binWriter.Write((Single)0.0f); + binWriter.Seek(4, SeekOrigin.Current); + binWriter.Write((Byte)0); + binWriter.Write((Byte)0); + binWriter.Write((Byte)0); + binWriter.Write(Encoding.ASCII.GetBytes(eventName), 0, Encoding.ASCII.GetByteCount(eventName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(eventName)); + } + } + + return new SubPacket(OPCODE, playerActorID, playerActorID, data); + } + } +} diff --git a/FFXIVClassic Map Server/packets/send/Actor/events/SetPushEventConditionWithTriggerBox.cs b/FFXIVClassic Map Server/packets/send/Actor/events/SetPushEventConditionWithTriggerBox.cs new file mode 100644 index 00000000..608a93f9 --- /dev/null +++ b/FFXIVClassic Map Server/packets/send/Actor/events/SetPushEventConditionWithTriggerBox.cs @@ -0,0 +1,40 @@ +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.events +{ + class SetPushEventConditionWithTriggerBox + { + public const ushort OPCODE = 0x0175; + public const uint PACKET_SIZE = 0x58; + + public static SubPacket buildPacket(uint playerActorID, uint targetActorID) + { + byte[] data = new byte[PACKET_SIZE - 0x20]; + + string eventName = ""; + + using (MemoryStream mem = new MemoryStream(data)) + { + using (BinaryWriter binWriter = new BinaryWriter(mem)) + { + binWriter.Write((Single)0.0f); + binWriter.Write((UInt32)0); + binWriter.Write((Single)0.0f); + binWriter.Seek(4, SeekOrigin.Current); + binWriter.Write((Byte)0); + binWriter.Write((Byte)0); + binWriter.Write((Byte)0); + binWriter.Write(Encoding.ASCII.GetBytes(eventName), 0, Encoding.ASCII.GetByteCount(eventName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(eventName)); + } + } + + return new SubPacket(OPCODE, playerActorID, playerActorID, data); + } + } +} diff --git a/FFXIVClassic Map Server/packets/send/Actor/events/SetTalkEventCondition.cs b/FFXIVClassic Map Server/packets/send/Actor/events/SetTalkEventCondition.cs new file mode 100644 index 00000000..de9c4d6c --- /dev/null +++ b/FFXIVClassic Map Server/packets/send/Actor/events/SetTalkEventCondition.cs @@ -0,0 +1,35 @@ +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.events +{ + class SetTalkEventCondition + { + public const ushort OPCODE = 0x012E; + public const uint PACKET_SIZE = 0x48; + + public static SubPacket buildPacket(uint playerActorID, uint targetActorID) + { + byte[] data = new byte[PACKET_SIZE - 0x20]; + + string eventName = ""; + + using (MemoryStream mem = new MemoryStream(data)) + { + using (BinaryWriter binWriter = new BinaryWriter(mem)) + { + binWriter.Write((Byte)0); + binWriter.Write((Byte)0); + binWriter.Write(Encoding.ASCII.GetBytes(eventName), 0, Encoding.ASCII.GetByteCount(eventName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(eventName)); + } + } + + return new SubPacket(OPCODE, playerActorID, playerActorID, data); + } + } +}