summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-10-06 16:06:44 -0300
committerJesusaves <cpntb1@ymail.com>2018-10-06 16:06:44 -0300
commitf5364f11e8424b9cc9560f20cf6dab0fb31a4933 (patch)
tree3ab5e863632fd6a19c2f16c621bc28bec0d0c2e8 /npc
parent1eb354820d2473b9d54af5dbf42d6027591f84fd (diff)
downloadserverdata-f5364f11e8424b9cc9560f20cf6dab0fb31a4933.tar.gz
serverdata-f5364f11e8424b9cc9560f20cf6dab0fb31a4933.tar.bz2
serverdata-f5364f11e8424b9cc9560f20cf6dab0fb31a4933.tar.xz
serverdata-f5364f11e8424b9cc9560f20cf6dab0fb31a4933.zip
Yeah, better to leave this crap at main functions file.
Diffstat (limited to 'npc')
-rw-r--r--npc/functions/main.txt21
-rw-r--r--npc/functions/util.txt13
2 files changed, 21 insertions, 13 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index bf6389989..9446d218b 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -3,6 +3,7 @@
// Authors:
// 4144
// Travolta
+// gumi
// Jesusalva
// Description:
// Built-in essential functions.
@@ -231,6 +232,24 @@ function script npctalkonce {
return true;
}
+// Randomizer functions
+/////////////////////////////////////////////
+
+// returns one argument randomly
+// any( <arg>{, ...<arg>} )
+function script any {
+ return getarg(rand(getargcount()));
+}
+
+// returns any member of the array
+// any_of( <array> )
+function script any_of {
+ return getelementofarray(getarg(0), getarrayindex(getarg(0)) + rand(getarraysize(getarg(0)) - getarrayindex(getarg(0))));
+}
+
+// TMW2 Custom Functions
+/////////////////////////////////////////////
+
function script isin {
if (getmapxy(.@mapName$, .@xpos, .@ypos, 0) != 0)
return false;
@@ -275,6 +294,8 @@ function script validatepin {
return true;
}
+// Linking functions
+/////////////////////////////////////////////
function script getquestlink {
return "[@@q" + getarg(0) + "|@@]";
}
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 47e07ea72..df12de57b 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -407,17 +407,4 @@ function script mercrank {
}
-// Randomizer functions by gumi
-/////////////////////////////////////////////
-// returns one argument randomly
-// any( <arg>{, ...<arg>} )
-function script any {
- return getarg(rand(getargcount()));
-}
-
-// returns any member of the array
-// any_of( <array> )
-function script any_of {
- return getelementofarray(getarg(0), getarrayindex(getarg(0)) + rand(getarraysize(getarg(0)) - getarrayindex(getarg(0))));
-}