PKreason.txt
snippets · 1.5 KB · 2010-03-30
do_pkreason command: replaces do_murder with a reason prompt, since many skills start combat.
Download « Back to the snippets list
Changed the new do_murder to pkreason (reason). Since there are too many
skills out there that initiate combat
---------------------------------------------------------------------------
FIGHT.C
---------------------------------------------------------------------------
-Add this command.
void do_pkreason( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char logbuf[MAX_STRING_LENGTH];
one_argument( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char( "Syntax: PKReason (Victim)\n\r", ch );
return;
}
if (!IS_NPC(ch) && IS_SET(ch->pcdata->act2, ACT_BOUND))
{
send_to_char("Your gonna kill while bound?\n\r", ch);
return;
}
sprintf( logbuf, "%s:\n\rRP Reason: %s\n\rTime: %s", ch->name, arg, (char *) ctime( ¤t_time ));
log_string(logbuf);
sprintf( buf, "-%s Reason: %s Time: %s", ch->name, arg1, (char *) ctime( ¤t_time ));
append_file( ch, MURDER_FILE, buf );
return;
}
---------------------------------------------------------------------------
MUD.H
---------------------------------------------------------------------------
Below: #define IDEA_FILE SYSTEM_DIR "ideas.txt" /* For 'idea'
*/
Add: #define MURDER_FILE SYSTEM_DIR "murder.txt" /* For 'murders'
*/
---------------------------------------------------------------------------
Add do_pkreason to tables.c and mud.h
Make Clean
Make
Copyover
Create new command
Done
---------------------------------------------------------------------------