Exemplo n.º 1
0
        public override void OnMovement(MovementEventArgs e)
        {
            base.OnMovement(e);
            ConfiguredPetXML cpd = new ConfiguredPetXML();

            if (cpd.LoseExpLevelOnDeath == true)
            {
                if (((BaseCreature)this.AttachedTo).Hits == 0 && PetDeathToggle == false)
                {
                    LevelHandlerPet.PetOnDeath(((BaseCreature)this.AttachedTo));
                    this.PetDeathToggle = true;
                }
                else
                {
                    if (((BaseCreature)this.AttachedTo).Hits > 0)
                    {
                        this.PetDeathToggle = false;
                    }
                }
            }
        }
        public override void OnKill(Mobile killed, Mobile killer)
        {
            ConfiguredPetXML cp = new ConfiguredPetXML();
            Configured       cc = new Configured();

            if (cc.ExpGainFromKill == true)
            {
                LevelHandler.Set(killer, killed);
            }

            if (killer is PlayerMobile)
            {
                PlayerMobile  master = (PlayerMobile)killer;
                List <Mobile> pets   = master.AllFollowers;
                if (pets.Count > 0)
                {
                    for (int i = 0; i < pets.Count; ++i)
                    {
                        Mobile pet = (Mobile)pets[i];

                        if (pet is IMount && ((IMount)pet).Rider != null)
                        {
                            if (cp.MountedPetsGainEXP == false)
                            {
                                return;
                            }
                        }

                        if (cp.EnabledLevelPets == true)
                        {
                            LevelHandlerPet.Set(pet, killed);
                        }
                    }
                }
            }
        }