diff options
-rw-r--r-- | npc/functions/RNGesus.txt | 23 | ||||
-rw-r--r-- | npc/functions/util.txt | 15 | ||||
-rw-r--r-- | npc/scripts.conf | 1 |
3 files changed, 15 insertions, 24 deletions
diff --git a/npc/functions/RNGesus.txt b/npc/functions/RNGesus.txt deleted file mode 100644 index f71c2f28a..000000000 --- a/npc/functions/RNGesus.txt +++ /dev/null @@ -1,23 +0,0 @@ -// Evol functions. -// Authors: -// gumi -// Description: -// Randomization helper functions. - - - -// any(<arg>{, ...<arg>}) -// returns one argument randomly - -function script any { - return getarg(rand(getargcount())); -} - - - -// any_of(<array>) -// returns any member of the array - -function script any_of { - return getelementofarray(getarg(0), getarrayindex(getarg(0)) + rand(getarraysize(getarg(0)) - getarrayindex(getarg(0)))); -} diff --git a/npc/functions/util.txt b/npc/functions/util.txt index 99d60da5d..47e07ea72 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -406,3 +406,18 @@ 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)))); +} diff --git a/npc/scripts.conf b/npc/scripts.conf index a02aa4341..544f8f55b 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -9,7 +9,6 @@ "npc/functions/array.txt", "npc/functions/input.txt", "npc/functions/math.txt", -"npc/functions/RNGesus.txt", "npc/functions/string.txt", "npc/functions/time.txt", "npc/functions/timer.txt", |