summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWushin <pasekei@gmail.com>2014-10-06 19:26:00 -0500
committerWushin <pasekei@gmail.com>2014-10-06 19:26:00 -0500
commit9f69379edceb30c117ee46cd4acb6de66b0f9890 (patch)
treebdbdf30559267dffa71dc5424fd504aa65c27b85
parent3f2414ab7eaa8edf2960e330a9318e69f116173b (diff)
parentdef5f943791e64e8babf81e3a334f1fca7fa0e70 (diff)
downloadserverdata-9f69379edceb30c117ee46cd4acb6de66b0f9890.tar.gz
serverdata-9f69379edceb30c117ee46cd4acb6de66b0f9890.tar.bz2
serverdata-9f69379edceb30c117ee46cd4acb6de66b0f9890.tar.xz
serverdata-9f69379edceb30c117ee46cd4acb6de66b0f9890.zip
Merge pull request #153 from mekolat/utilities
add reusable utilities
-rw-r--r--world/map/conf/magic-procedures.sex21
1 files changed, 21 insertions, 0 deletions
diff --git a/world/map/conf/magic-procedures.sex b/world/map/conf/magic-procedures.sex
index 2a8258cb..6f9c3246 100644
--- a/world/map/conf/magic-procedures.sex
+++ b/world/map/conf/magic-procedures.sex
@@ -335,3 +335,24 @@
(BLOCK "1 is Tulimshar, 9 is Hurnscald and 20 is Nivalis"
(message caster "A powerful magic drains your spell just as it is beginning to take shape!")
(ABORT))))
+
+(PROCEDURE script_split_str (d str v m)
+ (FOR a 0 m
+ (BLOCK
+ (IF (< (strlen str) 1) (BREAK))
+ (SET arglen (strlen str))
+ (SET argoffset
+ (if_then_else
+ (contains_string str d)
+ (strstr str d)
+ arglen))
+ (SET arg
+ (if_then_else (== arglen argoffset)
+ str
+ (substr str 0 argoffset)))
+ (set_script_str caster (+ (+ "@" v) (+ a "$")) arg)
+ (SET str
+ (if_then_else
+ (> arglen (- argoffset 1))
+ (substr str (+ argoffset 1) arglen)
+ "")))))