public string DropAll(string[] @params, MooNetClient invokerClient) { if (invokerClient == null) return "You can not invoke this command from console."; if (invokerClient.InGameClient == null) return "You can only invoke this command while ingame."; var player = invokerClient.InGameClient.Player; var bpItems = new List<Item>(player.Inventory.GetBackPackItems()); foreach (var item in bpItems) { var msg = new InventoryDropItemMessage {ItemID = item.DynamicID}; player.Inventory.Consume(invokerClient.InGameClient, msg); } return string.Format("Dropped {0} Items for you", bpItems.Count); }
private void OnInventoryDropItemMessage(InventoryDropItemMessage msg) { Item item = _owner.World.GetItem(msg.ItemID); if (_equipment.IsItemEquipped(item)) { _equipment.UnequipItem(item); SendVisualInventory(this._owner); } else { _inventoryStash.RemoveItem(item); } item.Drop(null, _owner.Position); AcceptMoveRequest(item); }
private void OnInventoryDropItemMessage(InventoryDropItemMessage msg) { if (isItemEquipped(msg.ItemId)) { UnequipItem(msg.ItemId); RefreshVisual(owner.Id); } else { RemoveItem(msg.ItemId); } AcceptMoveRequest(msg.ItemId, new InvLoc { Field0 = owner.Id, Field1 = -1, Field2 = -1, Field3 = -1 }); owner.Universe.DropItem(owner, owner.InGameClient.items[msg.ItemId], owner.Position); }
private void OnInventoryDropItemMessage(InventoryDropItemMessage msg) { var item = GetItem(msg.ItemID); if (item == null) return; // TODO: Throw smthg? /fasbat if (_equipment.IsItemEquipped(item)) { _equipment.UnequipItem(item); SendVisualInventory(this._owner); } else { var sourceGrid = (item.InvLoc.EquipmentSlot == 0 ? _inventoryGrid : _stashGrid); sourceGrid.RemoveItem(item); } item.CurrentState = ItemState.Dropping; item.Unreveal(_owner); item.SetNewWorld(_owner.World); item.Drop(null, _owner.Position); item.CurrentState = ItemState.Normal; AcceptMoveRequest(item); }
private void OnInventoryDropItemMessage(InventoryDropItemMessage msg) { Item item = _owner.World.GetItem(msg.ItemID); if (IsItemEquipped(item)) { UnequipItem(item); RefreshVisual(_owner.DynamicID); } else { RemoveItem(item); } AcceptMoveRequest(item); item.Drop(null, _owner.Position); }