summaryrefslogtreecommitdiff
path: root/npc/sample/npc_test_func.txt
diff options
context:
space:
mode:
author(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-04 23:25:09 +0000
committer(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-04 23:25:09 +0000
commit195dffc20af1fb32c7e4119988911b72955aeabc (patch)
treeb60d2a5e72d64dc5fc21eb9ce0962631e774a4c9 /npc/sample/npc_test_func.txt
downloadhercules-195dffc20af1fb32c7e4119988911b72955aeabc.tar.gz
hercules-195dffc20af1fb32c7e4119988911b72955aeabc.tar.bz2
hercules-195dffc20af1fb32c7e4119988911b72955aeabc.tar.xz
hercules-195dffc20af1fb32c7e4119988911b72955aeabc.zip
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@2 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'npc/sample/npc_test_func.txt')
-rw-r--r--npc/sample/npc_test_func.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/npc/sample/npc_test_func.txt b/npc/sample/npc_test_func.txt
new file mode 100644
index 000000000..db659fc1b
--- /dev/null
+++ b/npc/sample/npc_test_func.txt
@@ -0,0 +1,27 @@
+
+// 値を返さない関数
+function script func001 {
+ mes "ユーザー定義関数";
+ next;
+ return; // 省略できない
+}
+
+// 値を返す関数
+function script func002 {
+ return "ユーザー定義関数2";
+}
+
+// 関数の呼び出しとサブルーティンのテスト
+prontera.gat,168,189,1 script 関数テスト 112,{
+ callfunc "func001"; // ユーザー定義関数は文字列で指定
+ mes callfunc("func002");
+ next;
+ callsub L_SUB001; // サブルーティンはラベルを直接指定
+ close;
+ end;
+
+L_SUB001:
+ mes "サブルーティン";
+ return; // 省略できない
+}
+