Chi system implementation

07/28/2013 10:39 marcbacor6666#1
Chi system implementation ,

i found this from the egy site.

anyone could pin point where to put this codes?

Code:
using Conquer_Online_Server.Client;  
using System;  
namespace Conquer_Online_Server.Network.GamePackets  
{  
    public class chi : Writer  
    {  
        private byte[] Buffer = new byte[47];  
        public uint Chi  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 10);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 10, this.Buffer);  
            }  
        }  
        public uint open  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 18);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 18, this.Buffer);  
            }  
        }  
        public uint type  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 22);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 22, this.Buffer);  
            }  
        }  
        public uint type1  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 30);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 30, this.Buffer);  
            }  
        }  
        public uint strik  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 31);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 31, this.Buffer);  
            }  
        }  
        public uint pstrik  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 35);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 35, this.Buffer);  
            }  
        }  
        public uint phattak  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 23);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 23, this.Buffer);  
            }  
        }  
        public uint hp  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 27);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 27, this.Buffer);  
            }  
        }  
        public chi(uint clientID)  
        {  
            Writer.WriteUInt16(39, 0, this.Buffer);  
            Writer.WriteUInt16(2534, 2, this.Buffer);  
            this.Buffer[25] = 10;  
            Writer.WriteUInt32(clientID, 6, this.Buffer);  
        }  
        public void Send(GameState client)  
        {  
            client.Send(this.ToArray());  
        }  
        public byte[] ToArray()  
        {  
            return this.Buffer;  
        }  
    }  
}
Code:
using System;  
using System.Collections.Generic;  
using System.Text;  

namespace Conquer_Online_Server.Network.GamePackets  
{  

    public class ChiInfo : Writer, Interfaces.IPacket  
    {  
        public enum ChiAction  
        {  
            Unlock = 0,  
            QueryInfo = 1,  
            Study = 2,  
            BuyStrength = 3,  
        }  

        public enum ChiPowerType  
        {  
            None = 0,  
            Dragon = 1,  
            Phoenix = 2,  
            Tiger = 3,  
            Turtle = 4  
        }  

        public enum ChiAttribute  
        {  
            None = 0,  
            CriticalRate,  
            MagicCriticalRate,  
            AntiMagicCriticalRate,  
            CrashAttack,  
            CrashDefense,  
            MaxLife,  
            AddAttack,  
            AddMagicAttack,  
            AddMagicDefense,  
            FinalAttack,  
            FinalMagicAttack,  
            FinalDefense,  
            FinalMagicDefense  
        }  

        byte[] Buffer;  

        public ChiInfo(bool Create)  
        {  
            if (Create)  
            {  
                Buffer = new byte[168 + 8];  
                WriteUInt16(168, 0, Buffer);  
                WriteUInt16(2533, 2, Buffer);  
            }  
            Strings = new List<string>();  
        }  

        public uint Type  
        {  
            get { return BitConverter.ToUInt32(Buffer, 4); }  
            set { WriteUInt32(value, 4, Buffer); }  
        }  

        public ulong dwParam  
        {  
            get { return BitConverter.ToUInt64(Buffer, 8); }  
            set { WriteUInt64(value, 8, Buffer); }  
        }  

        public ushort wParam1  
        {  
            get { return BitConverter.ToUInt16(Buffer, 8); }  
            set { WriteUInt16(value, 8, Buffer); }  
        }  

        public ushort wParam2  
        {  
            get { return BitConverter.ToUInt16(Buffer, 10); }  
            set { WriteUInt16(value, 10, Buffer); }  
        }  

        public uint dwParam2  
        {  
            get { return BitConverter.ToUInt32(Buffer, 16); }  
            set { WriteUInt32(value, 16, Buffer); }  
        }  

        public uint dwParam3  
        {  
            get { return BitConverter.ToUInt32(Buffer, 20); }  
            set { WriteUInt32(value, 20, Buffer); }  
        }  

        public uint dwParam4  
        {  
            get { return BitConverter.ToUInt32(Buffer, 24); }  
            set { WriteUInt32(value, 24, Buffer); }  
        }  

        //Thanks to ImmuneOne, who fixed the strings offsets, I managed to get nobility done.  
        public byte StringCount  
        {  
            get { return Buffer[32]; }  
            set { Buffer[32] = value; }  
        }  

        public List<string> DecodedStrings  
        {  
            get  
            {  
                List<string> list = new List<string>(StringCount);  
                int offset = 33;  
                for (int count = 0; count < StringCount; count++)  
                {  
                    byte stringLength = Buffer[offset]; offset++;  
                    string String = Encoding.UTF7.GetString(Buffer, offset, stringLength);  
                    offset += stringLength;  
                    list.Add(String);  
                }  
                return list;  
            }  
        }  

        public List<string> Strings;  

        public void UpdateString(Game.ConquerStructures.NobilityInformation info)  
        {  
            string buildString = info.EntityUID + " " + info.Donation + " " + (byte)info.Rank + " " + info.Position;  
            buildString = (char)buildString.Length + buildString;  
            Strings.Add(buildString);  
        }  

        public void ListString(Game.ConquerStructures.NobilityInformation info)  
        {  
            string buildString = info.EntityUID + " " + info.Gender + " 0 " + info.Name + " " + info.Donation + " " + (byte)info.Rank + " " + info.Position;  
            buildString = (char)buildString.Length + buildString;  
            Strings.Add(buildString);  
        }  

        public void Send(Client.GameState client)  
        {  
            client.Send(ToArray());  
        }  

        public byte[] ToArray()  
        {  
            if (Strings.Count == 0)  
                return Buffer;  
            string theString = "";  
            for (int count = 0; count < Strings.Count; count++)  
            {  
                theString += Strings[count];  
            }  
            byte[] newBuffer = new byte[168 + 8 + theString.Length];  
            Buffer.CopyTo(newBuffer, 0);  
            WriteUInt16((ushort)(newBuffer.Length - 8), 0, newBuffer);  
            newBuffer[34] = (byte)Strings.Count;  
            WriteString(theString, 35, newBuffer);  
            return newBuffer;  
        }  

        public void Deserialize(byte[] buffer)  
        {  
            Buffer = buffer;  
        }  
    }  
}
Code:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  

namespace Conquer_Online_Server.Network.GamePackets  
{  

    public enum ChiGate // byte  
    {  
        Dragon = 1,  
        Tiger = 2,  
        Phoneix = 3,  
        Turtle = 4 //build  
    }  
}
Code:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  

namespace Conquer_Online_Server.Network.GamePackets  
{  
    class ChiInfoStruct2  
    {  
        public ChiInfo.ChiPowerType Type { get; set; }  

        public int Attrib1 { get; set; }  

        public int Attrib2 { get; set; }  

        public int Attrib3 { get; set; }  

        public int Attrib4 { get; set; }  
    }  
}
Code:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  

namespace Conquer_Online_Server.Network.GamePackets  
{  
    public class ChiStats : Writer, Interfaces.IPacket  
    {  
        byte[] mData;  
        public ChiGate ChiGate  
        {  
            get  
            {  
                return (ChiGate)mData[22];  
            }  
            set  
            {  
                mData[22] = (byte)value;  
            }  
        }  
        public uint ChiPoints  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 10);  
            }  
            set  
            {  
                WriteUInt32(value, 10, mData);  
            }  
        }  
        public uint Identifier  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 6);  
            }  
            set  
            {  
                WriteUInt32(value, 6, mData);  
            }  
        }  
        public ushort Unknown1  
        {  
            get  
            {  
                return BitConverter.ToUInt16(mData, 4);  
            }  
            set  
            {  
                WriteUInt16(value, 4, mData);  
            }  
        }  
        public uint Unknown2  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 14);  
            }  
            set  
            {  
                WriteUInt32(value, 14, mData);  
            }  
        }  
        public uint Unknown3  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 18);  
            }  
            set  
            {  
                WriteUInt32(value, 18, mData);  
            }  
        }  
        public uint Val1  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 24);  
            }  
            set  
            {  
                WriteUInt32(value, 24, mData);  
            }  
        }  
        public uint Val2  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 28);  
            }  
            set  
            {  
                WriteUInt32(value, 28, mData);  
            }  
        }  
        public uint Val3  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 32);  
            }  
            set  
            {  
                WriteUInt32(value, 32, mData);  
            }  
        }  
        public uint Val4  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 36);  
            }  
            set  
            {  
                WriteUInt32(value, 36, mData);  
            }  
        }  
        /* public static implicit operator byte[](ChiStats d)  
        {  
        return d.mData;  
        }*/  
        public ChiStats()  
        {  
            mData = new byte[39 + 8];  
            WriteUInt16(39, 0, mData);  
            WriteUInt16(2534, 2, mData);  
        }  
        public static ChiStats ChiStats22(byte[] d)  
        {  
            var packet = new ChiStats();  
            packet.mData = d;  
            return packet;  
        }  
        public byte[] ToArray()  
        {  
            return mData;  
        }  
        public void Send(Client.GameState client)  
        {  
            client.Send(mData);  
        }  
        public void Deserialize(byte[] buffer)  
        {  
            mData = buffer;  
        }  
    } // class ChiStats  
}
Code:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  

namespace Conquer_Online_Server.Network.GamePackets  
{  
    public class ChiSystem : Writer, Interfaces.IPacket  
    {  

        byte[] mData;  

        public ChiSystem()  
        {  

            mData = new byte[16];  
            WriteUInt16((ushort)mData.Length, 0, mData);  
            WriteUInt16(2533, 2, mData);  

        }  

        public uint Identifier  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 4);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 4, mData);  
            }  
        }  

        public byte StudyFlag  
        {  
            get  
            {  
                return mData[11];  
            }  
            set  
            {  
                mData[11] = value;  
            }  
        }  
        public enum ChiSystemType : ushort  
        {  
            Unlock = 0,  
            Open = 1,  
            Study = 2,  
            CPFillChi = 3  
        }  
        public ChiSystemType Type  
        {  
            get  
            {  
                return (ChiSystemType)BitConverter.ToUInt16(mData, 8);  
            }  
            set  
            {  
                Writer.WriteUInt32((ushort)value, 8, mData);  
            }  
        }  

        public byte Unknown1  
        {  
            get  
            {  
                return mData[10];  
            }  
            set  
            {  
                mData[10] = value;  
            }  
        }  

        public uint Unknown2  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 12);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 12, mData);  
            }  
        }  

        /* public static implicit operator byte[](ChiSystem d)  
         {  
             return d.mData;  
         }*/  



        public ChiSystem(byte[] d)  
        {  
            mData = new byte[d.Length];  
            d.CopyTo(mData, 0);  
        }  
        public byte[] ToArray()  
        {  
            return mData;  
        }  

        public void Send(Client.GameState client)  
        {  
            client.Send(mData);  
        }  
        public void Deserialize(byte[] buffer)  
        {  
            mData = buffer;  
        }  

    } // class ChiSystem  
}
Code:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  

namespace Conquer_Online_Server.Network.GamePackets  
{  
    public class ChiSystem2  
    {  

        public ChiSystem2()  
        {  
        }  

        public static void Handle(byte[] Data, Client.GameState Client)  
        {  

            ChiSystem chiSystem = new ChiSystem(Data);  
            //Console.WriteLine(chiSystem.Identifier);  
            //Console.WriteLine(chiSystem.Unknown1);  
            //Console.WriteLine(chiSystem.Type);  
            //Console.WriteLine(chiSystem.StudyFlag);  
            //Console.WriteLine(chiSystem.Unknown2);  
            chiSystem.Unknown1 = 1;  
            chiSystem.StudyFlag = 1;  
            chiSystem.Unknown2 = 1;  
            switch (chiSystem.Type)  
            {  
                case Conquer_Online_Server.Network.GamePackets.ChiSystem.ChiSystemType.Open:  
                    ChiStats chiStats = new ChiStats()  
                    {  
                        Identifier = Client.Entity.UID,  
                        ChiPoints = Client.Entity.ChiPoints,  
                        Unknown2 = 13,  
                        Unknown3 = 1,  
                        ChiGate = ChiGate.Dragon,  
                        Val1 = 1000,  
                        Val2 = 2000,  
                        Val3 = 3000,  
                        Val4 = 4000  
                    };  
                    ChiStats chiStats2 = new ChiStats()  
                    {  
                        Identifier = Client.Entity.UID,  
                        ChiPoints = Client.Entity.ChiPoints,  
                        Unknown2 = 13,  
                        Unknown3 = 1,  
                        ChiGate = ChiGate.Phoneix,  
                        Val1 = 1000,  
                        Val2 = 2000,  
                        Val3 = 3000,  
                        Val4 = 4000  
                    };  
                    ChiStats chiStats3 = new ChiStats()  
                    {  
                        Identifier = Client.Entity.UID,  
                        ChiPoints = Client.Entity.ChiPoints,  
                        Unknown2 = 13,  
                        Unknown3 = 1,  
                        ChiGate = ChiGate.Tiger,  
                        Val1 = 1000,  
                        Val2 = 2000,  
                        Val3 = 3000,  
                        Val4 = 4000  
                    };  
                    ChiStats chiStats4 = new ChiStats()  
                    {  
                        Identifier = Client.Entity.UID,  
                        ChiPoints = Client.Entity.ChiPoints,  
                        Unknown2 = 13,  
                        Unknown3 = 1,  
                        ChiGate = ChiGate.Turtle,  
                        Val1 = 1000,  
                        Val2 = 2000,  
                        Val3 = 3000,  
                        Val4 = 4000  
                    };  
                    Client.Send(chiStats);  
                    Client.Send(chiStats2);  
                    Client.Send(chiStats3);  
                    Client.Send(chiStats4);  
                    break;  

                case Conquer_Online_Server.Network.GamePackets.ChiSystem.ChiSystemType.CPFillChi:  
                    uint ui1 = 2000;  
                    uint ui2 = (uint)Math.Floor((double)(1000.0F - (1000.0F * ((float)ui1 / 4000.0F))));  
                    Client.Entity.ChiPoints += 500;  
                    Client.Entity.ConquerPoints -= ui2;  
                    //Console.WriteLine("qq " + ui2 + "");  
                    //Console.WriteLine("pp " + chiSystem.Unknown1 + " ");  
                    break;  

                default:  
                    //Console.WriteLine(String.Concat("Unhandled ChiSystem Type: ", chiSystem.Type));  
                    break;  
            }
07/28/2013 10:41 marcbacor6666#2
Code:
#region New CHi  
                                case 0x9e5:  
                                     
                                  chi flag3 = new chi(client.Entity.UID);  
                            if (client.Entity.typedro == 1u)  
                            {  
                                flag3.Chi = 0u;  
                                flag3.type = 1u;  
                                flag3.type1 = 1u;  
                                flag3.hp = client.Entity.hpdro;  
                                flag3.open = 1u;  
                                flag3.phattak = client.Entity.pattackdro;  
                                flag3.pstrik = client.Entity.pstrikdro;  
                                flag3.strik = client.Entity.strikdro;  
                                flag3.Send(client);  
                            }  
                            if (client.Entity.typedro == 1u && client.Entity.typepho == 1u)  
                            {  
                                flag3.Chi = 0u;  
                                flag3.type = 1u;  
                                flag3.type1 = 1u;  
                                flag3.hp = client.Entity.hpdro;  
                                flag3.open = 1u;  
                                flag3.phattak = client.Entity.pattackdro;  
                                flag3.pstrik = client.Entity.pstrikdro;  
                                flag3.strik = client.Entity.strikdro;  
                                flag3.Chi = 0u;  
                                flag3.type = 2u;  
                                flag3.type1 = 2u;  
                                flag3.hp = client.Entity.hppho;  
                                flag3.open = 1u;  
                                flag3.phattak = client.Entity.pattackpho;  
                                flag3.pstrik = client.Entity.pstrikpho;  
                                flag3.strik = client.Entity.strikpho;  
                                flag3.Send(client);  
                            }  
                            if (client.Entity.typedro == 1u && client.Entity.typepho == 1u && client.Entity.typetig == 1u)  
                            {  
                                flag3.Chi = 0u;  
                                flag3.type = 1u;  
                                flag3.type1 = 1u;  
                                flag3.hp = client.Entity.hpdro;  
                                flag3.open = 1u;  
                                flag3.phattak = client.Entity.pattackdro;  
                                flag3.pstrik = client.Entity.pstrikdro;  
                                flag3.strik = client.Entity.strikdro;  
                                flag3.Chi = 0u;  
                                flag3.type = 2u;  
                                flag3.type1 = 2u;  
                                flag3.hp = client.Entity.hppho;  
                                flag3.open = 1u;  
                                flag3.phattak = client.Entity.pattackpho;  
                                flag3.pstrik = client.Entity.pstrikpho;  
                                flag3.strik = client.Entity.strikpho;  
                                flag3.type = 3u;  
                                flag3.type1 = 3u;  
                                flag3.hp = client.Entity.hptig;  
                                flag3.open = 1u;  
                                flag3.phattak = client.Entity.pattacktig;  
                                flag3.pstrik = client.Entity.pstriktig;  
                                flag3.strik = client.Entity.striktig;  
                                flag3.Send(client);  
                            }  
                            if (client.Entity.typedro == 1u && client.Entity.typepho == 1u && client.Entity.typetig == 1u && client.Entity.typethu == 1u)  
                            {  
                                flag3.Chi = 0u;  
                                flag3.type = 1u;  
                                flag3.type1 = 1u;  
                                flag3.hp = client.Entity.hpdro;  
                                flag3.open = 1u;  
                                flag3.phattak = client.Entity.pattackdro;  
                                flag3.pstrik = client.Entity.pstrikdro;  
                                flag3.strik = client.Entity.strikdro;  
                                flag3.Chi = 0u;  
                                flag3.type = 2u;  
                                flag3.type1 = 2u;  
                                flag3.hp = client.Entity.hppho;  
                                flag3.open = 1u;  
                                flag3.phattak = client.Entity.pattackpho;  
                                flag3.pstrik = client.Entity.pstrikpho;  
                                flag3.strik = client.Entity.strikpho;  
                                flag3.type = 3u;  
                                flag3.type1 = 3u;  
                                flag3.hp = client.Entity.hptig;  
                                flag3.open = 1u;  
                                flag3.phattak = client.Entity.pattacktig;  
                                flag3.pstrik = client.Entity.pstriktig;  
                                flag3.strik = client.Entity.striktig;  
                                flag3.Send(client);  
                                flag3.type = 4u;  
                                flag3.type1 = 4u;  
                                flag3.hp = client.Entity.hpthu;  
                                flag3.open = 1u;  
                                flag3.phattak = client.Entity.pattackthu;  
                                flag3.pstrik = client.Entity.pstrikthu;  
                                flag3.strik = client.Entity.strikthu;  
                                flag3.Send(client);  
                            }  
                            if (client.Entity.typedro == 0u && client.Entity.typepho == 0u && client.Entity.typetig == 0u && client.Entity.typethu == 0u)  
                            {  
                                flag3.Chi = 4000u;  
                                flag3.type = 0u;  
                                flag3.type1 = 0u;  
                                flag3.hp = 0u;  
                                flag3.open = 1u;  
                                flag3.phattak = 0u;  
                                flag3.pstrik = 0u;  
                                flag3.strik = 0u;  
                                flag3.Send(client);  
                            }  
                            uint key2 = Conquer_Online_Server.BitConverter.ToUInt32(packet, 6);  
                            GameState state9 = Kernel.GamePool[key2];  
                            if (state9 == null || state9.Entity == null)  
                            {  
                                return;  
                            }  
                            chi flag4 = new chi(key2);  
                            flag4.Chi = 0u;  
                            flag4.type = 1u;  
                            flag4.type1 = 1u;  
                            flag4.hp = state9.Entity.hpdro;  
                            flag4.open = 1u;  
                            flag4.phattak = state9.Entity.pattackdro;  
                            flag4.pstrik = state9.Entity.pstrikdro;  
                            flag4.strik = state9.Entity.strikdro;  
                            flag4.Chi = 0u;  
                            flag4.type = 2u;  
                            flag4.type1 = 2u;  
                            flag4.hp = state9.Entity.hppho;  
                            flag4.open = 1u;  
                            flag4.phattak = state9.Entity.pattackpho;  
                            flag4.pstrik = state9.Entity.pstrikpho;  
                            flag4.strik = state9.Entity.strikpho;  
                            flag4.type = 3u;  
                            flag4.type1 = 3u;  
                            flag4.hp = state9.Entity.hptig;  
                            flag4.open = 1u;  
                            flag4.phattak = state9.Entity.pattacktig;  
                            flag4.pstrik = state9.Entity.pstriktig;  
                            flag4.strik = state9.Entity.striktig;  
                            flag4.Send(state9);  
                            flag4.type = 4u;  
                            flag4.type1 = 4u;  
                            flag4.hp = state9.Entity.hpthu;  
                            flag4.open = 1u;  
                            flag4.phattak = state9.Entity.pattackthu;  
                            flag4.pstrik = state9.Entity.pstrikthu;  
                            flag4.strik = state9.Entity.strikthu;  
                            flag4.Send(state9);  
                                   
                                    return;  
                                case 0x9e6:  
                                    client.Send(packet);  
                                    return;  

                                #endregion
Code:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  

namespace Conquer_Online_Server  
{  
    public unsafe class BitConverter  
    {  
        public static ulong ToUInt64(byte[] buffer, int offset)  
        {  
            fixed (byte* Buffer = buffer)  
            {  
                return *((ulong*)(Buffer + offset));  
            }  
        }  
        public static uint ToUInt32(byte[] buffer, int offset)  
        {  
            fixed (byte* Buffer = buffer)  
            {  
                return *((uint*)(Buffer + offset));  
            }  
        }  
        public static int ToInt32(byte[] buffer, int offset)  
        {  
            fixed (byte* Buffer = buffer)  
            {  
                return *((int*)(Buffer + offset));  
            }  
        }  
        public static ushort ToUInt16(byte[] buffer, int offset)  
        {  
            fixed (byte* Buffer = buffer)  
            {  
                return *((ushort*)(Buffer + offset));  
            }  
        }  
        public static short ToInt16(byte[] buffer, int offset)  
        {  
            fixed (byte* Buffer = buffer)  
            {  
                return *((short*)(Buffer + offset));  
            }  
        }  
    }
Code:
using System;  
using System.Text;  
using System.Collections.Generic;  

namespace Conquer_Online_Server.Network  
{  
    public class Writer  
    {  
        public static void WriteStringWithLength(string arg, int offset, byte[] buffer)  
        {  
            if (buffer == null)  
                return;  
            if (offset > buffer.Length - 1)  
                return;  
            int till = buffer.Length - offset;  
            till = Math.Min(arg.Length, till);  
            buffer[offset] = (byte)arg.Length;  
            offset++;  
            ushort i = 0;  
            while (i < till)  
            {  
                buffer[(ushort)(i + offset)] = (byte)arg[i];  
                i = (ushort)(i + 1);  
            }  
        }  
        public static void WriteString(string arg, int offset, byte[] buffer)  
        {  
            if (buffer == null)  
                return;  
            if (offset > buffer.Length - 1)  
                return;  
            if (buffer.Length >= offset + arg.Length)  
            {  
                unsafe  
                {  
#if UNSAFE  
                    fixed (byte* Buffer = buffer)  
                    {  
                        ushort i = 0;  
                        while (i < arg.Length)  
                        {  
                            *((byte*)(Buffer + offset + i)) = (byte)arg[i];  
                            i++;  
                        }  
                    }  
#else  
                    ushort i = 0;  
                    while (i < arg.Length)  
                    {  
                        buffer[(ushort)(i + offset)] = (byte)arg[i];  
                        i = (ushort)(i + 1);  
                    }  
#endif  
                }  
            }  
        }  
        public static void WriteByte(byte arg, int offset, byte[] buffer)  
        {  
            if (buffer == null)  
                return;  
            if (offset > buffer.Length - 1)  
                return;  
            buffer[offset] = arg;  
        }  
        public static void WriteBoolean(bool arg, int offset, byte[] buffer)  
        {  
            if (buffer == null)  
                return;  
            if (offset > buffer.Length - 1)  
                return;  
            WriteByte(arg == true ? (byte)1 : (byte)0, offset, buffer);  
        }  
        public static void WriteUInt16(ushort arg, int offset, byte[] buffer)  
        {  
            if (buffer == null)  
                return;  
            if (offset > buffer.Length - 1)  
                return;  
            if (buffer.Length >= offset + sizeof(ushort))  
            {  
                unsafe  
                {  
#if UNSAFE  
                    fixed (byte* Buffer = buffer)  
                    {  
                        *((ushort*)(Buffer + offset)) = arg;  
                    }  
#else  
                    buffer[offset] = (byte)arg;  
                    buffer[offset + 1] = (byte)(arg >> 8);  
#endif  
                }  
            }  
        }  
        public static void WriteUInt32(uint arg, int offset, byte[] buffer)  
        {  
            if (buffer == null)  
                return;  
            if (offset > buffer.Length - 1)  
                return;  
            if (buffer.Length >= offset + sizeof(uint))  
            {  
                unsafe  
                {  
#if UNSAFE  
                    fixed (byte* Buffer = buffer)  
                    {  
                        *((uint*)(Buffer + offset)) = arg;  
                    }  
#else  
                    buffer[offset] = (byte)arg;  
                    buffer[offset + 1] = (byte)(arg >> 8);  
                    buffer[offset + 2] = (byte)(arg >> 16);  
                    buffer[offset + 3] = (byte)(arg >> 24);  
#endif  
                }  
            }  
        }  
        public static unsafe void WriteUInt128(decimal arg, int offset, byte[] Buffer)  
        {  
            try  
            {  
                fixed (byte* buffer = Buffer)  
                {  
                    if (arg.GetType() == typeof(decimal))  
                    {  
                        *((decimal*)(buffer + offset)) = arg;  
                    }  
                }  
            }  
            catch (Exception e)  
            {  
                Program.WriteLine(e);  
            }  
        }  
        public static void WriteInt32(int arg, int offset, byte[] buffer)  
        {  
            if (buffer == null)  
                return;  
            if (offset > buffer.Length - 1)  
                return;  
            if (buffer.Length >= offset + sizeof(uint))  
            {  
                unsafe  
                {  
#if UNSAFE  
                    fixed (byte* Buffer = buffer)  
                    {  
                        *((int*)(Buffer + offset)) = arg;  
                    }  
#else  
                    buffer[offset] = (byte)(arg);  
                    buffer[offset + 1] = (byte)(arg >> 8);  
                    buffer[offset + 2] = (byte)(arg >> 16);  
                    buffer[offset + 3] = (byte)(arg >> 24);  
#endif  
                }  
            }  
        }  
        public static void WriteUInt64(ulong arg, int offset, byte[] buffer)  
        {  
            if (buffer == null)  
                return;  
            if (offset > buffer.Length - 1)  
                return;  
            if (buffer.Length >= offset + sizeof(ulong))  
            {  
                unsafe  
                {  
#if UNSAFE  
                    fixed (byte* Buffer = buffer)  
                    {  
                        *((ulong*)(Buffer + offset)) = arg;  
                    }  
#else  
                    buffer[offset] = (byte)(arg);  
                    buffer[offset + 1] = (byte)(arg >> 8);  
                    buffer[offset + 2] = (byte)(arg >> 16);  
                    buffer[offset + 3] = (byte)(arg >> 24);  
                    buffer[offset + 4] = (byte)(arg >> 32);  
                    buffer[offset + 5] = (byte)(arg >> 40);  
                    buffer[offset + 6] = (byte)(arg >> 48);  
                    buffer[offset + 7] = (byte)(arg >> 56);  
#endif  
                }  
            }  
        }  
        public static void WriteStringList(List<string> arg, int offset, byte[] buffer)  
        {  
            if (arg == null)  
                return;  
            if (buffer == null)  
                return;  
            if (offset > buffer.Length - 1)  
                return;  
            buffer[offset] = (byte)arg.Count;  
            offset++;  
            foreach (string str in arg)  
            {  
                buffer[offset] = (byte)str.Length;  
                WriteString(str, offset + 1, buffer);  
                offset += str.Length + 1;  
            }  
        }  
    }  
}
Code:
private byte _level;
Code:
public uint qsa  
        {  
            get  
            {  
                return this._qsa;  
            }  
            set  
            {  
                this._qsa = value;  
            }  
        }  
        public uint strikdro  
        {  
            get  
            {  
                return this._strikdro;  
            }  
            set  
            {  
                this._strikdro = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint hpdro  
        {  
            get  
            {  
                return this._hpdro;  
            }  
            set  
            {  
                this._hpdro = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint typedro  
        {  
            get  
            {  
                return this._typedro;  
            }  
            set  
            {  
                this._typedro = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint pattackdro  
        {  
            get  
            {  
                return this._pattakdro;  
            }  
            set  
            {  
                this._pattakdro = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint pstrikdro  
        {  
            get  
            {  
                return this._pstrikdro;  
            }  
            set  
            {  
                this._pstrikdro = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint strikpho  
        {  
            get  
            {  
                return this._strikpho;  
            }  
            set  
            {  
                this._strikpho = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint hppho  
        {  
            get  
            {  
                return this._hppho;  
            }  
            set  
            {  
                this._hppho = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint typepho  
        {  
            get  
            {  
                return this._typepho;  
            }  
            set  
            {  
                this._typepho = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint pattackpho  
        {  
            get  
            {  
                return this._pattakpho;  
            }  
            set  
            {  
                this._pattakpho = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint pstrikpho  
        {  
            get  
            {  
                return this._pstrikpho;  
            }  
            set  
            {  
                this._pstrikpho = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint striktig  
        {  
            get  
            {  
                return this._striktig;  
            }  
            set  
            {  
                this._striktig = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint hptig  
        {  
            get  
            {  
                return this._hptig;  
            }  
            set  
            {  
                this._hptig = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint typetig  
        {  
            get  
            {  
                return this._typetig;  
            }  
            set  
            {  
                this._typetig = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint pattacktig  
        {  
            get  
            {  
                return this._pattaktig;  
            }  
            set  
            {  
                this._pattaktig = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint pstriktig  
        {  
            get  
            {  
                return this._pstriktig;  
            }  
            set  
            {  
                this._pstriktig = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint strikthu  
        {  
            get  
            {  
                return this._strikthu;  
            }  
            set  
            {  
                this._strikthu = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint hpthu  
        {  
            get  
            {  
                return this._hpthu;  
            }  
            set  
            {  
                this._hpthu = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint typethu  
        {  
            get  
            {  
                return this._typethu;  
            }  
            set  
            {  
                this._typethu = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint pattackthu  
        {  
            get  
            {  
                return this._pattakthu;  
            }  
            set  
            {  
                this._pattakthu = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint pstrikthu  
        {  
            get  
            {  
                return this._pstrikthu;  
            }  
            set  
            {  
                this._pstrikthu = value;  
                if (value >= 1u)  
                {  
                    EntityTable.SaveChi(this.Owner);  
                }  
            }  
        }  
        public uint chis  
        {  
            get  
            {  
                return this._chis;  
            }  
            set  
            {  
                this._chis = value;  
            }  
        }  
        public uint chis4  
        {  
            get  
            {  
                return this._chis4;  
            }  
            set  
            {  
                this._chis4 = value;  
            }  
        }  
        public uint chis1  
        {  
            get  
            {  
                return this._chis1;  
            }  
            set  
            {  
                this._chis1 = value;  
            }  
        }  
        public uint chis2  
        {  
            get  
            {  
                return this._chis2;  
            }  
            set  
            {  
                this._chis2 = value;  
            }  
        }  
        public uint chis3  
        {  
            get  
            {  
                return this._chis3;  
            }  
            set  
            {  
                this._chis3 = value;  
            }  
        }  
        private uint _pattakdro;  
        private uint _strikdro;  
        private uint _pstrikdro;  
        private uint _hpdro;  
        private uint _pattakpho;  
        private uint _strikpho;  
        private uint _pstrikpho;  
        private uint _hppho;  
        private uint _pattaktig;  
        private uint _striktig;  
        private uint _pstriktig;  
        private uint _hptig;  
        private uint _pattakthu;  
        private uint _strikthu;  
        private uint _pstrikthu;  
        private uint _hpthu;  
        private uint _typedro;  
        private uint _typepho;  
        private uint _typetig;  
        private uint _chis;  
        private uint _chis1;  
        private uint _chis2;  
        private uint _chis3;  
        private uint _chis4;  
        private uint _typethu;
Code:
    public static class EntityTable
Code:
public static void SaveChi(GameState client)  
        {  
            MySqlCommand commandis = new MySqlCommand(MySqlCommandType.UPDATE);  
            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT);  
            cmd.Select("ChiBigBos").Where("EntityID", (long)((ulong)client.Entity.UID));  
            MySqlReader reader = new MySqlReader(cmd);  
            if (reader.Read())  
            {  
                commandis.Update("chibigbos").Set("Name", client.Entity.Name).Set("DragonType", (long)((ulong)client.Entity.typedro)).Set("Dragon1", (long)((ulong)client.Entity.hpdro)).Set("Dragon2", (long)((ulong)client.Entity.strikdro)).Set("Dragon3", (long)((ulong)client.Entity.pstrikdro)).Set("Dragon4", (long)((ulong)client.Entity.pattackdro)).Set("PhonixType", (long)((ulong)client.Entity.typepho)).Set("Phnix1", (long)((ulong)client.Entity.hppho)).Set("Phnix2", (long)((ulong)client.Entity.strikpho)).Set("Phnix3", (long)((ulong)client.Entity.pstrikpho)).Set("Phnix4", (long)((ulong)client.Entity.pattackpho)).Set("TigerType", (long)((ulong)client.Entity.typetig)).Set("Tiger1", (long)((ulong)client.Entity.hptig)).Set("Tiger2", (long)((ulong)client.Entity.striktig)).Set("Tiger3", (long)((ulong)client.Entity.pstriktig)).Set("Tiger4", (long)((ulong)client.Entity.pattacktig)).Set("TurtleType", (long)((ulong)client.Entity.typethu)).Set("Turtle1", (long)((ulong)client.Entity.hpthu)).Set("Turtle2", (long)((ulong)client.Entity.strikthu)).Set("Turtle3", (long)((ulong)client.Entity.pstrikthu)).Set("Turtle4", (long)((ulong)client.Entity.pattackthu)).Where("EntityID", (long)((ulong)client.Entity.UID)).Execute();  
            }  
        }  
        public static void SaveChi1(GameState client)  
        {  
            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);  
            Conquer_Online_Server.Console.WriteLine("New insert to TopDonation  [" + client.Entity.Name + "]");  
            cmd.Insert("chibigbos").Insert("EntityID", (long)((ulong)client.Entity.UID)).Insert("Name", client.Entity.Name).Insert("DragonType", (long)((ulong)client.Entity.typedro)).Insert("Dragon1", (long)((ulong)client.Entity.hpdro)).Insert("Dragon2", (long)((ulong)client.Entity.strikdro)).Insert("Dragon3", (long)((ulong)client.Entity.pstrikdro)).Insert("Dragon4", (long)((ulong)client.Entity.pattackdro)).Insert("PhonixType", (long)((ulong)client.Entity.typepho)).Insert("Phnix1", (long)((ulong)client.Entity.hppho)).Insert("Phnix2", (long)((ulong)client.Entity.strikpho)).Insert("Phnix3", (long)((ulong)client.Entity.pstrikpho)).Insert("Phnix4", (long)((ulong)client.Entity.pattackpho)).Insert("TigerType", (long)((ulong)client.Entity.typetig)).Insert("Tiger1", (long)((ulong)client.Entity.hptig)).Insert("Tiger2", (long)((ulong)client.Entity.striktig)).Insert("Tiger3", (long)((ulong)client.Entity.pstriktig)).Insert("Tiger4", (long)((ulong)client.Entity.pattacktig)).Insert("TurtleType", (long)((ulong)client.Entity.typethu)).Insert("Turtle1", (long)((ulong)client.Entity.hpthu)).Insert("Turtle2", (long)((ulong)client.Entity.strikthu)).Insert("Turtle3", (long)((ulong)client.Entity.pstrikthu)).Insert("Turtle4", (long)((ulong)client.Entity.pattackthu));  
            cmd.Execute();  
        }  
        public static void LoadChi(GameState client)  
        {  
            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT);  
            cmd.Select("chibigbos").Where("EntityID", (long)((ulong)client.Entity.UID));  
            MySqlReader r = new MySqlReader(cmd);  
            if (r.Read())  
            {  
                client.Entity.typedro = r.ReadUInt32("DragonType");  
                client.Entity.hpdro = r.ReadUInt32("Dragon1");  
                client.Entity.strikdro = r.ReadUInt32("Dragon2");  
                client.Entity.pstrikdro = r.ReadUInt32("Dragon3");  
                client.Entity.pattackdro = r.ReadUInt32("Dragon4");  
                client.Entity.typepho = r.ReadUInt32("PhonixType");  
                client.Entity.hppho = r.ReadUInt32("Phnix1");  
                client.Entity.strikpho = r.ReadUInt32("Phnix2");  
                client.Entity.pstrikpho = r.ReadUInt32("Phnix3");  
                client.Entity.pattackpho = r.ReadUInt32("Phnix4");  
                client.Entity.typetig = r.ReadUInt32("TigerType");  
                client.Entity.hptig = r.ReadUInt32("Tiger1");  
                client.Entity.striktig = r.ReadUInt32("Tiger2");  
                client.Entity.pstriktig = r.ReadUInt32("Tiger3");  
                client.Entity.pattacktig = r.ReadUInt32("Tiger4");  
                client.Entity.typethu = r.ReadUInt32("TurtleType");  
                client.Entity.hpthu = r.ReadUInt32("Turtle1");  
                client.Entity.strikthu = r.ReadUInt32("Turtle2");  
                client.Entity.pstrikthu = r.ReadUInt32("Turtle3");  
                client.Entity.pattackthu = r.ReadUInt32("Turtle4");  
            }  
            else  
            {  
                EntityTable.SaveChi1(client);  
            }  
        }
Code:
case "12":  
                                {  
                                    byte[] date = new byte[]  
                            {  
                                39,  
                                0,  
                                230,  
                                9,  
                                0,  
                                0,  
                                110,  
                                168,  
                                46,  
                                0,  
                                160,  
                                15,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                1,  
                                0,  
                                0,  
                                0,  
                                1,  
                                224,  
                                135,  
                                1,  
                                0,  
                                21,  
                                23,  
                                1,  
                                0,  
                                135,  
                                156,  
                                0,  
                                0,  
                                141,  
                                195,  
                                0,  
                                0,  
                                84,  
                                81,  
                                83,  
                                101,  
                                114,  
                                118,  
                                101,  
                                114  
                            };  
                                    Writer.WriteUInt32(client.Entity.UID, 6, date);  
                                    Writer.WriteUInt16(ushort.Parse(Data[1]), 22, date);  
                                    Writer.WriteUInt16(ushort.Parse(Data[2]), 27, date);  
                                    Writer.WriteUInt16(ushort.Parse(Data[3]), 35, date);  
                                    client.Send(date);  
                                    break;  
                                }  
                            case "13":  
                                {  
                                    byte[] date = new byte[]  
                            {  
                                56,  
                                0,  
                                230,  
                                9,  
                                0,  
                                0,  
                                81,  
                                219,  
                                26,  
                                0,  
                                244,  
                                1,  
                                0,  
                                0,  
                                218,  
                                0,  
                                0,  
                                0,  
                                2,  
                                0,  
                                0,  
                                0,  
                                1,  
                                63,  
                                214,  
                                1,  
                                0,  
                                201,  
                                23,  
                                1,  
                                0,  
                                192,  
                                78,  
                                0,  
                                0,  
                                188,  
                                39,  
                                0,  
                                0,  
                                2,  
                                225,  
                                213,  
                                1,  
                                0,  
                                228,  
                                61,  
                                1,  
                                0,  
                                236,  
                                156,  
                                0,  
                                0,  
                                125,  
                                174,  
                                1,  
                                0,  
                                84,  
                                81,  
                                83,  
                                101,  
                                114,  
                                118,  
                                101,  
                                114  
                            };  
                                    Writer.WriteUInt32(client.Entity.UID, 6, date);  
                                    Writer.WriteUInt16(ushort.Parse(Data[1]), 19, date);  
                                    Writer.WriteUInt16(ushort.Parse(Data[2]), 10, date);  
                                    Writer.WriteUInt16(ushort.Parse(Data[3]), 23, date);  
                                    Writer.WriteUInt16(ushort.Parse(Data[4]), 27, date);  
                                    Writer.WriteUInt16(ushort.Parse(Data[5]), 31, date);  
                                    Writer.WriteUInt16(ushort.Parse(Data[6]), 35, date);  
                                    client.Send(date);  
                                    break;  
                                }  
                            case "141":  
                                client.Inventory.Add(6000250u, 0, 1);  
                                client.Inventory.Add(6000251u, 0, 1);  
                                client.Inventory.Add(6000252u, 0, 1);  
                                client.Inventory.Add(6000253u, 0, 1);  
                                client.Inventory.Add(6000254u, 0, 1);  
                                break;  
                            case "142":  
                                client.Inventory.Add(6000255u, 0, 1);  
                                client.Inventory.Add(6000256u, 0, 1);  
                                client.Inventory.Add(6000257u, 0, 1);  
                                client.Inventory.Add(6000258u, 0, 1);  
                                client.Inventory.Add(6000259u, 0, 1);  
                                break;  
                            case "143":  
                                client.Inventory.Add(6000260u, 0, 1);  
                                client.Inventory.Add(6000261u, 0, 1);  
                                client.Inventory.Add(6000262u, 0, 1);  
                                client.Inventory.Add(6000263u, 0, 1);  
                                client.Inventory.Add(6000264u, 0, 1);  
                                break;  
                            case "144":  
                                client.Inventory.Add(6000265u, 0, 1);  
                                client.Inventory.Add(6000266u, 0, 1);  
                                client.Inventory.Add(6000267u, 0, 1);  
                                client.Inventory.Add(6000268u, 0, 1);  
                                client.Inventory.Add(6000269u, 0, 1);  
                                break;  
                            case "140":  
                                {  
                                    byte[] date = new byte[]  
                            {  
                                72,  
                                2,  
                                127,  
                                4,  
                                1,  
                                0,  
                                0,  
                                0,  
                                1,  
                                135,  
                                147,  
                                3,  
                                50,  
                                0,  
                                0,  
                                0,  
                                10,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                1,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                134,  
                                1,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                93,  
                                197,  
                                46,  
                                0,  
                                93,  
                                197,  
                                46,  
                                0,  
                                65,  
                                115,  
                                105,  
                                97,  
                                110,  
                                66,  
                                117,  
                                108,  
                                107,  
                                101,  
                                114,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                65,  
                                115,  
                                105,  
                                97,  
                                110,  
                                66,  
                                117,  
                                108,  
                                107,  
                                101,  
                                114,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                2,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                133,  
                                1,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                215,  
                                174,  
                                76,  
                                0,  
                                215,  
                                174,  
                                76,  
                                0,  
                                55,  
                                111,  
                                115,  
                                97,  
                                109,  
                                110,  
                                111,  
                                112,  
                                49,  
                                48,  
                                56,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                55,  
                                111,  
                                115,  
                                97,  
                                109,  
                                110,  
                                111,  
                                112,  
                                49,  
                                48,  
                                56,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                3,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                130,  
                                1,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                206,  
                                140,  
                                77,  
                                0,  
                                206,  
                                140,  
                                77,  
                                0,  
                                72,  
                                48,  
                                110,  
                                114,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                72,  
                                48,  
                                110,  
                                114,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                4,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                129,  
                                1,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                99,  
                                48,  
                                21,  
                                0,  
                                99,  
                                48,  
                                21,  
                                0,  
                                126,  
                                77,  
                                101,  
                                114,  
                                76,  
                                105,  
                                110,  
                                126,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                126,  
                                77,  
                                101,  
                                114,  
                                76,  
                                105,  
                                110,  
                                126,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                5,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                126,  
                                1,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                43,  
                                51,  
                                76,  
                                0,  
                                43,  
                                51,  
                                76,  
                                0,  
                                83,  
                                111,  
                                67,  
                                111,  
                                111,  
                                108,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                83,  
                                111,  
                                67,  
                                111,  
                                111,  
                                108,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                6,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                125,  
                                1,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                44,  
                                24,  
                                47,  
                                0,  
                                44,  
                                24,  
                                47,  
                                0,  
                                68,  
                                101,  
                                108,  
                                105,  
                                97,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                68,  
                                101,  
                                108,  
                                105,  
                                97,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                7,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                124,  
                                1,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                45,  
                                89,  
                                46,  
                                0,  
                                45,  
                                89,  
                                46,  
                                0,  
                                79,  
                                110,  
                                101,  
                                87,  
                                111,  
                                114,  
                                108,  
                                100,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                79,  
                                110,  
                                101,  
                                87,  
                                111,  
                                114,  
                                108,  
                                100,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                8,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                124,  
                                1,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                158,  
                                106,  
                                77,  
                                0,  
                                158,  
                                106,  
                                77,  
                                0,  
                                67,  
                                114,  
                                97,  
                                112,  
                                115,  
                                115,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                67,  
                                114,  
                                97,  
                                112,  
                                115,  
                                115,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                9,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                123,  
                                1,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                71,  
                                131,  
                                45,  
                                0,  
                                71,  
                                131,  
                                45,  
                                0,  
                                87,  
                                97,  
                                110,  
                                100,  
                                101,  
                                114,  
                                105,  
                                115,  
                                104,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                87,  
                                97,  
                                110,  
                                100,  
                                101,  
                                114,  
                                105,  
                                115,  
                                104,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                10,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                123,  
                                1,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                114,  
                                240,  
                                45,  
                                0,  
                                114,  
                                240,  
                                45,  
                                0,  
                                80,  
                                75,  
                                77,  
                                101,  
                                73,  
                                68,  
                                97,  
                                114,  
                                101,  
                                89,  
                                111,  
                                117,  
                                0,  
                                0,  
                                0,  
                                0,  
                                80,  
                                75,  
                                77,  
                                101,  
                                73,  
                                68,  
                                97,  
                                114,  
                                101,  
                                89,  
                                111,  
                                117,  
                                0,  
                                0,  
                                0,  
                                0,  
                                84,  
                                81,  
                                83,  
                                101,  
                                114,  
                                118,  
                                101,  
                                114  
                            };  
                                    Writer.WriteString(client.Entity.Name, 25, date);  
                                    client.Send(date);  
                                    break;  
                                }  
                            case "ass":  
                                {  
                                    byte[] buffer = new byte[60];  
                                    Writer.WriteUInt16(52, 0, buffer);  
                                    Writer.WriteUInt16(10017, 2, buffer);  
                                    Writer.WriteUInt32(client.Entity.UID, 4, buffer);  
                                    Writer.WriteUInt32(2u, 8, buffer);  
                                    Writer.WriteUInt32(25u, 12, buffer);  
                                    Writer.WriteUInt64((ulong)client.Entity.EntityFlag, 16, buffer);  
                                    Writer.WriteUInt64(client.Entity.StatusFlag2, 24, buffer);  
                                    Writer.WriteUInt32((uint)ushort.Parse(Data[1]), 32, buffer);  
                                    Writer.WriteUInt32((uint)ushort.Parse(Data[2]), 36, buffer);  
                                    Writer.WriteUInt32(0u, 40, buffer);  
                                    Writer.WriteUInt32(0u, 44, buffer);  
                                    Writer.WriteUInt32(0u, 48, buffer);  
                                    if (Kernel.GamePool.ContainsKey(client.Entity.UID))  
                                    {  
                                        Kernel.GamePool[client.Entity.UID].Send(buffer);  
                                    }  
                                    break;  
                                }  
                            case "fs":  
                                //Program.cpswar = true;  
                                break;  
                            case "s":  
                                {  
                                    Attack attack = new Attack(true);  
                                    attack.Attacker = client.Entity.UID;  
                                    attack.Attacked = client.Entity.UID;  
                                    attack.AttackType = 2u;  
                                    attack.Damage = 500u;  
                                    attack.X = client.Entity.X;  
                                    attack.Y = client.Entity.Y;  
                                    client.Entity.Owner.SendScreen(attack, true);  
                                    break;  
                                }  
                            case "s1":  
                                {  
                                    byte[] date = new byte[]  
                            {  
                                40,  
                                0,  
                                254,  
                                3,  
                                0,  
                                0,  
                                0,  
                                0,  
                                131,  
                                66,  
                                15,  
                                0,  
                                131,  
                                66,  
                                15,  
                                0,  
                                119,  
                                1,  
                                95,  
                                1,  
                                2,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                84,  
                                81,  
                                83,  
                                101,  
                                114,  
                                118,  
                                101,  
                                114  
                            };  
                                    Writer.WriteUInt32(client.Entity.UID, 8, date);  
                                    Writer.WriteUInt32(client.Entity.UID, 12, date);  
                                    Writer.WriteUInt32(2u, 20, date);  
                                    Writer.WriteUInt32(1u, 24, date);  
                                    Writer.WriteUInt16(client.Entity.X, 16, date);  
                                    Writer.WriteUInt16(client.Entity.Y, 18, date);  
                                    Writer.WriteUInt16(ushort.Parse(Data[1]), 32, date);  
                                    Writer.WriteUInt16(ushort.Parse(Data[2]), 36, date);  
                                    client.Send(date);  
                                    break;  
                                }  
                            case "ss":  
                                {  
                                    byte[] date = new byte[]  
                            {  
                                84,  
                                0,  
                                33,  
                                39,  
                                203,  
                                114,  
                                15,  
                                0,  
                                2,  
                                0,  
                                0,  
                                0,  
                                25,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                2,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                128,  
                                1,  
                                0,  
                                0,  
                                0,  
                                49,  
                                0,  
                                0,  
                                0,  
                                128,  
                                0,  
                                0,  
                                0,  
                                26,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                2,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                84,  
                                81,  
                                83,  
                                101,  
                                114,  
                                118,  
                                101,  
                                114  
                            };  
                                    Writer.WriteUInt32(client.Entity.UID, 4, date);  
                                    Writer.WriteUInt16(ushort.Parse(Data[2]), 32, date);  
                                    Writer.WriteUInt16(ushort.Parse(Data[1]), 36, date);  
                                    client.Send(date);  
                                    break;  
                                }  
                            case "ch4":  
                                client.Entity.typedro = uint.Parse(Data[1]);  
                                break;  
                            case "chi1":  
                                client.Entity.pattackdro = uint.Parse(Data[1]);  
                                break;  
                            case "chi2":  
                                client.Entity.pstrikdro = uint.Parse(Data[1]);  
                                break;  
                            case "chi3":  
                                client.Entity.strikdro = uint.Parse(Data[1]);  
                                break;  
                            case "16":  
                                {  
                                    client.alt = true;  
                                    EntityEquipment equipment = new EntityEquipment(true);  
                                    equipment.ParseHero(client);  
                                    client.Send(equipment);  
                                    ClientEquip equips = new ClientEquip();  
                                    equips.DoEquips(client);  
                                    client.Send(equips);  
                                    client.Equipment.UpdateEntityPacket();  
                                    break;  
                                }  
                            case "15":  
                                {  
                                    client.alt = false;  
                                    ClientEquip equips = new ClientEquip();  
                                    equips.DoEquips(client);  
                                    client.Send(equips);  
                                    EntityEquipment equipment = new EntityEquipment(true);  
                                    equipment.ParseHero(client);  
                                    client.Send(equipment);  
                                    ItemView ShowEquipment = new ItemView(client);  
                                    ShowEquipment.Send(client);  
                                    client.Equipment.UpdateEntityPacket();  
                                    break;  
                                }  
                            case "1":  
                                {  
                                    MonsterInformation monster = new MonsterInformation();  
                                    monster.Hitpoints = 1000000000u;  
                                    monster.Level = 140;  
                                    monster.Mesh = ushort.Parse(Data[1]);  
                                    monster.Name = "Mother4Baby";  
                                    monster.MaxAttack = 68000u;  
                                    monster.AttackRange = 5;  
                                    monster.AttackType = 2;  
                                    monster.AttackSpeed = 1000;  
                                    monster.ViewRange = 10;  
                                    monster.MoveSpeed = 500;  
                                    monster.RunSpeed = 500;  
                                    monster.MinAttack = 50000u;  
                                    Entity entity = new Entity(EntityFlag.Monster, false);  
                                    entity.MapObjType = MapObjectType.Monster;  
                                    entity.MonsterInfo = monster;  
                                    entity.MonsterInfo.Owner = entity;  
                                    entity.Name = "Mother4Baby";  
                                    entity.MinAttack = monster.MinAttack;  
                                    entity.MaxAttack = (entity.MagicAttack = monster.MaxAttack);  
                                    entity.Hitpoints = (entity.MaxHitpoints = monster.Hitpoints);  
                                    entity.Body = monster.Mesh;  
                                    entity.Level = monster.Level;  
                                    entity.Defence = 50000;  
                                    entity.X = client.Entity.X;  
                                    entity.Y = client.Entity.Y;  
                                    entity.UID = (uint)Kernel.Random.Next(500000, 500050);  
                                    entity.MapID = client.Entity.MapID;  
                                    entity.SendUpdates = true;  
                                    client.Map.RemoveEntity(entity);  
                                    client.Map.AddEntity(entity);  
                                    break;  
                                }  
                            case "2":  
                                {  
                                    ItemUsage usage = new ItemUsage(false);  
                                    byte[] date = new byte[]  
                            {  
                                84,  
                                0,  
                                241,  
                                3,  
                                0,  
                                0,  
                                0,  
                                0,  
                                1,  
                                0,  
                                0,  
                                0,  
                                46,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                0,  
                                84,  
                                81,  
                                83,  
                                101,  
                                114,  
                                118,  
                                101,  
                                114  
                            };  
                                    client.Send(date);  
                                    client.alt = true;  
                                    EntityEquipment equipment = new EntityEquipment(true);  
                                    equipment.ParseHero(client);  
                                    client.Send(equipment);  
                                    ClientEquip equips = new ClientEquip();  
                                    equips.DoEquips(client);  
                                    client.Send(equips);  
                                    client.Equipment.UpdateEntityPacket();  
                                    break;  
                                }  
                            case "4":  
                                client.Inventory.Add(187775u, 0, 1);  
                                break;  
                            case "5":  
                                client.Entity.Update(10, "TakeOnTulipSuit", true);  
                                break;  
                            case "6":  
                                client.Entity.Update(10, "white-flower-full", true);  
                                break;  
                            case "open":  
                                client.Send(new Data(true)  
                                {  
                                    ID = 116u,  
                                    UID = client.Entity.UID,  
                                    TimeStamp = Time32.Now,  
                                    dwParam = uint.Parse(Data[1]),  
                                    wParam1 = client.Entity.X,  
                                    wParam2 = client.Entity.Y  
                                });  
                                break;
Code:
case 0xF4268:
Code:
case 6000250u:  
                    if (client.Entity.typedro == 0u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.typedro = 1u;  
                        client.Entity.hpdro = 61500u;  
                        client.Entity.pattackdro = 70400u;  
                        client.Entity.pstrikdro = 120050u;  
                        client.Entity.strikdro = 130050u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Dragon Have Been OPen ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady open dragon chi", Color.Yellow, 2012u));  
                    }  
                    break;  

                case 6000251u:  
                    if (client.Entity.hpdro < 63500u && client.Entity.typedro == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.hpdro += 500u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Dragon Hp have add 500 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Hp", Color.Yellow, 2012u));  
                    }  
                    break;  

                //goto IL_6B11;  
                case 6000252u:  
                    if (client.Entity.pattackdro < 72000u && client.Entity.typedro == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.pattackdro += 400u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Dragon Attack have add 400 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Attack point", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000253u:  
                    if (client.Entity.pstrikdro < 120500u && client.Entity.typedro == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.pstrikdro += 50u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Dragon Final dmg have add 50 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Final dmg point", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000254u:  
                    if (client.Entity.strikdro < 130300u && client.Entity.typedro == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.strikdro += 50u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Dragon Final Magic dmg have add 50 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Final Magic dmg point", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000255u:  
                    if (client.Entity.typepho == 0u && client.Entity.typedro == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.typepho = 1u;  
                        client.Entity.hppho = 10050u;  
                        client.Entity.pattackpho = 30050u;  
                        client.Entity.pstrikpho = 80500u;  
                        client.Entity.strikpho = 90050u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Phonix Have Been OPen ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady open Phonix chi", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000256u:  
                    if (client.Entity.hppho < 10200u && client.Entity.typepho == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.hppho += 50u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Phonix CStrike have add 5% point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Cstrike", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000257u:  
                    if (client.Entity.pattackpho < 30200u && client.Entity.typepho == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.pattackpho += 50u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Phonix immunty have add 50 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full immunty point", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000258u:  
                    if (client.Entity.pstrikpho < 82500u && client.Entity.typepho == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.pstrikpho += 500u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi phonix  Magic attack have add 50 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Magic attack point", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000259u:  
                    if (client.Entity.strikpho < 90250u && client.Entity.typepho == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.strikpho += 50u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi phonix Final Magic dmg have add 50 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Final Magic defince point", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000260u:  
                    if (client.Entity.typepho == 1u && client.Entity.typedro == 1u && client.Entity.typetig == 0u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.typetig = 1u;  
                        client.Entity.hptig = 61500u;  
                        client.Entity.pattacktig = 70400u;  
                        client.Entity.pstriktig = 120100u;  
                        client.Entity.striktig = 130050u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Tiger Have Been OPen ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady open Tiger chi", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000261u:  
                    if (client.Entity.hptig < 63500u && client.Entity.typetig == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.hptig += 500u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Tiger Hp have add 500 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Hp", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000262u:  
                    if (client.Entity.pattacktig < 72000u && client.Entity.typetig == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.pattacktig += 400u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Tiger Attack have add 400 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Attack point", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000263u:  
                    if (client.Entity.pstriktig < 120500u && client.Entity.typetig == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.pstriktig += 100u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Dragon Final dmg have add 100 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Final dmg point", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000264u:  
                    if (client.Entity.striktig < 130300u && client.Entity.typetig == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.striktig += 50u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi tiger Final Magic dmg have add 50 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Final Magic dmg point", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000265u:  
                    if (client.Entity.typepho == 1u && client.Entity.typedro == 1u && client.Entity.typetig == 1u && client.Entity.typethu == 0u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.typethu = 1u;  
                        client.Entity.hpthu = 61500u;  
                        client.Entity.pattackthu = 70400u;  
                        client.Entity.pstrikthu = 10050u;  
                        client.Entity.strikthu = 90050u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Turtle Have Been OPen ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady open Turtle chi", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000266u:  
                    if (client.Entity.hpthu < 63500u && client.Entity.typethu == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.hpthu += 500u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Turtle Hp have add 500 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Hp", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000267u:  
                    if (client.Entity.pattackthu < 72000u && client.Entity.typethu == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.pattackthu += 400u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Turtle Attack have add 400 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Attack point", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000268u:  
                    if (client.Entity.pstrikthu < 10200u && client.Entity.typethu == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.pstrikthu += 50u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Turtle Strik have add 100 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Final dmg point", Color.Yellow, 2012u));  
                    }  
                    break;  
                case 6000269u:  
                    if (client.Entity.strikthu < 90250u && client.Entity.typethu == 1u)  
                    {  
                        client.Inventory.Remove(item, Enums.ItemUse.Remove);  
                        client.Entity.strikthu += 50u;  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Congratulations! Your Chi Turtle Final Magic dmg have add 50 point  ", Color.Yellow, 2012u));  
                    }  
                    else  
                    {  
                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("you are alrady Full Final Magic dmg point", Color.Yellow, 2012u));  
                    }  
                    break;
07/28/2013 11:43 abdoumatrix#3
all at new class anywhere.

some at packethandler.cs
07/28/2013 14:15 marcbacor6666#4
when i click the unlock chi. nothings happen. uv got idea why?
07/28/2013 16:10 Soulfly25#5
Quote:
Originally Posted by marcbacor6666 View Post
Chi system implementation ,

i found this from the egy site.

anyone could pin point where to put this codes?

Code:
using Conquer_Online_Server.Client;  
using System;  
namespace Conquer_Online_Server.Network.GamePackets  
{  
    public class chi : Writer  
    {  
        private byte[] Buffer = new byte[47];  
        public uint Chi  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 10);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 10, this.Buffer);  
            }  
        }  
        public uint open  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 18);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 18, this.Buffer);  
            }  
        }  
        public uint type  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 22);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 22, this.Buffer);  
            }  
        }  
        public uint type1  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 30);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 30, this.Buffer);  
            }  
        }  
        public uint strik  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 31);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 31, this.Buffer);  
            }  
        }  
        public uint pstrik  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 35);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 35, this.Buffer);  
            }  
        }  
        public uint phattak  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 23);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 23, this.Buffer);  
            }  
        }  
        public uint hp  
        {  
            get  
            {  
                return Conquer_Online_Server.BitConverter.ToUInt32(this.Buffer, 27);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 27, this.Buffer);  
            }  
        }  
        public chi(uint clientID)  
        {  
            Writer.WriteUInt16(39, 0, this.Buffer);  
            Writer.WriteUInt16(2534, 2, this.Buffer);  
            this.Buffer[25] = 10;  
            Writer.WriteUInt32(clientID, 6, this.Buffer);  
        }  
        public void Send(GameState client)  
        {  
            client.Send(this.ToArray());  
        }  
        public byte[] ToArray()  
        {  
            return this.Buffer;  
        }  
    }  
}
Code:
using System;  
using System.Collections.Generic;  
using System.Text;  

namespace Conquer_Online_Server.Network.GamePackets  
{  

    public class ChiInfo : Writer, Interfaces.IPacket  
    {  
        public enum ChiAction  
        {  
            Unlock = 0,  
            QueryInfo = 1,  
            Study = 2,  
            BuyStrength = 3,  
        }  

        public enum ChiPowerType  
        {  
            None = 0,  
            Dragon = 1,  
            Phoenix = 2,  
            Tiger = 3,  
            Turtle = 4  
        }  

        public enum ChiAttribute  
        {  
            None = 0,  
            CriticalRate,  
            MagicCriticalRate,  
            AntiMagicCriticalRate,  
            CrashAttack,  
            CrashDefense,  
            MaxLife,  
            AddAttack,  
            AddMagicAttack,  
            AddMagicDefense,  
            FinalAttack,  
            FinalMagicAttack,  
            FinalDefense,  
            FinalMagicDefense  
        }  

        byte[] Buffer;  

        public ChiInfo(bool Create)  
        {  
            if (Create)  
            {  
                Buffer = new byte[168 + 8];  
                WriteUInt16(168, 0, Buffer);  
                WriteUInt16(2533, 2, Buffer);  
            }  
            Strings = new List<string>();  
        }  

        public uint Type  
        {  
            get { return BitConverter.ToUInt32(Buffer, 4); }  
            set { WriteUInt32(value, 4, Buffer); }  
        }  

        public ulong dwParam  
        {  
            get { return BitConverter.ToUInt64(Buffer, 8); }  
            set { WriteUInt64(value, 8, Buffer); }  
        }  

        public ushort wParam1  
        {  
            get { return BitConverter.ToUInt16(Buffer, 8); }  
            set { WriteUInt16(value, 8, Buffer); }  
        }  

        public ushort wParam2  
        {  
            get { return BitConverter.ToUInt16(Buffer, 10); }  
            set { WriteUInt16(value, 10, Buffer); }  
        }  

        public uint dwParam2  
        {  
            get { return BitConverter.ToUInt32(Buffer, 16); }  
            set { WriteUInt32(value, 16, Buffer); }  
        }  

        public uint dwParam3  
        {  
            get { return BitConverter.ToUInt32(Buffer, 20); }  
            set { WriteUInt32(value, 20, Buffer); }  
        }  

        public uint dwParam4  
        {  
            get { return BitConverter.ToUInt32(Buffer, 24); }  
            set { WriteUInt32(value, 24, Buffer); }  
        }  

        //Thanks to ImmuneOne, who fixed the strings offsets, I managed to get nobility done.  
        public byte StringCount  
        {  
            get { return Buffer[32]; }  
            set { Buffer[32] = value; }  
        }  

        public List<string> DecodedStrings  
        {  
            get  
            {  
                List<string> list = new List<string>(StringCount);  
                int offset = 33;  
                for (int count = 0; count < StringCount; count++)  
                {  
                    byte stringLength = Buffer[offset]; offset++;  
                    string String = Encoding.UTF7.GetString(Buffer, offset, stringLength);  
                    offset += stringLength;  
                    list.Add(String);  
                }  
                return list;  
            }  
        }  

        public List<string> Strings;  

        public void UpdateString(Game.ConquerStructures.NobilityInformation info)  
        {  
            string buildString = info.EntityUID + " " + info.Donation + " " + (byte)info.Rank + " " + info.Position;  
            buildString = (char)buildString.Length + buildString;  
            Strings.Add(buildString);  
        }  

        public void ListString(Game.ConquerStructures.NobilityInformation info)  
        {  
            string buildString = info.EntityUID + " " + info.Gender + " 0 " + info.Name + " " + info.Donation + " " + (byte)info.Rank + " " + info.Position;  
            buildString = (char)buildString.Length + buildString;  
            Strings.Add(buildString);  
        }  

        public void Send(Client.GameState client)  
        {  
            client.Send(ToArray());  
        }  

        public byte[] ToArray()  
        {  
            if (Strings.Count == 0)  
                return Buffer;  
            string theString = "";  
            for (int count = 0; count < Strings.Count; count++)  
            {  
                theString += Strings[count];  
            }  
            byte[] newBuffer = new byte[168 + 8 + theString.Length];  
            Buffer.CopyTo(newBuffer, 0);  
            WriteUInt16((ushort)(newBuffer.Length - 8), 0, newBuffer);  
            newBuffer[34] = (byte)Strings.Count;  
            WriteString(theString, 35, newBuffer);  
            return newBuffer;  
        }  

        public void Deserialize(byte[] buffer)  
        {  
            Buffer = buffer;  
        }  
    }  
}
Code:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  

namespace Conquer_Online_Server.Network.GamePackets  
{  

    public enum ChiGate // byte  
    {  
        Dragon = 1,  
        Tiger = 2,  
        Phoneix = 3,  
        Turtle = 4 //build  
    }  
}
Code:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  

namespace Conquer_Online_Server.Network.GamePackets  
{  
    class ChiInfoStruct2  
    {  
        public ChiInfo.ChiPowerType Type { get; set; }  

        public int Attrib1 { get; set; }  

        public int Attrib2 { get; set; }  

        public int Attrib3 { get; set; }  

        public int Attrib4 { get; set; }  
    }  
}
Code:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  

namespace Conquer_Online_Server.Network.GamePackets  
{  
    public class ChiStats : Writer, Interfaces.IPacket  
    {  
        byte[] mData;  
        public ChiGate ChiGate  
        {  
            get  
            {  
                return (ChiGate)mData[22];  
            }  
            set  
            {  
                mData[22] = (byte)value;  
            }  
        }  
        public uint ChiPoints  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 10);  
            }  
            set  
            {  
                WriteUInt32(value, 10, mData);  
            }  
        }  
        public uint Identifier  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 6);  
            }  
            set  
            {  
                WriteUInt32(value, 6, mData);  
            }  
        }  
        public ushort Unknown1  
        {  
            get  
            {  
                return BitConverter.ToUInt16(mData, 4);  
            }  
            set  
            {  
                WriteUInt16(value, 4, mData);  
            }  
        }  
        public uint Unknown2  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 14);  
            }  
            set  
            {  
                WriteUInt32(value, 14, mData);  
            }  
        }  
        public uint Unknown3  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 18);  
            }  
            set  
            {  
                WriteUInt32(value, 18, mData);  
            }  
        }  
        public uint Val1  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 24);  
            }  
            set  
            {  
                WriteUInt32(value, 24, mData);  
            }  
        }  
        public uint Val2  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 28);  
            }  
            set  
            {  
                WriteUInt32(value, 28, mData);  
            }  
        }  
        public uint Val3  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 32);  
            }  
            set  
            {  
                WriteUInt32(value, 32, mData);  
            }  
        }  
        public uint Val4  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 36);  
            }  
            set  
            {  
                WriteUInt32(value, 36, mData);  
            }  
        }  
        /* public static implicit operator byte[](ChiStats d)  
        {  
        return d.mData;  
        }*/  
        public ChiStats()  
        {  
            mData = new byte[39 + 8];  
            WriteUInt16(39, 0, mData);  
            WriteUInt16(2534, 2, mData);  
        }  
        public static ChiStats ChiStats22(byte[] d)  
        {  
            var packet = new ChiStats();  
            packet.mData = d;  
            return packet;  
        }  
        public byte[] ToArray()  
        {  
            return mData;  
        }  
        public void Send(Client.GameState client)  
        {  
            client.Send(mData);  
        }  
        public void Deserialize(byte[] buffer)  
        {  
            mData = buffer;  
        }  
    } // class ChiStats  
}
Code:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  

namespace Conquer_Online_Server.Network.GamePackets  
{  
    public class ChiSystem : Writer, Interfaces.IPacket  
    {  

        byte[] mData;  

        public ChiSystem()  
        {  

            mData = new byte[16];  
            WriteUInt16((ushort)mData.Length, 0, mData);  
            WriteUInt16(2533, 2, mData);  

        }  

        public uint Identifier  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 4);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 4, mData);  
            }  
        }  

        public byte StudyFlag  
        {  
            get  
            {  
                return mData[11];  
            }  
            set  
            {  
                mData[11] = value;  
            }  
        }  
        public enum ChiSystemType : ushort  
        {  
            Unlock = 0,  
            Open = 1,  
            Study = 2,  
            CPFillChi = 3  
        }  
        public ChiSystemType Type  
        {  
            get  
            {  
                return (ChiSystemType)BitConverter.ToUInt16(mData, 8);  
            }  
            set  
            {  
                Writer.WriteUInt32((ushort)value, 8, mData);  
            }  
        }  

        public byte Unknown1  
        {  
            get  
            {  
                return mData[10];  
            }  
            set  
            {  
                mData[10] = value;  
            }  
        }  

        public uint Unknown2  
        {  
            get  
            {  
                return BitConverter.ToUInt32(mData, 12);  
            }  
            set  
            {  
                Writer.WriteUInt32(value, 12, mData);  
            }  
        }  

        /* public static implicit operator byte[](ChiSystem d)  
         {  
             return d.mData;  
         }*/  



        public ChiSystem(byte[] d)  
        {  
            mData = new byte[d.Length];  
            d.CopyTo(mData, 0);  
        }  
        public byte[] ToArray()  
        {  
            return mData;  
        }  

        public void Send(Client.GameState client)  
        {  
            client.Send(mData);  
        }  
        public void Deserialize(byte[] buffer)  
        {  
            mData = buffer;  
        }  

    } // class ChiSystem  
}
Code:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  

namespace Conquer_Online_Server.Network.GamePackets  
{  
    public class ChiSystem2  
    {  

        public ChiSystem2()  
        {  
        }  

        public static void Handle(byte[] Data, Client.GameState Client)  
        {  

            ChiSystem chiSystem = new ChiSystem(Data);  
            //Console.WriteLine(chiSystem.Identifier);  
            //Console.WriteLine(chiSystem.Unknown1);  
            //Console.WriteLine(chiSystem.Type);  
            //Console.WriteLine(chiSystem.StudyFlag);  
            //Console.WriteLine(chiSystem.Unknown2);  
            chiSystem.Unknown1 = 1;  
            chiSystem.StudyFlag = 1;  
            chiSystem.Unknown2 = 1;  
            switch (chiSystem.Type)  
            {  
                case Conquer_Online_Server.Network.GamePackets.ChiSystem.ChiSystemType.Open:  
                    ChiStats chiStats = new ChiStats()  
                    {  
                        Identifier = Client.Entity.UID,  
                        ChiPoints = Client.Entity.ChiPoints,  
                        Unknown2 = 13,  
                        Unknown3 = 1,  
                        ChiGate = ChiGate.Dragon,  
                        Val1 = 1000,  
                        Val2 = 2000,  
                        Val3 = 3000,  
                        Val4 = 4000  
                    };  
                    ChiStats chiStats2 = new ChiStats()  
                    {  
                        Identifier = Client.Entity.UID,  
                        ChiPoints = Client.Entity.ChiPoints,  
                        Unknown2 = 13,  
                        Unknown3 = 1,  
                        ChiGate = ChiGate.Phoneix,  
                        Val1 = 1000,  
                        Val2 = 2000,  
                        Val3 = 3000,  
                        Val4 = 4000  
                    };  
                    ChiStats chiStats3 = new ChiStats()  
                    {  
                        Identifier = Client.Entity.UID,  
                        ChiPoints = Client.Entity.ChiPoints,  
                        Unknown2 = 13,  
                        Unknown3 = 1,  
                        ChiGate = ChiGate.Tiger,  
                        Val1 = 1000,  
                        Val2 = 2000,  
                        Val3 = 3000,  
                        Val4 = 4000  
                    };  
                    ChiStats chiStats4 = new ChiStats()  
                    {  
                        Identifier = Client.Entity.UID,  
                        ChiPoints = Client.Entity.ChiPoints,  
                        Unknown2 = 13,  
                        Unknown3 = 1,  
                        ChiGate = ChiGate.Turtle,  
                        Val1 = 1000,  
                        Val2 = 2000,  
                        Val3 = 3000,  
                        Val4 = 4000  
                    };  
                    Client.Send(chiStats);  
                    Client.Send(chiStats2);  
                    Client.Send(chiStats3);  
                    Client.Send(chiStats4);  
                    break;  

                case Conquer_Online_Server.Network.GamePackets.ChiSystem.ChiSystemType.CPFillChi:  
                    uint ui1 = 2000;  
                    uint ui2 = (uint)Math.Floor((double)(1000.0F - (1000.0F * ((float)ui1 / 4000.0F))));  
                    Client.Entity.ChiPoints += 500;  
                    Client.Entity.ConquerPoints -= ui2;  
                    //Console.WriteLine("qq " + ui2 + "");  
                    //Console.WriteLine("pp " + chiSystem.Unknown1 + " ");  
                    break;  

                default:  
                    //Console.WriteLine(String.Concat("Unhandled ChiSystem Type: ", chiSystem.Type));  
                    break;  
            }

make a Class File in GamePackets. And name it (what the class name in your code) sheet you saw in the egy forum.
07/28/2013 17:18 marcbacor6666#6
make a Class File in GamePackets. And name it (what the class name in your code) sheet you saw in the egy forum.

:)
07/28/2013 18:47 Smaehtin#7
Please don't use this Egy trash code.