Walk To Link Code by Justice (Kwon J. Ekstrom) Updated: June 18, 2006 In mud.h: Add: (command declaration) DECLARE_DO_FUN( do_building ); // Walk-To-Link Snippet In mud.h: Add: (PCFLAG declaration) #define PCFLAG_BUILDING BV18 // Walk-To-Link Snippet In build.c: In: (PCFLAG name) char *const pc_flags[] = ... Change: "nstart", "dnd", "idle", "r18", "r19", "r20", "r21", "r22", "r23", "r24", To: "nstart", "dnd", "idle", "building", "r19", "r20", "r21", "r22", "r23", "r24", Note: BV18 is the first unused flag in stock SMAUGFUSS. It may already be used if your mud is not stock. Feel free to use any flag, but take care that the name in pc_flags and the BV match. In act_wiz.c: Add: /* Walk-To-Link Snippet * Toggle the "building" flag. */ void do_building(CHAR_DATA *ch, char *argument) { // Ignore people who can't use it. if (!IS_IMMORTAL(ch) || ch->pcdata == NULL) { send_to_char("Huh?\r\n", ch); return; } // Toggle the building flag. // Remove the flag if you have it. if (IS_SET(ch->pcdata->flags, PCFLAG_BUILDING)) { REMOVE_BIT(ch->pcdata->flags, PCFLAG_BUILDING); send_to_char( "You are no longer building.\n\r", ch ); act(AT_GREY,"$n is no longer building.", ch, NULL, NULL, TO_CANSEE); } // Set the flag otherwise. else { SET_BIT(ch->pcdata->flags, PCFLAG_BUILDING); send_to_char( "You are now building.\n\r", ch ); act(AT_GREY,"$n is now building.", ch, NULL, NULL, TO_CANSEE); return; } } In act_move.c: Add: (function prototype) void build_move(CHAR_DATA *ch, char *argument, int dir); // Walk-To-Link Snippet In act_move.c: Add: /* Walk-To-Link Snippet * * Convert movement commands into redit bexit, as appropriate. */ void build_move(CHAR_DATA *ch, char *argument, int dir) { char buf[MAX_INPUT_LENGTH]; bool stay; int len; // Init stay = FALSE; len = strlen(argument); // Check Walk-To-Link if (len > 0 && IS_IMMORTAL(ch) && IS_SET(ch->pcdata->flags, PCFLAG_BUILDING)) { // Build argument if (argument[0] == '#') { stay = TRUE; argument[0] = ' '; } sprintf(buf, "bexit %s %s", dir_name[dir], argument); // Attempt to link do_redit(ch, buf); // Log sprintf(buf, "%s linking %s from %d with %s.", ch->name, dir_name[dir], ch->in_room->vnum, argument); log_string(buf); // Stay in room? if (stay) return; } // Move move_char(ch, get_exit(ch->in_room, dir), 0); } In act_move.c: Replace: void do_north( CHAR_DATA * ch, char *argument ) { move_char( ch, get_exit( ch->in_room, DIR_NORTH ), 0 ); return; } void do_east( CHAR_DATA * ch, char *argument ) { move_char( ch, get_exit( ch->in_room, DIR_EAST ), 0 ); return; } void do_south( CHAR_DATA * ch, char *argument ) { move_char( ch, get_exit( ch->in_room, DIR_SOUTH ), 0 ); return; } void do_west( CHAR_DATA * ch, char *argument ) { move_char( ch, get_exit( ch->in_room, DIR_WEST ), 0 ); return; } void do_up( CHAR_DATA * ch, char *argument ) { move_char( ch, get_exit( ch->in_room, DIR_UP ), 0 ); return; } void do_down( CHAR_DATA * ch, char *argument ) { move_char( ch, get_exit( ch->in_room, DIR_DOWN ), 0 ); return; } void do_northeast( CHAR_DATA * ch, char *argument ) { move_char( ch, get_exit( ch->in_room, DIR_NORTHEAST ), 0 ); return; } void do_northwest( CHAR_DATA * ch, char *argument ) { move_char( ch, get_exit( ch->in_room, DIR_NORTHWEST ), 0 ); return; } void do_southeast( CHAR_DATA * ch, char *argument ) { move_char( ch, get_exit( ch->in_room, DIR_SOUTHEAST ), 0 ); return; } void do_southwest( CHAR_DATA * ch, char *argument ) { move_char( ch, get_exit( ch->in_room, DIR_SOUTHWEST ), 0 ); return; } With: void do_north( CHAR_DATA * ch, char *argument ) { build_move(ch, argument, DIR_NORTH); return; } void do_east( CHAR_DATA * ch, char *argument ) { build_move(ch, argument, DIR_EAST); return; } void do_south( CHAR_DATA * ch, char *argument ) { build_move(ch, argument, DIR_SOUTH); return; } void do_west( CHAR_DATA * ch, char *argument ) { build_move(ch, argument, DIR_WEST); return; } void do_up( CHAR_DATA * ch, char *argument ) { build_move(ch, argument, DIR_UP); return; } void do_down( CHAR_DATA * ch, char *argument ) { build_move(ch, argument, DIR_DOWN); return; } void do_northeast( CHAR_DATA * ch, char *argument ) { build_move(ch, argument, DIR_NORTHEAST); return; } void do_northwest( CHAR_DATA * ch, char *argument ) { build_move(ch, argument, DIR_NORTHWEST); return; } void do_southeast( CHAR_DATA * ch, char *argument ) { build_move(ch, argument, DIR_SOUTHEAST); return; } void do_southwest( CHAR_DATA * ch, char *argument ) { build_move(ch, argument, DIR_SOUTHWEST); return; }