Player Kill Registration Module v1.0 What this does: Most SWR MUDs go along with the simple MURDER , which works just fine but some Immortals have problems with people getting illegally PKilled, which sucks big time when you need to go into the log files to discover if the PKill was legal or illegal. This snippet will bring PKill registration to your MUD, meaning, you have to register for it in order to kill other players. What you will need to change: act_info.c fight.c mud.h player.c tables.c Note: This was a throw-together job, there may be ways to override this function, so check your MUD codebase for other possible ways to kill someone. ------------------------------------------------------------------------------------------------- act_info.c Find, sprintf( buf, "%s %s%s%s%s %s%s%s\n\r", Change it to look like this, sprintf( buf, "%s %s%s%s%s%s %s%s%s\n\r", Find, IS_SET(wch->act, PLR_AFK) ? "[AFK] " : "", Below it add, IS_SET(wch->pcdata->flags, PCFLAG_DEADLY) ? "&r[&RPKer&r]&w" : "&w", ------------------------------------------------------------------------------------------------- fight.c In the do_murder function, Find, if ( ( victim = get_char_room( ch, arg ) ) == NULL ) { send_to_char( "They aren't here.\n\r", ch ); return; } Below it add, if (!IS_SET(ch->pcdata->flags, PCFLAG_DEADLY) ) { send_to_char( "Please register as a PKer first!\n\r", ch ); return; } Find, if (!IS_SET(victim->pcdata->flags, PCFLAG_DEADLY) ) { send_to_char( "This person is not a PKer!\n\r", ch ); return; } ------------------------------------------------------------------------------------------------- mud.h Find, /* #define PCFLAG_ BV01 extra flag */ Change it too look like this, #define PCFLAG_DEADLY BV01 Find, DECLARE_DO_FUN( do_pick ); Below it add, DECLARE_DO_FUN( do_pkregister ): DECLARE_DO_FUN( do_pkunregster ); ------------------------------------------------------------------------------------------------- player.c At the bottom of the file, copy and paste this, void do_pkregister( CHAR_DATA *ch, char *argument ) { char logbuf[MAX_STRING_LENGTH]; char buf[MAX_STRING_LENGTH]; if ( IS_NPC(ch) || !ch->pcdata ) { send_to_char( "Yeah right!\n\r", ch ); return; } if ( argument[0] == '\0' ) { send_to_char( "&RIf you really want to register this character type PKRegister and your password.\n\r", ch ); return; } if ( IS_SET(ch->pcdata->flags, PCFLAG_DEADLY) ) { send_to_char( "&RYou only need to register Once.\n\r", ch ); return; } if ( strcmp( crypt( argument, ch->pcdata->pwd ), ch->pcdata->pwd ) ) { send_to_char( "Sorry wrong password.\n\r", ch ); sprintf( logbuf , "%s attempting to PKReg... WRONG PASSWORD!" , ch->name ); log_string( logbuf ); return; } sprintf( buf, "&B[&CINFO&B] &W%s Is Now Registerd for PKill!!!", ch->name ); echo_to_all( AT_IMMORT, buf, ECHOTAR_ALL ); act( AT_BLOOD, "&z&GRegistration Confirmed &B-- &CWelcome To The Wonderfull World Of PKill", ch, NULL, NULL, TO_CHAR ); SET_BIT( ch->pcdata->flags, PCFLAG_DEADLY ); save_char_obj( ch ); } void do_pkunregister( CHAR_DATA *ch, char *argument ) { char logbuf[MAX_STRING_LENGTH]; char buf[MAX_STRING_LENGTH]; int iLevel; if ( IS_NPC(ch) || !ch->pcdata ) { send_to_char( "Yeah right!\n\r", ch ); return; } if ( argument[0] == '\0' ) { send_to_char( "&RIf you really want to be removed as a PKer type pkunregister and your password.\n\r", ch ); return; } if ( !IS_SET(ch->pcdata->flags, PCFLAG_DEADLY) ) { send_to_char( "&RYou arn't a PKer anyway!\n\r", ch ); return; } /* * Due to abuse, there are two ways of restricting this command * The first way is listed below, requiring 1 million credits. * The other way is commented out, below the gold check, which checks if * you have already committed a murder. */ if ( ch->gold < 1000000 ) { send_to_char( "&RIt costs 1,000,000 credits to remove PKer status!\n\r", ch ); return; } /* if ( ch->pcdata->pkills < 0 ) { send_to_char( "&RYou have already committed murder, you can no longer use this command.\n\r", ch ); return; } */ if ( strcmp( crypt( argument, ch->pcdata->pwd ), ch->pcdata->pwd ) ) { send_to_char( "Sorry wrong password.\n\r", ch ); sprintf( logbuf , "%s attempting to UnPKReg... WRONG PASSWORD!" , ch->name ); log_string( logbuf ); return; } sprintf( buf, "&B[&CINFO&B] &W%s is is no longer a PKer!!!", ch->name ); echo_to_all( AT_IMMORT, buf, ECHOTAR_ALL ); act( AT_BLOOD, "&z&GRemoval Confirmed &B-- &CEnjoy knowing you are now safe!", ch, NULL, NULL, TO_CHAR ); REMOVE_BIT( ch->pcdata->flags, PCFLAG_DEADLY ); ch->gold -= 1000000; save_char_obj( ch ); } void do_showpk(CHAR_DATA *ch, char *argument) { char buf[MAX_STRING_LENGTH]; CHAR_DATA *vict; send_to_char( "&CList of &rPKers&C Online&B:\n\r\n\r", ch ); for(vict = first_char; vict; vict=vict->next) if (!IS_NPC(vict) && IS_SET(vict->pcdata->flags, PCFLAG_DEADLY) ) { sprintf(buf, "&W%s\n\r", vict->name); send_to_char(buf, ch); } } ------------------------------------------------------------------------------------------------- tables.c Find, if ( !str_cmp( name, "do_pickshiplock" )) return do_pickshiplock; Below it add, if ( !str_cmp( name, "do_pkregister" )) return do_pkregister; if ( !str_cmp( name, "do_pkunregister" )) return do_pkunregister; Find, if ( !str_cmp( name, "do_showclan" )) return do_showclan; Below it add, if ( !str_cmp( name, "do_showpk" )) return do_showpk; Find, if ( skill == do_pick ) return "do_pick"; Below it add, if ( skill == do_pkregister ) return "do_pkregister"; if ( skill == do_pkunregister ) return "do_pkunregister"; Find, if ( skill == do_showclan ) return "do_showclan"; Below it add, if ( skill == do_showpk ) return "do_showpk"; -------------------------------------------------------------------------------------------------