summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-07 18:19:57 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-16 22:44:20 +0300
commit61d6c958d5a753904d32ef2057b50f426bb0f3b9 (patch)
tree97a563e9f9ecc99ada1f7505459c58add34e47b2 /src/map/npc.c
parent625ed85b6a3d88587e8927f1f640f1fadd3dc642 (diff)
downloadhercules-61d6c958d5a753904d32ef2057b50f426bb0f3b9.tar.gz
hercules-61d6c958d5a753904d32ef2057b50f426bb0f3b9.tar.bz2
hercules-61d6c958d5a753904d32ef2057b50f426bb0f3b9.tar.xz
hercules-61d6c958d5a753904d32ef2057b50f426bb0f3b9.zip
Add function what call OnUntouch event.
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index c0e61e41f..63514710f 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -139,11 +139,22 @@ int npc_ontouch2_event(struct map_session_data *sd, struct npc_data *nd)
{
char name[EVENT_NAME_LENGTH];
- if( sd->areanpc_id == nd->bl.id )
+ if (sd->areanpc_id == nd->bl.id)
return 0;
snprintf(name, ARRAYLENGTH(name), "%s::%s", nd->exname, script->config.ontouch2_name);
- return npc->event(sd,name,2);
+ return npc->event(sd, name, 2);
+}
+
+int npc_onuntouch_event(struct map_session_data *sd, struct npc_data *nd)
+{
+ char name[EVENT_NAME_LENGTH];
+
+ if (sd->areanpc_id == nd->bl.id)
+ return 0;
+
+ snprintf(name, ARRAYLENGTH(name), "%s::%s", nd->exname, script->config.onuntouch_name);
+ return npc->event(sd, name, 2);
}
/*==========================================
@@ -4614,6 +4625,7 @@ void npc_defaults(void) {
npc->isnear = npc_isnear;
npc->ontouch_event = npc_ontouch_event;
npc->ontouch2_event = npc_ontouch2_event;
+ npc->onuntouch_event = npc_onuntouch_event;
npc->enable_sub = npc_enable_sub;
npc->enable = npc_enable;
npc->name2id = npc_name2id;