New do_exits and look_in_direction function by John Beckhoff ********************************************************************** DISCLAIMER: FYI - Please use at your own risk. I will not be resonsible for any damages cuased to your MUD if you use this code. USE AT YOUR OWN RISK!! This was coded for pl21 so if you have anything earlier than pl21 you will have to try to recode it yourself. If you are having trouble drop me a line and I will try to help if I have time :) I would also appreciate it if you would give me credit, if you use my code. Thanks :) *********************************************************************** I decided to change the do_exits command and the look_in_direction function on the mud I will be running in the near future.. I made the do_exits command a god only command, becuase I figured that the users wouldn't need to have access to that command since, I rewrote the look_in_direction function. Now, I rewrote the look_in_direction function so when a character looks in a certain direction, it will show the user the room contents in the direction he or she looks. It will also let characters see who just looked in the room from whatever direction they were in. &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& DO_EXITS COMMAND ----------------------------------------------------------------------------------------------- in interpreter.c change: { "exits" , POS_RESTING , do_exits , 0, 0 } to: { "exits" , POS_RESTING , do_exits , LVL_IMMORT, 0 } ^^^^^^^ or whatever god lvl you want ----------------------------------------------------------------------------------------------- in act.informative.c search for void do_auto_exits(struct char_data *ch); and delete the ACMD(do_exits); function in the declaration list. now search for: ACMD(do_exits) { int door, len = 0; if (AFF_FLAGGED(ch, AFF_BLIND)) { send_to_char(ch, "You can't see a damned thing, you're blind!\r\n"); return; and delete the ACMD(do_exits) function ----------------------------------------------------------------------------------------------- in act.wizard.c add: ACMD(do_exits); right after ACMD(do_goto); that is right around line 65 or so. now add this to the bottom of the file, or where ever you want to in the file: ACMD(do_exits) { int door, len = 0; send_to_char(ch, "Exits:\r\n"); for (door = 0; door < NUM_OF_DIRS; door++) { if(!EXIT(ch, door) || EXIT(ch, door)->to_room == NOWHERE) continue; len++; send_to_char(ch, "%-5s - [%d] ", dirs[door], GET_ROOM_VNUM(EXIT(ch, door)->to_room)); if (EXIT_FLAGGED(EXIT(ch, door), EX_LOCKED)) send_to_char(ch, " - LOCKED "); if (EXIT_FLAGGED(EXIT(ch, door), EX_PICKPROOF)) send_to_char(ch, " - PICK PROOF"); send_to_char(ch, "\r\n"); } if (!len) send_to_char(ch, "-= NONE =-\r\n"); } &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& LOOK_IN_DIRECTION FUNCTION: ---------------------------------------------------------------------------------------------- in act.informative.c add: void char_to_dir(struct char_data *ch, room_rnum room); void char_from_dir(struct char_data *ch); to the bottom of the local functions list do a search for void look_in_direction(struct char_data *ch, int dir) should be around line 430 or so and replace that function with: void look_in_direction(struct char_data *ch, int dir) { int was_in; if (EXIT(ch, dir)) { if(!EXIT_FLAGGED(EXIT(ch, dir), EX_CLOSED)) { was_in = IN_ROOM(ch); /* temporarily take character form current room without him/ her * knowing */ char_from_dir(ch); char_to_dir(ch, world[was_in].dir_option[dir]->to_room); //make character look at room he/she was sent to look_at_room(ch, 0); //lets bring the character back to the room he/she //was in char_from_dir(ch); char_to_dir(ch, was_in); } if(EXIT_FLAGGED(EXIT(ch, dir), EX_CLOSED)) send_to_char(ch, "The %s is closed.\r\n", fname(EXIT(ch, dir)->keyword)); } else send_to_char(ch, "You see nothing special!\r\n"); } now add these two functions below that one: void char_to_dir(struct char_data *ch, room_rnum room) { ch->next_in_room = world[room].people; world[room].people = ch; IN_ROOM(ch) = room; } void char_from_dir(struct char_data *ch) { struct char_data *temp; if (FIGHTING(ch) != NULL) stop_fighting(ch); REMOVE_FROM_LIST(ch, world[IN_ROOM(ch)].people, next_in_room); IN_ROOM(ch) = NOWHERE; ch->next_in_room = NULL; } ----------------------------------------------------------------------------------------------- &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if you have any problems drop me some e-mail. And I can try to help ya. thanks