Skip to content

Overview of Utility APIs

The utility APIs provide various helper functions that enhance the functionality and ease of use within the game. These APIs cover a wide range of operations, from player interactions to game mechanics.

Key Points

  • Enhanced Interaction: These APIs allow for more dynamic interactions with the game world, such as simulating clicks and adjusting player orientation.
  • Ease of Use: Simplify complex tasks like checking spell range, retrieving player speed, and determining facing direction.
  • Versatility: Cover a broad spectrum of functionalities, making them useful for various gameplay mechanics and scenarios.

Covered APIs

  • SetActivePlayerFacing: Forces the player to face a specified direction using coordinates (X, Y, Z) or a unit.
  • SetActivePlayerPitch: Sets the pitch of the player to face a specified direction using coordinates (X, Y, Z). Very useful for flying.
  • GetDragonRidingSpeed: Retrieves the current speed of the player while dragon riding.
  • IsFacing: Checks if the player is facing a specific unit, object, or position and returns a boolean.
  • GetFacing: Retrieves the current facing direction of a specified unit or object in radians.
  • GetCorpseLocation: Retrieves the coordinates (X, Y, Z) of the player's corpse.
  • IsSpellInRange: Checks whether a specified spell can be cast on a given unit based on the spell's range.
  • ClickPosition: Simulates a mouse click at a specified position in the game world using coordinates (X, Y, Z) and an optional boolean for right-click.
  • FacePosition: Makes a unit or object face a specified position in the game world using coordinates (X, Y, Z) or a unit.
  • GetLastClickPosition: Retrieves the world coordinates (X, Y, Z) of the last position clicked by the player.

Conclusion

The utility APIs provide essential functions that facilitate various in-game operations, making it easier for developers to interact with and manipulate game mechanics. By leveraging these APIs, developers can create more dynamic and responsive game experiences.