From 94ef1ee7bbea5dbdfcc6e96adf87a6262bb3ccdb Mon Sep 17 00:00:00 2001 From: panikon Date: Fri, 4 Apr 2014 23:44:20 -0300 Subject: Fixed issue: 8131 http://hercules.ws/board/tracker/issue-8131-sc-chat/ -Documented SC_NOCHAT -Corrected the way that pc_setparam was handling SP_MANNER -Added documentation on *sc_status regarding SC_NOCHAT, to mute a user via script you should set Manner --- doc/script_commands.txt | 4 ++++ src/common/mmo.h | 2 +- src/map/pc.c | 8 +++++++- src/map/script.c | 2 +- src/map/status.c | 5 ++++- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index f6cad66d5..1fd3c47a6 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -5296,6 +5296,10 @@ re-apply). You can see the full list of status effects caused by skills in 'src/map/status.h' - they are currently not fully documented, but most of that should be rather obvious. +Note: to use SC_NOCHAT you should alter Manner + set Manner, -5; // Will mute a user for 5 minutes + set Manner, 0; // Will unmute a user + set Manner, 5; // Will unmute a user and prevent the next use of 'Manner' --------------------------------------- diff --git a/src/common/mmo.h b/src/common/mmo.h index cf3933d40..019472acb 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -392,7 +392,7 @@ struct mmo_charstatus { unsigned int status_point,skill_point; int hp,max_hp,sp,max_sp; unsigned int option; - short manner; + short manner; // Defines how many minutes a char will be muted, each negative point is equivalent to a minute. unsigned char karma; short hair,hair_color,clothes_color; int party_id,guild_id,pet_id,hom_id,mer_id,ele_id; diff --git a/src/map/pc.c b/src/map/pc.c index b6964fc6e..42b79ed92 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -7466,7 +7466,13 @@ int pc_setparam(struct map_session_data *sd,int type,int val) break; case SP_MANNER: sd->status.manner = val; - break; + if( val < 0 ) + sc_start(NULL, &sd->bl, SC_NOCHAT, 100, 0, 0); + else { + status_change_end(&sd->bl, SC_NOCHAT, INVALID_TIMER); + clif->manner_message(sd, 5); + } + return 1; // status_change_start/status_change_end already sends packets warning the client case SP_FAME: sd->status.fame = val; break; diff --git a/src/map/script.c b/src/map/script.c index 296008536..312e40696 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -8687,7 +8687,7 @@ BUILDIN(savepoint) { sd = script->rid2sd(st); if( sd == NULL ) - return true;// no player attached, report source + return false;// no player attached, report source str = script_getstr(st,2); x = script_getnum(st,3); diff --git a/src/map/status.c b/src/map/status.c index fdbafd6b0..460af3179 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -7755,7 +7755,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t unit->stop_attack(bl); break; case SC_NOCHAT: - // [GodLesZ] FIXME: is this correct? a hardcoded interval of 60sec? what about configuration ?_? + // A hardcoded interval of 60 seconds is expected, as the time that SC_NOCHAT uses is defined by + // mmocharstatus.manner, each negative point results in 1 minute with this status activated + // This is done this way because the message that the client displays is hardcoded, and only + // shows how many minutes are remaining. [Panikon] tick = 60000; val1 = battle_config.manner_system; //Mute filters. if (sd) -- cgit v1.2.3-70-g09d2