Exemple #1
0
        public bool TryBuyout(Mobile m)
        {
            if (!OnGoing || InClaimPeriod || Buyout <= 0)
            {
                return(false);
            }

            if (m.Account is Account acct)
            {
                if (!acct.WithdrawGold(Buyout))
                {
                    m.SendLocalizedMessage(1155867); // The amount entered is invalid. Verify that there are sufficient funds to complete this transaction.
                    return(false);
                }

                VaultLogging.Buyout(this, m, Buyout);

                if (HighestBid != null && HighestBid.Mobile != m)
                {
                    DoOutBidMessage(HighestBid.Mobile);

                    HighestBid.Refund(this, HighestBid.CurrentBid);
                }

                HighestBid            = GetBidEntry(m, true);
                HighestBid.CurrentBid = Buyout - (int)(Buyout * .05);
                CurrentBid            = Buyout;

                EndAuction(true);
                ClaimPrize(m);
                return(true);
            }

            return(false);
        }