Skip to content

TargetActionEnum Documentation

Overview

The TargetActionEnum enum defines a set of possible actions that a player can perform on entities or locations in the HighSpell game. It is used by classes like TargetActionManager to determine the context-sensitive interactions available when the player clicks on an entity or point in the game world. Each action is assigned a unique numeric value and a corresponding string identifier, facilitating both client-side logic and server communication.

Usefulness for Botting

The TargetActionEnum enum is crucial for bot development as it enumerates all possible player interactions, such as attack, grab, fish, or walk_here, which can be programmatically triggered via TargetActionManager.handleTargetAction. By mapping actions to numeric IDs, bots can precisely target specific interactions (e.g., grab for picking up items, mine for resource gathering) on entities or locations. The enum’s integration with network packets (e.g., via SocketManager in TargetActionManager) allows bots to simulate player actions, enabling automation of tasks like combat, resource collection, or navigation, though such actions violate HighSpell’s terms of service. Most items and NPCS will have a list of TargetActions called Actions that are obtuse without this enum.

Enum Definition

The TargetActionEnum enum is defined as a JavaScript IIFE (Immediately Invoked Function Expression) that populates an object with action constants. Each entry maps a numeric value to a string key, and vice versa, enabling bidirectional lookup.

Enum Values

The enum defines the following actions, listed with their numeric values and string identifiers:

  • attack = 0: Initiate combat with an entity (e.g., NPC or player).
  • talk_to = 1: Start a conversation with an NPC.
  • shop = 2: Open a shop interface with an NPC or object.
  • grab = 3: Pick up an item or object.
  • pickpocket = 4: Attempt to steal from an NPC.
  • bank_at = 5: Access a bank interface at an object (e.g., bank booth).
  • open = 6: Open an object (e.g., door, chest).
  • close = 7: Close an object (e.g., door).
  • fish = 8: Fish at a fishing spot.
  • mine = 9: Mine resources from a rock or ore vein.
  • chop = 10: Chop a tree for wood.
  • shake = 11: Shake an object (e.g., a tree for resources).
  • comb = 12: Comb an object
  • climb = 13: Climb an object to change map levels (e.g., ladder, rope).
  • climb_same_map_level = 14: Climb an object without changing map levels.
  • enter = 15: Enter a location (e.g., cave entrance).
  • exit = 16: Exit a location (e.g., cave exit).
  • harvest = 17: Harvest resources (e.g., crops).
  • smelt = 18: Smelt ore into bars at a furnace.
  • smith = 19: Smith items at an anvil.
  • search = 20: Search an object for items or information.
  • picklock = 21: Attempt to pick a lock on an object (e.g., door, chest).
  • unlock = 22: Unlock an object with a key.
  • brew = 23: Brew potions or other items.
  • cast = 24: Cast a spell on an entity or location.
  • auto_cast = 25: Enable automatic spell casting.
  • stop_auto_casting = 26: Disable automatic spell casting.
  • mine_through = 27: Mine through an obstacle (e.g., rock wall).
  • go_through = 28: Pass through an object (e.g., gate, portal).
  • craft = 29: Craft an item using resources.
  • sleep_in = 30: Rest or sleep in an object (e.g., bed).
  • touch = 31: Interact with an object by touching it.
  • craft_at = 32: Craft at a specific workstation.
  • use_item_with = 33: Use an inventory item on an entity or object.
  • walk_here = 34: Move the player to a clicked location.
  • trade_with = 35: Initiate a trade with another player or NPC.
  • follow = 36: Follow another player or NPC.
  • moderate = 37: Open moderation tools for a player (e.g., for admins).
  • inspect = 38: View detailed information about an entity.
  • cancel = 39: Cancel the current action or interaction.
  • add_entity = 40: Add a new entity in map editor mode.
  • edit_entity = 41: Edit an existing entity in map editor mode.

Technical Observations

  • Bidirectional Mapping: Each action is assigned both a numeric value (e.g., 0) and a string key (e.g., "attack"), allowing lookup by either number or name.
  • Dependencies: The enum is used by classes like TargetActionManager, Entity, and WorldEntity.
  • Context-Sensitive Actions: The variety of actions supports diverse gameplay mechanics, including combat (attack, cast), resource gathering (mine, chop, fish), navigation (enter, exit, walk_here), and development tools (add_entity, edit_entity).
  • Network Implications: Actions like attack, use_item_with, and walk_here are likely sent to the server via SocketManager (as seen in TargetActionManager), suggesting client-server synchronization for most interactions.

Usage Context

  • Interaction System: Used by TargetActionManager to populate context menus based on mouse clicks, filtering actions by entity type and player capabilities (e.g., combat level checks for attack).
  • Entity Actions: Stored in the _actions array of Entity and its subclasses (e.g., WorldEntity, MainPlayer), determining available interactions.
  • Map Editor: Actions like add_entity and edit_entity support development tools, indicating the enum’s role in both gameplay and debugging.

Per the HighSpell Botting Resources ethos: - This documentation is for educational purposes, analyzing observable game client behavior. - Using this information to create bots violates HighSpell’s terms of service, risking account bans.