From 789c8d77c7de5673a3cefd8ca302d97bc358ce8e Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 11 Apr 2013 21:18:12 -0300 Subject: Hercules Channel System Update http://hercules.ws/board/topic/316-introducing-hercules-channel-system/?p=2716 Signed-off-by: shennetsind --- src/map/atcommand.c | 323 +++++++++++++++++++++++++++++++++++++++++++++++++--- src/map/clif.c | 47 +++++--- src/map/clif.h | 16 ++- src/map/guild.c | 9 +- src/map/pc.c | 3 +- src/map/pc.h | 3 +- src/map/skill.c | 4 +- 7 files changed, 363 insertions(+), 42 deletions(-) (limited to 'src/map') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 1c0542066..f3e69ffb7 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5669,7 +5669,6 @@ ACMD_FUNC(changelook) * Turns on/off Autotrade for a specific player *------------------------------------------*/ ACMD_FUNC(autotrade) { - int i; nullpo_retr(-1, sd); if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) { @@ -5692,22 +5691,7 @@ ACMD_FUNC(autotrade) { int timeout = atoi(message); status_change_start(&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0); } - - if( hChSys.ally && sd->status.guild_id ) { - struct guild *g = sd->guild, *sg; - if( g ) { - if( idb_exists(((struct hChSysCh *)g->channel)->users, sd->status.char_id) ) - clif->chsys_left((struct hChSysCh *)g->channel,sd); - for (i = 0; i < MAX_GUILDALLIANCE; i++) { - if( g->alliance[i].guild_id && (sg = guild_search(g->alliance[i].guild_id) ) ) { - if( idb_exists(((struct hChSysCh *)sg->channel)->users, sd->status.char_id) ) - clif->chsys_left((struct hChSysCh *)sg->channel,sd); - break; - } - } - } - } - + clif->chsys_quit(sd); clif->authfail_fd(sd->fd, 15); @@ -8883,6 +8867,12 @@ ACMD_FUNC(join) { } } + if( channel->banned && idb_exists(channel->banned, sd->status.account_id) ) { + sprintf(atcmd_output, msg_txt(1438),name); // You cannot join the '%s' channel because you've been banned from it + clif->message(fd, atcmd_output); + return -1; + } + if( !( channel->opt & hChSys_OPT_ANNOUNCE_JOIN ) ) { sprintf(atcmd_output, msg_txt(1403),name); // You're now in the '%s' channel clif->message(fd, atcmd_output); @@ -8922,6 +8912,25 @@ static inline void atcmd_channel_help(int fd, const char *command, bool can_crea sprintf(atcmd_output, msg_txt(1429),command);// -- %s unbind clif->message(fd, atcmd_output); clif->message(fd, msg_txt(1430));// - unbinds your global chat from its attached channel (if binded) + sprintf(atcmd_output, msg_txt(1429),command);// -- %s unbind + clif->message(fd, atcmd_output); + if( can_create ) { + sprintf(atcmd_output, msg_txt(1456),command);// -- %s ban + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1457));// - bans from channel + sprintf(atcmd_output, msg_txt(1458),command);// -- %s banlist + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1459));// - lists all banned characters from channel + sprintf(atcmd_output, msg_txt(1460),command);// -- %s unban + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1461));// - unbans from channel + sprintf(atcmd_output, msg_txt(1467),command);// -- %s unbanall + clif->message(fd, atcmd_output); + clif->message(fd, msg_txt(1468));// - unbans everyone from + sprintf(atcmd_output, msg_txt(1462),command);// -- %s setopt