public L2Item AddItem(int itemId, int count, L2Player player, bool ExistsInDb = false) { L2Item item = GetItemByItemId(itemId); if ((item != null) && item.Template.Stackable) { item.ChangeCount(count, player); item.UpdateDatabase(); } else { //for (int i = 0; i < Count; i++) // { ItemTemplate template = ItemTable.Instance.GetItem(itemId); if (template == null) { return(null); } item = ItemTable.Instance.CreateItem(itemId, count, player); item.OwnerId = player.ObjId; item.SlotLocation = 0; item.ExistsInDb = ExistsInDb; item.Location = L2Item.ItemLocation.Inventory; Items.Add(item); item.UpdateDatabase(); // } } return(item); }
public L2Item AddItem(L2Item item, L2Player player) { if (item != null) { item.OwnerId = player.ObjId; //item.SlotLocation = 0; Items.Add(item); item.UpdateDatabase(); } return(item); }