Beispiel #1
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;
        }
        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));
            }
        }