in act_comm.c add:


bool is_profane args( (char *what)) ;

Modify all channel functions that you want to filter

Example change:

void do_chat( CHAR_DATA *ch, char *argument )
{
    if (NOT_AUTHED(ch))
    {
      send_to_char("Huh?\n\r", ch);
      return;
    }
    talk_channel( ch, argument, CHANNEL_CHAT, "chat" );
    return;
}

into:

void do_chat( CHAR_DATA *ch, char *argument )
{
    if (NOT_AUTHED(ch))
    {
      send_to_char("Huh?\n\r", ch);
      return;
    }
    if (is_profane(argument))
     talk_channel( ch, argument, CHANNEL_SWEAR, "swear" );
    else
     talk_channel( ch, argument, CHANNEL_CHAT, "chat" );
    return;
}


Then create the actual check:
bool is_profane( char *what )
{
    
    if (!sysdata.PROFANITY_FILTER)
     return FALSE;
  
    what = strlower(what);

    if (strstr( what, "fuck" ))
     return TRUE;
    if (strstr( what, "shit" ) && !strstr( what, "shitake" ))
     return TRUE;
    if (strstr( what, "bitch" ))
     return TRUE;
    if (strstr( what, "bastard" ))
     return TRUE;
    if (strstr( what, "faggot" ))
     return TRUE;
    if (strstr( what, "pussy" ))
     return TRUE;
    if (strstr( what, "cock" ))
     return TRUE;
    if (strstr( what, "asshole" ))
     return TRUE;
    if (strstr( what, "cunt" ))
     return TRUE;
    if (strstr( what, "piss" ))
     return TRUE;
    if (strstr( what, "crap" ) && !strstr( what, "scrap" ))
     return TRUE;
/*    if (strstr( what, "ass" ) && !strstr( what, "assassin" ))
     return TRUE;
*/    if (strstr( what, "whore " ))
     return TRUE;
    if (strstr( what, "slut" ))
     return TRUE;
    if (strstr( what, "twat" ))
     return TRUE;
    if (strstr( what, "jackass" ))
     return TRUE;
    if (strstr( what, "dick" ))
     return TRUE;

    return FALSE;
}

(Theres a billion ways to create this check, but this ones as workable as any)
(another recommendation for it is to break it up into seperate chunks and compare 
each individual word, its slightly more careful in some cases but this was a rush
job and is more aimed towards being an example).

Next, in act_wiz.c add inside do_cset:

    pager_printf_color(ch, "\n\r&wProfanity Filtering: &W%s\n\r", 
          sysdata.PROFANITY_FILTER ? "On" : "Off" );

and

  if ( !str_cmp( arg, "profanity" ) )
    {

        sysdata.PROFANITY_FILTER = !sysdata.PROFANITY_FILTER;

      if ( sysdata.PROFANITY_FILTER )
          send_to_char( "Profanity Filtering system enabled.\n\r", ch );
      else
          send_to_char( "Profanity Filtering system disabled.\n\r", ch );
      return;
    }

in db.c add:

in save_sysdata
	fprintf( fp, "Profanity  %d\n", sys.PROFANITY_FILTER	);

Under case p in load sysdata:
            KEY( "Profanity",  sys->PROFANITY_FILTER, fread_number( fp ) );

in mud.h add:
to: struct	system_data
    bool	PROFANITY_FILTER;	/* Send profanity to swear */


