diff options
author | Trojal <trojal@gmail.com> | 2013-01-10 20:09:39 -0800 |
---|---|---|
committer | Trojal <trojal@gmail.com> | 2013-01-10 20:32:02 -0800 |
commit | 83e7a4954437c13aec639b0b512252cc20a8f36c (patch) | |
tree | b7f6d11b2058248d026f2d9944e8f4b6ac288d50 /doc/sample/npc_test_func.txt | |
parent | 51bfeb38eb139e97e0e1c096c85c15fba234f35b (diff) | |
parent | 38e583df21eccd9e4f31d38acaae32579c6f0d27 (diff) | |
download | hercules-83e7a4954437c13aec639b0b512252cc20a8f36c.tar.gz hercules-83e7a4954437c13aec639b0b512252cc20a8f36c.tar.bz2 hercules-83e7a4954437c13aec639b0b512252cc20a8f36c.tar.xz hercules-83e7a4954437c13aec639b0b512252cc20a8f36c.zip |
Merge rathena repository to form Hercules initial commit.
Diffstat (limited to 'doc/sample/npc_test_func.txt')
-rw-r--r-- | doc/sample/npc_test_func.txt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/sample/npc_test_func.txt b/doc/sample/npc_test_func.txt new file mode 100644 index 000000000..1a60ac69d --- /dev/null +++ b/doc/sample/npc_test_func.txt @@ -0,0 +1,35 @@ +//===== rAthena Script ======================================= +//= Sample: Functions +//===== By: ================================================== +//= rAthena Dev Team +//===== Current Version: ===================================== +//= 20120901 +//===== Description: ========================================= +//= Demonstrates use of functions. +//============================================================ + +// Define the function func001 +function script func001 { + mes "Hello there!"; + next; + return; // Return to script +} + +// Define the function func002 +function script func002 { + return "I'm a function"; +} + +// Uses 3 different methods of displaying dialogue from both internal and external sources. +prontera,168,189,1 script Functions 112,{ + callfunc "func001"; // Calls func001 and displays "Hello there!" + mes callfunc("func002"); // Calls func002 and displays "I'm a function" + next; + callsub L_SUB001; // Calls the label L_SUB001 and displays "I'm a label" + close; + end; + +L_SUB001: + mes "I'm a label"; + return; +} |