Server.Mobiles.PlayerVendor.OnDragDrop C# (CSharp) Метод

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

public OnDragDrop ( Mobile from, Item item ) : bool
from Mobile
item Item
Результат bool
		public override bool OnDragDrop( Mobile from, Item item )
		{
			if ( !IsOwner( from ) )
			{
				SayTo( from, 503209 ); // I can only take item from the shop owner.
				return false;
			}

			if ( item is Gold )
            {
                if (this.BankAccount < 1000000)
                {
                    SayTo(from, 503210); // I'll take that to fund my services.

                    this.BankAccount += item.Amount;
                    item.Delete();

                    return true;
                }
                else
                {
                    from.SendLocalizedMessage(1062493); // Your vendor has sufficient funds for operation and cannot accept this gold.

                    return false;
                }
            }
            else
			{
				bool newItem = ( GetVendorItem( item ) == null );

				if ( this.Backpack != null && this.Backpack.TryDropItem( from, item, false ) )
				{
					if ( newItem )
						OnItemGiven( from, item );

					return true;
				}
				else
				{
					SayTo( from, 503211 ); // I can't carry any more.
					return false;
				}
			}
		}