rAthena Scripting Documentation

Introduction to rAthena Scripting

Ever wondered how those custom NPCs, quests, and unique events come to life in rAthena? Well, it all boils down to the powerful rAthena scripting language! Think of it as your comprehensive toolkit, packed with commands and functions designed to bring your server ideas to reality. Now, this isn't your typical 'learn to code from scratch' tutorial. Instead, it's a detailed reference manual, perfect for anyone who already has a good grasp of programming basics and is eager to explore the specific tools rAthena offers. If you've got a vision for your server, this documentation is your go-to resource for understanding how to make it happen. Trust me, a solid foundation in general programming will make navigating this manual a breeze! ✨


What is RID and GID?

In rAthena scripting, RID and GID are important identifiers used to refer to game entities.

RID stands for Requesting ID which also refering to the player. It is the unique account identification number of a character that triggers a script's execution. When a script is invoked by a character (e.g., by clicking an NPC, walking into an OnTouch zone, or using an item), the RID of that character is automatically attached to the running script.

GID stands for Game ID. This is a unique identifier for various game objects, including monsters, NPCs, or even a character's account ID. It's primarily used for mob control commands and newer skill implementations.



📚 Setting Up the Script to Run

To make the NPC work in your rAthena server permanently, you need to save the script and configure the server to load it. Follow these steps:


I wanted to test the script once only.

To test your created mytestnpc.txt once, you need to use @loadnpc <pathfile_of_script> and @reloadnpcfile <pathfile_of_script> command via in-game. Follow these steps:

This would look like this: