diff options
author | mekolat <mekolat@gmail.com> | 2014-08-21 15:30:07 -0400 |
---|---|---|
committer | mekolat <mekolat@gmail.com> | 2014-10-06 13:36:15 -0400 |
commit | def5f943791e64e8babf81e3a334f1fca7fa0e70 (patch) | |
tree | 8c5ff2a50be921d3a7dba37f1f4a869b79725914 /world/map/conf | |
parent | 15ca5f58ad867c5313b81c40627ac623c22f76ab (diff) | |
download | serverdata-def5f943791e64e8babf81e3a334f1fca7fa0e70.tar.gz serverdata-def5f943791e64e8babf81e3a334f1fca7fa0e70.tar.bz2 serverdata-def5f943791e64e8babf81e3a334f1fca7fa0e70.tar.xz serverdata-def5f943791e64e8babf81e3a334f1fca7fa0e70.zip |
add argument splitter
Diffstat (limited to 'world/map/conf')
-rw-r--r-- | world/map/conf/magic-procedures.sex | 21 |
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) + ""))))) |