This is an immortal command driven jail snippet with an autmated release.  I take
no credit for the creation of this.  It is basically a lite version of smaugs
hell code ported to ROM.  The corner idea is from RoT.  This code can easily
be tranformed into a jail or whatever else you can think of.


#HELP
52 CORNER UNCORNER~ 
Syntax: CORNER <character> <number> <hours or days> 
Syntax: UNCORNER <character>
 
The corner command sends a character to the corner for a given
period of time.  It automatically releases the character when
their time has been served. 
  
Upon being cornered, the character receives the message, "The
ascendents are not pleased with your actions.  You shall remain
in the corner for <time period>".
 
Corner takes arguments of either hours or days.  To corner someone
for 3 hours, "corner <character> 3 hours".  To corner someone for
three days, "corner <character> 3 days".  Corner will default to hours
if hours or days is not specified.
 
You may not corner someone for more than thirty days with the corner
command. 
 
To release a player from the corner, simply "uncorner <character>".
~ 


Installation:

[ merc.h ]
---------------------------------------------------------------------------------------------
***Under  Well known room virtual numbers add:

#define ROOM_VNUM_CORNER              3 <-----being your corner room vnum------

Somwhere in struct pc_data add:

        time_t release_date;
        char *cornered_by;

[ act_wiz.c ]
----------------------------------------------------------------------------------------------
***Add do_corner and do_uncorner somewhere:

void do_corner( CHAR_DATA *ch, char *argument )
{ 
  CHAR_DATA *victim; 
  char arg[MAX_INPUT_LENGTH]; 
  int time; 
  bool h_d = FALSE; 
  struct tm *tms; 
 
  argument = one_argument(argument, arg); 
  if ( !*arg ) 
  { 
    send_to_char( "Send who to the corner, and for how long?\n\r", ch );
    return; 
  } 
  if ( !(victim = get_char_world(ch, arg)) || IS_NPC(victim) )
  { 
    send_to_char( "They aren't here.\n\r", ch );
    return;
  } 
  if ( IS_IMMORTAL(victim) )  
  { 
    send_to_char( "There is no point in sending an immortal to the corner.\n\r", ch );
    return; 
  }
  if ( victim->pcdata->release_date != 0 )
  { 
    printf_to_char(ch, "They are already in the corner until %24.24s, by %s.\n\r",
            ctime(&victim->pcdata->release_date), victim->pcdata->cornered_by);
    return; 
  } 
   
  argument = one_argument(argument, arg);
  if ( !*arg || !is_number(arg) ) 
  { 
    send_to_char( "Send them to the corner for how long?\n\r", ch );
    return; 
  } 
     
  time = atoi(arg);
  if ( time <= 0 )
  { 
    send_to_char( "You cannot corner for zero or negative time.\n\r", ch );
    return; 
  } 
     
  argument = one_argument(argument, arg);
  if ( !*arg || !str_cmp(arg, "hours"))
    h_d = TRUE; 
  else if ( str_cmp(arg, "days")) 
  { 
    send_to_char( "Is that value in hours or days?\n\r", ch ); 
    return; 
  } 
  else if ( time > 30 )
  { 
    send_to_char( "You may not corner a person for more than 30 days at a time.\n\r", ch );
    return;
  } 
  tms = localtime(&current_time);
    
  if ( h_d )
    tms->tm_hour += time; 
  else 
    tms->tm_mday += time;
  victim->pcdata->release_date = mktime(tms);
  victim->pcdata->cornered_by = str_dup(ch->name);
  printf_to_char(ch, "{W%s {Bwill be released from the corner at {W%24.24s{B.{x\n\r", victim->name,
          ctime(&victim->pcdata->release_date));
  chsend("{YPlease note the other immortals of why and who was cornered.{x\n\r", ch);
  act("{r$n disappears in a cloud of hellish light.{x", victim, 0, 0, TO_ROOM);
  char_from_room(victim);
  char_to_room (victim, get_room_index (ROOM_VNUM_CORNER)); 
  act("{r$n appears in a could of hellish light.{x", victim, NULL, ch, TO_NOTVICT);
  do_look(victim, "auto");
  printf_to_char(victim, "\n\r{RThe immortals are not pleased with your actions.{x\n\r"
          "{RYou shall remain in the corner for {W%d {R%s%s.{x\n\r", time,
          (h_d ? "hour" : "day"), (time == 1 ? "" : "s"));
  save_char_obj(victim);  
  return;
} 


void do_uncorner( CHAR_DATA *ch, char *argument )
{ 
  CHAR_DATA *victim; 
  char arg[MAX_INPUT_LENGTH]; 
  ROOM_INDEX_DATA *location; 
   
   
  argument = one_argument(argument, arg); 
  if ( !*arg ) 
  { 
    send_to_char( "Uncorner whom..?\n\r", ch ); 
    return; 
  } 
  location = ch->in_room;
  victim = get_char_world(ch, arg);
  if ( !victim || IS_NPC(victim) )
  { 
    send_to_char( "No such player character present.\n\r", ch );
    return; 
  } 
  if ( victim->in_room->vnum != 3)
  {
    send_to_char( "No one like that is in the corner.\n\r", ch );
    return; 
  } 
    location = get_room_index(ROOM_VNUM_TEMPLE);
  if ( !location ) 
    location = ch->in_room;
  act( "$n disappears in a cloud of godly light.", victim, NULL, ch, TO_NOTVICT );
  char_from_room(victim);
  char_to_room(victim, location);  
  send_to_char( "\n\r{YThe gods have smiled on you and released you from the corner early!{x\n\r\n\r",victim );
  do_look(victim, "auto");
  if ( victim != ch ) 
    send_to_char( "They have been released.\n\r", ch );
  if ( victim->pcdata->cornered_by )
  { 
    if( str_cmp(ch->name, victim->pcdata->cornered_by) )
      printf_to_char(ch, "(You should probably write a note to %s, explaining the early release.)\n\r",
            victim->pcdata->cornered_by);
    free_string (victim->pcdata->cornered_by);
    victim->pcdata->cornered_by = NULL; 
  } 
     
  act("{W$n appears in a cloud of godly light.{x", victim, 0, 0, TO_ROOM); 
  victim->pcdata->release_date = 0;
  save_char_obj(victim); 
  send_to_char( "\n\r{YThe gods have smiled on you and released you from the corner early!{x\n\r\n\r",victim );
  do_look(victim, "auto");
  if ( victim != ch ) 
    send_to_char( "They have been released.\n\r", ch );
  if ( victim->pcdata->cornered_by )
  { 
    if( str_cmp(ch->name, victim->pcdata->cornered_by) )
      printf_to_char(ch, "(You should probably write a note to %s, explaining the early release.)\n\r",
            victim->pcdata->cornered_by);
    free_string (victim->pcdata->cornered_by);
    victim->pcdata->cornered_by = NULL; 
  } 
     
  act("{W$n appears in a cloud of godly light.{x", victim, 0, 0, TO_ROOM); 
  victim->pcdata->release_date = 0;
  save_char_obj(victim); 
  send_to_char( "\n\r{YThe gods have smiled on you and released you from the corner early!{x\n\r\n\r",victim );
  do_look(victim, "auto");
  if ( victim != ch ) 
    send_to_char( "They have been released.\n\r", ch );
  if ( victim->pcdata->cornered_by )
  { 
    if( str_cmp(ch->name, victim->pcdata->cornered_by) )
      printf_to_char(ch, "(You should probably write a note to %s, explaining the early release.)\n\r",
            victim->pcdata->cornered_by);
    free_string (victim->pcdata->cornered_by);
    victim->pcdata->cornered_by = NULL; 
  } 
     
  act("{W$n appears in a cloud of godly light.{x", victim, 0, 0, TO_ROOM); 
  victim->pcdata->release_date = 0;
  save_char_obj(victim); 
  send_to_char( "\n\r{YThe gods have smiled on you and released you from the corner early!{x\n\r\n\r",victim );
  do_look(victim, "auto");
  if ( victim != ch ) 
    send_to_char( "They have been released.\n\r", ch );
  if ( victim->pcdata->cornered_by )
  { 
    if( str_cmp(ch->name, victim->pcdata->cornered_by) )
      printf_to_char(ch, "(You should probably write a note to %s, explaining the early release.)\n\r",
            victim->pcdata->cornered_by);
    free_string (victim->pcdata->cornered_by);
    victim->pcdata->cornered_by = NULL; 
  } 
     
  act("{W$n appears in a cloud of godly light.{x", victim, 0, 0, TO_ROOM); 
  victim->pcdata->release_date = 0;
  save_char_obj(victim); 
  return; 
} 


[ nanny.c ]
--------------------------------------------------------------------------------------
***In the nanny function under:

                char_to_room(ch, get_room_index(ROOM_VNUM_SCHOOL));
                chprintln(ch, "");
                do_function(ch, &do_oldhelp, "newbie info");
                chprintln(ch, ""); 
        } 
        else if (ch->in_room != NULL)
        {
                char_to_room(ch, ch->in_room);
        } 

ADD

        else if ( !IS_IMMORTAL(ch) && ch->pcdata->release_date > 0 &&
                ch->pcdata->release_date > current_time )
        { 
         
            if (ch->in_room->vnum == ROOM_VNUM_CORNER)
                char_to_room( ch, ch->in_room ); 
            else 
              char_to_room (ch, get_room_index (ROOM_VNUM_CORNER));  
        } 


[ save.c ]
----------------------------------------------------------------------------------------
***in fwrite_char function add:

        if ( ch->pcdata->release_date )
            fprintf( fp, "Cornered       %d %s~\n",
                (int)ch->pcdata->release_date, ch->pcdata->cornered_by );


***in the pload_default funtion towards the bottom add:

        ch->pcdata->release_date            = 0;        
        ch->pcdata->cornered_by               = NULL;   


***in the function fread_char unfer case 'C' add


                        if ( !strcmp(word, "Cornered") ) 
                        {
                          ch->pcdata->release_date = fread_number(fp);
                          ch->pcdata->cornered_by = fread_string(fp);
                          fMatch = TRUE; 
                          break;
                        } 

[ update.c ]
------------------------------------------------------------------------------------------
***in char_update under:

        if (ch->timer > 30)
            ch_quit = ch;

***ADD

                if ( !IS_NPC(ch) && !IS_IMMORTAL(ch) && ch->pcdata->release_date > 0 &&
                     ch->pcdata->release_date <= current_time )
                { 
                   ROOM_INDEX_DATA *location;
                    location = get_room_index(ROOM_VNUM_TEMPLE);
                   if ( !location )
                    location = ch->in_room;
                   char_from_room(ch);
                   char_to_room( ch, location );
                   chsend("You have been excused from the corner.  Now play nice!!,\n\r", ch);
                   act( "$n appears in a cloud of godly light.", ch, 0, 0, TO_ROOM);
                   do_look(ch, "auto");
                   free_string( ch->pcdata->cornered_by ); 
                   ch->pcdata->cornered_by = NULL;
                   ch->pcdata->release_date = 0;
                   save_char_obj( ch );
               }