From: Corey Hoitsma (choitsma@netcom.com)
Subject: Copyto and Dig Commands for OasisOLC

/* Add to bottom of act.wizard.c */

ACMD(do_copyto)
{

/* Only works if you have Oasis OLC */
extern void olc_add_to_save_list(int zone, byte type);

  char buf2[10];
  char buf[80];
  int iroom = 0, rroom = 0;
  struct room_data *room;

  one_argument(argument, buf2); 
  /* buf2 is room to copy to */

	CREATE (room, struct room_data, 1);	

	iroom = atoi(buf2);
	rroom = real_room(atoi(buf2));
	*room = world[rroom];

 if (!*buf2) {
    send_to_char("Format: copyto <room number>\r\n", ch); 
    return; }
 if (rroom <= 0) {
	sprintf(buf, "There is no room with the number %d.\r\n", iroom);
	send_to_char(buf, ch);
	return; }

/* Main stuff */

  if (world[ch->in_room].description) {
    world[rroom].description = str_dup(world[ch->in_room].description);

/* Only works if you have Oasis OLC */
  olc_add_to_save_list((iroom/100), OLC_SAVE_ROOM);

 sprintf(buf, "You copy the description to room %d.\r\n", iroom);
 send_to_char(buf, ch); }
	else
	send_to_char("This room has no description!\r\n", ch);
}

ACMD(do_dig)
{
/* Only works if you have Oasis OLC */
extern void olc_add_to_save_list(int zone, byte type);

  char buf2[10];
  char buf3[10];
  char buf[80];
  int iroom = 0, rroom = 0;
  int dir = 0;
/*  struct room_data *room; */

  two_arguments(argument, buf2, buf3); 
  /* buf2 is the direction, buf3 is the room */

	iroom = atoi(buf3);
	rroom = real_room(iroom);

 if (!*buf2) {
    send_to_char("Format: dig <dir> <room number>\r\n", ch); 
    return; }
 else if (!*buf3) {
    send_to_char("Format: dig <dir> <room number>\r\n", ch); 
    return; }
 if (rroom <= 0) {
	sprintf(buf, "There is no room with the number %d", iroom);
	send_to_char(buf, ch);
	return; }
/* Main stuff */
    switch (*buf2) {
    case 'n':
    case 'N':
      dir = NORTH;
      break;
    case 'e':
    case 'E':
      dir = EAST;
      break;
    case 's':
    case 'S':
      dir = SOUTH;
      break;
    case 'w':
    case 'W':
      dir = WEST;
      break;
    case 'u':
    case 'U':
      dir = UP;
      break;
    case 'd':
    case 'D':
      dir = DOWN;
      break; }

CREATE(world[rroom].dir_option[rev_dir[dir]], struct room_direction_data,1); 
  world[rroom].dir_option[rev_dir[dir]]->general_description = NULL;
  world[rroom].dir_option[rev_dir[dir]]->keyword = NULL;
  world[rroom].dir_option[rev_dir[dir]]->to_room = ch->in_room; 

CREATE(world[ch->in_room].dir_option[dir], struct room_direction_data,1); 
  world[ch->in_room].dir_option[dir]->general_description = NULL;
  world[ch->in_room].dir_option[dir]->keyword = NULL;
  world[ch->in_room].dir_option[dir]->to_room = rroom; 

/* Only works if you have Oasis OLC */
  olc_add_to_save_list((iroom/100), OLC_SAVE_ROOM);

 sprintf(buf, "You make an exit %s to room %d.\r\n", buf2, iroom);
 send_to_char(buf, ch);
}

