IsOwner() публичный Метод

public IsOwner ( Mobile m ) : bool
m Mobile
Результат bool
Пример #1
0
        public static void TryToBuy(Item item, Mobile from)
        {
            PlayerVendor vendor = item.RootParent as PlayerVendor;

            if (vendor == null || !vendor.CanInteractWith(from, false))
            {
                return;
            }

            if (vendor.IsOwner(from))
            {
                vendor.SayTo(from, 503212);                   // You own this shop, just take what you want.
                return;
            }

            VendorItem vi = vendor.GetVendorItem(item);

            if (vi == null)
            {
                vendor.SayTo(from, 503216);                   // You can't buy that.
            }
            else if (!vi.IsForSale)
            {
                vendor.SayTo(from, 503202);                   // This item is not for sale.
            }
            else
            {
                from.CloseGump(typeof(PlayerVendorBuyGump));
                from.SendGump(new PlayerVendorBuyGump(vendor, vi));
            }
        }
Пример #2
0
        public static void TryToBuy(Item item, Mobile from)
        {
            PlayerVendor vendor = item.RootParent as PlayerVendor;

            if (vendor == null || !vendor.CanInteractWith(from, false))
            {
                return;
            }

            if (vendor.IsOwner(from))
            {
                vendor.SayTo(from, 503212);                   // You own this shop, just take what you want.
                return;
            }

            VendorItem vi = vendor.GetVendorItem(item);

            if (vi == null)
            {
                vendor.SayTo(from, 503216);                   // You can't buy that.
            }
            else if (!vi.IsForSale)
            {
                vendor.SayTo(from, 503202);                   // This item is not for sale.
            }
            else if (vi.Created + TimeSpan.FromMinutes(1.0) > DateTime.Now)
            {
                from.SendMessage("You cannot buy this item right now.  Please wait one minute and try again.");
            }
            else
            {
                from.CloseGump(typeof(PlayerVendorBuyGump));
                from.SendGump(new PlayerVendorBuyGump(vendor, vi));
            }
        }
Пример #3
0
            public override void OnClick()
            {
                Mobile from = Owner.From;

                if (!m_Vendor.Deleted && m_Vendor.IsOwner(from) && from.CheckAlive())
                {
                    m_Vendor.Return();
                }
            }
Пример #4
0
        public override void GetChildContextMenuEntries(Mobile from, List <ContextMenuEntry> list, Item item)
        {
            base.GetChildContextMenuEntries(from, list, item);

            PlayerVendor pv = RootParent as PlayerVendor;

            if (pv == null || pv.IsOwner(from))
            {
                return;
            }

            VendorItem vi = pv.GetVendorItem(item);

            if (vi != null)
            {
                list.Add(new BuyEntry(item));
            }
        }