Beispiel #1
0
        /*
         #region Level System Taming
         *      XMLPetLevelAtt xmlpet = (XMLPetLevelAtt)XmlAttach.FindAttachment(this, typeof(XMLPetLevelAtt));
         *      Configured c = new Configured();
         *      ConfiguredPetXML cp = new ConfiguredPetXML();
         *      if (c.TamingGivesExp == true)
         *              LevelCore.Taming(tamer);
         #endregion
         */

        public static void Harvest(Mobile m, Item i, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource)
        {
            Configured c = new Configured();
            //LevelCore.Harvest(tool , from, new Configured());
            XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt));
            PlayerMobile      pm        = m as PlayerMobile;
            LevelHandler      lh        = new LevelHandler();

            if (xmlplayer == null)
            {
                return;
            }
            else
            {
                if (xmlplayer.Expp < xmlplayer.ToLevell)
                {
                    int xp   = (int)Math.Round(2 + (LevelCore.HarvestExp(m, i, def, map, loc, resource)));
                    int give = LevelHandler.ExpFilter(pm, xp, null, true);

                    if (give > 0)
                    {
                        pm.SendMessage("You gained {0} experience for harvesting some Resources.", give);
                        xmlplayer.kxp += (int)give;

                        if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                        {
                            LevelHandler.DoLevel(pm, new Configured());
                        }
                    }
                }
            }
        }
Beispiel #2
0
        public static int Skills(Mobile m)
        {
            Configured c = new Configured();

            if ((Cl.Enabled) || (En.Enabled))
            {
                if (c.AdvancedSkillExp)
                {
                    if (Core.AOS)
                    {
                        return((int)9.375 * AoS(m));
                    }
                    else if (Core.SE || Core.ML)
                    {
                        return((int)7.5 * SE(m));
                    }
                    else
                    {
                        return((int)6.25 * Pre(m));
                    }
                }
                else
                {
                    return((int)1.388 * m.Skills.Total);
                }
            }
            return(0);
        }
Beispiel #3
0
        public static string Display(Mobile m, Configured c)
        {
            XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt));
            PlayerMobile      pm        = m as PlayerMobile;

            if (xmlplayer == null)
            {
                return(null);
            }

            string dsp;

            if (pm.AccessLevel > AccessLevel.Player && !(c.StaffHasLevel))
            {
                dsp = "";
            }
            else
            {
                if (c.MaxLevel)
                {
                    dsp = "" + xmlplayer.Levell + "/" + xmlplayer.MaxLevel;
                }
                else
                {
                    dsp = "" + xmlplayer.Levell;
                }
            }

            return(dsp);
        }
Beispiel #4
0
        public static int CreatureLevel(Mobile m, Configured c)
        {
            BaseCreature bc = m as BaseCreature;

            int Lvl = ((bc.HitsMax + bc.RawStatTotal) / 40) + ((bc.DamageMax * bc.DamageMin) / 30);

            if (bc is BaseVendor && !(c.VendorLevels))
            {
                return(0);
            }
            else
            {
                if (Lvl < 1)
                {
                    return(1);
                }
                else if (IsParagon(bc))
                {
                    return(Lvl += Utility.RandomMinMax(3, 7));
                }
                else
                {
                    return(Lvl);
                }
            }
        }
        public static int ExpFilter(Mobile m, double o, Party p, bool craft)
        {
            XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt));
            PlayerMobile      pm        = null;
            Configured        c         = new Configured();

            double n;
            double New = 0;

            #region PartyExpShare
            if (p != null && c.PartyExpShare)
            {
                if (craft)
                {
                    return(0);
                }
                foreach (PartyMemberInfo mi in p.Members)
                {
                    pm = mi.Mobile as PlayerMobile;
                    XMLPlayerLevelAtt xmlplayerparty = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(pm, typeof(XMLPlayerLevelAtt));

                    if (xmlplayerparty != null)
                    {
                        if (xmlplayerparty.Expp + o > xmlplayerparty.ToLevell && xmlplayerparty.Levell >= xmlplayerparty.MaxLevel)
                        {
                            n   = (o + xmlplayerparty.Expp) - xmlplayerparty.ToLevell;
                            New = (o - n);
                        }
                        else
                        {
                            New = o;
                        }
                    }
                }
            }
            #endregion
            else
            {
                pm = m as PlayerMobile;

                if (xmlplayer.Expp + o > xmlplayer.ToLevell && xmlplayer.Levell >= xmlplayer.MaxLevel)
                {
                    n   = (o + xmlplayer.Expp) - xmlplayer.ToLevell;
                    New = (int)(o - n);
                }
                else
                {
                    New = o;
                }
            }

            return((int)New);
        }
Beispiel #6
0
        public static int PetLevelXML(Mobile m, Configured c)
        {
            BaseCreature   bc     = m as BaseCreature;
            XMLPetLevelAtt petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(bc, typeof(XMLPetLevelAtt));

            if (petxml == null)
            {
                return(0);
            }
            else
            {
                int Lvl = petxml.Levell;

                return(Lvl);
            }
        }
Beispiel #7
0
        public static void AddExp(Mobile m, Mobile k, Party p, Configured c)
        {
            BaseCreature     bc     = (BaseCreature)m;
            XMLPetLevelAtt   petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(bc, typeof(XMLPetLevelAtt));
            ConfiguredPetXML cp     = new ConfiguredPetXML();
            PlayerMobile     pm     = null;
            LevelHandlerPet  lh     = new LevelHandlerPet();
            Mobile           cm     = bc.ControlMaster;

            double orig = 0;  //Monster Xp
            double fig  = 0;  //Party Xp
            double give = 0;  //Xp To Give

            if (k != null)
            {
                orig = LevelCore.Base(k);
            }

            fig = orig;

            if (fig > 0)
            {
                give = LevelHandlerPet.ExpFilter(m, fig, p, false);
            }

            if (give > 0)
            {
                if (cp.NotifyOnPetExpGain == true)
                {
                    cm.SendMessage("{0} gained " + give + " exp for the kill!", bc.Name);
                }
                petxml.kxp += (int)give;

                if (petxml.Expp >= petxml.ToLevell && petxml.Levell < petxml.MaxLevel)
                {
                    DoLevel(bc, new Configured());
                }
            }
        }
Beispiel #8
0
        public static int ExpFilter(Mobile m, double o, Party p, bool craft)
        {
            BaseCreature     bc     = (BaseCreature)m;
            XMLPetLevelAtt   petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(bc, typeof(XMLPetLevelAtt));
            ConfiguredPetXML cp     = new ConfiguredPetXML();
            PlayerMobile     pm     = null;
            BaseCreature     bcc    = null;
            Configured       c      = new Configured();

            double n;
            double New = 0;

            if (p != null && c.PartyExpShare)
            {
            }
            else
            {
                bcc = m as BaseCreature;
                XMLPetLevelAtt petxml3 = (XMLPetLevelAtt)XmlAttach.FindAttachment(bcc, typeof(XMLPetLevelAtt));

                if (petxml3 == null)
                {
                    return(0);
                }

                if (petxml3.Expp + o > petxml3.ToLevell && petxml3.Levell >= petxml3.MaxLevel)
                {
                    n   = (o + petxml3.Expp) - petxml3.ToLevell;
                    New = (int)(o - n);
                }
                else
                {
                    New = o;
                }
            }

            return((int)New);
        }
Beispiel #9
0
        public static void Craft(Item i, int q, double ch, double e, Mobile m, Configured c)
        {
            XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt));
            PlayerMobile      pm        = m as PlayerMobile;
            LevelHandler      lh        = new LevelHandler();

            if (xmlplayer.Expp < xmlplayer.ToLevell)
            {
                int xp   = (int)Math.Round(3.6 + (LevelCore.CraftExp(i, q, ch, e, pm)));
                int give = LevelHandler.ExpFilter(pm, xp, null, true);

                if (give > 0)
                {
                    pm.SendMessage("You gained {0} experience for crafting an item.", give);
                    xmlplayer.kxp += (int)give;


                    if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                    {
                        LevelHandler.DoLevel(pm, new Configured());
                    }
                }
            }
        }
Beispiel #10
0
        public static int Base(Mobile kld)
        {
            Configured c = new Configured();

            double amnt;

            if (kld is BaseCreature)
            {
                BaseCreature bc = kld as BaseCreature;

                if (c.AdvancedExp)
                {
                    amnt = bc.HitsMax / 4;

                    #region Get Table Exp

                    foreach (Type creat in exp.NoExp)
                    {
                        if (creat == bc.GetType())
                        {
                            return(0);
                        }
                    }

                    foreach (Type creat in exp.ExtLowExp)
                    {
                        if (creat == bc.GetType())
                        {
                            return((int)(amnt + Utility.RandomMinMax(20, 40)));
                        }
                    }

                    foreach (Type creat in exp.VeryLowExp)
                    {
                        if (creat == bc.GetType())
                        {
                            return((int)(amnt + Utility.RandomMinMax(40, 60)));
                        }
                    }

                    foreach (Type creat in exp.LowExp)
                    {
                        if (creat == bc.GetType())
                        {
                            return((int)(amnt + Utility.RandomMinMax(60, 80)));
                        }
                    }

                    foreach (Type creat in exp.LowMedExp)
                    {
                        if (creat == bc.GetType())
                        {
                            return((int)(amnt + Utility.RandomMinMax(80, 95)));
                        }
                    }

                    foreach (Type creat in exp.MedExp)
                    {
                        if (creat == bc.GetType())
                        {
                            return((int)(amnt + Utility.RandomMinMax(95, 125)));
                        }
                    }

                    foreach (Type creat in exp.HighMedExp)
                    {
                        if (creat == bc.GetType())
                        {
                            return((int)(amnt + Utility.RandomMinMax(125, 145)));
                        }
                    }

                    foreach (Type creat in exp.HighExp)
                    {
                        if (creat == bc.GetType())
                        {
                            return((int)(amnt + Utility.RandomMinMax(145, 175)));
                        }
                    }

                    foreach (Type creat in exp.VeryHighExp)
                    {
                        if (creat == bc.GetType())
                        {
                            return((int)(amnt + Utility.RandomMinMax(175, 200)));
                        }
                    }

                    foreach (Type creat in exp.ExtHighExp)
                    {
                        if (creat == bc.GetType())
                        {
                            return((int)(amnt + Utility.RandomMinMax(200, 225)));
                        }
                    }

                    foreach (Type creat in exp.ExtHigh)
                    {
                        if (creat == bc.GetType())
                        {
                            return((int)(amnt + Utility.RandomMinMax(225, 400)));
                        }
                    }

                    #endregion
                }
                else
                {
                    amnt = bc.HitsMax + bc.RawStatTotal;

                    if (IsMageryCreature(bc))
                    {
                        amnt += 10;
                    }

                    if (IsFireBreathingCreature(bc))
                    {
                        amnt += 15;
                    }

                    if (kld is VampireBat || kld is VampireBatFamiliar)
                    {
                        amnt += 5;
                    }

                    amnt += GetPoisonLevel(bc) * 10;
                }
            }
            else
            {
                PlayerMobile pm = kld as PlayerMobile;

                amnt = ((pm.Str * pm.Hits) + (pm.Dex * pm.Stam)
                        + (pm.Int * pm.Mana)) / 5;

                if (pm.Skills.Total >= 100)
                {
                    amnt += pm.Skills.Total;
                }
                else
                {
                    amnt += 100;
                }
            }

            return((int)amnt / 10);
        }
Beispiel #11
0
        public static void DoLevel(Mobile klr, Configured c)
        {
            BaseCreature     bc     = (BaseCreature)klr;
            XMLPetLevelAtt   petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(bc, typeof(XMLPetLevelAtt));
            ConfiguredPetXML cs     = new ConfiguredPetXML();
            PlayerMobile     pm     = klr as PlayerMobile;
            LevelHandlerPet  lh     = new LevelHandlerPet();
            ConfiguredSkills css    = new ConfiguredSkills();
            Mobile           cm     = bc.ControlMaster;

            /* Still adding Skill Points for Future Development */

            if (petxml.Expp >= petxml.ToLevell)
            {
                petxml.Expp    = 0;
                petxml.kxp     = 0;
                petxml.Levell += 1;

                int totalStats = bc.RawDex + bc.RawInt + bc.RawStr;

                if (petxml.Levell <= 20)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 20);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below20;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below20Stat;
                    }
                }

                else if (petxml.Levell <= 40)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 40);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below40;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below40Stat;
                    }
                }
                else if (petxml.Levell <= 60)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 60);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below60;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below60Stat;
                    }
                }
                else if (petxml.Levell <= 70)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 80);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below70;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below70Stat;
                    }
                }
                else if (petxml.Levell <= 80)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 100);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below80;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below80Stat;
                    }
                }
                else if (petxml.Levell <= 90)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 120);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below90;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below90Stat;
                    }
                }
                else if (petxml.Levell <= 100)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 140);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below100;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below100Stat;
                    }
                }
                else if (petxml.Levell <= 110)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 140);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below110;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below110Stat;
                    }
                }
                else if (petxml.Levell <= 120)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 150);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below120;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below120Stat;
                    }
                }
                else if (petxml.Levell <= 130)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 150);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below130;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below130Stat;
                    }
                }
                else if (petxml.Levell <= 140)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 160);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below140;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below140Stat;
                    }
                }
                else if (petxml.Levell <= 150)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 180);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below150;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below150Stat;
                    }
                }
                else if (petxml.Levell <= 160)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 180);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below160;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below160Stat;
                    }
                }
                else if (petxml.Levell <= 170)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 190);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below170;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below170Stat;
                    }
                }
                else if (petxml.Levell <= 180)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 190);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below180;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below180Stat;
                    }
                }
                else if (petxml.Levell <= 190)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 190);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below190;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below190Stat;
                    }
                }
                else if (petxml.Levell <= 200)
                {
                    petxml.ToLevell = (int)(petxml.Levell * 200);
                    if (bc.SkillsTotal < cs.SkillsTotal)
                    {
                        petxml.SKPoints += cs.Below200;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        petxml.StatPoints += cs.Below200Stat;
                    }
                }
            }

            if (cs.RefreshOnLevel)
            {
                if (bc.Hits < bc.HitsMax)
                {
                    bc.Hits = bc.HitsMax;
                }

                if (bc.Mana < bc.ManaMax)
                {
                    bc.Mana = bc.ManaMax;
                }

                if (bc.Stam < bc.StamMax)
                {
                    bc.Stam = bc.StamMax;
                }
            }

            bc.PlaySound(0x20F);
            bc.FixedParticles(0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist);
            bc.FixedParticles(0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist);

            if (cs.NotifyOnPetlevelUp == true)
            {
                cm.SendMessage("Your Pet level has increased");
            }
            petxml.Expp = 0;
            petxml.kxp  = 0;
        }
Beispiel #12
0
        public static void Set(Mobile killer, Mobile killed)
        {
            if (killer is PlayerMobile || killed is PlayerMobile)
            {
                return;
            }

            ConfiguredPetXML cp     = new ConfiguredPetXML();
            BaseCreature     bc     = (BaseCreature)killer;
            XMLPetLevelAtt   petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(bc, typeof(XMLPetLevelAtt));
            BaseCreature     klr    = null;
            BaseCreature     klrr   = null;
            Party            pty    = null;
            Configured       c      = new Configured();
            LevelHandlerPet  lh     = new LevelHandlerPet();

            klr  = killer as BaseCreature;
            klrr = killed as BaseCreature;

            if (klr.Summoned == true || klr.Summoned == true)
            {
                return;
            }
            if (klrr.Summoned == true || klrr.Summoned == true)
            {
                return;
            }

            /* Suggestion: Have the below , when NULL, set to attach if system enabled
             *      then continue.   Pets without the attachment would then not have a level on them yet.
             *      No real reason to really indicate a pet is Level 1...  */

            if (petxml == null)
            {
                if (cp.EnabledLevelPets == true)
                {
                    XmlAttach.AttachTo(bc, new XMLPetLevelAtt());
                }

                else
                {
                    return;
                }
            }

            if (lh.MemberCount.Count > 0)
            {
                foreach (Mobile il in lh.MemberCount)
                {
                    lh.MemberCount.Remove(il);
                }
            }

            if (klr != null)
            {
                BaseCreature bcr = (BaseCreature)killer;
                pty = Party.Get(klr);
                if (bcr is BaseCreature)
                {
                }

                AddExp(klr, killed, pty, new Configured());
            }
        }
        public static void AddExp(Mobile m, Mobile k, Party p, Configured c)
        {
            XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt));
            ExpPowerHour      exppower  = (ExpPowerHour)XmlAttach.FindAttachment(m, typeof(ExpPowerHour));
            PlayerMobile      pm        = null;
            LevelHandler      lh        = new LevelHandler();

            int range = c.PartyRange;

            double orig = 0;    //Monster Xp
            double fig  = 0;    //Party Xp
            double give = 0;    //Xp To Give

            if (k != null)
            {
                orig = LevelCore.Base(k);
            }

            if (p != null && c.PartyExpShare)
            {
                if (c.PartySplitExp)
                {
                    foreach (PartyMemberInfo mi in p.Members)
                    {
                        pm = mi.Mobile as PlayerMobile;

                        if (pm.InRange(k, range) && lh.MemberCount.Count < 6)
                        {
                            lh.MemberCount.Add(pm);
                        }
                    }

                    if (lh.MemberCount.Count > 1)
                    {
                        fig = (orig / lh.MemberCount.Count);
                    }
                }
                else
                {
                    pm  = m as PlayerMobile;
                    fig = orig;
                }
            }
            else
            {
                pm  = m as PlayerMobile;
                fig = orig;
            }

            if (fig > 0)
            {
                give = LevelHandler.ExpFilter(pm, fig, p, false);
            }

            if (give > 0)
            {
                #region PartyExpShare
                if (p != null && c.PartyExpShare)
                {
                    foreach (PartyMemberInfo mi in p.Members)
                    {
                        pm = mi.Mobile as PlayerMobile;
                        if (pm.Alive && pm.InRange(k, range))
                        {
                            XMLPlayerLevelAtt xmlplayerparty = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(pm, typeof(XMLPlayerLevelAtt));
                            ExpPowerHour      exppowerparty  = (ExpPowerHour)XmlAttach.FindAttachment(pm, typeof(ExpPowerHour));
                            if (xmlplayerparty == null)
                            {
                                return;
                            }
                            else
                            {
                                if (exppowerparty != null)
                                {
                                    pm.SendMessage("You gained " + (give + c.ExpPowerAmount) + " boosted exp for the party kill!");
                                    xmlplayerparty.kxp += (int)give + c.ExpPowerAmount;
                                    if (pm.HasGump(typeof(ExpBar)))
                                    {
                                        pm.CloseGump(typeof(ExpBar));
                                        pm.SendGump(new ExpBar(pm));
                                    }
                                    if (xmlplayerparty.Expp >= xmlplayerparty.ToLevell && xmlplayerparty.Levell < xmlplayerparty.MaxLevel)
                                    {
                                        DoLevel(pm, new Configured());
                                    }
                                }
                                else
                                {
                                    pm.SendMessage("You gained " + give + " exp for the party kill!");
                                    xmlplayerparty.kxp += (int)give;
                                    if (pm.HasGump(typeof(ExpBar)))
                                    {
                                        pm.CloseGump(typeof(ExpBar));
                                        pm.SendGump(new ExpBar(pm));
                                    }
                                    if (xmlplayerparty.Expp >= xmlplayerparty.ToLevell && xmlplayerparty.Levell < xmlplayerparty.MaxLevel)
                                    {
                                        DoLevel(pm, new Configured());
                                    }
                                }
                            }
                        }
                    }
                }
                #endregion
                else
                {
                    if (exppower != null)
                    {
                        pm.SendMessage("You gained " + (give + c.ExpPowerAmount) + " boosted exp for the kill!");
                        xmlplayer.kxp += (int)give + c.ExpPowerAmount;
                    }
                    else
                    {
                        pm.SendMessage("You gained " + give + " exp for the kill!");
                        xmlplayer.kxp += (int)give;
                    }
                    if (pm.HasGump(typeof(ExpBar)))
                    {
                        pm.CloseGump(typeof(ExpBar));
                        pm.SendGump(new ExpBar(pm));
                    }

                    if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                    {
                        DoLevel(pm, new Configured());
                    }
                }
            }
        }
        public static bool DoGainSkillExp(Mobile from, Skill skill, SkillName skillname)
        {
            ConfiguredSkillsEXP css       = new ConfiguredSkillsEXP();
            Configured          c         = new Configured();
            XMLPlayerLevelAtt   xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt));

            if (xmlplayer == null)
            {
                return(false);
            }


            if (css.EnableEXPFromSkills == false)
            {
                return(false);
            }

            if (skill == from.Skills.Provocation && css.ProvocationGain)
            {
                int gain = (int)css.ProvocationGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Peacemaking && css.PeacemakingGain)
            {
                int gain = (int)css.PeacemakingGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Discordance && css.DiscordanceGain)
            {
                int gain = (int)css.DiscordanceGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Stealing && css.StealingGain)
            {
                int gain = (int)css.StealingGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.RemoveTrap && css.RemoveTrapGain)
            {
                int gain = (int)css.RemoveTrapGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Poisoning && css.PoisoningGain)
            {
                int gain = (int)css.PoisoningGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.DetectHidden && css.DetectHiddenGain)
            {
                int gain = (int)css.DetectHiddenGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Tracking && css.TrackingGain)
            {
                int gain = (int)css.TrackingGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Herding && css.HerdingGain)
            {
                int gain = (int)css.HerdingGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.AnimalTaming && css.AnimalTamingGain)
            {
                int gain = (int)css.AnimalTamingGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.AnimalLore && css.AnimalLoreGain)
            {
                int gain = (int)css.AnimalLoreGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.SpiritSpeak && css.SpiritSpeakGain)
            {
                int gain = (int)css.SpiritSpeakGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Meditation && css.MeditationGain)
            {
                int gain = (int)css.MeditationGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.EvalInt && css.EvalIntGain)
            {
                int gain = (int)css.EvalIntGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Imbuing && css.ImbuingGain)
            {
                int gain = (int)css.ImbuingGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Tinkering && css.TinkeringGain)
            {
                int gain = (int)css.TinkeringGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Tailoring && css.TailoringGain)
            {
                int gain = (int)css.TailoringGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Inscribe && css.InscribeGain)
            {
                int gain = (int)css.InscribeGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Cooking && css.CookingGain)
            {
                int gain = (int)css.CookingGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Carpentry && css.CarpentryGain)
            {
                int gain = (int)css.CarpentryGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Blacksmith && css.BlacksmithGain)
            {
                int gain = (int)css.BlacksmithGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Fletching && css.FletchingGain)
            {
                int gain = (int)css.FletchingGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Alchemy && css.AlchemyGain)
            {
                int gain = (int)css.AlchemyGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Anatomy && css.AnatomyGain)
            {
                int gain = (int)css.AnatomyGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.TasteID && css.TasteIDGain)
            {
                int gain = (int)css.TasteIDGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.ItemID && css.ItemIDGain)
            {
                int gain = (int)css.ItemIDGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Forensics && css.ForensicsGain)
            {
                int gain = (int)css.ForensicsGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Cartography && css.CartographyGain)
            {
                int gain = (int)css.CartographyGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Camping && css.CampingGain)
            {
                int gain = (int)css.CampingGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Begging && css.BeggingGain)
            {
                int gain = (int)css.BeggingGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.ArmsLore && css.ArmsLoreGain)
            {
                int gain = (int)css.ArmsLoreGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Fishing && css.FishingGain)
            {
                int gain = (int)css.FishingGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            if (skill == from.Skills.Hiding && css.HidingGain)
            {
                int gain = (int)css.HidingGainAmount;
                xmlplayer.kxp += gain;
                from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(from, new Configured());
                }
            }
            return(true);
        }
        public static void DoLevel(Mobile klr, Configured c)
        {
            XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(klr, typeof(XMLPlayerLevelAtt));
            PlayerMobile      pm        = klr as PlayerMobile;
            LevelHandler      lh        = new LevelHandler();
            ConfiguredSkills  cs        = new ConfiguredSkills();

            if (xmlplayer.Expp >= xmlplayer.ToLevell)
            {
                xmlplayer.Expp    = 0;
                xmlplayer.kxp     = 0;
                xmlplayer.Levell += 1;

                int totalStats = pm.RawDex + pm.RawInt + pm.RawStr;

                if (xmlplayer.Levell <= 20)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L2to20Multipier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below20;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below20Stat;
                    }
                }

                else if (xmlplayer.Levell <= 40)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L21to40Multiplier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below40;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below40Stat;
                    }
                }
                else if (xmlplayer.Levell <= 60)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L41to60Multiplier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below60;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below60Stat;
                    }
                }
                else if (xmlplayer.Levell <= 70)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L61to70Multiplier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below70;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below70Stat;
                    }
                }
                else if (xmlplayer.Levell <= 80)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L71to80Multiplier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below80;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below80Stat;
                    }
                }
                else if (xmlplayer.Levell <= 90)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L81to90Multipier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below90;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below90Stat;
                    }
                }
                else if (xmlplayer.Levell <= 100)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L91to100Multipier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below100;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below100Stat;
                    }
                }
                else if (xmlplayer.Levell <= 110)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L101to110Multiplier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below110;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below110Stat;
                    }
                }
                else if (xmlplayer.Levell <= 120)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L111to120Multiplier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below120;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below120Stat;
                    }
                }
                else if (xmlplayer.Levell <= 130)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L121to130Multiplier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below130;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below130Stat;
                    }
                }
                else if (xmlplayer.Levell <= 140)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L131to140Multiplier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below140;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below140Stat;
                    }
                }
                else if (xmlplayer.Levell <= 150)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L141to150Multiplier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below150;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below150Stat;
                    }
                }
                else if (xmlplayer.Levell <= 160)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L151to160Multiplier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below160;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below160Stat;
                    }
                }
                else if (xmlplayer.Levell <= 170)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L161to170Multiplier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below170;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below170Stat;
                    }
                }
                else if (xmlplayer.Levell <= 180)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L171to180Multiplier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below180;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below180Stat;
                    }
                }
                else if (xmlplayer.Levell <= 190)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L181to190Multiplier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below190;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below190Stat;
                    }
                }
                else if (xmlplayer.Levell <= 200)
                {
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * c.L191to200Multiplier);
                    if (pm.SkillsTotal < cs.SkillsTotal)
                    {
                        xmlplayer.SKPoints += cs.Below200;
                    }
                    if (totalStats < cs.MaxStatPoints)
                    {
                        xmlplayer.StatPoints += cs.Below200Stat;
                    }
                }

                if (xmlplayer.Levell >= c.WhatLevelToDelete)
                {
                    XMLNewPlayer xmlnewplayer = (XMLNewPlayer)XmlAttach.FindAttachment(klr, typeof(XMLNewPlayer));
                    if (xmlnewplayer != null)
                    {
                        xmlnewplayer.Delete();
                        XmlAttach.AttachTo(klr, new XMLNewPlayer());
                    }
                }

                if (cs.GainFollowerSlotOnLevel == true)
                {
                    if (xmlplayer.Levell == 20 && cs.GainOn20 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel20;
                    }
                    if (xmlplayer.Levell == 30 && cs.GainOn30 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel30;
                    }
                    if (xmlplayer.Levell == 40 && cs.GainOn40 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel40;
                    }
                    if (xmlplayer.Levell == 50 && cs.GainOn50 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel50;
                    }
                    if (xmlplayer.Levell == 60 && cs.GainOn60 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel60;
                    }
                    if (xmlplayer.Levell == 70 && cs.GainOn70 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel70;
                    }
                    if (xmlplayer.Levell == 80 && cs.GainOn80 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel80;
                    }
                    if (xmlplayer.Levell == 90 && cs.GainOn90 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel90;
                    }
                    if (xmlplayer.Levell == 100 && cs.GainOn100 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel100;
                    }
                    if (xmlplayer.Levell == 110 && cs.GainOn110 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel110;
                    }
                    if (xmlplayer.Levell == 120 && cs.GainOn120 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel120;
                    }
                    if (xmlplayer.Levell == 130 && cs.GainOn130 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel130;
                    }
                    if (xmlplayer.Levell == 140 && cs.GainOn140 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel140;
                    }
                    if (xmlplayer.Levell == 150 && cs.GainOn150 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel150;
                    }
                    if (xmlplayer.Levell == 160 && cs.GainOn160 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel160;
                    }
                    if (xmlplayer.Levell == 170 && cs.GainOn170 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel170;
                    }
                    if (xmlplayer.Levell == 180 && cs.GainOn180 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel180;
                    }
                    if (xmlplayer.Levell == 190 && cs.GainOn190 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel190;
                    }
                    if (xmlplayer.Levell == 200 && cs.GainOn200 == true)
                    {
                        klr.FollowersMax += cs.GainFollowerSlotOnLevel200;
                    }
                }
            }

            if (c.RefreshOnLevel)
            {
                if (pm.Hits < pm.HitsMax)
                {
                    pm.Hits = pm.HitsMax;
                }

                if (pm.Mana < pm.ManaMax)
                {
                    pm.Mana = pm.ManaMax;
                }

                if (pm.Stam < pm.StamMax)
                {
                    pm.Stam = pm.StamMax;
                }
            }

            pm.PlaySound(0x20F);
            pm.FixedParticles(0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist);
            pm.FixedParticles(0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist);
            pm.SendMessage("Your level has increased");
            xmlplayer.Expp = 0;
            xmlplayer.kxp  = 0;
            if (pm.HasGump(typeof(ExpBar)))
            {                   /* updates EXPBar */
                pm.CloseGump(typeof(ExpBar));
                pm.SendGump(new ExpBar(pm));
            }
        }
        public static void Set(Mobile killer, Mobile killed)
        {
            XMLPlayerLevelAtt xmlplayerklr = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(killer, typeof(XMLPlayerLevelAtt));
            PlayerMobile      klr          = null;
            Party             pty          = null;
            Configured        c            = new Configured();
            LevelHandler      lh           = new LevelHandler();
            ConfiguredPetXML  cp           = new ConfiguredPetXML();

            if (killer is BaseCreature)
            {
                BaseCreature bc       = killer as BaseCreature;
                BaseCreature bckilled = killed as BaseCreature;

                if (bc.Controlled && c.PetKillGivesExp)
                {
                    klr = bc.GetMaster() as PlayerMobile;
                }

                if (bc.Summoned && c.PetKillGivesExp)
                {
                    klr = bc.GetMaster() as PlayerMobile;
                }
            }
            else
            {
                if (killer is PlayerMobile) //double check ;)
                {
                    klr = killer as PlayerMobile;
                }
            }

            if (lh.MemberCount.Count > 0)
            {
                foreach (Mobile il in lh.MemberCount)
                {
                    lh.MemberCount.Remove(il);
                }
            }

            if (klr != null)
            {
                Mobile m = (Mobile)killer;
                pty = Party.Get(klr);
                if (m is PlayerMobile)
                {
                    XMLPlayerLevelAtt xmlplayerklr2 = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt));

                    if (xmlplayerklr2.Levell < 1)
                    {
                        xmlplayerklr2.Levell = 1;
                    }

                    if (xmlplayerklr2.ToLevell < 50)
                    {
                        xmlplayerklr2.ToLevell = 50;
                    }

                    if (!(xmlplayerklr2.MaxLevel == c.StartMaxLvl && xmlplayerklr2.MaxLevel > c.EndMaxLvl))
                    {
                        xmlplayerklr2.MaxLevel = c.StartMaxLvl;
                    }
                }

                AddExp(klr, killed, pty, new Configured());
            }
        }