eAthena Support

RO Scripting Tutorial

NPC Scripting Tutorial


My Friend did translate the NPC tutorial Guide, because it was hard for me to understand everything in the guide.
I thought it would be a good idea if i put it in the eathena website so everyone can read it. He didn't finish it off and contains alot of mistakes but I hope it's ok.

Original source:    Click Here german


Index


Chapter 1 - 10(Beginner)


1. Basic Information
2. Commands Part 1: mes, next, close
3. Variables                                                       (coming soon)
4. Operators                                                     (coming soon)
5. Commands Part 2: if, goto                           (coming soon)
6. Labels                                                            (coming soon)
7. Comments                                                     (coming soon)
8. Writing Color                                                 (coming soon)
9. Commands Part 3: menu, input, strcharinfo() (coming soon)
10. Data Types                                                  (coming soon)


Chapter 11-20(Intermediate)


11. Arrays                                                          (coming soon)
12. Commands Part 4: getitem, delitem, countitem, checkweight, getexp, close2. end (coming soon)
13. if in another way                                          (coming soon)
14. Logic Verknüpfung                                        (coming soon)
15. Switch, query_sql and SQL Tutorial              (coming soon)
16. Some other NPCs                                          (coming soon)
17. Loops                                                            (coming soon)
18. select and prompt... menu in a other way   (coming soon)
19. Monster Functions                                        (coming soon)
20. Events                                                            (coming soon)


Chapter 21-30(Professional)


21. RID                                                                (coming soon)
22. Functions - create, call, getarg()              (coming soon)
23. Array Simulation                                          (coming soon)
24. Bit Operatoren                                             (coming soon)
25. Unknown                                                      (coming soon)
26. Unknown                                                      (coming soon)
27. Unknown                                                      (coming soon)
28. Unknown                                                      (coming soon)
29. Unknown                                                      (coming soon)
30. Unknown                                                      (coming soon)




Chapter 1 - Basic Information


We start with the basic information of NPCs...Where he stands, Name of him, in which direction he looks,
What kind of NPC he is and how he look like.

prontera.gat,156,212,7<tab>script<tab>Lonely Angel<tab>811,{


Discription:


prontera.gat = The map where he can be found
156 = X Koordinate
212 = Y Koordinate
7 = Direction (In which direction he looks)
script = NPC Type
Lonely Angel = The Name of the NPC
811 = ID of the NPC. That's the Look he has.
<tab> = that means you have to press the Tab Button. DO NOT make blanks.


Please read through the guide and think about it......It's simple or?

Now you can read something about the NPC.

Mapname, X-Koordinate, Y-Koordinate
Log into your Server and go to the place where you want the NPC to be. Write "/where" without the quotation marks.
You will get this as your answer: mapname.gat,X,Y
Now you've got 3 Infos you'll need. The Mapname, X-Koordinate and the Y-Koordinate.

Direction of NPCs
[1][8][7]
[2][0][6]
[3][4][5]


A very simple grid ..... Do you want your NPC looking up so use 8, do you want it to look left so use 2.
0 is not important so ignore it.


NPC Type
There are many types of NPCs and all have different jobs. The most important things are going to be explained.

script = A normal NPC. You're gonna use it the most.
shop = A shop NPC you are using for shops like Tool Dealer in Prontera.
monster = You gonna use it for permanent monster spawning in a map.
warp = Creates a warp portal in a map.


Name of NPCs
Now you have to start thinking
The only rule is that the name of the NPC have to be shorter than 23 signs.

Looks of NPCs
A list of NPCs and IDs can be found here: http://the-aria.net/Enhancements/npclist.html

So now you are finished with the Basics.
IMPORTANT: Don't forget "{"  !!!!!!


Chapter 2 - Commands Part 1: mes, next, close


Welcome to Chapter 2 .... Now we start with the main scripting

prontera.gat,156,212,7    script    Lonely Angel    811, {


mes "[Lonely Angel]";
mes "Click on next to continue";
next;
mes "[Lonely Angel]";
mes "To quit, just click on the  [close] button";
close;


Discription:

mes "TEST" Opens a text box. The part between "" is what the player gets to read when he hits the NPC.
next This command will create a 'next' button in the message window for the invoking character.
close This command will create a 'close' button in the message window for the invoking character.
What do you recognize? Every Command have to be closed with ;  !!!!! <---- IMPORTANT


Exercise:

Code this NPC the same as I did but do not copy it. It is important that you start learn to use the ; .
Log into your Server and load the NPC. Keep reading after you did this exercise.
This website was created for free with Own-Free-Website.com. Would you also like to have your own website?
Sign up for free