diff options
author | Saulc <lucashelaine14@gmail.com> | 2018-01-13 20:50:42 +0100 |
---|---|---|
committer | Saulc <lucashelaine14@gmail.com> | 2018-01-13 20:50:42 +0100 |
commit | 20df2abc1aca00d6aa5dc78347133890f36b32f3 (patch) | |
tree | 4ad4a8bb8b0605473a702e314799a4626347721a /npc/functions/RNGesus.txt | |
download | serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.gz serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.bz2 serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.xz serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.zip |
Initial commit
Diffstat (limited to 'npc/functions/RNGesus.txt')
-rw-r--r-- | npc/functions/RNGesus.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/npc/functions/RNGesus.txt b/npc/functions/RNGesus.txt new file mode 100644 index 000000000..f71c2f28a --- /dev/null +++ b/npc/functions/RNGesus.txt @@ -0,0 +1,23 @@ +// 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)))); +} |