Пример #1
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                Mobile from = sender.Mobile;

                int available = Vendor.MaxAmount - MiningCooperative.PurchaseAmount(from);
                int payment   = Vendor.Quantity * Vendor.Price;

                if (info.ButtonID == 1)
                {
                    if (available > 0)
                    {
                        if (Banker.Withdraw(from, payment, true))
                        {
                            CommodityDeed deed = new CommodityDeed();
                            deed.SetCommodity(new EtherealSand(Vendor.Quantity));
                            from.AddToBackpack(deed);

                            MiningCooperative.AddPurchase(from, Vendor.Quantity);
                            from.SendGump(new MiningCooperativeGump(Vendor, from));
                        }
                        else
                        {
                            Vendor.Say(500192); // Begging thy pardon, but thou canst not afford that.
                        }
                    }
                    else
                    {
                        Vendor.Say(1159195); // Begging thy pardon, but your family has purchased the maximum amount of that commodity.  I cannot sell you more until a new shipment arrives!
                    }
                }
            }