Index: src/map/atcommand.c
===================================================================
--- src/map/atcommand.c (revision 17352)
+++ src/map/atcommand.c (working copy)
@@ -1126,14 +1126,14 @@
memset(item_name, '\0', sizeof(item_name));
if (!strcmpi(command+1,"itembound") && (!message || !*message || (
- sscanf(message, "\"%99[^\"]\" %d %d", item_name, &number, &bound) < 2 &&
- sscanf(message, "%99s %d %d", item_name, &number, &bound) < 2
+ sscanf(message, "\"%99[^\"]\" %d %d", item_name, &number, &bound) < 2 &&
+ sscanf(message, "%99s %d %d", item_name, &number, &bound) < 2
))) {
clif_displaymessage(fd, msg_txt(sd,295)); // Please enter an item name or ID (usage: @item <item name/ID> <quantity> <bound_type>).
return -1;
} else if (!message || !*message || (
- sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 &&
- sscanf(message, "%99s %d", item_name, &number) < 1
+ sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 &&
+ sscanf(message, "%99s %d", item_name, &number) < 1
)) {
clif_displaymessage(fd, msg_txt(sd,983)); // Please enter an item name or ID (usage: @item <item name/ID> <quantity>).
return -1;
@@ -6167,9 +6167,7 @@
bool ifcolor=(*(command + 8) != 'c' && *(command + 8) != 'C')?0:1;
unsigned long color=0;
- if (sd->sc.count && //no "chatting" while muted.
- (sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] ||
- (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
+ if (sd->sc.cant.chat)
return -1;
if(!ifcolor) {
@@ -6218,10 +6216,8 @@
return -1;
}
- if (sd->sc.count && //no "chatting" while muted.
- (sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] ||
- (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
- return -1;
+ if (sd->sc.cant.chat)
+ return -1; //no "chatting" while muted.
if (!message || !*message || sscanf(message, "%99[^\n]", mes) < 1) {
clif_displaymessage(fd, msg_txt(sd,1224)); // Please enter a message (usage: @pettalk <message>).
@@ -7052,10 +7048,8 @@
sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
}
- if (sd->sc.count && //no "chatting" while muted.
- (sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] ||
- (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
- return -1;
+ if (sd->sc.cant.chat)
+ return -1; //no "chatting" while muted.
if ( !merc_is_hom_active(sd->hd) ) {
clif_displaymessage(fd, msg_txt(sd,1254)); // You do not have a homunculus.
@@ -7439,10 +7433,8 @@
memset(tempmes, '\0', sizeof(tempmes));
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (sd->sc.count && //no "chatting" while muted.
- (sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] ||
- (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
- return -1;
+ if (sd->sc.cant.chat)
+ return -1; //no "chatting" while muted.
if (!message || !*message || sscanf(message, "%199[^\n]", tempmes) < 0) {
clif_displaymessage(fd, msg_txt(sd,1302)); // Please enter a message (usage: @me <message>).
Index: src/map/status.c
===================================================================
--- src/map/status.c (revision 17352)
+++ src/map/status.c (working copy)
@@ -1026,6 +1026,7 @@
StatusChangeStateTable[SC_MEIKYOUSISUI] |= SCS_NOMOVE;
StatusChangeStateTable[SC_KAGEHUMI] |= SCS_NOMOVE;
StatusChangeStateTable[SC_KYOUGAKU] |= SCS_NOMOVE;
+ StatusChangeStateTable[SC_PARALYSIS] |= SCS_NOMOVE;
/* StatusChangeState (SCS_) NOPICKUPITEMS */
StatusChangeStateTable[SC_HIDING] |= SCS_NOPICKITEM;
@@ -1055,9 +1056,12 @@
StatusChangeStateTable[SC_CURSEDCIRCLE_TARGET] |= SCS_NOCAST;
StatusChangeStateTable[SC_SILENCE] |= SCS_NOCAST;
- //Homon S
- StatusChangeStateTable[SC_PARALYSIS] |= SCS_NOMOVE;
-
+ /* StatusChangeState (SCS_) NOCHAT (skills) */
+ StatusChangeStateTable[SC_BERSERK] |= SCS_NOCHAT;
+ StatusChangeStateTable[SC_SATURDAYNIGHTFEVER] |= SCS_NOCHAT;
+ StatusChangeStateTable[SC_DEEPSLEEP] |= SCS_NOCHAT;
+ StatusChangeStateTable[SC__BLOODYLUST] |= SCS_NOCHAT;
+ StatusChangeStateTable[SC_NOCHAT] |= SCS_NOCHAT|SCS_NOCHATCOND;
}
static void initDummyData(void)
@@ -3589,9 +3593,16 @@
}
}
+ /* can't chat */
+ if( flag&SCS_NOCHAT ) {
+ if( !(flag&SCS_NOCHATCOND) ) {
+ sc->cant.chat += ( start ? 1 : -1 );
+ } else if(sc->data[SC_NOCHAT] && sc->data[SC_NOCHAT]->val1&MANNER_NOCHAT)
+ sc->cant.chat += ( start ? 1 : -1 );
+ }
+
/* player-only states */
if( bl->type == BL_PC ) {
-
/* can pick items? */
if( flag&SCS_NOPICKITEM ) {
if( !(flag&SCS_NOPICKITEMCOND) ) {
Index: src/map/status.h
===================================================================
--- src/map/status.h (revision 17352)
+++ src/map/status.h (working copy)
@@ -1550,6 +1550,8 @@
SCS_NODROPITEM = 0x00000020, /* player unable to drop items */
SCS_NOCASTCOND = 0x00000040, /* cond flag for nocast */
SCS_NOCAST = 0x00000080, /* unit unable to cast skills */
+ SCS_NOCHAT = 0x00000100, /* unit can't talk */
+ SCS_NOCHATCOND = 0x00000200, /* cond flag for notalk */
};
//Define flags for the status_calc_bl function. [Skotlex]
@@ -1706,6 +1708,7 @@
unsigned char pickup;
unsigned char drop;
unsigned char cast;
+ unsigned char chat;
} cant;/* status change state flags */
//int sg_id; //ID of the previous Storm gust that hit you
short comet_x, comet_y; // Point where src casted Comet - required to calculate damage from this point
Index: src/map/clif.c
===================================================================
--- src/map/clif.c (revision 17352)
+++ src/map/clif.c (working copy)
@@ -6598,7 +6598,7 @@
WBUFW(buf,0)=0x109;
WBUFW(buf,2)=len+8;
WBUFL(buf,4)=account_id;
- safestrncpy((char *)WBUFP(buf,8), mes, len);
+ safestrncpy((char *)WBUFP(buf,8), mes, len);
clif_send(buf,len+8,&sd->bl,PARTY);
}
}
@@ -9673,7 +9673,7 @@
if( is_atcommand(fd, sd, message, 1) )
return;
- if( sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
+ if( sd->sc.cant.chat )
return;
if( battle_config.min_chat_delay ) { //[Skotlex]
@@ -9994,7 +9994,7 @@
if ( is_atcommand(fd, sd, message, 1) )
return;
- if (sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT))
+ if (sd->sc.cant.chat)
return;
if (battle_config.min_chat_delay) { //[Skotlex]
@@ -11668,7 +11668,7 @@
if( is_atcommand(fd, sd, message, 1) )
return;
- if( sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
+ if( sd->sc.cant.chat )
return;
if( battle_config.min_chat_delay )
@@ -12213,7 +12213,7 @@
if( is_atcommand(fd, sd, message, 1) )
return;
- if( sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
+ if( sd->sc.cant.chat )
return;
if( battle_config.min_chat_delay )
@@ -14443,7 +14443,6 @@
}
#endif
-
/// Adoption System
///
@@ -15078,7 +15077,7 @@
if( is_atcommand(fd, sd, message, 1) )
return;
- if( sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
+ if( sd->sc.cant.chat )
return;
if( battle_config.min_chat_delay ) {