act_info.c

FlCodebase3.1/src/act_info.c · 170.8 KB

From the archive FlCodebase3.1.tgz

Download the archive   « Back to the archive contents

/***************************************************************************
 *  Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,        *
 *  Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.   *
 *                                                                         *
 *  Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael          *
 *  Chastain, Michael Quan, and Mitchell Tse.                              *
 *                                                                         *
 *  In order to use any part of this Envy Diku Mud, you must comply with   *
 *  the original Diku license in 'license.doc', the Merc license in        *
 *  'license.txt', as well as the Envy license in 'license.nvy'.           *
 *  In particular, you may not remove either of these copyright notices.   *
 *                                                                         *
 *  Much time and thought has gone into this software and you are          *
 *  benefitting.  We hope that you share your changes too.  What goes      *
 *  around, comes around.                                                  * 
 *                                                                         *
 *      ROM 2.4 is copyright 1993-1998 Russ Taylor                         *
 *      ROM has been brought to you by the ROM consortium                  *
 *          Russ Taylor (rtaylor@hypercube.org)                            *
 *          Gabrielle Taylor (gtaylor@hypercube.org)                       *
 *          Brian Moore (zump@rom.org)                                     *
 *      By using this code, you have agreed to follow the terms of the     *
 *      ROM license, in the file Rom24/doc/rom.license                     *
 *                                                                         *
 * Code Adapted and Improved by Abandoned Realms Mud                       *
 * and Aabahran: The Forsaken Lands Mud by Virigoth                        *
 *                                                                         *
 * Continued Production of this code is available at www.flcodebase.com    *
 ***************************************************************************/


#define _XOPEN_SOURCE
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <time.h>
#include "merc.h"
#include "magic.h"
#include "cabal.h"
#include "recycle.h"
#include "interp.h"
#include "jail.h"
#include "bounty.h"
#include "armies.h"
#include "comm.h"
#include "clan.h"

extern void show_cabal_help( CHAR_DATA* ch, char* argument, char* output );
extern bool bounty_covered( CHAR_DATA* victim );
extern void show_tracks( CHAR_DATA* ch, ROOM_INDEX_DATA* in_room );

char *  const   where_name      [] =
{
    "<used as light>     ",
    "<worn on finger>    ",
    "<worn on finger>    ",
    "<worn around neck>  ",
    "<worn around neck>  ",
    "<worn on torso>     ",
    "<worn on head>      ",
    "<worn on face>      ",
    "<worn on legs>      ",
    "<worn on feet>      ",
    "<worn on hands>     ",
    "<worn on arms>      ",
    "<worn as shield>    ",
    "<worn about body>   ",
    "<worn about waist>  ",
    "<worn around wrist> ",
    "<worn around wrist> ",
    "<wielded>           ",
    "<held>              ",
    "<floating nearby>   ",
    "<dual wielded>      ",
    "<worn as shroud>    ",
    "<tattooed>          ",
    "<worn on ear>       ",
    "<strung on back>    ",
    "<sheathed>          ",	//sheath locations are special, these strings
    "<sheathed>          ",	//is normaly replaced by "get_sheath_string"
    "<in the quiver>     ",
};

/* How equipment is shown */
int eq_positions[] =
{
WEAR_LIGHT,
WEAR_FINGER_L,
WEAR_FINGER_R,
WEAR_NECK_1,
WEAR_NECK_2,
WEAR_HEAD,
WEAR_EARRING,
WEAR_BODY,
WEAR_ARMS,
WEAR_HANDS,
WEAR_LEGS,
WEAR_FEET,
WEAR_SHIELD,
WEAR_ABOUT,
WEAR_WAIST,
WEAR_WRIST_L,
WEAR_WRIST_R,
WEAR_WIELD,
WEAR_SECONDARY,
WEAR_SHEATH_L,
WEAR_SHEATH_R,
WEAR_HOLD,
WEAR_FACE,
WEAR_SHROUD,
WEAR_FLOAT,
WEAR_RANGED,
WEAR_QUIVER,
WEAR_TATTOO,
};

/* shows info about character details */
void show_detail_info( CHAR_DATA* ch, CHAR_DATA* victim){
  char buf[MIL];
  BUFFER *output;
  int h, d, m, y;

  if (IS_NPC(victim))
    return;

  output = new_buf();

  rltom_date( victim->pcdata->birth_date, &h, &d, &m, &y );

  sprintf( buf, 
	   "Born at: %s\n\r"\
	   "Aged   : %-4d (%s-handed) %s%s%s\n\r",
	   mud_date_string( h, d, m, y ),
	   get_age( victim ),
	   victim->pcdata->lefthanded ? "Left" : "Right",
	   victim->pcdata->perk_bits ? "(" : "",
	   victim->pcdata->perk_bits ? perk_bit_name( victim->pcdata->perk_bits ) : "",
	   victim->pcdata->perk_bits ? ")" : ""
	   );
  add_buf( output, buf );
  if (victim->pcdata->fDetail){
    sprintf( buf, "Face: %-12.12s Eyes : %-12.12s Facial-Hair: %-18.18s\n\r",
	     chargen_face_table[victim->pcdata->face_type].name,
	     chargen_eyes_table[victim->pcdata->eye_color].name,
	     chargen_hairf_table[victim->pcdata->facial_hair].name
	     );
    add_buf( output, buf );
    sprintf( buf, "Hair: %-12.12s Color: %-12.12s Texture: %-12.12s\n\r",
	     chargen_hairl_table[victim->pcdata->hair_length].name,
	     chargen_hair_table[victim->pcdata->hair_color].name,
	     chargen_hairt_table[victim->pcdata->hair_texture].name
	     );
    add_buf( output, buf );
    sprintf( buf, "Body: %-12.12s Skin : %-12.12s\n\r",
	     chargen_body_table[victim->pcdata->body_type].name,
	     chargen_skin_table[victim->pcdata->skin_color].name
	     );
    add_buf( output, buf );
  }
  add_buf( output, "Description:\n\r");
  add_buf( output, victim->description);
  

  page_to_char( buf_string(output), ch );
  free_buf(output);
}

char *pers( CHAR_DATA *Ch, CHAR_DATA *looker )
{
  AFFECT_DATA* paf;
  CHAR_DATA* ch = Ch;
  static char buf[MSL];
  buf[0] = '\0';
  
  if (can_see(looker,ch)){
    if (IS_NPC(ch) && !is_affected(ch, gsn_doppelganger))
      return (ch->short_descr);

    if (IS_AFFECTED2(ch,AFF_SHADOWFORM)){
      if (IS_IMMORTAL(looker)){
	sprintf(buf,"{`8%s``} a shadow", ch->name);
	return (buf);
      }
      else
	return ("a shadow");
    }
    if (IS_AFFECTED2(ch,AFF_TREEFORM)){
      if (IS_IMMORTAL(looker)){
	sprintf(buf,"{`8%s``} A large oak tree", ch->name);
	return (buf);
      }
      else
	return ("A large oak tree");
    }
    if ( (paf = affect_find(ch->affected,gen_conceal)) != NULL){
      if (IS_IMMORTAL(looker) 
	  || (paf->modifier && is_same_cabal(ch->pCabal, looker->pCabal))){
	sprintf(buf,"{`8%s``} %s", ch->name, ch->short_descr);
	return (buf);
      }
      else
	return (ch->short_descr);
    }
    if (is_affected(ch,gsn_doppelganger) && ch->doppel){
      if (IS_IMMORTAL(looker) && !IS_NPC(ch)){
	sprintf(buf,"{`8%s``} %s", ch->name, ch->doppel->name);
	return (buf);
      }
      else if (ch->doppel->doppel == NULL)
	return (pers(ch->doppel, looker));
      else
	return (ch->doppel->name);
    }
    if (is_affected(ch,gsn_bat_form) 
	|| is_affected(ch,gsn_wolf_form) 
	|| is_affected(ch,gsn_mist_form)){
      if (IS_IMMORTAL(looker)){
	sprintf(buf,"{`8%s``} %s", ch->name, ch->short_descr);
	return (buf);
      }
      else
	return (ch->short_descr);
    }
    if (IS_IMMORTAL(ch) && ch->short_descr[0] && str_cmp(ch->name, ch->short_descr)){
      if (IS_IMMORTAL(looker)){
	sprintf(buf,"{`8%s``} %s", ch->name, ch->short_descr);
	return (buf);
      }
      else
	return (ch->short_descr);
    }
    return (ch->name);
  }
  if (IS_IMMORTAL(ch) && !IS_NPC(ch) && ch->incog_level)
    sprintf(buf,"an Immortal");
  else
    sprintf(buf,"someone");
  return (buf);
}

char *pers2( CHAR_DATA *ch )
{
  CHAR_DATA* vch = ch;
  static char buf[MSL];
  buf[0] = '\0';

  if (is_affected(ch,gsn_doppelganger) && ch->doppel){
    vch = ch->doppel;
  }
  if (IS_NPC(vch))
    return (vch->short_descr);

  if (is_affected(vch,gsn_bat_form) 
      || is_affected(vch,gsn_wolf_form) 
      || is_affected(vch,gsn_mist_form)
      || is_affected(vch, gen_conceal) )
    return (vch->short_descr);

  if (IS_IMMORTAL(ch) && ch->short_descr[0] 
      && str_cmp(ch->name, ch->short_descr))
    return (ch->short_descr);
  return (ch->name);
}

char *format_obj_to_char( OBJ_DATA *obj, CHAR_DATA *ch, bool fShort )
{
    static char buf[MSL];
    int cond = get_curr_cond(obj);
    buf[0] = '\0';
    if ((fShort && (obj->short_descr == NULL || obj->short_descr[0] == '\0'))
	|| (obj->description == NULL || obj->description[0] == '\0'))
      return buf;
    if ( IS_OBJ_STAT(obj, ITEM_STAIN) )		strcat( buf, "<`!STAINED``> "      );
    if (obj->item_type == ITEM_PROJECTILE)	strcat( buf, get_proj_number( obj->condition ) );
    else if (obj->carried_by && cond < 50)	strcat( buf, get_condition(cond, TRUE));
    if ( can_see_trap(ch, obj->traps) ) strcat (buf, "`!+``");
    if ( is_affected_obj(obj, gsn_there_not_there) ) strcat (buf, "(Phased) ");
    if ( IS_OBJ_STAT(obj, ITEM_INVIS) ) strcat( buf, "(Invis) "      );
    if ( IS_AFFECTED(ch, AFF_DETECT_EVIL)  && IS_OBJ_STAT(obj, ITEM_EVIL)  ) strcat( buf, "(Red Aura) ");
    if ( IS_AFFECTED(ch, AFF_DETECT_GOOD)  && IS_OBJ_STAT(obj, ITEM_BLESS) ) strcat( buf, "(Golden Aura) ");
    if ( IS_AFFECTED(ch, AFF_DETECT_MAGIC) && IS_OBJ_STAT(obj, ITEM_MAGIC) ) strcat( buf, "(Magical) ");
    if ( IS_OBJ_STAT(obj, ITEM_GLOW)  ) strcat( buf, "(Glowing) "    );
    if ( IS_OBJ_STAT(obj, ITEM_HUM)   ) strcat( buf, "(Humming) "    );
    if ( fShort && obj->short_descr != NULL )
      strcat( buf, obj->short_descr );
    else if ( obj->description != NULL)
      strcat( buf, obj->description );
    return buf;
}

/*void send_color_status(CHAR_DATA *ch, char *a, char *c, byte b)
{
    sprintf(c,"%s %s %s\n\r",color_table[b],a,ANSI_NORMAL);
    send_to_char(c,ch);
}*/

/* shows list of psalms */
void do_psalm(CHAR_DATA* ch, char* argument){
  char psalm_list[MAX_PSALM][MIL];
//  int max_psalms = max_psalm(ch);
  int i = 0;
  int last_psalm = 0;

  if (IS_NPC(ch))
    return;

  for (i = 0; i < MAX_PSALM; i++){
/*changed this to show baptism which is given regardless
  if (ch->pcdata->psalms[i] < 1 || ch->pcdata->psalms[i] > max_psalms){
*/
    if (ch->pcdata->psalms[i] < 1){
      continue;
    }
    last_psalm++;
    sprintf(psalm_list[ch->pcdata->psalms[i] - 1], 
	    "%3d. %-22s %8s %8s\n\r", 
	    ch->pcdata->psalms[i], 
	    psalm_table[i].name,
	    psalm_table[i].fGroup ? "[Group]" : "",
	    psalm_table[i].fTwo ? "" : "[no-double]");
  }
  if (last_psalm == 0){
    send_to_char("You have not learned any psalms.\n\r", ch);
    return;
  }
  else
    send_to_char("Psalm of:\n\r", ch);
  for (i = 0; i < last_psalm; i++){
    send_to_char(psalm_list[i], ch);
  }
}

/* checks if the area is city, and if so reports justice laws */
void do_law(CHAR_DATA *ch, char *argument){
  act("$n seems to scan the area $s eyes searching for guards.",
      ch, NULL, NULL, TO_ROOM);
  if (IS_SET(ch->in_room->area->area_flags, AREA_LAWFUL)){
    int crime = 0;
    send_to_char("The area about you observes Law in following ways:\n\r", ch );
    for (crime = 0; crime  < MAX_CRIME; crime ++ ){
      sendf(ch, "%-15s : %s\n\r", 
	    crime_table[crime].name,
	    punish_table[ch->in_room->area->crimes[crime]].name);
    }
  }
  else
    send_to_char("You scan the area but find no trace of guards.\n\r", ch);
}

void do_color(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
    {
        send_to_char("NPC's can't see colors!\n\r",ch);
        return;
    }
    if (IS_NULLSTR(argument)){
      TOGGLE_BIT(ch->color, COLOR_ON);
      send_to_char("Syntax:  color <flag>\n\rCurrent Settings:\n\r", ch);
      sendf(ch, 
	    "color\t\t%s\n\r"\
	    "damage\t\t%s\n\r",
	    IS_COLOR(ch, COLOR_ON) ? "[ON]" : "[OFF]",
	    IS_COLOR(ch, COLOR_DAMAGE) ? "[ON]" : "[OFF]");
      return;
    }
    if (!str_prefix(argument, "color")){
      do_color(ch, "");
    }
    else if (!str_prefix(argument, "damage")){
      /* we toggle color since it will be toggled back bo do_color */
      REMOVE_BIT(ch->color, COLOR_ON);
      TOGGLE_BIT(ch->color, COLOR_DAMAGE);
      do_color(ch, "");
    }
    else{
      TOGGLE_BIT(ch->color, COLOR_ON);
      do_color(ch, "");
    }
}

void list_to_char( OBJ_DATA *list, CHAR_DATA *ch, bool fShort, bool fShowNothing, bool fShowAll )
{
    char buf[MSL];
    BUFFER *output;
    int nShow = 0, iShow, count = 0;
    char *pstrShow;
    char **prgpstrShow;
    int *prgnShow;
    OBJ_DATA *obj;
    bool fCombine;
    if ( ch->desc == NULL )
	return;
    output = new_buf();

    for ( obj = list; obj != NULL; obj = obj->next_content )
      count++;

    prgpstrShow = alloc_mem( count * sizeof(char *) );
    prgnShow    = alloc_mem( count * sizeof(int)    );

    for ( obj = list; obj != NULL; obj = obj->next_content )
      if ( obj->wear_loc == WEAR_NONE && 
	   (can_see_obj( ch, obj ) || fShowAll)) 
	{
	  pstrShow = format_obj_to_char( obj, ch, fShort );
	  fCombine = FALSE;
	  for ( iShow = nShow - 1; iShow >= 0; iShow-- )
	    if ( !strcmp( prgpstrShow[iShow], pstrShow ) ){
	      prgnShow[iShow]++;
	      fCombine = TRUE;
	      break;
	    }
	  if ( !fCombine ){
	    prgpstrShow [nShow] = str_dup( pstrShow );
	    prgnShow    [nShow] = 1;
	    nShow++;
	  }
        }
    for ( iShow = 0; iShow < nShow; iShow++ ){
      if (prgpstrShow[iShow][0] == '\0')
	{
	  free_string(prgpstrShow[iShow]);
	  continue;
	}
      if ( prgnShow[iShow] != 1 )
        {
	  sprintf( buf, "(%2d) ", prgnShow[iShow] );
	  add_buf(output,buf);
        }
      else
	add_buf(output,"     ");
      add_buf(output,prgpstrShow[iShow]);
      add_buf(output,"\n\r");
      free_string( prgpstrShow[iShow] );
    }
    if ( fShowNothing && nShow == 0 )
      {
        send_to_char( "     Nothing.\n\r", ch );
      }
    send_to_char(buf_string(output),ch);
    free_buf(output);
    free_mem( prgpstrShow, count * sizeof(char *) );
    free_mem( prgnShow,    count * sizeof(int)    );
}

void show_list_to_char( OBJ_DATA *list, CHAR_DATA *ch, bool fShort, bool fShowNothing ){
  list_to_char(list, ch, fShort, fShowNothing , FALSE);
}


void char_to_char( CHAR_DATA *victim, CHAR_DATA *ch , bool fAll)
{
  CHAR_DATA* vch = victim;
  char buf[MSL], buf2[MSL];
  AFFECT_DATA* paf;
  
  buf[0] = '\0';
  if (IS_AFFECTED2(victim, AFF_CATALEPSY))
    return;
  if (IS_NPC(victim) && IS_NULLSTR(victim->long_descr)){
    if (IS_IMMORTAL(ch) && IS_SET(ch->act,PLR_HOLYLIGHT)){
      sendf(ch, "(%s)\n\r", victim->short_descr);
    }
    return;
  } 
  if (!IS_NPC(victim) && IS_IMMORTAL(victim) && victim->long_descr[0] != '\0')
    {
      if (IS_IMMORTAL(ch) && IS_SET(ch->act,PLR_HOLYLIGHT))
	{
	  sprintf( buf2, "(%s) ", victim->name);
	  strcat( buf, buf2);
	}
      strcat( buf, victim->long_descr );
      send_to_char( buf, ch );
      return;
    }
  if ( IS_SET(victim->comm,COMM_AFK     )   ) strcat( buf, "[`1AFK``] " );
  if ( IS_IMMORTAL(ch) && victim->invis_level > 1 )
    {
      sprintf( buf2, "(Wizi %d) ", victim->invis_level);
      strcat( buf,buf2);
    }
  if ( IS_IMMORTAL(ch) && victim->incog_level > 1 )
    {
	sprintf( buf2, "(Incog %d) ", victim->incog_level);
	strcat( buf,buf2);
    }
  
  /* Mirror cloak reverses prefixes */
  if (ch != victim
      && ch->class != gcn_psi
      && !IS_SET(ch->act, PLR_HOLYLIGHT) 
      && is_affected( victim, gsn_mirror_cloak))
    vch = ch;

  if ((paf = affect_find(victim->affected, gsn_mark_prey)) != NULL
      && paf->has_string && is_name(paf->string, ch->name)) strcat( buf, "(`!Marked``) " );
  else if (check_avenger(ch, victim) == CRUSADE_MATCH) strcat( buf, "(`!Marked``) " );
  if ( IS_AFFECTED(vch, AFF_INVISIBLE)   ) strcat( buf, "(`8Invisible``) " );
  if ( is_affected(vch, gsn_burrow)   )    strcat( buf, "(`3Burrowed``) " );
  if ( IS_AFFECTED2(vch, AFF_CAMOUFLAGE) ) strcat( buf, "(`2Camouflage``) " );
  if ( IS_AFFECTED(vch, AFF_HIDE)        
       || is_affected(vch, gen_d_shroud))  strcat( buf, "(`8Hide``) " );
  if ( IS_AFFECTED(vch, AFF_CHARM)       ) strcat( buf, "(`8Charmed``) " );
  if (IS_AFFECTED2(vch,AFF_SHADOWFORM))    strcat( buf, "(`5Shadowformed``) ");
  if (IS_AFFECTED2(vch,AFF_TREEFORM))      strcat( buf, "(`2Treeformed``) ");
  if (!IS_NPC(victim) 
      && IS_SET(victim->act, PLR_WANTED ) )strcat(buf, "(`1WANTED``) ");
  if (!IS_NPC(victim) 
      && IS_SET(victim->act, PLR_OUTCAST) )strcat(buf, "(`1OUTCAST``) ");
  if (IS_EVIL(victim)
      && IS_AFFECTED(ch, AFF_DETECT_EVIL) )strcat( buf, "(`!Red Aura``) "   );
  if (IS_GOOD(victim) 
      && IS_AFFECTED(ch, AFF_DETECT_GOOD) )strcat( buf, "(`#Golden Aura``) ");
  if (!IS_NPC(victim)
      && IS_AFFECTED2(ch,AFF_SENSE_EVIL) 
      && IS_EVIL(victim)
      && !IS_IMMORTAL(victim)
      && !can_see(ch,victim) ){
    buf[0] = '\0';
    strcat( buf, "(`!Red Aura``) ");
  }    
  
  /* can be hidden by shroud */
  if ( !is_affected(vch,skill_lookup("dark shroud")) ){
    if (IS_AFFECTED(vch, AFF_PASS_DOOR))    strcat( buf, "(`^Translucent``) ");
    if (IS_AFFECTED(vch, AFF_FAERIE_FIRE))  strcat( buf, "(`9Pink Aura``) "  );
    if (IS_AFFECTED(vch, AFF_FAERIE_FOG))   strcat( buf, "(`#Yellow Aura``) ");
    if (IS_AFFECTED(vch, AFF_SANCTUARY))    strcat( buf, "(`&White Aura``) " );
    if (is_affected(vch, gsn_lifeforce))    strcat( buf, "(`2Green Aura``) " );
    if (is_affected(vch, gsn_pyramid_of_force))strcat( buf, "(`0Pyramid``) " );
    if (is_affected(vch, gsn_aura) 
	|| IS_AVATAR(vch))	            strcat( buf, "(`&Bright Aura``)" );
  } 
  if ( IS_NPC(victim) 
       && !IS_AFFECTED2(victim, AFF_SEVERED)
       && victim->position == victim->start_pos 
       && victim->long_descr[0] != '\0' 
       && can_see(ch,victim) ){
    strcat( buf, victim->long_descr );
    send_to_char( buf, ch );
    return;
  }
  if( (IS_AFFECTED2(victim, AFF_SEVERED))){
    sprintf(buf,"%s's upper torso is here, twitching.\n\r",PERS2(victim));
    send_to_char(buf,ch);
    return;
  }
  else if (IS_STONED( victim )){
    sprintf(buf,"A statue of %s is here.\n\r", PERS2(victim));
    send_to_char(buf,ch);
    return;
  }
  
  /* were beast flags */
  if (!IS_NPC(victim) && victim->race == grn_werebeast){
    char tag[MIL];
    if (is_affected(victim, gsn_weretiger)){
      sprintf(tag,"{`8%s``} ", "Tiger");
      strcat( buf, tag );
    }
    else if (is_affected(victim, gsn_werewolf)){
      sprintf(tag,"{`8%s``} ", "Wolf");
      strcat( buf, tag );
    }
    else if (is_affected(victim, gsn_werebear)){
      sprintf(tag,"{`8%s``} ", "Bear");
      strcat( buf, tag );
    }
    else if (is_affected(victim, gsn_werefalcon)){
      sprintf(tag,"{`8%s``} ", "Falcon");
      strcat( buf, tag );
    }
  }

  if (is_affected(victim, gsn_doppelganger) && victim->doppel){
    strcat(buf, ( fAll? PERS2(victim): PERS(victim, ch )));
    if (!IS_NPC(victim->doppel) && !IS_SET(ch->comm, COMM_BRIEF)
	&& victim->doppel->short_descr[0] == '\0')
      strcat(buf, 
	     (fAll ? (IS_NPC(victim) ? "" : victim->pcdata->title) : victim->doppel->pcdata->title));
  }
  else{
    strcat( buf, (fAll? PERS2(victim) : PERS( victim, ch )) );
    if ( !IS_NPC(victim) 
	 && !IS_SET(ch->comm, COMM_BRIEF) 
	 && victim->position == POS_STANDING
	 && !IS_AFFECTED2(victim, AFF_SHADOWFORM)
	 && !IS_AFFECTED2(victim, AFF_TREEFORM) 
	 && (can_see(ch,victim) || fAll)
	 && !is_affected(victim,gsn_bat_form) 
	 && !is_affected(victim,gsn_wolf_form) 
	 && !is_affected(victim,gsn_mist_form)
	 && !is_affected(victim,gen_conceal) )
      strcat( buf, victim->pcdata->title );
  }
  switch ( victim->position ){
  case POS_DEAD:     strcat( buf, " is DEAD!!" );              break;
  case POS_MORTAL:   strcat( buf, " is mortally wounded." );   break;
  case POS_INCAP:    strcat( buf, " is incapacitated." );      break;
  case POS_STUNNED:  strcat( buf, " is lying here stunned." ); break;
  case POS_MEDITATE:  strcat( buf, " is sitting here meditating." ); break;
  case POS_SLEEPING: 
    if (is_affected(victim, gsn_camp)) strcat( buf," is camped up here.");
    else if (is_affected(victim, gsn_coffin)) strcat( buf," is lying here in a coffin.");
    else if (is_affected(victim, gsn_entomb)) strcat( buf," is sleeping in a tomb.");
    else if (is_affected(victim, gen_watchtower)) strcat( buf," is sleeping in a watchtower.");
    else strcat( buf," is sleeping here.");	break;
  case POS_RESTING:  
    if (is_affected(victim, gsn_mortally_wounded)) strcat( buf, " is kneeling on the ground." );       
    else if (is_affected(victim,gsn_ecstacy)) strcat( buf," is resting here with a wide grin.");
    else if (is_affected(victim, gen_watchtower)) strcat( buf," is resting in a watchtower.");
    else if (is_affected(victim, gen_acraft)) strcat( buf," is swinging a hammer here.");
    else if (is_affected(victim, gen_wcraft)) strcat( buf," is working on a weapon here.");
    else if (is_affected(victim, gen_chant)) strcat( buf," is praying here.");
    else strcat( buf, " is resting here." ); break;
  case POS_SITTING:  
    if (is_affected(victim,gsn_ecstacy)) strcat( buf," is sitting here with a wide grin.");
    else if (is_affected(victim, gen_watchtower)) strcat( buf," is sitting in a watchtower.");
    else strcat( buf, " is sitting here.");	 break;
  case POS_STANDING: 
    if (!IS_NPC(victim) && victim->pcdata->pStallion != NULL){
      sprintf( buf2, " is here, sitting astride %s.", victim->pcdata->pStallion->short_descr);
      strcat( buf, buf2);
    }
    else if (is_affected(victim,gsn_ecstacy)) strcat( buf," is standing here with a wide grin.");
    else if (is_affected(victim, gen_watchtower)) strcat( buf," is here in a watchtower.");
    else strcat( buf, " is here." ); break;
  case POS_FIGHTING:
    strcat( buf, " is here, fighting " );
      if ( victim->fighting == NULL ) strcat( buf, "thin air??" );
      else if ( victim->fighting == ch ) strcat( buf, "YOU!" );
      else if ( victim->in_room == victim->fighting->in_room ){
	strcat( buf, 
		(fAll? PERS2(victim->fighting): PERS( victim->fighting, ch )) );
	strcat( buf, "." );
      }
      else strcat( buf, "someone who left??" ); break;
  }
  strcat( buf, "\n\r" );
  buf[0] = UPPER(buf[0]);
  send_to_char( buf, ch );
  return;
}

/* returns the sheath equipment string */
char* sheath_str(CHAR_DATA* ch, OBJ_DATA* obj, bool fLeft){
  int pos = sheath_lookup(class_table[ch->class].name);

  /* thiefs only hide daggers otherwise its regular string */
  if ((obj->item_type != ITEM_WEAPON || obj->value[0] != WEAPON_DAGGER)
      && pos != 0
      && ch->class == class_lookup("thief"))
    pos = 0;

  if (fLeft)
    return sheath_table[pos].l_str;
  else
    return sheath_table[pos].r_str;
}

/* decides if the victim's sheaths are shown */
bool show_sheath(CHAR_DATA* ch, CHAR_DATA* victim){
  int i = 0;

  if (!IS_NPC(ch) && IS_SET(ch->act, PLR_HOLYLIGHT))
    return TRUE;

  if (ch == victim)
    return TRUE;

  if (get_skill(ch, gsn_peek) > 0)
    return TRUE;

  if ( (i = sheath_lookup(class_table[victim->class].name)) < 1
       || sheath_table[i].show)
    return TRUE;
  else
    return FALSE;
}

/* shows list of eq worn */
void show_equipment(CHAR_DATA* Victim, CHAR_DATA* ch, bool fMirror ){
  OBJ_DATA* obj;
  int i;
  char out[MSL];
  char buf[MIL];

/* dopple switch */
  CHAR_DATA* victim = is_affected(Victim, gsn_doppelganger) && Victim->doppel ? Victim->doppel : Victim;
  
  bool fBodyWep = is_affected(victim, gsn_body_weaponry);
  bool fGraft = is_affected(victim, gsn_graft_weapon);
  bool fShowSheath = show_sheath(ch, victim);
  bool fThief = victim->class == class_lookup("thief");

/* mirror switch */
  if (fMirror)
    victim = ch;
/* init buffer */
  out[0] = '\0';

  for (i = 0; i < sizeof(eq_positions)/sizeof(eq_positions[0]); i++){
    int pos = eq_positions[i];
    obj = get_eq_char(victim, pos);

    if (pos == WEAR_WIELD && fBodyWep){
      sprintf(buf , "%s hands shaped like weapons\n\r", where_name[pos]);
      strcat(out, buf);
      continue;
    }
    /* everything beyond this point needs an object */
    if (obj == NULL){
      /* show some position as nothing */
      if (ch == Victim
	  && pos != WEAR_SHEATH_L
	  && pos != WEAR_SHEATH_R
	  && pos != WEAR_WIELD
	  && pos != WEAR_SECONDARY
	  && pos != WEAR_SHIELD
	  && pos != WEAR_HOLD
	  && pos != WEAR_SHROUD
	  && pos != WEAR_TATTOO
	  && pos != WEAR_RANGED){
	sprintf( buf, "%s %s\n\r", 
		 where_name[eq_positions[i]], 
		 "nothing.");
	strcat(out, buf );
      }
      continue;
    }

    /* do not show hidden sheaths */
    if ( (pos == WEAR_SHEATH_L || pos == WEAR_SHEATH_L) && !fShowSheath){
      /* there is a special condition for thiefs and hidden sheathed weapons */
      if (!fThief || obj->value[0] == WEAPON_DAGGER)
	continue;
    }
    if (!can_see_obj(ch, obj)){
      if (ch == victim)
	sprintf( buf, "something.\n\r");
      else
	continue;
    }
    else if (pos == WEAR_WIELD && fGraft){
      sprintf( buf, "<grafted to hands>  %s\n\r", 
	       format_obj_to_char( obj, ch, TRUE ));
    }
    else if (pos == WEAR_SHEATH_L){
      sprintf( buf, "%s %s\n\r", 
	       sheath_str(victim, obj, TRUE),
	       format_obj_to_char( obj, ch, TRUE ));
    }
    else if (pos == WEAR_SHEATH_R){
      sprintf( buf, "%s %s\n\r", 
	       sheath_str(victim, obj, FALSE),
	       format_obj_to_char( obj, ch, TRUE ));
    }
    else{
      sprintf( buf, "%s %s\n\r", 
	       where_name[eq_positions[i]], 
	       format_obj_to_char( obj, ch, TRUE ));
    }
    /* attatch the string to output */
    strcat(out, buf);
  }
  if (buf[0] != '\0'){
    sendf(ch, "\n\r%s is using:\n\r", 
	  fMirror ? PERS(Victim, ch) : PERS(victim,ch) );
    send_to_char(out, ch);
  }
}

void show_char_to_char_0( CHAR_DATA *victim, CHAR_DATA *ch ){
  char_to_char(victim, ch, FALSE );
}


void show_char_to_char_1( CHAR_DATA *victim, CHAR_DATA *ch ){

  AFFECT_DATA* paf;
  bool fMirror = FALSE;

    CHAR_DATA *tmp_vict = ( is_affected(victim,gsn_doppelganger) && victim->doppel) ? victim->doppel : victim;
    char buf[MSL];
    int peek = 0, percent;
    if (!IS_NPC(victim) && IS_IMMORTAL(victim) && get_trust(ch) < get_trust(victim) && !IS_SET(victim->act,PLR_NOSUMMON))
    {
	send_to_char( "I don't think so.\n\r",ch);
	return;
    }
    if ( can_see( victim, ch ) )
    {
	if (ch == victim)
	    act( "$n looks at $mself.",ch,NULL,NULL,TO_ROOM);
	else
	{
	    act( "$n looks at you.", ch, NULL, victim, TO_VICT    );
	    act( "$n looks at $N.",  ch, NULL, victim, TO_NOTVICT );
	}
    }
    /* Mirror cloak reverses desc/eq onto the looker */
    if (ch != victim
	&& ch->class != gcn_psi
	&& !IS_SET(ch->act, PLR_HOLYLIGHT) 
	&& is_affected( victim, gsn_mirror_cloak)){
      fMirror = TRUE;
    }

    if ( IS_AFFECTED2( victim, AFF_SHADOWFORM))
	send_to_char("This formless apparition seems to be alive.\n\r",ch);
    else if (is_affected(victim,gsn_bat_form))
	send_to_char("You see a large vampire bat.\n\r",ch);
    else if (IS_AFFECTED2(victim, AFF_TREEFORM))
        send_to_char("You see before you a large oak tree.\n\r",ch);
    else if (is_affected(victim,gsn_wolf_form))
	send_to_char("You see a large wolf.\n\r",ch);
    else if (is_affected(victim,gsn_mist_form))
	send_to_char("You see a cloud of mist.\n\r",ch);
    else if (is_affected(victim,gsn_weretiger))
      send_to_char("You see a fierce tiger standing upright on its hind legs.\n\r",ch);
    else if (is_affected(victim,gsn_werewolf))
      send_to_char("You see a fearsome wolf standing upright on its hind legs.\n\r",ch);
    else if (is_affected(victim,gsn_werebear))
      send_to_char("You see a massive bear standing upright on its hind legs.\n\r",ch);
    else if (is_affected(victim,gsn_werefalcon))
      send_to_char("A fierce Werefalcon spreads its wings before you.\n\r",ch);
    else if ( (paf = affect_find(victim->affected, gen_conceal)) != NULL
	      && (!paf->modifier || !is_same_cabal(ch->pCabal, victim->pCabal))
	      && !IS_IMMORTAL(ch)){
      send_to_char("The thick hooded cloak conceals any kind of detail.\n\r",ch);
      return;
    }
    else if ( !fMirror && tmp_vict->description[0] != '\0' )
      send_to_char( tmp_vict->description, ch );
    else if (fMirror && ch->description[0] != '\0' )
      send_to_char( ch->description, ch );
    else
      act( "You see nothing special about $M.", ch, NULL, tmp_vict, TO_CHAR );

    if (!IS_NPC(tmp_vict) && !IS_IMMORTAL(victim)){
      int quest_num = tmp_vict->pcdata->max_quests;
      if (!str_cmp(tmp_vict->name, mud_data.questor)){
	act("$N currently holds the title of `#Master Questor`` of Aabahran.", ch, NULL, tmp_vict, TO_CHAR);
      }
      else if (quest_num == 0 )
	act("$E has led a sheltered life.", ch, NULL, tmp_vict, TO_CHAR );
      else
	{
	  percent =  (100 * quest_num)  / mud_data.max_quest;
	  if (percent > 99)
	    act("$E is the ultimate explorer.", ch, NULL, tmp_vict, TO_CHAR );
	  else if (percent > 90)
	    act("$E is a master explorer.", ch, NULL, tmp_vict, TO_CHAR );
	  else if (percent > 80)
	    act("$E is an experienced explorer.", ch, NULL, tmp_vict, TO_CHAR );
	  else if (percent > 60)
	    act("$E has unlocked many secrets of the world.", ch, NULL, tmp_vict, TO_CHAR );
	  else if (percent > 40)
	    act("$E has travelled quite a lot.", ch, NULL, tmp_vict, TO_CHAR );
	  else if (percent > 20)
	    act("$E has done a fair amount of traveling.", ch, NULL, tmp_vict, TO_CHAR );
	  else
	    act("$E has just opened up $S eyes to the world.", ch, NULL, tmp_vict, TO_CHAR );
	}
    }

if ( victim->max_hit > 0 )
     percent = ( 100 * victim->hit ) / victim->max_hit;
    else
	percent = -1;
    strcpy( buf, PERS(victim, ch) );
    if (percent >= 100)		strcat( buf, " is in excellent condition.\n\r");
    else if (percent >= 90)	strcat( buf, " has a few scratches.\n\r");
    else if (percent >= 75)	strcat( buf, " has some small wounds and bruises.\n\r");
    else if (percent >=  50)	strcat( buf, " has quite a few wounds.\n\r");
    else if (percent >= 30)	strcat( buf, " has some big nasty wounds and scratches.\n\r");
    else if (percent >= 15)	strcat( buf, " looks pretty hurt.\n\r");
    else if (percent >= 0 )	strcat( buf, " is in awful condition.\n\r");
    else			strcat( buf, " is bleeding to death.\n\r");
    buf[0] = UPPER(buf[0]);
    send_to_char( buf, ch );

    if (IS_AFFECTED2( victim, AFF_SHADOWFORM) && !IS_IMMORTAL(ch) && ch != victim)
    {
	send_to_char("\n\rYou can't see through the shadows.\n\r",ch);
	return;
    }
    if (IS_AFFECTED2( victim, AFF_TREEFORM) && !IS_IMMORTAL(ch) && ch != victim)
    {
        send_to_char("\n\rIts only a tree.\n\r",ch);
        return;
    }
    else if (is_affected(victim,gsn_bat_form) || is_affected(victim,gsn_wolf_form) || is_affected(victim,gsn_mist_form))
      return;

/* show eq */
    show_equipment(victim, ch, fMirror);

    peek = get_skill(ch,gsn_peek);
    if (peek > 0)
	peek += 2*(get_curr_stat(ch,STAT_LUCK) - 16);
    if ( victim != ch && !IS_NPC(ch) && (number_percent() < peek || IS_IMMORTAL(ch)))
    {
      if (!IS_NPC(victim) && IS_IMMORTAL(victim) && !IS_IMMORTAL(ch))
	return;	  
      send_to_char( "\n\rYou peek at the inventory:\n\r", ch );
      check_improve(ch,gsn_peek,TRUE, 0);
      show_list_to_char( is_affected(victim,gsn_doppelganger) ? tmp_vict->carrying : victim->carrying, ch, TRUE, TRUE );
    }

    if (IS_AFFECTED (ch, AFF_DETECT_MAGIC) || IS_IMMORTAL(ch)) {
      if (ch->level / 5 * 10 > number_percent () || IS_IMMORTAL(ch)) {
	do_affects2 (ch, victim);
      }
    }

     
}

void show_char_to_char( CHAR_DATA *list, CHAR_DATA *ch )
{
    CHAR_DATA *rch;
    bool found = FALSE;
    int number = 0;
    for ( rch = list; rch != NULL; rch = rch->next_in_room )
    {
	if ( rch == ch )
	    continue;
	if ( get_trust(ch) < rch->invis_level)
	    continue;
	if ( can_see( ch, rch ) 
	     || (IS_AFFECTED2(ch, AFF_SENSE_EVIL) 
		 && IS_EVIL(rch) && !is_affected(rch, gen_d_shroud))
	     || (check_avenger(ch, rch) == CRUSADE_MATCH
		 && !is_affected(rch, gen_d_shroud)) )
	{
	    show_char_to_char_0( rch, ch );
	    number++;
	}
	else if (!IS_UNDEAD(rch))
	  found = TRUE;
    }
    if (found && number < (ch->level / 10)){
      if (ch->race == grn_feral){
	send_to_char("You sense a hidden presence in this room.\n\r", ch);
      }
      else if (ch->class == gcn_monk
	       && is_affected(ch, gsn_sense_motion)
	       && get_skill(ch,gsn_sense_motion) > number_percent() 
	       && monk_good(ch, WEAR_HEAD) ){
	send_to_char("You sense a hidden presence in this room.\n\r", ch);
      }
    }
} 

bool check_blind( CHAR_DATA *ch )
{
    if (!IS_NPC(ch) && IS_SET(ch->act,PLR_HOLYLIGHT))
	return TRUE;
//we check if char is blined and make sure that he cannot see using bat senses.
//Also we check if he is a bat, and can use his senses (bata can beblinded
//with silence.

    if(  (IS_AFFECTED(ch, AFF_BLIND) && !is_affected(ch, gsn_bat_form)) || (IS_AFFECTED(ch, AFF_BLIND) && bat_blind(ch)) || bat_blind(ch) )
      return FALSE; 
    else
      return TRUE;
}

void do_scroll(CHAR_DATA *ch, char *argument)
{
    char arg[MIL];
    int lines;
    argument = one_argument( argument, arg );
    if (arg[0] == '\0')
    {
	if (ch->lines == 0)
	    send_to_char("You do not page long messages.\n\r",ch);
	else
	    sendf(ch, "You currently display %d lines per page.\n\r",ch->lines + 2);
	return;
    }
    if (!is_number(arg))
    {
	send_to_char("You must provide a number.\n\r",ch);
	return;
    }
    lines = atoi(arg);
    if (lines == 0)
    {
	send_to_char("Paging disabled.\n\r",ch);
	ch->lines = 0;
	return;
    }
    if (lines < 10 || lines > 100)
    {
	send_to_char("You must provide a reasonable number.\n\r",ch);
	return;
    }
    sendf(ch, "Scroll set to %d lines.\n\r", lines);
    ch->lines = lines - 2;
}

void do_socials(CHAR_DATA *ch, char *argument)
{
    int iSocial, col = 0;
    for (iSocial = 0; social_table[iSocial].name[0] != '\0'; iSocial++)
    {
	sendf(ch, "%-12s",social_table[iSocial].name);
	if (++col % 6 == 0)
	    send_to_char("\n\r",ch);
    }
    if ( col % 6 != 0)
	send_to_char("\n\r",ch);
}

void do_wizlist(CHAR_DATA *ch, char *argument)
{
    do_help(ch,"wizlist");
}

void do_credits(CHAR_DATA *ch, char *argument)
{
    do_help(ch,"diku");
}

void do_motd(CHAR_DATA *ch, char *argument)
{
    do_help(ch,"motd");
}

void do_imotd(CHAR_DATA *ch, char *argument)
{
    do_help(ch,"imotd");
}

void do_autolist(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
        return;
    send_to_char("   action     status\n\r",ch);
    send_to_char("---------------------\n\r",ch);
    send_to_char("autoassist     ",ch);
    if (IS_SET(ch->act,PLR_AUTOASSIST)) send_to_char("ON\n\r",ch);
    else send_to_char("OFF\n\r",ch); 
    send_to_char("autoexit       ",ch);
    if (IS_SET(ch->act,PLR_AUTOEXIT)) send_to_char("ON\n\r",ch);
    else send_to_char("OFF\n\r",ch);
    send_to_char("autogold       ",ch);
    if (IS_SET(ch->act,PLR_AUTOGOLD)) send_to_char("ON\n\r",ch);
    else send_to_char("OFF\n\r",ch);
    send_to_char("autoloot       ",ch);
    if (IS_SET(ch->act,PLR_AUTOLOOT)) send_to_char("ON\n\r",ch);
    else send_to_char("OFF\n\r",ch);
    send_to_char("autosac        ",ch);
    if (IS_SET(ch->act,PLR_AUTOSAC)) send_to_char("ON\n\r",ch);
    else send_to_char("OFF\n\r",ch);
    send_to_char("autosplit      ",ch);
    if (IS_SET(ch->act,PLR_AUTOSPLIT)) send_to_char("ON\n\r",ch);
    else send_to_char("OFF\n\r",ch);
    send_to_char("autoshow      ",ch);
    if (IS_SET(ch->comm,COMM_SHOW_AFFECTS))send_to_char("ON\n\r",ch);
    else send_to_char("OFF\n\r",ch);
    send_to_char("autofire       ",ch);
    if (IS_GAME(ch, GAME_NOAUTOFIRE)) send_to_char("OFF\n\r", ch);
    else  send_to_char("ON\n\r", ch);  
    send_to_char("autosex        ",ch);
    if (IS_GAME(ch, GAME_SEX)) send_to_char("ON\n\r", ch);
    else  send_to_char("OFF\n\r", ch);  
    send_to_char("prompt         ",ch);
    if (IS_SET(ch->comm,COMM_PROMPT)) send_to_char("ON\n\r",ch);
    else send_to_char("OFF\n\r",ch);
    send_to_char("autosheath     ",ch);
    if (IS_GAME(ch, GAME_ASHEATH)) send_to_char("ON\n\r", ch);
    else  send_to_char("OFF\n\r", ch);  
    if (ch->class == class_lookup("warrior")
	|| ch->class == class_lookup("paladin")
	|| ch->class == gcn_blademaster
	|| ch->class == class_lookup("monk")){
      send_to_char("mercykill      ",ch);
      if (IS_GAME(ch, GAME_MERCY)) send_to_char("ON\n\r", ch);
      else  send_to_char("OFF\n\r", ch);  
    }
    send_to_char("aliases        ",ch);
    if (IS_GAME(ch, GAME_NOALIAS)) send_to_char("OFF\n\r",ch);
    else send_to_char("ON\n\r",ch);
    send_to_char("experience     ",ch);
    if (IS_GAME(ch, GAME_NOEXP)) send_to_char("OFF\n\r",ch);
    else send_to_char("ON\n\r",ch);
    send_to_char("score          ",ch);
    if (!IS_GAME(ch, GAME_NEWSCORE)) send_to_char("OLD\n\r",ch);
    else send_to_char("NEW\n\r",ch);
    send_to_char("autoaim:    ",ch);
    if (IS_GAME(ch, GAME_AMOB)) send_to_char("MOB[ON] ", ch);
    else  send_to_char("MOB[OFF] ", ch);
    if (IS_GAME(ch, GAME_APC)) send_to_char("PC[ON] ", ch);
    else send_to_char("PC[OFF] ", ch);
    if (IS_GAME(ch, GAME_AOBJ)) send_to_char("OBJ[ON]\n\r", ch);
    else send_to_char("OBJ[OFF]\n\r", ch);

    if (ch->pCabal){
      send_to_char("autocabal      ",ch);
      if (IS_GAME(ch, GAME_SHOW_CABAL))send_to_char("ON\n\r", ch);
      else send_to_char("OFF\n\r", ch);
    }
    if (ch->pCabal){
      send_to_char("autoequip      ",ch);
      if (IS_GAME(ch, GAME_NOREQ_CABAL))send_to_char("OFF\n\r", ch);
      else send_to_char("ON\n\r", ch);
    }


    if (IS_SET(ch->act,PLR_NOSUMMON)) send_to_char("You can only be summoned within pk range.\n\r",ch);
    else send_to_char("You can be summoned by anyone.\n\r",ch);
    if (IS_SET(ch->act,PLR_NOFOLLOW)) send_to_char("You do not welcome followers.\n\r",ch);
    else send_to_char("You accept followers.\n\r",ch);
}

void do_autoaim(CHAR_DATA *ch, char *argument)
{
  char arg1[MIL];

  if (IS_NPC(ch))
    return;
  
  if (argument[0] == '\0'){
    send_to_char("autoaim:    ",ch);
    if (IS_GAME(ch, GAME_AMOB)) send_to_char("MOB[ON] ", ch);
    else  send_to_char("MOB[OFF] ", ch);
    if (IS_GAME(ch, GAME_APC)) send_to_char("PC[ON] ", ch);
    else send_to_char("PC[OFF] ", ch);
    if (IS_GAME(ch, GAME_AOBJ)) send_to_char("OBJ[ON]\n\r", ch);
    else send_to_char("OBJ[OFF]\n\r", ch);
    send_to_char("Current Settings: (use autoaim <mob/pc/obj/all> to toggle)\n\r", ch);
    return;
  }

  argument = one_argument(argument, arg1);

  /* MOB */
  if (!str_prefix("mob", arg1)){
    if (IS_GAME(ch, GAME_AMOB))
      REMOVE_BIT(ch->game, GAME_AMOB);
    else
      SET_BIT(ch->game, GAME_AMOB);
  }//END MOB
  
  
  /* PC */
  else if (!str_prefix("pc", arg1)){
    if (IS_GAME(ch, GAME_APC))
      REMOVE_BIT(ch->game, GAME_APC);
    else
      SET_BIT(ch->game, GAME_APC);
  }//END PC
  
  /* OBJ */
  else if (!str_prefix("obj", arg1)){
    if (IS_GAME(ch, GAME_AOBJ))
      REMOVE_BIT(ch->game, GAME_AOBJ);
    else
      SET_BIT(ch->game, GAME_AOBJ);
  }//END OBJ
  
  /* ALL */
  else if (!str_prefix("all", arg1)){
    if (IS_GAME(ch, GAME_AMOB)){
      REMOVE_BIT(ch->game, GAME_AMOB);
      REMOVE_BIT(ch->game, GAME_APC);
      REMOVE_BIT(ch->game, GAME_AOBJ);
    }
    else{
      SET_BIT(ch->game, GAME_AMOB);
      SET_BIT(ch->game, GAME_APC);
      SET_BIT(ch->game, GAME_AOBJ);
    }
  }//END ALL
  do_autoaim(ch, "");
}

void do_autoassist(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
        return;
    if (IS_SET(ch->act,PLR_AUTOASSIST))
    {
        send_to_char("Autoassist removed.\n\r",ch);
        REMOVE_BIT(ch->act,PLR_AUTOASSIST);
    }
    else
    {
        send_to_char("You will now assist when needed.\n\r",ch);
        SET_BIT(ch->act,PLR_AUTOASSIST);
    }
}

void do_autoexit(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
        return;
    if (IS_SET(ch->act,PLR_AUTOEXIT))
    {
        send_to_char("Exits will no longer be displayed.\n\r",ch);
        REMOVE_BIT(ch->act,PLR_AUTOEXIT);
    }
    else
    {
        send_to_char("Exits will now be displayed.\n\r",ch);
        SET_BIT(ch->act,PLR_AUTOEXIT);
    }
}
void do_autoexp(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
        return;
    if (IS_GAME(ch,GAME_NOEXP))
    {
      send_to_char("You will once again experience new things.\n\r",ch);
      REMOVE_BIT(ch->game, GAME_NOEXP);
    }
    else
    {
        send_to_char("You will no longer experience new things.\n\r",ch);
        SET_BIT(ch->game, GAME_NOEXP);
    }
}
void do_autoscore(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
        return;
    if (IS_GAME(ch,GAME_NEWSCORE))
    {
      send_to_char("Switching to OLD score sheet.\n\r",ch);
      REMOVE_BIT(ch->game, GAME_NEWSCORE);
    }
    else
    {
      send_to_char("Switching to NEW score sheet.\n\r",ch);
      SET_BIT(ch->game, GAME_NEWSCORE);
    }
}
void do_autoalias(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
        return;
    if (IS_GAME(ch,GAME_NOALIAS))
    {
      send_to_char("Aliases on.\n\r",ch);
      REMOVE_BIT(ch->game, GAME_NOALIAS);
    }
    else
    {
        send_to_char("Aliases off.\n\r",ch);
        SET_BIT(ch->game, GAME_NOALIAS);
    }
}

/* Toggles sex descriptors on whois list -Crypt */
void do_autosex(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
        return;
    if (IS_SET(ch->game,GAME_SEX))
    {
        send_to_char("Sexes will no longer be visible on the whois list.\n\r",ch);
        REMOVE_BIT(ch->game,GAME_SEX);
    }
    else
    {
        send_to_char("Sexes will now be displayed on the whois list.\n\r",ch);
        SET_BIT(ch->game,GAME_SEX);
    }
}   

/* Toggles firing of weapons in combat */
void do_autofire(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
        return;
    if (IS_SET(ch->game,GAME_NOAUTOFIRE)){
      send_to_char("You will now fire your weapons in combat.\n\r",ch);
      REMOVE_BIT(ch->game,GAME_NOAUTOFIRE);
    }
    else{
      send_to_char("You will no longer fire your weapons in combat.\n\r",ch);
      SET_BIT(ch->game,GAME_NOAUTOFIRE);
    }
}   

/* removes person from consideration for questor */
void do_forfeit(CHAR_DATA *ch, char *argument){
  char arg[MIL];

  argument = one_argument(argument, arg );

  if (IS_NULLSTR(arg)){
    send_to_char("Sytnax: forfeit questor\n\r", ch);
    return;
  }
  else if (!str_cmp(arg, "questor")){
    if (IS_GAME(ch, GAME_NOQUESTOR)){
      send_to_char("You've already made your choice.\n\r", ch);
      return;
    }
    else if (IS_NULLSTR(argument) || str_cmp(argument, "confirm")){
      send_to_char("WARNING: This will irreversibly prevent you from achiving status of Master Questor.\n\r"\
		   "Use \"forfeit questor confirm\" if you wish to continue.\n\r", ch );
      return;
    }
    send_to_char("You have decided to forfeit the status of Master Questor.\n\r", ch);
    SET_BIT(ch->game, GAME_NOQUESTOR);
    if (!str_cmp(ch->name, mud_data.questor)){
      free_string(mud_data.questor);
      mud_data.questor = str_dup( "" );
      mud_data.max_quest /= 2;
    }
    return;
  }
  else
    do_forfeit(ch, "");
}

/* toggels mercy kill for warriors with expert or master weapons */
void do_mercy(CHAR_DATA *ch, char *argument){
  if (IS_NPC(ch))
    return;
  if (IS_SET(ch->game,GAME_MERCY)){
    send_to_char("You will now fight to the DEATH.\n\r", ch);
    REMOVE_BIT(ch->game,GAME_MERCY);
    return;
  }
  if (!IS_PERK(ch, PERK_MERCY)
      && ch->class != class_lookup("warrior")
      && ch->class != class_lookup("paladin")
      && ch->class != gcn_blademaster
      && ch->class != class_lookup("monk")){
    send_to_char("Only warriors, blademasters, paladins, and monks are capable of this feat.\n\r", ch);
    return;
  }
  else if (ch->class == gcn_dk || ch->class == gcn_crusader){
    send_to_char("You lack the finesse to halt your deathblows.\n\r",ch);
    return;
  }
  else{
    send_to_char("You will now stay your deathblows when possible.\n\r", ch);
    SET_BIT(ch->game,GAME_MERCY);
  }
}

/* Viri: Toggles auto sheathing in cities*/
void do_autosheath(CHAR_DATA *ch, char *argument)
{
  if (IS_NPC(ch))
    return;
  if (IS_SET(ch->game,GAME_ASHEATH))
    {
     send_to_char("You will no longer pay attention to your weapons.\n\r", ch);
     REMOVE_BIT(ch->game,GAME_ASHEATH);
    }
  else
    {
      send_to_char("When possible, you will now sheath while entering a city.\n\r", ch);
      SET_BIT(ch->game,GAME_ASHEATH);
    }
}   

void do_autocabal(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
        return;
    if (!ch->pCabal){
      send_to_char("You are not in a cabal!\n\r", ch);
      return;
    }
    if (IS_GAME(ch, GAME_SHOW_CABAL)){
      if (!IS_CABAL(ch->pCabal, CABAL_CANHIDE)){
	send_to_char("You may not hide your affiliation.\n\r", ch);
	return;
      }
      send_to_char("Your affiliation will now be hidden.\n\r",ch);
      REMOVE_BIT(ch->game,GAME_SHOW_CABAL);
      return;
    }
    if (!IS_GAME(ch, GAME_SHOW_CABAL)){
      if (!IS_CABAL(ch->pCabal, CABAL_CANSHOW)){
	send_to_char("You may not show your affiliation.\n\r", ch);
	return;
      }
      send_to_char("Your affiliation will now be visible to all.\n\r",ch);
      SET_BIT(ch->game,GAME_SHOW_CABAL);
      return;
    }
}


void do_autoequip(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
        return;
    if (!ch->pCabal){
      send_to_char("You are not in a cabal!\n\r", ch);
      return;
    }
    if (IS_GAME(ch, GAME_NOREQ_CABAL))
    {
      send_to_char("Your Cabal will now re-equip you upon your demise.\n\r",ch);
      REMOVE_BIT(ch->game,GAME_NOREQ_CABAL);
    }
    else
    {
      send_to_char("Your Cabal will no longer grant you help upon your demise.\n\r",ch);
      SET_BIT(ch->game,GAME_NOREQ_CABAL);
    }
}

void do_autogold(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
        return;
    if (IS_SET(ch->act,PLR_AUTOGOLD))
    {
        send_to_char("Autogold removed.\n\r",ch);
        REMOVE_BIT(ch->act,PLR_AUTOGOLD);
    }
    else
    {
        send_to_char("Automatic gold looting set.\n\r",ch);
        SET_BIT(ch->act,PLR_AUTOGOLD);
    }
}

void do_autoloot(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
        return;
    if (IS_SET(ch->act,PLR_AUTOLOOT))
    {
        send_to_char("Autolooting removed.\n\r",ch);
        REMOVE_BIT(ch->act,PLR_AUTOLOOT);
    }
    else
    {
        send_to_char("Automatic corpse looting set.\n\r",ch);
        SET_BIT(ch->act,PLR_AUTOLOOT);
    }
}

void do_autosac(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
        return;
    if (IS_SET(ch->act,PLR_AUTOSAC))
    {
        send_to_char("Autosacrificing removed.\n\r",ch);
        REMOVE_BIT(ch->act,PLR_AUTOSAC);
    }
    else
    {
        send_to_char("Automatic corpse sacrificing set.\n\r",ch);
        SET_BIT(ch->act,PLR_AUTOSAC);
    }
}

void do_autosplit(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
        return;
    if (IS_SET(ch->act,PLR_AUTOSPLIT))
    {
        send_to_char("Autosplitting removed.\n\r",ch);
        REMOVE_BIT(ch->act,PLR_AUTOSPLIT);
    }
    else
    {
        send_to_char("Automatic gold splitting set.\n\r",ch);
        SET_BIT(ch->act,PLR_AUTOSPLIT);
    }
}

void do_brief(CHAR_DATA *ch, char *argument)
{
    if (IS_SET(ch->comm,COMM_BRIEF))
    {
        send_to_char("Full descriptions activated.\n\r",ch);
        REMOVE_BIT(ch->comm,COMM_BRIEF);
    }
    else
    {
        send_to_char("Short descriptions activated.\n\r",ch);
        SET_BIT(ch->comm,COMM_BRIEF);
    }
}

void do_compact(CHAR_DATA *ch, char *argument)
{
    if (IS_SET(ch->comm,COMM_COMPACT))
    {
        send_to_char("Compact mode removed.\n\r",ch);
        REMOVE_BIT(ch->comm,COMM_COMPACT);
    }
    else
    {
        send_to_char("Compact mode set.\n\r",ch);
        SET_BIT(ch->comm,COMM_COMPACT);
    }
}

void do_show(CHAR_DATA *ch, char *argument)
{
    if (!IS_SET(ch->comm,COMM_SHOW_AFFECTS))
    {
        send_to_char("Affects will no longer be shown in score.\n\r",ch);
        SET_BIT(ch->comm,COMM_SHOW_AFFECTS);
    }
    else
    {
        send_to_char("Affects will now be shown in score.\n\r",ch);
        REMOVE_BIT(ch->comm,COMM_SHOW_AFFECTS);
    }
}

void do_prompt(CHAR_DATA *ch, char *argument)
{
   char buf[MSL];
   
   SET_BIT(ch->comm,COMM_PROMPT);
   if ( argument[0] == '\0' )
   {
     sendf(ch, "Current prompt: %s\n\r", ch->prompt );
     return;
   }
   else if (!str_cmp(argument, "off")){
     send_to_char("You will no longer see prompts.\n\r",ch);
     REMOVE_BIT(ch->comm,COMM_PROMPT);
   }
   else if( !strcmp( argument, "all" ) )
     strcpy( buf, "%n%P%C<%hhp %mm %vmv> ");
   else
     {
      if ( strlen(argument) > MIL )
	argument[MIL] = '\0';
      strcpy( buf, argument );
      smash_tilde( buf );
      if (str_suffix("%c",buf))
	strcat(buf," ");
     }
   free_string( ch->prompt );
   ch->prompt = str_dup( buf );
   sendf(ch, "Prompt set to %s\n\r", ch->prompt );
   return;
}

void do_nofollow(CHAR_DATA *ch, char *argument)
{
    if (IS_AFFECTED(ch,AFF_CHARM))
    {
        send_to_char("You can't do that right now!\n\r",ch);
        return;
    }
    if (IS_SET(ch->act,PLR_NOFOLLOW))
    {
        send_to_char("You now accept followers.\n\r",ch);
        REMOVE_BIT(ch->act,PLR_NOFOLLOW);
    }
    else
    {
        send_to_char("You no longer accept followers.\n\r",ch);
        SET_BIT(ch->act,PLR_NOFOLLOW);
	
        die_follower( ch, TRUE );
	stop_follower( ch );
    }
}

void do_nosummon(CHAR_DATA *ch, char *argument)
{
    if (IS_NPC(ch))
    {
        if (IS_SET(ch->imm_flags,IMM_SUMMON))
        {
            send_to_char("You can now be summoned by anyone.\n\r",ch);
            REMOVE_BIT(ch->imm_flags,IMM_SUMMON);
        }
        else
        {
            send_to_char("You can now only be summoned within pk range.\n\r",ch);
            SET_BIT(ch->imm_flags,IMM_SUMMON);
        }
    }
    else
    {
        if (IS_SET(ch->act,PLR_NOSUMMON))
        {
            send_to_char("You can now be summoned by anyone.\n\r",ch);
            REMOVE_BIT(ch->act,PLR_NOSUMMON);
        }
        else
        {
            send_to_char("You can now only be summoned within pk range.\n\r",ch);
            SET_BIT(ch->act,PLR_NOSUMMON);
        }
    }
}

/* Written by:	Virigoth
   returns:	NULL
   comments:	Simple function to allow players to check the are they are in.
*/
void do_skylook(CHAR_DATA* ch){
  if(  (IS_AFFECTED(ch, AFF_BLIND) && !is_affected(ch, gsn_bat_form)) 
       || (IS_AFFECTED(ch, AFF_BLIND) && bat_blind(ch))  || bat_blind(ch) )
    {
      send_to_char( "You can't see a thing!\n\r", ch );
      return;
    }
  if (IS_AFFECTED2(ch,AFF_TERRAIN))
    {
      send_to_char( "Darkness.. Darkness everywhere!\n\r",ch);
      return;
    }
  if (!IS_OUTSIDE(ch)){
    send_to_char("You can see little of the sky from indoors.\n\r", ch);
    return;
  }

  send_to_char("You lookup into the sky.\n\r", ch);
  act("$n looks up into the sky.", ch, NULL, NULL, TO_ROOM);
  if (mud_data.weather_info.sunlight != SUN_DARK){
    do_weather(ch, "");
  }
  sendf(ch, "Using the sky and the surroundings you decide you are in area of %s.\n\r", 
	ch->in_room->area->name);
}


void do_look( CHAR_DATA *ch, char *argument )
{
    char arg1 [MIL], arg2 [MIL], arg3 [MIL];
    char *pdesc;
    EXIT_DATA *pexit;
    CHAR_DATA *victim;
    ARMY_DATA* pa;
    OBJ_DATA *obj, *tattoo;
    bool fSkip = FALSE;
    bool fAuto = !IS_NPC(ch) && IS_GAME(ch, GAME_AOBJ);
    int door, number, count;
    argument = one_argument( argument, arg1 );
    argument = one_argument( argument, arg2 );

    /* sku look to check the area */
    if (!str_prefix("sky", arg1)){
      do_skylook(ch);
      return;
    }
    if ( ch->desc == NULL && ( victim = get_char_room( ch, NULL, arg1 ) ) != NULL )
    {
        if ( can_see( victim, ch ) )
        {
            if (ch == victim)
                act( "$n looks at $mself.",ch,NULL,NULL,TO_ROOM);
            else
            {
                act( "$n looks at you.", ch, NULL, victim, TO_VICT    );
                act( "$n looks at $N.",  ch, NULL, victim, TO_NOTVICT );
            }
        }
	return;
    }

    if ( ch->position == POS_MEDITATE )
    {
	send_to_char( "You can't see anything, you're meditating!\n\r", ch );
	return;
    }
    if ( ch->position < POS_SLEEPING )
    {
	send_to_char( "You can't see anything but stars!\n\r", ch );
	return;
    }
    if ( ch->position == POS_SLEEPING )
    {
	send_to_char( "You can't see anything, you're sleeping!\n\r", ch );
	return;
    }
    if ( !check_blind( ch ) ){
      send_to_char( "You can't see a thing!\n\r", ch ); 
      return;
    }

    tattoo = get_eq_char(ch, WEAR_TATTOO);

    if ( (!IS_NPC(ch) && !IS_SET(ch->act, PLR_HOLYLIGHT) 
	  && room_is_dark( ch->in_room ) 
	  && !IS_AFFECTED(ch, AFF_INFRARED ) 
	  //	  && get_eq_char(ch, WEAR_LIGHT) == NULL 
	  && !is_ghost(ch,600)))
    {
	send_to_char( "It is pitch black ... \n\r", ch );
	show_list_to_char( ch->in_room->contents, ch, FALSE, FALSE );
	show_char_to_char( ch->in_room->people, ch );
	return;
    }

    number = number_argument(arg1,arg3);
    count = 0;

    if ( arg1[0] == '\0' || !str_cmp( arg1, "auto" ) )
    {
      if (IS_AFFECTED2(ch,AFF_TERRAIN)){
	if (is_affected(ch, gsn_forest_mist)){
	  if (ch->in_room->sector_type != SECT_AIR 
	      && ch->in_room->sector_type != SECT_DESERT 
	      && ch->in_room->sector_type != SECT_CITY
	      && ch->in_room->sector_type != SECT_INSIDE){
	    send_to_char("Shrouded in Mist\n\r",ch);
	    send_to_char("  A forest mist obscures all sense of direction.\n\r",ch);
	    fSkip = TRUE;
	  }
	}
	else{
	  send_to_char("Surrounded by Darkness\n\r",ch);
	  send_to_char("  Thick walls of darkness veil you from the world..\n\r",ch);
	  fSkip = TRUE;
	}
      }

      if ( is_affected(ch, gsn_burrow) )
	send_to_char("You can't see anything while burrowed.\n\r",ch);
      else if (!fSkip)
        {
	  send_to_char( ch->in_room->name, ch );
	  if (IS_IMMORTAL(ch) && (IS_NPC(ch) || IS_SET(ch->act,PLR_HOLYLIGHT)))
	    sendf(ch, " [Room %d]",ch->in_room->vnum);
	  send_to_char( "\n\r", ch );
	  
	  if ( arg1[0] == '\0' || ( !IS_NPC(ch) && !IS_SET(ch->comm, COMM_BRIEF) ) )
            {
	      send_to_char( "  ",ch);
	      if ((mud_data.time_info.hour >=5 && mud_data.time_info.hour <20) || !ch->in_room->description2[0])
		send_to_char( ch->in_room->description, ch );
	      else
		send_to_char( ch->in_room->description2, ch );
            }
	  if (IS_AREA(ch->in_room->area, AREA_RAID)){
	    send_to_char("Fires blaze throughout the city clouding the sky with smoke.\n\r", ch);
	  }
	  if (!IS_NULLSTR(ch->in_room->area->prefix)){
	    send_to_char(ch->in_room->area->prefix, ch);
	  }	  
	  send_to_char( "\n\r", ch );
	  show_tracks( ch, ch->in_room );
	  if ( IS_NPC(ch) || (!IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOEXIT)) )
	    do_exits( ch, "auto" );
        }
      show_room_armies(ch, &ch->in_room->room_armies );      
      show_list_to_char( ch->in_room->contents, ch, FALSE, FALSE );
      show_char_to_char( ch->in_room->people, ch );
      

      
      if (IS_SET(ch->in_room->room_flags, ROOM_NEWBIES_ONLY) 
	  && ch->level > 5 && !IS_IMMORTAL(ch)){
	send_to_char("\n\r`&You are no longer allowed in here.  Recalling...\n\r``", ch);
	spell_word_of_recall(skill_lookup("word of recall"), 60, ch, ch, 0);
      }
      return;
    }

    if ( !str_cmp( arg1, "i" ) || !str_cmp(arg1, "in")  || !str_cmp(arg1,"on"))
    {
      if ( arg2[0] == '\0' )
	{
	  send_to_char( "Look in what?\n\r", ch );
	  return;
        }

      if ( ( obj = get_obj_here( ch, NULL, arg2 ) ) == NULL )
	{
	  send_to_char( "You do not see that here.\n\r", ch );
	  return;
	}

      switch ( obj->item_type )
	{
	default:
	  send_to_char( "That is not a container.\n\r", ch );
	  break;
	case ITEM_DRINK_CON:
	  if ( obj->value[1] <= 0 )
	    {
	      send_to_char( "It is empty.\n\r", ch );
	      break;
	    }
	  sendf( ch, "It's %sfilled with a %s liquid.\n\r", obj->value[1] < obj->value[0] / 4 ? "less than half-" :
		 obj->value[1] < 3 * obj->value[0] / 4 ? "about half-" : "more than half-", liq_table[obj->value[2]].liq_color);
	  break;
	case ITEM_CONTAINER:
	case ITEM_CORPSE_NPC:
	case ITEM_CORPSE_PC:
	  if ( IS_SET(obj->value[1], CONT_CLOSED) )
	    {
	      send_to_char( "It is closed.\n\r", ch );
	      break;
	    }
	  act( "$p holds:", ch, obj, NULL, TO_CHAR );
	  show_list_to_char( obj->contains, ch, TRUE, TRUE );
	  break;
	}
      return;
    }
    if ( ( victim = get_char_room( ch, NULL, arg1 ) ) != NULL )
    {
      OBJ_DATA* inst;
      //special handling for cabal altars
      if (IS_NPC(victim) && victim->pIndexData->vnum == MOB_VNUM_ALTAR){
	show_altar( ch, victim );
	return;
      }
      show_char_to_char_1( victim, ch );
      /* check for sheath for justice */
      if (victim->in_room && IS_AREA(victim->in_room->area, AREA_LAWFUL)
	  && victim->in_room->area->raid == NULL
	  && ch->pCabal 
	  && (IS_CABAL(ch->pCabal, CABAL_JUSTICE) || IS_HIGHBORN(ch))
	  && !IS_WANTED(victim)
	  && ( ((inst = get_eq_char(victim, WEAR_WIELD) ) != NULL 
		&& inst->item_type != ITEM_INSTRUMENT
		&& get_eq_char(victim, WEAR_SHEATH_L) == NULL)
	       || (get_eq_char(victim, WEAR_SECONDARY) != NULL 
		   && get_eq_char(victim, WEAR_SHEATH_R) == NULL))
	  ){
	set_crime(victim, NULL, victim->in_room->area, CRIME_SHEATH);
	sendf( ch, "%s's weapon is DRAWN.\n\r", PERS(victim, ch));
      }
      if ( IS_NPC(victim) && HAS_TRIGGER_MOB( victim, TRIG_LOOK ) )
	p_percent_trigger( victim, NULL, NULL, ch, NULL, NULL, TRIG_LOOK );
      return;
    }
    //armies
    if ( (pa = get_army_room( ch, ch->in_room, arg1)) != NULL){
      send_to_char( pa->desc, ch );
      send_to_char( "\n\r", ch );
      return;
    }
    
    pdesc = get_auto_extra_descr(arg3,ch->in_room->extra_descr, fAuto);
    if (pdesc != NULL)
      if (++count == number)
	{
	  page_to_char(pdesc,ch);
	  return;
	}

    //objects on floor
    count = 0;
    for ( obj = ch->in_room->contents; obj != NULL; obj = obj->next_content )
      {
	if ( !can_see_obj( ch, obj ) )
	  continue;
	
	if ( (	pdesc = get_auto_extra_descr( arg3, obj->extra_descr, fAuto )) != NULL ) {
	  if (++count == number) {
	    page_to_char(pdesc,ch);
	    if ( obj && HAS_TRIGGER_OBJ( obj, TRIG_LOOK ) )
	      p_percent_trigger( NULL, obj, NULL, ch, NULL, NULL, TRIG_LOOK );
	    return;
	  }
	}
	else if ( (pdesc = get_auto_extra_descr( arg3, obj->pIndexData->extra_descr, fAuto )) != NULL ) {
	  if (++count == number) {
	    page_to_char(pdesc,ch);
	    if ( obj && HAS_TRIGGER_OBJ( obj, TRIG_LOOK ) )
	      p_percent_trigger( NULL, obj, NULL, ch, NULL, NULL, TRIG_LOOK );
	    return;
	  }
	}
	else if ( (fAuto  && is_auto_name(arg3, obj->name))
		  || is_name( arg3, obj->name )) {
	  if (++count == number) {
	    sendf(ch, "%s\n\r", obj->description);
	    if ( obj && HAS_TRIGGER_OBJ( obj, TRIG_LOOK ) )
	      p_percent_trigger( NULL, obj, NULL, ch, NULL, NULL, TRIG_LOOK );
	    return;
	  }
	}
      }//end for

    //objects in inventroy
    for ( obj = ch->carrying; obj != NULL; obj = obj->next_content )
      {
	if ( !can_see_obj( ch, obj ) )
	  continue;

	if ( (	pdesc = get_auto_extra_descr( arg3, obj->extra_descr, fAuto )) != NULL ) {
	  if (++count == number) {
	    page_to_char(pdesc,ch);
	    if ( obj && HAS_TRIGGER_OBJ( obj, TRIG_LOOK ) )
	      p_percent_trigger( NULL, obj, NULL, ch, NULL, NULL, TRIG_LOOK );
	    return;
	  }
	}
	else if ( (pdesc = get_auto_extra_descr( arg3, obj->pIndexData->extra_descr, fAuto )) != NULL ) {
	  if (++count == number) {
	    page_to_char(pdesc,ch);
	    if ( obj && HAS_TRIGGER_OBJ( obj, TRIG_LOOK ) )
	      p_percent_trigger( NULL, obj, NULL, ch, NULL, NULL, TRIG_LOOK );
	    return;
	  }
	}
	else if ( (fAuto && is_auto_name( arg3, obj->name )) || is_name(arg3, obj->name)){
	  if (++count == number) {
	    sendf(ch, "%s\n\r", obj->description);
	    if ( obj && HAS_TRIGGER_OBJ( obj, TRIG_LOOK ) )
	      p_percent_trigger( NULL, obj, NULL, ch, NULL, NULL, TRIG_LOOK );
	    return;
	  }
	}
      }//end FOR

    if (count > 0 && count != number)
      {
	if (count == 1)
	  sendf(ch,"You only see one %s here.\n\r",arg3);
	else
	  sendf(ch,"You only see %d of those here.\n\r",count);
	return;
      }
    
    if      ( !str_cmp( arg1, "n" ) || !str_cmp( arg1, "north" ) ) door = 0;
    else if ( !str_cmp( arg1, "e" ) || !str_cmp( arg1, "east"  ) ) door = 1;
    else if ( !str_cmp( arg1, "s" ) || !str_cmp( arg1, "south" ) ) door = 2;
    else if ( !str_cmp( arg1, "w" ) || !str_cmp( arg1, "west"  ) ) door = 3;
    else if ( !str_cmp( arg1, "u" ) || !str_cmp( arg1, "up"    ) ) door = 4;
    else if ( !str_cmp( arg1, "d" ) || !str_cmp( arg1, "down"  ) ) door = 5;
    else
    {
	send_to_char( "You do not see that here.\n\r", ch );
	return;
    }
    if ( ( pexit = ch->in_room->exit[door] ) == NULL )
    {
	send_to_char( "Nothing special there.\n\r", ch );
	return;
    }
    if (can_see_trap(ch, ch->in_room->exit[door]->traps)){
      send_to_char("You spot a hint of something hidden!\n\r\n\r", ch);
    }
    if ( pexit->description != NULL && pexit->description[0] != '\0' )
	send_to_char( pexit->description, ch );
    else
	send_to_char( "Nothing special there.\n\r", ch );
    if ( pexit->keyword != NULL && pexit->keyword[0] != '\0' && pexit->keyword[0] != ' ' )
    {
	if ( IS_SET(pexit->exit_info, EX_CLOSED) )
	    act( "The $d is closed.", ch, NULL, pexit->keyword, TO_CHAR );
	else if ( IS_SET(pexit->exit_info, EX_ISDOOR) )
	    act( "The $d is open.",   ch, NULL, pexit->keyword, TO_CHAR );
    }
}

void do_examine( CHAR_DATA *ch, char *argument )
{
    char buf[MSL], arg[MIL];
    OBJ_DATA *obj;
    AFFECT_DATA* paf;
    int i = 0;
    int weight = 0;
    one_argument( argument, arg );

    if ( arg[0] == '\0' ){
      send_to_char( "Examine what?\n\r", ch );
      return;
    }
    else if (!str_prefix( "armies", arg)){
      examine_room_armies( ch, &ch->in_room->room_armies );
      return;
    }
    do_look( ch, arg );

    if ( ( obj = get_obj_here( ch, NULL, arg ) ) != NULL ){
      /* clone check */
      bool fExtract = FALSE;
      if (obj->pIndexData->vnum == OBJ_VNUM_CLONE){
	if (ch->class == class_lookup("thief"))
	  send_to_char("Hmm.. There is something funny about this item.\n\r\n\r", ch);
	fExtract = TRUE;
	obj = create_object( get_obj_index(obj->cost), obj->level);
      }
      //omnipotence identifies it
      if (is_affected(ch, gsn_omnipotence)){
	spell_identify(skill_lookup("identify"), ch->level, ch, obj, TARGET_OBJ);
      }

      switch ( obj->item_type ){
      default:
	break;
      case ITEM_MONEY:
	if (obj->value[0] == 0)
	  sendf(ch,"Odd...there's no coins in the pile.\n\r");
	else if (obj->value[0] == 1)
	  sendf(ch,"Wow. One gold coin.\n\r");
	else
	  sendf(ch,"There are %d gold coins in the pile.\n\r",obj->value[0]);
	break;
      case ITEM_WEAPON:
	/* get the minimum strength */
        weight = get_obj_weight_char(ch, obj);
        if ((IS_WEAPON_STAT(obj,WEAPON_TWO_HANDS) 
	     && (ch->size < SIZE_LARGE || obj->value[0] == WEAPON_STAFF))
	    || obj->value[0] == WEAPON_POLEARM 
	    || obj->item_type == ITEM_INSTRUMENT )
	  weight = 2 * weight / 3;
	if (obj->item_type == ITEM_WEAPON
	    && get_skill(ch, gsn_2h_handling) > 0
	    && (IS_WEAPON_STAT(obj,WEAPON_TWO_HANDS) 
		|| is_affected(ch, gsn_double_grip)) )
	  weight = 2 * weight / 3;
	for (i = 0; i < 26; i++){
	  if (weight <=	str_app[i].wield * 10)
	    break;
	}
	i = URANGE(1, i, 26);

	sendf(ch, "After a brief examination you decide it looks much like a %s%s. (%d Str)\n\r", 
		IS_WEAPON_STAT(obj, WEAPON_TWO_HANDS) ? "a two handed " : "",
	      weapon_name(obj->value[0]),
			  i );
/* MALFORM LEVEL */
	  if ( (paf = affect_find(obj->affected, gen_malform)) != NULL)
	    sendf(ch, "Judging by the aura of evil, it is malformed and at level %d.\n\r", paf->level);
/* HOLY LEVEL */
	  if ( (paf = affect_find(obj->affected, gen_hwep)) != NULL){
	    sendf(ch, "The holy aura indicates it is at %d%s circle of Consecration.\n\r",
		  paf->level,
		  paf->level == 1 ? "st." : 	    
		  paf->level == 2 ? "nd." :
		  paf->level  == 3 ? "rd." :"th.");
	  }
	  if ( IS_OBJ_STAT(obj, ITEM_SOCKETABLE))
	    {
	      if (obj->contains){
		act( "$p has the following affixed to it:", ch, obj, NULL, TO_CHAR );
		show_list_to_char( obj->contains, ch, TRUE, TRUE );  
	      }
	      else
	      act( "$p seems to have a space to attach something to it.", ch, obj, NULL, TO_CHAR );
	    }
	  break;
	case ITEM_ARMOR:
	  if ( IS_OBJ_STAT(obj, ITEM_SOCKETABLE))
	    {
	      if (obj->contains){
		act( "$p has the following affixed to it:", ch, obj, NULL, TO_CHAR );
		show_list_to_char( obj->contains, ch, TRUE, TRUE );  
	      }
	      else
		act( "$p seems to have a space to attach something to it.", ch, obj, NULL, TO_CHAR );
	    }
	  break;
      case ITEM_PROJECTILE:
	sendf(ch, "After a brief examination you decide its a projectile of type: %s\n\r", flag_string(projectile_type, obj->value[0]));
	break;
      case ITEM_RANGED:
	sendf(ch, "After a brief examination you decide its a ranged weapon for: %s\n\r", flag_string(projectile_type, obj->value[0]));
	break;
      case ITEM_SOCKET:
	if (IS_SOC_STAT(obj, SOCKET_ARMOR)
	    && IS_SOC_STAT(obj, SOCKET_WEAPON))
	    act("You think you could attach $p to a proper weapon or armor.",
		ch, obj, NULL, TO_CHAR);
	  else if (IS_SOC_STAT(obj, SOCKET_ARMOR))
	    act("You think you could attach $p to a proper piece of armor.",
		ch, obj, NULL, TO_CHAR);
	else if (IS_SOC_STAT(obj, SOCKET_WEAPON))
	  act("You think you could attach $p to a proper weapon.",
	      ch, obj, NULL, TO_CHAR);
	  else 
	    act("You think you could attach $p to a proper weapon.",
		ch, obj, NULL, TO_CHAR);
	break;
      case ITEM_DRINK_CON:
      case ITEM_CONTAINER:
      case ITEM_CORPSE_NPC:
      case ITEM_CORPSE_PC:
	sprintf(buf,"in %s",argument);
	  do_look( ch, buf );
      }
/* mention of signature */
      if (IS_SET(obj->wear_flags, ITEM_HAS_OWNER)
	  && (paf = affect_find(obj->affected, gen_has_owner)) != NULL
	  && paf->has_string 
	  && !IS_NULLSTR(paf->string)){
	sendf(ch, "A single signature graces its surface: \"%s\"", paf->string);
      }
      act("\n\rYou judge $P to be in $tcondition.", ch, 
	  get_condition(get_curr_cond(obj), FALSE), obj, TO_CHAR);
      if (obj->pCabal || obj->race || obj->class >= 0)
	sendf(ch, "You have a feeling only a %s%s%s%s%s%scan use it.\n\r",
	      obj->race ? race_table[obj->race].name : "",
	      obj->race ? " " : "",
	      obj->class >= 0 ? class_table[obj->class].name : "",
	      obj->class >= 0 ? " ": "",
	      obj->pCabal ? obj->pCabal->name : "",
	      obj->pCabal ? " ": "");
      if (CAN_WEAR(obj, ITEM_WEAR_SHIELD)){
	/* get the minimum strength */
        weight = get_obj_weight_char(ch, obj);
	for (i = 0; i < 26; i++){
	  if (weight <=	str_app[i].wield * 12)
	    break;
	}
	i = URANGE(1, i, 25);
	sendf(ch, "You require %d Str to hold this shield.\n\r", i);
      }

      if ( obj && HAS_TRIGGER_OBJ( obj, TRIG_USE ) )
	send_to_char("You have a vauge feeling this item can be used somehow.\n\r", ch);
      if (fExtract)
	extract_obj( obj );
    }
}

/* Written by:	Virigoth
   returns:	NULL
   comments:	Simple function to allow exits to be printed on prompt.
*/
void do_promptexit(CHAR_DATA* ch, char* str){
  EXIT_DATA *pexit;
  int door = 0;
  char buf[MIL];
  bool found = FALSE;
  
  sprintf(buf,"[Exits:");
  if ( !check_blind( ch ) && !is_affected(ch,gsn_bat_form)){
    sprintf(str,"[Exits: --- ]");
    return;
  }
  else if (IS_AFFECTED2(ch,AFF_TERRAIN))
    {
      if (is_affected(ch, gsn_forest_mist)){
	if (ch->in_room->sector_type != SECT_AIR 
	    && ch->in_room->sector_type != SECT_DESERT 
	    && ch->in_room->sector_type != SECT_CITY
	    && ch->in_room->sector_type != SECT_INSIDE){
	  sprintf(str,"[Exits: ??? ]");
	  return;
	}
      }
      else{
	sprintf(str,"[Exits: ??? ]");
	return;
      }
    }
  else
    sprintf(buf,"[Exits:");

  for ( door = 0; door <= 5; door++ )
    {
      bool paran = FALSE;
      if ( (pexit = ch->in_room->exit[door] ) == NULL 
	   || pexit->to_room == NULL
	   || !can_see_room(ch,pexit->to_room)
	   || (!IS_SET(pexit->exit_info, EX_ISDOOR) && IS_SET(pexit->exit_info, EX_SECRET) && !IS_IMMORTAL( ch ))
	   || (IS_SET(pexit->exit_info, EX_CLOSED) && IS_SET(pexit->exit_info, EX_SECRET) && !IS_IMMORTAL( ch )) )
	continue;
      else{
	if (IS_SET(pexit->exit_info, EX_CLOSED))
	  paran = TRUE;
	found = TRUE;
	strcat( buf, " " );
	if (paran)
	  strcat(buf,"(");
	if (can_see_trap(ch, pexit->traps))
	  strcat(buf, "`!+``");
	strcat( buf, shrt_dir_name[door] );
	if (paran)
	  strcat(buf,")");
      }
    }
  if ( !found )
    strcat( buf,  " none");
  strcat( buf, "]" );
  sprintf( str, "%s",  buf);
}

void do_exits( CHAR_DATA *ch, char *argument )
{
    extern char * const dir_name[];
    char buf[MSL];
    EXIT_DATA *pexit;
    bool found = FALSE, fAuto = !str_cmp( argument, "auto" );
    int door;
    if ( !check_blind( ch ) && !is_affected(ch,gsn_bat_form)){
      send_to_char( "You can't see a thing!\n\r", ch ); 
      return;
    }
    if (IS_AFFECTED2(ch,AFF_TERRAIN))
    {
      if (is_affected(ch, gsn_forest_mist)){
	if (ch->in_room->sector_type != SECT_AIR 
	    && ch->in_room->sector_type != SECT_DESERT 
	    && ch->in_room->sector_type != SECT_CITY
	    && ch->in_room->sector_type != SECT_INSIDE){
	  send_to_char("You can't tell where the exits are.\n\r",ch);
	  return;
	}
      }
      else{
	  send_to_char("You can't tell where the exits are.\n\r",ch);
	  return;
      }
    }
    if (fAuto)
	sprintf(buf,"[Exits:");
    else if (IS_IMMORTAL(ch))
	sprintf(buf,"Obvious exits from room %d:\n\r",ch->in_room->vnum);
    else
	sprintf(buf,"Obvious exits:\n\r");

    for ( door = 0; door <= 5; door++ )
    {
	bool paran = FALSE;
	if ( (pexit = ch->in_room->exit[door] ) == NULL 
	     || pexit->to_room == NULL
	     || !can_see_room(ch,pexit->to_room)
	     || (!IS_SET(pexit->exit_info, EX_ISDOOR) && IS_SET(pexit->exit_info, EX_SECRET) && !IS_IMMORTAL( ch ))
	     || (IS_SET(pexit->exit_info, EX_CLOSED) && IS_SET(pexit->exit_info, EX_SECRET) && !IS_IMMORTAL( ch )) )
	  continue;
	else{
	  if (IS_SET(pexit->exit_info, EX_CLOSED))
	    paran = TRUE;
	  found = TRUE;
	  if ( fAuto ){
	    strcat( buf, " " );
	    if (paran)
	      strcat(buf,"(");
	    if (can_see_trap(ch, pexit->traps))
	      strcat(buf, "`!+``");
	    strcat( buf, dir_name[door] );
	    if (paran)
	      strcat(buf,")");
	  }
	  else{
	    if (paran)
	      sprintf( buf + strlen(buf), "%s(%-5s) - %s", 
		       can_see_trap(ch, pexit->traps) ? "`!+``" : "",
		       capitalize( dir_name[door] ),
		       room_is_dark(ch->in_room) ? "Too dark to tell." : pexit->to_room->name);
	    else
	      sprintf( buf + strlen(buf), " %s%-5s  - %s", 
		       can_see_trap(ch, pexit->traps) ? "`!+``" : "",
		       capitalize( dir_name[door] ),
		       room_is_dark(ch->in_room) ? "Too dark to tell." : pexit->to_room->name);
	    if (IS_IMMORTAL(ch))
	      sprintf(buf + strlen(buf), " (room %d)\n\r",pexit->to_room->vnum);
	    else
	      sprintf(buf + strlen(buf), "\n\r");
	  }
	}
    }
    if ( !found )
      strcat( buf, fAuto ? " none" : "None.\n\r" );
    if ( fAuto )
      strcat( buf, "]\n\r" );
    send_to_char( buf, ch );
}

void do_worth( CHAR_DATA *ch, char *argument )
{
    if (IS_NPC(ch))
    {
        sendf(ch,"You have %ld gold.\n\r",ch->gold);
	return;
    }
    sendf(ch, "You have %ld gold, and %ld experience (%ld exp to level).\n\r", ch->gold, ch->exp, total_exp(ch) - ch->exp);
    if ( !IS_NPC(ch) && ch->pCabal)
      sendf(ch, "You currently possess %d %s%s for your service to %s.\n\r", 
	    GET_CP(ch),
	    ch->pCabal->currency,
	    GET_CP(ch) == 1 ? "" : "s",
	    ch->pCabal->who_name);

    if (ch->pCabal){
      float rate = cp_calculate_timegain(ch);
      if (rate == 0){
	sendf(ch, "You currently are not gaining any %ss.%s\n\t",
	      ch->pCabal->currency,
	      is_affected(ch, gsn_stance) ? " [STANCE]" : "");
	return;
      }
	/* calculate ticks per cp */
      rate /= CPTS;
      
      /* check if we gain more then 1 cp / tick */
      if (rate < 1){
	rate = 1 / rate;
	sendf(ch, "You currently need %.1f hours for one %s.\n\r",
	      rate,
	      ch->pCabal->currency);
      }
      else
	sendf(ch, "You currently gain %.1f %s%s per hour.\n\r",
	      rate,
	      ch->pCabal->currency,
	      (rate != 1? "s" : ""));
    }//END DISPLAY CP RATE

}

char* get_stat_string( CHAR_DATA* ch, int stat ){
  static char output[32];
  char* stat_str, *color;
  
  output[0] = 0;

  if (ch == NULL)
    return output;

  switch( stat ){
  case STAT_STR:	stat_str = "Str";	break;
  case STAT_INT:	stat_str = "Int";	break;
  case STAT_WIS:	stat_str = "Wis";	break;
  case STAT_DEX:	stat_str = "Dex";	break;
  case STAT_CON:	stat_str = "Con";	break;
  case STAT_LUCK:	stat_str = "Lck";	break;
  default: sprintf(output, "%s13.13", "???"); return output;
  }

  if (stat != STAT_LUCK ){
    char over_string[3];
    int abs_stat =  get_abs_stat( ch, stat );
    int cur_stat =  get_curr_stat(ch, stat);
    int perm_stat =  UMIN(get_max_stat(ch, stat), ch->perm_stat[stat]);
    

    if (abs_stat > cur_stat){
      sprintf(over_string, "^%1.1d", abs_stat - cur_stat);
    }
    else
      over_string[0] = 0;

    if (abs_stat > perm_stat)
      color = "`@";
    else if (abs_stat < perm_stat)
      color = "`3";
    else
      color = "";

    sprintf( output, "%3.3s: %2.2d(%s%-2.2d%s)%-2.2s",
	     stat_str,
	     perm_stat, 
	     color,
	     cur_stat,
	     abs_stat != perm_stat ? "``" : "",
	     over_string);
  }
  else{
    int cur = get_curr_stat(ch, stat);
    int max = get_max_stat(ch, stat);
    sprintf( output, "%3.3s: %s", stat_str, short_bar( cur - 3, max ) );
  }
  return output;
}

void add_score_line( BUFFER* buffer, char* str ){
  char buf[MIL];

  sprintf(buf, "| %-61.61s |\n\r", str );
  add_buf( buffer, buf );
}

/* CURRENT LAYOUT
1 +  15     +   2 +                    44                     + 1 = 63 chars 
/---------------\/----------------------------------------------\
| Voytek        || The Hand of Pandemonium [MASQUE]             |
\---------------/\----------------------------------------------/
/ Str: 99(99)^9 || Level: 99            Age: 17(999h)           |
| Int: 99(99)^9 || Class: Dark-Knight   Ethos: Chaotic		|
| Wis: 99(99)^9 || Race:  Human(M)      Align: Evil		|
| Dex: 99(99)^9 || Hp: 9999/9999        Home : Miruvhor         |
| Con: 99(99)^9 || Mn: 9999/9999	Exp: 99999/999999	|
\ Lck: [|||---] \/ Mv: 9999/9999        ToHit: -99  ToDam: -99	/
/---------------/\------------------/\--------------------------\
|    ARMOR      ||      SAVES       || Deity : Avariel		|
| Pierce: -9999 || Spell      : -99 || Faith : Baaclance        |
| Slash : -9999 || Afflictive : -99 || Weight: 9999/9999	|
| Blunt : -9999 || Maledictive: -99 || Items : 9999/9999	|
| Magic : -9999 || Mental     : -99 || Prac  : 99    Train: 99	|
| Weapon: Normal||                  || Gold  : 9999k Cp: 9999k	|
\---------------\/------------------\/--------------------------/
*/
void new_score( CHAR_DATA* ch,  CHAR_DATA* victim, char* argument ){
  AFFECT_DATA* paf;
  BUFFER* buffer;
  char buf[MIL], buf1[MIL], buf2[MIL], buf3[MIL], buf4[MIL];
  int i, scroll;  

  if (is_affected(victim,gsn_linked_mind))
    return;
  else
    buffer = new_buf();
/* LINE 1 */
  add_buf( buffer,
  "\n\r/---------------\\/----------------------------------------------\\\n\r");

/* LINE 2: name(13), title/cabal rank and cabal(44) */
  sprintf(buf1, "%-13s", victim->name );
  if (victim->pCabal){
    sprintf(buf2, "%s of %s%s", 
	    get_crank(victim), 
	    victim->pCabal->who_name,
	    IS_MASQUE(victim) ? " [MASQUE]" : "");
    sprintf(buf3, "%-48.48s", buf2);
  }
  else{
    sprintf(buf2, "%s%s",
	    IS_NPC(victim) ? "" : victim->pcdata->title,
	    IS_MASQUE(victim) ? " [MASQUE]" : "");
    sprintf(buf3, "%-44.44s", buf2);
  }
  sprintf(buf, "| %s || %s |\n\r", buf1, buf3);
  add_buf(buffer, buf );

/* LINE 3: */
  add_buf(buffer, 
  "\\---------------/\\----------------------------------------------/\n\r");

/* LINE 4: Strength (13)  Level[Sex] (20)  Age (22) */
  switch (victim->sex){
  case SEX_NEUTRAL: sprintf( buf4, "%s", "N"); break;
  case SEX_MALE: sprintf( buf4, "%s", "M"); break;
  case SEX_FEMALE: sprintf( buf4, "%s", "F"); break;
  }
  sprintf( buf1, "%s", get_stat_string(victim, STAT_STR));
  sprintf( buf2, "Level: %2d Sex: %s", victim->level, buf4 );
  sprintf( buf3, "Age  : %2d(%dh)", 
	   get_age(victim),
	   ( victim->played + (int) (mud_data.current_time - victim->logon) ) / 3600);
  sprintf( buf, "| %s || %-20.20s  %-22.22s |\n\r",
	   buf1, buf2, buf3);
  add_buf( buffer, buf );

/* LINE 5: Int (13) Class (20)  Ethos (22) */
  //sex
  sprintf( buf1, "%s", get_stat_string(victim, STAT_INT));
  sprintf( buf2, "Class: %s", 
	   IS_NPC(victim) ? "mobile" : class_table[victim->class].name);

  sprintf( buf3, "Ethos: %s", 
	   IS_NPC(victim) ? "None" : ethos_table[victim->pcdata->ethos].name);
  sprintf( buf, "| %s || %-20.20s  %-22.22s |\n\r",
	   buf1, buf2, buf3);
  add_buf( buffer, buf );

/* LINE 6: Wis (13) Race (20) Align (22) */
  sprintf( buf1, "%s", get_stat_string(victim, STAT_WIS));
  //race
  if (is_affected(victim, gen_unlife))
    sprintf(buf2, "Race : %s", "undead");
  else if (IS_QRACE(victim))
    sprintf(buf2, "Race : %s(%s)", 
	    victim->pcdata->race, race_table[victim->race].name);
  else
    sprintf(buf2, "Race : %s", race_table[victim->race].name);
  //align
  if (IS_GOOD(victim))
    sprintf( buf3, "Align: %s", "good");
  else if (IS_EVIL(victim))
    sprintf( buf3, "Align: %s", "evil");
  else
    sprintf( buf3, "Align: %s", "neutral");

  sprintf( buf, "| %s || %-21.21s %-22.22s |\n\r",
	   buf1, buf2, buf3);
  add_buf( buffer, buf );

/* LINE 7: Dex (13) Hp (20) Exp (22)  */
  sprintf( buf1, "%s", get_stat_string(victim, STAT_DEX));
  sprintf( buf2, "Hp   : %4d/%-4d", victim->hit, victim->max_hit );
  sprintf( buf3, "Exp  : %ld/%-6ld", 
	   total_exp(victim) - victim->exp, victim->exp);
  sprintf( buf, "| %s || %-20.20s  %-22.22s |\n\r",
	   buf1, buf2, buf3);
  add_buf( buffer, buf );

/* LINE 8: Con (13) Mana (20) Misc (22) */
  sprintf( buf1, "%s", get_stat_string(victim, STAT_CON));
  sprintf( buf2, "Mana : %4d/%-4d", victim->mana, victim->max_mana );

 /* race/class specific things here */
  if (!IS_NPC(victim) && victim->pcdata->enemy_race){
    sprintf( buf3, "Enemy: %s", pc_race_table[ch->pcdata->enemy_race].name);
  }
  else
    buf3[0] = 0;
  
  sprintf( buf, "| %s || %-20.20s  %-22.22s |\n\r",
	   buf1, buf2, buf3);
  add_buf( buffer, buf );

/* LINE 9: Luck (13) Move (20) ToHit (10) ToDam(11) */
  sprintf( buf1, "%s", get_stat_string(victim, STAT_LUCK));
  sprintf( buf2, "Move : %4d/%-4d", victim->move, victim->max_move );
  sprintf( buf3, "+Hit: %d", GET_HITROLL(victim) );
  sprintf( buf4, "+Dam: %d", GET_DAMROLL(victim) );
  sprintf( buf, "\\ %s \\/ %-20.20s  %-10.10s %-11.11s /\n\r",
	   buf1, buf2, buf3, buf4);
  add_buf( buffer, buf );

/* LINE 10 */
  add_buf( buffer, 
  "/---------------/\\------------------/\\--------------------------\\\n\r");

/* LINE 11 Deity (16)*/
  sprintf(buf, "|    ARMOR      ||      SAVES       || Deity : %-16.16s |\n\r",
	  IS_NPC(victim) ? "Creator" : deity_table[victim->pcdata->way].god);
  add_buf( buffer, buf );

/* LINE 12: AC-Slash (13) Svs-Spell (17) Faith (24) */
  sprintf(buf1, "Slash : %5d", GET_AC(victim, AC_SLASH ));
  sprintf(buf2, "Spell      : %2d", victim->savingspell );
  if (IS_NPC(victim))
    sprintf(buf3, "Faith : None");
  else
    sprintf(buf3, "Faith : %s", 
	    deity_table[victim->pcdata->way].way);

  sprintf(buf, "| %-13.13s || %-16.16s || %-24.24s |\n\r",
	  buf1, buf2, buf3);
  add_buf( buffer, buf );

/* LINE 13: AC-Pierce (13) Svs-Afflictive (17) Weight (24) */
  sprintf(buf1, "Pierce: %5d", GET_AC(victim, AC_PIERCE ));
  sprintf(buf2, "Afflictive : %2d", victim->savingaffl );
  sprintf(buf3, "Weight: %d/%-3d", 
	  get_carry_weight(victim) / 10, 
	  can_carry_w(victim) /10 );
  sprintf(buf, "| %-13.13s || %-16.16s || %-24.24s |\n\r",
	  buf1, buf2, buf3);
  add_buf( buffer, buf );

/* LINE 14: AC-Blunt (13) Svs-Maledictive (17) Items (24) */  
  sprintf(buf1, "Blunt : %5d", GET_AC(victim, AC_BASH ));
  sprintf(buf2, "Maledictive: %2d", victim->savingmaled );
  sprintf(buf3, "Items : %d/%-3d", 
	  victim->carry_number, 
	  can_carry_n(victim));
  sprintf(buf, "| %-13.13s || %-16.16s || %-24.24s |\n\r",
	  buf1, buf2, buf3);
  add_buf( buffer, buf );

/* LINE 15: AC-Magic (13) Svs-Mental (17) Prac (13) Train (10) */  
  sprintf(buf1, "Magic : %5d", GET_AC(victim, AC_EXOTIC ));
  sprintf(buf2, "Mental     : %2d", victim->savingmental );
  sprintf(buf3, "Prac  : %d", victim->practice );
  sprintf(buf4, "Train: %d", victim->train );
  sprintf(buf, "| %-13.13s || %-16.16s || %-13.13s %-10.10s |\n\r",
	  buf1, buf2, buf3, buf4);
  add_buf( buffer, buf );

/* LINE 16: Weapon Pos(13) Gold (13) Cp (10) */
  if (!IS_NPC(victim) 
      && (get_skill(victim, gsn_2h_tactics) || get_skill(victim, gsn_battlestance))){
    sprintf(buf3, "Weapon: %s",
	    victim->pcdata->wep_pos == WEPPOS_HIGH ? "high" :
	    victim->pcdata->wep_pos == WEPPOS_LOW ? "low" : 
	    victim->pcdata->wep_pos == WEPPOS_NORMAL? "norm" : "unkown");
  }
  else
    buf3[0] = 0;
  if (!IS_NPC(victim) 
      && get_skill(victim, gsn_footwork)){
    sprintf(buf4, "Pos: %s",
	    victim->pcdata->bat_pos == BATPOS_LEFT ? "left" :
	    victim->pcdata->bat_pos == BATPOS_RIGHT ? "right" : 
	    victim->pcdata->bat_pos == BATPOS_MIDDLE ? "middle" : "unkown");
  }
  else
    buf4[0] = 0;
  sprintf(buf1, "Gold  : %ld%s", 
	  victim->gold > 9999 ? victim->gold / 1000 : victim->gold,
	  victim->gold > 9999 ? "k" : "" );
  if (victim->pCabal){
    int cp = GET_CP(victim);
    if (cp < 1000)
      sprintf(buf2, "CP: %d", cp);
    else
      sprintf(buf2, "CP: %.1fk", (float)cp/1000);
  }
  else
    sprintf(buf2, "%s", "" );
  sprintf(buf, "| %-13.13s || %-16.16s || %-13.13s %-10.10s |\n\r",
	 buf3, buf4, buf1, buf2);
  add_buf( buffer, buf );

/* LINE 17 */
  add_buf( buffer, 
  "\\---------------\\/------------------\\/--------------------------/\n\r");

  if (!IS_NULLSTR(argument)){
    scroll = ch->lines;
    ch->lines = 0;
    page_to_char(buf_string(buffer),ch);
    ch->lines = scroll;
    free_buf(buffer);
    return;
  }

/* LINE 18: Condition */
  if (victim->pcdata->dall < 10  )
    sprintf(buf1, "You are in the prime of your health.");
  else if (victim->pcdata->dall < 20  )  
    sprintf(buf1, "You have a few cuts and bruises.");
  else if (victim->pcdata->dall < 30  ) 
    sprintf(buf1, "You are a bit worn out from your wounds.");
  else if (victim->pcdata->dall < 40  ) 
    sprintf(buf1, "You are covered with deep scars and lacerations.");
  else if (victim->pcdata->dall < 50  )
    sprintf(buf1, "You have sustained mortal injuries in your travels.");
  else if (victim->pcdata->dall < 60  )
    sprintf(buf1, "Death is knocking at your door.");
  else				    
    sprintf(buf1, "The next death will send you beyond the abyss.");

  sprintf( buf, "/ Condition: %-50.50s \\\n\r", buf1 );
  add_buf( buffer, buf );

  /* monk anatomies */
  if ( (victim->class == gcn_monk || victim->class == gcn_blademaster) && !IS_NPC(victim)){
    OBJ_DATA *obj;
    add_score_line(buffer, "Anatomy :Mob Human Elf Dwarf DemiHum Giant Beast Flying Unique");
    sprintf(buf, "|          %3d  %3d  %3d  %3d    %3d    %3d   %3d   %3d    %3d  |\n\r",
	    victim->pcdata->anatomy[0],
	    victim->pcdata->anatomy[1],
	    victim->pcdata->anatomy[2],
	    victim->pcdata->anatomy[3],
	    victim->pcdata->anatomy[4],
	    victim->pcdata->anatomy[5],
	    victim->pcdata->anatomy[6],
	    victim->pcdata->anatomy[7],
	    victim->pcdata->anatomy[8]);
    add_buf( buffer, buf );

    sprintf(buf, "Encumber:");
    buf1[0] = 0;
    for (i = 0; i < 8; i++){
      if ((obj = get_eq_char(victim, monk_table[i].value)) != NULL && obj->weight > monk_table[i].weight * 10){
	sprintf(buf1, " %s", monk_table[i].wear);
	strcat(buf, buf1);
      }
    }
    if (buf1[0] != 0)
      add_score_line( buffer, buf );
  }

  /* application */
  if (HAS_CLAN(victim)){
    int sec = ClanSecondsToApply( victim);
    if (sec > 0){
      sprintf(buf, "You have %d days left to submit a cabal application.", sec / 86400);
      add_score_line( buffer, buf );
    }
  }
  /* promotion */
  if (!IS_NPC(victim) && victim->pCabal && victim->pcdata->member ){
    if (check_promo_hours( victim->pcdata->member,  victim->pcdata->rank )){
      sprintf(buf, "You are ready for a cabal promotion.");
      add_score_line( buffer, buf );
    }
    else{
      int diff = (victim->pcdata->member->rank + 1) * 10 - (victim->pcdata->member->hours / 3600);
      sprintf( buf, "%d more hours must pass before a cabal promotion.", diff);
      add_score_line( buffer, buf );
    }
  }  

  /* alias */
  if (!IS_NPC(ch) && victim->pcdata->alias 
      && victim->pcdata->alias[0] != '\0'){
    sprintf( buf, "Alias: The last thing you see is %s.", victim->pcdata->alias);
    add_score_line( buffer, buf );
  }

  /* Hunger, Thirst, and Drunkiness */
  if ( !IS_NPC(victim)){ 
    if (is_affected(victim, gsn_drunken) 
	|| victim->pcdata->condition[COND_DRUNK]   > 10 )
      add_score_line(buffer, "You are drunk." );
    if ( victim->pcdata->condition[COND_THIRST] ==  0 )
      add_score_line(buffer,"You are thirsty.");
    if (victim->pcdata->condition[COND_HUNGER]   ==  0 )
      add_score_line(buffer,"You are hungry." );
    if ( is_ghost( victim, 300 ) )
      add_score_line(buffer, "You are a ghost.");
    
    /* SERVANTS */
    if (victim->pcdata->familiar != NULL){
      sprintf(buf, "Your servant task: %s", special_bit_name(victim->pcdata->familiar->special));
      add_score_line(buffer, buf);
    }
/* CRUSADE */
    if ( (paf = affect_find(victim->affected, gen_crusade)) != NULL){
      sprintf(buf, "You are on Crusade against %s", show_crusade( paf ));
      add_score_line( buffer, buf );
    }
    
/* CABAL AREA OWNERSHIPS */
    /* CABAL AREA EFFECTS */
    if (victim->in_room && victim->in_room->area->pCabal ){
      if (!str_cmp(victim->in_room->area->pCabal->name, "Knight") 
	  && IS_GOOD(ch))
	sprintf(buf, "[%s] forces are aiding your healing.", 
		victim->in_room->area->pCabal->who_name );
      else if (!str_cmp(victim->in_room->area->pCabal->name, "Savant")
	       && (class_table[victim->class].fMana 
		   || class_table[victim->class].sMana ))
	sprintf( buf, "[%s] forces are aiding your mind.", 
		 victim->in_room->area->pCabal->who_name );
      else if (!str_cmp(victim->in_room->area->pCabal->name, "Warmaster")
	       && !class_table[victim->class].fMana 
	       && !class_table[victim->class].sMana)
	sprintf( buf, "[%s] forces are aiding your feet and stamina.", 
		 victim->in_room->area->pCabal->who_name );
      else if (!str_cmp(victim->in_room->area->pCabal->name, "Nexus") 
	       && IS_EVIL(victim))
	sprintf(buf, "[%s] forces are aiding your violent instincts.", 
		victim->in_room->area->pCabal->who_name );
      else
	buf[0] = 0;
      
      if (buf[0] != 0){
	sprintf(buf1, "| %-65.65s |\n\r", buf );
	add_buf( buffer, buf1 );
      }
    }
    if(is_affected(victim, gen_study)){
      add_score_line(buffer, study_info(victim, FALSE, NULL));
    }
/* show abduction */
    if (is_affected(victim, gsn_abduct)){
      add_score_line(buffer, abduct_info( victim ) );
    }
/* show chaos orb */
    if ( (paf = affect_find(victim->affected, gen_orb)) != NULL){
      sprintf(buf1, "Your %s is at level %d", 
	      effect_table[GN_POS(paf->type)].name,
	      paf->modifier / effect_table[GN_POS(paf->type)].value3[0] );
      add_score_line( buffer, buf1 );
    }
/* TRAP info */
    for (i = 0; i < MAX_TRAPS; i++){
      TRAP_DATA* pTrap = victim->traps[i];
      if (pTrap == NULL)
	continue;
      if (pTrap->on_obj){
	sprintf(buf1, "You've set %s on %s [%d]", 
		pTrap->name,
		pTrap->on_obj->short_descr,
		pTrap->duration);
	add_score_line( buffer, buf1 );
      }
      else if (pTrap->on_exit){
	sprintf(buf1, "You've set %s on path leading to %s [%d]",
	      pTrap->name,
		pTrap->on_exit->to_room ? pTrap->on_exit->to_room->name : "error",
		pTrap->duration);
	sprintf(buf, "| %-65.65s |\n\r", buf1 );
	add_buf( buffer, buf );
      }
      else{
	sprintf(buf1, "You've set a trap but something is wrong. ");
	add_score_line( buffer, buf1 );
      }
    }
    /* show crimes */
    if (show_crimes(ch, victim, FALSE, TRUE ) != CRIME_ALLOW){
      add_score_line(buffer, "You are wanted for crimes.  Use \"crimes\" for details");
    }
  }
/* END */
  sprintf( buf, 
   "\\---------------------------------------------------------------/\n\r");
  add_buf( buffer, buf );
  
  scroll = ch->lines;
  ch->lines = 0;
  page_to_char(buf_string(buffer),ch);
  ch->lines = scroll;
  free_buf(buffer);
}

void do_crimes( CHAR_DATA *ch, char *argument ){
  show_crimes(ch, ch, FALSE, FALSE );
}  

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

  int i;
  AFFECT_DATA* paf;
  
  if (is_affected(ch,gsn_linked_mind))
    return;
  if (IS_GAME(ch, GAME_NEWSCORE )){
    new_score( ch, ch, argument );
    return;
  }
  sendf( ch, "You are %s",  ch->name);
  if (!IS_NPC(ch))
    sendf(ch, ", loyal believer in way of %s and powers of %s.", 
	  deity_table[ch->pcdata->way].way, 
	  path_table[deity_table[ch->pcdata->way].path].name);

  sendf(ch, "\n\rLevel %d, %d years old (%d hours).\n\r", ch->level, get_age(ch),
	( ch->played + (int) (mud_data.current_time - ch->logon) ) / 3600);
  if ( get_trust( ch ) != ch->level )
    sendf( ch, "You are trusted at level %d.\n\r", get_trust( ch ) );
  if (!IS_NPC(ch) && ch->pcdata->alias && ch->pcdata->alias[0] != '\0')
    sendf( ch, "Alias: The last thing you see is %s.\n\r", ch->pcdata->alias);
  sendf(ch, "Race: %s %s%s%s Sex: %s  Class: %s",
	IS_QRACE(ch) ? ch->pcdata->race :  
	race_table[is_affected(ch, gen_unlife) ? 
		  race_lookup("undead") : ch->race].name, 
	IS_QRACE(ch) ? "(" : "",
	IS_QRACE(ch) ? race_table[is_affected(ch, gen_unlife) ? 
				 race_lookup("undead") : ch->race].name :
	"",
	IS_QRACE(ch) ? ") " : "",
	ch->sex == 0 
	? "sexless" : ch->sex == 1 ? "male" : "female",
	IS_NPC(ch) ? "mobile" : class_table[ch->class].name);

  if(!IS_NPC(ch) &&  IS_SET(ch->act2, PLR_MASQUERADE))
    sendf(ch, "  `5[`%%MASQUE`5]``\n\r");
  else
    send_to_char("\n\r",ch);
  sendf(ch, "Hometown: %s     Alignment: %s    Ethos: %s",
	IS_NPC(ch) ? "None" : hometown_table[ch->hometown].name,
	ch->alignment >= GOOD_THRESH ? "Good" : ch->alignment < GOOD_THRESH && ch->alignment > EVIL_THRESH ? "Neutral" : ch->alignment <= EVIL_THRESH ? "Evil" : "Wrong for a mortal",
	IS_NPC(ch) ? "None" : ethos_table[ch->pcdata->ethos].name);
  sendf(ch, "\n\r");
  if ( !IS_NPC(ch) && ch->pCabal){
    sendf( ch, "%s of [%s] with %d %s%s to your name.\n\r", 
	   get_crank( ch ),
	   ch->pCabal->who_name,
	   GET_CP(ch), 
	   ch->pCabal->currency,
	   GET_CP(ch) == 1 ? "" : "s");
  }
  if (!IS_NPC(ch) && ch->pCabal && ch->pcdata->member ){
    if ((ch->pcdata->member->hours / 3600) >= (ch->pcdata->member->rank + 1) * 10){
      sendf(ch, "You have been cleared for a promotion in the ranks of [%s]\n\r", ch->pCabal->who_name);
    }
    else{
      int diff = (ch->pcdata->member->rank + 1) * 10 - (ch->pcdata->member->hours / 3600);
      sendf(ch, "%d more hours must pass, before your cabal rank may change.\n\r", diff);
    }

  }
  sendf( ch, "You have %d/%d hit, %d/%d mana, %d/%d movement.\n\r",
	 ch->hit, ch->max_hit, ch->mana, ch->max_mana, ch->move, ch->max_move);
  sendf( ch, "You have %d practices and %d training sessions.\n\r", ch->practice, ch->train);
  sendf( ch, "You are carrying %d/%d items with weight %d/%d pounds.\n\r",
	 ch->carry_number, can_carry_n(ch), get_carry_weight(ch) / 10, can_carry_w(ch) /10 );
  sendf( ch, "Str: %d(%d)  Int: %d(%d)  Wis: %d(%d)  Dex: %d(%d)  Con: %d(%d)\n\r",
	 ch->perm_stat[STAT_STR], get_curr_stat(ch,STAT_STR), ch->perm_stat[STAT_INT], get_curr_stat(ch,STAT_INT),
	 ch->perm_stat[STAT_WIS], get_curr_stat(ch,STAT_WIS), ch->perm_stat[STAT_DEX], get_curr_stat(ch,STAT_DEX),
	 ch->perm_stat[STAT_CON], get_curr_stat(ch,STAT_CON) );
  sendf( ch, "You have scored %ld exp, and have %ld gold coins.\n\r",ch->exp,ch->gold );
  if (!IS_NPC(ch))
    {
      int luck;
      send_to_char("Condition: ",ch);
      if (ch->pcdata->dall < 10  )        send_to_char("You are in the prime of your health.\n\r",ch);
      else if (ch->pcdata->dall < 20  )   send_to_char("You have a few cuts and bruises.\n\r",ch);
      else if (ch->pcdata->dall < 30  )   send_to_char("You are a bit worn out from your wounds.\n\r",ch);
      else if (ch->pcdata->dall < 40  )   send_to_char("You are covered with deep scars and jagged lacerations.\n\r",ch);
      else if (ch->pcdata->dall < 50  )   send_to_char("You have sustained some mortal injuries in your travels.\n\r",ch);
      else if (ch->pcdata->dall < 60  )   send_to_char("Death is knocking at your door.\n\r",ch);
      else				    send_to_char("The next death will send you beyond the abyss.\n\r",ch);
      luck = get_curr_stat(ch,STAT_LUCK);
      send_to_char("Luck: ",ch);
      if (luck < 8) 			send_to_char("You have hit rock bottom on your luck.\n\r",ch);
      else if (luck < 12)		send_to_char("Things are just not going your way.\n\r",ch);
      else if (luck < 15)		send_to_char("You are down on your luck.\n\r",ch);
      else if (luck < 18)		send_to_char("Your luck can turn either way.\n\r",ch);
      else if (luck < 21)		send_to_char("You feel lucky.\n\r",ch);
      else if (luck < 24)		send_to_char("You feel very lucky.\n\r",ch);
      else 				send_to_char("Lady Luck is going your way.\n\r",ch);
    }
  
  /* Show Avatar Level description. */
  if (!IS_NPC(ch) && IS_AVATAR(ch))
    act(get_avatar_desc(ch), ch, NULL, NULL, TO_CHAR);
  
  if (!IS_NPC(ch) && ch->level < LEVEL_HERO)
    sendf (ch, "You need %ld exp to level.\n\r",total_exp(ch) - ch->exp);
  sendf( ch, "Wimpy set to %d hit points.\n\r", ch->wimpy );
  if (!IS_NPC(ch) && ch->pcdata->guarding != NULL)
    sendf(ch, "Guarding: %s\n\r",ch->pcdata->guarding->name);
  if (!IS_NPC(ch) && ch->pcdata->guarded_by != NULL)
    sendf(ch, "Guarded by: %s\n\r",ch->pcdata->guarded_by->name);
  if ( !IS_NPC(ch) && (is_affected(ch,gsn_drunken) || ch->pcdata->condition[COND_DRUNK]   > 10 ))
    send_to_char( "You are drunk.\n\r",   ch );
  if ( !IS_NPC(ch) && ch->pcdata->condition[COND_THIRST] ==  0 )
    send_to_char( "You are thirsty.\n\r", ch );
  if ( !IS_NPC(ch) && ch->pcdata->condition[COND_HUNGER]   ==  0 )
    send_to_char( "You are hungry.\n\r",  ch );
  if ( !IS_NPC(ch) && is_ghost( ch, 300 ) )
    send_to_char( "You are a ghost.\n\r",  ch);
  switch ( ch->position )
    {
    case POS_DEAD:
      send_to_char( "You are DEAD!!\n\r",             ch );	break;
    case POS_MORTAL:
      send_to_char( "You are mortally wounded.\n\r",  ch );	break;
    case POS_INCAP:
	send_to_char( "You are incapacitated.\n\r",     ch );	break;
    case POS_STUNNED:
	send_to_char( "You are stunned.\n\r",           ch );	break;
    case POS_MEDITATE:
	send_to_char( "You are meditating.\n\r",          ch );	break;
    case POS_SLEEPING:
	if (IS_AFFECTED2(ch, AFF_CATALEPSY))
	{   send_to_char( "You are in a state of self induced catalepsy.\n\r",          ch );	break;}
	else
	{   send_to_char( "You are sleeping.\n\r",          ch );	break;}
    case POS_RESTING:
	send_to_char( "You are resting.\n\r",           ch );	break;
    case POS_SITTING:
	send_to_char( "You are sitting.\n\r",           ch );	break;
    case POS_STANDING:
	send_to_char( "You are standing.\n\r",          ch );	break;
    case POS_FIGHTING:
	send_to_char( "You are fighting.\n\r",          ch );	break;
    }
    if (!IS_NPC(ch) && ch->pcdata->familiar != NULL)
        sendf(ch, "Your servant has been commanded the following: %s\n\r",special_bit_name(ch->pcdata->familiar->special));
    if (ch->level >= 25)
	sendf( ch, "Armor: pierce: %d  bash: %d  slash: %d  magic: %d\n\r",
          GET_AC(ch,AC_PIERCE), GET_AC(ch,AC_BASH), GET_AC(ch,AC_SLASH), GET_AC(ch,AC_EXOTIC));
    if (ch->level >= 30)
	sendf( ch, "Save vs  Spell: %d  Affliction: %d  Malediction: %d  Mental: %d\n\r", ch->savingspell,ch->savingaffl,ch->savingmaled,ch->savingmental);
    for (i = 0; i < 4; i++)
    {
	char * temp;
	switch(i)
	{
	    case(AC_PIERCE):    temp = "piercing";      break;
	    case(AC_BASH):      temp = "bashing";       break;
	    case(AC_SLASH):     temp = "slashing";      break;
	    case(AC_EXOTIC):    temp = "magic";         break;
	    default:            temp = "error";         break;
	}
	send_to_char("You are ", ch);
        if (GET_AC(ch,i) >=  101 )    sendf(ch,"hopelessly vulnerable to %s.\n\r",temp);
        else if (GET_AC(ch,i)>=80)    sendf(ch,"defenseless against %s.\n\r",temp);
        else if (GET_AC(ch,i)>=60)    sendf(ch,"barely protected from %s.\n\r",temp);
        else if (GET_AC(ch,i)>=40)    sendf(ch,"slightly armored against %s.\n\r",temp);
        else if (GET_AC(ch,i)>=20)    sendf(ch,"somewhat armored against %s.\n\r",temp);
        else if (GET_AC(ch,i)>=0)     sendf(ch,"armored against %s.\n\r",temp);
        else if (GET_AC(ch,i)>=-40)   sendf(ch,"well-armored against %s.\n\r",temp);
        else if (GET_AC(ch,i)>=-80)   sendf(ch,"very well-armored against %s.\n\r",temp);
        else if (GET_AC(ch,i)>=-120)  sendf(ch,"heavily armored against %s.\n\r",temp);
        else if (GET_AC(ch,i)>=-160)  sendf(ch,"superbly armored against %s.\n\r",temp);
        else if (GET_AC(ch,i)>=-200)  sendf(ch,"supremely armored against %s.\n\r",temp);
        else if (GET_AC(ch,i)>=-250)  sendf(ch,"almost invulnerable to %s.\n\r",temp);
        else if (GET_AC(ch,i)>=-300)  sendf(ch,"divinely armored against %s.\n\r",temp);
        else                          sendf(ch,"utterly invincible against %s.\n\r",temp);
    }
    if (IS_IMMORTAL(ch))
    {
        send_to_char("Holy Light: ",ch);
        if (IS_SET(ch->act,PLR_HOLYLIGHT))
            send_to_char("on",ch);
        else
            send_to_char("off",ch);
        if (ch->invis_level)
            sendf( ch, "  Invisible: level %d",ch->invis_level);
        if (ch->incog_level)
            sendf( ch, "  Incognito: level %d",ch->incog_level);
        send_to_char("\n\r",ch);
    }
    if ( ch->level >= 15 )
        sendf( ch, "Hitroll: %d  Damroll: %d.\n\r",GET_HITROLL(ch),GET_DAMROLL(ch));
    if (!IS_NPC(ch) 
	&& (get_skill(ch, gsn_2h_tactics) && has_twohanded(ch)) ){
      sendf(ch, "Your weapon is held %s.\n\r",
	    ch->pcdata->wep_pos == WEPPOS_HIGH ? "high" :
	    ch->pcdata->wep_pos == WEPPOS_LOW ? "low" : 
	    ch->pcdata->wep_pos == WEPPOS_NORMAL? "normal" : "unkown");
    }
    if ( (paf = affect_find(ch->affected, gen_crusade)) != NULL){
      sendf(ch, "You are on a Crusade against %s\n\r", show_crusade( paf ));
    }
    /* CABAL AREA EFFECTS */
    if (ch->in_room && ch->in_room->area->pCabal ){
      if (!str_cmp(ch->in_room->area->pCabal->name, "Knight") && IS_GOOD(ch))
	sendf( ch, "[%s] forces are aiding your healing.\n\r", ch->in_room->area->pCabal->who_name );
      else if (!str_cmp(ch->in_room->area->pCabal->name, "Savant")
	       && (class_table[ch->class].fMana || class_table[ch->class].sMana ))
	sendf( ch, "[%s] forces are aiding your mind.\n\r", ch->in_room->area->pCabal->who_name );
      else if (!str_cmp(ch->in_room->area->pCabal->name, "Warmaster")
	       && !class_table[ch->class].fMana && !class_table[ch->class].sMana)
	sendf( ch, "[%s] forces are aiding your feet and stamina.\n\r", ch->in_room->area->pCabal->who_name );
      else if (!str_cmp(ch->in_room->area->pCabal->name, "Nexus") && IS_EVIL(ch))
	sendf( ch, "[%s] forces are aiding your darker instincts.\n\r", ch->in_room->area->pCabal->who_name );
    }
	
    if ((ch->class == gcn_monk || ch->class == gcn_blademaster) && !IS_NPC(ch))
    {
	OBJ_DATA *obj;
	send_to_char("Anatomy:", ch);
        for (i = 0; anatomy_table[i].name != NULL; i++)
	    sendf(ch, "  %s: %d", anatomy_table[i].name, ch->pcdata->anatomy[i]);
	send_to_char("\n\r", ch);
	send_to_char("Encumberance:", ch);
	for (i = 0; i < 8; i++)
	    if ((obj = get_eq_char(ch, monk_table[i].value)) != NULL && obj->weight > monk_table[i].weight * 10)
	        sendf(ch, " %s", monk_table[i].wear);
	send_to_char("\n\r", ch);
    }

//Last thing we show before affects is chance to assasinate:
    if(is_affected(ch, gen_study))
      sendf(ch, "%s\n\r", study_info(ch, FALSE, NULL));
/* show abduction */
    sendf(ch, "%s\n\r", abduct_info(ch));
/* show chaos orb */
    if ( (paf = affect_find(ch->affected, gen_orb)) != NULL){
      sendf(ch, "Your %s is at level %d\n\r", 
	    effect_table[GN_POS(paf->type)].name,
	    paf->modifier / effect_table[GN_POS(paf->type)].value3[0] );
    }
/* show crimes */
    show_crimes(ch, ch, FALSE, FALSE );
/* TRAP info */
    for (i = 0; i < MAX_TRAPS; i++){
      TRAP_DATA* pTrap = ch->traps[i];
      if (pTrap == NULL)
	continue;
      if (pTrap->on_obj)
	sendf(ch, "You've set %s on %s [%d]\n\r", 
	      pTrap->name,
	      pTrap->on_obj->short_descr,
	      pTrap->duration);
      else if (pTrap->on_exit)
	sendf(ch, "You've set %s on path leading to %s [%d]\n\r",
	      pTrap->name,
	      pTrap->on_exit->to_room ? pTrap->on_exit->to_room->name : "error",
	      pTrap->duration);
      else
	sendf(ch, "You've set a trap but something is wrong. ");
    }
    if (IS_SET(ch->comm,COMM_SHOW_AFFECTS))
        send_to_char( "\n\r", ch);
    else
	do_affects(ch, "");
}

void show_affects(CHAR_DATA* ch, CHAR_DATA* victim ){
  AFFECT_DATA *paf, *paf_last = NULL;
  char buf[MSL];
  bool fAffected = FALSE;
  
//Check if there is anythhing to show.
  if ( victim->affected != NULL || victim->affected2 != NULL)
    {
      for ( paf = victim->affected; paf != NULL; paf = paf->next )
	if (paf->where != TO_NONE)
	  {fAffected = TRUE;break;}
      if(!fAffected)
	for ( paf = victim->affected2; paf != NULL; paf = paf->next )
	    if (paf->where != TO_NONE)
	      {fAffected = TRUE;break;}
    }//end show check.
  
  if (fAffected)
    {
      if (ch == victim)
	send_to_char( "You are affected by the followin

Showing the first 100 KB of 170.8 KB. Download the archive for the full file.

Site Stats

Snippets: 1791
Codebases: 571