Package net.eternalclient.api.packets
Class ObjectPackets
- java.lang.Object
-
- net.eternalclient.api.packets.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.
-
-
-
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 withctrlDown
- 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 tilectrlDown
- 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 withctrlDown
- 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 withctrlDown
- 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 onctrlDown
- 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 onaction
- the action to be performed on the objectctrlDown
- 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 packetworldPointX
- the x-coordinate of the tile object in the worldworldPointY
- the y-coordinate of the tile object in the worlditemSlot
- the slot index of the itemitemId
- the ID of the itemitemWidgetId
- the ID of the item widgetctrlDown
- 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 spellworldPointX
- the X world point of the tile objectworldPointY
- the Y world point of the tile objectspellWidgetId
- the ID of the spell widgetctrlDown
- 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 objectworldPointX
- the x-coordinate of the object in the worldworldPointY
- the y-coordinate of the object in the worldctrlDown
- 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 objectworldPointX
- the x-coordinate of the object in the game worldworldPointY
- the y-coordinate of the object in the game worldctrlDown
- 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 objectworldPointX
- the X coordinate of the object in the worldworldPointY
- the Y coordinate of the object in the worldctrlDown
- 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 objectworldPointX
- the X coordinate of the tile object in the worldworldPointY
- the Y coordinate of the tile object in the worldctrlDown
- 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 objectworldPointX
- the X coordinate of the object in the worldworldPointY
- the Y coordinate of the object in the worldctrlDown
- 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 idworldPointX
- the x-coordinate of the object's locationworldPointY
- the y-coordinate of the object's locationitemSlot
- the slot of the itemitemId
- the id of the itemitemWidgetId
- the widget id of the itemctrlDown
- 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 widgetworldPointX
- the x-coordinate of the target locationworldPointY
- the y-coordinate of the target locationsourceSlot
- the source slotsourceItemId
- the source item IDsourceWidgetId
- the source widget IDctrlDown
- 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 spellworldPointX
- the x-coordinate of the targeted objectworldPointY
- the y-coordinate of the targeted objectspellWidgetId
- the id of the spell widgetctrlDown
- 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 objectworldPointX
- the X-coordinate of the object in the worldworldPointY
- the Y-coordinate of the object in the worldctrlDown
- 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 idworldPointX
- the world point X coordinateworldPointY
- the world point Y coordinatectrlDown
- 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 objectworldPointX
- the x-coordinate of the world pointworldPointY
- the y-coordinate of the world pointctrlDown
- true if the control key is down, false otherwise- Returns:
- the created packet buffer node
-
-