diff options
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/src/map/script.c b/src/map/script.c index 91f1d8cc9..5777ccb3e 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -14890,24 +14890,40 @@ BUILDIN(npcskilleffect) { *------------------------------------------*/ BUILDIN(specialeffect) { struct block_list *bl = NULL; - int type = script_getnum(st,2); - enum send_target target = script_hasdata(st,3) ? (send_target)script_getnum(st,3) : AREA; + int type = script_getnum(st, 2); + enum send_target target = AREA; - if (script_hasdata(st,4)) { - struct npc_data *nd = npc->name2id(script_getstr(st,4)); - if (nd != NULL) - bl = &nd->bl; + if (script_hasdata(st, 3)) { + target = script_getnum(st, 3); + } + + if (script_hasdata(st, 4)) { + if (script_isstringtype(st, 4)) { + struct npc_data *nd = npc->name2id(script_getstr(st, 4)); + if (nd != NULL) { + bl = &nd->bl; + } + } else { + bl = map->id2bl(script_getnum(st, 4)); + } } else { bl = map->id2bl(st->oid); } - if (bl == NULL) + if (bl == NULL) { return true; + } if (target == SELF) { - struct map_session_data *sd = script->rid2sd(st); - if (sd != NULL) + struct map_session_data *sd; + if (script_hasdata(st, 5)) { + sd = map->id2sd(script_getnum(st, 5)); + } else { + sd = script->rid2sd(st); + } + if (sd != NULL) { clif->specialeffect_single(bl, type, sd->fd); + } } else { clif->specialeffect(bl, type, target); } @@ -23579,7 +23595,7 @@ void script_parse_builtin(void) { BUILDIN_DEF(petskillsupport,"viiii"), // [Skotlex] BUILDIN_DEF(skilleffect,"vi"), // skill effect [Celest] BUILDIN_DEF(npcskilleffect,"viii"), // npc skill effect [Valaris] - BUILDIN_DEF(specialeffect,"i??"), // npc skill effect [Valaris] + BUILDIN_DEF(specialeffect,"i???"), // npc skill effect [Valaris] BUILDIN_DEF(specialeffect2,"i??"), // skill effect on players[Valaris] BUILDIN_DEF(nude,""), // nude command [Valaris] BUILDIN_DEF(mapwarp,"ssii??"), // Added by RoVeRT |