Exemple #1
0
        /*public override void OnDoubleClick(Mobile from)
         * {
         *      if(from.InRange(this.Location, 3) && from.Backpack != null)
         *      {
         *              WarehouseContainer container = MaginciaBazaar.ClaimContainer(from);
         *
         *              if(container != null)
         *                      TryTransferItems(from, container);
         *      }
         * }*/

        public void TryTransferPets(Mobile from, StorageEntry entry)
        {
            if (entry == null)
            {
                return;
            }

            int fees = entry.Funds;

            if (fees < 0)
            {
                int owed = fees * -1;
                SayTo(from, String.Format("It looks like you owe {0}gp as back fees.  How much would you like to pay now?", owed.ToString("###,###,###")));
                from.Prompt = new BackfeePrompt(this, entry);
                return;
            }

            if (!TryPayFunds(from, entry))
            {
                from.SendGump(new BazaarInformationGump(1150681, 1150678)); // Some personal possessions that were equipped on the broker still remain in storage, because your backpack cannot hold them. Please free up space in your backpack and return to claim these items.
                return;
            }

            List <BaseCreature> list = new List <BaseCreature>(entry.Creatures);

            foreach (BaseCreature bc in list)
            {
                if (from.Stabled.Count < AnimalTrainer.GetMaxStabled(from))
                {
                    bc.Blessed      = false;
                    bc.ControlOrder = OrderType.Stay;
                    bc.Internalize();
                    bc.IsStabled = true;
                    bc.Loyalty   = BaseCreature.MaxLoyalty; // Wonderfully happy
                    from.Stabled.Add(bc);
                    bc.SetControlMaster(null);
                    bc.SummonMaster = null;

                    entry.RemovePet(bc);
                }
                else
                {
                    from.SendGump(new BazaarInformationGump(1150681, 1150678)); // Some personal possessions that were equipped on the broker still remain in storage, because your backpack cannot hold them. Please free up space in your backpack and return to claim these items.
                    return;
                }
            }

            from.SendGump(new BazaarInformationGump(1150681, 1150677)); // There are no longer any items or funds in storage for your former bazaar stall. Thank you for your diligence in recovering your possessions.
            MaginciaBazaar.RemoveFromStorage(from);
        }
Exemple #2
0
        public void TryTransferItems(Mobile from, StorageEntry entry)
        {
            if (entry == null)
            {
                return;
            }

            int fees = entry.Funds;

            if (fees < 0)
            {
                int owed = fees * -1;
                SayTo(from, String.Format("It looks like you owe {0}gp as back fees.  How much would you like to pay now?", owed.ToString("###,###,###")));
                from.Prompt = new BackfeePrompt(this, entry);
                return;
            }

            if (!TryPayFunds(from, entry))
            {
                from.SendGump(new BazaarInformationGump(1150681, 1150678)); // Some personal possessions that were equipped on the broker still remain in storage, because your backpack cannot hold them. Please free up space in your backpack and return to claim these items.
                return;
            }

            Dictionary <Type, int> copy = new Dictionary <Type, int>(entry.CommodityTypes);

            foreach (KeyValuePair <Type, int> commodities in copy)
            {
                Type type = commodities.Key;
                int  amt  = commodities.Value;

                if (!GiveItems(from, type, amt, entry))
                {
                    from.SendGump(new BazaarInformationGump(1150681, 1150678)); // Some personal possessions that were equipped on the broker still remain in storage, because your backpack cannot hold them. Please free up space in your backpack and return to claim these items.
                    return;
                }
            }

            from.SendGump(new BazaarInformationGump(1150681, 1150677));             // There are no longer any items or funds in storage for your former bazaar stall. Thank you for your diligence in recovering your possessions.
            MaginciaBazaar.RemoveFromStorage(from);
        }