Furniture patch 1.01 By Xerves (Released September 18, 1999)
Xerves is the admin/owner of Rafermand (mud.rafermand.net port 3002)
Website: http://www.rafermand.net
Contact: xerves@rafermand.net

Hello, and thanks for visiting the site.  This is the patch from 1.0 to
1.01 (only use this if you already have 1.0 in your code).  I don't want
to repeat myself a lot, so please read the full version for any changes
and fixes (or look at the code).  Thanks

Email : rafermand@home.net

Note:  I am going to use the orginal 1.0 file and going to add this before
some new code

*

And this means take the code out

-

These lines need to be added to the code.  At a certain point I am going to
say that all of the below is new and just add it.  Thanks, and I hope this
helps.

--------------------------

---------------
act_info.c
----------------

In function
      void show_char_to_char_0( CHAR_DATA *victim, CHAR_DATA *ch )

At the top with all the buffer declares, add this line
char message[MAX_STRING_LENGTH]; /* Output for the furniture -- Xerves */

Below these lines
          switch ( victim->position )
    {
    case POS_DEAD:     strcat( buf, "&P is DEAD!!&G" );			break;
    case POS_MORTAL:   strcat( buf, "&P is mortally wounded.&G" );		break;
    case POS_INCAP:    strcat( buf, "&P is incapacitated.&G" );		break;
    case POS_STUNNED:  strcat( buf, "&P is lying here stunned.&G" );	break;

And before these lines


    case POS_SHOVE:    strcat( buf, "&P is being shoved around.&G" );	break;
    case POS_DRAG:     strcat( buf, "&P is being dragged around.&G" );	break;

Remove everything and replace it with the following

/* Orginal furniture taken from Russ Walsh's Rot copyright 1996-1997
   Furniture 1.0 is provided by Xerves
   Info rewrite for sleeping/resting/standing/sitting on Objects -- Xerves */
   case POS_SLEEPING:
    if (victim->on != NULL)
        {
            if (IS_SET(victim->on->value[2],SLEEP_AT))
            {
                sprintf(message,"&P is sleeping at %s.",
                    victim->on->short_descr);
                strcat(buf,message);
            }
            else if (IS_SET(victim->on->value[2],SLEEP_ON))
            {
                sprintf(message,"&P is sleeping on %s.",
                    victim->on->short_descr);
                strcat(buf,message);
            }
            else
            {
                sprintf(message, "&P is sleeping in %s.",
                    victim->on->short_descr);
                strcat(buf,message);
            }
        }
*       else
*       {
        if (ch->position == POS_SITTING
        ||  ch->position == POS_RESTING )
            strcat( buf, "&P is sleeping nearby.&G" );
	else
            strcat( buf, "&P is deep in slumber here.&G" );
*       }
        break;
    case POS_RESTING:
        if (victim->on != NULL)
        {
            if (IS_SET(victim->on->value[2],REST_AT))
            {
                sprintf(message,"&P is resting at %s.",
                    victim->on->short_descr);
                strcat(buf,message);
            }
            else if (IS_SET(victim->on->value[2],REST_ON))
            {
                sprintf(message,"&P is resting on %s.",
                    victim->on->short_descr);
                strcat(buf,message);
            }
            else
            {
                sprintf(message, "&P is resting in %s.",
                    victim->on->short_descr);
                strcat(buf,message);
            }
        }
*       else
*       {
        if (ch->position == POS_RESTING)
            strcat ( buf, "&P is sprawled out alongside you.&G" );
        else
	if (ch->position == POS_MOUNTED)
	    strcat ( buf, "&P is sprawled out at the foot of your mount.&G" );
	else
            strcat (buf, "&P is sprawled out here.&G" );
*       }
        break;
    case POS_SITTING:
        if (victim->on != NULL)
        {
            if (IS_SET(victim->on->value[2],SIT_AT))
            {
                sprintf(message,"&P is sitting at %s.",
                    victim->on->short_descr);
                strcat(buf,message);
            }
            else if (IS_SET(victim->on->value[2],SIT_ON))
            {
                sprintf(message,"&P is sitting on %s.",
                    victim->on->short_descr);
                strcat(buf,message);
            }
            else
            {
                sprintf(message, "&P is sitting in %s.",
                    victim->on->short_descr);
                strcat(buf,message);
            }
        }
        else
	    strcat(buf, "&P is sitting here.");
	break;
    case POS_STANDING:
     if (victim->on != NULL)
        {
            if (IS_SET(victim->on->value[2],STAND_AT))
            {
                sprintf(message,"&P is standing at %s.",
                    victim->on->short_descr);
                strcat(buf,message);
            }
            else if (IS_SET(victim->on->value[2],STAND_ON))
            {
                sprintf(message,"&P is standing on %s.",
                    victim->on->short_descr);
                strcat(buf,message);
            }
            else
            {
                sprintf(message, "&P is standing in %s.",
                    victim->on->short_descr);
                strcat(buf,message);
            }
        }
      else
        if ( IS_IMMORTAL(victim) )
            strcat( buf, "&P is here before you.&G" );
	else
        if ( ( victim->in_room->sector_type == SECT_UNDERWATER )
        && !IS_AFFECTED(victim, AFF_AQUA_BREATH) && !IS_NPC(victim) )
            strcat( buf, "&P is drowning here.&G" );
	else
	if ( victim->in_room->sector_type == SECT_UNDERWATER )
            strcat( buf, "&P is here in the water.&G" );
	else
	if ( ( victim->in_room->sector_type == SECT_OCEANFLOOR )
	&& !IS_AFFECTED(victim, AFF_AQUA_BREATH) && !IS_NPC(victim) )
	    strcat( buf, "&P is drowning here.&G" );
	else
	if ( victim->in_room->sector_type == SECT_OCEANFLOOR )
	    strcat( buf, "&P is standing here in the water.&G" );
	else
	if ( IS_AFFECTED(victim, AFF_FLOATING)
        || IS_AFFECTED(victim, AFF_FLYING) )
          strcat( buf, "&P is hovering here.&G" );
        else
          strcat( buf, "&P is standing here.&G" );
          break;

------------------
act_move.c
------------------

This is the main chunck of code, it was rewritten into SMAUG format.
The functions are stand/sit/rest/sleep

/* Orginal furniture taken from Russ Walsh's Rot copyright 1996-1997
   Furniture 1.0 is provided by Xerves
   Allows you to stand/sit/rest/sleep on/at/in objects -- Xerves */
void do_stand( CHAR_DATA *ch, char *argument )
{

    OBJ_DATA *obj = NULL;
  * int aon = 0;

if (ch->position == POS_FIGHTING
|| ch->position == POS_BERSERK
|| ch->position == POS_EVASIVE
|| ch->position == POS_DEFENSIVE
|| ch->position == POS_AGGRESSIVE)
    {
	send_to_char("Maybe you should finish this fight first?\n\r",ch);
	return;
    }

if (ch->position == POS_MOUNTED)
   {
      send_to_char("You are already sitting - on your mount.\n\r",ch);
      return;
   }

    /* Ok, now that it is possible to sit, lets find us an object to sit on --Xerves */
    if (argument[0] != '\0')
    {
	obj = get_obj_list(ch,argument,ch->in_room->first_content);
	if (obj == NULL)
	{
	    send_to_char("You don't see that here.\n\r",ch);
	    return;
	}
-	if (obj->item_type != ITEM_FURNITURE
-	||  (!IS_SET(obj->value[2],STAND_AT)
-	&&   !IS_SET(obj->value[2],STAND_ON)
-	&&   !IS_SET(obj->value[2],STAND_IN)))
-	{
-	    send_to_char("You can't seem to find a place to stand.\n\r",ch);
-	    return;
-	}
*       if (obj->item_type != ITEM_FURNITURE)
*       {
*          send_to_char("It has to be furniture silly.\n\r", ch);
*          return;
*       }
*	if (!IS_SET(obj->value[2],STAND_ON)
*	&&   !IS_SET(obj->value[2],STAND_IN)
*	&&   !IS_SET(obj->value[2],STAND_AT))
*	{
*	    send_to_char("You can't stand on that.\n\r",ch);
*	    return;
*	}
*       if (ch->on == obj)
*          aon = 1;
*       else
	ch->on = obj;
    }

    switch ( ch->position )
    {
    case POS_SLEEPING:
	if ( IS_AFFECTED(ch, AFF_SLEEP) )
	    { send_to_char( "You can't wake up!\n\r", ch ); return; }

	if (obj == NULL)
	{
	    send_to_char( "You wake and stand up.\n\r", ch );
	    act( AT_ACTION, "$n wakes and stands up.", ch, NULL, NULL, TO_ROOM );
	    ch->on = NULL;
	}
	else if (IS_SET(obj->value[2],STAND_AT))
	{
	   act( AT_ACTION, "You wake and stand at $p.",ch,obj,NULL,TO_CHAR);
	   act( AT_ACTION, "$n wakes and stands at $p.",ch,obj,NULL,TO_ROOM);
	}
	else if (IS_SET(obj->value[2],STAND_ON))
	{
	    act( AT_ACTION, "You wake and stand on $p.",ch,obj,NULL,TO_CHAR);
	    act( AT_ACTION, "$n wakes and stands on $p.",ch,obj,NULL,TO_ROOM);
	}
	else
	{
	    act( AT_ACTION, "You wake and stand in $p.",ch,obj,NULL,TO_CHAR);
	    act( AT_ACTION, "$n wakes and stands in $p.",ch,obj,NULL,TO_ROOM);
	}
	ch->position = POS_STANDING;
	do_look(ch,"auto");
	break;

    case POS_RESTING: case POS_SITTING:
	if (obj == NULL)
	{
	    send_to_char( "You stand up.\n\r", ch );
	    act( AT_ACTION, "$n stands up.", ch, NULL, NULL, TO_ROOM );
	    ch->on = NULL;
	}
	else if (IS_SET(obj->value[2],STAND_AT))
	{
	    act( AT_ACTION, "You stand at $p.",ch,obj,NULL,TO_CHAR);
	    act( AT_ACTION, "$n stands at $p.",ch,obj,NULL,TO_ROOM);
	}
	else if (IS_SET(obj->value[2],STAND_ON))
	{
	    act( AT_ACTION, "You stand on $p.",ch,obj,NULL,TO_CHAR);
	    act( AT_ACTION, "$n stands on $p.",ch,obj,NULL,TO_ROOM);
	}
	else
	{
	    act( AT_ACTION, "You stand in $p.",ch,obj,NULL,TO_CHAR);
	    act( AT_ACTION, "$n stands on $p.",ch,obj,NULL,TO_ROOM);
	}
	ch->position = POS_STANDING;
	break;

    case POS_STANDING:
-	send_to_char( "You are already standing.\n\r", ch );
*        if (obj != NULL && aon != 1 )
*        {
*
*         if (IS_SET(obj->value[2],STAND_AT))
*	  {
*	      act( AT_ACTION, "You stand at $p.",ch,obj,NULL,TO_CHAR);
*	      act( AT_ACTION, "$n stands at $p.",ch,obj,NULL,TO_ROOM);
*	  }
*	  else if (IS_SET(obj->value[2],STAND_ON))
*	  {
*	      act( AT_ACTION, "You stand on $p.",ch,obj,NULL,TO_CHAR);
*	      act( AT_ACTION, "$n stands on $p.",ch,obj,NULL,TO_ROOM);
*	  }
*	  else
*	  {
*	      act( AT_ACTION, "You stand in $p.",ch,obj,NULL,TO_CHAR);
*	      act( AT_ACTION, "$n stands on $p.",ch,obj,NULL,TO_ROOM);
*	  }
*       }
*       else if (aon == 1)
*       {
*           act( AT_ACTION, "You are already using $p for furniture.", ch, obj, NULL, TO_CHAR);
*       }
*       else if (ch->on != NULL && obj == NULL)
*       {
*           act( AT_ACTION, "You hop off of $p and stand on the ground.", ch, ch->on, NULL, TO_CHAR);
*           act( AT_ACTION, "$n hops off of $p and stands on the ground.", ch, ch->on, NULL, TO_ROOM );
*	    ch->on = NULL;
*       }
*       else
*	send_to_char( "You are already standing.\n\r", ch );
	break;

      }
    return;
}


void do_sit( CHAR_DATA *ch, char *argument )
{

    OBJ_DATA *obj = NULL;
*   int aon = 0;
if (ch->position == POS_FIGHTING
|| ch->position == POS_BERSERK
|| ch->position == POS_EVASIVE
|| ch->position == POS_DEFENSIVE
|| ch->position == POS_AGGRESSIVE)
    {
	send_to_char("Maybe you should finish this fight first?\n\r",ch);
	return;
    }

if (ch->position == POS_MOUNTED)
   {
      send_to_char("You are already sitting - on your mount.\n\r",ch);
      return;
   }

/* Ok, now that it is possible to sit, lets find us an object to sit on --Xerves */
    if (argument[0] != '\0')
    {
	obj = get_obj_list(ch,argument,ch->in_room->first_content);
	if (obj == NULL)
	{
	    send_to_char("You don't see that here.\n\r",ch);
	    return;
	}
-    }
-    else obj = ch->on;
-
-    if (obj != NULL)
-    {
-	if (!IS_SET(obj->item_type,ITEM_FURNITURE)
-	||  (!IS_SET(obj->value[2],SIT_ON)
-	&&   !IS_SET(obj->value[2],SIT_IN)
-	&&   !IS_SET(obj->value[2],SIT_AT)))
-	{
-	    send_to_char("You can't sit on that.\n\r",ch);
-	    return;
-	}
-
*       if (obj->item_type != ITEM_FURNITURE)
*       {
*          send_to_char("It has to be furniture silly.\n\r", ch);
*          return;
*       }
*	if (!IS_SET(obj->value[2],SIT_ON)
*	&&   !IS_SET(obj->value[2],SIT_IN)
*	&&   !IS_SET(obj->value[2],SIT_AT))
*	{
*	    send_to_char("You can't sit on that.\n\r",ch);
*	    return;
*	}
*       if (ch->on == obj)
*         aon = 1;
*       else
	ch->on = obj;
    }
    switch (ch->position)
    {
	case POS_SLEEPING:
            if (obj == NULL)
            {
            	send_to_char( "You wake and sit up.\n\r", ch );
            	act( AT_ACTION, "$n wakes and sits up.", ch, NULL, NULL, TO_ROOM );
            }
            else if (IS_SET(obj->value[2],SIT_AT))
            {
                  act( AT_ACTION, "You wake up and sit at $p.",ch,obj,NULL,TO_CHAR);
            	act( AT_ACTION, "$n wakes and sits at $p.",ch,obj,NULL,TO_ROOM);
            }
            else if (IS_SET(obj->value[2],SIT_ON))
            {
            	act( AT_ACTION, "You wake and sit on $p.",ch,obj,NULL,TO_CHAR);
            	act( AT_ACTION, "$n wakes and sits at $p.",ch,obj,NULL,TO_ROOM);
            }
            else
            {
            	act( AT_ACTION, "You wake and sit in $p.",ch,obj,NULL,TO_CHAR);
            	act( AT_ACTION, "$n wakes and sits in $p.",ch,obj,NULL,TO_ROOM);
            }

	    ch->position = POS_SITTING;
	    break;
	case POS_RESTING:
	    if (obj == NULL)
		send_to_char("You stop resting.\n\r",ch);
	    else if (IS_SET(obj->value[2],SIT_AT))
	    {
		act( AT_ACTION, "You sit at $p.",ch,obj,NULL,TO_CHAR);
		act( AT_ACTION, "$n sits at $p.",ch,obj,NULL,TO_ROOM);
	    }

	    else if (IS_SET(obj->value[2],SIT_ON))
	    {
		act( AT_ACTION, "You sit on $p.",ch,obj,NULL,TO_CHAR);
		act( AT_ACTION, "$n sits on $p.",ch,obj,NULL,TO_ROOM);
	    }
	    ch->position = POS_SITTING;
	    break;
	case POS_SITTING:
-	    send_to_char("You are already sitting down.\n\r",ch);
*         if (obj != NULL && aon != 1 )
*         {
*
*           if (IS_SET(obj->value[2],SIT_AT))
*	    {
*	        act( AT_ACTION, "You sit at $p.",ch,obj,NULL,TO_CHAR);
*	        act( AT_ACTION, "$n sits at $p.",ch,obj,NULL,TO_ROOM);
*	    }
*	    else if (IS_SET(obj->value[2],STAND_ON))
*	    {
*	        act( AT_ACTION, "You sit on $p.",ch,obj,NULL,TO_CHAR);
*	        act( AT_ACTION, "$n sits on $p.",ch,obj,NULL,TO_ROOM);
*	    }
*	    else
*	    {
*	        act( AT_ACTION, "You sit in $p.",ch,obj,NULL,TO_CHAR);
*	        act( AT_ACTION, "$n sits on $p.",ch,obj,NULL,TO_ROOM);
*	    }
*          }
*         else if (aon == 1)
*         {
*             act( AT_ACTION, "You are already using $p for furniture.", ch, obj, NULL, TO_CHAR);
*         }
*         else if (ch->on != NULL && obj == NULL)
*         {
*             act( AT_ACTION, "You hop off of $p and sit on the ground.", ch, ch->on, NULL, TO_CHAR);
*             act( AT_ACTION, "$n hops off of $p and sits on the ground.", ch, ch->on, NULL, TO_ROOM );
*	      ch->on = NULL;
*         }
*         else
*	  send_to_char( "You are already sitting.\n\r", ch );
	    break;
	case POS_STANDING:
	    if (obj == NULL)
    	    {
		send_to_char("You sit down.\n\r",ch);
    	        act( AT_ACTION, "$n sits down on the ground.",ch,NULL,NULL,TO_ROOM);
	    }
	    else if (IS_SET(obj->value[2],SIT_AT))
	    {
		act( AT_ACTION, "You sit down at $p.",ch,obj,NULL,TO_CHAR);
		act( AT_ACTION, "$n sits down at $p.",ch,obj,NULL,TO_ROOM);
	    }
	    else if (IS_SET(obj->value[2],SIT_ON))
	    {
		act( AT_ACTION, "You sit on $p.",ch,obj,NULL,TO_CHAR);
		act( AT_ACTION, "$n sits on $p.",ch,obj,NULL,TO_ROOM);
	    }
	    else
	    {
		act( AT_ACTION, "You sit down in $p.",ch,obj,NULL,TO_CHAR);
		act( AT_ACTION, "$n sits down in $p.",ch,obj,NULL,TO_ROOM);
	    }
    	    ch->position = POS_SITTING;
    	    break;
    }


    return;
}


void do_rest( CHAR_DATA *ch, char *argument )
{

    OBJ_DATA *obj = NULL;
*   int aon = 0;

if (ch->position == POS_FIGHTING
|| ch->position == POS_BERSERK
|| ch->position == POS_EVASIVE
|| ch->position == POS_DEFENSIVE
|| ch->position == POS_AGGRESSIVE)
    {
	send_to_char("Maybe you should finish this fight first?\n\r",ch);
	return;
    }

if (ch->position == POS_MOUNTED)
   {
      send_to_char("You are already sitting - on your mount.\n\r",ch);
      return;
   }

    /* okay, now that we know we can sit, find an object to sit on */
    if (argument[0] != '\0')
    {
	obj = get_obj_list(ch,argument,ch->in_room->first_content);
	if (obj == NULL)
	{
	    send_to_char("You don't see that here.\n\r",ch);
	    return;
	}
-    }
-    else obj = ch->on;
-
-    if (obj != NULL)
-    {
-if (!IS_SET(obj->item_type,ITEM_FURNITURE)
-    	||  (!IS_SET(obj->value[2],REST_ON)
-    	&&   !IS_SET(obj->value[2],REST_IN)
-    	&&   !IS_SET(obj->value[2],REST_AT)))
-    	{
-	    send_to_char("You can't rest on that.\n\r",ch);
-	    return;
-    	}
-
*       if (obj->item_type != ITEM_FURNITURE)
*       {
*          send_to_char("It has to be furniture silly.\n\r", ch);
*          return;
*       }
*	if (!IS_SET(obj->value[2],REST_ON)
*	&&   !IS_SET(obj->value[2],REST_IN)
*	&&   !IS_SET(obj->value[2],REST_AT))
*	{
*	    send_to_char("You can't rest on that.\n\r",ch);
*	    return;
*	}
*       if (ch->on == obj)
*         aon = 1;
*       else
	ch->on = obj;
    }

    switch ( ch->position )
    {
    case POS_SLEEPING:
	if (obj == NULL)
	{
	    send_to_char( "You wake up and start resting.\n\r", ch );
	    act  ( AT_ACTION, "$n wakes up and starts resting.",ch,NULL,NULL,TO_ROOM);
	}
	else if (IS_SET(obj->value[2],REST_AT))
	{
	    act( AT_ACTION, "You wake up and rest at $p.",
		    ch,obj,NULL,TO_CHAR);
	    act( AT_ACTION, "$n wakes up and rests at $p.",ch,obj,NULL,TO_ROOM);
	}
      else if (IS_SET(obj->value[2],REST_ON))
      {
          act( AT_ACTION, "You wake up and rest on $p.",
                  ch,obj,NULL,TO_CHAR);
          act( AT_ACTION, "$n wakes up and rests on $p.",ch,obj,NULL,TO_ROOM);
      }
      else
      {
          act( AT_ACTION, "You wake up and rest in $p.",
                  ch,obj,NULL,TO_CHAR);
          act( AT_ACTION, "$n wakes up and rests in $p.",ch,obj,NULL,TO_ROOM);
      }
	ch->position = POS_RESTING;
	break;

    case POS_RESTING:
-	send_to_char( "You are already resting.\n\r", ch );
*        if (obj != NULL && aon != 1 )
*        {
*
*         if (IS_SET(obj->value[2],REST_AT))
*	  {
*	      act( AT_ACTION, "You rest at $p.",ch,obj,NULL,TO_CHAR);
*	      act( AT_ACTION, "$n rests at $p.",ch,obj,NULL,TO_ROOM);
*	  }
*	  else if (IS_SET(obj->value[2],REST_ON))
*	  {
*	      act( AT_ACTION, "You rest on $p.",ch,obj,NULL,TO_CHAR);
*	      act( AT_ACTION, "$n rests on $p.",ch,obj,NULL,TO_ROOM);
*	  }
*	  else
*	  {
*	      act( AT_ACTION, "You rest in $p.",ch,obj,NULL,TO_CHAR);
*	      act( AT_ACTION, "$n rests on $p.",ch,obj,NULL,TO_ROOM);
*	  }
*        }
*       else if (aon == 1)
*       {
*           act( AT_ACTION, "You are already using $p for furniture.", ch, obj, NULL, TO_CHAR);
*       }
*       else if (ch->on != NULL && obj == NULL)
*       {
*           act( AT_ACTION, "You hop off of $p and start resting on the ground.", ch, ch->on, NULL, TO_CHAR);
*           act( AT_ACTION, "$n hops off of $p and starts to rest on the ground.", ch, ch->on, NULL, TO_ROOM );
*	    ch->on = NULL;
*       }
*       else
*	send_to_char( "You are already resting.\n\r", ch );
	break;

    case POS_STANDING:
	if (obj == NULL)
	{
	    send_to_char( "You rest.\n\r", ch );
	    act( AT_ACTION, "$n sits down and rests.", ch, NULL, NULL, TO_ROOM );
	}
        else if (IS_SET(obj->value[2],REST_AT))
        {
	    act( AT_ACTION, "You sit down at $p and rest.",ch,obj,NULL,TO_CHAR);
	    act( AT_ACTION, "$n sits down at $p and rests.",ch,obj,NULL,TO_ROOM);
        }
        else if (IS_SET(obj->value[2],REST_ON))
        {
	    act( AT_ACTION, "You sit on $p and rest.",ch,obj,NULL,TO_CHAR);
	    act( AT_ACTION, "$n sits on $p and rests.",ch,obj,NULL,TO_ROOM);
        }
        else
        {
	    act( AT_ACTION, "You rest in $p.",ch,obj,NULL,TO_CHAR);
	    act( AT_ACTION, "$n rests in $p.",ch,obj,NULL,TO_ROOM);
        }
	ch->position = POS_RESTING;
	break;

    case POS_SITTING:
	if (obj == NULL)
	{
	    send_to_char("You rest.\n\r",ch);
	    act( AT_ACTION, "$n rests.",ch,NULL,NULL,TO_ROOM);
	}
        else if (IS_SET(obj->value[2],REST_AT))
        {
	    act( AT_ACTION, "You rest at $p.",ch,obj,NULL,TO_CHAR);
	    act( AT_ACTION, "$n rests at $p.",ch,obj,NULL,TO_ROOM);
        }
        else if (IS_SET(obj->value[2],REST_ON))
        {
	    act( AT_ACTION, "You rest on $p.",ch,obj,NULL,TO_CHAR);
	    act( AT_ACTION, "$n rests on $p.",ch,obj,NULL,TO_ROOM);
        }
        else
        {
	    act( AT_ACTION, "You rest in $p.",ch,obj,NULL,TO_CHAR);
	    act( AT_ACTION, "$n rests in $p.",ch,obj,NULL,TO_ROOM);
	}
	ch->position = POS_RESTING;
	break;
    }

    rprog_rest_trigger( ch );
    return;
}


void do_sleep( CHAR_DATA *ch, char *argument )
{
OBJ_DATA *obj = NULL;
*  int aon = 0;

if (ch->position == POS_FIGHTING
|| ch->position == POS_BERSERK
|| ch->position == POS_EVASIVE
|| ch->position == POS_DEFENSIVE
|| ch->position == POS_AGGRESSIVE)
    {
	send_to_char("Maybe you should finish this fight first?\n\r",ch);
	return;
    }

if (ch->position == POS_MOUNTED)
   {
      send_to_char("If you wish to go to sleep, get off of your mount first.n\r",ch);
      return;
   }

    /* okay, now that we know we can sit, find an object to sit on */
    if (argument[0] != '\0')
    {
	obj = get_obj_list(ch,argument,ch->in_room->first_content);
	if (obj == NULL)
	{
	    send_to_char("You don't see that here.\n\r",ch);
	    return;
	}
-    }
-    else obj = ch->on;
-
-    if (obj != NULL)
-    {
-	if (!IS_SET(obj->item_type,ITEM_FURNITURE)
-	||  (!IS_SET(obj->value[2],SLEEP_ON)
-	&&   !IS_SET(obj->value[2],SLEEP_IN)
-	&&   !IS_SET(obj->value[2],SLEEP_AT)))
-	{
-	    send_to_char("You can't sleep on that.\n\r",ch);
-	    return;
-	}
-
*       if (obj->item_type != ITEM_FURNITURE)
*       {
*          send_to_char("It has to be furniture silly.\n\r", ch);
*          return;
*       }
*	if (!IS_SET(obj->value[2],SLEEP_ON)
*	&&   !IS_SET(obj->value[2],SLEEP_IN)
*	&&   !IS_SET(obj->value[2],SLEEP_AT))
*	{
*	    send_to_char("You can't sleep on that.\n\r",ch);
*	    return;
*	}
*       if (ch->on == obj)
*         aon = 1;
*       else
	ch->on = obj;
    }
    switch (ch->position)
    {
	case POS_SLEEPING:

-          send_to_char( "You are already sleeping.\n\r", ch );
*          if (obj != NULL && aon != 1 )
*          {
*
*           if (IS_SET(obj->value[2],SLEEP_AT))
*	    {
*	        act( AT_ACTION, "You sleep at $p.",ch,obj,NULL,TO_CHAR);
*	        act( AT_ACTION, "$n sleeps at $p.",ch,obj,NULL,TO_ROOM);
*	    }
*	    else if (IS_SET(obj->value[2],SLEEP_ON))
*	    {
*	        act( AT_ACTION, "You sleep on $p.",ch,obj,NULL,TO_CHAR);
*	        act( AT_ACTION, "$n sleeps on $p.",ch,obj,NULL,TO_ROOM);
*	    }
*	    else
*	    {
*	        act( AT_ACTION, "You sleep in $p.",ch,obj,NULL,TO_CHAR);
*	        act( AT_ACTION, "$n sleeps on $p.",ch,obj,NULL,TO_ROOM);
*	    }
*         }
*         else if (aon == 1)
*         {
*             act( AT_ACTION, "You are already using $p for furniture.", ch, obj, NULL, TO_CHAR);
*         }
*         else if (ch->on != NULL && obj == NULL)
*         {
*             act( AT_ACTION, "You hop off of $p and try to sleep on the ground.", ch, ch->on, NULL, TO_CHAR);
*             act( AT_ACTION, "$n hops off of $p and falls quickly asleep on the ground.", ch, ch->on, NULL, TO_ROOM );
*	      ch->on = NULL;
*         }
*         else
*	  send_to_char( "You are already sleeping.\n\r", ch );
	    break;
	case POS_RESTING:
	    if (obj == NULL)
          {
		send_to_char("You lean your head back more and go to sleep.\n\r",ch);
    	      act( AT_ACTION, "$n lies back and falls asleep on the ground.",ch,NULL,NULL,TO_ROOM);
          }
	    else if (IS_SET(obj->value[2],SLEEP_AT))
	    {
		act( AT_ACTION, "You sleep at $p.",ch,obj,NULL,TO_CHAR);
		act( AT_ACTION, "$n sleeps at $p.",ch,obj,NULL,TO_ROOM);
	    }

	    else if (IS_SET(obj->value[2],SLEEP_ON))
	    {
		act( AT_ACTION, "You sleep on $p.",ch,obj,NULL,TO_CHAR);
		act( AT_ACTION, "$n sleeps on $p.",ch,obj,NULL,TO_ROOM);
	    }

	    else
	    {
		act( AT_ACTION, "You sleep in $p.",ch,obj,NULL,TO_CHAR);
		act( AT_ACTION, "$n sleeps in $p.",ch,obj,NULL,TO_ROOM);
	    }
	    ch->position = POS_SLEEPING;
	    break;

	case POS_SITTING:
	    if (obj == NULL)
          {
            send_to_char("You lay down and go to sleep.\n\r", ch);
            act( AT_ACTION, "$n lies back and falls asleep on the ground.",ch,NULL,NULL,TO_ROOM);
          }
          else if (IS_SET(obj->value[2],SLEEP_AT))
	    {
		act( AT_ACTION, "You sleep at $p.",ch,obj,NULL,TO_CHAR);
		act( AT_ACTION, "$n sleeps at $p.",ch,obj,NULL,TO_ROOM);
	    }

	    else if (IS_SET(obj->value[2],SLEEP_ON))
	    {
		act( AT_ACTION, "You sleep on $p.",ch,obj,NULL,TO_CHAR);
		act( AT_ACTION, "$n sleeps on $p.",ch,obj,NULL,TO_ROOM);
	    }

	    else
	    {
		act( AT_ACTION, "You sleep in $p.",ch,obj,NULL,TO_CHAR);
		act( AT_ACTION, "$n sleeps in $p.",ch,obj,NULL,TO_ROOM);
	    }
	    ch->position = POS_SLEEPING;

	    break;
	case POS_STANDING:
	    if (obj == NULL)
    	    {
		send_to_char("You drop down and fall asleep on the ground.\n\r",ch);
    	      act( AT_ACTION, "$n drops down and falls asleep on the ground.",ch,NULL,NULL,TO_ROOM);
	    }
	    else if (IS_SET(obj->value[2],SLEEP_AT))
	    {
		act( AT_ACTION, "You sleep at $p.",ch,obj,NULL,TO_CHAR);
		act( AT_ACTION, "$n sleeps at $p.",ch,obj,NULL,TO_ROOM);
	    }
	    else if (IS_SET(obj->value[2],SLEEP_ON))
	    {
		act( AT_ACTION, "You sleep on $p.",ch,obj,NULL,TO_CHAR);
		act( AT_ACTION, "$n sleeps on $p.",ch,obj,NULL,TO_ROOM);
	    }
	    else
	    {
		act( AT_ACTION, "You sleep down in $p.",ch,obj,NULL,TO_CHAR);
		act( AT_ACTION, "$n sleeps down in $p.",ch,obj,NULL,TO_ROOM);
	    }
    	    ch->position = POS_SLEEPING;
    	    break;
    }

    rprog_sleep_trigger( ch );
    return;
}
----------------
mud.h
----------------

Defined Bitvectors for the furniture

Defined it after

/*
 * Values for containers (value[1]).
 * Used in #OBJECTS.
 */
#define CONT_CLOSEABLE		   BV00
#define CONT_PICKPROOF		   BV01
#define CONT_CLOSED		   BV02
#define CONT_LOCKED		   BV03
#define CONT_EATKEY		   BV04

Here is what was added

/*
 * Sitting/Standing/Sleeping/Sitting on/in/at Objects - Xerves
 * Used for furniture (value[2]) in the #OBJECTS Section
 */
#define SIT_ON     BV00
#define SIT_IN     BV01
#define SIT_AT     BV02

#define STAND_ON   BV03
#define STAND_IN   BV04
#define STAND_AT   BV05

#define SLEEP_ON   BV06
#define SLEEP_IN   BV07
#define SLEEP_AT   BV08

#define REST_ON     BV09
#define REST_IN     BV10
#define REST_AT     BV11

In
    struct	char_data


After

    OBJ_DATA *		last_carrying;

ADD

    OBJ_DATA *		on;

------------------------------------------

 The rest below is totally new.  Just follow the directions to
 add all of the stuff.

-----------
act_wiz.c
-----------

Goto do_transfer
After these lines
    act( AT_MAGIC, "$n disappears in a cloud of swirling colors.", victim, NULL, NULL, TO_ROOM );
    victim->retran = victim->in_room->vnum;
    char_from_room( victim );
    char_to_room( victim, location );
Add these lines
    if ( victim->on )
    {
       victim->on = NULL;
       victim->position = POS_STANDING;
    }
    if (victim->position != POS_STANDING)
    {
       victim->position = POS_STANDING;
    }

----------
build.c
----------
Goto do_goto
After these lines
    ch->regoto = ch->in_room->vnum;
    char_from_room( ch );
    if ( ch->mount )
    {
	char_from_room( ch->mount );
	char_to_room( ch->mount, location );
    }
    char_to_room( ch, location );
Add these lines
    if ( ch->on )
    {
       ch->on = NULL;
       ch->position = POS_STANDING;
    }
    if (ch->position != POS_STANDING)
    {
       ch->position = POS_STANDING;
    }


----------
magic.c
----------

Goto spell_astral_walk
After these lines
    act( AT_MAGIC, skill->hit_room, ch, NULL, victim, TO_NOTVICT );
    else
	act( AT_MAGIC, "$n disappears in a flash of light!", ch, NULL, NULL, TO_ROOM );
    char_from_room( ch );
    char_to_room( ch, victim->in_room );
Add these lines
    if ( ch->on )
    {
       ch->on = NULL;
       ch->position = POS_STANDING;
    }
    if (ch->position != POS_STANDING)
    {
       ch->position = POS_STANDING;
    }

Goto spell_solar_flight
After these lines
    act( AT_MAGIC, "$n disappears in a blinding flash of light!",
	ch, NULL, NULL, TO_ROOM );
    char_from_room( ch );
    char_to_room( ch, victim->in_room )
Add these lines
    if ( ch->on )
    {
       ch->on = NULL;
       ch->position = POS_STANDING;
    }
    if (ch->position != POS_STANDING)
    {
       ch->position = POS_STANDING;
    }

Goto spell_helical_flow
After these lines
    act( AT_MAGIC, "$n coils into an ascending column of colour,"
                    " vanishing into thin air.", ch, NULL, NULL,
		    TO_ROOM );
    char_from_room( ch );
    char_to_room( ch, victim->in_room );
Add these lines
    if ( ch->on )
    {
       ch->on = NULL;
       ch->position = POS_STANDING;
    }
    if (ch->position != POS_STANDING)
    {
       ch->position = POS_STANDING;
    }


Goto spell_teleport
After these lines
    act( AT_MAGIC, "$n slowly fades out of view.", victim, NULL, NULL, TO_ROOM );
    char_from_room( victim );
    char_to_room( victim, pRoomIndex );
Add these lines
    if ( ch->on )
    {
       ch->on = NULL;
       ch->position = POS_STANDING;
    }
    if (ch->position != POS_STANDING)
    {
       ch->position = POS_STANDING;
    }

----------
skills.c
----------
Goto do_recall
After these lines
    if ( ch->mount )
    {
	char_from_room( ch->mount );
	char_to_room( ch->mount, ch->in_room );
      do_look(ch->mount, "auto" );
    }
    if (ch->pcdata->pet )
    {
       char_from_room( ch->pcdata->pet );
       char_to_room( ch->pcdata->pet, ch->in_room );
       do_look(ch->pcdata->pet, "auto" );
    }
Add these lines
    if ( ch->on )
    {
       ch->on = NULL;
       ch->position = POS_STANDING;
    }
    if (ch->position != POS_STANDING)
    {
       ch->position = POS_STANDING;
    }


Goto do_mistwalk
After these lines
    act( AT_DGREEN, "Your surroundings blur as you assume a form of churning mist!", ch, NULL, NULL, TO_CHAR );
    act( AT_DGREEN, "$n dissolves into a cloud of glowing mist, then vanishes!", ch, NULL, NULL, TO_ROOM );
    learn_from_success( ch, gsn_mistwalk );
    char_from_room( ch );
    char_to_room( ch, victim->in_room );
Add these lines
    if ( ch->on )
    {
       ch->on = NULL;
       ch->position = POS_STANDING;
    }
    if (ch->position != POS_STANDING)
    {
       ch->position = POS_STANDING;
    }



-----------
mud_comm.c
-----------

goto do_mptransfer
After these lines
      if ( immortal->fighting )
         stop_fighting( immortal, TRUE );
      char_from_room( immortal );
      char_to_room( immortal, location );
    }

    char_from_room( victim );
Add these lines
    if ( victim->on )
    {
       victim->on = NULL;
       victim->position = POS_STANDING;
    }
    if (victim->position != POS_STANDING)
    {
       victim->position = POS_STANDING;
    }

Goto do_mpgoto
After these lines
    in_room = ch->in_room;
    if ( ch->fighting )
	stop_fighting( ch, TRUE );
    char_from_room( ch );
Add these lines
    if ( ch->on )
    {
       ch->on = NULL;
       ch->position = POS_STANDING;
    }
    if (ch->position != POS_STANDING)
    {
       ch->position = POS_STANDING;
    }

--------------------------------------

FURNITUREVALUES
It is now possible to sit/sleep/rest/stand on furniture.
Here is how all of this works.

value2 - sit/sleep/rest/stand on furniture (more below)

As for value2, it uses bitvictors, and here are their numbers

SIT ON -    1        SIT IN -    2        SIT AT -    4
STAND ON -  8        STAND IN -  16       STAND AT -  32
SLEEP ON -  64       SLEEP IN -  128      SLEEP AT -  256
REST ON -   512      REST IN -   1024     REST AT -   2048

Furniture is set using the v2 setting and through adding the
values to make it work.  Say you want SIT ON and STAND IN, you
would add 1 and 16 and get 17.

A quick note, you can only be on in at an object.  If you
set all 3 of them to lets say Sit, when type type sit
object, they will sit at the object.  So only select
one.

Furniture Code 1.01 provided by Xerves of Rafermand.

-------------------------------------------------------
FURNITURE

Syntax: <action> <object>

It is now possible to sit/stand/sleep/rest on/in/at properly
created peices of furniture.  All you have to do is find a peice
of furniture that is working properly and just type sit chair
if it was a chair.  If you can sit on it, it will allow you
to either sit on/in/at it.

Furniture Code 1.01 provided by Xerves of Rafermand.

------------------------------------------------------------

Furniture code was put into a moderately modified SMAUG 1.4 source
code and seemed to work without problems (or ones I can see at this
moment).  I cannot say that this code will fit exactly into 1.4a or
1.02, but if you look at the code a bit you should be able to figure
most of it out (most of the checks above are places after the char
is taken from the room).  Also, if you have modified any of the stuff
where I said just to put this whole chunk of text in, you might consider
wanting to look at the orginal before just dropping it in there.  I
hope this release found most of the errors associated with 1.0, if not,
my email address is above, and I would love to hear of any problems that
are left.  Thanks, and sorry about not releasing this any sooner.

--Xerves
