summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorMatheus Macabu <mkbu95@gmail.com>2013-07-04 19:32:46 -0300
committerMatheus Macabu <mkbu95@gmail.com>2013-07-04 19:32:46 -0300
commitda064c030d22c0920f74b345ca3118c9204dae2b (patch)
tree97965c317f79cde6384e344da398e97ac5bce462 /src/map/clif.c
parente8adea6f0cbad25b5ac21944b16099cce155d050 (diff)
downloadhercules-da064c030d22c0920f74b345ca3118c9204dae2b.tar.gz
hercules-da064c030d22c0920f74b345ca3118c9204dae2b.tar.bz2
hercules-da064c030d22c0920f74b345ca3118c9204dae2b.tar.xz
hercules-da064c030d22c0920f74b345ca3118c9204dae2b.zip
Implemented official mute system. Thanks to:
Ai4rei/Mirei for the code; kyeme for suggesting it; Napster for updating the patch. Signed-off-by: Matheus Macabu <mkbu95@gmail.com>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 1e05ced14..1cdb59966 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -13412,14 +13412,42 @@ void clif_parse_GMReqNoChat(int fd,struct map_session_data *sd)
if( type == 0 )
value = -value;
- //If type is 2 and the ids don't match, this is a crafted hacked packet!
- //Disabled because clients keep self-muting when you give players public @ commands... [Skotlex]
- if (type == 2 /* && (pc->get_group_level(sd) > 0 || sd->bl.id != id)*/)
- return;
+ if (type == 2)
+ {
+ if (!battle_config.client_accept_chatdori)
+ return;
+ if (pc->get_group_level(sd) > 0 || sd->bl.id != id)
+ return;
- dstsd = iMap->id2sd(id);
- if( dstsd == NULL )
- return;
+ dstsd = sd;
+ }
+ else
+ {
+ dstsd = iMap->id2sd(id);
+ if( dstsd == NULL )
+ return;
+ }
+
+ if (type == 2 || ( (pc->get_group_level(sd)) > pc->get_group_level(dstsd) && !pc->can_use_command(sd, "@mute")))
+ {
+ clif->manner_message(sd, 0);
+ clif->manner_message(dstsd, 5);
+
+ if (dstsd->status.manner < value)
+ {
+ dstsd->status.manner -= value;
+ sc_start(&dstsd->bl,SC_NOCHAT,100,0,0);
+
+ }
+ else
+ {
+ dstsd->status.manner = 0;
+ status_change_end(&dstsd->bl, SC_NOCHAT, INVALID_TIMER);
+ }
+
+ if( type != 2 )
+ clif->GM_silence(sd, dstsd, type);
+ }
sprintf(command, "%cmute %d %s", atcommand->at_symbol, value, dstsd->status.name);
atcommand->parse(fd, sd, command, 1);