summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorTaylor Locke <kisuka@kisuka.com>2014-10-29 23:30:57 -0700
committerTaylor Locke <kisuka@kisuka.com>2014-10-29 23:31:14 -0700
commit228a826dfdde3581f8e5d757ec458119d6079524 (patch)
tree52a052f2b26a5d03e33b85f7e73d025c91d5d111 /src/map/script.c
parent04c7b7326365c4f68e64875ca3519a20c1f81b79 (diff)
downloadhercules-228a826dfdde3581f8e5d757ec458119d6079524.tar.gz
hercules-228a826dfdde3581f8e5d757ec458119d6079524.tar.bz2
hercules-228a826dfdde3581f8e5d757ec458119d6079524.tar.xz
hercules-228a826dfdde3581f8e5d757ec458119d6079524.zip
Added 2014 Halloween Event and made status change parameter optional on montransform.
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 05321561e..f4c343452 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -17967,6 +17967,7 @@ BUILDIN(montransform) {
struct block_list* bl;
char msg[CHAT_SIZE_MAX];
int mob_id, val1, val2, val3, val4;
+ val1 = val2 = val3 = val4 = 0;
if( (bl = map->id2bl(st->rid)) == NULL )
return true;
@@ -17986,12 +17987,17 @@ BUILDIN(montransform) {
}
tick = script_getnum(st, 3);
- type = (sc_type)script_getnum(st, 4);
- val1 = val2 = val3 = val4 = 0;
- if( !(type > SC_NONE && type < SC_MAX) ) {
- ShowWarning("buildin_montransform: Unsupported status change id %d\n", type);
- return false;
+ if (script_hasdata(st, 4))
+ type = (sc_type)script_getnum(st, 4);
+ else
+ type = SC_NONE;
+
+ if (script_hasdata(st, 4)) {
+ if( !(type > SC_NONE && type < SC_MAX) ) {
+ ShowWarning("buildin_montransform: Unsupported status change id %d\n", type);
+ return false;
+ }
}
if (script_hasdata(st, 5))
@@ -18027,8 +18033,11 @@ BUILDIN(montransform) {
clif->ShowScript(&sd->bl, msg);
status_change_end(bl, SC_MONSTER_TRANSFORM, INVALID_TIMER); // Clear previous
sc_start2(NULL, bl, SC_MONSTER_TRANSFORM, 100, mob_id, type, tick);
- sc_start4(NULL, bl, type, 100, val1, val2, val3, val4, tick);
+
+ if (script_hasdata(st, 4))
+ sc_start4(NULL, bl, type, 100, val1, val2, val3, val4, tick);
}
+
return true;
}
@@ -19460,7 +19469,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(stand, "?"),
BUILDIN_DEF(issit, "?"),
- BUILDIN_DEF(montransform, "vii????"), // Monster Transform [malufett/Hercules]
+ BUILDIN_DEF(montransform, "vi?????"), // Monster Transform [malufett/Hercules]
/* New BG Commands [Hercules] */
BUILDIN_DEF(bg_create_team,"sii"),