Example #1
0
 public void Update(byte type, string value, bool screen)
 {
     if (!SendUpdates)
         return;
     Network.GamePackets._String update = new _String(true);
     update.UID = this.UID;
     update.Type = type;
     update.TextsCount = 1;
     update.Texts.Add(value);
     if (EntityFlag == EntityFlag.Player)
     {
         if (!screen)
             update.Send(Owner as Client.GameState);
         else
             (Owner as Client.GameState).SendScreen(update, true);
     }
     else
     {
         MonsterInfo.SendScreen(update);
     }
 }
Example #2
0
 public void SendAllyAndEnemy(Client.GameState client)
 {
     foreach (Guild guild in Enemy.Values)
     {
         _String stringPacket = new _String(true);
         stringPacket.UID = guild.ID;
         stringPacket.Type = _String.GuildEnemies;
         stringPacket.Texts.Add(guild.Name + " " + guild.LeaderName + " 0 " + guild.MemberCount);
         client.Send(stringPacket);
         client.Send(stringPacket);
        // return;
     }
     foreach (Guild guild in Ally.Values)
     {
         _String stringPacket = new _String(true);
         stringPacket.UID = guild.ID;
         stringPacket.Type = _String.GuildAllies;
         stringPacket.Texts.Add(guild.Name + " " + guild.LeaderName + " 0 " + guild.MemberCount);
         client.Send(stringPacket);
         client.Send(stringPacket);
       //  return;
     }
 }
Example #3
0
 public void SendName(Client.GameState client)
 {
     _String stringPacket = new _String(true);
     stringPacket.UID = ID;
     stringPacket.Type = _String.GuildName;
     stringPacket.Texts.Add(Name + " " + LeaderName + " 0 " + MemberCount);
     client.Send(stringPacket);
 }
Example #4
0
 static void ObserveEquipment(Data generalData, Client.GameState client)
 {
     Client.GameState pclient = null;
     if (ServerBase.Kernel.GamePool.TryGetValue(generalData.dwParam, out pclient))
     {
         //if (generalData.ID != 117)
         //{
         // client.Send(pclient.Entity.WindowSpawn());
         //    client.Send(new GamePackets.ObserveStats(pclient).ToArray());
         //    pclient.Entity.SetVisible();
         //}
         pclient.Send(new Message(client.Entity.Name + " is observing your gear carefully.", System.Drawing.Color.Red, Message.TopLeft));
         if (ServerBase.Kernel.GamePool.TryGetValue(generalData.dwParam, out pclient))
         {
             client.Send(new GamePackets.ObserveStats(pclient).ToArray());
             IConquerItem[] Equipment = pclient.Equipment.Objects;
             foreach (ConquerItem item in Equipment)
             {
                 if (item != null)
                 {
                     uint UID = item.UID;
                     item.UID = pclient.Entity.UID;
                     item.Mode = Game.Enums.ItemMode.View;
                     item.Send(client);
                     item.UID = UID;
                     //item.Mode = Game.Enums.ItemMode.Default;
                 }
                 if (item != null)
                 {
                     BoothItem Item = new BoothItem(true);
                     Item.Fill(item, pclient.Entity.UID);
                     Item.Send(client);
                     if (item.Purification.Available)
                     {
                         ItemAdding add = new ItemAdding(true);
                         add = new ItemAdding(true);
                         add.Append(item.Purification);
                         add.Send(client);
                     }
                 }
             }
             _String packet = new _String(true);
             packet.Type = 16;
             packet.UID = client.Entity.UID;
             packet.TextsCount = 1;
             packet.Texts = new List<string>() { pclient.Entity.Spouse };
             client.Send(packet);
             packet.Type = 10;
             client.Send(packet);
         }
     }
 }
Example #5
0
 public void AddEnemy(string name)
 {
     foreach (Guild guild in ServerBase.Kernel.Guilds.Values)
     {
         if (guild.Name == name)
         {
             if (Ally.ContainsKey(guild.ID))
             {
                 RemoveAlly(guild.Name);
                 guild.RemoveAlly(Name);
             }
             Enemy.Add(guild.ID, guild);
             _String stringPacket = new _String(true);
             stringPacket.UID = guild.ID;
             stringPacket.Type = _String.GuildEnemies;
             stringPacket.Texts.Add(guild.Name + " " + guild.LeaderName + " 0 " + guild.MemberCount);
             SendGuildMessage(stringPacket);
             SendGuildMessage(stringPacket);
             Database.GuildTable.AddEnemy(this, guild.ID);
             return;
         }
     }
 }
Example #6
0
        private void Execute()
        {
            #region interactions
            if (attack != null)
            {
                switch (attack.AttackType)
                {
                    case (uint)Network.GamePackets.Attack.InteractionRequest:
                        new InteractionRequest(attack, attacker);
                        return;
                    case (uint)Network.GamePackets.Attack.InteractionEffect:
                        new InteractionEffect(attack, attacker);
                        return;

                    case (uint)Network.GamePackets.Attack.InteractionAccept:
                        new InteractionAccept(attack, attacker);
                        return;
                    case (uint)Network.GamePackets.Attack.InteractionRefuse:
                        new InteractionRefuse(attack, attacker);
                        return;
                    case (uint)Network.GamePackets.Attack.InteractionStopEffect:
                        new InteractionStopEffect(attack, attacker);
                        return;
                }
            }
            #endregion
            #region Monster -> Player \ Monster
            if (attack == null)
            {
                if (attacker.EntityFlag != EntityFlag.Monster)
                    return;
                if (attacker.Companion)
                {
                    if (ServerBase.Constants.PKForbiddenMaps.Contains(attacker.MapID))
                        return;
                }
                if (attacked.EntityFlag == EntityFlag.Player)
                {
                    if (!attacked.Owner.Attackable)
                        return;
                    if (attacked.Dead)
                        return;
                    //uint damageo = Calculate.Melee(attacker, attacked);
                    //uint damageo2 = Calculate.Melee(attacker, attacked);
                    if (attacked.Dead)
                    {
                        attacked.Die();

                        return;
                    }
                    #region New Monster Attack And Spells
                    #region SwordMaster
                    if (attacker.Name == "SwordMaster")
                    {

                        uint rand = (uint)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 4);
                        switch (rand)
                        {

                            case 1:
                                attacker.MonsterInfo.SpellID = 10502;
                                break;
                            case 2:
                                attacker.MonsterInfo.SpellID = 10504;
                                break;
                            case 3:
                                attacker.MonsterInfo.SpellID = 10506;
                                break;

                            case 4:
                                attacker.MonsterInfo.SpellID = 10505;
                                break;
                        }

                        uint damage = 0;//Calculate.Magic(attacker, attacked, attacker.MonsterInfo.SpellID, 0);
                        damage += (uint)ServerBase.Kernel.Random.Next(1200, 1400);
                        // damage += attacker.MagicAttack;
                        //damage -= attacked.PhysicalDamageDecrease;
                        // damage -= attacked.MagicDamageDecrease;
                        //  damage -= attacked.MagicDefence;

                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Die();
                        }
                        else
                        {
                            attacked.Hitpoints -= damage;
                        }
                        if (attacker.Companion)
                            attacker.Owner.IncreaseExperience(Math.Min(damage, attacked.Hitpoints), true);
                        SpellUse suse = new SpellUse(true);
                        suse.Attacker = attacker.UID;
                        suse.SpellID = attacker.MonsterInfo.SpellID;
                        suse.X = attacked.X;
                        suse.Y = attacked.Y;
                        suse.Targets.Add(attacked.UID, damage);
                        attacked.Owner.SendScreen(suse, true);
                    }

                    #endregion
                    #region ThrillingSpook
                    if (attacker.Name == "ThrillingSpook" || attacker.Name == "LavaBeast")
                    {

                        uint rand = (uint)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 4);
                        switch (rand)
                        {

                            case 1:
                                attacker.MonsterInfo.SpellID = 10363;
                                break;
                            case 2:
                                attacker.MonsterInfo.SpellID = 10360;
                                break;
                            case 3:
                                attacker.MonsterInfo.SpellID = 10361;
                                break;

                            case 4:
                                attacker.MonsterInfo.SpellID = 10362;
                                break;
                        }

                        uint damage = 0;//Calculate.Magic(attacker, attacked, attacker.MonsterInfo.SpellID, 0);
                        damage += (uint)ServerBase.Kernel.Random.Next(300, 500);
                        // damage += attacker.MagicAttack;
                        //damage -= attacked.PhysicalDamageDecrease;
                        // damage -= attacked.MagicDamageDecrease;
                        //  damage -= attacked.MagicDefence;

                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Die();
                        }
                        else
                        {
                            attacked.Hitpoints -= damage;
                        }
                        if (attacker.Companion)
                            attacker.Owner.IncreaseExperience(Math.Min(damage, attacked.Hitpoints), true);
                        SpellUse suse = new SpellUse(true);
                        suse.Attacker = attacker.UID;
                        suse.SpellID = attacker.MonsterInfo.SpellID;
                        suse.X = attacked.X;
                        suse.Y = attacked.Y;
                        suse.Targets.Add(attacked.UID, damage);
                        attacked.Owner.SendScreen(suse, true);
                    }

                    #endregion
                    #region SnowBanhe
                    if (attacker.Name == "SnowBanshee")
                    {

                        uint rand = (uint)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 4);
                        switch (rand)
                        {

                            case 1:
                                attacker.MonsterInfo.SpellID = 30010;
                                break;
                            case 2:
                                attacker.MonsterInfo.SpellID = 30011;
                                break;
                            case 3:
                                attacker.MonsterInfo.SpellID = 30012;
                                break;

                            case 4:
                                attacker.MonsterInfo.SpellID = 10001;
                                break;
                        }

                        uint damage = 0;//Calculate.Magic(attacker, attacked, attacker.MonsterInfo.SpellID, 0);
                        damage += (uint)ServerBase.Kernel.Random.Next(1200, 1400);
                        // damage += attacker.MagicAttack;
                        //damage -= attacked.PhysicalDamageDecrease;
                        // damage -= attacked.MagicDamageDecrease;
                        //  damage -= attacked.MagicDefence;

                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Die();
                        }
                        else
                        {
                            attacked.Hitpoints -= damage;
                        }
                        if (attacker.Companion)
                            attacker.Owner.IncreaseExperience(Math.Min(damage, attacked.Hitpoints), true);
                        SpellUse suse = new SpellUse(true);
                        suse.Attacker = attacker.UID;
                        suse.SpellID = attacker.MonsterInfo.SpellID;
                        suse.X = attacked.X;
                        suse.Y = attacked.Y;
                        suse.Targets.Add(attacked.UID, damage);
                        attacked.Owner.SendScreen(suse, true);
                    }
                    #endregion
                    #region TreatoDragon
                    if (attacker.Name == "TeratoDragon")
                    {
                        uint rand = (uint)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 5);
                        switch (rand)
                        {

                            case 1:
                                attacker.MonsterInfo.SpellID = 7012;
                                break;
                            case 2:
                                attacker.MonsterInfo.SpellID = 7013;
                                break;
                            case 3:
                                attacker.MonsterInfo.SpellID = 7015;
                                break;
                            case 4:
                                attacker.MonsterInfo.SpellID = 7016;
                                break;
                            case 5:
                                attacker.MonsterInfo.SpellID = 7017;
                                break;

                        }

                        uint damage = 0;//Calculate.Magic(attacker, attacked, attacker.MonsterInfo.SpellID, 0);
                        damage += (uint)ServerBase.Kernel.Random.Next(1200, 1400);
                        // damage += attacker.MagicAttack;
                        //damage -= attacked.PhysicalDamageDecrease;
                        // damage -= attacked.MagicDamageDecrease;
                        //  damage -= attacked.MagicDefence;

                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Die();
                        }
                        else
                        {
                            attacked.Hitpoints -= damage;
                        }
                        if (attacker.Companion)
                            attacker.Owner.IncreaseExperience(Math.Min(damage, attacked.Hitpoints), true);
                        SpellUse suse = new SpellUse(true);
                        suse.Attacker = attacker.UID;
                        suse.SpellID = attacker.MonsterInfo.SpellID;
                        suse.X = attacked.X;
                        suse.Y = attacked.Y;
                        suse.Targets.Add(attacked.UID, damage);
                        attacked.Owner.SendScreen(suse, true);

                    }
                    #endregion
                    #region Nobility War
                    if (attacker.Name == "KingMonster" || attacker.Name == "PrincesMonster" || attacker.Name == "DukeMonster")
                    {
                        uint rand = (uint)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 5);
                        switch (rand)
                        {

                            case 1:
                                attacker.MonsterInfo.SpellID = 7012;
                                break;
                            case 2:
                                attacker.MonsterInfo.SpellID = 7013;
                                break;
                            case 3:
                                attacker.MonsterInfo.SpellID = 7015;
                                break;
                            case 4:
                                attacker.MonsterInfo.SpellID = 7016;
                                break;
                            case 5:
                                attacker.MonsterInfo.SpellID = 7017;
                                break;

                        }

                        uint damage = 0;//Calculate.Magic(attacker, attacked, attacker.MonsterInfo.SpellID, 0);
                        damage += (uint)ServerBase.Kernel.Random.Next(100, 300);
                        // damage += attacker.MagicAttack;
                        //damage -= attacked.PhysicalDamageDecrease;
                        // damage -= attacked.MagicDamageDecrease;
                        //  damage -= attacked.MagicDefence;

                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Die();
                        }
                        else
                        {
                            attacked.Hitpoints -= damage;
                        }
                        if (attacker.Companion)
                            attacker.Owner.IncreaseExperience(Math.Min(damage, attacked.Hitpoints), true);
                        SpellUse suse = new SpellUse(true);
                        suse.Attacker = attacker.UID;
                        suse.SpellID = attacker.MonsterInfo.SpellID;
                        suse.X = attacked.X;
                        suse.Y = attacked.Y;
                        suse.Targets.Add(attacked.UID, damage);
                        attacked.Owner.SendScreen(suse, true);

                    }
                    #endregion

                    #endregion

                    if (attacker.MonsterInfo.SpellID == 0)
                    {
                        uint damage = Calculate.Melee(attacker, attacked);

                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Die();
                        }
                        else
                        {
                            attacked.Hitpoints -= damage;
                        }

                        attack = new Attack(true);
                        attack.Attacker = attacker.UID;
                        attack.Attacked = attacked.UID;
                        attack.AttackType = Attack.Melee;
                        attack.Damage = damage;
                        attack.X = attacked.X;
                        attack.Y = attacked.Y;
                        //attack.FirstEffect = EffectValue.Block;
                        attacked.Owner.SendScreen(attack, true);
                    }
                    else
                    {
                        uint damage = Calculate.Magic(attacker, attacked, attacker.MonsterInfo.SpellID, 0);

                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Die();
                        }

                        else
                        {
                            attacked.Hitpoints -= damage;
                        }
                        if (attacker.Companion)
                            attacker.Owner.IncreaseExperience(Math.Min(damage, attacked.Hitpoints), true);

                        SpellUse suse = new SpellUse(true);
                        suse.Attacker = attacker.UID;
                        suse.SpellID = attacker.MonsterInfo.SpellID;
                        suse.X = attacked.X;
                        suse.Y = attacked.Y;
                        suse.Targets.Add(attacked.UID, damage);
                        attacked.Owner.SendScreen(suse, true);
                    }
                }
                else
                {
                    if (attacker.MonsterInfo.SpellID == 0)
                    {
                        uint damage = Calculate.Melee(attacker, attacked);
                        attack = new Attack(true);
                        attack.Attacker = attacker.UID;
                        attack.Attacked = attacked.UID;
                        attack.AttackType = Attack.Melee;
                        attack.Damage = damage;
                        attack.X = attacked.X;
                        attack.Y = attacked.Y;
                        attacked.MonsterInfo.SendScreen(attack);
                        if (attacker.Companion)
                            if (damage > attacked.Hitpoints)
                                attacker.Owner.IncreaseExperience(Math.Min(damage, attacked.Hitpoints), true);
                            else
                                attacker.Owner.IncreaseExperience(damage, true);

                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Die(attacker);
                            attack = new Attack(true);
                            attack.Attacker = attacker.UID;
                            attack.Attacked = attacked.UID;
                            attack.AttackType = Network.GamePackets.Attack.Kill;
                            attack.X = attacked.X;
                            attack.Y = attacked.Y;
                            attacked.MonsterInfo.SendScreen(attack);
                        }
                        else
                        {
                            attacked.Hitpoints -= damage;
                        }
                    }
                    else
                    {
                        uint damage = Calculate.Magic(attacker, attacked, attacker.MonsterInfo.SpellID, 0);
                        SpellUse suse = new SpellUse(true);
                        suse.Attacker = attacker.UID;
                        suse.SpellID = attacker.MonsterInfo.SpellID;
                        suse.X = attacked.X;
                        suse.Y = attacked.Y;
                        suse.Targets.Add(attacked.UID, damage);
                        attacked.MonsterInfo.SendScreen(suse);
                        if (attacker.Companion)
                            if (damage > attacked.Hitpoints)
                                attacker.Owner.IncreaseExperience(Math.Min(damage, attacked.Hitpoints), true);
                            else
                                attacker.Owner.IncreaseExperience(damage, true);

                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Die(attacker);
                            attack = new Attack(true);
                            attack.Attacker = attacker.UID;
                            attack.Attacked = attacked.UID;
                            attack.AttackType = Network.GamePackets.Attack.Kill;
                            attack.X = attacked.X;
                            attack.Y = attacked.Y;
                            attacked.MonsterInfo.SendScreen(attack);
                        }
                        else
                        {
                            attacked.Hitpoints -= damage;
                        }
                    }
                }
            }
            #endregion
            #region Player -> Player \ Monster \ Sob Npc
            else
            {
                #region Merchant
                if (attack.AttackType == Attack.MerchantAccept || attack.AttackType == Attack.MerchantRefuse)
                {

                    attacker.AttackPacket = null;
                    return;
                }
                #endregion
                #region Marriage
                if (attack.AttackType == Attack.MarriageAccept || attack.AttackType == Attack.MarriageRequest)
                {
                    if (attack.AttackType == Attack.MarriageRequest)
                    {
                        Client.GameState Spouse = null;
                        uint takeout = attack.Attacked;
                        if (takeout == attacker.UID)
                            takeout = attack.Attacker;
                        if (ServerBase.Kernel.GamePool.TryGetValue(takeout, out Spouse))
                        {
                            if (attacker.Spouse != "None" || Spouse.Entity.Spouse != "None")
                            {
                                attacker.Owner.Send(new Message("You cannot marry someone that is already married with someone else!", System.Drawing.Color.Black, Message.TopLeft));
                            }
                            else
                            {
                                uint id1 = attacker.Mesh % 10, id2 = Spouse.Entity.Mesh % 10;

                                if (id1 <= 2 && id2 >= 3 || id1 >= 2 && id2 <= 3)
                                {

                                    attack.X = Spouse.Entity.X;
                                    attack.Y = Spouse.Entity.Y;

                                    Spouse.Send(attack);
                                }
                                else
                                {
                                    attacker.Owner.Send(new Message("You cannot marry someone of your gender!", System.Drawing.Color.Black, Message.TopLeft));
                                }
                            }
                        }
                    }
                    else
                    {
                        Client.GameState Spouse = null;
                        if (ServerBase.Kernel.GamePool.TryGetValue(attack.Attacked, out Spouse))
                        {
                            if (attacker.Spouse != "None" || Spouse.Entity.Spouse != "None")
                            {
                                attacker.Owner.Send(new Message("You cannot marry someone that is already married with someone else!", System.Drawing.Color.Black, Message.TopLeft));
                            }
                            else
                            {
                                if (attacker.Mesh % 10 <= 2 && Spouse.Entity.Mesh % 10 >= 3 || attacker.Mesh % 10 >= 3 && Spouse.Entity.Mesh % 10 <= 2)
                                {
                                    Spouse.Entity.Spouse = attacker.Name;
                                    attacker.Spouse = Spouse.Entity.Name;
                                    Message message = null;
                                    if (Spouse.Entity.Mesh % 10 >= 3)
                                        message = new Message("Joy and happiness! " + Spouse.Entity.Name + " and " + attacker.Name + " have joined together in the holy marriage. We wish them a stone house.", System.Drawing.Color.BurlyWood, Message.Center);
                                    else
                                        message = new Message("Joy and happiness! " + attacker.Name + " and " + attacker.Spouse + " have joined together in the holy marriage. We wish them a stone house.", System.Drawing.Color.BurlyWood, Message.Center);

                                    var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                    varr.MoveNext();
                                    int COunt = ServerBase.Kernel.GamePool.Count;
                                    for (uint x = 0;
                                        x < COunt;
                                        x++)
                                    {
                                        if (x >= COunt) break;

                                        Client.GameState client = (varr.Current as Client.GameState);

                                        client.Send(message);

                                        varr.MoveNext();

                                    }

                                    Spouse.Entity.Update(_String.Effect, "firework-2love", true);
                                    attacker.Update(_String.Effect, "firework-2love", true);
                                }
                                else
                                {
                                    attacker.Owner.Send(new Message("You cannot marry someone of your gender!", System.Drawing.Color.Black, Message.TopLeft));
                                }
                            }
                        }
                    }
                }
                #endregion
            #endregion

                #region Attacking
                else
                {
                    attacker.Owner.Attackable = true;
                    Entity attacked = null;
                    SobNpcSpawn attackedsob = null;

                    #region Checks
                    if (attack.Attacker != attacker.UID)
                        return;
                    if (attacker.EntityFlag != EntityFlag.Player)
                        return;
                    attacker.RemoveFlag(Update.Flags.Invisibility);

                    bool pass = false;
                    if (attack.AttackType == Attack.Melee)
                    {
                        if (attacker.OnFatalStrike())
                        {
                            if (attack.Attacked < 600000)
                            {
                                pass = true;
                            }
                        }
                    }
                    ushort decrease = 0;
                    if (attacker.OnCyclone())
                        decrease = 700;
                    if (attacker.OnSuperman())
                        decrease = 300;
                    if (!pass)
                    {
                        int milliSeconds = 1000 - attacker.Agility - decrease;
                        if (milliSeconds < 0 || milliSeconds > 5000)
                            milliSeconds = 0;
                        if (Time32.Now < attacker.AttackStamp.AddMilliseconds(milliSeconds))
                            return;
                    }
                    if (attacker.Dead)
                    {
                        if (attacker.AttackPacket != null)
                            attacker.AttackPacket = null;
                        return;
                    }
                    attacker.AttackStamp = Time32.Now;
                    if (attacker.Owner.QualifierGroup != null)
                    {
                        if (Time32.Now < attacker.Owner.QualifierGroup.CreateTime.AddSeconds(12))
                        {
                            return;
                        }
                    }

                restart:

                    #region Extract attack information
                    ushort SpellID = 0, X = 0, Y = 0;
                    uint Target = 0;
                    if (attack.AttackType == Attack.Magic)
                    {
                        if (!attack.Decoded)
                        {
                            #region GetSkillID
                            SpellID = Convert.ToUInt16(((long)attack.ToArray()[24] & 0xFF) | (((long)attack.ToArray()[25] & 0xFF) << 8));
                            SpellID ^= (ushort)0x915d;
                            SpellID ^= (ushort)attacker.UID;
                            SpellID = (ushort)(SpellID << 0x3 | SpellID >> 0xd);
                            SpellID -= 0xeb42;
                            #endregion
                            #region GetCoords
                            X = (ushort)((attack.ToArray()[16] & 0xFF) | ((attack.ToArray()[17] & 0xFF) << 8));
                            X = (ushort)(X ^ (uint)(attacker.UID & 0xffff) ^ 0x2ed6);
                            X = (ushort)(((X << 1) | ((X & 0x8000) >> 15)) & 0xffff);
                            X = (ushort)((X | 0xffff0000) - 0xffff22ee);

                            Y = (ushort)((attack.ToArray()[18] & 0xFF) | ((attack.ToArray()[19] & 0xFF) << 8));
                            Y = (ushort)(Y ^ (uint)(attacker.UID & 0xffff) ^ 0xb99b);
                            Y = (ushort)(((Y << 5) | ((Y & 0xF800) >> 11)) & 0xffff);
                            Y = (ushort)((Y | 0xffff0000) - 0xffff8922);
                            #endregion
                            #region GetTarget
                            Target = ((uint)attack.ToArray()[12] & 0xFF) | (((uint)attack.ToArray()[13] & 0xFF) << 8) | (((uint)attack.ToArray()[14] & 0xFF) << 16) | (((uint)attack.ToArray()[15] & 0xFF) << 24);
                            Target = ((((Target & 0xffffe000) >> 13) | ((Target & 0x1fff) << 19)) ^ 0x5F2D2463 ^ attacker.UID) - 0x746F4AE6;
                            #endregion

                            attack.X = X;
                            attack.Y = Y;
                            attack.Damage = SpellID;
                            attack.Attacked = Target;
                            attack.Decoded = true;
                        }
                        else
                        {
                            X = attack.X;
                            Y = attack.Y;
                            SpellID = (ushort)attack.Damage;
                            Target = attack.Attacked;
                        }
                    }
                    #endregion
                    #endregion

                    if (attacker.ContainsFlag(Update.Flags.Ride))
                    {
                        attacker.Stamina = 100;
                        if (attacker.RidingCropID == 0)
                        {
                            if (attack.AttackType != Attack.Magic)
                                attacker.RemoveFlag(Update.Flags.Ride);
                            else
                                if (!(SpellID == 7003 || SpellID == 7002))
                                    attacker.RemoveFlag(Update.Flags.Ride);
                        }
                    }
                    //if (attacked.ContainsFlag(Update.Flags.Ride))
                    //{
                    //    //if (attack.AttackType != Attack.Magic)
                    //    //    attacker.RemoveFlag(Update.Flags.Ride);
                    //    //else
                    //    if (!(SpellID == 7003 || SpellID == 7002))
                    //        attacked.RemoveFlag(Update.Flags.Ride);
                    //}
                    if (attacker.ContainsFlag(Update.Flags.CastPray))
                        attacker.RemoveFlag(Update.Flags.CastPray);
                    if (attacker.ContainsFlag(Update.Flags.Praying))
                        attacker.RemoveFlag(Update.Flags.Praying);
                    Interfaces.IConquerItem item = new Network.GamePackets.ConquerItem(true);
                    // BlessEffect.Handler(client);

                    #region GemuriEfecte
                    {
                        #region DragonGem
                        if (!attacker.Owner.Equipment.Free((byte)ConquerItem.RightWeapon))
                        {
                            Interfaces.IConquerItem rightweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.RightWeapon);
                            if (rightweapon.SocketOne == Game.Enums.Gem.SuperDragonGem || rightweapon.SocketTwo == Game.Enums.Gem.SuperDragonGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("goldendragon");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }

                        if (!attacker.Owner.Equipment.Free((byte)ConquerItem.LeftWeapon))
                        {
                            Interfaces.IConquerItem rightweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.LeftWeapon);
                            if (rightweapon.SocketOne == Game.Enums.Gem.SuperDragonGem || rightweapon.SocketTwo == Game.Enums.Gem.SuperDragonGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("goldendragon");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }

                        if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Head))
                        {
                            Interfaces.IConquerItem rightweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Head);
                            if (rightweapon.SocketOne == Game.Enums.Gem.SuperDragonGem || rightweapon.SocketTwo == Game.Enums.Gem.SuperDragonGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("goldendragon");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }

                        if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Armor))
                        {
                            Interfaces.IConquerItem rightweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Armor);
                            if (rightweapon.SocketOne == Game.Enums.Gem.SuperDragonGem || rightweapon.SocketTwo == Game.Enums.Gem.SuperDragonGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("goldendragon");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }

                        if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Boots))
                        {
                            Interfaces.IConquerItem rightweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Boots);
                            if (rightweapon.SocketOne == Game.Enums.Gem.SuperDragonGem || rightweapon.SocketTwo == Game.Enums.Gem.SuperDragonGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("goldendragon");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }
                        if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Necklace))
                        {
                            Interfaces.IConquerItem rightweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Necklace);
                            if (rightweapon.SocketOne == Game.Enums.Gem.SuperDragonGem || rightweapon.SocketTwo == Game.Enums.Gem.SuperDragonGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("goldendragon");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }
                        if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Ring))
                        {
                            Interfaces.IConquerItem rightweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Ring);
                            if (rightweapon.SocketOne == Game.Enums.Gem.SuperDragonGem || rightweapon.SocketTwo == Game.Enums.Gem.SuperDragonGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("goldendragon");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }
                        #endregion
                        #region phoenix Gem
                        else if (!attacker.Owner.Equipment.Free((byte)ConquerItem.RightWeapon))
                        {
                            Interfaces.IConquerItem rightweapon1 = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.RightWeapon);
                            if (rightweapon1.SocketOne == Game.Enums.Gem.SuperPhoenixGem || rightweapon1.SocketTwo == Game.Enums.Gem.SuperPhoenixGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("phoenix");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }

                        else if (!attacker.Owner.Equipment.Free((byte)ConquerItem.LeftWeapon))
                        {
                            Interfaces.IConquerItem rightweapon1 = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.LeftWeapon);
                            if (rightweapon1.SocketOne == Game.Enums.Gem.SuperPhoenixGem || rightweapon1.SocketTwo == Game.Enums.Gem.SuperPhoenixGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("phoenix");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }

                        else if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Head))
                        {
                            Interfaces.IConquerItem rightweapon1 = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Head);
                            if (rightweapon1.SocketOne == Game.Enums.Gem.SuperPhoenixGem || rightweapon1.SocketTwo == Game.Enums.Gem.SuperPhoenixGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("phoenix");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }

                        else if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Armor))
                        {
                            Interfaces.IConquerItem rightweapon1 = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Armor);
                            if (rightweapon1.SocketOne == Game.Enums.Gem.SuperPhoenixGem || rightweapon1.SocketTwo == Game.Enums.Gem.SuperPhoenixGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("phoenix");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }

                        else if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Boots))
                        {
                            Interfaces.IConquerItem rightweapon1 = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Boots);
                            if (rightweapon1.SocketOne == Game.Enums.Gem.SuperPhoenixGem || rightweapon1.SocketTwo == Game.Enums.Gem.SuperPhoenixGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("phoenix");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }
                        else if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Necklace))
                        {
                            Interfaces.IConquerItem rightweapon1 = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Necklace);
                            if (rightweapon1.SocketOne == Game.Enums.Gem.SuperPhoenixGem || rightweapon1.SocketTwo == Game.Enums.Gem.SuperPhoenixGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("phoenix");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }
                        else if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Ring))
                        {
                            Interfaces.IConquerItem rightweapon1 = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Ring);
                            if (rightweapon1.SocketOne == Game.Enums.Gem.SuperPhoenixGem || rightweapon1.SocketTwo == Game.Enums.Gem.SuperPhoenixGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("phoenix");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }
                        #endregion
                        #region RainbowGem Gem
                        else if (!attacker.Owner.Equipment.Free((byte)ConquerItem.RightWeapon))
                        {
                            Interfaces.IConquerItem rightweapon2 = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.RightWeapon);
                            if (rightweapon2.SocketOne == Game.Enums.Gem.SuperRainbowGem || rightweapon2.SocketTwo == Game.Enums.Gem.SuperRainbowGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("rainbow");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }

                        else if (!attacker.Owner.Equipment.Free((byte)ConquerItem.LeftWeapon))
                        {
                            Interfaces.IConquerItem rightweapon2 = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.LeftWeapon);
                            if (rightweapon2.SocketOne == Game.Enums.Gem.SuperRainbowGem || rightweapon2.SocketTwo == Game.Enums.Gem.SuperRainbowGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("rainbow");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }

                        else if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Head))
                        {
                            Interfaces.IConquerItem rightweapon2 = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Head);
                            if (rightweapon2.SocketOne == Game.Enums.Gem.SuperRainbowGem || rightweapon2.SocketTwo == Game.Enums.Gem.SuperRainbowGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("rainbow");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }

                        else if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Armor))
                        {
                            Interfaces.IConquerItem rightweapon2 = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Armor);
                            if (rightweapon2.SocketOne == Game.Enums.Gem.SuperRainbowGem || rightweapon2.SocketTwo == Game.Enums.Gem.SuperRainbowGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("rainbow");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }

                        else if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Boots))
                        {
                            Interfaces.IConquerItem rightweapon2 = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Boots);
                            if (rightweapon2.SocketOne == Game.Enums.Gem.SuperRainbowGem || rightweapon2.SocketTwo == Game.Enums.Gem.SuperRainbowGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("rainbow");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }
                        else if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Necklace))
                        {
                            Interfaces.IConquerItem rightweapon2 = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Necklace);
                            if (rightweapon2.SocketOne == Game.Enums.Gem.SuperRainbowGem || rightweapon2.SocketTwo == Game.Enums.Gem.SuperRainbowGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("rainbow");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }
                        else if (!attacker.Owner.Equipment.Free((byte)ConquerItem.Ring))
                        {
                            Interfaces.IConquerItem rightweapon2 = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.Ring);
                            if (rightweapon2.SocketOne == Game.Enums.Gem.SuperRainbowGem || rightweapon2.SocketTwo == Game.Enums.Gem.SuperRainbowGem)
                            {
                                if (ServerBase.Kernel.Rate(0.5))
                                {
                                    _String str = new _String(true);
                                    str.UID = attacker.UID;
                                    str.TextsCount = 1;
                                    str.Type = _String.Effect;
                                    str.Texts.Add("rainbow");

                                    attacker.Owner.SendScreen(str, true);
                                }
                            }
                        }
                        #endregion

                    }
                    #endregion
                    #region Dash
                    if (SpellID == 1051)
                    {
                        if (ServerBase.Kernel.GetDistance(attack.X, attack.Y, attacker.X, attacker.Y) > 4)
                        {
                            attacker.Owner.Disconnect();
                            return;
                        }
                        attacker.X = attack.X; attacker.Y = attack.Y;
                        ushort x = attacker.X, y = attacker.Y;
                        Game.Map.UpdateCoordonatesForAngle(ref x, ref y, (Enums.ConquerAngle)Target);
                        foreach (Interfaces.IMapObject obj in attacker.Owner.Screen.Objects)
                        {
                            if (obj == null)
                                continue;
                            if (obj.X == x && obj.Y == y && (obj.MapObjType == MapObjectType.Monster || obj.MapObjType == MapObjectType.Player))
                            {
                                Entity entity = obj as Entity;
                                if (!entity.Dead)
                                {
                                    Target = obj.UID;
                                    break;
                                }
                            }
                        }
                    }
                    #endregion
                    #region CounterKill
                    if (attack.AttackType == Attack.CounterKillSwitch)
                    {
                        if (attacked != null)
                            if (attacked.ContainsFlag(Update.Flags.Fly))
                            { attacker.AttackPacket = null; return; }
                        if (attacker != null)
                            if (attacker.ContainsFlag(Update.Flags.Fly))
                            { attacker.AttackPacket = null; return; }
                        if (attacker.Owner.Spells.ContainsKey(6003))
                        {
                            if (!attacker.CounterKillSwitch)
                            {
                                if (Time32.Now >= attacker.CounterKillStamp.AddSeconds(15))
                                {
                                    attacker.CounterKillStamp = Time32.Now;
                                    attacker.CounterKillSwitch = true;
                                    Attack m_attack = new Attack(true);
                                    m_attack.Attacked = attacker.UID;
                                    m_attack.Attacker = attacker.UID;
                                    m_attack.AttackType = Attack.CounterKillSwitch;
                                    m_attack.Damage = 1;
                                    m_attack.X = attacker.X;
                                    m_attack.Y = attacker.Y;
                                    m_attack.Send(attacker.Owner);
                                }
                            }
                            else
                            {
                                attacker.CounterKillSwitch = false;
                                Attack m_attack = new Attack(true);
                                m_attack.Attacked = attacker.UID;
                                m_attack.Attacker = attacker.UID;
                                m_attack.AttackType = Attack.CounterKillSwitch;
                                m_attack.Damage = 0;
                                m_attack.X = attacker.X;
                                m_attack.Y = attacker.Y;
                                m_attack.Send(attacker.Owner);
                            }

                            attacker.Owner.IncreaseSpellExperience(100, 6003);
                            attacker.AttackPacket = null;
                        }
                    }
                    #endregion
                    #region Melee
                    else if (attack.AttackType == Attack.Melee)
                    {
                        if (attacker.Owner.Screen.TryGetValue(attack.Attacked, out attacked))
                        {
                            CheckForExtraWeaponPowers(attacker.Owner, attacked);
                            if (!CanAttack(attacker, attacked, null, attack.AttackType == Attack.Melee))
                                return;
                            pass = false;
                            if (attacker.OnFatalStrike())
                            {
                                if (attacked.EntityFlag == EntityFlag.Monster)
                                {
                                    pass = true;
                                }
                            }
                            ushort range = attacker.AttackRange;
                            if (attacker.Transformed)
                                range = (ushort)attacker.TransformationAttackRange;
                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= range || pass)
                            {
                                uint damage = Game.Attacking.Calculate.Melee(attacker, attacked);
                                attack.Damage = damage;
                                if (attacker.OnFatalStrike())
                                {
                                    if (attacked.EntityFlag == EntityFlag.Monster)
                                    {
                                        bool can = false;
                                        if (!attacker.Owner.Equipment.Free((byte)ConquerItem.RightWeapon))
                                            if (attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.RightWeapon).ID / 1000 == 601)
                                                can = true;
                                        if (!attacker.Owner.Equipment.Free((byte)ConquerItem.LeftWeapon))
                                            if (attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.LeftWeapon).ID / 1000 == 601)
                                                can = true;
                                        if (!can)
                                            return;
                                        ushort x = attacked.X;
                                        ushort y = attacked.Y;
                                        Map.UpdateCoordonatesForAngle(ref x, ref y, ServerBase.Kernel.GetAngle(attacked.X, attacked.Y, attacker.X, attacker.Y));
                                        attacker.Shift(x, y);
                                        attack.X = x;
                                        attack.Y = y;
                                        attack.AttackType = Attack.FatalStrike;
                                    }
                                }
                                //over:
                                if (!attacker.Owner.Equipment.Free((byte)ConquerItem.RightWeapon))
                                {
                                    Interfaces.IConquerItem rightweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.RightWeapon);
                                    ushort wep1subyte = (ushort)(rightweapon.ID / 1000), wep2subyte = 0;
                                    bool wep1bs = false, wep2bs = false;
                                    if (wep1subyte == 421)
                                    {
                                        wep1bs = true;
                                        wep1subyte--;
                                    }
                                    ushort wep1spellid = 0, wep2spellid = 0;
                                    if (Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
                                        wep1spellid = Database.SpellTable.WeaponSpells[wep1subyte];
                                    Database.SpellInformation wep1spell = null, wep2spell = null;
                                    bool doWep1Spell = false, doWep2Spell = false;
                                    if (attacker.Owner.Spells.ContainsKey(wep1spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep1spellid))
                                    {
                                        wep1spell = Database.SpellTable.SpellInformations[wep1spellid][attacker.Owner.Spells[wep1spellid].Level];
                                        doWep1Spell = ServerBase.Kernel.Rate(wep1spell.Percent);
                                        if (attacked.EntityFlag == EntityFlag.Player && wep1spellid == 10490)
                                            doWep1Spell = ServerBase.Kernel.Rate(5);
                                    }
                                    if (!doWep1Spell)
                                    {
                                        if (!attacker.Owner.Equipment.Free((byte)ConquerItem.LeftWeapon))
                                        {
                                            Interfaces.IConquerItem leftweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.LeftWeapon);
                                            wep2subyte = (ushort)(leftweapon.ID / 1000);
                                            if (wep2subyte == 421)
                                            {
                                                wep2bs = true;
                                                wep2subyte--;
                                            }
                                            if (Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
                                                wep2spellid = Database.SpellTable.WeaponSpells[wep2subyte];
                                            if (attacker.Owner.Spells.ContainsKey(wep2spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep2spellid))
                                            {
                                                wep2spell = Database.SpellTable.SpellInformations[wep2spellid][attacker.Owner.Spells[wep2spellid].Level];
                                                doWep2Spell = ServerBase.Kernel.Rate(wep2spell.Percent);
                                                if (attacked.EntityFlag == EntityFlag.Player && wep2spellid == 10490)
                                                    doWep2Spell = ServerBase.Kernel.Rate(5);
                                            }
                                        }
                                    }

                                    if (!attacker.Transformed)
                                    {
                                        if (doWep1Spell)
                                        {
                                            attack.AttackType = Attack.Magic;
                                            attack.Decoded = true;
                                            attack.X = attacked.X;
                                            attack.Y = attacked.Y;
                                            attack.Attacked = attacked.UID;
                                            attack.Damage = wep1spell.ID;
                                            goto restart;
                                        }
                                        if (doWep2Spell)
                                        {
                                            attack.AttackType = Attack.Magic;
                                            attack.Decoded = true;
                                            attack.X = attacked.X;
                                            attack.Y = attacked.Y;
                                            attack.Attacked = attacked.UID;
                                            attack.Damage = wep2spell.ID;
                                            goto restart;
                                        }
                                        if (wep1bs)
                                            wep1subyte++;
                                        if (attacker.EntityFlag == EntityFlag.Player && attacked.EntityFlag != EntityFlag.Player)
                                            if (damage > attacked.Hitpoints)
                                            {
                                                attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), wep1subyte);
                                                if (wep2subyte != 0)
                                                {
                                                    if (wep2bs)
                                                        wep2subyte++;
                                                    attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), wep2subyte);
                                                }
                                            }
                                            else
                                            {
                                                attacker.Owner.IncreaseProficiencyExperience(damage, wep1subyte);
                                                if (wep2subyte != 0)
                                                {
                                                    if (wep2bs)
                                                        wep2subyte++;
                                                    attacker.Owner.IncreaseProficiencyExperience(damage, wep2subyte);
                                                }
                                            }
                                    }
                                }
                                else
                                {
                                    if (!attacker.Transformed)
                                    {
                                        if (attacker.EntityFlag == EntityFlag.Player && attacked.EntityFlag != EntityFlag.Player)
                                            if (damage > attacked.Hitpoints)
                                            {
                                                attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), 0);
                                            }
                                            else
                                            {
                                                attacker.Owner.IncreaseProficiencyExperience(damage, 0);
                                            }
                                    }
                                }
                                ReceiveAttack(attacker, attacked, attack, damage, null);
                                attack.AttackType = Attack.Melee;
                            }
                            else
                            {
                                attacker.AttackPacket = null;
                            }
                        }
                        else if (attacker.Owner.Screen.TryGetSob(attack.Attacked, out attackedsob))
                        {
                            if (CanAttack(attacker, attackedsob, null))
                            {
                                ushort range = attacker.AttackRange;
                                if (attacker.Transformed)
                                    range = (ushort)attacker.TransformationAttackRange;
                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= range)
                                {
                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                    if (!attacker.Owner.Equipment.Free((byte)ConquerItem.RightWeapon))
                                    {
                                        Interfaces.IConquerItem rightweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.RightWeapon);
                                        ushort wep1subyte = (ushort)(rightweapon.ID / 1000), wep2subyte = 0;
                                        bool wep1bs = false, wep2bs = false;
                                        if (wep1subyte == 421)
                                        {
                                            wep1bs = true;
                                            wep1subyte--;
                                        }
                                        ushort wep1spellid = 0, wep2spellid = 0;
                                        if (Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
                                            wep1spellid = Database.SpellTable.WeaponSpells[wep1subyte];
                                        Database.SpellInformation wep1spell = null, wep2spell = null;
                                        bool doWep1Spell = false, doWep2Spell = false;
                                        if (attacker.Owner.Spells.ContainsKey(wep1spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep1spellid))
                                        {
                                            wep1spell = Database.SpellTable.SpellInformations[wep1spellid][attacker.Owner.Spells[wep1spellid].Level];
                                            doWep1Spell = ServerBase.Kernel.Rate(wep1spell.Percent);
                                        }
                                        if (!doWep1Spell)
                                        {
                                            if (!attacker.Owner.Equipment.Free((byte)ConquerItem.LeftWeapon))
                                            {
                                                Interfaces.IConquerItem leftweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.LeftWeapon);
                                                wep2subyte = (ushort)(leftweapon.ID / 1000);
                                                if (wep2subyte == 421)
                                                {
                                                    wep2bs = true;
                                                    wep2subyte--;
                                                }
                                                if (Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
                                                    wep2spellid = Database.SpellTable.WeaponSpells[wep2subyte];
                                                if (attacker.Owner.Spells.ContainsKey(wep2spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep2spellid))
                                                {
                                                    wep2spell = Database.SpellTable.SpellInformations[wep2spellid][attacker.Owner.Spells[wep2spellid].Level];
                                                    doWep2Spell = ServerBase.Kernel.Rate(wep2spell.Percent);
                                                }
                                            }
                                        }

                                        if (!attacker.Transformed)
                                        {
                                            if (doWep1Spell)
                                            {
                                                attack.AttackType = Attack.Magic;
                                                attack.Decoded = true;
                                                attack.X = attackedsob.X;
                                                attack.Y = attackedsob.Y;
                                                attack.Attacked = attackedsob.UID;
                                                attack.Damage = wep1spell.ID;
                                                goto restart;
                                            }
                                            if (doWep2Spell)
                                            {
                                                attack.AttackType = Attack.Magic;
                                                attack.Decoded = true;
                                                attack.X = attackedsob.X;
                                                attack.Y = attackedsob.Y;
                                                attack.Attacked = attackedsob.UID;
                                                attack.Damage = wep2spell.ID;
                                                goto restart;
                                            }
                                            if (attacker.MapID == 1039)
                                            {
                                                if (wep1bs)
                                                    wep1subyte++;
                                                if (attacker.EntityFlag == EntityFlag.Player)
                                                    if (damage > attackedsob.Hitpoints)
                                                    {
                                                        attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), wep1subyte);
                                                        if (wep2subyte != 0)
                                                        {
                                                            if (wep2bs)
                                                                wep2subyte++;
                                                            attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), wep2subyte);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        attacker.Owner.IncreaseProficiencyExperience(damage, wep1subyte);
                                                        if (wep2subyte != 0)
                                                        {
                                                            if (wep2bs)
                                                                wep2subyte++;
                                                            attacker.Owner.IncreaseProficiencyExperience(damage, wep2subyte);
                                                        }
                                                    }
                                            }
                                        }
                                    }
                                    attack.Damage = damage;
                                    ReceiveAttack(attacker, attackedsob, attack, damage, null);
                                }
                                else
                                {
                                    attacker.AttackPacket = null;
                                }
                            }
                        }
                        else
                        {
                            attacker.AttackPacket = null;
                        }
                    }
                    #endregion
                    #region Ranged
                    else if (attack.AttackType == Attack.Ranged)
                    {
                        if (attacker.Owner.Screen.TryGetValue(attack.Attacked, out attacked))
                        {
                            CheckForExtraWeaponPowers(attacker.Owner, attacked);
                            if (attacker.Owner.Equipment.TryGetItem(ConquerItem.LeftWeapon) == null)
                                return;
                            if (!CanAttack(attacker, attacked, null, attack.AttackType == Attack.Melee))
                                return;
                            if (!attacker.Owner.Equipment.Free((byte)ConquerItem.LeftWeapon))
                            {
                                Interfaces.IConquerItem arrow = attacker.Owner.Equipment.TryGetItem(ConquerItem.LeftWeapon);
                                arrow.Durability -= 1;
                                ItemUsage usage = new ItemUsage(true) { UID = arrow.UID, dwParam = arrow.Durability, ID = ItemUsage.UpdateDurability };
                                usage.Send(attacker.Owner);
                                if (arrow.Durability <= 0 || arrow.Durability > 5000)
                                {
                                    Network.PacketHandler.ReloadArrows(attacker.Owner.Equipment.TryGetItem(ConquerItem.LeftWeapon), attacker.Owner);
                                }
                            }
                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= ServerBase.Constants.pScreenDistance)
                            {
                                uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked);
                                attack.Damage = damage;
                                if (attacker.EntityFlag == EntityFlag.Player && attacked.EntityFlag != EntityFlag.Player)
                                    if (damage > attacked.Hitpoints)
                                    {
                                        attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), 500);
                                    }
                                    else
                                    {
                                        attacker.Owner.IncreaseProficiencyExperience(damage, 500);
                                    }
                                ReceiveAttack(attacker, attacked, attack, damage, null);
                            }
                        }
                        else if (attacker.Owner.Screen.TryGetSob(attack.Attacked, out attackedsob))
                        {
                            if (CanAttack(attacker, attackedsob, null))
                            {
                                if (attacker.Owner.Equipment.TryGetItem(ConquerItem.LeftWeapon) == null)
                                    return;
                                if (attacker.MapID != 1039)
                                {
                                    if (!attacker.Owner.Equipment.Free((byte)ConquerItem.LeftWeapon))
                                    {
                                        Interfaces.IConquerItem arrow = attacker.Owner.Equipment.TryGetItem(ConquerItem.LeftWeapon);
                                        arrow.Durability -= 1;
                                        ItemUsage usage = new ItemUsage(true) { UID = arrow.UID, dwParam = arrow.Durability, ID = ItemUsage.UpdateDurability };
                                        usage.Send(attacker.Owner);
                                        if (arrow.Durability <= 0 || arrow.Durability > 5000)
                                        {
                                            Network.PacketHandler.ReloadArrows(attacker.Owner.Equipment.TryGetItem(ConquerItem.LeftWeapon), attacker.Owner);
                                        }
                                    }
                                }
                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= ServerBase.Constants.pScreenDistance)
                                {
                                    uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob);
                                    attack.Damage = damage;
                                    ReceiveAttack(attacker, attackedsob, attack, damage, null);
                                    if (damage > attackedsob.Hitpoints)
                                    {
                                        attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), 500);
                                    }
                                    else
                                    {
                                        attacker.Owner.IncreaseProficiencyExperience(damage, 500);
                                    }
                                }
                            }
                        }
                        else
                        {
                            attacker.AttackPacket = null;
                        }
                    }
                    #endregion
                    #region Magic
                    else if (attack.AttackType == Attack.Magic)
                    {
                        CheckForExtraWeaponPowers(attacker.Owner, attacked);
                        uint Experience = 100;
                        bool shuriken = false;
                        ushort spellID = SpellID;
                        if (SpellID >= 3090 && SpellID <= 3306)
                            spellID = 3090;
                        if (spellID == 6012)
                            shuriken = true;

                        if (attacker == null)
                            return;
                        if (attacker.Owner == null)
                        {
                            attacker.AttackPacket = null;
                            return;
                        }
                        if (attacker.Owner.Spells == null)
                        {
                            attacker.Owner.Spells = new SafeDictionary<ushort, Conquer_Online_Server.Interfaces.ISkill>(10000);
                            attacker.AttackPacket = null;
                            return;
                        }
                        if (attacker.Owner.Spells[spellID] == null && spellID != 6012)
                        {
                            attacker.AttackPacket = null;
                            return;
                        }

                        Database.SpellInformation spell = null;
                        if (shuriken)
                            spell = Database.SpellTable.SpellInformations[6010][0];
                        else
                        {
                            byte choselevel = 0;
                            if (spellID == SpellID)
                                choselevel = attacker.Owner.Spells[spellID].Level;
                            if (Database.SpellTable.SpellInformations[SpellID] != null && !Database.SpellTable.SpellInformations[SpellID].ContainsKey(choselevel))
                                choselevel = (byte)(Database.SpellTable.SpellInformations[SpellID].Count - 1);

                            spell = Database.SpellTable.SpellInformations[SpellID][choselevel];
                        }
                        if (spell == null)
                        {
                            attacker.AttackPacket = null;
                            return;
                        }
                        attacked = null;
                        attackedsob = null;
                        if (attacker.Owner.Screen.TryGetValue(Target, out attacked) || attacker.Owner.Screen.TryGetSob(Target, out attackedsob) || Target == attacker.UID || spell.Sort != 1)
                        {
                            if (Target == attacker.UID)
                                attacked = attacker;
                            if (attacked != null)
                            {
                                if (attacked.Dead && spell.Sort != Database.SpellSort.Revive && spell.ID != 10405)
                                {
                                    attacker.AttackPacket = null;
                                    return;
                                }
                            }
                            if (Target >= 400000 && Target <= 600000 || Target >= 800000)
                            {
                                if (attacked == null && attackedsob == null)
                                    return;
                            }
                            else if (Target != 0 && attackedsob == null)
                                return;
                            if (attacked != null)
                            {
                                if (attacked.EntityFlag == EntityFlag.Monster)
                                {
                                    if (spell.CanKill)
                                    {
                                        if (attacked.MonsterInfo.InSight == 0)
                                        {
                                            attacked.MonsterInfo.InSight = attacker.UID;
                                        }
                                    }
                                }
                            }
                            if (!attacker.Owner.Spells.ContainsKey(spellID))
                            {
                                if (spellID != 6012)
                                    return;
                            }
                            if (spell != null)
                            {
                                if (spell.OnlyWithThisWeaponSubtype != 0)
                                {
                                    uint firstwepsubtype, secondwepsubtype;
                                    if (!attacker.Owner.Equipment.Free(4))
                                    {
                                        firstwepsubtype = attacker.Owner.Equipment.Objects[3].ID / 1000;
                                        if (!attacker.Owner.Equipment.Free(5) && attacker.Owner.Equipment.Objects[4] != null)
                                        {
                                            secondwepsubtype = attacker.Owner.Equipment.Objects[4].ID / 1000;
                                            if (firstwepsubtype != spell.OnlyWithThisWeaponSubtype)
                                            {
                                                if (secondwepsubtype != spell.OnlyWithThisWeaponSubtype)
                                                {
                                                    attacker.AttackPacket = null;
                                                    return;
                                                }
                                            }
                                        }
                                        else
                                        {
                                            if (firstwepsubtype != spell.OnlyWithThisWeaponSubtype)
                                            {
                                                attacker.AttackPacket = null;
                                                return;
                                            }
                                        }
                                    }
                                    else
                                    {
                                        attacker.AttackPacket = null;
                                        return;
                                    }
                                }
                            }
                          //  Buffers buff = new Buffers();

                            switch (spellID)
                            {
                                #region Single magic damage spells
                                case 1000:
                                case 1001:
                                case 1002:
                                case 1150:
                                case 1160:
                                case 1180:
                                case 1320:

                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            if (attacked != null)
                                            {
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                {
                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;

                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        uint damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell);

                                                        ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                        suse.Targets.Add(attacked.UID, damage);

                                                        if (attacked.EntityFlag == EntityFlag.Player)
                                                            attacked.Owner.SendScreen(suse, true);
                                                        else
                                                            attacked.MonsterInfo.SendScreen(suse);
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                            }
                                            else
                                            {
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Distance)
                                                {
                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;

                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        uint damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell);

                                                        ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                        suse.Targets.Add(attackedsob.UID, damage);

                                                        attacker.Owner.SendScreen(suse, true);
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            attacker.AttackPacket = null;
                                        }
                                        break;
                                    }
                                #endregion
                                #region Single heal/meditation spells
                                case 1190:
                                case 1195:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            uint damage = spell.Power;
                                            if (spell.ID == 1190)
                                            {
                                                Experience = damage = Math.Min(damage, attacker.MaxHitpoints - attacker.Hitpoints);
                                                attacker.Hitpoints += damage;
                                            }
                                            else
                                            {
                                                Experience = damage = Math.Min(damage, (uint)(attacker.MaxMana - attacker.Mana));
                                                attacker.Mana += (ushort)damage;
                                            }

                                            suse.Targets.Add(attacker.UID, spell.Power);

                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                #endregion
                                #region Multi heal spells
                                case 1005:
                                case 1055:
                                case 1170:
                                case 1175:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            if (attackedsob != null)
                                            {
                                                if (attacker.MapID == 1038)
                                                    break;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Distance)
                                                {
                                                    PrepareSpell(spell, attacker.Owner);

                                                    uint damage = spell.Power;
                                                    damage = Math.Min(damage, attackedsob.MaxHitpoints - attackedsob.Hitpoints);
                                                    attackedsob.Hitpoints += damage;
                                                    Experience += damage;
                                                    suse.Targets.Add(attackedsob.UID, damage);

                                                    attacker.Owner.SendScreen(suse, true);
                                                }
                                            }
                                            else
                                            {
                                                if (spell.Multi)
                                                {
                                                    if (attacker.Owner.Team != null)
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                        {
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                            {
                                                                uint damage = spell.Power;
                                                                damage = Math.Min(damage, teammate.Entity.MaxHitpoints - teammate.Entity.Hitpoints);
                                                                teammate.Entity.Hitpoints += damage;
                                                                Experience += damage;
                                                                suse.Targets.Add(teammate.Entity.UID, damage);

                                                                if (spell.NextSpellID != 0)
                                                                {
                                                                    attack.Damage = spell.NextSpellID;
                                                                    attacker.AttackPacket = attack;
                                                                }
                                                                else
                                                                {
                                                                    attacker.AttackPacket = null;
                                                                }
                                                            }
                                                        }
                                                        if (attacked.EntityFlag == EntityFlag.Player)
                                                            attacked.Owner.SendScreen(suse, true);
                                                        else
                                                            attacked.MonsterInfo.SendScreen(suse);
                                                    }
                                                    else
                                                    {
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                        {
                                                            PrepareSpell(spell, attacker.Owner);

                                                            uint damage = spell.Power;
                                                            damage = Math.Min(damage, attacked.MaxHitpoints - attacked.Hitpoints);
                                                            attacked.Hitpoints += damage;
                                                            Experience += damage;
                                                            suse.Targets.Add(attacked.UID, damage);

                                                            if (spell.NextSpellID != 0)
                                                            {
                                                                attack.Damage = spell.NextSpellID;
                                                                attacker.AttackPacket = attack;
                                                            }
                                                            else
                                                            {
                                                                attacker.AttackPacket = null;
                                                            }
                                                            if (attacked.EntityFlag == EntityFlag.Player)
                                                                attacked.Owner.SendScreen(suse, true);
                                                            else
                                                                attacked.MonsterInfo.SendScreen(suse);
                                                        }
                                                        else
                                                        {
                                                            attacker.AttackPacket = null;
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);

                                                        uint damage = spell.Power;
                                                        damage = Math.Min(damage, attacked.MaxHitpoints - attacked.Hitpoints);
                                                        attacked.Hitpoints += damage;
                                                        Experience += damage;
                                                        suse.Targets.Add(attacked.UID, damage);

                                                        if (spell.NextSpellID != 0)
                                                        {
                                                            attack.Damage = spell.NextSpellID;
                                                            attacker.AttackPacket = attack;
                                                        }
                                                        else
                                                        {
                                                            attacker.AttackPacket = null;
                                                        }
                                                        if (attacked.EntityFlag == EntityFlag.Player)
                                                            attacked.Owner.SendScreen(suse, true);
                                                        else
                                                            attacked.MonsterInfo.SendScreen(suse);
                                                    }
                                                    else
                                                    {
                                                        attacker.AttackPacket = null;
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            attacker.AttackPacket = null;
                                        }
                                        break;
                                    }
                                #endregion
                                #region Revive
                                case 1050:
                                case 1100:
                                    {
                                        if (attackedsob != null)
                                            return;
                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                suse.Targets.Add(attacked.UID, 0);

                                                attacked.Ressurect();

                                                attacked.Owner.SendScreen(suse, true);
                                            }
                                        }
                                        break;
                                    }
                                #endregion
                                #region Linear spells
                                case 1045:
                                case 11000:
                                case 11005:
                                case 1046:
                                case 1260:
                                case 11110:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);
                                            Game.Attacking.InLineAlgorithm ila = new Conquer_Online_Server.Game.Attacking.InLineAlgorithm(attacker.X,
                                        X, attacker.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = SpellID;
                                            suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (_obj == null)
                                                    continue;
                                                if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    attacked = _obj as Entity;
                                                    if (ila.InLine(attacked.X, attacked.Y))
                                                    {
                                                        if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            continue;

                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);

                                                        attack.Damage = damage;

                                                        ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                        suse.Targets.Add(attacked.UID, damage);
                                                    }
                                                }
                                                else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    attackedsob = _obj as SobNpcSpawn;

                                                    if (ila.InLine(attackedsob.X, attackedsob.Y))
                                                    {
                                                        if (!CanAttack(attacker, attackedsob, spell))
                                                            continue;

                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                        damage = (uint)(damage * spell.PowerPercent);
                                                        attack.Damage = damage;

                                                        ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                        suse.Targets.Add(attackedsob.UID, damage);
                                                    }
                                                }
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                #endregion

                                #region XPSpells inofensive
                                case 1015:
                                case 1020:
                                case 1025:
                                case 1110:
                                case 6011:

                                case 10390:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            suse.Targets.Add(attacked.UID, 0);

                                            if (spell.ID == 6011)
                                            {
                                                attacked.FatalStrikeStamp = Time32.Now;
                                                attacked.FatalStrikeTime = 60;
                                                attacked.AddFlag(Update.Flags.CannonBarrage);
                                            }

                                            else
                                            {
                                                if (spell.ID == 1110 || spell.ID == 1025 || spell.ID == 10390)
                                                {
                                                    if (!attacked.OnKOSpell())
                                                        attacked.KOCount = 0;

                                                    attacked.KOSpell = spell.ID;
                                                    if (spell.ID == 1110)
                                                    {
                                                        attacked.CycloneStamp = Time32.Now;
                                                        attacked.CycloneTime = 20;
                                                        attacked.AddFlag(Update.Flags.Cyclone);
                                                    }
                                                    else if (spell.ID == 10390)
                                                    {
                                                        attacked.OblivionStamp = Time32.Now;
                                                        attacked.OblivionTime = 20;
                                                        attacked.AddFlag2(Update.Flags2.Oblivion);
                                                    }
                                                    else
                                                    {
                                                        attacked.SupermanStamp = Time32.Now;
                                                        attacked.SupermanTime = 20;
                                                        attacked.AddFlag(Update.Flags.Superman);
                                                    }
                                                }
                                                else
                                                {
                                                    if (spell.ID == 1020)
                                                    {
                                                        attacked.ShieldTime = 0;
                                                        attacked.ShieldStamp = Time32.Now;
                                                        attacked.MagicShieldStamp = Time32.Now;
                                                        attacked.MagicShieldTime = 0;

                                                        attacked.AddFlag(Update.Flags.MagicShield);
                                                        attacked.ShieldStamp = Time32.Now;
                                                        attacked.ShieldIncrease = spell.PowerPercent;
                                                        attacked.ShieldTime = (byte)spell.Duration;
                                                    }
                                                    else
                                                    {
                                                        attacked.AccuracyStamp = Time32.Now;
                                                        attacked.StarOfAccuracyStamp = Time32.Now;
                                                        attacked.StarOfAccuracyTime = 0;
                                                        attacked.AccuracyTime = 0;

                                                        attacked.AddFlag(Update.Flags.StarOfAccuracy);
                                                        attacked.AccuracyStamp = Time32.Now;
                                                        attacked.AccuracyTime = (byte)spell.Duration;
                                                    }
                                                }
                                            }
                                            attacked.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                #endregion
                                #region Circle spells
                                case 1010:
                                case 1115:
                                case 1120:
                                case 1125:
                                case 3090:
                                case 5001:
                                case 8030:
                                case 11040:
                                case 11070:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                            {
                                                foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (_obj == null)
                                                        continue;
                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        attacked = _obj as Entity;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                        {
                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attacked);
                                                                if (spell.Power > 0)
                                                                    damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell);
                                                                if (spell.ID == 8030)
                                                                    damage = Game.Attacking.Calculate.Ranged(attacker, attacked);

                                                                ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                                suse.Targets.Add(attacked.UID, damage);
                                                            }
                                                        }
                                                    }
                                                    else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        attackedsob = _obj as SobNpcSpawn;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                        {
                                                            if (CanAttack(attacker, attackedsob, spell))
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                                if (spell.Power > 0)
                                                                    damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell);
                                                                if (spell.ID == 8030)
                                                                    damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob);

                                                                ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                suse.Targets.Add(attackedsob.UID, damage);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                #endregion
                                #region Buffers
                                case 1075:
                                case 1085:
                                case 1090:
                                case 1095:
                                case 3080:

                                    {
                                        if (attackedsob != null)
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                suse.Targets.Add(attackedsob.UID, 0);

                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                        }
                                        else
                                        {
                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                            {
                                                if (CanUseSpell(spell, attacker.Owner))
                                                {
                                                    PrepareSpell(spell, attacker.Owner);

                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;

                                                    suse.Targets.Add(attacked.UID, 0);

                                                    if (spell.ID == 1075 || spell.ID == 1085)
                                                    {
                                                        if (spell.ID == 1075)
                                                        {
                                                            attacked.AddFlag(Update.Flags.Invisibility);
                                                            attacked.InvisibilityStamp = Time32.Now;
                                                            attacked.InvisibilityTime = (byte)spell.Duration;
                                                            if (attacked.EntityFlag == EntityFlag.Player)
                                                                attacked.Owner.Send(ServerBase.Constants.Invisibility(spell.Duration));
                                                        }
                                                        else
                                                        {
                                                            attacked.AccuracyStamp = Time32.Now;
                                                            attacked.StarOfAccuracyStamp = Time32.Now;
                                                            attacked.StarOfAccuracyTime = 0;
                                                            attacked.AccuracyTime = 0;

                                                            attacked.AddFlag(Update.Flags.StarOfAccuracy);
                                                            attacked.StarOfAccuracyStamp = Time32.Now;
                                                            attacked.StarOfAccuracyTime = (byte)spell.Duration;
                                                            if (attacked.EntityFlag == EntityFlag.Player)
                                                                attacked.Owner.Send(ServerBase.Constants.Accuracy(spell.Duration));
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (spell.ID == 1090)
                                                        {
                                                            attacked.ShieldTime = 0;
                                                            attacked.ShieldStamp = Time32.Now;
                                                            attacked.MagicShieldStamp = Time32.Now;
                                                            attacked.MagicShieldTime = 0;

                                                            attacked.AddFlag(Update.Flags.MagicShield);
                                                            attacked.MagicShieldStamp = Time32.Now;
                                                            attacked.MagicShieldIncrease = spell.PowerPercent;
                                                            attacked.MagicShieldTime = (byte)spell.Duration;
                                                            if (attacked.EntityFlag == EntityFlag.Player)
                                                                attacked.Owner.Send(ServerBase.Constants.Shield(spell.PowerPercent, spell.Duration));
                                                        }
                                                        else if (spell.ID == 1095)
                                                        {
                                                            attacked.AddFlag(Update.Flags.Stigma);
                                                            attacked.StigmaStamp = Time32.Now;
                                                            attacked.StigmaIncrease = spell.PowerPercent;
                                                            attacked.StigmaTime = (byte)spell.Duration;
                                                            if (attacked.EntityFlag == EntityFlag.Player)
                                                                attacked.Owner.Send(ServerBase.Constants.Stigma(spell.PowerPercent, spell.Duration));
                                                        }
                                                        else
                                                        {
                                                            attacked.AddFlag(Update.Flags.Dodge);
                                                            attacked.DodgeStamp = Time32.Now;
                                                            attacked.DodgeIncrease = spell.PowerPercent;
                                                            attacked.DodgeTime = (byte)spell.Duration;
                                                            if (attacked.EntityFlag == EntityFlag.Player)
                                                                attacked.Owner.Send(ServerBase.Constants.Dodge(spell.PowerPercent, spell.Duration));
                                                        }

                                                    }

                                                    if (attacked.EntityFlag == EntityFlag.Player)
                                                        attacked.Owner.SendScreen(suse, true);
                                                    else
                                                        attacked.MonsterInfo.SendScreen(suse);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                #endregion
                                #region Percent
                                case 3050:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            if (attackedsob != null)
                                            {
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Distance)
                                                {
                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;

                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        uint damage = Game.Attacking.Calculate.Percent(attackedsob, spell.PowerPercent);

                                                        attackedsob.Hitpoints -= damage;

                                                        suse.Targets.Add(attackedsob.UID, damage);

                                                        attacker.Owner.SendScreen(suse, true);
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                {
                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;

                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        uint damage = Game.Attacking.Calculate.Percent(attacked, spell.PowerPercent);

                                                        if (attacker.Owner.QualifierGroup != null)
                                                            attacker.Owner.QualifierGroup.UpdateDamage(attacker.Owner, damage);

                                                        attacked.Hitpoints -= damage;

                                                        suse.Targets.Add(attacked.UID, damage);

                                                        if (attacked.EntityFlag == EntityFlag.Player)
                                                            attacked.Owner.SendScreen(suse, true);
                                                        else
                                                            attacked.MonsterInfo.SendScreen(suse);
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                #endregion
                                #region ExtraXP
                                case 1040:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            if (attacker.Owner.Team != null)
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (teammate.Entity.UID != attacker.UID)
                                                    {
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                        {
                                                            teammate.XPCount += 20;
                                                            Update update = new Update(true);
                                                            update.UID = teammate.Entity.UID;
                                                            update.Append(Update.XPCircle, teammate.XPCount);
                                                            update.Send(teammate);
                                                            suse.Targets.Add(teammate.Entity.UID, 20);

                                                            if (spell.NextSpellID != 0)
                                                            {
                                                                attack.Damage = spell.NextSpellID;
                                                                attacker.AttackPacket = attack;
                                                            }
                                                            else
                                                            {
                                                                attacker.AttackPacket = null;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            if (attacked.EntityFlag == EntityFlag.Player)
                                                attacked.Owner.SendScreen(suse, true);
                                            else
                                                attacked.MonsterInfo.SendScreen(suse);
                                        }
                                        break;
                                    }
                                #endregion
                                #region Pure Skills
                                //SoulShackle
                                case 10405:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            if (attacked == null) return;
                                            if (attacked.EntityFlag == EntityFlag.Monster)
                                                return;
                                            if (attacked.UID == attacker.UID)
                                                return;
                                            if (!attacked.Dead)
                                                return;

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = SpellID;
                                            suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            if (attacked.BattlePower > attacker.BattlePower)
                                            {
                                                int diff = attacked.BattlePower - attacker.BattlePower;
                                                if (ServerBase.Kernel.Rate(100 - diff * 5))
                                                {
                                                    attacked.ShackleStamp = Time32.Now;
                                                    attacked.ShackleTime = (short)spell.Duration;
                                                    suse.Targets.Add(attacked.UID, 1);
                                                    attacked.AddFlag(Update.Flags.SoulShackle);
                                                    attacked.Owner.SendScreen(suse, true);
                                                }
                                            }
                                            else
                                            {
                                                attacked.ShackleStamp = Time32.Now;
                                                attacked.ShackleTime = (short)spell.Duration;
                                                suse.Targets.Add(attacked.UID, 1);
                                                attacked.AddFlag(Update.Flags.SoulShackle);
                                                attacked.Owner.SendScreen(suse, true);
                                            }
                                        }
                                        break;
                                    }
                                //AzureShield
                                case 30000:
                                    {
                                        if (attacked == null)
                                            return;
                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                suse.Targets.Add(attacked.UID, 0);
                                                attacked.Owner.SendScreen(suse, true);
                                                attacked.AzureStamp = Time32.Now;
                                                attacked.AzureTime = (short)spell.Duration;
                                                attacked.AzureDamage = spell.Power;
                                                attacked.AddFlag(Update.Flags.AzureShield);
                                            }
                                        }
                                        break;
                                    }
                                //HeavenBlade
                                case 10310:
                                    {
                                        if (attacked == null)
                                            return;
                                        spell.UseStamina = 100;
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            if (attacked != null)
                                            {
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                {
                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;

                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        uint damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell);
                                                        if (ServerBase.Kernel.Rate(spell.Percent))
                                                        {
                                                            damage = ReceiveAttack(suse, attacker, attacked, attack, damage, spell);

                                                            suse.Targets.Add(attacked.UID, damage);
                                                        }
                                                        else
                                                        {
                                                            damage = 0;
                                                            suse.Targets.Add(attacked.UID, damage);
                                                        }

                                                        if (attacked.EntityFlag == EntityFlag.Player)
                                                            attacked.Owner.SendScreen(suse, true);
                                                        else
                                                            attacked.MonsterInfo.SendScreen(suse);
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                            }
                                            else
                                            {
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Distance)
                                                {
                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;

                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        uint damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell);
                                                        if (ServerBase.Kernel.Rate(spell.Percent))
                                                        {
                                                            ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                            suse.Targets.Add(attackedsob.UID, damage);
                                                        }
                                                        else
                                                        {
                                                            damage = 0;
                                                            suse.Targets.Add(attackedsob.UID, damage);
                                                        }

                                                        attacker.Owner.SendScreen(suse, true);
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            attacker.AttackPacket = null;
                                        }
                                        break;
                                    }
                                //StarArrow
                                case 10313:
                                    {
                                        spell.UseStamina = 50;
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            if (attacked != null)
                                            {
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                {
                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = attacked.X;
                                                    suse.Y = attacked.Y;

                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, spell);

                                                        damage = ReceiveAttack(suse, attacker, attacked, attack, damage, spell);

                                                        suse.Targets.Add(attacked.UID, damage);

                                                        if (attacked.EntityFlag == EntityFlag.Player)
                                                            attacked.Owner.SendScreen(suse, true);
                                                        else
                                                            attacked.MonsterInfo.SendScreen(suse);
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                            }
                                            else
                                            {
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Distance)
                                                {
                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;

                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob);

                                                        ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                        suse.Targets.Add(attackedsob.UID, damage);

                                                        attacker.Owner.SendScreen(suse, true);
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            attacker.AttackPacket = null;
                                        }
                                        break;
                                    }
                                //DragonWhirl
                                #region DragonWhirl
                                case 10315:
                                    {
                                        if (attacker.Stamina >= 30)
                                        {
                                            attacker.Stamina -= 30;
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                attack.X = X;
                                                attack.Y = Y;
                                                attack.Attacker = attacker.UID;
                                                attack.AttackType = 53;
                                                attack.X = X;
                                                attack.Y = Y;
                                                Writer.WriteUInt16(spell.ID, 24, attack.ToArray());
                                                Writer.WriteByte(spell.Level, 26, attack.ToArray());
                                                attacker.Owner.SendScreen(attack, true);
                                                attacker.X = X;
                                                attacker.Y = Y;

                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                                {
                                                    foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                    {
                                                        if (_obj == null)
                                                            continue;
                                                        if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                        {
                                                            attacked = _obj as Entity;
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                            {
                                                                if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                {
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attacked);
                                                                    uint DamageAdd = (damage * 150) / 100;
                                                                    if (spell.Power > 0)
                                                                        damage = (uint)(DamageAdd + Game.Attacking.Calculate.Magic(attacker, attacked, spell));

                                                                    ReceiveAttack(suse, attacker, attacked, attack, damage, spell);
                                                                    suse.Targets.Add(attacked.UID, damage);

                                                                }
                                                            }
                                                        }
                                                        else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                        {
                                                            attackedsob = _obj as SobNpcSpawn;
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Distance)
                                                            {
                                                                if (CanAttack(attacker, attackedsob, spell))
                                                                {
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                                    uint DamageAdd = (damage * 150) / 100;
                                                                    if (spell.Power > 0)
                                                                        damage = (uint)(DamageAdd + Game.Attacking.Calculate.Magic(attacker, attacked, spell));

                                                                    ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                    suse.Targets.Add(attackedsob.UID, damage);

                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                        }
                                        break;
                                    }
                                #endregion
                                #endregion

                                #region WeaponSpells
                                #region Circle
                                case 5010:
                                case 7020:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            if (suse.SpellID != 10415)
                                            {
                                                suse.X = X;
                                                suse.Y = Y;
                                            }
                                            else
                                            {
                                                suse.X = 6;
                                            }
                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
                                            {
                                                foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (_obj == null)
                                                        continue;
                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        attacked = _obj as Entity;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                        {
                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                PrepareSpell(spell, attacker.Owner);
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);

                                                                ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                                suse.Targets.Add(attacked.UID, damage);
                                                            }
                                                        }
                                                    }
                                                    else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        attackedsob = _obj as SobNpcSpawn;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                        {
                                                            if (CanAttack(attacker, attackedsob, spell))
                                                            {
                                                                PrepareSpell(spell, attacker.Owner);
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                                damage = (uint)(damage * spell.PowerPercent);
                                                                ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                suse.Targets.Add(attackedsob.UID, damage);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }

                                        break;
                                    }
                                #endregion
                                #region Single target
                                case 10490:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            TryTrip suse = new TryTrip(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;

                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
                                            {
                                                if (attackedsob != null)
                                                {
                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                        damage = (uint)(damage * spell.PowerPercent);
                                                        ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                        suse.Damage = damage;
                                                        suse.Attacked = attackedsob.UID;
                                                    }
                                                }
                                                else
                                                {
                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);

                                                        ReceiveAttack(attacker, attacked, attack, damage, spell);
                                                        suse.Damage = damage;
                                                        suse.Attacked = attacked.UID;
                                                    }
                                                }
                                                attacker.AttackPacket = null;
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        attacker.AttackPacket = null;
                                        break;
                                    }
                                case 1290:
                                case 5030:
                                case 5040:
                                case 7000:
                                case 7010:
                                case 7030:
                                case 7040:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange)
                                            {
                                                if (attackedsob != null)
                                                {
                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                        damage = (uint)(damage * spell.PowerPercent);
                                                        ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                        suse.Targets.Add(attackedsob.UID, damage);
                                                    }
                                                }
                                                else
                                                {
                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);

                                                        ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                        suse.Targets.Add(attacked.UID, damage);
                                                    }
                                                }
                                                attacker.AttackPacket = null;
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        attacker.AttackPacket = null;
                                        break;
                                    }
                                #endregion
                                #region Sector
                                case 1250:
                                case 5050:
                                case 5020:
                                case 1300:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            Sector sector = new Sector(attacker.X, attacker.Y, X, Y);
                                            sector.Arrange(spell.Sector, spell.Range);
                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance + 1)
                                            {
                                                foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (_obj == null)
                                                        continue;
                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        attacked = _obj as Entity;

                                                        if (sector.Inside(attacked.X, attacked.Y))
                                                        {
                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);

                                                                ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                                suse.Targets.Add(attacked.UID, damage);
                                                            }
                                                        }
                                                    }
                                                    else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        attackedsob = _obj as SobNpcSpawn;

                                                        if (sector.Inside(attackedsob.X, attackedsob.Y))
                                                        {
                                                            if (CanAttack(attacker, attackedsob, spell))
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                                damage = (uint)(damage * spell.PowerPercent);
                                                                ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                suse.Targets.Add(attackedsob.UID, damage);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                #endregion
                                #endregion
                                #region Fly
                                case 8002:
                                case 8003:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            attacked.FlyStamp = Time32.Now;
                                            attacked.FlyTime = (byte)spell.Duration;

                                            suse.Targets.Add(attacked.UID, attacked.FlyTime);
                                            attacked.RemoveFlag(Update.Flags.Ride);
                                            attacked.AddFlag(Update.Flags.Fly);

                                            attacked.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                #endregion
                                #region Ninja Spells
                                case 6010://Vortex
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            attacker.AddFlag(Update.Flags.ShurikenVortex);
                                            attacker.ShurikenVortexStamp = Time32.Now;
                                            attacker.ShurikenVortexTime = 20;

                                            attacker.Owner.SendScreen(suse, true);

                                            attacker.VortexPacket = new Attack(true);
                                            attacker.VortexPacket.Decoded = true;
                                            attacker.VortexPacket.Damage = 6012;
                                            attacker.VortexPacket.AttackType = Attack.Magic;
                                            attacker.VortexPacket.Attacker = attacker.UID;
                                        }
                                        break;
                                    }
                                case 6012://VortexRespone
                                    {
                                        if (!attacker.ContainsFlag(Update.Flags.ShurikenVortex))
                                        {
                                            attacker.AttackPacket = null;
                                            break;
                                        }
                                        SpellUse suse = new SpellUse(true);
                                        suse.Attacker = attacker.UID;
                                        suse.SpellID = spell.ID;
                                        suse.SpellLevel = spell.Level;
                                        suse.X = attacker.X;
                                        suse.Y = attacker.Y;
                                        foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                        {
                                            if (_obj == null)
                                                continue;
                                            if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                            {
                                                attacked = _obj as Entity;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                {
                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attacked);

                                                        ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                        suse.Targets.Add(attacked.UID, damage);
                                                    }
                                                }
                                            }
                                            else if (_obj.MapObjType == MapObjectType.SobNpc)
                                            {
                                                attackedsob = _obj as SobNpcSpawn;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                {
                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);

                                                        ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                        suse.Targets.Add(attackedsob.UID, damage);
                                                    }
                                                }
                                            }
                                        }
                                        attacker.Owner.SendScreen(suse, true);
                                        break;
                                    }
                                case 6001:
                                    {

                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance)
                                            {

                                                foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        attacked = _obj as Entity;
                                                        if (ServerBase.Kernel.GetDistance(X, Y, attacked.X, attacked.Y) <= spell.Range)
                                                        {
                                                            if (attacked.Name == "TeratoDragon")//SnowBanshee
                                                                continue;
                                                            if (attacked.Name == "SnowBanshee")//SnowBanshee
                                                                continue;
                                                            if (attacked.Name == "ThrillingSpook")//SnowBanshee
                                                                continue;
                                                            if (attacked.Name == "SwordMaster")//SnowBanshee
                                                                continue;
                                                            if (attacked.Name == "LavaBeast")//SnowBanshee
                                                                continue;
                                                            if (attacked.Name == "Guard1")//SnowBanshee
                                                                continue;
                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                int potDifference = attacker.BattlePower - attacked.BattlePower;

                                                                int rate = spell.Percent + potDifference;
                                                                // uint dmg = (uint)((attacked.Hitpoints * ((10))) / 100);
                                                                if (attacked.Statistics.Detoxication > 0 && attacked.Statistics.Detoxication < 100)
                                                                    rate = (int)((rate * attacked.Statistics.Detoxication) / 100);
                                                                if (attacked.Statistics.Detoxication >= 100)
                                                                    rate = 0;
                                                                if (ServerBase.Kernel.Rate(rate))
                                                                {
                                                                    attacked.ToxicFogStamp = Time32.Now;
                                                                    attacked.ToxicFogLeft = 20;
                                                                    attacked.ToxicFogPercent = spell.PowerPercent;
                                                                    suse.Targets.Add(attacked.UID, 1);

                                                                }
                                                                else
                                                                {
                                                                    suse.Targets.Add(attacked.UID, 0);
                                                                    suse.Targets[attacked.UID].Hit = false;
                                                                }
                                                                if (attacked.Hitpoints <= 1)
                                                                {
                                                                    //client.Entity.Poison = null;
                                                                    suse.Targets.Add(attacked.UID, 0);
                                                                    suse.Targets[attacked.UID].Hit = false;
                                                                    //attacked.Update(true, false, true, Game.Enums.Poison);

                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                case 6000:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            ushort Xx, Yx;
                                            if (attacked != null)
                                            {
                                                Xx = attacked.X;
                                                Yx = attacked.Y;
                                            }
                                            else
                                            {
                                                Xx = attackedsob.X;
                                                Yx = attackedsob.Y;
                                            }
                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, Xx, Yx) <= spell.Range)
                                            {
                                                if (attackedsob == null)
                                                    if (attacked.ContainsFlag(Network.GamePackets.Update.Flags.Fly))
                                                        return;
                                                if (attacked.ContainsFlag(Network.GamePackets.Update.Flags.Fly))
                                                    return;
                                                if (attacker.ContainsFlag(Network.GamePackets.Update.Flags.Fly))
                                                    return;
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                bool send = false;

                                                if (attackedsob == null)
                                                {
                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);

                                                        ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                        suse.Targets.Add(attacked.UID, damage);
                                                        send = true;
                                                    }
                                                }
                                                else
                                                {
                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                        damage = (uint)(damage * spell.PowerPercent);
                                                        ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                        suse.Targets.Add(attackedsob.UID, damage);
                                                        send = true;
                                                    }
                                                }
                                                if (send)
                                                    attacker.Owner.SendScreen(suse, true);
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                        }
                                        break;
                                    }
                                case 6002:
                                    {
                                        if (attackedsob != null)
                                            return;
                                        if (attacked.EntityFlag == EntityFlag.Monster)
                                            return;
                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                int potDifference = attacker.BattlePower - attacked.BattlePower;

                                                int rate = spell.Percent + potDifference;

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                if (CanAttack(attacker, attacked, spell, false))
                                                {
                                                    suse.Targets.Add(attacked.UID, 0);
                                                    if (ServerBase.Kernel.Rate(rate))
                                                    {
                                                        attacked.NoDrugsStamp = Time32.Now;
                                                        attacked.NoDrugsTime = (short)spell.Duration;
                                                        if (attacked.EntityFlag == EntityFlag.Player)
                                                        {
                                                            attacked.Owner.Send(ServerBase.Constants.NoDrugs(spell.Duration));
                                                        }
                                                    }
                                                    else
                                                    {
                                                        suse.Targets[attacked.UID].Hit = false;
                                                    }

                                                    attacked.Owner.SendScreen(suse, true);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                case 6004:
                                    {
                                        if (attackedsob != null)
                                            return;
                                        if (attacked.EntityFlag == EntityFlag.Monster)
                                            return;
                                        if (!attacked.ContainsFlag(Update.Flags.Fly))
                                            return;
                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                int potDifference = attacker.BattlePower - attacked.BattlePower;

                                                int rate = spell.Percent + potDifference;

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                if (CanAttack(attacker, attacked, spell, false))
                                                {
                                                    uint dmg = Calculate.Percent(attacked, 0.1F);
                                                    suse.Targets.Add(attacked.UID, dmg);

                                                    if (ServerBase.Kernel.Rate(rate))
                                                    {
                                                        attacked.Hitpoints -= dmg;
                                                        attacked.RemoveFlag(Update.Flags.Fly);
                                                    }
                                                    else
                                                    {
                                                        suse.Targets[attacked.UID].Hit = false;
                                                    }

                                                    attacked.Owner.SendScreen(suse, true);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                #endregion
                                #region Riding
                                case 7001:
                                    {
                                        if (!attacker.Owner.Equipment.Free(12))
                                        {
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            if (attacker.ContainsFlag(Update.Flags.Ride))
                                            {
                                                attacker.RemoveFlag(Update.Flags.Ride);
                                            }
                                            else
                                            {
                                                if (attacker.Owner.Map.ID == 1036 && attacker.Owner.Equipment.TryGetItem((byte)12).Plus < 6)
                                                    break;
                                                if (attacker.Stamina >= 100 && (attacker.Owner.QualifierGroup == null || attacker.Owner.QualifierGroup != null && !attacker.Owner.QualifierGroup.Inside))
                                                {
                                                    attacker.AddFlag(Update.Flags.Ride);
                                                    attacker.Stamina -= 100;
                                                    Network.GamePackets.Vigor vigor = new Network.GamePackets.Vigor(true);
                                                    vigor.VigorValue = attacker.Owner.Entity.MaxVigor;
                                                    vigor.Send(attacker.Owner);
                                                }
                                            }
                                            suse.Targets.Add(attacker.UID, 0);
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                case 7002:
                                    {//Spook
                                        if (attacked.ContainsFlag(Update.Flags.Ride) && attacker.ContainsFlag(Update.Flags.Ride))
                                        {
                                            Interfaces.IConquerItem attackedSteed = null, attackerSteed = null;
                                            if ((attackedSteed = attacked.Owner.Equipment.TryGetItem(ConquerItem.Steed)) != null)
                                            {
                                                if ((attackerSteed = attacker.Owner.Equipment.TryGetItem(ConquerItem.Steed)) != null)
                                                {
                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;
                                                    suse.Targets.Add(attacked.UID, 0);

                                                    if (attackedSteed.Plus < attackerSteed.Plus)
                                                        attacked.RemoveFlag(Update.Flags.Ride);
                                                    else if (attackedSteed.Plus == attackerSteed.Plus && attackedSteed.PlusProgress <= attackerSteed.PlusProgress)
                                                        attacked.RemoveFlag(Update.Flags.Ride);
                                                    else
                                                        suse.Targets[attacked.UID].Hit = false;
                                                    attacker.Owner.SendScreen(suse, true);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                case 7003:
                                    {//WarCry
                                        SpellUse suse = new SpellUse(true);
                                        suse.Attacker = attacker.UID;
                                        suse.SpellID = spell.ID;
                                        suse.SpellLevel = spell.Level;
                                        suse.X = X;
                                        suse.Y = Y;
                                        Interfaces.IConquerItem attackedSteed = null, attackerSteed = null;
                                        foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                        {
                                            if (_obj == null)
                                                continue;
                                            if (_obj.MapObjType == MapObjectType.Player && _obj.UID != attacker.UID)
                                            {
                                                attacked = _obj as Entity;
                                                if ((attackedSteed = attacked.Owner.Equipment.TryGetItem(ConquerItem.Steed)) != null)
                                                {
                                                    if ((attackerSteed = attacker.Owner.Equipment.TryGetItem(ConquerItem.Steed)) != null)
                                                    {
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= attackedSteed.Plus)
                                                        {
                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                suse.Targets.Add(attacked.UID, 0);
                                                                if (attackedSteed.Plus < attackerSteed.Plus)
                                                                    attacked.RemoveFlag(Update.Flags.Ride);
                                                                else if (attackedSteed.Plus == attackerSteed.Plus && attackedSteed.PlusProgress <= attackerSteed.PlusProgress)
                                                                    attacked.RemoveFlag(Update.Flags.Ride);
                                                                else
                                                                    suse.Targets[attacked.UID].Hit = false;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        attacker.Owner.SendScreen(suse, true);
                                        break;
                                    }
                                #endregion
                                #region Dash
                                case 1051:
                                    {
                                        if (attacked != null)
                                        {
                                            if (!attacked.Dead)
                                            {
                                                var direction = ServerBase.Kernel.GetAngle(attacker.X, attacker.Y, attacked.X, attacked.Y);
                                                if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                {
                                                    uint damage = Calculate.Melee(attacker, attacked);
                                                    attack = new Attack(true);
                                                    attack.AttackType = Attack.Dash;
                                                    attack.X = attacked.X;
                                                    attack.Y = attacked.Y;
                                                    attack.Attacker = attacker.UID;
                                                    attack.Attacked = attacked.UID;
                                                    attack.Damage = damage;
                                                    attack.ToArray()[27] = (byte)direction;
                                                    attacked.Move(direction);
                                                    attacker.Move(direction);

                                                    ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                    attacker.Owner.SendScreen(attack, true);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                #endregion
                                #region RapidFire
                                case 8000:
                                    {
                                        if (attackedsob != null)
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                if (CanAttack(attacker, attackedsob, spell))
                                                {
                                                    PrepareSpell(spell, attacker.Owner);
                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = attackedsob.X;
                                                    suse.Y = attackedsob.Y;
                                                    uint damage = Calculate.Ranged(attacker, attackedsob);
                                                    damage = (uint)(damage * spell.PowerPercent);
                                                    suse.Targets.Add(attackedsob.UID, damage);

                                                    ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                    attacker.Owner.SendScreen(suse, true);
                                                }
                                            }
                                        }
                                        else
                                        {
                                            if (!attacked.Dead)
                                            {
                                                if (CanUseSpell(spell, attacker.Owner))
                                                {
                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        SpellUse suse = new SpellUse(true);
                                                        suse.Attacker = attacker.UID;
                                                        suse.SpellID = spell.ID;
                                                        suse.SpellLevel = spell.Level;
                                                        suse.X = attacked.X;
                                                        suse.Y = attacked.Y;
                                                        uint damage = Calculate.Ranged(attacker, attacked);
                                                        damage = (uint)(damage * spell.PowerPercent);
                                                        suse.Targets.Add(attacked.UID, damage);

                                                        ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                        attacker.Owner.SendScreen(suse, true);
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                #endregion
                                #region FireOfHell
                                case 1165:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            Sector sector = new Sector(attacker.X, attacker.Y, X, Y);
                                            sector.Arrange(spell.Sector, spell.Distance);
                                            foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (_obj == null)
                                                    continue;
                                                if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    attacked = _obj as Entity;

                                                    if (sector.Inside(attacked.X, attacked.Y))
                                                    {
                                                        if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            uint damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell);

                                                            ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                            suse.Targets.Add(attacked.UID, damage);
                                                        }
                                                    }
                                                }
                                                else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    attackedsob = _obj as SobNpcSpawn;

                                                    if (sector.Inside(attackedsob.X, attackedsob.Y))
                                                    {
                                                        if (CanAttack(attacker, attackedsob, spell))
                                                        {
                                                            uint damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell);

                                                            ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                            suse.Targets.Add(attackedsob.UID, damage);
                                                        }
                                                    }
                                                }
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                #endregion
                                #region Scatter
                                case 8001:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            Sector sector = new Sector(attacker.X, attacker.Y, X, Y);
                                            sector.Arrange(spell.Sector, spell.Distance);
                                            foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (_obj == null)
                                                    continue;
                                                if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    attacked = _obj as Entity;

                                                    if (sector.Inside(attacked.X, attacked.Y))
                                                    {
                                                        if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, spell);

                                                            ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                            suse.Targets.Add(attacked.UID, damage);
                                                        }
                                                    }
                                                }
                                                else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    attackedsob = _obj as SobNpcSpawn;

                                                    if (sector.Inside(attackedsob.X, attackedsob.Y))
                                                    {
                                                        if (CanAttack(attacker, attackedsob, spell))
                                                        {
                                                            uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob);
                                                            if (damage == 0)
                                                                damage = 1;
                                                            damage = Game.Attacking.Calculate.Percent((int)damage, spell.PowerPercent);

                                                            ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                            suse.Targets.Add(attackedsob.UID, damage);
                                                        }
                                                    }
                                                }
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                #endregion
                                #region Intensify
                                case 9000:
                                    {
                                        attacker.IntensifyStamp = Time32.Now;
                                        attacker.OnIntensify = true;
                                        SpellUse suse = new SpellUse(true);
                                        suse.Attacker = attacker.UID;
                                        suse.SpellID = spell.ID;
                                        suse.SpellLevel = spell.Level;
                                        suse.X = X;
                                        suse.Y = Y;
                                        suse.Targets.Add(attacker.UID, 0);
                                        suse.Send(attacker.Owner);
                                        break;
                                    }
                                #endregion

                                #region Pirate Spells

                                #region Xp Skills
                                case 11050: //Cannon Barrage
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            attacker.CannonBarageStamp = Time32.Now;
                                            attacker.Cannonbarage = 30;
                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                            {
                                                for (int c = 0; c < attacker.Owner.Screen.Objects.Count(); c++)
                                                {
                                                    //For a multi threaded application, while we go through the collection
                                                    //the collection might change. We will make sure that we wont go off
                                                    //the limits with a check.
                                                    if (c >= attacker.Owner.Screen.Objects.Count())
                                                        break;
                                                    Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                    if (_obj == null)
                                                        continue;
                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        attacked = _obj as Entity;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                        {
                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attacked);
                                                                if (spell.Power > 0)
                                                                    damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell);
                                                                if (spell.ID == 8030)
                                                                    damage = Game.Attacking.Calculate.Ranged(attacker, attacked);
                                                                damage = ReceiveAttack(suse, attacker, attacked, attack, damage, spell);
                                                                suse.Targets.Add(attacked.UID, damage);
                                                                //attacked.AddFlag(Update.Effects.CannonBarrage);
                                                            }
                                                        }
                                                    }
                                                    else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        attackedsob = _obj as SobNpcSpawn;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                        {
                                                            if (CanAttack(attacker, attackedsob, spell))
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                                if (spell.Power > 0)
                                                                    damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell);
                                                                if (spell.ID == 8030)
                                                                    damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob);
                                                                ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                suse.Targets.Add(attackedsob.UID, damage);
                                                                //attacked.AddFlag(Update.Effects.CannonBarrage);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                case 11060: // BlackPearl Rage
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            attacker.BlackBeardStamp = Time32.Now;
                                            attacker.Blackbeard = 30;
                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                            {
                                                for (int c = 0; c < attacker.Owner.Screen.Objects.Count(); c++)
                                                {
                                                    //For a multi threaded application, while we go through the collection
                                                    //the collection might change. We will make sure that we wont go off
                                                    //the limits with a check.
                                                    if (c >= attacker.Owner.Screen.Objects.Count())
                                                        break;
                                                    Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                    if (_obj == null)
                                                        continue;
                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        attacked = _obj as Entity;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                        {
                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attacked);
                                                                if (spell.Power > 0)
                                                                    damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell);
                                                                if (spell.ID == 8030)
                                                                    damage = Game.Attacking.Calculate.Ranged(attacker, attacked);
                                                                damage = ReceiveAttack(suse, attacker, attacked, attack, damage, spell);
                                                                suse.Targets.Add(attacked.UID, damage);
                                                                attacked.AddFlag(Update.Effects.EagleEye);
                                                            }
                                                        }
                                                    }
                                                    else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        attackedsob = _obj as SobNpcSpawn;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                        {
                                                            if (CanAttack(attacker, attackedsob, spell))
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                                if (spell.Power > 0)
                                                                    damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell);
                                                                if (spell.ID == 8030)
                                                                    damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob);
                                                                ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                suse.Targets.Add(attackedsob.UID, damage);
                                                                attacked.AddFlag(Update.Effects.EagleEye);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                #endregion

                                #region Auto On Skills
                                case 11120: //Adrenaline Rush
                                case 11130: //BlackSpot
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
                                            {
                                                if (attackedsob != null)
                                                {
                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        suse.MakeConst();
                                                        for (uint c = 0; c < 3; c++)
                                                        {
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                            if (damage > attackedsob.Hitpoints)
                                                                damage = attackedsob.Hitpoints;

                                                            ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                            suse.Targets.Add(attackedsob.UID + c, damage);
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        suse.MakeConst();
                                                        for (uint c = 0; c < 3; c++)
                                                        {
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);
                                                            if (damage > attacked.Hitpoints)
                                                                damage = attacked.Hitpoints;
                                                            damage = ReceiveAttack(suse, attacker, attacked, attack, damage, spell);

                                                            suse.Targets.Add(attacked.UID + c, damage);
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                #endregion // Doesnt Work // Doest Work

                                #region WeaponSkills
                                case 11140: //windstorm
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
                                            {
                                                if (attackedsob != null)
                                                {
                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        suse.MakeConst();
                                                        for (uint c = 0; c < 3; c++)
                                                        {
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                            if (damage > attackedsob.Hitpoints)
                                                                damage = attackedsob.Hitpoints;

                                                            ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                            suse.Targets.Add(attackedsob.UID + c, damage);
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        suse.MakeConst();
                                                        for (uint c = 0; c < 3; c++)
                                                        {
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);
                                                            if (damage > attacked.Hitpoints)
                                                                damage = attacked.Hitpoints;
                                                            damage = ReceiveAttack(suse, attacker, attacked, attack, damage, spell);

                                                            suse.Targets.Add(attacked.UID + c, damage);
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                #endregion // Doesnt Work

                                #region Linear Skills
                                /*case 11110: //Blade Tempest
                                    {
                                        if (Time32.Now < attacker.WhilrwindKick.AddMilliseconds(1500))
                                            return;
                                        attacker.WhilrwindKick = Time32.Now;
                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)//<= 3
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                //suse.X = (ushort)ServerBase.Kernel.Random.Next(3, 10);
                                                suse.X = X;
                                                //suse.Y = 0;
                                                suse.Y = Y;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                                {
                                                    for (int c = 0; c < attacker.Owner.Screen.Objects.Count(); c++)
                                                    {
                                                        //For a multi threaded application, while we go through the collection
                                                        //the collection might change. We will make sure that we wont go off
                                                        //the limits with a check.
                                                        if (c >= attacker.Owner.Screen.Objects.Count())
                                                            break;
                                                        Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                        if (_obj == null)
                                                            continue;
                                                        if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                        {
                                                            attacked = _obj as Entity;
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                            {
                                                                if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Ranged))
                                                                {
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attacked);

                                                                    damage = ReceiveAttack(suse, attacker, attacked, attack, damage, spell);
                                                                    attacked.Stunned = true;
                                                                    attacked.StunStamp = Time32.Now;
                                                                    suse.Targets.Add(attacked.UID, damage);
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                        }
                                        break;
                                    }*/
                                #endregion

                                #region Single damage Skill
                                case 11030: // Eagle Eye
                                    if (CanUseSpell(spell, attacker.Owner))
                                    {
                                        PrepareSpell(spell, attacker.Owner);

                                        SpellUse suse = new SpellUse(true);
                                        suse.Attacker = attacker.UID;
                                        suse.SpellID = spell.ID;
                                        suse.SpellLevel = spell.Level;
                                        suse.X = X;
                                        suse.Y = Y;
                                        suse.Targets.Add(attacker.UID, spell.Power);
                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance)
                                        {
                                            if (attackedsob != null)
                                            {
                                                if (CanAttack(attacker, attackedsob, spell))
                                                {
                                                    PrepareSpell(spell, attacker.Owner);
                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                    damage = (uint)(damage * spell.PowerPercent * 30);
                                                    ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                    suse.Targets.Add(attackedsob.UID, damage);
                                                }
                                            }
                                            else
                                            {
                                                if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                {
                                                    PrepareSpell(spell, attacker.Owner);
                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);
                                                    damage = ReceiveAttack(suse, attacker, attacked, attack, damage, spell);
                                                    suse.Targets.Add(attacked.UID, damage);
                                                    attacked.AddFlag(Update.Effects.EagleEye);
                                                }
                                            }
                                        }
                                        attacker.Owner.SendScreen(suse, true);
                                    }
                                    break;
                                #endregion

                                #region Region Damage Skills
                                case 11100: //kracken revenge
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                            {
                                                for (int c = 0; c < attacker.Owner.Screen.Objects.Count(); c++)
                                                {
                                                    //For a multi threaded application, while we go through the collection
                                                    //the collection might change. We will make sure that we wont go off
                                                    //the limits with a check.
                                                    if (c >= attacker.Owner.Screen.Objects.Count())
                                                        break;
                                                    Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                    if (_obj == null)
                                                        continue;
                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        attacked = _obj as Entity;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                        {
                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attacked);
                                                                if (spell.Power > 0)
                                                                    damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell);
                                                                if (spell.ID == 8030)
                                                                    damage = Game.Attacking.Calculate.Ranged(attacker, attacked);
                                                                damage = ReceiveAttack(suse, attacker, attacked, attack, damage, spell);
                                                                suse.Targets.Add(attacked.UID, damage);
                                                                attacked.AddFlag(Update.Effects.KrackenRevenge);
                                                            }
                                                        }
                                                    }
                                                    else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        attackedsob = _obj as SobNpcSpawn;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                        {
                                                            if (CanAttack(attacker, attackedsob, spell))
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                                if (spell.Power > 0)
                                                                    damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell);
                                                                if (spell.ID == 8030)
                                                                    damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob);
                                                                ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                suse.Targets.Add(attackedsob.UID, damage);
                                                                attacked.AddFlag(Update.Effects.KrackenRevenge);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                /*case 11040: // Scurvey Bomb
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                            {
                                                for (int c = 0; c < attacker.Owner.Screen.Objects.Count(); c++)
                                                {
                                                    //For a multi threaded application, while we go through the collection
                                                    //the collection might change. We will make sure that we wont go off
                                                    //the limits with a check.
                                                    if (c >= attacker.Owner.Screen.Objects.Count())
                                                        break;
                                                    Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                    if (_obj == null)
                                                        continue;
                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        attacked = _obj as Entity;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                        {
                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attacked);
                                                                if (spell.Power > 0)
                                                                    damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell);
                                                                if (spell.ID == 8030)
                                                                    damage = Game.Attacking.Calculate.Ranged(attacker, attacked);
                                                                damage = ReceiveAttack(suse, attacker, attacked, attack, damage, spell);
                                                                suse.Targets.Add(attacked.UID, damage);
                                                                attacked.Update(_String.Effect, "pro_gre_assflo", true);
                                                            }
                                                        }
                                                    }
                                                    else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        attackedsob = _obj as SobNpcSpawn;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                        {
                                                            if (CanAttack(attacker, attackedsob, spell))
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                                if (spell.Power > 0)
                                                                    damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell);
                                                                if (spell.ID == 8030)
                                                                    damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob);
                                                                ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                suse.Targets.Add(attackedsob.UID, damage);
                                                                //attacked.Update(_String.Effect, "pro_gre_assflo", true);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }*/
                               /* case 11070: // Gale Bomb
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                            {
                                                for (int c = 0; c < attacker.Owner.Screen.Objects.Count(); c++)
                                                {
                                                    //For a multi threaded application, while we go through the collection
                                                    //the collection might change. We will make sure that we wont go off
                                                    //the limits with a check.
                                                    if (c >= attacker.Owner.Screen.Objects.Count())
                                                        break;
                                                    Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                    if (_obj == null)
                                                        continue;
                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        attacked = _obj as Entity;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                        {
                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attacked);
                                                                if (spell.Power > 0)
                                                                    damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell);
                                                                if (spell.ID == 8030)
                                                                    damage = Game.Attacking.Calculate.Ranged(attacker, attacked);
                                                                damage = ReceiveAttack(suse, attacker, attacked, attack, damage, spell);
                                                                suse.Targets.Add(attacked.UID, damage);
                                                                attacked.Update(_String.Effect, "pro_tir_assflo", true);
                                                            }
                                                        }
                                                    }
                                                    else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        attackedsob = _obj as SobNpcSpawn;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                        {
                                                            if (CanAttack(attacker, attackedsob, spell))
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                                if (spell.Power > 0)
                                                                    damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell);
                                                                if (spell.ID == 8030)
                                                                    damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob);
                                                                ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                suse.Targets.Add(attackedsob.UID, damage);
                                                                attacked.Update(_String.Effect, "pro_tir_assflo", true);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }*/
                                #endregion

                                #endregion

                                #region Trasnformations
                                case 1270:
                                case 1280:
                                case 1350:
                                case 1360:
                                case 3321:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            if (attacker.MapID == 1036)
                                                return;
                                            bool wasTransformated = attacker.Transformed;
                                            PrepareSpell(spell, attacker.Owner);

                                            #region Atributes
                                            switch (spell.ID)
                                            {
                                                case 1350:
                                                    switch (spell.Level)
                                                    {
                                                        case 0:
                                                            {
                                                                attacker.TransformationMaxAttack = 182;
                                                                attacker.TransformationMinAttack = 122;
                                                                attacker.TransformationDefence = 1300;
                                                                attacker.TransformationMagicDefence = 94;
                                                                attacker.TransformationDodge = 35;
                                                                attacker.TransformationTime = 39;
                                                                attacker.TransformationID = 207;
                                                                break;
                                                            }
                                                        case 1:
                                                            {
                                                                attacker.TransformationMaxAttack = 200;
                                                                attacker.TransformationMinAttack = 134;
                                                                attacker.TransformationDefence = 1400;
                                                                attacker.TransformationMagicDefence = 96;
                                                                attacker.TransformationDodge = 40;
                                                                attacker.TransformationTime = 49;
                                                                attacker.TransformationID = 207;
                                                                break;
                                                            }
                                                        case 2:
                                                            {
                                                                attacker.TransformationMaxAttack = 240;
                                                                attacker.TransformationMinAttack = 160;
                                                                attacker.TransformationDefence = 1500;
                                                                attacker.TransformationMagicDefence = 97;
                                                                attacker.TransformationDodge = 45;
                                                                attacker.TransformationTime = 59;
                                                                attacker.TransformationID = 207;
                                                                break;
                                                            }
                                                        case 3:
                                                            {
                                                                attacker.TransformationMaxAttack = 258;
                                                                attacker.TransformationMinAttack = 172;
                                                                attacker.TransformationDefence = 1600;
                                                                attacker.TransformationMagicDefence = 98;
                                                                attacker.TransformationDodge = 50;
                                                                attacker.TransformationTime = 69;
                                                                attacker.TransformationID = 267;
                                                                break;
                                                            }
                                                        case 4:
                                                            {
                                                                attacker.TransformationMaxAttack = 300;
                                                                attacker.TransformationMinAttack = 200;
                                                                attacker.TransformationDefence = 1900;
                                                                attacker.TransformationMagicDefence = 99;
                                                                attacker.TransformationDodge = 55;
                                                                attacker.TransformationTime = 79;
                                                                attacker.TransformationID = 267;
                                                                break;
                                                            }
                                                    }
                                                    break;
                                                case 1270:
                                                    switch (spell.Level)
                                                    {
                                                        case 0:
                                                            {
                                                                attacker.TransformationMaxAttack = 282;
                                                                attacker.TransformationMinAttack = 179;
                                                                attacker.TransformationDefence = 73;
                                                                attacker.TransformationMagicDefence = 34;
                                                                attacker.TransformationDodge = 9;
                                                                attacker.TransformationTime = 34;
                                                                attacker.TransformationID = 214;
                                                                break;
                                                            }
                                                        case 1:
                                                            {
                                                                attacker.TransformationMaxAttack = 395;
                                                                attacker.TransformationMinAttack = 245;
                                                                attacker.TransformationDefence = 126;
                                                                attacker.TransformationMagicDefence = 45;
                                                                attacker.TransformationDodge = 12;
                                                                attacker.TransformationTime = 39;
                                                                attacker.TransformationID = 214;
                                                                break;
                                                            }
                                                        case 2:
                                                            {
                                                                attacker.TransformationMaxAttack = 616;
                                                                attacker.TransformationMinAttack = 367;
                                                                attacker.TransformationDefence = 180;
                                                                attacker.TransformationMagicDefence = 53;
                                                                attacker.TransformationDodge = 15;
                                                                attacker.TransformationTime = 44;
                                                                attacker.TransformationID = 214;
                                                                break;
                                                            }
                                                        case 3:
                                                            {
                                                                attacker.TransformationMaxAttack = 724;
                                                                attacker.TransformationMinAttack = 429;
                                                                attacker.TransformationDefence = 247;
                                                                attacker.TransformationMagicDefence = 53;
                                                                attacker.TransformationDodge = 15;
                                                                attacker.TransformationTime = 49;
                                                                attacker.TransformationID = 214;
                                                                break;
                                                            }
                                                        case 4:
                                                            {
                                                                attacker.TransformationMaxAttack = 1231;
                                                                attacker.TransformationMinAttack = 704;
                                                                attacker.TransformationDefence = 499;
                                                                attacker.TransformationMagicDefence = 50;
                                                                attacker.TransformationDodge = 20;
                                                                attacker.TransformationTime = 54;
                                                                attacker.TransformationID = 274;
                                                                break;
                                                            }
                                                        case 5:
                                                            {
                                                                attacker.TransformationMaxAttack = 1573;
                                                                attacker.TransformationMinAttack = 941;
                                                                attacker.TransformationDefence = 601;
                                                                attacker.TransformationMagicDefence = 53;
                                                                attacker.TransformationDodge = 25;
                                                                attacker.TransformationTime = 59;
                                                                attacker.TransformationID = 274;
                                                                break;
                                                            }
                                                        case 6:
                                                            {
                                                                attacker.TransformationMaxAttack = 1991;
                                                                attacker.TransformationMinAttack = 1107;
                                                                attacker.TransformationDefence = 1029;
                                                                attacker.TransformationMagicDefence = 55;
                                                                attacker.TransformationDodge = 30;
                                                                attacker.TransformationTime = 64;
                                                                attacker.TransformationID = 274;
                                                                break;
                                                            }
                                                        case 7:
                                                            {
                                                                attacker.TransformationMaxAttack = 2226;
                                                                attacker.TransformationMinAttack = 1235;
                                                                attacker.TransformationDefence = 1029;
                                                                attacker.TransformationMagicDefence = 55;
                                                                attacker.TransformationDodge = 35;
                                                                attacker.TransformationTime = 69;
                                                                attacker.TransformationID = 274;
                                                                break;
                                                            }
                                                    }
                                                    break;
                                                case 1360:
                                                    switch (spell.Level)
                                                    {
                                                        case 0:
                                                            {
                                                                attacker.TransformationMaxAttack = 1215;
                                                                attacker.TransformationMinAttack = 610;
                                                                attacker.TransformationDefence = 100;
                                                                attacker.TransformationMagicDefence = 96;
                                                                attacker.TransformationDodge = 30;
                                                                attacker.TransformationTime = 59;
                                                                attacker.TransformationID = 217;
                                                                break;
                                                            }
                                                        case 1:
                                                            {
                                                                attacker.TransformationMaxAttack = 1310;
                                                                attacker.TransformationMinAttack = 650;
                                                                attacker.TransformationDefence = 400;
                                                                attacker.TransformationMagicDefence = 97;
                                                                attacker.TransformationDodge = 30;
                                                                attacker.TransformationTime = 79;
                                                                attacker.TransformationID = 217;
                                                                break;
                                                            }
                                                        case 2:
                                                            {
                                                                attacker.TransformationMaxAttack = 1420;
                                                                attacker.TransformationMinAttack = 710;
                                                                attacker.TransformationDefence = 650;
                                                                attacker.TransformationMagicDefence = 98;
                                                                attacker.TransformationDodge = 30;
                                                                attacker.TransformationTime = 89;
                                                                attacker.TransformationID = 217;
                                                                break;
                                                            }
                                                        case 3:
                                                            {
                                                                attacker.TransformationMaxAttack = 1555;
                                                                attacker.TransformationMinAttack = 780;
                                                                attacker.TransformationDefence = 720;
                                                                attacker.TransformationMagicDefence = 98;
                                                                attacker.TransformationDodge = 30;
                                                                attacker.TransformationTime = 99;
                                                                attacker.TransformationID = 277;
                                                                break;
                                                            }
                                                        case 4:
                                                            {
                                                                attacker.TransformationMaxAttack = 1660;
                                                                attacker.TransformationMinAttack = 840;
                                                                attacker.TransformationDefence = 1200;
                                                                attacker.TransformationMagicDefence = 99;
                                                                attacker.TransformationDodge = 30;
                                                                attacker.TransformationTime = 109;
                                                                attacker.TransformationID = 277;
                                                                break;
                                                            }
                                                    }
                                                    break;
                                                case 1280:
                                                    switch (spell.Level)
                                                    {
                                                        case 0:
                                                            {
                                                                attacker.TransformationMaxAttack = 930;
                                                                attacker.TransformationMinAttack = 656;
                                                                attacker.TransformationDefence = 290;
                                                                attacker.TransformationMagicDefence = 45;
                                                                attacker.TransformationDodge = 40;
                                                                attacker.TransformationTime = 29;
                                                                attacker.TransformationID = 213;
                                                                break;
                                                            }
                                                        case 1:
                                                            {
                                                                attacker.TransformationMaxAttack = 1062;
                                                                attacker.TransformationMinAttack = 750;
                                                                attacker.TransformationDefence = 320;
                                                                attacker.TransformationMagicDefence = 46;
                                                                attacker.TransformationDodge = 40;
                                                                attacker.TransformationTime = 34;
                                                                attacker.TransformationID = 213;
                                                                break;
                                                            }
                                                        case 2:
                                                            {
                                                                attacker.TransformationMaxAttack = 1292;
                                                                attacker.TransformationMinAttack = 910;
                                                                attacker.TransformationDefence = 510;
                                                                attacker.TransformationMagicDefence = 50;
                                                                attacker.TransformationDodge = 40;
                                                                attacker.TransformationTime = 39;
                                                                attacker.TransformationID = 213;
                                                                break;
                                                            }
                                                        case 3:
                                                            {
                                                                attacker.TransformationMaxAttack = 1428;
                                                                attacker.TransformationMinAttack = 1000;
                                                                attacker.TransformationDefence = 600;
                                                                attacker.TransformationMagicDefence = 53;
                                                                attacker.TransformationDodge = 40;
                                                                attacker.TransformationTime = 44;
                                                                attacker.TransformationID = 213;
                                                                break;
                                                            }
                                                        case 4:
                                                            {
                                                                attacker.TransformationMaxAttack = 1570;
                                                                attacker.TransformationMinAttack = 1100;
                                                                attacker.TransformationDefence = 700;
                                                                attacker.TransformationMagicDefence = 55;
                                                                attacker.TransformationDodge = 40;
                                                                attacker.TransformationTime = 49;
                                                                attacker.TransformationID = 213;
                                                                break;
                                                            }
                                                        case 5:
                                                            {
                                                                attacker.TransformationMaxAttack = 1700;
                                                                attacker.TransformationMinAttack = 1200;
                                                                attacker.TransformationDefence = 880;
                                                                attacker.TransformationMagicDefence = 57;
                                                                attacker.TransformationDodge = 40;
                                                                attacker.TransformationTime = 54;
                                                                attacker.TransformationID = 273;
                                                                break;
                                                            }
                                                        case 6:
                                                            {
                                                                attacker.TransformationMaxAttack = 1900;
                                                                attacker.TransformationMinAttack = 1300;
                                                                attacker.TransformationDefence = 1540;
                                                                attacker.TransformationMagicDefence = 59;
                                                                attacker.TransformationDodge = 40;
                                                                attacker.TransformationTime = 59;
                                                                attacker.TransformationID = 273;
                                                                break;
                                                            }
                                                        case 7:
                                                            {
                                                                attacker.TransformationMaxAttack = 2100;
                                                                attacker.TransformationMinAttack = 1500;
                                                                attacker.TransformationDefence = 1880;
                                                                attacker.TransformationMagicDefence = 61;
                                                                attacker.TransformationDodge = 40;
                                                                attacker.TransformationTime = 59;
                                                                attacker.TransformationID = 273;
                                                                break;
                                                            }
                                                        case 8:
                                                            {
                                                                attacker.TransformationMaxAttack = 2300;
                                                                attacker.TransformationMinAttack = 1600;
                                                                attacker.TransformationDefence = 1970;
                                                                attacker.TransformationMagicDefence = 63;
                                                                attacker.TransformationDodge = 40;
                                                                attacker.TransformationTime = 59;
                                                                attacker.TransformationID = 273;
                                                                break;
                                                            }
                                                    }
                                                    break;

                                                case 3321:
                                                    {
                                                        attacker.TransformationMaxAttack = 2000000;
                                                        attacker.TransformationMinAttack = 2000000;
                                                        attacker.TransformationDefence = 65355;
                                                        attacker.TransformationMagicDefence = 65355;
                                                        attacker.TransformationDodge = 35;
                                                        attacker.TransformationTime = 65355;
                                                        attacker.TransformationID = 223;
                                                        break;
                                                    }

                                            }
                                            #endregion

                                            SpellUse spellUse = new SpellUse(true);
                                            spellUse.Attacker = attacker.UID;
                                            spellUse.SpellID = spell.ID;
                                            spellUse.SpellLevel = spell.Level;
                                            spellUse.X = X;
                                            spellUse.Y = Y;
                                            spellUse.Targets.Add(attacker.UID, (uint)0);
                                            attacker.Owner.SendScreen(spellUse, true);
                                            attacker.TransformationStamp = Time32.Now;
                                            attacker.TransformationMaxHP = 3000;
                                            if (spell.ID == 1270)
                                                attacker.TransformationMaxHP = 50000;
                                            attacker.TransformationAttackRange = 3;
                                            if (spell.ID == 1360)
                                                attacker.TransformationAttackRange = 10;
                                            if (!wasTransformated)
                                            {
                                                double maxHP = attacker.MaxHitpoints;
                                                double HP = attacker.Hitpoints;
                                                double point = HP / maxHP;

                                                attacker.Hitpoints = (uint)(attacker.TransformationMaxHP * point);
                                            }
                                            attacker.Update(Update.MaxHitpoints, attacker.TransformationMaxHP, false);
                                        }
                                        break;
                                    }
                                #endregion
                                #region Bless
                                case 9876:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);
                                            attacker.AddFlag(Update.Flags.CastPray);
                                            SpellUse spellUse = new SpellUse(true);
                                            spellUse.Attacker = attacker.UID;
                                            spellUse.SpellID = spell.ID;
                                            spellUse.SpellLevel = spell.Level;
                                            spellUse.X = X;
                                            spellUse.Y = Y;
                                            spellUse.Targets.Add(attacker.UID, 0);
                                            attacker.Owner.SendScreen(spellUse, true);
                                        }
                                        break;
                                    }
                                #endregion
                                #region Companions
                                case 4000:
                                case 4010:
                                case 4020:
                                case 4050:
                                case 4060:
                                case 4070:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            if (attacker.Owner.Companion != null)
                                            {
                                                if (attacker.Owner.Companion.MonsterInfo != null)
                                                {
                                                    attacker.Owner.Map.RemoveEntity(attacker.Owner.Companion);
                                                    Data data = new Data(true);
                                                    data.UID = attacker.Owner.Companion.UID;
                                                    data.ID = Data.RemoveEntity;
                                                    attacker.Owner.Companion.MonsterInfo.SendScreen(data);
                                                    attacker.Owner.Companion = null;
                                                }
                                            }
                                            PrepareSpell(spell, attacker.Owner);
                                            SpellUse spellUse = new SpellUse(true);
                                            spellUse.Attacker = attacker.UID;
                                            spellUse.SpellID = spell.ID;
                                            spellUse.SpellLevel = spell.Level;
                                            spellUse.X = X;
                                            spellUse.Y = Y;
                                            spellUse.Targets.Add(attacker.UID, 0);
                                            attacker.Owner.SendScreen(spellUse, true);
                                            attacker.Owner.Companion = new Entity(EntityFlag.Monster, true);
                                            attacker.Owner.Companion.MonsterInfo = new Conquer_Online_Server.Database.MonsterInformation();
                                            Database.MonsterInformation mt = Database.MonsterInformation.MonsterInfos[spell.Power];
                                            attacker.Owner.Companion.Owner = attacker.Owner;
                                            attacker.Owner.Companion.MapObjType = MapObjectType.Monster;
                                            attacker.Owner.Companion.MonsterInfo = mt.Copy();
                                            attacker.Owner.Companion.MonsterInfo.Owner = attacker.Owner.Companion;
                                            attacker.Owner.Companion.Name = mt.Name;
                                            attacker.Owner.Companion.MinAttack = mt.MinAttack;
                                            attacker.Owner.Companion.MaxAttack = attacker.Owner.Companion.MagicAttack = mt.MaxAttack;
                                            attacker.Owner.Companion.Hitpoints = attacker.Owner.Companion.MaxHitpoints = mt.Hitpoints;
                                            attacker.Owner.Companion.Body = mt.Mesh;
                                            attacker.Owner.Companion.Level = mt.Level;
                                            attacker.Owner.Companion.UID = (uint)(attacker.UID - 200000);
                                            attacker.Owner.Companion.MapID = attacker.Owner.Map.ID;
                                            attacker.Owner.Companion.SendUpdates = true;
                                            attacker.Owner.Companion.X = attacker.X;
                                            attacker.Owner.Companion.Y = attacker.Y;
                                            attacker.Owner.Map.AddEntity(attacker.Owner.Companion);
                                            attacker.Owner.SendScreenSpawn(attacker.Owner.Companion, true);
                                        }
                                        break;
                                    }
                                #endregion

                                #region MonkSpells
                                //TyrantAura
                                case 10395:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            if (attacker.Owner.Team != null)
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                        PrepareSpell(spell, attacker.Owner);
                                                    {

                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.FendAura))//FendAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.FendAura);//FendAura
                                                            teammate.Entity.Statistics.Immunity -= 200;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                                            teammate.Entity.Statistics.MetalResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                                            teammate.Entity.Statistics.WoodResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                                            teammate.Entity.Statistics.WaterResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                                            teammate.Entity.Statistics.FireResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                                            teammate.Entity.Statistics.EarthResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.TyrantAura))//TyrantAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.TyrantAura);//TyrantAura
                                                            teammate.Entity.Statistics.CriticalStrike -= 200;
                                                        }

                                                        teammate.Entity.AddFlag2(Update.Flags2.TyrantAura);
                                                        teammate.Entity.Statistics.CriticalStrike += 200;
                                                        suse.Targets.Add(teammate.Entity.UID, 1);
                                                        teammate.Entity.TyrantAura = Time32.Now;
                                                        teammate.Entity.TyrantAuras = (short)spell.Duration;

                                                    }
                                                }
                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                    attacked.Owner.SendScreen(suse, true);
                                                else
                                                    attacked.MonsterInfo.SendScreen(suse);
                                            }
                                            else
                                            {
                                                if (attacked == null)
                                                    return;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                {
                                                    PrepareSpell(spell, attacker.Owner);
                                                    if (attacker.ContainsFlag2(Update.Flags2.FendAura))//FendAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.FendAura);//FendAura
                                                        attacker.Statistics.Immunity -= 200;
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                                        attacker.Statistics.MetalResistance -= 30;
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                                                    {
                                                        attacker.Statistics.WoodResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                                                    {
                                                        attacker.Statistics.WaterResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                                                    {
                                                        attacker.Statistics.FireResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                                                    {
                                                        attacker.Statistics.EarthResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                                    }
                                                    if (attacked.ContainsFlag2(Update.Flags2.TyrantAura))//TyrantAura
                                                    {
                                                        attacked.RemoveFlag2(Update.Flags2.TyrantAura);//TyrantAura
                                                        attacked.Statistics.CriticalStrike -= 200;

                                                    }
                                                    attacker.AddFlag2(Update.Flags2.TyrantAura);
                                                    attacker.Statistics.CriticalStrike += 200;
                                                    attacker.TyrantAura = Time32.Now;
                                                    attacker.TyrantAuras = (short)spell.Duration;
                                                    suse.Targets.Add(attacked.UID, 1);
                                                    if (attacked.EntityFlag == EntityFlag.Player)
                                                        attacked.Owner.SendScreen(suse, true);
                                                    else
                                                        attacked.MonsterInfo.SendScreen(suse);
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                            }
                                        }
                                        attacker.AttackPacket = null;
                                        break;
                                    }
                                //FendAura
                                case 10410:
                                    {

                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            if (attacker.Owner.Team != null)
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                        PrepareSpell(spell, attacker.Owner);
                                                    {

                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                                                            teammate.Entity.Statistics.CriticalStrike -= 200;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                                            teammate.Entity.Statistics.MetalResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                                            teammate.Entity.Statistics.WoodResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                                            teammate.Entity.Statistics.WaterResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                                            teammate.Entity.Statistics.FireResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                                            teammate.Entity.Statistics.EarthResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                                                            teammate.Entity.Statistics.Immunity -= 200;
                                                        }

                                                        teammate.Entity.AddFlag2(Update.Flags2.FendAura);
                                                        teammate.Entity.Statistics.Immunity += 200;
                                                        suse.Targets.Add(teammate.Entity.UID, 1);
                                                        teammate.Entity.TyrantAura = Time32.Now;
                                                        teammate.Entity.TyrantAuras = (short)spell.Duration;

                                                    }
                                                }
                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                    attacked.Owner.SendScreen(suse, true);
                                                else
                                                    attacked.MonsterInfo.SendScreen(suse);
                                            }
                                            else
                                            {
                                                if (attacked == null)
                                                    return;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                {
                                                    PrepareSpell(spell, attacker.Owner);
                                                    if (attacked.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                                                    {
                                                        attacked.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                                                        attacked.Statistics.CriticalStrike -= 200;
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                                        attacker.Statistics.MetalResistance -= 30;
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                                                    {
                                                        attacker.Statistics.WoodResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                                                    {
                                                        attacker.Statistics.WaterResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                                                    {
                                                        attacker.Statistics.FireResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                                                    {
                                                        attacker.Statistics.EarthResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                                                        attacker.Statistics.Immunity += 200;

                                                    }
                                                    attacker.AddFlag2(Update.Flags2.FendAura);
                                                    attacker.Statistics.Immunity += 200;
                                                    attacker.TyrantAura = Time32.Now;
                                                    attacker.TyrantAuras = (short)spell.Duration;
                                                    suse.Targets.Add(attacked.UID, 1);
                                                    if (attacked.EntityFlag == EntityFlag.Player)
                                                        attacked.Owner.SendScreen(suse, true);
                                                    else
                                                        attacked.MonsterInfo.SendScreen(suse);
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                            }
                                        }
                                        attacker.AttackPacket = null;
                                        break;
                                    }
                                //ElementalAuraMetal
                                case 10420:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            if (attacker.Owner.Team != null)
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                        PrepareSpell(spell, attacker.Owner);
                                                    {

                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                                                            teammate.Entity.Statistics.CriticalStrike -= 200;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                                            teammate.Entity.Statistics.MetalResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                                            teammate.Entity.Statistics.WoodResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                                            teammate.Entity.Statistics.WaterResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                                            teammate.Entity.Statistics.FireResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                                            teammate.Entity.Statistics.EarthResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                                                            teammate.Entity.Statistics.Immunity -= 200;
                                                        }

                                                        teammate.Entity.AddFlag2(Update.Flags2.MetalAura);
                                                        teammate.Entity.Statistics.MetalResistance += 30;
                                                        suse.Targets.Add(teammate.Entity.UID, 1);
                                                        teammate.Entity.TyrantAura = Time32.Now;
                                                        teammate.Entity.TyrantAuras = (short)spell.Duration;

                                                    }
                                                }
                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                    attacked.Owner.SendScreen(suse, true);
                                                else
                                                    attacked.MonsterInfo.SendScreen(suse);
                                            }
                                            else
                                            {
                                                if (attacked == null)
                                                    return;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                {
                                                    PrepareSpell(spell, attacker.Owner);
                                                    if (attacker.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                                                        attacker.Statistics.CriticalStrike -= 200;
                                                    }
                                                    if (attacked.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                                                    {
                                                        attacked.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                                        attacked.Statistics.MetalResistance -= 30;
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                                                    {
                                                        attacker.Statistics.WoodResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                                                    {
                                                        attacker.Statistics.WaterResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                                                    {
                                                        attacker.Statistics.FireResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                                                    {
                                                        attacker.Statistics.EarthResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                                                        attacker.Statistics.Immunity -= 200;

                                                    }
                                                    attacker.AddFlag2(Update.Flags2.MetalAura);
                                                    attacker.Statistics.MetalResistance += 30;
                                                    attacker.TyrantAura = Time32.Now;
                                                    attacker.TyrantAuras = (short)spell.Duration;
                                                    suse.Targets.Add(attacked.UID, 1);
                                                    if (attacked.EntityFlag == EntityFlag.Player)
                                                        attacked.Owner.SendScreen(suse, true);
                                                    else
                                                        attacked.MonsterInfo.SendScreen(suse);
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                            }
                                        }
                                        attacker.AttackPacket = null;
                                        break;
                                    }
                                //ElementalAuraWood
                                case 10421:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            if (attacker.Owner.Team != null)
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                        PrepareSpell(spell, attacker.Owner);
                                                    {

                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                                                            teammate.Entity.Statistics.CriticalStrike -= 200;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                                            teammate.Entity.Statistics.MetalResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                                            teammate.Entity.Statistics.WoodResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                                            teammate.Entity.Statistics.WaterResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                                            teammate.Entity.Statistics.FireResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                                            teammate.Entity.Statistics.EarthResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                                                            teammate.Entity.Statistics.Immunity -= 200;
                                                        }

                                                        teammate.Entity.AddFlag2(Update.Flags2.WoodAura);
                                                        teammate.Entity.Statistics.WoodResistance += 30;
                                                        suse.Targets.Add(teammate.Entity.UID, 1);
                                                        teammate.Entity.TyrantAura = Time32.Now;
                                                        teammate.Entity.TyrantAuras = (short)spell.Duration;

                                                    }
                                                }
                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                    attacked.Owner.SendScreen(suse, true);
                                                else
                                                    attacked.MonsterInfo.SendScreen(suse);
                                            }
                                            else
                                            {
                                                if (attacked == null)
                                                    return;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                {
                                                    PrepareSpell(spell, attacker.Owner);
                                                    if (attacker.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                                                        attacker.Statistics.CriticalStrike -= 200;
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                                        attacker.Statistics.MetalResistance -= 30;
                                                    }
                                                    if (attacked.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                                                    {
                                                        attacked.Statistics.WoodResistance -= 30;
                                                        attacked.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                                                    {
                                                        attacker.Statistics.WaterResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                                                    {
                                                        attacker.Statistics.FireResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                                                    {
                                                        attacker.Statistics.EarthResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                                                        attacker.Statistics.Immunity -= 200;

                                                    }
                                                    attacker.AddFlag2(Update.Flags2.WoodAura);
                                                    attacker.Statistics.WoodResistance += 30;
                                                    attacker.TyrantAura = Time32.Now;
                                                    attacker.TyrantAuras = (short)spell.Duration;
                                                    suse.Targets.Add(attacked.UID, 1);
                                                    if (attacked.EntityFlag == EntityFlag.Player)
                                                        attacked.Owner.SendScreen(suse, true);
                                                    else
                                                        attacked.MonsterInfo.SendScreen(suse);
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                            }
                                        }
                                        attacker.AttackPacket = null;
                                        break;
                                    }
                                //ElementalAuraWater
                                case 10422:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            if (attacker.Owner.Team != null)
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                        PrepareSpell(spell, attacker.Owner);
                                                    {

                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                                                            teammate.Entity.Statistics.CriticalStrike -= 200;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                                            teammate.Entity.Statistics.MetalResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                                            teammate.Entity.Statistics.WoodResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                                            teammate.Entity.Statistics.WaterResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                                            teammate.Entity.Statistics.FireResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                                            teammate.Entity.Statistics.EarthResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                                                            teammate.Entity.Statistics.Immunity -= 200;
                                                        }

                                                        teammate.Entity.AddFlag2(Update.Flags2.WaterAura);
                                                        teammate.Entity.Statistics.WaterResistance += 30;
                                                        suse.Targets.Add(teammate.Entity.UID, 1);
                                                        teammate.Entity.TyrantAura = Time32.Now;
                                                        teammate.Entity.TyrantAuras = (short)spell.Duration;

                                                    }
                                                }
                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                    attacked.Owner.SendScreen(suse, true);
                                                else
                                                    attacked.MonsterInfo.SendScreen(suse);
                                            }
                                            else
                                            {
                                                if (attacked == null)
                                                    return;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                {
                                                    PrepareSpell(spell, attacker.Owner);
                                                    if (attacker.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                                                        attacker.Statistics.CriticalStrike -= 200;
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                                        attacker.Statistics.MetalResistance -= 30;
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                                                    {
                                                        attacker.Statistics.WoodResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                                    }
                                                    if (attacked.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                                                    {
                                                        attacked.Statistics.WaterResistance -= 30;
                                                        attacked.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                                                    {
                                                        attacker.Statistics.FireResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                                                    {
                                                        attacker.Statistics.EarthResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                                                        attacker.Statistics.Immunity -= 200;

                                                    }
                                                    attacker.AddFlag2(Update.Flags2.WaterAura);
                                                    attacker.Statistics.WaterResistance += 30;
                                                    attacker.TyrantAura = Time32.Now;
                                                    attacker.TyrantAuras = (short)spell.Duration;
                                                    suse.Targets.Add(attacked.UID, 1);
                                                    if (attacked.EntityFlag == EntityFlag.Player)
                                                        attacked.Owner.SendScreen(suse, true);
                                                    else
                                                        attacked.MonsterInfo.SendScreen(suse);
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                            }
                                        }
                                        attacker.AttackPacket = null;
                                        break;
                                    }
                                //ElementalAuraFire
                                case 10423:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            if (attacker.Owner.Team != null)
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                        PrepareSpell(spell, attacker.Owner);
                                                    {

                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                                                            teammate.Entity.Statistics.CriticalStrike -= 200;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                                            teammate.Entity.Statistics.MetalResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                                            teammate.Entity.Statistics.WoodResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                                            teammate.Entity.Statistics.WaterResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                                            teammate.Entity.Statistics.FireResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                                            teammate.Entity.Statistics.EarthResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                                                            teammate.Entity.Statistics.Immunity -= 200;
                                                        }

                                                        teammate.Entity.AddFlag2(Update.Flags2.FireAura);
                                                        teammate.Entity.Statistics.FireResistance += 30;
                                                        suse.Targets.Add(teammate.Entity.UID, 1);
                                                        teammate.Entity.TyrantAura = Time32.Now;
                                                        teammate.Entity.TyrantAuras = (short)spell.Duration;

                                                    }
                                                }
                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                    attacked.Owner.SendScreen(suse, true);
                                                else
                                                    attacked.MonsterInfo.SendScreen(suse);
                                            }
                                            else
                                            {
                                                if (attacked == null)
                                                    return;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                {
                                                    PrepareSpell(spell, attacker.Owner);
                                                    if (attacker.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                                                        attacker.Statistics.CriticalStrike -= 200;
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                                        attacker.Statistics.MetalResistance -= 30;
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                                                    {
                                                        attacker.Statistics.WoodResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                                                    {
                                                        attacker.Statistics.WaterResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                                    }
                                                    if (attacked.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                                                    {
                                                        attacked.Statistics.FireResistance -= 30;
                                                        attacked.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                                                    {
                                                        attacker.Statistics.EarthResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                                                        attacker.Statistics.Immunity -= 200;

                                                    }
                                                    attacker.AddFlag2(Update.Flags2.FireAura);
                                                    attacker.Statistics.FireResistance += 30;
                                                    attacker.TyrantAura = Time32.Now;
                                                    attacker.TyrantAuras = (short)spell.Duration;
                                                    suse.Targets.Add(attacked.UID, 1);
                                                    if (attacked.EntityFlag == EntityFlag.Player)
                                                        attacked.Owner.SendScreen(suse, true);
                                                    else
                                                        attacked.MonsterInfo.SendScreen(suse);
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                            }
                                        }
                                        attacker.AttackPacket = null;
                                        break;
                                    }
                                //ElementalEarthAura
                                case 10424:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            if (attacker.Owner.Team != null)
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                        PrepareSpell(spell, attacker.Owner);
                                                    {

                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                                                            teammate.Entity.Statistics.CriticalStrike -= 200;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                                            teammate.Entity.Statistics.MetalResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                                            teammate.Entity.Statistics.WoodResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                                            teammate.Entity.Statistics.WaterResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                                            teammate.Entity.Statistics.FireResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                                            teammate.Entity.Statistics.EarthResistance -= 30;
                                                        }
                                                        if (teammate.Entity.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                                                        {
                                                            teammate.Entity.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                                                            teammate.Entity.Statistics.Immunity -= 200;
                                                        }

                                                        teammate.Entity.AddFlag2(Update.Flags2.EarthAura);
                                                        teammate.Entity.Statistics.EarthResistance += 30;
                                                        suse.Targets.Add(teammate.Entity.UID, 1);
                                                        teammate.Entity.TyrantAura = Time32.Now;
                                                        teammate.Entity.TyrantAuras = (short)spell.Duration;

                                                    }
                                                }
                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                    attacked.Owner.SendScreen(suse, true);
                                                else
                                                    attacked.MonsterInfo.SendScreen(suse);
                                            }
                                            else
                                            {
                                                if (attacked == null)
                                                    return;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                {
                                                    PrepareSpell(spell, attacker.Owner);
                                                    if (attacker.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                                                        attacker.Statistics.CriticalStrike -= 200;
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                                        attacker.Statistics.MetalResistance -= 30;
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                                                    {
                                                        attacker.Statistics.WoodResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                                                    {
                                                        attacker.Statistics.WaterResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                                                    {
                                                        attacker.Statistics.FireResistance -= 30;
                                                        attacker.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                                    }
                                                    if (attacked.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                                                    {
                                                        attacked.Statistics.EarthResistance -= 30;
                                                        attacked.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                                    }
                                                    if (attacker.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                                                    {
                                                        attacker.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                                                        attacker.Statistics.Immunity -= 200;

                                                    }
                                                    attacker.AddFlag2(Update.Flags2.EarthAura);
                                                    attacker.Statistics.EarthResistance += 30;
                                                    attacker.TyrantAura = Time32.Now;
                                                    attacker.TyrantAuras = (short)spell.Duration;
                                                    suse.Targets.Add(attacked.UID, 1);
                                                    if (attacked.EntityFlag == EntityFlag.Player)
                                                        attacked.Owner.SendScreen(suse, true);
                                                    else
                                                        attacked.MonsterInfo.SendScreen(suse);
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                            }
                                        }
                                        attacker.AttackPacket = null;
                                        break;
                                    }

                                //Compassion
                                case 10430:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            if (attacker.Owner.Team != null)
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                    {
                                                        attacker.RemoveFlag(Update.Flags.Poisoned);

                                                        suse.Targets.Add(teammate.Entity.UID, 1);
                                                    }
                                                }
                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                    attacked.Owner.SendScreen(suse, true);
                                                else
                                                    attacked.MonsterInfo.SendScreen(suse);
                                            }
                                            else
                                            {
                                                if (attacked == null)
                                                    return;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                {
                                                    PrepareSpell(spell, attacker.Owner);

                                                    attacker.RemoveFlag(Update.Flags.Poisoned);

                                                    suse.Targets.Add(attacked.UID, 1);

                                                    if (attacked.EntityFlag == EntityFlag.Player)
                                                        attacked.Owner.SendScreen(suse, true);
                                                    else
                                                        attacked.MonsterInfo.SendScreen(suse);
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                            }
                                        }
                                        attacker.AttackPacket = null;
                                        break;
                                    }
                                //Serenity
                                case 10400:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);

                                            if (attacker == null) return;

                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = SpellID;
                                            suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            suse.Targets.Add(attacker.UID, 1);

                                            attacker.ToxicFogLeft = 0;
                                            //attacker.RemoveFlag(Update.Flags.SoulShackle);
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        attacker.AttackPacket = null;
                                        break;
                                    }
                                //Tranquility
                                case 10425:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;

                                            if (attacker.Owner.Team != null)
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                    {
                                                        attacker.RemoveFlag(Update.Flags.SoulShackle);
                                                        attacked.RemoveFlag(Update.Flags.SoulShackle);
                                                        teammate.Entity.RemoveFlag(Update.Flags.SoulShackle);
                                                        suse.Targets.Add(teammate.Entity.UID, 1);
                                                    }
                                                }
                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                    attacked.Owner.SendScreen(suse, true);
                                                else
                                                    attacked.MonsterInfo.SendScreen(suse);
                                            }
                                            else
                                            {
                                                if (attacked == null)
                                                    return;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                {
                                                    PrepareSpell(spell, attacker.Owner);

                                                    attacker.RemoveFlag(Update.Flags.SoulShackle);

                                                    suse.Targets.Add(attacked.UID, 1);

                                                    if (attacked.EntityFlag == EntityFlag.Player)
                                                        attacked.Owner.SendScreen(suse, true);
                                                    else
                                                        attacked.MonsterInfo.SendScreen(suse);
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                            }
                                        }
                                        attacker.AttackPacket = null;
                                        break;
                                    }
                                //Radiant Palm
                                case 10381:
                                    // case 10315:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);
                                            Game.Attacking.InLineAlgorithm ila = new Conquer_Online_Server.Game.Attacking.InLineAlgorithm(attacker.X,
                                        X, attacker.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = SpellID;
                                            suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            for (int c = 0; c < attacker.Owner.Screen.Objects.Length; c++)
                                            {
                                                //For a multi threaded application, while we go through the collection
                                                //the collection might change. We will make sure that we wont go off
                                                //the limits with a check.
                                                if (c >= attacker.Owner.Screen.Objects.Length)
                                                    break;
                                                Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                if (_obj == null)
                                                    continue;
                                                if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    attacked = _obj as Entity;
                                                    if (ila.InLine(attacked.X, attacked.Y))
                                                    {
                                                        if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            continue;

                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);

                                                        attack.Damage = damage;

                                                        ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                        suse.Targets.Add(attacked.UID, damage);
                                                    }
                                                }
                                                else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    attackedsob = _obj as SobNpcSpawn;

                                                    if (ila.InLine(attackedsob.X, attackedsob.Y))
                                                    {
                                                        if (!CanAttack(attacker, attackedsob, spell))
                                                            continue;

                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                        damage = (uint)(damage * spell.PowerPercent);
                                                        attack.Damage = damage;

                                                        ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                        suse.Targets.Add(attackedsob.UID, damage);
                                                    }
                                                }
                                            }

                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        attacker.AttackPacket = null;
                                        break;
                                    }
                                //WhirlwindKick
                                case 10415:
                                    {
                                        if (Time32.Now < attacker.WhilrwindKick.AddMilliseconds(1500))
                                        { attacker.AttackPacket = null; return; }
                                        attacker.WhilrwindKick = Time32.Now;
                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 3)
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = 0;
                                                suse.X = (ushort)ServerBase.Kernel.Random.Next(3, 10);
                                                suse.Y = 0;

                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 3)
                                                {
                                                    for (int c = 0; c < attacker.Owner.Screen.Objects.Length; c++)
                                                    {
                                                        //For a multi threaded application, while we go through the collection
                                                        //the collection might change. We will make sure that we wont go off
                                                        //the limits with a check.
                                                        if (c >= attacker.Owner.Screen.Objects.Length)
                                                            break;
                                                        Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                        if (_obj == null)
                                                            continue;
                                                        if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                        {
                                                            attacked = _obj as Entity;
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                            {
                                                                if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Ranged))
                                                                {
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attacked);

                                                                    ReceiveAttack(attacker, attacked, attack, damage, spell);
                                                                    attacked.Stunned = true;
                                                                    attacked.StunStamp = Time32.Now;
                                                                    suse.Targets.Add(attacked.UID, damage);

                                                                }
                                                            }
                                                        }
                                                    }
                                                    attacker.AttackPacket = null;
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null; return;
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                                suse.Targets = new SafeDictionary<uint, SpellUse.DamageClass>();
                                                attacker.AttackPacket = null; return;
                                            }
                                            attacker.AttackPacket = null;
                                        }
                                        attacker.AttackPacket = null; return;
                                        //break;
                                    }
                                #endregion

                            }
                            attacker.Owner.IncreaseSpellExperience(Experience, spellID);
                            if (attacker.MapID == 1039)
                            {
                                if (spell.ID == 7001 || spell.ID == 9876)
                                {
                                    attacker.AttackPacket = null;
                                    return;
                                }
                                if (attacker.AttackPacket != null)
                                {
                                    attack.Damage = spell.ID;
                                    attacker.AttackPacket = attack;
                                    if (Database.SpellTable.WeaponSpells.ContainsValue(spell.ID))
                                    {
                                        if (attacker.AttackPacket == null)
                                        {
                                            attack.AttackType = Attack.Melee;
                                            attacker.AttackPacket = attack;
                                        }
                                        else
                                        {
                                            attacker.AttackPacket.AttackType = Attack.Melee;
                                        }
                                    }
                                }
                            }
                            else
                            {
                                if (spell.NextSpellID != 0)
                                {
                                    if (spell.NextSpellID >= 1000 && spell.NextSpellID <= 1002)
                                        if (Target >= 1000000)
                                        {
                                            attacker.AttackPacket = null;
                                            return;
                                        }
                                    attack.Damage = spell.NextSpellID;
                                    attacker.AttackPacket = attack;
                                }
                                else
                                {
                                    if (!Database.SpellTable.WeaponSpells.ContainsValue(spell.ID) || spell.ID == 9876)
                                        attacker.AttackPacket = null;
                                    else
                                    {
                                        if (attacker.AttackPacket == null)
                                        {
                                            attack.AttackType = Attack.Melee;
                                            attacker.AttackPacket = attack;
                                        }
                                        else
                                        {
                                            attacker.AttackPacket.AttackType = Attack.Melee;
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            attacker.AttackPacket = null;
                        }
                    }
                    #endregion
                }
                #endregion
            }
        }
Example #7
0
        static void HandlePacket(byte[] packet, Client.GameState client)
        {
            if (packet == null)
                return;
            if (client == null)
                return;
            ushort Length = BitConverter.ToUInt16(packet, 0);
            ushort ID = BitConverter.ToUInt16(packet, 2);
            ushort ID2 = BitConverter.ToUInt16(packet, 4);
            switch (ID)
            {
                #region market quest
                case 2400:
                    {
                        if (client.Entity.QQ1 == 0)
                        {
                            client.Entity.Teleport(1068, 053, 055);
                        }
                        else
                        {
                            client.Send(new Message("you can only make quest once in day", Color.AntiqueWhite, 2005));
                        }

                        break;
                    }
                #endregion
                #region ElitePk Tournament 2223 | 2219
                case 2223:
                    {
                        if (client.Entity.MapID == 6002)
                            break;

                        if (ServerBase.Kernel.Elite_PK_Tournament.Start)
                            break;

                        GamePackets.Elite_Pk pk = new Elite_Pk(client.Entity.UID);
                        pk.Send(client);
                        break;
                    }
                case 2219:
                    {
                        if (client.Entity.MapID == 6002)
                            break;
                        byte[] sed = new byte[36]
                        {
                        0x1C ,0x00 ,0xAB ,0x08 ,0x04 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x03 ,0x00    //  ; «         
            ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x54 ,0x51 ,0x53 ,0x65     // ;            TQSe
            ,0x72 ,0x76 ,0x65 ,0x72                                         // ;rver
                        };
                        client.Send(sed);
                        break;

                    }
                case 1063:
                    {
                        GamePackets.Guild_Pk pk = new Guild_Pk(client.Entity.UID);
                        pk.Send(client);
                        //byte[] sed = new byte[346];
                        ////{0x5a ,0x01 ,0x27 ,0x04 ,0x09 ,0x00 ,0x01 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x08 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x21 ,0x42 ,0x72 ,0x61 ,0x73 ,0x69 ,0x6c ,0x54 ,0x6f ,0x50 ,0x54 ,0x65 ,0x61 ,0x6d ,0x21 ,0x00 ,0x45 ,0x2a ,0x00 ,0x00 ,0x0e ,0x00 ,0x00 ,0x00 ,0x40 ,0xd2 ,0xdf ,0x03 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x7e ,0x5e ,0x21 ,0x54 ,0x68 ,0x65 ,0x5f ,0x42 ,0x65 ,0x73 ,0x74 ,0x21 ,0x5e ,0x7e ,0x00 ,0x00 ,0x2f ,0x20 ,0x00 ,0x00 ,0x09 ,0x00 ,0x00 ,0x00 ,0x00 ,0x0e ,0x27 ,0x07 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x46 ,0x69 ,0x72 ,0x65 ,0x45 ,0x6d ,0x62 ,0x6c ,0x65 ,0x6d ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x20 ,0x1c ,0x00 ,0x00 ,0x17 ,0x00 ,0x00 ,0x00 ,0x00 ,0xe1 ,0xf5 ,0x05 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x7e ,0x44 ,0x2e ,0x30 ,0x2e ,0x4a ,0x2e ,0x7e ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x3f ,0x0c ,0x00 ,0x00 ,0x0d ,0x00 ,0x00 ,0x00 ,0x40 ,0xf6 ,0xd3 ,0x04 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x2d ,0x4e ,0x7e ,0x4f ,0x7e ,0x59 ,0x7e ,0x50 ,0x7e ,0x49 ,0x2d ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x9e ,0x06 ,0x00 ,0x00 ,0x05 ,0x00 ,0x00 ,0x00 ,0x00 ,0x5a ,0x62 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x53 ,0x75 ,0x70 ,0x72 ,0x65 ,0x6d ,0x65 ,0x7e ,0x46 ,0x6f ,0x72 ,0x63 ,0x65 ,0x00 ,0x00 ,0x00 ,0x2f ,0x06 ,0x00 ,0x00 ,0x03 ,0x00 ,0x00 ,0x00 ,0x00 ,0x2d ,0x31 ,0x01 ,0x00 ,0x00 ,0x00 ,0x00 ,0xc8 ,0x00 ,0x00 ,0x00 ,0x53 ,0x69 ,0x6c ,0x65 ,0x6e ,0x54 ,0x5f ,0x48 ,0x65 ,0x41 ,0x6c ,0x4c ,0x23 ,0x30 ,0x31 ,0x00 ,0x40 ,0x03 ,0x00 ,0x00 ,0x04 ,0x00 ,0x00 ,0x00 ,0x80 ,0xf0 ,0xfa ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0xf4 ,0x01 ,0x00 ,0x00 ,0x21 ,0x4e ,0x6f ,0x86 ,0x4d ,0x65 ,0x72 ,0x63 ,0x59 ,0x21 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xe8 ,0x01 ,0x00 ,0x00 ,0x04 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00

                        ////};
                        //client.Send(sed);
                        break;

                    }
                case 2224:
                    {

                        client.Send(packet);
                        break;

                    }
                case 2232:
                    {

                        //                        byte[] sed = new byte[36]
                        //                        {
                        //                        0x1C ,0x00 ,0xAB ,0x08 ,0x04 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x03 ,0x00    //  ; «         
                        //,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x54 ,0x51 ,0x53 ,0x65     // ;            TQSe
                        //,0x72 ,0x76 ,0x65 ,0x72                                         // ;rver
                        //                        };
                        client.Send(packet);
                        break;

                    }
                case 2233:
                    {

                        GamePackets.Team_Pk pk = new Team_Pk(client.Entity.UID);
                        pk.Send(client);
                        break;

                    }
                case 2252:
                    {

                        // byte[] sed = new byte[60];
                        // ;rver };
                        client.Send(packet);
                        break;

                    }
                case 1130:
                    {
                        if (client.Entity.TitlePacket != null)
                        {
                            if (packet[9] == 4)
                            {
                                if (client.Entity.TitlePacket.dwParam2 != 0)
                                    client.Entity.TitlePacket.Send(client);
                            }
                            if (packet[9] == 3)
                            {
                                client.Entity.TitleActivated = packet[8];
                                client.Send(packet);
                                client.SendScreen(client.Entity.SpawnPacket, false);
                            }
                        }
                        break;
                    }
                #endregion
                #region TopGuilds
                case 1058:
                    {
                        if (client.Guild != null && client.AsMember != null)
                        {
                            if (client.AsMember != null)
                            {
                                Writer.WriteUInt32((uint)client.AsMember.SilverDonation, 8, packet);
                                if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
                                    if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                        if (client.AsMember.SilverDonation > client.Guild.money_donation)
                                        {
                                            client.Guild.money_donation = (uint)client.AsMember.SilverDonation;
                                            client.Entity.GuildRank = (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.OSupervisor;
                                            client.AsMember.Rank = (Conquer_Online_Server.Game.Enums.GuildMemberRank)client.Entity.GuildRank;
                                        }

                                Writer.WriteUInt32((uint)client.AsMember.ConquerPointDonation, 20, packet);
                                if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
                                    if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                        if (client.AsMember.ConquerPointDonation > client.Guild.cp_donaion)
                                        {
                                            client.Guild.cp_donaion = (uint)client.AsMember.ConquerPointDonation;
                                            client.Entity.GuildRank = (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.CPSupervisor;
                                            client.AsMember.Rank = (Conquer_Online_Server.Game.Enums.GuildMemberRank)client.Entity.GuildRank;
                                        }

                            }
                            Writer.WriteUInt32(client.Entity.PKPoints, 12, packet);
                            if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
                                if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                    if (client.Entity.PKPoints > client.Guild.pkp_donation)
                                    {
                                        client.Guild.pkp_donation = (uint)client.Entity.PKPoints;
                                        client.Entity.GuildRank = (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.PKSupervisor;
                                        client.AsMember.Rank = (Conquer_Online_Server.Game.Enums.GuildMemberRank)client.Entity.GuildRank;
                                    }

                            if (client.ArenaStatistic != null)
                            {
                                Writer.WriteUInt32(client.ArenaStatistic.CurrentHonor, 24, packet);
                                if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
                                    if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                        if (client.ArenaStatistic.CurrentHonor > client.Guild.honor_donation)
                                        {
                                            client.Guild.honor_donation = (uint)client.ArenaStatistic.CurrentHonor;
                                            client.Entity.GuildRank = (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.HonoraryManager;
                                            client.AsMember.Rank = (Conquer_Online_Server.Game.Enums.GuildMemberRank)client.Entity.GuildRank;
                                        }
                            }
                            Writer.WriteUInt32(0, 16, packet);
                            if (client.Entity != null)
                                if (client.Entity.MyFlowers != null)
                                {
                                    Writer.WriteUInt32((uint)client.Entity.MyFlowers.RedRoses, 28, packet);
                                    if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
                                        if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                            if (client.Entity.MyFlowers.RedRoses > client.Guild.rose_donation)
                                            {
                                                client.Guild.rose_donation = (uint)client.Entity.MyFlowers.RedRoses;
                                                client.Entity.GuildRank = (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.RoseSupervisor;
                                                client.AsMember.Rank = (Conquer_Online_Server.Game.Enums.GuildMemberRank)client.Entity.GuildRank;
                                            }

                                    Writer.WriteUInt32((uint)client.Entity.MyFlowers.Tulips, 32, packet);
                                    if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
                                        if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                            if (client.Entity.MyFlowers.Tulips > client.Guild.tuil_donation)
                                            {
                                                client.Guild.tuil_donation = (uint)client.Entity.MyFlowers.Tulips;
                                                client.Entity.GuildRank = (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.TulipFollower;
                                                client.AsMember.Rank = (Conquer_Online_Server.Game.Enums.GuildMemberRank)client.Entity.GuildRank;
                                            }

                                    Writer.WriteUInt32((uint)client.Entity.MyFlowers.Lilies, 36, packet);
                                    if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
                                        if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                            if (client.Entity.MyFlowers.Lilies > client.Guild.lilies_donation)
                                            {
                                                client.Guild.lilies_donation = (uint)client.Entity.MyFlowers.Lilies;
                                                client.Entity.GuildRank = (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.LilySupervisor;
                                                client.AsMember.Rank = (Conquer_Online_Server.Game.Enums.GuildMemberRank)client.Entity.GuildRank;
                                            }

                                    Writer.WriteUInt32((uint)client.Entity.MyFlowers.Orchads, 40, packet);
                                    if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
                                        if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                            if (client.Entity.MyFlowers.Orchads > client.Guild.orchid_donation)
                                            {
                                                client.Guild.orchid_donation = (uint)client.Entity.MyFlowers.Orchads;
                                                client.Entity.GuildRank = (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.OrchidFollower;
                                                client.AsMember.Rank = (Conquer_Online_Server.Game.Enums.GuildMemberRank)client.Entity.GuildRank;
                                            }
                                    Writer.WriteUInt32((uint)(client.Entity.MyFlowers.Orchads
                                        + (uint)client.Entity.MyFlowers.RedRoses
                                        + (uint)client.Entity.MyFlowers.Tulips
                                        + (uint)client.Entity.MyFlowers.Lilies), 44, packet);
                                }
                            if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
                                if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                {
                                    if (client.Entity.Name == client.Guild.LeaderName)
                                    {
                                        client.Entity.GuildRank = (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.LeaderSpouse;
                                        client.AsMember.Rank = (Conquer_Online_Server.Game.Enums.GuildMemberRank)client.Entity.GuildRank;
                                    }
                                }
                            if (client.Guild != null)
                                client.Guild.SendGuild(client);
                            client.Send(packet);
                        }
                        break;
                    }
                #endregion
                #region Guild members (2102)
                case 2102:
                    {
                        ushort Page = BitConverter.ToUInt16(packet, 8);
                        if (client.Guild != null)
                        {
                            client.Guild.SendMembers(client, Page);
                        }
                        break;
                    }
                #endregion
                #region EnitityCreate (1001)
                case 1001:
                    {
                        if (client.Action == 1)
                        {
                            EnitityCreate EC = new EnitityCreate();
                            EC.Deserialize(packet);
                            string Message = "";
                            Boolean Created = Database.EntityTable.CreateEntity(EC, client, ref Message);
                            client.Send(new Message(Message, "ALLUSERS", System.Drawing.Color.Orange, GamePackets.Message.PopUP));
                            if (Created)
                                Console.WriteLine(client.Account.Username + " Sucesfully Created a new Character " + EC.Name);
                            client.JustCreated = true;
                        }
                        break;
                    }
                #endregion
                #region Chat/Message (1004)
                case 1004:
                    {
                        if (client.Action != 2)
                            return;
                        Message message = new Message();
                        message.Deserialize(packet);
                        if (message.__Message.Split(new string[] { "\\n" }, StringSplitOptions.RemoveEmptyEntries).Length > 0)
                            message.__Message = message.__Message.Split(new string[] { "\\n" }, StringSplitOptions.RemoveEmptyEntries)[0];
                        Chat(message, client);
                        break;
                    }
                #endregion
                #region Item/Ping (1009)
                case 1009:
                    {
                        if (client.Action != 2)
                            return;
                        ItemUsage usage = new ItemUsage(false);
                        usage.Deserialize(packet);
                        if (!client.Entity.Dead || usage.ID == ItemUsage.Ping)
                        {
                            switch (usage.ID)
                            {

                                case 52:
                                    {
                                        var item = Database.ConquerItemTable.LoadItem(usage.UID);
                                        item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.ChatItem;
                                        item.Send(client);
                                        break;
                                    }
                                case 41:
                                    {
                                        var item = Database.ConquerItemTable.LoadItem(usage.UID);
                                        usage.dwParam = 5;
                                        client.Send(usage);
                                        break;
                                    }
                                case ItemUsage.ArrowReload:
                                    {
                                        ReloadArrows(client.Equipment.TryGetItem(ConquerItem.LeftWeapon), client);

                                        break;
                                    }
                                case ItemUsage.ShowBoothItems:
                                    {
                                        ShowBoothItems(usage, client);
                                        break;
                                    }
                                case ItemUsage.AddItemOnBoothForSilvers:
                                case ItemUsage.AddItemOnBoothForConquerPoints:
                                    {
                                        AddItemOnBooth(usage, client);
                                        break;
                                    }
                                case ItemUsage.BuyFromBooth:
                                    {
                                        BuyFromBooth(usage, client);
                                        break;
                                    }
                                case ItemUsage.RemoveItemFromBooth:
                                    {
                                        RemoveItemFromBooth(usage, client);
                                        break;
                                    }
                                case ItemUsage.EquipItem:
                                    {
                                        EquipItem(usage, client);
                                        break;
                                    }
                                case ItemUsage.UnequipItem:
                                    {
                                        UnequipItem(usage, client);
                                        break;
                                    }
                                case ItemUsage.BuyFromNPC:
                                    {
                                        HandleBuyFromNPC(usage, client);
                                        break;
                                    }
                                case ItemUsage.SellToNPC:
                                    {
                                        HandleSellToNPC(usage, client);
                                        break;
                                    }
                                case ItemUsage.Repair:
                                    {
                                        HandleRepair(usage, client);
                                        break;
                                    }
                                case ItemUsage.MeteorUpgrade:
                                case ItemUsage.DragonBallUpgrade:
                                    {
                                        UpgradeItem(usage, client);
                                        break;
                                    }
                                case ItemUsage.Ping:
                                    {
                                        if (Time32.Now < client.LastPing.AddSeconds(2))
                                        {
                                            client.PingCount++;
                                            if (client.PingCount == 40)
                                            {
                                                client.Send(new Message("Speed hack detected!", System.Drawing.Color.BlanchedAlmond, Message.TopLeft));
                                                client.Disconnect();
                                                return;
                                            }
                                        }

                                        if (client.Entity != null)
                                        {
                                            if (client.Entity.UID != 0)
                                            {
                                                if (!ServerBase.Kernel.GamePool.ContainsKey(client.Entity.UID))
                                                {
                                                    ServerBase.Kernel.GamePool.Add(client.Entity.UID, client);
                                                }
                                            }
                                        }

                                        client.LastPingT = client.LastPing;
                                        client.LastPing = Time32.Now;

                                        if (client.LastPing > client.LastPingT.AddSeconds(2))
                                            client.PingCount = 0;
                                        usage.TimeStamp += 120;
                                        // client.Send(ReturnFinal(packet));
                                        //Network.PacketHandler.HandleBuffer(packet, client);
                                        client.Send(usage);
                                        if (!ServerBase.Kernel.GamePool.ContainsKey(client.Entity.UID))
                                            if (client.Socket.Connected)
                                            {
                                                ServerBase.Kernel.GamePool.Add(client.Entity.UID, client);
                                                client.Screen.FullWipe();
                                                client.Screen.Reload(null);
                                            }
                                        break;
                                    }
                                case ItemUsage.ViewWarehouse:
                                    {
                                        usage.dwParam = client.MoneySave;
                                        client.Send(usage);
                                        break;
                                    }
                                case ItemUsage.WarehouseDeposit:
                                    {
                                        if (client.Entity.Money >= usage.dwParam)
                                        {
                                            client.Entity.Money -= usage.dwParam;
                                            client.MoneySave += usage.dwParam;
                                        }
                                        break;
                                    }
                                case ItemUsage.WarehouseWithdraw:
                                    {
                                        if (client.MoneySave >= usage.dwParam)
                                        {
                                            client.Entity.Money += usage.dwParam;
                                            client.MoneySave -= usage.dwParam;
                                        }
                                        break;
                                    }
                                case ItemUsage.DropItem:
                                    {
                                        DropItem(usage, client);
                                        break;
                                    }
                                case ItemUsage.DropMoney:
                                    {
                                        DropMoney(usage, client);
                                        break;
                                    }
                                case ItemUsage.Enchant:
                                    {
                                        EnchantItem(usage, client);
                                        break;
                                    }
                                case ItemUsage.SocketTalismanWithItem:
                                    {
                                        SocketTalismanWithItem(usage, client);
                                        break;
                                    }
                                case ItemUsage.SocketTalismanWithCPs:
                                    {
                                        SocketTalismanWithCPs(usage, client);
                                        break;
                                    }
                                case 40:
                                    {
                                        uint ItemAdd = (uint)((packet[4] & 0xFF) | ((packet[5] & 0xFF) << 8) | ((packet[6] & 0xFF) << 16) | ((packet[7] & 0xFF) << 24));

                                        //PrintPacket(packet);
                                        Interfaces.IConquerItem item_new = null;
                                        if (client.Inventory.TryGetItem(ItemAdd, out item_new))
                                        {
                                            if (item_new.Bless == 7)
                                                return;

                                            Queue<uint> amount = new Queue<uint>(packet[20]);

                                            for (ushort i = 84; i < 84 + 4 * packet[20]; i += 4)
                                            {
                                                if (client.Inventory.ContainsUID((uint)((packet[i] & 0xFF) | ((packet[(byte)(i + 1)] & 0xFF) << 8) | ((packet[(byte)(i + 2)] & 0xFF) << 16) | ((packet[(byte)(i + 3)] & 0xFF) << 24))))
                                                    amount.Enqueue((uint)((packet[i] & 0xFF) | ((packet[(byte)(i + 1)] & 0xFF) << 8) | ((packet[(byte)(i + 2)] & 0xFF) << 16) | ((packet[(byte)(i + 3)] & 0xFF) << 24)));
                                                else
                                                    return;
                                            }

                                            byte oldbless = item_new.Bless;
                                            if (item_new.Bless == 0 && amount.Count == 5)
                                                item_new.Bless = 1;
                                            else if (item_new.Bless == 1 && amount.Count == 1)
                                                item_new.Bless = 3;
                                            else if (item_new.Bless == 3 && amount.Count == 3)
                                                item_new.Bless = 5;
                                            else if (item_new.Bless == 5 && amount.Count == 5)
                                                item_new.Bless = 7;
                                            if (oldbless == item_new.Bless)
                                                return;

                                            while (amount.Count != 0)
                                                client.Inventory.Remove(amount.Dequeue(), Conquer_Online_Server.Game.Enums.ItemUse.Remove, true);

                                            item_new.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                            item_new.Send(client);
                                            Database.ConquerItemTable.UpdateItem(item_new, client);
                                        }
                                        //client.Send(packet);
                                        break;
                                    }
                                case 53:
                                    {
                                        uint ItemAdd = BitConverter.ToUInt32(packet, 8);

                                        //Interfaces.IConquerItem item_new = null;
                                        //if (client.Inventory.TryGetItem(ItemAdd, out item_new))
                                        {
                                            uint obtined_points = 0;
                                            Database.ConquerItemInformation iteminfo = new Conquer_Online_Server.Database.ConquerItemInformation(ItemAdd, 0);
                                            Dictionary<uint, uint> amount = new Dictionary<uint, uint>();//packet[20]);
                                            for (ushort i = 80; i < 84 + 4 * packet[20]; i += 4)
                                            {
                                                uint item_swap = BitConverter.ToUInt32(packet, i);
                                                if (client.Inventory.ContainsUID(item_swap))
                                                {
                                                    Interfaces.IConquerItem item = null;
                                                    if (client.Inventory.TryGetItem(item_swap, out item))
                                                    {
                                                        amount.Add(item_swap, i);
                                                    }
                                                    switch (item.ID)
                                                    {
                                                        case 191505:
                                                        case 191605:
                                                        case 191705:
                                                        case 191805:
                                                        case 191905:
                                                        case 191405:
                                                        case 183325:
                                                        case 183315:
                                                        case 183375:
                                                        case 183305:
                                                            {
                                                                obtined_points += 300;
                                                                break;
                                                            }
                                                        default:
                                                            obtined_points += 50;
                                                            break;
                                                    }
                                                }
                                            }
                                            if (iteminfo.BaseInformation.ConquerPointsWorth > obtined_points)
                                            {
                                                uint add_cps = 0;
                                                add_cps = (uint)(iteminfo.BaseInformation.ConquerPointsWorth - obtined_points);
                                                if (add_cps < client.Entity.ConquerPoints)
                                                {
                                                    client.Entity.ConquerPoints -= add_cps;
                                                    foreach (uint key in amount.Keys)
                                                    {
                                                        if (client.Inventory.ContainsUID(key))
                                                            client.Inventory.Remove(key, Conquer_Online_Server.Game.Enums.ItemUse.Remove, true);
                                                    }
                                                    client.Inventory.Add(ItemAdd, 0, 1);

                                                }
                                            }
                                            else
                                            {
                                                foreach (uint key in amount.Keys)
                                                {
                                                    if (client.Inventory.ContainsUID(key))
                                                        client.Inventory.Remove(key, Conquer_Online_Server.Game.Enums.ItemUse.Remove, true);
                                                }
                                                client.Inventory.Add(ItemAdd, 0, 1);

                                            }
                                        }
                                        break;
                                    }
                                case ItemUsage.SocketerMan:
                                    {
                                        #region Socketing
                                        UInt32 Count = usage.dwExtraInfo, ItemUID = usage.UID;
                                        Byte Type = 0;
                                        Interfaces.IConquerItem Item = null;
                                        if (client.Inventory.TryGetItem(ItemUID, out Item))
                                        {
                                            #region Removing Used Items
                                            for (int i = 1; i <= Count; i++)
                                            {
                                                uint It = BitConverter.ToUInt32(packet, (int)(80 + (4 * i)));
                                                Interfaces.IConquerItem Rem = null;
                                                if (client.Inventory.TryGetItem(It, out Rem))
                                                {
                                                    if (Rem.ID == 1088000 && Count == 12)
                                                        Type = 1;
                                                    if (Rem.ID == 1088000 && Count == 1)
                                                        Type = 2;
                                                    if (Rem.ID == 1088000 && Count == 5)
                                                        Type = 3;
                                                    if (Rem.ID == 1200005 && Count == 1)
                                                        Type = 4;
                                                    if (Rem.ID == 1200006 && Count == 7)
                                                        Type = 5;
                                                    client.Inventory.Remove(Rem, Game.Enums.ItemUse.Remove);
                                                }
                                            }
                                            #endregion
                                            #region Type Switch
                                            switch (Type)
                                            {
                                                #region Open First Socket
                                                case 1:
                                                case 2:
                                                    {
                                                        usage.dwParam = 1;
                                                        Item.Mode = Game.Enums.ItemMode.Update;
                                                        Item.SocketOne = (Game.Enums.Gem)255;
                                                        Item.Send(client);
                                                        Item.Mode = Game.Enums.ItemMode.Default;
                                                        Conquer_Online_Server.Database.ConquerItemTable.UpdateSockets(Item, client);
                                                        break;
                                                    }
                                                #endregion
                                                #region Open Second Socket
                                                case 3:
                                                case 5:
                                                    {
                                                        usage.dwParam = 1;
                                                        Item.Mode = Game.Enums.ItemMode.Update;
                                                        Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has oppened the second socket into his/her item!", System.Drawing.Color.Yellow, 2011), Kernel.GamePool.Values, client.Entity.UID);
                                                        Item.SocketTwo = (Game.Enums.Gem)255;
                                                        Item.Send(client);
                                                        Item.Mode = Game.Enums.ItemMode.Default;
                                                        Conquer_Online_Server.Database.ConquerItemTable.UpdateSockets(Item, client);
                                                        break;
                                                    }
                                                #endregion
                                                #region Using Tough Drill
                                                case 4:
                                                    {
                                                        if (ServerBase.Kernel.Rate(10))
                                                        {
                                                            usage.dwParam = 1;
                                                            Item.Mode = Game.Enums.ItemMode.Update;
                                                            Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has oppened the second socket into his/her item!", System.Drawing.Color.Yellow, 2011), Kernel.GamePool.Values, client.Entity.UID);
                                                            Item.SocketTwo = (Game.Enums.Gem)255;
                                                            Item.Send(client);
                                                            Item.Mode = Game.Enums.ItemMode.Default;
                                                            Conquer_Online_Server.Database.ConquerItemTable.UpdateSockets(Item, client);
                                                        }
                                                        else
                                                        {
                                                            usage.dwParam = 0;
                                                            client.Send(new Message("The ToughDrill has failed. Try your lucky next time!", System.Drawing.Color.Red, Message.TopLeft));
                                                            client.Inventory.Add(1200006, 0, 1);
                                                        }
                                                        break;
                                                    }
                                                #endregion
                                            }
                                            #endregion
                                        }
                                        //dWParam Values, = 0 = Failed, 1 = Suceed, 2 = Nothing
                                        client.Send(usage);
                                        #endregion
                                        break;
                                    }
                                case ItemUsage.RedeemGear:
                                    {
                                        var item = client.DeatinedItem[usage.UID];
                                        if (item != null)
                                        {
                                            if (DateTime.Now > item.Date.AddDays(7))
                                            {
                                                client.Send(new Message("This item is expired!", System.Drawing.Color.Red, Message.TopLeft));

                                                return;
                                            }
                                            if (client.Entity.ConquerPoints >= item.ConquerPointsCost)
                                            {
                                                client.Entity.ConquerPoints -= item.ConquerPointsCost;

                                                usage.dwParam = client.Entity.UID;
                                                usage.dwExtraInfo3 = item.ConquerPointsCost;
                                                client.Send(usage);

                                                client.Inventory.Add(item.Item, Conquer_Online_Server.Game.Enums.ItemUse.Add);

                                                Database.DetainedItemTable.Redeem(item, client);
                                                client.DeatinedItem.Remove(item.UID);

                                                if (ServerBase.Kernel.GamePool.ContainsKey(item.GainerUID))
                                                {
                                                    var pClient = ServerBase.Kernel.GamePool[item.GainerUID];
                                                    pClient.ClaimableItem[item.UID].OwnerUID = 500;
                                                    pClient.ClaimableItem[item.UID].MakeItReadyToClaim();
                                                    usage.dwParam = pClient.Entity.UID;
                                                    usage.ID = ItemUsage.ClaimGear;
                                                    pClient.Send(usage);
                                                    pClient.ClaimableItem[item.UID].Send(pClient);
                                                }

                                                Message message = new Message("Thank you for arresting " + item.OwnerName + ", " + item.GainerName + ". The arrested one has redeemed his items and you have received a great deal of ConquerPoints as reward. Congratulations!", System.Drawing.Color.Wheat, Message.Talk);
                                                ServerBase.Kernel.SendWorldMessage(message, ServerBase.Kernel.GamePool.Values);
                                            }
                                        }
                                        else
                                        {
                                            client.Send(new Message("The item you want to redeem has already been redeemed.", System.Drawing.Color.Red, Message.TopLeft));
                                        }
                                        break;
                                    }
                                case ItemUsage.ClaimGear:
                                    {
                                        var item = client.ClaimableItem[usage.UID];
                                        if (item != null)
                                        {
                                            if (item.Bound)
                                            {
                                                client.Send(new Message("Unnclaimable item!", System.Drawing.Color.Red, Message.TopLeft));
                                                return;
                                            }
                                            if (DateTime.Now < item.Date.AddDays(7) && item.OwnerUID != 500)
                                            {
                                                client.Send(new Message("This item is not expired. You cannot claim it yet!", System.Drawing.Color.Red, Message.TopLeft));
                                                return;
                                            }
                                            if (item.OwnerUID == 500)
                                                client.Entity.ConquerPoints += item.ConquerPointsCost;
                                            else
                                            {
                                                client.Inventory.Add(item.Item, Conquer_Online_Server.Game.Enums.ItemUse.Move);
                                                Message message = new Message("Thank you for arresting " + item.OwnerName + ", " + item.GainerName + ". The arrested one has redeemed his items and you have received a great deal of ConquerPoints as reward. Congratulations!", System.Drawing.Color.Wheat, Message.Talk);
                                                ServerBase.Kernel.SendWorldMessage(message, ServerBase.Kernel.GamePool.Values);
                                            }
                                            Database.DetainedItemTable.Claim(item, client);
                                            client.ClaimableItem.Remove(item.UID);

                                            usage.dwParam = client.Entity.UID;
                                            usage.dwExtraInfo3 = item.ConquerPointsCost;
                                            client.Send(usage);
                                        }
                                        else
                                        {
                                            client.Send(new Message("The item you want to claim has already been claimed.", System.Drawing.Color.Red, Message.TopLeft));
                                        }
                                        break;
                                    }
                                case 34:
                                    {
                                        break;
                                    }
                                case 45:
                                    {
                                        client.Entity.Teleport(1002, 429, 378);
                                        break;
                                    }
                                default:
                                    {
                                        Console.WriteLine("Unhandled item usage type : " + usage.ID);
                                        break;
                                    }
                            }
                        }
                        break;
                    }
                #endregion
                #region String (1015)
                case 1015:
                    {
                        if (client.Action != 2)
                            return;
                        _String stringpacket = new _String(false);
                        stringpacket.Deserialize(packet);
                        switch (stringpacket.Type)
                        {
                            case _String.WhisperDetails:
                                {
                                    if (stringpacket.Texts.Count > 0)
                                    {
                                        var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                        varr.MoveNext();
                                        int COunt = ServerBase.Kernel.GamePool.Count;
                                        for (uint x = 0;
                                            x < COunt;
                                            x++)
                                        {
                                            if (x >= COunt) break;

                                            Client.GameState pClient = (varr.Current as Client.GameState);

                                            if (pClient.Entity.Name == stringpacket.Texts[0])
                                            {
                                                string otherstring = "";
                                                otherstring += pClient.Entity.UID + " ";
                                                otherstring += pClient.Entity.Level + " ";
                                                otherstring += pClient.Entity.BattlePower + " #";
                                                if (pClient.Entity.GuildID != 0)
                                                    otherstring += pClient.Guild.Name + " fNone# ";
                                                else
                                                    otherstring += "None fNone# ";
                                                otherstring += pClient.Entity.Spouse + " ";
                                                otherstring += (byte)(pClient.Entity.NobilityRank) + " ";
                                                if (pClient.Entity.Body % 10 < 3)
                                                    otherstring += "1";
                                                else
                                                    otherstring += "0";
                                                stringpacket.Texts.Add(otherstring);
                                                client.Send(stringpacket);
                                            }

                                            varr.MoveNext();

                                        }
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region KnownPersons (1019)
                case 1019:
                    {
                        KnownPersons knownP = new KnownPersons(false);
                        knownP.Deserialize(packet);
                        switch (knownP.Type)
                        {
                            case KnownPersons.RequestFriendship:
                                {
                                    AddFriend(knownP, client);
                                    break;
                                }
                            case KnownPersons.RemovePerson:
                                {
                                    RemoveFriend(knownP, client);
                                    break;
                                }
                            case KnownPersons.RemoveEnemy:
                                {
                                    RemoveEnemy(knownP, client);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Attack (1022)
                case 1022:
                    {
                        if (client.Action != 2)
                            return;
                        uint dmg = BitConverter.ToUInt32(packet, 24);
                        uint AttackType = BitConverter.ToUInt32(packet, 20);
                        switch (AttackType)
                        {
                            case 39:
                                {
                                    if (!Kernel.VotePool.ContainsKey(client.Account.IP))
                                    {
                                        if (!Kernel.VotePoolUid.ContainsKey(client.Entity.UID))
                                        {
                                            client.Entity.ConquerPoints += 1000;
                                            Conquer_Online_Server.Game.ConquerStructures.PlayersVot Vot = new Conquer_Online_Server.Game.ConquerStructures.PlayersVot();
                                            Vot.AdressIp = client.Account.IP;
                                            Vot.Uid = client.Entity.UID;
                                            Kernel.VotePool.Add(Vot.AdressIp, Vot);
                                            Kernel.VotePoolUid.Add(Vot.Uid, Vot);
                                            Database.EntityTable.SavePlayersVot(Vot);
                                            client.Send(new Conquer_Online_Server.Network.GamePackets.Message("http://5.41.141.216/index.php", 2105));
                                            client.Send(new Message("You Have clamied your Prize 1k Cps Server ", Color.Brown, 1000000));
                                        }
                                        else
                                        {
                                            client.Send(new Conquer_Online_Server.Network.GamePackets.Message("http://5.41.141.216/index.php", 2105));
                                            client.Send(new Message("you can only take prize once in day", Color.Brown, 10000000));
                                        }
                                    }
                                    else
                                    {
                                        client.Send(new Conquer_Online_Server.Network.GamePackets.Message("http://5.41.141.216/index.php", 2105));
                                        client.Send(new Message("you can only take prize once in day", Color.Brown, 10000000));
                                    }

                                    break;
                                }
                            default:
                                {
                                    GamePackets.Attack attack = new Attack(false);
                                    attack.Deserialize(packet);
                                    if (client.Entity.ContainsFlag(Update.Flags.Ride) && !client.Entity.Owner.Equipment.Free(18))
                                    {
                                        Attack(attack, client);
                                        return;
                                    }
                                    else
                                    {
                                        client.Entity.RemoveFlag(Update.Flags.Ride);
                                    }
                                    Attack(attack, client);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Teams (1023)
                case 1023:
                    {
                        if (client.Action != 2)
                            return;
                        Team teamPacket = new Team();
                        teamPacket.Deserialize(packet);
                        switch (teamPacket.Type)
                        {
                            case Team.Create: CreateTeam(teamPacket, client); break;
                            case Team.AcceptJoinRequest: AcceptRequestToJoinTeam(teamPacket, client); break;
                            case Team.AcceptInvitation: AcceptInviteToJoinTeam(teamPacket, client); break;
                            case Team.InviteRequest: SendInviteToJoinTeam(teamPacket, client); break;
                            case Team.JoinRequest: SendRequestJoinToTeam(teamPacket, client); break;
                            case Team.ExitTeam: LeaveTeam(teamPacket, client); break;
                            case Team.Dismiss: DismissTeam(teamPacket, client); break;
                            case Team.Kick: KickFromTeam(teamPacket, client); break;
                            case Team.ForbidJoining:
                                {
                                    if (client.Team != null && client.Team.Teammates != null) foreach (Client.GameState Teammate in client.Team.Teammates)
                                            if (Teammate != null)
                                            {
                                                Teammate.Team.ForbidJoin = true;
                                                Teammate.Send(teamPacket);
                                            }

                                    break;
                                }
                            case Team.UnforbidJoining:
                                {
                                    if (client.Team != null && client.Team.Teammates != null) foreach (Client.GameState Teammate in client.Team.Teammates)
                                            if (Teammate != null)
                                            {
                                                Teammate.Team.ForbidJoin = false;
                                                Teammate.Send(teamPacket);
                                            }

                                    break;
                                }
                            case Team.LootMoneyOff:
                                {
                                    if (client.Team != null && client.Team.Teammates != null) foreach (Client.GameState Teammate in client.Team.Teammates)
                                            if (Teammate != null)
                                            {
                                                Teammate.Team.PickupMoney = true;
                                                Teammate.Send(teamPacket);
                                            }
                                    break;
                                }
                            case Team.LootMoneyOn:
                                {
                                    if (client.Team != null && client.Team.Teammates != null) foreach (Client.GameState Teammate in client.Team.Teammates)
                                            if (Teammate != null)
                                            {
                                                Teammate.Team.PickupMoney = false;
                                                Teammate.Send(teamPacket);
                                            }
                                    break;
                                }
                            case Team.LootItemsOn:
                                {
                                    if (client.Team != null && client.Team.Teammates != null) foreach (Client.GameState Teammate in client.Team.Teammates)
                                            if (Teammate != null)
                                            {
                                                Teammate.Team.PickupItems = true;
                                                Teammate.Send(teamPacket);
                                            }
                                    break;
                                }
                            case Team.LootItemsOff:
                                {
                                    if (client.Team != null && client.Team.Teammates != null) foreach (Client.GameState Teammate in client.Team.Teammates)
                                            if (Teammate != null)
                                            {
                                                Teammate.Team.PickupItems = false;
                                                Teammate.Send(teamPacket);
                                            }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Atributes Set (1024)
                case 1024:
                    {
                        if (client.Action != 2)
                            return;
                        ushort AddStr = BitConverter.ToUInt16(packet, 8);
                        ushort AddAgi = BitConverter.ToUInt16(packet, 12);
                        ushort AddVit = BitConverter.ToUInt16(packet, 16);
                        ushort AddSpi = BitConverter.ToUInt16(packet, 20);
                        if (AddStr > 0)
                        {
                            if (client.Entity.Atributes >= AddStr)
                            {
                                client.Entity.Atributes -= AddStr;
                                client.Entity.Strength += AddStr;
                            }
                        }
                        if (AddAgi > 0)
                        {
                            if (client.Entity.Atributes >= AddAgi)
                            {
                                client.Entity.Atributes -= AddAgi;
                                client.Entity.Agility += AddAgi;
                            }
                        }
                        if (AddVit > 0)
                        {
                            if (client.Entity.Atributes >= AddVit)
                            {
                                client.Entity.Atributes -= AddVit;
                                client.Entity.Vitality += AddVit;
                            }
                        }
                        if (AddSpi > 0)
                        {
                            if (client.Entity.Atributes >= AddSpi)
                            {
                                client.Entity.Atributes -= AddSpi;
                                client.Entity.Spirit += AddSpi;
                            }
                        }
                        //Conquer_Online_Server.Game.Attacking.Calculate.Vitals(client.Entity, true);
                        client.CalculateStatBonus();
                        client.CalculateHPBonus();
                        client.GemAlgorithm();
                        client.SendStatMessage();
                        break;
                    }
                #endregion
                #region Socketing (1027)
                case 1027:
                    {
                        EmbedSocket socket = new EmbedSocket(false);
                        socket.Deserialize(packet);
                        SocketItem(socket, client);
                        break;
                    }
                #endregion
                #region ItemAdding Stabilization
                case 1038:
                    {
                        ItemAddingStabilization stabilization = new ItemAddingStabilization(false);
                        stabilization.Deserialize(packet);
                        StabilazeArtifact(stabilization, client);
                        break;
                    }
                #endregion
                #region LoginPacket (1052)
                case 1052:
                    {
                        if (client.Action == 1)
                        {
                            Connect connect = new Connect();
                            connect.Deserialize(packet);
                            AppendConnect(connect, client);
                        }
                        else
                            client.Disconnect();
                        break;
                    }
                #endregion
                #region Trade (1056)
                case 1056:
                    {
                        if (client.Action != 2)
                            return;
                        Trade trade = new Trade(false);
                        trade.Deserialize(packet);
                        switch (trade.Type)
                        {
                            case Trade.Request:
                                RequestTrade(trade, client);
                                break;
                            case Trade.Close:
                                CloseTrade(trade, client);
                                break;
                            case Trade.AddItem:
                                AddTradeItem(trade, client);
                                break;
                            case Trade.SetMoney:
                                SetTradeMoney(trade, client);
                                break;
                            case Trade.SetConquerPoints:
                                SetTradeConquerPoints(trade, client);
                                break;
                            case Trade.Accept:
                                AcceptTrade(trade, client);
                                break;
                        }
                        break;
                    }
                #endregion
                #region Floor items (1101)
                case 1101:
                    {
                        if (client.Action != 2)
                            return;
                        FloorItem floorItem = new FloorItem(false);
                        floorItem.Deserialize(packet);
                        PickupItem(floorItem, client);
                        break;
                    }
                #endregion
                #region Warehouses (1102)
                case 1102:
                    {
                        if (client.Action != 2)
                            return;
                        Warehouse warehousepacket = new Warehouse(false);
                        warehousepacket.Deserialize(packet);
                        switch (warehousepacket.Type)
                        {
                            case Warehouse.Entire:
                                {
                                    Game.ConquerStructures.Warehouse wh = client.Warehouses[(Conquer_Online_Server.Game.ConquerStructures.Warehouse.WarehouseID)warehousepacket.NpcID];
                                    if (wh == null) return;
                                    byte count = 0;
                                    warehousepacket.Count = 1;
                                    warehousepacket.Type = Warehouse.AddItem;
                                    for (; count < wh.Count; count++)
                                    {
                                        warehousepacket.Append(wh.Objects[count]);
                                        client.Send(warehousepacket);
                                    }
                                    break;
                                }
                            case Warehouse.AddItem:
                                {
                                    Game.ConquerStructures.Warehouse wh = client.Warehouses[(Conquer_Online_Server.Game.ConquerStructures.Warehouse.WarehouseID)warehousepacket.NpcID];
                                    if (wh == null) return;
                                    Interfaces.IConquerItem item = null;
                                    if (client.Inventory.TryGetItem(warehousepacket.UID, out item))
                                    {
                                        if (wh.Add(item))
                                        {
                                            warehousepacket.UID = 0;
                                            warehousepacket.Count = 1;
                                            warehousepacket.Append(item);
                                            client.Send(warehousepacket);
                                            return;
                                        }
                                    }
                                    break;
                                }
                            case Warehouse.RemoveItem:
                                {
                                    Game.ConquerStructures.Warehouse wh = client.Warehouses[(Conquer_Online_Server.Game.ConquerStructures.Warehouse.WarehouseID)warehousepacket.NpcID];
                                    if (wh == null) return;
                                    if (wh.ContainsUID(warehousepacket.UID))
                                    {
                                        if (wh.Remove(warehousepacket.UID))
                                        {
                                            client.Send(warehousepacket);
                                            return;
                                        }
                                    }
                                    break;
                                }
                            default:
                                {
                                    Console.WriteLine("Unknown type: " + warehousepacket.Type);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Guild command (1107)
                case 1107:
                    {
                        GuildCommand command = new GuildCommand(false);
                        command.Deserialize(packet);
                        switch (command.Type)
                        {
                            case GuildCommand.Neutral1:
                            case GuildCommand.Neutral2:
                                {
                                    string name = System.Text.ASCIIEncoding.ASCII.GetString(packet, 26, packet[25]);
                                    if (client.Guild != null)
                                    {
                                        if (client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                        {
                                            client.Guild.RemoveAlly(name);
                                            foreach (var guild in ServerBase.Kernel.Guilds.Values)
                                            {
                                                if (guild.Name == name && client.Guild.Name != name)
                                                {
                                                    guild.RemoveAlly(client.Guild.Name);
                                                }
                                            }
                                            client.Guild.RemoveEnemy(name);
                                        }
                                    }
                                    break;
                                }
                            case GuildCommand.Allied:
                                {
                                    string name = System.Text.ASCIIEncoding.ASCII.GetString(packet, 26, packet[25]);
                                    if (client.Guild != null)
                                    {
                                        if (client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                        {
                                            AllyGuilds(name, client);
                                        }
                                    }
                                    break;
                                }
                            case GuildCommand.Enemied:
                                {
                                    string name = System.Text.ASCIIEncoding.ASCII.GetString(packet, 26, packet[25]);
                                    if (client.Guild != null)
                                    {
                                        if (client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                        {
                                            client.Guild.AddEnemy(name);
                                        }
                                    }
                                    break;
                                }
                            default:
                                {
                                    client.Send(packet);
                                    break;
                                }
                            case GuildCommand.Bulletin:
                                {
                                    string message = System.Text.ASCIIEncoding.ASCII.GetString(packet, 26, packet[25]);
                                    if (client.Guild != null)
                                    {
                                        if (client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                        {
                                            client.Guild.Bulletin = message;
                                            client.Guild.SendGuild(client);
                                            Database.GuildTable.UpdateBulletin(client.Guild, client.Guild.Bulletin);
                                        }
                                    }
                                    break;
                                }
                            case GuildCommand.DonateSilvers:
                                {
                                    if (client.Guild != null)
                                    {
                                        if (client.Entity.Money >= command.dwParam)
                                        {
                                            client.Guild.SilverFund += command.dwParam;
                                            Database.GuildTable.SaveFunds(client.Guild);
                                            client.AsMember.SilverDonation += command.dwParam;
                                            client.Entity.Money -= command.dwParam;
                                            client.Guild.SendGuild(client);
                                        }
                                    }
                                    break;
                                }
                            case GuildCommand.DonateConquerPoints:
                                {
                                    if (client.Guild != null)
                                    {
                                        if (client.Entity.ConquerPoints >= command.dwParam)
                                        {
                                            client.Guild.ConquerPointFund += command.dwParam;
                                            Database.GuildTable.SaveFunds(client.Guild);
                                            client.AsMember.ConquerPointDonation += command.dwParam;
                                            client.Entity.ConquerPoints -= command.dwParam;
                                            client.Guild.SendGuild(client);
                                        }
                                    }
                                    break;
                                }
                            case GuildCommand.Refresh:
                                {
                                    if (client.AsMember != null)
                                    {
                                        if (client.Guild != null)
                                            client.Guild.SendGuild(client);
                                    }
                                    break;
                                }
                            case GuildCommand.Discharge:
                                {
                                    string name = System.Text.ASCIIEncoding.ASCII.GetString(packet, 26, packet[25]);
                                    if (client.Guild != null)
                                    {
                                        if (client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                        {
                                            var member = client.Guild.GetMemberByName(name);
                                            if (member.ID != client.Entity.UID)
                                            {
                                                if (member.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
                                                {
                                                    client.Guild.DeputyLeaderCount--;
                                                    member.Rank = Conquer_Online_Server.Game.Enums.GuildMemberRank.Member;
                                                    if (member.IsOnline)
                                                    {
                                                        client.Guild.SendGuild(member.Client);
                                                        member.Client.Entity.GuildRank = (ushort)member.Rank;
                                                        member.Client.Screen.FullWipe();
                                                        member.Client.Screen.Reload(null);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    break;
                                }
                            case GuildCommand.Promote:
                                {
                                    if (client.Guild != null)
                                    {
                                        if (client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                        {
                                            if (client.Guild.Members.ContainsKey(command.dwParam))
                                            {
                                                var member = client.Guild.Members[command.dwParam];
                                                if (member.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.Member)
                                                {
                                                    member.Rank = Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader;
                                                    if (member.IsOnline)
                                                    {
                                                        client.Guild.SendGuild(member.Client);
                                                        member.Client.Entity.GuildRank = (ushort)member.Rank;
                                                        member.Client.Screen.FullWipe();
                                                        member.Client.Screen.Reload(null);
                                                    }
                                                }
                                                else if (member.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
                                                {
                                                    member.Rank = Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader;
                                                    if (member.IsOnline)
                                                    {
                                                        client.Guild.SendGuild(member.Client);
                                                        member.Client.Entity.GuildRank = (ushort)member.Rank;
                                                        member.Client.Screen.FullWipe();
                                                        member.Client.Screen.Reload(null);
                                                    }
                                                    client.AsMember.Rank = Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader;
                                                    client.Guild.SendGuild(client);
                                                    client.Entity.GuildRank = (ushort)client.AsMember.Rank;
                                                    client.Screen.FullWipe();
                                                    client.Screen.Reload(null);
                                                }
                                            }
                                        }
                                    }
                                    break;
                                }
                            case GuildCommand.JoinRequest:
                                {
                                    if (ServerBase.Kernel.GamePool.ContainsKey(command.dwParam))
                                    {
                                        var Client = ServerBase.Kernel.GamePool[command.dwParam];
                                        if (Client.OnHoldGuildJoin == client.OnHoldGuildJoin && Client.OnHoldGuildJoin != 0)
                                        {
                                            if (Client.Guild != null)
                                            {
                                                if (Client.AsMember.Rank != Conquer_Online_Server.Game.Enums.GuildMemberRank.Member)
                                                {
                                                    Client.Guild.AddMember(client);
                                                    Client.OnHoldGuildJoin = 0;
                                                    client.OnHoldGuildJoin = 0;
                                                }
                                            }
                                            else
                                            {
                                                if (client.AsMember.Rank != Conquer_Online_Server.Game.Enums.GuildMemberRank.Member)
                                                {
                                                    client.Guild.AddMember(Client);
                                                    Client.OnHoldGuildJoin = 0;
                                                    client.OnHoldGuildJoin = 0;
                                                }
                                            }
                                            return;
                                        }
                                        if (client.Guild == null)
                                        {
                                            command.dwParam = client.Entity.UID;
                                            Client.Send(command);
                                            Client.OnHoldGuildJoin = (uint)new Random().Next();
                                            client.OnHoldGuildJoin = Client.OnHoldGuildJoin;
                                        }
                                    }
                                    break;
                                }
                            case GuildCommand.InviteRequest:
                                {
                                    if (ServerBase.Kernel.GamePool.ContainsKey(command.dwParam))
                                    {
                                        var Client = ServerBase.Kernel.GamePool[command.dwParam];
                                        if (Client.OnHoldGuildJoin == client.OnHoldGuildJoin && Client.OnHoldGuildJoin != 0)
                                        {
                                            if (Client.Guild != null)
                                            {
                                                if (Client.AsMember.Rank != Conquer_Online_Server.Game.Enums.GuildMemberRank.Member)
                                                {
                                                    Client.Guild.AddMember(client);
                                                    Client.OnHoldGuildJoin = 0;
                                                    client.OnHoldGuildJoin = 0;
                                                }
                                            }
                                            else
                                            {
                                                if (client.AsMember.Rank != Conquer_Online_Server.Game.Enums.GuildMemberRank.Member)
                                                {
                                                    client.Guild.AddMember(Client);
                                                    Client.OnHoldGuildJoin = 0;
                                                    client.OnHoldGuildJoin = 0;
                                                }
                                            }
                                            return;
                                        }
                                        if (client.Guild != null)
                                        {
                                            command.dwParam = client.Entity.UID;
                                            Client.Send(command);
                                            Client.OnHoldGuildJoin = (uint)new Random().Next();
                                            client.OnHoldGuildJoin = Client.OnHoldGuildJoin;
                                        }
                                    }
                                    break;
                                }
                            case GuildCommand.Quit:
                                {
                                    if (client.Guild != null)
                                    {
                                        if (client.AsMember.Rank != Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                        {
                                            client.Guild.ExpelMember(client.Entity.Name, true);
                                        }
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Enlight (1127)
                case 1127:
                    {
                        Enlight enlight = new Enlight(false);
                        enlight.Deserialize(packet);
                        if (ServerBase.Kernel.GamePool.ContainsKey(enlight.Enlighted))
                        {
                            var Client = ServerBase.Kernel.GamePool[enlight.Enlighted];

                            if (enlight.Enlighter == client.Entity.UID && enlight.Enlighted != enlight.Enlighter)
                            {
                                if (Client.Entity.ReceivedEnlightenPoints < 5)
                                {
                                    if (client.Entity.EnlightenPoints >= 100)
                                    {
                                        if (Client.Entity.EnlightmentTime <= 80)
                                        {
                                            client.Entity.EnlightenPoints -= 100;
                                            Client.Entity.EnlightmentStamp = Time32.Now;
                                            Client.IncreaseExperience(Game.Attacking.Calculate.Percent((int)Client.ExpBall, .10F), false);
                                            Client.SendScreen(packet, true);
                                            Client.Entity.ReceivedEnlightenPoints++;
                                            Client.Entity.EnlightmentTime += 20;
                                            if (client.Entity.EnlightmentTime > 80)
                                                client.Entity.EnlightmentTime = 100;
                                            else if (client.Entity.EnlightmentTime > 60)
                                                client.Entity.EnlightmentTime = 80;
                                            else if (client.Entity.EnlightmentTime > 40)
                                                client.Entity.EnlightmentTime = 60;
                                            else if (client.Entity.EnlightmentTime > 20)
                                                client.Entity.EnlightmentTime = 40;
                                            else if (client.Entity.EnlightmentTime > 0)
                                                client.Entity.EnlightmentTime = 20;
                                        }
                                        else client.Send(new Message("You can't enlighten " + Client.Entity.Name + " yet because he has to wait a few minutes until he can be enlightened again.", System.Drawing.Color.Blue, Message.TopLeft));
                                    }
                                    else client.Send(new Message("You can't enlighten " + Client.Entity.Name + " because you don't have enough enlighten points!", System.Drawing.Color.Blue, Message.TopLeft));
                                }
                                else client.Send(new Message("You can't enlighten " + Client.Entity.Name + " because he/she was enlightened today five times already!", System.Drawing.Color.Blue, Message.TopLeft));
                            }
                        }
                        break;
                    }
                #endregion
                #region NPC Dialog (2031 + 2032)
                case 2031:
                case 2032:
                    {
                        if (client.Action != 2)
                            return;
                        NpcRequest req = new NpcRequest();
                        req.Deserialize(packet);
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 202)//HoursPK War
                        {
                            if (client.Entity.Owner.Equipment.TryGetItem((byte)12).Plus > 7)
                            {
                                client.Entity.AddFlag(Update.Flags.Ride);
                                Random R = new Random();
                                int Nr = R.Next(1, 10);
                                if (Nr == 1) client.Entity.Teleport(2525, 114, 078);
                                if (Nr == 2) client.Entity.Teleport(2525, 96, 87);
                                if (Nr == 3) client.Entity.Teleport(2525, 142, 88);
                                if (Nr == 4) client.Entity.Teleport(2525, 115, 115);
                                if (Nr == 5) client.Entity.Teleport(2525, 98, 130);
                                if (Nr == 6) client.Entity.Teleport(2525, 96, 153);
                                if (Nr == 7) client.Entity.Teleport(2525, 112, 162);
                                if (Nr == 8) client.Entity.Teleport(2525, 130, 166);
                                if (Nr == 9) client.Entity.Teleport(2525, 139, 114);
                                if (Nr == 10) client.Entity.Teleport(2525, 156, 119);
                            }
                        }
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 167)//Donation War
                        {
                            if (client.Entity.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                            {
                                client.Entity.Teleport(1166, 50, 50);//Kings Map
                            }
                            if (client.Entity.NobilityRank == Game.ConquerStructures.NobilityRank.Prince)
                            {
                                client.Entity.Teleport(1167, 50, 50);//Princes Map
                            }
                            if (client.Entity.NobilityRank == Game.ConquerStructures.NobilityRank.Duke)
                            {
                                client.Entity.Teleport(1168, 50, 50);//Duke Map
                            }
                        }
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 133)//5th Elements
                        {
                            client.Entity.Teleport(1233, 36, 34);
                        }
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 159)//DeathTeam
                        {
                            client.Entity.Teleport(1595, 125, 130);
                        }
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 115)//GuildWar
                        {
                            Random R = new Random();
                            int Nr = R.Next(1, 10);
                            if (Nr == 1)
                            {
                                client.Entity.Teleport(1038, 351, 341);
                            }
                            if (Nr == 2)
                            {
                                client.Entity.Teleport(1038, 335, 345);
                            }
                            if (Nr == 3)
                            {
                                client.Entity.Teleport(1038, 309, 369);
                            }
                            if (Nr == 4)
                            {
                                client.Entity.Teleport(1038, 283, 340);
                            }
                            if (Nr == 5)
                            {
                                client.Entity.Teleport(1038, 310, 327);
                            }
                            if (Nr == 6)
                            {
                                client.Entity.Teleport(1038, 318, 297);
                            }
                            if (Nr == 7)
                            {
                                client.Entity.Teleport(1038, 347, 309);
                            }
                            if (Nr == 8)
                            {
                                client.Entity.Teleport(1038, 337, 320);
                            }
                            if (Nr == 9)
                            {
                                client.Entity.Teleport(1038, 309, 293);
                            }
                            if (Nr == 10)
                            {
                                client.Entity.Teleport(1038, 371, 300);
                            }
                        }
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 202)//HoursPK War
                        {
                            if (client.Entity.Owner.Equipment.TryGetItem((byte)12).Plus > 7)
                            {
                                client.Entity.AddFlag(Update.Flags.Ride);
                                Random R = new Random();
                                int Nr = R.Next(1, 10);
                                if (Nr == 1) client.Entity.Teleport(2525, 114, 078);
                                if (Nr == 2) client.Entity.Teleport(2525, 96, 87);
                                if (Nr == 3) client.Entity.Teleport(2525, 142, 88);
                                if (Nr == 4) client.Entity.Teleport(2525, 115, 115);
                                if (Nr == 5) client.Entity.Teleport(2525, 98, 130);
                                if (Nr == 6) client.Entity.Teleport(2525, 96, 153);
                                if (Nr == 7) client.Entity.Teleport(2525, 112, 162);
                                if (Nr == 8) client.Entity.Teleport(2525, 130, 166);
                                if (Nr == 9) client.Entity.Teleport(2525, 139, 114);
                                if (Nr == 10) client.Entity.Teleport(2525, 156, 119);
                            }
                        }
                        if (req.InteractType == NpcReply.MessageBox)
                        {
                            if (req.OptionID == 255)
                            {
                                if (client.OnMessageBoxOK != null)
                                {
                                    client.OnMessageBoxOK.Invoke();
                                    client.OnMessageBoxOK = null;
                                }
                            }
                            else
                            {
                                if (client.OnMessageBoxCANCEL != null)
                                {
                                    client.OnMessageBoxCANCEL.Invoke();
                                    client.OnMessageBoxCANCEL = null;
                                }
                            }
                        }
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 249)
                        {
                            Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                        }
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 248)
                        {
                            if (ServerBase.Kernel.PK == false)
                            {
                                client.Send(new Network.GamePackets.NpcReply(6, "The Tournoment has finished time of join."));

                            }
                            else
                            {
                                client.InPKT = true;
                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                client.Entity.Teleport(1507, 100, 100);
                            }
                        }
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 247)
                        {

                            client.Entity.Teleport(1858, 70, 70);

                        }

                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 246)
                        {

                            if (ServerBase.Kernel.PK == false)
                            {
                                client.Send(new Network.GamePackets.NpcReply(6, "The Tournoment has finished time of join."));

                            }
                            else
                            {
                                client.InPKT = true;
                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                client.Entity.Teleport(1787, 50, 50);
                            }
                        }

                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 245)
                        {
                            if (ServerBase.Kernel.PK == false)
                            {
                                client.Send(new Network.GamePackets.NpcReply(6, "The Tournoment has finished time of join."));

                            }
                            else
                            {
                                client.InPKT = true;
                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                client.Entity.Teleport(1787, 50, 50);
                            }
                        }

                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 244)
                        {
                            if (ServerBase.Kernel.PK == false)
                            {
                                client.Send(new Network.GamePackets.NpcReply(6, "The Tournoment has finished time of join."));

                            }
                            else
                            {
                                client.InPKT = true;
                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                client.Entity.Teleport(1787, 50, 50);
                            }

                        }
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 243)
                        {
                            if (ServerBase.Kernel.PK == false)
                            {
                                client.Send(new Network.GamePackets.NpcReply(6, "The Tournoment has finished time of join."));

                            }
                            else
                            {
                                client.InPKT = true;
                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                client.Entity.Teleport(1787, 50, 50);
                            }

                        }
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 242)
                        {
                            if (ServerBase.Kernel.PK == false)
                            {
                                client.Send(new Network.GamePackets.NpcReply(6, "The Tournoment has finished time of join."));

                            }
                            else
                            {
                                client.InPKT = true;
                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                client.Entity.Teleport(1787, 50, 50);

                            }
                        }
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 241)
                        {
                            if (ServerBase.Kernel.PK == false)
                            {
                                client.Send(new Network.GamePackets.NpcReply(6, "The Tournoment has finished time of join."));

                            }
                            else
                            {
                                client.InPKT = true;
                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                client.Entity.Teleport(1787, 50, 50);
                            }

                        }
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 240)
                        {
                            if (ServerBase.Kernel.PK == false)
                            {
                                client.Send(new Network.GamePackets.NpcReply(6, "The Tournoment has finished time of join."));

                            }
                            else
                            {
                                client.InPKT = true;
                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                client.Entity.Teleport(1787, 50, 50);
                            }

                        }
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 238)
                        {

                            client.Entity.Teleport(2555, 50, 50);

                        }
                        if (client.Map.BaseID != 6001 && !client.Entity.Dead && req.OptionID == 239)
                        {
                            if (Program.Steed == false)
                            {
                                client.Send(new Network.GamePackets.NpcReply(6, "The SteedRace has finished time of join."));

                            }
                            else
                            {
                                Conquer_Online_Server.Interfaces.IConquerItem I = client.Equipment.TryGetItem(12);
                                if (I != null && I.ID != 0)
                                {
                                    client.Entity.srjoin = 1;
                                    client.Entity.Teleport(1950, 077, 157);
                                    client.Entity.AddFlag(Update.Flags.Ride);
                                }
                                else
                                {
                                    client.Send(new Network.GamePackets.NpcReply(6, "You Dont have a Steed ."));
                                }
                            }

                        }
                        else
                        {
                            if (ID == 2031)
                                client.ActiveNpc = req.NpcID;
                            if (req.NpcID == 12)
                            {
                                if (client.Entity.VIPLevel > 0)
                                {
                                    Data data = new Data(true);
                                    data.ID = Data.OpenWindow;
                                    data.UID = client.Entity.UID;
                                    data.TimeStamp = Time32.Now;
                                    data.dwParam = Data.WindowCommands.VIPWarehouse;
                                    data.wParam1 = client.Entity.X;
                                    data.wParam2 = client.Entity.Y;
                                    client.WarehouseOpen = true;
                                    client.Send(data);
                                    break;
                                }
                            }
                            Interfaces.INpc npc = null;
                            if (req.InteractType == 102)
                            {
                                if (client.Guild != null)
                                {
                                    if (client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                    {
                                        client.Guild.ExpelMember(req.Input, false);
                                    }
                                }
                                return;
                            }
                            if (client.Map.Npcs.TryGetValue(client.ActiveNpc, out npc))
                            {
                                if (ServerBase.Kernel.GetDistance(client.Entity.X, client.Entity.Y, npc.X, npc.Y) > 17)
                                    return;
                                if (req.OptionID == 255 || (req.OptionID == 0 && ID == 2032))
                                    return;
                                req.NpcID = client.ActiveNpc;
                                //NpcDialogs.Dialogs.GetDialog(req, client);
                                Dialogs.GetDialog(req, client);
                            }
                        }
                        break;
                    }
                #endregion
                #region Compose (2036)
                case 2036:
                    {
                        Compose compose = new Compose(false);
                        compose.Deserialize(packet);
                        ComposePlus(compose, client);
                        break;
                    }
                #endregion
                #region Offline TG (2044)
                case 2044:
                    {
                        OfflineTGRequest otgr = new OfflineTGRequest(false);
                        otgr.Deserialize(packet);
                        switch (otgr.ID)
                        {
                            case OfflineTGRequest.OnTrainingTimeRequested:
                                {
                                    otgr.Minutes = 900;
                                    client.Send(otgr);
                                    break;
                                }
                            case OfflineTGRequest.OnConfirmation:
                                {
                                    client.Entity.PreviousMapID = client.Entity.MapID;
                                    client.Entity.PrevX = client.Entity.X;
                                    client.Entity.PrevY = client.Entity.Y;
                                    client.Entity.MapID = 601;
                                    client.Entity.X = 64;
                                    client.Entity.Y = 56;
                                    client.OfflineTGEnterTime = DateTime.Now;

                                    client.Disconnect();
                                    break;
                                }
                            case OfflineTGRequest.ClaimExperience:
                                {
                                    var T1 = new TimeSpan(DateTime.Now.Ticks);
                                    var T2 = new TimeSpan(client.OfflineTGEnterTime.Ticks);
                                    ushort minutes = (ushort)(T1.TotalMinutes - T2.TotalMinutes);
                                    minutes = (ushort)Math.Min((ushort)900, minutes);
                                    double expballGain = (double)300 * (double)minutes / (double)900;
                                    while (expballGain >= 100)
                                    {
                                        expballGain -= 100;
                                        client.IncreaseExperience(client.ExpBall, false);
                                    }
                                    if (expballGain != 0)
                                        client.IncreaseExperience((uint)(client.ExpBall * (expballGain / 100)), false);

                                    client.Entity.SetLocation(client.Entity.PreviousMapID, client.Entity.PrevX, client.Entity.PrevY);
                                    if (client.Map.ID == 1036 || client.Map.ID == 1039)
                                        client.Entity.Teleport(1002, 430, 378);
                                    else
                                    {
                                        switch (client.Map.ID)
                                        {
                                            default:
                                                {
                                                    client.Entity.Teleport(1002, 429, 378);
                                                    break;
                                                }
                                            case 1000:
                                                {
                                                    client.Entity.Teleport(1000, 500, 650);
                                                    break;
                                                }
                                            case 1020:
                                                {
                                                    client.Entity.Teleport(1020, 565, 562);
                                                    break;
                                                }
                                            case 1011:
                                                {
                                                    client.Entity.Teleport(1011, 188, 264);
                                                    break;
                                                }
                                            case 6001:
                                                {
                                                    client.Entity.Teleport(6001, 030, 075);
                                                    break;
                                                }

                                            case 1015:
                                                {
                                                    client.Entity.Teleport(1015, 717, 571);
                                                    break;
                                                }
                                        }
                                    }
                                    client.OfflineTGEnterTime = DateTime.Now;
                                    break;
                                }
                            default:
                                client.Send(otgr);
                                break;
                        }
                        break;
                    }
                #endregion
                #region Trade partner (2046)
                case 2046:
                    {
                        TradePartner partner = new TradePartner(false);
                        partner.Deserialize(packet);
                        switch (partner.Type)
                        {
                            case TradePartner.RequestPartnership:
                                RequestTradePartnership(partner, client);
                                break;
                            case TradePartner.RejectRequest:
                                RejectPartnership(partner, client);
                                break;
                            case TradePartner.BreakPartnership:
                                BreakPartnership(partner, client);
                                break;
                        }
                        break;
                    }
                #endregion
                #region ItemLock (2048)
                case 2048:
                    {
                        if (client.Action != 2)
                            return;
                        ItemLock itemlock = new ItemLock(false);
                        itemlock.Deserialize(packet);
                        switch (itemlock.ID)
                        {
                            case ItemLock.RequestLock:
                                LockItem(itemlock, client);
                                break;
                            case ItemLock.RequestUnlock:
                                UnlockItem(itemlock, client);
                                break;
                        }
                        break;
                    }
                #endregion
                #region Broadcast (2050)
                case 2050:
                    {
                        Broadcast cast = new Broadcast(false);
                        cast.Deserialize(packet);
                        switch (cast.Type)
                        {
                            case Broadcast.ReleaseSoonMessages:
                                {
                                    BroadcastInfoAwaiting(cast, client);
                                    break;
                                }
                            case Broadcast.MyMessages:
                                {
                                    BroadcastClientMessages(cast, client);
                                    break;
                                }
                            case Broadcast.BroadcastMessage:
                                {
                                    if (Game.ConquerStructures.Broadcast.Broadcasts.Count == ServerBase.Constants.MaxBroadcasts)
                                    {
                                        client.Send(new Message("You cannot send any broadcasts for now. The limit has been reached. Wait until a broadcast is chopped down.", System.Drawing.Color.Red, Message.TopLeft));
                                        break;
                                    }
                                    if (client.Entity.ConquerPoints >= 5)
                                    {
                                        client.Entity.ConquerPoints = (uint)Math.Max(0, (int)((int)client.Entity.ConquerPoints - (int)5));
                                        Game.ConquerStructures.Broadcast.BroadcastStr broadcast = new Conquer_Online_Server.Game.ConquerStructures.Broadcast.BroadcastStr();
                                        broadcast.EntityID = client.Entity.UID;
                                        broadcast.EntityName = client.Entity.Name;
                                        broadcast.ID = Game.ConquerStructures.Broadcast.BroadcastCounter.Next;
                                        if (cast.List[0].Length > 80)
                                            cast.List[0] = cast.List[0].Remove(80);
                                        broadcast.Message = cast.List[0];
                                        if (Game.ConquerStructures.Broadcast.Broadcasts.Count == 0)
                                        {
                                            if (Game.ConquerStructures.Broadcast.CurrentBroadcast.EntityID == 1)
                                            {
                                                Game.ConquerStructures.Broadcast.CurrentBroadcast = broadcast;
                                                Game.ConquerStructures.Broadcast.LastBroadcast = DateTime.Now;
                                                ServerBase.Kernel.SendWorldMessage(new Message(cast.List[0], "ALLUSERS", client.Entity.Name, System.Drawing.Color.Red, Message.BroadcastMessage), ServerBase.Kernel.GamePool.Values);
                                                client.Send(cast);
                                                break;
                                            }
                                        }
                                        Game.ConquerStructures.Broadcast.Broadcasts.Add(broadcast);
                                        cast.dwParam = (uint)Game.ConquerStructures.Broadcast.Broadcasts.Count;
                                        client.Send(cast);
                                        break;
                                    }
                                    break;
                                }
                            case Broadcast.Urgen5CPs:
                                {
                                    for (int c = 0; c < Game.ConquerStructures.Broadcast.Broadcasts.Count; c++)
                                    {
                                        var broadcast = Game.ConquerStructures.Broadcast.Broadcasts[c];
                                        if (broadcast.ID == cast.dwParam)
                                        {
                                            if (c != 0)
                                            {
                                                if (client.Entity.ConquerPoints >= 5)
                                                {
                                                    broadcast.SpentCPs += 5;
                                                    client.Entity.ConquerPoints = (uint)Math.Max(0, (int)((int)client.Entity.ConquerPoints - (int)5));
                                                    if (Game.ConquerStructures.Broadcast.Broadcasts[c - 1].SpentCPs <= broadcast.SpentCPs)
                                                    {
                                                        Game.ConquerStructures.Broadcast.Broadcasts[c] = Game.ConquerStructures.Broadcast.Broadcasts[c - 1];
                                                        Game.ConquerStructures.Broadcast.Broadcasts[c - 1] = broadcast;
                                                    }
                                                    else
                                                    {
                                                        Game.ConquerStructures.Broadcast.Broadcasts[c] = broadcast;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    break;
                                }
                            case Broadcast.Urgen15CPs:
                                {
                                    for (int c = 0; c < Game.ConquerStructures.Broadcast.Broadcasts.Count; c++)
                                    {
                                        var broadcast = Game.ConquerStructures.Broadcast.Broadcasts[c];
                                        if (broadcast.ID == cast.dwParam)
                                        {
                                            if (c != 0)
                                            {
                                                if (client.Entity.ConquerPoints >= 15)
                                                {
                                                    broadcast.SpentCPs += 15;
                                                    client.Entity.ConquerPoints = (uint)Math.Max(0, (int)((int)client.Entity.ConquerPoints - (int)15));
                                                    for (int b = c - 1; b > 0; b--)
                                                        Game.ConquerStructures.Broadcast.Broadcasts[b] = Game.ConquerStructures.Broadcast.Broadcasts[b - 1];

                                                    Game.ConquerStructures.Broadcast.Broadcasts[0] = broadcast;
                                                }
                                            }
                                        }
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Nobility (2064)
                case 2064:
                    {
                        NobilityInfo nobility = new NobilityInfo(false);
                        nobility.Deserialize(packet);
                        Game.ConquerStructures.Nobility.Handle(nobility, client);
                        break;
                    }
                #endregion
                #region Mentor prize (2067)
                #region MentorPremio
                case 1036:
                    {
                        switch (packet[4])
                        {
                            #region Send
                            case 0:
                                // Writer.WriteUInt32(client.Entity.Contribution_Experience.Training_Exp, 8, packet);
                                //Writer.WriteUInt32(client.Entity.Contribution_Experience.Blessing_Exp, 12, packet);
                                client.Send(packet);
                                break;
                            #endregion
                            #region Claim Training Exp
                            case 1:
                                {
                                    if (client.Entity.Contribution_Experience.Blessing_Exp > 0)
                                    {
                                        ulong Increase = (ulong)(client.ExpBall * (client.Entity.Contribution_Experience.Training_Exp / 6000000));
                                        client.Entity.Contribution_Experience.Training_Exp = 0;
                                        client.IncreaseExperience(Increase, true);
                                        client.Send(packet);
                                    }
                                    break;
                                }
                            #endregion
                            #region Claim Blessing Exp
                            case 2:
                                {
                                    if (client.Entity.Contribution_Experience.Blessing_Exp > 0)
                                    {
                                        ulong Increase = (ulong)(client.ExpBall * (client.Entity.Contribution_Experience.Blessing_Exp / 6000000));
                                        client.Entity.Contribution_Experience.Blessing_Exp = 0;
                                        client.IncreaseExperience(Increase, true);
                                        client.Send(packet);
                                    }
                                    break;
                                }
                            #endregion
                            default: Console.WriteLine("Unknown 1036 claim type " + packet[4]); break;
                        }
                        break;
                    }
                #endregion
                case 2067:
                    {
                        MentorPrize prize = new MentorPrize(false);
                        prize.Deserialize(packet);
                        switch (prize.Prize_Type)
                        {
                            case MentorPrize.ClaimExperience:
                                {
                                    // client.IncreaseExperience((ulong)(((double)client.PrizeExperience / 606) * client.ExpBall), false);
                                    client.PrizeExperience = 0;
                                    foreach (var appr in client.Apprentices.Values)
                                    {
                                        appr.Actual_Experience = 0;
                                        Database.KnownPersons.SaveApprenticeInfo(appr);
                                    }
                                    prize.Mentor_ID = client.Entity.UID;
                                    prize.Prize_Type = MentorPrize.Show;
                                    prize.Prize_Experience = client.PrizeExperience;
                                    prize.Prize_HeavensBlessing = client.PrizeHeavenBlessing;
                                    prize.Prize_PlusStone = client.PrizePlusStone;
                                    client.Send(prize);
                                    break;
                                }
                            case MentorPrize.ClaimHeavenBlessing:
                                {
                                    client.AddBless(client.PrizeHeavenBlessing);
                                    client.PrizeHeavenBlessing = 0;
                                    foreach (var appr in client.Apprentices.Values)
                                    {
                                        appr.Actual_HeavenBlessing = 0;
                                        Database.KnownPersons.SaveApprenticeInfo(appr);
                                    }
                                    prize.Mentor_ID = client.Entity.UID;
                                    prize.Prize_Type = MentorPrize.Show;
                                    prize.Prize_Experience = client.PrizeExperience;
                                    prize.Prize_HeavensBlessing = client.PrizeHeavenBlessing;
                                    prize.Prize_PlusStone = client.PrizePlusStone;
                                    client.Send(prize);
                                    break;
                                }
                            case MentorPrize.ClaimPlus:
                                {
                                    int stones = client.PrizePlusStone / 100;
                                    int totake = stones;
                                    if (stones > 0)
                                    {
                                        for (; stones > 0; stones--)
                                        {
                                            client.PrizePlusStone -= 100;
                                            if (!client.Inventory.Add(730001, 1, 1))
                                                break;
                                        }
                                    }
                                    foreach (var appr in client.Apprentices.Values)
                                    {
                                        if (appr.Actual_Plus >= totake)
                                        {
                                            appr.Actual_Plus -= (ushort)totake;
                                            totake = 0;
                                        }
                                        else
                                        {
                                            totake -= appr.Actual_Plus;
                                            appr.Actual_Plus = 0;
                                        }
                                        Database.KnownPersons.SaveApprenticeInfo(appr);
                                    }
                                    prize.Mentor_ID = client.Entity.UID;
                                    prize.Prize_Type = MentorPrize.Show;
                                    prize.Prize_Experience = client.PrizeExperience;
                                    prize.Prize_HeavensBlessing = client.PrizeHeavenBlessing;
                                    prize.Prize_PlusStone = client.PrizePlusStone;
                                    client.Send(prize);
                                    break;
                                }
                            case MentorPrize.Show:
                                {
                                    prize.Mentor_ID = client.Entity.UID;
                                    prize.Prize_Type = MentorPrize.Show;
                                    prize.Prize_Experience = client.PrizeExperience;
                                    prize.Prize_HeavensBlessing = client.PrizeHeavenBlessing;
                                    prize.Prize_PlusStone = client.PrizePlusStone;
                                    client.Send(prize);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region MentorApprentice (2065)
                case 2065:
                    {
                        MentorApprentice ma = new MentorApprentice(false);
                        ma.Deserialize(packet);
                        switch (ma.Type)
                        {
                            case MentorApprentice.LeaveMentor:
                                {
                                    LeaveMentor(ma, client);
                                    break;
                                }
                            case MentorApprentice.ExpellApprentice:
                                {
                                    ExpelApprentice(ma, client);
                                    break;
                                }
                            case MentorApprentice.RequestApprentice:
                                {
                                    AddApprentice(ma, client);
                                    break;
                                }
                            case MentorApprentice.RequestMentor:
                                {
                                    AddMentor(ma, client);
                                    break;
                                }
                            case MentorApprentice.AcceptRequestApprentice:
                                {
                                    AcceptRequestApprentice(ma, client);
                                    break;
                                }
                            case MentorApprentice.AcceptRequestMentor:
                                {
                                    AcceptRequestMentor(ma, client);
                                    break;
                                }
                        }
                        break;
                    }
                case 2066:
                    {
                        MentorInformation info = new MentorInformation(false);
                        info.Deserialize(packet);
                        if (info.Mentor_Type == 1)
                        {
                            client.ReviewMentor();
                        }
                        break;
                    }
                #endregion
                #region PurifyItem (2076)
                case 2076:
                    {
                        Purification ps = new Purification(false);
                        ps.Deserialize(packet);
                        switch (ps.Mode)
                        {
                            case Purification.Purify:
                                PurifyItem(ps, client); break;
                            case Purification.Purify1:
                                new Game.Features.Refinery.Handle(packet, client);
                                break;
                        }
                        break;
                    }
                #endregion

                #region Arsenal Guild
                case 2202:
                    {

                        ArsenalInscribitionList list = new ArsenalInscribitionList();
                        client.Send(list.Build(packet, client.Guild));
                        break;
                    }
                case 2203:
                    {
                        client.Guild.Arsenal.Update(client.Guild);
                        client.Send(client.Guild.A_Packet);
                        Database.ArsenalsTable.Load(client.Guild);
                        #region Handle
                        byte pType = packet[4];
                        byte i_type = packet[8];
                        uint i_Uid = BitConverter.ToUInt32(packet, 12);
                        switch (pType)
                        {
                            case 0://Unlock
                                {
                                    uint value = 5000000;
                                    if (client.Guild.SilverFund >= value)
                                    {

                                        if (i_type == 2 || i_type == 3)
                                        { value = 10000000; }
                                        if (i_type >= 3 && i_type <= 5)
                                        { value = 15000000; }
                                        if (i_type == 6 || i_type == 7)
                                        { value = 20000000; }
                                        if (client.Guild.SilverFund >= value)
                                        {
                                            client.Guild.SilverFund -= value;
                                            Database.ArsenalsTable.CreateArsenal((ushort)client.Guild.ID, (Game.ConquerStructures.Society.ArsenalType)i_type);
                                        }
                                        else
                                            client.Send(new Network.GamePackets.Message("sorry, you need " + value + " guild Found", System.Drawing.Color.Red, Message.TopLeft).ToArray());
                                    }
                                    else
                                        client.Send(new Network.GamePackets.Message("sorry, you need " + value + " guild Found", System.Drawing.Color.Red, Message.TopLeft).ToArray());
                                    break;
                                }
                            case 1://Inscribe
                                {
                                    Interfaces.IConquerItem Item = null;
                                    if (client.Inventory.TryGetItem(i_Uid, out Item))
                                    {
                                        client.Guild.Arsenal.Inscribe((Game.ConquerStructures.Society.ArsenalType)i_type, Item, client);
                                        client.Guild.Arsenal.Update((Game.ConquerStructures.Society.ArsenalType)i_type, client.Guild);
                                    }
                                    break;
                                }
                            case 2://Uninscribe
                                {
                                    Game.ConquerStructures.Society.ArsenalSingle AS = null;
                                    if (client.Guild.Arsenal.Inscribed[(Game.ConquerStructures.Society.ArsenalType)i_type].TryGetValue(i_Uid, out AS))
                                    {
                                        client.Guild.Arsenal.Uninscribe((Game.ConquerStructures.Society.ArsenalType)i_type, AS, client);
                                        client.Guild.Arsenal.Update((Game.ConquerStructures.Society.ArsenalType)i_type, client.Guild);
                                    }
                                    break;
                                }
                            case 3://Enhance
                                {
                                    //client.Entity.Mentors.Share();
                                    client.Guild.A_Packet.SetTotals2();
                                    client.Send(client.Guild.A_Packet);
                                    break;
                                }
                            case 4://Show Main Info
                                {
                                    client.Guild.A_Packet.SetTotals();
                                    client.Send(client.Guild.A_Packet);
                                    break;
                                }
                        }
                        client.Send(packet);
                        #endregion
                        break;
                    }
                #endregion
                #region Arena (2207<->2211)
                case 2207://Request Arena ranking List
                    {
                        //Code snippet that belongs to Ultimation
                        ushort PageIndex = BitConverter.ToUInt16(packet, 6);
                        Game.ConquerStructures.Arena.Statistics.ShowRankingPage(packet[4], PageIndex, client);
                        break;
                    }
                case 2206:
                    {
                        //Code snippet that belongs to Ultimation
                        ushort PageIndex = BitConverter.ToUInt16(packet, 4);
                        Game.ConquerStructures.Arena.QualifyEngine.RequestGroupList(client, PageIndex);
                        break;
                    }
                case 2205://Arena Signup!
                    {
                        //Code snippet that belongs to Ultimation
                        uint DialogID = BitConverter.ToUInt32(packet, 4);
                        uint ButtonID = BitConverter.ToUInt32(packet, 8);
                        switch (DialogID)
                        {
                            case 4:
                                {
                                    switch (ButtonID)
                                    {
                                        case 0:
                                            {
                                                Game.ConquerStructures.Arena.QualifyEngine.DoQuit(client);
                                                break;
                                            }
                                    }
                                    break;
                                }
                            case 0: Game.ConquerStructures.Arena.QualifyEngine.DoSignup(client); client.Send(packet); break;
                            case 1: Game.ConquerStructures.Arena.QualifyEngine.DoQuit(client); client.Send(packet); break;
                            case 3:
                                {
                                    switch (ButtonID)
                                    {
                                        case 2: Game.ConquerStructures.Arena.QualifyEngine.DoGiveUp(client); break;
                                        case 1: Game.ConquerStructures.Arena.QualifyEngine.DoAccept(client); break;
                                    }
                                    break;
                                }
                            case 5:
                                {
                                    if (client.ArenaStatistic.ArenaPoints <= 1500)
                                        if (client.Entity.Money >= 9000000)
                                        {
                                            client.Entity.Money -= 9000000;
                                            client.ArenaStatistic.ArenaPoints += 1500;
                                            client.Send(client.ArenaStatistic);
                                        }
                                    break;
                                }
                            case 11://Win/Lose Dialog
                                {
                                    switch (ButtonID)
                                    {
                                        case 0: Game.ConquerStructures.Arena.QualifyEngine.DoSignup(client); break;
                                    }
                                    break;
                                }

                        }
                        break;
                    }
                case 2208://Request Arena Winner List
                    {
                        //Code snippet that belongs to Ultimation
                        Game.ConquerStructures.Arena.Statistics.ShowWiners(client);
                        break;
                    }
                case 2209:
                    {
                        client.ArenaStatistic.Send(client);
                        break;
                    }
                case 2211:
                    {
                        ushort Type = BitConverter.ToUInt16(packet, 4);
                        uint Fighter = BitConverter.ToUInt32(packet, 10);
                        if (Type == 0)
                        {
                            if (ServerBase.Kernel.GamePool.ContainsKey(Fighter))
                            {
                                Client.GameState Client = ServerBase.Kernel.GamePool[Fighter];
                                if (Client.QualifierGroup != null)
                                {
                                    if (Client.QualifierGroup.Inside)
                                    {
                                        if (!Client.QualifierGroup.Done)
                                        {
                                            Client.QualifierGroup.BeginWatching(client);
                                        }
                                    }
                                }
                            }
                        }
                        else if (Type == 1)
                        {
                            Game.ConquerStructures.Arena.QualifyEngine.DoLeave(client);
                        }
                        else if (Type == 4)
                        {
                            string name = "";
                            for (int c = 22; c < packet.Length; c++)
                            {
                                if (packet[c] != 0)
                                    name += (char)packet[c];
                                else
                                    break;
                            }
                            Game.ConquerStructures.Arena.QualifyEngine.DoCheer(client, name);
                        }
                        break;
                    }
                #endregion
                #region Movement/Walk (10005)
                case 10005:
                    {
                        if (client.Action != 2)
                            return;
                        GroundMovement groundMovement = new GroundMovement(false);
                        groundMovement.Deserialize(packet);
                        PlayerGroundMovment(groundMovement, client);
                        break;
                    }
                #endregion
                #region Data (10010)
                case 10010:
                    {
                        if (client.Action != 2)
                            return;
                        Data gData = new Data(false);
                        gData.Deserialize(packet);
                        switch (gData.ID)
                        {
                            case Data.SwingPickaxe:
                                client.Mining = true;
                                break;
                            case Data.Revive:

                                Revive(gData, client);
                                // Revive(gData, client);
                                break;
                            case Data.UsePortal:
                                if (client.Entity.MapID == 601)
                                {
                                    client.Entity.Teleport(601, 063, 055);
                                }
                                else
                                    UsePortal(gData, client);
                                break;

                            case Data.ChangePKMode:
                                ChangePKMode(gData, client);
                                break;
                            case Data.ChangeAction:
                                ChangeAction(gData, client);
                                break;
                            case Data.ChangeDirection:
                                ChangeDirection(gData, client);
                                break;
                            case Data.Hotkeys:
                                client.Send(packet);
                                break;
                            case 408://steed soul remoeve
                                {

                                    break;
                                }
                            case Data.ConfirmSpells:
                                if (client.Spells != null)
                                    foreach (Interfaces.ISkill spell in client.Spells.Values)
                                        if (spell.ID != 3060)
                                            spell.Send(client);
                                client.Send(packet);
                                break;
                            case Data.ConfirmProficiencies:
                                if (client.Proficiencies != null)
                                    foreach (Interfaces.ISkill proficiency in client.Proficiencies.Values)
                                        proficiency.Send(client);
                                client.Send(packet);
                                break;
                            case Data.ConfirmGuild:
                                client.Send(packet);
                                break;
                            case Data.ConfirmFriends:
                                #region Friends/Enemy/TradePartners/Apprentices
                                Message msg2 = new Message("Your friend, " + client.Entity.Name + ", has logged on.", System.Drawing.Color.Red, Message.TopLeft);

                                foreach (Game.ConquerStructures.Society.Friend friend in client.Friends.Values)
                                {
                                    if (friend.IsOnline)
                                    {
                                        var pckt = new KnownPersons(true)
                                        {
                                            UID = client.Entity.UID,
                                            Type = KnownPersons.RemovePerson,
                                            Name = client.Entity.Name,
                                            Online = true
                                        };
                                        friend.Client.Send(pckt);
                                        pckt.Type = KnownPersons.AddFriend;
                                        friend.Client.Send(pckt);
                                        friend.Client.Send(msg2);
                                    }
                                    client.Send(new KnownPersons(true)
                                    {
                                        UID = friend.ID,
                                        Type = KnownPersons.AddFriend,
                                        Name = friend.Name,
                                        Online = friend.IsOnline
                                    });
                                    if (friend.Message != "")
                                    {
                                        client.Send(new Message(friend.Message, client.Entity.Name, friend.Name, System.Drawing.Color.Red, Message.Whisper));
                                        Database.KnownPersons.UpdateMessageOnFriend(friend.ID, client.Entity.UID, "");
                                    }
                                }

                                foreach (Game.ConquerStructures.Society.Enemy enemy in client.Enemy.Values)
                                {
                                    client.Send(new KnownPersons(true)
                                    {
                                        UID = enemy.ID,
                                        Type = KnownPersons.AddEnemy,
                                        Name = enemy.Name,
                                        Online = enemy.IsOnline
                                    });
                                }
                                Message msg3 = new Message("Your partner, " + client.Entity.Name + ", has logged in.", System.Drawing.Color.Red, Message.TopLeft);

                                foreach (Game.ConquerStructures.Society.TradePartner partner in client.Partners.Values)
                                {
                                    if (partner.IsOnline)
                                    {
                                        var packet3 = new TradePartner(true)
                                        {
                                            UID = client.Entity.UID,
                                            Type = TradePartner.BreakPartnership,
                                            Name = client.Entity.Name,
                                            HoursLeft = (int)(new TimeSpan(partner.ProbationStartedOn.AddDays(3).Ticks).TotalHours - new TimeSpan(DateTime.Now.Ticks).TotalHours),
                                            Online = true
                                        };
                                        partner.Client.Send(packet3);
                                        packet3.Type = TradePartner.AddPartner;
                                        partner.Client.Send(packet3);
                                        partner.Client.Send(msg3);
                                    }
                                    var packet4 = new TradePartner(true)
                                    {
                                        UID = partner.ID,
                                        Type = TradePartner.AddPartner,
                                        Name = partner.Name,
                                        HoursLeft = (int)(new TimeSpan(partner.ProbationStartedOn.AddDays(3).Ticks).TotalHours - new TimeSpan(DateTime.Now.Ticks).TotalHours),
                                        Online = partner.IsOnline
                                    };
                                    client.Send(packet4);
                                }

                                foreach (Game.ConquerStructures.Society.Apprentice appr in client.Apprentices.Values)
                                {
                                    if (appr.IsOnline)
                                    {
                                        ApprenticeInformation AppInfo = new ApprenticeInformation();
                                        AppInfo.Apprentice_ID = appr.ID;
                                        AppInfo.Apprentice_Level = appr.Client.Entity.Level;
                                        AppInfo.Apprentice_Class = appr.Client.Entity.Class;
                                        AppInfo.Apprentice_PkPoints = appr.Client.Entity.PKPoints;
                                        AppInfo.Apprentice_Experience = appr.Actual_Experience;
                                        AppInfo.Apprentice_Composing = appr.Actual_Plus;
                                        AppInfo.Apprentice_Blessing = appr.Actual_HeavenBlessing;
                                        AppInfo.Apprentice_Name = appr.Name;
                                        AppInfo.Apprentice_Online = true;
                                        AppInfo.Apprentice_Spouse_Name = appr.Client.Entity.Spouse;
                                        AppInfo.Enrole_date = appr.EnroleDate;
                                        AppInfo.Mentor_ID = client.Entity.UID;
                                        AppInfo.Mentor_Mesh = client.Entity.Mesh;
                                        AppInfo.Mentor_Name = client.Entity.Name;
                                        AppInfo.Type = 2;
                                        client.Send(AppInfo);

                                        MentorInformation Information = new MentorInformation(true);
                                        Information.Mentor_Type = 1;
                                        Information.Mentor_ID = client.Entity.UID;
                                        Information.Apprentice_ID = appr.ID;
                                        Information.Enrole_Date = appr.EnroleDate;
                                        Information.Mentor_Level = client.Entity.Level;
                                        Information.Mentor_Class = client.Entity.Class;
                                        Information.Mentor_PkPoints = client.Entity.PKPoints;
                                        Information.Mentor_Mesh = client.Entity.Mesh;
                                        Information.Mentor_Online = true;
                                        Information.Shared_Battle_Power = (uint)(((client.Entity.BattlePower - client.Entity.ExtraBattlePower) - (appr.Client.Entity.BattlePower - appr.Client.Entity.ExtraBattlePower)) / 3.3F);
                                        Information.String_Count = 3;
                                        Information.Mentor_Name = client.Entity.Name;
                                        Information.Apprentice_Name = appr.Name;
                                        Information.Mentor_Spouse_Name = client.Entity.Spouse;
                                        appr.Client.ReviewMentor();
                                        appr.Client.Send(Information);
                                    }
                                    else
                                    {
                                        ApprenticeInformation AppInfo = new ApprenticeInformation();
                                        AppInfo.Apprentice_ID = appr.ID;
                                        AppInfo.Apprentice_Name = appr.Name;
                                        AppInfo.Apprentice_Online = false;
                                        AppInfo.Enrole_date = appr.EnroleDate;
                                        AppInfo.Mentor_ID = client.Entity.UID;
                                        AppInfo.Mentor_Mesh = client.Entity.Mesh;
                                        AppInfo.Mentor_Name = client.Entity.Name;
                                        AppInfo.Type = 2;
                                        client.Send(AppInfo);
                                    }
                                }
                                #endregion
                                client.Send(packet);
                                break;
                            case Data.EndTeleport:
                                break;
                            case Data.GetSurroundings:
                                if (client.Booth != null)
                                {
                                    client.Entity.TransformationID = 0;
                                    client.Booth.Remove();
                                    client.Booth = null;
                                }
                                GetSurroundings(client);
                                client.Send(new MapStatus() { BaseID = client.Map.BaseID, ID = client.Map.ID, Status = Database.MapsTable.MapInformations[client.Map.ID].Status });
                                Game.Weather.CurrentWeatherBase.Send(client);
                                client.Send(gData);
                                break;
                            case Data.SetLocation:
                                SetLocation(gData, client);
                                break;
                            case Data.Jump:
                                PlayerJump(gData, client);
                                break;
                            case Data.UnknownEntity:
                                {
                                    #region UnknownEntity
                                    Client.GameState pClient = null;
                                    if (ServerBase.Kernel.GamePool.TryGetValue(gData.dwParam, out pClient))
                                    {
                                        if (ServerBase.Kernel.GetDistance(pClient.Entity.X, pClient.Entity.Y, client.Entity.X, client.Entity.Y) <= ServerBase.Constants.pScreenDistance && client.Map.ID == pClient.Map.ID)
                                        {
                                            if (pClient.Guild != null)
                                                pClient.Guild.SendName(client);
                                            if (client.Guild != null)
                                                client.Guild.SendName(pClient);
                                            if (pClient.Entity.UID != client.Entity.UID)
                                            {
                                                if (pClient.Map.ID == client.Map.ID)
                                                {
                                                    if (pClient.Map.BaseID == 700)
                                                    {
                                                        if (client.QualifierGroup != null)
                                                        {
                                                            if (pClient.QualifierGroup != null)
                                                            {
                                                                client.Entity.SendSpawn(pClient, false);
                                                                pClient.Entity.SendSpawn(client, false);
                                                            }
                                                            else
                                                            {
                                                                client.Entity.SendSpawn(pClient, false);
                                                                client.Screen.Add(pClient.Entity);
                                                            }
                                                        }
                                                        else
                                                        {
                                                            if (pClient.QualifierGroup != null)
                                                            {
                                                                pClient.Entity.SendSpawn(client, false);
                                                                pClient.Screen.Add(client.Entity);
                                                            }
                                                            else
                                                            {
                                                                client.Entity.SendSpawn(pClient, false);
                                                                pClient.Entity.SendSpawn(client, false);
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        client.Entity.SendSpawn(pClient, false);
                                                        pClient.Entity.SendSpawn(client, false);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    else
                                    {
                                        Game.Entity monster = null;
                                        if (client.Map.Entities.TryGetValue(gData.dwParam, out monster))
                                        {
                                            if (ServerBase.Kernel.GetDistance(monster.X, monster.Y, client.Entity.X, client.Entity.Y) <= ServerBase.Constants.pScreenDistance)
                                            {
                                                monster.SendSpawn(client, false);
                                            }
                                        }
                                        if (client.Map.Companions.TryGetValue(gData.dwParam, out monster))
                                        {
                                            if (ServerBase.Kernel.GetDistance(monster.X, monster.Y, client.Entity.X, client.Entity.Y) <= ServerBase.Constants.pScreenDistance)
                                            {
                                                monster.SendSpawn(client, false);
                                            }
                                        }
                                    }
                                    #endregion
                                    break;
                                }
                            case Data.CompleteLogin:
                                LoginMessages(client);

                                EntityEquipment equips = new EntityEquipment(true);
                                equips.ParseHero(client);
                                client.Send(equips);
                                break;
                            case Data.ChangeFace:
                                ChangeFace(gData, client);
                                break;
                            case Data.ObserveEquipment:
                            case Data.ObserveEquipment2:
                            case Data.ObserveKnownPerson:
                                ObserveEquipment(gData, client);
                                break;
                            case Data.ViewEnemyInfo:
                                {
                                    if (client.Enemy.ContainsKey(gData.dwParam))
                                    {
                                        if (client.Enemy[gData.dwParam].IsOnline)
                                        {
                                            KnownPersonInfo info = new KnownPersonInfo(true);
                                            info.Fill(client.Enemy[gData.dwParam], true, false);
                                            if (client.Enemy[gData.dwParam].Client.Guild != null)
                                                client.Enemy[gData.dwParam].Client.Guild.SendName(client);
                                            client.Send(info);
                                        }
                                    }
                                    break;
                                }
                            case Data.ViewFriendInfo:
                                {
                                    if (client.Friends.ContainsKey(gData.dwParam))
                                    {
                                        if (client.Friends[gData.dwParam].IsOnline)
                                        {
                                            KnownPersonInfo info = new KnownPersonInfo(true);
                                            info.Fill(client.Friends[gData.dwParam], false, false);
                                            if (client.Friends[gData.dwParam].Client.Guild != null)
                                                client.Friends[gData.dwParam].Client.Guild.SendName(client);
                                            client.Send(info);
                                        }
                                    }
                                    break;
                                }
                            case Data.ViewPartnerInfo:
                                {
                                    if (client.Partners.ContainsKey(gData.dwParam))
                                    {
                                        if (client.Partners[gData.dwParam].IsOnline)
                                        {
                                            TradePartnerInfo info = new TradePartnerInfo(true);
                                            info.Fill(client.Partners[gData.dwParam]);
                                            if (client.Partners[gData.dwParam].Client.Guild != null)
                                                client.Partners[gData.dwParam].Client.Guild.SendName(client);
                                            client.Send(info);
                                        }
                                    }
                                    break;
                                }
                            case Data.EndFly:
                                client.Entity.RemoveFlag(Update.Flags.Fly);
                                break;
                            case Data.EndTransformation:
                                client.Entity.Untransform();
                                break;
                            case Data.XPListEnd:
                            case Data.Die:
                                break;
                            case Data.OwnBooth:
                                {

                                    //client.Entity.TransformationTime = 3600;
                                    if (client.WarehouseOpen == true)
                                    {
                                        client.Send(new Message("you cant booth when you open warehose", Color.AntiqueWhite, 2005));

                                        return;
                                    }
                                    else
                                    {
                                        client.Booth = new Conquer_Online_Server.Game.ConquerStructures.Booth(client, gData);
                                        client.Send(new Data(true) { ID = Data.ChangeAction, UID = client.Entity.UID, dwParam = 0 });

                                    }
                                    break;
                                }
                            case Data.Away:
                                {
                                    if (client.Entity.Away == 0)
                                        client.Entity.Away = 1;
                                    else
                                        client.Entity.Away = 0;
                                    client.SendScreenSpawn(client.Entity, false);
                                    break;
                                }
                            case Data.DeleteCharacter:
                                {
                                    if ((client.WarehousePW == null || client.WarehousePW == "" || client.WarehousePW == "0" && gData.dwParam == 0) || (client.WarehousePW == gData.dwParam.ToString()))
                                    {
                                        client.Account.EntityID = 0;
                                        client.Account.Save();
                                        client.Disconnect();
                                    }
                                    break;
                                }
                            case Data.TeamSearchForMember:
                                {
                                    if (client.Team != null)
                                    {
                                        Client.GameState Client = null;
                                        if (!client.Team.IsTeammate(gData.UID))
                                            return;
                                        if (Kernel.GamePool.TryGetValue(gData.UID, out Client))
                                        {
                                            gData.wParam1 = Client.Entity.X;
                                            gData.wParam2 = Client.Entity.Y;
                                            gData.Send(client);
                                        }
                                    }
                                    break;
                                }
                            default:
                                if (client.Account.State == Conquer_Online_Server.Database.AccountTable.AccountState.ProjectManager)
                                    client.Send(new Message("Unknown generaldata id: " + gData.ID, System.Drawing.Color.CadetBlue, Message.Talk));
                                break;
                        }
                        break;
                    }
                #endregion
                #region Status 1040
                case 1040:
                    {
                        Status ShowStatistics2 = new Status(client);
                        ShowStatistics2.Deserialize(packet);
                        ShowStatistics2.Send(client);
                        //uint UID = BitConverter.ToUInt32(packet, 4);
                        //Client.GameState Client;
                        //if (ServerBase.Kernel.GamePool.TryGetValue(UID, out Client))
                        //{
                        //    client.Send(WindowStats(Client));
                        //}
                        break;
                    }
                #endregion
                #region Flowers
                case 1150:
                    {
                        SendFlowers(client, packet);

                        break;
                    }
                case 1151:
                    {
                        AddFlowers(client, packet);

                        break;
                    }

                #endregion
                #region Clans
                case 1312:
                    {
                        switch (packet[4])
                        {
                            case 21://transfer
                                {
                                    if (client.Entity.Myclan != null)
                                    {
                                        PrintPacket(packet);
                                        uint lider = 0;
                                        string name_receive = System.Text.Encoding.ASCII.GetString(packet, 18, packet[17]);

                                        var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                        varr.MoveNext();
                                        int COunt = ServerBase.Kernel.GamePool.Count;
                                        for (uint x = 0;
                                            x < COunt;
                                            x++)
                                        {
                                            if (x >= COunt) break;

                                            Client.GameState clien = (varr.Current as Client.GameState);

                                            if (clien.Entity.Name == name_receive)
                                                lider = clien.Entity.UID;

                                            varr.MoveNext();

                                        }

                                        if (lider == client.Entity.UID) return;
                                        Client.GameState aClient = null;
                                        if (Conquer_Online_Server.ServerBase.Kernel.GamePool.TryGetValue(lider, out aClient))
                                        {

                                            if (Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(client.Entity.Myclan.ClanId))
                                            {
                                                if (Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].Members.ContainsKey(aClient.Entity.UID))
                                                {
                                                    Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].ClanLider = aClient.Entity.Name;
                                                    aClient.Entity.ClanRank = 100;
                                                    aClient.Entity.Myclan.Members[aClient.Entity.UID].Rank = 100;
                                                    if (aClient.Entity.Myclan.Members.ContainsKey(client.Entity.UID))
                                                        aClient.Entity.Myclan.Members[client.Entity.UID].Rank = 0;
                                                    client.Entity.ClanRank = 0;
                                                    Database.Clans.SaveClan(aClient.Entity.Myclan);
                                                    Database.Clans.JoinClan(client);
                                                }
                                            }

                                        }
                                        else
                                        {
                                            Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].ClanLider = name_receive;
                                            client.Entity.ClanRank = 0;
                                            Database.Clans.JoinClan(client);
                                            Database.Clans.SaveClan(client.Entity.Myclan);
                                            Database.Clans.TransferClan(name_receive);
                                        }
                                    }
                                    break;
                                }
                            /* case 14://add enemy
                                 {
                                     break;
                                 }*/
                            case 9://recruit member
                                {
                                    break;
                                }
                            case 23://client exit
                                {
                                    if (client.Entity.Myclan != null)
                                    {
                                        if (Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(client.Entity.Myclan.ClanId))
                                        {
                                            if (Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].Members.ContainsKey(client.Entity.UID))
                                            {
                                                Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].Members.Remove(client.Entity.UID);
                                            }
                                        }
                                        client.Entity.ClanId = 0;
                                        client.Entity.ClanName = "";
                                        client.Entity.Myclan = null;

                                        Database.Clans.KickClan(client.Entity.Name);
                                        client.Send(packet);
                                    }
                                    break;
                                }
                            case 25://buleitn
                                {
                                    if (client.Entity.Myclan == null) return;
                                    string buletin = System.Text.Encoding.ASCII.GetString(packet, 18, packet[17]);
                                    if (Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(client.Entity.Myclan.ClanId))
                                        Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].ClanBuletion = buletin;
                                    Database.Clans.SaveClan(Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId]);
                                    client.Send(packet);
                                    break;
                                }
                            case 22://give kick
                                {
                                    if (client.Entity.Myclan != null)
                                    {
                                        if (client.Entity.ClanRank == 100)
                                        {
                                            string name = System.Text.Encoding.ASCII.GetString(packet, 18, packet[17]);
                                            uint Key = 0;

                                            foreach (Game.ClanMembers mem in client.Entity.Myclan.Members.Values)
                                            {
                                                if (mem.Name == name)
                                                    Key = mem.UID;
                                            }
                                            if (Key != 0)
                                            {

                                                if (Conquer_Online_Server.ServerBase.Kernel.GamePool.ContainsKey(Key))
                                                {

                                                    if (Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(client.Entity.Myclan.ClanId))
                                                    {
                                                        if (Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].Members.ContainsKey(Key))
                                                        {
                                                            Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].Members.Remove(Key);
                                                            Network.GamePackets.ClanMembers clan = new Network.GamePackets.ClanMembers(client);
                                                            client.Send(clan.ToArray());
                                                            Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 22);
                                                            ServerBase.Kernel.GamePool[Key].Send(cl.ToArray());
                                                            ServerBase.Kernel.GamePool[Key].Entity.ClanName = "";
                                                            ServerBase.Kernel.GamePool[Key].Entity.ClanId = 0;
                                                            ServerBase.Kernel.GamePool[Key].Entity.Myclan = null;
                                                            ServerBase.Kernel.GamePool[Key].Screen.FullWipe();
                                                            ServerBase.Kernel.GamePool[Key].Screen.Reload(null);
                                                        }
                                                    }
                                                }
                                            }
                                            Database.Clans.KickClan(name);
                                        }
                                    }

                                    break;
                                }

                            case 26://donation
                                {
                                    uint money = BitConverter.ToUInt32(packet, 8);
                                    if (client.Entity.Money >= money && client.Entity.Myclan != null)
                                    {
                                        client.Entity.Myclan.Members[client.Entity.UID].Donation += money;
                                        client.Entity.Money -= money;
                                        if (Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(client.Entity.Myclan.ClanId))
                                            Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].ClanDonation += money;
                                        Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 1);
                                        client.Send(cl.ToArray());
                                        Database.Clans.SaveClientDonation(client);
                                        Database.Clans.SaveClan(Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId]);
                                    }
                                    break;
                                }
                            case 11://add player
                                {

                                    uint lider = BitConverter.ToUInt32(packet, 8);
                                    if (Conquer_Online_Server.ServerBase.Kernel.GamePool.ContainsKey(lider))
                                    {
                                        packet[4] = 11;
                                        Network.Writer.WriteUInt32(client.Entity.UID, 8, packet);
                                        packet[16] = 1;
                                        packet[17] = (byte)client.Entity.Name.Length;
                                        for (int i = 0; i < client.Entity.Name.Length; i++)
                                        {
                                            try
                                            {
                                                packet[18 + i] = Convert.ToByte(client.Entity.Name[i]);

                                            }
                                            catch { }
                                        }
                                        if (Conquer_Online_Server.ServerBase.Kernel.GamePool[lider].Entity.Myclan != null)
                                            Conquer_Online_Server.ServerBase.Kernel.GamePool[lider].Send(packet);
                                    }
                                    break;
                                }
                            case 12:
                                {
                                    if (packet[16] == 1)
                                    {
                                        if (client.Entity.Myclan != null)
                                            if (client.Entity.Myclan.Members[client.Entity.UID].Rank == 100)
                                            {
                                                //if (client.Entity.Myclan != null)
                                                {
                                                    if (client.Entity.Myclan.Members.Count < 7)
                                                    {

                                                        uint memeber = BitConverter.ToUInt32(packet, 8);
                                                        if (ServerBase.Kernel.GamePool.ContainsKey(memeber))
                                                        {
                                                            Game.ClanMembers member = new Conquer_Online_Server.Game.ClanMembers();
                                                            member.UID = ServerBase.Kernel.GamePool[memeber].Entity.UID;
                                                            member.Donation = 0;
                                                            member.Rank = 10;
                                                            member.Class = ServerBase.Kernel.GamePool[memeber].Entity.Class;
                                                            member.Level = ServerBase.Kernel.GamePool[memeber].Entity.Level;
                                                            member.Name = ServerBase.Kernel.GamePool[memeber].Entity.Name;
                                                            if (!client.Entity.Myclan.Members.ContainsKey(memeber))
                                                                client.Entity.Myclan.Members.Add(member.UID, member);

                                                            ServerBase.Kernel.GamePool[memeber].Entity.ClanRank = 0;
                                                            ServerBase.Kernel.GamePool[memeber].Entity.ClanId = client.Entity.ClanId;
                                                            ServerBase.Kernel.GamePool[memeber].Entity.Myclan = client.Entity.Myclan;
                                                            ServerBase.Kernel.GamePool[memeber].Entity.ClanName = client.Entity.ClanName;
                                                            Database.Clans.JoinClan(ServerBase.Kernel.GamePool[memeber]);
                                                            ServerBase.Kernel.GamePool[memeber].Screen.FullWipe();
                                                            ServerBase.Kernel.GamePool[memeber].Screen.Reload(null);
                                                        }
                                                    }
                                                }
                                            }
                                    }
                                    break;
                                }
                            case 4://memebers
                                {
                                    ClanMembers clan = new ClanMembers(client);
                                    client.Send(clan.ToArray());
                                    break;
                                }
                            case 0x1d:
                                {
                                    if (client.Entity.Myclan != null)
                                    {
                                        Network.Writer.WriteUInt32(client.Entity.Myclan.ClanId, 8, packet);
                                        Network.Writer.WriteByte(1, 16, packet);
                                        Network.Writer.WriteByte(0x0d, 17, packet);
                                        Network.Writer.WriteString("0 0 0 0 0 0 0", 18, packet);
                                        client.Send(packet);
                                        Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 1);
                                        client.Send(cl.ToArray());
                                        client.Send(packet);

                                        if (client.Entity.Myclan.ClanBuletion != "")
                                            client.Send(cl.UpgradeBuletin(client.Entity.Myclan.ClanBuletion));
                                    }
                                    else
                                    {
                                        client.Send(packet);
                                        packet[4] = 23;
                                    }

                                    break;
                                }
                            case 0x18:
                                {
                                    client.Send(packet);
                                    break;
                                }
                            case (byte)Game.Clan_Typ.AddAlly:
                                {
                                    Game.Clans clan = client.Entity.Myclan;
                                    if (clan != null)
                                    {
                                        Client.GameState target;
                                        UInt32 Identifier = BitConverter.ToUInt32(packet, 8);

                                        if (client.Entity.ClanRank == 100)
                                        {
                                            if (clan.Allies.Count >= 5)
                                            { client.Send(new Message("The Ammount of Allies You can Have has exceeded", System.Drawing.Color.Red, Message.TopLeft)); break; }

                                            if (ServerBase.Kernel.GamePool.TryGetValue(Identifier, out target))
                                            {
                                                Game.Clans tclan = target.Entity.Myclan;
                                                if (tclan != null)
                                                {
                                                    if (target.Entity.ClanRank == 100)
                                                    {
                                                        if (tclan.Allies.Count >= 5)
                                                        { client.Send(new Message("The Ammount of Allies the Target Clan can Have has exceeded", System.Drawing.Color.Red, Message.TopLeft)); break; }

                                                        if (!clan.Allies.ContainsKey(tclan.ClanId))
                                                        {
                                                            if (!clan.Enemies.ContainsKey(tclan.ClanId))
                                                            {
                                                                String clanName = client.Entity.ClanName;

                                                                Clan2 clanp = new Clan2();

                                                                clanp.Deserialize(packet);

                                                                clanp.Offset16 = 2;
                                                                clanp.Identifier = client.Entity.UID;

                                                                Writer.WriteByte((Byte)clanName.Length, 17, clanp.ToArray());
                                                                Writer.WriteString(clanName, 18, clanp.ToArray());

                                                                tclan.AllyRequest = clan.ClanId;

                                                                target.Send(clanp);
                                                            }
                                                            else client.Send(new Message("That clan is Your Enemy.", System.Drawing.Color.Red, Message.TopLeft));
                                                        }
                                                    }
                                                    else client.Send(new Message("This target is not the clan leader.", System.Drawing.Color.Red, Message.TopLeft));
                                                }
                                            }
                                            else client.Send(new Message("Can not find target.", System.Drawing.Color.Red, Message.TopLeft));
                                        }
                                        else client.Send(new Message("You are not the clan leader.", System.Drawing.Color.Red, Message.TopLeft));
                                    }
                                    break;
                                }
                            case (byte)Game.Clan_Typ.AcceptAlliance:
                                {
                                    Game.Clans clan = client.Entity.Myclan;
                                    if (clan != null)
                                    {
                                        if (client.Entity.ClanRank == 100)
                                        {
                                            Game.Clans tclan;
                                            if (ServerBase.Kernel.ServerClans.TryGetValue(clan.AllyRequest, out tclan))
                                            {
                                                if (tclan != null)
                                                {
                                                    if (!tclan.Enemies.ContainsKey(clan.ClanId))
                                                    {
                                                        if (!clan.Enemies.ContainsKey(tclan.ClanId))
                                                        {
                                                            if (!clan.Allies.ContainsKey(tclan.ClanId))
                                                                clan.Allies.Add(tclan.ClanId, tclan);

                                                            tclan.Allies.Add(clan.ClanId, clan);

                                                            clan.SendMessage(new ClanRelations(clan, ClanRelations.RelationTypes.Allies));
                                                            tclan.SendMessage(new ClanRelations(tclan, ClanRelations.RelationTypes.Allies));

                                                            clan.SendMessage(new Message(String.Format("Our Clan has Allianced with {0}", tclan.ClanName), System.Drawing.Color.Red, Message.Clan));
                                                            tclan.SendMessage(new Message(String.Format("Our Clan has Allianced with {0}", clan.ClanName), System.Drawing.Color.Red, Message.Clan));

                                                            clan.AddRelation(tclan.ClanId, ClanRelations.RelationTypes.Allies);
                                                            tclan.AddRelation(clan.ClanId, ClanRelations.RelationTypes.Allies);

                                                            clan.AllyRequest = tclan.AllyRequest = 0;
                                                        }
                                                        else client.Send(new Message("This Clan is Your Enemy.", System.Drawing.Color.Red, Message.TopLeft));
                                                    }
                                                    client.Send(new Message("This Clan Has Enemied You!.", System.Drawing.Color.Red, Message.TopLeft));
                                                }
                                            }
                                            else client.Send(new Message("Can not find target", System.Drawing.Color.Red, Message.TopLeft));
                                        }
                                        else client.Send(new Message("You are not the clan leader.", System.Drawing.Color.Red, Message.TopLeft));
                                    }
                                    break;
                                }
                            case (byte)Game.Clan_Typ.DeleteEnemy:
                                {
                                    Game.Clans clan = client.Entity.Myclan;
                                    if (clan != null)
                                    {
                                        if (client.Entity.ClanRank == 100)
                                        {
                                            Clan2 clanp = new Clan2();
                                            clanp.Deserialize(packet);

                                            String EnemyTarget = clanp.Offset18String;
                                            UInt32 ClanId = clanp.GetClanId(EnemyTarget);

                                            Game.Clans tclan;
                                            if (ServerBase.Kernel.ServerClans.TryGetValue(ClanId, out tclan))
                                            {
                                                clan.Enemies.Remove(ClanId);

                                                clan.DeleteRelation(ClanId, ClanRelations.RelationTypes.Enemies);

                                                clan.SendMessage(new ClanRelations(clan, ClanRelations.RelationTypes.Enemies));

                                                clan.SendMessage(new Message(String.Format("We are no longer Enemies With {0}", clan.ClanId), System.Drawing.Color.Red, Message.Clan));

                                                client.Send(clanp);
                                            }
                                        }
                                        else client.Send(new Message("You are not authorized to continue with this action", System.Drawing.Color.Red, Message.TopLeft));
                                    }
                                    break;
                                }
                            case (byte)Game.Clan_Typ.DeleteAlly:
                                {
                                    Game.Clans clan = client.Entity.Myclan;
                                    if (clan != null)
                                    {
                                        if (client.Entity.ClanRank == 100)
                                        {
                                            Clan2 clanp = new Clan2();
                                            clanp.Deserialize(packet);

                                            String AlliedTarget = clanp.Offset18String;
                                            UInt32 ClanId = clanp.GetClanId(AlliedTarget);

                                            Game.Clans tclan;
                                            if (clan.Allies.TryGetValue(ClanId, out tclan))
                                            {
                                                clan.Allies.Remove(ClanId);
                                                tclan.Allies.Remove(clan.ClanId);

                                                clan.DeleteRelation(ClanId, ClanRelations.RelationTypes.Allies);
                                                tclan.DeleteRelation(clan.ClanId, ClanRelations.RelationTypes.Allies);

                                                clan.SendMessage(new ClanRelations(clan, ClanRelations.RelationTypes.Allies));
                                                tclan.SendMessage(new ClanRelations(tclan, ClanRelations.RelationTypes.Allies));

                                                clan.SendMessage(new Message(String.Format("We are no longer allied with {0}", tclan.ClanName), System.Drawing.Color.Red, Message.Clan));
                                                tclan.SendMessage(new Message(String.Format("We are no longer allied with {0}", clan.ClanName), System.Drawing.Color.Red, Message.Clan));

                                                client.Send(clanp);
                                            }
                                        }
                                        else client.Send(new Message("You are not authorized to continue with this action", System.Drawing.Color.Red, Message.TopLeft));
                                    }
                                    break;
                                }
                            case (byte)Game.Clan_Typ.AddEnemy:
                                {
                                    Game.Clans clan = client.Entity.Myclan;
                                    if (clan != null)
                                    {
                                        if (client.Entity.ClanRank == 100)
                                        {
                                            String Enemy = System.Text.Encoding.ASCII.GetString(packet, 18, packet[17]).Trim(new Char[] { '\0' });
                                            UInt32 ClanId = 0;
                                            var AllCland = ServerBase.Kernel.ServerClans.Values.ToArray();
                                            foreach (Game.Clans c_clan in AllCland)
                                            {
                                                if (Enemy == c_clan.ClanName)
                                                {
                                                    ClanId = c_clan.ClanId;
                                                    break;
                                                }
                                            }
                                            if (ClanId == 0) break;
                                            if (!clan.Enemies.ContainsKey(ClanId))
                                            {
                                                if (!clan.Allies.ContainsKey(ClanId))
                                                {
                                                    if (clan.Enemies.Count >= 5)
                                                    { client.Send(new Message("The Ammount of Enemies You can Have has exceeded", System.Drawing.Color.Red, Message.TopLeft)); break; }

                                                    Game.Clans tclan;
                                                    if (ServerBase.Kernel.ServerClans.TryGetValue(ClanId, out tclan))
                                                    {
                                                        if (!clan.Enemies.ContainsKey(tclan.ClanId))
                                                            clan.Enemies.Add(tclan.ClanId, tclan);

                                                        clan.AddRelation(ClanId, ClanRelations.RelationTypes.Enemies);

                                                        clan.SendMessage(new ClanRelations(clan, ClanRelations.RelationTypes.Enemies));

                                                        clan.SendMessage(new Message(String.Format("We Have Enemied the clan {0}", tclan.ClanName), System.Drawing.Color.Red, Message.Clan));
                                                        tclan.SendMessage(new Message(String.Format("The Clan {0} Has Made us their Enemy!", clan.ClanName), System.Drawing.Color.Red, Message.Clan));
                                                    }
                                                }
                                                else client.Send(new Message("This clan is one of your alliance, What has gone wrong?", System.Drawing.Color.Red, Message.TopLeft));
                                            }
                                            else client.Send(new Message("This clan is Already One of Your Enemies", System.Drawing.Color.Red, Message.TopLeft));
                                        }
                                    }
                                    break;
                                }
                            default:
                                Console.WriteLine("Clan Type " + packet[4]);
                                break;

                        }
                        break;
                        /* switch (packet[4])
                         {
                             case 23://client exit
                                 {
                                     if (client.Entity.Myclan != null)
                                     {
                                         foreach (var clien in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                         {
                                             if (clien.Entity.Myclan != null)
                                             {
                                                 if (clien.Entity.Myclan.ClanId == client.Entity.Myclan.ClanId)
                                                 {
                                                     if (clien.Entity.Myclan.Members.ContainsKey(client.Entity.UID))
                                                         clien.Entity.Myclan.Members.Remove(client.Entity.UID);
                                                 }
                                             }
                                         }
                                         client.Entity.ClanName = "";
                                         client.Entity.Myclan = null;
                                         Database.Clans.KickClan(client.Entity.Name);
                                         client.Send(packet);
                                     }
                                     break;
                                 }
                             case 14://enemy
                                 {
                                     string Enemy = System.Text.Encoding.ASCII.GetString(packet, 18, packet[17]);
                                     client.Send(packet);

                                     Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 14);
                                     client.Send(cl.SendAlies(Enemy, "Lider"));
                                     break;
                                 }
                             case 25://buleitn
                                 {
                                     if (client.Entity.Myclan == null) return;
                                     string buletin = System.Text.Encoding.ASCII.GetString(packet, 18, packet[17]);
                                     foreach (var clan in Conquer_Online_Server.ServerBase.Kernel.ServerClans.Values)
                                     {
                                         if (clan.ClanId == client.Entity.Myclan.ClanId)
                                             clan.ClanBuletion = buletin;
                                     }
                                     foreach (var member in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                     {
                                         if (member.Entity.Myclan != null)
                                         {
                                             if (member.Entity.UID != client.Entity.UID)
                                                 if (member.Entity.Myclan.ClanId == client.Entity.Myclan.ClanId)
                                                 {
                                                     member.Entity.Myclan.ClanBuletion = buletin;
                                                 }
                                         }
                                     }
                                     Database.Clans.SaveClan(Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId]);
                                     client.Send(packet);
                                     client.Entity.Myclan.ClanBuletion = buletin;
                                     break;
                                 }
                             case 22://give kick
                                 {
                                     if (client.Entity.Myclan != null)
                                     {
                                         if (client.Entity.ClanRank == 100)
                                         {
                                             string name = System.Text.Encoding.ASCII.GetString(packet, 18, packet[17]);
                                             uint Key = 0;

                                             foreach (Game.ClanMembers mem in client.Entity.Myclan.Members.Values)
                                             {
                                                 if (mem.Name == name)
                                                     Key = mem.UID;
                                             }
                                             if (Key != 0)
                                             {

                                                 if (Conquer_Online_Server.ServerBase.Kernel.GamePool.ContainsKey(Key))
                                                 {
                                                     foreach (var clien in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                                     {
                                                         if (clien.Entity.UID == client.Entity.UID) continue;
                                                         if (clien.Entity.Myclan != null)
                                                         {
                                                             if (clien.Entity.Myclan.ClanId == client.Entity.Myclan.ClanId)
                                                             {
                                                                 if (clien.Entity.Myclan.Members.ContainsKey(Key))
                                                                 {
                                                                     clien.Entity.Myclan.Members.Remove(Key);
                                                                     Network.GamePackets.ClanMembers clan = new Network.GamePackets.ClanMembers(client);
                                                                     client.Send(clan.ToArray());

                                                                     clien.Entity.ClanName = "";
                                                                     clien.Entity.Myclan = null;
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                             Database.Clans.KickClan(name);
                                         }
                                     }
                                     break;
                                 }
                             case 26:
                                 {
                                     uint money = BitConverter.ToUInt32(packet, 8);
                                     if (client.Entity.Money >= money && client.Entity.Myclan != null)
                                     {
                                         client.Entity.Myclan.Members[client.Entity.UID].Donation += money;
                                         client.Entity.Money -= money;
                                         Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].ClanDonation += money;
                                         foreach (var clien in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                         {
                                             if (clien.Entity.Myclan != null)
                                             {
                                                 if (clien.Entity.UID != client.Entity.UID)
                                                 {
                                                     if (clien.Entity.Myclan.ClanId == client.Entity.Myclan.ClanId)
                                                     {

                                                         clien.Entity.Myclan.ClanDonation = Conquer_Online_Server.ServerBase.Kernel.ServerClans[clien.Entity.Myclan.ClanId].ClanDonation;
                                                     }
                                                 }
                                             }
                                         }
                                         client.Entity.Myclan.ClanDonation = Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].ClanDonation;
                                         Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 1);
                                         client.Send(cl.ToArray());
                                         Database.Clans.SaveClientDonation(client);
                                         Database.Clans.SaveClan(Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId]);
                                     }
                                     break;
                                 }
                             case 11://add player
                                 {

                                     uint lider = BitConverter.ToUInt32(packet, 8);
                                     if (Conquer_Online_Server.ServerBase.Kernel.GamePool.ContainsKey(lider))
                                     {
                                         packet[4] = 11;
                                         Network.Writer.WriteUInt32(client.Entity.UID, 8, packet);

                                         packet[16] = 1;
                                         packet[17] = (byte)client.Entity.Name.Length;
                                         for (int i = 0; i < client.Entity.Name.Length; i++)
                                         {
                                             try
                                             {
                                                 packet[18 + i] = Convert.ToByte(client.Entity.Name[i]);

                                             }
                                             catch { }
                                         }
                                         Conquer_Online_Server.ServerBase.Kernel.GamePool[lider].Send(packet);
                                     }
                                     break;
                                 }
                             case 12:
                                 {
                                     if (packet[16] == 1)
                                     {
                                         if (client.Entity.Myclan.Members[client.Entity.UID].Rank == 100)
                                         {
                                             if (client.Entity.Myclan != null)
                                             {
                                                 if (client.Entity.Myclan.Members.Count < 7)
                                                 {

                                                     uint memeber = BitConverter.ToUInt32(packet, 8);
                                                     if (ServerBase.Kernel.GamePool.ContainsKey(memeber))
                                                     {
                                                         Game.ClanMembers member = new Conquer_Online_Server.Game.ClanMembers();
                                                         member.UID = ServerBase.Kernel.GamePool[memeber].Entity.UID;
                                                         member.Donation = 0;
                                                         member.Rank = 10;
                                                         member.Class = ServerBase.Kernel.GamePool[memeber].Entity.Class;
                                                         member.Level = ServerBase.Kernel.GamePool[memeber].Entity.Level;
                                                         member.Name = ServerBase.Kernel.GamePool[memeber].Entity.Name;
                                                         if (!client.Entity.Myclan.Members.ContainsKey(memeber))
                                                             client.Entity.Myclan.Members.Add(member.UID, member);

                                                         foreach (var clien in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                                         {
                                                             if (clien.Entity.Myclan != null)
                                                             {
                                                                 if (clien.Entity.Myclan.ClanId == client.Entity.Myclan.ClanId)
                                                                 {
                                                                     if (!clien.Entity.Myclan.Members.ContainsKey(memeber))
                                                                         clien.Entity.Myclan.Members.Add(member.UID, member);
                                                                 }
                                                             }
                                                         }
                                                       ServerBase.Kernel.GamePool[memeber].Entity.ClanRank = 0;
                                                         ServerBase.Kernel.GamePool[memeber].Entity.Myclan = client.Entity.Myclan;
                                                         ServerBase.Kernel.GamePool[memeber].Entity.ClanName = client.Entity.ClanName;
                                                         Database.Clans.JoinClan(ServerBase.Kernel.GamePool[memeber]);
                                                        ServerBase.Kernel.GamePool[memeber].Entity.Teleport(ServerBase.Kernel.GamePool[memeber].Entity.MapID
                                                             , ServerBase.Kernel.GamePool[memeber].Entity.X
                                                             , ServerBase.Kernel.GamePool[memeber].Entity.Y);
                                                     }
                                                 }
                                             }
                                      }
                                     }
                                     break;
                                 }
                             case 4://memebers
                                 {
                                     ClanMembers clan = new ClanMembers(client);
                                     client.Send(clan.ToArray());
                                     break;
                                 }
                             case 0x1d:
                                 {
                                     if (client.Entity.Myclan != null)
                                     {
                                         Network.Writer.WriteUInt32(client.Entity.Myclan.ClanId, 8, packet);
                                         Network.Writer.WriteByte(1, 16, packet);
                                         Network.Writer.WriteByte(0x0d, 17, packet);
                                         Network.Writer.WriteString("0 0 0 0 0 0 0", 18, packet);
                                         client.Send(packet);
                                         Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 1);
                                         client.Send(cl.ToArray());
                                         client.Send(packet);

                                         if (client.Entity.Myclan.ClanBuletion != "")
                                             client.Send(cl.UpgradeBuletin(client.Entity.Myclan.ClanBuletion));
                                     }
                                     else
                                     {
                                         client.Send(packet);
                                         packet[4] = 23;
                                     }

                                     break;
                                 }
                             case 0x18:
                                 {
                                     client.Send(packet);
                                     break;
                                 }
                             default:
                                 Console.WriteLine("Clan Type " + packet[4]);
                                 break;
                         }
                         break;*/
                    }
                #endregion
                #region Reincarnation (1066)
                case 1066:
                    {
                        if (client.Entity.Reborn != 2) return;
                        byte NewClass = packet[4];
                        ushort NewBody = packet[8];
                        if (client.Entity.Body.ToString().EndsWith("1") || client.Entity.Body.ToString().EndsWith("2"))
                            NewBody += 2000;
                        else NewBody += 1000;

                        if (client.Inventory.Contains(711083, 1))
                        {
                            client.Entity.Body = NewBody;
                            new PacketHandler.Reincarnation(client, NewClass);
                            //new Game.Features.Reincarnation.Reincarnate(client.Entity, NewClass);
                            client.Inventory.Remove(711083, 1);
                        }
                        break;
                    }
                #endregion
                #region SubClass (2320)
                case 2320:
                    {
                        byte[] Packet = null;
                        switch (packet[4])
                        {
                            #region [Restore/Switch]
                            case 0:
                                byte To = packet[6];
                                Packet = new byte[0];
                                client.Send(packet);

                                if (To > 0)//Switch
                                {
                                    #region [Effects-Addition]
                                    switch ((Conquer_Online_Server.Game.ClassID)To)
                                    {
                                        case Conquer_Online_Server.Game.ClassID.Apothecary:
                                            {
                                                //

                                                client.Entity.Statistics.Detoxication = (ushort)(client.Entity.SubClasses.Classes[(byte)Conquer_Online_Server.Game.ClassID.Apothecary].Phase * 8);
                                                //client.Entity.Statistics.Detoxication += (client.Entity.SubClasses.Classes[To].Level);
                                                break;
                                            }
                                    }

                                    #endregion
                                    /*switch ((Game.ClassID)To)
                                    {
                                        case Game.ClassID.Wrangler:
                                            {
                                                switch (client.Entity.SubClasses.Classes[To].Level)
                                                {
                                                    case 9:
                                                        {
                                                            //client.Entity.Hitpoints += 1200;
                                                            //client.Entity.MaxHitpoints += 1200;
                                                            break;
                                                        }
                                                }
                                                break;
                                            }
                                    }*/
                                    Packet = new byte[0];
                                    Packet = new SubClassShowFull(true) { ID = 1, Class = To, Level = client.Entity.SubClasses.Classes[To].Phase }.ToArray();//client.Entity.SubClasses.Classes[To].Phase
                                    client.Send(Packet);
                                    //Packet = new SubClass(client.Entity).ToArray();
                                    //client.Send(Packet);
                                    client.Entity.SubClass = To;
                                    client.Entity.SubClassLevel = client.Entity.SubClasses.Classes[To].Level;
                                    client.Entity.SubClasses.Active = To;
                                }
                                else//Restore
                                {
                                    client.Entity.SubClass = 0;
                                    client.Entity.SubClassLevel = 0;
                                    client.Entity.SubClasses.Active = 0;
                                    Packet = new SubClassShowFull(true) { ID = 1 }.ToArray();
                                    client.Send(Packet);
                                }
                                client.SendScreen(client.Entity.SpawnPacket, false);
                                break;
                            #endregion
                            #region [Upgrade]
                            case 2:
                                {
                                    byte Class = packet[6];
                                    ushort Required = 0;
                                    Game.SubClass Sc = client.Entity.SubClasses.Classes[Class];
                                    #region [Set Required]
                                    switch ((Game.ClassID)Sc.ID)
                                    {
                                        case Game.ClassID.MartialArtist:
                                            switch (Sc.Level)
                                            {
                                                case 1: Required = 300; break;
                                                case 2: Required = 900; break;
                                                case 3: Required = 1800; break;
                                                case 4: Required = 2700; break;
                                                case 5: Required = 3600; break;
                                                case 6: Required = 5100; break;
                                                case 7: Required = 6900; break;
                                                case 8: Required = 8700; break;
                                                case 9: Required = ushort.MaxValue; break;
                                            }
                                            break;
                                        case Game.ClassID.Warlock:
                                            switch (Sc.Level)
                                            {
                                                case 1: Required = 300; break;
                                                case 2: Required = 900; break;
                                                case 3: Required = 1800; break;
                                                case 4: Required = 2700; break;
                                                case 5: Required = 3600; break;
                                                case 6: Required = 5100; break;
                                                case 7: Required = 6900; break;
                                                case 8: Required = 8700; break;
                                                case 9: Required = ushort.MaxValue; break;
                                            }
                                            break;
                                        case Game.ClassID.ChiMaster:
                                            switch (Sc.Level)
                                            {
                                                case 1: Required = 600; break;
                                                case 2: Required = 1800; break;
                                                case 3: Required = 3600; break;
                                                case 4: Required = 5400; break;
                                                case 5: Required = 7200; break;
                                                case 6: Required = 10200; break;
                                                case 7: Required = 13800; break;
                                                case 8: Required = 17400; break;
                                                case 9: Required = ushort.MaxValue; break;
                                            }
                                            break;
                                        case Game.ClassID.Sage:
                                            switch (Sc.Level)
                                            {
                                                case 1: Required = 400; break;
                                                case 2: Required = 1200; break;
                                                case 3: Required = 2400; break;
                                                case 4: Required = 3600; break;
                                                case 5: Required = 4800; break;
                                                case 6: Required = 6800; break;
                                                case 7: Required = 9200; break;
                                                case 8: Required = 11600; break;
                                                case 9: Required = ushort.MaxValue; break;
                                            }
                                            break;
                                        case Game.ClassID.Apothecary:
                                            switch (Sc.Level)
                                            {
                                                case 1: Required = 100; break;
                                                case 2: Required = 200; break;
                                                case 3: Required = 300; break;
                                                case 4: Required = 400; break;
                                                case 5: Required = 500; break;
                                                case 6: Required = 1000; break;
                                                case 7: Required = 4000; break;
                                                case 8: Required = 9000; break;
                                                case 9: Required = ushort.MaxValue; break;
                                            }
                                            break;
                                        case Game.ClassID.Wrangler:
                                        case Game.ClassID.Performer:
                                            switch (Sc.Level)
                                            {
                                                case 1: Required = 400; break;
                                                case 2: Required = 1200; break;
                                                case 3: Required = 2400; break;
                                                case 4: Required = 3600; break;
                                                case 5: Required = 4800; break;
                                                case 6: Required = 6800; break;
                                                case 7: Required = 9200; break;
                                                case 8: Required = 11600; break;
                                                case 9: Required = ushort.MaxValue; break;
                                            }
                                            break;
                                    }
                                    #endregion
                                    if (client.Entity.SubClasses.StudyPoints >= Required)
                                    {
                                        client.Entity.SubClasses.StudyPoints -= Required;
                                        client.Entity.SubClasses.Classes[Class].Level++;
                                        Packet = new byte[0];
                                        Packet = new SubClassShowFull(true) { ID = 1, Class = Class, Level = client.Entity.SubClasses.Classes[Class].Level }.ToArray();
                                        client.Send(Packet);
                                        Packet = new SubClass(client.Entity).ToArray();
                                        client.Send(Packet);
                                        Database.SubClassTable.Update(client.Entity, client.Entity.SubClasses.Classes[Class]);
                                        Database.SubClassTable.Update(client.Entity);
                                    }
                                    break;
                                }
                            #endregion
                            #region [Info]
                            case 6:
                                Game.Entity Owner = client.Entity;
                                if (Owner.SubClasses.Classes.Count > 0)
                                {
                                    Game.SubClass[] Classes = new Game.SubClass[Owner.SubClasses.Classes.Count];
                                    Owner.SubClasses.Classes.Values.CopyTo(Classes, 0);
                                    foreach (Game.SubClass Class in Classes)
                                    {
                                        if (Class.ID == 9)
                                        {
                                            for (byte i = 0; i < Class.Phase; i++)
                                            {
                                                Packet = new byte[0];
                                                Packet = new SubClassShowFull(true) { ID = 4, Class = Class.ID, Level = Class.Level }.ToArray();
                                                client.Send(Packet);
                                            }
                                            continue;
                                        }
                                        Packet = new byte[0];
                                        Packet = new SubClassShowFull(true) { ID = 4, Class = Class.ID, Level = Class.Level }.ToArray();
                                        client.Send(Packet);
                                    }
                                }
                                Packet = new SubClass(client.Entity).ToArray();
                                client.Send(Packet);
                                break;
                            #endregion
                            default:
                                Console.WriteLine("Unknown 2320 packet type " + packet[4]);
                                break;
                        }
                        break;
                    }
                #endregion
                #region MemoryAgate
                case 2110:
                    {
                        uint ItemUID = BitConverter.ToUInt32(packet, 8);
                        switch (packet[4])
                        {
                            case 1://record
                                {
                                    if (client.Map.IsDynamic()) return;
                                    Interfaces.IConquerItem Item = null;
                                    if (client.Inventory.TryGetItem(ItemUID, out Item))
                                    {
                                        if (Item.Agate_map.ContainsKey(packet[12]))
                                        {
                                            Item.Agate_map[(uint)packet[12]] = client.Entity.MapID
                                               + "~" + client.Entity.X
                                               + "~" + client.Entity.Y;
                                            Database.ConquerItemTable.UpdateItem(Item, client);
                                            Item.SendAgate(client);
                                            break;
                                        }
                                        if (packet[12] > Item.Agate_map.Count)
                                        {
                                            Item.Agate_map.Add((byte)(Item.Agate_map.Count), client.Entity.MapID
                                               + "~" + client.Entity.X
                                               + "~" + client.Entity.Y);
                                            Database.ConquerItemTable.UpdateItem(Item, client);
                                            Item.SendAgate(client);
                                            break;
                                        }
                                        else
                                        {
                                            if (!Item.Agate_map.ContainsKey(packet[12]))
                                            {

                                                Item.Agate_map.Add(packet[12], client.Entity.MapID
                                                    + "~" + client.Entity.X

                                                   + "~" + client.Entity.Y);
                                                Database.ConquerItemTable.UpdateItem(Item, client);
                                                Item.SendAgate(client);
                                            }
                                            break;
                                        }
                                    }
                                    break;
                                }
                            case 3://recal
                                {
                                    if (client.Map.IsDynamic()) return;
                                    Interfaces.IConquerItem Item = null;
                                    if (client.Inventory.TryGetItem(ItemUID, out Item))
                                    {

                                        if (Item.Agate_map.ContainsKey(packet[12]))
                                        {
                                            if (ushort.Parse(Item.Agate_map[packet[12]].Split('~')[0].ToString()) == 1038)
                                                return;
                                            if (ushort.Parse(Item.Agate_map[packet[12]].Split('~')[0].ToString()) == 6001)
                                                return;
                                            client.Entity.Teleport(ushort.Parse(Item.Agate_map[packet[12]].Split('~')[0].ToString())
                                                , ushort.Parse(Item.Agate_map[packet[12]].Split('~')[1].ToString())
                                                , ushort.Parse(Item.Agate_map[packet[12]].Split('~')[2].ToString()));
                                            Item.Durability--;
                                            Item.SendAgate(client);
                                            Database.ConquerItemTable.UpdateItem(Item, client);
                                        }
                                    }
                                    break;
                                }
                            case 4://repair
                                {
                                    Interfaces.IConquerItem Item = null;
                                    if (client.Inventory.TryGetItem(ItemUID, out Item))
                                    {
                                        uint cost = (uint)(Item.MaximDurability - Item.Durability) / 2;
                                        if (cost == 0)
                                            cost = 1;
                                        if (client.Entity.ConquerPoints > cost)
                                        {
                                            client.Entity.ConquerPoints -= cost;
                                            Item.Durability = Item.MaximDurability;
                                            Item.SendAgate(client);
                                            Database.ConquerItemTable.UpdateItem(Item, client);
                                        }
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                case 1128:
                    {
                        p1128 vp = new p1128(false);
                        vp.Deserialize(packet);
                        switch (vp.UID)
                        {
                            case 0://player city teleport
                                {
                                    switch (vp.UID2)
                                    {
                                        ////////////////////////////////////////////////////////////////////////////////////////////////////
                                        case 1://tc
                                            client.Entity.Teleport(1002, 429, 378);
                                            break;
                                        case 2://pc
                                            client.Entity.Teleport(1011, 188, 264);
                                            break;
                                        case 3://ac
                                            client.Entity.Teleport(1020, 565, 562);
                                            break;
                                        case 4://dc
                                            client.Entity.Teleport(1000, 500, 650);
                                            break;
                                        case 5://bc
                                            client.Entity.Teleport(1015, 717, 571);
                                            break;
                                            ////////////////////////////////////////////////////////////////////////////////////////
                                            {

                                            }
                                        default: Console.WriteLine("Unknown 1128 portal subtype 1 : " + vp.UID2); break;
                                    }
                                    break;
                                }
                            case 1://Team city teleport
                                {
                                    switch (vp.UID2)
                                    {
                                        ////////////////////////////////////////////////////////////////////////////////////////////////////
                                        case 1://tc
                                            foreach (Client.GameState teammate in client.Entity.Owner.Team.Teammates)
                                            {
                                                if (ServerBase.Kernel.GetDistance(client.Entity.X, client.Entity.Y, teammate.Entity.X, teammate.Entity.Y) <= 18)
                                                {
                                                    teammate.Entity.Teleport(1002, 429, 378);
                                                }
                                            }
                                            client.Entity.Teleport(1002, 429, 378);
                                            break;
                                        case 2://pc
                                            foreach (Client.GameState teammate in client.Entity.Owner.Team.Teammates)
                                            {
                                                if (ServerBase.Kernel.GetDistance(client.Entity.X, client.Entity.Y, teammate.Entity.X, teammate.Entity.Y) <= 18)
                                                {
                                                    teammate.Entity.Teleport(1011, 188, 264);
                                                }
                                            }
                                            client.Entity.Teleport(1011, 188, 264);
                                            break;
                                        case 3://ac
                                            foreach (Client.GameState teammate in client.Entity.Owner.Team.Teammates)
                                            {
                                                if (ServerBase.Kernel.GetDistance(client.Entity.X, client.Entity.Y, teammate.Entity.X, teammate.Entity.Y) <= 18)
                                                {
                                                    teammate.Entity.Teleport(1020, 565, 562);
                                                }
                                            }
                                            client.Entity.Teleport(1020, 565, 562);
                                            break;
                                        case 4://dc
                                            foreach (Client.GameState teammate in client.Entity.Owner.Team.Teammates)
                                            {
                                                if (ServerBase.Kernel.GetDistance(client.Entity.X, client.Entity.Y, teammate.Entity.X, teammate.Entity.Y) <= 18)
                                                {
                                                    teammate.Entity.Teleport(1000, 500, 650);
                                                }
                                            }
                                            client.Entity.Teleport(1000, 500, 650);
                                            break;
                                        case 5://bc
                                            foreach (Client.GameState teammate in client.Entity.Owner.Team.Teammates)
                                            {
                                                if (ServerBase.Kernel.GetDistance(client.Entity.X, client.Entity.Y, teammate.Entity.X, teammate.Entity.Y) <= 18)
                                                {
                                                    teammate.Entity.Teleport(1015, 717, 571);
                                                }
                                            }
                                            client.Entity.Teleport(1015, 717, 571);
                                            break;
                                            ////////////////////////////////////////////////////////////////////////////////////////
                                            {

                                            }
                                        default: Console.WriteLine("Unknown 1128 portal subtype 2 : " + vp.UID2); break;
                                    }
                                    break;
                                }

                            default:
                                Console.WriteLine("Unknown 1128 subtype: " + vp.UID); break;
                        }
                        break;
                    }
                default:
                    {
                        if (client.Account.State == Conquer_Online_Server.Database.AccountTable.AccountState.ProjectManager)
                            client.Send(new Message("Unknown type: " + ID + " with length " + packet.Length + "Unknown type: " + ID2, System.Drawing.Color.CadetBlue, Message.Talk));
                        if (ID == 1040)
                            client.Send(packet);
                        break;
                    }
            }
        }
Example #8
0
        public static uint Ranged(Entity attacker, Entity attacked, Database.SpellInformation spell)
        {
            if (attacked.Name.Contains("Guard1"))
                return 1;
            int Damage = 0;
            Durability(attacker, attacked, null);

            if (attacked.ContainsFlag(Network.GamePackets.Update.Flags.ShurikenVortex))
                return 1;
            if (attacker.Transformed)
                return 0;
            if (attacker.Name.Contains("Guard1"))
                return 700000;
            Damage = ServerBase.Kernel.Random.Next(Math.Min((int)attacker.MinAttack, (int)attacker.MaxAttack), Math.Max((int)attacker.MinAttack, (int)attacker.MaxAttack) + 1);

            if (attacker.OnSuperman())
                if (attacked.EntityFlag == EntityFlag.Monster)
                    Damage *= 10;
                else
                    Damage *= 2;

            if (attacker.OnFatalStrike())
                if (attacked.EntityFlag == EntityFlag.Monster)
                    Damage *= 5;

            if (!attacked.Transformed)
                Damage -= attacked.Defence;
            else
                Damage -= attacked.TransformationDefence;

            Damage -= Damage * attacked.ItemBless / 100;

            byte dodge = attacked.Dodge;
            if (dodge > 100)
                dodge = 99;
            if (!attacked.Transformed)
                Damage -= Damage * dodge / 100;
            else
                Damage -= Damage * attacked.TransformationDodge / 100;

            if (attacker.OnIntensify && Time32.Now >= attacker.IntensifyStamp.AddSeconds(4))
            {
                Damage *= 2;
                attacker.OnIntensify = false;
            }

            if (attacker.ContainsFlag(Network.GamePackets.Update.Flags.Stigma))
                if (!attacker.Transformed)
                    Damage = (int)(Damage * attacker.StigmaIncrease);

            if (attacked.EntityFlag == EntityFlag.Monster)
            {
                if (attacked.MapID < 1351 || attacked.MapID > 1354)
                    Damage = (int)(Damage * (1 + (GetLevelBonus(attacker.Level, attacked.Level) * 0.08)));

                if (attacked.MapID < 1351 || attacked.MapID > 1354)
                    Damage = (int)(Damage * AttackMultiplier(attacker, attacked));
            }
            Damage = BattlePowerCalculation(Damage, attacker.BattlePower - attacked.BattlePower);
            if (ServerBase.Kernel.Rate(5))
            {
                if (attacker.EntityFlag == EntityFlag.Player)
                {
                    if (attacker.Owner.BlessTime > 0)
                    {
                        Damage *= 2;
                        _String str = new _String(true);
                        str.UID = attacker.UID;
                        str.TextsCount = 1;
                        str.Type = _String.Effect;
                        str.Texts.Add("LuckyGuy");
                        attacker.Owner.SendScreen(str, true);
                    }
                }
            }

            if (ServerBase.Kernel.Rate(5))
            {
                if (attacked.EntityFlag == EntityFlag.Player)
                {
                    if (attacked.Owner.BlessTime > 0)
                    {
                        Damage = 1;
                        _String str = new _String(true);
                        str.UID = attacker.UID;
                        str.TextsCount = 1;
                        str.Type = _String.Effect;
                        str.Texts.Add("LuckyGuy");
                        attacked.Owner.SendScreen(str, true);
                    }
                }
            }
            if (attacked.EntityFlag == EntityFlag.Monster)
            {
                if (Damage >= 700 * attacked.MaxHitpoints)
                    Damage = (int)(700 * attacked.MaxHitpoints);
            }

            if (spell.PowerPercent != 0)
                Damage = (int)(Damage * spell.PowerPercent);

            Damage += attacker.PhysicalDamageIncrease;
            Damage -= attacked.PhysicalDamageDecrease;

            if (Damage <= 0)
                Damage = 1;
            AutoRespone(attacker, attacked, ref Damage);
            if (attacked.ContainsFlag(Update.Flags.AzureShield))
            {
                if (Damage >= attacked.AzureDamage)
                {
                    Damage -= attacked.AzureDamage;
                    attacked.AzureDamage = 0;

                }
                else
                {
                    attacked.AzureDamage -= Damage;
                    Damage = 0;
                }
            }
            return (uint)Damage;
        }
Example #9
0
        public static uint Ranged(Entity attacker, SobNpcSpawn attacked)
        {
            int Damage = 0;
            Durability(attacker, null, null);
            if (attacker.Transformed)
                return 0;
            if (attacked.UID == 810 && attacker.Owner.Guild != null)
            {
                if (Game.ConquerStructures.Society.GuildWar.PoleKeeper == attacker.Owner.Guild)
                {
                    return 0;
                }
            }
            Damage = ServerBase.Kernel.Random.Next(Math.Min((int)attacker.MinAttack, (int)attacker.MaxAttack), Math.Max((int)attacker.MinAttack, (int)attacker.MaxAttack) + 1);

            if (attacker.OnIntensify && Time32.Now >= attacker.IntensifyStamp.AddSeconds(4))
            {
                Damage *= 2;

                attacker.OnIntensify = false;
            }

            if (ServerBase.Kernel.Rate(5))
            {
                if (attacker.EntityFlag == EntityFlag.Player)
                {
                    if (attacker.Owner.BlessTime > 0)
                    {
                        Damage *= 2;
                        _String str = new _String(true);
                        str.UID = attacker.UID;
                        str.TextsCount = 1;
                        str.Type = _String.Effect;
                        str.Texts.Add("LuckyGuy");
                        attacker.Owner.SendScreen(str, true);
                    }
                }
            }
            if (attacker.ContainsFlag(Network.GamePackets.Update.Flags.Stigma))
                if (!attacker.Transformed)
                    Damage = (int)(Damage * attacker.StigmaIncrease);

            Damage += attacker.PhysicalDamageIncrease;
            if (Damage <= 0)
                Damage = 1;
            return (uint)Damage;
        }
Example #10
0
        public static uint Magic(Entity attacker, Entity attacked, Database.SpellInformation spell)
        {
            if (!ServerBase.Kernel.Rate(spell.Percent))
                return 0;
            Durability(attacker, attacked, spell);
            if (attacked.ContainsFlag(Network.GamePackets.Update.Flags.ShurikenVortex))
                return 1;
            if (attacker.Transformed)
                return 0;
            if (attacker.Name.Contains("Guard1"))
                return 700000;
            int Damage = 0;
            Damage = (int)attacker.MagicAttack;
            Damage += spell.Power;

            if (!attacked.Transformed)
            {
                //(uint)((double)damage * (100 - Attacked.Entity.ItemBless) / 95);
                // Damage -= (int)((uint)(attacked.MagicDefencePercent * Damage / 100));
                if (attacked.ItemBless > 60)
                    attacked.ItemBless = 58;
                Damage = (int)((uint)((double)Damage * (100 - attacked.ItemBless) / 340));
                Damage -= attacked.MagicDefence;

            }
            else
                Damage = (int)(((Damage * 0.75) * (1 - (0 * 0.01))) - attacked.TransformationMagicDefence);

            if (attacked.EntityFlag == EntityFlag.Monster)
                if (attacked.MapID < 1351 || attacked.MapID > 1354)
                    Damage = (int)(Damage * AttackMultiplier(attacker, attacked) / 2);

            if (attacked.EntityFlag == EntityFlag.Monster)
            {
                Damage = (int)(Damage * 6.6);
                if (attacked.MapID < 1351 || attacked.MapID > 1354)
                    Damage = (int)(Damage * (1 + (GetLevelBonus(attacker.Level, attacked.Level) * 0.08)));
            }

            Damage = BattlePowerCalculation(Damage, attacker.BattlePower - attacked.BattlePower);

            //  Damage = RemoveExcessDamage(Damage, attacker, attacked);
            //   Console.WriteLine("[3]" + Damage);
            if (ServerBase.Kernel.Rate(5))
            {
                if (attacker.EntityFlag == EntityFlag.Player)
                {
                    Damage *= 2;
                    _String str = new _String(true);
                    str.UID = attacker.UID;
                    str.TextsCount = 1;
                    str.Type = _String.Effect;
                    str.Texts.Add("LuckyGuy");
                    attacker.Owner.SendScreen(str, true);
                }
            }

            if (ServerBase.Kernel.Rate(5))
            {
                if (attacked.EntityFlag == EntityFlag.Player)
                {
                    if (attacked.Owner.BlessTime > 0)
                    {
                        Damage = 1;
                        _String str = new _String(true);
                        str.UID = attacker.UID;
                        str.TextsCount = 1;
                        str.Type = _String.Effect;
                        str.Texts.Add("LuckyGuy");
                        attacked.Owner.SendScreen(str, true);
                    }
                }
            }

            Damage += attacker.MagicDamageIncrease;
            Damage -= attacked.MagicDamageDecrease;

            if (Damage <= 0)
                Damage = 1;

            if (attacked.EntityFlag == EntityFlag.Monster)
            {
                if (Damage >= 700 * attacked.MaxHitpoints)
                    Damage = (int)(700 * attacked.MaxHitpoints);
            }
            else
            {
                if (attacker.EntityFlag == EntityFlag.Monster)
                {
                    if (attacker.Name.Contains("Guard1"))
                        Damage = (int)attacked.MaxHitpoints + 1;
                }
            }

            AutoRespone(attacker, attacked, ref Damage);
            if (attacked.ContainsFlag(Update.Flags.AzureShield))
            {
                if (Damage >= attacked.AzureDamage)
                {
                    Damage -= attacked.AzureDamage;
                    attacked.AzureDamage = 0;

                }
                else
                {
                    attacked.AzureDamage -= Damage;
                    Damage = 0;
                }
            }
            return (uint)Damage;
        }
Example #11
0
        public static uint Melee(Entity attacker, Entity attacked, Database.SpellInformation spell)
        {
            if (attacked.Name.Contains("Guard1"))
                return 1;
            int Damage = 0;

            if (attacker.EntityFlag == EntityFlag.Monster)
                if (attacked.EntityFlag == EntityFlag.Player)
                    if (ServerBase.Kernel.Rate(Math.Min(60, attacked.Dodge + 30)))
                        return 0;

            Durability(attacker, attacked, null);
            if (attacker.Name.Contains("Guard1"))
                return 700000;
            if (attacked.ContainsFlag(Network.GamePackets.Update.Flags.ShurikenVortex))
                return 1;
            if (!attacker.Transformed)
                Damage = ServerBase.Kernel.Random.Next(Math.Min((int)attacker.MinAttack, (int)attacker.MaxAttack), Math.Max((int)attacker.MinAttack, (int)attacker.MaxAttack) + 1);
            else
                Damage = ServerBase.Kernel.Random.Next((int)attacker.TransformationMinAttack, (int)attacker.TransformationMaxAttack + 1);

            if (attacker.ContainsFlag(Network.GamePackets.Update.Flags.Stigma))
                if (!attacker.Transformed)
                    Damage = (int)(Damage * attacker.StigmaIncrease);

            if (attacked.EntityFlag == EntityFlag.Monster)
            {
                if (attacked.MapID < 1351 || attacked.MapID > 1354)
                    Damage = (int)(Damage * (1 + (GetLevelBonus(attacker.Level, attacked.Level) * 0.08)));
            }
            if (attacker.EntityFlag == EntityFlag.Player)
            {
                if (attacked.EntityFlag == EntityFlag.Monster)
                {
                    if (attacked.MapID < 1351 || attacked.MapID > 1354)
                        if (!attacker.Owner.Equipment.Free(4) && !attacker.Owner.Equipment.Free(5))
                            Damage = (int)(Damage * 1.5);
                }
                if (attacked.EntityFlag == EntityFlag.Monster)
                    if (attacked.MapID < 1351 || attacked.MapID > 1354)
                        Damage = (int)(Damage * AttackMultiplier(attacker, attacked));
                // if (attacker.OnSuperman())
                //     if (attacked.EntityFlag == EntityFlag.Monster)
                //         Damage *= 10;

                if (attacker.OnFatalStrike())
                    if (attacked.EntityFlag == EntityFlag.Monster)
                        Damage *= 5;
            }
            if (!attacked.Transformed)
            {
                if (attacked.ContainsFlag(Network.GamePackets.Update.Flags.MagicShield))
                {
                    if (attacked.ShieldTime > 0)
                        Damage -= (ushort)(attacked.Defence * attacked.ShieldIncrease);
                    else
                        Damage -= (ushort)(attacked.Defence * attacked.MagicShieldIncrease);
                }
                else
                {
                    Damage -= attacked.Defence;
                }
            }
            else
                Damage -= attacked.TransformationDefence;
            Damage = BattlePowerCalculation(Damage, attacker.BattlePower - attacked.BattlePower);
            if (ServerBase.Kernel.Rate(5))
            {
                if (attacker.EntityFlag == EntityFlag.Player)
                {
                    if (attacker.Owner.BlessTime > 0)
                    {
                        Damage *= 2;
                        _String str = new _String(true);
                        str.UID = attacker.UID;
                        str.TextsCount = 1;
                        str.Type = _String.Effect;
                        str.Texts.Add("LuckyGuy");
                        attacker.Owner.SendScreen(str, true);
                    }
                }
            }

            if (ServerBase.Kernel.Rate(5))
            {
                if (attacked.EntityFlag == EntityFlag.Player)
                {
                    if (attacked.Owner.BlessTime > 0)
                    {
                        Damage = 1;
                        _String str = new _String(true);
                        str.UID = attacker.UID;
                        str.TextsCount = 1;
                        str.Type = _String.Effect;
                        str.Texts.Add("LuckyGuy");
                        attacked.Owner.SendScreen(str, true);
                    }
                }
            }
            if (spell.ID == 6000 && attacked.EntityFlag == EntityFlag.Monster)
            {
                if (spell.PowerPercent != 0)
                    Damage = (int)(Damage * spell.PowerPercent);
            }
            else if (spell.ID != 6000)
            {
                if (spell.PowerPercent != 0)
                    Damage = (int)(Damage * spell.PowerPercent);
            }
            Damage = RemoveExcessDamage(Damage, attacker, attacked);

            Damage += attacker.PhysicalDamageIncrease;
            Damage -= attacked.PhysicalDamageDecrease;

            if (attacked.EntityFlag == EntityFlag.Monster)
            {
                if (Damage >= 700 * attacked.MaxHitpoints)
                    Damage = (int)(700 * attacked.MaxHitpoints);
            }
            if (Damage <= 0)
                Damage = 1;

            AutoRespone(attacker, attacked, ref Damage);

            if (attacked.ContainsFlag(Update.Flags.AzureShield))
            {
                if (Damage >= attacked.AzureDamage)
                {
                    Damage -= attacked.AzureDamage;
                    attacked.AzureDamage = 0;

                }
                else
                {
                    attacked.AzureDamage -= Damage;
                    Damage = 0;
                }
            }
            if (attacker.OnSuperman())
                if (attacked.EntityFlag == EntityFlag.Monster)
                    Damage *= 10;
            if (attacker.NobilityRank != attacked.NobilityRank)
            {
                int addnobility_damage = 0;
                if ((byte)attacker.NobilityRank == 12)
                    addnobility_damage = (Damage * ((byte)attacker.NobilityRank + 45)) / 100;
                else
                    if ((byte)attacker.NobilityRank > 5)
                        addnobility_damage = (Damage * ((byte)attacker.NobilityRank + 25)) / 100;
                if ((byte)attacked.NobilityRank > 5)
                {
                    if ((addnobility_damage - (uint)((Damage * ((byte)attacked.NobilityRank + 8)) / 100)) > 0)
                    {
                        addnobility_damage -= (int)((Damage * ((byte)attacked.NobilityRank + 8)) / 100);
                    }
                    else
                    {
                        if (Damage > (uint)((Damage * ((byte)attacked.NobilityRank + 8)) / 100))
                        {
                            Damage -= (int)((Damage * ((byte)attacked.NobilityRank + 8)) / 100);
                        }
                        else
                            Damage = 1;
                    }
                }
                if (Damage != 1)
                {
                    Damage += addnobility_damage;
                }
            }
            return (uint)Damage;
        }
Example #12
0
        public static uint Magic(Entity attacker, SobNpcSpawn attacked, Database.SpellInformation spell)
        {
            if (!ServerBase.Kernel.Rate(spell.Percent))
                return 0;
            if (attacked.UID == 810 && attacker.Owner.Guild != null)
            {
                if (Game.ConquerStructures.Society.GuildWar.PoleKeeper == attacker.Owner.Guild)
                {
                    return 0;
                }
            }
            Durability(attacker, null, spell);
            if (attacker.Transformed)
                return 0;
            if (attacker.Name.Contains("Guard"))
                return 700000;
            int Damage = 0;
            Damage = (int)attacker.MagicAttack;
            Damage += spell.Power;
            if (ServerBase.Kernel.Rate(5))
            {
                if (attacker.EntityFlag == EntityFlag.Player)
                {
                    if (attacker.Owner.BlessTime > 0)
                    {
                        Damage *= 2;
                        _String str = new _String(true);
                        str.UID = attacker.UID;
                        str.TextsCount = 1;
                        str.Type = _String.Effect;
                        str.Texts.Add("LuckyGuy");
                        attacker.Owner.SendScreen(str, true);
                    }
                }
            }

            Damage += attacker.MagicDamageIncrease;

            if (Damage <= 0)
                Damage = 1;

            return (uint)Damage;
        }
Example #13
0
        public static void GetDialog(Network.GamePackets.NpcRequest npcRequest, Client.GameState client)
        {
            if (npcRequest == null) return;
            if (AvatarLinker == null)
                AvatarLinker = new ServerBase.IniFile("\\database\\npc.ini");
            //Console.WriteLine("[" + client.Entity.Name + "][NPC] " + npcRequest.NpcID + " : " + npcRequest.OptionID);
            if (!client.Map.Npcs.ContainsKey(client.ActiveNpc) || npcRequest == null || client == null || client.Entity == null || (npcRequest.NpcID == 0 && npcRequest.OptionID == 255))
                return;
            if (client.Trade != null)
                if (client.Trade.InTrade)
                    return;
            Dialogs dialog = new Dialogs();
            dialog.Client = client;
            dialog.Replies = new List<NpcReply>();
            INpc npcs = null;
            if (client.Map.Npcs.TryGetValue(client.ActiveNpc, out npcs))
            {
                ushort avatar = (ushort)AvatarLinker.ReadInt16("NpcType" + (npcs.Mesh / 10), "SimpleObjID", 1);

                dialog.Avatar(avatar);
            }
            if (npcs == null) return;
            switch (client.Entity.MapID)
            {
                #region Twin City
                case 1002:
                    {
                        switch (client.ActiveNpc)
                        {
                            #region Enter Guild Arena
                            case 380:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Would you like to enter the guild war arena?");
                                                dialog.Option("Yes.", 1);
                                                dialog.Option("No.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                client.Entity.Teleport(1038, 348, 339);
                                                break;
                                            }
                                    } break;
                                }
                            #endregion

                            #region Twin City
                            case 10080:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                if (client.Entity.PKPoints < 29)
                                                {
                                                    dialog.Text("Hey there " + client.Entity.Name + "! I'm the craziest conductress!\nI also know how to send you to all the main cities.\nAnyways... Where are you headed? I may be able to teleport you there for 5,000 gold.");
                                                    dialog.Option("Phoenix Castle.", 1);
                                                    dialog.Option("Ape City.", 2);
                                                    dialog.Option("Desert City.", 3);
                                                    dialog.Option("Bird Island.", 4);
                                                    dialog.Option("Mine Cave.", 5);
                                                    dialog.Option("Market.", 6);
                                                    dialog.Option("I don't care.", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not help MURDERS!");
                                                    dialog.Option("Ouch..", 255);
                                                    dialog.Option("Then you are of no use to me!\nI'll kill you too!", 100);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        case 1:
                                        case 2:
                                        case 3:
                                        case 4:
                                        case 5:
                                        case 6:
                                            {
                                                ushort Map = 1002, X, Y;
                                                if (npcRequest.OptionID == 1)
                                                {
                                                    X = 958;
                                                    Y = 555;
                                                }
                                                else if (npcRequest.OptionID == 2)
                                                {
                                                    X = 555;
                                                    Y = 957;
                                                }
                                                else if (npcRequest.OptionID == 3)
                                                {
                                                    X = 69;
                                                    Y = 473;
                                                }
                                                else if (npcRequest.OptionID == 4)
                                                {
                                                    X = 232;
                                                    Y = 190;
                                                }
                                                else if (npcRequest.OptionID == 5)
                                                {
                                                    X = 53;
                                                    Y = 399;
                                                }
                                                else
                                                {
                                                    X = 211;
                                                    Y = 196;
                                                    Map = 1036;
                                                }
                                                if (client.Entity.Money >= 5000)
                                                {
                                                    client.Entity.Money -= 5000;
                                                    client.Entity.Teleport(Map, X, Y);
                                                }
                                                else
                                                {
                                                    dialog.Text("Hey! You don't have 5,000 gold do you?\nDon't you dare try to cheat me or I'll call the guards!");
                                                    dialog.Option("Crazy!", 255);
                                                    dialog.Send();
                                                }
                                                break;

                                            }
                                        case 100:
                                            {
                                                client.Entity.AddFlag(Update.Flags.FlashingName);
                                                client.Entity.FlashingNameStamp = Time32.Now;
                                                client.Entity.FlashingNameTime = 30;
                                                client.Send(Conquer_Online_Server.ServerBase.Constants.Warrent);
                                                dialog.Text("Guards! HELP! " + client.Entity.Name + " is trying to kill me!!");
                                                dialog.Option("I'll get you!", 255);
                                                dialog.Send();
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Celestine
                            case 20005:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Did you see those plants while comming over here? Do you see that pond right over there? You see I need clean water badly. If the clean water is united with 7 of 9 unique gems(except tortoise, thunder, glory) it can heal plants and clean ponds. In exchange of those 8 items, I will give you back a celestial stone, which is needed for first reborn.");
                                                dialog.Option("How do I get gems?", 1);
                                                dialog.Option("How do I get clean water?", 2);
                                                dialog.Option("I got the items.", 3);
                                                dialog.Option("Boring...", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                dialog.Text("You can get gems simply by minning or killing monsters, as they drop gems sometime.");
                                                dialog.Option("How do I get clean water?", 2);
                                                dialog.Option("I got the items.", 3);
                                                dialog.Option("Boring...", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 2:
                                            {
                                                dialog.Text("In the first Island Map in Adventure Zone(GC1), you might find the WaterLord(517,732). You may kill it and it may give a CleanWater, with a 50% percent of success. Once killed you may wait 15 minutes, before it will respawn again.");
                                                dialog.Option("How do I get gems?", 1);
                                                dialog.Option("I got the items.", 3);
                                                dialog.Option("Boring...", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 3:
                                            {
                                                bool hasfornow = true;
                                                uint baseid = 700001;
                                                for (int c = 0; c < 70; c += 10)
                                                    if (!client.Inventory.Contains((uint)(baseid + c), 1))
                                                    {
                                                        hasfornow = false;
                                                        break;
                                                    }
                                                if (!hasfornow)
                                                {
                                                    dialog.Text("You don't meet the requierments!");
                                                    dialog.Send();
                                                    break;
                                                }
                                                if (client.Inventory.Contains(721258, 1))
                                                {
                                                    for (int c = 0; c < 70; c += 10)
                                                        client.Inventory.Remove((uint)(baseid + c), 1);
                                                    client.Inventory.Remove(721258, 1);
                                                    client.Inventory.Add(721259, 0, 1);
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't meet the requierments!");
                                                    dialog.Send();
                                                    break;
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region GuildDirector
                            case 10003:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello there. Do you want to create a new guild? You need level 90 and 500000 silver and you have to not belong to any guild. If you are a guild leader, then you can name 5 deputy leaders.");
                                                dialog.Option("Create guild.", 1);
                                                dialog.Option("Name deputy leader.", 3);
                                                // dialog.Option("Move leadership.", 6);
                                                dialog.Option("Disband guild.", 9);
                                                dialog.Option("I don't have that.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 9:
                                            {
                                                if (client.Guild != null && client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                                {
                                                    dialog.Text("Are you sure you want to disband your guild?");
                                                    dialog.Option("Yes.", 10);
                                                    dialog.Option("Ah, nevermind.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't meet the requierments.");
                                                    dialog.Option("Ahh.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 10:
                                            {
                                                if (client.Guild != null && client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                                {
                                                    client.Guild.Disband();
                                                }
                                                break;
                                            }
                                        case 6:
                                            {
                                                if (client.Guild != null && client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                                {
                                                    dialog.Text("Input here the member name you want to promote as guild leader.");
                                                    dialog.Input("Here:", 7, 16);
                                                    dialog.Option("Ah, nevermind.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't meet the requierments.");
                                                    dialog.Option("Ahh.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 7:
                                            {
                                                if (client.Guild != null && client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                                {
                                                    if (npcRequest.Input != "")
                                                    {
                                                        var member = client.Guild.GetMemberByName(npcRequest.Input);
                                                        if (member == null)
                                                        {
                                                            dialog.Text("There is no such member in your guild.");
                                                            dialog.Option("Ah, nevermind.", 255);
                                                            dialog.Send();
                                                            return;
                                                        }
                                                        else
                                                        {
                                                            if (member.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                                            {
                                                                dialog.Text("You cannot promote this member anymore.");
                                                                dialog.Option("Ah, nevermind.", 255);
                                                                dialog.Send();
                                                                return;
                                                            }
                                                            else
                                                            {
                                                                if (member.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
                                                                    client.Guild.DeputyLeaderCount--;
                                                                member.Rank = Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader;
                                                                if (member.IsOnline)
                                                                {
                                                                    client.Guild.SendGuild(member.Client);
                                                                    member.Client.Entity.GuildRank = (ushort)member.Rank;
                                                                    member.Client.Screen.FullWipe();
                                                                    member.Client.Screen.Reload(null);
                                                                }
                                                                client.AsMember.Rank = Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader;
                                                                if (client.AsMember.IsOnline)
                                                                {
                                                                    client.Guild.SendGuild(client);
                                                                    client.Entity.GuildRank = (ushort)member.Rank;
                                                                    client.Screen.FullWipe();
                                                                    client.Screen.Reload(null);
                                                                }
                                                                client.Guild.DeputyLeaderCount++;
                                                            }
                                                        }
                                                    }
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Guild != null && client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                                {
                                                    dialog.Text("You have now " + client.Guild.DeputyLeaderCount + " named deupty leaders.");
                                                    if (client.Guild.DeputyLeaderCount == 5)
                                                    {
                                                        dialog.Text("You cannot name any other deupty leader.");
                                                        dialog.Option("Ah, nevermind.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("Input here the member name you want to promote as deputy leader.");
                                                        dialog.Input("Here:", 4, 16);
                                                        dialog.Option("Ah, nevermind.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't meet the requierments.");
                                                    dialog.Option("Ahh.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 4:
                                            {
                                                if (client.Guild != null && client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                                {
                                                    if (npcRequest.Input != "")
                                                    {
                                                        var member = client.Guild.GetMemberByName(npcRequest.Input);
                                                        if (member == null)
                                                        {
                                                            dialog.Text("There is no such member in your guild.");
                                                            dialog.Option("Ah, nevermind.", 255);
                                                            dialog.Send();
                                                            return;
                                                        }
                                                        else
                                                        {
                                                            if (member.Rank != Conquer_Online_Server.Game.Enums.GuildMemberRank.Member)
                                                            {
                                                                dialog.Text("You cannot promote this member anymore.");
                                                                dialog.Option("Ah, nevermind.", 255);
                                                                dialog.Send();
                                                                return;
                                                            }
                                                            else
                                                            {
                                                                member.Rank = Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader;
                                                                if (member.IsOnline)
                                                                {
                                                                    client.Guild.SendGuild(member.Client);
                                                                    member.Client.Entity.GuildRank = (ushort)member.Rank;
                                                                    member.Client.Screen.FullWipe();
                                                                    member.Client.Screen.Reload(null);
                                                                }
                                                                client.Guild.DeputyLeaderCount++;
                                                            }
                                                        }
                                                    }
                                                }
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Guild == null && client.Entity.Level >= 90 && client.Entity.Money >= 500000)
                                                {
                                                    dialog.Text("Name your guild. The name must have less than 16 characters of any type.");
                                                    dialog.Input("Here:", 2, 16);
                                                    dialog.Option("Ah, nevermind.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't meet the requierments.");
                                                    dialog.Option("Ahh.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                string _name = npcRequest.Input;
                                                bool guildExist = false;
                                                if (_name == "")
                                                {
                                                    dialog.Text("You don't give me a name...");
                                                    dialog.Option("I see.", 255);
                                                    dialog.Send();
                                                }
                                                else if (_name != "")
                                                {
                                                    foreach (Guild g in Conquer_Online_Server.ServerBase.Kernel.Guilds.Values)
                                                    {
                                                        if (g.Name == _name)
                                                        {
                                                            guildExist = true;
                                                        }
                                                    }
                                                    if (guildExist)
                                                    {
                                                        dialog.Text("The guild name already exist!");
                                                        dialog.Option("I'll choose another.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        if (client.Guild == null && client.Entity.Level >= 90 && client.Entity.Money >= 500000)
                                                        {
                                                            if (npcRequest.Input != "")
                                                            {
                                                                client.Entity.Money -= 500000;
                                                                Guild guild = new Guild(client.Entity.Name);
                                                                guild.ID = Guild.GuildCounter.Next;
                                                                guild.SilverFund = 500000;
                                                                client.AsMember = new Conquer_Online_Server.Game.ConquerStructures.Society.Guild.Member(guild.ID)
                                                                {
                                                                    SilverDonation = 500000,
                                                                    ID = client.Entity.UID,
                                                                    Level = client.Entity.Level,
                                                                    Name = client.Entity.Name,
                                                                    Rank = Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader,
                                                                };
                                                                if (client.NobilityInformation != null)
                                                                {
                                                                    client.AsMember.Gender = client.NobilityInformation.Gender;
                                                                    client.AsMember.NobilityRank = client.NobilityInformation.Rank;
                                                                }

                                                                client.Entity.GuildID = (ushort)guild.ID;
                                                                client.Entity.GuildRank = (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader;
                                                                guild.Leader = client.AsMember;
                                                                client.Guild = guild;
                                                                guild.Create(npcRequest.Input);
                                                                guild.MemberCount++;
                                                                guild.SendGuild(client);
                                                                guild.SendName(client);
                                                                client.Screen.FullWipe();
                                                                client.Screen.Reload(null);
                                                            }
                                                        }
                                                    }
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Barber
                            case 10002:
                                {
                                    dialog.Avatar(241);
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("What kind of hair style would you like?");
                                                dialog.Option("New Styles", 1);
                                                dialog.Option("Nostalgic Styles", 2);
                                                dialog.Option("Special Styles", 3);
                                                dialog.Option("Nevermind", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        #region New Hair Styles
                                        #region Options
                                        case 1:
                                            {

                                                dialog.Text("Which new style do you want?");
                                                dialog.Option("New Hairstyle 1", 10);
                                                dialog.Option("New Hairstyle 2", 11);
                                                dialog.Option("New Hairstyle 3", 12);
                                                dialog.Option("New Hairstyle 4", 13);
                                                dialog.Option("New Hairstyle 5", 14);
                                                dialog.Option("New Hairstyle 6", 15);
                                                dialog.Option("New Hairstyle 7", 16);
                                                dialog.Option("More styles.", 102);
                                                dialog.Send();
                                                break;

                                            }
                                        case 102:
                                            {

                                                dialog.Text("Which new style do you want?");
                                                dialog.Option("New Hairstyle 8", 17);
                                                dialog.Option("New Hairstyle 9", 18);
                                                dialog.Option("New Hairstyle 10", 19);
                                                dialog.Option("New Hairstyle 11", 20);
                                                dialog.Option("New Hairstyle 12", 21);
                                                dialog.Option("Back.", 1);
                                                dialog.Option("Nevermind", 255);
                                                dialog.Send();
                                                break;

                                            }
                                        #endregion
                                        #region ...
                                        case 10:
                                        case 11:
                                        case 12:
                                        case 13:
                                        case 14:
                                        case 15:
                                        case 16:
                                        case 17:
                                        case 18:
                                        case 19:
                                        case 20:
                                        case 21:
                                            {
                                                client.Entity.HairStyle = ushort.Parse(Convert.ToString(client.Entity.HairStyle)[0] + (20 + npcRequest.OptionID).ToString());
                                                dialog.Text("Done!");
                                                dialog.Option("Thanks.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        #endregion
                                        #endregion
                                        #region Nostalgic Hair Styles
                                        #region Options
                                        case 2:
                                            {

                                                dialog.Text("Which new style do you want?");
                                                dialog.Option("Nostalgic Hairstyle 1", 30);
                                                dialog.Option("Nostalgic Hairstyle 2", 31);
                                                dialog.Option("Nostalgic Hairstyle 3", 32);
                                                dialog.Option("Nostalgic Hairstyle 4", 33);
                                                dialog.Option("Nostalgic Hairstyle 5", 34);
                                                dialog.Option("Nostalgic Hairstyle 6", 35);
                                                dialog.Option("Nostalgic Hairstyle 7", 36);
                                                dialog.Option("Nevermind.", 255);
                                                dialog.Send();
                                                break;

                                            }
                                        #endregion
                                        #region ...
                                        case 30:
                                        case 31:
                                        case 32:
                                        case 33:
                                        case 34:
                                        case 35:
                                        case 36:
                                            {
                                                client.Entity.HairStyle = ushort.Parse(Convert.ToString(client.Entity.HairStyle)[0] + (npcRequest.OptionID - 20).ToString());
                                                dialog.Text("Done!");
                                                dialog.Option("Thanks.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        #endregion
                                        #endregion
                                        #region Special Hair Styles
                                        #region Options
                                        case 3:
                                            {

                                                dialog.Text("Which new style do you want?");
                                                dialog.Option("New Hairstyle 1", 40);
                                                dialog.Option("New Hairstyle 2", 41);
                                                dialog.Option("New Hairstyle 3", 42);
                                                dialog.Option("New Hairstyle 4", 43);
                                                dialog.Option("New Hairstyle 5", 44);
                                                dialog.Option("Nevermind.", 255);
                                                dialog.Send();
                                                break;

                                            }
                                        #endregion
                                        #region ...
                                        case 40:
                                        case 41:
                                        case 42:
                                        case 43:
                                        case 44:
                                            {
                                                client.Entity.HairStyle = ushort.Parse(Convert.ToString(client.Entity.HairStyle)[0] + (npcRequest.OptionID - 19).ToString());
                                                dialog.Text("Done!");
                                                dialog.Option("Thanks.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        #endregion
                                        #endregion

                                    }
                                    break;
                                }
                            #endregion

                            #region Assistant
                            case 4293:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Do you want to visit the mine?");
                                                dialog.Option("Yes.", 1);
                                                dialog.Option("No.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                client.Entity.Teleport(1028, 155, 95);
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region General Peace
                            case 10054:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Stop!\nThe path ahead of you is dangerous.\nI don't recommend you continue on this path.\n");
                                                if (client.Entity.Level <= 70)
                                                {
                                                    dialog.Text("If you are looking from stronger monsters you should look in the Canyon first.\n");
                                                    dialog.Text("You can find your way there in the south-west part of the wind plain.\n");
                                                }
                                                dialog.Option("Leave me alone General.", 1);
                                                dialog.Option("Okay, thanks for the warning.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                client.Entity.Teleport(1000, 973, 668);
                                                break;
                                            }
                                    }
                                    break;
                                }

                            #endregion

                            #region WarehouseGuardian
                            case 1061: //WarehouseGuardian
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello. I'm the one that was choosen to set/change/remove the password of the warehouse. I must say without a password you could lose a lot yet, which you probably already knew. My advice for you is that you should have a password, because it could save you of many problems. If you have a password yet, you can remove or change it.");
                                                if (client.WarehousePW == "")
                                                {
                                                    dialog.Option("Okay, let me set the password.", 1);
                                                }
                                                else
                                                {
                                                    dialog.Option("I want to change the password.", 2);
                                                    dialog.Option("I want to remove the password.", 3);
                                                }
                                                dialog.Option("Forget it.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        #region Set password
                                        case 1:
                                            {
                                                if (client.WarehousePW == "")
                                                {
                                                    dialog.Text("Please insert a password that's built only with numbers and whose length is less or equal to 8. An example can be 74352.");
                                                    dialog.Input("Here:", 4, 8);
                                                    dialog.Option("Forget it.", 255);
                                                }
                                                else
                                                {
                                                    dialog.Text("You have a password already set.");
                                                    dialog.Option("Alright.", 255);
                                                }
                                                dialog.Send();
                                                break;
                                            }
                                        case 4:
                                            {
                                                if (client.WarehousePW == "")
                                                {
                                                    if (CheckNumberPassword(npcRequest.Input) && npcRequest.Input.Length <= 8)
                                                    {
                                                        client.TempPassword = npcRequest.Input;
                                                        dialog.Text("Please insert the password again.");
                                                        dialog.Input("Here:", 5, 8);
                                                        dialog.Option("Forget it.", 255);
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("Invalid password, please try again.");
                                                        dialog.Input("Here:", 4, 8);
                                                        dialog.Option("Alright.", 255);
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You have a password already set.");
                                                    dialog.Option("Alright.", 255);
                                                }
                                                dialog.Send();
                                                break;
                                            }
                                        case 5:
                                            {
                                                if (client.WarehousePW == "")
                                                {
                                                    if (CheckNumberPassword(npcRequest.Input) && npcRequest.Input.Length <= 8)
                                                    {
                                                        if (client.TempPassword == npcRequest.Input)
                                                        {
                                                            client.TempPassword = "";
                                                            client.WarehousePW = npcRequest.Input;
                                                            dialog.Text("Password set!");
                                                            dialog.Option("Thank you.", 255);
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("The password doesn't match. Insert again?");
                                                            dialog.Input("Here:", 5, 8);
                                                            dialog.Option("Forget it.", 255);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("Invalid password, please try again.");
                                                        dialog.Input("Here:", 5, 8);
                                                        dialog.Option("Alright.", 255);
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You have a password already set.");
                                                    dialog.Option("Alright.", 255);
                                                }
                                                dialog.Send();
                                                break;
                                            }
                                        #endregion
                                        #region Change password
                                        case 2:
                                            {
                                                if (client.WarehousePW != "")
                                                {
                                                    dialog.Text("Please insert the password you have now.");
                                                    dialog.Input("Here:", 6, 8);
                                                    dialog.Option("Forget it.", 255);
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't have a password set.");
                                                    dialog.Option("Alright.", 255);
                                                }
                                                dialog.Send();
                                                break;
                                            }
                                        case 6:
                                            {
                                                if (client.WarehousePW != "")
                                                {
                                                    if (CheckNumberPassword(npcRequest.Input) && npcRequest.Input.Length <= 8)
                                                    {
                                                        if (client.WarehousePW == npcRequest.Input)
                                                        {
                                                            dialog.Text("Please insert the password again.");
                                                            dialog.Input("Here:", 7, 8);
                                                            dialog.Option("Forget it.", 255);
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("Wrong password. Try again?");
                                                            dialog.Input("Here:", 6, 8);
                                                            dialog.Option("Alright.", 255);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("Invalid password, please try again.");
                                                        dialog.Input("Here:", 6, 8);
                                                        dialog.Option("Alright.", 255);
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't have a password set.");
                                                    dialog.Option("Alright.", 255);
                                                }
                                                dialog.Send();
                                                break;
                                            }
                                        case 7:
                                            {
                                                if (client.WarehousePW != "")
                                                {
                                                    if (CheckNumberPassword(npcRequest.Input) && npcRequest.Input.Length <= 8)
                                                    {
                                                        client.TempPassword = npcRequest.Input;
                                                        dialog.Text("Please insert the password again.");
                                                        dialog.Input("Here:", 8, 8);
                                                        dialog.Option("Forget it.", 255);
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("Invalid password, please try again.");
                                                        dialog.Input("Here:", 7, 8);
                                                        dialog.Option("Alright.", 255);
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't have a password set.");
                                                    dialog.Option("Alright.", 255);
                                                }
                                                dialog.Send();
                                                break;
                                            }
                                        case 8:
                                            {
                                                if (client.WarehousePW != "")
                                                {
                                                    if (CheckNumberPassword(npcRequest.Input) && npcRequest.Input.Length <= 8)
                                                    {
                                                        if (client.TempPassword == npcRequest.Input)
                                                        {
                                                            client.TempPassword = "";
                                                            client.WarehousePW = npcRequest.Input;
                                                            dialog.Text("Password changed!");
                                                            dialog.Option("Thank you.", 255);
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("Wrong password.");
                                                            dialog.Input("Here:", 8, 8);
                                                            dialog.Option("Alright.", 255);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("Invalid password, please try again.");
                                                        dialog.Input("Here:", 8, 8);
                                                        dialog.Option("Alright.", 255);
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't have a password set.");
                                                    dialog.Option("Alright.", 255);
                                                }
                                                dialog.Send();
                                                break;
                                            }
                                        #endregion
                                        #region Remove password
                                        case 3:
                                            {
                                                if (client.WarehousePW != "")
                                                {
                                                    dialog.Text("Please insert the password you have now.");
                                                    dialog.Input("Here:", 9, 8);
                                                    dialog.Option("Forget it.", 255);
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't have a password set.");
                                                    dialog.Option("Alright.", 255);
                                                }
                                                dialog.Send();
                                                break;
                                            }
                                        case 9:
                                            {
                                                if (client.WarehousePW != "")
                                                {
                                                    if (CheckNumberPassword(npcRequest.Input) && npcRequest.Input.Length <= 8)
                                                    {
                                                        if (client.WarehousePW == npcRequest.Input)
                                                        {
                                                            dialog.Text("Please insert the password again.");
                                                            dialog.Input("Here:", 10, 8);
                                                            dialog.Option("Forget it.", 255);
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("Wrong password. Try again?");
                                                            dialog.Input("Here:", 9, 8);
                                                            dialog.Option("Alright.", 255);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("Invalid password, please try again.");
                                                        dialog.Input("Here:", 9, 8);
                                                        dialog.Option("Alright.", 255);
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't have a password set.");
                                                    dialog.Option("Alright.", 255);
                                                }
                                                dialog.Send();
                                                break;
                                            }
                                        case 10:
                                            {
                                                if (client.WarehousePW != "")
                                                {
                                                    if (CheckNumberPassword(npcRequest.Input) && npcRequest.Input.Length <= 8)
                                                    {
                                                        if (client.WarehousePW == npcRequest.Input)
                                                        {
                                                            client.WarehousePW = "";
                                                            client.WarehouseOpen = true;
                                                            dialog.Text("Password removed.");
                                                            dialog.Option("Thank you.", 255);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("Invalid password, please try again.");
                                                        dialog.Input("Here:", 10, 8);
                                                        dialog.Option("Alright.", 255);
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't have a password set.");
                                                    dialog.Option("Alright.", 255);
                                                }
                                                dialog.Send();
                                                break;
                                            }
                                        #endregion
                                    }
                                    break;
                                }
                            #endregion

                            #region Jail npc
                            case 10081: //Jail npc
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello there. I can teleport you in jail for the amount of 1000 silvers. Do you want to proceed?");
                                                dialog.Option("Sure.", 1);
                                                dialog.Option("I'm standing by.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Money >= 1000)
                                                {
                                                    client.Entity.Money -= 1000;
                                                    client.Entity.Teleport(6000, 32, 72);
                                                }
                                                else
                                                {
                                                    dialog.Text("You need 1000 silvers to be able to enter the jail.");
                                                    dialog.Option("Alright.", 255);
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Arena npc
                            case 10021: //Arena npc
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello there. I can teleport you in jail for the amount of 50 silvers. Do you want to proceed?");
                                                dialog.Option("Sure.", 1);
                                                dialog.Option("I'm standing by.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Money >= 50)
                                                {
                                                    client.Entity.Money -= 50;
                                                    client.Entity.Teleport(1005, 51, 71);
                                                }
                                                else
                                                {
                                                    dialog.Text("You need 50 silvers to be able to enter the jail.");
                                                    dialog.Option("Alright.", 255);
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region ShopBoy
                            case 10063: //ShopBoy
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello there. I can teleport you in our shop, but I can also dye your armor black for the price of one DragonBall. What do you say?");
                                                dialog.Option("Teleport me in the shop.", 1);
                                                dialog.Option("Dye my armor black.", 2);
                                                dialog.Option("I'm standing by.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                client.Entity.Teleport(1008, 22, 26);
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Inventory.Contains(1088000, 1))
                                                {
                                                    IConquerItem armor = client.Equipment.TryGetItem(3);
                                                    if (armor != null && armor.ID != 0)
                                                    {
                                                        client.Inventory.Remove(1088000, 1);
                                                        armor.Color = Conquer_Online_Server.Game.Enums.Color.Black;
                                                        Conquer_Online_Server.Database.ConquerItemTable.UpdateColor(armor, client);
                                                        armor.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                        armor.Send(client);
                                                        client.Equipment.UpdateEntityPacket();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't wear an armor right now so I can't do anything.");
                                                        dialog.Option("Ah alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("Hmm...You don't have one DragonBall so I can't dye your armor.");
                                                    dialog.Option("Ah alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Kungfu Boy
                            case 100229:
                                {
                                    // If inv contains jade glyph
                                    // npcRequest.OptionID = 5
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                //#warning (Kungfu Boy) Check for begenniers quest, check for the note. Echo this text.
                                                dialog.Text("I started learning Kungfu when I was very young.\nNow I have learn to master my Chi very well! Wanna have a try?");
                                                dialog.Option("Yeah!", 1);
                                                dialog.Option("I don't care...", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                dialog.Text("Oh, a message from the Village Gateman? I see.\nHe wants me to teach you how to master your Chi.");
                                                dialog.Option("I'm listening.", 2);
                                                dialog.Send();
                                                break;
                                            }
                                        case 2:
                                            {
                                                dialog.Text("Press the Ctrl button, move the mouse arrow to the place you want to jump to and left click.");
                                                dialog.Text("You should know, you can't jump to a place you can't just normally walk to sometimes.");
                                                dialog.Option("Gotcha.", 3);
                                                dialog.Send();
                                                break;
                                            }
                                        case 3:
                                            {
                                                dialog.Text("Good! It seems that you have mastered this skill. One more thing!\n");
                                                dialog.Text("My sister, Kungfu Girl, has stolen my Jade Glyph and taken it up onto the roof behind me. Can you go get it for me?");
                                                dialog.Option("No problem.", 4);
                                                dialog.Send();
                                                break;
                                            }
                                        case 4:
                                            {
                                                //#warning (Kungfu boy) Add quest progress
                                                client.Send(new Message("Jump to the roof behind Kungfu Boy and catch his mischievous sister!", System.Drawing.Color.Green, Message.PopUP));
                                                break;
                                            }
                                        case 5:
                                            {
                                                dialog.Text("Hey you got it! Thank you. I see you've mastered your Chi.");
                                                dialog.Option("I have.", 6);
                                                dialog.Send();
                                                break;
                                            }
                                        case 6:
                                            {
                                                dialog.Text("Well, thats good. I storngly recommend you go visit the Armorer in Twin City.");
                                                dialog.Text(" You need to pick out some armor. It will save your life!");
                                                dialog.Option("I'll think about it.", 255);
                                                dialog.Send();
                                                break;
                                            }

                                    }
                                    break;
                                }

                            #endregion

                            #region Kungfu Girl
                            case 127271:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Haha! I wanted to play a trick on my brother! Don't tell him.");
                                                dialog.Option("He knows already.", 2);
                                                dialog.Option("You are very naughty.", 1);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                dialog.Text("Teehee!");
                                                dialog.Option("He knows about this, you know.", 2);
                                                dialog.Send();
                                                break;
                                            }
                                        case 2:
                                            {
                                                dialog.Text("Oh, well you got me.... Alright. Here's his Jade Glyph. Take it.");
                                                dialog.Option("Good!", 3);
                                                dialog.Send();
                                                break;
                                            }
                                        case 3:
                                            {
                                                //#warning (Kungfu boy) Add quest progress
                                                client.Send(new Message("You got Kungfu Boy's Jade Glyph back from Kungfu Girl! Take it back to Kungfu Boy.", System.Drawing.Color.Green, Message.PopUP));
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Simon
                            case 1152:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hmm, a few years ago, me and some friends of mine, started exploring the mountains. It was an usual day, cloudy with a very happy sun. We all went on the mountain to explore and level up a bit. Somehow we was all tricked into seeing a fantasy land and we went that way. We found a big rock that looked like a door, we broke it and went in. Since then, my friends are in the place we found and which we called the labirinth as it was full of powerful creatures that were leading each of the four levels of the labirith. Each friend of mine chose a floor and they await great conquerors at the end of each floor. ");
                                                dialog.Option("Tell me more about it.", 1);
                                                dialog.Option("Blah, boring.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                dialog.Text("In each floor there are three kinds of monsters, floor one has Slingers, GoldGhosts and the powerful Gibbon. The second floor has the AgileRats, Bladelings and the snake Naga. The third floor has BlueBirds, FiendBats and the mighty Talon. The last floor, the fourth, has MinotaurL120 and the Syren. Each of them drops some items, and you'll need some to get to the next floor, or some others to claim a reward from me.");
                                                dialog.Option("What rewards?", 2);
                                                dialog.Option("Blah, boring.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 2:
                                            {
                                                dialog.Text("In exchange of 17 SunDiamonds(dropped by Slingers) I will give you two meteors, for 17 MoonDiamonds(dropped by Bladelings), I will give you 4 meteors, for 17 StarDiamonds(dropped by BlueBirds), I will give you 4 meteor tears, and lastly for 17 CloudDiamonds, I will give you one DragonBall. More over, to get to the second floor from first one you need a SkyToken(dropped by GoldGhost), from second to third a EarthToken(dropped by AgileRat) and from third to fourth a SoulToken(dropped by FiendBat).");
                                                dialog.Option("Enough talking.", 3);
                                                dialog.Option("Claim my reward.", 4);
                                                dialog.Option("Blah, boring.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 3:
                                            {
                                                dialog.Text("Right. , I will be more than glad to teleport you in the first floor of the Labirith.");
                                                dialog.Option("Here, take them.", 5);
                                                dialog.Option("Blah, boring.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 4:
                                            {
                                                dialog.Text("What do you want to claim?");
                                                dialog.Option("Two Meteors.", 6);
                                                dialog.Option("Four Meteors.", 7);
                                                dialog.Option("Four Meteor tears.", 8);
                                                dialog.Option("One DragonBall.", 9);
                                                dialog.Option("Blah, boring.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 5:
                                            {

                                                client.Entity.Teleport(1351, 018, 127);

                                                break;
                                            }
                                        case 6:
                                            {
                                                if (client.Inventory.Contains(721533, 17))
                                                {
                                                    client.Inventory.Remove(721533, 17);
                                                    client.Inventory.Add(1088001, 0, 2);
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't meet the requierments.");
                                                    dialog.Option("Ahh, sorry.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 7:
                                            {
                                                if (client.Inventory.Contains(721534, 17))
                                                {
                                                    client.Inventory.Remove(721534, 17);
                                                    client.Inventory.Add(1088001, 0, 4);
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't meet the requierments.");
                                                    dialog.Option("Ahh, sorry.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 8:
                                            {
                                                if (client.Inventory.Contains(721535, 17))
                                                {
                                                    client.Inventory.Remove(721535, 17);
                                                    client.Inventory.Add(1088002, 0, 4);
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't meet the requierments.");
                                                    dialog.Option("Ahh, sorry.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 9:
                                            {
                                                if (client.Inventory.Contains(721536, 17))
                                                {
                                                    client.Inventory.Remove(721536, 17);
                                                    client.Inventory.Add(1088000, 0, 1);
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't meet the requierments.");
                                                    dialog.Option("Ahh, sorry.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region MoonBoxQuest
                            #region FortuneTeller
                            case 600050:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello " + client.Entity.Name + ", Have you heard of the palace method?");
                                                dialog.Option("Palace method?..", 1);
                                                dialog.Option("Don't care!", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                dialog.Text("I discovered a mystical tactic, but I was not able to solve it.\nI almost died! It's very dangerous.");
                                                dialog.Option("Sounds like my kind of fun.", 2);
                                                dialog.Option("Too dangerous", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 2:
                                            {

                                                dialog.Text("I'm serious! You don't understand it's very dangerous...");
                                                dialog.Option("Yea yea. Just take my there.", 3);
                                                dialog.Option("Nevermind... o.o", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 3:
                                            {
                                                client.Entity.Teleport(1042, 028, 033);
                                                dialog.Text("I warned you....");
                                                dialog.Option("I think you're full of it.\nThere's nothing here.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                            #endregion

                        }
                        break;
                    }
                #endregion
                #region MoonboxQuest
                case 1040:
                case 1041:
                case 1042:
                case 1043:
                case 1044:
                case 1045:
                case 1046:
                case 1047:
                case 1048:
                case 1049:
                case 1050:
                case 1051:
                    {
                        switch (client.ActiveNpc)
                        {
                            #region MoonBoxQuest
                            #region Maggie
                            case 600003:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("What are you here for!?\nPlease do not go ahead, or you will enter the very dangerous tactics.");
                                                dialog.Option("....You too?", 1);
                                                dialog.Option("Send me to the tatics.", 4);
                                                dialog.Option("I had better leave here!", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                dialog.Text("The tactic is so changeful, I once thought highly of my self\nand died from the damned tactics.");
                                                dialog.Option("How can I solve the tatics?", 2);
                                                dialog.Option("I do not believe in this!", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 2:
                                            {
                                                dialog.Text("I have studied it for so may years, but fail to work it out.\nPerhaps you can... Would you like to give it a try?");
                                                dialog.Option("Yes. I like a good challenge.", 3);
                                                dialog.Option("I changed my mind..", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 3:
                                            {
                                                dialog.Text("You will be entrapped in the tatic if you enter.\nYou won't be able to leave until you've found a special token.");
                                                dialog.Option("I'm ready to do this.", 5);
                                                dialog.Option("No. This is too risky.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 4:
                                            {
                                                dialog.Text("Alright, I'll take you there.\nYou must be sure to pick up the token!");
                                                dialog.Option("Okay.", 5);
                                                dialog.Send();
                                                break;
                                            }
                                        case 5:
                                            {
                                                ushort map = 1042;
                                                map += (ushort)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 8);
                                                client.Entity.Teleport(map, 210, 164);
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                            #region GuardianGod
                            case 600004:
                            case 600006:
                            case 600008:
                            case 600010:
                            case 600012:
                            case 600014:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                string[] Tactics = { "Peace", "Chaos", "Deserted", "Disturbed", "Prosperous", "Calmed" };
                                                uint almostid = client.ActiveNpc / 2;
                                                uint baseId = 721010;
                                                uint tactic = almostid - 300002;
                                                baseId += tactic;
                                                if (client.Inventory.Contains(baseId, 1))
                                                {
                                                    dialog.Text("Congratulations, you have a token for this tactic. This tactic is " + Tactics[tactic] + ".");
                                                    dialog.Option("Ok, thanks!", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't have a token for this tactic, I'm afraid I cannot tell you which tactic is it.");
                                                    dialog.Option("Ahh, thanks anyway!", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                    }
                                    break;
                                }
                            case 600016:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("You are in DeathTactic, you either die or proceed if you have 6 tokens that are not the same.");
                                                dialog.Option("Ok, thanks!", 255);
                                                dialog.Send();
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                            #region Ghost
                            case 600005:
                            case 600007:
                            case 600009:
                            case 600011:
                            case 600013:
                            case 600015:
                                {
                                    uint almostId = (client.ActiveNpc - 1) / 2;
                                    uint baseId = 721010;
                                    uint tactic = almostId - 300002;
                                    baseId += tactic;
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {

                                                if (client.Inventory.Contains(baseId, 1))
                                                {
                                                    dialog.Text("Nice you have the token!\nAre you ready to leave?");
                                                    dialog.Option("Yes.", 1);
                                                    dialog.Option("No.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("How dare you bother me without the token!\nYou will not leave this place until the token has been found!");
                                                    dialog.Option("Sorry I'll go find it!", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Inventory.Contains(baseId, 1))
                                                {
                                                    client.Entity.Teleport(1042, 028, 033);
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            case 600017:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("I've been trapped here forever.\nI didn't have all the token before coming here.");
                                                dialog.Option("What about me?", 1);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                dialog.Text("If you have all the tokens you may leave this place with a moonbox.\nIf you don't.... You must die.");
                                                dialog.Option("I have them! Please don't kill me!", 2);
                                                dialog.Option("Oh no...", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Inventory.Contains(721010, 1) &&
                                                         client.Inventory.Contains(721011, 1) &&
                                                         client.Inventory.Contains(721012, 1) &&
                                                         client.Inventory.Contains(721013, 1) &&
                                                         client.Inventory.Contains(721014, 1) &&
                                                         client.Inventory.Contains(721015, 1))
                                                {
                                                    client.Inventory.Remove(721010, 1);
                                                    client.Inventory.Remove(721011, 1);
                                                    client.Inventory.Remove(721012, 1);
                                                    client.Inventory.Remove(721013, 1);
                                                    client.Inventory.Remove(721014, 1);
                                                    client.Inventory.Remove(721015, 1);

                                                    client.Inventory.Add(721072, 0, 1);
                                                    client.Entity.Teleport(1050, 210, 164);
                                                }
                                                else
                                                {
                                                    dialog.Text("You're wrong. Enjoy your death.");
                                                    dialog.Option("No!", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                            #region VagrantGhost
                            case 600018:
                            case 600019:
                            case 600020:
                            case 600021:
                            case 600022:
                            case 600023:
                            case 600024:
                            case 600025:
                            case 600026:
                            case 600027:
                            case 600028:
                            case 600029:
                            case 600030:
                            case 600031:
                            case 600032:
                            case 600033:
                            case 600034:
                            case 600035:
                            case 600036:
                            case 600037:
                            case 600038:
                            case 600039:
                            case 600040:
                            case 600041:
                            case 600042:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Help me... Please");
                                                dialog.Option("Who are you?", 1);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                dialog.Text("I am a warrior trapped in these tactics please help me to revive!");
                                                dialog.Option("I have the SoulJade.", 2);
                                                dialog.Option("No.", 3);
                                                dialog.Send();
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Inventory.Contains(721072, 1))
                                                {
                                                    dialog.Text("Thank you! Will you recive my gift of a Moonbox?");
                                                    dialog.Option("Yes.", 3);
                                                    dialog.Option("Not needed.", 4);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("You do not...even so, I shall help you leave this cursed map.");
                                                    dialog.Option("Please get me out of here.", 5);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Inventory.Contains(721072, 1))
                                                {
                                                    client.Inventory.Remove(721072, 1);
                                                    client.Inventory.Add(721080, 0, 1);
                                                    client.Entity.Teleport(1042, 028, 033);
                                                }
                                                break;
                                            }
                                        case 4:
                                            {
                                                client.Inventory.Remove(721072, 1);
                                                client.Entity.Teleport(1042, 028, 033);
                                                break;
                                            }
                                        case 5:
                                            {
                                                client.Entity.Teleport(1042, 028, 033);
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                            #endregion
                        }
                        break;
                    }
                #endregion
                #region Ape Canyon
                case 1020:
                    {
                        switch (client.ActiveNpc)
                        {
                            #region Ape City
                            case 10053:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello " + client.Entity.Name + ", I can send you on your way for just 100 silvers.");
                                                dialog.Text("\nWhere would you like to go?");
                                                dialog.Option("Twin City", 1);
                                                dialog.Option("Market", 2);
                                                dialog.Option("Nevermind", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Money >= 100)
                                                {
                                                    client.Entity.Money -= 100;
                                                    client.Entity.Teleport(1020, 378, 13);
                                                }
                                                else
                                                {
                                                    dialog.Text("You do not have 100 silvers.");
                                                    dialog.Option("Aww!", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Entity.Money >= 100)
                                                {
                                                    client.Entity.Money -= 100;
                                                    client.Entity.Teleport(1036, 211, 196);
                                                }
                                                else
                                                {
                                                    dialog.Text("You do not have 100 silvers.");
                                                    dialog.Option("Aww!", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                            #region Ape Canyon

                            #region Alex
                            case 3600:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("You don't worry, it's not gonna hurt you a bit when getting the third life. You just need an exemption token and it's all going to be fine.");
                                                dialog.Option("Here is the ExemptionToken.", 1);
                                                dialog.Option("I'll just leave", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Reborn == 1)
                                                {
                                                    if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
                                                    {
                                                        dialog.Text("Select the class you want to reborn in.");
                                                        dialog.Option("Trojan.", 11);
                                                        dialog.Option("Warrior.", 21);
                                                        dialog.Option("Archer.", 41);
                                                        dialog.Option("WaterTaoist.", 132);
                                                        dialog.Option("FireTaoist.", 142);
                                                        dialog.Option("Ninja.", 51);
                                                        dialog.Option("Monk.", 61);
                                                        dialog.Option("PirateLord.", 71);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("If you are a water saint you need level 110+, else you need 120+.");
                                                        dialog.Option("I'll just leave", 255);
                                                        dialog.Send();
                                                        break;
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You need to be in the second life to be able to get the third life.");
                                                    dialog.Option("I'll just leave", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                                break;
                                            }
                                        default:
                                            {
                                                if (npcRequest.OptionID == 255)
                                                    return;
                                                if (client.Entity.Reborn == 1)
                                                {
                                                    if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
                                                    {
                                                        if (client.Inventory.Contains(723701, 1))
                                                        {
                                                            if (client.Reborn(npcRequest.OptionID))
                                                            {
                                                                client.Inventory.Remove(723701, 1);
                                                            }
                                                            else
                                                            {
                                                                dialog.Text("You need two free slots in your inventory.");
                                                                dialog.Option("I'll just leave", 255);
                                                                dialog.Send();
                                                                break;
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("If you are a water saint you need level 110+, else you need 120+.");
                                                        dialog.Option("I'll just leave", 255);
                                                        dialog.Send();
                                                        break;
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You need to be in the second life to be able to get the third life.");
                                                    dialog.Option("I'll just leave", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Assistant
                            case 126:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Do you want to visit the mine?");
                                                dialog.Option("Yes.", 1);
                                                dialog.Option("No.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                client.Entity.Teleport(1026, 142, 105);
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #endregion
                        }
                        break;
                    }
                #endregion
                #region PhoenixCastle
                case 1011:
                    {
                        switch (client.ActiveNpc)
                        {
                            #region Phoenix Castle
                            case 10052:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello " + client.Entity.Name + ", I can send you on your way for just 100 silvers.");
                                                dialog.Text("\nWhere would you like to go?");
                                                dialog.Option("Market", 1);
                                                dialog.Option("Twin City", 2);
                                                dialog.Option("Nevermind", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Money >= 100)
                                                {
                                                    client.Entity.Money -= 100;
                                                    client.Entity.Teleport(1036, 211, 196);
                                                }
                                                else
                                                {
                                                    dialog.Text("You do not have 100 silvers.");
                                                    dialog.Option("Aww!", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Entity.Money >= 100)
                                                {
                                                    client.Entity.Money -= 100;
                                                    client.Entity.Teleport(10, 377);
                                                }
                                                else
                                                {
                                                    dialog.Text("You do not have 100 silvers.");
                                                    dialog.Option("Aww!", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                            #region PhoenixCity

                            #region Assistant
                            case 125:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Do you want to visit the mine?");
                                                dialog.Option("Yes.", 1);
                                                dialog.Option("No.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                client.Entity.Teleport(1025, 30, 71);
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #endregion
                        }
                        break;
                    }
                #endregion
                #region DesertCity
                case 1000:
                    {
                        switch (client.ActiveNpc)
                        {
                            #region Desert city
                            case 10051:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello " + client.Entity.Name + ", I can set you on your way for just 100 silver.\n");
                                                dialog.Text("Where would you like to go?");
                                                dialog.Option("Twin City", 1);
                                                dialog.Option("Market", 3);
                                                dialog.Option("Mystic Castle", 2);
                                                dialog.Option("Nevermind.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Money >= 100)
                                                {
                                                    client.Entity.Teleport(1000, 973, 668);
                                                    client.Entity.Money -= 100;
                                                }
                                                else
                                                {
                                                    dialog.Text("You do not have 100 silvers.");
                                                    dialog.Option("Aww!", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Entity.Money >= 100)
                                                {
                                                    client.Entity.Teleport(1000, 80, 320);
                                                    client.Entity.Money -= 100;
                                                }
                                                else
                                                {
                                                    dialog.Text("You do not have 100 silvers.");
                                                    dialog.Option("Aww!", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Entity.Money >= 100)
                                                {
                                                    client.Entity.Teleport(1036, 211, 196);
                                                    client.Entity.Money -= 100;
                                                }
                                                else
                                                {
                                                    dialog.Text("You do not have 100 silvers.");
                                                    dialog.Option("Aww!", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                            #region DesertCity
                            #region Assistant
                            case 127:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Do you want to visit the mine?");
                                                dialog.Option("Yes.", 1);
                                                dialog.Option("No.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                client.Entity.Teleport(1027, 142, 105);
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                            #endregion
                        }
                        break;
                    }
                #endregion
                #region Bird Village
                case 1015:
                    {
                        switch (client.ActiveNpc)
                        {
                            #region Bird Island
                            case 10056:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello " + client.Entity.Name + ", I can send you on your way for just 100 silvers.");
                                                dialog.Text("\nWhere would you like to go?");
                                                dialog.Option("Twin City", 1);
                                                dialog.Option("Market", 2);
                                                dialog.Option("Nevermind", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Money >= 100)
                                                {
                                                    client.Entity.Money -= 100;
                                                    client.Entity.Teleport(1015, 1015, 710);
                                                }
                                                else
                                                {
                                                    dialog.Text("You do not have 100 silvers.");
                                                    dialog.Option("Aww!", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Entity.Money >= 100)
                                                {
                                                    client.Entity.Money -= 100;
                                                    client.Entity.Teleport(1036, 211, 196);
                                                }
                                                else
                                                {
                                                    dialog.Text("You do not have 100 silvers.");
                                                    dialog.Option("Aww!", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                            #region Bird Village

                            #region ArtisanOu
                            case 41:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello there my friend. I am here to make your socket your weapon. With a socketed weapon you can add gems inside of the sockets and the gems will give you some extra stats. For the first socket I demand 1 DragonBall and for the second one I demand 5 dragonballs.");
                                                dialog.Option("Alright let's go on.", 1);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (!client.Equipment.Free(4))
                                                {
                                                    Conquer_Online_Server.Interfaces.IConquerItem Item = null;
                                                    Item = client.Equipment.TryGetItem(4);
                                                    if (Item.SocketOne == Conquer_Online_Server.Game.Enums.Gem.NoSocket)
                                                    {
                                                        dialog.Text("My friend I need one DragonBall to socket your weapon. Are you sure you want to do this?");
                                                        dialog.Option("Yea sure.", 2);
                                                        dialog.Send();
                                                    }
                                                    else if (Item.SocketTwo == Conquer_Online_Server.Game.Enums.Gem.NoSocket)
                                                    {
                                                        dialog.Text("My friend I need five dragonballs to socket your weapon. Are you sure you want to do this?");
                                                        dialog.Option("Yea sure.", 2);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("I can't socket this weapon once more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You need to wear the weapon first.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (!client.Equipment.Free(4))
                                                {
                                                    Conquer_Online_Server.Interfaces.IConquerItem Item = null;
                                                    Item = client.Equipment.TryGetItem(4);
                                                    if (Item.SocketOne == Conquer_Online_Server.Game.Enums.Gem.NoSocket)
                                                    {
                                                        if (client.Inventory.Contains(1088000, 1))
                                                        {
                                                            client.Inventory.Remove(1088000, 1);
                                                            Item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                            Item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                            Item.Send(client);
                                                            Conquer_Online_Server.Database.ConquerItemTable.UpdateSockets(Item, client);
                                                            dialog.Text("Done!");
                                                            dialog.Option("Thank you.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You don't have one DragonBall!");
                                                            dialog.Option("Ah...", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else if (Item.SocketTwo == Conquer_Online_Server.Game.Enums.Gem.NoSocket)
                                                    {
                                                        if (client.Inventory.Contains(1088000, 5))
                                                        {
                                                            client.Inventory.Remove(1088000, 5);
                                                            Item.SocketTwo = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                            Item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                            Item.Send(client);
                                                            Conquer_Online_Server.Database.ConquerItemTable.UpdateSockets(Item, client);
                                                            dialog.Text("Done!");
                                                            dialog.Option("Thank you.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You don't have one DragonBall!");
                                                            dialog.Option("Ah...", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You need to wear the weapon first.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #endregion
                        }
                        break;
                    }
                #endregion
                #region Market
                case 1036:
                    {
                        switch (client.ActiveNpc)
                        {
                            #region Market

                            #region Shelby
                            case 300000:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("I have here the list with the virtue of all the people in this world. You have so far " + client.VirtuePoints + " virtue points.");
                                                dialog.Option("Thank you.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region LadyLuck
                            case 923:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                if (client.InLottery)
                                                {
                                                    dialog.Text("My friend, did something happen to you?\nYou may still want to try your luck since you already paid me the fee.");
                                                    dialog.Option("Alright, take me in.", 2);
                                                    dialog.Option("Later...", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("Hello my friend. Have you ever heard of the lottery?\nWell, my friend, to join the lottery you need 27 ConquerPoints. By entering the lottery you'll gain a big chance to win wonderful items, wonderful and very expensive.\n\nWhat do you say, would you like to join?\n");
                                                    dialog.Option("Alright, take me in.", 1);
                                                    dialog.Option("Later...", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Level >= 70)
                                                {
                                                    if (client.LotteryEntries < 10)
                                                    {
                                                        if (client.Entity.ConquerPoints >= 27)
                                                        {
                                                            client.Entity.ConquerPoints -= 27;
                                                            client.InLottery = true;
                                                            client.LotteryEntries++;
                                                            client.Entity.Teleport(700, 42, 50);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You may not join the lottery today. You have already tried it 10 times today.");
                                                        dialog.Option("Ahh sorry.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You may not join the lottery , you need level 70 first.");
                                                    dialog.Option("Ahh sorry.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.InLottery)
                                                {
                                                    client.Entity.Teleport(700, 42, 50);
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Realloter
                            case 350050:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello there brave conqueror, if you have reborn, and you misplaced your atribute points or you want to set them another way, I'll reset your atribute points for one DragonBall. Do you accept?");
                                                dialog.Option("Here is the DragonBall.", 1);
                                                dialog.Option("I'll just leave", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Reborn > 0)
                                                {
                                                    if (client.Inventory.Contains(1088000, 1))
                                                    {
                                                        client.Inventory.Remove(1088000, 1);
                                                        if (client.Entity.Reborn != 0)
                                                        {
                                                            client.Entity.Agility = 0;
                                                            client.Entity.Strength = 0;
                                                            client.Entity.Vitality = 1;
                                                            client.Entity.Spirit = 0;
                                                            if (client.Entity.Reborn == 1)
                                                            {
                                                                client.Entity.Atributes = (ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornLevel, client.Entity.FirstRebornLevel)
                                                                    + 52 + 3 * (client.Entity.Level - 15));
                                                            }
                                                            else
                                                            {
                                                                client.Entity.Atributes = (ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornLevel, client.Entity.FirstRebornClass) +
                                                                    client.ExtraAtributePoints(client.Entity.SecondRebornLevel, client.Entity.SecondRebornClass) + 52 + 3 * (client.Entity.Level - 15));
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need a DragonBall.");
                                                        dialog.Option("I'll just leave", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You have to have atleast one rebirth atleast.");
                                                    dialog.Option("I'll just leave", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Magic Artisan
                            case 9071:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Have you ever seen my brother Artisan Wind? If so, you might know that he upgrades and downgrades the item level and item quality.");
                                                dialog.Text("Well, he doesn't always succeed, but that's why I am here. I can upgrade/downgrade being sucessfully with a fixed amount of meteors (tears)/dragonballs. ");
                                                dialog.Text("What would you like me to do?");
                                                dialog.Option("Upgrade level.", 1);
                                                dialog.Option("Downgrade level.", 2);
                                                dialog.Option("Upgrade quality.", 3);
                                                dialog.Option("I'll just leave", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                        case 2:
                                        case 3:
                                            {
                                                int aut = npcRequest.OptionID * 10;
                                                dialog.Text("Select which item's details you want to change?");
                                                dialog.Option("Headgear.", (byte)(aut + 1));
                                                dialog.Option("Necklace.", (byte)(aut + 2));
                                                dialog.Option("Armor.", (byte)(aut + 3));
                                                dialog.Option("Main Weapon.", (byte)(aut + 4));
                                                dialog.Option("Left Weapon/Shield.", (byte)(aut + 5));
                                                dialog.Option("Ring.", (byte)(aut + 6));
                                                dialog.Option("Boots.", (byte)(aut + 8));
                                                dialog.Option("I'll just leave", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 100:
                                            {
                                                if (client.SelectedItem == 0)
                                                    return;
                                                var item = client.Equipment.TryGetItem(client.SelectedItem);
                                                var itemdetail = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
                                                Conquer_Online_Server.Database.ConquerItemInformation infos = new Conquer_Online_Server.Database.ConquerItemInformation(item.ID, item.Plus);
                                                switch (client.UpdateType)
                                                {
                                                    case 1:
                                                    case 2:
                                                        {
                                                            //Cost: 36
                                                            //Metscrolls: 4
                                                            byte cost = (byte)(itemdetail.Level / 5);
                                                            byte scrolls = 0;
                                                            bool useScrolls = false;
                                                            byte extraScroll = 0;
                                                            int addMets = 0;
                                                            cost += (byte)((item.ID % 10) / 3);
                                                            cost += (byte)(itemdetail.Level / 10);
                                                            uint id = 1088001;
                                                            if (client.UpdateType == 2)
                                                                id++;
                                                            foreach (IConquerItem scroll in client.Inventory.Objects)
                                                                if (scroll.ID == 720027)
                                                                    scrolls++;
                                                            if (cost % 10 != 0)
                                                            {
                                                                addMets = 10 - (cost % 10);
                                                                extraScroll = 1;
                                                            }
                                                            if (scrolls >= (cost / 10) + extraScroll)
                                                                useScrolls = true;

                                                            if (client.Inventory.Contains(id, cost) || useScrolls)
                                                            {
                                                                if (useScrolls)
                                                                {
                                                                    client.Inventory.Remove(720027, Convert.ToByte((cost / 10) + extraScroll));
                                                                    client.Inventory.Add(1088001, 0, (byte)addMets);
                                                                }
                                                                else
                                                                    client.Inventory.Remove(id, cost);
                                                                client.UnloadItemStats(item, false);
                                                                if (client.UpdateType == 1)
                                                                {
                                                                    Conquer_Online_Server.Database.ConquerItemInformation infos2 = new Conquer_Online_Server.Database.ConquerItemInformation(infos.CalculateUplevel(), item.Plus);
                                                                    if (infos2.BaseInformation.ID == infos.BaseInformation.ID)
                                                                        return;
                                                                    if (client.Entity.Level < infos2.BaseInformation.Level)
                                                                    {
                                                                        dialog.Text("You need level " + infos2.BaseInformation.Level + " first.");
                                                                        dialog.Option("Ahh sorry.", 255);
                                                                        dialog.Send();
                                                                        client.SelectedItem = 0;
                                                                        client.UpdateType = 0;
                                                                        return;
                                                                    }
                                                                    item.ID = infos.CalculateUplevel();
                                                                }
                                                                else
                                                                    item.ID = infos.CalculateDownlevel();

                                                                Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
                                                                item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                                item.Send(client);
                                                                client.LoadItemStats(item);
                                                                client.Equipment.UpdateEntityPacket();
                                                            }
                                                            break;
                                                        }
                                                    case 3:
                                                        {
                                                            byte cost = (byte)(itemdetail.Level / 30);
                                                            cost += (byte)((item.ID % 10) / 2);
                                                            uint id = 1088000;

                                                            if (client.Inventory.Contains(id, cost))
                                                            {
                                                                client.Inventory.Remove(id, cost);
                                                                client.UnloadItemStats(item, false);
                                                                if (item.ID % 10 < 5)
                                                                    item.ID += 5 - item.ID % 10;
                                                                item.ID++;
                                                                Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
                                                                item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                                item.Send(client);
                                                                client.LoadItemStats(item);
                                                                client.Equipment.UpdateEntityPacket();
                                                            }
                                                            break;
                                                        }
                                                }
                                                break;
                                            }
                                        default:
                                            {
                                                if (npcRequest.OptionID == 255)
                                                    break;
                                                client.SelectedItem = (byte)(npcRequest.OptionID % 10);
                                                client.UpdateType = (byte)(npcRequest.OptionID / 10);
                                                if (client.Equipment.Free(client.SelectedItem))
                                                {
                                                    dialog.Text("You have to be wearing the selected item.");
                                                    dialog.Option("I'll just leave", 255);
                                                    dialog.Send();
                                                    return;
                                                }
                                                var item = client.Equipment.TryGetItem(client.SelectedItem);
                                                var itemdetail = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
                                                if (itemdetail == null)
                                                {
                                                    dialog.Text("An error occured. Please relogin and try again.");
                                                    dialog.Option("Ok.", 255);
                                                    dialog.Send();
                                                    return;
                                                }
                                                switch (client.UpdateType)
                                                {
                                                    case 1:
                                                    case 2:
                                                        {
                                                            if (itemdetail.Level == Conquer_Online_Server.Network.PacketHandler.ItemMaxLevel(client.SelectedItem) && client.UpdateType == 1)
                                                            {
                                                                dialog.Text("This item's level cannot be upgraded anymore.");
                                                                dialog.Option("Ahh sorry.", 255);
                                                                dialog.Send();
                                                                client.SelectedItem = 0;
                                                                client.UpdateType = 0;
                                                                return;
                                                            }
                                                            if (itemdetail.Level == Conquer_Online_Server.Network.PacketHandler.ItemMinLevel(client.SelectedItem) && client.UpdateType == 2)
                                                            {
                                                                dialog.Text("This item's level cannot be downgraded anymore.");
                                                                dialog.Option("Ahh sorry.", 255);
                                                                dialog.Send();
                                                                client.SelectedItem = 0;
                                                                client.UpdateType = 0;
                                                                return;
                                                            }
                                                            byte cost = (byte)(itemdetail.Level / 5);
                                                            cost += (byte)((item.ID % 10) / 3);
                                                            cost += (byte)(itemdetail.Level / 10);
                                                            dialog.Text("It will cost you " + cost + " meteor" + (client.UpdateType == 2 ? " tears" : "s") + ". Do you accept?");
                                                            dialog.Option("Yes.", 100);
                                                            dialog.Option("No thank you.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                    case 3:
                                                        {
                                                            if (item.ID % 10 == 9)
                                                            {
                                                                dialog.Text("This item's quality cannot be upgraded anymore.");
                                                                dialog.Option("Ahh sorry.", 255);
                                                                dialog.Send();
                                                                client.SelectedItem = 0;
                                                                client.UpdateType = 0;
                                                                return;
                                                            }
                                                            byte cost = (byte)(itemdetail.Level / 30);
                                                            cost += (byte)((item.ID % 10) / 2);
                                                            dialog.Text("It will cost you " + cost + " dragonballs. Do you accept?");
                                                            dialog.Option("Yes.", 100);
                                                            dialog.Option("No thank you.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                }

                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Weapon Master
                            case 7050:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("My brothers, Magic Artisan and Artisan Wind, both need meteors to upgrade, but I need only dragonballs.");
                                                dialog.Text("I upgrade item's level only and I want  only one dragonball for my service.");
                                                dialog.Option("Upgrade level.", 1);
                                                dialog.Option("I'll just leave", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                int aut = npcRequest.OptionID * 10;
                                                dialog.Text("Select which item's details you want to change?");
                                                dialog.Option("Headgear.", (byte)(aut + 1));
                                                dialog.Option("Necklace.", (byte)(aut + 2));
                                                dialog.Option("Armor.", (byte)(aut + 3));
                                                dialog.Option("Main Weapon.", (byte)(aut + 4));
                                                dialog.Option("Left Weapon/Shield.", (byte)(aut + 5));
                                                dialog.Option("Ring.", (byte)(aut + 6));
                                                dialog.Option("Boots.", (byte)(aut + 8));
                                                dialog.Option("I'll just leave", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 100:
                                            {
                                                if (client.SelectedItem == 0)
                                                    return;
                                                var item = client.Equipment.TryGetItem(client.SelectedItem);
                                                var itemdetail = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
                                                Conquer_Online_Server.Database.ConquerItemInformation infos = new Conquer_Online_Server.Database.ConquerItemInformation(item.ID, item.Plus);
                                                switch (client.UpdateType)
                                                {
                                                    case 1:
                                                    case 2:
                                                        {

                                                            byte cost = (byte)(itemdetail.Level / 6);
                                                            cost += (byte)((item.ID % 10) / 3);
                                                            uint id = 1088001;
                                                            if (client.UpdateType == 2)
                                                                id++;
                                                            if (client.Inventory.Contains(id, cost))
                                                            {
                                                                client.Inventory.Remove(id, cost);
                                                                client.UnloadItemStats(item, false);
                                                                if (client.UpdateType == 1)
                                                                    item.ID = infos.CalculateUplevel();
                                                                else
                                                                    item.ID = infos.CalculateDownlevel();
                                                                if (infos.BaseInformation.ID == item.ID)
                                                                    return;
                                                                Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
                                                                item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                                item.Send(client);
                                                                client.LoadItemStats(item);
                                                                client.Equipment.UpdateEntityPacket();
                                                            }
                                                            break;
                                                        }
                                                    case 3:
                                                        {
                                                            byte cost = (byte)(itemdetail.Level / 30);
                                                            cost += (byte)((item.ID % 10) / 2);
                                                            uint id = 1088000;

                                                            if (client.Inventory.Contains(id, cost))
                                                            {
                                                                client.Inventory.Remove(id, cost);
                                                                client.UnloadItemStats(item, false);
                                                                item.ID++;
                                                                Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
                                                                item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                                item.Send(client);
                                                                client.LoadItemStats(item);
                                                                client.Equipment.UpdateEntityPacket();
                                                            }
                                                            break;
                                                        }
                                                }
                                                break;
                                            }
                                        default:
                                            {
                                                if (npcRequest.OptionID == 255)
                                                    break;
                                                byte SelectedItem = (byte)(npcRequest.OptionID % 10);
                                                byte NowType = (byte)(npcRequest.OptionID / 10);
                                                if (client.Equipment.Free(SelectedItem))
                                                {
                                                    dialog.Text("You have to be wearing the selected item.");
                                                    dialog.Option("I'll just leave", 255);
                                                    dialog.Send();
                                                    return;
                                                }
                                                var item = client.Equipment.TryGetItem(SelectedItem);
                                                var itemdetail = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
                                                ConquerItemInformation infos3 = new ConquerItemInformation(item.ID, item.Plus);
                                                ConquerItemInformation infos23;// = new ConquerItemInformation(Item.ID, Item.Plus);
                                                uint n = infos3.CalculateUplevel();
                                                infos23 = new ConquerItemInformation(n, item.Plus);
                                                if (infos3.BaseInformation.Level == PacketHandler.ItemMaxLevel(PacketHandler.ItemPosition(infos3.BaseInformation.ID)))
                                                {
                                                    dialog.Text("This item is already at maximum level!");
                                                    dialog.Link("Alright", 255);
                                                    dialog.Avatar(50);
                                                    dialog.Send();
                                                    return;
                                                }

                                                //if (itemdetail.Level == Conquer_Online_Server.Network.PacketHandler.ItemMaxLevel(client.SelectedItem) && client.UpdateType == 1)
                                                //{
                                                //    dialog.Text("This item's level cannot be upgraded anymore.");
                                                //    dialog.Option("Ahh sorry.", 255);
                                                //    dialog.Send();
                                                //    client.SelectedItem = 0;
                                                //    client.UpdateType = 0;
                                                //    return;
                                                //}
                                                if (NowType == 1)
                                                {
                                                    dialog.Text("It will cost you one dragonball. Do you accept?");
                                                    dialog.Option("Yes.", (byte)(20 + SelectedItem));
                                                    dialog.Option("No thank you.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    Conquer_Online_Server.Database.ConquerItemInformation infos = new Conquer_Online_Server.Database.ConquerItemInformation(item.ID, item.Plus);
                                                    Conquer_Online_Server.Database.ConquerItemInformation infos2 = new Conquer_Online_Server.Database.ConquerItemInformation(infos.CalculateUplevel(), item.Plus);
                                                    if (client.Entity.Level < infos2.BaseInformation.Level)
                                                    {
                                                        dialog.Text("You need level " + infos2.BaseInformation.Level + " first.");
                                                        dialog.Option("Ahh sorry.", 255);
                                                        dialog.Send();
                                                        client.SelectedItem = 0;
                                                        client.UpdateType = 0;
                                                        return;
                                                    }
                                                    if (client.Inventory.Contains(1088000, 1))
                                                    {
                                                        client.Inventory.Remove(1088000, 1);
                                                        client.UnloadItemStats(item, false);
                                                        item.ID = infos.CalculateUplevel();
                                                        Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
                                                        item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                        item.Send(client);
                                                        client.LoadItemStats(item);
                                                        client.Equipment.UpdateEntityPacket();
                                                    }
                                                }
                                            }
                                            break;
                                    }
                                    break;
                                }
                            #endregion

                            #region Proficiency God
                            case 26678:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello my friend. If you believe that, leveling your proficiency is too hard and takes too much time, I can help you. In exchange of a fixed amount of exp balls, I will agree to level up your proficiency.");
                                                dialog.Text("Now, tell me what proficiency you want to level up.");
                                                dialog.Option("One handed.", 1);
                                                dialog.Option("Two handed.", 3);
                                                dialog.Option("Other.", 5);
                                                dialog.Option("I'll just leave", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                dialog.Text("Which one handed proficiency?");
                                                dialog.Option("Blade.", 41);
                                                dialog.Option("Sword.", 42);
                                                dialog.Option("Hook.", 43);
                                                dialog.Option("Whip.", 44);
                                                dialog.Option("Axe.", 45);
                                                dialog.Option("Next page.", 2);
                                                dialog.Option("Nothing, sorry.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 2:
                                            {
                                                dialog.Text("Which one handed proficiency?");
                                                dialog.Option("PrayerBead.", 61);
                                                dialog.Option("Hammer.", 46);
                                                dialog.Option("Club.", 48);
                                                dialog.Option("Scepter.", 184);
                                                dialog.Option("Katana.", 60);
                                                dialog.Option("Axe.", 45);
                                                dialog.Option("Back.", 1);
                                                dialog.Option("Nothing, sorry.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 3:
                                            {
                                                dialog.Text("Which two handed proficiency?");
                                                dialog.Option("Backsword.", 124);
                                                dialog.Option("Glaive.", 51);
                                                dialog.Option("Poleaxe.", 53);
                                                dialog.Option("LongHammer.", 54);
                                                dialog.Option("Spear.", 56);
                                                dialog.Option("Next page.", 4);
                                                dialog.Option("Nothing, sorry.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 4:
                                            {
                                                dialog.Text("Which one handed proficiency?");
                                                dialog.Option("Pickaxe.", 142);
                                                dialog.Option("Halberd.", 58);
                                                dialog.Option("Wand.", 165);
                                                dialog.Option("Bow.", 50);
                                                dialog.Option("Back.", 3);
                                                dialog.Option("Nothing, sorry.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 5:
                                            {
                                                dialog.Text("Which one handed proficiency?");
                                                dialog.Option("Boxing.", 254);
                                                dialog.Option("Shield.", 90);
                                                dialog.Option("Nothing, sorry.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 100:
                                            {
                                                if (client.Proficiencies.ContainsKey(client.UplevelProficiency))
                                                {
                                                    var prof = client.Proficiencies[client.UplevelProficiency];
                                                    if (prof.Level >= 12)
                                                    {
                                                        dialog.Text("This proficiency cannot be leveled up anymore.");
                                                        dialog.Option("Oh.", 255);
                                                        dialog.Send();
                                                        break;
                                                    }
                                                    client.UplevelProficiency = 0;
                                                    if (client.Inventory.Contains(723700, prof.Level))
                                                    {
                                                        client.Inventory.Remove(723700, prof.Level);
                                                        prof.Level++;
                                                        prof.Experience = 0;
                                                        prof.Send(client);
                                                        break;
                                                    }
                                                    dialog.Text("You don't have the requiered exp balls, I'm sorry I cannot help you.");
                                                    dialog.Option("It's alright.", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't know this proficiency.");
                                                    dialog.Option("Ahh, sorry.", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        default:
                                            {
                                                if (npcRequest.OptionID == 255)
                                                    return;
                                                ushort proficiency = 0;
                                                if (npcRequest.OptionID < 100)
                                                    proficiency = (ushort)(npcRequest.OptionID * 10);
                                                else
                                                {
                                                    if (npcRequest.OptionID != 254)
                                                    {
                                                        string off = npcRequest.OptionID.ToString();
                                                        string reverse = off[2].ToString() + off[1].ToString() + off[0].ToString();
                                                        proficiency = ushort.Parse(reverse);
                                                    }
                                                }
                                                if (proficiency == 600) proficiency++;
                                                if (client.Proficiencies.ContainsKey(proficiency))
                                                {
                                                    var prof = client.Proficiencies[proficiency];
                                                    if (prof.Level >= 12)
                                                    {
                                                        dialog.Text("This proficiency cannot be leveled up anymore.");
                                                        dialog.Option("Oh.", 255);
                                                        dialog.Send();
                                                        break;
                                                    }
                                                    client.UplevelProficiency = proficiency;
                                                    dialog.Text("I need " + prof.Level + " exp balls to be able to level up this proficiency.");
                                                    dialog.Option("Let's do it then.", 100);
                                                    dialog.Option("No, sorry.", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't know this proficiency.");
                                                    dialog.Option("Ahh, sorry.", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region CPAdmin
                            case 111816:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Greetings, here you can exchange either a Dragonball or a DragonScroll for cps. ");
                                                dialog.Text("One Dragonball will get you 215 cps and a DragonScroll will get you 2150. ");
                                                dialog.Text("What would you like to trade? Or would you rather not?");
                                                dialog.Option("Dragonball", 1);
                                                dialog.Option("DragonballScroll", 2);
                                                dialog.Option("I'll just leave", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Inventory.Contains(1088000, 1))
                                                {
                                                    client.Inventory.Remove(1088000, 1);
                                                    client.Entity.ConquerPoints += 215;
                                                }
                                                else
                                                {
                                                    dialog.Text("You do not have a Dragonball");
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Inventory.Contains(720028, 1))
                                                {
                                                    client.Inventory.Remove(720028, 1);
                                                    client.Entity.ConquerPoints += 2150;
                                                }
                                                else
                                                {
                                                    dialog.Text("You do not have a DragonballScroll");
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region SurgeonMiracle
                            case 3381:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Do you want to have your size changed so that you can become much more");
                                                dialog.Text(" adorable? Now here is a precious chance for you.");
                                                dialog.Option("I want to change my size.", 1);
                                                //dialog.Option("I want to change my gender.", 2);
                                                dialog.Option("I don't want to change.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                dialog.Text("If you pay me one DragonBall, I can have your size changed. You will become");
                                                dialog.Text("more attractive and start a fresh life. By the way, to avoid some unexpected");
                                                dialog.Text("things, make sure you are not in any disguise form.");
                                                dialog.Option("Here is a DragonBall.", 3);
                                                dialog.Option("I have no DragonBall.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 2:
                                            {
                                                dialog.Text("If you pay me one DragonBall, I can have your gender changed. You will become");
                                                dialog.Text("more attractive and start a fresh life. By the way, to avoid some unexpected");
                                                dialog.Text("things, make sure you are not in any disguise form.");
                                                dialog.Option("Here is a DragonBall.", 4);
                                                dialog.Option("I have no DragonBall.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Inventory.Contains(1088000, 1))
                                                {
                                                    int Model = (int)client.Entity.Body % 10;
                                                    switch (Model)
                                                    {
                                                        case 2:
                                                        case 4:
                                                            client.Entity.Body--;
                                                            break;
                                                        case 1:
                                                        case 3:
                                                            client.Entity.Body++;
                                                            break;
                                                    }

                                                    client.Inventory.Remove(1088000, 1);
                                                    break;
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, there is no DragonBall in your inventory. I can't have your size changed.");
                                                    dialog.Option("Ok, Sorry.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 4:
                                            {
                                                if (client.Inventory.Contains(1088000, 1))
                                                {
                                                    int Model = (int)client.Entity.Body % 10;
                                                    switch (Model)
                                                    {
                                                        case 3:
                                                        case 4:
                                                            client.Entity.Body -= 2;
                                                            break;
                                                        case 1:
                                                        case 2:
                                                            client.Entity.Body += 2;
                                                            break;
                                                    }
                                                    client.Send(new Message("Your gender has been changed.", System.Drawing.Color.BurlyWood, Message.TopLeft));
                                                    client.Inventory.Remove(1088000, 1);
                                                    break;
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, there is no DragonBall in your inventory. I can't have your size changed.");
                                                    dialog.Option("Ok, Sorry.", 255);
                                                    dialog.Send();
                                                }
                                            }
                                            break;
                                    }
                                    break;
                                }
                            #endregion

                            #region Mark. Controler
                            case 45: //Mark. Controler
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("If you want to leave just tell me when you are ready. It's free.\nYou will be teleported to the city you were in before coming here.");
                                                dialog.Option("I'm ready.", 1);
                                                dialog.Option("Wait a minute.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                int PrevMap = client.Entity.PreviousMapID;
                                                switch (PrevMap)
                                                {
                                                    default:
                                                        {
                                                            client.Entity.Teleport(1002, 429, 378);
                                                            break;
                                                        }
                                                    case 1000:
                                                        {
                                                            client.Entity.Teleport(1000, 500, 650);
                                                            break;
                                                        }
                                                    case 1020:
                                                        {
                                                            client.Entity.Teleport(1020, 565, 562);
                                                            break;
                                                        }
                                                    case 1011:
                                                        {
                                                            client.Entity.Teleport(1011, 188, 264);
                                                            break;
                                                        }
                                                    case 1015:
                                                        {
                                                            client.Entity.Teleport(1015, 717, 571);
                                                            break;
                                                        }
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Enchanter and composer
                            case 35016:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("I can improve the enchant of an item and I can also improve the plus of an item. Please let me know how can I help you.");
                                                dialog.Option("Compose.", 1);
                                                dialog.Option("Enchant.", 2);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                Data data = new Data(true);
                                                data.ID = Data.OpenWindow;
                                                data.UID = client.Entity.UID;
                                                data.TimeStamp = Time32.Now;
                                                data.dwParam = Data.WindowCommands.Compose;
                                                data.wParam1 = client.Entity.X;
                                                data.wParam2 = client.Entity.Y;
                                                client.Send(data);
                                                break;
                                            }
                                        case 2:
                                            {
                                                Data data = new Data(true);
                                                data.ID = Data.OpenCustom;
                                                data.UID = client.Entity.UID;
                                                data.TimeStamp = Time32.Now;
                                                data.dwParam = Data.CustomCommands.Enchant;
                                                data.wParam1 = client.Entity.X;
                                                data.wParam2 = client.Entity.Y;
                                                client.Send(data);
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Bless
                            case 35015:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello there mate. I am here to add to your item a very precious element that will make your item more powerful and also more expensive. Each bless point ( - ) gives you 1% less damage. For -1 you need five Super tortoise gems(STG) or you can gain in through first reborn. For -3 you need one STGs, for -5 you need three STGs and for -7 you five STGs. Do you want to go on?");
                                                dialog.Option("Okay let's roll.", 1);
                                                dialog.Option("It's too expensive.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        #region Bless NPc]
                                        case 1:
                                            {
                                                Network.GamePackets.Data Data = new Network.GamePackets.Data(true);
                                                Data.UID = client.Entity.UID;
                                                Data.ID = 126;
                                                Data.dwParam = 426;
                                                Data.wParam1 = client.Entity.X;
                                                Data.wParam2 = client.Entity.Y;
                                                client.Send(Data);
                                                break;
                                            }
                                        #endregion

                                    }
                                    break;
                                }
                            #endregion

                            #region BlacksmithLee
                            case 1550:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            client.Send(new Data(true) { UID = client.Entity.UID, ID = Data.OpenWindow, dwParam = Data.WindowCommands.OpenSockets, wParam1 = client.Entity.X, wParam2 = client.Entity.Y });
                                            break;
                                    }
                                    break;
                                }
                            #endregion

                            #region UnknownMan
                            case 3825:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello stranger. My mother tough me not to talk with strangers but I feel like I can talk with you. There is something special to you. Since I feel like I can trust you I can make you a service. If your level is below 110, I will give you a lot of exp in exchange of one DragonBall, but if your level is above or equal to 110 I will demand two DragonBalls. If your level is higher than 135, well then, I can't help you. If you are interested in my proposition and if you have DragonBalls, please let me know.");
                                                dialog.Option("Yes I do.", 1);
                                                dialog.Option("No, not really.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Level >= 135)
                                                {
                                                    dialog.Text("I am sorry, your level is too high. I simply can't help you.");
                                                    dialog.Option("Sorry.", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                                if (DateTime.Now.DayOfYear != client.LastDragonBallUse.DayOfYear)
                                                {
                                                    byte needTimes = 1;
                                                    ulong exp_reward = 13901336;//default for level 50 or lower
                                                    #region exp reward switch
                                                    byte level = client.Entity.Level;
                                                    if (level > 50 && level < 63)
                                                        exp_reward = 27152909;
                                                    if (level >= 63 && level < 69)
                                                        exp_reward = 28860143;
                                                    if (level >= 69 && level < 74)
                                                        exp_reward = 36822370;
                                                    if (level >= 74 && level < 79)
                                                        exp_reward = 57533091;
                                                    if (level >= 79 && level < 87)
                                                        exp_reward = 70404048;
                                                    if (level >= 87 && level < 90)
                                                        exp_reward = 84097242;
                                                    if (level >= 90 && level < 93)
                                                        exp_reward = 102959118;
                                                    if (level >= 93 && level < 96)
                                                        exp_reward = 134266326;
                                                    if (level >= 96 && level < 98)
                                                        exp_reward = 100801220;
                                                    if (level >= 98 && level <= 100)
                                                        exp_reward = 214351925;

                                                    if (level > 100)
                                                    {
                                                        switch (level)
                                                        {
                                                            case 101: exp_reward = 242910783; break;
                                                            case 102: exp_reward = 286050512; break;
                                                            case 103: exp_reward = 259627544; break;
                                                            case 104: exp_reward = 232767237; break;
                                                            case 105: exp_reward = 241888762; break;
                                                            case 106: exp_reward = 249478280; break;
                                                            case 107: exp_reward = 265126887; break;
                                                            case 108: exp_reward = 187446887; break;
                                                            case 109: exp_reward = 193715970; break;
                                                            case 110: exp_reward = 204416075; break;
                                                            case 111: exp_reward = 227337342; break;
                                                            case 112: exp_reward = 230562942; break;
                                                            case 113: exp_reward = 234594942; break;
                                                            case 114: exp_reward = 238626942; break;
                                                            case 115: exp_reward = 240239742; break;
                                                            case 116: exp_reward = 242658942; break;
                                                            case 117: exp_reward = 246690942; break;
                                                            case 118: exp_reward = 290290023; break;
                                                            case 119: exp_reward = 358712493; break;
                                                            case 120: exp_reward = 282274058; break;
                                                            case 121: exp_reward = 338728870; break;
                                                            case 122: exp_reward = 243884786; break;
                                                            case 123: exp_reward = 292661743; break;
                                                            case 124: exp_reward = 322122547; break;
                                                            case 125: exp_reward = 292661744; break;
                                                            case 126: exp_reward = 351194092; break;
                                                            case 127: exp_reward = 337146328; break;
                                                            case 128: exp_reward = 303431696; break;
                                                            case 129: exp_reward = 322122547; break;
                                                        }
                                                    }
                                                    #endregion
                                                    if (client.Entity.Level >= 110) { needTimes = 2; }
                                                    if (client.Entity.Level >= 130) { needTimes += 8; }
                                                    if (client.Entity.Level >= 135)
                                                    {
                                                        dialog.Text("I can't help you anymore, you're too high leveled!");
                                                        dialog.Option("I see, Thanks!", 255);
                                                        break;
                                                    }
                                                    if (client.Inventory.Contains(1088000, needTimes))
                                                    {
                                                        client.Inventory.Remove(1088000, needTimes);
                                                        client.IncreaseExperience(exp_reward, false);
                                                        client.LastDragonBallUse = DateTime.Now;
                                                        dialog.Text("Congratulations! You've received a lot of experience from me today, enjoy!");
                                                        dialog.Text("I'll see you only tomorrow now.");
                                                        dialog.Option("I see, Thanks!", 255);
                                                        break;
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("I am sorry, but obviously you want to scam me out because you don't have the amount of required DragonBalls.");
                                                        dialog.Option("Sorry.", 255);
                                                        dialog.Send();
                                                        break;
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I am sorry, but I remeber that I gave you this opportunity already today. I can't do it more than once per day so I'm afraid I have to tell you good bye until tomorrow.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region LoveStone
                            case 390:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello mate, how do you do? Listen, There are not many people that can make a marriage last, but I can sense that you are one of them, if you want to marry someone just let me know. Also, if you are heavenly blessed I can give you one hour of double exp each day.");
                                                dialog.Option("Yes, I want to marry someone.", 1);
                                                dialog.Option("I need double exp.", 2);
                                                dialog.Option("Nothing thank you.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Spouse == "None")
                                                {
                                                    dialog.Text("Here, click on the player you want to be your spouse.");
                                                    dialog.Option("Thank you.", 255);
                                                    dialog.Send();
                                                    Data data = new Data(true);
                                                    data.UID = client.Entity.UID;
                                                    data.ID = Data.OpenCustom;
                                                    data.dwParam = Data.CustomCommands.FlowerPointer;
                                                    client.Send(data);
                                                }
                                                else
                                                {
                                                    dialog.Text("You are already married. If you want to broke the marriage, you have to go to StarLit. He'll handle your request.");
                                                    dialog.Option("Alright that's what I'll do.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Entity.HeavenBlessing > 0)
                                                {
                                                    if (!client.DoubleExpToday)
                                                    {
                                                        dialog.Text("Here. Come back tomorrow for more.");
                                                        dialog.Option("Alright that's what I'll do.", 255);
                                                        dialog.Send();

                                                        client.Entity.DoubleExperienceTime = 3600;
                                                        client.DoubleExpToday = true;
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You already took your double exp today. Come back tomorrow.");
                                                        dialog.Option("Alright that's what I'll do.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot take double exp because you are not heavenly blessed.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Eternity
                            case 300500:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello conqueror. You know, there are ancient stories about a second life and many people chose not to believe it. Even so, there are some people that believe in it, and that inspired me to learn about it. In my study, I found out how to reborn someone. But, in this quest, a CelestialStone may be needed. To get one, talk with Celestine(TwinCity 365, 92).");
                                                dialog.Option("Tell me more about it.", 1);
                                                dialog.Option("Reborm me.", 2);
                                                dialog.Option("Nothing thank you.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                dialog.Text("So you want to know more? When you reborn, you can chose what class you want to be the second life. Once you reborn you will start again the journey to conquer this world from level 15. Beware that you may gain some special skills depending on the class you chose to reborn, and you'll be able to get an own pet, that will follow and help you level or fight. The cost is a CelestialStone.");
                                                dialog.Option("Reborm me.", 2);
                                                dialog.Option("Nothing thank you.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Entity.Reborn == 0)
                                                {
                                                    if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
                                                    {
                                                        dialog.Text("There are two kinds of reborns. One is the normal one and the second one is blessed. The normal reborn will give you the chance to get a Super Gem and the blessed reborn will set a -1 into one of your equipment that you wear during the reborn. What do you chose?");
                                                        dialog.Option("Normal reborn.", 5);
                                                        dialog.Option("Blessed reborn.", 3);
                                                        dialog.Option("Nothing thank you.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You cannot reborn if your level is not 110+ for water saints and 120+ for other masters.");
                                                        dialog.Option("Ahh.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
                                                    dialog.Option("Thank you.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 5:
                                            {
                                                if (client.Entity.Reborn == 0)
                                                {
                                                    if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
                                                    {
                                                        dialog.Text("Select the super gem you desire.");
                                                        dialog.Option("SuperPhoenixGem.", 203);
                                                        dialog.Option("SuperDragonGem.", 213);
                                                        dialog.Option("SuperFuryGem.", 223);
                                                        dialog.Option("SuperRainbowGem.", 233);
                                                        dialog.Option("SuperVioletGem.", 253);
                                                        dialog.Option("SuperMoonGem.", 254);
                                                        dialog.Option("SuperKylinGem.", 243);
                                                        dialog.Option("Nothing thank you.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You cannot reborn if your level is not 110+ for water saints and 120+ for other masters.");
                                                        dialog.Option("Ahh.", 255);
                                                        dialog.Send();
                                                    }
                                                    break;
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
                                                    dialog.Option("Thank you.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Entity.Reborn == 0)
                                                {
                                                    if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
                                                    {
                                                        dialog.Text("Select the class you want to reborn in.");
                                                        dialog.Option("Trojan.", (byte)(10 + npcRequest.OptionID));
                                                        dialog.Option("Warrior.", (byte)(20 + npcRequest.OptionID));
                                                        dialog.Option("Archer.", (byte)(40 + npcRequest.OptionID));
                                                        dialog.Option("WaterTaoist.", (byte)(132 + npcRequest.OptionID));
                                                        dialog.Option("FireTaoist.", (byte)(142 + npcRequest.OptionID));
                                                        dialog.Option("Ninja.", (byte)(50 + npcRequest.OptionID));
                                                        dialog.Option("Monk.", (byte)(60 + npcRequest.OptionID));
                                                        dialog.Option("PirateLord.", (byte)(70 + npcRequest.OptionID));
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You cannot reborn if your level is not 110+ for water saints and 120+ for other masters.");
                                                        dialog.Option("Ahh.", 255);
                                                        dialog.Send();
                                                    }
                                                    break;
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
                                                    dialog.Option("Thank you.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        default:
                                            {
                                                if (client.Entity.Reborn == 0)
                                                {
                                                    if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
                                                    {
                                                        if (npcRequest.OptionID == 255)
                                                            return;
                                                        if (npcRequest.OptionID >= 200 && npcRequest.OptionID <= 254)
                                                        {
                                                            client.SelectedGem = (byte)(npcRequest.OptionID % 100);
                                                            if (client.SelectedGem == 54)
                                                                client.SelectedGem = 63;
                                                            if (client.Entity.Reborn == 0)
                                                            {
                                                                byte id = 4;
                                                                dialog.Text("Select the class you want to reborn in.");
                                                                dialog.Option("Trojan.", (byte)(10 + id));
                                                                dialog.Option("Warrior.", (byte)(20 + id));
                                                                dialog.Option("Archer.", (byte)(40 + id));
                                                                dialog.Option("WaterTaoist.", (byte)(132 + id));
                                                                dialog.Option("FireTaoist.", (byte)(142 + id));
                                                                dialog.Option("Ninja.", (byte)(50 + id));
                                                                dialog.Option("Monk.", (byte)(60 + id));
                                                                dialog.Option("PirateLord.", (byte)(70 + id));
                                                                dialog.Send();
                                                                break;
                                                            }
                                                            else
                                                            {
                                                                dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
                                                                dialog.Option("Thank you.", 255);
                                                                dialog.Send();
                                                            }
                                                        }
                                                        else
                                                        {
                                                            if (client.Inventory.Contains(721259, 1))
                                                            {
                                                                byte _class = (byte)(npcRequest.OptionID - npcRequest.OptionID % 10);
                                                                if (_class > 100)
                                                                    _class += 2;
                                                                byte type = (byte)(npcRequest.OptionID - _class);
                                                                if (_class < 100)
                                                                    _class++;
                                                                if (client.Reborn(_class))
                                                                {
                                                                    client.Inventory.Remove(721259, 1);
                                                                    if (type == 4)
                                                                    {
                                                                        if (client.SelectedGem != 0)
                                                                        {
                                                                            uint gemid = (uint)(client.SelectedGem + 700000);
                                                                            client.Inventory.Add(gemid, 0, 1);
                                                                        }
                                                                    }
                                                                    else
                                                                    {
                                                                        int availableshots = 0;
                                                                        for (byte count = 0; count < 18; count++)
                                                                            if (!client.Equipment.Free(count))
                                                                                if (client.Equipment.TryGetItem(count).Bless == 0)
                                                                                    availableshots++;
                                                                        if (availableshots != 0)
                                                                        {
                                                                            byte ex = (byte)Conquer_Online_Server.ServerBase.Kernel.Random.Next(18);
                                                                            if (!client.Equipment.Free(ex))
                                                                                if (client.Equipment.TryGetItem(ex).Bless == 0)
                                                                                {
                                                                                    var item = client.Equipment.TryGetItem(ex);
                                                                                    item.Bless = 1;
                                                                                    item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                                                    item.Send(client);
                                                                                    Conquer_Online_Server.Database.ConquerItemTable.UpdateBless(item, client);
                                                                                }
                                                                        }
                                                                    }
                                                                }
                                                                else
                                                                {
                                                                    dialog.Text("Sorry, but you need atleast 2 free spaces in your inventory.");
                                                                    dialog.Option("Ohh.", 255);
                                                                    dialog.Send();
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You cannot reborn if your level is not 110+ for water saints and 120+ for other masters.");
                                                        dialog.Option("Ahh.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
                                                    dialog.Option("Thank you.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region MillionaireLee
                            case 5004:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hey you! Yeah, it's you I am talking about. I've got a great deal that you cannot leave without taking it. I will give you one meteorscroll for ten meteors and one dragonballscroll for ten dragonballs. With those scrolls you can have more than fourty meteors or dragonballs in your inventory at once!");
                                                dialog.Option("Take my meteors.", 1);
                                                dialog.Option("Take my dragonballs.", 2);
                                                dialog.Option("I'm too poor.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Inventory.Contains(1088001, 10))
                                                {
                                                    client.Inventory.Remove(1088001, 10);
                                                    client.Inventory.Add(720027, 0, 1);
                                                }
                                                else
                                                {
                                                    dialog.Text("You poor man! I can't help you.");
                                                    dialog.Option("Why!?", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Inventory.Contains(1088000, 10))
                                                {
                                                    client.Inventory.Remove(1088000, 10);
                                                    client.Inventory.Add(720028, 0, 1);
                                                }
                                                else
                                                {
                                                    dialog.Text("You poor man! I can't help you.");
                                                    dialog.Option("Why!?", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Granny
                            case 5043:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("These youngsters forget to increase the durabuility when they upgrade your items. ");
                                                dialog.Text("I can take your SuperKylinGems and try to increase your item's max durabuility. ");
                                                dialog.Text("It's possible that the item could be completely repaired too. How many will you try with?");
                                                dialog.Input("Enter:", 1, 2);
                                                dialog.Option("Not now.", 255);

                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                byte Kylins = 0;
                                                if (!Byte.TryParse(npcRequest.Input, out Kylins))
                                                {// Input doesn't contain numbers only.
                                                    dialog.Text("Tell me, how am I supposed to get your durability higher if you can't give me a number 1 through 40?");
                                                    dialog.Option("Oops!", 0);
                                                    dialog.Send();
                                                    break;
                                                }
                                                if (Kylins != 0 && Kylins <= 40)
                                                {
                                                    if (client.Inventory.Contains(700043, Kylins))
                                                    {
                                                        client.KylinUpgradeCount = Kylins;
                                                        dialog.Text("Which item do you want to upgrade?");
                                                        dialog.Option("Headgear.", 101);
                                                        dialog.Option("Necklace.", 102);
                                                        dialog.Option("Armor.", 103);
                                                        dialog.Option("Main Weapon.", 104);
                                                        dialog.Option("Left Weapon.", 105);
                                                        dialog.Option("Ring.", 106);
                                                        dialog.Option("Next Page.", 2);
                                                        dialog.Option("I'll just leave", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have that many SuperKylinGems...");
                                                        dialog.Option("Oops...", 255);
                                                        dialog.Send();
                                                        break;
                                                    }
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Inventory.Contains(700043, client.KylinUpgradeCount))
                                                {
                                                    dialog.Text("Which item do you want to upgrade?");
                                                    dialog.Option("Boots.", 108);
                                                    dialog.Option("Fan.", 110);
                                                    dialog.Option("Tower.", 111);
                                                    dialog.Option("I'll just leave", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 101:
                                        case 102:
                                        case 103:
                                        case 104:
                                        case 105:
                                        case 106:
                                        case 108:
                                        case 110:
                                        case 111:
                                            {
                                                if (client.KylinUpgradeCount != 0 && client.KylinUpgradeCount <= 40)
                                                {
                                                    if (client.Inventory.Contains(700043, client.KylinUpgradeCount))
                                                    {
                                                        var item = client.Equipment.TryGetItem((byte)(npcRequest.OptionID - 100));
                                                        if (item != null)
                                                        {
                                                            #region old
                                                            /*if (item.Durability == item.MaximDurability)
                                                {
                                                    var itemdetail = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
                                                    if (itemdetail.Durability != item.MaximDurability)
                                                    {

                                                        int diff = itemdetail.Durability - item.MaximDurability;

                                                        int need = Math.Max((diff / 100) / 6, 1);

                                                        need = Math.Min(need, client.KylinUpgradeCount);

                                                        for (int counter = 0; counter < need; counter++)
                                                        {
                                                            item.MaximDurability += 100;
                                                            client.Inventory.Remove(700043, 1);
                                                        }
                                                        if (item.MaximDurability > itemdetail.Durability)
                                                            item.MaximDurability = itemdetail.Durability;
                                                        item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                        item.Send(client);
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("Your item must be repaired first.");
                                                    dialog.Option("Oh, sorry.", 255);
                                                    dialog.Send();
                                                    break;
                                                }*/
                                                            #endregion
                                                            #region test
                                                            var itemdetail = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
                                                            if (itemdetail.Durability != item.MaximDurability)
                                                            {
                                                                ushort oldDurability = item.MaximDurability;
                                                                bool Upgraded = false;
                                                                while (client.KylinUpgradeCount != 0)
                                                                {
                                                                    client.Inventory.Remove(700043, 1);
                                                                    client.KylinUpgradeCount -= 1;

                                                                    int rndDurability = (Conquer_Online_Server.ServerBase.Kernel.Random.Next(itemdetail.Durability));
                                                                    if (rndDurability >= item.MaximDurability)
                                                                    {
                                                                        //This looks ugly to me, not sure how else to do it.
                                                                        item.MaximDurability = ushort.Parse(rndDurability.ToString());
                                                                        rndDurability = 0;
                                                                        if (!Upgraded)
                                                                            Upgraded = true;
                                                                    }
                                                                }
                                                                if (Upgraded)
                                                                    dialog.Text("Your item's durabuility was increased from " + oldDurability + " to " + item.MaximDurability + ".\n");
                                                                else
                                                                    dialog.Text("I wasen't able to increase your item's durability..\n");
                                                                int Repair = (Conquer_Online_Server.ServerBase.Kernel.Random.Next(3));
                                                                if (Repair == 1)
                                                                {
                                                                    if (Upgraded)
                                                                        dialog.Text("I was also able to repair the item.");
                                                                    else
                                                                    {
                                                                        dialog.Text("But I was able to repair the item.");
                                                                        Upgraded = true;
                                                                    }
                                                                    item.Durability = item.MaximDurability;
                                                                }
                                                                item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                                item.Send(client);
                                                                if (Upgraded)
                                                                    dialog.Option("Thanks.", 255);
                                                                else
                                                                    dialog.Option("Darn..", 255);
                                                                dialog.Send();
                                                                break;
                                                            }
                                                            else
                                                            {
                                                                dialog.Text("This item is already at it's max durabuility!");
                                                                dialog.Option("Oh.", 255);
                                                                dialog.Send();
                                                                break;
                                                            }
                                                            #endregion
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("Wahh, What is this? I may be forgetful but I'm sure you told me you would give me " + client.KylinUpgradeCount.ToString() + " SuperKylinGems!\n\n I don't see that you have this many..");
                                                        dialog.Option("Lets try again.", 0);
                                                        dialog.Option("Nevermind.", 255);
                                                        dialog.Send();
                                                        break;
                                                    }
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }

                            #endregion

                            #region Confiscator
                            case 4450:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Have you ever arrested anyone? Or ... don't tell me, you have been arrested by anyone? If so, there is a chance that some gear was detained.");
                                                dialog.Option("I want to check my detained gear.", 1);
                                                dialog.Option("I want to check my claimable gear.", 2);
                                                dialog.Option("Thank you.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                client.Send(new Data(true) { ID = Data.OpenWindow, dwParam = Data.WindowCommands.DetainRedeem, UID = client.Entity.UID });
                                                break;
                                            }
                                        case 2:
                                            {
                                                client.Send(new Data(true) { ID = Data.OpenWindow, dwParam = Data.WindowCommands.DetainClaim, UID = client.Entity.UID });
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region PurificationStabilizer
                            case 7763:

                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Have you ever heard of the ruthless Terato Dragon? It cuts open every single conqueror that wants to take his prize. His prize are items that purify your items. His affiliates, sub-kings of monsters, also drop items like that. If you have such an item, I can purify your gear with it.");
                                                dialog.Text("Once purified, the item must be stabilized, otherwise the purity will dissapear after several days. If you want to stabilize your items, come to me I'll see what I can do.");
                                                dialog.Option("Purify my item.", 1);
                                                dialog.Option("Stabilize my item.", 2);
                                                dialog.Option("Nevermind.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                INpc npc = null;
                                                if (client.Map.Npcs.TryGetValue(client.ActiveNpc, out npc))
                                                {
                                                    Data data = new Data(true);
                                                    data.ID = Data.OpenWindow;
                                                    data.UID = client.Entity.UID;
                                                    data.TimeStamp = Time32.Now;
                                                    data.dwParam = 455;
                                                    data.wParam1 = npc.X;
                                                    data.wParam2 = npc.Y;
                                                    client.Send(data);
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                INpc npc = null;
                                                if (client.Map.Npcs.TryGetValue(client.ActiveNpc, out npc))
                                                {
                                                    Data data = new Data(true);
                                                    data.ID = Data.OpenWindow;
                                                    data.UID = client.Entity.UID;
                                                    data.TimeStamp = Time32.Now;//done
                                                    data.dwParam = 459;
                                                    data.wParam1 = npc.X;
                                                    data.wParam2 = npc.Y;
                                                    client.Send(data);
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #endregion
                        }
                        break;
                    }
                #endregion
                #region Guild war
                case 1038:
                    {
                        switch (client.ActiveNpc)
                        {
                            #region Pole
                            case 810:
                                {
                                    if (client.Guild != null)
                                    {
                                        if (client.Guild.PoleKeeper)
                                        {
                                            switch (npcRequest.OptionID)
                                            {
                                                case 0:
                                                    {
                                                        dialog.Text("Hey " + client.Entity.Name + "Heal  This Stone Pillar !");
                                                        if (!Game.ConquerStructures.Society.GuildWar.IsWar)
                                                        {
                                                            dialog.Option("Dont Heart me plz", 1);
                                                        }
                                                        dialog.Option("Heal This Stone Pillar !", 255);
                                                        dialog.Send();
                                                        break;
                                                    }
                                                case 1:
                                                    {
                                                        client.Entity.Teleport(1002, 429, 378);
                                                        break;
                                                    }
                                            }
                                        }
                                    }
                                    break;
                                }
                            #endregion

                            #region Gates
                            case 516074:
                                {
                                    if (client.Guild != null)
                                    {
                                        if (client.Guild.PoleKeeper)
                                        {
                                            switch (npcRequest.OptionID)
                                            {
                                                case 0:
                                                    dialog.Text("Select the option you want to pursue.");
                                                    if (client.AsMember.Rank != Conquer_Online_Server.Game.Enums.GuildMemberRank.Member)
                                                    {
                                                        dialog.Option("Open gate.", 1);
                                                    }
                                                    dialog.Option("Get inside.", 3);
                                                    dialog.Option("Nothing.", 255);
                                                    dialog.Send();
                                                    break;
                                                case 1:
                                                    {
                                                        Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh = (ushort)(250 + Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh % 10);

                                                        Update upd = new Update(true);
                                                        upd.UID = Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.UID;
                                                        upd.Append(Update.Mesh, Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh);
                                                        Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Hitpoints = Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.MaxHitpoints;
                                                        client.SendScreen(upd, true);
                                                        break;
                                                    }
                                                case 2:
                                                    {
                                                        Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh = (ushort)(240 + Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh % 10);

                                                        Update upd = new Update(true);
                                                        upd.UID = Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.UID;
                                                        upd.Append(Update.Mesh, Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh);
                                                        Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Hitpoints = Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.MaxHitpoints;
                                                        client.SendScreen(upd, true);
                                                        break;
                                                    }
                                                case 3:
                                                    {
                                                        client.Entity.Teleport(1038, 162, 198);
                                                        break;
                                                    }
                                            }
                                        }
                                    }
                                    break;
                                }
                            case 516075:
                                {
                                    if (client.Guild != null)
                                    {
                                        if (client.Guild.PoleKeeper)
                                        {
                                            switch (npcRequest.OptionID)
                                            {
                                                case 0:
                                                    dialog.Text("Select the option you want to pursue.");
                                                    if (client.AsMember.Rank != Conquer_Online_Server.Game.Enums.GuildMemberRank.Member)
                                                    {
                                                        dialog.Option("Open gate.", 1);
                                                    }
                                                    dialog.Option("Get inside.", 3);
                                                    dialog.Option("Nothing.", 255);
                                                    dialog.Send();
                                                    break;
                                                case 1:
                                                    {
                                                        Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.RightGate.Mesh = (ushort)(280 + Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.RightGate.Mesh % 10);

                                                        Update upd = new Update(true);
                                                        upd.UID = Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.RightGate.UID;
                                                        upd.Append(Update.Mesh, Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.RightGate.Mesh);
                                                        Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.RightGate.Hitpoints = Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.RightGate.MaxHitpoints;
                                                        client.SendScreen(upd, true);
                                                        break;
                                                    }
                                                case 2:
                                                    {
                                                        Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.RightGate.Mesh = (ushort)(270 + Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.RightGate.Mesh % 10);

                                                        Update upd = new Update(true);
                                                        upd.UID = Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.RightGate.UID;
                                                        upd.Append(Update.Mesh, Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.RightGate.Mesh);
                                                        Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.RightGate.Hitpoints = Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.RightGate.MaxHitpoints;
                                                        client.SendScreen(upd, true);
                                                        break;
                                                    }
                                                case 3:
                                                    {
                                                        client.Entity.Teleport(1038, 210, 177);
                                                        break;
                                                    }
                                            }
                                        }
                                    }
                                    break;
                                }
                            #endregion

                            #region Guild Conductresses

                            #region Exit Guild Arena
                            case 7000:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Do you want to leave the guild arena?");
                                                dialog.Option("Yes.", 1);
                                                dialog.Option("No.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                client.Entity.Teleport(1002, 429, 378);
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #endregion

                            #region Guild Conductors
                            #region IN
                            case 9884:
                            case 9885:
                            case 9986:
                            case 9987:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("In exchange of a fee of 1000gold, I will teleport you to a special place. If you don't have money, don't bother me.");
                                                dialog.Option("Teleport me.", 1);
                                                dialog.Option("I'm too poor.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Money >= 1000)
                                                {
                                                    client.Entity.Money -= 1000;
                                                    switch (client.ActiveNpc)
                                                    {
                                                        case 9884: client.Entity.Teleport(1216, 12, 481); break;
                                                        case 9885: client.Entity.Teleport(1213, 439, 261); break;
                                                        case 9986: client.Entity.Teleport(1217, 536, 558); break;
                                                        case 9987: client.Entity.Teleport(1001, 337, 325); break;
                                                    }
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                            #endregion
                        }
                        break;
                    }
                #endregion
                #region Promotion Center
                case 1004:
                    {
                        switch (client.ActiveNpc)
                        {
                            #region Promotion Center

                            #region HeadAbbot
                            case 4271:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    dialog.Text("I am the monk trainer, master of balence in destruction and harmony.\nWhat do you seek for, young monk?");
                                                    dialog.Option("Promote me.", 1);
                                                    dialog.Option("Learn skills.", 2);
                                                    dialog.Option("Claim bound items.", 49);
                                                    dialog.Option("Thank you very much.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #region BoundItems
                                        case 49:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.HeadgearClaim)
                                                    dialog.Option("Headgear (Lvl 15).", 50);
                                                if (!client.RingClaim)
                                                    dialog.Option("Ring (Lvl 15).", 51);
                                                if (!client.NecklaceClaim)
                                                    dialog.Option("Necklace (Lvl 15).", 52);
                                                if (!client.ArmorClaim)
                                                    dialog.Option("Armor (Lvl 15).", 53);
                                                dialog.Option("Next.", 48);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 48:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.BootsClaim)
                                                    dialog.Option("Boots (Lvl 15).", 54);
                                                if (!client.TowerClaim)
                                                    dialog.Option("Tower (Lvl 100).", 55);
                                                if (!client.FanClaim)
                                                    dialog.Option("Fan (Lvl 100).", 56);
                                                if (!client.WeaponClaim)
                                                    dialog.Option("Weapon (Lvl 15).", 57);
                                                dialog.Option("Back.", 49);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 50:
                                            {
                                                uint itemid = 143009;
                                                byte level = 15;
                                                if (!client.HeadgearClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);
                                                        item.ID = itemid;
                                                        item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.HeadgearClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 51:
                                            {
                                                uint itemid = 150039;
                                                byte level = 15;
                                                if (!client.RingClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);
                                                        item.ID = itemid;
                                                        item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.RingClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 52:
                                            {
                                                uint itemid = 120029;
                                                byte level = 15;
                                                if (!client.NecklaceClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);
                                                        item.ID = itemid;
                                                        item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.NecklaceClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 53:
                                            {
                                                uint itemid = 136009;
                                                byte level = 15;
                                                if (!client.ArmorClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);
                                                        item.ID = itemid;
                                                        item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.ArmorClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 54:
                                            {
                                                uint itemid = 160019;
                                                byte level = 15;
                                                if (!client.BootsClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);
                                                        item.ID = itemid;
                                                        item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.BootsClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 55:
                                            {
                                                uint itemid = 202009;
                                                byte level = 100;
                                                if (!client.TowerClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);
                                                        item.ID = itemid;
                                                        item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.TowerClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 56:
                                            {
                                                uint itemid = 201009;
                                                byte level = 100;
                                                if (!client.FanClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);
                                                        item.ID = itemid;
                                                        item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.FanClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 57:
                                            {
                                                byte level = 15;
                                                if (!client.WeaponClaim)
                                                {
                                                    ISkill proff = null;
                                                    ushort maxlevel = 0;
                                                    foreach (var prof in client.Proficiencies.Values)
                                                    {
                                                        if (maxlevel < prof.Level && prof.ID != 0)
                                                        {
                                                            maxlevel = prof.Level;
                                                            proff = prof;
                                                        }
                                                    }
                                                    if (proff == null)
                                                        return;
                                                    uint itemid = 610029;
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.WeaponClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion
                                        #region Promote
                                        case 1:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Class == 65)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("To promote now you need" + client.PromoteItemNameNeed + " level " + client.PromoteLevelNeed + ".");
                                                        dialog.Option("Promote me sir.", 3);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Class == 65)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {

                                                        if (client.PromoteItemNeed == 721020)
                                                        {
                                                            if (client.Inventory.Remove("moonbox"))
                                                            {
                                                                client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                                client.Entity.Class++;
                                                                dialog.Text("Congratulations! You have been promoted.");
                                                                dialog.Option("Thank you master.", 255);
                                                                dialog.Send();
                                                            }

                                                            else
                                                            {
                                                                dialog.Text("You don't meet the requierments.");
                                                                dialog.Option("Ahh.", 255);
                                                                dialog.Send();
                                                            }
                                                            return;
                                                        }
                                                        if (client.Inventory.Contains(client.PromoteItemNeed, client.PromoteItemCountNeed) && client.Entity.Level >= client.PromoteLevelNeed)
                                                        {
                                                            client.Inventory.Remove(client.PromoteItemNeed, client.PromoteItemCountNeed);
                                                            client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                            client.Entity.Class++;
                                                            dialog.Text("Congratulations! You have been promoted.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You don't meet the requierments.");
                                                            dialog.Option("Ahh.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion
                                        #region Skills
                                        case 2:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    dialog.Text("Let me know what you want to learn.");
                                                    dialog.Option("Triple Attack (Lvl 5).", 6);
                                                    dialog.Option("Oblivion (XP) (Lvl 15)", 7);
                                                    dialog.Option("Whirlwind Kick (Lvl 15)", 8);
                                                    dialog.Option("Radiant Palm (Lvl 40)", 9);
                                                    dialog.Option("Serenity (Lvl 40)", 10);
                                                    dialog.Option("Tranquility (Lvl 70)", 11);
                                                    dialog.Option("Compassion (Lvl 100)", 12);
                                                    dialog.Option("Auras (Lvl 20->100)", 5);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 5:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    dialog.Text("Which aura do you want to learn?");
                                                    dialog.Option("Tyrant (Lvl 20).", 13);
                                                    dialog.Option("Fend (Lvl 20)", 14);
                                                    dialog.Option("Metal (Lvl 100)", 15);
                                                    dialog.Option("Wood (Lvl 100)", 16);
                                                    dialog.Option("Water (Lvl 100)", 17);
                                                    dialog.Option("Fire (Lvl 100)", 18);
                                                    dialog.Option("Earth (Lvl 100)", 19);
                                                    dialog.Option("Back to skills.", 2);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 6:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Level >= 5)
                                                    {
                                                        dialog.Text("You have learned Triple Attack.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(10490)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 5 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 7:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Level >= 15)
                                                    {
                                                        dialog.Text("You have learned the Oblivion XP skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(10390)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 15 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 8:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Level >= 15)
                                                    {
                                                        dialog.Text("You have learned Whirlwind Kick.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(10415)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 15 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 9:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        dialog.Text("You have learned Radiant Palm.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(10381)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 10:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        dialog.Text("You have learned Serenity.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(10400)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 11:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Level >= 70)
                                                    {
                                                        dialog.Text("You have learned Tranquility.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(10425)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 12:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Level >= 100)
                                                    {
                                                        dialog.Text("You have learned Compassion.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(10430)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 100 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 13:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Level >= 20)
                                                    {
                                                        dialog.Text("You have learned Tyrent Aura.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(10395)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 20 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 14:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Level >= 20)
                                                    {
                                                        dialog.Text("You have learned Fend Aura.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(10410)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 20 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 15:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Level >= 100)
                                                    {
                                                        dialog.Text("You have learned Metal Elemental Aura.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(10420)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 100 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 16:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Level >= 100)
                                                    {
                                                        dialog.Text("You have learned Wood Elemental Aura.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(10421)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 100 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 17:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Level >= 100)
                                                    {
                                                        dialog.Text("You have learned Water Elemental Aura.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(10422)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 100 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 18:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Level >= 100)
                                                    {
                                                        dialog.Text("You have learned Fire Elemental Aura.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(10423)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 100 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 19:
                                            {
                                                if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                                {
                                                    if (client.Entity.Level >= 100)
                                                    {
                                                        dialog.Text("You have learned Earth Elemental Aura.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(10424)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 100 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion
                                    }
                                    break;
                                }
                            #endregion

                            #region WarriorGod
                            case 10001:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                if (client.Entity.Class >= 20 && client.Entity.Class <= 25)
                                                {
                                                    dialog.Text("I am the shield and two hand weapons master. As I see, you started your way on conquering this world. I will try to help you teaching you warrior skills and promoting you.");
                                                    dialog.Option("Promote me.", 1);
                                                    dialog.Option("Learn skills.", 2);
                                                    dialog.Option("Claim bound items.", 49);
                                                    dialog.Option("Thank you very much.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the warrior secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #region BoundItems
                                        case 49:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.HeadgearClaim)
                                                    dialog.Option("Headgear (Lvl 15).", 50);
                                                if (!client.RingClaim)
                                                    dialog.Option("Ring (Lvl 15).", 51);
                                                if (!client.NecklaceClaim)
                                                    dialog.Option("Necklace (Lvl 15).", 52);
                                                if (!client.ArmorClaim)
                                                    dialog.Option("Armor (Lvl 15).", 53);
                                                dialog.Option("Next.", 48);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 48:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.BootsClaim)
                                                    dialog.Option("Boots (Lvl 15).", 54);
                                                if (!client.TowerClaim)
                                                    dialog.Option("Tower (Lvl 100).", 55);
                                                if (!client.FanClaim)
                                                    dialog.Option("Fan (Lvl 100).", 56);
                                                if (!client.WeaponClaim)
                                                    dialog.Option("Weapon (Lvl 110).", 57);
                                                dialog.Option("Back.", 49);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 50:
                                            {
                                                uint itemid = 111009;
                                                byte level = 15;
                                                if (!client.HeadgearClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.HeadgearClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 51:
                                            {
                                                uint itemid = 150039;
                                                byte level = 15;
                                                if (!client.RingClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.RingClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 52:
                                            {
                                                uint itemid = 120029;
                                                byte level = 15;
                                                if (!client.NecklaceClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.NecklaceClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 53:
                                            {
                                                uint itemid = 131009;
                                                byte level = 15;
                                                if (!client.ArmorClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.ArmorClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 54:
                                            {
                                                uint itemid = 160019;
                                                byte level = 15;
                                                if (!client.BootsClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.BootsClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 55:
                                            {
                                                uint itemid = 202009;
                                                byte level = 100;
                                                if (!client.TowerClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.TowerClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 56:
                                            {
                                                uint itemid = 201009;
                                                byte level = 100;
                                                if (!client.FanClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.FanClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 57:
                                            {
                                                byte level = 100;
                                                if (!client.WeaponClaim)
                                                {
                                                    ISkill proff = null;
                                                    ushort maxlevel = 0;
                                                    foreach (var prof in client.Proficiencies.Values)
                                                    {
                                                        if (maxlevel < prof.Level && prof.ID != 0)
                                                        {
                                                            maxlevel = prof.Level;
                                                            proff = prof;
                                                        }
                                                    }
                                                    if (proff == null)
                                                        return;
                                                    uint itemid = (uint)(proff.ID * 1000 + 219);
                                                    if (!Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations.ContainsKey(itemid))
                                                    {
                                                        dialog.Text("You need more proficiency belonging to a weapon, and not a shield or your punch.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                        return;
                                                    }
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.WeaponClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion
                                        #region Promotion
                                        case 1:
                                            {
                                                if (client.Entity.Class >= 20 && client.Entity.Class <= 25)
                                                {
                                                    if (client.Entity.Class == 25)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("To promote now you need" + client.PromoteItemNameNeed + " level " + client.PromoteLevelNeed + ".");
                                                        dialog.Option("Promote me sir.", 3);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the warrior secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Entity.Class >= 20 && client.Entity.Class <= 25)
                                                {
                                                    if (client.Entity.Class == 25)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {

                                                        if (client.PromoteItemNeed == 721020)
                                                        {
                                                            if (client.Inventory.Remove("moonbox"))
                                                            {
                                                                client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                                client.Entity.Class++;
                                                                dialog.Text("Congratulations! You have been promoted.");
                                                                dialog.Option("Thank you master.", 255);
                                                                dialog.Send();
                                                            }

                                                            else
                                                            {
                                                                dialog.Text("You don't meet the requierments.");
                                                                dialog.Option("Ahh.", 255);
                                                                dialog.Send();
                                                            }
                                                            return;
                                                        }
                                                        if (client.Inventory.Contains(client.PromoteItemNeed, client.PromoteItemCountNeed) && client.Entity.Level >= client.PromoteLevelNeed)
                                                        {
                                                            client.Inventory.Remove(client.PromoteItemNeed, client.PromoteItemCountNeed);
                                                            client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                            client.Entity.Class++;
                                                            dialog.Text("Congratulations! You have been promoted.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You don't meet the requierments.");
                                                            dialog.Option("Ahh.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the warrior secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Entity.Class >= 20 && client.Entity.Class <= 25)
                                                {
                                                    dialog.Text("Let me know what you want to learn.");
                                                    dialog.Option("XP Skills (Lvl 40).", 5);
                                                    dialog.Option("Dash (Lvl 61).", 6);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the warrior secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 5:
                                            {
                                                if (client.Entity.Class >= 20 && client.Entity.Class <= 25)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        dialog.Text("You have learned the XP Skills of this class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        client.AddSpell(LearnableSpell(1025));
                                                        client.AddSpell(LearnableSpell(1020));
                                                        client.AddSpell(LearnableSpell(1015));
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the warrior secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion
                                        #region Skills
                                        case 6:
                                            {
                                                if (client.Entity.Class >= 20 && client.Entity.Class <= 25)
                                                {
                                                    if (client.Entity.Level >= 61)
                                                    {
                                                        dialog.Text("You have learned the Dash Skill of this class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(1051)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 61 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the warrior secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                                        #endregion
                            #endregion

                            #region Archer Master
                            case 400:
                                {
                                    byte mClass = 40;
                                    byte MClass = 45;
                                    string Class = "archer";
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    dialog.Text("I am the bow master. As I see, you started your way on conquering this world. I will try to help you teaching you warrir skills and promoting you.");
                                                    dialog.Option("Promote me.", 1);
                                                    dialog.Option("Learn skills.", 2);
                                                    dialog.Option("Claim bound items.", 49);
                                                    dialog.Option("Thank you very much.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #region BoundItems
                                        case 49:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.HeadgearClaim)
                                                    dialog.Option("Headgear (Lvl 15).", 50);
                                                if (!client.RingClaim)
                                                    dialog.Option("Ring (Lvl 15).", 51);
                                                if (!client.NecklaceClaim)
                                                    dialog.Option("Necklace (Lvl 15).", 52);
                                                if (!client.ArmorClaim)
                                                    dialog.Option("Armor (Lvl 15).", 53);
                                                dialog.Option("Next.", 48);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 48:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.BootsClaim)
                                                    dialog.Option("Boots (Lvl 15).", 54);
                                                if (!client.TowerClaim)
                                                    dialog.Option("Tower (Lvl 100).", 55);
                                                if (!client.FanClaim)
                                                    dialog.Option("Fan (Lvl 100).", 56);
                                                if (!client.WeaponClaim)
                                                    dialog.Option("Weapon (Lvl 110).", 57);
                                                dialog.Option("Back.", 49);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 50:
                                            {
                                                uint itemid = 113009;
                                                byte level = 15;
                                                if (!client.HeadgearClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.HeadgearClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 51:
                                            {
                                                uint itemid = 150039;
                                                byte level = 15;
                                                if (!client.RingClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.RingClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 52:
                                            {
                                                uint itemid = 120029;
                                                byte level = 15;
                                                if (!client.NecklaceClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.NecklaceClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 53:
                                            {
                                                uint itemid = 160039;
                                                byte level = 15;
                                                if (!client.ArmorClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.ArmorClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 54:
                                            {
                                                uint itemid = 160019;
                                                byte level = 15;
                                                if (!client.BootsClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.BootsClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 55:
                                            {
                                                uint itemid = 202009;
                                                byte level = 100;
                                                if (!client.TowerClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.TowerClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 56:
                                            {
                                                uint itemid = 201009;
                                                byte level = 100;
                                                if (!client.FanClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.FanClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 57:
                                            {
                                                byte level = 100;
                                                if (!client.WeaponClaim)
                                                {
                                                    ISkill proff = null;
                                                    ushort maxlevel = 0;
                                                    foreach (var prof in client.Proficiencies.Values)
                                                    {
                                                        if (maxlevel < prof.Level && prof.ID != 0)
                                                        {
                                                            maxlevel = prof.Level;
                                                            proff = prof;
                                                        }
                                                    }
                                                    if (proff == null)
                                                        return;
                                                    uint itemid = (uint)(proff.ID * 1000 + 219);
                                                    if (!Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations.ContainsKey(itemid))
                                                    {
                                                        Console.WriteLine("invalid claim weapon " + itemid);
                                                        return;
                                                    }
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.WeaponClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion
                                        #region Promotion
                                        case 1:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Class == MClass)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("To promote now you need" + client.PromoteItemNameNeed + " level " + client.PromoteLevelNeed + ".");
                                                        dialog.Option("Promote me sir.", 3);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Class == MClass)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        if (client.PromoteItemNeed == 721020)
                                                        {
                                                            if (client.Inventory.Remove("moonbox"))
                                                            {
                                                                client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                                client.Entity.Class++;
                                                                dialog.Text("Congratulations! You have been promoted.");
                                                                dialog.Option("Thank you master.", 255);
                                                                dialog.Send();
                                                            }

                                                            else
                                                            {
                                                                dialog.Text("You don't meet the requierments.");
                                                                dialog.Option("Ahh.", 255);
                                                                dialog.Send();
                                                            }
                                                            return;
                                                        }
                                                        if (client.Inventory.Contains(client.PromoteItemNeed, client.PromoteItemCountNeed) && client.Entity.Level >= client.PromoteLevelNeed)
                                                        {
                                                            client.Inventory.Remove(client.PromoteItemNeed, client.PromoteItemCountNeed);
                                                            client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                            client.Entity.Class++;
                                                            dialog.Text("Congratulations! You have been promoted.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You don't meet the requierments.");
                                                            dialog.Option("Ahh.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion
                                        #region Skills
                                        case 2:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    dialog.Text("Let me know what you want to learn.");
                                                    dialog.Option("XPFly (Lvl 1).", 5);
                                                    dialog.Option("Scatter (Lvl 23).", 6);
                                                    dialog.Option("RapidFire (Lvl 40).", 7);
                                                    dialog.Option("Fly (Lvl 70).", 8);
                                                    dialog.Option("Intensify (Lvl 70).", 9);
                                                    dialog.Option("Arrow rain (Lvl 70).", 10);
                                                    dialog.Option("Advanced Fly (Lvl 100).", 11);
                                                    dialog.Option("Nothing.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 5:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    dialog.Text("You have learned the XP Skill of this class.");
                                                    dialog.Option("Thank you master.", 255);
                                                    dialog.Send();
                                                    if (!client.AddSpell(LearnableSpell(8002)))
                                                    {
                                                        dialog.Text("You already know this skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 6:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 23)
                                                    {
                                                        dialog.Text("You have learned the scatter.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(8001)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 23 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 7:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(8000)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the rapid fire.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 8:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 70)
                                                    {

                                                        if (!client.AddSpell(LearnableSpell(8003)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the fly.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 9:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 70)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(9000)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the intensify.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 10:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 70)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(8030)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the arrow rain.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 11:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 100)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(8003, 1)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the advanced fly.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 100 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                                        #endregion
                            #endregion

                            #region WindSage
                            case 4720:
                                {
                                    byte mClass = 50;
                                    byte MClass = 55;
                                    string Class = "ninja";
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    dialog.Text("I am the master of the no sound attack and the master of the katanas. As I see, you started your way on conquering this world. I will try to help you teaching you warrir skills and promoting you.");
                                                    dialog.Option("Promote me.", 1);
                                                    dialog.Option("Learn skills.", 2);
                                                    dialog.Option("Claim bound items.", 49);
                                                    dialog.Option("Thank you very much.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #region BoundItems
                                        case 49:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.HeadgearClaim)
                                                    dialog.Option("Headgear (Lvl 15).", 50);
                                                if (!client.RingClaim)
                                                    dialog.Option("Ring (Lvl 15).", 51);
                                                if (!client.NecklaceClaim)
                                                    dialog.Option("Necklace (Lvl 15).", 52);
                                                if (!client.ArmorClaim)
                                                    dialog.Option("Armor (Lvl 15).", 53);
                                                dialog.Option("Next.", 48);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 48:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.BootsClaim)
                                                    dialog.Option("Boots (Lvl 15).", 54);
                                                if (!client.TowerClaim)
                                                    dialog.Option("Tower (Lvl 100).", 55);
                                                if (!client.FanClaim)
                                                    dialog.Option("Fan (Lvl 100).", 56);
                                                if (!client.WeaponClaim)
                                                    dialog.Option("Weapon (Lvl 110).", 57);
                                                dialog.Option("Back.", 49);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 50:
                                            {
                                                uint itemid = 123009;
                                                byte level = 15;
                                                if (!client.HeadgearClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.HeadgearClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 51:
                                            {
                                                uint itemid = 150039;
                                                byte level = 15;
                                                if (!client.RingClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.RingClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 52:
                                            {
                                                uint itemid = 120029;
                                                byte level = 15;
                                                if (!client.NecklaceClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.NecklaceClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 53:
                                            {
                                                uint itemid = 135009;
                                                byte level = 15;
                                                if (!client.ArmorClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.ArmorClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 54:
                                            {
                                                uint itemid = 160019;
                                                byte level = 15;
                                                if (!client.BootsClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.BootsClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 55:
                                            {
                                                uint itemid = 202009;
                                                byte level = 100;
                                                if (!client.TowerClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.TowerClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 56:
                                            {
                                                uint itemid = 201009;
                                                byte level = 100;
                                                if (!client.FanClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.FanClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 57:
                                            {
                                                byte level = 100;
                                                if (!client.WeaponClaim)
                                                {
                                                    ISkill proff = null;
                                                    ushort maxlevel = 0;
                                                    foreach (var prof in client.Proficiencies.Values)
                                                    {
                                                        if (maxlevel < prof.Level && prof.ID != 0)
                                                        {
                                                            maxlevel = prof.Level;
                                                            proff = prof;
                                                        }
                                                    }
                                                    if (proff == null)
                                                        return;
                                                    uint itemid = (uint)(proff.ID * 1000 + 219);
                                                    if (!Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations.ContainsKey(itemid))
                                                    {
                                                        Console.WriteLine("invalid claim weapon " + itemid);
                                                        return;
                                                    }
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.WeaponClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion
                                        #region Promotion
                                        case 1:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Class == MClass)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("To promote now you need" + client.PromoteItemNameNeed + " level " + client.PromoteLevelNeed + ".");
                                                        dialog.Option("Promote me sir.", 3);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Class == MClass)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        if (client.PromoteItemNeed == 721020)
                                                        {
                                                            if (client.Inventory.Remove("moonbox"))
                                                            {
                                                                client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                                client.Entity.Class++;
                                                                dialog.Text("Congratulations! You have been promoted.");
                                                                dialog.Option("Thank you master.", 255);
                                                                dialog.Send();
                                                            }
                                                            else
                                                            {
                                                                dialog.Text("You don't meet the requierments.");
                                                                dialog.Option("Ahh.", 255);
                                                                dialog.Send();
                                                            }
                                                            return;
                                                        }
                                                        if (client.Inventory.Contains(client.PromoteItemNeed, client.PromoteItemCountNeed) && client.Entity.Level >= client.PromoteLevelNeed)
                                                        {
                                                            client.Inventory.Remove(client.PromoteItemNeed, client.PromoteItemCountNeed);
                                                            client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                            client.Entity.Class++;
                                                            dialog.Text("Congratulations! You have been promoted.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You don't meet the requierments.");
                                                            dialog.Option("Ahh.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion
                                        #region Skills
                                        case 2:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    dialog.Text("Let me know what you want to learn. '[...]' and '{...}' means ninja as second life and ninja as third life.");
                                                    dialog.Option("TwofoldBlades (Lvl 40).", 5);
                                                    dialog.Option("ToxicFog (Lvl 70).", 6);
                                                    dialog.Option("PoisonStar [Lvl 70].", 7);
                                                    dialog.Option("CounterKill {Lvl 70}(Second Reborn).", 8);
                                                    dialog.Option("ArcherBane (Lvl 110).", 9);
                                                    dialog.Option("ShurikenVortex (Lvl 70).", 10);
                                                    dialog.Option("Nothing.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 5:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(6000)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the TwofoldBlades.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 23 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 6:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 70)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(6001)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the ToxicFog.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 7:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 70)
                                                    {
                                                        if ((client.Entity.Reborn == 1 && client.Entity.Class == 55) || (client.Entity.Reborn == 2 && client.Entity.SecondRebornClass == 55))
                                                        {
                                                            if (!client.AddSpell(LearnableSpell(6002)))
                                                            {
                                                                dialog.Text("You already know this skill.");
                                                                dialog.Option("Thank you master.", 255);
                                                                dialog.Send();
                                                                break;
                                                            }
                                                            dialog.Text("You have learned the PoisonStar.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need to be ninja in the second life.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 8:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 70)
                                                    {
                                                        if (client.Entity.Reborn == 2 && client.Entity.Class == 55 && client.Entity.FirstRebornClass == 55 && client.Entity.SecondRebornClass == 55)
                                                        {
                                                            if (!client.AddSpell(LearnableSpell(6003)))
                                                            {
                                                                dialog.Text("You already know this skill.");
                                                                dialog.Option("Thank you master.", 255);
                                                                dialog.Send();
                                                                break;
                                                            }
                                                            dialog.Text("You have learned the CounterKill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need to be ninja in the third life.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 9:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 110)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(6004)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the ArcherBane.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 10:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 70)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(6010)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the ShurikenVortex.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                                        #endregion
                            #endregion

                            #region TrojanMaster
                            case 10022:
                                {
                                    byte mClass = 10;
                                    byte MClass = 15;
                                    string Class = "trojan";
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    dialog.Text("I am the master of the one hand weapons. As I see, you started your way on conquering this world. I will try to help you teaching you warrir skills and promoting you.");
                                                    dialog.Option("Promote me.", 1);
                                                    dialog.Option("Learn skills.", 2);
                                                    dialog.Option("Claim bound items.", 49);
                                                    dialog.Option("Thank you very much.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #region BoundItems
                                        case 49:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.HeadgearClaim)
                                                    dialog.Option("Headgear (Lvl 15).", 50);
                                                if (!client.RingClaim)
                                                    dialog.Option("Ring (Lvl 15).", 51);
                                                if (!client.NecklaceClaim)
                                                    dialog.Option("Necklace (Lvl 15).", 52);
                                                if (!client.ArmorClaim)
                                                    dialog.Option("Armor (Lvl 15).", 53);
                                                dialog.Option("Next.", 48);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 48:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.BootsClaim)
                                                    dialog.Option("Boots (Lvl 15).", 54);
                                                if (!client.TowerClaim)
                                                    dialog.Option("Tower (Lvl 100).", 55);
                                                if (!client.FanClaim)
                                                    dialog.Option("Fan (Lvl 100).", 56);
                                                if (!client.WeaponClaim)
                                                    dialog.Option("Weapon (Lvl 110).", 57);
                                                dialog.Option("Back.", 49);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 50:
                                            {
                                                uint itemid = 118009;
                                                byte level = 15;
                                                if (!client.HeadgearClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.HeadgearClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 51:
                                            {
                                                uint itemid = 150039;
                                                byte level = 15;
                                                if (!client.RingClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.RingClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 52:
                                            {
                                                uint itemid = 120029;
                                                byte level = 15;
                                                if (!client.NecklaceClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.NecklaceClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 53:
                                            {
                                                uint itemid = 130009;
                                                byte level = 15;
                                                if (!client.ArmorClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.ArmorClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 54:
                                            {
                                                uint itemid = 160019;
                                                byte level = 15;
                                                if (!client.BootsClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.BootsClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 55:
                                            {
                                                uint itemid = 202009;
                                                byte level = 100;
                                                if (!client.TowerClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.TowerClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 56:
                                            {
                                                uint itemid = 201009;
                                                byte level = 100;
                                                if (!client.FanClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.FanClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 57:
                                            {
                                                byte level = 100;
                                                if (!client.WeaponClaim)
                                                {
                                                    ISkill proff = null;
                                                    ushort maxlevel = 0;
                                                    foreach (var prof in client.Proficiencies.Values)
                                                    {
                                                        if (maxlevel < prof.Level && prof.ID != 0)
                                                        {
                                                            maxlevel = prof.Level;
                                                            proff = prof;
                                                        }
                                                    }
                                                    if (proff == null)
                                                        return;
                                                    uint itemid = (uint)(proff.ID * 1000 + 219);
                                                    if (!Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations.ContainsKey(itemid))
                                                    {
                                                        Console.WriteLine("invalid claim weapon " + itemid);
                                                        return;
                                                    }
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.WeaponClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion
                                        #region Promotion
                                        case 1:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Class == MClass)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("To promote now you need" + client.PromoteItemNameNeed + " level " + client.PromoteLevelNeed + ".");
                                                        dialog.Option("Promote me sir.", 3);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Class == MClass)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        if (client.PromoteItemNeed == 721020)
                                                        {
                                                            if (client.Inventory.Remove("moonbox"))
                                                            {
                                                                client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                                client.Entity.Class++;
                                                                dialog.Text("Congratulations! You have been promoted.");
                                                                dialog.Option("Thank you master.", 255);
                                                                dialog.Send();
                                                            }

                                                            else
                                                            {
                                                                dialog.Text("You don't meet the requierments.");
                                                                dialog.Option("Ahh.", 255);
                                                                dialog.Send();
                                                            }
                                                            return;
                                                        }
                                                        if (client.Inventory.Contains(client.PromoteItemNeed, client.PromoteItemCountNeed) && client.Entity.Level >= client.PromoteLevelNeed)
                                                        {
                                                            client.Inventory.Remove(client.PromoteItemNeed, client.PromoteItemCountNeed);
                                                            client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                            client.Entity.Class++;
                                                            dialog.Text("Congratulations! You have been promoted.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You don't meet the requierments.");
                                                            dialog.Option("Ahh.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    dialog.Text("Let me know what you want to learn.");
                                                    dialog.Option("XPSkills (Lvl 40).", 5);
                                                    dialog.Option("Hercules (Lvl 40).", 6);
                                                    dialog.Option("Golem. (Lvl 40).", 7);
                                                    dialog.Option("Spritual Healing. (Lvl 40).", 8);
                                                    dialog.Option("Nothing.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 5:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        dialog.Text("You have learned the XP Skills.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        client.AddSpell(LearnableSpell(1110));
                                                        client.AddSpell(LearnableSpell(1015));
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion
                                        #region Skills
                                        case 6:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1115)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the Hercules.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 7:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1270)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the Golem.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 8:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1190)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the Spritual Healing.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                                        #endregion
                            #endregion

                            #region Taoist Moon
                            case 10000:
                                {
                                    byte mClass = 142;
                                    byte MClass = 145;
                                    string Class = "fire taoist";
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                if (client.Entity.Class >= 100 && client.Entity.Class <= 101)
                                                {
                                                    dialog.Text("I am the master of the fire skills. As I see, you started your way on conquering this world. I will try to help you teaching you warrir skills and promoting you.");
                                                    dialog.Option("Promote me.", 100);
                                                    dialog.Option("Learn basic skills.", 200);
                                                    dialog.Option("Claim bound items.", 49);
                                                    dialog.Option("Thank you very much.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                    {
                                                        dialog.Text("I am the master of the fire skills. As I see, you started your way on conquering this world. I will try to help you teaching you warrir skills and promoting you.");
                                                        dialog.Option("Promote me.", 1);
                                                        dialog.Option("Learn skills.", 2);
                                                        dialog.Option("Learn basic skills.", 200);
                                                        dialog.Option("Claim bound items.", 49);
                                                        dialog.Option("Wait a minute.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                break;
                                            }
                                        #region BoundItems
                                        case 49:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.HeadgearClaim)
                                                    dialog.Option("Headgear (Lvl 15).", 50);
                                                if (!client.RingClaim)
                                                    dialog.Option("Bracelet (Lvl 15).", 51);
                                                if (!client.NecklaceClaim)
                                                    dialog.Option("Bag (Lvl 15).", 52);
                                                if (!client.ArmorClaim)
                                                    dialog.Option("Armor (Lvl 15).", 53);
                                                dialog.Option("Next.", 48);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 48:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.BootsClaim)
                                                    dialog.Option("Boots (Lvl 15).", 54);
                                                if (!client.TowerClaim)
                                                    dialog.Option("Tower (Lvl 100).", 55);
                                                if (!client.FanClaim)
                                                    dialog.Option("Fan (Lvl 100).", 56);
                                                if (!client.WeaponClaim)
                                                    dialog.Option("Weapon (Lvl 110).", 57);
                                                dialog.Option("Back.", 49);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 50:
                                            {
                                                uint itemid = 117009;
                                                byte level = 15;
                                                if (!client.HeadgearClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.HeadgearClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 51:
                                            {
                                                uint itemid = 152019;
                                                byte level = 15;
                                                if (!client.RingClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.RingClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 52:
                                            {
                                                uint itemid = 121029;
                                                byte level = 15;
                                                if (!client.NecklaceClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.NecklaceClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 53:
                                            {
                                                uint itemid = 134009;
                                                byte level = 15;
                                                if (!client.ArmorClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.ArmorClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 54:
                                            {
                                                uint itemid = 160019;
                                                byte level = 15;
                                                if (!client.BootsClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.BootsClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 55:
                                            {
                                                uint itemid = 202009;
                                                byte level = 100;
                                                if (!client.TowerClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.TowerClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 56:
                                            {
                                                uint itemid = 201009;
                                                byte level = 100;
                                                if (!client.FanClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.FanClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 57:
                                            {
                                                byte level = 100;
                                                if (!client.WeaponClaim)
                                                {
                                                    ISkill proff = null;
                                                    ushort maxlevel = 0;
                                                    foreach (var prof in client.Proficiencies.Values)
                                                    {
                                                        if (maxlevel < prof.Level && prof.ID != 0)
                                                        {
                                                            maxlevel = prof.Level;
                                                            proff = prof;
                                                        }
                                                    }
                                                    if (proff == null)
                                                        return;
                                                    uint itemid = (uint)(proff.ID * 1000 + 219);
                                                    if (!Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations.ContainsKey(itemid))
                                                    {
                                                        Console.WriteLine("invalid claim weapon " + itemid);
                                                        return;
                                                    }
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.WeaponClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion
                                        case 100:
                                            {
                                                if (client.Entity.Class >= 100 && client.Entity.Class <= 101)
                                                {
                                                    if (client.Entity.Class == 101)
                                                    {
                                                        dialog.Text("Do you want to become a fire taoist?");
                                                        dialog.Option("Yes sir.", 254);
                                                        dialog.Option("No thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("To promote now you need" + client.PromoteItemNameNeed + " level " + client.PromoteLevelNeed + ".");
                                                        dialog.Option("Promote me sir.", 254);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 254:
                                            {
                                                if (client.Entity.Class == 100)
                                                {
                                                    client.Entity.Class++;
                                                    dialog.Text("Congratulations! You have been promoted.");
                                                    dialog.Option("Thank you master.", 255);
                                                    dialog.Send();
                                                }
                                                else if (client.Entity.Class == 101)
                                                {
                                                    client.Entity.Class = 142;
                                                    dialog.Text("Congratulations! You have been promoted.");
                                                    dialog.Option("Thank you master.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 200:
                                            {
                                                if (client.Entity.Class >= 100)
                                                {
                                                    dialog.Text("Let me know what you want to learn.");
                                                    dialog.Option("Thunder (Lvl 1).", 205);
                                                    dialog.Option("Cure (Lvl 1).", 206);
                                                    dialog.Option("Meditation. (Lvl 40).", 207);
                                                    dialog.Option("Nothing.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 205:
                                            {
                                                if (client.Entity.Class >= 100)
                                                {
                                                    if (!client.AddSpell(LearnableSpell(1000)))
                                                    {
                                                        dialog.Text("You already know this skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        break;
                                                    }
                                                    dialog.Text("You have learned thunder.");
                                                    dialog.Option("Thank you.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 206:
                                            {
                                                if (client.Entity.Class >= 100)
                                                {
                                                    if (!client.AddSpell(LearnableSpell(1005)))
                                                    {
                                                        dialog.Text("You already know this skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        break;
                                                    }
                                                    dialog.Text("You have learned cure.");
                                                    dialog.Option("Thank you.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 207:
                                            {
                                                if (client.Entity.Class >= 100)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1195)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned meditation.");
                                                        dialog.Option("Thank you.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Class == MClass)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("To promote now you need" + client.PromoteItemNameNeed + " level " + client.PromoteLevelNeed + ".");
                                                        dialog.Option("Promote me sir.", 3);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Class == MClass)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        if (client.PromoteItemNeed == 721020)
                                                        {
                                                            if (client.Inventory.Remove("moonbox"))
                                                            {
                                                                client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                                client.Entity.Class++;
                                                                dialog.Text("Congratulations! You have been promoted.");
                                                                dialog.Option("Thank you master.", 255);
                                                                dialog.Send();
                                                            }

                                                            else
                                                            {
                                                                dialog.Text("You don't meet the requierments.");
                                                                dialog.Option("Ahh.", 255);
                                                                dialog.Send();
                                                            }
                                                            return;
                                                        }
                                                        if (client.Inventory.Contains(client.PromoteItemNeed, client.PromoteItemCountNeed) && client.Entity.Level >= client.PromoteLevelNeed)
                                                        {
                                                            client.Inventory.Remove(client.PromoteItemNeed, client.PromoteItemCountNeed);
                                                            client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                            client.Entity.Class++;
                                                            dialog.Text("Congratulations! You have been promoted.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You don't meet the requierments.");
                                                            dialog.Option("Ahh.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    dialog.Text("Let me know what you want to learn.");
                                                    dialog.Option("Fire (Lvl 42 + Thunder lvl 4).", 5);
                                                    dialog.Option("Bomb. (Lvl 43).", 6);
                                                    dialog.Option("FireCircle. (Lvl 48).", 7);
                                                    dialog.Option("FireRing. (Lvl 52).", 8);
                                                    dialog.Option("FireMeteor. (Lvl 55).", 9);
                                                    dialog.Option("Tornado (Lvl 81 + Fire lvl 3).", 10);
                                                    dialog.Option("Nothing.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 5:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 42)
                                                    {
                                                        if (client.Spells.ContainsKey(1000) && client.Spells[1000] != null && client.Spells[1000].Level == 4)
                                                        {
                                                            if (!client.AddSpell(LearnableSpell(1001)))
                                                            {
                                                                dialog.Text("You already know this skill.");
                                                                dialog.Option("Thank you master.", 255);
                                                                dialog.Send();
                                                                break;
                                                            }
                                                            dialog.Text("You have learned the fire.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need to know thunder very well to be able to learn the fire skill.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 42 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 10:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 81)
                                                    {
                                                        if (client.Spells.ContainsKey(1001) && client.Spells[1001] != null && client.Spells[1001].Level == 3)
                                                        {
                                                            if (!client.AddSpell(LearnableSpell(1002)))
                                                            {
                                                                dialog.Text("You already know this skill.");
                                                                dialog.Option("Thank you master.", 255);
                                                                dialog.Send();
                                                                break;
                                                            }
                                                            dialog.Text("You have learned the tornado.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need to know thunder very well to be able to learn the fire skill.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 81 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 6:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 43)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1160)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the bomb skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 43 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 7:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 48)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1120)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the fire circle skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 48 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 8:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 52)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1150)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the fire ring skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 52 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 9:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 55)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1180)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the fire meteor skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 55 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Taoist Star
                            case 30:
                                {
                                    byte mClass = 132;
                                    byte MClass = 135;
                                    string Class = "water taoist";
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                if (client.Entity.Class >= 100 && client.Entity.Class <= 101)
                                                {
                                                    dialog.Text("I am the master of the fire skills. As I see, you started your way on conquering this world. I will try to help you teaching you warrir skills and promoting you.");
                                                    dialog.Option("Promote me.", 100);
                                                    dialog.Option("Learn basic skills.", 200);
                                                    dialog.Option("Claim bound items.", 49);
                                                    dialog.Option("Thank you very much.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                    {
                                                        dialog.Text("I am the master of the water skills. The water skills, are not skills that would make wounds but heal them. As I see, you started your way on conquering this world. I will try to help you teaching you warrir skills and promoting you.");
                                                        dialog.Option("Promote me.", 1);
                                                        dialog.Option("Learn skills.", 2);
                                                        dialog.Option("Learn basic skills.", 200);
                                                        dialog.Option("Claim bound items.", 49);
                                                        dialog.Option("Wait a minute.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                break;
                                            }
                                        #region BoundItems
                                        case 49:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.HeadgearClaim)
                                                    dialog.Option("Headgear (Lvl 15).", 50);
                                                if (!client.RingClaim)
                                                    dialog.Option("Bracelet (Lvl 15).", 51);
                                                if (!client.NecklaceClaim)
                                                    dialog.Option("Bag (Lvl 15).", 52);
                                                if (!client.ArmorClaim)
                                                    dialog.Option("Armor (Lvl 15).", 53);
                                                dialog.Option("Next.", 48);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 48:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.BootsClaim)
                                                    dialog.Option("Boots (Lvl 15).", 54);
                                                if (!client.TowerClaim)
                                                    dialog.Option("Tower (Lvl 100).", 55);
                                                if (!client.FanClaim)
                                                    dialog.Option("Fan (Lvl 100).", 56);
                                                if (!client.WeaponClaim)
                                                    dialog.Option("Weapon (Lvl 110).", 57);
                                                dialog.Option("Back.", 49);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 50:
                                            {
                                                uint itemid = 117009;
                                                byte level = 15;
                                                if (!client.HeadgearClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.HeadgearClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 51:
                                            {
                                                uint itemid = 152019;
                                                byte level = 15;
                                                if (!client.RingClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.RingClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 52:
                                            {
                                                uint itemid = 121029;
                                                byte level = 15;
                                                if (!client.NecklaceClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.NecklaceClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 53:
                                            {
                                                uint itemid = 134009;
                                                byte level = 15;
                                                if (!client.ArmorClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.ArmorClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 54:
                                            {
                                                uint itemid = 160019;
                                                byte level = 15;
                                                if (!client.BootsClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.BootsClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 55:
                                            {
                                                uint itemid = 202009;
                                                byte level = 100;
                                                if (!client.TowerClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.TowerClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 56:
                                            {
                                                uint itemid = 201009;
                                                byte level = 100;
                                                if (!client.FanClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.FanClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 57:
                                            {
                                                byte level = 100;
                                                if (!client.WeaponClaim)
                                                {
                                                    ISkill proff = null;
                                                    ushort maxlevel = 0;
                                                    foreach (var prof in client.Proficiencies.Values)
                                                    {
                                                        if (maxlevel < prof.Level && prof.ID != 0)
                                                        {
                                                            maxlevel = prof.Level;
                                                            proff = prof;
                                                        }
                                                    }
                                                    if (proff == null)
                                                        return;
                                                    uint itemid = (uint)(proff.ID * 1000 + 219);
                                                    if (!Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations.ContainsKey(itemid))
                                                    {
                                                        Console.WriteLine("invalid claim weapon " + itemid);
                                                        return;
                                                    }
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database
                                                            .ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.WeaponClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion

                                        case 100:
                                            {
                                                if (client.Entity.Class >= 100 && client.Entity.Class <= 101)
                                                {
                                                    if (client.Entity.Class == 101)
                                                    {
                                                        dialog.Text("Do you want to become a water taoist?");
                                                        dialog.Option("Yes sir.", 254);
                                                        dialog.Option("No thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("To promote now you need" + client.PromoteItemNameNeed + " level " + client.PromoteLevelNeed + ".");
                                                        dialog.Option("Promote me sir.", 254);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 254:
                                            {
                                                if (client.Entity.Class == 100)
                                                {
                                                    client.Entity.Class++;
                                                    dialog.Text("Congratulations! You have been promoted.");
                                                    dialog.Option("Thank you master.", 255);
                                                    dialog.Send();
                                                }
                                                else if (client.Entity.Class == 101)
                                                {
                                                    client.Entity.Class = 132;
                                                    dialog.Text("Congratulations! You have been promoted.");
                                                    dialog.Option("Thank you master.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 200:
                                            {
                                                if (client.Entity.Class >= 100)
                                                {
                                                    dialog.Text("Let me know what you want to learn.");
                                                    dialog.Option("Thunder (Lvl 1).", 205);
                                                    dialog.Option("Cure (Lvl 1).", 206);
                                                    dialog.Option("Meditation. (Lvl 40).", 207);
                                                    dialog.Option("Nothing.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 205:
                                            {
                                                if (client.Entity.Class >= 100)
                                                {
                                                    if (!client.AddSpell(LearnableSpell(1000)))
                                                    {
                                                        dialog.Text("You already know this skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        break;
                                                    }
                                                    dialog.Text("You have learned thunder.");
                                                    dialog.Option("Thank you.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 206:
                                            {
                                                if (client.Entity.Class >= 100)
                                                {
                                                    if (!client.AddSpell(LearnableSpell(1005)))
                                                    {
                                                        dialog.Text("You already know this skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                        break;
                                                    }
                                                    dialog.Text("You have learned cure.");
                                                    dialog.Option("Thank you.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 207:
                                            {
                                                if (client.Entity.Class >= 100)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1195)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned meditation.");
                                                        dialog.Option("Thank you.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Class == MClass)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("To promote now you need" + client.PromoteItemNameNeed + " level " + client.PromoteLevelNeed + ".");
                                                        dialog.Option("Promote me sir.", 3);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Class == MClass)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        if (client.PromoteItemNeed == 721020)
                                                        {
                                                            if (client.Inventory.Remove("moonbox"))
                                                            {
                                                                client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                                client.Entity.Class++;
                                                                dialog.Text("Congratulations! You have been promoted.");
                                                                dialog.Option("Thank you master.", 255);
                                                                dialog.Send();
                                                            }

                                                            else
                                                            {
                                                                dialog.Text("You don't meet the requierments.");
                                                                dialog.Option("Ahh.", 255);
                                                                dialog.Send();
                                                            }
                                                            return;
                                                        }
                                                        if (client.Inventory.Contains(client.PromoteItemNeed, client.PromoteItemCountNeed) && client.Entity.Level >= client.PromoteLevelNeed)
                                                        {
                                                            client.Inventory.Remove(client.PromoteItemNeed, client.PromoteItemCountNeed);
                                                            client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                            client.Entity.Class++;
                                                            dialog.Text("Congratulations! You have been promoted.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You don't meet the requierments.");
                                                            dialog.Option("Ahh.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    dialog.Text("Let me know what you want to learn.");
                                                    dialog.Option("XP Revive (Lvl 1).", 5);
                                                    dialog.Option("Volcano (Lvl 1).", 6);
                                                    dialog.Option("Lightning (Lvl 1).", 7);
                                                    dialog.Option("HealingRain. (Lvl 40).", 8);
                                                    dialog.Option("StarOfAccuracy. (Lvl 40).", 9);
                                                    dialog.Option("MagicShield. (Lvl 40).", 10);
                                                    dialog.Option("Next.", 20);
                                                    dialog.Option("Nothing.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 20:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    dialog.Text("Let me know what you want to learn.");
                                                    dialog.Option("WaterDevil. (Lvl 40).", 21);
                                                    dialog.Option("Stigma. (Lvl 40).", 11);
                                                    dialog.Option("Invisibility. (Lvl 70).", 12);
                                                    dialog.Option("Pray. (Lvl 70).", 13);
                                                    dialog.Option("SpeedLightning (Lvl 70).", 14);
                                                    dialog.Option("AdvancedCure. (Lvl 80).", 15);
                                                    dialog.Option("Nectar. (Lvl 90).", 16);
                                                    dialog.Option("Back.", 2);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 5:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 1)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1050)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned xp revive skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 1 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 21:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1280)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You have learned water devil.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 6:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 1)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1125)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the volcano xp skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 1 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 7:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 1)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1010)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the lightning xp skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 1 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 8:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1055)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the fire healing rain.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 9:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1085)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the star of acurracy skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 10:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1090)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the magic shield skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 11:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1095)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the stigma skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 12:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 70)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1075)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the invisibility skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 13:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 70)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1100)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the pray skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 14:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 70)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(5001)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the speed lightning skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 15:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 80)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1175)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the advanced cure skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 16:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Level >= 80)
                                                    {
                                                        if (!client.AddSpell(LearnableSpell(1170)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                            break;
                                                        }
                                                        dialog.Text("You have learned the nectar skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Pirate lord
                            case 9391:
                                {
                                    byte mClass = 70;
                                    byte MClass = 75;
                                    string Class = "pirate";
                                    switch (npcRequest.OptionID)

                                    {
                                        case 0:
                                            {
                                                if (client.Entity.Class >= 70 && client.Entity.Class <= 75)
                                                {
                                                    dialog.Text("We Pirates are always in pursuit of freedorn and strength. The rapier and pistol stand for cruelty and mercilessness.");
                                                    dialog.Option("l want to get prormoted.", 1);
                                                    dialog.Option("Learn Class Skill.", 2);
                                                    dialog.Option("Claim Bound Items.", 49);
                                                    dialog.Option("Thank you verymuch.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {

                                                    dialog.Text("Sorry, but you are not a Pirate.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }

                                        #region Promotion
                                        case 1:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Class == MClass)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("To promote now you need" + client.PromoteItemNameNeed + " level " + client.PromoteLevelNeed + ".");
                                                        dialog.Option("Promote me sir.", 3);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Entity.Class >= mClass && client.Entity.Class <= MClass)
                                                {
                                                    if (client.Entity.Class == MClass)
                                                    {
                                                        dialog.Text("You cannot be promoted anymore. You have mastered your class.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        if (client.PromoteItemNeed == 721020)
                                                        {
                                                            if (client.Inventory.Remove("moonbox"))
                                                            {
                                                                client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                                client.Entity.Class++;
                                                                dialog.Text("Congratulations! You have been promoted.");
                                                                dialog.Option("Thank you master.", 255);
                                                                dialog.Send();
                                                            }
                                                            else
                                                            {
                                                                dialog.Text("You don't meet the requierments.");
                                                                dialog.Option("Ahh.", 255);
                                                                dialog.Send();
                                                            }
                                                            return;
                                                        }
                                                        if (client.Inventory.Contains(client.PromoteItemNeed, client.PromoteItemCountNeed) && client.Entity.Level >= client.PromoteLevelNeed)
                                                        {
                                                            client.Inventory.Remove(client.PromoteItemNeed, client.PromoteItemCountNeed);
                                                            client.Inventory.Add(client.PromoteItemGain, 0, 1);
                                                            client.Entity.Class++;
                                                            dialog.Text("Congratulations! You have been promoted.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You don't meet the requierments.");
                                                            dialog.Option("Ahh.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("I will not tell any of the " + Class + " secrets to another class, so, good bye.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion
                                        #region Skills
                                        case 2:
                                            {
                                                if (client.Entity.Class >= 0 && client.Entity.Class <= 75)
                                                {
                                                    dialog.Text("Which Pirate Skill do you want to learn?");
                                                    dialog.Option("Blade Tempest.", 6);
                                                    dialog.Option("Gale Bomb.", 7);
                                                    dialog.Option("Adrenaline Rush.", 8);
                                                    dialog.Option("Eagle Eye.", 9);
                                                    dialog.Option("Blackbeard`sRage.", 10);
                                                    dialog.Option("Kraken`sRevenge.", 11);
                                                    dialog.Option("Cannon Barrage.", 12);
                                                    dialog.Option("Next.", 5);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry. but you can't learn the skill.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 5:
                                            {
                                                if (client.Entity.Class >= 0 && client.Entity.Class <= 75)
                                                {
                                                    dialog.Text("Which skill do you want to learn?");
                                                    dialog.Option("Black Spot.", 13);
                                                    dialog.Option("Windstorm.", 14);
                                                    dialog.Option("ScurvyBomb.", 15);
                                                    dialog.Option("Previous page.", 2);
                                                    dialog.Send();

                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry. but you can't learn the skill.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 6:
                                            {
                                                if (client.Entity.Class >= 0 && client.Entity.Class <= 75)
                                                {
                                                    if (client.Entity.Level >= 15)
                                                    {
                                                        dialog.Text("You have learned BladeTempest.");
                                                        dialog.Option("Great.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(11110)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Great.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 15 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry. but you can't learn the skill.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 7:
                                            {
                                                if (client.Entity.Class >= 0 && client.Entity.Class <= 75)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        dialog.Text("You have learned the GaleBomb.");
                                                        dialog.Option("Great.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(11070)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Great.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry. but you can't learn the skill.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 8:
                                            {
                                                if (client.Entity.Class >= 0 && client.Entity.Class <= 75)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        dialog.Text("You have learned AdrenalineRush.");
                                                        dialog.Option("Great.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(11130)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Great.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but you can't learn the skill.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 9:
                                            {
                                                if (client.Entity.Class >= 0 && client.Entity.Class <= 75)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        dialog.Text("You have learned EagleEye.");
                                                        dialog.Option("Great.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(11030)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Great.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but you can't learn the skill.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 10:
                                            {
                                                if (client.Entity.Class >= 0 && client.Entity.Class <= 75)
                                                {
                                                    if (client.Entity.Level >= 40)
                                                    {
                                                        dialog.Text("You have learned Blackbeard`sRage.");
                                                        dialog.Option("Great.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(11060)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Great.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 40 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry. but you can't learn the skill.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 11:
                                            {
                                                if (client.Entity.Class >= 0 && client.Entity.Class <= 75)
                                                {
                                                    if (client.Entity.Level >= 70)
                                                    {
                                                        dialog.Text("You have learned Kraken`sRevenge.");
                                                        dialog.Option("Great.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(11100)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Great.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 70 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but you can't learn the skill.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 12:
                                            {
                                                if (client.Entity.Class >= 0 && client.Entity.Class <= 75)
                                                {
                                                    if (client.Entity.Level >= 15)
                                                    {
                                                        dialog.Text("You have learned CannonBarrage.");
                                                        dialog.Option("Great.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(11050)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Great.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 15 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but you can't learn the skill.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 13:
                                            {
                                                if (client.Entity.Class >= 0 && client.Entity.Class <= 75)
                                                {
                                                    if (client.Entity.Level >= 90)
                                                    {
                                                        dialog.Text("You have learned BlackSpot.");
                                                        dialog.Option("Great.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(11120)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Great.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 90 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but you can't learn the skill.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 14:
                                            {
                                                if (client.Entity.Class >= 0 && client.Entity.Class <= 75)
                                                {
                                                    if (client.Entity.Level >= 5)
                                                    {
                                                        dialog.Text("You have learned Windstorm.");
                                                        dialog.Option("Great.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(11140)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Great.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 5 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but you can't learn the skill.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 15:
                                            {
                                                if (client.Entity.Class >= 0 && client.Entity.Class <= 75)
                                                {
                                                    if (client.Entity.Level >= 5)
                                                    {
                                                        dialog.Text("You have learned ScurvyBomb.");
                                                        dialog.Option("Great.", 255);
                                                        dialog.Send();
                                                        if (!client.AddSpell(LearnableSpell(11040)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Great.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You need to be level 5 or more.");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but you can't learn the skill.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion
                                        #region BoundItems
                                        case 49:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.HeadgearClaim)
                                                    dialog.Option("Headgear (Lvl 15).", 50);
                                                if (!client.RingClaim)
                                                    dialog.Option("Ring (Lvl 15).", 51);
                                                if (!client.NecklaceClaim)
                                                    dialog.Option("Necklace (Lvl 15).", 52);
                                                if (!client.ArmorClaim)
                                                    dialog.Option("Armor (Lvl 15).", 53);
                                                dialog.Option("Next.", 48);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 48:
                                            {
                                                dialog.Text("We just found some equipment, and I thought that we should give them to our pupils so they can be less defeatable.");
                                                if (!client.BootsClaim)
                                                    dialog.Option("Boots (Lvl 15).", 54);
                                                if (!client.TowerClaim)
                                                    dialog.Option("Tower (Lvl 100).", 55);
                                                if (!client.FanClaim)
                                                    dialog.Option("Fan (Lvl 100).", 56);
                                                if (!client.WeaponClaim)
                                                    dialog.Option("Weapon (Lvl 110).", 57);
                                                dialog.Option("Back.", 49);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 50:
                                            {
                                                uint itemid = 144009;
                                                byte level = 15;
                                                if (!client.HeadgearClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);
                                                        item.ID = itemid;
                                                        item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.HeadgearClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 51:
                                            {
                                                uint itemid = 150039;
                                                byte level = 15;
                                                if (!client.RingClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);
                                                        item.ID = itemid;
                                                        item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.RingClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 52:
                                            {
                                                uint itemid = 120029;
                                                byte level = 15;
                                                if (!client.NecklaceClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);
                                                        item.ID = itemid;
                                                        item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.NecklaceClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 53:
                                            {
                                                uint itemid = 139009;
                                                byte level = 15;
                                                if (!client.ArmorClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);
                                                        item.ID = itemid;
                                                        item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.ArmorClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 54:
                                            {
                                                uint itemid = 160019;
                                                byte level = 15;
                                                if (!client.BootsClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);
                                                        item.ID = itemid;
                                                        item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.BootsClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 55:
                                            {
                                                uint itemid = 202009;
                                                byte level = 100;
                                                if (!client.TowerClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);
                                                        item.ID = itemid;
                                                        item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.TowerClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 56:
                                            {
                                                uint itemid = 201009;
                                                byte level = 100;
                                                if (!client.FanClaim)
                                                {
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);
                                                        item.ID = itemid;
                                                        item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.FanClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 57:
                                            {
                                                byte level = 100;
                                                if (!client.WeaponClaim)
                                                {
                                                    ISkill proff = null;
                                                    ushort maxlevel = 0;
                                                    foreach (var prof in client.Proficiencies.Values)
                                                    {
                                                        if (maxlevel < prof.Level && prof.ID != 0)
                                                        {
                                                            maxlevel = prof.Level;
                                                            proff = prof;
                                                        }
                                                    }
                                                    if (proff == null)
                                                        return;
                                                    uint itemid = 611219;
                                                    if (client.Entity.Level >= level)
                                                    {
                                                        ConquerItem item = new ConquerItem(true);

                                                        item.ID = itemid; item.Color = Conquer_Online_Server.Game.Enums.Color.White;
                                                        item.Durability = item.MaximDurability = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                                        item.Bound = true;
                                                        item.Plus = 4;
                                                        item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (client.Inventory.Add(item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd))
                                                        {
                                                            client.WeaponClaim = true;
                                                        }
                                                        else
                                                        {
                                                            dialog.Text("You need atleast one free slot in your inventory.");
                                                            dialog.Option("Alright.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("You don't have atleast level " + level + ".");
                                                        dialog.Option("Alright.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot claim it twice.");
                                                    dialog.Option("Alright.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        #endregion

                                    }
                                    break;
                                }
                            #endregion

                            #region MightyTao
                            case 35500:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("If you have reborn atleast one time, you can learn some great skills. With them you will be able to summon some misterious monsters. They will help you conquer this world much faster.");
                                                dialog.Option("Summon guard - 1 euxite ore.", 1);
                                                dialog.Option("Summon class monster - 1 gold ore rate5.", 2);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Reborn > 0)
                                                {
                                                    if (client.Inventory.Contains(1072031, 1))
                                                    {
                                                        client.Inventory.Remove(1072031, 1);
                                                        if (!client.AddSpell(LearnableSpell(4000)))
                                                        {
                                                            dialog.Text("You already know this skill.");
                                                            dialog.Option("Thank you master.", 255);
                                                            dialog.Send();
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot learn those skills until you reborn atleast once.");
                                                    dialog.Option("Alright", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Entity.Reborn > 0)
                                                {
                                                    if (client.Entity.Class >= 50 && client.Entity.Class <= 55)
                                                    {
                                                        dialog.Text("You cannot learn skills like this one. Ninjas don't need such thing. They are much more stronger than every other class.");
                                                        dialog.Option("Alright", 255);
                                                        dialog.Send();
                                                        break;
                                                    }
                                                    if (client.Inventory.Contains(1072054, 1))
                                                    {
                                                        client.Inventory.Remove(1072054, 1);
                                                        if (client.Entity.Class <= 15)
                                                            client.AddSpell(LearnableSpell(4050));
                                                        else if (client.Entity.Class <= 25)
                                                            client.AddSpell(LearnableSpell(4060));
                                                        else if (client.Entity.Class <= 45)
                                                            client.AddSpell(LearnableSpell(4070));
                                                        else if (client.Entity.Class <= 135)
                                                            client.AddSpell(LearnableSpell(4010));
                                                        else if (client.Entity.Class <= 145)
                                                            client.AddSpell(LearnableSpell(4020));
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You cannot learn those skills until you reborn atleast once.");
                                                    dialog.Option("Alright", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #endregion
                        }
                        break;
                    }
                #endregion
                #region Stables
                case 1006:
                    {
                        switch (client.ActiveNpc)
                        {
                            #region Stables
                            #region  Breeder
                            case 9883:
                                {
                                    Data data = new Data(true);
                                    data.ID = Data.OpenWindow;
                                    data.UID = client.Entity.UID;
                                    data.TimeStamp = Time32.Now;
                                    data.dwParam = Data.WindowCommands.Breeding;
                                    data.wParam1 = client.Entity.X;
                                    data.wParam2 = client.Entity.Y;
                                    client.Send(data);
                                    break;
                                }
                            #endregion
                            #region SkillTeacher
                            case 9881:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Ready to learn some great skills? Their prices are as good as they are.");
                                                dialog.Option("Riding - 50000 gold.", 1);
                                                dialog.Option("Spook - 100000 gold.", 2);
                                                dialog.Option("WarCry - 1000000 gold.", 3);
                                                dialog.Option("Nothing.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Entity.Money >= 50000)
                                                {
                                                    if (!client.AddSpell(LearnableSpell(7001)))
                                                    {
                                                        dialog.Text("You already know this skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        client.Entity.Money -= 50000;
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't meet the requierments.");
                                                    dialog.Option("Ahh sorry.", 255);
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Entity.Money >= 100000)
                                                {
                                                    if (!client.AddSpell(LearnableSpell(7002)))
                                                    {
                                                        dialog.Text("You already know this skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        client.Entity.Money -= 100000;
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't meet the requierments.");
                                                    dialog.Option("Ahh sorry.", 255);
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Entity.Money >= 1000000)
                                                {
                                                    if (!client.AddSpell(LearnableSpell(7003)))
                                                    {
                                                        dialog.Text("You already know this skill.");
                                                        dialog.Option("Thank you master.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        client.Entity.Money -= 1000000;
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't meet the requierments.");
                                                    dialog.Option("Ahh sorry.", 255);
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                            #endregion
                        }
                        break;
                    }
                #endregion
                #region Lottery
                case 700:
                    {
                        switch (client.ActiveNpc)
                        {
                            #region LuckyBox
                            case 925:
                            case 926:
                            case 927:
                            case 928:
                            case 929:
                            case 930:
                            case 931:
                            case 932:
                            case 933:
                            case 934:
                            case 935:
                            case 936:
                            case 937:
                            case 938:
                            case 939:
                            case 940:
                            case 942:
                            case 943:
                            case 944:
                            case 945:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                if (client.InLottery)
                                                {
                                                    dialog.Text("Do you really want to chose me?");
                                                    dialog.Option("Yes.", 1);
                                                    dialog.Option("No.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("Re-enter the lottery if you want to try me.");
                                                    dialog.Option("Ahh.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.InLottery)
                                                {
                                                    if (client.Inventory.Count == 40)
                                                    {
                                                        client.Send(Conquer_Online_Server.ServerBase.Constants.FullInventory);
                                                        return;
                                                    }
                                                    client.InLottery = false;
                                                tryagain:
                                                    int rand = Conquer_Online_Server.ServerBase.Kernel.Random.Next(Conquer_Online_Server.Database.LotteryTable.LotteryItems.Count);
                                                    var item = Conquer_Online_Server.Database.LotteryTable.LotteryItems[rand];
                                                    var Itemd = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
                                                    if (Itemd == null)
                                                        goto tryagain;
                                                    if (Conquer_Online_Server.ServerBase.Kernel.Rate(item.Rank, item.Chance) && Conquer_Online_Server.ServerBase.Kernel.Rate(item.Rank, 35 - item.Rank))
                                                    {
                                                        IConquerItem Item = new ConquerItem(true);
                                                        Item.ID = item.ID;
                                                        Item.Plus = item.Plus;
                                                        Item.Color = Conquer_Online_Server.Game.Enums.Color.Blue;
                                                        if (item.Sockets > 0)
                                                            Item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (item.Sockets > 1)
                                                            Item.SocketTwo = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        Item.Durability = Item.MaximDurability = Itemd.Durability;
                                                        client.Inventory.Add(Item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd);
                                                        if (item.Rank <= 4)
                                                        {
                                                            Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " won " + item.Name + " in lottery.", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                        }
                                                        else
                                                        {
                                                            if (Conquer_Online_Server.ServerBase.Kernel.Rate(item.Chance, 100))
                                                            {
                                                                Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " won " + item.Name + " in lottery.", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        goto tryagain;
                                                    }
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                        }
                        break;
                    }
                #endregion
                #region Lottery2
                case 701:
                    {
                        switch (client.ActiveNpc)
                        {
                            #region LuckyBox
                            case 9251:
                            case 9261:
                            case 9271:
                            case 9281:
                            case 9291:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                if (client.InLottery2)
                                                {
                                                    dialog.Text("Do you really want to chose me?");
                                                    dialog.Option("Yes.", 1);
                                                    dialog.Option("No.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("Re-enter the lottery if you want to try me.");
                                                    dialog.Option("Ahh.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.InLottery2)
                                                {
                                                    if (client.Inventory.Count == 40)
                                                    {
                                                        client.Send(Conquer_Online_Server.ServerBase.Constants.FullInventory);
                                                        return;
                                                    }
                                                    client.InLottery2 = false;
                                                tryagain:
                                                    int rand = Conquer_Online_Server.ServerBase.Kernel.Random.Next(Conquer_Online_Server.Database.LotteryTable2.LotteryItems.Count);
                                                    var item = Conquer_Online_Server.Database.LotteryTable2.LotteryItems[rand];
                                                    var Itemd = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
                                                    if (Itemd == null)
                                                        goto tryagain;
                                                    if (Conquer_Online_Server.ServerBase.Kernel.Rate(item.Rank, item.Chance) && Conquer_Online_Server.ServerBase.Kernel.Rate(item.Rank, 35 - item.Rank))
                                                    {
                                                        IConquerItem Item = new ConquerItem(true);
                                                        Item.ID = item.ID;
                                                        Item.Plus = item.Plus;
                                                        Item.Color = Conquer_Online_Server.Game.Enums.Color.Blue;
                                                        if (item.Sockets > 0)
                                                            Item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        if (item.Sockets > 1)
                                                            Item.SocketTwo = Conquer_Online_Server.Game.Enums.Gem.EmptySocket;
                                                        Item.Durability = Item.MaximDurability = Itemd.Durability;
                                                        client.Inventory.Add(Item, Conquer_Online_Server.Game.Enums.ItemUse.CreateAndAdd);
                                                        if (item.Rank <= 4)
                                                        {
                                                            Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " is so lucky to win " + item.Name + " in Magic Lottery.", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                        }
                                                        else
                                                        {
                                                            if (Conquer_Online_Server.ServerBase.Kernel.Rate(item.Chance, 100))
                                                            {
                                                                Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " won " + item.Name + " in Magic Lottery.", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        goto tryagain;
                                                    }
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                        }
                        break;
                    }
                #endregion
                #region ClassPkEscort
                case 7001:
                    {
                        switch (client.ActiveNpc)
                        {
                            #region ClassPkEscort
                            case 706:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                Conquer_Online_Server.Game.ConquerStructures.ClassPk.CheackAlive();
                                                dialog.Text("Hello there,do you want to claim ClassPk Prize you must be the only one Here to Claim It.");
                                                dialog.Option("ClaimPrize.", 1);
                                                dialog.Option("Just Passing By!", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (Conquer_Online_Server.Game.ConquerStructures.ClassPk.howmanyinmap == 1)
                                                {
                                                    dialog.Text("would you like to Claim the prize for ClassPk Tourment?");
                                                    dialog.Option("yes,please.", 2);
                                                    dialog.Option("Wait a minute.", 255);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry you must be the only one in the Map to claim the Prize");
                                                    dialog.Option("oh,Sorry.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (client.Entity.Class >= 10 && client.Entity.Class <= 15 && DateTime.Now.Minute >= 05 && DateTime.Now.Minute <= 59 && DateTime.Now.DayOfWeek == DayOfWeek.Saturday && DateTime.Now.Hour >= 20 && DateTime.Now.Hour <= 21)
                                                {
                                                    dialog.Text("You have won Trojan ClassPk would You like to ClaimPrize and Back to TwinCity?");
                                                    dialog.Option("Gimme My Prize.", 3);
                                                    dialog.Send();
                                                }
                                                else if (client.Entity.Class >= 20 && client.Entity.Class <= 25 && DateTime.Now.Minute >= 05 && DateTime.Now.Minute <= 59 && DateTime.Now.DayOfWeek == DayOfWeek.Sunday && DateTime.Now.Hour >= 20 && DateTime.Now.Hour <= 21)
                                                {
                                                    dialog.Text("You have won Warrior ClassPk would You like to ClaimPrize and Back to TwinCity?");
                                                    dialog.Option("Gimme My Prize.", 4);
                                                    dialog.Send();
                                                }
                                                else if (client.Entity.Class >= 40 && client.Entity.Class <= 45 && DateTime.Now.Minute >= 05 && DateTime.Now.Minute <= 59 && DateTime.Now.DayOfWeek == DayOfWeek.Friday && DateTime.Now.Hour >= 20 && DateTime.Now.Hour <= 21)
                                                {
                                                    dialog.Text("You have won Archer ClassPk would You like to ClaimPrize and Back to TwinCity?");
                                                    dialog.Option("Gimme My Prize.", 5);
                                                    dialog.Send();
                                                }
                                                else if (client.Entity.Class >= 50 && client.Entity.Class <= 55 && DateTime.Now.Minute >= 05 && DateTime.Now.Minute <= 59 && DateTime.Now.DayOfWeek == DayOfWeek.Tuesday && DateTime.Now.Hour >= 20 && DateTime.Now.Hour <= 21)
                                                {
                                                    dialog.Text("You have won Ninja ClassPk would You like to ClaimPrize and Back to TwinCity?");
                                                    dialog.Option("Gimme My Prize.", 6);
                                                    dialog.Send();
                                                }
                                                else if (client.Entity.Class >= 60 && client.Entity.Class <= 65 && DateTime.Now.Minute >= 05 && DateTime.Now.Minute <= 59 && DateTime.Now.DayOfWeek == DayOfWeek.Wednesday && DateTime.Now.Hour >= 20 && DateTime.Now.Hour <= 21)
                                                {
                                                    dialog.Text("You have won Monk ClassPk would You like to ClaimPrize and Back to TwinCity?");
                                                    dialog.Option("Gimme My Prize.", 7);
                                                    dialog.Send();
                                                }
                                                else if (client.Entity.Class >= 130 && client.Entity.Class <= 135 && DateTime.Now.Minute >= 05 && DateTime.Now.Minute <= 59 && DateTime.Now.DayOfWeek == DayOfWeek.Thursday && DateTime.Now.Hour >= 20 && DateTime.Now.Hour <= 21)
                                                {
                                                    dialog.Text("You have won Water ClassPk would You like to ClaimPrize and Back to TwinCity?");
                                                    dialog.Option("Gimme My Prize.", 8);
                                                    dialog.Send();
                                                }
                                                else if (client.Entity.Class >= 140 && client.Entity.Class <= 145 && DateTime.Now.Minute >= 05 && DateTime.Now.Minute <= 59 && DateTime.Now.DayOfWeek == DayOfWeek.Monday && DateTime.Now.Hour >= 20 && DateTime.Now.Hour <= 21)
                                                {
                                                    dialog.Text("You have won Fire ClassPk would You like to ClaimPrize and Back to TwinCity?");
                                                    dialog.Option("Gimme My Prize.", 9);
                                                    dialog.Send();
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry you can claim the Prize Btween 20:05 to 20:59 and must be the only Alive player Here");
                                                    dialog.Option("ok Sorry.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                Conquer_Online_Server.Game.ConquerStructures.ClassPk.ClassPks = false;
                                                client.Entity.Teleport(1002, 439, 387);
                                                client.Entity.ConquerPoints += 1000;
                                                client.Entity.TopTrojan += 1;
                                                client.Entity.AddFlag(Conquer_Online_Server.Network.GamePackets.Update.Flags.TopTrojan);
                                                Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations, " + client.Entity.Name + " has won TrojanPk War and  Claimed 1,000 cps!", System.Drawing.Color.White, Message.TopLeft), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                break;
                                            }
                                        case 4:
                                            {
                                                Conquer_Online_Server.Game.ConquerStructures.ClassPk.ClassPks = false;
                                                client.Entity.Teleport(1002, 439, 387);
                                                client.Entity.ConquerPoints += 1000;
                                                client.Entity.TopWarrior += 1;
                                                client.Entity.AddFlag(Conquer_Online_Server.Network.GamePackets.Update.Flags.TopWarrior);
                                                Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations, " + client.Entity.Name + " has won WarriorPk War and  Claimed 1,000 cps!", System.Drawing.Color.White, Message.TopLeft), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                break;
                                            }
                                        case 5:
                                            {
                                                Conquer_Online_Server.Game.ConquerStructures.ClassPk.ClassPks = false;
                                                client.Entity.Teleport(1002, 439, 387);
                                                client.Entity.ConquerPoints += 1000;
                                                client.Entity.TopArcher += 1;
                                                client.Entity.AddFlag(Conquer_Online_Server.Network.GamePackets.Update.Flags.TopArcher);
                                                Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations, " + client.Entity.Name + " has won ArcherPk War and  Claimed 1,000 cps!", System.Drawing.Color.White, Message.TopLeft), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                break;
                                            }
                                        case 6:
                                            {
                                                Conquer_Online_Server.Game.ConquerStructures.ClassPk.ClassPks = false;
                                                client.Entity.Teleport(1002, 439, 387);
                                                client.Entity.ConquerPoints += 1000;
                                                client.Entity.TopNinja += 1;
                                                client.Entity.AddFlag(Conquer_Online_Server.Network.GamePackets.Update.Flags.TopPirate);
                                                Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations, " + client.Entity.Name + " has won NinjaPk War and  Claimed 1,000 cps!", System.Drawing.Color.White, Message.TopLeft), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                break;
                                            }
                                        case 7:
                                            {
                                                Conquer_Online_Server.Game.ConquerStructures.ClassPk.ClassPks = false;
                                                client.Entity.Teleport(1002, 439, 387);
                                                client.Entity.ConquerPoints += 1000;
                                                client.Entity.TopMonk += 1;
                                                client.Entity.AddFlag(Conquer_Online_Server.Network.GamePackets.Update.Flags.Flashy);
                                                Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations, " + client.Entity.Name + " has won MonkPk War and  Claimed 1,000 cps!", System.Drawing.Color.White, Message.TopLeft), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                break;
                                            }
                                        case 8:
                                            {
                                                Conquer_Online_Server.Game.ConquerStructures.ClassPk.ClassPks = false;
                                                client.Entity.Teleport(1002, 439, 387);
                                                client.Entity.ConquerPoints += 1000;
                                                client.Entity.TopWaterTaoist += 1;
                                                client.Entity.AddFlag(Conquer_Online_Server.Network.GamePackets.Update.Flags.TopWaterTaoist);
                                                Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations, " + client.Entity.Name + " has won WaterTao Pk War and  Claimed 1,000 cps!", System.Drawing.Color.White, Message.TopLeft), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                break;
                                            }
                                        case 9:
                                            {
                                                Conquer_Online_Server.Game.ConquerStructures.ClassPk.ClassPks = false;
                                                client.Entity.Teleport(1002, 439, 387);
                                                client.Entity.ConquerPoints += 1000;
                                                client.Entity.TopFireTaoist += 1;
                                                client.Entity.AddFlag(Conquer_Online_Server.Network.GamePackets.Update.Flags.TopFireTaoist);
                                                Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations, " + client.Entity.Name + " has won FireTao Pk War and  Claimed 1,000 cps!", System.Drawing.Color.White, Message.TopLeft), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                        }
                        break;
                    }
                #endregion

            }

            switch (client.ActiveNpc)
            {
                #region Saddle seller
                case 11111:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Greetings! I'm a great seller, I have the most Saddle item ");
                                    dialog.Text("world. What do you want my brother!");
                                    dialog.Option("Saddle [100 Cps]", 1);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(85);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.ConquerPoints >= 100)
                                    {
                                        client.Inventory.Add(723903, 0, 1);

                                        client.Entity.ConquerPoints -= 100;
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have enough Cps!");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(85);
                                        dialog.Send();
                                    }
                                    break;
                                }

                        }
                        break;
                    }
                #endregion
                #region ClassPkEnvoy
                case 705:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello there,i can help you to Join ClassPk but you should Read the rules First before SignUp.");
                                    dialog.Option("SignUp.", 2);
                                    dialog.Option("Tell Me Rules.", 1);
                                    dialog.Option("Just Passing By!", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    dialog.Text("We have classPk Tourment EveryDay Every Class Have CustomDay Start At 20:00,Trojan ClassPk Start on Saturday");
                                    dialog.Text(",Warrior ClassPk Start on Sunday,Fire ClassPk Start on Monday,Ninja ClassPk Start on Tuesday,Water ClassPk Start on Thursday");
                                    dialog.Text(",Monk ClassPk Start on Wednesday,Archer ClassPk Start on Friday, Dont be late xD");
                                    dialog.Option("SignUp.", 2);
                                    dialog.Option("Just Passing By!", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 2:
                                {
                                    if (client.Entity.Class >= 10 && client.Entity.Class <= 15 && DateTime.Now.Hour == 20 && DateTime.Now.Minute <= 05 && DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
                                    {
                                        dialog.Popup("Trojan pk Tourment Has been Started would You like to Join It?", 3);

                                    }
                                    else if (client.Entity.Class >= 20 && client.Entity.Class <= 25 && DateTime.Now.Hour == 20 && DateTime.Now.Minute <= 05 && DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
                                    {
                                        dialog.Popup("Warriors pk Tourment Has been Started would You like to Join It?", 3);

                                    }
                                    else if (client.Entity.Class >= 40 && client.Entity.Class <= 45 && DateTime.Now.Hour == 20 && DateTime.Now.Minute <= 05 && DateTime.Now.DayOfWeek == DayOfWeek.Friday)
                                    {
                                        dialog.Popup("Archers pk Tourment Has been Started would You like to Join It?", 3);

                                    }
                                    else if (client.Entity.Class >= 50 && client.Entity.Class <= 55 && DateTime.Now.Hour == 20 && DateTime.Now.Minute <= 05 && DateTime.Now.DayOfWeek == DayOfWeek.Tuesday)
                                    {
                                        dialog.Popup("Ninjas pk Tourment Has been Started would You like to Join It?", 3);

                                    }
                                    else if (client.Entity.Class >= 60 && client.Entity.Class <= 65 && DateTime.Now.Hour == 20 && DateTime.Now.Minute <= 05 && DateTime.Now.DayOfWeek == DayOfWeek.Wednesday)
                                    {
                                        dialog.Popup("Monk pk Tourment Has been Started would You like to Join It?", 3);

                                    }
                                    else if (client.Entity.Class >= 130 && client.Entity.Class <= 135 && DateTime.Now.Hour == 20 && DateTime.Now.Minute <= 05 && DateTime.Now.DayOfWeek == DayOfWeek.Thursday)
                                    {
                                        dialog.Popup("WaterTao pk Tourment Has been Started would You like to Join It?", 3);

                                    }
                                    else if (client.Entity.Class >= 140 && client.Entity.Class <= 145 && DateTime.Now.Hour == 20 && DateTime.Now.Minute <= 05 && DateTime.Now.DayOfWeek == DayOfWeek.Monday)
                                    {
                                        dialog.Popup("FireTao pk Tourment Has been Started would You like to Join It?", 3);

                                    }
                                    else
                                    {
                                        dialog.Popup("Sorry there is no any Pk Tourment Running now for your class please Read the rules", 255);

                                    }
                                    break;
                                }
                            case 3:
                                {
                                    client.Entity.Teleport(7001, 25, 40);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Warden
                case 10082:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("I can take you out of the jail. Just tell me.");
                                    dialog.Option("Take me out.", 1);
                                    dialog.Option("Alright.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1002, 514, 356);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region FrozenGrottoGeneral
                case 27837:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("There is a dangeous frozen cavern south of nowhere! It's too dangerous for you to enter! Even Leroy Jenkins died there!");
                                    dialog.Option("I want to enter the grotto.", 3);
                                    dialog.Option("Blah, boring.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 3:
                                {
                                    dialog.Text("Well, ok. But I'll only let you go in there if you've voted for the establishment!\nOtherwise you will need a substantial bribe...!");
                                    dialog.Option("Here's 1,200 CPs.", 4);
                                    dialog.Option("I'm too poor.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 4:
                                {

                                    dialog.Text("A fine bribe! Although, you really should consider supporting the establishment!\n");
                                    dialog.Text("Ok, well.. Which floor of the Grotto do you want to enter?\n");
                                    dialog.Option("Floor 1 [Lv127]", 1);
                                    dialog.Option("Floor 2 [Lv132]", 2);
                                    dialog.Send();

                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1762, 61, 257);
                                    break;
                                }
                            case 2:
                                {
                                    client.Entity.Teleport(7007, 61, 257);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Tinter
                case 10064: //Tinter
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Select the item.");
                                    dialog.Option("Headgear.", 1);
                                    dialog.Option("Armor.", 3);
                                    dialog.Option("Shield.", 5);
                                    dialog.Option("I'm standing by.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                            case 3:
                            case 5:
                                {
                                    client.TinterItemSelect = npcRequest.OptionID;
                                    dialog.Text("Select the new color.");
                                    dialog.Option("Orange.", 13);
                                    dialog.Option("Light Blue.", 14);
                                    dialog.Option("Red.", 15);
                                    dialog.Option("Blue.", 16);
                                    dialog.Option("Yellow.", 17);
                                    dialog.Option("Purple.", 18);
                                    dialog.Option("White.", 19);
                                    dialog.Option("I'm standing by.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 13:
                            case 14:
                            case 15:
                            case 16:
                            case 17:
                            case 18:
                            case 19:
                                {
                                    if (client.TinterItemSelect == 0)
                                        return;
                                    IConquerItem item = client.Equipment.TryGetItem(client.TinterItemSelect);
                                    if (item == null || item.ID == 0)
                                    {
                                        dialog.Text("You don't have a item like this one equiped.");
                                        dialog.Send();
                                        break;
                                    }
                                    item.Color = (Conquer_Online_Server.Game.Enums.Color)(npcRequest.OptionID % 10);
                                    Conquer_Online_Server.Database.ConquerItemTable.UpdateColor(item, client);
                                    client.TinterItemSelect = 0;
                                    item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                    item.Send(client);
                                    item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Default;
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Lottery

                #region JewlarLau
                case 3953:
                case 2065:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Do you have gems? I'm a great fan of them... I'd give gems with better quality for 15 gems of a lower quality. As long as I'll have many more, I don't care about the quality. I think you know, quantity not quality...ha ha! what fools, they say quality is better than quantity but I don't care.");
                                    dialog.Option("I have 15 normal gems.", 25);
                                    dialog.Option("I have 15 refined gems.", 26);
                                    dialog.Option("I'm too poor.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 25:
                            case 26:
                                {
                                    client.JewelarLauKind = npcRequest.OptionID;
                                    dialog.Text("What gems?");
                                    dialog.Option("PhoenixGem.", 1);
                                    dialog.Option("DragonGem.", 11);
                                    dialog.Option("FuryGem.", 21);
                                    dialog.Option("RainbowGem.", 31);
                                    dialog.Option("KylinGem.", 41);
                                    dialog.Option("Next.", 50);
                                    dialog.Send();
                                    break;
                                }
                            case 50:
                                {
                                    dialog.Text("What gems?");
                                    dialog.Option("VioletGem.", 51);
                                    dialog.Option("MoonGem.", 61);
                                    dialog.Option("TortoiseGem.", 71);
                                    dialog.Option("ThunderGem.", 101);
                                    dialog.Option("GloryGem.", 121);
                                    dialog.Option("Back.", client.JewelarLauKind);
                                    dialog.Send();
                                    break;
                                }
                            default:
                                {
                                    if (npcRequest.OptionID == 255)
                                        return;
                                    byte gemid = (byte)(npcRequest.OptionID + client.JewelarLauKind - 25);
                                    uint findgemid = (uint)(700000 + gemid);
                                    uint givegemid = findgemid + 1;
                                    if (client.Inventory.Contains(findgemid, 15))
                                    {
                                        client.Inventory.Remove(findgemid, 15);
                                        client.Inventory.Add(givegemid, 0, 1);
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have enough " + (Conquer_Online_Server.Game.Enums.Gem)gemid + "s. Come back when you have all of them.");
                                        dialog.Option("Alright sir.", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #region LadyLuck
                case 924:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    if (client.InLottery)
                                    {
                                        dialog.Text("You may come back later, if you still want to try your luck. It will be free next time you want.");
                                        dialog.Option("Yes please, let me out.", 1);
                                        dialog.Option("No thank you.", 255);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("Thank you for trying out the lottery. Please come back any other time, we will wait you.");
                                        dialog.Option("Take me out.", 1);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1036, 219, 189);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #endregion
                #region Labirinth
                case 1153:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello there. Just let me know if you want to move to the second floor of the labirinth with a SkyToken or go to TwinCity for free.");
                                    dialog.Option("Second floor.", 1);
                                    dialog.Option("TwinCity.", 2);
                                    dialog.Option("Nothing.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Inventory.Contains(721537, 1))
                                    {
                                        client.Inventory.Remove(721537, 1);
                                        client.Entity.Teleport(1352, 027, 227);
                                    }
                                    else
                                    {
                                        dialog.Text("You don't meet the requierments.");
                                        dialog.Option("Ahh sorry.", 255);
                                    }
                                    break;
                                }
                            case 2:
                                {
                                    client.Entity.Teleport(1002, 428, 379);
                                    break;
                                }
                        }
                        break;
                    }
                case 1154:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello there. Just let me know if you want to move to the third floor of the labirinth with a EarthToken or go to TwinCity for free.");
                                    dialog.Option("Third floor.", 1);
                                    dialog.Option("TwinCity.", 2);
                                    dialog.Option("Nothing.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Inventory.Contains(721538, 1))
                                    {
                                        client.Inventory.Remove(721538, 1);
                                        client.Entity.Teleport(1353, 025, 268);
                                    }
                                    else
                                    {
                                        dialog.Text("You don't meet the requierments.");
                                        dialog.Option("Ahh sorry.", 255);
                                    }
                                    break;
                                }
                            case 2:
                                {
                                    client.Entity.Teleport(1002, 428, 379);
                                    break;
                                }
                        }
                        break;
                    }
                case 1155:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello there. Just let me know if you want to move to the fourth floor of the labirinth with a SoulToken or go to TwinCity for free.");
                                    dialog.Option("Fourth floor.", 1);
                                    dialog.Option("TwinCity.", 2);
                                    dialog.Option("Nothing.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Inventory.Contains(721539, 1))
                                    {
                                        client.Inventory.Remove(721539, 1);
                                        client.Entity.Teleport(1354, 005, 290);
                                    }
                                    else
                                    {
                                        dialog.Text("You don't meet the requierments.");
                                        dialog.Option("Ahh sorry.", 255);
                                    }
                                    break;
                                }
                            case 2:
                                {
                                    client.Entity.Teleport(1002, 428, 379);
                                    break;
                                }
                        }
                        break;
                    }
                case 1156:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello there. Just let me know if you want to go to TwinCity.");
                                    dialog.Option("TwinCity.", 1);
                                    dialog.Option("Nothing.", 255);
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1002, 428, 379);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Birth Villiage

                #region RecruitMaster
                case 1060:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("You are about to enter the wonderful world of Trinity Conquer!");
                                    dialog.Text("\n\nYou will have much to learn, to survive here. As the saying goes, if you know yourself and your enemy, you will never lose a battle!");
                                    dialog.Option("Got it!", 1);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    switch (client.Entity.Class)
                                    {
                                        case 50:
                                            {
                                                dialog.Text("What the..! Oh.. It's just you, Ninja!");
                                                dialog.Text("\n\nSuch a mysterious figures, cloaked in shadow.. Ninjas have the most devastating attacks");
                                                dialog.Text(", but the lowest defence and health of all classes. Their speed and surprising skills are what make");
                                                dialog.Text("are what make them such a dangerous force here!\n\nAlways be aware of your surroundings!\n");
                                                dialog.Option("I am like a shadow!", 2);
                                                dialog.Send();
                                                break;
                                            }
                                        case 100:
                                            {
                                                dialog.Text("Well hello there, young Taoist! Right now, you don't have any specialty in your magic skills.");
                                                dialog.Text("Once you train enough, you can be promoted to a Fire or Water Taoist, and then continure on your path to glory!");
                                                dialog.Option("Fire and Water Taoist?", 11);
                                                dialog.Send();
                                                break;
                                            }

                                    }
                                    break;
                                }
                            case 11:
                                {
                                    dialog.Text("Fire Taoists are able to smite their enemies at long range, as their spells cause much more damage than other Taoists.");
                                    dialog.Text("While the Water Taoists are adept at healing and reviving fallen comrades. Both paths offer their own choices.");
                                    dialog.Text("It's up to you to decide where your heart lies.");
                                    dialog.Option("I see.", 2);
                                    dialog.Send();
                                    break;
                                }
                            case 2:
                                {
                                    dialog.Text("In Conquer Online, Path Finding is efficient in helping you locate shops and places of intrest. ");
                                    dialog.Text("You can check the current map's list by clicking the \"Path Finding\" button to the right. ");
                                    dialog.Text("Just highlight where you would like to go and click, and you're on your way!");
                                    dialog.Option("Anything else?", 3);
                                    dialog.Send();
                                    break;
                                }
                            case 3:
                                {
                                    dialog.Text("If you click \"Status\" in the lower right corner of the screen you will be able to check your character level, status, and attributes.");
                                    dialog.Option("I see.", 4);
                                    dialog.Send();
                                    break;
                                }
                            case 4:
                                {
                                    dialog.Text("You can also check your equipment, weapon proficiency, skills, and skill levels by click the tabs on the left side of the Status window.");
                                    if (client.Entity.Class == 100)
                                    { dialog.Option("Got it!", 55); }
                                    else { dialog.Option("Got it!", 5); }
                                    dialog.Send();
                                    break;
                                }
                            case 5:
                                {
                                    dialog.Text("Now you should go speak with Old General Yang.\n I'm sure he will be able to teach you some more useful tips!");
                                    dialog.Option("Okay, thanks!", 6);
                                    dialog.Send();
                                    break;
                                }
                            case 55:
                                {
                                    dialog.Text("Now you should go speak with Taoist Star.\n I'm sure he will be able to teach you some more useful tips!");
                                    dialog.Option("Okay, thanks!", 66);
                                    dialog.Send();
                                    break;
                                }
                            case 6:
                                {
                                    new Message("You should follow the Recruit Master's advice!\nGo find Old General Yang.", System.Drawing.Color.Green, Message.PopUP);
                                    break;
                                }
                            case 66:
                                {
                                    new Message("You should follow the Recruit Master's advice!\nGo find Taoist Star.", System.Drawing.Color.Green, Message.PopUP);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #region Pharmacist
                case 10008:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hi! I sell all sorts of potions and town scrolls in all the citys.\nI also sell fireworks and skill books in the market.");
                                    dialog.Option("What potions?", 1);
                                    dialog.Option("Consult others.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    dialog.Text("Healing and mana potions.\nHealing potions make you healthy.\nMana potions will enable you to cast spells, If you have any.\n");
                                    dialog.Text("\nThat is all. If you have not talked to others NPCs...\nYou had better have a chat with them so that you can learn more.\n");
                                    dialog.Option("I see. Thanks.", 255);
                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #region WiseGuy
                case 100041:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Well, if you want to talk to any NPCs, just click them. Easy, huh?");
                                    dialog.Option("About my class...", 1);
                                    dialog.Option("Ah, Forget about it.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    switch (client.Entity.Class)
                                    {
                                        case 50:
                                            {
                                                dialog.Text("The Ninja is an expert in various oriental weapons, boasting swift and powerful melee attack skills. I know somebody. In Twin City there are merchants I know. you go talk to them, they'll sort you out. Got it?");
                                                break;
                                            }
                                        case 10:
                                            {
                                                dialog.Text("The Trojan is an expert in various oriental weapons, dual wield and a powerful melee attack skills. I know somebody. In Twin City there are merchants I know. you go talk to them, they'll sort you out. Got it?");
                                                break;
                                            }
                                        case 40:
                                            {
                                                dialog.Text("The Archer is an expert in Ranged oriental weapons, Ppowerful Ranged attack skills. I know somebody. In Twin City there are merchants I know. you go talk to them, they'll sort you out. Got it?");
                                                break;
                                            }
                                        case 20:
                                            {
                                                dialog.Text("The Warrior is an expert in various oriental weapons, two handed weapons, Sheald and a powerful melee attack skills. I know somebody. In Twin City there are merchants I know. you go talk to them, they'll sort you out. Got it?");
                                                break;
                                            }
                                        case 100:
                                            {
                                                dialog.Text("The Taoist is an expert in various Magic Spells, powerful melee Spells and skills. I know somebody. In Twin City there are merchants I know. you go talk to them, they'll sort you out. Got it?");
                                                break;
                                            }
                                    }
                                    dialog.Option("I see, thanks.", 0);
                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #region VilliageIdiot
                case 10009:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello, new blood! Welcome! It is good that you selected This class!");
                                    dialog.Option("Thank you.", 1);
                                    dialog.Option("Not a chance. Leave me be!", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    switch (client.Entity.Class)
                                    {
                                        case 10:
                                            {
                                                dialog.Text("Some handy weapons are essential for Trojans. But you'd never do that, Cause your're my friend now, right?");
                                                break;
                                            }
                                        case 40:
                                            {
                                                dialog.Text("Some handy weapons are essential for Archers. But you'd never do that, Cause your're my friend now, right?");
                                                break;
                                            }
                                        case 20:
                                            {
                                                dialog.Text("Some handy weapons are essential for Warriors. But you'd never do that, Cause your're my friend now, right?");
                                                break;
                                            }
                                        case 100:
                                            {
                                                dialog.Text("Some handy weapons are essential for Taoists. But you'd never do that, Cause your're my friend now, right?");
                                                break;
                                            }
                                        case 50:
                                            {
                                                dialog.Text("Some handy weapons are essential for Ninjas. But you'd never do that, Cause your're my friend now, right?");
                                                break;
                                            }
                                    }
                                    dialog.Option("Sure.. I'll be back in my next life.", 255);
                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #region Armorer
                case 10007:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Armorers swear only to provide the very best in defense.\nWhether it's robes or helmets, we have it all.");
                                    dialog.Option("I see. Where can I find an armorer?", 1);
                                    dialog.Option("Consult others.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    dialog.Text("Every city or major settlement has one.\nBut our armors very best from place to place.\nSome armorers have better helms, while others specialize in mail or helms.\n");
                                    dialog.Text("Just to be sure to buy armor without red text in the description.\nYou won't be able to wear those!\n");
                                    dialog.Option("I see. Thanks.", 255);
                                    dialog.Send();
                                    break;

                                }
                        }
                        break;
                    }
                #endregion

                #region Warehouseman
                case 10006:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Welcome! I run a warehouse in every city.\nYou can store your money and items in my warehouses, and retrieve them for free.");
                                    dialog.Option("Cool. How do I use them?", 1);
                                    dialog.Option("Consult others.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    dialog.Text("First, you find my warehouse men in your city..\nClick on him to see your storage box open up.\nTo deposit money, enter the amount in the bank field before clicking Deposit.\n");
                                    dialog.Text("Withdrawing money is the same.\n \nIf you want to put items in your storage space, just drag and drop.\nTaking them out only requires one click.\nAlso, your money is totalled from all warehouses.\n");
                                    dialog.Option("I see. Thanks.", 255);
                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #region Blacksmith
                case 10005:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("We blacksmiths can be found from North to South, East to West.\nWe promise a fine selection of weapons for you to purchase!");
                                    dialog.Option("Tell me more.", 1);
                                    dialog.Option("Consult others.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    dialog.Text("Let me tell you how to choose a good weapon.\nHover your mouse pointer over the weapon, check its stats and find a weapon with all white writing.\nIf there's red text, you won't be able to use it.");
                                    dialog.Text("After you buy it, you open your backpack, find the right item and right-click it to equip.\nIt's as easy as that!\n \nOh, and to sell an item, you just drag and drop to my shop!\n");
                                    dialog.Option("What about repairs?", 2);
                                    dialog.Option("Consult others.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 2:
                                {

                                    dialog.Text("First, unequip the item by double-clicking it in your status window.\nThen find me, click my repair button and click the item.");
                                    dialog.Option("Any other tips?", 3);
                                    dialog.Option("Consult others.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 3:
                                {

                                    dialog.Text("Yeah, some items are high quality: Normal, Refined, Unique, Elite, Super.\nThat's specialist stuff, only found in the market.\nThat is all. If you have not talked to other NPCs...\nYou had better have a chat with them so that you can learn more.");
                                    dialog.Option("Thanks.", 255);
                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #region GateMan
                case 10010:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Good day to you" + client.Entity.Name + "! I'm the gateman of the Birth Village.\nIs there any way I can help you?");
                                    dialog.Option("I'm ready to start the adventure.", 1);
                                    dialog.Option("I'm beyond help...", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    dialog.Text("Welcome to the world of Trinity Conquer Online!\nThe road to becoming a legend is both long and bumpy. You should work very hard to become great! Here is a quest for you. Please take this message to Kungfu Boy in Twin City. You will get a reward for your help.");
                                    dialog.Option("As you wish.", 2);
                                    dialog.Option("I need more advice.", 3);
                                    dialog.Option("I'll stay here for a while.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 2:
                                {
                                    client.Entity.Teleport(1002, 442, 457);
                                    client.Send(new Message("You've recived a present from the gateman and you agreed to take the message to Kungfu Boy in Twin City for him.", System.Drawing.Color.Green, Message.PopUP));
                                    break;

                                }
                            case 3:
                                {
                                    dialog.Text("You will soon be in Twin City. I advise you not to stray too far from the city gates. Don't leave the Wind Plains until you are truly ready. You wouldn't even cross the river until you've visited");
                                    dialog.Text("the job center for your first promotion. Open your backpack and drag some potion down into the quick slot bar. You will be able to use F1-F10 keys to use things you place in the quick slots. They should help you stay alive.");
                                    dialog.Option("Thanks.", 255);
                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }

                #endregion

                #region OldGeneralYang
                case 425:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Oh, I so long for the glory of the field, but I'm too old to go back out and deal with these youngsters...\n");
                                    dialog.Text("I see a spark in your eye that reminds me of my younger days... What can I do for you young one?");
                                    dialog.Option("I'm ready for Initiation.", 1);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    dialog.Text("It would be wise for you to learn alittle more about Conquer before you decide to head out on your own.");
                                    dialog.Option("Fill me in.", 2);
                                    dialog.Send();
                                    break;
                                }
                            case 2:
                                {
                                    dialog.Text("There are two kinds of skills in Conquer.\nOne is the active skills, which are activated through the use of your magic or stamina.");
                                    dialog.Option("And the other?", 3);
                                    dialog.Send();
                                    break;
                                }
                            case 3:
                                {
                                    dialog.Text("The other is known as a passive skill.\nPassive skills will automaticly activate if the situation warrants the passive skills use.");
                                    dialog.Option("Got it!", 4);
                                    dialog.Send();
                                    break;
                                }
                            case 4:
                                {
                                    dialog.Text("Well that is all I can tell you for today. It's time to eat!\nYou can talk to the Village Gateman when you are ready to get started.");
                                    dialog.Option("Okay", 255);
                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #endregion
                #region OUT
                case 9988:
                case 9989:
                case 9990:
                case 9991:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("In exchange of a fee of 500gold, I will teleport you back to the guild war map. Don't bother me if you are poor.");
                                    dialog.Option("Teleport me.", 1);
                                    dialog.Option("I'm too poor.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.Money >= 500)
                                    {
                                        client.Entity.Money -= 500;
                                        client.Entity.Teleport(1038, 348, 339);
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Warehousemen
                case 8:
                case 10012:
                case 10028:
                case 10011:
                case 10027:
                case 4101:
                case 44:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    INpc npc = null;
                                    if (client.Map.Npcs.TryGetValue(client.ActiveNpc, out npc))
                                    {
                                        if (client.WarehousePW == "")
                                            client.Send(new Message("To protect your items that are stored in warehouse, you should set an password at WHSGuardian.", System.Drawing.Color.Maroon, Message.TopLeft));
                                        else
                                        {
                                            if (!client.WarehouseOpen)
                                            {
                                                dialog.Text("Please tell me the password of your warehouse so I can open it. It's like a key, if you don't have it I can't do anything.");
                                                dialog.Input("Here:", 1, 8);
                                                dialog.Option("Nevermind.", 255);
                                                dialog.Send();
                                                return;
                                            }
                                        }
                                        client.WarehouseOpen = true;
                                        Data data = new Data(true);
                                        data.ID = Data.OpenWindow;
                                        data.UID = client.Entity.UID;
                                        data.TimeStamp = Time32.Now;
                                        data.dwParam = Data.WindowCommands.Warehouse;
                                        data.wParam1 = npc.X;
                                        data.wParam2 = npc.Y;
                                        client.Send(data);
                                    }
                                    break;
                                }
                            case 1:
                                {
                                    if (client.WarehouseOpenTries < 3)
                                    {
                                        client.WarehouseOpenTries++;
                                        if (npcRequest.Input == client.WarehousePW)
                                        {
                                            INpc npc = null;
                                            if (client.Map.Npcs.TryGetValue(client.ActiveNpc, out npc))
                                            {
                                                client.WarehouseOpen = true;
                                                Data data = new Data(true);
                                                data.ID = Data.OpenWindow;
                                                data.UID = client.Entity.UID;
                                                data.TimeStamp = Time32.Now;
                                                data.dwParam = 4;
                                                data.wParam1 = npc.X;
                                                data.wParam2 = npc.Y;
                                                client.Send(data);
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("Wrong password. Tries left: " + client.WarehouseOpenTries + ". Try again?");
                                            dialog.Input("Here:", 1, 8);
                                            dialog.Option("Alright.", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("You can try no more to open your warehouse. Come back later.");
                                        dialog.Option("Nevermind.", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region winner GW
                case 399813: //Arena npc
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Your guild Won the GuildWar?if so,you are rewarded with CPs and the special Aura");
                                    dialog.Option("Sure.", 1);
                                    dialog.Option("No Just joking.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    if (GuildWar.IsWar == false)
                                    {
                                        if (client.AsMember.Guild == GuildWar.PoleKeeper)
                                        {
                                            #region cheack
                                            if (client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                            {
                                                if (client.Entity.TopGuildLeader < 1)
                                                {
                                                    client.Entity.TopGuildLeader += 1;
                                                    client.Entity.ConquerPoints += 10000;
                                                   // client.Inventory.Add(723467, 0, 1);
                                                    foreach (Conquer_Online_Server.Client.GameState clients in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                                    {

                                                        if (clients.AsMember.IsOnline)
                                                        {
                                                            if (clients.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                                            {
                                                                clients.Send(new Message("LeaderGuild has only take your own", Color.White, 2005));
                                                                continue;
                                                            }
                                                            else
                                                            {
                                                                clients.Entity.ConquerPoints += 500;
                                                                clients.Send(new Message("The Guild Winner all his online member has take 500 cps gratz", Color.White, 2011));
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("you have taked your reward");
                                                    dialog.Option("Alright.", 255);
                                                }
                                            }
                                            else if (client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
                                            {
                                                if (client.Entity.TopDeputyLeader < 1)
                                                {
                                                    client.Entity.TopDeputyLeader += 1;
                                                    //client.Entity.ConquerPoints += 1000000;
                                                    //client.Inventory.Add(723467, 0, 1);

                                                }
                                                else
                                                {
                                                    dialog.Text("you have taked your reward");
                                                    dialog.Option("Alright.", 255);
                                                }
                                            }
                                            #endregion
                                            else
                                            {
                                                dialog.Text("you are not GuildLeader");
                                                dialog.Option("Alright.", 255);
                                            }
                                        }

                                        else
                                        {
                                            dialog.Text("you are not winner");
                                            dialog.Option("Alright.", 255);
                                        }
                                    }

                                    else
                                    {
                                        dialog.Text("guild war is on");
                                        dialog.Option("Alright.", 255);
                                    }
                                }
                                break;

                        }
                        break;
                    }
                #endregion
                #region Boxers
                case 180:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("If you want to leave just tell me when you are ready. It's free.\nYou will be teleported to the city you were in before coming here.");
                                    dialog.Option("I'm ready.", 1);
                                    dialog.Option("Wait a minute.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    int PrevMap = client.Entity.PreviousMapID;
                                    switch (PrevMap)
                                    {
                                        default:
                                            {
                                                client.Entity.Teleport(1002, 429, 378);
                                                break;
                                            }
                                        case 1000:
                                            {
                                                client.Entity.Teleport(1000, 500, 650);
                                                break;
                                            }
                                        case 1020:
                                            {
                                                client.Entity.Teleport(1020, 565, 562);
                                                break;
                                            }
                                        case 1011:
                                            {
                                                client.Entity.Teleport(1011, 188, 264);
                                                break;
                                            }
                                        case 1015:
                                            {
                                                client.Entity.Teleport(1015, 717, 571);
                                                break;
                                            }
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                case 181:
                case 182:
                case 183:
                case 184:
                case 185:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello " + client.Entity.Name + ", if your level is higher than 19, I can send you to a training ground in exchange of 1000 silvers. Be aware of the fact that you can't attack dumes with level higher than yours.");
                                    dialog.Option("Alright, let me in.", 1);
                                    dialog.Option("Nevermind", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.Level >= 20)
                                    {
                                        if (client.Entity.Money >= 1000)
                                        {
                                            client.Entity.Money -= 1000;
                                            client.Entity.Teleport(1039, 216, 214);
                                        }
                                        else
                                        {
                                            dialog.Text("You do not have 1000 silvers.");
                                            dialog.Option("Aww!", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("Your level is not high enough.");
                                        dialog.Option("Aww!", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                /////////////////////////////////////////////////////////
                #region WeeklyPkWar
                case 2314:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hey there " + client.Entity.Name + "Would you like to join the Weekly PKWar?  Only Starts on saturday at 23:00.");
                                    dialog.Option("Yes Please", 3);
                                    dialog.Option("I don't care.", 255);
                                    dialog.Send();
                                    break;
                                }

                            case 3:
                                {

                                    #region WpkWar

                                    if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday && (DateTime.Now.Hour == 23 && DateTime.Now.Minute <= 05))
                                    {
                                        if (client.Entity.Level >= 1 && client.Entity.Level <= 99)
                                        {
                                            if (!Kernel.WeeklyPkWar.AddMap.pk100.Contains(client.Entity.UID))
                                                Kernel.WeeklyPkWar.AddMap.pk100.Add(client.Entity.UID, client);
                                            client.Entity.Teleport(1508, 100, 100);
                                        }
                                        else if (client.Entity.Level >= 100 && client.Entity.Level <= 119)
                                        {
                                            if (!Kernel.WeeklyPkWar.AddMap.pk100119.Contains(client.Entity.UID))
                                                Kernel.WeeklyPkWar.AddMap.pk100119.Add(client.Entity.UID, client);
                                            client.Entity.Teleport(1507, 120, 120);
                                        }
                                        else if (client.Entity.Level >= 120 && client.Entity.Level <= 129)
                                        {
                                            if (!Kernel.WeeklyPkWar.AddMap.pk120130.Contains(client.Entity.UID))
                                                Kernel.WeeklyPkWar.AddMap.pk120130.Add(client.Entity.UID, client);
                                            client.Entity.Teleport(1506, 120, 120);
                                        }
                                        else if (client.Entity.Level >= 130)
                                        {
                                            if (!Kernel.WeeklyPkWar.AddMap.pk130.Contains(client.Entity.UID))
                                                Kernel.WeeklyPkWar.AddMap.pk130.Add(client.Entity.UID, client);
                                            client.Entity.Teleport(1505, 151, 151);
                                        }

                                    }
                                    else
                                    {
                                        dialog.Text("Weekly Pk War is held during Saturday at 16:04 ");
                                        dialog.Option("I don't care.", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    #endregion

                                }

                                break;
                        }
                        break;
                    }
                #endregion
                #region Winner of WeeklyPKWar NPC 2315
                case 2315:
                case 2355:
                case 2358:
                case 2357:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hey,you kill all here?");
                                    dialog.Option("Yes", 1);
                                    dialog.Option("no", 255);
                                    dialog.Option("Send me twinCity", 4);
                                    dialog.Send();
                                    break;
                                }
                            case 4:
                                {
                                    Kernel.WeeklyPkWar.RemovePlayersTorament(client);
                                    client.Entity.Teleport(1002, 429, 378);
                                    break;
                                }
                            case 1:
                                {
                                    int alive = 0;
                                    foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                        if (players.Entity.MapID >= 1505 && players.Entity.MapID < 1508 && (!players.Entity.Dead))
                                            alive++;

                                    #region pkjan

                                    if (client.Entity.Level >= 1 && client.Entity.Level <= 99)
                                    {
                                        if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday && DateTime.Now.Minute >= 25)
                                        {
                                            if (alive == 1)
                                            {
                                                Kernel.WeeklyPkWar.AddMap.pk100.Remove(client.Entity.UID);
                                                client.Entity.Teleport(1002, 429, 378);
                                                client.Entity.ConquerPoints += 50000;
                                                client.Entity.WeeklyPKChampion = 1;
                                                Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win WeeklyPkWar (1-99) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                //GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Troajan War(0-100) and win 5ExpBalls ,50.000 cps and TopClass ");
                                            }
                                            else
                                            {
                                                dialog.Text("Sorry, but its Players on map");
                                                dialog.Option("Ah,my bad", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        }
                                    }
                                    else if (client.Entity.Level >= 100 && client.Entity.Level <= 119)
                                    {
                                        if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday && DateTime.Now.Minute >= 25)
                                        {
                                            if (alive == 1)
                                            {
                                                Kernel.WeeklyPkWar.AddMap.pk100119.Remove(client.Entity.UID);
                                                client.Entity.Teleport(1002, 429, 378);

                                                client.Entity.ConquerPoints += 50000;
                                                client.Entity.WeeklyPKChampion = 1;
                                                Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win WeeklyPkWar (100-119) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                //Kernel.SendWorldMessage(2005, System.Drawing.Color.Red, "Congratulations! " + client.Entity.Name+ " has win Class Troajan War (100-119) and win 5ExpBalls ,50.000 cps and TopClass ");
                                            }
                                            else
                                            {
                                                dialog.Text("Sorry, but its Players on map");
                                                dialog.Option("Ah,my bad", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        }
                                    }
                                    else if (client.Entity.Level >= 120 && client.Entity.Level <= 129)
                                    {
                                        if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday && DateTime.Now.Minute >= 25)
                                        {
                                            if (alive == 1)
                                            {
                                                Kernel.WeeklyPkWar.AddMap.pk120130.Remove(client.Entity.UID);
                                                client.Entity.Teleport(1002, 429, 378);

                                                client.Entity.ConquerPoints += 50000;
                                                client.Entity.WeeklyPKChampion = 1;
                                                Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win WeeklyPkWar (120-129) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                //GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Troajan War (120-130) and win 5ExpBalls ,50.000 cps and TopClass ");
                                            }
                                            else
                                            {
                                                dialog.Text("Sorry, but its Players on map");
                                                dialog.Option("Ah,my bad", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        }
                                    }
                                    else if (client.Entity.Level >= 140)
                                    {
                                        if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday && DateTime.Now.Minute >= 25)
                                        {
                                            if (alive == 1)
                                            {
                                                Kernel.WeeklyPkWar.AddMap.pk130.Remove(client.Entity.UID);
                                                client.Entity.Teleport(1002, 429, 378);
                                                client.Entity.ConquerPoints += 50000;
                                                client.Entity.WeeklyPKChampion = 1;
                                                Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win WeeklyPkWar (130-140) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                // GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Troajan War 130+ and win 5ExpBalls ,50.000 cps and TopClass ");
                                            }
                                            else
                                            {
                                                dialog.Text("Sorry, but its Players on map");
                                                dialog.Option("Ah,my bad", 255);
                                                dialog.Send();
                                                break;
                                            }

                                        }
                                    }
                                    #endregion

                                }
                                break;
                        }
                        break;
                    }
                #endregion
                ////////////////////    /////////////////////      ///////////////////////////       ////////////////////////
                #region ElitePk
                case 2359:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hey there " + client.Entity.Name + "Would you like to join the ElitePkWar? Only in Monday at 18:00.");
                                    dialog.Option("Yes Please", 3);
                                    dialog.Option("I don't care.", 255);
                                    dialog.Send();
                                    break;
                                }

                            case 3:
                                {

                                    #region ElitePk

                                    if (DateTime.Now.DayOfWeek == DayOfWeek.Monday && DateTime.Now.Hour == 23 && DateTime.Now.Minute >= 19 && DateTime.Now.Minute < 24)
                                    {

                                        if (client.Entity.Level >= 1 && client.Entity.Level <= 99)
                                        {
                                            if (!Kernel.ElitePk.AddMap.pk100.Contains(client.Entity.UID))
                                                Kernel.ElitePk.AddMap.pk100.Add(client.Entity.UID, client);
                                            client.Entity.Teleport(1526, 100, 100);
                                        }
                                        else if (client.Entity.Level >= 100 && client.Entity.Level <= 119)
                                        {
                                            if (!Kernel.ElitePk.AddMap.pk100119.Contains(client.Entity.UID))
                                                Kernel.ElitePk.AddMap.pk100119.Add(client.Entity.UID, client);
                                            client.Entity.Teleport(1527, 100, 120);
                                        }
                                        else if (client.Entity.Level >= 120 && client.Entity.Level <= 129)
                                        {
                                            if (!Kernel.ElitePk.AddMap.pk120130.Contains(client.Entity.UID))
                                                Kernel.ElitePk.AddMap.pk120130.Add(client.Entity.UID, client);
                                            client.Entity.Teleport(1528, 100, 120);
                                        }
                                        else if (client.Entity.Level >= 140)
                                        {
                                            if (!Kernel.ElitePk.AddMap.pk130.Contains(client.Entity.UID))
                                                Kernel.ElitePk.AddMap.pk130.Add(client.Entity.UID, client);
                                            client.Entity.Teleport(1525, 161, 200);
                                        }

                                    }
                                    else
                                    {
                                        dialog.Text("ElitePk War is held during at 23:19 on Monday ");
                                        dialog.Option("I don't care.", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    #endregion

                                }

                                break;
                        }
                        break;
                    }
                #endregion
                #region elitepk oprize
                case 23152:
                case 23552:
                case 23582:
                case 23572:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hey,you kill all here?");
                                    dialog.Option("Yes", 1);
                                    dialog.Option("no", 255);
                                    dialog.Option("Send me twinCity", 4);
                                    dialog.Send();
                                    break;
                                }
                            case 4:
                                {
                                    Kernel.ElitePk.RemovePlayersTorament(client);
                                    client.Entity.Teleport(1002, 429, 378);
                                    break;
                                }
                            case 1:
                                {
                                    int alive = 0;
                                    foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                        if (players.Entity.MapID >= 1525 && players.Entity.MapID < 1528 && (!players.Entity.Dead))
                                            alive++;

                                    #region ElitePk

                                    if (client.Entity.Level >= 1 && client.Entity.Level <= 99)
                                    {
                                        if (DateTime.Now.DayOfWeek == DayOfWeek.Monday && DateTime.Now.Hour == 23 && DateTime.Now.Minute >= 25)
                                        {
                                            if (alive == 1)
                                            {
                                                Kernel.ElitePk.AddMap.pk100.Remove(client.Entity.UID);
                                                client.Entity.Teleport(1002, 429, 378);
                                                client.Entity.ConquerPoints += 50000;
                                                client.Entity.ElitePK = 1;
                                                Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win ElitePk (1-99) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                //GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Troajan War(0-100) and win 5ExpBalls ,50.000 cps and TopClass ");
                                            }
                                            else
                                            {
                                                dialog.Text("Sorry, but its Players on map");
                                                dialog.Option("Ah,my bad", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        }
                                    }
                                    else if (client.Entity.Level >= 100 && client.Entity.Level <= 119)
                                    {
                                        if (DateTime.Now.DayOfWeek == DayOfWeek.Monday && DateTime.Now.Hour == 23 && DateTime.Now.Minute >= 25)
                                        {
                                            if (alive == 1)
                                            {
                                                Kernel.ElitePk.AddMap.pk100119.Remove(client.Entity.UID);
                                                client.Entity.Teleport(1002, 429, 378);

                                                client.Entity.ConquerPoints += 50000;
                                                client.Entity.ElitePK = 1;
                                                Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win ElitePk (100-119) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                //Kernel.SendWorldMessage(2005, System.Drawing.Color.Red, "Congratulations! " + client.Entity.Name+ " has win Class Troajan War (100-119) and win 5ExpBalls ,50.000 cps and TopClass ");
                                            }
                                            else
                                            {
                                                dialog.Text("Sorry, but its Players on map");
                                                dialog.Option("Ah,my bad", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        }
                                    }
                                    else if (client.Entity.Level >= 120 && client.Entity.Level <= 129)
                                    {
                                        if (DateTime.Now.DayOfWeek == DayOfWeek.Monday && DateTime.Now.Hour == 23 && DateTime.Now.Minute >= 25)
                                        {
                                            if (alive == 1)
                                            {
                                                Kernel.ElitePk.AddMap.pk120130.Remove(client.Entity.UID);
                                                client.Entity.Teleport(1002, 429, 378);

                                                client.Entity.ConquerPoints += 50000;
                                                client.Entity.ElitePK = 1;
                                                Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win ElitePk (120-129) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                //GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Troajan War (120-130) and win 5ExpBalls ,50.000 cps and TopClass ");
                                            }
                                            else
                                            {
                                                dialog.Text("Sorry, but its Players on map");
                                                dialog.Option("Ah,my bad", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        }
                                    }
                                    else if (client.Entity.Level >= 140)
                                    {
                                        if (DateTime.Now.DayOfWeek == DayOfWeek.Monday && DateTime.Now.Hour == 23 && DateTime.Now.Minute >= 25)
                                        {
                                            if (alive == 1)
                                            {
                                                Kernel.ElitePk.AddMap.pk130.Remove(client.Entity.UID);
                                                client.Entity.Teleport(1002, 429, 378);
                                                client.Entity.ConquerPoints += 50000;

                                                client.Entity.ElitePK = 1;
                                                Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win ElitePk (130-140) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                // GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Troajan War 130+ and win 5ExpBalls ,50.000 cps and TopClass ");
                                            }
                                            else
                                            {
                                                dialog.Text("Sorry, but its Players on map");
                                                dialog.Option("Ah,my bad", 255);
                                                dialog.Send();
                                                break;
                                            }

                                        }
                                    }
                                    #endregion

                                }

                                break;
                        }
                        break;
                    }
                #endregion
                #region Seller/moonbox/emerald 422 395
                case 338111:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hey how I can help you ? ");
                                    dialog.Option("Buy YanYangFroot - 10k CPS ", 1);
                                    dialog.Option("Buy MoonBox - 5000 CPS ", 2);//721080
                                    dialog.Option("Buy EuxeniteOre - 5000 CPS ", 3);
                                    dialog.Option("Buy Emerald - 5000 CPS ", 4);
                                    dialog.Option("Buy MeteorTear - 5000 CPS ", 5);
                                    dialog.Option("Buy Bomb 5000 CPS ", 6);
                                    dialog.Option("Buy 1 Orched for 5000 cps ", 7);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(80);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    if (client.Entity.ConquerPoints >= 10000)
                                    {
                                        client.Entity.ConquerPoints -= 10000;
                                        client.Inventory.Add(711188, 0, 1);

                                    }
                                    else
                                    {
                                        dialog.Text("You don't have 10000 ConquerPoints.");
                                        dialog.Option("Ah, my bad", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 2:
                                {

                                    if (client.Entity.ConquerPoints >= 5000)
                                    {
                                        client.Entity.ConquerPoints -= 5000;
                                        client.Inventory.Add(721080, 0, 1);

                                    }
                                    else
                                    {
                                        dialog.Text("You don't have 5000 ConquerPoints.");
                                        dialog.Option("Ah, my bad", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 3:
                                {

                                    if (client.Entity.ConquerPoints >= 5000)
                                    {
                                        client.Entity.ConquerPoints -= 5000;
                                        client.Inventory.Add(1072031, 0, 1);

                                    }
                                    else
                                    {
                                        dialog.Text("You don't have 5000 ConquerPoints.");
                                        dialog.Option("Ah, my bad", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 4:
                                {
                                    if (client.Entity.ConquerPoints >= 5000)
                                    {
                                        client.Entity.ConquerPoints -= 5000;
                                        client.Inventory.Add(1080001, 0, 1);
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have 5000 ConquerPoints.");
                                        dialog.Option("Ah, my bad", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 5:
                                {
                                    if (client.Entity.ConquerPoints >= 5000)
                                    {
                                        client.Entity.ConquerPoints -= 5000;
                                        client.Inventory.Add(1088002, 0, 1);
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have 5000 ConquerPoints.");
                                        dialog.Option("Ah, my bad", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 6:
                                {
                                    if (client.Entity.ConquerPoints >= 5000)
                                    {
                                        client.Entity.ConquerPoints -= 5000;
                                        client.Inventory.Add(721261, 0, 1);

                                    }
                                    else
                                    {
                                        dialog.Text("You don't have 5000 ConquerPoints.");
                                        dialog.Option("Ah, my bad", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 7:
                                {
                                    if (client.Entity.ConquerPoints >= 5000)
                                    {

                                        client.Entity.ConquerPoints -= 5000;
                                        client.Inventory.Add(753001, 0, 1);
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have 5000 ConquerPoints.");
                                        dialog.Option("Ah, my bad", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 8:
                                {
                                    if (client.Entity.ConquerPoints >= 5000)
                                    {
                                        client.Inventory.Add(1080001, 0, 1);
                                        client.Entity.ConquerPoints -= 500;
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have 5000 ConquerPoints.");
                                        dialog.Option("Ah, my bad", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                /////////////////////////////////////////              ////////////////////////////
                #region ElitePkWar
                case 23555:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hey there " + client.Entity.Name + "Would you like to join the ElitePkWar?.");
                                    dialog.Option("Yes Please", 1);
                                    dialog.Option("I don't care.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if ((DateTime.Now.Hour == 23 && DateTime.Now.Minute <= 05))
                                    {
                                        Random R = new Random();
                                        int Nr = R.Next(1, 10);
                                        if (Nr == 1) client.Entity.Teleport(1507, 114, 078);
                                        if (Nr == 2) client.Entity.Teleport(1507, 96, 87);
                                        if (Nr == 3) client.Entity.Teleport(1507, 142, 88);
                                        if (Nr == 4) client.Entity.Teleport(1507, 115, 115);
                                        if (Nr == 5) client.Entity.Teleport(1507, 98, 130);
                                        if (Nr == 6) client.Entity.Teleport(1507, 96, 153);
                                        if (Nr == 7) client.Entity.Teleport(1507, 112, 162);
                                        if (Nr == 8) client.Entity.Teleport(1507, 130, 166);
                                        if (Nr == 9) client.Entity.Teleport(1507, 139, 114);
                                        if (Nr == 10) client.Entity.Teleport(1507, 156, 119);
                                    }
                                    else
                                    {
                                        // client.Entity.TitleActivated = 15;
                                        dialog.Text("ElitePkWar is held during at 23:00 ");
                                        dialog.Option("I don't care.", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region [LeadSage]
                case 355915:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                dialog.Text(
                                    "Hello, my friend. Are you here to join the Sage sub-class? Before we start, "
                                    + "please allow me to introduce this sub-class to you. Sages have strong "
                                    + "spiritual powers and have a gruesome ability to reduce a target`s Magical "
                                    + "Defense. This is very helpful in defeating those who might underestimate "
                                    + "your power! Would you like to join us? After you join this sub-class, you can "
                                    + "level it up and get promoted to reduce more of your target`s Magical Defense.");
                                if (!client.Entity.SubClasses.Classes.ContainsKey((byte)Game.ClassID.Sage))
                                    dialog.Option("Yes, I`d like to join it.", 1);
                                dialog.Option("I want to get promoted.", 2);
                                dialog.Link("How can I get promoted?", 3);
                                dialog.Link("Not my concern.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 1:
                                dialog.Text(
                                    "I`m glad that you are willing to be one of us. I`m sure you will be a fantastic "
                                    + "Sage. Still, there are a few requiriments you need to meet. Though players "
                                    + "of all classes can join us, we only accept players who are over level 70, and it "
                                    + "takes 20 Lucky Amulets to pay the tuition fee. After joining the Sage sub-class, "
                                    + "click open your character sheet and you`ll find the sub-class button on the "
                                    + "left-hand corner. You may level up your sub-class on the sub-class button sheet. You "
                                    + "need to meet a certain sub-class level to get promoted to higher sub-class "
                                    + "phases.");
                                dialog.Link("I see. Count me in.", 100);
                                dialog.Link("Oh, it does not suit me.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 2:
                                if (!client.Entity.SubClasses.Classes.ContainsKey((byte)ClassID.Sage))
                                {
                                    dialog.Text(
                                        "You are not a Sage yet and can`t get promoted. Do you want to join the "
                                        + "Sage sub-class now?");
                                    dialog.Link("Yes, I`d like to join.", 1);
                                    dialog.Link("Oh. Not now.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text(
                                       "To promote to Phase " + (client.Entity.SubClasses.Classes[(byte)ClassID.Sage].Phase + 1).ToString() + " you must meet the requirements. have you meet "
                                       + "them into the sub-class sheet?");
                                    dialog.Link("Positive.", 200);
                                    dialog.Link("Oh. not yet.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                            case 3:
                                dialog.Text(
                                    "Good day! Please spare me a few minutes so that I can tell you about the "
                                    + "sub-classes in Twin City. Each Sub-Class has 9 phases, and the higher the "
                                    + "phase is, the more bonus effects the sub-class will offer. But keep in mind "
                                    + "that these sub-classes also have a level system and you need to level them "
                                    + "up before you can get promoted. You can level up your sub-class by gaining "
                                    + "study points.");
                                dialog.Link("How can I get study points?", 30);
                                dialog.Link("Oh.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 30:
                                dialog.Text(
                                    "Well, the only way to get those points is to read the sub-class books, such as "
                                    + "the Diligence Book. When you`ve gained enough study points, open the "
                                    + "sub-class sheet from the character panel and level up the sub-class there. "
                                    + "Monsters in the wild are always bothering young adventurers, so you might "
                                    + "find some books from them.");
                                dialog.Link("Okay.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 100:
                                if (PacketHandler.PassLearn((byte)ClassID.Sage, client.Entity))
                                {
                                    client.Entity.SubClasses.Classes.Add((byte)ClassID.Sage, new Conquer_Online_Server.Game.SubClass() { ID = (byte)ClassID.Sage, Level = 1, Phase = 1 });
                                    Database.SubClassTable.Insert(client.Entity, (byte)ClassID.Sage);
                                    dialog.Text(
                                        "Congratulations! You`ve learned the Sage way. Hope you use this power "
                                        + "for the good of us all.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text(
                                        "I`m sorry, you need to give me 20 Lucky Amulets and "
                                        + "reach level 70 to join us.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                            case 200:
                                if (client.Entity.SubClasses.Classes[(byte)ClassID.Sage].Phase == 9)
                                {
                                    dialog.Text("Your sub-class phase is already 9, you can`t promote it anymore!");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                    return;
                                }
                                if (client.Entity.SubClasses.Classes[(byte)ClassID.Sage].Phase < client.Entity.SubClasses.Classes[(byte)ClassID.Sage].Level)
                                {
                                    client.Entity.SubClasses.Classes[(byte)ClassID.Sage].Phase++;
                                    dialog.Text("You have promoted your sub-class successfully.");
                                    dialog.Link("Oh, Thanks.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                    Database.SubClassTable.Update(client.Entity, client.Entity.SubClasses.Classes[(byte)ClassID.Sage]);
                                }
                                else
                                {
                                    dialog.Text("I`m sorry, you don`t meet the requirements yet.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                        }
                        break;
                    }
                #endregion
                #region [LeadWarlock]
                case 355914:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                dialog.Text(
                                    "Good day! Have you ever wondered what a Warlock is? Well, please allow "
                                    + "me to introduce this sub-class to you. Warlocks are masters of the "
                                    + "psionic energies and can increase their chances of casting spells with 2x "
                                    + "Magical Attack. Isn`t that wonderful? Would you like to join us? After you join "
                                    + "this sub-class, you can level it up and get promoted to increase your power!");
                                if (!client.Entity.SubClasses.Classes.ContainsKey((byte)ClassID.Warlock))
                                    dialog.Link("Yes, I`d like to join it.", 1);
                                dialog.Link("I want to get promoted.", 2);
                                dialog.Link("How can I get promoted?", 3);
                                dialog.Link("Not my concern.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 1:
                                dialog.Text(
                                    "I`m glad that you are willing to be one of us. I`m sure you will make a great "
                                    + "Warlock. Still, there are a few requiriments you need to meet. Though players "
                                    + "of all classes can join us, we only accept players who are over level 70, and it "
                                    + "takes 10 Bombs to pay the tuition fee. After joining the Warlock sub-class, "
                                    + "click open your character sheet and you`ll find the sub-class button on the "
                                    + "left-hand corner. You may level up your sub-class on the sub-class button sheet. You "
                                    + "need to meet a certain sub-class level to get promoted to higher sub-class "
                                    + "phases.");
                                dialog.Link("I see. Count me in.", 100);
                                dialog.Link("Oh, it does not suit me.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 2:
                                if (!client.Entity.SubClasses.Classes.ContainsKey((byte)ClassID.Warlock))
                                {
                                    dialog.Text(
                                        "You are not a Warlock yet and can`t get promoted. Do you want to join the "
                                        + "Warlock sub-class now?");
                                    dialog.Link("Yes, I`d like to join.", 1);
                                    dialog.Link("Oh. Not now.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text(
                                       "To promote to Phase " + (client.Entity.SubClasses.Classes[(byte)ClassID.Warlock].Phase + 1).ToString() + " you must meet the requirements. have you meet "
                                       + "them into the sub-class sheet?");
                                    dialog.Link("Positive.", 200);
                                    dialog.Link("Oh. not yet.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                            case 3:
                                dialog.Text(
                                    "Good day! Please spare me a few minutes so that I can tell you about the "
                                    + "sub-classes in Twin City. Each Sub-Class has 9 phases, and the higher the "
                                    + "phase is, the more bonus effects the sub-class will offer. But keep in mind "
                                    + "that these sub-classes also have a level system and you need to level them "
                                    + "up before you can get promoted. You can level up your sub-class by gaining "
                                    + "study points.");
                                dialog.Link("How can I get study points?", 30);
                                dialog.Link("Oh.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 30:
                                dialog.Text(
                                    "Well, the only way to get those points is to read the sub-class books, such as "
                                    + "the Diligence Book. When you`ve gained enough study points, open the "
                                    + "sub-class sheet from the character panel and level up the sub-class there. "
                                    + "Monsters in the wild are always bothering young adventurers, so you might "
                                    + "find some books from them.");
                                dialog.Link("Okay.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 100:
                                if (PacketHandler.PassLearn((byte)ClassID.Warlock, client.Entity))
                                {
                                    client.Entity.SubClasses.Classes.Add((byte)ClassID.Warlock, new Conquer_Online_Server.Game.SubClass() { ID = (byte)ClassID.Warlock, Level = 1, Phase = 1 });
                                    Database.SubClassTable.Insert(client.Entity, (byte)ClassID.Warlock);
                                    dialog.Text(
                                        "Congratulations! You`ve learned the Warlock way. Hope you use this power "
                                        + "for the good of us all.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text(
                                        "I`m sorry, you need to give me 10 Bombs and "
                                        + "reach level 70 to join us.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                            case 200:
                                if (client.Entity.SubClasses.Classes[(byte)ClassID.Warlock].Phase == 9)
                                {
                                    dialog.Text("Your sub-class phase is already 9, you can`t promote it anymore!");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                    return;
                                }
                                if (client.Entity.SubClasses.Classes[(byte)ClassID.Warlock].Phase < client.Entity.SubClasses.Classes[(byte)ClassID.Warlock].Level)
                                {
                                    client.Entity.SubClasses.Classes[(byte)ClassID.Warlock].Phase++;
                                    dialog.Text("You have promoted your sub-class successfully.");
                                    dialog.Link("Oh, Thanks.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                    Database.SubClassTable.Update(client.Entity, client.Entity.SubClasses.Classes[(byte)ClassID.Warlock]);
                                }
                                else
                                {
                                    dialog.Text("I`m sorry, you don`t meet the requirements yet.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                        }
                        break;
                    }
                #endregion
                #region [LeadPerformer]
                case 355913:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                dialog.Text(
                                    "Hello there! Please allow me to introduce to you the sub-class of Performers to you. "
                                    + "Performers are gifted in the harmonizing of song and swordplay into "
                                    + "beautiful, unique dances. These dances will surely make you the center of "
                                    + "people`s attention! Would you like to join us? After you join this sub-class, you "
                                    + "can level it up and get promoted to learn more stylish dances.");
                                if (!client.Entity.SubClasses.Classes.ContainsKey((byte)ClassID.Performer))
                                    dialog.Option("Yes, I`d like to join it.", 1);
                                dialog.Option("I want to get promoted.", 2);
                                dialog.Option("How can I get promoted?", 3);
                                dialog.Option("Learn Dances", 50);
                                dialog.Option("Not my concern.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 1:
                                dialog.Text(
                                    "I`m glad that you are willing to be one of us. I`m sure your dances will be very "
                                    + "charming. Still, there are a few requiriments you need to meet. Though "
                                    + "players of all classes can join us, we only accept players who are over level "
                                    + "70, and it takes 15 Orchids to pay the tuition fee. After joining the Performer "
                                    + "sub-class, click open your character sheet and you`ll find the "
                                    + "sub-class button on the left-hand corner. You may level up your sub-class on "
                                    + "the sub-class button sheet. You need to meet a certain sub-class level to get "
                                    + "promoted to higher sub-class phases.");
                                dialog.Option("I see. Count me in.", 100);
                                dialog.Option("Oh, it does not suit me.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 2:
                                if (!client.Entity.SubClasses.Classes.ContainsKey((byte)ClassID.Performer))
                                {
                                    dialog.Text(
                                        "You are not a Performer yet and can`t get promoted. Do you want to join the "
                                        + "Performer sub-class now?");
                                    dialog.Option("Yes, I`d like to join.", 1);
                                    dialog.Option("Oh. Not now.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text(
                                       "To promote to Phase " + (client.Entity.SubClasses.Classes[(byte)ClassID.Performer].Phase + 1).ToString() + " you must meet the requirements. have you meet "
                                       + "them into the sub-class sheet?");
                                    dialog.Option("Positive.", 200);
                                    dialog.Option("Oh. not yet.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                            case 3:
                                dialog.Text(
                                    "Good day! Please spare me a few minutes so that I can tell you about the "
                                    + "sub-classes in Twin City. Each Sub-Class has 9 phases, and the higher the "
                                    + "phase is, the more bonus effects the sub-class will offer. But keep in mind "
                                    + "that these sub-classes also have a level system and you need to level them "
                                    + "up before you can get promoted. You can level up your sub-class by gaining "
                                    + "study points.");
                                dialog.Option("How can I get study points?", 30);
                                dialog.Option("Oh.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 30:
                                dialog.Text(
                                    "Well, the only way to get those points is to read the sub-class books, such as "
                                    + "the Diligence Book. When you`ve gained enough study points, open the "
                                    + "sub-class sheet from the character panel and level up the sub-class there. "
                                    + "Monsters in the wild are always bothering young adventurers, so you might "
                                    + "find some books from them.");
                                dialog.Option("Okay.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 100:
                                if (PacketHandler.PassLearn((byte)ClassID.Performer, client.Entity))
                                {
                                    client.Entity.SubClasses.Classes.Add((byte)ClassID.Performer, new Conquer_Online_Server.Game.SubClass() { ID = (byte)ClassID.Performer, Level = 1, Phase = 1 });
                                    Database.SubClassTable.Insert(client.Entity, (byte)ClassID.Performer);
                                    dialog.Text(
                                        "Congratulations! You`ve learned the Performer way. Hope you use this power "
                                        + "for the good of us all.");
                                    dialog.Option("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text(
                                        "I`m sorry, you need to give me 15 Orchids and "
                                        + "reach level 70 to join us.");
                                    dialog.Option("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                            #region Skills

                            case 50:
                                {

                                    if (client.Entity.SubClasses.Classes[(byte)ClassID.Performer].Phase >= 1)
                                    {
                                        dialog.Text("Which aura do you want to learn?");
                                        dialog.Option("BattleDance (Lvl 1).", 13);
                                        dialog.Option("Triumph (Lvl 3)", 14);
                                        dialog.Option("StepStomp (Lvl 5)", 15);
                                        dialog.Option("Moonlight (Lvl 7)", 16);
                                        dialog.Option("SnowWind (Lvl 9)", 17);

                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("The ancient secrets of the Peformer is not for trade.\nIf you wish to learn the secrets of the peformer come back in another life. Good bye.");
                                        dialog.Option("Alright.", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }

                            case 13:
                                {
                                    if (client.Entity.SubClasses.Classes[(byte)ClassID.Performer].Phase >= 1)
                                    {
                                        if (client.Entity.Level >= 1)
                                        {
                                            client.AddSpell(new Spell(true) { ID = 1415 });
                                            dialog.Text("You have learned BattleDance.");
                                            dialog.Option("Thank you master.", 255);
                                            dialog.Send();
                                            if (!client.AddSpell(LearnableSpell(1415)))
                                            {
                                                dialog.Text("You already know this skill.");
                                                dialog.Option("Thank you master.", 255);
                                                dialog.Send();
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("You need to be level 1 or more.");
                                            dialog.Option("Alright.", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("The ancient secrets of the Peformer is not for trade.\nIf you wish to learn the secrets of the Peformer come back in another life. Good bye.");
                                        dialog.Option("Alright.", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 14:
                                {
                                    if (client.Entity.SubClasses.Classes[(byte)ClassID.Performer].Phase >= 3)
                                    {
                                        if (client.Entity.Level >= 20)
                                        {
                                            client.AddSpell(new Spell(true) { ID = 1416 });
                                            dialog.Text("You have learned Triumph.");
                                            dialog.Option("Thank you master.", 255);
                                            dialog.Send();
                                            if (!client.AddSpell(LearnableSpell(1416)))
                                            {
                                                dialog.Text("You already know this skill.");
                                                dialog.Option("Thank you master.", 255);
                                                dialog.Send();
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("You need to be level 20 or more.");
                                            dialog.Option("Alright.", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("The ancient secrets of the Pefromer is not for trade.\nIf you wish to learn the secrets of the Peformer come back in another life. Good bye.");
                                        dialog.Option("Alright.", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 15:
                                {
                                    if (client.Entity.SubClasses.Classes[(byte)ClassID.Performer].Phase >= 5)
                                    {
                                        if (client.Entity.Level >= 100)
                                        {
                                            client.AddSpell(new Spell(true) { ID = 1417 });
                                            dialog.Text("You have learned StepStomp.");
                                            dialog.Option("Thank you master.", 255);
                                            dialog.Send();
                                            if (!client.AddSpell(LearnableSpell(1417)))
                                            {
                                                dialog.Text("You already know this skill.");
                                                dialog.Option("Thank you master.", 255);
                                                dialog.Send();
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("You need to be level 100 or more.");
                                            dialog.Option("Alright.", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("The ancient secrets of the Peformer is not for trade.\nIf you wish to learn the secrets of the Peformer come back in another life. Good bye.");
                                        dialog.Option("Alright.", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 16:
                                {
                                    if (client.Entity.SubClasses.Classes[(byte)ClassID.Performer].Phase >= 7)
                                    {
                                        if (client.Entity.Level >= 100)
                                        {
                                            client.AddSpell(new Spell(true) { ID = 1418 });
                                            dialog.Text("You have learned Moonlight.");
                                            dialog.Option("Thank you master.", 255);
                                            dialog.Send();
                                            if (!client.AddSpell(LearnableSpell(1418)))
                                            {
                                                dialog.Text("You already know this skill.");
                                                dialog.Option("Thank you master.", 255);
                                                dialog.Send();
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("You need to be level 100 or more.");
                                            dialog.Option("Alright.", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("The ancient secrets of the Peformer is not for trade.\nIf you wish to learn the secrets of the Peformer come back in another life. Good bye.");
                                        dialog.Option("Alright.", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 17:
                                {
                                    if (client.Entity.SubClasses.Classes[(byte)ClassID.Performer].Phase >= 9)
                                    {
                                        if (client.Entity.Level >= 100)
                                        {
                                            client.AddSpell(new Spell(true) { ID = 1419 });
                                            dialog.Text("You have learned SnowWind.");
                                            dialog.Option("Thank you master.", 255);
                                            dialog.Send();
                                            if (!client.AddSpell(LearnableSpell(1419)))
                                            {
                                                dialog.Text("You already know this skill.");
                                                dialog.Option("Thank you master.", 255);
                                                dialog.Send();
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("You need to be level 100 or more.");
                                            dialog.Option("Alright.", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("The ancient secrets of the Peformer is not for trade.\nIf you wish to learn the secrets of the Pefrormer come back in another life. Good bye.");
                                        dialog.Option("Alright.", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 18:
                                {
                                    if (client.Entity.SubClasses.Classes[(byte)ClassID.Performer].Phase == 9)
                                    {
                                        if (client.Entity.Level >= 100)
                                        {
                                            client.AddSpell(new Spell(true) { ID = 1423 });
                                            dialog.Text("You have learned Fire Elemental Aura.");
                                            dialog.Option("Thank you master.", 255);
                                            dialog.Send();
                                            if (!client.AddSpell(LearnableSpell(1423)))
                                            {
                                                dialog.Text("You already know this skill.");
                                                dialog.Option("Thank you master.", 255);
                                                dialog.Send();
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("You need to be level 100 or more.");
                                            dialog.Option("Alright.", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                        dialog.Option("Alright.", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 19:
                                {
                                    if (client.Entity.SubClasses.Classes[(byte)ClassID.Performer].Phase == 9)
                                    {
                                        if (client.Entity.Level >= 100)
                                        {
                                            dialog.Text("You have learned Earth Elemental Aura.");
                                            dialog.Option("Thank you master.", 255);
                                            dialog.Send();
                                            if (!client.AddSpell(LearnableSpell(10424)))
                                            {
                                                dialog.Text("You already know this skill.");
                                                dialog.Option("Thank you master.", 255);
                                                dialog.Send();
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("You need to be level 100 or more.");
                                            dialog.Option("Alright.", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("The ancient secrets of the monk is not for trade.\nIf you wish to learn the secrets of the monk come back in another life. Good bye.");
                                        dialog.Option("Alright.", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            #endregion
                            case 200:
                                if (client.Entity.SubClasses.Classes[(byte)ClassID.Performer].Phase == 9)
                                {
                                    dialog.Text("Your sub-class phase is already 9, you can`t promote it anymore!");
                                    dialog.Option("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                    return;
                                }
                                if (client.Entity.SubClasses.Classes[(byte)ClassID.Performer].Phase < client.Entity.SubClasses.Classes[(byte)ClassID.Performer].Level)
                                {
                                    client.Entity.SubClasses.Classes[(byte)ClassID.Performer].Phase++;
                                    Conquer_Online_Server.Database.SubClassTable.Update(client.Entity, client.Entity.SubClasses.Classes[(byte)ClassID.Performer]);
                                    Conquer_Online_Server.Database.SubClassTable.Update(client.Entity);
                                    dialog.Text("You have promoted your sub-class successfully.");
                                    dialog.Option("Oh, Thanks.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text("I`m sorry, you don`t meet the requirements yet.");
                                    dialog.Option("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                        }
                        break;
                    }
                #endregion
                #region [LeadApothecary]
                case 355912:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                dialog.Text(
                                    "Hello there! Please allow me to introduce to you the sub-class of the "
                                    + "Apothecary. An Apothecary is a master of various oriental herbs and can use  "
                                    + "their healing powers to protect themselves from poison damage. Would you "
                                    + "like to join us? After you join this sub-class, you can level it up and get "
                                    + "promoted to gain more protection.");
                                if (!client.Entity.SubClasses.Classes.ContainsKey((byte)ClassID.Apothecary))
                                    dialog.Link("Yes, I`d like to join it.", 1);
                                dialog.Link("I want to get promoted.", 2);
                                dialog.Link("How can I get promoted?", 3);
                                dialog.Link("Not my concern.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 1:
                                dialog.Text(
                                    "I`m glad that you desire to become one of us. I`m sure you`ll make a capable  "
                                    + "Apothecary. Still, there are a few requiriments you need to meet. Though "
                                    + "players of all classes can join us, we only accept players who are over level "
                                    + "70, and it takes 10 Meteor Tears to pay the tuition fee. After joining the "
                                    + "Apothecary sub-class, click open your character sheet and you`ll find the "
                                    + "sub-class button on the left-hand corner. You may level up your sub-class on "
                                    + "the sub-class button sheet. You need to meet a certain sub-class level to get "
                                    + "promoted to higher sub-class phases.");
                                dialog.Link("I see. Count me in.", 100);
                                dialog.Link("Oh, it does not suit me.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 2:
                                if (!client.Entity.SubClasses.Classes.ContainsKey((byte)ClassID.Apothecary))
                                {
                                    dialog.Text(
                                        "You are not a Apothecary yet and can`t get promoted. Do you want to join the "
                                        + "Apothecary sub-class now?");
                                    dialog.Link("Yes, I`d like to join.", 1);
                                    dialog.Link("Oh. Not now.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text(
                                       "To promote to Phase " + (client.Entity.SubClasses.Classes[(byte)ClassID.Apothecary].Phase + 1).ToString() + " you must meet the requirements. have you meet "
                                       + "them into the sub-class sheet?");
                                    dialog.Link("Positive.", 200);
                                    dialog.Link("Oh. not yet.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                            case 3:
                                dialog.Text(
                                    "Good day! Please spare me a few minutes so that I can tell you about the "
                                    + "sub-classes in Twin City. Each Sub-Class has 9 phases, and the higher the "
                                    + "phase is, the more bonus effects the sub-class will offer. But keep in mind "
                                    + "that these sub-classes also have a level system and you need to level them "
                                    + "up before you can get promoted. You can level up your sub-class by gaining "
                                    + "study points.");
                                dialog.Link("How can I get study points?", 30);
                                dialog.Link("Oh.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 30:
                                dialog.Text(
                                    "Well, the only way to get those points is to read the sub-class books, such as "
                                    + "the Diligence Book. When you`ve gained enough study points, open the "
                                    + "sub-class sheet from the character panel and level up the sub-class there. "
                                    + "Monsters in the wild are always bothering young adventurers, so you might "
                                    + "find some books from them.");
                                dialog.Link("Okay.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 100:
                                if (PacketHandler.PassLearn((byte)ClassID.Apothecary, client.Entity))
                                {
                                    client.Entity.SubClasses.Classes.Add((byte)ClassID.Apothecary, new Conquer_Online_Server.Game.SubClass() { ID = (byte)ClassID.Apothecary, Level = 1, Phase = 1 });
                                    Database.SubClassTable.Insert(client.Entity, (byte)ClassID.Apothecary);
                                    dialog.Text(
                                        "Congratulations! You`ve learned the Apothecary way. Hope you use this power "
                                        + "for the good of us all.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text(
                                        "I`m sorry, you need to give me 10 Meteor Tears and "
                                        + "reach level 70 to join us.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                            case 200:
                                if (client.Entity.SubClasses.Classes[(byte)ClassID.Apothecary].Phase == 9)
                                {
                                    dialog.Text("Your sub-class phase is already 9, you can`t promote it anymore!");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                    return;
                                }
                                if (client.Entity.SubClasses.Classes[(byte)ClassID.Apothecary].Phase < client.Entity.SubClasses.Classes[(byte)ClassID.Apothecary].Level)
                                {
                                    client.Entity.SubClasses.Classes[(byte)ClassID.Apothecary].Phase++;
                                    dialog.Text("You have promoted your sub-class successfully.");
                                    dialog.Link("Oh, Thanks.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                    Database.SubClassTable.Update(client.Entity, client.Entity.SubClasses.Classes[(byte)ClassID.Apothecary]);
                                }
                                else
                                {
                                    dialog.Text("I`m sorry, you don`t meet the requirements yet.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                        }
                        break;
                    }
                #endregion
                #region [LeadMartialArtist]
                case 355911:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                dialog.Text(
                                    "Hello there! You look quite capable. Perhaps you`ll make a great Martial "
                                    + "Artist. Please allow me to explain the MartialArtist sub-class. The Martial "
                                    + "Artist`s awesome displays of ombat prowess are a wonder to behold, but a "
                                    + "nightmare to face. When you are a martial Artist, you will be able to increase "
                                    + "the chances of hitting with 1.5x Attack Power! Would you like to join us? After "
                                    + "you join this sub-class, you can level it up and get promoted to increase your "
                                    + "chances of hitting your enemies with more power!");
                                if (!client.Entity.SubClasses.Classes.ContainsKey((byte)ClassID.MartialArtist))
                                    dialog.Link("Yes, I`d like to join it.", 1);
                                dialog.Link("I want to get promoted.", 2);
                                dialog.Link("How can I get promoted?", 3);
                                dialog.Link("Not my concern.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 1:
                                dialog.Text(
                                    "I`m glad that you are willing to be one of us. I`m sure you will distinguish "
                                    + "yourself with your combat ability in no time. Still, there are a few requiriments "
                                    + "you need to meet. Though players of all classes can join us, we only accept "
                                    + "players who are over level 70, and it takes 5 Celestial Stones to pay the tuition "
                                    + "fee. After joining the Martial Artist sub-class, click open your character sheet "
                                    + "and you`ll find the sub-class button on the left-hand corner. You may level up "
                                    + "your sub-class on the sub-class button sheet. You need to meet a certain sub-class "
                                    + "level to get promoted to higher sub-class phases.");
                                dialog.Link("I see. Count me in.", 100);
                                dialog.Link("Oh, it does not suit me.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 2:
                                if (!client.Entity.SubClasses.Classes.ContainsKey((byte)ClassID.MartialArtist))
                                {
                                    dialog.Text(
                                        "You are not a Martial Artist yet and can`t get promoted. Do you want to join the "
                                        + "Martial Artist sub-class now?");
                                    dialog.Link("Yes, I`d like to join.", 1);
                                    dialog.Link("Oh. Not now.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text(
                                       "To promote to Phase " + (client.Entity.SubClasses.Classes[(byte)ClassID.MartialArtist].Phase + 1).ToString() + " you must meet the requirements. have you meet "
                                       + "them into the sub-class sheet?");
                                    dialog.Link("Positive.", 200);
                                    dialog.Link("Oh. not yet.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                            case 3:
                                dialog.Text(
                                    "Good day! Please spare me a few minutes so that I can tell you about the "
                                    + "sub-classes in Twin City. Each Sub-Class has 9 phases, and the higher the "
                                    + "phase is, the more bonus effects the sub-class will offer. But keep in mind "
                                    + "that these sub-classes also have a level system and you need to level them "
                                    + "up before you can get promoted. You can level up your sub-class by gaining "
                                    + "study points.");
                                dialog.Link("How can I get study points?", 30);
                                dialog.Link("Oh.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 30:
                                dialog.Text(
                                    "Well, the only way to get those points is to read the sub-class books, such as "
                                    + "the Diligence Book. When you`ve gained enough study points, open the "
                                    + "sub-class sheet from the character panel and level up the sub-class there. "
                                    + "Monsters in the wild are always bothering young adventurers, so you might "
                                    + "find some books from them.");
                                dialog.Link("Okay.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 100:
                                if (PacketHandler.PassLearn((byte)ClassID.MartialArtist, client.Entity))
                                {
                                    client.Entity.SubClasses.Classes.Add((byte)ClassID.MartialArtist, new Conquer_Online_Server.Game.SubClass() { ID = (byte)ClassID.MartialArtist, Level = 1, Phase = 1 });
                                    Database.SubClassTable.Insert(client.Entity, (byte)ClassID.MartialArtist);
                                    dialog.Text(
                                        "Congratulations! You`ve learned the Martial Artist way. Hope you use this power "
                                        + "for the good of us all.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text(
                                        "I`m sorry, you need to buy 5 Celestial Stones from the Great Merchant and "
                                        + "reach level 70 to join us.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                            case 200:
                                if (client.Entity.SubClasses.Classes[(byte)ClassID.MartialArtist].Phase == 9)
                                {
                                    dialog.Text("Your sub-class phase is already 9, you can`t promote it anymore!");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                    return;
                                }
                                if (client.Entity.SubClasses.Classes[(byte)ClassID.MartialArtist].Phase < client.Entity.SubClasses.Classes[(byte)ClassID.MartialArtist].Level)
                                {
                                    client.Entity.SubClasses.Classes[(byte)ClassID.MartialArtist].Phase++;
                                    dialog.Text("You have promoted your sub-class successfully.");
                                    dialog.Link("Oh, Thanks.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                    Database.SubClassTable.Update(client.Entity, client.Entity.SubClasses.Classes[(byte)ClassID.MartialArtist]);
                                }
                                else
                                {
                                    dialog.Text("I`m sorry, you don`t meet the requirements yet.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                        }
                        break;
                    }
                #endregion
                #region [LeadChiMaster]
                case 355910:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                dialog.Text(
                                    "Hello there! Please allow me to introduce to you the sub-class of the Chi "
                                    + "Master. The Chi Master is a potent combatant so versed in counter attacks, "
                                    + "that they have a chance of preventing their enemy from landing Critical "
                                    + "Strikes! Would you like to join us? After you join this sub-class you can level"
                                    + "it up and get promoted to increase your immunity to critical strikes.");
                                if (!client.Entity.SubClasses.Classes.ContainsKey((byte)ClassID.ChiMaster))
                                    dialog.Link("Yes, I`d like to join it.", 1);
                                dialog.Link("I want to get promoted.", 2);
                                dialog.Link("How can I get promoted?", 3);
                                dialog.Link("Where to buy Yin-Yang Fruits?", 4);
                                dialog.Link("Not my concern.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 1:
                                dialog.Text(
                                    "I`m glad that you are willing to be one of us. I`m sure you`ll make a capable "
                                    + "Chi Master. Still, there are a few requiriments you need to meet. Though "
                                    + "players of all classes can join us, we only accept players who are over level "
                                    + "70, and it takes 1 Yin-Yang Fruit to pay the tuition fee. You can pay 10,000 "
                                    + "Horse Racing points to the Horse Race Manager to buy one. After joining the "
                                    + "Chi Master sub-class, click open your character sheet and you`ll find the "
                                    + "sub-class button on the left-hand corner. You may level up your sub-class on "
                                    + "the sub-class button sheet. You need to meet a certain sub-class level to get "
                                    + "promoted to higher sub-class phases.");
                                dialog.Link("I see. Count me in.", 100);
                                dialog.Link("Oh, it does not suit me.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 2:
                                if (!client.Entity.SubClasses.Classes.ContainsKey((byte)ClassID.ChiMaster))
                                {
                                    dialog.Text(
                                        "You are not a Chi Master yet and can`t get promoted. Do you want to join the "
                                        + "Chi Master sub-class now?");
                                    dialog.Link("Yes, I`d like to join.", 1);
                                    dialog.Link("Oh. Not now.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text(
                                       "To promote to Phase " + client.Entity.SubClasses.Classes[(byte)ClassID.ChiMaster].Phase + 1 + " you must meet the requirements. have you meet "
                                       + "them into the sub-class sheet?");
                                    dialog.Link("Positive.", 200);
                                    dialog.Link("Oh. not yet.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                            case 3:
                                dialog.Text(
                                    "Good day! Please spare me a few minutes so that I can tell you about the "
                                    + "sub-classes in Twin City. Each Sub-Class has 9 phases, and the higher the "
                                    + "phase is, the more bonus effects the sub-class will offer. But keep in mind "
                                    + "that these sub-classes also have a level system and you need to level them "
                                    + "up before you can get promoted. You can level up your sub-class by gaining "
                                    + "study points.");
                                dialog.Link("How can I get study points?", 30);
                                dialog.Link("Oh.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 30:
                                dialog.Text(
                                    "Well, the only way to get those points is to read the sub-class books, such as "
                                    + "the Diligence Book. When you`ve gained enough study points, open the "
                                    + "sub-class sheet from the character panel and level up the sub-class there. "
                                    + "Monsters in the wild are always bothering young adventurers, so you might "
                                    + "find some books from them.");
                                dialog.Link("Okay.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 4:
                                dialog.Text(
                                    "You may pay 10,000 Horse Racing points to the Horse Race Manager to buy "
                                    + "a Yin-Yang Fruit.");
                                dialog.Link("Thanks.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 100:
                                if (PacketHandler.PassLearn((byte)ClassID.ChiMaster, client.Entity))
                                {
                                    client.Entity.SubClasses.Classes.Add((byte)ClassID.ChiMaster, new Conquer_Online_Server.Game.SubClass() { ID = (byte)ClassID.ChiMaster, Level = 1, Phase = 1 });
                                    Database.SubClassTable.Insert(client.Entity, (byte)ClassID.ChiMaster);
                                    dialog.Text(
                                        "Congratulations! You`ve learned the Chi Masters way. Hope you use this power "
                                        + "for the good of us all.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text(
                                        "I`m sorry, you need to buy a Yin-Yang Fruit from the Horse Race Manager and "
                                        + "reach level 70 to join us.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                            case 200:
                                if (client.Entity.SubClasses.Classes[(byte)ClassID.ChiMaster].Phase == 9)
                                {
                                    dialog.Text("Your sub-class phase is already 9, you can`t promote it anymore!");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                    return;
                                }
                                if (client.Entity.SubClasses.Classes[(byte)ClassID.ChiMaster].Phase < client.Entity.SubClasses.Classes[(byte)ClassID.ChiMaster].Level)
                                {
                                    client.Entity.SubClasses.Classes[(byte)ClassID.ChiMaster].Phase++;
                                    dialog.Text("You have promoted your sub-class successfully.");
                                    dialog.Link("Oh, Thanks.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                    Database.SubClassTable.Update(client.Entity, client.Entity.SubClasses.Classes[(byte)ClassID.ChiMaster]);
                                }
                                else
                                {
                                    dialog.Text("I`m sorry, you don`t meet the requirements yet.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                        }
                        break;
                    }
                #endregion
                #region [Wrangler]
                case 855931:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                dialog.Text(
                                    "Good day! Have you ever wondered what a Wrangler is? Well, please allow "
                                    + "me to introduce this sub-class to you. Wrangler are masters of the "
                                    + "MaxHp energies and can increase! "
                                    + "Isn`t that wonderful? Would you like to join us? After you join "
                                    + "this sub-class, you can level it up and get promoted to increase your power!");
                                if (!client.Entity.SubClasses.Classes.ContainsKey((byte)ClassID.Wrangler))
                                    dialog.Link("Yes, I`d like to join it.", 1);
                                dialog.Link("I want to get promoted.", 2);
                                dialog.Link("How can I get promoted?", 3);
                                dialog.Link("Not my concern.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 1:
                                dialog.Text(
                                    "I`m glad that you are willing to be one of us. I`m sure you will make a great "
                                    + "Wrangler. Still, there are a few requiriments you need to meet. Though players "
                                    + "of all classes can join us, we only accept players who are over level 70, and it "
                                    + "takes 40 Saddel`s to pay the tuition fee. After joining the Wrangler sub-class, "
                                    + "click open your character sheet and you`ll find the sub-class button on the "
                                    + "left-hand corner. You may level up your sub-class on the sub-class button sheet. You "
                                    + "need to meet a certain sub-class level to get promoted to higher sub-class "
                                    + "phases.");
                                dialog.Link("I see. Count me in.", 100);
                                dialog.Link("Oh, it does not suit me.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 2:
                                if (!client.Entity.SubClasses.Classes.ContainsKey((byte)ClassID.Wrangler))
                                {
                                    dialog.Text(
                                        "You are not a Wrangler yet and can`t get promoted. Do you want to join the "
                                        + "Warlock sub-class now?");
                                    dialog.Link("Yes, I`d like to join.", 1);
                                    dialog.Link("Oh. Not now.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text(
                                       "To promote to Phase " + (client.Entity.SubClasses.Classes[(byte)ClassID.Wrangler].Phase + 1).ToString() + " you must meet the requirements. have you meet "
                                       + "them into the sub-class sheet?");
                                    dialog.Link("Positive.", 200);
                                    dialog.Link("Oh. not yet.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                            case 3:
                                dialog.Text(
                                    "Good day! Please spare me a few minutes so that I can tell you about the "
                                    + "sub-classes in Twin City. Each Sub-Class has 9 phases, and the higher the "
                                    + "phase is, the more bonus effects the sub-class will offer. But keep in mind "
                                    + "that these sub-classes also have a level system and you need to level them "
                                    + "up before you can get promoted. You can level up your sub-class by gaining "
                                    + "study points.");
                                dialog.Link("How can I get study points?", 30);
                                dialog.Link("Oh.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 30:
                                dialog.Text(
                                    "Well, the only way to get those points is to read the sub-class books, such as "
                                    + "the Diligence Book. When you`ve gained enough study points, open the "
                                    + "sub-class sheet from the character panel and level up the sub-class there. "
                                    + "Monsters in the wild are always bothering young adventurers, so you might "
                                    + "find some books from them.");
                                dialog.Link("Okay.", 255);
                                dialog.Avatar(100);
                                dialog.Send();
                                break;
                            case 100:
                                if (PacketHandler.PassLearn((byte)ClassID.Wrangler, client.Entity))
                                {
                                    client.Entity.SubClasses.Classes.Add((byte)ClassID.Wrangler, new Conquer_Online_Server.Game.SubClass() { ID = (byte)ClassID.Wrangler, Level = 1, Phase = 1 });
                                    Database.SubClassTable.Insert(client.Entity, (byte)ClassID.Wrangler);
                                    dialog.Text(
                                        "Congratulations! You`ve learned the Wrangler way. Hope you use this power "
                                        + "for the good of us all.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text(
                                        "I`m sorry, you need to give me 10 Bombs and "
                                        + "reach level 70 to join us.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                            case 200:
                                if (client.Entity.SubClasses.Classes[(byte)ClassID.Wrangler].Phase == 9)
                                {
                                    dialog.Text("Your sub-class phase is already 9, you can`t promote it anymore!");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                    return;
                                }
                                if (client.Entity.SubClasses.Classes[(byte)ClassID.Wrangler].Phase < client.Entity.SubClasses.Classes[(byte)ClassID.Wrangler].Level)
                                {
                                    client.Entity.SubClasses.Classes[(byte)ClassID.Wrangler].Phase++;
                                    dialog.Text("You have promoted your sub-class successfully.");
                                    dialog.Link("Oh, Thanks.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                    Database.SubClassTable.Update(client.Entity, client.Entity.SubClasses.Classes[(byte)ClassID.Wrangler]);
                                }
                                else
                                {
                                    dialog.Text("I`m sorry, you don`t meet the requirements yet.");
                                    dialog.Link("Oh.", 255);
                                    dialog.Avatar(100);
                                    dialog.Send();
                                }
                                break;
                        }
                        break;
                    }
                #endregion
                #region [RecruitMaster]
                case 10100:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("You are about to enter the mysteious and wonderful world of Conquer! You ");
                                    dialog.Text("will have much to learn, to survive here. As the saying goes, if you know ");
                                    dialog.Text("yourself and your enemy, you`ll never lose a battle!");
                                    dialog.Option("Wonderful!", 1);
                                    dialog.Avatar(5);
                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region SubClassManager
                case 121656:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Greetings! I am the subclass manager, i can set your subclass to any ");
                                    dialog.Text("of the desired subclasses and even upgrade it's level. What do you want?");
                                    dialog.Option("I want to get the subclass.", 1);
                                    //dialog.Option("I want to upgrade the subclass level.", 2);
                                    dialog.Option("Let me think it over.", 255);
                                    dialog.Avatar(92);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    dialog.Text("Please choose the desired one.");
                                    dialog.Option("Aphotecary", 15);
                                    //dialog.Option("I want to upgrade the subclass level.", 2);
                                    dialog.Option("Let me think it over.", 255);
                                    dialog.Avatar(92);
                                    dialog.Send();
                                    break;
                                }
                            case 15:
                                {
                                    if (client.Entity.ConquerPoints >= 5680)
                                    {

                                        client.Entity.ConquerPoints -= 5680;
                                        client.Entity.SubClasses.Classes[(byte)ClassID.Apothecary].Phase += 9;
                                        // client.Entity.SubClass = 5;
                                        //client.Entity.SubClassLevel = 1;

                                    }

                                    else
                                    {
                                        dialog.Text("You don't have 5680 cps!");
                                        dialog.Option("Let me think it over.", 255);
                                        dialog.Avatar(92);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region GuildConductor1
                case 5640:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Are you heading for the next teleporter? It is free for our members, and 1,000 silver for others.");
                                    dialog.Option("Please teleport me there.", 1);
                                    dialog.Option("Buy Guild Teleporter.", 255);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(116);
                                    dialog.Send();

                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.Money >= 1000)
                                    {
                                        client.Entity.Money -= 1000;
                                        client.Entity.Teleport(1005, 35, 51);
                                    }
                                    else
                                    {

                                        dialog.Text("Please take 1000 silvers to use guild teleporter.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();

                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region GuildConductor2
                case 5641:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Are you heading for the next teleporter? It is free for our members, and 1,000 silver for others.");
                                    dialog.Option("Please teleport me there.", 1);
                                    dialog.Option("Buy Guild Teleporter.", 255);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(116);
                                    dialog.Send();

                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.Money >= 1000)
                                    {
                                        client.Entity.Money -= 1000;
                                        client.Entity.Teleport(1015, 794, 567);
                                    }
                                    else
                                    {

                                        dialog.Text("Please take 1000 silvers to use guild teleporter.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();

                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region GuildConductor3
                case 5642:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Are you heading for the next teleporter? It is free for our members, and 1,000 silver for others.");
                                    dialog.Option("Please teleport me there.", 1);
                                    dialog.Option("Buy Guild Teleporter.", 255);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(116);
                                    dialog.Send();

                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.Money >= 1000)
                                    {
                                        client.Entity.Money -= 1000;
                                        client.Entity.Teleport(1000, 489, 633);
                                    }
                                    else
                                    {

                                        dialog.Text("Please take 1000 silvers to use guild teleporter.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();

                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region GuildConductor4
                case 5643:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Are you heading for the next teleporter? It is free for our members, and 1,000 silver for others.");
                                    dialog.Option("Please teleport me there.", 1);
                                    dialog.Option("Buy Guild Teleporter.", 255);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(116);
                                    dialog.Send();

                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.Money >= 1000)
                                    {
                                        client.Entity.Money -= 1000;
                                        client.Entity.Teleport(1001, 335, 326);
                                    }
                                    else
                                    {

                                        dialog.Text("Please take 1000 silvers to use guild teleporter.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();

                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region GuildConductor1
                case 5662:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would you like to go ack to Guild Area in Twin City? l will teleport our members there free and charge nonmembers 500.");
                                    dialog.Option("Please teleport me there.", 1);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(116);
                                    dialog.Send();

                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.Money >= 500)
                                    {
                                        client.Entity.Money -= 500;
                                        client.Entity.Teleport(1038, 349, 340);
                                    }
                                    else
                                    {

                                        dialog.Text("Please take 500 silvers to use guild teleporter.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();

                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region GuildConductor2
                case 5663:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would you like to go ack to Guild Area in Twin City? l will teleport our members there free and charge nonmembers 500.");
                                    dialog.Option("Please teleport me there.", 1);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(116);
                                    dialog.Send();

                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.Money >= 500)
                                    {
                                        client.Entity.Money -= 500;
                                        client.Entity.Teleport(1038, 349, 340);
                                    }
                                    else
                                    {

                                        dialog.Text("Please take 500 silvers to use guild teleporter.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();

                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region GuildConductor3
                case 5664:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would you like to go ack to Guild Area in Twin City? l will teleport our members there free and charge nonmembers 500.");
                                    dialog.Option("Please teleport me there.", 1);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(116);
                                    dialog.Send();

                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.Money >= 500)
                                    {
                                        client.Entity.Money -= 500;
                                        client.Entity.Teleport(1038, 349, 340);
                                    }
                                    else
                                    {

                                        dialog.Text("Please take 500 silvers to use guild teleporter.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();

                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region GuildConductor4
                case 5665:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would you like to go ack to Guild Area in Twin City? l will teleport our members there free and charge nonmembers 500.");
                                    dialog.Option("Please teleport me there.", 1);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(116);
                                    dialog.Send();

                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.Money >= 500)
                                    {
                                        client.Entity.Money -= 500;
                                        client.Entity.Teleport(1038, 349, 340);
                                    }
                                    else
                                    {

                                        dialog.Text("Please take 500 silvers to use guild teleporter.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();

                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Prize For skill
                case 3996:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hi" + client.Entity.Name + "Iam AimlBot[PM] Rewarder if you Win in that the fight can gift you the skill  at 8:00 PM!!!?");
                                    dialog.Option("Yes.", 2);
                                    dialog.Option("No.", 255);
                                    dialog.Option("Back To Twin City.", 1);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1002, 429, 378);
                                    break;
                                }
                            case 2:
                                {
                                    int alive = 0;
                                    foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                        if (players.Entity.MapID == 1994 && (!players.Entity.Dead))
                                            alive++;

                                    if (DateTime.Now.DayOfWeek == DayOfWeek.Friday && DateTime.Now.Hour == 20 && DateTime.Now.Minute >= 20)
                                    {
                                        if (client.Entity.topTrojan == 0)
                                        {
                                            if (alive == 1)
                                            {
                                                if (!client.AddSpell(LearnableSpell(10309)))
                                                    //client.Entity.topTrojan += 1;
                                                    client.Entity.SubClasses.StudyPoints += 200;
                                                //client.Entity.AddFlag(Update.Flags.TopTrojan);
                                                client.Entity.ConquerPoints += 50000;
                                                client.Entity.Teleport(1002, 429, 378);
                                                Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize ConquerPoints and 2000 Study Points for winning the The Trojan Class pk.", System.Drawing.Color.DarkGray, Message.Center), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                dialog.Text("Good luck and be carefull");
                                                dialog.Option("Thanks.", 255);
                                                dialog.Send();
                                                break;
                                            }
                                            else
                                            {
                                                dialog.Text("Sorry, They are some Players They are (" + alive + ")Players Just Kill Them and Come Take Your Reward");
                                                dialog.Option("Ok.Sorry.", 255);

                                                dialog.Send();
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("Sorry, I Took You Reward Before");
                                            dialog.Option("Sorry, I Forgot xD", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("Sorry, I can't Give you My Reward Before 8:00 PM");
                                        dialog.Option("Ok.Sorry.", 255);
                                        dialog.Send();
                                    }

                                    break;

                                }
                        }
                        break;
                    }
                #endregion

                #region Clan War
                case 5578:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hi " + client.Entity.Name + "!, Do You Want To join Clan War?");
                                    dialog.Option("Yes,Please", 1);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(259);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
                                    {
                                        if ((DateTime.Now.Hour == 20 && DateTime.Now.Minute >= 54) && (DateTime.Now.Hour == 21 && DateTime.Now.Minute <= 10))
                                        {
                                            client.Entity.Teleport(1801, 50, 50);
                                            client.Entity.Action = 250;
                                            dialog.Text("Good luck and be carefull");
                                            dialog.Option("Thanks.", 255);
                                            dialog.Send();
                                            break;
                                        }
                                        else
                                        {
                                            dialog.Text("If you want Sign Up,you must choose your Right Time in the right day and come at 20:50 and make sure u are in clan");
                                            dialog.Option("Ok sorry", 255);
                                            dialog.Send();
                                            break;
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("This is not the correct day Come later in correct Time");
                                        dialog.Option("Sorry. I will come in correct day", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Clan War Prize 1
                case 81001:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hey there " + client.Entity.Clan + " Would you like to claim your Prize In 21:10?.");
                                    dialog.Option("Yes Please", 1);
                                    dialog.Option("I don't care.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (DateTime.Now.DayOfWeek == DayOfWeek.Friday && DateTime.Now.Hour >= 21 || DateTime.Now.Minute > 10)
                                    {
                                        WeeklyPkWarWinnerCPs = 0;
                                        client.Entity.ConquerPoints += 0;
                                        Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Clan + " claimed the prize " + WeeklyPkWarWinnerCPs + " ConquerPoints for winning the ClanWar.", System.Drawing.Color.White, Message.Center), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                        client.Entity.Teleport(7001, 50, 50);
                                        Conquer_Online_Server.Database.EntityTable.SaveEntity(client);
                                    }
                                    else
                                    {
                                        dialog.Text("Hey there " + client.Entity.Name + "You can claim the prize when the time on or after 20:50");
                                        dialog.Option("Ok thanks", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Clan War Prize 2
                case 81002:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hey there " + client.Entity.Name + " Would you like to claim your Prize In 21:10?.");
                                    dialog.Option("Yes Please", 1);
                                    dialog.Option("I don't care.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    int alive = 0;
                                    foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                        if (players.Entity.MapID == 35101 && (!players.Entity.Dead))
                                            alive++;
                                    if (DateTime.Now.DayOfWeek == DayOfWeek.Friday && DateTime.Now.Hour >= 21 || DateTime.Now.Minute > 10)
                                    {
                                        if (alive == 1)
                                        {
                                            client.Entity.ConquerPoints += 100000;
                                            Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 100k Cps for winning the Best Player In Clan War.", System.Drawing.Color.White, Message.Center), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                            client.Entity.SendSpawn(client, true);
                                            client.Entity.Teleport(1002, 430, 380);
                                            Conquer_Online_Server.Database.EntityTable.SaveEntity(client);
                                        }
                                        else
                                        {
                                            dialog.Text("There are still " + alive + " players in the map kill it first to claim prize!");
                                            dialog.Option("Ok thanks", 255);
                                            dialog.Send();
                                            break;
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("Hey there " + client.Entity.Name + "You can only claim the prize when the time on or after 21:10");
                                        dialog.Option("Ok thanks", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                ///////// clas pk war////////////
                #region Join ClassWar new for all
                case 7052225:
                    {
                        switch (npcRequest.OptionID)
                        {
                            //la trojan  client.Entity.Teleport(1730, 34, 19);
                            //la warrior client.Entity.Teleport(1731, 34, 19);
                            //la ninja client.Entity.Teleport(1732, 34, 19);
                            //la waterclient.Entity.Teleport(1733, 34, 19);
                            //la fire client.Entity.Teleport(1734, 34, 19);
                            //la archer client.Entity.Teleport(1735, 34, 19);
                            case 0:
                                {
                                    dialog.Text("Hellow! We have Class PkWar for different class every day and the champion will get a nice reward. Will you give it go?");
                                    dialog.Option("Tell me the rules", 1);
                                    dialog.Option("Sign me up", 3);
                                    dialog.Option("Nope", 255);
                                    dialog.Send();
                                    break;
                                }

                            case 1:
                                {
                                    dialog.Text("Okay, Monday is for Trojan War, and Tuesdey is for Warriors, Wednesday for Archers,Thursday for Water and Fire Taoist , and Friday for Ninjas, saturday for Monks ");
                                    dialog.Text(" It`ll take place 19:45 -  19:50  . Talk me you sign up 15 minutes before it starts, but after it starts ");
                                    dialog.Text(" but after it starts,nobody cand enter the arena. the War will by divided into four groups, That is Lvl 90- , 100-119, lvl 120 -129 and 130+ Before the War Ends, the last players in each Arena will be the champion  ");
                                    dialog.Text(" and can clain 5 Exp Balls with the pk Escort. If ther are more 1 Player in the arena  at 14:49 or 22:59, all Player Will send you TwinCity and the War Stoped Automaticali ");
                                    dialog.Option("Sign me up", 3);
                                    dialog.Option("l`ll pass", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 3:
                                {

                                    #region trojan

                                        if ((client.Entity.Class >= 10 && client.Entity.Class <= 15))
                                        {

                                            if (PKTournament.Stage == PKTournamentStage.Inviting)
                                            {
                                                client.InPKT = true;
                                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                                client.Entity.Teleport(1787, 50, 50);
                                            }
                                            else
                                            {
                                                if (PKTournament.Stage == PKTournamentStage.None)
                                                {
                                                    dialog.Text(" sorry you cant join ");
                                                    dialog.Option("l`ll pass", 255);
                                                    dialog.Send();
                                                }
                                            }

                                    }
                                    #endregion
                                    #region war

                                        else if ((client.Entity.Class >= 20 && client.Entity.Class <= 25))
                                        {

                                            if (PKTournament.Stage == PKTournamentStage.Inviting)
                                            {
                                                client.InPKT = true;
                                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                                client.Entity.Teleport(1787, 50, 50);
                                            }
                                            else
                                            {
                                                if (PKTournament.Stage == PKTournamentStage.None)
                                                {
                                                    dialog.Text(" sorry you cant join ");
                                                    dialog.Option("l`ll pass", 255);
                                                    dialog.Send();
                                                }
                                            }
                                        }

                                    #endregion
                                    #region archer

                                        if ((client.Entity.Class >= 40 && client.Entity.Class <= 45))
                                        {

                                            if (PKTournament.Stage == PKTournamentStage.Inviting)
                                            {
                                                client.InPKT = true;
                                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                                client.Entity.Teleport(1787, 50, 50);
                                            }
                                            else
                                            {
                                                if (PKTournament.Stage == PKTournamentStage.None)
                                                {
                                                    dialog.Text(" sorry you cant join ");
                                                    dialog.Option("l`ll pass", 255);
                                                    dialog.Send();
                                                }
                                            }

                                        }
                                        #endregion
                                    #region monk

                                        if ((client.Entity.Class >= 60 && client.Entity.Class <= 65))
                                        {

                                            if (PKTournament.Stage == PKTournamentStage.Inviting)
                                            {
                                                client.InPKT = true;
                                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                                client.Entity.Teleport(1787, 50, 50);
                                            }
                                            else
                                            {
                                                if (PKTournament.Stage == PKTournamentStage.None)
                                                {
                                                    dialog.Text(" sorry you cant join ");
                                                    dialog.Option("l`ll pass", 255);
                                                    dialog.Send();
                                                }
                                            }

                                        }
                                        #endregion
                                  #region water

                                        if ((client.Entity.Class >= 130 && client.Entity.Class <= 135))
                                        {

                                            if (PKTournament.Stage == PKTournamentStage.Inviting)
                                            {
                                                client.InPKT = true;
                                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                                client.Entity.Teleport(1787, 50, 50);
                                            }
                                            else
                                            {
                                                if (PKTournament.Stage == PKTournamentStage.None)
                                                {
                                                    dialog.Text(" sorry you cant join ");
                                                    dialog.Option("l`ll pass", 255);
                                                    dialog.Send();
                                                }
                                            }

                                        }
                                        #endregion
                                  #region fire

                                        if ((client.Entity.Class >= 140 && client.Entity.Class <= 145))
                                        {

                                            if (PKTournament.Stage == PKTournamentStage.Inviting)
                                            {
                                                client.InPKT = true;
                                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                                client.Entity.Teleport(1787, 50, 50);
                                            }
                                            else
                                            {
                                                if (PKTournament.Stage == PKTournamentStage.None)
                                                {
                                                    dialog.Text(" sorry you cant join ");
                                                    dialog.Option("l`ll pass", 255);
                                                    dialog.Send();
                                                }
                                            }

                                        }
                                        #endregion
                                  #region ninja

                                        if ((client.Entity.Class >= 50 && client.Entity.Class <= 55))
                                        {

                                            if (PKTournament.Stage == PKTournamentStage.Inviting)
                                            {
                                                client.InPKT = true;
                                                PKTournament.PKTHash.Add(client.Entity.UID, client);
                                                //Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                                client.Entity.Teleport(1787, 50, 50);
                                            }
                                            else
                                            {
                                                if (PKTournament.Stage == PKTournamentStage.None)
                                                {
                                                    dialog.Text(" sorry you cant join ");
                                                    dialog.Option("l`ll pass", 255);
                                                    dialog.Send();
                                                }
                                            }

                                        }
                                        #endregion
                                }

                                break;
                        }
                        break;
                    }
                #endregion
                #region PkWarWinerNpc
                case 3956:
                case 3957:
                case 3958:
                case 3959:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hey,you kill all here?");
                                    dialog.Option("Yes", 1);
                                    dialog.Option("no", 255);
                                    dialog.Option("Send me twinCity", 4);
                                    dialog.Send();
                                    break;
                                }
                            case 4:
                                {
                                    Kernel.ClassPkWar.RemovePlayersTorament(client);
                                    client.Entity.Teleport(1002, 429, 378);
                                    break;
                                }
                            case 1:
                                {
                                    int alive = 0;
                                    foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                        if (players.Entity.MapID >= 1730 && players.Entity.MapID < 1733 && (!players.Entity.Dead))
                                            alive++;

                                    #region trojan
                                    if (client.Entity.TopTrojan >= 1)
                                    {
                                        dialog.Text("i you can claim prize once.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                        break;
                                    }
                                    if (client.Entity.Class >= 10 && client.Entity.Class <= 15)
                                    {
                                        if (client.Entity.Level >= 1 && client.Entity.Level <= 99)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Monday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.tro100.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);
                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopTrojan = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Trojan War (1-99) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    //GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Troajan War(0-100) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 100 && client.Entity.Level <= 119)
                                        {

                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Monday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.tro100119.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopTrojan = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Trojan War (100-119) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    //Kernel.SendWorldMessage(2005, System.Drawing.Color.Red, "Congratulations! " + client.Entity.Name+ " has win Class Troajan War (100-119) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 120 && client.Entity.Level <= 129)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Monday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.tro120130.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopTrojan = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Trojan War (120-129) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    //GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Troajan War (120-130) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 130)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Monday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.tro130.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);
                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopTrojan = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Trojan War (130-140) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    // GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Troajan War 130+ and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map ");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                    #region warrior
                                    if (client.Entity.TopWarrior >= 1)
                                    {
                                        dialog.Text("i you can claim prize once.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                        break;
                                    }
                                    if (client.Entity.Class >= 20 && client.Entity.Class <= 25)
                                    {
                                        if (client.Entity.Level >= 1 && client.Entity.Level <= 99)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Tuesday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.war100.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopWarrior = 1;

                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Warrior War (1-99) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    //GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Warrior War(0-100) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 100 && client.Entity.Level <= 119)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Tuesday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.war100119.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopWarrior = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Warrior War (100-119) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    //GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Warrior War (100-119) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 120 && client.Entity.Level <= 129)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Tuesday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.war120130.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopWarrior = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Warrior War (120-129) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    // GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Warrior War (120-130) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 130)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Tuesday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.war130.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopWarrior = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Warrior War (130-140) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    //GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Warrior War 130+ and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                    #region Archer
                                    if (client.Entity.TopArcher >= 1)
                                    {
                                        dialog.Text("i you can claim prize once.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                        break;
                                    }
                                    if (client.Entity.Class >= 40 && client.Entity.Class <= 45)
                                    {
                                        if (client.Entity.Level >= 1 && client.Entity.Level <= 99)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Wednesday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.archer100.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopArcher = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Archer War (1-99) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    // GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Archer War(0-100) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 100 && client.Entity.Level <= 119)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Wednesday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.archer100119.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopArcher = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Archer War (100-119) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    // GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Archer War (100-119) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 120 && client.Entity.Level <= 129)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Wednesday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.archer120130.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopArcher = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Archer War (120-129) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    // GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Archer War (120-130) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 130)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Wednesday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.archer130.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopArcher = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Archer War (130-140) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    //GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Archer War 130+ and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                    #region ninja
                                    if (client.Entity.TopNinja >= 1)
                                    {
                                        dialog.Text("i you can claim prize once.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                        break;
                                    }
                                    if (client.Entity.Class >= 50 && client.Entity.Class <= 55)
                                    {
                                        if (client.Entity.Level >= 1 && client.Entity.Level <= 99)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.ninja100.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopNinja = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Ninja War (1-99) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    //GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Ninja War(0-100) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 100 && client.Entity.Level <= 119)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.ninja100119.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Ninja War (100-119) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    client.Entity.TopNinja = 1;
                                                    // GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Ninja War (100-119) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 120 && client.Entity.Level <= 129)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.ninja120130.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopNinja = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Ninja War (120-130) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    // GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Ninja War (120-130) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 130)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.ninja130.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopNinja = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Ninja War 130+ and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    // GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Ninja War 130+ and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                    #region water
                                    if (client.Entity.TopWaterTaoist >= 1)
                                    {
                                        dialog.Text("i you can claim prize once.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                        break;
                                    }
                                    if (client.Entity.Class >= 100 && client.Entity.Class <= 135)
                                    {
                                        if (client.Entity.Level >= 1 && client.Entity.Level <= 99)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.water100.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Water War (1-99) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    client.Entity.TopWaterTaoist = 1;
                                                    //  GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Water War(0-100) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 100 && client.Entity.Level <= 119)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.water100119.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopWaterTaoist = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Water War (100-119) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    // GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Water War (100-119) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 120 && client.Entity.Level <= 129)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.water120130.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopWaterTaoist = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Water War (120-130) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    //GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Water War (120-130) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 130)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.water130.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Water War (130-140) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    client.Entity.TopWaterTaoist = 1;
                                                    // GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + " has win Class Water War 130+ and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                    #region fire
                                    if (client.Entity.TopFireTaoist >= 1)
                                    {
                                        dialog.Text("i you can claim prize once.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                        break;
                                    }
                                    if (client.Entity.Class >= 140 && client.Entity.Class <= 145)
                                    {
                                        if (client.Entity.Level >= 1 && client.Entity.Level <= 99)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Friday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.fire100.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopFireTaoist = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Fire War (1-99) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    //  GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + "has win Class Fier War(0-100) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 100 && client.Entity.Level <= 119)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Friday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.fire100119.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Fire War (100-119) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    client.Entity.TopFireTaoist = 1;
                                                    //   GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + "has win Class Fier War (100-119) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 120 && client.Entity.Level <= 129)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Friday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.fire120130.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Fire War (120-129) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    client.Entity.TopFireTaoist = 1;
                                                    //  GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + "has win Class Fier War (120-130) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 130)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Friday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.fire130.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopFireTaoist = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Fire War (130-140) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    // GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + "has win Class Fier War 130+ and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                    #region Monk
                                    if (client.Entity.TopMonk >= 1)
                                    {
                                        dialog.Text("i you can claim prize once.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                        break;
                                    }
                                    if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                    {
                                        if (client.Entity.Level >= 1 && client.Entity.Level <= 99)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.Monk100.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopMonk = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Monk War (1-99) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    //  GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + "has win Class Fier War(0-100) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 100 && client.Entity.Level <= 119)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.Monk100119.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Monk War (100-119) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    client.Entity.TopMonk = 1;
                                                    //   GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + "has win Class Fier War (100-119) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 120 && client.Entity.Level <= 129)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.Monk120130.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Monk War (120-129) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    client.Entity.TopMonk = 1;
                                                    //  GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + "has win Class Fier War (120-130) and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else if (client.Entity.Level >= 130)
                                        {
                                            if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday && DateTime.Now.Hour >= 19 || DateTime.Now.Minute > 50)
                                            {
                                                if (alive == 1)
                                                {
                                                    Kernel.ClassPkWar.AddMap.Pirate130.Remove(client.Entity.UID);
                                                    client.Entity.Teleport(1002, 429, 378);

                                                    client.Entity.ConquerPoints += 50000;
                                                    client.Entity.TopMonk = 1;
                                                    Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " has win Class Monk War (130-140) and win 5ExpBalls ,50.000 cps and TopClass", System.Drawing.Color.Black, Message.Service), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    // GC.LocalMessage(2005, System.Drawing.Color.Red, "Congratulations! " + GC.MyChar.Name + "has win Class Fier War 130+ and win 5ExpBalls ,50.000 cps and TopClass ");
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry, but its Players on map");
                                                    dialog.Option("Ah,my bad", 255);
                                                    dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                }

                                break;

                        }
                        break;
                    }

                #endregion
                //////////////////////////////
                #region Guild War

                #region Jail warden
                case 140:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    if (Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.IsWar)
                                    {
                                        if (DateTime.Now.Minute >= 30 && DateTime.Now.Minute <= 35 || DateTime.Now.Minute >= 00 && DateTime.Now.Minute <= 05)
                                        {
                                            dialog.Text("My friend, you may leave if you want.");
                                            dialog.Option("Yes please.", 1);
                                            dialog.Option("No need...", 255);
                                            dialog.Send();

                                        }
                                        else
                                        {
                                            client.Entity.Owner.Send(new Conquer_Online_Server.Network.GamePackets.Message(" " + client.Entity.Name + "  you Can exit of GwJaill at " + DateTime.Now.ToLongTimeString() + "", System.Drawing.Color.White, 2005));
                                            // client.SendStatMessage(2005, GC.MyChar.Name + "has exit of GwJaill at " + DateTime.Now.ToLongTimeString() + "", System.Drawing.Color.White);
                                            dialog.Text("You lost your change. Now wait for the next pardon!");
                                            dialog.Option("No!!!", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("My friend, you may leave if you want.");
                                        dialog.Option("Yes please.", 1);
                                        dialog.Option("No need...", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 1:
                                {
                                    if (Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.IsWar)
                                    {
                                        if (DateTime.Now.Minute >= 30 && DateTime.Now.Minute <= 35 || DateTime.Now.Minute >= 00 && DateTime.Now.Minute <= 05)
                                        {
                                            client.Entity.Owner.Send(new Conquer_Online_Server.Network.GamePackets.Message(" " + client.Entity.Name + "  you Can exit of GwJaill at " + DateTime.Now.ToLongTimeString() + "", System.Drawing.Color.White, 2005));
                                            client.Entity.Teleport(1002, 430, 380);
                                        }
                                        else
                                        {
                                            dialog.Text("You lost your change. Now wait for the next pardon!");
                                            dialog.Option("No!!!", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        client.Entity.Teleport(1002, 430, 380);
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #region Light up runes
                case 4452:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello friend, as you might know, while guild war, you can light up some runes and after guild war is over, you can come to me and I will give you experience in exchange of your rune.");
                                    dialog.Text("Once guild war starts, come to me and ask for a rune, and you will receive it. If you lose it, you can come back and reclaim it, but you will start from level 1 once again.");
                                    dialog.Option("Give me a rune.", 1);
                                    dialog.Option("Claim experience.", 2);
                                    dialog.Option("Nothing.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (GuildWar.IsWar)
                                    {
                                        for (int c = 0; c <= 10; c++)
                                        {
                                            if (client.Inventory.Contains((uint)(729960 + c), 1))
                                            {
                                                dialog.Text("You already have a rune.");
                                                dialog.Option("Thank you.", 255);
                                                dialog.Send();
                                                return;
                                            }
                                        }
                                        if (client.Inventory.Add(729960, 0, 1))
                                        {
                                            dialog.Text("Go, and light up this rune.");
                                            dialog.Option("Thank you.", 255);
                                            dialog.Send();
                                        }
                                        else
                                        {
                                            dialog.Text("There is not enough room in your inventory.");
                                            dialog.Option("Ah, hold on.", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("I cannot give you a rune now.");
                                        dialog.Option("Ahh.", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 2:
                                {
                                    if (!GuildWar.IsWar)
                                    {
                                        for (int c = 0; c <= 10; c++)
                                        {
                                            if (client.Inventory.Contains((uint)(729960 + c), 1))
                                            {
                                                int expballs = c;
                                                if (729960 + c == 729970)
                                                    expballs += 2;

                                                for (int ex = 0; ex < expballs; ex++)
                                                    client.IncreaseExperience(client.ExpBall, false);
                                                client.Inventory.Remove((uint)(729960 + c), 1);
                                                return;
                                            }
                                        }
                                        dialog.Text("You cannot claim experience if you don't have a rune.");
                                        dialog.Option("Ahh.", 255);
                                        dialog.Send();
                                    }
                                    else
                                    {

                                    }
                                    {
                                        dialog.Text("You cannot claim experience while guild war.");
                                        dialog.Option("Ahh.", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                case 4453:
                case 4454:
                case 4455:
                case 4456:
                case 4457:
                case 4458:
                case 4459:
                case 4460:
                case 4461:
                    {
                        dialog.Avatar(0);
                        uint takeFlame = 725507 + client.ActiveNpc;
                        uint addFlame = 725507 + client.ActiveNpc + 1;
                        if (GuildWar.IsWar)
                        {
                            if (client.Inventory.Contains(takeFlame, 1))
                            {
                                client.Inventory.Remove(takeFlame, 1);
                                client.Inventory.Add(addFlame, 0, 1);
                                dialog.Text("Well done! Next rune is number " + (client.ActiveNpc - 4451) + ".");
                                dialog.Send();
                            }
                            else
                            {
                                dialog.Text("You cannot flame up this stone without the proper rune.");
                                dialog.Send();
                            }
                        }
                        else
                        {
                            dialog.Text("You cannot flame up a rune if guild war is not on.");
                            dialog.Send();
                        }
                        break;
                    }
                case 4462:
                    {
                        dialog.Avatar(0);
                        uint takeFlame = 725507 + client.ActiveNpc;
                        uint addFlame = 725507 + client.ActiveNpc + 1;
                        if (GuildWar.IsWar)
                        {
                            if (GuildWar.Flame10th)
                            {
                                if (client.Inventory.Contains(takeFlame, 1))
                                {
                                    client.Inventory.Remove(takeFlame, 1);
                                    client.Inventory.Add(addFlame, 0, 1);
                                    dialog.Text("Well done! Nothing left to light up. Congratulations!");
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text("You cannot flame up this stone without the proper rune.");
                                    dialog.Send();
                                }
                            }
                            else
                            {
                                dialog.Text("It's not the right time to flame up this rune.");
                                dialog.Send();
                            }
                        }
                    }
                    break;
                #endregion

                #endregion
                #region OfflineTG
                case 3836:
                    {
                        OfflineTGStats sts = new OfflineTGStats(true);
                        var T1 = new TimeSpan(DateTime.Now.Ticks);
                        var T2 = new TimeSpan(client.OfflineTGEnterTime.Ticks);
                        ushort minutes = (ushort)(T1.TotalMinutes - T2.TotalMinutes);
                        minutes = (ushort)Math.Min((ushort)900, minutes);
                        sts.TotalTrainingMinutesLeft = (ushort)(900 - minutes);
                        sts.TrainedMinutes = minutes;
                        ulong exp = client.Entity.Experience;
                        byte level = client.Entity.Level;
                        double expballGain = (double)300 * (double)minutes / (double)900;
                        while (expballGain >= 100)
                        {
                            expballGain -= 100;
                            exp += client.ExpBall;
                        }
                        if (expballGain != 0)
                            exp += (uint)(client.ExpBall * (expballGain / 100));

                        while (exp >= Conquer_Online_Server.Database.DataHolder.LevelExperience(level))
                        {
                            exp -= Conquer_Online_Server.Database.DataHolder.LevelExperience(level);
                            level++;
                        }
                        double percent = (double)exp * (double)100 / (double)Conquer_Online_Server.Database.DataHolder.LevelExperience(level);

                        sts.Character_NewExp = (ulong)(percent * 100000);
                        sts.Character_AcquiredLevel = level;
                        sts.Send(client);
                        break;
                    }
                #endregion
                #region Clan
                case 9873:
                    {
                        switch (npcRequest.OptionID)
                        {

                            case 0:
                                {
                                    if (client.Entity.Myclan == null)
                                    {
                                        dialog.Text("Hellow! You wana create clan?If you need  500.000 Silvers");
                                        dialog.Option("Yes, i wana", 1);
                                        dialog.Option("No ty", 255);
                                        dialog.Avatar(40);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("Hellow! You upgrade level at clan?");
                                        dialog.Option("Upgrade level", 2);
                                        dialog.Option("Delete my clan", 10);

                                        dialog.Option("No ty", 255);
                                        dialog.Avatar(40);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 12:
                                {

                                    if (Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(client.Entity.Myclan.ClanId))
                                        Conquer_Online_Server.ServerBase.Kernel.ServerClans.Remove(client.Entity.Myclan.ClanId);
                                    Database.Clans.DeleteClan(client.Entity.Myclan.ClanId);

                                    var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                    varr.MoveNext();
                                    int COunt = ServerBase.Kernel.GamePool.Count;
                                    for (uint c = 0;
                                        c < COunt;
                                        c++)
                                    {
                                        if (c >= COunt) break;

                                        Client.GameState clien = (varr.Current as Client.GameState);
                                        if (clien.Entity.Myclan != null)
                                        {
                                            if (client.Entity.UID != clien.Entity.UID)
                                            {
                                                if (clien.Entity.Myclan.ClanId == client.Entity.Myclan.ClanId)
                                                {
                                                    Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(clien, 22);
                                                    clien.Send(cl.ToArray());
                                                    clien.Entity.ClanId = 0;
                                                    clien.Entity.ClanRank = 0;
                                                    clien.Entity.Myclan = null;
                                                    clien.Entity.ClanName = null;
                                                    Database.Clans.KickClan(clien.Entity.Name);
                                                }
                                            }
                                        }
                                        varr.MoveNext();

                                    }

                                    Network.GamePackets.Clan acl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 22);
                                    client.Send(acl.ToArray());
                                    client.Entity.Myclan = null;
                                    client.Entity.ClanRank = 0;
                                    client.Entity.ClanId = 0;
                                    client.Entity.ClanName = null;
                                    Database.Clans.KickClan(client.Entity.Name);
                                    client.Entity.Myclan = null;
                                    break;
                                }
                            case 10:
                                {
                                    dialog.Text("You sure? You wana delete?");
                                    dialog.Option("Yes i wana", 12);
                                    dialog.Option("No ty", 255);
                                    dialog.Avatar(40);
                                    dialog.Send();
                                    break;
                                }
                            case 2:
                                {
                                    if (client.Entity.Myclan.ClanLevel < 4)
                                    {
                                        dialog.Text("You need " + Game.Clans.MoneyClanLevel[client.Entity.Myclan.ClanLevel] + " Silvers to upgrade ClandLevel! You are sure?");
                                        dialog.Option("Yes upgrad.", 4);
                                        dialog.Option("No thanks.", 255);
                                        dialog.Avatar(88);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("Sorry, you clan name is level max");
                                        dialog.Option("Ah, ok", 255);
                                        dialog.Avatar(88);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 4:
                                {
                                    if (client.Entity.Money >= Game.Clans.MoneyClanLevel[client.Entity.Myclan.ClanLevel])
                                    {
                                        client.Entity.Money -= Game.Clans.MoneyClanLevel[client.Entity.Myclan.ClanLevel];

                                        var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                        varr.MoveNext();
                                        int COunt = ServerBase.Kernel.GamePool.Count;
                                        for (uint c = 0;
                                            c < COunt;
                                            c++)
                                        {
                                            if (c >= COunt) break;

                                            Client.GameState clien = (varr.Current as Client.GameState);
                                            if (clien.Entity.Myclan != null)
                                            {
                                                if (clien.Entity.UID != client.Entity.UID)
                                                {
                                                    if (clien.Entity.Myclan.ClanId == client.Entity.Myclan.ClanId)
                                                    {
                                                        clien.Entity.Myclan.ClanId += 1;
                                                    }
                                                }
                                            }
                                            varr.MoveNext();

                                        }

                                        dialog.Text("Done");
                                        dialog.Send();

                                        client.Entity.Myclan.ClanLevel += 1;
                                        Database.Clans.SaveClan(client.Entity.Myclan);
                                        Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 1);
                                        client.Send(cl.ToArray());
                                    }
                                    else
                                    {
                                        dialog.Text("Sorry, you need " + Game.Clans.MoneyClanLevel[client.Entity.Myclan.ClanLevel] + " Silvers");
                                        dialog.Option("Ah, Ok", 255);
                                        dialog.Avatar(40);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 1:
                                {
                                    dialog.Text("Say me, what name you wana?");
                                    dialog.Input("Clan Name", 3, 14);
                                    dialog.Option("Let me think it over.", 255);
                                    dialog.Avatar(88);
                                    dialog.Send();
                                    break;
                                }
                            case 3:
                                {
                                    string name = npcRequest.Input;
                                    foreach (KeyValuePair<uint, Game.Clans> cl in Conquer_Online_Server.ServerBase.Kernel.ServerClans)
                                    {
                                        if (cl.Value.ClanName == name)
                                        {
                                            dialog.Text("Sorry, but this clan exist! change name");
                                            dialog.Option("Ah, Ok", 255);
                                            dialog.Avatar(88);
                                            dialog.Send();
                                            return;
                                        }
                                    }
                                    if (client.Entity.Money >= 500000)
                                    {
                                        client.Entity.Money -= 500000;
                                        Game.Clans clan = new Conquer_Online_Server.Game.Clans();
                                        clan.ClanName = name;
                                        clan.ClanDonation = 500000;
                                        clan.ClanLider = client.Entity.Name;

                                        Game.ClanMembers member = new Conquer_Online_Server.Game.ClanMembers();
                                        member.Name = client.Entity.Name;
                                        member.UID = client.Entity.UID;
                                        member.Donation = 500000;
                                        member.Class = client.Entity.Class;
                                        member.Rank = 100;
                                        member.Level = client.Entity.Level;
                                        if (!clan.Members.ContainsKey(member.UID))
                                            clan.Members.Add(member.UID, member);
                                        client.Entity.Myclan = clan;
                                        Database.Clans.CreateClan(client);
                                        dialog.Text("Done");
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("Sorry, but need 500.000 Silver");
                                        dialog.Option("Ah, Ok", 255);
                                        dialog.Avatar(88);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Adventure Zone
                #region Adv zone teleporter
                case 300655:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("I have just discovered a new place, where the turtle doves are so big, that they drop awesome items when they die. It's free, do you want to see it?");
                                    dialog.Option("Yes please.", 1);
                                    dialog.Option("No thank you.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1210, 1029, 714);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Adv zone mine supervisor
                case 300652:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("In this mine, the minerals are very good. They are really expensive, would you like to enter?");
                                    dialog.Option("Yes please.", 1);
                                    dialog.Option("No thank you.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1218, 30, 69);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Grandpa
                case 300653:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would you like to advance?");
                                    dialog.Option("Yes.", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1219, 448, 272);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Boatman
                case 300654:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would you like to go in TwinCity?");
                                    dialog.Option("Yes.", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1002, 430, 380);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #endregion
                #region NPC Teleporter
                case 400655:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Do You need to go to place of NPC");
                                    dialog.Option("Yes please.", 1);
                                    dialog.Option("No thank you.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1201, 110, 116);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region NPC Teleporter
                case 600655:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Do You need to go to place of quests NPC");
                                    dialog.Option("Yes please.", 1);
                                    dialog.Option("No thank you.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(2010, 024, 075);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region MillionaireLee
                case 501204:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hey you! Yeah, it's you I am talking about. I've got a great deal that you cannot leave without taking it. I will give you one meteorscroll for ten meteors and one dragonballscroll for ten dragonballs. With those scrolls you can have more than fourty meteors or dragonballs in your inventory at once!");
                                    dialog.Option("Take my meteors.", 1);

                                    dialog.Option("I'm too poor.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    break;
                                }

                        }
                        break;
                    }
                #endregion
                //3956,3957,3958,3959,,3560,3561,39 60
                #region ClassPKEnvoy
                case 7052:
                    {
                        if (npcRequest.OptionID == 0)
                        {
                            dialog.Text("I hold every Class PK Tournament for Trojans, Warriors, Monks, Ninjas, Taoists And Archers, So Tell me your character Class so I can Sign you up at 19:45 GMT!");
                            dialog.Text("Remember: you must be strong to be able to attend the Pk Tourny.");
                            dialog.Option("I'm a Trojan [Saturday]", 1);
                            dialog.Option("I'm a Warrior [Sunday]", 2);
                            dialog.Option("I'm a Ninja [Monday]", 3);
                            dialog.Option("I'm a WaterTaoist [Tuesday]", 4);
                            dialog.Option("I'm a FireTaoist [Wednesday]", 5);
                            dialog.Option("I'm an Archer [Thursday]", 6);
                            dialog.Option("I'm an Monk [Friday]", 7);
                            dialog.Option("Just passing by.", 255);
                            dialog.Avatar(0);
                            dialog.Send();
                        }
                        else if (npcRequest.OptionID == 1)
                        {
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
                            {
                                if (client.Entity.Class == 15 && (DateTime.Now.Hour == 19 && DateTime.Now.Minute >= 45))
                                {
                                    client.Entity.Teleport(1730, 34, 19);
                                    dialog.Text("Good luck and be careful!");
                                    dialog.Option("Thanks.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text("If you want to Sign Up, you must choose your Right character in the right day and come at 19:45");
                                    dialog.Option("I see.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                            }
                            else
                            {
                                dialog.Text("This is not the correct day Come later in correct day");
                                dialog.Option("sorry...I will come the correct day", 255);
                                dialog.Avatar(0);
                                dialog.Send();
                            }
                        }
                        else if (npcRequest.OptionID == 2)
                        {
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
                            {
                                if (client.Entity.Class == 25 && (DateTime.Now.Hour == 19 && DateTime.Now.Minute >= 45))
                                {
                                    client.Entity.Teleport(1731, 34, 19);
                                    dialog.Text("Good luck and be careful!");
                                    dialog.Option("Thanks.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text("If you want to Sign Up, you must choose your Right character in the right day and come at 19:45");
                                    dialog.Option("I see.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                            }
                            else
                            {
                                dialog.Text("This is not the correct day Come later in correct day");
                                dialog.Option("sorry...I will come the correct day", 255);
                                dialog.Avatar(0);
                                dialog.Send();
                            }
                        }
                        else if (npcRequest.OptionID == 3)
                        {
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Monday)
                            {
                                if (client.Entity.Class == 55 && (DateTime.Now.Hour == 19 && DateTime.Now.Minute >= 45))
                                {
                                    client.Entity.Teleport(1732, 34, 19);

                                    dialog.Text("Good luck and be careful!");
                                    dialog.Option("Thanks.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text("If you want Sign Up,you must choose your Right character in the right day and come at 19:45");
                                    dialog.Option("I see.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                            }
                            else
                            {
                                dialog.Text("This is not the correct day Come later in correct day");
                                dialog.Option("sorry...I will come the correct day", 255);
                                dialog.Avatar(0);
                                dialog.Send();
                            }
                        }
                        else if (npcRequest.OptionID == 4)
                        {
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Tuesday)
                            {
                                if (client.Entity.Class == 135 && (DateTime.Now.Hour == 19 && DateTime.Now.Minute >= 45))
                                {
                                    client.Entity.Teleport(1733, 34, 19);

                                    dialog.Text("Good luck and be careful!");
                                    dialog.Option("Thanks.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text("If you want to Sign Up, you must choose your Right character in the right day and come at 19:45");
                                    dialog.Option("I see.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                            }
                            else
                            {
                                dialog.Text("This is not the correct day Come later in correct day");
                                dialog.Option("sorry...I will come the correct day", 255);
                                dialog.Avatar(0);
                                dialog.Send();
                            }
                        }
                        else if (npcRequest.OptionID == 5)
                        {
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Wednesday)
                            {
                                if (client.Entity.Class == 145 && (DateTime.Now.Hour == 19 && DateTime.Now.Minute >= 45))
                                {
                                    client.Entity.Teleport(1734, 34, 19);

                                    dialog.Text("Good luck and be careful!");
                                    dialog.Option("Thanks.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text("If you want Sign Up,you must choose your Right character in the right day and come at 19:45");
                                    dialog.Option("I see.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                            }
                            else
                            {
                                dialog.Text("This is not the correct day Come later in correct day");
                                dialog.Option("sorry...I will come the correct day", 255);
                                dialog.Avatar(0);
                                dialog.Send();
                            }
                        }
                        else if (npcRequest.OptionID == 6)
                        {
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday)
                            {
                                if (client.Entity.Class == 45 && (DateTime.Now.Hour == 19 && DateTime.Now.Minute >= 45))
                                {
                                    client.Entity.Teleport(1735, 34, 19);

                                    dialog.Text("Good luck and be careful!");
                                    dialog.Option("Thanks.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text("If you want to Sign Up, you must choose your Right character in the right day and come at 19:45");
                                    dialog.Option("I see.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                            }
                            else
                            {
                                dialog.Text("This is not the correct day Come later in correct day");
                                dialog.Option("sorry...I will come the correct day", 255);
                                dialog.Avatar(0);
                                dialog.Send();
                            }
                        }
                        else if (npcRequest.OptionID == 7)
                        {
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
                            {
                                if (client.Entity.Class == 65 && (DateTime.Now.Hour == 19 && DateTime.Now.Minute >= 45))
                                {
                                    client.Entity.Teleport(1736, 34, 19);

                                    dialog.Text("Good luck and be careful!");
                                    dialog.Option("Thanks.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                                else
                                {
                                    dialog.Text("If you want Sign Up,you must choose your Right character in the right day and come at 19:45");
                                    dialog.Option("I see.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                            }
                            else
                            {
                                dialog.Text("This is not the correct day Come later in correct day");
                                dialog.Option("sorry...I will come the correct day", 255);
                                dialog.Avatar(0);
                                dialog.Send();
                            }
                        }
                        break;
                    }
                #endregion
                #region Prize For Trojan
                case 39565:
                    {
                        if (npcRequest.OptionID == 0)
                        {
                            dialog.Text("I will claim to you your prize at 20.10!");
                            dialog.Option("Claim My Prize", 1);
                            dialog.Option("Teleport me to TwinCity", 2);
                            dialog.Avatar(0);
                            dialog.Send();

                        }
                        else if (npcRequest.OptionID == 1)
                        {
                            int alive = 0;
                            foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                if (players.Entity.MapID == 1730 && (!players.Entity.Dead))
                                    alive++;
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
                            {

                                if (client.Entity.Class == 15 && (DateTime.Now.Hour == 20 && DateTime.Now.Minute >= 10))
                                {
                                    if (alive == 1)
                                    {
                                        client.Entity.TopTrojan += 1;

                                        client.Entity.ConquerPoints += 3000;
                                        Conquer_Online_Server.Network.PacketHandler.WorldMessage("Congratulations! " + client.Entity.Name + " has won the Trojan PK Tournament!");
                                        client.Entity.Teleport(1002, 429, 378);
                                        dialog.Text("Good luck and be careful!");
                                        dialog.Option("Thanks.", 255);
                                        dialog.Avatar(0);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("There are still " + alive + " players in the map kill it first to claim prize!");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                }
                                else
                                {
                                    dialog.Text("You can Take it Later at 20:10!");
                                    dialog.Option("I see.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }

                            }

                        }
                        else if (npcRequest.OptionID == 2)
                        {
                            client.Entity.Teleport(1002, 429, 378);
                            dialog.Text("Good luck and be careful!");
                            dialog.Option("Thanks.", 255);
                            dialog.Avatar(0);
                            dialog.Send();
                        }

                        break;
                    }
                #endregion
                #region Prize For Warrior
                case 39557:
                    {
                        if (npcRequest.OptionID == 0)
                        {
                            dialog.Text("I will claim to you your prize at 20.10!");
                            dialog.Option("Claim My Prize", 1);
                            dialog.Option("Teleport me to TwinCity", 2);
                            dialog.Avatar(0);
                            dialog.Send();

                        }
                        else if (npcRequest.OptionID == 1)
                        {
                            int alive = 0;
                            foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                if (players.Entity.MapID == 1731 && (!players.Entity.Dead))
                                    alive++;
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
                            {
                                if (client.Entity.Class == 25 && (DateTime.Now.Hour == 20 && DateTime.Now.Minute >= 10))
                                {
                                    if (alive == 1)
                                    {
                                        client.Entity.TopWarrior += 1;
                                        client.Entity.ConquerPoints += 3000;
                                        Conquer_Online_Server.Network.PacketHandler.WorldMessage("Congratulations! " + client.Entity.Name + " has won the Warrior PK Tournament!");
                                        client.Entity.Teleport(1002, 429, 378);
                                        dialog.Text("Good luck and be careful!");
                                        dialog.Option("Thanks.", 255);
                                        dialog.Avatar(0);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("There are still " + alive + " players in the map kill it first to claim prize!");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                }
                                else
                                {
                                    dialog.Text("You can Take it Later at 20:10.");
                                    dialog.Option("I see.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                            }

                        }
                        else if (npcRequest.OptionID == 2)
                        {
                            client.Entity.Teleport(1002, 429, 378);
                            dialog.Text("Good luck and be careful!");
                            dialog.Option("Thanks.", 255);
                            dialog.Avatar(0);
                            dialog.Send();
                        }

                        break;
                    }
                #endregion
                #region Prize For Ninja
                case 35958:
                    {
                        if (npcRequest.OptionID == 0)
                        {
                            dialog.Text("I will claim to you your prize at 20.10!");
                            dialog.Option("Claim My Prize", 1);
                            dialog.Option("Teleport me to TwinCity", 2);
                            dialog.Avatar(0);
                            dialog.Send();

                        }
                        else if (npcRequest.OptionID == 1)
                        {
                            int alive = 0;
                            foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                if (players.Entity.MapID == 1732 && (!players.Entity.Dead))
                                    alive++;
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Monday)
                            {
                                if (client.Entity.Class == 55 && (DateTime.Now.Hour == 20 && DateTime.Now.Minute >= 10))
                                {
                                    if (alive == 1)
                                    {
                                        client.Entity.TopNinja += 1;
                                        client.Entity.ConquerPoints += 3000;
                                        Conquer_Online_Server.Network.PacketHandler.WorldMessage("Congratulations! " + client.Entity.Name + " has won the Ninja PK Tournament!");
                                        client.Entity.Teleport(1002, 429, 378);
                                        dialog.Text("Good luck and be careful!");
                                        dialog.Option("Thanks.", 255);
                                        dialog.Avatar(0);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("There are still " + alive + " players in the map kill it first to claim prize!");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                }
                                else
                                {
                                    dialog.Text("You can Take it Later at 20:10.");
                                    dialog.Option("I see.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                            }

                        }
                        else if (npcRequest.OptionID == 2)
                        {
                            client.Entity.Teleport(1002, 429, 378);
                            dialog.Text("Good luck and be careful!");
                            dialog.Option("Thanks.", 255);
                            dialog.Avatar(0);
                            dialog.Send();
                        }

                        break;
                    }
                #endregion
                #region Prize For WaterTaoist
                case 39559:
                    {
                        if (npcRequest.OptionID == 0)
                        {
                            dialog.Text("I will claim to you your prize at 20.10!");
                            dialog.Option("Claim My Prize", 1);
                            dialog.Option("Teleport me to TwinCity", 2);
                            dialog.Avatar(0);
                            dialog.Send();

                        }
                        else if (npcRequest.OptionID == 1)
                        {
                            int alive = 0;
                            foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                if (players.Entity.MapID == 1733 && (!players.Entity.Dead))
                                    alive++;
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Tuesday)
                            {
                                if (client.Entity.Class == 135 && (DateTime.Now.Hour == 20 && DateTime.Now.Minute >= 10))
                                {
                                    if (alive == 1)
                                    {
                                        client.Entity.TopWaterTaoist += 1;
                                        client.Entity.ConquerPoints += 3000;
                                        Conquer_Online_Server.Network.PacketHandler.WorldMessage("Congratulations! " + client.Entity.Name + " has won the WaterTaoist PK Tournament!");
                                        client.Entity.Teleport(1002, 429, 378);
                                        dialog.Text("Good luck and be careful!");
                                        dialog.Option("Thanks.", 255);
                                        dialog.Avatar(0);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("There are still " + alive + " players in the map kill it first to claim prize!");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                }
                                else
                                {
                                    dialog.Text("You can Take it Later at 20:10.");
                                    dialog.Option("I see.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                            }

                        }
                        else if (npcRequest.OptionID == 2)
                        {
                            client.Entity.Teleport(1002, 429, 378);
                            dialog.Text("Good luck and be careful!");
                            dialog.Option("Thanks.", 255);
                            dialog.Avatar(0);
                            dialog.Send();
                        }

                        break;
                    }
                #endregion
                #region Prize For FireTaoist
                case 39560:
                    {
                        if (npcRequest.OptionID == 0)
                        {
                            dialog.Text("I will claim to you your prize at 20.10!");
                            dialog.Option("Claim My Prize", 1);
                            dialog.Option("Teleport me to TwinCity", 2);
                            dialog.Avatar(0);
                            dialog.Send();

                        }
                        else if (npcRequest.OptionID == 1)
                        {
                            int alive = 0;
                            foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                if (players.Entity.MapID == 1734 && (!players.Entity.Dead))
                                    alive++;
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Wednesday)
                            {
                                if (client.Entity.Class == 145 && (DateTime.Now.Hour == 20 && DateTime.Now.Minute >= 10))
                                {
                                    if (alive == 1)
                                    {
                                        client.Entity.TopFireTaoist += 1;
                                        client.Entity.ConquerPoints += 3000;
                                        Conquer_Online_Server.Network.PacketHandler.WorldMessage("Congratulations! " + client.Entity.Name + " has won the FireTaoist PK Tournament!");
                                        client.Entity.Teleport(1002, 429, 378);
                                        dialog.Text("Good luck and be careful!");
                                        dialog.Option("Thanks.", 255);
                                        dialog.Avatar(0);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("There are still " + alive + " players in the map kill it first to claim prize!");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                }
                                else
                                {
                                    dialog.Text("You can Take it Later at 20:10.");
                                    dialog.Option("I see.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                            }

                        }
                        else if (npcRequest.OptionID == 2)
                        {
                            client.Entity.Teleport(1002, 429, 378);
                            dialog.Text("Good luck and be careful!");
                            dialog.Option("Thanks.", 255);
                            dialog.Avatar(0);
                            dialog.Send();
                        }

                        break;
                    }
                #endregion
                #region Prize For Archer
                case 35651:
                    {
                        if (npcRequest.OptionID == 0)
                        {
                            dialog.Text("I will claim to you your prize at 20.10!");
                            dialog.Option("Claim My Prize", 1);
                            dialog.Option("Teleport me to TwinCity", 2);
                            dialog.Avatar(0);
                            dialog.Send();

                        }
                        else if (npcRequest.OptionID == 1)
                        {
                            int alive = 0;
                            foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                if (players.Entity.MapID == 1735 && (!players.Entity.Dead))
                                    alive++;
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday)
                            {
                                if (client.Entity.Class == 45 && (DateTime.Now.Hour == 20 && DateTime.Now.Minute >= 10))
                                {
                                    if (alive == 1)
                                    {
                                        client.Entity.TopArcher += 1;
                                        client.Entity.ConquerPoints += 3000;
                                        Conquer_Online_Server.Network.PacketHandler.WorldMessage("Congratulations! " + client.Entity.Name + " has won the Archer PK Tournament!");
                                        client.Entity.Teleport(1002, 429, 378);
                                        dialog.Text("Good luck and be careful!");
                                        dialog.Option("Thanks.", 255);
                                        dialog.Avatar(0);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("There are still " + alive + " players in the map kill it first to claim prize!");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                }
                                else
                                {
                                    dialog.Text("You can Take it Later at 20:10.");
                                    dialog.Option("I see.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                            }

                        }
                        else if (npcRequest.OptionID == 2)
                        {
                            client.Entity.Teleport(1002, 429, 378);
                            dialog.Text("Good luck and be careful!");
                            dialog.Option("Thanks.", 255);
                            dialog.Avatar(0);
                            dialog.Send();
                        }

                        break;
                    }
                #endregion
                #region Prize For monk
                case 35262:
                    {
                        if (npcRequest.OptionID == 0)
                        {
                            dialog.Text("I will claim to you your prize at 20.10!");
                            dialog.Option("Claim My Prize", 1);
                            dialog.Option("Teleport me to TwinCity", 2);
                            dialog.Avatar(0);
                            dialog.Send();

                        }
                        else if (npcRequest.OptionID == 1)
                        {
                            int alive = 0;
                            foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                if (players.Entity.MapID == 1736 && (!players.Entity.Dead))
                                    alive++;
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
                            {
                                if (client.Entity.Class == 65 && (DateTime.Now.Hour == 20 && DateTime.Now.Minute >= 10))
                                {
                                    if (alive == 1)
                                    {
                                        client.Entity.TopMonk += 1;
                                        client.Entity.ConquerPoints += 3000;
                                        Conquer_Online_Server.Network.PacketHandler.WorldMessage("Congratulations! " + client.Entity.Name + " has won the MOnk PK Tournament!");
                                        client.Entity.Teleport(1002, 429, 378);
                                        dialog.Text("Good luck and be careful!");
                                        dialog.Option("Thanks.", 255);
                                        dialog.Avatar(0);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("There are still " + alive + " players in the map kill it first to claim prize!");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                }
                                else
                                {
                                    dialog.Text("You can Take it Later at 20:10.");
                                    dialog.Option("I see.", 255);
                                    dialog.Avatar(0);
                                    dialog.Send();
                                }
                            }

                        }
                        else if (npcRequest.OptionID == 2)
                        {
                            client.Entity.Teleport(1002, 429, 378);
                            dialog.Text("Good luck and be careful!");
                            dialog.Option("Thanks.", 255);
                            dialog.Avatar(0);
                            dialog.Send();
                        }

                        break;
                    }
                #endregion
                #region SteedRace
                case 1415:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Popup("Hello, im here for help you,i make some tornaments SteedRace",1);

                                    break;
                                }

                            case 1:
                                {
                                    if (Program.Steed == true)
                                    {
                                        dialog.Popup("Do you want to join in RaceSteed?",22);

                                        // Conquer_Online_Server.Network.PacketHandler.WorldMessage("This Player" + client.Entity.Name + " Join Come All SteedRace This First Server With Steed Race By koko  ");
                                        //client.Entity.Teleport(1950, 061, 156);
                                        break;
                                    }
                                    else
                                    {
                                        dialog.Popup("Steed Race is Finished come next XX:30?", 225);
                                        break;

                                    }

                                }
                            case 22:
                                {
                                    Conquer_Online_Server.Interfaces.IConquerItem I = client.Equipment.TryGetItem(12);
                                    //Interfaces.IConquerItem I = PacketHandler.ItemPosition(I.ID)==5;
                                    if (I != null && I.ID != 0)
                                    {
                                        client.Entity.srjoin = 1;
                                        dialog.Popup("You have now joined in Race Tornament",255);
                                        client.Entity.AddFlag(Update.Flags.Ride);
                                        // Conquer_Online_Server.Network.PacketHandler.WorldMessage("This Player" + client.Entity.Name + " Join Come All SteedRace This First Server With Steed Race By koko  ");
                                        client.Entity.Teleport(1950, 077, 157);
                                        break;
                                    }
                                    else
                                    {
                                        dialog.Popup("Sorry you dont have steed",255);

                                        break;

                                    }
                                }

                        }
                        break;
                    }
                #endregion
                #region Zizo2012 Quests
                #region Donation War Dukes Priz
                case 452:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello! " + client.Entity.Name + " You Can Here Take Ur PRiz If U R the Only One Online Here !");
                                    dialog.Option("I am The Last One Here Give Me The Reward Now.", 1);
                                    dialog.Option("No Thanks .", 255);
                                    dialog.Avatar(34);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    int alive = 0;
                                    foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                        if (players.Entity.MapID == 1168 && (!players.Entity.Dead))
                                            alive++;
                                    if (alive == 1 && DateTime.Now.Minute <= 45 && DateTime.Now.Minute >= 00)
                                    {
                                        client.Entity.ConquerPoints += 500000;
                                        Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 500 K ConquerPoints for winning the Donaiton War (The Best Duke / Dukess).", System.Drawing.Color.Red, Message.Center), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                        client.Entity.SendSpawn(client, true);
                                        client.Entity.Teleport(1002, 429, 378);
                                    }
                                    else
                                    {
                                        dialog.Text("There are still " + alive + " players in the map kill it first to claim prize OR u need to wait in 00 Mint");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Donation War Princes Priz
                case 451:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello! " + client.Entity.Name + " You Can Here Take Ur PRiz If U R the Only One Online Here !");
                                    dialog.Option("I am The Last One Here Give Me The Reward Now.", 1);
                                    dialog.Option("No Thanks .", 255);
                                    dialog.Avatar(34);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    int alive = 0;
                                    foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                        if (players.Entity.MapID == 1167 && (!players.Entity.Dead))
                                            alive++;
                                    if (alive == 1 && DateTime.Now.Minute <= 45 && DateTime.Now.Minute >= 00)
                                    {
                                        client.Entity.ConquerPoints += 1000000;
                                        Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 1 M ConquerPoints for winning the Donaiton War (The Best Prince / Princess).", System.Drawing.Color.Red, Message.Center), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                        client.Entity.SendSpawn(client, true);
                                        client.Entity.Teleport(1002, 429, 378);
                                    }
                                    else
                                    {
                                        dialog.Text("There are still " + alive + " players in the map kill it first to claim prize OR u need to wait in 00 Mint");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Donation War Kings Priz
                case 450:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello! " + client.Entity.Name + " You Can Here Take Ur PRiz If U R the Only One Online Here !");
                                    dialog.Option("I am The Last One Here Give Me The Reward Now.", 1);
                                    dialog.Option("No Thanks .", 255);
                                    dialog.Avatar(34);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    int alive = 0;
                                    foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                        if (players.Entity.MapID == 1166 && (!players.Entity.Dead))
                                            alive++;
                                    if (alive == 1 && DateTime.Now.Minute <= 45 && DateTime.Now.Minute >= 00)
                                    {
                                        client.Entity.ConquerPoints += 1500000;
                                        Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 1.500 M ConquerPoints for winning the Donaiton War (The Best King / Queen).", System.Drawing.Color.Red, Message.Center), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                        client.Entity.SendSpawn(client, true);
                                        client.Entity.Teleport(1002, 429, 378);
                                    }
                                    else
                                    {
                                        dialog.Text("There are still " + alive + " players in the map kill it first to claim prize OR u need to wait in 00 Mint");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Donation War SignUp
                case 449:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello! " + client.Entity.Name + " You Can Here SignUp Donation War in Sunday in 18:45 For Kings , Princes and Dukes Only !! Do U Wanna To SignUp ??");
                                    dialog.Option("SignUp Me Now.", 1);
                                    dialog.Option("No Thanks .", 255);
                                    dialog.Avatar(34);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday && DateTime.Now.Minute >= 45 && DateTime.Now.Minute <= 00)
                                    {
                                        if (client.Entity.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                        {
                                            client.Entity.Teleport(1166, 50, 50);//Kings Map
                                        }
                                        if (client.Entity.NobilityRank == Game.ConquerStructures.NobilityRank.Prince)
                                        {
                                            client.Entity.Teleport(1167, 50, 50);//Princes Map
                                        }
                                        if (client.Entity.NobilityRank == Game.ConquerStructures.NobilityRank.Duke)
                                        {
                                            client.Entity.Teleport(1168, 50, 50);//Duke Map
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("This IS not the right time");
                                        dialog.Option("Okey", 255);
                                        dialog.Avatar(15);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Priz of Hours PK war
                case 15152:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hey,you kill all here?");
                                    dialog.Option("Yes", 1);
                                    dialog.Option("no", 255);
                                    dialog.Option("Send me twinCity", 4);
                                    dialog.Send();
                                    break;
                                }
                            case 4:
                                {
                                    client.Entity.Teleport(1002, 429, 378);
                                    break;
                                }
                            case 1:
                                {
                                    int alive = 0;
                                    foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                        if (players.Entity.MapID == 2525 && (!players.Entity.Dead))
                                            alive++;
                                    if (alive == 1 && DateTime.Now.Minute <= 45 && DateTime.Now.Minute >= 00)
                                    {
                                        client.Entity.RemoveFlag(Update.Flags.Ride);
                                        client.Entity.ConquerPoints += 50000;
                                        Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 50k cps ConquerPoints for winning the Hours Pk War and Receive His Priz.", System.Drawing.Color.Red, Message.Center), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                        client.Entity.SendSpawn(client, true);
                                        client.Entity.Teleport(1002, 429, 378);
                                    }
                                    else
                                    {
                                        dialog.Text("There are still " + alive + " players in the map kill it first to claim prize!");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #endregion

                #region Arena 300 cps
                case 3006554:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would you like to go in Arena and Win 300 cps for each killing");
                                    dialog.Option("Yes.", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1860, 070, 077);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region  Breeder
                case 5680:
                    {
                        Data data = new Data(true);
                        data.ID = Data.OpenWindow;
                        data.UID = client.Entity.UID;
                        data.TimeStamp = Time32.Now;
                        data.dwParam = Data.WindowCommands.Breeding;
                        data.wParam1 = client.Entity.X;
                        data.wParam2 = client.Entity.Y;
                        client.Send(data);
                        break;
                    }
                #endregion
                #region Stables
                #region ReincarnationSeer
                case 35882:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    Data Data = new Data(true);
                                    Data.UID = client.Entity.UID;
                                    Data.ID = 126;
                                    Data.dwParam = 485;
                                    Data.wParam1 = client.Entity.X;
                                    Data.wParam2 = client.Entity.Y;
                                    client.Send(Data);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #endregion
                #region Stables
                #region ReincarnationSeer
                case 358821:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    Data Data = new Data(true);
                                    Data.UID = client.Entity.UID;
                                    Data.ID = 126;
                                    Data.dwParam = 502;
                                    Data.wParam1 = client.Entity.X;
                                    Data.wParam2 = client.Entity.Y;
                                    client.Send(Data);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #endregion
                #region MightyTao
                case 355000:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("If you have reborn at least one time, i will learn you new Skills for wandand Spear only for 5k cps .");
                                    dialog.Option("ViperFang.", 2);
                                    dialog.Option("DargonTrail.", 1);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.ConquerPoints >= 5000)
                                    {
                                        client.Entity.ConquerPoints -= 5000;
                                        if (!client.AddSpell(LearnableSpell(11000)))
                                        {
                                            dialog.Text("You already know this skill.");
                                            dialog.Option("Thank you master.", 255);
                                            dialog.Send();
                                        }
                                    }

                                    else
                                    {
                                        dialog.Text("You dont have Cps.");
                                        dialog.Option("Alright", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    break;
                                }
                            case 2:
                                {
                                    if (client.Entity.ConquerPoints >= 5000)
                                    {
                                        client.Entity.ConquerPoints -= 5000;
                                        if (!client.AddSpell(LearnableSpell(11005)))
                                        {
                                            dialog.Text("You already know this skill.");
                                            dialog.Option("Thank you master.", 255);
                                            dialog.Send();
                                        }

                                    }
                                    else
                                    {
                                        dialog.Text("You you dont have cps.");
                                        dialog.Option("Alright", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Starlit deivorce
                case 4486:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    {
                                        dialog.Text("Are you unloved? Want divorce? I can help you.");
                                        dialog.Option("Yes, I want divorce", 1);
                                        dialog.Option("No, I am loved.", 255);
                                        dialog.Avatar(91);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 1:
                                {
                                    dialog.Text("I need a Meteor Tear to divorce.");
                                    dialog.Option("Okay, here is your Meteor and your MeteorTear.", 2);
                                    dialog.Option("I will not give it to you!", 255);
                                    dialog.Avatar(91);
                                    dialog.Send();

                                    break;
                                }
                            case 2:
                                {
                                    if (client.Inventory.Contains(1088002, 1))
                                    {
                                        client.Inventory.Remove(1088002, 1);
                                        client.Entity.Spouse = "None";
                                    }
                                    else
                                    {
                                        dialog.Text("you dont have  Meteor Tear to divorce.");

                                        dialog.Option("I will not give it to you!", 255);
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #region Prize Seller
                case 200033:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Greetings! I'm a great seller, I have the most precious items in the entire ");
                                    dialog.Text("world. What do you want my brother!");
                                    dialog.Option("GoldPrize [10 LordTokens]", 1);
                                    dialog.Option("GoldCup [9 LordTokens]", 2);
                                    dialog.Option("GoldTrophy [8 LordTokens]", 3);
                                    dialog.Option("SilverPrize [6 LordTokens]", 4);
                                    dialog.Option("BronzePrize  [4 LordTokens]", 5);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(85);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Inventory.Contains(723467, 10))
                                    {

                                        client.Inventory.Remove(723467, 10);
                                        client.Inventory.Add(2100075, 0, 1);
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have enough 10 LordTokens !");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(85);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 2:
                                {
                                    if (client.Inventory.Contains(723467, 9))
                                    {

                                        client.Inventory.Remove(723467, 9);
                                        client.Inventory.Add(2100095, 0, 1);

                                    }
                                    else
                                    {
                                        dialog.Text("You don't have enough 9 LordTokens !");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(85);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 3:
                                {
                                    if (client.Inventory.Contains(723467, 8))
                                    {

                                        client.Inventory.Remove(723467, 8);
                                        client.Inventory.Add(2100085, 0, 1);

                                    }
                                    else
                                    {
                                        dialog.Text("You don't have enough 8 LordTokens !");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(85);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 4:
                                {
                                    if (client.Inventory.Contains(723467, 6))
                                    {

                                        client.Inventory.Remove(723467, 6);
                                        client.Inventory.Add(2100065, 0, 1);

                                    }
                                    else
                                    {
                                        dialog.Text("You don't have enough 6 LordTokens !");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(85);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 5:
                                {
                                    if (client.Inventory.Contains(723467, 4))
                                    {

                                        client.Inventory.Remove(723467, 4);
                                        client.Inventory.Add(2100055, 0, 1);

                                    }
                                    else
                                    {
                                        dialog.Text("You don't have enough 4 LordTokens !");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(85);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region vip by jenzo
                case 4431:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    if (client.Entity.VIPLevel == 6)
                                    {
                                        dialog.Text("your Vip is 6 gratz.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                        break;
                                    }
                                    dialog.Text("Hay i will upgrade your VIP for CPs");
                                    dialog.Option("[VIP 1] 1kk CPs.", 1);
                                    dialog.Option("[VIP 2] 800k CPs.", 2);
                                    dialog.Option("[VIP 3] 700k CPs.", 3);
                                    dialog.Option("[VIP 4] 600k CPs.", 4);
                                    dialog.Option("[VIP 5] 500k CPs.", 5);
                                    dialog.Option("[VIP 6] 400k CPs.", 6);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(116);
                                    dialog.Send();
                                    break;

                                }
                            case 1:
                                {
                                    if (client.Entity.VIPLevel == 0 && client.Entity.VIPLevel < 1)
                                    {
                                        if (client.Entity.ConquerPoints >= 1000000)
                                        {
                                            client.Entity.ConquerPoints -= 1000000;
                                            client.Entity.VIPLevel = 1;
                                        }

                                        else
                                        {
                                            dialog.Text("Please take 1m cps.");
                                            dialog.Option("I see.", 255);
                                            dialog.Avatar(116);
                                            dialog.Send();
                                        }

                                    }
                                    else
                                    {
                                        dialog.Text("Sorry Can't upgrade any more.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }

                                    break;
                                }
                            case 2:
                                {
                                    if (client.Entity.VIPLevel == 1 && client.Entity.VIPLevel < 2)
                                    {
                                        if (client.Entity.ConquerPoints >= 800000)
                                        {
                                            client.Entity.ConquerPoints -= 800000;
                                            client.Entity.VIPLevel = 2;
                                        }

                                    else
                                    {
                                        dialog.Text("Please take 800k cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }

                                    }
                                    else
                                    {
                                        dialog.Text("Sorry Can't upgrade any more.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 3:
                                {
                                    if (client.Entity.VIPLevel == 2 && client.Entity.VIPLevel < 3)
                                    {
                                        if (client.Entity.ConquerPoints >= 700000)
                                        {
                                            client.Entity.ConquerPoints -= 700000;
                                            client.Entity.VIPLevel = 3;
                                        }

                                    else
                                    {
                                        dialog.Text("Please take 700k cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }

                                    }
                                    else
                                    {
                                        dialog.Text("Sorry Can't upgrade any more.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 4:
                                {
                                    if (client.Entity.VIPLevel == 3 && client.Entity.VIPLevel < 4)
                                    {
                                        if (client.Entity.ConquerPoints >= 600000)
                                        {
                                            client.Entity.ConquerPoints -= 600000;
                                            client.Entity.VIPLevel = 4;
                                        }

                                    else
                                    {
                                        dialog.Text("Please take 600k cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                          }

                                    }
                                    else
                                    {
                                        dialog.Text("Sorry Can't upgrade any more.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 5:
                                {
                                    if (client.Entity.VIPLevel == 4 && client.Entity.VIPLevel < 5)
                                    {
                                        if (client.Entity.ConquerPoints >= 500000)
                                        {
                                            client.Entity.ConquerPoints -= 500000;
                                            client.Entity.VIPLevel = 5;
                                        }

                                    else
                                    {
                                        dialog.Text("Please take 500k cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();

                                           }

                                    }
                                    else
                                    {
                                        dialog.Text("Sorry Can't upgrade any more.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 6:
                                {
                                    if (client.Entity.VIPLevel == 5 && client.Entity.VIPLevel < 6)
                                    {
                                        if (client.Entity.ConquerPoints >= 400000)
                                        {
                                            client.Entity.ConquerPoints -= 400000;
                                            client.Entity.VIPLevel = 6;
                                        }

                                    else
                                    {
                                        dialog.Text("Please take 400k cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();

                                           }

                                    }
                                    else
                                    {
                                        dialog.Text("Sorry Can't upgrade any more.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #region NPcCenter
                case 4466:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hi,so what can i do for you?");
                                    //dialog.Option("Enter Pk map ", 1);
                                    dialog.Option("Get free items ", 2);
                                    // dialog.Option("About VotsPoints ", 4);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(114);
                                    dialog.Send();
                                    break;
                                }
                            case 4:
                                {
                                    dialog.Text("You will get vote points for every vote! You wana change VotsPoints? You Have " + client.Entity.VotsPoints + "");
                                    dialog.Option("Remove my pkp 3 Points", 12);
                                    dialog.Option("Random SoulItem 5 Points", 13);
                                    dialog.Option("Random Accesory 3 Points", 14);
                                    dialog.Option("Clear my Lotery 3 Points", 15);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(114);
                                    dialog.Send();
                                    break;
                                }
                            case 12:
                                {
                                    if (client.Entity.VotsPoints >= 3)
                                    {
                                        client.Entity.VotsPoints -= 3;
                                        client.Entity.PKPoints = 0;
                                    }
                                    break;
                                }
                            case 13:
                                {
                                    if (client.Entity.VotsPoints >= 5)
                                    {

                                        uint Uid = 0;
                                        byte type = (byte)ServerBase.Kernel.Random.Next(1, 26);
                                        switch (type)
                                        {
                                            #region Rand Souls
                                            case 1: Uid = 822052; break;
                                            case 2: Uid = 822053; break;
                                            case 3: Uid = 822054; break;
                                            case 4: Uid = 822055; break;
                                            case 5: Uid = 800413; break;
                                            case 6: Uid = 800414; break;
                                            case 7: Uid = 800014; break;
                                            case 8: Uid = 800015; break;
                                            case 9: Uid = 800016; break;
                                            case 10: Uid = 800512; break;
                                            case 11: Uid = 800613; break;
                                            case 12: Uid = 800415; break;
                                            case 13: Uid = 800420; break;
                                            case 14: Uid = 800513; break;
                                            case 15: Uid = 800017; break;
                                            case 16: Uid = 820052; break;
                                            case 17: Uid = 820053; break;
                                            case 18: Uid = 820054; break;
                                            case 19: Uid = 820055; break;
                                            case 20: Uid = 820056; break;
                                            case 21: Uid = 820057; break;
                                            case 22: Uid = 800110; break;
                                            case 23: Uid = 800320; break;
                                            case 24: Uid = 800616; break;
                                            case 25: Uid = 800722; break;
                                            case 26: Uid = 800000; break;
                                            #endregion
                                        }
                                        if (Uid != 0)
                                            if (client.Inventory.Add(Uid, 0, 1))
                                                client.Entity.VotsPoints -= 5;
                                    }
                                    break;
                                }
                            case 14:
                                {
                                    if (client.Entity.VotsPoints >= 3)
                                    {
                                        uint ItemID = 0;
                                        uint rand = (uint)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 78);
                                        switch (rand)
                                        {
                                            #region Rand Accesory
                                            case 1:
                                                ItemID = 350001;
                                                break;
                                            case 2:
                                                ItemID = 350002;
                                                break;
                                            case 3:
                                                ItemID = 350004;
                                                break;
                                            case 4:
                                                ItemID = 350005;
                                                break;
                                            case 5:
                                                ItemID = 350006;
                                                break;
                                            case 6:
                                                ItemID = 350007;
                                                break;
                                            case 7:
                                                ItemID = 350008;
                                                break;
                                            case 8:
                                                ItemID = 350009;
                                                break;
                                            case 9:
                                                ItemID = 350010;
                                                break;
                                            case 10:
                                                ItemID = 350011;
                                                break;
                                            case 11:
                                                ItemID = 350012;
                                                break;
                                            case 12:
                                                ItemID = 350014;
                                                break;
                                            case 13:
                                                ItemID = 350015;
                                                break;
                                            case 14:
                                                ItemID = 350016;
                                                break;
                                            case 15:
                                                ItemID = 350017;
                                                break;
                                            case 16://PalmLeafFan 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory A~delicate~and~beautiful~fan~made~of~palm~leaves. 8 0 0
                                                ItemID = 350018;
                                                break;
                                            case 17://IronShovel 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory An~iron~shovel~may~come~in~handy~in~winter,~when~you~need~to~shovel~paths~through~snow. 8 0 0
                                                ItemID = 350019;
                                                break;
                                            case 18:////FrozenTuna 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory It`s~a~strangely-shaped~tuna~from~Bird~Island. 8 0 0
                                                ItemID = 350020; break;
                                            case 19://IceStick 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory A~strange~stick.~Maybe~you~can~play~ice~hockey~with~it. 8 0 0
                                                ItemID = 360001;
                                                break;
                                            case 20://Wrench 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory It`s~a~heavy~wrench.~Perhaps~you~can~use~it~to~deal~ 8 0 0
                                                ItemID = 360002; break;
                                            case 21://WoodenClub 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory This~wooden~club~often~gives~off~a~sweet~odor. 8 0 0
                                                ItemID = 360003; break;
                                            case 22://Umbrella 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory An~unbreakable~umbrella~is~a~stealth~weapon~that~also~keeps~you~dry. 8 0 0
                                                ItemID = 360004; break;
                                            case 23:////Blowfish 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Dried~in~the~bright~sunlight~over~the~Desert,~the~blowfish~makes~a~good~weapon~for~it`s~as~hard~as~iron. 8 0 0
                                                ItemID = 360005; break;
                                            case 24://FeatherDuster 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360006; break;
                                            case 25://Spatula 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360007; break;
                                            case 26://InvincibleFist 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360008; break;
                                            case 27://FishPole 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360009; break;
                                            case 28://Pan 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360010; break;
                                            case 29://Handbag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360011;
                                                break;
                                            case 30://Backpack 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360012;
                                                break;
                                            case 31://SportsBag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360013; break;
                                            case 32://Bunny 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360014; break;
                                            case 33://GoodEveningBear 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360015; break;
                                            case 34://Rod 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360016;
                                                break;
                                            case 35://Clap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360017;
                                                break;
                                            case 36://HeavyHammer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360018;
                                                break;
                                            case 37://LightSaber 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360019
                                                     ;
                                                break;
                                            case 38://TennisRacket 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360020
                                                     ;
                                                break;
                                            case 39://ApeCityHam 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360021;
                                                break;
                                            case 40: //Wrench 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory It`s~a~heavy~wrench. 8 0 0
                                                ItemID = 360022;
                                                break;
                                            case 41: //WoodenClub 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory This~wooden~club~often~gives~off~a~sweet~odor. 8 0 0
                                                ItemID = 360023;
                                                break;
                                            case 42://Umbrella 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory An~unbreakable~umbrella~is~a~stealth~weapon~that~also~keeps~you~dry. 8 0 0
                                                ItemID = 360024;
                                                break;
                                            case 43://Blowfish 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Dried~in~the~bright~sunlight~over~the~Desert,~the~Mackerel~makes~a~good~weapon~for~it`s~as~hard~as~iron. 8 0 0
                                                ItemID = 360025;
                                                break;
                                            case 44://FeatherDuster 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360026;
                                                break;
                                            case 45://Spatula 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360027;
                                                break;
                                            case 46://InvincibleFist 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360028;
                                                break;
                                            case 47://FishPole 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360029;
                                                break;
                                            case 48://Pan 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360030;
                                                break;
                                            case 49://Handbag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360031;
                                                break;
                                            case 50://Backpack 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360032;
                                                break;
                                            case 51://SportsBag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360033;
                                                break;
                                            case 52://Bunny 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360034;
                                                break;
                                            case 53://GoodEveningBear 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360035;
                                                break;
                                            case 54://Rod 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360036;
                                                break;
                                            case 55://Clap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360037;
                                                break;
                                            case 56://HeavyHammer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360038;
                                                break;
                                            case 57://LightSaber 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360039;
                                                break;
                                            case 58://TennisRacket 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360040;
                                                break;
                                            case 59://ApeCityHam 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 370001;
                                                break;
                                            case 60: //WoodenBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                                ItemID = 370002;
                                                break;
                                            case 61://LoveBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                                ItemID = 370003;
                                                break;
                                            case 62://SeaHorse 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                                ItemID = 370004;
                                                break;
                                            case 63://Harp 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                                ItemID = 370005;
                                                break;
                                            case 64://ForceBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                                ItemID = 370011;
                                                break;
                                            case 65://WoodenBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 370012;
                                                break;
                                            case 66://LoveBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 370013;
                                                break;
                                            case 67://SeaHorse 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 370014;
                                                break;
                                            case 68://Harp 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 370015;
                                                break;
                                            case 69://ForceBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 380001;
                                                break;
                                            case 70://Wok 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                                ItemID = 380002;
                                                break;
                                            case 71://TurtleShell 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                                ItemID = 380003;
                                                break;
                                            case 72://LoveShield 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                                ItemID = 380004;
                                                break;
                                            case 73://SunFlower 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                                ItemID = 380005;
                                                break;
                                            case 74://Wheel 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                                ItemID = 380011;
                                                break;
                                            case 75://Wok 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 380012;
                                                break;
                                            case 76://TurtleShell 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 380013;
                                                break;
                                            case 77://LoveShield 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 380014;
                                                break;
                                            case 78://SunFlower 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 380015;
                                                break;
                                            default:
                                                ItemID = 380013;
                                                break;
                                            //Wheel 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                            #endregion
                                        }
                                        if (ItemID != 0)
                                            if (client.Inventory.Add(ItemID, 0, 1))
                                                client.Entity.VotsPoints -= 3;
                                    }
                                    break;
                                }
                            case 15:
                                {
                                    if (client.Entity.VotsPoints >= 3)
                                    {
                                        client.Entity.VotsPoints -= 3;
                                        Database.QuestTable.ResetLotto(client);
                                    }
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1507, 88, 112);
                                    ServerBase.Kernel.SendWorldMessage(new Network.GamePackets.Message(client.Entity.Name + " has join in PkMap!", System.Drawing.Color.Red, Conquer_Online_Server.Network.GamePackets.Message.Talk), ServerBase.Kernel.GamePool.Values);
                                    break;
                                }
                            case 2:
                                {
                                    if (client.Entity.QQ3 >= 1)
                                    {
                                        dialog.Text("Ohh sorry you can Take free stuff only once time");
                                        //dialog.Option("Yes please.", 1);
                                        dialog.Option("Thanks So Much", 255);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("What class are you?");
                                        dialog.Option("Trojan ", 10);
                                        dialog.Option("Warrior ", 20);
                                        dialog.Option("Archer ", 40);
                                        dialog.Option("Ninja", 50);
                                        dialog.Option("Monk", 60);
                                        dialog.Option("Fire", 100);
                                        dialog.Avatar(114);
                                        dialog.Send();
                                    }
                                    break;

                                }
                            case 10:
                                {
                                    if (client.Entity.Class >= npcRequest.OptionID && client.Entity.Class <= client.Entity.Class + 5)
                                    {
                                        client.Inventory.Add(118009, 6, 1, true);
                                        client.Inventory.Add(120009, 6, 1, true);
                                        client.Inventory.Add(150009, 6, 1, true);
                                        client.Inventory.Add(410009, 6, 1, true);
                                        client.Inventory.Add(130009, 6, 1, true);
                                        client.Inventory.Add(160019, 6, 1, true);
                                        client.Inventory.Add(723753, 0, 1, true);
                                        client.Inventory.Add(723917, 0, 1, true);
                                        client.Entity.QQ3 += 1;
                                        dialog.Text("Done! Welcome to BrightStarV2 !");
                                        dialog.Option("Thanks", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();

                                    }
                                    break;
                                }
                            case 20:
                                {
                                    if (client.Entity.Class >= npcRequest.OptionID && client.Entity.Class <= client.Entity.Class + 5)
                                    {

                                        client.Inventory.Add(111009, 6, 1, true);
                                        client.Inventory.Add(120009, 6, 1, true);
                                        client.Inventory.Add(150009, 6, 1, true);
                                        client.Inventory.Add(561009, 6, 1, true);
                                        client.Inventory.Add(131009, 6, 1, true);
                                        client.Inventory.Add(160019, 6, 1, true);
                                        client.Inventory.Add(723917, 0, 1, true);
                                        client.Inventory.Add(723753, 0, 1, true);
                                        client.Entity.QQ3 += 1;
                                        dialog.Text("Done! Welcome to BrightStarV2  !");
                                        dialog.Option("Thanks", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();

                                    }
                                    break;
                                }
                            case 40:
                                {
                                    if (client.Entity.Class >= npcRequest.OptionID && client.Entity.Class <= client.Entity.Class + 5)
                                    {
                                        client.Inventory.Add(117009, 6, 1, true);
                                        client.Inventory.Add(120009, 6, 1, true);
                                        client.Inventory.Add(150009, 6, 1, true);
                                        client.Inventory.Add(500009, 6, 1, true);
                                        client.Inventory.Add(133009, 6, 1, true);
                                        client.Inventory.Add(160019, 6, 1, true);
                                        client.Inventory.Add(723753, 0, 1, true);
                                        client.Inventory.Add(723917, 0, 1, true);
                                        client.Entity.QQ3 += 1;
                                        dialog.Text("Done! Welcome to BrightStarV2 !");
                                        dialog.Option("Thanks", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();

                                    }
                                    break;
                                }
                            case 50:
                                {
                                    if (client.Entity.Class >= npcRequest.OptionID && client.Entity.Class <= client.Entity.Class + 5)
                                    {
                                        client.Inventory.Add(117009, 6, 1, true);
                                        client.Inventory.Add(120009, 6, 1, true);
                                        client.Inventory.Add(150009, 6, 1, true);
                                        client.Inventory.Add(601009, 6, 1, true);
                                        client.Inventory.Add(135009, 6, 1, true);
                                        client.Inventory.Add(160019, 6, 1, true);
                                        client.Inventory.Add(723753, 0, 1, true);
                                        client.Inventory.Add(723917, 0, 1, true);
                                        client.Entity.QQ3 += 1;
                                        dialog.Text("Done! Welcome to BrightStarV2 !");
                                        dialog.Option("Thanks", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();

                                    }
                                    break;
                                }
                            case 60:
                                {
                                    if (client.Entity.Class >= npcRequest.OptionID && client.Entity.Class <= client.Entity.Class + 5)
                                    {
                                        client.Inventory.Add(117009, 6, 1, true);
                                        client.Inventory.Add(120009, 6, 1, true);
                                        client.Inventory.Add(150009, 6, 1, true);
                                        client.Inventory.Add(610009, 6, 1, true);
                                        client.Inventory.Add(136009, 6, 1, true);
                                        client.Inventory.Add(723753, 0, 1, true);
                                        client.Inventory.Add(160019, 6, 1, true);
                                        client.Inventory.Add(723917, 0, 1, true);
                                        client.Entity.QQ3 += 1;
                                        dialog.Text("Done! Welcome to BrightStarV2 !");
                                        dialog.Option("Thanks", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();

                                    }
                                    break;
                                }
                            case 100:
                                {
                                    if (client.Entity.Class >= npcRequest.OptionID && client.Entity.Class <= client.Entity.Class + 5)
                                    {
                                        client.Inventory.Add(117009, 6, 1, true);
                                        client.Inventory.Add(121009, 6, 1, true);
                                        client.Inventory.Add(152019, 6, 1, true);
                                        client.Inventory.Add(421009, 6, 1, true);
                                        client.Inventory.Add(723753, 0, 1, true);
                                        client.Inventory.Add(134009, 6, 1, true);
                                        client.Inventory.Add(160019, 6, 1, true);
                                        client.Inventory.Add(723917, 0, 1, true);
                                        client.Entity.QQ3 += 1;
                                        dialog.Text("Done! Welcome to BrightStarV2  !");
                                        dialog.Option("Thanks", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();

                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region NewMonsters
                case 30065054:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would you like to go to New Monsters ");
                                    dialog.Option("TreatoDragon.", 1);
                                    dialog.Option("LavaBeast.", 2);
                                    dialog.Option("SnowBanche.", 3);
                                    dialog.Option("SwordMaster.", 4);
                                    dialog.Option("ThrillingSpook.", 5);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1002, 565, 793);
                                    break;
                                }
                            case 2:
                                {
                                    client.Entity.Teleport(2056, 467, 740);
                                    break;
                                }
                            case 3:
                                {
                                    client.Entity.Teleport(7007, 347, 370);
                                    break;
                                }
                            case 4:
                                {
                                    client.Entity.Teleport(1090, 076, 051);
                                    break;
                                }
                            case 5:
                                {
                                    client.Entity.Teleport(1068, 055, 055);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #region QQQ
                #region SwordMaster
                case 6666660:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    if (client.Entity.QQ2 >= 1)
                                    {
                                        dialog.Text("Ohh sorry you can make it Once in day See you Next Day");
                                        //dialog.Option("Yes please.", 1);
                                        dialog.Option("Thanks So Much", 255);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("I have just discovered a new place, can get cps from a big monster called  || SwordMaster || is strog be cearful to join you must your level is 130 or above");
                                        dialog.Text("and your reward will be Cps Or Special Iteams, Steeds, Lord Tokens, Study Points");
                                        dialog.Option("Yes please.", 1);
                                        dialog.Option("No thank you.", 255);
                                        dialog.Send();

                                    }
                                    break;
                                }
                            case 1:
                                {

                                    if (client.Entity.Level >= 130)
                                    {
                                        client.Entity.Teleport(1090, 076, 051);
                                    }
                                    else
                                    {
                                        dialog.Text("Ohh sorry your level is " + client.Entity.Level + "  to low to join you must be 130or above");
                                        //  dialog.Option("Yes please.", 1);
                                        // dialog.Option("No thank you.", 255);
                                        dialog.Option("Thanks So Much", 255);
                                        dialog.Send();
                                    }

                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region ThrillingSpook
                case 6666661:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    if (client.Entity.QQ1 >= 1)
                                    {
                                        dialog.Text("Ohh sorry you can make it Once in day See you Next Day");
                                        //dialog.Option("Yes please.", 1);
                                        dialog.Option("Thanks So Much", 255);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("I have just discovered a new place, can get cps from a big monster called  || ThrillingSpook || is strog be cearful to join you must your level is 133 or above");
                                        dialog.Text("and your reward will be Cps Or Special Iteams, Steeds, Lord Tokens, Study Points");
                                        dialog.Option("Yes please.", 1);
                                        dialog.Option("No thank you.", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 1:
                                {

                                    if (client.Entity.Level >= 133)
                                    {
                                        client.Entity.Teleport(1036, 243, 147);
                                    }
                                    else
                                    {
                                        dialog.Text("Ohh sorry your level is " + client.Entity.Level + "  to low to join you must be 130or above");
                                        //  dialog.Option("Yes please.", 1);
                                        // dialog.Option("No thank you.", 255);
                                        dialog.Option("Thanks So Much", 255);
                                        dialog.Send();
                                    }

                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #endregion

                #region ChangePassword
                case 1061441: //WarehouseGuardian
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello. I'm the one that was choosen to set/change your account  password .you can change you password for 14 letters nubmer or characters.");

                                    dialog.Option("I want to change the password.", 2);
                                    // dialog.Option("I want to remove the password.", 3);

                                    dialog.Option("Forget it.", 255);
                                    dialog.Send();
                                    break;
                                }

                            #region Change password
                            case 2:
                                {
                                    if (client.Account.Password != "")
                                    {
                                        dialog.Text("Please insert the old password you have now.");
                                        dialog.Input("Here:", 6, 14);
                                        dialog.Option("Forget it.", 255);
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have a password set.");
                                        dialog.Option("Alright.", 255);
                                    }
                                    dialog.Send();
                                    break;
                                }
                            case 6:
                                {
                                    if (client.Account.Password != "")
                                    {
                                        if (npcRequest.Input.Length <= 14)
                                        {
                                            if (client.Account.Password == npcRequest.Input)
                                            {
                                                dialog.Text("Please insert the password again.");
                                                dialog.Input("Here:", 7, 14);
                                                dialog.Option("Forget it.", 255);
                                            }
                                            else
                                            {
                                                dialog.Text("Wrong password. Try again?");
                                                dialog.Input("Here:", 6, 14);
                                                dialog.Option("Alright.", 255);
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("Invalid password, please try again.");
                                            dialog.Input("Here:", 6, 14);
                                            dialog.Option("Alright.", 255);
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have a password set.");
                                        dialog.Option("Alright.", 255);
                                    }
                                    dialog.Send();
                                    break;
                                }
                            case 7:
                                {
                                    if (client.Account.Password != "")
                                    {
                                        if (npcRequest.Input.Length <= 14)
                                        {
                                            client.TempPassword = npcRequest.Input;
                                            dialog.Text("Please insert the password again.");
                                            dialog.Input("Here:", 8, 14);
                                            dialog.Option("Forget it.", 255);
                                        }
                                        else
                                        {
                                            dialog.Text("Invalid password, please try again.");
                                            dialog.Input("Here:", 7, 14);
                                            dialog.Option("Alright.", 255);
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have a password set.");
                                        dialog.Option("Alright.", 255);
                                    }
                                    dialog.Send();
                                    break;
                                }
                            case 8:
                                {
                                    if (client.Account.Password != "")
                                    {
                                        if (npcRequest.Input.Length <= 14)
                                        {
                                            if (client.TempPassword == npcRequest.Input)
                                            {
                                                client.TempPassword = "";
                                                client.Account.Password = npcRequest.Input;
                                                client.Account.Save();
                                                dialog.Text("Password changed!");
                                                dialog.Option("Thank you.", 255);
                                            }
                                            else
                                            {
                                                dialog.Text("Wrong password.");
                                                dialog.Input("Here:", 8, 14);
                                                dialog.Option("Alright.", 255);
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("Invalid password, please try again.");
                                            dialog.Input("Here:", 8, 14);
                                            dialog.Option("Alright.", 255);
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have a password set.");
                                        dialog.Option("Alright.", 255);
                                    }
                                    dialog.Send();
                                    break;
                                }
                            #endregion

                        }
                        break;
                    }
                #endregion

                #region PK less than
                case 10021252:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    if (client.Entity.PKPoints < 30)
                                    {
                                        dialog.Text("i cant less your pk." + client.Entity.PKPoints);
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                        break;
                                    }
                                    dialog.Text("Hay I am Pkpoints lesser i can less your pk from 30 or higher");
                                    dialog.Option("-[30] PKponits 1000 cps.", 1);
                                    dialog.Option("-[60] PKponits 2000 cps", 2);
                                    dialog.Option("-[90] PKponits 3000 cps", 3);
                                    dialog.Option("-[120] PKponits 4000 cps", 4);
                                    dialog.Option("-[150] PKponits 5000 cps", 5);
                                    dialog.Option("-[200] PKponits 6000 cps", 6);
                                    dialog.Option("-[250] PKponits 7000 cps", 7);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(116);
                                    dialog.Send();
                                    break;

                                }
                            case 1:
                                {
                                    if (client.Entity.PKPoints >= 30)
                                    {
                                        if (client.Entity.ConquerPoints >= 1000)
                                        {
                                            client.Entity.ConquerPoints -= 1000;
                                            client.Entity.PKPoints -= 30;
                                        }
                                        else
                                        {
                                            dialog.Text("Please take 1000 cps.");
                                            dialog.Option("I see.", 255);
                                            dialog.Avatar(116);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("your pk points is low must higher than." + client.Entity.PKPoints);
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 2:
                                {
                                    if (client.Entity.PKPoints >= 60)
                                    {
                                        if (client.Entity.ConquerPoints >= 2000)
                                        {
                                            client.Entity.ConquerPoints -= 2000;
                                            client.Entity.PKPoints -= 60;
                                        }
                                        else
                                        {
                                            dialog.Text("Please take 2000 cps.");
                                            dialog.Option("I see.", 255);
                                            dialog.Avatar(116);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("your pk points is low must higher than." + client.Entity.PKPoints);
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 3:
                                {
                                    if (client.Entity.PKPoints >= 90)
                                    {
                                        if (client.Entity.ConquerPoints >= 3000)
                                        {
                                            client.Entity.ConquerPoints -= 3000;
                                            client.Entity.PKPoints -= 90;
                                        }
                                        else
                                        {
                                            dialog.Text("Please take 3000 cps.");
                                            dialog.Option("I see.", 255);
                                            dialog.Avatar(116);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("your pk points is low must higher than." + client.Entity.PKPoints);
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 4:
                                {
                                    if (client.Entity.PKPoints >= 120)
                                    {
                                        if (client.Entity.ConquerPoints >= 4000)
                                        {
                                            client.Entity.ConquerPoints -= 4000;
                                            client.Entity.PKPoints -= 120;
                                        }
                                        else
                                        {
                                            dialog.Text("Please take 4000 cps.");
                                            dialog.Option("I see.", 255);
                                            dialog.Avatar(116);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("your pk points is low must higher than." + client.Entity.PKPoints);
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 5:
                                {
                                    if (client.Entity.PKPoints >= 150)
                                    {
                                        if (client.Entity.ConquerPoints >= 5000)
                                        {
                                            client.Entity.ConquerPoints -= 5000;
                                            client.Entity.PKPoints -= 150;
                                        }
                                        else
                                        {
                                            dialog.Text("Please take 5000 cps.");
                                            dialog.Option("I see.", 255);
                                            dialog.Avatar(116);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("your pk points is low must higher than." + client.Entity.PKPoints);
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 6:
                                {
                                    if (client.Entity.PKPoints >= 200)
                                    {
                                        if (client.Entity.ConquerPoints >= 6000)
                                        {
                                            client.Entity.ConquerPoints -= 6000;
                                            client.Entity.PKPoints -= 200;
                                        }
                                        else
                                        {
                                            dialog.Text("Please take 6000 cps.");
                                            dialog.Option("I see.", 255);
                                            dialog.Avatar(116);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("your pk points is low must higher than." + client.Entity.PKPoints);
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 7:
                                {
                                    if (client.Entity.PKPoints >= 250)
                                    {
                                        if (client.Entity.ConquerPoints >= 7000)
                                        {
                                            client.Entity.ConquerPoints -= 7000;
                                            client.Entity.PKPoints -= 250;
                                        }
                                        else
                                        {
                                            dialog.Text("Please take 7000 cps.");
                                            dialog.Option("I see.", 255);
                                            dialog.Avatar(116);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("your pk points is low must higher than." + client.Entity.PKPoints);
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #region ChangeName
                case 1061441200:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hola, Yo te puedo cambiar el nombre por 50 mil CPS");

                                    dialog.Option("Yo deseo cambiar el nombre.", 2);
                                    dialog.Option("Dejame Pensar.", 255);
                                    dialog.Send();
                                    break;
                                }

                            #region Change Name
                            case 2:
                                {
                                    if (client.Entity.ConquerPoints < 50000)
                                    {
                                        dialog.Text("i can't change your name you maust have 50k cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                        break;
                                    }
                                    if (client.Entity.Name != "")
                                    {
                                        dialog.Text("Por favor inserta el nombre que usas ahora.");
                                        dialog.Input("Here:", 6, 14);
                                        dialog.Option("Forget it.", 255);
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have a Name set.");
                                        dialog.Option("Alright.", 255);
                                    }
                                    dialog.Send();
                                    break;
                                }
                            case 6:
                                {

                                    if (client.Entity.Name != "")
                                    {
                                        if (InvalidCharacters(npcRequest.Input) && npcRequest.Input.Length <= 14)
                                        {

                                            if (client.Entity.Name == npcRequest.Input)
                                            {

                                                dialog.Text("Por favor inserta el nuevo nombre.");
                                                dialog.Input("Here:", 7, 14);
                                                dialog.Option("Forget it.", 255);
                                            }
                                            else
                                            {
                                                dialog.Text("Wrong Name. Try again?");
                                                dialog.Input("Here:", 6, 14);
                                                dialog.Option("Alright.", 255);
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("Invalid Name, please try again.");
                                            dialog.Input("Here:", 6, 14);
                                            dialog.Option("Alright.", 255);
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have a Name set.");
                                        dialog.Option("Alright.", 255);
                                    }
                                    dialog.Send();
                                    break;
                                }
                            case 7:
                                {

                                    if (client.Entity.Name != "")
                                    {

                                        if (InvalidCharacters(npcRequest.Input) && npcRequest.Input.Length <= 14)
                                        {

                                            client.TempPassword = npcRequest.Input;
                                            dialog.Text("Por favor insterte el nuevo nombre de nuevo.");
                                            dialog.Input("Here:", 8, 14);
                                            dialog.Option("Forget it.", 255);
                                        }
                                        else
                                        {
                                            dialog.Text("Invalid Name, please try again.");
                                            dialog.Input("Here:", 7, 14);
                                            dialog.Option("Alright.", 255);
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have a Name set.");
                                        dialog.Option("Alright.", 255);
                                    }
                                    dialog.Send();
                                    break;
                                }
                            case 8:
                                {
                                    if (InvalidCharacters2(npcRequest.Input))
                                    {
                                        if (client.Entity.Name != "")
                                        {
                                            if (InvalidCharacters(npcRequest.Input) && npcRequest.Input.Length <= 14)
                                            {

                                                if (client.TempPassword == npcRequest.Input)
                                                {
                                                    if (client.Entity.ConquerPoints >= 50000)
                                                    {
                                                        client.TempPassword = "";
                                                        client.Send(new Message("El Jugador " + client.Entity.Name + " despues de tanto pensarlo se ha cambiado el nombre a " + npcRequest.Input + "", Color.White, Message.Whisper));
                                                        client.Entity.ConquerPoints -= 50000;
                                                        client.Account.Save();
                                                        client.Entity.Name = npcRequest.Input;
                                                        client.Screen.Reload(null);
                                                        Database.EntityTable.SaveEntities(client.Entity);
                                                        Database.ArenaTable.UpgradeNameArena(client);
                                                        client.Disconnect();
                                                        dialog.Text("Name changed a " + client.Entity.Name + "!");
                                                        dialog.Option("Thank you.", 255);
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("Wrong Name.");
                                                        dialog.Input("Here:", 8, 14);
                                                        dialog.Option("Alright.", 255);
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                dialog.Text("Invalid Name, please try again.");
                                                dialog.Input("Here:", 8, 14);
                                                dialog.Option("Alright.", 255);
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("Name errorrrrrr.");
                                            dialog.Option("Alright.", 255);
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("Name you are choised is used try agine.");
                                        dialog.Option("Alright.", 255);
                                    }

                                    dialog.Send();
                                    break;
                                }
                            #endregion

                        }
                        break;
                    }
                #endregion
                #region LadyLuck join
                case 4490:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    if (client.InLottery2)
                                    {
                                        dialog.Text("My friend, did something happen to you?\nYou may still want to try your luck since you already paid me the fee.");
                                        dialog.Option("Alright, take me in.", 2);
                                        dialog.Option("Later...", 255);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("Hello my friend. Have you ever heard of the lottery?\nWell, my friend, to join the lottery you need 2000 ConquerPoints. By entering the lottery you'll gain a big chance to win wonderful items, wonderful and very expensive.\n\nWhat do you say, would you like to join?\n");
                                        dialog.Option("Alright, take me in.", 1);
                                        dialog.Option("Later...", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.Level >= 1)
                                    {
                                        if (client.LotteryEntries2 < 10)
                                        {
                                            if (client.Entity.ConquerPoints >= 2000)
                                            {
                                                client.Entity.ConquerPoints -= 2000;
                                                client.InLottery2 = true;
                                                client.LotteryEntries2++;
                                                client.Entity.Teleport(701, 42, 50);
                                            }
                                            else
                                            {
                                                dialog.Text("You dont have 2000 CPS");
                                                dialog.Option("Ahh sorry.", 255);
                                                dialog.Send();
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("You may not join the lottery today. You have already tried it 10 times today.");
                                            dialog.Option("Ahh sorry.", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("You may not join the lottery , you need level 1 first.");
                                        dialog.Option("Ahh sorry.", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 2:
                                {
                                    if (client.InLottery2)
                                    {
                                        client.Entity.Teleport(701, 42, 50);
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region LadyLuck2
                case 9241:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    if (client.InLottery2)
                                    {
                                        dialog.Text("You may come back later, if you still want to try your luck. It will be free next time you want.");
                                        dialog.Option("Yes please, let me out.", 1);
                                        dialog.Option("No thank you.", 255);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("Thank you for trying out the lottery. Please come back any other time, we will wait you.");
                                        dialog.Option("Take me out.", 1);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1002, 425, 379);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region NPcCenter
                case 50204:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hi,so what can i do for you?");
                                    dialog.Option("Enter Pk map ", 1);
                                    dialog.Option("Get free items ", 2);
                                    dialog.Option("About VotsPoints ", 4);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(114);
                                    dialog.Send();
                                    break;
                                }
                            case 4:
                                {
                                    dialog.Text("You will get vote points for every vote! You wana change VotsPoints? You Have " + client.Entity.VotsPoints + "");
                                    dialog.Option("Remove my pkp 3 Points", 12);
                                    dialog.Option("Random SoulItem 5 Points", 13);
                                    dialog.Option("Random Accesory 3 Points", 14);
                                    dialog.Option("Clear my Lotery 3 Points", 15);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(114);
                                    dialog.Send();
                                    break;
                                }
                            case 12:
                                {
                                    if (client.Entity.VotsPoints >= 3)
                                    {
                                        client.Entity.VotsPoints -= 3;
                                        client.Entity.PKPoints = 0;
                                    }
                                    break;
                                }
                            case 13:
                                {
                                    if (client.Entity.VotsPoints >= 5)
                                    {

                                        uint Uid = 0;
                                        byte type = (byte)ServerBase.Kernel.Random.Next(1, 26);
                                        switch (type)
                                        {
                                            #region Rand Souls
                                            case 1: Uid = 822052; break;
                                            case 2: Uid = 822053; break;
                                            case 3: Uid = 822054; break;
                                            case 4: Uid = 822055; break;
                                            case 5: Uid = 800413; break;
                                            case 6: Uid = 800414; break;
                                            case 7: Uid = 800014; break;
                                            case 8: Uid = 800015; break;
                                            case 9: Uid = 800016; break;
                                            case 10: Uid = 800512; break;
                                            case 11: Uid = 800613; break;
                                            case 12: Uid = 800415; break;
                                            case 13: Uid = 800420; break;
                                            case 14: Uid = 800513; break;
                                            case 15: Uid = 800017; break;
                                            case 16: Uid = 820052; break;
                                            case 17: Uid = 820053; break;
                                            case 18: Uid = 820054; break;
                                            case 19: Uid = 820055; break;
                                            case 20: Uid = 820056; break;
                                            case 21: Uid = 820057; break;
                                            case 22: Uid = 800110; break;
                                            case 23: Uid = 800320; break;
                                            case 24: Uid = 800616; break;
                                            case 25: Uid = 800722; break;
                                            case 26: Uid = 800000; break;
                                            #endregion
                                        }
                                        if (Uid != 0)
                                            if (client.Inventory.Add(Uid, 0, 1))
                                                client.Entity.VotsPoints -= 5;
                                    }
                                    break;
                                }
                            case 14:
                                {
                                    if (client.Entity.VotsPoints >= 3)
                                    {
                                        uint ItemID = 0;
                                        uint rand = (uint)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 78);
                                        switch (rand)
                                        {
                                            #region Rand Accesory
                                            case 1:
                                                ItemID = 350001;
                                                break;
                                            case 2:
                                                ItemID = 350002;
                                                break;
                                            case 3:
                                                ItemID = 350004;
                                                break;
                                            case 4:
                                                ItemID = 350005;
                                                break;
                                            case 5:
                                                ItemID = 350006;
                                                break;
                                            case 6:
                                                ItemID = 350007;
                                                break;
                                            case 7:
                                                ItemID = 350008;
                                                break;
                                            case 8:
                                                ItemID = 350009;
                                                break;
                                            case 9:
                                                ItemID = 350010;
                                                break;
                                            case 10:
                                                ItemID = 350011;
                                                break;
                                            case 11:
                                                ItemID = 350012;
                                                break;
                                            case 12:
                                                ItemID = 350014;
                                                break;
                                            case 13:
                                                ItemID = 350015;
                                                break;
                                            case 14:
                                                ItemID = 350016;
                                                break;
                                            case 15:
                                                ItemID = 350017;
                                                break;
                                            case 16://PalmLeafFan 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory A~delicate~and~beautiful~fan~made~of~palm~leaves. 8 0 0
                                                ItemID = 350018;
                                                break;
                                            case 17://IronShovel 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory An~iron~shovel~may~come~in~handy~in~winter,~when~you~need~to~shovel~paths~through~snow. 8 0 0
                                                ItemID = 350019;
                                                break;
                                            case 18:////FrozenTuna 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory It`s~a~strangely-shaped~tuna~from~Bird~Island. 8 0 0
                                                ItemID = 350020; break;
                                            case 19://IceStick 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory A~strange~stick.~Maybe~you~can~play~ice~hockey~with~it. 8 0 0
                                                ItemID = 360001;
                                                break;
                                            case 20://Wrench 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory It`s~a~heavy~wrench.~Perhaps~you~can~use~it~to~deal~ 8 0 0
                                                ItemID = 360002; break;
                                            case 21://WoodenClub 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory This~wooden~club~often~gives~off~a~sweet~odor. 8 0 0
                                                ItemID = 360003; break;
                                            case 22://Umbrella 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory An~unbreakable~umbrella~is~a~stealth~weapon~that~also~keeps~you~dry. 8 0 0
                                                ItemID = 360004; break;
                                            case 23:////Blowfish 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Dried~in~the~bright~sunlight~over~the~Desert,~the~blowfish~makes~a~good~weapon~for~it`s~as~hard~as~iron. 8 0 0
                                                ItemID = 360005; break;
                                            case 24://FeatherDuster 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360006; break;
                                            case 25://Spatula 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360007; break;
                                            case 26://InvincibleFist 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360008; break;
                                            case 27://FishPole 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360009; break;
                                            case 28://Pan 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360010; break;
                                            case 29://Handbag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360011;
                                                break;
                                            case 30://Backpack 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360012;
                                                break;
                                            case 31://SportsBag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360013; break;
                                            case 32://Bunny 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360014; break;
                                            case 33://GoodEveningBear 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360015; break;
                                            case 34://Rod 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360016;
                                                break;
                                            case 35://Clap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360017;
                                                break;
                                            case 36://HeavyHammer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360018;
                                                break;
                                            case 37://LightSaber 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360019
                                                     ;
                                                break;
                                            case 38://TennisRacket 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360020
                                                     ;
                                                break;
                                            case 39://ApeCityHam 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                                ItemID = 360021;
                                                break;
                                            case 40: //Wrench 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory It`s~a~heavy~wrench. 8 0 0
                                                ItemID = 360022;
                                                break;
                                            case 41: //WoodenClub 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory This~wooden~club~often~gives~off~a~sweet~odor. 8 0 0
                                                ItemID = 360023;
                                                break;
                                            case 42://Umbrella 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory An~unbreakable~umbrella~is~a~stealth~weapon~that~also~keeps~you~dry. 8 0 0
                                                ItemID = 360024;
                                                break;
                                            case 43://Blowfish 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Dried~in~the~bright~sunlight~over~the~Desert,~the~Mackerel~makes~a~good~weapon~for~it`s~as~hard~as~iron. 8 0 0
                                                ItemID = 360025;
                                                break;
                                            case 44://FeatherDuster 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360026;
                                                break;
                                            case 45://Spatula 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360027;
                                                break;
                                            case 46://InvincibleFist 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360028;
                                                break;
                                            case 47://FishPole 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360029;
                                                break;
                                            case 48://Pan 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360030;
                                                break;
                                            case 49://Handbag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360031;
                                                break;
                                            case 50://Backpack 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360032;
                                                break;
                                            case 51://SportsBag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360033;
                                                break;
                                            case 52://Bunny 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360034;
                                                break;
                                            case 53://GoodEveningBear 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360035;
                                                break;
                                            case 54://Rod 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360036;
                                                break;
                                            case 55://Clap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360037;
                                                break;
                                            case 56://HeavyHammer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360038;
                                                break;
                                            case 57://LightSaber 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360039;
                                                break;
                                            case 58://TennisRacket 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 360040;
                                                break;
                                            case 59://ApeCityHam 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 370001;
                                                break;
                                            case 60: //WoodenBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                                ItemID = 370002;
                                                break;
                                            case 61://LoveBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                                ItemID = 370003;
                                                break;
                                            case 62://SeaHorse 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                                ItemID = 370004;
                                                break;
                                            case 63://Harp 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                                ItemID = 370005;
                                                break;
                                            case 64://ForceBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                                ItemID = 370011;
                                                break;
                                            case 65://WoodenBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 370012;
                                                break;
                                            case 66://LoveBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 370013;
                                                break;
                                            case 67://SeaHorse 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 370014;
                                                break;
                                            case 68://Harp 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 370015;
                                                break;
                                            case 69://ForceBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 380001;
                                                break;
                                            case 70://Wok 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                                ItemID = 380002;
                                                break;
                                            case 71://TurtleShell 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                                ItemID = 380003;
                                                break;
                                            case 72://LoveShield 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                                ItemID = 380004;
                                                break;
                                            case 73://SunFlower 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                                ItemID = 380005;
                                                break;
                                            case 74://Wheel 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                                ItemID = 380011;
                                                break;
                                            case 75://Wok 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 380012;
                                                break;
                                            case 76://TurtleShell 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 380013;
                                                break;
                                            case 77://LoveShield 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 380014;
                                                break;
                                            case 78://SunFlower 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                                ItemID = 380015;
                                                break;
                                            default:
                                                ItemID = 380013;
                                                break;
                                            //Wheel 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                            #endregion
                                        }
                                        if (ItemID != 0)
                                            if (client.Inventory.Add(ItemID, 0, 1))
                                                client.Entity.VotsPoints -= 3;
                                    }
                                    break;
                                }
                            case 15:
                                {
                                    if (client.Entity.VotsPoints >= 3)
                                    {
                                        client.Entity.VotsPoints -= 3;
                                        Database.QuestTable.ResetLotto(client);
                                    }
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1507, 88, 112);
                                    ServerBase.Kernel.SendWorldMessage(new Network.GamePackets.Message(client.Entity.Name + " has join in PkMap!", System.Drawing.Color.Red, Conquer_Online_Server.Network.GamePackets.Message.Talk), ServerBase.Kernel.GamePool.Values);
                                    break;
                                }
                            case 2:
                                {
                                    if (client.Entity.QQ3 >= 1)
                                    {
                                        dialog.Text("Ohh sorry you can Take free stuff only once time");
                                        //dialog.Option("Yes please.", 1);
                                        dialog.Option("Thanks So Much", 255);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("What class are you?");
                                        dialog.Option("Trojan ", 10);
                                        dialog.Option("Warrior ", 20);
                                        dialog.Option("Archer ", 40);
                                        dialog.Option("Ninja", 50);
                                        dialog.Option("Monk", 60);
                                        dialog.Option("Fire", 100);
                                        dialog.Avatar(114);
                                        dialog.Send();
                                    }
                                    break;

                                }
                            case 10:
                                {
                                    if (client.Entity.Class >= npcRequest.OptionID && client.Entity.Class <= client.Entity.Class + 5)
                                    {
                                        client.Inventory.Add(118009, 6, 1, true);
                                        client.Inventory.Add(120009, 6, 1, true);
                                        client.Inventory.Add(150009, 6, 1, true);
                                        client.Inventory.Add(410009, 6, 1, true);
                                        client.Inventory.Add(130009, 6, 1, true);
                                        client.Inventory.Add(160019, 6, 1, true);
                                        client.Inventory.Add(723753, 0, 1, true);
                                        client.Inventory.Add(723917, 0, 1, true);
                                        client.Entity.QQ3 += 1;
                                        dialog.Text("Done! Welcome to Mr.sayed-Co !");
                                        dialog.Option("Thanks", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();

                                    }
                                    break;
                                }
                            case 20:
                                {
                                    if (client.Entity.Class >= npcRequest.OptionID && client.Entity.Class <= client.Entity.Class + 5)
                                    {

                                        client.Inventory.Add(111009, 6, 1, true);
                                        client.Inventory.Add(120009, 6, 1, true);
                                        client.Inventory.Add(150009, 6, 1, true);
                                        client.Inventory.Add(561009, 6, 1, true);
                                        client.Inventory.Add(131009, 6, 1, true);
                                        client.Inventory.Add(160019, 6, 1, true);
                                        client.Inventory.Add(723917, 0, 1, true);
                                        client.Inventory.Add(723753, 0, 1, true);
                                        client.Entity.QQ3 += 1;
                                        dialog.Text("Done! Welcome to BrightStarV2  !");
                                        dialog.Option("Thanks", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();

                                    }
                                    break;
                                }
                            case 40:
                                {
                                    if (client.Entity.Class >= npcRequest.OptionID && client.Entity.Class <= client.Entity.Class + 5)
                                    {
                                        client.Inventory.Add(117009, 6, 1, true);
                                        client.Inventory.Add(120009, 6, 1, true);
                                        client.Inventory.Add(150009, 6, 1, true);
                                        client.Inventory.Add(500009, 6, 1, true);
                                        client.Inventory.Add(133009, 6, 1, true);
                                        client.Inventory.Add(160019, 6, 1, true);
                                        client.Inventory.Add(723753, 0, 1, true);
                                        client.Inventory.Add(723917, 0, 1, true);
                                        client.Entity.QQ3 += 1;
                                        dialog.Text("Done! Welcome to BrightStarV2 !");
                                        dialog.Option("Thanks", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();

                                    }
                                    break;
                                }
                            case 50:
                                {
                                    if (client.Entity.Class >= npcRequest.OptionID && client.Entity.Class <= client.Entity.Class + 5)
                                    {
                                        client.Inventory.Add(117009, 6, 1, true);
                                        client.Inventory.Add(120009, 6, 1, true);
                                        client.Inventory.Add(150009, 6, 1, true);
                                        client.Inventory.Add(601009, 6, 1, true);
                                        client.Inventory.Add(135009, 6, 1, true);
                                        client.Inventory.Add(160019, 6, 1, true);
                                        client.Inventory.Add(723753, 0, 1, true);
                                        client.Inventory.Add(723917, 0, 1, true);
                                        client.Entity.QQ3 += 1;
                                        dialog.Text("Done! Welcome to BrightStarV2 !");
                                        dialog.Option("Thanks", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();

                                    }
                                    break;
                                }
                            case 60:
                                {
                                    if (client.Entity.Class >= npcRequest.OptionID && client.Entity.Class <= client.Entity.Class + 5)
                                    {
                                        client.Inventory.Add(117009, 6, 1, true);
                                        client.Inventory.Add(120009, 6, 1, true);
                                        client.Inventory.Add(150009, 6, 1, true);
                                        client.Inventory.Add(610009, 6, 1, true);
                                        client.Inventory.Add(136009, 6, 1, true);
                                        client.Inventory.Add(723753, 0, 1, true);
                                        client.Inventory.Add(160019, 6, 1, true);
                                        client.Inventory.Add(723917, 0, 1, true);
                                        client.Entity.QQ3 += 1;
                                        dialog.Text("Done! Welcome to BrightStarV2 !");
                                        dialog.Option("Thanks", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();

                                    }
                                    break;
                                }
                            case 100:
                                {
                                    if (client.Entity.Class >= npcRequest.OptionID && client.Entity.Class <= client.Entity.Class + 5)
                                    {
                                        client.Inventory.Add(117009, 6, 1, true);
                                        client.Inventory.Add(121009, 6, 1, true);
                                        client.Inventory.Add(152019, 6, 1, true);
                                        client.Inventory.Add(421009, 6, 1, true);
                                        client.Inventory.Add(723753, 0, 1, true);
                                        client.Inventory.Add(134009, 6, 1, true);
                                        client.Inventory.Add(160019, 6, 1, true);
                                        client.Inventory.Add(723917, 0, 1, true);
                                        client.Entity.QQ3 += 1;
                                        dialog.Text("Done! Welcome to BrightStarV2  !");
                                        dialog.Option("Thanks", 255);
                                        dialog.Avatar(80);
                                        dialog.Send();

                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion

                #region Steed Seller
                case 4488:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hay i will Sell Rare Steed For CPs");
                                    dialog.Option("[ZebraSteed +6] 1kk CPs.", 1);
                                    dialog.Option("[BlazeHoofSteed +6] 1kk CPs.", 2);
                                    dialog.Option("[FrostBiteSteed +6] 1kk CPs.", 3);
                                    dialog.Option("[SnowySteed +6] 1kk CPs.", 4);
                                    dialog.Option("[MountNightMareSteed +6] 1kk CPs.", 5);
                                    dialog.Option("[StarSteed +6] 1kk CPs.", 6);
                                    dialog.Option("[SpottedSteed +6] 1kk CPs.", 7);
                                    dialog.Option("Next Steed +12", 8);
                                    dialog.Avatar(116);
                                    dialog.Send();
                                    break;

                                }
                            case 8:
                                {
                                    dialog.Text("Hay i will Sell Rare Steed For CPs");
                                    dialog.Option("[ZebraSteed +12] 2kk CPs.", 9);
                                    dialog.Option("[BlazeHoofSteed +12] 2kk CPs.", 10);
                                    dialog.Option("[FrostBiteSteed +12] 2kk CPs.", 11);
                                    dialog.Option("[SnowySteed +12] 2kk CPs.", 12);
                                    dialog.Option("[MountNightMareSteed +12] 2kk CPs.", 13);
                                    dialog.Option("[StarSteed +12] 2kk CPs.", 14);
                                    dialog.Option("[SpottedSteed +12] 2kk CPs.", 15);
                                    dialog.Option("Back Steed +6", 0);
                                    dialog.Avatar(116);
                                    dialog.Send();
                                    break;

                                }
                            #region Steed +6
                            case 1:
                                {
                                    if (client.Entity.ConquerPoints >= 1000000)
                                    {
                                        client.Entity.ConquerPoints -= 1000000;
                                        PacketHandler.CheckCommand(new Message("@item Steed Fixed 6 0 0 0 0 142 39 46", System.Drawing.Color.Red, 2001), client);
                                    }
                                    else
                                    {
                                        dialog.Text("Please take 1kk cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 2:
                                {
                                    if (client.Entity.ConquerPoints >= 1000000)
                                    {
                                        client.Entity.ConquerPoints -= 1000000;
                                        PacketHandler.CheckCommand(new Message("@item Steed Fixed 6 0 0 0 0 148 156 137", System.Drawing.Color.Red, 2001), client);
                                    }
                                    else
                                    {
                                        dialog.Text("Please take 1kk cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 3:
                                {
                                    if (client.Entity.ConquerPoints >= 1000000)
                                    {
                                        client.Entity.ConquerPoints -= 1000000;
                                        PacketHandler.CheckCommand(new Message("@item Steed Fixed 6 0 0 0 0 62 63 184", System.Drawing.Color.Red, 2001), client);
                                    }
                                    else
                                    {
                                        dialog.Text("Please take 1kk cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 4:
                                {
                                    if (client.Entity.ConquerPoints >= 1000000)
                                    {
                                        client.Entity.ConquerPoints -= 1000000;
                                        PacketHandler.CheckCommand(new Message("@item Steed Fixed 6 0 0 0 0 150 100 100", System.Drawing.Color.Red, 2001), client);
                                    }
                                    else
                                    {
                                        dialog.Text("Please take 1kk cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 5:
                                {
                                    if (client.Entity.ConquerPoints >= 1000000)
                                    {
                                        client.Entity.ConquerPoints -= 1000000;
                                        PacketHandler.CheckCommand(new Message("@item Steed Fixed 6 0 0 0 0 150 150 50", System.Drawing.Color.Red, 2001), client);
                                    }
                                    else
                                    {
                                        dialog.Text("Please take 1kk cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 6:
                                {
                                    if (client.Entity.ConquerPoints >= 1000000)
                                    {
                                        client.Entity.ConquerPoints -= 1000000;
                                        PacketHandler.CheckCommand(new Message("@item Steed Fixed 6 0 0 0 0 0 200 0", System.Drawing.Color.Red, 2001), client);
                                    }
                                    else
                                    {
                                        dialog.Text("Please take 1kk cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 7:
                                {
                                    if (client.Entity.ConquerPoints >= 1000000)
                                    {
                                        client.Entity.ConquerPoints -= 1000000;
                                        PacketHandler.CheckCommand(new Message("@item Steed Fixed 6 0 0 0 0 147 134 122", System.Drawing.Color.Red, 2001), client);
                                    }
                                    else
                                    {
                                        dialog.Text("Please take 1kk cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            #endregion
                            #region Steed +12
                            case 9:
                                {
                                    if (client.Entity.ConquerPoints >= 2000000)
                                    {
                                        client.Entity.ConquerPoints -= 2000000;
                                        PacketHandler.CheckCommand(new Message("@item Steed Fixed 12 0 0 0 0 142 39 46", System.Drawing.Color.Red, 2001), client);
                                    }
                                    else
                                    {
                                        dialog.Text("Please take 2kk cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 10:
                                {
                                    if (client.Entity.ConquerPoints >= 2000000)
                                    {
                                        client.Entity.ConquerPoints -= 2000000;
                                        PacketHandler.CheckCommand(new Message("@item Steed Fixed 12 0 0 0 0 148 156 137", System.Drawing.Color.Red, 2001), client);
                                    }
                                    else
                                    {
                                        dialog.Text("Please take 2kk cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 11:
                                {
                                    if (client.Entity.ConquerPoints >= 2000000)
                                    {
                                        client.Entity.ConquerPoints -= 2000000;
                                        PacketHandler.CheckCommand(new Message("@item Steed Fixed 12 0 0 0 0 62 63 184", System.Drawing.Color.Red, 2001), client);
                                    }
                                    else
                                    {
                                        dialog.Text("Please take 2kk cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 12:
                                {
                                    if (client.Entity.ConquerPoints >= 2000000)
                                    {
                                        client.Entity.ConquerPoints -= 2000000;
                                        PacketHandler.CheckCommand(new Message("@item Steed Fixed 12 0 0 0 0 150 100 100", System.Drawing.Color.Red, 2001), client);
                                    }
                                    else
                                    {
                                        dialog.Text("Please take 2kk cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 13:
                                {
                                    if (client.Entity.ConquerPoints >= 2000000)
                                    {
                                        client.Entity.ConquerPoints -= 2000000;
                                        PacketHandler.CheckCommand(new Message("@item Steed Fixed 12 0 0 0 0 150 150 50", System.Drawing.Color.Red, 2001), client);
                                    }
                                    else
                                    {
                                        dialog.Text("Please take 2kk cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 14:
                                {
                                    if (client.Entity.ConquerPoints >= 2000000)
                                    {
                                        client.Entity.ConquerPoints -= 2000000;
                                        PacketHandler.CheckCommand(new Message("@item Steed Fixed 12 0 0 0 0 0 200 0", System.Drawing.Color.Red, 2001), client);
                                    }
                                    else
                                    {
                                        dialog.Text("Please take 2kk cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 15:
                                {
                                    if (client.Entity.ConquerPoints >= 2000000)
                                    {
                                        client.Entity.ConquerPoints -= 2000000;
                                        PacketHandler.CheckCommand(new Message("@item Steed Fixed 12 0 0 0 0 147 134 122", System.Drawing.Color.Red, 2001), client);
                                    }
                                    else
                                    {
                                        dialog.Text("Please take 2kk cps.");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(116);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            #endregion

                        }
                        break;
                    }
                #endregion
                #region TeamWarMaster
                case 1881:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    if (!Conquer_Online_Server.Game.Features.TeamWar.War.Running)
                                    {
                                        dialog.Text("Hello my champion, I am the team wars master, but i can't ");
                                        dialog.Text("do anything out of time. Even the greats needs a rest, I'll ");
                                        dialog.Text("tell everyone when it starts... don't worry!");
                                        dialog.Option("Ok thanks.", 255);
                                        goto Jump;
                                    }
                                    dialog.Text("Hello my champion, I am the team wars master, you shall inscribe ");
                                    dialog.Text("you and your team into the event, there are some strongers warriors, ");
                                    dialog.Text("don't get filled with yourself, or you will loose easyly.");
                                    dialog.Option("I'll inscribe myself and my team.", 1);
                                    dialog.Option("Let me think it over.", 255);
                                Jump:
                                    dialog.Avatar(105);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Team == null)
                                    {
                                        dialog.Text("You don't have a team, please get off!");
                                        dialog.Option("Ok sorry!", 255);
                                        goto Jump;
                                    }
                                    if (client.Team != null && !client.Team.TeamLeader)
                                    {
                                        dialog.Text("You're not a team master, please get off!");
                                        dialog.Option("Ok sorry!", 255);
                                        goto Jump;
                                    }
                                    if (client.Team.TeamLeader && client.Team != null)
                                    {
                                        dialog.MessageBox("Your team have been inscribed at the team war. Get Ready!", 255);
                                        dialog.Send();
                                        foreach (GameState cli in client.Team.Teammates)
                                        {
                                            cli.Send(new Message("Your team have been inscribed at the team war. Get Ready!", Color.Red, Message.TopLeft));
                                        }
                                        client.Entity.tID = Conquer_Online_Server.Game.Features.TeamWar.War.Add(client);
                                        return;
                                    }
                                Jump:
                                    dialog.Avatar(105);
                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region silent NPc
                #region  ArenaManagerWang
                case 18810:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Want to test your power and skill? Power Arena has now provided you such a chance. Come to Arena Manager Wang between 13:00 pm and 14:00pm or 20:30 pm and 21:30 pm to accept the challenge!");
                                    dialog.Option("I~will~be~there!", 255);
                                    dialog.Option("Exchange~for~refinery~packs.", 0);
                                    dialog.Option("Rules?", 1);
                                    dialog.Avatar(31);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    dialog.Text("The Power Arena has 7 stages. The guardians in higher stages of the Power Arena will be more powerful. If you are knocked down in a stage, you will be sent to a lower stage to restart your challenge. However, if you are knocked down in stage 7, you");
                                    dialog.Text("~will be knocked out of the Power Arena. You have to wait for 5 minutes to enter the Arena again. You will find an Agate in each stage of the Arena. If you flattened enough guardians in that stage, you can click the Agate to claim your reward, or to");
                                    dialog.Text("~proceed to an advanced stage. Of course, you can choose to withdraw to a lower stage or to quit the Arena.");
                                    dialog.Option("I~see!", 255);
                                    dialog.Avatar(31);
                                    break;
                                }

                        }
                        break;
                    }
                #endregion
                #region  HorseRaceManager
                case 6001:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hi! You can sign up the Horse Racing here! Once you participate in the racing, you`ll receive honorable points, which can be exchanged for different kinds of refinery packs.");
                                    dialog.Text("All players can join the Horse Race and win points to swap for Refinery Packs! There will be 10 Horse Races a day. Entrance Time ");
                                    dialog.Text("~If you have a steed and have learned mount skills, join in the Horse Racing now!");
                                    dialog.Option("Join Steed Race.", 10);
                                    dialog.Option("Learn~about~the~rules.", 1);
                                    dialog.Option("View~Horse~Racing~Store.", 2);
                                    dialog.Option("Just~passing~by.", 255);
                                    dialog.Avatar(166);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    dialog.Text("First, you should have a steed and have learned mount skills, then I can teleport you to the Horse Racing for 10 times daily! It is held at 3:30, 5:30, 7:30, 9:30, 11:30, 13:30, 15:30, 19:30, 21:30 and 23:30.");
                                    dialog.Text("I can take you to the Horse Racing track. There are 10 races a day.");
                                    dialog.Option("Got~it!", 255);
                                    dialog.Avatar(166);
                                    dialog.Avatar(31);
                                    break;
                                }
                            case 2:
                                {
                                    Network.GamePackets.Data Data = new Network.GamePackets.Data(true);
                                    Data.UID = client.Entity.UID;
                                    Data.ID = 126;
                                    Data.dwParam = 464;
                                    Data.wParam1 = client.Entity.X;
                                    Data.wParam2 = client.Entity.Y;
                                    client.Send(Data);
                                    break;
                                }
                            case 10:
                                {
                                    if (Kernel.SteedTornament.sr == true)
                                    {
                                        dialog.Text("Do you want to join in RaceSteed?");
                                        dialog.Option("I need join now", 22);
                                        dialog.Option("No Thanks", 255);
                                        dialog.Send();
                                        // Conquer_Online_Server.Network.PacketHandler.WorldMessage("This Player" + client.Entity.Name + " Join Come All SteedRace This First Server With Steed Race By koko  ");
                                        //client.Entity.Teleport(1950, 061, 156);
                                        break;
                                    }
                                    else
                                    {
                                        dialog.Text("Sorry but the RaceSteed dont is starting here");
                                        dialog.Option("oK.Sorry", 255);
                                        dialog.Send();
                                        break;

                                    }

                                }
                            case 22:
                                {
                                    Conquer_Online_Server.Interfaces.IConquerItem I = client.Equipment.TryGetItem(12);
                                    //Interfaces.IConquerItem I = PacketHandler.ItemPosition(I.ID)==5;
                                    if (I != null && I.ID != 0)
                                    {
                                        client.Entity.srjoin = 1;
                                        dialog.Text("You have now joined in Race Tornament");
                                        dialog.Option("Thanks", 255);
                                        // dialog.Option("No Thanks", 255);
                                        dialog.Send();
                                        // Conquer_Online_Server.Network.PacketHandler.WorldMessage("This Player" + client.Entity.Name + " Join Come All SteedRace This First Server With Steed Race By koko  ");
                                        //client.Entity.Teleport(1950, 061, 156);
                                        break;
                                    }
                                    else
                                    {
                                        dialog.Text("Sorry you dont have steed");
                                        dialog.Option("oK.Sorry", 255);
                                        dialog.Send();
                                        break;

                                    }
                                }

                        }
                        break;
                    }
                #endregion
                #region  RefineryStabilizer
                case 7538:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hey there! I can channel the power of Permanent Stones and stabilize the Refinery, which means making the temporary Refinery permanent. Permanent Stones have 10 Stabilization Points,");
                                    dialog.Text("~and Big Permanent Stones have 100. Different Refinery levels require different amounts of points. I can only perform the stabilization with enough of them. Are we clear? Good.");
                                    dialog.Text("~Do you want to stabilize the Refinery now?");
                                    dialog.Option("Yup.", 1);
                                    dialog.Option("Nope.", 255);
                                    dialog.Avatar(51);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    Data Data = new Data(true);
                                    Data.UID = client.Entity.UID;
                                    Data.ID = 126;
                                    Data.dwParam = 448;
                                    Data.wParam1 = client.Entity.X;
                                    Data.wParam2 = client.Entity.Y;
                                    client.Send(Data);
                                    break;

                                }

                        }
                        break;
                    }
                #endregion
                #region  RebirthMaster
                case 9072:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("I devote all my life to the research of eternity. And finally I know the secret of rebirth! Well, anything I can help you with?");
                                    dialog.Option("1st~Rebirth.", 1);
                                    dialog.Option("2nd~Rebirth.", 2);
                                    dialog.Option("Reincarnation.", 3);
                                    dialog.Option("Reallot~my~Attribute~Points.", 4);
                                    dialog.Option("Just~passing~by.", 255);
                                    dialog.Avatar(67);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1036, 299, 214);
                                    break;
                                }
                            case 2:
                                {
                                    client.Entity.Teleport(1020, 439, 312);
                                    break;
                                }
                            case 3:
                                {
                                    Data Data = new Data(true);
                                    Data.UID = client.Entity.UID;
                                    Data.ID = 126;
                                    Data.dwParam = 485;
                                    Data.wParam1 = client.Entity.X;
                                    Data.wParam2 = client.Entity.Y;
                                    client.Send(Data);
                                    break;
                                }
                            #region Realloter
                            case 4:
                                {

                                    dialog.Text("Hello there brave conqueror, if you have reborn, and you misplaced your atribute points or you want to set them another way, I'll reset your atribute points for one DragonBall. Do you accept?");
                                    dialog.Option("Here is the DragonBall.", 10);
                                    dialog.Option("I'll just leave", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 10:
                                {
                                    if (client.Entity.Reborn > 0)
                                    {
                                        if (client.Inventory.Contains(1088000, 1))
                                        {
                                            client.Inventory.Remove(1088000, 1);
                                            if (client.Entity.Reborn != 0)
                                            {
                                                client.Entity.Agility = 0;
                                                client.Entity.Strength = 0;
                                                client.Entity.Vitality = 1;
                                                client.Entity.Spirit = 0;
                                                if (client.Entity.Reborn == 1)
                                                {
                                                    client.Entity.Atributes = (ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornLevel, client.Entity.FirstRebornLevel)
                                                        + 52 + 3 * (client.Entity.Level - 15));
                                                }
                                                else
                                                {
                                                    client.Entity.Atributes = (ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornLevel, client.Entity.FirstRebornClass) +
                                                        client.ExtraAtributePoints(client.Entity.SecondRebornLevel, client.Entity.SecondRebornClass) + 52 + 3 * (client.Entity.Level - 15));
                                                }
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("You need a DragonBall.");
                                            dialog.Option("I'll just leave", 255);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("You have to have atleast one rebirth atleast.");
                                        dialog.Option("I'll just leave", 255);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;

                            #endregion

                    }
                #endregion

                #region  5 metor and dragon bel
                case 180810:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Want to test your power and skill? i can spawm Great TreatoDragon only if you gived me 5 meteor and 1 dragonBill");
                                    dialog.Option("yah sure i have it!", 1);
                                    dialog.Option("whats? no thanks", 255);
                                    dialog.Avatar(31);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Inventory.Contains(720598, 1) && client.Inventory.Contains(1088001, 5))
                                    {
                                        client.Inventory.Remove(720598, 1);
                                        client.Inventory.Remove(1088001, 5);

                                        Database.MonsterInformation monster = new Conquer_Online_Server.Database.MonsterInformation();
                                        monster.Boss = true;
                                        monster.Hitpoints = 50000000;
                                        monster.Level = 140;
                                        monster.Mesh = 950;
                                        monster.Name = "TeratoDragon";
                                        monster.MaxAttack = 10500;
                                        monster.AttackRange = 5;
                                        monster.AttackType = 2;
                                        monster.AttackSpeed = 1000;
                                        monster.ViewRange = 2;
                                        monster.MoveSpeed = 500;
                                        monster.RunSpeed = 500;
                                        monster.MinAttack = 59000;
                                        Game.Entity entity = new Game.Entity(Game.EntityFlag.Monster, false);
                                        entity.MapObjType = Game.MapObjectType.Monster;
                                        entity.MonsterInfo = monster;
                                        entity.MonsterInfo.Owner = entity;
                                        entity.Name = "TeratoDragon";
                                        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 = 5000;
                                        entity.X = client.Entity.X;
                                        entity.Y = client.Entity.Y;
                                        entity.UID = 500002;
                                        entity.MapID = client.Entity.MapID;
                                        entity.SendUpdates = true;
                                        //client.Map.RemoveEntity(entity);
                                        client.Map.AddEntity(entity);
                                        Network.GamePackets._String stringPacket = new Conquer_Online_Server.Network.GamePackets._String(true);
                                        stringPacket.UID = entity.UID;
                                        stringPacket.Type = Network.GamePackets._String.Effect;
                                        stringPacket.Texts.Add("MBStandard");
                                        entity.SetFlag(0, 0);
                                        var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                        varr.MoveNext();
                                        int COunt = ServerBase.Kernel.GamePool.Count;
                                        for (uint x = 0;
                                            x < COunt;
                                            x++)
                                        {
                                            if (x >= COunt) break;

                                            Client.GameState aclient = (varr.Current as Client.GameState);

                                            if (ServerBase.Kernel.GetDistance(client.Entity.X, client.Entity.Y, entity.X, entity.Y) < ServerBase.Constants.nScreenDistance)
                                            {
                                                entity.CauseOfDeathIsMagic = false;
                                                aclient.Entity.Teleport(aclient.Entity.X, aclient.Entity.Y);
                                                aclient.Send(stringPacket);
                                            }

                                            varr.MoveNext();

                                        }
                                        Conquer_Online_Server.ServerBase.Kernel.Terato_open = true;

                                        client.Send(new Network.GamePackets.NpcReply(6, "Gratz you Spamwed TreatoDragon hurry kill it."));
                                    }
                                    else
                                    {
                                        client.Send(new Network.GamePackets.NpcReply(6, "You must have 5 meteor and 1 dragonBill in your inventory."));
                                    }

                                    break;
                                }

                        }
                        break;
                    }
                #endregion
                #region  Cheak LVl for levling
                case 8885552:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Want to test your power and skill?, you did't find the best place to leveling ?,i will tell you best place to lvling fast");
                                    dialog.Option("yah sure i want know!", 1);
                                    dialog.Option("whats? no thanks", 255);
                                    dialog.Avatar(31);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    if (client.Entity.Level > 0 && client.Entity.Level < 7)
                                    {
                                        dialog.Popup("Gretz Your Lvl ("+client.Entity.Level +") you can lvling here until you get lvl (7) Wanna go?", 2);
                                    }
                                   else if (client.Entity.Level >= 7&& client.Entity.Level < 12)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (12) Wanna go?", 3);
                                    }
                                    else if (client.Entity.Level >= 12 && client.Entity.Level < 14)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (14) Wanna go?", 4);
                                    }
                                    else if (client.Entity.Level >= 14 && client.Entity.Level < 45)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (45) Wanna go?", 5);
                                    }
                                    else if (client.Entity.Level >= 45 && client.Entity.Level < 50)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (50) Wanna go?", 6);
                                    }
                                    else if (client.Entity.Level >= 50 && client.Entity.Level < 55)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (55) Wanna go?", 7);
                                    }
                                    else if (client.Entity.Level >= 55 && client.Entity.Level < 60)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (60) Wanna go?", 8);
                                    }
                                    else if (client.Entity.Level >= 60 && client.Entity.Level < 65)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (65) Wanna go?", 9);
                                    }
                                    else if (client.Entity.Level >= 65 && client.Entity.Level < 70)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (70) Wanna go?", 10);
                                    }
                                    else if (client.Entity.Level >= 70 && client.Entity.Level < 90)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (90) Wanna go?", 11);
                                    }
                                    else if (client.Entity.Level >= 90 && client.Entity.Level < 100)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (100) Wanna go?", 12);
                                    }
                                    else if (client.Entity.Level >= 100 && client.Entity.Level < 105)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (105) Wanna go?", 13);
                                    }
                                    else if (client.Entity.Level >= 105 && client.Entity.Level < 110)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (110) Wanna go?", 14);
                                    }
                                    else if (client.Entity.Level >= 110 && client.Entity.Level < 115)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (115) Wanna go?", 15);
                                    }
                                    else if (client.Entity.Level >= 115 && client.Entity.Level < 130)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (130) Wanna go?", 16);
                                    }
                                    else if (client.Entity.Level >= 130 && client.Entity.Level < 140)
                                    {
                                        dialog.Popup("Gretz Your Lvl (" + client.Entity.Level + ") you can lvling here until you get lvl (140) Wanna go?", 17);
                                    }
                                    break;
                                }
                            case 2:
                                {
                                    client.Entity.Teleport(1002, 470, 482);
                                    break;
                                }
                            case 3:
                                {
                                    client.Entity.Teleport(1002, 511, 731);
                                    break;
                                }
                            case 4:
                                {
                                    client.Entity.Teleport(1002, 252, 581);
                                    break;
                                }
                            case 5:
                                {
                                    client.Entity.Teleport(1075, 266, 128);
                                    break;
                                }
                            case 6:
                                {
                                    client.Entity.Teleport(1077, 708, 716);
                                    break;
                                }
                            case 7:
                                {
                                    client.Entity.Teleport(1077, 909, 631);
                                    break;
                                }
                            case 8:
                                {
                                    client.Entity.Teleport(1077, 774, 504);
                                    break;
                                }
                            case 9:
                                {
                                    client.Entity.Teleport(1077, 525, 448);
                                    break;
                                }
                            case 10:
                                {
                                    client.Entity.Teleport(1077, 316, 520);
                                    break;
                                }
                            case 11:
                                {
                                    client.Entity.Teleport(1015, 645, 701);
                                    break;
                                }
                            case 12:
                                {
                                    client.Entity.Teleport(1001, 275, 478);
                                    break;
                                }
                            case 13:
                                {
                                    client.Entity.Teleport(1001, 365, 452);
                                    break;
                                }
                            case 14:
                                {
                                    client.Entity.Teleport(1001, 448, 257);
                                    break;
                                }
                            case 15:
                                {
                                    client.Entity.Teleport(1001, 448, 257);
                                    break;
                                }
                            case 16:
                                {
                                    client.Entity.Teleport(1999, 413, 471);
                                    break;
                                }
                            case 17:
                                {
                                    client.Entity.Teleport(7007, 134, 283);
                                    break;
                                }

                        }
                        break;
                    }
                #endregion
                #endregion
                #region FrozenGrottoGeneralFull
                case 278374:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("There is a dangeous frozen cavern south of nowhere! It's too dangerous for you to enter! Even Leroy Jenkins died there!");
                                    dialog.Option("FrozenGrotto 1", 1);
                                    dialog.Option("FrozenGrotto 2", 2);
                                    dialog.Option("FrozenGrotto 3", 3);
                                    dialog.Option("FrozenGrotto 4", 4);
                                    dialog.Option("FrozenGrotto 5", 5);
                                    dialog.Option("FrozenGrotto 6", 6);
                                    dialog.Option("Blah, boring.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 6:
                                {
                                    client.Entity.Teleport(2056, 478, 755);
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1762, 61, 257);
                                    break;
                                }
                            case 2:
                                {
                                    client.Entity.Teleport(7007, 61, 257);
                                    break;
                                }
                            case 4:
                                {
                                    client.Entity.Teleport(2054, 392, 586);
                                    break;
                                }
                            case 3:
                                {
                                    client.Entity.Teleport(1999, 407, 486);
                                    break;
                                }
                            case 5:
                                {
                                    client.Entity.Teleport(2055, 544, 574);
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region TopguildLeader
                case 21652:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would Your like To Get Top GuildLeader?");
                                    dialog.Option("Yes.Thx", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    if (!client.AddSpell(LearnableSpell(0x400)))
                                        client.Entity.AddFlag(Update.Flags.TopGuildLeader);
                                    client.Entity.AddFlag(Update.Flags.TopGuildLeader);

                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region TopFire
                case 21653:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would Your like To Get Top TopFire?");
                                    dialog.Option("Yes.Thx", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    if (!client.AddSpell(LearnableSpell(0x100)))
                                        client.Entity.AddFlag(Update.Flags.TopFireTaoist);
                                    client.Entity.AddFlag(Update.Flags.TopFireTaoist);

                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region TopWater
                case 21654:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would Your like To Get Top TopWater?");
                                    dialog.Option("Yes.Thx", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    if (!client.AddSpell(LearnableSpell(0x800)))
                                        client.Entity.AddFlag(Update.Flags.TopWaterTaoist);
                                    client.Entity.AddFlag(Update.Flags.TopWaterTaoist);

                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region TopWarrior
                case 21655:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would Your like To Get Top TopWarrior?");
                                    dialog.Option("Yes.Plz", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    if (!client.AddSpell(LearnableSpell(0x600)))
                                        client.Entity.AddFlag(Update.Flags.TopWarrior);
                                    client.Entity.AddFlag(Update.Flags.TopWarrior);

                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region TopNinja
                case 21656:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would Your like To Get Top TopNinja?");
                                    dialog.Option("Yes.Thx", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    if (!client.AddSpell(LearnableSpell(0x4000)))
                                        client.Entity.AddFlag(Update.Flags.TopPirate);
                                    client.Entity.AddFlag(Update.Flags.TopPirate);

                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region TopTrojan
                case 21657:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would Your like To Get Top TopTrojan?");
                                    dialog.Option("Yes.Thx", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    if (!client.AddSpell(LearnableSpell(0x900)))
                                        client.Entity.AddFlag(Update.Flags.TopTrojan);
                                    client.Entity.AddFlag(Update.Flags.TopTrojan);

                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region TopArcher
                case 21658:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would Your like To Get Top TopArcher?");
                                    dialog.Option("Yes.Thx", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    if (!client.AddSpell(LearnableSpell(0x300)))
                                        client.Entity.AddFlag(Update.Flags.TopArcher);
                                    client.Entity.AddFlag(Update.Flags.TopArcher);

                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region TopDeputyLeader
                case 21659:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would Your like To Get Top TopDeputyLeader?");
                                    dialog.Option("Yes.Thx", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    if (!client.AddSpell(LearnableSpell(0x401)))
                                        client.Entity.AddFlag(Update.Flags.TopDeputyLeader);
                                    client.Entity.AddFlag(Update.Flags.TopDeputyLeader);

                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region MontlyTopPk
                case 21660:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would Your like To Get Top MontlyTopPk?");
                                    dialog.Option("Yes.Thx", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    if (!client.AddSpell(LearnableSpell(0x20)))
                                        client.Entity.AddFlag(Update.Flags.MonthlyPKChampion);
                                    client.Entity.AddFlag(Update.Flags.MonthlyPKChampion);

                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region WeeklyTopPkBlue
                case 21661:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would Your like To Get Top WeeklyTopPk?");
                                    dialog.Option("Yes.Thx", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {

                                    if (!client.AddSpell(LearnableSpell(0x4)))
                                        client.Entity.AddFlag(Update.Flags.WeeklyPKChampion);
                                    client.Entity.AddFlag(Update.Flags.WeeklyPKChampion);

                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Lune(Enter Moon Platform)
                case 5000:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Would you like to enter the Moon Platform ?");
                                    dialog.Option("Yes.", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    client.Entity.Teleport(1100, 184, 164);
                                    dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region  ClasspkAuto
                case 222220:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Popup("Everyone settle down! I need to announce that there are new rules for the Class PK War Want JOin?",1);
                                    break;
                                }
                            case 1:
                                {

                                    if (ServerBase.Kernel.PK == true)
                                    {
                                        dialog.Popup("Are you ready?", 2);
                                    }
                                    else
                                    {
                                        dialog.Popup("Class Pk war is Finished you can't Join", 255);
                                    }

                                    break;
                                }
                            case 2:
                                {
                                    client.InPKT = true;
                                    PKTournament.PKTHash.Add(client.Entity.UID, client);
                                    client.Entity.Teleport(1787, 50, 50);
                                    break;
                                }

                        }
                        break;
                    }
                #endregion
                #region  ElitepkAuto
                case 222222:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Popup("Elite PK Tournament, have you joined before? No? Aha, please allow me to introduce , Want JOin?", 1);
                                    break;
                                }
                            case 1:
                                {

                                    if (ServerBase.Kernel.Elite_PK_Tournament.Start == true)
                                    {
                                        dialog.Popup("Are you ready?", 2);
                                    }
                                    else
                                    {
                                        dialog.Popup("Elite Pk Tournament is Finished you can't Join", 255);
                                    }

                                    break;
                                }
                            case 2:
                                {
                                    Conquer_Online_Server.ServerBase.Kernel.Elite_PK_Tournament.AddMap(client);
                                    break;
                                }

                        }
                        break;
                    }
                #endregion
                #region  LastManpkAuto
                #region client of LastManpkAuto
                case 2222241:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hey there " + client.Entity.Name + "Would you like to claim your Prize?.");
                                    dialog.Option("Yes Please", 1);
                                    dialog.Option("I don't care.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    int alive = 0;
                                    foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                        if (players.Entity.MapID == 1858 && (!players.Entity.Dead))
                                            alive++;
                                    if (Program.LastManStanding == false)
                                    {
                                        if (alive == 1)
                                        {
                                            if (client.Entity.VIPLevel > 0)
                                            {
                                                client.Entity.ConquerPoints += 4000;
                                            }
                                            else
                                            {
                                                client.Entity.ConquerPoints += 2000;
                                            }

                                            Database.EntityTable.DeleteTabelTop2(client);

                                            #region Ninja
                                            if (client.Entity.Class >= 50 && client.Entity.Class <= 55)
                                            {
                                                if (client.Entity.VIPLevel > 0)
                                                {
                                                    client.Entity.TopNinja2 = 1;
                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 4k cps ConquerPoints for winning the LastManStanding and Halo2 cause He VIP.  " + client.Entity.VIPLevel + " ", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                }
                                                else
                                                {
                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 2k cps ConquerPoints for winning the LastManStanding and Halo2.", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    client.Entity.TopNinja2 = 1;
                                                }
                                            }
                                            #endregion
                                            #region Warrior
                                            if (client.Entity.Class >= 20 && client.Entity.Class <= 25)
                                            {
                                                if (client.Entity.VIPLevel > 0)
                                                {

                                                    client.Entity.TopWarrior2 = 1;
                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 4k cps ConquerPoints for winning the LastManStanding and Halo2 cause He VIP.  " + client.Entity.VIPLevel + " ", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                }
                                                else
                                                {
                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 2k cps ConquerPoints for winning the LastManStanding and Halo2.", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    client.Entity.TopWarrior2 = 1;
                                                }
                                            }
                                            #endregion
                                            #region Archer
                                            if (client.Entity.Class >= 40 && client.Entity.Class <= 45)
                                            {

                                                if (client.Entity.VIPLevel > 0)
                                                {

                                                    client.Entity.TopArcher2 = 1;
                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 4k cps ConquerPoints for winning the LastManStanding and Halo2 cause He VIP.  " + client.Entity.VIPLevel + " ", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                }
                                                else
                                                {
                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 2k cps ConquerPoints for winning the LastManStanding and Halo2.", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    client.Entity.TopArcher2 = 1;
                                                }
                                            }
                                            #endregion
                                            #region Trojan
                                            if (client.Entity.Class >= 10 && client.Entity.Class <= 15)
                                            {
                                                if (client.Entity.VIPLevel > 0)
                                                {

                                                    client.Entity.TopTrojan2 = 1;
                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 4k cps ConquerPoints for winning the LastManStanding and Halo2 cause He VIP.  " + client.Entity.VIPLevel + " ", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                }
                                                else
                                                {
                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 2k cps ConquerPoints for winning the LastManStanding and Halo2.", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    client.Entity.TopTrojan2 = 1;
                                                }
                                            }
                                            #endregion
                                            #region Water
                                            if (client.Entity.Class >= 130 && client.Entity.Class <= 135)
                                            {
                                                if (client.Entity.VIPLevel > 0)
                                                {

                                                    client.Entity.TopWaterTaoist2 = 1;

                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 4k cps ConquerPoints for winning the LastManStanding and Halo2 cause He VIP.  " + client.Entity.VIPLevel + " ", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                }
                                                else
                                                {
                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 2k cps ConquerPoints for winning the LastManStanding and Halo2.", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    client.Entity.TopWaterTaoist2 = 1;
                                                }
                                            }
                                            #endregion
                                            #region Fire
                                            if (client.Entity.Class >= 140 && client.Entity.Class <= 145)
                                            {
                                                if (client.Entity.VIPLevel > 0)
                                                {

                                                    client.Entity.TopFireTaoist2 = 1;
                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 4k cps ConquerPoints for winning the LastManStanding and Halo2 cause He VIP.  " + client.Entity.VIPLevel + " ", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                }
                                                else
                                                {
                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 2k cps ConquerPoints for winning the LastManStanding and Halo2.", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    client.Entity.TopFireTaoist2 = 1;
                                                }
                                            }
                                            #endregion
                                            #region Monk
                                            if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                                            {
                                                if (client.Entity.VIPLevel > 0)
                                                {

                                                    client.Entity.TopMonk2 = 1;
                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 4k cps ConquerPoints for winning the LastManStanding and Halo2 cause He VIP.  " + client.Entity.VIPLevel + " ", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                }
                                                else
                                                {
                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " claimed the prize 2k cps ConquerPoints for winning the LastManStanding and Halo2.", System.Drawing.Color.Black, Message.Talk), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                    client.Entity.TopMonk2 = 1;
                                                }
                                            }
                                            #endregion

                                            client.Entity.SendSpawn(client, true);
                                            client.Entity.Teleport(1002, 429, 378);
                                            Conquer_Online_Server.Database.EntityTable.SaveEntity(client);
                                        }
                                        else
                                        {
                                            dialog.Text("There are still " + alive + " players in the map kill it first to claim prize!");
                                            dialog.Option("okay", 255);
                                            dialog.Send();
                                            break;
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("Hey there " + client.Entity.Name + "You can only claim the prize when the time on or after XX:03");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                case 222223:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Popup("Everyone this is LastMAn Standing for all Classes PK War Want JOin?", 1);
                                    break;
                                }
                            case 1:
                                {

                                    if (Program.LastManStanding == false)
                                    {
                                        dialog.Popup("LastManStanding Pk war is Finished you can't Join", 255);

                                    }
                                    else
                                    {
                                        dialog.Popup("Are you ready?", 2);
                                    }

                                    break;
                                }
                            case 2:
                                {

                                    client.Entity.Teleport(1858, 70, 70);
                                    break;
                                }

                        }
                        break;
                    }
                #endregion
                #region  WeeklypkAuto
                #region client of WeeklypkAuto
                case 25555:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hey there " + client.Entity.Name + "Would you like to claim your Prize?.");
                                    dialog.Option("Yes Please", 1);
                                    dialog.Option("I don't care.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    int alive = 0;
                                    foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                        if (players.Entity.MapID == 2555 && (!players.Entity.Dead))
                                            alive++;
                                    if (Program.WeeklyPk == false)
                                    {
                                        if (alive == 1)
                                        {
                                            if (client.Entity.VIPLevel > 0)
                                            {
                                                client.Entity.ConquerPoints += 4000;
                                            }
                                            else
                                            {
                                                client.Entity.ConquerPoints += 2000;
                                            }
                                            client.Entity.SendSpawn(client, true);
                                            client.Entity.Teleport(1002, 429, 378);
                                            Conquer_Online_Server.Database.EntityTable.SaveEntity(client);
                                        }
                                        else
                                        {
                                            dialog.Text("There are still " + alive + " players in the map kill it first to claim prize!");
                                            dialog.Option("okay", 255);
                                            dialog.Send();
                                            break;
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("Hey there " + client.Entity.Name + "You can only claim the prize when the time on or after XX:03");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                case 222224:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Popup("Everyone this is WeeklyPk for all Classes PK War Want JOin?", 1);
                                    break;
                                }
                            case 1:
                                {

                                    if (Program.WeeklyPk == false)
                                    {
                                        dialog.Popup("WeeklyPk Pk war is Finished you can't Join", 255);

                                    }
                                    else
                                    {
                                        dialog.Popup("Are you ready?", 2);
                                    }

                                    break;
                                }
                            case 2:
                                {

                                    client.Entity.Teleport(2555, 50, 50);
                                    break;
                                }

                        }
                        break;
                    }
                #endregion
                #region Noblibity Rank
                // Edit By [email protected]
                case 19933010:
                    {
                        switch (npcRequest.OptionID)
                        {

                            case 0:
                                {
                                    if (Program.nobilityrankwar == true)
                                    {
                                        if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.King)
                                        {
                                            dialog.Text("Hi " + client.Entity.Name + " You Are Aking\nAre You Sure That You Want  To\nEnter Nobility Rank War.");
                                            dialog.Option("Yes Enter me Now", 1);
                                            dialog.Option("No Thanks .", 255);
                                            dialog.Avatar(34);
                                            dialog.Send();
                                            break;
                                        }
                                        else if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.Prince)
                                        {
                                            dialog.Text("Hi " + client.Entity.Name + " You Are Prince\nAre You Sure That You Want  To\nEnter Nobility Rank War.");
                                            dialog.Option("Yes Enter me Now", 2);
                                            dialog.Option("No Thanks .", 255);
                                            dialog.Avatar(34);
                                            dialog.Send();
                                            break;
                                        }
                                        else if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.Duke)
                                        {
                                            dialog.Text("Hi " + client.Entity.Name + " You Are Duke\nAre You Sure That You Want  To\nEnter Nobility Rank War.");
                                            dialog.Option("Yes Enter me Now", 3);
                                            dialog.Option("No Thanks .", 255);
                                            dialog.Avatar(34);
                                            dialog.Send();
                                            break;
                                        }
                                        else
                                        {
                                            dialog.Text("Sorry This Quest Available For (Kings - Princes - Dukes) Only. ");
                                            dialog.Option("OK..", 255);
                                            break;
                                        }
                                    }
                                    else
                                    {
                                        if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.King)
                                        {
                                            dialog.Text("Sorry This Isn't The Time For Nobility War.\nCome Back Sunday 15:00");
                                            dialog.Option("OK..", 255);
                                            break;
                                        }
                                        else if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.Prince)
                                        {
                                            dialog.Text("Sorry This Isn't The Time For Nobility War.\nCome Back Sunday 15:00");
                                            dialog.Option("OK..", 255);
                                            break;
                                        }
                                        else if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.Duke)
                                        {
                                            dialog.Text("Sorry This Isn't The Time For Nobility War.\nCome Back Sunday 15:00");
                                            dialog.Option("OK..", 255);
                                            break;
                                        }
                                        else
                                        {
                                            dialog.Text("Sorry This Quest Available For (Kings - Princes - Dukes) Only. ");
                                            dialog.Option("OK..", 255);
                                            break;
                                        }
                                    }
                                }
                            #region
                            case 1:
                                {
                                    ushort x = (ushort)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 6);

                                    if (x == 1)
                                    {
                                        client.Entity.Teleport(9991, 091, 014);
                                        break;
                                    }
                                    else if (x == 2)
                                    {
                                        client.Entity.Teleport(9991, 098, 038);
                                        break;
                                    }
                                    else if (x == 3)
                                    {
                                        client.Entity.Teleport(9991, 013, 088);
                                        break;
                                    }
                                    else if (x == 4)
                                    {
                                        client.Entity.Teleport(9991, 234, 150);
                                        break;
                                    }
                                    else if (x == 5)
                                    {
                                        client.Entity.Teleport(9991, 205, 200);
                                        break;
                                    }
                                    else if (x == 6)
                                    {
                                        client.Entity.Teleport(9991, 165, 235);
                                        break;
                                    }
                                    break;
                                }
                            case 2:
                                {
                                    ushort x = (ushort)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 6);

                                    if (x == 1)
                                    {
                                        client.Entity.Teleport(9992, 091, 014);
                                        break;
                                    }
                                    else if (x == 2)
                                    {
                                        client.Entity.Teleport(9992, 098, 038);
                                        break;
                                    }
                                    else if (x == 3)
                                    {
                                        client.Entity.Teleport(9992, 013, 088);
                                        break;
                                    }
                                    else if (x == 4)
                                    {
                                        client.Entity.Teleport(9992, 234, 150);
                                        break;
                                    }
                                    else if (x == 5)
                                    {
                                        client.Entity.Teleport(9992, 205, 200);
                                        break;
                                    }
                                    else if (x == 6)
                                    {
                                        client.Entity.Teleport(9992, 165, 235);
                                        break;
                                    }
                                    break;
                                }
                            case 3:
                                {
                                    ushort x = (ushort)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 6);

                                    if (x == 1)
                                    {
                                        client.Entity.Teleport(9993, 091, 014);
                                        break;
                                    }
                                    else if (x == 2)
                                    {
                                        client.Entity.Teleport(9993, 098, 038);
                                        break;
                                    }
                                    else if (x == 3)
                                    {
                                        client.Entity.Teleport(9993, 013, 088);
                                        break;
                                    }
                                    else if (x == 4)
                                    {
                                        client.Entity.Teleport(9993, 234, 150);
                                        break;
                                    }
                                    else if (x == 5)
                                    {
                                        client.Entity.Teleport(9993, 205, 200);
                                        break;
                                    }
                                    else if (x == 6)
                                    {
                                        client.Entity.Teleport(9993, 165, 235);
                                        break;
                                    }
                                    break;
                                }
                            #endregion

                        }
                        break;

                    }
                case 19933011:
                case 19933012:
                case 19933013:
                    {
                        switch (npcRequest.OptionID)
                        {

                            case 0:
                                {
                                    if (Program.nobilityrankwar == false)
                                    {
                                        int alive = 0;
                                        foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                            if (players.Entity.MapID == client.Entity.MapID && (!players.Entity.Dead))
                                                alive++;
                                        if (alive == 1)
                                        {
                                            if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.King && Program.Kingmonster == true)
                                            {
                                                dialog.Text("Congratulation You Are The " + client.Entity.NobilityRank + " Of The Server.\n");
                                                dialog.Text("You Can Take Your Prize Now.\n");
                                                dialog.Option("Give ME IT", 11);
                                                dialog.Send();
                                                break;
                                            }
                                            else if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.Prince && Program.Princesmonster == true)
                                            {
                                                dialog.Text("Congratulation You Are The " + client.Entity.NobilityRank + " Of The Server.\n");
                                                dialog.Text("You Can Take Your Prize Now.\n");
                                                dialog.Option("Give ME IT", 21);
                                                dialog.Send();
                                                break;
                                            }
                                            else if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.Duke && Program.Dukemonster == true)
                                            {
                                                dialog.Text("Congratulation You Are The " + client.Entity.NobilityRank + " Of The Server.\n");
                                                dialog.Text("You Can Take Your Prize Now.");
                                                dialog.Option("Give ME IT", 31);
                                                dialog.Send();
                                                break;
                                            }
                                            else
                                            {
                                                dialog.Text("Congratulation You Are The " + client.Entity.NobilityRank + " Of The Server.\n");
                                                dialog.Text("There  Are AGreat Monster Make troubles In The Game You Must Kill It  First.\n");
                                                dialog.Text("Are You Ready For THis Mission.\n");
                                                dialog.Option("No Give Me Some Time", 255);
                                                dialog.Option("Ok I Can Do It", 1);
                                                dialog.Send();
                                                break;
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("There are  still " + alive + " players in the map kill it first to claim prize!");
                                            dialog.Option("okay", 255);
                                            dialog.Send();
                                            break;
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("Hey " + client.Entity.Name + " You can only claim the prize when the time on or  after 15:10");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                }
                            case 1:
                                {

                                    int alive = 0;
                                    foreach (Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                                        if (players.Entity.MapID == client.Entity.MapID && (!players.Entity.Dead))
                                            alive++;
                                    if (Program.nobilityrankwar == false)
                                    {
                                        if (alive == 1)
                                        {
                                            if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.King)
                                            { Program.Kingmonster = false; }
                                            else if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.Prince)
                                            { Program.Princesmonster = false; }
                                            else if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.Duke)
                                            { Program.Dukemonster = false; }
                                            Database.MonsterInformation monster = new Conquer_Online_Server.Database.MonsterInformation();
                                            monster.Boss = true;
                                            monster.Hitpoints = 50000000;
                                            monster.Level = 140;
                                            monster.Mesh = 950;
                                            if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.King)
                                            {
                                                monster.Name = "KingMonster";
                                            }
                                            else if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.Prince)
                                            {
                                                monster.Name = "PrincesMonster";
                                            }
                                            else if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.Duke)
                                            {
                                                monster.Name = "DukeMonster";
                                            }
                                            monster.MaxAttack = 10500;
                                            monster.AttackRange = 5;
                                            monster.AttackType = 2;
                                            monster.ID = 9991;
                                            monster.AttackSpeed = 1000;
                                            monster.ViewRange = 2;
                                            monster.MoveSpeed = 500;
                                            monster.RunSpeed = 500;
                                            monster.MinAttack = 5000;
                                            Game.Entity entity = new Game.Entity(Game.EntityFlag.Monster, false);
                                            entity.MapObjType = Game.MapObjectType.Monster;
                                            entity.MonsterInfo = monster;
                                            entity.MonsterInfo.Owner = entity;
                                            if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.King || client.Entity.MapID == 9991)
                                            {
                                                entity.Name = "KingMonster";
                                            }
                                            else if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.Prince || client.Entity.MapID == 9992)
                                            {
                                                entity.Name = "PrincesMonster";
                                            }
                                            else if (client.Entity.NobilityRank == Conquer_Online_Server.Game.ConquerStructures.NobilityRank.Duke || client.Entity.MapID == 9993)
                                            {
                                                entity.Name = "DukeMonster";
                                            }
                                            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 = 5000;
                                            entity.X = client.Entity.X;
                                            entity.Y = client.Entity.Y;
                                            entity.UID = 500002;
                                            entity.MapID = client.Entity.MapID;
                                            entity.SendUpdates = true;
                                            //client.Map.RemoveEntity(entity);
                                            client.Map.AddEntity(entity);
                                            Network.GamePackets._String stringPacket = new Conquer_Online_Server.Network.GamePackets._String(true);
                                            stringPacket.UID = entity.UID;
                                            stringPacket.Type = Network.GamePackets._String.Effect;
                                            stringPacket.Texts.Add("MBStandard");
                                            entity.SetFlag(0, 0);
                                            var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                            varr.MoveNext();
                                            int COunt = ServerBase.Kernel.GamePool.Count;
                                            for (uint x = 0;
                                                x < COunt;
                                                x++)
                                            {
                                                if (x >= COunt) break;

                                                Client.GameState aclient = (varr.Current as Client.GameState);

                                                if (ServerBase.Kernel.GetDistance(client.Entity.X, client.Entity.Y, entity.X, entity.Y) < ServerBase.Constants.nScreenDistance)
                                                {
                                                    entity.CauseOfDeathIsMagic = false;
                                                    aclient.Entity.Teleport(aclient.Entity.X, aclient.Entity.Y);
                                                    aclient.Send(stringPacket);
                                                }

                                                varr.MoveNext();

                                            }

                                            client.Send(new Network.GamePackets.NpcReply(6, "Gratz you Spamwed " + monster.Name + "  hurry kill it."));

                                        }
                                        else
                                        {
                                            dialog.Text("There are still  " + alive + " players in the map kill it first to claim prize!");
                                            dialog.Option("okay", 255);
                                            dialog.Send();
                                            break;
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("Hey " + client.Entity.Name + "You can only claim the prize when the time on or  after 15:10");
                                        dialog.Option("okay", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    break;
                                }
                            case 11:
                                {
                                    //                  Add Your King Prize Here

                                    client.Entity.Teleport(1002, 429, 378);
                                    break;
                                }
                            case 21:
                                {
                                    //                  Add Your Princea Prize Here

                                    client.Entity.Teleport(1002, 429, 378);
                                    break;
                                }
                            case 31:
                                {
                                    //                  Add Your Duke Prize Here

                                    client.Entity.Teleport(1002, 429, 378);
                                    break;
                                }

                        }
                        break;
                    }
                #endregion
                #region Vendedor de Item de Pirata
                case 4504:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hola " + client.Entity.Name + " soy el vendedor de items de pirata , te puedo ayudar a empezar tu profesion como pirata por tan solo 10k cps, quieres comprar? ");
                                    dialog.Option("si vendemelo", 1);
                                    dialog.Option("No Gracias.", 255);
                                    dialog.Avatar(85);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.ConquerPoints >= 10000)
                                    {
                                        client.Inventory.Add(139008, 1, 1);
                                        client.Inventory.Add(144000, 1, 1);
                                        client.Inventory.Add(611000, 1, 1);
                                        client.Inventory.Add(612020, 1, 1);

                                        client.Entity.ConquerPoints -= 100;
                                    }
                                    else
                                    {
                                        dialog.Text("No tienes suficientes cp`s!");
                                        dialog.Option("Ya veo.", 255);
                                        dialog.Avatar(85);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Upgradar Tesoros
                case 14550:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    //int aut = npcRequest.OptionID * 10;
                                    dialog.Text("Hola estoy aca para subir tus tesoros a 130 cada uno te vale 500 mil cps.");
                                    dialog.Option("Upgradar Avanico.", 10);
                                    dialog.Option("Upgradar Torro.", 11);
                                    dialog.Option("No need thanks!", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 10:
                                {
                                    byte _pos = npcRequest.OptionID;
                                    var item = client.Equipment.TryGetItem(_pos);
                                    var itemdetail = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
                                    Conquer_Online_Server.Database.ConquerItemInformation infos = new Conquer_Online_Server.Database.ConquerItemInformation(item.ID, item.Plus);
                                    uint cost = 0;
                                    cost += 500000;

                                    if (client.Entity.ConquerPoints > cost)
                                    {
                                        client.Entity.ConquerPoints -= cost;
                                        client.UnloadItemStats(item, false);
                                        item.ID += 10;
                                        Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
                                        item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                        item.Send(client);
                                        _String str = new _String(true);
                                        str.UID = client.Entity.UID;
                                        str.TextsCount = 1;
                                        str.Type = _String.Effect;
                                        str.Texts.Add("perfect");
                                        client.Screen.SendScreen(str, true);
                                        client.LoadItemStats(item);
                                        client.Equipment.UpdateEntityPacket();
                                    }
                                    break;
                                }
                            case 11:
                                {
                                    byte _pos = npcRequest.OptionID;
                                    var item = client.Equipment.TryGetItem(_pos);
                                    var itemdetail = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
                                    Conquer_Online_Server.Database.ConquerItemInformation infos = new Conquer_Online_Server.Database.ConquerItemInformation(item.ID, item.Plus);
                                    uint cost = 0;
                                    cost += 500000;

                                    if (client.Entity.ConquerPoints > cost)
                                    {
                                        client.Entity.ConquerPoints -= cost;
                                        client.UnloadItemStats(item, false);
                                        item.ID += 10;
                                        Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
                                        item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                        item.Send(client);
                                        _String str = new _String(true);
                                        str.UID = client.Entity.UID;
                                        str.TextsCount = 1;
                                        str.Type = _String.Effect;
                                        str.Texts.Add("perfect");
                                        client.Screen.SendScreen(str, true);
                                        client.LoadItemStats(item);
                                        client.Equipment.UpdateEntityPacket();
                                    }
                                    break;
                                }
                            case 100:
                                {
                                    if (client.SelectedItem == 0)
                                        return;
                                    var item = client.Equipment.TryGetItem(client.SelectedItem);
                                    var itemdetail = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
                                    Conquer_Online_Server.Database.ConquerItemInformation infos = new Conquer_Online_Server.Database.ConquerItemInformation(item.ID, item.Plus);
                                    switch (client.UpdateType)
                                    {
                                        case 1:
                                        case 2:
                                            {
                                                byte cost = (byte)(itemdetail.Level / 6);
                                                cost += (byte)((item.ID % 10) / 3);
                                                uint id = 1088001;
                                                if (client.UpdateType == 2)
                                                    id++;
                                                if (client.Inventory.Contains(id, cost))
                                                {
                                                    client.Inventory.Remove(id, cost);
                                                    client.UnloadItemStats(item, false);
                                                    if (client.UpdateType == 1)
                                                        item.ID = infos.CalculateUplevel();
                                                    else
                                                        item.ID = infos.CalculateDownlevel();
                                                    if (infos.BaseInformation.ID == item.ID)
                                                        return;
                                                    Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
                                                    item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                    item.Send(client);
                                                    _String str = new _String(true);
                                                    str.UID = client.Entity.UID;
                                                    str.TextsCount = 1;
                                                    str.Type = _String.Effect;
                                                    str.Texts.Add("perfect");
                                                    client.Screen.SendScreen(str, true);
                                                    client.LoadItemStats(item);
                                                    client.Equipment.UpdateEntityPacket();
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                byte cost = (byte)(itemdetail.Level / 30);
                                                cost += (byte)((item.ID % 10) / 2);
                                                uint id = 1088000;

                                                if (client.Inventory.Contains(id, cost))
                                                {
                                                    client.Inventory.Remove(id, cost);
                                                    client.UnloadItemStats(item, false);
                                                    item.ID++;
                                                    Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
                                                    item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                    item.Send(client);
                                                    _String str = new _String(true);
                                                    str.UID = client.Entity.UID;
                                                    str.TextsCount = 1;
                                                    str.Type = _String.Effect;
                                                    str.Texts.Add("perfect");
                                                    client.Screen.SendScreen(str, true);
                                                    client.LoadItemStats(item);
                                                    client.Equipment.UpdateEntityPacket();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            default:
                                {
                                    if (npcRequest.OptionID == 255)
                                        break;
                                    byte SelectedItem = (byte)(npcRequest.OptionID % 10);
                                    byte NowType = (byte)(npcRequest.OptionID / 10);
                                    if (client.Equipment.Free(SelectedItem))
                                    {
                                        dialog.Text("You have to be wearing the selected item.");
                                        dialog.Option("I'll just leave", 255);
                                        dialog.Send();
                                        return;
                                    }
                                    var item = client.Equipment.TryGetItem(SelectedItem);
                                    var itemdetail = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];

                                    if (itemdetail.Level == Conquer_Online_Server.Network.PacketHandler.ItemMaxLevel(client.SelectedItem) && client.UpdateType == 1)
                                    {
                                        dialog.Text("This item's level cannot be upgraded anymore.");
                                        dialog.Option("Ahh sorry.", 255);
                                        dialog.Send();
                                        client.SelectedItem = 0;
                                        client.UpdateType = 0;
                                        return;
                                    }
                                    if (NowType == 1)
                                    {
                                        dialog.Text("It will cost you one dragonball. Do you accept?");
                                        dialog.Option("Yes.", (byte)(20 + SelectedItem));
                                        dialog.Option("No thank you.", 255);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        Conquer_Online_Server.Database.ConquerItemInformation infos = new Conquer_Online_Server.Database.ConquerItemInformation(item.ID, item.Plus);
                                        Conquer_Online_Server.Database.ConquerItemInformation infos2 = new Conquer_Online_Server.Database.ConquerItemInformation(infos.CalculateUplevel(), item.Plus);
                                        if (client.Entity.Level < infos2.BaseInformation.Level)
                                        {
                                            dialog.Text("You need level " + infos2.BaseInformation.Level + " first.");
                                            dialog.Option("Ahh sorry.", 255);
                                            dialog.Send();
                                            client.SelectedItem = 0;
                                            client.UpdateType = 0;
                                            return;
                                        }
                                        if (client.Inventory.Contains(1088000, 1))
                                        {
                                            client.Inventory.Remove(1088000, 1);
                                            client.UnloadItemStats(item, false);
                                            item.ID = infos.CalculateUplevel();
                                            Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
                                            item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                            item.Send(client);
                                            _String str = new _String(true);
                                            str.UID = client.Entity.UID;
                                            str.TextsCount = 1;
                                            str.Type = _String.Effect;
                                            str.Texts.Add("perfect");
                                            client.Screen.SendScreen(str, true);
                                            client.LoadItemStats(item);
                                            client.Equipment.UpdateEntityPacket();
                                        }
                                    }
                                }
                                break;
                        }
                        break;
                    }
                #endregion
                #region Mas No° Items Raros
                case 2000:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hola yo te puedo ayudar a poner de +1 a +12 por cps a Frack de Armas.");
                                    dialog.Text("te costara 50000 cps cada vez que quieras upgradarlo");
                                    dialog.Link("Si deseo tranformarlo.", 100);
                                    dialog.Link("No gracias.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 100:
                                {
                                    dialog.Text("Que items quiere que se te suba el Plus?.");
                                    dialog.Link("Frack De Arma Principal", 15);
                                    dialog.Link("Frack De Arma Secundaria.", 16);
                                    dialog.Link("Latigo.", 18);
                                     dialog.Link("Frack.", 9);
                                     dialog.Link("Botella.", 7);
                                    dialog.Link("Pasaba por aki.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 7:
                            case 9:
                            case 15:
                            case 16:
                            case 18:
                                {
                                    IConquerItem Item = client.Equipment.TryGetItem(npcRequest.OptionID);
                                    if (Item != null)
                                    {
                                        if (Item.ID > 0)
                                        {
                                            uint nUmber = 0;
                                            switch (Item.Plus)
                                            {
                                                case 0: nUmber = 50000; break;
                                                case 1: nUmber = 100000; break;
                                                case 2: nUmber = 150000; break;
                                                case 3: nUmber = 200000; break;
                                                case 4: nUmber = 250000; break;
                                                case 5: nUmber = 300000; break;
                                                case 6: nUmber = 350000; break;
                                                case 7: nUmber = 400000; break;
                                                case 8: nUmber = 450000; break;
                                                case 9: nUmber = 500000; break;
                                                case 10: nUmber = 550000; break;
                                                case 11: nUmber = 600000; break;
                                                default: nUmber = 0; break;
                                            }

                                            if (nUmber == 0)
                                            {
                                                dialog.Text("Yo no puedo upgradar esto mas.");
                                                dialog.Link("Eso veo, Gracias.", 255);
                                                dialog.Avatar(104);
                                                dialog.Send();
                                                return;
                                            }

                                            if (!client.Agreed)
                                            {
                                                dialog.Text("Su item Necesita cps para obtener mejor, ");
                                                dialog.Text("tu necesitas tener " + nUmber + " CPs. Lo tienens?");
                                                dialog.Link("Wow claro!", npcRequest.OptionID);
                                                dialog.Link("dejame pensar.", 255);
                                                dialog.Avatar(104);
                                                dialog.Send();
                                                client.Agreed = true;
                                                return;
                                            }

                                            if (client.Entity.ConquerPoints >= nUmber)
                                            {
                                                client.Entity.ConquerPoints -= nUmber;
                                                Item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                if (Item.Plus < 12)
                                                    Item.Plus += 1;
                                                if (Item.Plus == 12)
                                                    Item.Send(client);
                                                Item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Default;
                                                ConquerItemTable.UpdateItem(Item, client);
                                                client.Agreed = false;
                                            }
                                            else
                                            {
                                                dialog.Text("You don't have " + nUmber + " CPs!");
                                                dialog.Link("I'll be right back!", 255);
                                                dialog.Avatar(104);
                                                dialog.Send();
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("Please wear your gear first!");
                                            dialog.Link("I'll be right back!", 255);
                                            dialog.Avatar(104);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("Please wear your gear first!");
                                        dialog.Link("I'll be right back!", 255);
                                        dialog.Avatar(104);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region EmbededSocket
                case 12550:
                    {
                        switch (npcRequest.OptionID)
                        {

                            case 0:
                                {
                                    dialog.Text("Hola deseas meterle gemas a los socalos de tus items?.");
                                    dialog.Link("Si deseo meterle.", 254);
                                    dialog.Link("No gracias.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 254:
                                {
                                    dialog.Text("Que gema desearias meterle.");
                                    dialog.Link("Gema Dragon Super", 101);
                                    dialog.Link("Gema De Fenix Super.", 201);
                                    dialog.Link("Solo pasaba por aqui.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 101:
                                {
                                    if (client.Inventory.Contains(700013, 1))
                                    {
                                        dialog.Text("Que socalo quieres meterle.");
                                        dialog.Link("Primer Socalo", 120);
                                        dialog.Link("Segundo Socalo.", 121);
                                        dialog.Avatar(60);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("Tu no tienes la gema de dragon no te puedo ayudar.");
                                        dialog.Link("Ash Gracias.", 255);
                                        dialog.Avatar(60);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 201:
                                {
                                    if (client.Inventory.Contains(700003, 1))
                                    {
                                        dialog.Text("Que socalo quieres meterle.");
                                        dialog.Link("Primer Socalo", 220);
                                        dialog.Link("Segundo Socalo.", 221);
                                        dialog.Avatar(60);
                                        dialog.Send();
                                    }
                                    else
                                    {
                                        dialog.Text("Tu no tienes la gema de dragon no te puedo ayudar.");
                                        dialog.Link("Ash Gracias.", 255);
                                        dialog.Avatar(60);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 120:
                                {
                                    dialog.Text("Ok Meteras la Gema en el Primer Socalo.");
                                    dialog.Link("Deseas Continuar?", 100);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 121:
                                {
                                    dialog.Text("Ok Meteras la Gema en el Segundo Socalo.");
                                    dialog.Link("Deseas Continuar?", 110);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 220:
                                {
                                    dialog.Text("Ok Meteras la Gema en el Primer Socalo.");
                                    dialog.Link("Deseas Continuar?", 200);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 221:
                                {
                                    dialog.Text("Ok Meteras la Gema en el Segundo Socalo.");
                                    dialog.Link("Deseas Continuar?", 210);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 100:
                                {
                                    dialog.Text("A que desearias meterle la gema.");
                                    dialog.Link("Frack de Arma Primaria", 15);
                                    dialog.Link("Frack de Arma Secundaria.", 16);
                                    dialog.Link("Latigo.", 18);
                                    dialog.Link("Bottella.", 7);
                                    dialog.Link("Frack.", 9);
                                    dialog.Link("Solo pasaba por aqui.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 7:
                            case 9:
                            case 10:
                            case 11:
                            case 15:
                            case 16:
                            case 18:
                                {
                                    IConquerItem Item = client.Equipment.TryGetItem(npcRequest.OptionID);
                                    if (Item != null)
                                    {
                                        if (Item.ID > 0)
                                        {
                                            if (Item.SocketOne == Conquer_Online_Server.Game.Enums.Gem.EmptySocket)
                                            {
                                                Item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.SuperDragonGem;
                                                Item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                Item.Send(client);
                                                Database.ConquerItemTable.UpdateSockets(Item, client);
                                                client.Inventory.Remove(700013, 1);
                                            }
                                            else
                                            {
                                                dialog.Text("Tu no tienes un ssocalo en tu item!");
                                                dialog.Link("I'll be right back!", 255);
                                                dialog.Avatar(104);
                                                dialog.Send();

                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("Please wear your gear first!");
                                            dialog.Link("I'll be right back!", 255);
                                            dialog.Avatar(104);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("Please wear your gear first!");
                                        dialog.Link("I'll be right back!", 255);
                                        dialog.Avatar(104);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 110:
                                {
                                    dialog.Text("A que desearias meterle la gema.");
                                    dialog.Link("Frack de Arma Primaria", 55);
                                    dialog.Link("Frack de Arma Secundaria.", 56);
                                    dialog.Link("Latigo.", 58);
                                    dialog.Link("Bottella.", 47);
                                    dialog.Link("Frack.", 49);
                                    dialog.Link("Solo pasaba por aqui.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 47:
                            case 49:
                            case 55:
                            case 56:
                            case 58:
                                {
                                    byte _pos = (byte)(npcRequest.OptionID - 40);
                                    IConquerItem Item = client.Equipment.TryGetItem(_pos);
                                    if (Item != null)
                                    {
                                        if (Item.ID > 0)
                                        {
                                            if (Item.SocketTwo == Conquer_Online_Server.Game.Enums.Gem.EmptySocket)
                                            {
                                                Item.SocketTwo = Conquer_Online_Server.Game.Enums.Gem.SuperDragonGem;
                                                Item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                Item.Send(client);
                                                Database.ConquerItemTable.UpdateSockets(Item, client);
                                                client.Inventory.Remove(700013, 1);
                                            }
                                            else
                                            {
                                                dialog.Text("tu no tienes un segundo socalo en tu item!");
                                                dialog.Link("I'll be right back!", 255);
                                                dialog.Avatar(104);
                                                dialog.Send();
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("Please wear your gear first!");
                                            dialog.Link("I'll be right back!", 255);
                                            dialog.Avatar(104);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("Please wear your gear first!");
                                        dialog.Link("I'll be right back!", 255);
                                        dialog.Avatar(104);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 200:
                                {
                                    dialog.Text("A que desearias meterle la gema.");
                                    dialog.Link("Frack de Arma Primaria", 25);
                                    dialog.Link("Frack de Arma Secundaria.", 26);
                                    dialog.Link("Latigo.", 28);
                                    dialog.Link("Bottella.", 17);
                                    dialog.Link("Frack.", 19);
                                    dialog.Link("Solo pasaba por aqui.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 17:
                            case 19:
                            case 20:
                            case 21:
                            case 25:
                            case 26:
                            case 27:
                            case 28:
                                {
                                    byte _pos = (byte)(npcRequest.OptionID - 10);
                                    IConquerItem Item = client.Equipment.TryGetItem(_pos);
                                    if (Item != null)
                                    {
                                        if (Item.ID > 0)
                                        {
                                            if (Item.SocketOne == Conquer_Online_Server.Game.Enums.Gem.EmptySocket)
                                            {
                                                Item.SocketOne = Conquer_Online_Server.Game.Enums.Gem.SuperPhoenixGem;
                                                Item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                Item.Send(client);
                                                Database.ConquerItemTable.UpdateSockets(Item, client);
                                                client.Inventory.Remove(700003, 1);
                                            }
                                            else
                                            {
                                                dialog.Text("Tu no tienes un ssocalo en tu item!");
                                                dialog.Link("I'll be right back!", 255);
                                                dialog.Avatar(104);
                                                dialog.Send();

                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("Please wear your gear first!");
                                            dialog.Link("I'll be right back!", 255);
                                            dialog.Avatar(104);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("Please wear your gear first!");
                                        dialog.Link("I'll be right back!", 255);
                                        dialog.Avatar(104);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 210:
                                {
                                    dialog.Text("A que desearias meterle la gema.");
                                    dialog.Link("Frack de Arma Primaria", 95);
                                    dialog.Link("Frack de Arma Secundaria.", 96);
                                    dialog.Link("Latigo.", 98);
                                    dialog.Link("Bottella.", 87);
                                    dialog.Link("Frack.", 89);
                                    dialog.Link("Solo pasaba por aqui.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 87:
                            case 89:
                            case 95:
                            case 96:
                            case 97:
                            case 98:
                                {
                                    byte _pos = (byte)(npcRequest.OptionID - 80);
                                    IConquerItem Item = client.Equipment.TryGetItem(_pos);
                                    if (Item != null)
                                    {
                                        if (Item.ID > 0)
                                        {
                                            if (Item.SocketTwo == Conquer_Online_Server.Game.Enums.Gem.EmptySocket)
                                            {
                                                Item.SocketTwo = Conquer_Online_Server.Game.Enums.Gem.SuperPhoenixGem;
                                                Item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                Item.Send(client);
                                                Database.ConquerItemTable.UpdateSockets(Item, client);
                                                client.Inventory.Remove(700003, 1);
                                            }
                                            else
                                            {
                                                dialog.Text("tu no tienes un segundo socalo en tu item!");
                                                dialog.Link("I'll be right back!", 255);
                                                dialog.Avatar(104);
                                                dialog.Send();
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("Please wear your gear first!");
                                            dialog.Link("I'll be right back!", 255);
                                            dialog.Avatar(104);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("Please wear your gear first!");
                                        dialog.Link("I'll be right back!", 255);
                                        dialog.Avatar(104);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region BlacksmithLee Cps
                case 10550:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hola Tu puedes abrir ahora los socalos a Frack de Armas y Latigo.");
                                    dialog.Text("Para Primer Socalo te vale 15kk CPs,");
                                    dialog.Text("Para el segundo te cuesta 10kk pero puede fallar.");
                                    dialog.Link("Yo deseo abrir el Primer Sock.", 100);
                                    dialog.Link("Yo deseo abrir el segundo sock.", 200);
                                    dialog.Link("No gracias.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 100:
                                {
                                    dialog.Text("A que desearias abrir el 1º socalo.");
                                    dialog.Link("Frack De Arma Principal", 25);
                                    dialog.Link("Frack De Arma Secundaria.", 26);
                                    dialog.Link("Latigo.", 28);
                                    dialog.Link("Frack.", 19);
                                    // dialog.Link("Torro.", 21);
                                    // dialog.Link("Abanico.", 20);
                                    dialog.Link("Botella.", 17);
                                    dialog.Link("Pasaba por aki.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 200:
                                {
                                    dialog.Text("A que desearias abrir el segundo socalo.");
                                    dialog.Link("Frack De Arma Principal.", 35);
                                    dialog.Link("Frack De Arma Secundaria.", 36);
                                    dialog.Link("Latigo.", 38);
                                    // dialog.Link("Torro.", 31);
                                    //dialog.Link("Abanico.", 30);
                                    dialog.Link("Frack.", 29);
                                    dialog.Link("Botella.", 27);
                                    dialog.Link("Pasaba por aki.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 17:
                            case 19:
                            case 20:
                            case 21:
                            case 25:
                            case 26:
                            case 28:
                                {
                                    byte _pos = (byte)(npcRequest.OptionID - 10);
                                    IConquerItem item = client.Equipment.TryGetItem(_pos);
                                    if (item != null)
                                    {
                                        if (item.ID > 0 && item.UID > 0)
                                        {
                                            if ((int)item.SocketOne > 0)
                                            {
                                                dialog.Text("Yout item already has a socket!");
                                                dialog.Link("I see.", 255);
                                                dialog.Avatar(60);
                                                dialog.Send();
                                                return;
                                            }
                                            if (!client.Agreed)
                                            {
                                                client.Agreed = true;
                                                dialog.Text("Debes tener Puesto el Item y Tener las cps los tienes?");
                                                dialog.Link("Let's continue!", npcRequest.OptionID);
                                                dialog.Link("Just passing by.", 255);
                                                dialog.Avatar(60);
                                                dialog.Send();
                                                //return;
                                            }
                                            else
                                            {
                                                client.Agreed = false;
                                                if (client.Entity.ConquerPoints >= 1500000)
                                                {
                                                    client.Entity.ConquerPoints -= 1500000;
                                                    item.SocketOne = (Conquer_Online_Server.Game.Enums.Gem)255;
                                                    ConquerItemTable.UpdateItem(item, client);
                                                    item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                    item.Send(client);
                                                    _String str = new _String(true);
                                                    str.UID = client.Entity.UID;
                                                    str.TextsCount = 1;
                                                    str.Type = _String.Effect;
                                                    str.Texts.Add("perfect");
                                                    client.Screen.SendScreen(str, true);
                                                    item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Default;
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't have 1500000 ConquerPoints!!");
                                                    dialog.Link("I see.", 255);
                                                    dialog.Avatar(60);
                                                    dialog.Send();
                                                }
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("I can't do anything to that gear!");
                                            dialog.Link("I see.", 255);
                                            dialog.Avatar(60);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("I can't do anything to that gear!");
                                        dialog.Link("I see.", 255);
                                        dialog.Avatar(60);
                                        dialog.Send();
                                    }

                                    break;
                                }
                            case 27:
                            case 29:
                            case 30:
                            case 31:
                            case 35:
                            case 36:
                            case 38:
                                {
                                    byte _pos = (byte)(npcRequest.OptionID - 20);
                                    IConquerItem item = client.Equipment.TryGetItem(_pos);
                                    if (item != null)
                                    {
                                        if (item.ID > 0 && item.UID > 0)
                                        {
                                            if (!((int)item.SocketOne > 0))
                                            {
                                                dialog.Text("Yout item don't have the first socket!");
                                                dialog.Link("I see.", 255);
                                                dialog.Avatar(60);
                                                dialog.Send();
                                                return;
                                            }

                                            if (_pos == 5)
                                            {
                                                if (!(item.ID >= 900000 && item.ID <= 900999))
                                                {
                                                    dialog.Text("You need to be wearing a shield.");
                                                    dialog.Link("I see.", 255);
                                                    dialog.Avatar(60);
                                                    dialog.Send();
                                                    return;
                                                }
                                            }

                                            if (!client.Agreed)
                                            {
                                                client.Agreed = true;
                                                dialog.Text("Debes estar usando el item y tener las cps los tienes?");
                                                dialog.Link("Let's continue!", npcRequest.OptionID);
                                                dialog.Link("Just passing by.", 255);
                                                dialog.Avatar(60);
                                                dialog.Send();
                                                //return;
                                            }
                                            else
                                            {
                                                client.Agreed = false;
                                                if (client.Entity.ConquerPoints >= 10000000)
                                                {
                                                    if (Game.Entity.ChanceSuccess(30))
                                                    {
                                                        client.Entity.ConquerPoints -= 10000000;
                                                        item.SocketTwo = (Conquer_Online_Server.Game.Enums.Gem)255;
                                                        ConquerItemTable.UpdateItem(item, client);
                                                        item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                        item.Send(client);
                                                        _String str = new _String(true);
                                                        str.UID = client.Entity.UID;
                                                        str.TextsCount = 1;
                                                        str.Type = _String.Effect;
                                                        str.Texts.Add("perfect");
                                                        client.Screen.SendScreen(str, true);
                                                        item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Default;
                                                        PacketHandler.WorldMessage("Congratulations! " + client.Entity.Name + " has openned the second socket using a 10kk y 15kk De cps  " + Database.ConquerItemInformation.BaseInformations[item.ID].Name + "!");
                                                    }
                                                    else
                                                    {
                                                        client.Entity.ConquerPoints -= 10000000;
                                                        dialog.Text("Sorry... The item failed, try again next time bro!");
                                                        dialog.Link("I see.", 255);
                                                        dialog.Avatar(60);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't have a 10000000 ConquerPoints!");
                                                    dialog.Link("I see.", 255);
                                                    dialog.Avatar(60);
                                                    dialog.Send();
                                                }
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("I can't do anything to that gear!");
                                            dialog.Link("I see.", 255);
                                            dialog.Avatar(60);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("I can't do anything to that gear!");
                                        dialog.Link("I see.", 255);
                                        dialog.Avatar(60);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region BlacksmithLee
                case 450399999:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Yo soy el amo de las tomas, que puede abrir la primera y la segunda");
                                    dialog.Text("sockets en cualquier punto de su deseo, a excepción de los talismanes, que");
                                    dialog.Text("son especiales.");
                                    dialog.Link("Quiero probar las bolas de dragón", 100);
                                    dialog.Link("Quiero probar algunas ToughDrills.", 2);
                                    dialog.Link("quiero usar 7 StarDrills.", 3);
                                    dialog.Link("Quiero a la toma de mi arma.", 4);
                                    dialog.Link("Déjame pensarlo.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    client.Send(new Data(true) { UID = client.Entity.UID, ID = 126, dwParam = 425, wParam1 = client.Entity.X, wParam2 = client.Entity.Y });
                                    break;
                                }
                            case 100:
                                {
                                    dialog.Text("Voy a carga de 12 bolas de dragón para abrir la toma por primera vez en una");
                                    dialog.Text("elemento, si está de acuerdo, seleccione el elemento que desea abrir");
                                    dialog.Text("el primer socket.");
                                    dialog.Link("Sombrero", 11);
                                    dialog.Link("Collar / bolsa", 12);
                                    dialog.Link("Armadura", 13);
                                    // dialog.Link ("Arma"., 14);
                                    dialog.Link("Escudo", 15);
                                    dialog.Link("Anillo / AnilloDestreza / pulsera.", 16);
                                    dialog.Link("Botas", 18);
                                    dialog.Link("Just passing by.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 2:
                                {
                                    dialog.Text("Voy a cobrar una ToughDrill para tratar de abrir la segunda toma en un artículo,");
                                    dialog.Text("pero recuerde que puede fallar si eres un tipo con suerte, usted puede obtener el archivo.");
                                    dialog.Text("segunda toma abierta, otras más, va a fracasar.");
                                    dialog.Link("Casco", 21);
                                    dialog.Link("Collar / Bolsa", 22);
                                    dialog.Link("Armadura", 23);
                                    //dialog.Link("Weapon.", 24);
                                    dialog.Link("Escudo.", 25);
                                    dialog.Link("Anillo/AnilloDestreza/Pulsera.", 26);
                                    dialog.Link("Botas.", 28);
                                    dialog.Link("Just passing by.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 3:
                                {
                                    dialog.Text("Voy a cobrar 7 StarDrills para abrir la segunda toma en un artículo,");
                                    dialog.Text("que no fallan, pero es un precio expencive ¿Está usted dispuesto a pagar.");
                                    dialog.Link("Headgear", 31);
                                    dialog.Link("Necklace/Bag", 32);
                                    dialog.Link("Armor/Coat/Robe.", 33);
                                    //dialog.Link("Weapon.", 34);
                                    dialog.Link("Shield.", 35);
                                    dialog.Link("Ring/Heavyring/Bracelet.", 36);
                                    dialog.Link("Boots.", 38);
                                    dialog.Link("Just passing by.", 255);
                                    dialog.Avatar(60);
                                    dialog.Send();
                                    break;
                                }
                            case 4:
                                {
                                    byte _pos = (byte)(4);
                                    byte dbsNeed = 1;
                                    IConquerItem item = client.Equipment.TryGetItem(_pos);
                                    if (item != null)
                                    {
                                        if (item.ID > 0 && item.UID > 0)
                                        {
                                            if ((int)item.SocketOne > 0)
                                            {
                                                dbsNeed = 5;
                                            }
                                            else if ((int)item.SocketTwo > 0)
                                            {
                                                return;
                                            }

                                            if (!client.Agreed)
                                            {
                                                client.Agreed = true;
                                                dialog.Text("Voy a cobrar " + dbsNeed + " Bolas de Dragón. Usted puede encontrarlos en el centro comercial, ");
                                                dialog.Text("o en el gran comerciante. Por favor, elegir el equipo, y recordar u necesidad de");
                                                dialog.Text("usarlo. ¿Está de acuerdo?");
                                                dialog.Link("Let's continue!", npcRequest.OptionID);
                                                dialog.Link("Just passing by.", 255);
                                                dialog.Avatar(60);
                                                dialog.Send();
                                                //return;
                                            }
                                            else
                                            {
                                                client.Agreed = false;
                                                if (client.Inventory.Contains(1088000, dbsNeed))
                                                {
                                                    client.Inventory.Remove(1088000, dbsNeed);
                                                    if (dbsNeed == 1)
                                                        item.SocketOne = (Conquer_Online_Server.Game.Enums.Gem)255;
                                                    else item.SocketTwo = (Conquer_Online_Server.Game.Enums.Gem)255;
                                                    ConquerItemTable.UpdateItem(item, client);
                                                    item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                    _String str = new _String(true);
                                                    str.UID = client.Entity.UID;
                                                    str.TextsCount = 1;
                                                    str.Type = _String.Effect;
                                                    str.Texts.Add("perfect");
                                                    client.Screen.SendScreen(str, true);
                                                    item.Send(client);
                                                    item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Default;

                                                }
                                                else
                                                {
                                                    dialog.Text("Usted No tiene 12 Bolas de Dragon!!");
                                                    dialog.Link("Eso veo.", 255);
                                                    dialog.Avatar(60);
                                                    dialog.Send();
                                                }
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("No puedo hacer nada para que el engranaje!");
                                            dialog.Link("Eso veo.", 255);
                                            dialog.Avatar(60);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("No puedo hacer nada para que el engranaje!");
                                        dialog.Link("Eso veo.", 255);
                                        dialog.Avatar(60);
                                        dialog.Send();
                                    }

                                    break;
                                }
                            case 11:
                            case 12:
                            case 13:
                            case 14:
                            case 15:
                            case 16:
                            case 18:
                                {
                                    byte _pos = (byte)(npcRequest.OptionID - 10);
                                    IConquerItem item = client.Equipment.TryGetItem(_pos);
                                    if (item != null)
                                    {
                                        if (item.ID > 0 && item.UID > 0)
                                        {
                                            if ((int)item.SocketOne > 0)
                                            {
                                                dialog.Text("Yout item already has a socket!");
                                                dialog.Link("I see.", 255);
                                                dialog.Avatar(60);
                                                dialog.Send();
                                                return;
                                            }

                                            if (_pos == 5)
                                            {
                                                if (!(item.ID >= 900000 && item.ID <= 900999))
                                                {
                                                    dialog.Text("You need to be wearing a shield.");
                                                    dialog.Link("I see.", 255);
                                                    dialog.Avatar(60);
                                                    dialog.Send();
                                                    return;
                                                }
                                            }

                                            if (!client.Agreed)
                                            {
                                                client.Agreed = true;
                                                dialog.Text("I'll charge 12 Dragonballs. You can found them at shopping mall, ");
                                                dialog.Text("or at GreatMerchant. Please choose the gear, and remember u need to ");
                                                dialog.Text("be wearing it. Do you agree?");
                                                dialog.Link("Let's continue!", npcRequest.OptionID);
                                                dialog.Link("Just passing by.", 255);
                                                dialog.Avatar(60);
                                                dialog.Send();
                                                //return;
                                            }
                                            else
                                            {
                                                client.Agreed = false;
                                                if (client.Inventory.Contains(1088000, 12))
                                                {
                                                    client.Inventory.Remove(1088000, 12);
                                                    item.SocketOne = (Conquer_Online_Server.Game.Enums.Gem)255;
                                                    ConquerItemTable.UpdateItem(item, client);
                                                    item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                    _String str = new _String(true);
                                                    str.UID = client.Entity.UID;
                                                    str.TextsCount = 1;
                                                    str.Type = _String.Effect;
                                                    str.Texts.Add("perfect");
                                                    client.Screen.SendScreen(str, true);
                                                    item.Send(client);
                                                    item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Default;
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't have 12 Dragonballs!!");
                                                    dialog.Link("I see.", 255);
                                                    dialog.Avatar(60);
                                                    dialog.Send();
                                                }
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("I can't do anything to that gear!");
                                            dialog.Link("I see.", 255);
                                            dialog.Avatar(60);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("I can't do anything to that gear!");
                                        dialog.Link("I see.", 255);
                                        dialog.Avatar(60);
                                        dialog.Send();
                                    }

                                    break;
                                }
                            case 21:
                            case 22:
                            case 23:
                            case 24:
                            case 25:
                            case 26:
                            case 28:
                                {
                                    byte _pos = (byte)(npcRequest.OptionID - 20);
                                    IConquerItem item = client.Equipment.TryGetItem(_pos);
                                    if (item != null)
                                    {
                                        if (item.ID > 0 && item.UID > 0)
                                        {
                                            if (!((int)item.SocketOne > 0))
                                            {
                                                dialog.Text("Yout item don't have the first socket!");
                                                dialog.Link("I see.", 255);
                                                dialog.Avatar(60);
                                                dialog.Send();
                                                return;
                                            }

                                            if (_pos == 5)
                                            {
                                                if (!(item.ID >= 900000 && item.ID <= 900999))
                                                {
                                                    dialog.Text("You need to be wearing a shield.");
                                                    dialog.Link("I see.", 255);
                                                    dialog.Avatar(60);
                                                    dialog.Send();
                                                    return;
                                                }
                                            }

                                            if (!client.Agreed)
                                            {
                                                client.Agreed = true;
                                                dialog.Text("I'll charge a ToughDrill. You can found this rare item at shopping mall, ");
                                                dialog.Text("or at GreatMerchant. Please choose the gear, and remember u need to ");
                                                dialog.Text("be wearing it. Do you agree?");
                                                dialog.Link("Let's continue!", npcRequest.OptionID);
                                                dialog.Link("Just passing by.", 255);
                                                dialog.Avatar(60);
                                                dialog.Send();
                                                //return;
                                            }
                                            else
                                            {
                                                client.Agreed = false;
                                                if (client.Inventory.Contains(1200005, 1))
                                                {
                                                    if (Game.Entity.ChanceSuccess(35))
                                                    {
                                                        client.Inventory.Remove(1200005, 1);
                                                        item.SocketTwo = (Conquer_Online_Server.Game.Enums.Gem)255;
                                                        ConquerItemTable.UpdateItem(item, client);
                                                        item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                        item.Send(client);
                                                        _String str = new _String(true);
                                                        str.UID = client.Entity.UID;
                                                        str.TextsCount = 1;
                                                        str.Type = _String.Effect;
                                                        str.Texts.Add("perfect");
                                                        client.Screen.SendScreen(str, true);
                                                        item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Default;
                                                        PacketHandler.WorldMessage("Congratulations! " + client.Entity.Name + " has openned the second socket using a tough drill into his/her item!");
                                                    }
                                                    else
                                                    {
                                                        client.Inventory.Remove(1200005, 1);
                                                        client.Inventory.Add(1200006, 0, 1);
                                                        dialog.Text("Sorry... The item failed, try again next time bro!");
                                                        dialog.Link("I see.", 255);
                                                        dialog.Avatar(60);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't have a ToughDrill!");
                                                    dialog.Link("I see.", 255);
                                                    dialog.Avatar(60);
                                                    dialog.Send();
                                                }
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("I can't do anything to that gear!");
                                            dialog.Link("I see.", 255);
                                            dialog.Avatar(60);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("I can't do anything to that gear!");
                                        dialog.Link("I see.", 255);
                                        dialog.Avatar(60);
                                        dialog.Send();
                                    }
                                    break;
                                }
                            case 31:
                            case 32:
                            case 33:
                            case 34:
                            case 35:
                            case 36:
                            case 38:
                                {
                                    byte _pos = (byte)(npcRequest.OptionID - 30);
                                    IConquerItem item = client.Equipment.TryGetItem(_pos);
                                    if (item != null)
                                    {
                                        if (item.ID > 0 && item.UID > 0)
                                        {
                                            if (!((int)item.SocketOne > 0))
                                            {
                                                dialog.Text("Yout item don't have the first socket!");
                                                dialog.Link("I see.", 255);
                                                dialog.Avatar(60);
                                                dialog.Send();
                                                return;
                                            }

                                            if (_pos == 5)
                                            {
                                                if (!(item.ID >= 900000 && item.ID <= 900999))
                                                {
                                                    dialog.Text("You need to be wearing a shield.");
                                                    dialog.Link("I see.", 255);
                                                    dialog.Avatar(60);
                                                    dialog.Send();
                                                    return;
                                                }
                                            }

                                            if (!client.Agreed)
                                            {
                                                client.Agreed = true;
                                                dialog.Text("I'll charge 7 StarDrills. Please choose the gear, and remember u need to ");
                                                dialog.Text("be wearing it. Do you agree?");
                                                dialog.Link("Let's continue!", npcRequest.OptionID);
                                                dialog.Link("Just passing by.", 255);
                                                dialog.Avatar(60);
                                                dialog.Send();
                                                //return;
                                            }
                                            else
                                            {
                                                client.Agreed = false;
                                                if (client.Inventory.Contains(1200006, 7))
                                                {
                                                    client.Inventory.Remove(1200006, 7);
                                                    item.SocketTwo = (Conquer_Online_Server.Game.Enums.Gem)255;
                                                    ConquerItemTable.UpdateItem(item, client);
                                                    item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                    item.Send(client);
                                                    _String str = new _String(true);
                                                    str.UID = client.Entity.UID;
                                                    str.TextsCount = 1;
                                                    str.Type = _String.Effect;
                                                    str.Texts.Add("perfect");
                                                    client.Screen.SendScreen(str, true);
                                                    item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Default;
                                                    PacketHandler.WorldMessage("Congratulations! " + client.Entity.Name + " has openned the second socket using 7 star drills into his/her item!");
                                                }
                                                else
                                                {
                                                    dialog.Text("You don't have a ToughDrill!");
                                                    dialog.Link("I see.", 255);
                                                    dialog.Avatar(60);
                                                    dialog.Send();
                                                }
                                            }
                                        }
                                        else
                                        {
                                            dialog.Text("I can't do anything to that gear!");
                                            dialog.Link("I see.", 255);
                                            dialog.Avatar(60);
                                            dialog.Send();
                                        }
                                    }
                                    else
                                    {
                                        dialog.Text("I can't do anything to that gear!");
                                        dialog.Link("I see.", 255);
                                        dialog.Avatar(60);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                #endregion
                #region Proficiency God
                case 941:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Hello my friend. If you believe that, leveling your proficiency is too hard and takes too much time, I can help you. In exchange of a fixed amount of exp balls, I will agree to level up your proficiency.");
                                    dialog.Text("Now, tell me what proficiency you want to level up.");
                                    dialog.Option("Upgrade One-handed Proficiency.", 1);
                                    dialog.Option("Upgrade Two handed Proficiency.", 3);
                                    dialog.Option("Repair Items", 185);
                                    dialog.Option("Upgrade Boxing/Shield Proficiency.", 5);
                                    dialog.Option("Just passing by!", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 185:
                                {
                                    dialog.Text("Which item do you want to upgrade?");
                                    dialog.Option("Headgear.", 101);
                                    dialog.Option("Necklace.", 102);
                                    dialog.Option("Armor.", 103);
                                    dialog.Option("Main Weapon.", 104);
                                    dialog.Option("Left Weapon.", 105);
                                    dialog.Option("Ring.", 106);
                                    dialog.Option("Next Page.", 186);
                                    dialog.Option("I'll just leave", 255);
                                    dialog.Send();

                                    break;
                                }
                            case 186:
                                {
                                    dialog.Text("Which item do you want to upgrade?");
                                    dialog.Option("Boots.", 108);
                                    dialog.Option("Fan.", 110);
                                    dialog.Option("Tower.", 111);
                                    dialog.Option("I'll just leave", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 101:
                            case 102:
                            case 103:
                            case 104:
                            case 105:
                            case 106:
                            case 108:
                            case 110:
                            case 111:
                                {
                                    var item = client.Equipment.TryGetItem((byte)(npcRequest.OptionID - 100));
                                    if (item != null)
                                    {
                                        #region old
                                        /*if (item.Durability == item.MaximDurability)
                                                {
                                                    var itemdetail = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
                                                    if (itemdetail.Durability != item.MaximDurability)
                                                    {

                                                        int diff = itemdetail.Durability - item.MaximDurability;

                                                        int need = Math.Max((diff / 100) / 6, 1);

                                                        need = Math.Min(need, client.KylinUpgradeCount);

                                                        for (int counter = 0; counter < need; counter++)
                                                        {
                                                            item.MaximDurability += 100;
                                                            client.Inventory.Remove(700043, 1);
                                                        }
                                                        if (item.MaximDurability > itemdetail.Durability)
                                                            item.MaximDurability = itemdetail.Durability;
                                                        item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                                        item.Send(client);
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("Your item must be repaired first.");
                                                    dialog.Option("Oh, sorry.", 255);
                                                    dialog.Send();
                                                    break;
                                                }*/
                                        #endregion
                                        #region test
                                        var itemdetail = Conquer_Online_Server.Database.ConquerItemInformation.BaseInformations[item.ID];
                                        if (itemdetail.Durability != item.MaximDurability)
                                        {
                                            ushort oldDurability = item.MaximDurability;
                                            bool Upgraded = false;
                                            while (client.Entity.Money > 1000000)
                                            {
                                                client.Entity.Money -= 1000000;

                                                int rndDurability = (Conquer_Online_Server.ServerBase.Kernel.Random.Next(itemdetail.Durability));
                                                if (rndDurability >= item.MaximDurability)
                                                {
                                                    //This looks ugly to me, not sure how else to do it.
                                                    item.MaximDurability = ushort.Parse(rndDurability.ToString());
                                                    rndDurability = 0;
                                                    if (!Upgraded)
                                                        Upgraded = true;
                                                }
                                            }
                                            if (Upgraded)
                                                dialog.Text("Your item's durabuility was increased from " + oldDurability + " to " + item.MaximDurability + ".\n");
                                            else
                                                dialog.Text("I wasen't able to increase your item's durability..\n");
                                            int Repair = (Conquer_Online_Server.ServerBase.Kernel.Random.Next(1));
                                            if (Repair == 1)
                                            {
                                                if (Upgraded)
                                                    dialog.Text("I was also able to repair the item.");
                                                else
                                                {
                                                    dialog.Text("But I was able to repair the item.");
                                                    Upgraded = true;
                                                }
                                                item.Durability = item.MaximDurability;
                                            }
                                            item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
                                            item.Send(client);
                                            if (Upgraded)
                                                dialog.Option("Thanks.", 255);
                                            else
                                                dialog.Option("Darn..", 255);
                                            dialog.Send();
                                            break;
                                        }
                                        else
                                        {
                                            dialog.Text("This item is already at it's max durabuility!");
                                            dialog.Option("Oh.", 255);
                                            dialog.Send();
                                            break;
                                        }
                                        #endregion
                                    }
                                    break;
                                }
                            case 1:
                                {
                                    dialog.Text("Which one handed proficiency?");
                                    dialog.Option("Upgrade Blade Proficiency.", 41);
                                    dialog.Option("Upgrade Sword Proficiency.", 42);
                                    dialog.Option("Upgrade Hook Proficiency.", 43);
                                    dialog.Option("Upgrade Whip Proficiency.", 44);
                                    dialog.Option("Upgrade Axe Proficiency.", 45);
                                    dialog.Option("Upgrade Dagger Proficiency.", 49);
                                    dialog.Option("Next page.", 2);
                                    dialog.Option("Nothing, sorry.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 2:
                                {
                                    dialog.Text("Which one handed proficiency?");
                                    dialog.Option("Upgrade PrayerBead Proficiency.", 61);
                                    dialog.Option("Upgrade Hammer Proficiency.", 46);
                                    dialog.Option("Upgrade Club Proficiency.", 48);
                                    dialog.Option("Upgrade Scepter Proficiency.", 184);
                                    dialog.Option("Upgrade Katana Proficiency.", 60);
                                    dialog.Option("Upgrade Axe Proficiency.", 45);
                                    dialog.Option("Back.", 1);
                                    dialog.Option("Nothing, sorry.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 3:
                                {
                                    dialog.Text("Which two handed proficiency?");
                                    dialog.Option("Upgrade Glaive Proficiency.", 51);
                                    dialog.Option("Upgrade Poleaxe Proficiency.", 53);
                                    dialog.Option("Upgrade LongHammer Proficiency.", 54);
                                    dialog.Option("Upgrade Spear Proficiency.", 56);
                                    dialog.Option("Next page.", 4);
                                    dialog.Option("Nothing, sorry.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 4:
                                {
                                    dialog.Text("Which one handed proficiency?");
                                    dialog.Option("Upgrade Backsword Proficiency.", 124);
                                    dialog.Option("Upgrade Pickaxe Proficiency.", 142);
                                    dialog.Option("Upgrade Halberd Proficiency.", 58);
                                    dialog.Option("Upgrade Wand Proficiency.", 165);
                                    dialog.Option("Upgrade Bow Proficiency.", 50);
                                    dialog.Option("Back.", 3);
                                    dialog.Option("Nothing, sorry.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 5:
                                {
                                    dialog.Text("Which others handed proficiency?");
                                    dialog.Option("Upgrade Boxing Proficiency.", 254);
                                    dialog.Option("Upgrade Shield Proficiency.", 90);
                                    dialog.Option("Nothing, sorry.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 100:
                                {
                                    if (client.Proficiencies.ContainsKey(client.UplevelProficiency))
                                    {
                                        var prof = client.Proficiencies[client.UplevelProficiency];
                                        if (prof.Level >= 12)
                                        {
                                            dialog.Text("This proficiency cannot be leveled up anymore.");
                                            dialog.Option("Oh sorry.", 255);
                                            dialog.Send();
                                            break;
                                        }
                                        client.UplevelProficiency = 0;
                                        if (client.Inventory.Contains(723700, prof.Level))
                                        {
                                            client.Inventory.Remove(723700, prof.Level);
                                            prof.Level++;
                                            prof.Experience = 0;
                                            _String str = new _String(true);
                                            str.UID = client.Entity.UID;
                                            str.TextsCount = 1;
                                            str.Type = _String.Effect;
                                            str.Texts.Add("perfect");
                                            client.Screen.SendScreen(str, true);
                                            prof.Send(client);
                                            break;
                                        }
                                        dialog.Text("You don't have the requiered exp balls, I'm sorry I cannot help you.");
                                        dialog.Option("It's alright.", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    else
                                    {
                                        dialog.Text("You don't know this proficiency.");
                                        dialog.Option("Ahh, sorry.", 255);
                                        dialog.Send();
                                        break;
                                    }
                                }
                            default:
                                {
                                    if (npcRequest.OptionID == 255)
                                        return;
                                    ushort proficiency = 0;
                                    if (npcRequest.OptionID < 100)
                                        proficiency = (ushort)(npcRequest.OptionID * 10);
                                    else
                                    {
                                        if (npcRequest.OptionID != 254)
                                        {
                                            string off = npcRequest.OptionID.ToString();
                                            string reverse = off[2].ToString() + off[1].ToString() + off[0].ToString();
                                            proficiency = ushort.Parse(reverse);
                                        }
                                    }
                                    if (proficiency == 600) proficiency++;
                                    if (client.Proficiencies.ContainsKey(proficiency))
                                    {
                                        var prof = client.Proficiencies[proficiency];
                                        if (prof.Level >= 12)
                                        {
                                            dialog.Text("This proficiency cannot be leveled up anymore.");
                                            dialog.Option("Oh.", 255);
                                            dialog.Send();
                                            break;
                                        }
                                        client.UplevelProficiency = proficiency;
                                        dialog.Text("I need " + prof.Level + " exp balls to be able to level up this proficiency.");
                                        dialog.Option("Let's do it then.", 100);
                                        dialog.Option("No, sorry.", 255);
                                        dialog.Send();
                                        break;
                                    }
                                    else
                                    {
                                        dialog.Text("You don't know this proficiency.");
                                        dialog.Option("Ahh, sorry.", 255);
                                        dialog.Send();
                                        break;
                                    }
                                }
                        }
                        break;
                    }
                #endregion
                #region Saddle seller
                case 829:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Greetings! I'm a great seller, I have the most Saddle item ");
                                    dialog.Text("world. What do you want my brother!");
                                    dialog.Option("Saddle [50k Cps]", 1);
                                    dialog.Option("Just passing by.", 255);
                                    dialog.Avatar(85);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.ConquerPoints >= 50000)
                                    {
                                        client.Inventory.Add(723903, 0, 1);

                                        client.Entity.ConquerPoints -= 50000;
                                    }
                                    else
                                    {
                                        dialog.Text("You don't have enough Cps!");
                                        dialog.Option("I see.", 255);
                                        dialog.Avatar(85);
                                        dialog.Send();
                                    }
                                    break;
                                }

                        }
                        break;
                    }
                #endregion

                default:
                    {
                        if (client.Account.State == Conquer_Online_Server.Database.AccountTable.AccountState.GameMaster || client.Account.State == Conquer_Online_Server.Database.AccountTable.AccountState.ProjectManager)
                            client.Send(new Message("NpcID[" + client.ActiveNpc + "]", System.Drawing.Color.Red, Message.TopLeft));
                        break;
                    }
            }

            if (!dialog.Sent)
                if (dialog.Replies.Count > 1)
                    dialog.Send();
        }
Example #14
0
        public static void CpsFowin(Client.GameState GC)
        {
            // Entity GC = new Entity();
            if (Kernel.SteedTornament.cps == 1)
            {
                GC.Entity.ConquerPoints += 20000;
                GC.Entity.cp = 20000;
                foreach (Client.GameState Chaar in ServerBase.Kernel.GamePool.Values)
                {

                    //Entity Chaar = (Game.Entity)DE.Value;
                    {
                        if (Chaar != null)
                        {
                            if (Chaar.Entity.MapID == 1950)
                            {

                                Kernel.SendWorldMessage(new Message(""+ " "+" ", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
                                Kernel.SendWorldMessage(new Message( " Rank         Name         Score", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
                                Kernel.SendWorldMessage(new Message( "No.1          " + GC.Entity.Name + "      " + (DateTime.Now - GC.Entity.SteedRaceTime) + "", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
                                Conquer_Online_Server.Network.GamePackets._String Packet = new Conquer_Online_Server.Network.GamePackets._String(true);
                                //GamePackets.poker Packet2 = new GamePackets.poker(true, client);
                                Packet.UID = GC.Entity.UID;
                                Packet.Type = _String.Effect;
                                Packet.TextsCount = 1;
                                Packet.Texts.Add("ridmatch_first");
                                GC.SendScreen(Packet, true);
                            }
                        }
                    }
                }
            }
            else if (Kernel.SteedTornament.cps == 2)
            {
                GC.Entity.ConquerPoints += 17000;
                GC.Entity.cp = 17000;
                foreach (Client.GameState Chaar in ServerBase.Kernel.GamePool.Values)
                {

                   // Entity Chaar = (Game.Entity)DE.Value;
                    {
                        if (Chaar != null)
                        {
                            if (Chaar.Entity.MapID == 1950)
                            {
               Kernel.SendWorldMessage(new Message( "No.2          " + GC.Entity.Name + "      " + (DateTime.Now - GC.Entity.SteedRaceTime) + "", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
               Conquer_Online_Server.Network.GamePackets._String Packet = new Conquer_Online_Server.Network.GamePackets._String(true);
               //GamePackets.poker Packet2 = new GamePackets.poker(true, client);
               Packet.UID = GC.Entity.UID;
               Packet.Type = _String.Effect;
               Packet.TextsCount = 1;
               Packet.Texts.Add("ridmatch_second");
               GC.SendScreen(Packet, true);
                            }
                        }
                    }
                }
            }
            else if (Kernel.SteedTornament.cps == 3)
            {
                GC.Entity.ConquerPoints += 15000;
                GC.Entity.cp = 15000;
                foreach (DictionaryEntry DE in Kernel.H_Chars)
                {
                    Entity Chaar = (Game.Entity)DE.Value;
                    {
                        if (Chaar != null)
                        {
                            if (Chaar.MapID == 1950)
                            {
                  Kernel.SendWorldMessage(new Message( "No.3          " + GC.Entity.Name + "      " + (DateTime.Now - GC.Entity.SteedRaceTime) + "", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
                  Conquer_Online_Server.Network.GamePackets._String Packet = new Conquer_Online_Server.Network.GamePackets._String(true);
                  //GamePackets.poker Packet2 = new GamePackets.poker(true, client);
                  Packet.UID = GC.Entity.UID;
                  Packet.Type = _String.Effect;
                  Packet.TextsCount = 1;
                  Packet.Texts.Add("ridmatch_third");
                  GC.SendScreen(Packet, true);
                            }
                        }
                    }
                }
            }
            else if (Kernel.SteedTornament.cps == 4)
            {
                GC.Entity.ConquerPoints += 14000;
                GC.Entity.cp = 14000;
                foreach (DictionaryEntry DE in Kernel.H_Chars)
                {
                    Entity Chaar = (Game.Entity)DE.Value;
                    {
                        if (Chaar != null)
                        {
                            if (Chaar.MapID == 1950)
                            {
                               Kernel.SendWorldMessage(new Message( "No.4         " + GC.Entity.Name + "      " + (DateTime.Now - GC.Entity.SteedRaceTime) + "", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
                               Conquer_Online_Server.Network.GamePackets._String Packet = new Conquer_Online_Server.Network.GamePackets._String(true);
                               //GamePackets.poker Packet2 = new GamePackets.poker(true, client);
                               Packet.UID = GC.Entity.UID;
                               Packet.Type = _String.Effect;
                               Packet.TextsCount = 1;
                               Packet.Texts.Add("ridmatch_first");
                               GC.SendScreen(Packet, true);
                            }
                        }
                    }
                }
            }
            else if (Kernel.SteedTornament.cps == 5)
            {
                GC.Entity.ConquerPoints += 12000;
                GC.Entity.cp = 12000;
                foreach (DictionaryEntry DE in Kernel.H_Chars)
                {
                    Entity Chaar = (Game.Entity)DE.Value;
                    {
                        if (Chaar != null)
                        {
                            if (Chaar.MapID == 1950)
                            {
                                Kernel.SendWorldMessage(new Message( "No.5          " + GC.Entity.Name + "      " + (DateTime.Now - GC.Entity.SteedRaceTime) + "", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
                            }
                        }
                    }
                }
            }
            else if (Kernel.SteedTornament.cps == 6)
            {
                GC.Entity.ConquerPoints += 10000;
                GC.Entity.cp = 10000;
                foreach (DictionaryEntry DE in Kernel.H_Chars)
                {
                    Entity Chaar = (Game.Entity)DE.Value;
                    {
                        if (Chaar != null)
                        {
                            if (Chaar.MapID == 1950)
                            {
                                Kernel.SendWorldMessage(new Message( "No.6          " + GC.Entity.Name + "      " + (DateTime.Now - GC.Entity.SteedRaceTime) + "", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
                            }
                        }
                    }
                }
            }
            else if (Kernel.SteedTornament.cps == 7)
            {
                GC.Entity.ConquerPoints += 8000;
                GC.Entity.cp = 8000;
                foreach (DictionaryEntry DE in Kernel.H_Chars)
                {
                    Entity Chaar = (Game.Entity)DE.Value;
                    {
                        if (Chaar != null)
                        {
                            if (Chaar.MapID == 1950)
                            {
                                Kernel.SendWorldMessage(new Message( "No.7          " + GC.Entity.Name + "      " + (DateTime.Now - GC.Entity.SteedRaceTime) + "", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
                            }
                        }
                    }
                }

            }
            else if (Kernel.SteedTornament.cps == 8)
            {
                GC.Entity.ConquerPoints += 5000;
                GC.Entity.cp = 5000;
                foreach (DictionaryEntry DE in Kernel.H_Chars)
                {
                    Entity Chaar = (Game.Entity)DE.Value;
                    {
                        if (Chaar != null)
                        {
                            if (Chaar.MapID == 1950)
                            {
                                Kernel.SendWorldMessage(new Message( "No.8          " + GC.Entity.Name + "      " + (DateTime.Now - GC.Entity.SteedRaceTime) + "", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
                            }
                        }
                    }
                }
            }
            else if (Kernel.SteedTornament.cps == 9)
            {
                GC.Entity.ConquerPoints += 4000;
                GC.Entity.cp = 4000;
                foreach (DictionaryEntry DE in Kernel.H_Chars)
                {
                    Entity Chaar = (Game.Entity)DE.Value;
                    {
                        if (Chaar != null)
                        {
                            if (Chaar.MapID == 1950)
                            {
                               Kernel.SendWorldMessage(new Message( "No.9         " + GC.Entity.Name + "      " + (DateTime.Now - GC.Entity.SteedRaceTime) + "", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
                            }
                        }
                    }
                }
            }
            else if (Kernel.SteedTornament.cps == 10)
            {
                GC.Entity.ConquerPoints += 3000;
                GC.Entity.cp = 3000;
                foreach (DictionaryEntry DE in Kernel.H_Chars)
                {
                    Entity Chaar = (Game.Entity)DE.Value;
                    {
                        if (Chaar != null)
                        {
                            if (Chaar.MapID == 1950)
                            {

                                Kernel.SendWorldMessage(new Message( "No.10          " + GC.Entity.Name + "      " + (DateTime.Now - GC.Entity.SteedRaceTime) + "", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
                            }
                        }
                    }
                }
            }
            else if (Kernel.SteedTornament.cps > 10)
            {
                GC.Entity.ConquerPoints += 1000;
                GC.Entity.cp = 1000;
            }
        }