This is a snippet to add selfdestruct capabilities to your SWR. It is nothing fancy, there are no timers put in, though that could be easily done. This snippet may not be complete, as it is my first and I am writing it long after I installed this code. I didn't add the a command to change the password. PS. This is my first snippet, don't get mad if it isn't good. They will get better, I promise. Questions? Email me at ferak_@hotmail.com Good luck, Ferak. *** MUD.H *** in 'struct ship_data' add somewhere: char * selfdestruct; int selfdpass; --- find: DECLARE_DO_FUN( do_sedit ); below it add: DECLARE_DO_FUN( do_selfd ); DECLARE_DO_FUN( do_selfdestruct ); *** TABLES.C *** find: if ( !str_cmp( name, "do_seduce" )) return do_seduce; below it add: if ( !str_cmp( name, "do_selfd" )) return do_selfd; if ( !str_cmp( name, "do_selfdestruct" )) return do_selfdestruct; --- find: if ( skill == do_sedit ) return "do_sedit"; below it add: if ( skill == do_selfd ) return "do_selfd"; if ( skill == do_selfdestruct ) return "do_selfdestruct"; *** SPACE.C *** in 'get_ship_value' below: price += ( 100 * ship->maxchaff ); add: if (!str_cmp(ship->selfdestruct,"Installed")) price += 1000; --- in 'save_ship' below: fprintf( fp, "Manuever %d\n", ship->manuever ); add: fprintf( fp, "SelfDpass %d\n", ship->selfdpass ); fprintf( fp, "Selfdestruct %s~\n", ship->selfdestruct ); --- in 'fread_ship' below: case 'S': add: KEY( "Selfdestruct", ship->selfdestruct, fread_string( fp ) ); KEY( "SelfDpass", ship->selfdpass, fread_number( fp ) ); --- in 'resetship' below: if (ship->starsystem) ship_from_starsystem( ship, ship->starsystem ); add: ship->selfdpass = number_range( 10001, 99999 ); --- in 'setship' below: if ( arg1[0] == '\0' || arg2[0] == '\0' || arg1[0] == '\0' ) in the send_to_char code somewhere add in 'selfdpass' and 'selfd' - below: if ( !str_cmp( arg2, "lasers" ) ) { ship->lasers = URANGE( 0, atoi(argument) , 10 ); send_to_char( "Done.\n\r", ch ); save_ship( ship ); return; } add: if ( !str_cmp( arg2, "selfd" ) ) { if ( str_cmp(argument,"Yes") && str_cmp(argument,"No") ) { send_to_char( "&CChoices&R:&W Yes and No.\n\r", ch ); return; } if ( !str_cmp(argument,"Yes") || !str_cmp(argument,"yes") ) { ship->selfdestruct = STRALLOC("Installed"); } if ( !str_cmp(argument,"No") || !str_cmp(argument,"no") ) { ship->selfdestruct = STRALLOC("Not Installed"); } send_to_char( "Done.\n\r", ch ); save_ship( ship ); return; } if ( !str_cmp( arg2, "selfdpass" ) ) { if ( (atoi(argument) < 10001) || (atoi(argument) > 99999) ) { send_to_char("Selfdestruct Password must be between 10001 and 99999.\n\r", ch); return; } ship->selfdpass = atoi(argument); send_to_char( "Done.\n\r", ch ); save_ship( ship ); return; } --- in 'showship' below: ch_printf( ch, "Shields: %d/%d Energy(fuel): %d/%d Chaff: %d/%d\n\r", ship->shield, ship->maxshield, ship->energy, ship->maxenergy, ship->chaff, ship->maxchaff); add: ch_printf( ch, "Selfdestruct: %s Selfdestructpass: %d\n\r", ship->selfdestruct, ship->selfdpass); --- in 'makeship' below: ship->home = STRALLOC( "" ); add: ship->selfdestruct = STRALLOC( "Not Installed" ); ship->selfdpass = number_range( 10001, 99999 ); --- in 'copyship' below: ship->home = STRALLOC( "" ); add: ship->selfdestruct = old->selfdestruct; ship->selfdpass = number_range( 10001, 99999 ); --- in 'do_info' below: ch_printf( ch, "Maximum Speed: %d Hyperspeed: %d\n\r", target->realspeed, target->hyperspeed ); add: if (check_pilot(ch,target) ) { ch_printf( ch, "Selfdestruct Pass: %d\n\r", target->selfdpass); } --- in 'sellship' below: ship->owner = STRALLOC( "" ); add: ship->selfdpass = number_range( 10001, 99999 ); --- anywhere in space.c add in these functions. any .c file that is in your make will work too : void do_selfd(CHAR_DATA *ch, char *argument ) { send_to_char("If you wish to SELFDESTRUCT your ship, please spell it out completely!\n\r",ch); return; } void do_selfdestruct(CHAR_DATA *ch, char *argument ) { char buf[MAX_STRING_LENGTH]; SHIP_DATA *ship; if ( (ship = ship_from_cockpit(ch->in_room->vnum)) == NULL ) { send_to_char("&RYou must be in the cockpit of a ship to do that!\n\r",ch); return; } if ( (ship = ship_from_pilotseat(ch->in_room->vnum)) == NULL ) { send_to_char("&RYou must be in the pilots seat!\n\r",ch); return; } if ( ship->target0 || ship->target1 || ship->target2 ) { send_to_char("&RNot while the ship is enganged with an enemy!\n\r",ch); return; } if ( !str_cmp(ship->selfdestruct,"Not Installed" ) ) { send_to_char("This ship is not equipped with a selfdestruct module!\n\r", ch); return; } if ( argument == '\0') { send_to_char("&CUsage&R:&WSelfdestruct &R<&WPassword&R>&W\n\r", ch); return; } if ( atoi(argument) != ship->selfdpass ) { send_to_char("Incorrect password! How dare you try to blow up this ship!&R'&W\n\r", ch ); return; } act( AT_PLAIN, "$n flips a switch on the control panell.", ch, NULL, argument , TO_ROOM ); echo_to_cockpit( AT_BLOOD+AT_BLINK, ship, "Your vision flashes white.... then fades to black.\n\r"); sprintf( buf , "%s explodes in a burst of flames!", ship->fakename); echo_to_system( AT_ORANGE , ship , buf , NULL ); destroy_ship(ship, NULL); } -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- Now all you have to do is: make clean make reboot Then in the mud: cedit selfd code do_selfd cedit selfd level cedit selfd position 5 cedit selfdestruct code do_selfdestruct cedit selfdestruct level cedit selfdestruct position 5 cedit selfdestruct log 1 cedit save That should do it. You may have troubles with your ship files, as you are changing the layout of them. You may have to manually add in the proper lines to each of them or redo the ship files. If you have any questions send them to ferak_@hotmail.com