summaryrefslogtreecommitdiff
path: root/doc/sample/npc_test_func.txt
blob: 1a60ac69de8bdf41cf6730ec1557fe82372413b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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;
}