diff options
author | gumi <mekolat@users.noreply.github.com> | 2017-06-06 13:55:07 -0400 |
---|---|---|
committer | gumi <mekolat@users.noreply.github.com> | 2017-07-20 18:13:54 -0400 |
commit | e3b63461ab6e3564e975da56793b5d2fa8064300 (patch) | |
tree | 72dc04b20cccf6d59fe7ef71e84fd30b4918623f /npc/functions/RNGesus.txt | |
parent | 3c9b5c41881137456750d9f8bd5124b09c057100 (diff) | |
download | serverdata-e3b63461ab6e3564e975da56793b5d2fa8064300.tar.gz serverdata-e3b63461ab6e3564e975da56793b5d2fa8064300.tar.bz2 serverdata-e3b63461ab6e3564e975da56793b5d2fa8064300.tar.xz serverdata-e3b63461ab6e3564e975da56793b5d2fa8064300.zip |
more framework functions
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 00000000..f71c2f28 --- /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)))); +} |