Class ObjectPackets


  • public class ObjectPackets
    extends java.lang.Object
    Utility class for creating and queuing object packets.
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectPackets()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static RSPacketBufferNode createItemOnObjectPacket​(int id, int worldPointX, int worldPointY, int itemSlot, int itemId, int itemWidgetId, boolean ctrlDown)
      Creates a packet to create an item on an object.
      static RSPacketBufferNode createObjectFifthActionPacket​(int id, int worldPointX, int worldPointY, boolean ctrlDown)
      Creates a packet buffer node for the fifth action packet with the given parameters.
      static RSPacketBufferNode createObjectFirstActionPacket​(int id, int worldPointX, int worldPointY, boolean ctrlDown)
      Creates a first action packet for an object with the given ID, world coordinates, and control key status.
      static RSPacketBufferNode createObjectFourthActionPacket​(int id, int worldPointX, int worldPointY, boolean ctrlDown)
      Creates a packet buffer node for the fourth action object packet.
      static RSPacketBufferNode createObjectSecondActionPacket​(int id, int worldPointX, int worldPointY, boolean ctrlDown)
      Creates a packet buffer node with the specified parameters for the second action of an object.
      static RSPacketBufferNode createObjectThirdActionPacket​(int id, int worldPointX, int worldPointY, boolean ctrlDown)
      Creates a packet buffer node for the third action packet.
      static RSPacketBufferNode createSpellOnObjectPacket​(int id, int worldPointX, int worldPointY, int spellWidgetId, boolean ctrlDown)
      Creates a packet for casting a spell on an object.
      static RSPacketBufferNode createWidgetOnObjectPacket​(int id, int worldPointX, int worldPointY, int sourceSlot, int sourceItemId, int sourceWidgetId, boolean ctrlDown)
      Creates a packet buffer node for sending a widget-on-object packet.
      static void queueItemUseOnTileObjectPacket​(int id, int worldPointX, int worldPointY, int itemSlot, int itemId, int itemWidgetId, boolean ctrlDown)
      Queues a packet to use an item on a tile object.
      static void queueSpellOnTileObjectPacket​(int id, int worldPointX, int worldPointY, int spellWidgetId, boolean ctrlDown)
      Queues and sends a packet to create a spell on a tile object.
      static void queueTileObjectAction1Packet​(int id, int worldPointX, int worldPointY, boolean ctrlDown)
      Queues a tile object action 1 packet to be sent.
      static void queueTileObjectAction2Packet​(int id, int worldPointX, int worldPointY, boolean ctrlDown)
      Queues a packet to send the second action of a tile object to server.
      static void queueTileObjectAction3Packet​(int id, int worldPointX, int worldPointY, boolean ctrlDown)
      Queues a tile object action packet and sends it.
      static void queueTileObjectAction4Packet​(int id, int worldPointX, int worldPointY, boolean ctrlDown)
      Queues a tile object action fourth packet to be sent.
      static void queueTileObjectAction5Packet​(int id, int worldPointX, int worldPointY, boolean ctrlDown)
      Queues a tile object action 5 packet with the given ID, world point X, world point Y, and control key status.
      static void tileObjectAction​(GameObject object, java.lang.String action, boolean ctrlDown)
      Performs the corresponding action on the given GameObject based on the provided action string and control key status.
      static void tileObjectFifthOption​(GameObject object, boolean ctrlDown)
      Performs the fifth option action on the given GameObject at its interact coordinates.
      static void tileObjectFirstOption​(GameObject object, boolean ctrlDown)
      Moves the specified GameObject to the front and performs the first option action on it.
      static void tileObjectFourthOption​(GameObject object, boolean ctrlDown)
      Queues the fourth option tile object action for the specified game object, given the object's interact coordinates and plane.
      static void tileObjectSecondOption​(GameObject object, boolean ctrlDown)
      Tiles the specified GameObject to the given options along with the specified control key press.
      static void tileObjectThirdOption​(GameObject object, boolean ctrlDown)
      Clicks on the specified GameObject and performs the third option action.
      static void useItemOnTileObject​(Item item, GameObject object)
      Uses the specified item on the provided game object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ObjectPackets

        public ObjectPackets()
    • Method Detail

      • tileObjectFirstOption

        public static void tileObjectFirstOption​(GameObject object,
                                                 boolean ctrlDown)
        Moves the specified GameObject to the front and performs the first option action on it.
        Parameters:
        object - the GameObject to be interacted with
        ctrlDown - true if the control key is being held down, false otherwise
      • tileObjectSecondOption

        public static void tileObjectSecondOption​(GameObject object,
                                                  boolean ctrlDown)
        Tiles the specified GameObject to the given options along with the specified control key press.
        Parameters:
        object - the GameObject to tile
        ctrlDown - true if the control key is pressed, false otherwise
      • tileObjectThirdOption

        public static void tileObjectThirdOption​(GameObject object,
                                                 boolean ctrlDown)
        Clicks on the specified GameObject and performs the third option action.
        Parameters:
        object - the GameObject to interact with
        ctrlDown - true if the CTRL key is being held down, false otherwise
      • tileObjectFourthOption

        public static void tileObjectFourthOption​(GameObject object,
                                                  boolean ctrlDown)
        Queues the fourth option tile object action for the specified game object, given the object's interact coordinates and plane. Optionally, if ctrlDown is true, performs the action while the CTRL key is held down.
        Parameters:
        object - the game object to interact with
        ctrlDown - indicates whether the CTRL key is held down
      • tileObjectFifthOption

        public static void tileObjectFifthOption​(GameObject object,
                                                 boolean ctrlDown)
        Performs the fifth option action on the given GameObject at its interact coordinates.
        Parameters:
        object - the GameObject to perform the action on
        ctrlDown - true if the control key is held down, false otherwise
      • tileObjectAction

        public static void tileObjectAction​(GameObject object,
                                            java.lang.String action,
                                            boolean ctrlDown)
        Performs the corresponding action on the given GameObject based on the provided action string and control key status.
        Parameters:
        object - the GameObject to perform the action on
        action - the action to be performed on the object
        ctrlDown - true if the control key is down, false otherwise
      • useItemOnTileObject

        public static void useItemOnTileObject​(Item item,
                                               GameObject object)
        Uses the specified item on the provided game object.
        Parameters:
        item - The item to use.
        object - The game object to use the item on.
      • queueItemUseOnTileObjectPacket

        public static void queueItemUseOnTileObjectPacket​(int id,
                                                          int worldPointX,
                                                          int worldPointY,
                                                          int itemSlot,
                                                          int itemId,
                                                          int itemWidgetId,
                                                          boolean ctrlDown)
        Queues a packet to use an item on a tile object.
        Parameters:
        id - the ID of the packet
        worldPointX - the x-coordinate of the tile object in the world
        worldPointY - the y-coordinate of the tile object in the world
        itemSlot - the slot index of the item
        itemId - the ID of the item
        itemWidgetId - the ID of the item widget
        ctrlDown - whether the control key is held down
      • queueSpellOnTileObjectPacket

        public static void queueSpellOnTileObjectPacket​(int id,
                                                        int worldPointX,
                                                        int worldPointY,
                                                        int spellWidgetId,
                                                        boolean ctrlDown)
        Queues and sends a packet to create a spell on a tile object.
        Parameters:
        id - the ID of the spell
        worldPointX - the X world point of the tile object
        worldPointY - the Y world point of the tile object
        spellWidgetId - the ID of the spell widget
        ctrlDown - true if the control key is held down, false otherwise
      • queueTileObjectAction1Packet

        public static void queueTileObjectAction1Packet​(int id,
                                                        int worldPointX,
                                                        int worldPointY,
                                                        boolean ctrlDown)
        Queues a tile object action 1 packet to be sent.
        Parameters:
        id - the ID of the object
        worldPointX - the x-coordinate of the object in the world
        worldPointY - the y-coordinate of the object in the world
        ctrlDown - whether the Ctrl key is down
      • queueTileObjectAction2Packet

        public static void queueTileObjectAction2Packet​(int id,
                                                        int worldPointX,
                                                        int worldPointY,
                                                        boolean ctrlDown)
        Queues a packet to send the second action of a tile object to server.
        Parameters:
        id - the unique identifier of the tile object
        worldPointX - the x-coordinate of the object in the game world
        worldPointY - the y-coordinate of the object in the game world
        ctrlDown - indicates if the control key is being held down
      • queueTileObjectAction3Packet

        public static void queueTileObjectAction3Packet​(int id,
                                                        int worldPointX,
                                                        int worldPointY,
                                                        boolean ctrlDown)
        Queues a tile object action packet and sends it.
        Parameters:
        id - the ID of the object
        worldPointX - the X coordinate of the object in the world
        worldPointY - the Y coordinate of the object in the world
        ctrlDown - true if the control key is held down, false otherwise
      • queueTileObjectAction4Packet

        public static void queueTileObjectAction4Packet​(int id,
                                                        int worldPointX,
                                                        int worldPointY,
                                                        boolean ctrlDown)
        Queues a tile object action fourth packet to be sent.
        Parameters:
        id - the ID of the tile object
        worldPointX - the X coordinate of the tile object in the world
        worldPointY - the Y coordinate of the tile object in the world
        ctrlDown - true if the control key is held down, false otherwise
      • queueTileObjectAction5Packet

        public static void queueTileObjectAction5Packet​(int id,
                                                        int worldPointX,
                                                        int worldPointY,
                                                        boolean ctrlDown)
        Queues a tile object action 5 packet with the given ID, world point X, world point Y, and control key status.
        Parameters:
        id - the ID of the object
        worldPointX - the X coordinate of the object in the world
        worldPointY - the Y coordinate of the object in the world
        ctrlDown - true if the control key is pressed, false otherwise
      • createItemOnObjectPacket

        public static RSPacketBufferNode createItemOnObjectPacket​(int id,
                                                                  int worldPointX,
                                                                  int worldPointY,
                                                                  int itemSlot,
                                                                  int itemId,
                                                                  int itemWidgetId,
                                                                  boolean ctrlDown)
        Creates a packet to create an item on an object.
        Parameters:
        id - the object's id
        worldPointX - the x-coordinate of the object's location
        worldPointY - the y-coordinate of the object's location
        itemSlot - the slot of the item
        itemId - the id of the item
        itemWidgetId - the widget id of the item
        ctrlDown - true if Ctrl key is down, false otherwise
        Returns:
        the created RSPacketBufferNode object
      • createWidgetOnObjectPacket

        public static RSPacketBufferNode createWidgetOnObjectPacket​(int id,
                                                                    int worldPointX,
                                                                    int worldPointY,
                                                                    int sourceSlot,
                                                                    int sourceItemId,
                                                                    int sourceWidgetId,
                                                                    boolean ctrlDown)
        Creates a packet buffer node for sending a widget-on-object packet.
        Parameters:
        id - the ID of the widget
        worldPointX - the x-coordinate of the target location
        worldPointY - the y-coordinate of the target location
        sourceSlot - the source slot
        sourceItemId - the source item ID
        sourceWidgetId - the source widget ID
        ctrlDown - indicates if the CTRL key is pressed down
        Returns:
        the created packet buffer node
      • createSpellOnObjectPacket

        public static RSPacketBufferNode createSpellOnObjectPacket​(int id,
                                                                   int worldPointX,
                                                                   int worldPointY,
                                                                   int spellWidgetId,
                                                                   boolean ctrlDown)
        Creates a packet for casting a spell on an object.
        Parameters:
        id - the id of the spell
        worldPointX - the x-coordinate of the targeted object
        worldPointY - the y-coordinate of the targeted object
        spellWidgetId - the id of the spell widget
        ctrlDown - true if the control key is held down, false otherwise
        Returns:
        the created RSPacketBufferNode object
      • createObjectFirstActionPacket

        public static RSPacketBufferNode createObjectFirstActionPacket​(int id,
                                                                       int worldPointX,
                                                                       int worldPointY,
                                                                       boolean ctrlDown)
        Creates a first action packet for an object with the given ID, world coordinates, and control key status.
        Parameters:
        id - The ID of the object.
        worldPointX - The x-coordinate of the object in the game world.
        worldPointY - The y-coordinate of the object in the game world.
        ctrlDown - True if the control key is down, false otherwise.
        Returns:
        The created RSPacketBufferNode.
      • createObjectSecondActionPacket

        public static RSPacketBufferNode createObjectSecondActionPacket​(int id,
                                                                        int worldPointX,
                                                                        int worldPointY,
                                                                        boolean ctrlDown)
        Creates a packet buffer node with the specified parameters for the second action of an object.
        Parameters:
        id - The ID of the object.
        worldPointX - The X coordinate of the world point.
        worldPointY - The Y coordinate of the world point.
        ctrlDown - Whether the control key is down or not.
        Returns:
        The created packet buffer node.
      • createObjectThirdActionPacket

        public static RSPacketBufferNode createObjectThirdActionPacket​(int id,
                                                                       int worldPointX,
                                                                       int worldPointY,
                                                                       boolean ctrlDown)
        Creates a packet buffer node for the third action packet.
        Parameters:
        id - the ID of the object
        worldPointX - the X-coordinate of the object in the world
        worldPointY - the Y-coordinate of the object in the world
        ctrlDown - true if the control key is down, false otherwise
        Returns:
        the created packet buffer node
      • createObjectFourthActionPacket

        public static RSPacketBufferNode createObjectFourthActionPacket​(int id,
                                                                        int worldPointX,
                                                                        int worldPointY,
                                                                        boolean ctrlDown)
        Creates a packet buffer node for the fourth action object packet.
        Parameters:
        id - the object id
        worldPointX - the world point X coordinate
        worldPointY - the world point Y coordinate
        ctrlDown - true if the control key is pressed, false otherwise
        Returns:
        the created packet buffer node
      • createObjectFifthActionPacket

        public static RSPacketBufferNode createObjectFifthActionPacket​(int id,
                                                                       int worldPointX,
                                                                       int worldPointY,
                                                                       boolean ctrlDown)
        Creates a packet buffer node for the fifth action packet with the given parameters.
        Parameters:
        id - the identifier of the object
        worldPointX - the x-coordinate of the world point
        worldPointY - the y-coordinate of the world point
        ctrlDown - true if the control key is down, false otherwise
        Returns:
        the created packet buffer node