From 2993842616623a4ad1e4d58f02d75f21d2700a58 Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 3 Feb 2016 21:22:25 +0100 Subject: Enable use of specialeffect 74,SELF,; Partly based on #1134 Closes #1134 as merged Signed-off-by: Haru --- src/map/script.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src/map') diff --git a/src/map/script.c b/src/map/script.c index 1128f400f..fd653523d 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -13631,25 +13631,27 @@ BUILDIN(npcskilleffect) { * Special effects [Valaris] *------------------------------------------*/ BUILDIN(specialeffect) { - struct block_list *bl=map->id2bl(st->oid); + 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; - if(bl==NULL) - return true; - if (script_hasdata(st,4)) { struct npc_data *nd = npc->name2id(script_getstr(st,4)); if (nd != NULL) - clif->specialeffect(&nd->bl, type, target); + bl = &nd->bl; } else { - if (target == SELF) { - struct map_session_data *sd = script->rid2sd(st); - if (sd != NULL) - clif->specialeffect_single(bl,type,sd->fd); - } else { - clif->specialeffect(bl, type, target); - } + bl = map->id2bl(st->oid); + } + + if (bl == NULL) + return true; + + if (target == SELF) { + struct map_session_data *sd = script->rid2sd(st); + if (sd != NULL) + clif->specialeffect_single(bl, type, sd->fd); + } else { + clif->specialeffect(bl, type, target); } return true; -- cgit v1.2.3-60-g2f50