public static void Send(Client client, string text, int color)
        {
            PacketWriter packetWriter = new PacketWriter();
            packetWriter.PushByte(0xdf);
            packetWriter.PushByte(0xdf);
            packetWriter.PushShort(0xa);
            packetWriter.PushShort(1);
            packetWriter.PushShort(0);
            packetWriter.PushInt(3086);
            packetWriter.PushInt(client.Character.Id);
            packetWriter.PushInt(0x206b4b73);
            packetWriter.PushInt(50000);
            packetWriter.PushInt(client.Character.Id);
            packetWriter.PushByte(1);
            packetWriter.PushInt(0);
            packetWriter.PushInt(0x557e26);
            packetWriter.PushInt(0x21212122);
            packetWriter.PushInt(0x3a212121);
            packetWriter.PushShort(0x293c);
            packetWriter.PushByte(0x73);
            packetWriter.PushByte((byte)text.Length);
            packetWriter.PushString(text);
            packetWriter.PushInt(0);

            byte[] packet = packetWriter.Finish();

            client.SendCompressed(packet);
        }
        public static void Send(Client cli, NonPlayerCharacterClass knubotTarget, string message)
        {
            PacketWriter packetWriter = new PacketWriter();

            packetWriter.PushByte(0xdf);
            packetWriter.PushByte(0xdf);
            packetWriter.PushShort(0xa);
            packetWriter.PushShort(1);
            packetWriter.PushShort(0);
            packetWriter.PushInt(3086);
            packetWriter.PushInt(cli.Character.Id);
            packetWriter.PushInt(0x5d70532a);
            packetWriter.PushIdentity(cli.Character.Type, cli.Character.Id);
            packetWriter.PushByte(0);
            packetWriter.PushShort(2);
            packetWriter.PushIdentity(knubotTarget.Type, knubotTarget.Id);
            packetWriter.PushInt(0);
            packetWriter.PushInt(message.Length);
            packetWriter.PushString(message);
            packetWriter.PushInt(0);

            byte[] packet = packetWriter.Finish();

            cli.SendCompressed(packet);
        }
        public static void Send(Client cli, NonPlayerCharacterClass knubotTarget, string[] choices)
        {
            PacketWriter pw = new PacketWriter();

            pw.PushByte(0xdf);
            pw.PushByte(0xdf);
            pw.PushShort(0xa);
            pw.PushShort(1);
            pw.PushShort(0);
            pw.PushInt(3086);
            pw.PushInt(cli.Character.Id);
            pw.PushInt(0x55704d31);
            pw.PushIdentity(cli.Character.Type, cli.Character.Id);
            pw.PushByte(0);
            pw.PushShort(2);
            pw.PushIdentity(knubotTarget.Type, knubotTarget.Id);
            pw.PushInt(choices.Length);
            foreach (string choice in choices)
            {
                pw.PushInt(choice.Length);
                pw.PushString(choice);
            }

            byte[] packet = pw.Finish();

            cli.SendCompressed(packet);
        }
        public static void Send(Client client, int category, int instance, object[] args)
        {
            PacketWriter packetWriter = new PacketWriter();
            packetWriter.PushByte(0xDF);
            packetWriter.PushByte(0xDF);
            packetWriter.PushShort(10);
            packetWriter.PushShort(1);
            packetWriter.PushShort(0);
            packetWriter.PushInt(3086);
            packetWriter.PushInt(0);
            packetWriter.PushInt(0x206B4B73);
            packetWriter.PushIdentity(50000, client.Character.Id);
            packetWriter.PushByte(1);
            packetWriter.PushInt(0);

            string message = "&~" + Encode85By4(category) + "&:" + Encode85By4(instance);

            foreach (object arg in args)
            {
                if (arg is Int32)
                {
                    message = message + "i" + Encode85By5((Int32)arg);
                }
                string stringArg = arg as string;
                if (stringArg != null)
                {
                    if (stringArg.Length > 255)
                    {
                        message = message + "S";
                        Int16 len = (Int16)stringArg.Length;
                        message = message + ShortToChar(len) + stringArg;
                    }
                    else
                    {
                        message = message + "s" + ByteToChar((byte)(stringArg.Length));
                    }
                }
            }

            Int16 mlen = (Int16)(message.Length);
            packetWriter.PushShort(mlen);
            packetWriter.PushString(message);
            packetWriter.PushInt(1);

            byte[] packet = packetWriter.Finish();
            client.SendCompressed(packet);
        }