public bool DepositItem(Creature creature, long itemEntityId, string bankId, string tabName, int x, int y)
{
// Check tab
if (!this.Tabs.ContainsKey(tabName))
return false;
var tab = this.Tabs[tabName];
// Check item
var item = creature.Inventory.GetItem(itemEntityId);
if (item == null) return false;
// Add gold directly
if (item.Info.Id == 2000)
{
this.Gold += item.Info.Amount;
Send.BankUpdateGold(creature, this.Gold);
}
// Add check as gold
else if (item.Info.Id == 2004)
{
var amount = item.MetaData1.GetInt("EVALUE");
this.Gold += amount;
Send.BankUpdateGold(creature, this.Gold);
}
// Add license as gold
else if (item.HasTag("/personalshoplicense/"))
{
var fee = 0f;
var license = item.Data.PersonalShopLicense;
var licenseData = AuraData.ShopLicenseDb.Find(license);
if (licenseData != null)
fee = licenseData.ExchangeFee;
var amount = item.MetaData1.GetInt("EVALUE");
amount = (int)(amount - amount * fee);
if (amount > 0)
{
this.Gold += amount;
Send.BankUpdateGold(creature, this.Gold);
}
}
// Normal items
else
{
// Generate a new item, makes moving and updating easier.
var newItem = new Item(item);
// Try adding item to tab
if (!tab.TryAdd(newItem, x, y))
return false;
// Update bank id
newItem.Bank = bankId;
// Update client
Send.BankAddItem(creature, newItem, bankId, tabName);
}
// Remove item from inventory
creature.Inventory.Remove(item);
return true;
}