void doIt()
        {
            #region Reincarnate
            Database.ReincarnationTable.NewReincarnated(Entity);
            Game.Features.Reincarnation.ReincarnateInfo info = new Game.Features.Reincarnation.ReincarnateInfo();
            info.UID = Entity.UID;
            info.Level = Entity.Level;
            info.Experience = Entity.Experience;
            ServerBase.Kernel.ReincarnatedCharacters.Add(info.UID, info);
            Entity.FirstRebornClass = First;
            Entity.SecondRebornClass = Second;
            Entity.Class = Class;
            Entity.Atributes = 182;
            Entity.Level = 15;
            Entity.Experience = 0;
            #endregion
            #region Low level items
            for (byte i = 1; i < 9; i++)
            {
                if (i != 7)
                {
                    Interfaces.IConquerItem item = Entity.Owner.Equipment.TryGetItem(i);
                    if (item != null && item.ID != 0)
                    {
                        try
                        {
                            UnloadItemStats(item, false);
                            Database.ConquerItemInformation cii = new PhoenixProject.Database.ConquerItemInformation(item.ID, item.Plus);
                            item.ID = cii.LowestID(Network.PacketHandler.ItemMinLevel(Network.PacketHandler.ItemPosition(item.ID)));
                            item.Mode = PhoenixProject.Game.Enums.ItemMode.Update;
                            item.Send(Entity.Owner);
                            LoadItemStats(item);
                            Database.ConquerItemTable.UpdateItemID(item, Entity.Owner);
                        }
                        catch
                        {
                            Console.WriteLine("Reborn item problem: " + item.ID);
                        }
                    }
                }
            }
            Interfaces.IConquerItem hand = Entity.Owner.Equipment.TryGetItem(5);
            if (hand != null)
            {
                Entity.Owner.Equipment.Remove(5);
                CalculateStatBonus();
                CalculateHPBonus();
                Entity.Owner.Screen.Reload(null);
            }
            else
                Entity.Owner.SendScreen(Entity.Owner.Entity.SpawnPacket, false);
            #endregion

            foreach (Interfaces.ISkill s in Skills)
                Entity.Owner.Spells.Remove(s.ID);

            switch (First)
            {
                #region Trojan
                case 15:
                    {
                        switch (Second)
                        {
                            case 11:
                                Add(Enums.SkillIDs.CruelShade);
                                break;
                            default: WontAdd(Enums.SkillIDs.Accuracy); break;
                        }
                        break;
                    }
                #endregion
                #region Warrior
                case 25:
                    {
                        switch (Second)
                        {
                            case 11:
                                Add(Enums.SkillIDs.IronShirt);
                                WontAdd(Enums.SkillIDs.Shield);
                                WontAdd(Enums.SkillIDs.SuperMan);
                                break;
                            case 21:
                                Add(Enums.SkillIDs.Reflect);
                                break;
                            case 132:
                                WontAdd(Enums.SkillIDs.FlyingMoon);
                                WontAdd(Enums.SkillIDs.Shield);
                                break;
                            case 142:
                                WontAdd(Enums.SkillIDs.Accuracy);
                                WontAdd(Enums.SkillIDs.FlyingMoon);
                                WontAdd(Enums.SkillIDs.SuperMan);
                                break;
                            default:
                                WontAdd(Enums.SkillIDs.Accuracy);
                                WontAdd(Enums.SkillIDs.FlyingMoon);
                                WontAdd(Enums.SkillIDs.SuperMan);
                                WontAdd(Enums.SkillIDs.Shield);
                                break;
                        }
                        break;
                    }
                #endregion
                #region Archer
                case 45:
                    {
                        switch (Second)
                        {
                            case 41: break;
                            default:
                                WontAdd(Enums.SkillIDs.Scatter);
                                WontAdd(Enums.SkillIDs.XPFly);
                                WontAdd(Enums.SkillIDs.AdvancedFly);
                                WontAdd(Enums.SkillIDs.ArrowRain);
                                WontAdd(Enums.SkillIDs.Intensify);
                                WontAdd(Enums.SkillIDs.RapidFire);
                                break;
                        }
                        break;
                    }
                #endregion
                #region Ninja
                case 55:
                    {
                        switch (Second)
                        {
                            case 51: break;
                            default:
                                WontAdd(Enums.SkillIDs.PoisonStar);
                                WontAdd(Enums.SkillIDs.ShurikenVortex);
                                WontAdd(Enums.SkillIDs.FatalStrike);
                                WontAdd(Enums.SkillIDs.TwofoldBlades);
                                WontAdd(Enums.SkillIDs.ArcherBane);
                                break;
                        }
                        break;
                    }
                #endregion
                #region Monk
                case 65:
                    {
                        switch (Second)
                        {
                            case 61: break;
                            default:
                                WontAdd(Enums.SkillIDs.Oblivion);
                                WontAdd(Enums.SkillIDs.RadiantPalm);
                                WontAdd(Enums.SkillIDs.TyrantAura);
                                WontAdd(Enums.SkillIDs.DeathBlow);
                                WontAdd(Enums.SkillIDs.DeflectionAura);
                                WontAdd(Enums.SkillIDs.TripleAttack);
                                break;
                        }
                        break;
                    }
                #endregion
                #region Water
                case 135:
                    {
                        switch (Second)
                        {
                            case 132: Add(Enums.SkillIDs.Pervade); break;
                            case 142:
                                WontAdd(Enums.SkillIDs.Nectar);
                                WontAdd(Enums.SkillIDs.HealingRain);
                                break;
                            default:
                                WontAdd(Enums.SkillIDs.Nectar);
                                WontAdd(Enums.SkillIDs.Lightning);
                                WontAdd(Enums.SkillIDs.Volcano);
                                WontAdd(Enums.SkillIDs.AdvancedCure);
                                WontAdd(Enums.SkillIDs.SpeedLightning);
                                WontAdd(Enums.SkillIDs.HealingRain);
                                break;
                        }
                        break;
                    }
                #endregion
                #region Fire
                case 145:
                    {
                        switch (Second)
                        {
                            case 142: Add(Enums.SkillIDs.Dodge); break;
                            default:
                                if (Second != 132)
                                    WontAdd(Enums.SkillIDs.FireCircle);

                                WontAdd(Enums.SkillIDs.Tornado);
                                WontAdd(Enums.SkillIDs.FireMeteor);
                                WontAdd(Enums.SkillIDs.FireOfHell);
                                WontAdd(Enums.SkillIDs.FireRing);
                                WontAdd(Enums.SkillIDs.Volcano);
                                WontAdd(Enums.SkillIDs.Lightning);
                                WontAdd(Enums.SkillIDs.SpeedLightning);
                                break;
                        }
                        break;
                    }
                #endregion
            }

            Add(Enums.SkillIDs.Bless);

            #region Re-Learn Profs
            foreach (Interfaces.IProf Prof in Profs)
            {
                if (Prof == null)
                    continue;

                Prof.Available = false;
                Prof.PreviousLevel = Prof.Level;
                Prof.Level = 0;
                Prof.Experience = 0;
                Entity.Owner.Proficiencies.Add(Prof.ID, Prof);
                Prof.Send(Entity.Owner);
            }
            #endregion
            #region Re-Learn Skills
            foreach (Interfaces.ISkill Skill in Skills)
            {
                if (Skill == null)
                    continue;

                Skill.Available = false;
                Skill.PreviousLevel = Skill.Level;
                Skill.Level = 0;
                Skill.Experience = 0;

                if (!WontLearn.ContainsKey(Skill.ID))
                {
                    Entity.Owner.Spells.Add(Skill.ID, Skill);
                    Skill.Send(Entity.Owner);
                }
            }
            #endregion
            #region Learn Skills
            foreach (Interfaces.ISkill L in Learn.Values)
            {
                if (L == null)
                    continue;

                L.Available = false;
                Entity.Owner.Spells.Add(L.ID, L);
                L.Send(Entity.Owner);
            }
            #endregion
            #region Remove Skills
            foreach (Interfaces.ISkill L in WontLearn.Values)
            {
                if (L == null)
                    continue;

                L.Available = false;
                Entity.Owner.Spells.Remove(L.ID);
                Database.SkillTable.DeleteSpell(Entity.Owner, L.ID);
                L.Send(Entity.Owner);
            }
            #endregion

            Database.DataHolder.GetStats(Entity.Class, Entity.Level, Entity.Owner);
            Entity.Owner.CalculateStatBonus();
            Entity.Owner.CalculateHPBonus();

                Database.SkillTable.SaveProficiencies(Entity.Owner);
                Database.SkillTable.SaveSpells(Entity.Owner);

            ServerBase.Kernel.SendWorldMessage(new PhoenixProject.Network.GamePackets.Message("Congratulations, " + Entity.Name + " reincarnated!", System.Drawing.Color.White, Network.GamePackets.Message.TopLeft), ServerBase.Kernel.GamePool.Values);
        }
        public Reincarnation(Client.GameState client, byte new_class)
        {
            if (client.Entity.Level < 130)
                return;
            _client = client;
            RemoveSkill = new SafeDictionary<ushort, PhoenixProject.Interfaces.ISkill>(500);
            Addskill = new SafeDictionary<ushort, PhoenixProject.Interfaces.ISkill>(500);
            #region Low level items
            for (byte i = 1; i < 9; i++)
            {
                if (i != 7)
                {
                    Interfaces.IConquerItem item = client.Equipment.TryGetItem(i);
                    if (item != null && item.ID != 0)
                    {
                        try

                        {
                            //client.UnloadItemStats(item, false);
                            Database.ConquerItemInformation cii = new PhoenixProject.Database.ConquerItemInformation(item.ID, item.Plus);
                            item.ID = cii.LowestID(Network.PacketHandler.ItemMinLevel(Network.PacketHandler.ItemPosition(item.ID)));
                            item.Mode = PhoenixProject.Game.Enums.ItemMode.Update;
                            item.Send(client);
                            client.LoadItemStats(client.Entity);
                            Database.ConquerItemTable.UpdateItemID(item, client);
                        }
                        catch
                        {
                            Console.WriteLine("Reborn item problem: " + item.ID);
                        }
                    }
                }
            }
            Interfaces.IConquerItem hand = client.Equipment.TryGetItem(5);
            if (hand != null)
            {
                client.Equipment.Remove(5);
                client.CalculateStatBonus();
                client.CalculateHPBonus();
                client.SendStatMessage();
            }
            else
                //client.Screen.send(client.Entity.SpawnPacket, false);
            #endregion

            #region Remove Extra Skill
            if (client.Entity.FirstRebornClass == 15 && client.Entity.SecondRebornClass == 15 && client.Entity.Class == 15)
            {
                WontAdd(PhoenixProject.Game.Enums.SkillIDs.DragonWhirl);
            }
            if (client.Entity.FirstRebornClass == 25 && client.Entity.SecondRebornClass == 25 && client.Entity.Class == 25)
            {
                WontAdd(PhoenixProject.Game.Enums.SkillIDs.Perseverance);
            }
            if (client.Entity.FirstRebornClass == 45 && client.Entity.SecondRebornClass == 45 && client.Entity.Class == 45)
            {
                WontAdd(PhoenixProject.Game.Enums.SkillIDs.StarArrow);
            }
            if (client.Entity.FirstRebornClass == 55 && client.Entity.SecondRebornClass == 55 && client.Entity.Class == 55)
            {
                WontAdd(PhoenixProject.Game.Enums.SkillIDs.PoisonStar);
            }
            if (client.Entity.FirstRebornClass == 65 && client.Entity.SecondRebornClass == 65 && client.Entity.Class == 65)
            {
                WontAdd(PhoenixProject.Game.Enums.SkillIDs.SoulShackle);
            }
            if (client.Entity.FirstRebornClass == 135 && client.Entity.SecondRebornClass == 135 && client.Entity.Class == 135)
            {
                WontAdd(PhoenixProject.Game.Enums.SkillIDs.AzureShield);
            }
            if (client.Entity.FirstRebornClass == 145 && client.Entity.SecondRebornClass == 145 && client.Entity.Class == 145)
            {
                WontAdd(PhoenixProject.Game.Enums.SkillIDs.HeavenBlade);
            }
            #endregion
            Database.ReincarnationTable.NewReincarnated(client.Entity);
            Game.Features.Reincarnation.ReincarnateInfo info = new Game.Features.Reincarnation.ReincarnateInfo();
            info.UID = client.Entity.UID;
            info.Level = client.Entity.Level;
            info.Experience = client.Entity.Experience;
            ServerBase.Kernel.ReincarnatedCharacters.Add(info.UID, info);
            client.Entity.FirstRebornClass = client.Entity.SecondRebornClass;
            client.Entity.SecondRebornClass = client.Entity.Class;
            client.Entity.Class = new_class;
            client.Entity.SecondRebornLevel = client.Entity.Level;
            client.Entity.Level = 15;
            client.Entity.Experience = 0;
            client.Entity.Atributes =
             (ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornClass, client.Entity.FirstRebornLevel) +
              client.ExtraAtributePoints(client.Entity.SecondRebornClass, client.Entity.SecondRebornLevel) + 62);

            client.Spells.Clear();
            client.Spells = new SafeDictionary<ushort, PhoenixProject.Interfaces.ISkill>(100);
            switch (client.Entity.FirstRebornClass)
            {
                case 15:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.Cyclone);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Hercules);
                        Add(PhoenixProject.Game.Enums.SkillIDs.SpiritHealing);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Robot);
                        break;
                    }
                case 25:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.SuperMan);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Dash);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Shield);
                        break;
                    }
                case 45:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.Intensify);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Scatter);
                        Add(PhoenixProject.Game.Enums.SkillIDs.RapidFire);
                        Add(PhoenixProject.Game.Enums.SkillIDs.XPFly);
                        Add(PhoenixProject.Game.Enums.SkillIDs.AdvancedFly);
                        break;
                    }
                case 55:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.FatalStrike);
                        Add(PhoenixProject.Game.Enums.SkillIDs.ShurikenVortex);
                        Add(PhoenixProject.Game.Enums.SkillIDs.ToxicFog);
                        Add(PhoenixProject.Game.Enums.SkillIDs.TwofoldBlades);
                        Add(PhoenixProject.Game.Enums.SkillIDs.PoisonStar);

                        break;
                    }
                case 65:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.RadiantPalm);
                        Add(PhoenixProject.Game.Enums.SkillIDs.WhirlWindKick);
                        Add(PhoenixProject.Game.Enums.SkillIDs.TripleAttack);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Oblivion);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Serenity);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Compassion);
                        Add(PhoenixProject.Game.Enums.SkillIDs.TyrantAura);
                        Add(PhoenixProject.Game.Enums.SkillIDs.TyrantAura);
                        Add(PhoenixProject.Game.Enums.SkillIDs.DeflectionAura);
                        break;
                    }
                case 75:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.RadiantPalm);
                        Add(PhoenixProject.Game.Enums.SkillIDs.WhirlWindKick);
                        Add(PhoenixProject.Game.Enums.SkillIDs.TripleAttack);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Oblivion);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Serenity);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Compassion);
                        Add(PhoenixProject.Game.Enums.SkillIDs.TyrantAura);
                        Add(PhoenixProject.Game.Enums.SkillIDs.TyrantAura);
                        Add(PhoenixProject.Game.Enums.SkillIDs.DeflectionAura);
                        break;
                    }
                case 135:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.Thunder);
                        Add(PhoenixProject.Game.Enums.SkillIDs.WaterElf);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Cure);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Lightning);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Volcano);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Pray);
                        Add(PhoenixProject.Game.Enums.SkillIDs.AdvancedCure);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Meditation);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Stigma);
                        break;
                    }
                case 140:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.Thunder);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Cure);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Lightning);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Tornado);
                        Add(PhoenixProject.Game.Enums.SkillIDs.FireCircle);
                        Add(PhoenixProject.Game.Enums.SkillIDs.FireMeteor);
                        Add(PhoenixProject.Game.Enums.SkillIDs.FireRing);
                        break;
                    }

            }

            byte PreviousClass = client.Entity.FirstRebornClass;
            byte toClass = (byte)(client.Entity.SecondRebornClass - 4);

            Interfaces.ISkill[] ADD_spells = this.Addskill.Values.ToArray();
            foreach (Interfaces.ISkill skill in ADD_spells)
            {
                skill.Available = true;
                if (!client.Spells.ContainsKey(skill.ID))
                    client.Spells.Add(skill.ID, skill);
            }
            #region Spells
            Interfaces.ISkill[] spells = client.Spells.Values.ToArray();
            foreach (Interfaces.ISkill spell in spells)
            {
                spell.PreviousLevel = spell.Level;
                spell.Level = 0;
                spell.Experience = 0;
                #region Pirate
                if (PreviousClass == 75)
                {
                    if (client.Entity.Class != 71)
                    {
                        switch (spell.ID)
                        {
                            case 10490:
                            case 10415:
                            case 10381:
                                client.RemoveSpell(spell);
                                break;
                        }
                    }
                }
                #endregion
                #region Monk
                if (PreviousClass == 65)
                {
                    if (client.Entity.Class != 61)
                    {
                        switch (spell.ID)
                        {
                            case 10490:
                            case 10415:
                            case 10381:
                                client.RemoveSpell(spell);
                                break;
                        }
                    }
                }
                #endregion
                #region Warrior
                if (PreviousClass == 25)
                {
                    if (client.Entity.Class != 21)
                    {
                        switch (spell.ID)
                        {
                            case 1025:
                                if (client.Entity.Class != 21 && client.Entity.Class != 132)
                                    client.RemoveSpell(spell);
                                break;
                        }
                    }
                }
                #endregion
                #region Ninja
                if (toClass != 51)
                {
                    switch (spell.ID)
                    {
                        case 6010:
                        case 6000:
                        case 6011:
                            client.RemoveSpell(spell);
                            break;
                    }
                }
                #endregion
                #region Trojan
                if (toClass != 11)
                {
                    switch (spell.ID)
                    {
                        case 1115:
                            client.RemoveSpell(spell);
                            break;
                    }
                }
                #endregion
                #region Archer
                if (toClass != 41)
                {
                    switch (spell.ID)
                    {
                        case 8001:
                        case 8000:
                        case 8003:
                        case 9000:
                        case 8002:
                        case 8030:
                            client.RemoveSpell(spell);
                            break;
                    }
                }
                #endregion
                #region WaterTaoist
                if (PreviousClass == 135)
                {
                    if (toClass != 132)
                    {
                        switch (spell.ID)
                        {
                            case 1000:
                            case 1001:
                            case 1010:
                            case 1125:
                            case 1100:
                            case 8030:
                                client.RemoveSpell(spell);
                                break;
                            case 1050:
                            case 1175:
                            case 1170:
                                if (toClass != 142)
                                    client.RemoveSpell(spell);
                                break;
                        }
                    }
                }
                #endregion
                #region FireTaoist
                if (PreviousClass == 145)
                {
                    if (toClass != 142)
                    {
                        switch (spell.ID)
                        {
                            case 1000:
                            case 1001:
                            case 1150:
                            case 1180:
                            case 1120:
                            case 1002:
                            case 1160:
                            case 1165:
                                client.RemoveSpell(spell);
                                break;
                        }
                    }
                }
                #endregion
                if (client.Spells.ContainsKey(spell.ID))
                    if (spell.ID != (ushort)Game.Enums.SkillIDs.Reflect)
                        spell.Send(client);
            }
            #endregion
            Add(PhoenixProject.Game.Enums.SkillIDs.Bless);

            Addskill.Clear();
            Addskill = new SafeDictionary<ushort, PhoenixProject.Interfaces.ISkill>(100);

            PreviousClass = client.Entity.SecondRebornClass;
            toClass = client.Entity.Class;
            switch (client.Entity.SecondRebornClass)
            {
                case 15:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.Robot);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Cyclone);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Hercules);
                        Add(PhoenixProject.Game.Enums.SkillIDs.SpiritHealing);

                        break;
                    }
                case 25:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.SuperMan);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Dash);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Shield);
                        break;
                    }
                case 45:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.Intensify);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Scatter);
                        Add(PhoenixProject.Game.Enums.SkillIDs.RapidFire);
                        Add(PhoenixProject.Game.Enums.SkillIDs.XPFly);
                        Add(PhoenixProject.Game.Enums.SkillIDs.AdvancedFly);
                        break;
                    }
                case 55:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.FatalStrike);
                        Add(PhoenixProject.Game.Enums.SkillIDs.ShurikenVortex);
                        Add(PhoenixProject.Game.Enums.SkillIDs.ToxicFog);
                        Add(PhoenixProject.Game.Enums.SkillIDs.TwofoldBlades);
                        break;
                    }
                case 65:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.RadiantPalm);
                        Add(PhoenixProject.Game.Enums.SkillIDs.WhirlWindKick);
                        Add(PhoenixProject.Game.Enums.SkillIDs.TripleAttack);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Oblivion);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Serenity);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Compassion);
                        Add(PhoenixProject.Game.Enums.SkillIDs.TyrantAura);
                        Add(PhoenixProject.Game.Enums.SkillIDs.TyrantAura);
                        Add(PhoenixProject.Game.Enums.SkillIDs.DeflectionAura);
                        break;
                    }
                case 75:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.RadiantPalm);
                        Add(PhoenixProject.Game.Enums.SkillIDs.WhirlWindKick);
                        Add(PhoenixProject.Game.Enums.SkillIDs.TripleAttack);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Oblivion);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Serenity);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Compassion);
                        Add(PhoenixProject.Game.Enums.SkillIDs.TyrantAura);
                        Add(PhoenixProject.Game.Enums.SkillIDs.TyrantAura);
                        Add(PhoenixProject.Game.Enums.SkillIDs.DeflectionAura);
                        break;
                    }
                case 135:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.Thunder);
                        Add(PhoenixProject.Game.Enums.SkillIDs.WaterElf);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Cure);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Lightning);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Volcano);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Pray);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Stigma);
                        Add(PhoenixProject.Game.Enums.SkillIDs.AdvancedCure);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Meditation);
                        break;
                    }
                case 140:
                    {
                        Add(PhoenixProject.Game.Enums.SkillIDs.Thunder);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Cure);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Lightning);
                        Add(PhoenixProject.Game.Enums.SkillIDs.Tornado);
                        Add(PhoenixProject.Game.Enums.SkillIDs.FireCircle);
                        Add(PhoenixProject.Game.Enums.SkillIDs.FireMeteor);
                        Add(PhoenixProject.Game.Enums.SkillIDs.FireRing);
                        break;
                    }

            }

            //PreviousClass = client.Entity.FirstRebornClass;
            //toClass = client.Entity.SecondRebornClass;
            Add(PhoenixProject.Game.Enums.SkillIDs.Bless);

            Interfaces.ISkill[] aADD_spells = this.Addskill.Values.ToArray();
            foreach (Interfaces.ISkill skill in aADD_spells)
            {
                skill.Available = true;
                if (!client.Spells.ContainsKey(skill.ID))
                    client.Spells.Add(skill.ID, skill);
            }
            #region Spells
            Interfaces.ISkill[] aspells = client.Spells.Values.ToArray();
            foreach (Interfaces.ISkill aspell in spells)
            {
                aspell.PreviousLevel = aspell.Level;
                aspell.Level = 0;
                aspell.Experience = 0;
                #region Pirate
                if (PreviousClass == 75)
                {
                    if (client.Entity.Class != 71)
                    {
                        switch (aspell.ID)
                        {
                            case 10490:
                            case 10415:
                            case 10381:
                                client.RemoveSpell(aspell);
                                break;
                        }
                    }
                }
                #endregion
                #region Monk
                if (PreviousClass == 65)
                {
                    if (client.Entity.Class != 61)
                    {
                        switch (aspell.ID)
                        {
                            case 10490:
                            case 10415:
                            case 10381:
                                client.RemoveSpell(aspell);
                                break;
                        }
                    }
                }
                #endregion
                #region Warrior
                if (PreviousClass == 25)
                {
                    if (client.Entity.Class != 21)
                    {
                        switch (aspell.ID)
                        {
                            case 1025:
                                if (client.Entity.Class != 21 && client.Entity.Class != 132)
                                    client.RemoveSpell(aspell);
                                break;
                        }
                    }
                }
                #endregion
                #region Ninja
                if (toClass != 51)
                {
                    switch (aspell.ID)
                    {
                        case 6010:
                        case 6000:
                        case 6011:
                            client.RemoveSpell(aspell);
                            break;
                    }
                }
                #endregion
                #region Trojan
                if (toClass != 11)
                {
                    switch (aspell.ID)
                    {
                        case 1115:
                            client.RemoveSpell(aspell);
                            break;
                    }
                }
                #endregion
                #region Archer
                if (toClass != 41)
                {
                    switch (aspell.ID)
                    {
                        case 8001:
                        case 8000:
                        case 8003:
                        case 9000:
                        case 8002:
                        case 8030:
                            client.RemoveSpell(aspell);
                            break;
                    }
                }
                #endregion
                #region WaterTaoist
                if (PreviousClass == 135)
                {
                    if (toClass != 132)
                    {
                        switch (aspell.ID)
                        {
                            case 1000:
                            case 1001:
                            case 1010:
                            case 1125:
                            case 1100:
                            case 8030:
                                client.RemoveSpell(aspell);
                                break;
                            case 1050:
                            case 1175:
                            case 1170:
                                if (toClass != 142)
                                    client.RemoveSpell(aspell);
                                break;
                        }
                    }
                }
                #endregion
                #region FireTaoist
                if (PreviousClass == 145)
                {
                    if (toClass != 142)
                    {
                        switch (aspell.ID)
                        {
                            case 1000:
                            case 1001:
                            case 1150:
                            case 1180:
                            case 1120:
                            case 1002:
                            case 1160:
                            case 1165:
                                client.RemoveSpell(aspell);
                                break;
                        }
                    }
                }
                #endregion
                if (client.Spells.ContainsKey(aspell.ID))
                    if (aspell.ID != (ushort)Game.Enums.SkillIDs.Reflect)
                        aspell.Send(client);
            }
            #endregion
            Addskill.Clear();
            Addskill = new SafeDictionary<ushort, PhoenixProject.Interfaces.ISkill>(20);
            #region Add Extra Skill
            if (client.Entity.FirstRebornClass == 15 && client.Entity.SecondRebornClass == 15 && client.Entity.Class == 11)
            {
                Add(PhoenixProject.Game.Enums.SkillIDs.DragonWhirl);
            }
            if (client.Entity.FirstRebornClass == 25 && client.Entity.SecondRebornClass == 25 && client.Entity.Class == 21)
            {
                Add(PhoenixProject.Game.Enums.SkillIDs.Perseverance);
            }
            if (client.Entity.FirstRebornClass == 45 && client.Entity.SecondRebornClass == 45 && client.Entity.Class == 41)
            {
                Add(PhoenixProject.Game.Enums.SkillIDs.StarArrow);
            }
            if (client.Entity.FirstRebornClass == 55 && client.Entity.SecondRebornClass == 55 && client.Entity.Class == 55)
            {
                Add(PhoenixProject.Game.Enums.SkillIDs.PoisonStar);
                Add(PhoenixProject.Game.Enums.SkillIDs.CounterKill);
            }
            if (client.Entity.FirstRebornClass == 65 && client.Entity.SecondRebornClass == 65 && client.Entity.Class == 61)
            {
                Add(PhoenixProject.Game.Enums.SkillIDs.SoulShackle);
            }
            if (client.Entity.FirstRebornClass == 135 && client.Entity.SecondRebornClass == 135 && client.Entity.Class == 132)
            {
                Add(PhoenixProject.Game.Enums.SkillIDs.AzureShield);
            }
            if (client.Entity.FirstRebornClass == 145 && client.Entity.SecondRebornClass == 145 && client.Entity.Class == 142)
            {
                Add(PhoenixProject.Game.Enums.SkillIDs.HeavenBlade);
            }
            #endregion
            Interfaces.ISkill[] aaADD_spells = this.Addskill.Values.ToArray();
            foreach (Interfaces.ISkill skill in aaADD_spells)
            {
                skill.Available = true;
                if (!client.Spells.ContainsKey(skill.ID))
                    client.Spells.Add(skill.ID, skill);
            }

            #region Proficiencies
            foreach (Interfaces.ISkill proficiency in client.Proficiencies.Values)
            {
                proficiency.PreviousLevel = proficiency.Level;
                proficiency.Level = 0;
                proficiency.Experience = 0;
                proficiency.Send(client);
            }
            #endregion
            Database.DataHolder.GetStats(client.Entity.Class, client.Entity.Level, client);
            client.CalculateStatBonus();
            client.CalculateHPBonus();
            client.GemAlgorithm();
            client.SendStatMessage();
            Network.PacketHandler.WorldMessage(client.Entity.Name + " has got Reincarnation! Congratulations!");
        }
            public Reincarnation(Client.GameState client, byte new_class)
            {
                if (client.Entity.Level < 120)
                    return;
                if (ServerBase.Kernel.ReincarnatedCharacters.ContainsKey(client.Entity.UID))
                    return;
                _client = client;
                Database.ReincarnationTable.NewReincarnated(client.Entity);
                Game.Features.Reincarnation.ReincarnateInfo info = new Game.Features.Reincarnation.ReincarnateInfo();
                info.UID = client.Entity.UID;
                info.Level = client.Entity.Level;
                info.Experience = client.Entity.Experience;
                ServerBase.Kernel.ReincarnatedCharacters.Add(info.UID, info);
                client.Entity.FirstRebornClass = client.Entity.SecondRebornClass;
                client.Entity.SecondRebornClass = client.Entity.Class;
                client.Entity.Class = new_class;
                client.Entity.SecondRebornLevel = client.Entity.Level;
                //client.Entity.ReincarnationLev = client.Entity.Level;//kikoz
                client.Entity.Level = 15;
                client.Entity.Experience = 0;
                client.Entity.Atributes =
                 (ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornClass, client.Entity.FirstRebornLevel) +
                  client.ExtraAtributePoints(client.Entity.SecondRebornClass, client.Entity.SecondRebornLevel) + 62);
                #region RemoveAllSpells
                Interfaces.ISkill[] spells = client.Spells.Values.ToArray();
                foreach (Interfaces.ISkill spell in spells)
                {
                    if (!ServerBase.Constants.AvaibleSpells.Contains(spell.ID))
                    {
                        client.RemoveSpell(spell);
                    }
                    //spell.Send(client);
                }
                #endregion
                #region Blessed
                if (client.Entity.Reborn == 2)
                {
                    if (client.Entity.Reborn == 2)
                    {

                        client.AddSpell(new Spell(true) { ID = 9876 });//Bless
                    }
                }
                #endregion

                #region SeconedClassTrojan
                if (client.Entity.SecondRebornClass == 15)
                {
                    if (client.Entity.SecondRebornClass == 15)
                    {
                        client.AddSpell(new Spell(true) { ID = 1190 });//SpiritHealing
                        client.AddSpell(new Spell(true) { ID = 1110 });//Cyclone
                        client.AddSpell(new Spell(true) { ID = 1270 });//Robot
                        client.AddSpell(new Spell(true) { ID = 1015 });//Accury
                    }
                }
                #endregion
                #region SeconedClassWarrior
                if (client.Entity.SecondRebornClass == 25)
                {
                    if (client.Entity.SecondRebornClass == 25)
                    {
                        client.AddSpell(new Spell(true) { ID = 1040 });//Raor
                        client.AddSpell(new Spell(true) { ID = 1051 });//Dash
                        client.AddSpell(new Spell(true) { ID = 1320 });//FlyingMoon
                        client.AddSpell(new Spell(true) { ID = 1025 });//Superman
                    }
                }
                #endregion
                #region SeconedClassArcher
                if (client.Entity.SecondRebornClass == 45)
                {
                    if (client.Entity.SecondRebornClass == 45)
                    {

                    }
                }
                #endregion
                #region SeconedClassNinja
                if (client.Entity.SecondRebornClass == 55)
                {
                    if (client.Entity.SecondRebornClass == 55)
                    {
                        client.AddSpell(new Spell(true) { ID = 6001 });//ToxicFog
                        client.AddSpell(new Spell(true) { ID = 6004 });//ArcherBane
                    }
                }
                #endregion
                #region SeconedClassMonk
                if (client.Entity.SecondRebornClass == 65)
                {
                    if (client.Entity.SecondRebornClass == 65)
                    {
                        client.AddSpell(new Spell(true) { ID = 10400 });//Serenity
                        client.AddSpell(new Spell(true) { ID = 10425 });//Tranquality
                    }
                }
                #endregion
                #region SeconedClassWater
                if (client.Entity.SecondRebornClass == 135)
                {
                    if (client.Entity.SecondRebornClass == 135)
                    {
                        client.AddSpell(new Spell(true) { ID = 1000 });//Thunder
                        client.AddSpell(new Spell(true) { ID = 1005 });//Cure
                        //client.AddSpell(new Spell(true) { ID = 1001 });//Fire
                        client.AddSpell(new Spell(true) { ID = 1195 });//Medation
                        client.AddSpell(new Spell(true) { ID = 1085 });//StarOfAccuracy
                        client.AddSpell(new Spell(true) { ID = 1090 });//MagicShield
                        client.AddSpell(new Spell(true) { ID = 1095 });//Stigma
                        client.AddSpell(new Spell(true) { ID = 1075 });//Invisibility
                        //client.AddSpell(new Spell(true) { ID = 1175 });//AdvancedCure
                        //client.AddSpell(new Spell(true) { ID = 1170 });//Nectar
                    }
                }
                #endregion
                #region SeconedClassFire
                if (client.Entity.SecondRebornClass == 145)
                {
                    if (client.Entity.SecondRebornClass == 145)
                    {
                        client.AddSpell(new Spell(true) { ID = 1005 });//Cure
                        //client.AddSpell(new Spell(true) { ID = 1001 });//Fire
                        client.AddSpell(new Spell(true) { ID = 1195 });//Medation
                    }
                }
                #endregion
                #region SeconedClassPirate
                if (client.Entity.SecondRebornClass == 75)
                {
                    if (client.Entity.SecondRebornClass == 75)
                    {
                        client.AddSpell(new Spell(true) { ID = 11070 });//ScurvyBomb
                    }
                }
                #endregion

                #region FirstClassTrojan
                if (client.Entity.FirstRebornClass == 15)
                {
                    if (client.Entity.FirstRebornClass == 15)
                    {
                        client.AddSpell(new Spell(true) { ID = 1190 });//SpiritHealing
                        client.AddSpell(new Spell(true) { ID = 1110 });//Cyclone
                        client.AddSpell(new Spell(true) { ID = 1270 });//Robot
                        client.AddSpell(new Spell(true) { ID = 1015 });//Accury
                    }
                }
                #endregion
                #region FirstClassWarrior
                if (client.Entity.FirstRebornClass == 25)
                {
                    if (client.Entity.FirstRebornClass == 25)
                    {
                        client.AddSpell(new Spell(true) { ID = 1040 });//Raor
                        client.AddSpell(new Spell(true) { ID = 1051 });//Dash
                        client.AddSpell(new Spell(true) { ID = 1320 });//FlyingMoon
                        client.AddSpell(new Spell(true) { ID = 1025 });//Superman
                    }
                }
                #endregion
                #region FirstClassArcher
                if (client.Entity.FirstRebornClass == 45)
                {
                    if (client.Entity.FirstRebornClass == 45)
                    {

                    }
                }
                #endregion
                #region FirstClassNinja
                if (client.Entity.FirstRebornClass == 55)
                {
                    if (client.Entity.FirstRebornClass == 55)
                    {
                        client.AddSpell(new Spell(true) { ID = 6001 });//ToxicFog
                        client.AddSpell(new Spell(true) { ID = 6004 });//ArcherBane
                    }
                }
                #endregion
                #region FirstClassMonk
                if (client.Entity.FirstRebornClass == 65)
                {
                    if (client.Entity.FirstRebornClass == 65)
                    {
                        client.AddSpell(new Spell(true) { ID = 10400 });//Serenity
                        client.AddSpell(new Spell(true) { ID = 10425 });//Tranquality
                    }
                }
                #endregion
                #region FirstClassWater
                if (client.Entity.FirstRebornClass == 135)
                {
                    if (client.Entity.FirstRebornClass == 135)
                    {
                        client.AddSpell(new Spell(true) { ID = 1000 });//Thunder
                        client.AddSpell(new Spell(true) { ID = 1005 });//Cure
                        //client.AddSpell(new Spell(true) { ID = 1001 });//Fire
                        client.AddSpell(new Spell(true) { ID = 1195 });//Medation
                        client.AddSpell(new Spell(true) { ID = 1085 });//StarOfAccuracy
                        client.AddSpell(new Spell(true) { ID = 1090 });//MagicShield
                        client.AddSpell(new Spell(true) { ID = 1095 });//Stigma
                        client.AddSpell(new Spell(true) { ID = 1075 });//Invisibility
                        //client.AddSpell(new Spell(true) { ID = 1175 });//AdvancedCure
                        //client.AddSpell(new Spell(true) { ID = 1170 });//Nectar
                    }
                }
                #endregion
                #region FirstClassFire
                if (client.Entity.FirstRebornClass == 145)
                {
                    if (client.Entity.FirstRebornClass == 145)
                    {
                        client.AddSpell(new Spell(true) { ID = 1005 });//Cure
                        //client.AddSpell(new Spell(true) { ID = 1001 });//Fire
                        client.AddSpell(new Spell(true) { ID = 1195 });//Medation
                    }
                }
                #endregion
                #region FirstClassPirate
                if (client.Entity.FirstRebornClass == 75)
                {
                    if (client.Entity.FirstRebornClass == 75)
                    {
                        client.AddSpell(new Spell(true) { ID = 11070 });//GaleBomb
                    }
                }
                #endregion

                #region AddPureTrojanSpell
                if (client.Entity.FirstRebornClass == 15 && client.Entity.SecondRebornClass == 15)
                {
                    if (client.Entity.Class == 11)
                    {
                        client.AddSpell(new Spell(true) { ID = 1190 });//SpiritHealing
                        client.AddSpell(new Spell(true) { ID = 1110 });//Cyclone
                        client.AddSpell(new Spell(true) { ID = 1115 });//Hercules
                        client.AddSpell(new Spell(true) { ID = 1015 });//Accury
                        //client.AddSpell(new Spell(true) { ID = 9876 });//Bless
                        //client.AddSpell(new Spell(true) { ID = 7001 });//Riding
                        client.AddSpell(new Spell(true) { ID = 10315 });//DragonWhirl
                        client.AddSpell(new Spell(true) { ID = 3050 });//CruelShade
                    }
                }
                #endregion
                #region AddPureWarSpell
                if (client.Entity.FirstRebornClass == 25 && client.Entity.SecondRebornClass == 25)
                {
                    if (client.Entity.Class == 21)
                    {
                        //client.AddSpell(new Spell(true) { ID = 7001 });//Riding
                        //client.AddSpell(new Spell(true) { ID = 9876 });//Bless
                        client.AddSpell(new Spell(true) { ID = 10311 });//Perseverance
                        client.AddSpell(new Spell(true) { ID = 7020 });//Rage
                        client.AddSpell(new Spell(true) { ID = 1051 });//Dash
                        client.AddSpell(new Spell(true) { ID = 1320 });//FlyingMoon
                        client.AddSpell(new Spell(true) { ID = 1040 });//Roar
                        client.AddSpell(new Spell(true) { ID = 1025 });//SuperMan
                        client.AddSpell(new Spell(true) { ID = 1020 });//Shield
                        client.AddSpell(new Spell(true) { ID = 3060 });//Reflect
                    }
                }
                #endregion
                #region AddPureArcherSpell
                if (client.Entity.FirstRebornClass == 45 && client.Entity.SecondRebornClass == 45)
                {
                    if (client.Entity.Class == 41)
                    {
                        //client.AddSpell(new Spell(true) { ID = 7001 });//Riding
                        //client.AddSpell(new Spell(true) { ID = 9876 });//Bless
                        client.AddSpell(new Spell(true) { ID = 10313 });//StarArrow
                        client.AddSpell(new Spell(true) { ID = 8030 });//ArrowRain
                        client.AddSpell(new Spell(true) { ID = 8002 });//XpFly
                        client.AddSpell(new Spell(true) { ID = 9000 });//INTE
                        client.AddSpell(new Spell(true) { ID = 8003 });//AdvanceFly
                        client.AddSpell(new Spell(true) { ID = 8000 });//RapidFire
                        client.AddSpell(new Spell(true) { ID = 8001 });//Scatter
                        //client.AddSpell(new Spell(true) { ID = 3060 });//Reflect
                    }
                }
                #endregion
                #region AddPureNinjaSpell
                if (client.Entity.FirstRebornClass == 55 && client.Entity.SecondRebornClass == 55)
                {
                    if (client.Entity.Class == 51)
                    {
                        //client.AddSpell(new Spell(true) { ID = 7001 });//Riding
                        //client.AddSpell(new Spell(true) { ID = 9876 });//Bless
                        client.AddSpell(new Spell(true) { ID = 6003 });//CounterKill
                        client.AddSpell(new Spell(true) { ID = 6000 });//TwoFold
                        client.AddSpell(new Spell(true) { ID = 6001 });//Toxic
                        client.AddSpell(new Spell(true) { ID = 6002 });//PoisnStar
                        client.AddSpell(new Spell(true) { ID = 6004 });//ArcherBane
                        client.AddSpell(new Spell(true) { ID = 6010 });//ShurikenVortex
                        client.AddSpell(new Spell(true) { ID = 6011 });//FatalStrike
                        //client.AddSpell(new Spell(true) { ID = 3060 });//Reflect
                    }
                }
                #endregion
                #region AddPureMonkSpell
                if (client.Entity.FirstRebornClass == 65 && client.Entity.SecondRebornClass == 65)
                {
                    if (client.Entity.Class == 61)
                    {
                        ////client.AddSpell(new Spell(true) { ID = 7001 });//Riding
                        //client.AddSpell(new Spell(true) { ID = 9876 });//Bless
                        client.AddSpell(new Spell(true) { ID = 10405 });//SoulShakle
                        client.AddSpell(new Spell(true) { ID = 10381 });//Radiant
                        client.AddSpell(new Spell(true) { ID = 10390 });//Oblivion
                        client.AddSpell(new Spell(true) { ID = 10400 });//Serinity
                        client.AddSpell(new Spell(true) { ID = 10415 });//Whirld
                        client.AddSpell(new Spell(true) { ID = 10425 });//Tranquilty
                        client.AddSpell(new Spell(true) { ID = 10490 });//TripleAttack
                        client.AddSpell(new Spell(true) { ID = 10430 });//Compassion
                    }
                }
                #endregion
                #region AddPureWaterSpell
                if (client.Entity.FirstRebornClass == 135 && client.Entity.SecondRebornClass == 135)
                {
                    if (client.Entity.Class == 132)
                    {
                        //client.AddSpell(new Spell(true) { ID = 7001 });//Riding
                        //client.AddSpell(new Spell(true) { ID = 9876 });//Bless
                        client.AddSpell(new Spell(true) { ID = 30000 });//AzureShield
                        client.AddSpell(new Spell(true) { ID = 1280 });//WaterElf
                        client.AddSpell(new Spell(true) { ID = 1050 });//XpReveve
                        client.AddSpell(new Spell(true) { ID = 1170 });//Nectar
                        client.AddSpell(new Spell(true) { ID = 1175 });//AdvancedCure
                        client.AddSpell(new Spell(true) { ID = 1100 });//Pray
                        client.AddSpell(new Spell(true) { ID = 1075 });//inv
                        client.AddSpell(new Spell(true) { ID = 1095 });//Stigma
                        client.AddSpell(new Spell(true) { ID = 1090 });//MagicShield
                        client.AddSpell(new Spell(true) { ID = 1085 });//Star
                        client.AddSpell(new Spell(true) { ID = 1055 });//HealingRain
                        client.AddSpell(new Spell(true) { ID = 1195 });//Mediation
                        client.AddSpell(new Spell(true) { ID = 1001 });//Fire
                        client.AddSpell(new Spell(true) { ID = 1000 });//Thunder
                        client.AddSpell(new Spell(true) { ID = 1005 });//Cure
                    }
                }
                #endregion
                #region AddPureFireSpell
                if (client.Entity.FirstRebornClass == 145 && client.Entity.SecondRebornClass == 145)
                {
                    if (client.Entity.Class == 142)
                    {
                        //client.AddSpell(new Spell(true) { ID = 7001 });//Riding
                        //client.AddSpell(new Spell(true) { ID = 9876 });//Bless
                        client.AddSpell(new Spell(true) { ID = 10310 });//HeavenBlade
                        client.AddSpell(new Spell(true) { ID = 3080 });//Dodge
                        client.AddSpell(new Spell(true) { ID = 1195 });//Mediation
                        client.AddSpell(new Spell(true) { ID = 1001 });//Fire
                        client.AddSpell(new Spell(true) { ID = 1000 });//Thunder
                        client.AddSpell(new Spell(true) { ID = 1005 });//Cure
                        client.AddSpell(new Spell(true) { ID = 1002 });//Tornado
                        client.AddSpell(new Spell(true) { ID = 1150 });//FireRing
                        client.AddSpell(new Spell(true) { ID = 1180 });//FireMeteor
                        client.AddSpell(new Spell(true) { ID = 1120 });//FireCircle
                        client.AddSpell(new Spell(true) { ID = 1160 });//Bomb
                        client.AddSpell(new Spell(true) { ID = 1165 });//FireOfHell
                        client.AddSpell(new Spell(true) { ID = 1125 });//Volcano
                    }
                }
                #endregion
                #region AddPurePirate
                if (client.Entity.FirstRebornClass == 75 && client.Entity.SecondRebornClass == 75)
                {
                    if (client.Entity.Class == 71)
                    {
                        client.AddSpell(new Spell(true) { ID = 11110 });//SpiritHealing
                        client.AddSpell(new Spell(true) { ID = 11040 });//Cyclone
                        client.AddSpell(new Spell(true) { ID = 11050 });//Hercules
                        client.AddSpell(new Spell(true) { ID = 11060 });//Accury
                        client.AddSpell(new Spell(true) { ID = 11070 });//Scatter
                        client.AddSpell(new Spell(true) { ID = 11100 });//SpiritHealing
                        client.AddSpell(new Spell(true) { ID = 11120 });//Cyclone
                        client.AddSpell(new Spell(true) { ID = 11130 });//Hercules//11140
                        client.AddSpell(new Spell(true) { ID = 11140 });//Hercules//11140
                    }
                }
                #endregion

                if (client.Entity.Reborn == 2)
                {
                    #region if water
                    if (client.Entity.Reborn == 2)
                    {
                        if (client.Entity.Class >= 132 && client.Entity.Class <= 135)
                        {
                            //client.AddSpell(new Spell(true) { ID = 30000 });//AzureShield
                            client.AddSpell(new Spell(true) { ID = 1280 });//WaterElf
                            client.AddSpell(new Spell(true) { ID = 1050 });//XpReveve
                            client.AddSpell(new Spell(true) { ID = 1170 });//Nectar
                            client.AddSpell(new Spell(true) { ID = 1175 });//AdvancedCure
                            client.AddSpell(new Spell(true) { ID = 1100 });//Pray
                            client.AddSpell(new Spell(true) { ID = 1075 });//inv
                            client.AddSpell(new Spell(true) { ID = 1095 });//Stigma
                            client.AddSpell(new Spell(true) { ID = 1090 });//MagicShield
                            client.AddSpell(new Spell(true) { ID = 1085 });//Star
                            client.AddSpell(new Spell(true) { ID = 1055 });//HealingRain
                            client.AddSpell(new Spell(true) { ID = 1195 });//Mediation
                            client.AddSpell(new Spell(true) { ID = 1001 });//Fire
                            client.AddSpell(new Spell(true) { ID = 1000 });//Thunder
                            client.AddSpell(new Spell(true) { ID = 1005 });//Cure
                            client.AddSpell(new Spell(true) { ID = 1350 });//DivenHere
                        }
                    }
                    #endregion
                    #region if Fire
                    if (client.Entity.Reborn == 2)
                    {
                        if (client.Entity.Class >= 142 && client.Entity.Class <= 145)
                        {
                            //client.AddSpell(new Spell(true) { ID = 3080 });//Dodge
                            client.AddSpell(new Spell(true) { ID = 1195 });//Mediation
                            client.AddSpell(new Spell(true) { ID = 1001 });//Fire
                            client.AddSpell(new Spell(true) { ID = 1000 });//Thunder
                            client.AddSpell(new Spell(true) { ID = 1005 });//Cure
                            client.AddSpell(new Spell(true) { ID = 1002 });//Tornado
                            client.AddSpell(new Spell(true) { ID = 1150 });//FireRing
                            client.AddSpell(new Spell(true) { ID = 1180 });//FireMeteor
                            client.AddSpell(new Spell(true) { ID = 1120 });//FireCircle
                            client.AddSpell(new Spell(true) { ID = 1160 });//Bomb
                            client.AddSpell(new Spell(true) { ID = 1165 });//FireOfHell
                            client.AddSpell(new Spell(true) { ID = 1125 });//Volcano
                        }
                    }
                    #endregion
                    #region if Monk
                    if (client.Entity.Reborn == 2)
                    {
                        if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                        {
                            client.AddSpell(new Spell(true) { ID = 10381 });//Radiant
                            client.AddSpell(new Spell(true) { ID = 10390 });//Oblivion
                            client.AddSpell(new Spell(true) { ID = 10400 });//Serinity
                            client.AddSpell(new Spell(true) { ID = 10415 });//Whirld
                            client.AddSpell(new Spell(true) { ID = 10425 });//Tranquilty
                            client.AddSpell(new Spell(true) { ID = 10490 });//TripleAttack
                            client.AddSpell(new Spell(true) { ID = 10430 });//Compassion

                            client.AddSpell(new Spell(true) { ID = 10420 });//Whirld
                            client.AddSpell(new Spell(true) { ID = 10421 });//Tranquilty
                            client.AddSpell(new Spell(true) { ID = 10422 });//TripleAttack
                            client.AddSpell(new Spell(true) { ID = 10423 });//Compassion
                            client.AddSpell(new Spell(true) { ID = 10424 });//Compassion

                            client.AddSpell(new Spell(true) { ID = 10410 });//Compassion
                            client.AddSpell(new Spell(true) { ID = 10395 });//Compassion
                        }
                    }
                    #endregion
                    #region if Ninja
                    if (client.Entity.Reborn == 2)
                    {
                        if (client.Entity.Class >= 50 && client.Entity.Class <= 55)
                        {
                            client.AddSpell(new Spell(true) { ID = 6000 });//TwoFold
                            client.AddSpell(new Spell(true) { ID = 6001 });//Toxic
                            //client.AddSpell(new Spell(true) { ID = 6002 });//PoisnStar
                            client.AddSpell(new Spell(true) { ID = 6004 });//ArcherBane
                            client.AddSpell(new Spell(true) { ID = 6010 });//ShurikenVortex
                            client.AddSpell(new Spell(true) { ID = 6011 });//FatalStrike
                        }
                    }
                    #endregion
                    #region if Warrior
                    if (client.Entity.Reborn == 2)
                    {
                        if (client.Entity.Class >= 20 && client.Entity.Class <= 21)
                        {
                            client.AddSpell(new Spell(true) { ID = 1051 });//Dash
                            client.AddSpell(new Spell(true) { ID = 1320 });//FlyingMoon
                            client.AddSpell(new Spell(true) { ID = 1040 });//Roar
                            client.AddSpell(new Spell(true) { ID = 1025 });//SuperMan
                            client.AddSpell(new Spell(true) { ID = 1020 });//Shield
                        }
                    }
                    #endregion
                    #region if Archer
                    if (client.Entity.Reborn == 2)
                    {
                        if (client.Entity.Class >= 40 && client.Entity.Class <= 45)
                        {
                            client.AddSpell(new Spell(true) { ID = 8030 });//ArrowRain
                            client.AddSpell(new Spell(true) { ID = 8002 });//XpFly
                            client.AddSpell(new Spell(true) { ID = 9000 });//INTE
                            client.AddSpell(new Spell(true) { ID = 8003 });//AdvanceFly
                            client.AddSpell(new Spell(true) { ID = 8000 });//RapidFire
                            client.AddSpell(new Spell(true) { ID = 8001 });//Scatter
                        }
                    }
                    #endregion
                    #region if Trojan
                    if (client.Entity.Reborn == 2)
                    {
                        if (client.Entity.Class >= 10 && client.Entity.Class <= 15)
                        {
                            client.AddSpell(new Spell(true) { ID = 1190 });//SpiritHealing
                            client.AddSpell(new Spell(true) { ID = 1110 });//Cyclone
                            client.AddSpell(new Spell(true) { ID = 1115 });//Hercules
                            client.AddSpell(new Spell(true) { ID = 1015 });//Accury
                            client.AddSpell(new Spell(true) { ID = 1270 });//Scatter
                        }
                    }
                    #endregion
                    #region if Pirate
                    if (client.Entity.Reborn == 2)
                    {
                        if (client.Entity.Class >= 70 && client.Entity.Class <= 75)
                        {
                            client.AddSpell(new Spell(true) { ID = 11110 });//SpiritHealing
                            // client.AddSpell(new Spell(true) { ID = 11040 });//Cyclone
                            client.AddSpell(new Spell(true) { ID = 11050 });//Hercules
                            client.AddSpell(new Spell(true) { ID = 11060 });//Accury
                            client.AddSpell(new Spell(true) { ID = 11070 });//Scatter
                            //client.AddSpell(new Spell(true) { ID = 11100 });//SpiritHealing
                            client.AddSpell(new Spell(true) { ID = 11120 });//Cyclone
                            client.AddSpell(new Spell(true) { ID = 11130 });//Hercules//11140
                            client.AddSpell(new Spell(true) { ID = 11140 });//Hercules//11140
                            //client.AddSpell(new Spell(true) { ID = 11060 });//Accury
                            //client.AddSpell(new Spell(true) { ID = 11070 });//Scatter
                        }
                    }
                    #endregion
                }

                #region Adding earned skills
                if (client.Entity.SecondRebornClass == 15 && client.Entity.Class == 11)
                {
                    client.AddSpell(new Spell(true) { ID = 3050 });
                }
                if (client.Entity.SecondRebornClass == 75 && client.Entity.Class == 71)
                {
                    client.AddSpell(new Spell(true) { ID = 11100 });
                }
                if (client.Entity.Class == 51)
                {
                    client.AddSpell(new Spell(true) { ID = 11230 });
                }
                if (client.Entity.SecondRebornClass == 55 && client.Entity.Class == 51)
                {
                    client.AddSpell(new Spell(true) { ID = 6002 });
                }
                if (client.Entity.SecondRebornClass == 145 && client.Entity.Class == 142)
                {
                    client.AddSpell(new Spell(true) { ID = 3080 });
                }
                if (client.Entity.SecondRebornClass == 135 && client.Entity.Class == 132)
                {
                    client.AddSpell(new Spell(true) { ID = 3090 });
                }
                if (client.Entity.SecondRebornClass == 55 && client.Entity.FirstRebornClass == 55)
                {
                    client.AddSpell(new Spell(true) { ID = 6002 });
                }
                if (client.Entity.SecondRebornClass == 15 && client.Entity.FirstRebornClass == 15)
                {
                    client.AddSpell(new Spell(true) { ID = 3050 });
                }
                if (client.Entity.SecondRebornClass == 75 && client.Entity.FirstRebornClass == 75)
                {
                    client.AddSpell(new Spell(true) { ID = 11100 });
                }
                if (client.Entity.SecondRebornClass == 25)
                {
                    client.AddSpell(new Spell(true) { ID = 3060 });
                }
                if (client.Entity.SecondRebornClass == 145 && client.Entity.FirstRebornClass == 145)
                {
                    client.AddSpell(new Spell(true) { ID = 3080 });
                }
                if (client.Entity.SecondRebornClass == 135 && client.Entity.FirstRebornClass == 135)
                {
                    client.AddSpell(new Spell(true) { ID = 3090 });
                }
                #endregion

                #region Remove unallow skills skills
                if (client.Entity.Class == 11)
                {
                    client.RemoveSpell(new Spell(true) { ID = 1025 });
                    client.RemoveSpell(new Spell(true) { ID = 1020 });
                }
                if (client.Entity.Class == 71)
                {
                    client.RemoveSpell(new Spell(true) { ID = 1025 });
                    client.RemoveSpell(new Spell(true) { ID = 1020 });
                }
                if (client.Entity.Class == 41)
                {
                    client.RemoveSpell(new Spell(true) { ID = 1025 });

                }
                if (client.Entity.Class == 51)
                {
                    client.RemoveSpell(new Spell(true) { ID = 1025 });
                    client.RemoveSpell(new Spell(true) { ID = 1020 });
                }
                if (client.Entity.Class == 61)
                {
                    client.RemoveSpell(new Spell(true) { ID = 1025 });
                    client.RemoveSpell(new Spell(true) { ID = 1020 });
                }
                if (client.Entity.Class == 142)
                {
                    client.RemoveSpell(new Spell(true) { ID = 1025 });
                }
                if (client.Entity.Class == 142)
                {
                    client.RemoveSpell(new Spell(true) { ID = 6002 });
                }
                if (client.Entity.Class == 132)
                {
                    client.RemoveSpell(new Spell(true) { ID = 6002 });
                }
                #endregion

                #region Proficiencies
                foreach (Interfaces.ISkill proficiency in client.Proficiencies.Values)
                {
                    proficiency.PreviousLevel = proficiency.Level;
                    proficiency.Level = 0;
                    proficiency.Experience = 0;
                    proficiency.Send(client);
                }
                #endregion
                #region Low level items
                for (byte i = 1; i < 9; i++)
                {
                    if (i != 7)
                    {
                        Interfaces.IConquerItem item = client.Equipment.TryGetItem(i);
                        if (item != null && item.ID != 0)
                        {
                            try
                            {
                                //client.UnloadItemStats(item, false);
                                Database.ConquerItemInformation cii = new PhoenixProject.Database.ConquerItemInformation(item.ID, item.Plus);
                                item.ID = cii.LowestID(Network.PacketHandler.ItemMinLevel(Network.PacketHandler.ItemPosition(item.ID)));
                                item.Mode = PhoenixProject.Game.Enums.ItemMode.Update;
                                item.Send(client);
                                client.LoadItemStats(client.Entity);
                                client.CalculateStatBonus();
                                client.CalculateHPBonus();
                                Database.ConquerItemTable.UpdateItemID(item, client);
                            }
                            catch
                            {
                                Console.WriteLine("Reborn item problem: " + item.ID);
                            }
                        }
                    }
                }
                #region Alt Fix By Amjad
                Interfaces.IConquerItem AltRing = client.Equipment.TryGetItem(26);
                if (AltRing != null)
                {
                    client.Equipment.Remove(26);
                    client.CalculateStatBonus();
                    client.CalculateHPBonus();
                }
                else
                    client.SendScreen(client.Entity.SpawnPacket, false);
                Interfaces.IConquerItem AltRightHand = client.Equipment.TryGetItem(24);
                if (AltRightHand != null)
                {
                    client.Equipment.Remove(24);
                    client.CalculateStatBonus();
                    client.CalculateHPBonus();
                }
                else
                    client.SendScreen(client.Entity.SpawnPacket, false);
                Interfaces.IConquerItem AltNecklace = client.Equipment.TryGetItem(22);
                if (AltNecklace != null)
                {
                    client.Equipment.Remove(22);
                    client.CalculateStatBonus();
                    client.CalculateHPBonus();
                }
                else
                    client.SendScreen(client.Entity.SpawnPacket, false);
                Interfaces.IConquerItem AltHead = client.Equipment.TryGetItem(21);
                if (AltHead != null)
                {
                    client.Equipment.Remove(21);
                    client.CalculateStatBonus();
                    client.CalculateHPBonus();
                }
                else
                    client.SendScreen(client.Entity.SpawnPacket, false);
                Interfaces.IConquerItem AltLeftHand = client.Equipment.TryGetItem(25);
                if (AltLeftHand != null)
                {
                    client.Equipment.Remove(25);
                    client.CalculateStatBonus();
                    client.CalculateHPBonus();
                }
                else
                    client.SendScreen(client.Entity.SpawnPacket, false);
                Interfaces.IConquerItem AltBoots = client.Equipment.TryGetItem(28);
                if (AltBoots != null)
                {
                    client.Equipment.Remove(28);
                    client.CalculateStatBonus();
                    client.CalculateHPBonus();
                }
                else
                    client.SendScreen(client.Entity.SpawnPacket, false);
                Interfaces.IConquerItem AltArmor = client.Equipment.TryGetItem(23);
                if (AltArmor != null)
                {
                    client.Equipment.Remove(23);
                    client.CalculateStatBonus();
                    client.CalculateHPBonus();
                }
                else
                    client.SendScreen(client.Entity.SpawnPacket, false);

                #endregion
                Interfaces.IConquerItem hand = client.Equipment.TryGetItem(5);
                if (hand != null)
                {
                    client.Equipment.Remove(5);
                    client.CalculateStatBonus();
                    client.CalculateHPBonus();
                    client.SendStatMessage();
                }
                else
                    client.SendScreen(client.Entity.SpawnPacket, false);
                #endregion
                Database.DataHolder.GetStats(client.Entity.Class, client.Entity.Level, client);
                // client.loadi
                client.CalculateStatBonus();
                client.CalculateHPBonus();
                client.GemAlgorithm();
                client.SendStatMessage();
                client.Equipment.UpdateEntityPacket();
                //Database.ReincarnationTable.NewReincarnated(client.Entity);
                Network.PacketHandler.WorldMessage(client.Entity.Name + " has got Reincarnation! Congratulations!");
            }