Exemple #1
0
        public void EndStable(Mobile from, BaseCreature pet)
        {
            if (Deleted || !from.CheckAlive())
            {
                return;
            }

            if (!pet.Controlled || pet.ControlMaster != from)
            {
                from.SendMessage("That is not your pet!");
            }
            else if (pet.IsDeadPet)
            {
                from.SendMessage("That pet is dead and cannot be stabled!");
            }
            else if (pet.Summoned)
            {
                from.SendMessage("You can not stable summoned creatures");
            }
            else if (pet.Body.IsHuman)
            {
                from.SendMessage("That is not your pet!");
            }
            else if ((pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0))
            {
                from.SendMessage("You need to unload the pack animal before you can stable it!");
            }
            else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                from.SendMessage("Your pet seems to be busy at the moment, try again when its not!");
            }
            else if (from.Stabled.Count >= Server.Mobiles.AnimalTrainer.GetMaxStabled(from))
            {
                from.SendMessage("You have too many pets in the stables!");
            }
            else
            {
                Container bank = from.BankBox;

                if (bank != null && bank.ConsumeTotal(typeof(Gold), 30))
                {
                    pet.Language      = null;
                    pet.ControlTarget = null;
                    pet.ControlOrder  = OrderType.Stay;
                    pet.Internalize();

                    pet.SetControlMaster(null);
                    pet.SummonMaster = null;

                    pet.IsStabled = true;
                    from.Stabled.Add(pet);
                    from.SendMessage("Your pet is stabled. You may recover it by saying 'claim'. In one real world week,");
                    from.SendMessage("if your pet is not claimed by then, it will vanish if it is not claimed!");
                }
                else
                {
                    from.SendMessage("You lack The necessary bank funds to do this!");
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// This will stable the pet inside a player's stable and delete the statuette.
        /// This function will also clear the control slots needed for the new master to control the pet
        /// as they have been assigned at bid time
        /// </summary>
        /// <param name="m">The player claiming the pet</param>
        /// <returns>True if succesful, false if player can't add to stable</returns>
        public bool Stable(Mobile m)
        {
            if (m_Creature == null)
            {
                m.SendMessage(AuctionSystem.MessageHue, AuctionSystem.ST[144]);
                Delete();
                return(true);
            }

            if (m.Stabled.Count > AnimalTrainer.GetMaxStabled(m))
            {
                m.SendMessage(AuctionSystem.MessageHue, AuctionSystem.ST[178]);
                return(false);
            }

            m_Creature.ControlMaster = m;

            m_Creature.ControlTarget = null;
            m_Creature.ControlOrder  = OrderType.Stay;
            m_Creature.Internalize();

            m_Creature.SetControlMaster(null);
            m_Creature.SummonMaster = null;

            m_Creature.IsStabled = true;
            m.Stabled.Add(m_Creature);

            m_Creature = null;
            Delete();

            return(true);
        }
Exemple #3
0
        public void EndStable(Mobile from, BaseCreature pet)
        {
            if (this.Deleted || !from.CheckAlive())
            {
                return;
            }

            else if (!pet.Controlled || pet.ControlMaster != from)
            {
                from.SendLocalizedMessage(1042562); // You do not own that pet!
            }
            else if (pet.IsDeadPet)
            {
                from.SendLocalizedMessage(1049668); // Living pets only, please.
            }
            else if (pet.Summoned)
            {
                from.SendLocalizedMessage(502673); // I can not stable summoned creatures.
            }
            else if (pet.Body.IsHuman)
            {
                from.SendLocalizedMessage(502672); // HA HA HA! Sorry, I am not an inn.
            }
            else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                from.SendLocalizedMessage(1042564); // I'm sorry.  Your pet seems to be busy.
            }
            else if (from.Stabled.Count >= GetMaxStabled(from))
            {
                from.SendLocalizedMessage(1114325); // There is no more room in your chicken coop!
            }
            else
            {
                Container bank = from.FindBankNoCreate();

                if (bank != null && bank.ConsumeTotal(typeof(Gold), 30))
                {
                    pet.ControlTarget = null;
                    pet.ControlOrder  = OrderType.Stay;
                    pet.Internalize();

                    pet.SetControlMaster(null);
                    pet.SummonMaster = null;

                    pet.IsStabled = true;

                    if (Core.SE)
                    {
                        pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy
                    }
                    from.Stabled.Add(pet);

                    from.SendLocalizedMessage(502679); // Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!
                }
                else
                {
                    from.SendLocalizedMessage(502677); // But thou hast not the funds in thy bank account!
                }
            }
        }
Exemple #4
0
        private void ShrinkPet(BaseCreature pet)
        {
            m_Pet   = pet;
            m_Owner = pet.ControlMaster;

            if (ShrinkConfig.LootStatus == ShrinkConfig.BlessStatus.All ||
                (m_Pet.IsBonded && ShrinkConfig.LootStatus == ShrinkConfig.BlessStatus.BondedOnly))
            {
                LootType = LootType.Blessed;
            }
            else
            {
                LootType = LootType.Regular;
            }

            m_Pet.Internalize();
            m_Pet.SetControlMaster(null);
            m_Pet.ControlOrder = OrderType.Stay;
            m_Pet.SummonMaster = null;
            m_Pet.IsStabled    = true;

            if (pet is IEvoCreature)
            {
                ((IEvoCreature)m_Pet).OnShrink(this);
            }
        }
Exemple #5
0
 public static void StablePet(PlayerMobile owner, BaseCreature pet)
 {
     pet.Internalize();
     pet.IsStabled = true;
     owner.Stabled.Add(pet);
     owner.SendMessage(String.Format("{0} has been stabled.", pet.Name));
 }
        public void EndStable(Mobile from, BaseCreature pet)
        {
            if (Deleted || !from.CheckAlive() || !CanUse() || !CheckAccess(from))
            {
                return;
            }

            else if (!pet.Controlled || pet.ControlMaster != from)
            {
                from.SendLocalizedMessage(1042562);                 // You do not own that pet!
            }
            else if (pet.IsDeadPet)
            {
                from.SendLocalizedMessage(1049668);                 // Living pets only, please.
            }
            else if (pet.Summoned)
            {
                from.SendLocalizedMessage(502673);                 // I can not stable summoned creatures.
            }
            else if (pet.Body.IsHuman)
            {
                from.SendLocalizedMessage(502672);                 // HA HA HA! Sorry, I am not an inn.
            }
            else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                from.SendLocalizedMessage(1042564);                 // I'm sorry.  Your pet seems to be busy.
            }
            else if (GetCount() >= MaxStables)
            {
                from.SendLocalizedMessage(1114325);                 // There is no more room in your chicken coop!
            }
            else
            {
                pet.ControlTarget = null;
                pet.ControlOrder  = OrderType.Stay;
                pet.Internalize();

                pet.SetControlMaster(null);
                pet.SummonMaster = null;

                pet.IsStabled = true;

                if (Core.SE)
                {
                    pet.Loyalty = BaseCreature.MaxLoyalty;                     // Wonderfully happy
                }
                if (!m_Stored.ContainsKey(from))
                {
                    m_Stored.Add(from, new List <BaseCreature>());
                }

                if (!m_Stored[from].Contains(pet))
                {
                    m_Stored[from].Add(pet);
                }

                from.SendMessage("Your chicken has been stabled.");
            }
        }
        public void EndStable(Mobile from, BaseCreature pet)
        {
            if (Deleted || !from.CheckAlive())
            {
                return;
            }

            if (!pet.Controlled || pet.ControlMaster != from)
            {
                from.SendMessage("You do not own that pet!");
            }
            else if (pet.IsDeadPet)
            {
                from.SendMessage("Living pets only, please!");
            }
            else if (pet.Summoned)
            {
                from.SendMessage("You can not stable summoned creatures");
            }
            else if (pet.Body.IsHuman)
            {
                from.SendMessage("You do not own that pet!");
            }
            else if ((pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0))
            {
                from.SendMessage("You need to unload the Pack Animal Befor You Can Stable It!");
            }
            else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                from.SendMessage(" Your pet seems to be busy at the moment, try agen when its not!");
            }
            else if (from.Stabled.Count >= GetMaxStabled(from))
            {
                from.SendMessage(" You have too many pets in the stables!");
            }
            else
            {
                Container bank = from.BankBox;

                if (bank != null && bank.ConsumeTotal(typeof(Gold), 30))
                {
                    pet.ControlTarget = null;
                    pet.ControlOrder  = OrderType.Stay;
                    pet.Internalize();

                    pet.SetControlMaster(null);
                    pet.SummonMaster = null;

                    pet.IsStabled = true;
                    from.Stabled.Add(pet);
                    from.SendMessage("thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week,");
                    from.SendMessage("if your pet is not claimed by then, I shall sell it off if it is not claimed!");
                }
                else
                {
                    from.SendMessage("You Lack The nessasary bank funds to do this");
                }
            }
        }
Exemple #8
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            if (info.ButtonID == 0)
            {
                return;
            }

            if (info.ButtonID == 500)            // MAIN MENU
            {
                from.SendGump(new PetBrokerGump(m_Broker, from));
                return;
            }
            else if (info.ButtonID == 501) // REMOVE PET
            {
                if (m_Index >= 0 && m_Index < m_Broker.BrokerEntries.Count)
                {
                    PetBrokerEntry entry = m_Broker.BrokerEntries[m_Index];

                    if (from.Stabled.Count >= AnimalTrainer.GetMaxStabled(from) || entry.Pet == null)
                    {
                        from.SendLocalizedMessage(1150634); // Failed to transfer the selected pet to your stables. Either the pet is no longer in the broker's inventory, or you do not have any available stable slots.
                    }
                    else
                    {
                        BaseCreature bc = entry.Pet;
                        m_Broker.RemoveEntry(entry);

                        PetBroker.EndViewTimer(bc);
                        bc.ControlTarget = null;
                        bc.ControlOrder  = OrderType.Stay;
                        bc.Internalize();
                        bc.SetControlMaster(null);
                        bc.SummonMaster = null;
                        bc.IsStabled    = true;
                        bc.Loyalty      = BaseCreature.MaxLoyalty;
                        from.Stabled.Add(bc);

                        from.SendLocalizedMessage(1150635, String.Format("{0}\t{1}", entry.TypeName, bc.Name)); // Your pet ~1_TYPE~ named ~2_NAME~ has been transferred to the stables.
                        from.SendGump(new PetBrokerGump(m_Broker, from));
                        return;
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1150341); // You did not select a pet.
                }
                from.SendGump(new RemovePetsGump(m_Broker, from, m_Index));
            }
            else
            {
                from.SendGump(new RemovePetsGump(m_Broker, from, info.ButtonID - 1));
            }
        }
            protected override void OnTarget(Mobile from, object o)
            {
                if (o is Item)
                {
                    from.SendMessage("That cannot be shrunken.");
                }

                else if (o is PlayerMobile)
                {
                    from.SendMessage("That cannot be shrunken.");
                }

                else if (o is BaseEscortable)
                {
                    from.SendMessage("You can't shrink me.");
                }

                /*else if ( o is RoninsBaseCreature && ( (RoninsBaseCreature)o).Pregnant == true )
                 *  from.SendMessage( 53, "Warning! Shrinking a pet while pregnant could cause a server crash." );
                 *
                 * else if ( o is RoninsBaseCreature && ( (RoninsBaseCreature)o).IsMating == true )
                 *  from.SendMessage( 53, "Warning! Shrinking a pet while mating could cause a server crash." );*/

                else if (o is BaseCreature)
                {
                    BaseCreature c    = (BaseCreature)o;
                    Type         type = c.GetType();
                    ShrinkItem   si   = new ShrinkItem();
                    si.MobType  = type;
                    si.Pet      = c;
                    si.PetOwner = from;

                    if (c is BaseMount)
                    {
                        BaseMount mount = (BaseMount)c;
                        si.MountID = mount.ItemID;
                    }
                    from.AddToBackpack(si);

                    c.Controlled    = true;
                    c.ControlMaster = null;
                    c.Internalize();

                    c.OwnerAbandonTime = DateTime.MinValue;

                    c.IsStabled = true;
                }
                else
                {
                    from.SendMessage("You cannot shrink that, MOBILES ONLY");
                }
            }
Exemple #10
0
            private void StablePets(Mobile from, PlayerMobile master)
            {
                ArrayList pets = new ArrayList();

                foreach (Mobile m in World.Mobiles.Values)
                {
                    if (m is BaseCreature && (m as BaseCreature).IOBFollower == false)
                    {
                        BaseCreature bc = (BaseCreature)m;

                        if (bc.Controlled && bc.ControlMaster == master)
                        {
                            pets.Add(bc);
                        }
                    }
                }

                if (pets.Count > 0)
                {
                    for (int i = 0; i < pets.Count; ++i)
                    {
                        BaseCreature pet = pets[i] as BaseCreature;

                        if ((pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0))
                        {
                            continue;                             // You need to unload your pet.
                        }
                        if (master.Stabled.Count >= BaseCreature.GetMaxStabled(master))
                        {
                            continue;                             // You have too many pets in the stables!
                        }

                        if (pet is IMount)
                        {
                            ((IMount)pet).Rider = null;                             // make sure it's dismounted
                        }
                        pet.ControlTarget = null;
                        pet.ControlOrder  = OrderType.Stay;
                        pet.Internalize();

                        pet.SetControlMaster(null);
                        pet.SummonMaster = null;

                        pet.IsStabled = true;
                        master.Stabled.Add(pet);
                    }

                    from.SendMessage("{0} pets have been stabled", pets.Count);
                }
            }
Exemple #11
0
        public static void SendToStables(Mobile to, BaseCreature pet)
        {
            EndViewTimer(pet);

            pet.Blessed       = false;
            pet.ControlTarget = null;
            pet.ControlOrder  = OrderType.Stay;
            pet.Internalize();
            pet.SetControlMaster(null);
            pet.SummonMaster = null;
            pet.IsStabled    = true;
            pet.Loyalty      = BaseCreature.MaxLoyalty;
            to.Stabled.Add(pet);
        }
Exemple #12
0
        public bool TryBuyPet(Mobile from, PetBrokerEntry entry)
        {
            if (from == null || entry == null || entry.Pet == null)
            {
                return(false);
            }

            int          cost     = entry.SalePrice;
            int          toDeduct = cost + (int)((double)cost * ((double)ComissionFee / 100.0));
            BaseCreature pet      = entry.Pet;

            if (!m_BrokerEntries.Contains(entry) || entry.Pet == null || entry.Pet.Deleted)
            {
                from.SendLocalizedMessage(1150377);                 // Unable to complete the desired transaction at this time.
            }
            else if (pet.GetControlChance(from) <= 0.0)
            {
                from.SendLocalizedMessage(1150379);                 // Unable to transfer that pet to you because you have no chance at all of controlling it.
            }
            else if (from.Stabled.Count >= AnimalTrainer.GetMaxStabled(from) /*from.Followers + pet.ControlSlots >= from.FollowersMax*/)
            {
                from.SendLocalizedMessage(1150376);                 // You do not have any available stable slots. The Animal Broker can only transfer pets to your stables. Please make a stables slot available and try again.
            }
            else if (!Banker.Withdraw(from, toDeduct, true))
            {
                from.SendLocalizedMessage(1150252);                 // You do not have the funds needed to make this trade available in your bank box. Brokers are only able to transfer funds from your bank box. Please deposit the necessary funds into your bank box and try again.
            }
            else
            {
                BankBalance += cost;
                pet.Blessed  = false;
                EndViewTimer(pet);
                pet.ControlTarget = null;
                pet.ControlOrder  = OrderType.Stay;
                pet.Internalize();
                pet.SetControlMaster(null);
                pet.SummonMaster = null;
                pet.IsStabled    = true;
                pet.Loyalty      = BaseCreature.MaxLoyalty;
                from.Stabled.Add(pet);

                from.SendLocalizedMessage(1150380, String.Format("{0}\t{1}", entry.TypeName, pet.Name)); // You have purchased ~1_TYPE~ named "~2_NAME~". The animal is now in the stables and you may retrieve it there.
                m_BrokerEntries.Remove(entry);
                return(true);
            }

            return(false);
        }
		/// <summary>
		/// Creates a new MobileStatuette object - for internal use only
		/// </summary>
		private MobileStatuette( BaseCreature creature )
		{
			m_Creature = creature;
			ItemID = ShrinkTable.Lookup( m_Creature );
			Hue = m_Creature.Hue;

			m_Creature.ControlTarget = null;
			m_Creature.ControlOrder = OrderType.Stay;
			m_Creature.Internalize();
			m_Creature.SetControlMaster( null );
			m_Creature.SummonMaster = null;
			m_Creature.IsStabled = true;

			// Set the type of the creature as the name for this item
			Name = Xanthos.Utilities.Misc.GetFriendlyClassName( creature.GetType().Name );
		}
Exemple #14
0
		/// <summary>
		/// Creates a new MobileStatuette object - for internal use only
		/// </summary>
		private MobileStatuette( BaseCreature creature )
		{
			m_Creature = creature;
			ItemID = ShrinkTable.Lookup( m_Creature );
			Hue = m_Creature.Hue;

			m_Creature.ControlTarget = null;
			m_Creature.ControlOrder = OrderType.Stay;
			m_Creature.Internalize();
			m_Creature.SetControlMaster( null );
			m_Creature.SummonMaster = null;
			m_Creature.IsStabled = true;

			// Set the type of the creature as the name for this item
			Name = InsertSpaces( creature.GetType().Name );
		}
Exemple #15
0
        /// <summary>
        /// Creates a new MobileStatuette object - for internal use only
        /// </summary>
        private MobileStatuette(BaseCreature creature)
        {
            m_Creature = creature;
            ItemID     = ShrinkTable.Lookup(m_Creature);
            Hue        = m_Creature.Hue;

            m_Creature.ControlTarget = null;
            m_Creature.ControlOrder  = OrderType.Stay;
            m_Creature.Internalize();
            m_Creature.SetControlMaster(null);
            m_Creature.SummonMaster = null;
            m_Creature.IsStabled    = true;

            // Set the type of the creature as the name for this item
            Name = Xanthos.Utilities.Misc.GetFriendlyClassName(creature.GetType().Name);
        }
Exemple #16
0
        /// <summary>
        /// Creates a new MobileStatuette object - for internal use only
        /// </summary>
        private MobileStatuette(BaseCreature creature)
        {
            m_Creature = creature;
            ItemID     = ShrinkTable.Lookup(m_Creature);
            Hue        = m_Creature.Hue;

            m_Creature.ControlTarget = null;
            m_Creature.ControlOrder  = OrderType.Stay;
            m_Creature.Internalize();
            m_Creature.SetControlMaster(null);
            m_Creature.SummonMaster = null;
            m_Creature.IsStabled    = true;

            // Set the type of the creature as the name for this item
            Name = InsertSpaces(creature.GetType().Name);
        }
 public MiniaturePet( int itemid, BaseCreature creature, Mobile owner )
     : base(itemid)
 {
     m_Creature = creature;
     creature.IsStabled = true;
     creature.ControlTarget = null;
     creature.ControlOrder = OrderType.Stay;
     creature.StabledOwner = owner;
     creature.Internalize();
     creature.SetControlMaster( null );
     creature.SummonMaster = null;
     creature.Loyalty = BaseCreature.MaxLoyalty;
     Weight = 10;
     Name = creature.Name;
     Movable = false;
 }
Exemple #18
0
        public static void StablePet(PlayerMobile player, BaseCreature pet)
        {
            if (null == player || null == pet)
            {
                return;
            }

            pet.Internalize();
            pet.ControlTarget = null;
            pet.ControlOrder  = OrderType.Stay;
            pet.SetControlMaster(null);
            pet.SummonMaster = null;
            pet.IsStabled    = true;
            player.Stabled.Add(pet);
            player.SendMessage("Your pet has been stabled");
        }
Exemple #19
0
        public void TryAutoStable(BaseCreature pet)
        {
            if (pet == null)
            {
                return;
            }

            Mobile owner = pet.GetMaster();

            if (!pet.Controlled || owner == null)
            {
                return;
            }
            if (pet.Body.IsHuman || pet.IsDeadPet || pet.Allured)
            {
                SendToStables(pet, owner);
            }
            else if (owner.Stabled.Count >= AnimalTrainer.GetMaxStabled(owner))
            {
                SendToStables(pet, owner);
            }
            else if ((pet is PackLlama || pet is PackHorse || pet is Beetle) &&
                     (pet.Backpack != null && pet.Backpack.Items.Count > 0))
            {
                SendToStables(pet, owner);
            }
            else
            {
                pet.ControlTarget = null;
                pet.ControlOrder  = OrderType.Stay;
                pet.Internalize();

                pet.SetControlMaster(null);
                pet.SummonMaster = null;

                pet.IsStabled = true;
                pet.StabledBy = owner;

                if (Core.SE)
                {
                    pet.Loyalty = AnimalTrainer.MaxLoyalty; // Wonderfully happy
                }

                owner.Stabled.Add(pet);
                owner.SendLocalizedMessage(1153050, pet.Name); // Pets are not permitted in this location. Your pet named ~1_NAME~ has been sent to the stables.
            }
        }
Exemple #20
0
        public static void StablePet(Mobile from, BaseCreature pet)
        {
            if (pet == null || pet.Deleted || from == null || from.Deleted)
            {
                return;
            }

            if (pet.ControlMaster == null)
            {
                from.SendMessage("This creature has no owner.");
            }
            else if (pet.IsStabled)
            {
                from.SendMessage("The pet is already stabled.");
            }
            else
            {
                Mobile owner = pet.ControlMaster;

                if (owner.Stabled.Count >= AnimalTrainer.GetMaxStabled(owner))
                {
                    from.SendMessage("Warning: The owner has not enough free stable slots. Forcing GM stable...");
                }

                if (pet is IMount)
                {
                    var bm = (IMount)pet;
                    bm.Rider = null;
                }

                pet.ControlTarget = null;
                pet.ControlOrder  = OrderType.Stay;
                pet.Internalize();

                pet.SetControlMaster(null);
                pet.SummonMaster = null;

                pet.IsStabled   = true;
                pet.StabledDate = DateTime.UtcNow;
                owner.Stabled.Add(pet);

                from.SendMessage("The pet is now stabled.");
            }
        }
        public void Internalize()
        {
            if (m_Pet.Map == Map.Internal)
            {
                return;
            }

            m_Pet.ControlTarget = null;
            m_Pet.ControlOrder  = OrderType.Stay;
            m_Pet.Internalize();

            m_Pet.SetControlMaster(null);
            m_Pet.SummonMaster = null;

            m_Pet.IsStabled = true;
            m_Pet.Loyalty   = BaseCreature.MaxLoyalty;

            m_Pet.Home      = Point3D.Zero;
            m_Pet.RangeHome = 10;
            m_Pet.Blessed   = false;
        }
        public void ChickenCaged(Mobile from, BaseCreature pet)
        {
            pet.ControlTarget = null;
            pet.ControlOrder  = OrderType.Stay;
            pet.Internalize();

            pet.SetControlMaster(null);
            pet.SummonMaster = null;

            pet.IsStabled = true;

            if (!m_Stored.ContainsKey(from))
            {
                m_Stored.Add(from, new List <BaseCreature>());
            }

            if (!m_Stored[from].Contains(pet))
            {
                m_Stored[from].Add(pet);
            }

            this.BlessedFor = from;
        }
Exemple #23
0
            protected override void OnTick()
            {
                if (m_Creature is BaseMount)
                {
                    ((BaseMount)m_Creature).Rider = null;
                }

                m_Creature.ControlTarget = null;
                m_Creature.ControlOrder  = OrderType.Stay;
                m_Creature.Internalize();

                m_Creature.SetControlMaster(null);
                m_Creature.SummonMaster = null;

                m_Creature.IsStabled = true;
                m_Creature.Loyalty   = BaseCreature.MaxLoyalty;

                m_Creature.Home      = Point3D.Zero;
                m_Creature.RangeHome = 10;
                m_Creature.Blessed   = false;

                EndViewTimer(m_Creature);
            }
Exemple #24
0
        public static void SendToBrokerStables(BaseCreature pet)
        {
            if (pet is BaseMount)
            {
                ((BaseMount)pet).Rider = null;
            }

            pet.ControlTarget = null;
            pet.ControlOrder  = OrderType.Stay;
            pet.Internalize();

            pet.SetControlMaster(null);
            pet.SummonMaster = null;

            pet.IsStabled = true;
            pet.Loyalty   = BaseCreature.MaxLoyalty;

            pet.Home      = Point3D.Zero;
            pet.RangeHome = 10;
            pet.Blessed   = false;

            EndViewTimer(pet);
        }
Exemple #25
0
		private void ShrinkPet( BaseCreature pet )
		{
			m_Pet = pet;
			m_Owner = pet.ControlMaster;
				
			if ( ShrinkConfig.LootStatus == ShrinkConfig.BlessStatus.All
				|| ( m_Pet.IsBonded && ShrinkConfig.LootStatus == ShrinkConfig.BlessStatus.BondedOnly ))
				LootType = LootType.Blessed;
			else
				LootType = LootType.Regular;

			m_Pet.Internalize();
			m_Pet.SetControlMaster( null );
			m_Pet.ControlOrder = OrderType.Stay;
			m_Pet.SummonMaster = null;
			m_Pet.IsStabled = true;

			if ( pet is IEvoCreature )
				((IEvoCreature)m_Pet).OnShrink( this );
		}
        public void EndStable(Mobile from, BaseCreature pet)
        {
            if (Deleted || !from.CheckAlive())
            {
                return;
            }

            if (!pet.Controlled || pet.ControlMaster != from)
            {
                Say(1042562);                   // You do not own that pet!
            }
            else if (pet.IsDeadPet)
            {
                Say(1049668);                   // Living pets only, please.
            }
            else if (pet.Summoned)
            {
                Say(502673);                   // I can not stable summoned creatures.
            }
            else if (pet.Body.IsHuman)
            {
                Say(502672);                   // HA HA HA! Sorry, I am not an inn.
            }
            else if ((pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0))
            {
                Say(1042563);                   // You need to unload your pet.
            }
            else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                Say(1042564);                   // I'm sorry.  Your pet seems to be busy.
            }
            else if (from.Stabled.Count >= GetMaxStabled(from))
            {
                Say(1042565);                   // You have too many pets in the stables!
            }
            else
            {
                if (Banker.Withdraw(from, 30))
                {
                    if (m_Sign != null)
                    {
                        m_Sign.Stone.CityTreasury += 30;
                    }

                    pet.ControlTarget = null;
                    pet.ControlOrder  = OrderType.Stay;
                    pet.Internalize();

                    pet.SetControlMaster(null);
                    pet.SummonMaster = null;

                    pet.IsStabled = true;
                    from.Stabled.Add(pet);

                    Say(502679);                       // Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!
                }
                else
                {
                    Say(502677);                       // But thou hast not the funds in thy bank account!
                }
            }
        }
Exemple #27
0
        public void EndStable(Mobile from, BaseCreature pet)
        {
            if (Deleted || !from.CheckAlive())
                return;

            else if (!pet.Controlled || pet.ControlMaster != from)
            {
                from.SendLocalizedMessage(1042562); // You do not own that pet!
            }
            else if (pet.IsDeadPet)
            {
                from.SendLocalizedMessage(1049668); // Living pets only, please.
            }
            else if (pet.Summoned)
            {
                from.SendLocalizedMessage(502673); // I can not stable summoned creatures.
            }
            #region Mondain's Legacy
            else if (pet.Allured)
            {
                from.SendLocalizedMessage(1048053); // You can't stable that!
            }
            #endregion
            else if (pet.Body.IsHuman)
            {
                from.SendLocalizedMessage(502672); // HA HA HA! Sorry, I am not an inn.
            }
            else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                from.SendLocalizedMessage(1042564); // I'm sorry.  Your pet seems to be busy.
            }
            else if (from.Stabled.Count >= GetMaxStabled(from))
            {
                from.SendLocalizedMessage(1114325); // There is no more room in your chicken coop!
            }
            else
            {
                Container bank = from.FindBankNoCreate();

                if (bank != null && bank.ConsumeTotal(typeof(Gold), 30))
                {
                    pet.ControlTarget = null;
                    pet.ControlOrder = OrderType.Stay;
                    pet.Internalize();

                    pet.SetControlMaster(null);
                    pet.SummonMaster = null;

                    pet.IsStabled = true;

                    if (Core.SE)
                        pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy

                    from.Stabled.Add(pet);

                    from.SendLocalizedMessage(502679); // Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!
                }
                else
                {
                    from.SendLocalizedMessage(502677); // But thou hast not the funds in thy bank account!
                }
            }
        }
Exemple #28
0
        public void EndStable(Mobile from, BaseCreature pet)
        {
            if (Deleted || !from.CheckAlive())
            {
                return;
            }

            if (pet.Body.IsHuman)
            {
                from.SendLocalizedMessage(502672);                 // HA HA HA! Sorry, I am not an inn.
            }
            else if (!pet.Controlled)
            {
                from.SendLocalizedMessage(1048053);                 // You can't stable that!
            }
            else if (pet.ControlMaster != from)
            {
                from.SendLocalizedMessage(1042562);                 // You do not own that pet!
            }
            else if (pet.IsDeadPet)
            {
                from.SendLocalizedMessage(1049668);                 // Living pets only, please.
            }
            else if (pet.Summoned)
            {
                from.SendLocalizedMessage(502673);                 // I can not stable summoned creatures.
            }
            else if (pet.Allured)
            {
                from.SendLocalizedMessage(1048053);                 // You can't stable that!
            }
            else if ((pet is PackLlama || pet is PackHorse || pet is Beetle) &&
                     (pet.Backpack != null && pet.Backpack.Items.Count > 0))
            {
                from.SendLocalizedMessage(1042563);                 // You need to unload your pet.
            }
            else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                from.SendLocalizedMessage(1042564);                 // I'm sorry.  Your pet seems to be busy.
            }
            else if (from.Stabled.Count >= GetMaxStabled(from))
            {
                from.SendLocalizedMessage(1042565);                 // You have too many pets in the stables!
            }
            else if ((from.Backpack != null && from.Backpack.ConsumeTotal(typeof(Gold), 30)) || Banker.Withdraw(from, 30))
            {
                pet.ControlTarget = null;
                pet.ControlOrder  = OrderType.Stay;
                pet.Internalize();

                pet.SetControlMaster(null);
                pet.SummonMaster = null;

                pet.IsStabled = true;
                pet.StabledBy = from;

                if (Core.SE)
                {
                    pet.Loyalty = BaseCreature.MaxLoyalty;                     // Wonderfully happy
                }

                from.Stabled.Add(pet);

                from.SendLocalizedMessage(1049677);
                // [AOS: Your pet has been stabled.] Very well, thy pet is stabled.
                // Thou mayst recover it by saying 'claim' to me. In one real world week,
                // I shall sell it off if it is not claimed!
            }
            else
            {
                from.SendLocalizedMessage(502677);                 // But thou hast not the funds in thy bank account!
            }

            // if ( Deleted || !from.CheckAlive() )
            // return;

            // if ( !pet.Controlled || pet.ControlMaster != from )
            // {
            // from.SendMessage ("You do not own that pet!");
            // }
            // else if ( pet.IsDeadPet )
            // {
            // from.SendMessage ("Living pets only, please!");
            // }
            // else if ( pet.Summoned )
            // {
            // from.SendMessage ("You can not stable summoned creatures");
            // }
            // else if ( pet.Body.IsHuman )
            // {
            // from.SendMessage ("You do not own that pet!");
            // }
            // else if ( (pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0) )
            // {
            // from.SendMessage ("You need to unload the Pack Animal Befor You Can Stable It!");
            // }
            // else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map )
            // {
            // from.SendMessage (" Your pet seems to be busy at the moment, try agen when its not!");
            // }
            // else if ( from.Stabled.Count >= GetMaxStabled( from ) )
            // {
            // from.SendMessage (" You have too many pets in the stables!");
            // }
            // else
            // {
            // Container bank = from.BankBox;

            // if ( bank != null && bank.ConsumeTotal( typeof( Gold ), 30 ) )
            // {
            // pet.ControlTarget = null;
            // pet.ControlOrder = OrderType.Stay;
            // pet.Internalize();

            // pet.SetControlMaster( null );
            // pet.SummonMaster = null;

            // pet.IsStabled = true;
            // from.Stabled.Add( pet );
            // from.SendMessage ("thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week,");
            // from.SendMessage ("if your pet is not claimed by then, I shall sell it off if it is not claimed!");
            // }
            // else
            // {
            // from.SendMessage ("You Lack The nessasary bank funds to do this");
            // }
            // }
        }
        private static void SendAway( BaseCreature b )
        {
            b.Controlled = true;	//To make it so It won't still be a part of a spawner.
            b.SetControlMaster( null );
            b.SummonMaster = null;
            b.Internalize();

            if ( ShrinkConfig.ResetBondingStatus )
                b.IsBonded = false;

            if( !ShrinkConfig.RetainBondingTimer )
                b.BondingBegin = DateTime.MinValue;

            b.OwnerAbandonTime = DateTime.MinValue;

            b.IsStabled = true;
        }
Exemple #30
0
        public void EndStable(Mobile from, BaseCreature pet)
        {
            if (Deleted || !from.CheckAlive())
            {
                return;
            }

            if (pet.Body.IsHuman)
            {
                from.SendLocalizedMessage(502672); // HA HA HA! Sorry, I am not an inn.
            }
            else if (!pet.Controlled)
            {
                from.SendLocalizedMessage(1048053); // You can't stable that!
            }
            else if (pet.ControlMaster != from)
            {
                from.SendLocalizedMessage(1042562); // You do not own that pet!
            }
            else if (pet.IsDeadPet)
            {
                from.SendLocalizedMessage(1049668); // Living pets only, please.
            }
            else if (pet.Summoned)
            {
                from.SendLocalizedMessage(502673); // I can not stable summoned creatures.
            }
            else if (pet.Allured)
            {
                from.SendLocalizedMessage(1048053); // You can't stable that!
            }
            else if ((pet is PackLlama || pet is PackHorse || pet is Beetle) &&
                     (pet.Backpack != null && pet.Backpack.Items.Count > 0))
            {
                from.SendLocalizedMessage(1042563); // You need to unload your pet.
            }
            else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                from.SendLocalizedMessage(1042564); // I'm sorry.  Your pet seems to be busy.
            }
            else if (from.Stabled.Count >= AnimalTrainer.GetMaxStabled(from))
            {
                from.SendLocalizedMessage(1042565); // You have too many pets in the stables!
            }
            else if ((from.Backpack != null && from.Backpack.ConsumeTotal(typeof(Gold), 30)) || Banker.Withdraw(from, 30))
            {
                pet.ControlTarget = null;
                pet.ControlOrder  = OrderType.Stay;
                pet.Internalize();

                pet.SetControlMaster(null);
                pet.SummonMaster = null;

                pet.IsStabled = true;
                pet.StabledBy = from;

                pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy

                from.Stabled.Add(pet);

                from.SendLocalizedMessage(1049677); // Your pet has been stabled.
            }
            else
            {
                from.SendLocalizedMessage(502677); // But thou hast not the funds in thy bank account!
            }
        }
Exemple #31
0
 public static void StablePet( PlayerMobile owner, BaseCreature pet )
 {
     pet.Internalize();
     pet.IsStabled = true;
     owner.Stabled.Add( pet );
     owner.SendMessage( String.Format( "{0} has been stabled.", pet.Name ) );
 }
        public static void StablePet(Mobile from, BaseCreature pet)
        {
            if (pet == null || pet.Deleted || !(pet is BaseCreature) || from == null || from.Deleted)
                return;

            if (pet.ControlMaster == null)
                from.SendMessage("This creature has no owner.");

            else if (pet.IsStabled)
                from.SendMessage("The pet is already stabled.");
			else
			{
				Mobile owner = pet.ControlMaster;

				if (owner.Stabled.Count >= Server.Mobiles.AnimalTrainer.GetMaxStabled(owner))
					from.SendMessage("Warning: The owner has not enough free stable slots. Forcing GM stable...");

				if (pet is IMount)
				{
					IMount bm = (IMount)pet;
					bm.Rider = null;
				}

				pet.ControlTarget = null;
				pet.ControlOrder = OrderType.Stay;
				pet.Internalize();

				pet.SetControlMaster(null);
				pet.SummonMaster = null;

				pet.IsStabled = true;
				owner.Stabled.Add(pet);

				from.SendMessage("The pet is now stabled.");
			}
        }
		public static void StablePet( PlayerMobile player, BaseCreature pet )
		{
			if ( null == player || null == pet )
				return;

			pet.Internalize();
			pet.ControlTarget = null;
			pet.ControlOrder = OrderType.Stay;
			pet.SetControlMaster( null );
			pet.SummonMaster = null;
			pet.IsStabled = true;
			player.Stabled.Add( pet );
			player.SendMessage( "Your pet has been stabled" );
		}
        public void EndStable( Mobile from, BaseCreature pet )
        {
            if ( Deleted || !from.CheckAlive() )
                return;

            if ( !pet.Controlled || pet.ControlMaster != from )
            {
                SayTo( from, 1042562 ); // You do not own that pet!
            }
            else if ( pet.IsDeadPet )
            {
                SayTo( from, 1049668 ); // Living pets only, please.
            }
            else if ( pet.Summoned || pet.VanishTime != DateTime.MinValue )
            {
                SayTo( from, 502673 ); // I can not stable summoned creatures.
            }
            else if ( pet.Body.IsHuman )
            {
                SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
            }
            else if ( ( pet is WorkHorse || pet is GiantScarab) && (pet.Backpack != null && pet.Backpack.Items.Count > 0) )
            {
                SayTo( from, 1042563 ); // You need to unload your pet.
            }
            else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map )
            {
                SayTo( from, 1042564 ); // I'm sorry.  Your pet seems to be busy.
            }
            else
            {
                Container bank = from.BankBox;

                if ( bank != null && bank.ConsumeTotal( typeof( Copper ), 1 ) )
                {
                    pet.ControlTarget = null;
                    pet.ControlOrder = OrderType.Stay;
                    pet.StabledOwner = from;
                    pet.Internalize();
                    pet.SetControlMaster( null );
                    pet.SummonMaster = null;
                    pet.IsStabled = true;
                    pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy
                    this.Stabled.Add( pet );
                    SayTo( from, "Thy pet has been stabled. I will charge you one copper piece every six hours [OOC: two real-life hours]." );
                    SayTo( from, "Here is your ticket. Hand it back to me when you wish to get your animal back, or say just tell me you wish to claim your pets." );
                    StableTicket ticket = new StableTicket();
                    ticket.StabledPet = pet;
                    pet.StableTicket = ticket;

                    if( from.Backpack != null )
                        from.AddToBackpack( ticket );
                }
                else
                {
                    SayTo( from, 502677 ); // But thou hast not the funds in thy bank account!
                }
            }
        }
		public void EndStable( Mobile from, BaseCreature pet )
		{
			if ( Deleted || !from.CheckAlive() )
				return;

			if ( pet.Body.IsHuman )
			{
				SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
			}
			else if ( !pet.Controlled )
			{
				SayTo( from, 1048053 ); // You can't stable that!
			}
			else if ( pet.ControlMaster != from )
			{
				SayTo( from, 1042562 ); // You do not own that pet!
			}
			else if ( pet.IsDeadPet )
			{
				SayTo( from, 1049668 ); // Living pets only, please.
			}
			else if ( pet.Summoned )
			{
				SayTo( from, 502673 ); // I can not stable summoned creatures.
			}
            /*
			else if ( pet.Allured )
			{
				SayTo( from, 1048053 ); // You can't stable that!
			}
*/
			else if ( (pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0) )
			{
				SayTo( from, 1042563 ); // You need to unload your pet.
			}
			else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map )
			{
				SayTo( from, 1042564 ); // I'm sorry.  Your pet seems to be busy.
			}
			else if ( from.Stabled.Count >= GetMaxStabled( from ) )
			{
				SayTo( from, 1042565 ); // You have too many pets in the stables!
			}
			else
			{
				Container bank = from.FindBankNoCreate();

				if ( ( from.Backpack != null && from.Backpack.ConsumeTotal( typeof( Gold ), 30 ) ) || ( bank != null && bank.ConsumeTotal( typeof( Gold ), 30 ) ) )
				{
					pet.ControlTarget = null;
					pet.ControlOrder = OrderType.Stay;
					pet.Internalize();

					pet.SetControlMaster( null );
					pet.SummonMaster = null;

					pet.IsStabled = true;
                    pet.StabledBy = from;

					if ( Core.SE )	
						pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy

					from.Stabled.Add( pet );

					SayTo( from, Core.AOS ? 1049677 : 502679 ); // [AOS: Your pet has been stabled.] Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!
				}
				else
				{
					SayTo( from, 502677 ); // But thou hast not the funds in thy bank account!
				}
			}
		}
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            BaseCreature bc1 = (BaseCreature)m_Pet1;
            BaseCreature bc2 = (BaseCreature)m_Pet2;

            Mobile cm1 = bc1.ControlMaster;
            Mobile cm2 = bc2.ControlMaster;

            if (from == null)
            {
                return;
            }

            //Baby Stat Table
            if (info.ButtonID == 1)
            {
                from.CloseGump(typeof(BreedingAcceptGump));
                //from.CloseGump( typeof( BabyStatTableGump ) );

                from.SendGump(new BreedingAcceptGump(m_Pet1, m_Pet2));
                //from.SendGump( new BabyStatTableGump( m_Pet1, m_Pet2 ) );
            }

            //Accept
            if (info.ButtonID == 2)
            {
                Mobile breeder = new Mobile();

                Mobile owner = new Mobile();

                int ai = 0;

                if (bc1.AI == AIType.AI_Mage && bc2.AI == AIType.AI_Mage)
                {
                    ai = 1;
                }
                if (bc1.AI == AIType.AI_Melee && bc2.AI == AIType.AI_Melee)
                {
                    ai = 2;
                }

                int xstr = bc1.RawStr + bc2.RawStr;
                int xdex = bc1.RawDex + bc2.RawDex;
                int xint = bc1.RawInt + bc2.RawInt;

                int xhits = bc1.HitsMax + bc2.HitsMax;
                int xstam = bc1.StamMax + bc2.StamMax;
                int xmana = bc1.ManaMax + bc2.ManaMax;

                int xphys = bc1.PhysicalResistance + bc2.PhysicalResistance;
                int xfire = bc1.FireResistance + bc2.FireResistance;
                int xcold = bc1.ColdResistance + bc2.ColdResistance;
                int xnrgy = bc1.EnergyResistance + bc2.EnergyResistance;
                int xpois = bc1.PoisonResistance + bc2.PoisonResistance;

                int xdmin = bc1.DamageMin + bc2.DamageMin;
                int xdmax = bc1.DamageMax + bc2.DamageMax;

                int xmlev = bc1.Level + bc2.Level;

                int newStr = xstr / 2;
                int newDex = xdex / 2;
                int newInt = xint / 2;

                int newHits = xhits / 2;
                int newStam = xstam / 2;
                int newMana = xmana / 2;

                int newPhys = xphys / 2;
                int newFire = xfire / 2;
                int newCold = xcold / 2;
                int newNrgy = xnrgy / 2;
                int newPois = xpois / 2;

                int newDmin = xdmin / 2;
                int newDmax = xdmax / 2;

                int newMlev = xmlev / 2;

                int babyStr  = newStr + Utility.RandomMinMax(0, 1);
                int babyDex  = newDex + Utility.RandomMinMax(0, 1);
                int babyInt  = newInt + Utility.RandomMinMax(0, 1);
                int babyHits = newHits + Utility.RandomMinMax(0, 2);
                int babyStam = newStam + Utility.RandomMinMax(0, 2);
                int babyMana = newMana + Utility.RandomMinMax(0, 2);

                int babyPhys = newPhys + Utility.RandomMinMax(0, 2);
                int babyFire = newFire + Utility.RandomMinMax(0, 2);
                int babyCold = newCold + Utility.RandomMinMax(0, 2);
                int babyNrgy = newNrgy + Utility.RandomMinMax(0, 2);
                int babyPois = newPois + Utility.RandomMinMax(0, 2);

                int babyDmin = newDmin;
                int babyDmax = newDmax;

                int babyMlev = newMlev + Utility.RandomMinMax(1, 3);

                int stats     = babyStr + babyDex + babyInt + babyHits + babyStam + babyMana + babyPhys + babyFire + babyCold + babyNrgy + babyPois + babyDmin + babyDmax + babyMlev;
                int newPrice  = stats * 3;
                int babyPrice = newPrice;
                int chance    = stats;

                if (chance <= 1500)
                {
                    chance = 1500;
                }

                if (babyStr >= FSATS.NormalSTR)
                {
                    babyStr = FSATS.NormalSTR;
                }

                if (babyDex >= FSATS.NormalDEX)
                {
                    babyDex = FSATS.NormalDEX;
                }

                if (babyInt >= FSATS.NormalINT)
                {
                    babyInt = FSATS.NormalINT;
                }

                if (babyPhys >= FSATS.NormalPhys)
                {
                    babyPhys = FSATS.NormalPhys;
                }

                if (babyFire >= FSATS.NormalFire)
                {
                    babyFire = FSATS.NormalFire;
                }

                if (babyCold >= FSATS.NormalCold)
                {
                    babyCold = FSATS.NormalCold;
                }

                if (babyNrgy >= FSATS.NormalEnergy)
                {
                    babyNrgy = FSATS.NormalEnergy;
                }

                if (babyPois >= FSATS.NormalPoison)
                {
                    babyPois = FSATS.NormalPoison;
                }

                if (babyDmin >= FSATS.NormalMinDam)
                {
                    babyDmin = FSATS.NormalMinDam;
                }

                if (babyDmax >= FSATS.NormalMaxDam)
                {
                    babyDmax = FSATS.NormalMaxDam;
                }

                if (babyMlev >= 60)
                {
                    babyMlev = 60;
                }

                foreach (Mobile m in from.GetMobilesInRange(5))
                {
                    if (m is AnimalBreeder)
                    {
                        breeder = m;
                    }

                    if (m == cm1)
                    {
                        owner = m;
                    }
                }

                if (breeder == null)
                {
                    from.SendMessage("You must be near an animal breeder in order to breed your pet.");

                    if (cm1 != null)
                    {
                        cm1.SendMessage("The owner of the other pet is too far away from the animal breeder.");
                    }
                }
                else if (owner == null)
                {
                    from.SendMessage("The owner of the other pet is not near by.");

                    if (cm1 != null)
                    {
                        cm1.SendMessage("You are to far away from the other pet owner.");
                    }
                }
                else if (Utility.Random(chance) < 1500)
                {
                    if (cm1 != null)                       //Generate Claim Ticket One
                    {
                        PetClaimTicket pct = new PetClaimTicket();
                        pct.AI    = ai;
                        pct.Owner = cm1;
                        pct.Pet   = m_Pet1;
                        pct.Str   = babyStr;
                        pct.Dex   = babyDex;
                        pct.Int   = babyInt;
                        pct.Hits  = babyHits;
                        pct.Stam  = babyStam;
                        pct.Mana  = babyMana;
                        pct.Phys  = babyPhys;
                        pct.Fire  = babyFire;
                        pct.Cold  = babyCold;
                        pct.Nrgy  = babyNrgy;
                        pct.Pois  = babyPois;
                        pct.Dmin  = babyDmin;
                        pct.Dmax  = babyDmax;
                        pct.Mlev  = babyMlev;
                        pct.Gen   = bc1.Generation;
                        pct.Price = babyPrice;
                        cm1.AddToBackpack(pct);

                        breeder.SayTo(cm1, "Ill hold onto your pet for you while its mating.");
                        breeder.SayTo(cm1, "Return here in three days and show me the claim ticket I gave to you.");
                        cm1.SendMessage("They have accepted your offer.");

                        bc1.ControlTarget = null;
                        bc1.ControlOrder  = OrderType.Stay;
                        bc1.Internalize();

                        bc1.SetControlMaster(null);
                    }

                    if (cm2 != null)                       //Generate Claim Ticket One
                    {
                        PetClaimTicket pct = new PetClaimTicket();
                        pct.AI    = ai;
                        pct.Owner = cm2;
                        pct.Pet   = m_Pet2;
                        pct.Str   = babyStr;
                        pct.Dex   = babyDex;
                        pct.Int   = babyInt;
                        pct.Hits  = babyHits;
                        pct.Stam  = babyStam;
                        pct.Mana  = babyMana;
                        pct.Phys  = babyPhys;
                        pct.Fire  = babyFire;
                        pct.Cold  = babyCold;
                        pct.Nrgy  = babyNrgy;
                        pct.Pois  = babyPois;
                        pct.Dmin  = babyDmin;
                        pct.Dmax  = babyDmax;
                        pct.Mlev  = babyMlev;
                        pct.Gen   = bc2.Generation;
                        pct.Price = babyPrice;
                        cm2.AddToBackpack(pct);

                        breeder.SayTo(cm2, "Ill hold onto your pet for you while its mating.");
                        breeder.SayTo(cm2, "Return here in three days and the show me that claim ticket i gave to you.");
                        cm2.SendMessage("You accept their offer.");

                        bc2.ControlTarget = null;
                        bc2.ControlOrder  = OrderType.Stay;
                        bc2.Internalize();

                        bc2.SetControlMaster(null);
                    }

                    if (bc1 != null || bc2 != null)
                    {
                        bc1.MatingDelay = DateTime.Now + TimeSpan.FromHours(144.0);
                        bc2.MatingDelay = DateTime.Now + TimeSpan.FromHours(144.0);
                    }
                }
                else
                {
                    if (cm1 != null && cm2 != null)
                    {
                        cm1.SendMessage("Breeding Failed: It is hard to successfully mate two strong pets together, You will have to wait 6 hours to try again.");
                        cm2.SendMessage("Breeding Failed: It is hard to successfully mate two strong pets together, You will have to wait 6 hours to try again.");
                        bc1.MatingDelay = DateTime.Now + TimeSpan.FromHours(6.0);
                        bc2.MatingDelay = DateTime.Now + TimeSpan.FromHours(6.0);
                    }
                }
            }

            //Decline
            if (info.ButtonID == 3)
            {
                from.SendMessage("You have declined their offer.");

                if (cm1 != null)
                {
                    cm1.SendMessage("They have declined your offer");
                }
            }
        }
Exemple #37
0
        public static bool Shrink(Mobile from, object target)
        {
            if (from == target)
            {
                from.SendMessage("You cannot shrink yourself!");
                return(false);
            }
            else if (!(target is BaseCreature))
            {
                from.SendMessage("You cannot shrink that!");
                return(false);
            }
            else
            {
                BaseCreature creature = (BaseCreature)target;

                if (creature.ControlMaster != from)
                {
                    from.SendMessage("You can only shrink creatures that you control.");
                    return(false);
                }
                else if (!creature.Tamable)
                {
                    from.SendMessage("You can only shrink creature that are tameable.");
                    return(false);
                }
                else if (creature.IsDeadPet)
                {
                    from.SendMessage("You cannot shrink dead creatures!");
                    return(false);
                }
                else if (creature.Summoned)
                {
                    from.SendMessage("You cannot shrink summoned creatures!");
                    return(false);
                }
                else if (creature.Combatant != null && creature.InRange(creature.Combatant, 12) && creature.Map == creature.Combatant.Map)
                {
                    from.SendMessage("You cannot shrink a creature while it is in combat.");
                    return(false);
                }
                else if ((creature is PackLlama || creature is PackHorse || creature is Beetle) && (creature.Backpack != null && creature.Backpack.Items.Count > 0))
                {
                    from.SendMessage("You must unload the creature first.");
                    return(false);
                }

                ShrunkenCreature shrunk = new ShrunkenCreature(from, creature);

                if (!from.AddToBackpack(shrunk))
                {
                    shrunk.MoveToWorld(from.Location, from.Map);
                    from.SendMessage("Your backpack is full so the shrunken creature falls to the ground!");
                }

                creature.SetControlMaster(null);

                creature.IsStabled = true;
                creature.Internalize();

                return(true);
            }
        }
Exemple #38
0
        public void EndStable(Mobile from, BaseCreature pet)
        {
            if (Deleted || !from.CheckAlive() || !CanUse() || !CheckAccess(from))
            {
                return;
            }

            else if (!pet.Controlled || pet.ControlMaster != from)
            {
                from.SendLocalizedMessage(1042562); // You do not own that pet!
            }
            else if (pet.IsDeadPet)
            {
                from.SendLocalizedMessage(1049668); // Living pets only, please.
            }
            else if (pet.Summoned)
            {
                from.SendLocalizedMessage(502673); // I can not stable summoned creatures.
            }
            #region Mondain's Legacy
            else if (pet.Allured)
            {
                from.SendLocalizedMessage(1048053); // You can't stable that!
            }
            #endregion
            else if (pet.Body.IsHuman)
            {
                from.SendLocalizedMessage(502672); // HA HA HA! Sorry, I am not an inn.
            }
            else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                from.SendLocalizedMessage(1042564); // I'm sorry.  Your pet seems to be busy.
            }
            else if (GetCount() >= MaxStables)
            {
                from.SendLocalizedMessage(1114325); // There is no more room in your chicken coop!
            }
            else
            {
                //Container bank = from.FindBankNoCreate();

                //if (bank != null && bank.ConsumeTotal(typeof(Gold), 30))
                //{
                pet.ControlTarget = null;
                pet.ControlOrder  = OrderType.Stay;
                pet.Internalize();

                pet.SetControlMaster(null);
                pet.SummonMaster = null;

                pet.IsStabled = true;

                if (Core.SE)
                {
                    pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy
                }
                if (!m_Stored.ContainsKey(from))
                {
                    m_Stored.Add(from, new List <BaseCreature>());
                }

                if (!m_Stored[from].Contains(pet))
                {
                    m_Stored[from].Add(pet);
                }

                from.SendMessage("Your chicken has been stabled.");
                //from.SendLocalizedMessage(502679); // Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!
                //}
                //else
                //{
                //from.SendLocalizedMessage(502677); // But thou hast not the funds in thy bank account!
                //}
            }
        }
        public void EndStable( Mobile from, BaseCreature pet )
        {
            if ( Deleted || !from.CheckAlive() )
                return;

            int maxStabled = GetMaxStabled( from );
            int newCount = GetNumStabled( from ) + GetStableSlotsFor( from, pet );

            if ( !pet.Controled || pet.ControlMaster != from )
            {
                SayTo( from, 1042562 ); // You do not own that pet!
            }
            else if ( pet.IsDeadPet )
            {
                SayTo( from, 1049668 ); // Living pets only, please.
            }
            else if ( pet.Summoned )
            {
                SayTo( from, 502673 ); // I can not stable summoned creatures.
            }
            else if ( pet.Body.IsHuman )
            {
                SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
            }
            else if ( (pet is PackLlama || pet is PackHorse) && (pet.Backpack != null && pet.Backpack.Items.Count > 0) )
            {
                SayTo( from, 1042563 ); // You need to unload your pet.
            }
            else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map )
            {
                SayTo( from, 1042564 ); // I'm sorry.  Your pet seems to be busy.
            }
            else if ( newCount > maxStabled )
            {
                //SayTo( from, 1042565 ); // You have too many pets in the stables!
                SayTo( from, "There is not enough room in the stable for that!  Claim some of your other animals first." );
            }
            else
            {
                Container bank = from.BankBox;

                if ( bank != null && bank.ConsumeTotal( typeof( Gold ), 30 ) )
                {
                    pet.ControlTarget = null;
                    pet.ControlOrder = OrderType.Stay;
                    pet.Internalize();

                    pet.SetControlMaster( null );
                    pet.SummonMaster = null;

                    pet.IsStabled = true;
                    from.Stabled.Add( pet );

                    SayTo( from, 502679 ); // Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!
                }
                else
                {
                    SayTo( from, 502677 ); // But thou hast not the funds in thy bank account!
                }
            }
        }
Exemple #40
0
		private static void SendAway( BaseCreature b )
		{
			b.SetControlMaster( null );
			b.SummonMaster = null;
			b.Internalize();
			b.IsStabled = true;	
		}
Exemple #41
0
        private void ReadyPlayer(Mobile m)
        {
            if (!m_ScoreTable.ContainsKey(m.Serial))
            {
                m_ScoreTable.Add(m.Serial, new ScoreKeeper(m));
            }

            if (!m_UseSphereRules)
            {
                #region DistroCode

                bool MagicWeapons = MagicWeaponRule == pMagicWeaponRule.Allowed;
                bool MagicArmor   = MagicArmorRule == pMagicArmorRule.Allowed;
                bool Potions      = PotionRule == pPotionRule.Allowed;
                bool Bandages     = BandageRule == pBandaidRule.Allowed;
                bool Pets         = PetRule == pPetRule.Allowed;
                bool Mounts       = MountRule == pMountRule.Allowed;

                if (!m.Alive)
                {
                    m.Resurrect();
                }

                Container bp  = m.Backpack;
                Container bag = new Bag();
                bag.Hue = 38;
                BankBox bank   = m.BankBox;
                Item    oncurs = m.Holding;

                if (oncurs != null)
                {
                    bp.DropItem(oncurs);
                }

                m.CurePoison(m);

                m.Hits = m.HitsMax;
                m.Mana = m.ManaMax;
                m.Stam = m.StamMax;

                m.StatMods.Clear();

                List <Item> items = new List <Item>();

                foreach (Layer layer in PvpCore.EquipmentLayers)
                {
                    Item item = m.FindItemOnLayer(layer);

                    if (item != null)
                    {
                        if (item is BaseWeapon && !MagicWeapons)
                        {
                            BaseWeapon weapon = (BaseWeapon)item;

                            if (weapon.AccuracyLevel != WeaponAccuracyLevel.Regular)
                            {
                                items.Add(weapon);
                            }
                            else if (weapon.DamageLevel != WeaponDamageLevel.Regular)
                            {
                                items.Add(weapon);
                            }
                            else if (weapon.DurabilityLevel != WeaponDurabilityLevel.Regular)
                            {
                                items.Add(weapon);
                            }
                        }
                        else if (item is BaseArmor && !MagicArmor)
                        {
                            BaseArmor armor = (BaseArmor)item;

                            if (armor.Durability != ArmorDurabilityLevel.Regular)
                            {
                                items.Add(armor);
                            }
                            else if (armor.ProtectionLevel != ArmorProtectionLevel.Regular)
                            {
                                items.Add(armor);
                            }
                        }
                    }
                }

                if (m.Backpack != null)
                {
                    foreach (Item item in m.Backpack.Items)
                    {
                        if (item != null)
                        {
                            if (item is BaseWeapon && !MagicWeapons)
                            {
                                BaseWeapon weapon = (BaseWeapon)item;

                                if (weapon.AccuracyLevel != WeaponAccuracyLevel.Regular)
                                {
                                    items.Add(weapon);
                                }
                                else if (weapon.DamageLevel != WeaponDamageLevel.Regular)
                                {
                                    items.Add(weapon);
                                }
                                else if (weapon.DurabilityLevel != WeaponDurabilityLevel.Regular)
                                {
                                    items.Add(weapon);
                                }
                            }
                            else if (item is BaseArmor && !MagicArmor)
                            {
                                BaseArmor armor = (BaseArmor)item;

                                if (armor.Durability != ArmorDurabilityLevel.Regular)
                                {
                                    items.Add(armor);
                                }
                                else if (armor.ProtectionLevel != ArmorProtectionLevel.Regular)
                                {
                                    items.Add(armor);
                                }
                            }
                            else if (item is BasePotion && !Potions)
                            {
                                items.Add(item);
                            }
                            else if (item is EtherealMount && !Mounts)
                            {
                                items.Add(item);
                            }
                            else if (item is Bandage && !Bandages)
                            {
                                items.Add(item);
                            }
                        }
                    }
                }

                if (!Mounts)
                {
                    if (m.Mount != null)
                    {
                        IMount mount = m.Mount;
                        mount.Rider = null;
                        if (mount is BaseMount)
                        {
                            if (mount is BaseCreature)
                            {
                                BaseCreature bc = (BaseCreature)mount;
                                bc.ControlTarget = null;
                                bc.ControlOrder  = OrderType.Stay;
                                bc.Internalize();

                                bc.SetControlMaster(null);
                                bc.SummonMaster = null;

                                bc.IsStabled = true;
                                m.Stabled.Add(bc);
                                MountCollection.Add(m.Serial, bc);
                                m.SendMessage(38, "Your mount has been moved to the your stables");
                            }
                        }
                    }
                }

                if (items.Count > 0)
                {
                    m.SendMessage(38, "You had items that did not meet the requirements for the deathmatch and were thus moved to your bank.");
                }

                foreach (Item item in items)
                {
                    bag.AddItem(item);
                }

                if (bag.Items.Count > 0)
                {
                    bank.DropItem(bag);
                }
                else
                {
                    bag.Delete();
                }

                #endregion
            }

            if (m_EventSupplier != null)
            {
                m_EventSupplier.OnMoveOver(m);
            }

            Contestants.Add(m);

            SpawnMobile(m);

            if (m_GiveHorses)
            {
                DMHorse.TryGiveHorse(m);
            }

            if (m.NetState != null)
            {
                m.SendMessage(38, "You have joined a deathmatch");
                m.SendMessage(38, "You can check the score with \".DMScore\"");
            }
        }
        public void EndStable(Mobile from, BaseCreature pet)
        {
            if (Deleted || !from.CheckAlive())
            {
                return;
            }

            if (!pet.Controlled || pet.ControlMaster != from)
            {
                from.SendLocalizedMessage(1042562);                 // You do not own that pet!
            }
            else if (pet.IsDeadPet)
            {
                from.SendLocalizedMessage(1049668);                 // Living pets only, please.
            }
            else if (pet.Summoned)
            {
                from.SendLocalizedMessage(502673);                 // I can not stable summoned creatures.
            }
            #region Mondain's Legacy
            else if (pet.Allured)
            {
                from.SendLocalizedMessage(1048053);                 // You can't stable that!
            }
            #endregion
            else if (pet.Body.IsHuman)
            {
                from.SendLocalizedMessage(502672);                 // HA HA HA! Sorry, I am not an inn.
            }
            else if ((pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0))
            {
                from.SendLocalizedMessage(1042563);                 // You need to unload your pet.
            }
            else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                from.SendLocalizedMessage(1042564);                 // I'm sorry.  Your pet seems to be busy.
            }
            else if (from.Stabled.Count >= GetMaxStabled(from))
            {
                from.SendLocalizedMessage(1042565);                 // You have too many pets in the stables!
            }
            else
            {
                Container bank = from.FindBankNoCreate();

                if (bank != null && bank.ConsumeTotal(typeof(Gold), 30))
                {
                    pet.ControlTarget = null;
                    pet.ControlOrder  = OrderType.Stay;
                    pet.Internalize();

                    pet.SetControlMaster(null);
                    pet.SummonMaster = null;

                    pet.IsStabled = true;

                    if (Core.SE)
                    {
                        pet.Loyalty = BaseCreature.MaxLoyalty;                         // Wonderfully happy
                    }
                    from.Stabled.Add(pet);

                    UsesRemaining -= 1;

                    from.SendLocalizedMessage(502679);                     // Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!
                }
                else
                {
                    from.SendLocalizedMessage(502677);                     // But thou hast not the funds in thy bank account!
                }
            }
        }
	//RUFO beginfunction
	private void SellPetForGold(Mobile from, BaseCreature pet, int goldamount)
	{
               		Item gold = new Gold(goldamount);
               		pet.ControlTarget = null; 
               		pet.ControlOrder = OrderType.None; 
               		pet.Internalize(); 
               		pet.SetControlMaster( null ); 
               		pet.SummonMaster = null;
               		pet.Delete();
               		
               		Container backpack = from.Backpack;
               		if ( backpack == null || !backpack.TryDropItem( from, gold, false ) ) 
            		{ 
            			gold.MoveToWorld( from.Location, from.Map );           			
            		}

	}
		public void EndStable( Mobile from, BaseCreature pet )
		{
			if ( Deleted || !from.CheckAlive() )
				return;

			if ( !pet.Controlled || pet.ControlMaster != from )
			{
				SayTo( from, 1042562 ); // You do not own that pet!
			}
			//Pix: 10/7/2004 - allow dead pets to be stabled.
			//else if ( pet.IsDeadPet )
			//{
			//	SayTo( from, 1049668 ); // Living pets only, please.
			//}
			else if ( pet.Summoned )
			{
				SayTo( from, 502673 ); // I can not stable summoned creatures.
			}
			else if ( pet.IOBFollower ) // Don't stable IOB Bretheren
			{
				SayTo( from, "You can't stable your bretheren!" );
			}
			else if ( pet.Body.IsHuman )
			{
				SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
			}
			else if ( (pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0) )
			{
				SayTo( from, 1042563 ); // You need to unload your pet.
			}
			else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map )
			{
				SayTo( from, 1042564 ); // I'm sorry.  Your pet seems to be busy.
			}
			else if ( from.Stabled.Count >= GetMaxStabled( from ) )
			{
				SayTo( from, 1042565 ); // You have too many pets in the stables!
			}
			else
			{
				Container bank = from.BankBox;

				if ( bank != null && bank.ConsumeTotal( typeof( Gold ), 30 ) )
				{
					pet.ControlTarget = null;
					pet.ControlOrder = OrderType.Stay;
					pet.Internalize();

					pet.SetControlMaster( null );
					pet.SummonMaster = null;

					pet.IsStabled = true;
					from.Stabled.Add( pet );

					SayTo( from, 502679 ); // Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!
				}
				else
				{
					SayTo( from, 502677 ); // But thou hast not the funds in thy bank account!
				}
			}
		}
Exemple #45
0
            protected override void OnTarget(Mobile from, object target)
            {
                if (target == from)
                {
                    from.SendMessage("You cant shrink yourself!");
                }

                else if (target is PlayerMobile)
                {
                    from.SendMessage("That person gives you a dirty look.");
                }

                else if (target is Item)
                {
                    from.SendMessage("You can only shrink pets that you own");
                }

                else if (target is BaseBioCreature && FSATS.EnableBioShrink == false)
                {
                    from.SendMessage("Unnatural creatures cannot be shrunk");
                }

                else if (Server.Spells.SpellHelper.CheckCombat(from))
                {
                    from.SendMessage("You cannot shrink your pet while your fighting.");
                }

                else if (target is BaseCreature)
                {
                    BaseCreature c = (BaseCreature)target;

                    bool   packanimal = false;
                    Type   typ        = c.GetType();
                    string nam        = typ.Name;

                    foreach (string ispack in FSATS.PackAnimals)
                    {
                        if (ispack == nam)
                        {
                            packanimal = true;
                        }
                    }

                    if (c.BodyValue == 400 || c.BodyValue == 401 && c.Controlled == false)
                    {
                        from.SendMessage("That person gives you a dirty look.");
                    }
                    else if (c.ControlMaster != from && c.Controlled == false)
                    {
                        from.SendMessage("This is not your pet.");
                    }
                    else if (packanimal == true && (c.Backpack != null && c.Backpack.Items.Count > 0))
                    {
                        from.SendMessage("You must unload your pets backpack first.");
                    }
                    else if (c.IsDeadPet)
                    {
                        from.SendMessage("You cannot shrink the dead.");
                    }
                    else if (c.Summoned)
                    {
                        from.SendMessage("You cannot shrink a summoned creature.");
                    }
                    else if (c.Combatant != null && c.InRange(c.Combatant, 12) && c.Map == c.Combatant.Map)
                    {
                        from.SendMessage("Your pet is fighting, You cannot shrink it yet.");
                    }
                    else if (c.BodyMod != 0)
                    {
                        from.SendMessage("You cannot shrink your pet while its polymorphed.");
                    }
                    //else if ( Server.Spells.LostArts.CharmBeastSpell.IsCharmed( c ) )
                    //{
                    //	from.SendMessage( "Your hold over this pet is not strong enough to shrink it." );
                    //}
                    else if (c.Controlled == true && c.ControlMaster == from)
                    {
                        Type       type = c.GetType();
                        ShrinkItem si   = new ShrinkItem();
                        si.MobType  = type;
                        si.Pet      = c;
                        si.PetOwner = from;

                        if (c is BaseMount)
                        {
                            BaseMount mount = (BaseMount)c;
                            si.MountID = mount.ItemID;
                        }

                        from.AddToBackpack(si);

                        IEntity p1 = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z), from.Map);
                        IEntity p2 = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map);

                        Effects.SendMovingParticles(p2, p1, ShrinkTable.Lookup(c), 1, 0, true, false, 0, 3, 1153, 1, 0, EffectLayer.Head, 0x100);
                        from.PlaySound(492);

                        c.Controlled    = true;
                        c.ControlMaster = null;
                        c.Internalize();

                        c.OwnerAbandonTime = DateTime.MinValue;

                        c.IsStabled = true;

                        m_Powder.Charges -= 1;
                        if (m_Powder.Charges == 0)
                        {
                            m_Powder.Delete();
                        }
                    }
                }
            }