Esempio n. 1
0
        public void ClaimPrize(Mobile m)
        {
            var item = Auction.AuctionItem;

            if (item != null)
            {
                var name      = Auction.AuctionItemName();
                var vaultCont = item as AccountVaultContainer;

                if (vaultCont != null)
                {
                    if (vaultCont.TryClaim(m))
                    {
                        Auction.Reset();
                        m.SendLocalizedMessage(1152339, name); // A reward of ~1_ITEM~ has been placed in your backpack.
                    }
                    else
                    {
                        m.SendLocalizedMessage(1158079); // You cannot currently unpack this vault or claim this item, as doing so would overload you!
                    }
                }
                else if (m.Backpack != null && m.Backpack.TryDropItem(m, item, false))
                {
                    m.SendLocalizedMessage(1152339, name); // A reward of ~1_ITEM~ has been placed in your backpack.
                    item.Movable = true;

                    Auction.Reset();
                }
                else
                {
                    m.SendLocalizedMessage(1158079); // You cannot currently unpack this vault or claim this item, as doing so would overload you!
                }
            }
        }