Quote:
I haven't been able to figure out the flags for capture the flag yet, sorry. If i find it out i probably won't release it anyway tho, gotta keep some stuff for myself =)
PHP Code:
public byte[] CaptureTheFlag(SingleNPC NPC)//1080
{
string Ctf = "CaptureTheFlag";
ushort PacketType = 1109;
byte[] Packet = new byte[28 + Ctf.Length];
if (World.CaptureTheFlag != "None")
Packet = new byte[28 + World.CaptureTheFlag.Length];
fixed (byte* p = Packet)
{
*((ushort*)p) = (ushort)Packet.Length;
*((ushort*)(p + 2)) = (ushort)PacketType;
*((uint*)(p + 4)) = (uint)NPC.UID;
*((uint*)(p + 8)) = (uint)NPC.MaxHP;
*((uint*)(p + 12)) = (uint)NPC.CurHP;
*((ushort*)(p + 16)) = (ushort)NPC.X;
*((ushort*)(p + 18)) = (ushort)NPC.Y;
*((ushort*)(p + 20)) = (ushort)(1086);
*((ushort*)(p + 22)) = (ushort)NPC.Flags;
*(p + 24) = 11;
*(p + 26) = 1;
if (World.CaptureTheFlag != "None")
{
*(p + 27) = (byte)World.CaptureTheFlag.Length;
for (int i = 0; i < World.CaptureTheFlag.Length; i++)
{
*(p + 28 + i) = Convert.ToByte(World.CaptureTheFlag[i]);
}
}
else
{
*(p + 27) = (byte)Ctf.Length;
for (int i = 0; i < 4; i++)
{
*(p + 28 + i) = Convert.ToByte(Ctf[i]);
}
}
}
return Packet;
}