Added event conditions to the database. This is a JSON object that stores all types of conditions. The server also sends the correct packets to enable these conditions (minus the push packets... those aren't implemented).

This commit is contained in:
Filip Maj 2016-01-23 22:11:45 -05:00
parent 3b48ed1f74
commit 7bc3c8c2dd
13 changed files with 192 additions and 41 deletions

View file

@ -13,22 +13,21 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
public const ushort OPCODE = 0x0136;
public const uint PACKET_SIZE = 0x48;
public static SubPacket buildPacket(uint playerActorID, uint targetActorID)
public static SubPacket buildPacket(uint playerActorID, uint sourceActorID, uint unknown1, byte unknown2, string conditionName)
{
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));
binWriter.Write((UInt32)unknown1);
binWriter.Write((Byte)unknown2);
binWriter.Write(Encoding.ASCII.GetBytes(conditionName), 0, Encoding.ASCII.GetByteCount(conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(conditionName));
}
}
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
return new SubPacket(OPCODE, sourceActorID, playerActorID, data);
}
}
}