summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgumi <mekolat@users.noreply.github.com>2017-05-27 11:57:52 -0400
committergumi <mekolat@users.noreply.github.com>2017-06-03 12:57:14 -0400
commit289365d08535bc626f700e9c7ac47fef5a2d3370 (patch)
tree8c221c636cb5ca15f209e4b8878951c34e36e45e /src
parent9d28c5187812e496b10d6fbaf62c642a69916021 (diff)
downloadhercules-289365d08535bc626f700e9c7ac47fef5a2d3370.tar.gz
hercules-289365d08535bc626f700e9c7ac47fef5a2d3370.tar.bz2
hercules-289365d08535bc626f700e9c7ac47fef5a2d3370.tar.xz
hercules-289365d08535bc626f700e9c7ac47fef5a2d3370.zip
allow to use specialeffect() on any unit, and to send to any player
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c36
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