Esempio n. 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;
        }
Esempio n. 2
0
        public static void CheckLevel(Mobile defender, BaseCreature attacker, int count)
        {
            bool   nolevel = false;
            Type   typ     = attacker.GetType();
            string nam     = attacker.Name;

            foreach (string check in FSATS.NoLevelCreatures)
            {
                if (check == nam)
                {
                    nolevel = true;
                }
            }

            if (nolevel != false)
            {
                return;
            }

            int expgainmin, expgainmax;

            if (attacker is BaseBioCreature || attacker is BioCreature || attacker is BioMount)
            {
            }
            else if (defender is BaseCreature)
            {
                if (attacker.Controlled == true && attacker.ControlMaster != null && attacker.Summoned == false)
                {
                    BaseCreature bc = (BaseCreature)defender;

                    expgainmin = bc.HitsMax * 25;
                    expgainmax = bc.HitsMax * 50;

                    int xpgain = Utility.RandomMinMax(expgainmin, expgainmax);

                    if (count > 1)
                    {
                        xpgain = xpgain / count;
                    }

                    if (attacker.Level <= attacker.MaxLevel - 1)
                    {
                        attacker.Exp += xpgain;
                        attacker.ControlMaster.SendMessage("Your pet has gained {0} experience points.", xpgain);
                    }

                    int nextLevel = attacker.NextLevel * attacker.Level;

                    if (attacker.Exp >= nextLevel && attacker.Level <= attacker.MaxLevel - 1)
                    {
                        DoLevelBonus(attacker);

                        Mobile cm = attacker.ControlMaster;
                        attacker.Level += 1;
                        attacker.Exp    = 0;
                        attacker.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
                        attacker.PlaySound(503);
                        cm.SendMessage(38, "Your pets level has increased to {0}.", attacker.Level);

                        int gain = Utility.RandomMinMax(10, 50);

                        attacker.AbilityPoints += gain;

                        if (attacker.ControlMaster != null)
                        {
                            attacker.ControlMaster.SendMessage(38, "Your pet {0} has gained some ability points.", gain);
                        }

                        if (attacker.Level == 9)
                        {
                            attacker.AllowMating = true;
                            cm.SendMessage(1161, "Your pet is now at the level to mate.");
                        }
                        if (attacker.Evolves == true)
                        {
                            if (attacker.UsesForm1 == true && attacker.F0 == true)
                            {
                                DoEvoCheck(attacker);

                                attacker.BodyValue   = attacker.Form1;
                                attacker.BaseSoundID = attacker.Sound1;
                                attacker.F1          = true;
                                attacker.F2          = false;
                                attacker.F3          = false;
                                attacker.F4          = false;
                                attacker.F5          = false;
                                attacker.F6          = false;
                                attacker.F7          = false;
                                attacker.F8          = false;
                                attacker.F9          = false;
                                attacker.UsesForm1   = false;
                                cm.SendMessage(64, "Your pet has evolved.");
                            }
                            else if (attacker.UsesForm2 == true && attacker.F1 == true)
                            {
                                DoEvoCheck(attacker);

                                attacker.BodyValue   = attacker.Form2;
                                attacker.BaseSoundID = attacker.Sound2;
                                attacker.F1          = false;
                                attacker.F2          = true;
                                attacker.F3          = false;
                                attacker.F4          = false;
                                attacker.F5          = false;
                                attacker.F6          = false;
                                attacker.F7          = false;
                                attacker.F8          = false;
                                attacker.F9          = false;
                                attacker.UsesForm2   = false;
                                cm.SendMessage(64, "Your pet has evolved.");
                            }
                            else if (attacker.UsesForm3 == true && attacker.F2 == true)
                            {
                                DoEvoCheck(attacker);

                                attacker.BodyValue   = attacker.Form3;
                                attacker.BaseSoundID = attacker.Sound3;
                                attacker.F1          = false;
                                attacker.F2          = false;
                                attacker.F3          = true;
                                attacker.F4          = false;
                                attacker.F5          = false;
                                attacker.F6          = false;
                                attacker.F7          = false;
                                attacker.F8          = false;
                                attacker.F9          = false;
                                attacker.UsesForm3   = false;
                                cm.SendMessage(64, "Your pet has evolved.");
                            }
                            else if (attacker.UsesForm4 == true && attacker.F3 == true)
                            {
                                DoEvoCheck(attacker);

                                attacker.BodyValue   = attacker.Form4;
                                attacker.BaseSoundID = attacker.Sound4;
                                attacker.F1          = false;
                                attacker.F2          = false;
                                attacker.F3          = false;
                                attacker.F4          = true;
                                attacker.F5          = false;
                                attacker.F6          = false;
                                attacker.F7          = false;
                                attacker.F8          = false;
                                attacker.F9          = false;
                                attacker.UsesForm4   = false;
                                cm.SendMessage(64, "Your pet has evolved.");
                            }
                            else if (attacker.UsesForm5 == true && attacker.F4 == true)
                            {
                                DoEvoCheck(attacker);

                                attacker.BodyValue   = attacker.Form5;
                                attacker.BaseSoundID = attacker.Sound5;
                                attacker.F1          = false;
                                attacker.F2          = false;
                                attacker.F3          = false;
                                attacker.F4          = false;
                                attacker.F5          = true;
                                attacker.F6          = false;
                                attacker.F7          = false;
                                attacker.F8          = false;
                                attacker.F9          = false;
                                attacker.UsesForm5   = false;
                                cm.SendMessage(64, "Your pet has evolved.");
                            }
                            else if (attacker.UsesForm6 == true && attacker.F5 == true)
                            {
                                DoEvoCheck(attacker);

                                attacker.BodyValue   = attacker.Form6;
                                attacker.BaseSoundID = attacker.Sound6;
                                attacker.F1          = false;
                                attacker.F2          = false;
                                attacker.F3          = false;
                                attacker.F4          = false;
                                attacker.F5          = false;
                                attacker.F6          = true;
                                attacker.F7          = false;
                                attacker.F8          = false;
                                attacker.F9          = false;
                                attacker.UsesForm6   = false;
                                cm.SendMessage(64, "Your pet has evolved.");
                            }
                            else if (attacker.UsesForm7 == true && attacker.F6 == true)
                            {
                                DoEvoCheck(attacker);

                                attacker.BodyValue   = attacker.Form7;
                                attacker.BaseSoundID = attacker.Sound7;
                                attacker.F1          = false;
                                attacker.F2          = false;
                                attacker.F3          = false;
                                attacker.F4          = false;
                                attacker.F5          = false;
                                attacker.F6          = false;
                                attacker.F7          = true;
                                attacker.F8          = false;
                                attacker.F9          = false;
                                attacker.UsesForm7   = false;
                                cm.SendMessage(64, "Your pet has evolved.");
                            }
                            else if (attacker.UsesForm8 == true && attacker.F7 == true)
                            {
                                DoEvoCheck(attacker);

                                attacker.BodyValue   = attacker.Form8;
                                attacker.BaseSoundID = attacker.Sound8;
                                attacker.F1          = false;
                                attacker.F2          = false;
                                attacker.F3          = false;
                                attacker.F4          = false;
                                attacker.F5          = false;
                                attacker.F6          = false;
                                attacker.F7          = false;
                                attacker.F8          = true;
                                attacker.F9          = false;
                                attacker.UsesForm8   = false;
                                cm.SendMessage(64, "Your pet has evolved.");
                            }
                            else if (attacker.UsesForm9 == true && attacker.F8 == true)
                            {
                                DoEvoCheck(attacker);

                                attacker.BodyValue   = attacker.Form9;
                                attacker.BaseSoundID = attacker.Sound9;
                                attacker.F1          = false;
                                attacker.F2          = false;
                                attacker.F3          = false;
                                attacker.F4          = false;
                                attacker.F5          = false;
                                attacker.F6          = false;
                                attacker.F7          = false;
                                attacker.F8          = false;
                                attacker.F9          = true;
                                attacker.UsesForm9   = false;
                                cm.SendMessage(64, "Your pet has evolved.");
                            }
                        }
                    }
                }
            }
        }