summaryrefslogtreecommitdiff
path: root/server/sample/npc_test_func.txt
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-29 22:09:19 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-29 22:09:19 +0300
commit39fa4991f1ce803da04fae342d5ab64111a3df5e (patch)
tree585dbfb0d6800a8a3bc4d3bec3eb8d41e23894e1 /server/sample/npc_test_func.txt
parent61d35617036a2170160e91fdc8f93410ae7d0e3e (diff)
downloaddocs-39fa4991f1ce803da04fae342d5ab64111a3df5e.tar.gz
docs-39fa4991f1ce803da04fae342d5ab64111a3df5e.tar.bz2
docs-39fa4991f1ce803da04fae342d5ab64111a3df5e.tar.xz
docs-39fa4991f1ce803da04fae342d5ab64111a3df5e.zip
Add all existing server docs.
Diffstat (limited to 'server/sample/npc_test_func.txt')
-rw-r--r--server/sample/npc_test_func.txt35
1 files changed, 35 insertions, 0 deletions
diff --git a/server/sample/npc_test_func.txt b/server/sample/npc_test_func.txt
new file mode 100644
index 0000000..a57b6cf
--- /dev/null
+++ b/server/sample/npc_test_func.txt
@@ -0,0 +1,35 @@
+//===== Hercules Script =======================================
+//= Sample: Functions
+//===== By: ==================================================
+//= Hercules Dev Team
+//===== Current Version: =====================================
+//= 20131225
+//===== 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 4_F_KAFRA6,{
+ 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;
+}