Aura.Channel.World.Inventory.BankInventory.WithdrawItem C# (CSharp) Метод

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

Moves item with given id from bank to creature's cursor pocket. Returns whether it was successful or not.
public WithdrawItem ( Creature creature, string tabName, long itemEntityId ) : bool
creature Aura.Channel.World.Entities.Creature
tabName string
itemEntityId long
Результат bool
		public bool WithdrawItem(Creature creature, string tabName, long itemEntityId)
		{
			// Check tab
			if (!this.Tabs.ContainsKey(tabName))
				return false;

			var tab = this.Tabs[tabName];

			// Check item
			var item = tab.GetItem(itemEntityId);
			if (item == null)
				return false;

			// Don't allow withdrawing while the item is being transferred
			// to the current bank.
			if (item.Bank == creature.Temp.CurrentBankId && item.BankTransferRemaining != 0)
				return false;

			// Ask about transfer if item is not in current bank.
			if (item.Bank != creature.Temp.CurrentBankId)
			{
				var fromBankId = item.Bank;
				var toBankId = creature.Temp.CurrentBankId;

				var time = GetTransferTime(fromBankId, toBankId);
				var price = GetTransferFee(item, fromBankId, toBankId);
				var bankTitle = GetName(item.Bank);

				Send.BankTransferInquiry(creature, itemEntityId, bankTitle, time, price);

				return false;
			}

			// Generate a new item, makes moving and updating easier.
			var newItem = new Item(item);

			// Try moving item into cursor pocket
			if (!creature.Inventory.Add(newItem, Pocket.Cursor))
				return false;

			// Remove item from bank
			tab.Remove(item);
			Send.BankRemoveItem(creature, tabName, itemEntityId);

			return true;
		}