public void DropItem(Item item) { Drop drop; if (item is Equip) { drop = new Drop(item as Equip, this, Position.X, Position.Y, 120); } else { drop = new Drop(item, this, Position.X, Position.Y, 120); } InventoryItems.Remove(item.Slot); item.Remove(); Handler12.ModifyInventorySlot(this, 0x24, (byte)item.Slot, 0, null); Map.AddDrop(drop); }
private void UseOneItemStack(Item item) { byte sendslot = (byte)item.Slot; if (item.Amount > 1) { --item.Amount; Handler12.ModifyInventorySlot(this, 0x24, sendslot, sendslot, item); } else { if (InventoryItems.Remove(item.Slot)) { item.Remove(); Handler12.ModifyInventorySlot(this, 0x24, sendslot, sendslot, null); } else Log.WriteLine(LogLevel.Warn, "Error deleting item from slot {0}.", item.Slot); } Save(); }