public void DropItem(Item item) { Drop drop = new Drop(item, this, Position.X, Position.Y, 120); if(drop == null) return; this.Inventory.InventoryItems.Remove((byte)item.Slot); item.Delete(); Handler12.ModifyInventorySlot(this, 0x24, (byte)item.Slot, 0, null); Map.AddDrop(drop); }
public void RemoveInventory(Item pItem) { try { locker.WaitOne(); Handler12.ModifyInventorySlot(InventoryOwner, 0x24, (byte)pItem.Slot, 0, null); pItem.Delete(); this.InventoryItems.Remove((byte)pItem.Slot); } finally { locker.ReleaseMutex(); } }
private void UseOneItemStack(Item item) { byte sendslot = (byte)item.Slot; if (item.Ammount > 1) { --item.Ammount; Handler12.ModifyInventorySlot(this, 0x24, sendslot, sendslot, item); } else { if (this.Inventory.InventoryItems.Remove((byte)item.Slot)) { item.Delete(); Handler12.ModifyInventorySlot(this, 0x24, sendslot, sendslot, null); } else Log.WriteLine(LogLevel.Warn, "Error deleting item from slot {0}.", item.Slot); } Save(); }