Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private final static int WALKING_PACKET = 11;
- private final static int MINI_WALKING_PACKET = 44;
- public final static int ACTION_BUTTON1_PACKET = 50;
- public final static int ACTION_BUTTON2_PACKET = 72;
- public final static int ACTION_BUTTON3_PACKET = 14;
- public final static int ACTION_BUTTON4_PACKET = 18;
- public final static int ACTION_BUTTON5_PACKET = 31;
- public final static int ACTION_BUTTON6_PACKET = 62;
- public final static int ACTION_BUTTON7_PACKET = 21;
- public final static int ACTION_BUTTON8_PACKET = 4;
- public final static int ACTION_BUTTON9_PACKET = 45;
- public final static int ACTION_BUTTON10_PACKET = -11;
- public final static int WORLD_MAP_CLICK = 37;
- public final static int RECEIVE_PACKET_COUNT_PACKET = 15;
- private final static int PLAYER_OPTION_3_PACKET = -1;
- private final static int PLAYER_OPTION_4_PACKET = 17;
- private final static int PLAYER_OPTION_6_PACKET = 67;
- private final static int MOVE_CAMERA_PACKET = 79;
- private final static int INTERFACE_ON_OBJECT = 107;
- private final static int CLICK_PACKET = 73;
- private final static int CLICK_PACKET_2 = 27;
- private final static int MOUVE_MOUSE_PACKET = 53;
- private final static int MOUSE_MOVEMENT_DELAY = 116;
- private final static int KEY_TYPED_PACKET = 86;
- private final static int CLOSE_INTERFACE_PACKET = 56;
- private final static int COMMANDS_PACKET = 109;
- private final static int INTERFACE_ON_INTERFACE = 102;
- private final static int IN_OUT_SCREEN_PACKET = 25;
- private final static int DONE_LOADING_REGION_PACKET = 76;
- private final static int PING_PACKET = 119;
- private final static int SCREEN_PACKET = 20;
- private final static int CHAT_TYPE_PACKET = 2;
- private final static int CHAT_PACKET = 87;
- private final static int PUBLIC_QUICK_CHAT_PACKET = 71;
- private final static int ADD_FRIEND_PACKET = -1;
- private final static int ADD_IGNORE_PACKET = -1;
- private final static int REMOVE_IGNORE_PACKET = -1;
- private final static int JOIN_FRIEND_CHAT_PACKET = -1;
- private final static int CHANGE_FRIEND_CHAT_PACKET = -1;
- private final static int KICK_FRIEND_CHAT_PACKET = -1;
- private final static int KICK_CLAN_CHAT_PACKET = -1;
- private final static int REMOVE_FRIEND_PACKET = -1;
- private final static int SEND_FRIEND_MESSAGE_PACKET = -1;
- private final static int SEND_FRIEND_QUICK_CHAT_PACKET = -1;
- private final static int OBJECT_CLICK1_PACKET = 36;
- private final static int OBJECT_CLICK2_PACKET = 39;
- private final static int OBJECT_CLICK3_PACKET = 40;
- private final static int OBJECT_CLICK4_PACKET = 90;
- private final static int OBJECT_CLICK5_PACKET = 41;
- private final static int OBJECT_EXAMINE_PACKET = 29;
- private final static int NPC_CLICK1_PACKET = 59;
- private final static int ATTACK_NPC_PACKET = 65;
- private final static int NPC_CLICK2_PACKET = 52;
- private final static int NPC_CLICK3_PACKET = 61;
- private final static int NPC_CLICK4_PACKET = 88;
- private static final int NPC_EXAMINE_PACKET = 38;
- private final static int PLAYER_OPTION_1_PACKET = 100;
- private final static int PLAYER_OPTION_2_PACKET = 68;
- private final static int PLAYER_OPTION_9_PACKET = 49;
- private final static int ITEM_TAKE_PACKET = 26;
- private final static int GROUND_ITEM_OPTION_2 = 0;
- private final static int DIALOGUE_CONTINUE_PACKET = 113;
- private final static int ENTER_INTEGER_PACKET = 81;
- private final static int ENTER_NAME_PACKET = 9;
- private final static int ENTER_LONG_TEXT_PACKET = 111;
- private final static int SWITCH_INTERFACE_COMPONENTS_PACKET = 12;
- private final static int INTERFACE_ON_PLAYER = -1;
- private final static int INTERFACE_ON_NPC = 32;
- private final static int COLOR_ID_PACKET = 91;
- private static final int FORUM_THREAD_ID_PACKET = -1;
- private final static int OPEN_URL_PACKET = -1;
- private final static int REPORT_ABUSE_PACKET = -1;
- private final static int GRAND_EXCHANGE_ITEM_SELECT_PACKET = 34;
- private final static int WORLD_LIST_UPDATE = 108;
- private final static int UPDATE_GAMEBAR_PACKET = 84;
- private final static int NIS_VAR_PACKET = 46;
- private final static int MUSIC_PACKET = 93;
- private final static int REQUEST_PLAY_MUSIC_PACKET = 82;
- private final static int CUTSCENE_DONE_PACKET = -1;
- private final static int GARBAGE_CLEAR_PACKET = 8;
- //--------SWITCH_INTERFACE_COMPONENTS_PACKET -- start
- if (opcode == SWITCH_INTERFACE_COMPONENTS_PACKET) {
- @SuppressWarnings("unused")
- int toItemId = stream.readShortLE();
- int fromInterfaceHash = stream.readIntLE();
- int fromSlot = stream.readShort();
- int toInterfaceHash = stream.readIntV1();
- int fromItemId = stream.readShort();
- int toSlot = stream.readShortLE();
- int fromInterfaceId = fromInterfaceHash >> 16;
- int fromComponentId = fromInterfaceHash - (fromInterfaceId << 16);
- int toInterfaceId = toInterfaceHash >> 16;
- int toComponentId = toInterfaceHash - (toInterfaceId << 16);
- if (Settings.DEBUG)
- System.out.println("Switch item " + fromInterfaceId + ", " + toInterfaceId + ", " + fromSlot + ", "
- + toSlot + ", " + fromComponentId + ", " + toComponentId);
- if (Utils.getInterfaceDefinitionsSize() <= fromInterfaceId
- || Utils.getInterfaceDefinitionsSize() <= toInterfaceId)
- return;
- if (!player.getInterfaceManager().containsInterface(fromInterfaceId)
- || !player.getInterfaceManager().containsInterface(toInterfaceId))
- return;
- if (fromComponentId != -1
- && Utils.getInterfaceDefinitionsComponentsSize(fromInterfaceId) <= fromComponentId)
- return;
- if (toComponentId != -1 && Utils.getInterfaceDefinitionsComponentsSize(toInterfaceId) <= toComponentId)
- return;
- if ((fromInterfaceId == Inventory.INVENTORY_INTERFACE || fromInterfaceId == Inventory.INVENTORY_INTERFACE_2)
- && (toInterfaceId == Inventory.INVENTORY_INTERFACE
- || toInterfaceId == Inventory.INVENTORY_INTERFACE_2)) {
- if (toSlot < 0 || toSlot >= player.getInventory().getItemsContainerSize()
- || fromSlot >= player.getInventory().getItemsContainerSize())
- return;
- player.getInventory().switchItem(fromSlot, toSlot);
- } else if ((fromInterfaceId == Inventory.INVENTORY_INTERFACE
- || fromInterfaceId == Inventory.INVENTORY_INTERFACE_2)
- && ((toInterfaceId == 1462 && toComponentId == 14)
- || (toInterfaceId == 1464 && toComponentId == 15))) {
- System.out.println("VAG");
- if (fromSlot >= player.getInventory().getItemsContainerSize()
- || player.getInterfaceManager().containsInventoryInter())
- return;
- Item item = player.getInventory().getItem(fromSlot);
- if (item == null)
- return;
- ItemDefinitions defs = ItemDefinitions.getItemDefinitions(item.getId());
- if (!defs.isWearItem())
- return;
- InventoryOptionsHandler.handleItemOption2(player, fromSlot, item.getId(), item);
- } else if (((fromInterfaceId == 1462 && fromComponentId == 14)
- || (fromInterfaceId == 1464 && fromComponentId == 15))
- && (toInterfaceId == Inventory.INVENTORY_INTERFACE
- || toInterfaceId == Inventory.INVENTORY_INTERFACE_2)) {
- if (fromSlot >= player.getEquipment().getItems().getSize()
- || player.getInterfaceManager().containsInventoryInter())
- return;
- Item item = player.getEquipment().getItem(fromSlot);
- if (item == null)
- return;
- ItemDefinitions defs = ItemDefinitions.getItemDefinitions(item.getId());
- if (!defs.isWearItem())
- return;
- player.getEquipment().handleEquipment(defs.getEquipSlot(), item.getId(),
- WorldPacketsDecoder.ACTION_BUTTON1_PACKET);
- } else if (toInterfaceId == 1430 && (toComponentId >= 55 && toComponentId <= 229)
- || (toInterfaceId == 1436 && (toComponentId >= 25 && toComponentId <= 194))) { // ability
- // bar
- // switch shortcut
- if (fromInterfaceId == 1430 && (fromComponentId >= 55 && fromComponentId <= 229)
- || (fromInterfaceId == 1436 && (fromComponentId >= 25 && fromComponentId <= 194)))
- player.getActionbar().switchShortcut((fromComponentId - (fromInterfaceId == 1430 ? 55 : 25)) / 13,
- (toComponentId - (toInterfaceId == 1430 ? 55 : 25)) / 13);
- // item shortcut inv
- else if (fromInterfaceId == Inventory.INVENTORY_INTERFACE
- || fromInterfaceId == Inventory.INVENTORY_INTERFACE_2) {
- if (fromSlot >= player.getInventory().getItemsContainerSize())
- return;
- Item item = player.getInventory().getItem(fromSlot);
- if (item == null || item.getId() != fromItemId)
- return;
- player.getActionbar().setShortcut((toComponentId - (toInterfaceId == 1430 ? 55 : 25)) / 13,
- new ItemShortcut(item.getId()));
- // item shortcut equip
- } else if ((fromInterfaceId == 1464 && fromComponentId == 15)
- || (fromInterfaceId == 1464 && fromComponentId == 14)) {
- if (fromSlot >= player.getEquipment().getItems().getSize())
- return;
- Item item = player.getEquipment().getItem(fromSlot);
- if (item == null || item.getId() != fromItemId)
- return;
- player.getActionbar().setShortcut((toComponentId - (toInterfaceId == 1430 ? 55 : 25)) / 13,
- new ItemShortcut(item.getId()));
- // spell shortcut
- // Switch item 1464, 1430, 3, 65535, 15, 142
- } else if (fromInterfaceId == 1461 && fromComponentId == 1) {
- if (Magic.getSpellData(fromSlot) == null) // fake spell
- return;
- player.getActionbar().setShortcut((toComponentId - (toInterfaceId == 1430 ? 55 : 25)) / 13,
- new MagicAbilityShortcut(fromSlot));
- } else if (fromInterfaceId == 1449 && fromComponentId == 1) {
- boolean usingDefenceAbilities = player.getCombatDefinitions().onDefenceMenu();
- if (ActionBar.getAbilityData(usingDefenceAbilities ? ActionBar.DEFENCE_ABILITY_SHORTCUT
- : ActionBar.HEAL_ABILITY_SHORTCUT, fromSlot) == null) // fake
- // spell
- return;
- player.getActionbar().setShortcut((toComponentId - (toInterfaceId == 1430 ? 55 : 25)) / 13,
- usingDefenceAbilities ? new DefenceAbilityShortcut(fromSlot)
- : new HealAbilityShortcut(fromSlot));
- } else if (fromInterfaceId == 1452 && fromComponentId == 1) {
- if (ActionBar.getAbilityData(ActionBar.RANGED_ABILITY_SHORTCUT, fromSlot) == null) // fake
- // spell
- return;
- player.getActionbar().setShortcut((toComponentId - (toInterfaceId == 1430 ? 55 : 25)) / 13,
- new RangeAbilityShortcut(fromSlot));
- // prayer shortcut
- } else if (fromInterfaceId == 1460 && fromComponentId == 1) {
- boolean usingStrAbilities = player.getCombatDefinitions().onStrengthMenu();
- if (ActionBar.getAbilityData(
- usingStrAbilities ? ActionBar.STRENGTH_ABILITY_SHORTCUT : ActionBar.MELEE_ABILITY_SHORTCUT,
- fromSlot) == null) // fake
- // spell
- return;
- player.getActionbar().setShortcut((toComponentId - (toInterfaceId == 1430 ? 55 : 25)) / 13,
- usingStrAbilities ? new StrengthAbilityShortcut(fromSlot)
- : new MeleeAbilityShortcut(fromSlot));
- } else if (fromInterfaceId == 1458 && fromComponentId == 31) {
- if (!player.getPrayer().exists(fromSlot))
- return;
- player.getActionbar().setShortcut((toComponentId - (toInterfaceId == 1430 ? 55 : 25)) / 13,
- new PrayerShortcut(fromSlot, player.getPrayer().isAncientCurses()));
- }
- } else if (fromInterfaceId == 1430 && (fromComponentId >= 55 && fromComponentId <= 229)
- || (fromInterfaceId == 1436 && (fromComponentId >= 25 && fromComponentId <= 194))) { // ability
- // bar
- // drag
- // inventory droping drag
- if ((toInterfaceId == InterfaceManager.RESIZABLE_WINDOW_ID && toComponentId == 18))
- player.getActionbar().clearShortcut((fromComponentId - (fromInterfaceId == 1430 ? 55 : 25)) / 13);
- } else if ((fromInterfaceId == Inventory.INVENTORY_INTERFACE
- || fromInterfaceId == Inventory.INVENTORY_INTERFACE_2)
- && (toInterfaceId == InterfaceManager.RESIZABLE_WINDOW_ID && toComponentId == 18)) {
- if (fromSlot >= player.getInventory().getItemsContainerSize())
- return;
- Item item = player.getInventory().getItem(fromSlot);
- if (item == null || item.getId() != fromItemId)
- return;
- InventoryOptionsHandler.handleItemOption7(player, fromSlot, fromItemId, item);
- } else if (fromInterfaceId == 762 && toInterfaceId == 762) {
- if (fromComponentId == toComponentId) {
- if (toComponentId == 10) {
- if (toSlot >= player.getInventory().getItemsContainerSize()
- || fromSlot >= player.getInventory().getItemsContainerSize())
- return;
- player.getInventory().switchItem(fromSlot, toSlot);
- } else
- player.getBank().switchItem(fromSlot, toSlot);
- } else if (fromComponentId == 10) {
- if (fromSlot >= player.getInventory().getItemsContainerSize())
- return;
- player.getBank().switchToBank(fromSlot, toSlot, toComponentId);
- } else if (fromComponentId == 243) {
- if (toComponentId >= 280)
- player.getBank().insertItem(fromSlot, toComponentId == 300 ? toSlot : -1, fromComponentId,
- toComponentId);
- else if (toComponentId == 10) {
- if (toSlot >= player.getInventory().getItemsContainerSize())
- return;
- player.getBank().switchToInventory(fromSlot, toSlot);
- } else
- player.getBank().switchItem(fromSlot, toSlot, fromComponentId, toComponentId);
- }
- } else if (fromInterfaceId == 1265 && toInterfaceId == 1266
- && player.getTemporaryAttributtes().get("is_buying") != null) {
- if ((boolean) player.getTemporaryAttributtes().get("is_buying") == true) {
- Shop shop = (Shop) player.getTemporaryAttributtes().get("shop_instance");
- if (shop == null)
- return;
- // shop.buyItem(player, fromSlot, 1);
- }
- } else if ((fromInterfaceId == 34 || fromInterfaceId == 1417)
- && (toInterfaceId == 34 || toInterfaceId == 1417))
- player.getNotes().switchNotes(fromSlot, toSlot);
- }
- //--------SWITCH_INTERFACE_COMPONENTS_PACKET -- end
- if (opcode == ENTER_INTEGER_PACKET) {
- if (!player.isRunning() || player.isDead())
- return; //put this (if) instead of urs
- if (player.getInterfaceManager().containsInterface(105)
- && player.getTemporaryAttributtes().remove("GEPRICESET") != null) {
- player.getGeManager().modifyPricePerItem((value - 1));
- } else if (player.getInterfaceManager().containsInterface(105)
- && player.getTemporaryAttributtes().remove("GEQUANTITYSET") != null) {
- player.getGeManager().modifyAmount((value - 1));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement