summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-10-03 00:25:11 +0300
committerAndrei Karas <akaras@inbox.ru>2018-10-03 00:53:42 +0300
commit79a55bfd5c029ae833bed01a5a9b497b4dcf1ed7 (patch)
tree772ee49f6f9939026ff8327cd4102756a37a2323 /src/map
parente9bba136ecc2a15fa8a434833cdc0404abbc68be (diff)
downloadhercules-79a55bfd5c029ae833bed01a5a9b497b4dcf1ed7.tar.gz
hercules-79a55bfd5c029ae833bed01a5a9b497b4dcf1ed7.tar.bz2
hercules-79a55bfd5c029ae833bed01a5a9b497b4dcf1ed7.tar.xz
hercules-79a55bfd5c029ae833bed01a5a9b497b4dcf1ed7.zip
Add script command for remove special effect.
New script command: removespecialeffect *removespecialeffect(<effect number>{, <send_target>{, <unit id>{, <account id>}}}) *removespecialeffect(<effect number>{, <send_target>{, "<NPC Name>"{, <account id>}}})
Diffstat (limited to 'src/map')
-rw-r--r--src/map/script.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index b787d0138..1973c5629 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -15428,6 +15428,50 @@ static BUILDIN(specialeffect2)
return true;
}
+static BUILDIN(removespecialeffect)
+{
+ struct block_list *bl = NULL;
+ int type = script_getnum(st, 2);
+ enum send_target target = AREA;
+
+ 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) {
+ return true;
+ }
+
+ if (target == SELF) {
+ 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->removeSpecialEffect_single(bl, type, &sd->bl);
+ }
+ } else {
+ clif->removeSpecialEffect(bl, type, target);
+ }
+
+ return true;
+}
+
/*==========================================
* Nude [Valaris]
*------------------------------------------*/
@@ -25199,6 +25243,7 @@ static void script_parse_builtin(void)
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(removespecialeffect,"i???"),
BUILDIN_DEF_DEPRECATED(specialeffect2,"i??"), // skill effect on players[Valaris]
BUILDIN_DEF(nude,""), // nude command [Valaris]
BUILDIN_DEF(mapwarp,"ssii??"), // Added by RoVeRT