private void handleClick5(Player player, Packet packet) { int interfaceID = packet.getIn().readShort(StreamBuffer.ValueType.A, StreamBuffer.ByteOrder.LITTLE); int itemId = packet.getIn().readShort(true, StreamBuffer.ValueType.A, StreamBuffer.ByteOrder.LITTLE); player.setSlot(packet.getIn().readShort(true, StreamBuffer.ByteOrder.LITTLE)); RSInterface inter = RSInterface.forId(interfaceID); switch (interfaceID) { case 4233: // make 5 ring crafting GemCrafting.startCrafter(player, GemData.getGemSlot()[player.getSlot()], 5, 0); break; case 4239: // make 5 neckalce crafting GemCrafting.startCrafter(player, GemData.getGemSlot()[player.getSlot()], 5, 1); break; case 4245: // make 5 amulet crafting GemCrafting.startCrafter(player, GemData.getGemSlot()[player.getSlot()], 5, 2); break; case 18821: // make 5 bracelet crafting GemCrafting.startCrafter(player, GemData.getGemSlot()[player.getSlot()], 5, 3); break; } if (!player.hasInterfaceOpen(inter)) { // player.getActionSender().removeInterfaces(); return; } if (interfaceID == 5064 || interfaceID == 7423) { BankManager.bankItem(player, player.getSlot(), itemId, 5); } else if (interfaceID == 5382) { BankManager.withdrawItem(player, player.getSlot(), itemId, 5); } else if (interfaceID == 3900) { ShopManager.buyItem(player, player.getSlot(), itemId, 1); } else if (interfaceID == 3823) { ShopManager.sellItem(player, player.getSlot(), itemId, 1); } else if (interfaceID == 3322) { if (player.getStatedInterface() == "duel") player.getDuelMainData().stakeItem(new Item(itemId, 5), player.getSlot()); else TradeManager.offerItem(player, player.getSlot(), itemId, 5); } else if (interfaceID == 3415) { TradeManager.removeTradeItem(player, player.getSlot(), itemId, 5); } else if (interfaceID == 15682 || interfaceID == 15683) { player.getFarmingTools().withdrawItems(itemId, 5); } else if (interfaceID == 15594 || interfaceID == 15595) { player.getFarmingTools().storeItems(itemId, 5); } else if (interfaceID == 1119 || interfaceID == 1120 || interfaceID == 1121 || interfaceID == 1122 || interfaceID == 1123) { // player.getSmithing().smithItem(itemId, 5); SmithBars.startSmithing(player, itemId, 5); } else if (interfaceID == 6669) { player.getDuelMainData().removeStakedItem(new Item(itemId, 5)); } }
private void handleClickAll(Player player, Packet packet) { player.setSlot(packet.getIn().readShort(StreamBuffer.ValueType.A)); int interfaceID = packet.getIn().readShort(); int itemId = packet.getIn().readShort(StreamBuffer.ValueType.A); RSInterface inter = RSInterface.forId(interfaceID); if (!player.hasInterfaceOpen(inter)) { // player.getActionSender().removeInterfaces(); return; } if (interfaceID == 5064 || interfaceID == 7423) { BankManager.bankItem( player, player.getSlot(), itemId, player.getInventory().getItemContainer().getCount(itemId)); } else if (interfaceID == 5382) { BankManager.withdrawItem(player, player.getSlot(), itemId, player.getBank().getCount(itemId)); } else if (interfaceID == 3900) { ShopManager.buyItem(player, player.getSlot(), itemId, 10); } else if (interfaceID == 3823) { ShopManager.sellItem(player, player.getSlot(), itemId, 10); } else if (interfaceID == 3322) { if (player.getStatedInterface() == "duel") player .getDuelMainData() .stakeItem( new Item(itemId, player.getInventory().getItemContainer().getCount(itemId)), player.getSlot()); else TradeManager.offerItem( player, player.getSlot(), itemId, player.getInventory().getItemContainer().getCount(itemId)); } else if (interfaceID == 15594 || interfaceID == 15595) { player.getActionSender().openXInterface(interfaceID); player.setClickItem(itemId); } else if (interfaceID == 15682 || interfaceID == 15683) { player.getActionSender().openXInterface(interfaceID); player.setClickItem(itemId); } else if (interfaceID == 3415) { TradeManager.removeTradeItem(player, player.getSlot(), itemId, Integer.MAX_VALUE); } else if (interfaceID == 6669) { player.getDuelMainData().removeStakedItem(new Item(itemId, Integer.MAX_VALUE)); } }