public static void HandleExchangeObjectTransfertListToInv(ExchangeObjectTransfertListToInvMessage message, WorldClient client) { AbstractTradeExchange dialog = client.Character.GetDialog <AbstractTradeExchange>(); IEnumerable <ItemStack> allPresentItems = dialog.GetAllPresentItems().Where(x => message.ids.Contains(x.ItemUId)); foreach (ItemStack itemStack in allPresentItems) { dialog.MoveItem(itemStack.ItemUId, -1 * (int)itemStack.Quantity); } }
public void GetItems(List <int> items) { if (items.Count > 0) { foreach (int i in items) { Account.Log(new ActionTextInformation("Objet pris du coffre : " + GetItemFromUID(i).Name + " (x" + GetItemFromUID(i).Quantity + ")."), 2); } ExchangeObjectTransfertListToInvMessage msg = new ExchangeObjectTransfertListToInvMessage(items.ToArray()); Account.SocketManager.Send(msg); Account.Log(new BotTextInformation("Trajet : Tous les objets pris du coffre."), 3); } Account.Npc.CloseDialog(); }
public static void HandleExchangeObjectTransfertListToInvMessage(WorldClient client, ExchangeObjectTransfertListToInvMessage message) { var bank = client.Character.Dialog as BankDialog; if (bank == null) { return; } bank.Customer.MoveItems(false, message.ids, false, false); }