diff options
author | Victor <victor.lombardi@insa-rouen.fr> | 2016-02-03 21:22:25 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-03-19 23:12:31 +0100 |
commit | 2993842616623a4ad1e4d58f02d75f21d2700a58 (patch) | |
tree | f64021f5239e6d5aa2bb6242cc0326e27d78baf2 /src/map | |
parent | 6d0a5ec55528423d309c875725e382fb0311f92c (diff) | |
download | hercules-2993842616623a4ad1e4d58f02d75f21d2700a58.tar.gz hercules-2993842616623a4ad1e4d58f02d75f21d2700a58.tar.bz2 hercules-2993842616623a4ad1e4d58f02d75f21d2700a58.tar.xz hercules-2993842616623a4ad1e4d58f02d75f21d2700a58.zip |
Enable use of specialeffect 74,SELF,<npc>;
Partly based on #1134
Closes #1134 as merged
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/script.c | 26 |
1 files changed, 14 insertions, 12 deletions
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; |