summaryrefslogtreecommitdiff
path: root/src/map/channel.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-05-15 01:25:39 +0200
committerGitHub <noreply@github.com>2017-05-15 01:25:39 +0200
commitbe118c7fad6df29dc691452ef511ac12fea37a06 (patch)
tree36c9f9e7714ffea7d1b9d21b86ddc7ed61e955c0 /src/map/channel.c
parentab333a87fb891793321b0e4467d8389c8f80be35 (diff)
parent8669002016bc60019a317124ae088a8053a0238b (diff)
downloadhercules-be118c7fad6df29dc691452ef511ac12fea37a06.tar.gz
hercules-be118c7fad6df29dc691452ef511ac12fea37a06.tar.bz2
hercules-be118c7fad6df29dc691452ef511ac12fea37a06.tar.xz
hercules-be118c7fad6df29dc691452ef511ac12fea37a06.zip
Merge pull request #1719 from mekolat/channel2
add channel handler events
Diffstat (limited to 'src/map/channel.c')
-rw-r--r--src/map/channel.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/map/channel.c b/src/map/channel.c
index ee8242b23..9ec415883 100644
--- a/src/map/channel.c
+++ b/src/map/channel.c
@@ -26,6 +26,7 @@
#include "map/instance.h"
#include "map/irc-bot.h"
#include "map/map.h"
+#include "map/npc.h"
#include "map/pc.h"
#include "common/cbasetypes.h"
#include "common/conf.h"
@@ -278,12 +279,21 @@ void channel_send(struct channel_data *chan, struct map_session_data *sd, const
clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd,1455));
return;
} else if (sd) {
+ int i;
+
safesnprintf(message, 150, "[ #%s ] %s : %s", chan->name, sd->status.name, msg);
clif->channel_msg(chan,sd,message);
if (chan->type == HCS_TYPE_IRC)
ircbot->relay(sd->status.name,msg);
if (chan->msg_delay != 0)
sd->hchsysch_tick = timer->gettick();
+
+ for (i = 0; i < MAX_EVENTQUEUE; i++) {
+ if (chan->handlers[i][0] != '\0') {
+ pc->setregstr(sd, script->add_str("@channelmes$"), msg);
+ npc->event(sd, chan->handlers[i], 0);
+ }
+ }
} else {
safesnprintf(message, 150, "[ #%s ] %s", chan->name, msg);
clif->channel_msg2(chan, message);