cotn25/area/
cotn25/src/
 /***************************************************************************
 *  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 Merc Diku Mud, you must comply with   *
 *  both the original Diku license in 'license.doc' as well the Merc       *
 *  license in 'license.txt'.  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.                                                  *
 ***************************************************************************/

#if defined(macintosh)
#include<types.h>
#else
#include <sys/types.h>
#endif
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "merc.h"

/* for  keeping track of the player count */
int max_on = 0;
int maxon1 = 0;

void sync_stats(void);


// HAHAHA -Xrak my who messages :)

void do_setxrakwho(CHAR_DATA *ch, char *argument) 
{  
  char buf[MAX_STRING_LENGTH];
   
  if (IS_NPC(ch)) return;
  smash_tilde(argument);
  sprintf(buf,"#n");
  strcpy(buf,argument);
  SET_BIT(ch->pcdata->jflags, JFLAG_XRAKWHO);
  free_string(ch->pcdata->xrakwho);
  ch->pcdata->xrakwho = str_dup(wordwrapchange(argument));
  send_to_char("done.\n\r",ch);
  return;
}    


void do_who(CHAR_DATA *ch, char *argument)
{
  DESCRIPTOR_DATA *d;
  CHAR_DATA *wch;
  CHAR_DATA *victim;
  char relrank[MSL];
  char sexbuf[MSL];
  char arg[MAX_INPUT_LENGTH];
  char pkratio[MAX_STRING_LENGTH];
  char kav[MAX_STRING_LENGTH];
  char faith[MAX_STRING_LENGTH];
  char god[MAX_STRING_LENGTH];
  char openb[20];
  char closeb[20];
  int b, c, a;
  int count;
  char buf[MAX_STRING_LENGTH]; // banners
  char buf1[MAX_STRING_LENGTH]; // Admin.
  char buf2[MAX_STRING_LENGTH];
  char buf3[MAX_STRING_LENGTH];
  char buf4[MAX_STRING_LENGTH];
  char buf5[MAX_STRING_LENGTH];
  char buf6[MAX_STRING_LENGTH];
  char buf7[MAX_STRING_LENGTH];
  char buf8[MAX_STRING_LENGTH]; // avatars : buf2 - buf16
  char buf9[MAX_STRING_LENGTH];
  char buf10[MAX_STRING_LENGTH];
  char buf11[MAX_STRING_LENGTH];
  char buf12[MAX_STRING_LENGTH];
  char buf13[MAX_STRING_LENGTH];
  char buf14[MAX_STRING_LENGTH];
  char buf15[MAX_STRING_LENGTH];
  char buf16[MAX_STRING_LENGTH];
  char buf17[MAX_STRING_LENGTH]; // mortals.
  char buf18[MAX_STRING_LENGTH];
  char buf19[MAX_STRING_LENGTH];
  int nPlayerAll = 0;
  int nPlayerVis = 0;
  int nImmVis = 0;
  int mightRate;
  int i, x, v;
  bool rangeOnly = FALSE;
  bool canDecap;
  bool canKillYou;
  bool avatars = FALSE;
  bool a1 = FALSE;
  bool a2 = FALSE;
  bool a3 = FALSE;
  bool a4 = FALSE;
  bool a5 = FALSE;
  bool a6 = FALSE;
  bool a7 = FALSE;
  bool a8 = FALSE;
  bool a9 = FALSE;
  bool a10 = FALSE;
  bool a11 = FALSE;
  bool a12 = FALSE;
  bool a13 = FALSE;
  bool a14 = FALSE;
  bool a15 = FALSE;
  bool a16 = FALSE;
  bool a17 = FALSE;

  if (IS_NPC(ch)) return;

  one_argument(argument, arg);

  if (!str_cmp(arg, "kill")) rangeOnly = TRUE;

  buf1[0] = '\0';
  buf2[0] = '\0';
  buf3[0] = '\0';
  buf4[0] = '\0';
  buf5[0] = '\0';
  buf6[0] = '\0';
  buf7[0] = '\0';
  buf8[0] = '\0';
  buf9[0] = '\0';
  buf10[0] = '\0';
  buf11[0] = '\0';
  buf12[0] = '\0';   
  buf13[0] = '\0';
  buf14[0] = '\0';
  buf15[0] = '\0';
  buf16[0] = '\0';
  buf17[0] = '\0';

//    do_save( ch, " " );
//    save_char_obj_backup( ch );
//    save_char_obj( ch );
//    save_char_obj( wch );
//    save_char_obj_backup( wch );
  
  for (d = descriptor_list; d != NULL; d = d->next)
  {
    char const *title;
    
    if (d->connected != CON_PLAYING) continue;
    if ((wch = d->character) == NULL) continue;

    /*
     * Immortals are not players, and should not be counted as such.
     */
    if (wch->level < 7) nPlayerAll++;
    count++;


    /*
     * Visibility :-)
     */
    if (!can_see(ch, wch)) continue;

    if (wch->level < 7) nPlayerVis++;
    else nImmVis++;

    /*
     * The playerkill range is decided
     */
    if (!str_cmp(ch->pcdata->last_decap[0], wch->name)) canDecap = FALSE;
    else canDecap = fair_fight(ch, wch);
    if (!str_cmp(wch->pcdata->last_decap[0], ch->name)) canKillYou = FALSE;
    else canKillYou = fair_fight(wch, ch);

    if (rangeOnly && !canDecap) continue;
   
     if ( wch->sex == 1 )
    {
    sprintf (sexbuf, "Male");
    }
    if ( wch->sex == 2 )
    {
    sprintf (sexbuf, "Female");
    }
    if ( wch->fight_timer > 0 )
    {
    sprintf (sexbuf, "#n[#YF#yT#n] ");
    }
    /*
     * Let's calculate the pkratio and the color of the symbols for players to be guided by.
     */

    if (!IS_SET(wch->immune, IMM_HYBRID))
    {
	sprintf(pkratio,"#7[#n%2d#7]#n",wch->pStatus);
    }
    else
    {
        sprintf(pkratio,"#7[#n%2d#7]#n",wch->pStatus);
    }

    /*
     * Now let's parse the title.
     */

    mightRate = getMight(wch);
    count = 0;
    
    if ((IS_HEAD(wch,LOST_HEAD) || IS_EXTRA(wch,EXTRA_OSWITCH)) && wch->pcdata->chobj != NULL)
    {
      if (wch->pcdata->chobj->pIndexData->vnum == 12) title = " #CA Head#n     #n ";
      else if (wch->pcdata->chobj->pIndexData->vnum == 30005) title = " #CA Brain#n     ";
      else title = " #RAn Object#n       ";
    }
    else
    {
      switch (wch->level )
      {
        default:
          title = " ";
          break;
        case MAX_LEVEL:
        case MAX_LEVEL - 1:
        case MAX_LEVEL - 2:
        case MAX_LEVEL - 3:
        case MAX_LEVEL - 4:
        case MAX_LEVEL - 5:
          if (IS_EXTRA(wch, EXTRA_AFK)) title = " #C*#0***A#CF#0K***#C*#n ";
          else if (IS_SET(wch->newbits2, NEW2_CODING)) title = "#r-#0[#rCODING#0]#r-#n     ";
          else if (wch->prefix != NULL && strlen(wch->prefix) > 1 && str_cmp(wch->prefix,"off")) title = wch->prefix;
          else if (!str_cmp(wch->pcdata->switchname, "Xrakisis")) title = "#G(#C=-#gOWNER#C-=#G)#n";
          else if (!str_cmp(wch->pcdata->switchname, "Sneak")) title = "#G(#C=-#PGoat#C-=#G)#n";
          else if (!str_cmp(wch->pcdata->switchname, "Drexx")) title = "#LC#7oder#n";
          else if (!str_cmp(wch->pcdata->switchname, "Akurei")) title = "#G(#C=-#rCoder#C-=#G)#n";
          else if (!str_cmp(wch->pcdata->switchname, "Anubis")) title = "#R|#0)-#RD#remo#Rn #rW#Rarlor#rd#0-(#R|#n";   
	  else if (!str_cmp(wch->pcdata->switchname, "Kaname")) title = "#y<#G(#L=- #RB#rloo#Rd #7Pr#0in#7ce #L-=#G)#y>#n";
          else title = "#Y>>>#0GoD#Y<<<#n";
          break;
        case MAX_LEVEL - 6:
        case MAX_LEVEL - 7:
        case MAX_LEVEL - 8:
        case MAX_LEVEL - 9:
          if (IS_EXTRA(wch, EXTRA_AFK)) title = "  #C*#0***A#CF#0K***#C*#n   ";
          else if (IS_SET(wch->act, PLR_SILENCE)) title = "  #LSI#7LENC#LED#n      ";

				else if (IS_RACE(wch, RACE_HUMAN))
					title = "  #0Human#n         ";
                                else if (IS_RACE(wch, RACE_ELF))
                                        title = "High Elf";
                                else if (IS_RACE(wch, RACE_GNOME))
                                        title = "Gnome";
                                else if (IS_RACE(wch, RACE_GULLYDWARF))
                                        title = "Gully Dwarf";
                                else if (IS_RACE(wch, RACE_HILLDWARF))
                                        title = "Hill Dwarf";
                                else if (IS_RACE(wch, RACE_MTDWARF))
                                        title = "Mountain Dwarf";
                                else if (IS_RACE(wch, RACE_DRAGONKIND))
                                        title = "DragonKind";
                                else if (IS_RACE(wch, RACE_HOBBIT))
                                        title = "Hobbit";
                                else if (IS_RACE(wch, RACE_KENDER))
                                        title = "Kender";
                                else if (IS_RACE(wch, RACE_DROW))
                                        title = "Drow";
                                else if (IS_RACE(wch, RACE_GIANT))
                                        title = "Giant";
                                else if (IS_RACE(wch, RACE_HALFELF))
                                        title = "Half Elf";
                                else if (IS_RACE(wch, RACE_OGRE))
                                        title = "Ogre";
                                else if (IS_RACE(wch, RACE_HALFOGRE))
                                        title = "Half Ogre";
                                else if (IS_RACE(wch, RACE_MINOTAUR))
                                        title = "Minotaur";
                                else if (IS_RACE(wch, RACE_GOBLIN))
                                        title = "Goblin";
                                else if (IS_RACE(wch, RACE_HOBGOBLIN))
                                        title = "HobGoblin";
                                else if (IS_RACE(wch, RACE_DUERGARDWARF))
                                        title = "Duergar";
                                else if (IS_RACE(wch, RACE_TROLL))
                                        title = "Troll";
                                else if (IS_RACE(wch, RACE_HALFTROLL))
                                        title = "Half Troll";
                                else if (IS_RACE(wch, RACE_ORC))
                                        title = "Orc";
                                else if (IS_RACE(wch, RACE_HALFORC))
                                        title = "Half Orc";
                                else if (IS_RACE(wch, RACE_CENTAUR))
                                        title = "Centaur";
                                else if (IS_RACE(wch, RACE_WILDELF))
                                        title = "Wild Elf";
                                else if (IS_RACE(wch, RACE_ARCHDEMON))
                                        title = "Arch-Demon";
                                else if (IS_RACE(wch, RACE_ARCHANGEL))
                                        title = "Arch-Angel";
				else 
					title = "#Gnone#n";
                                break;
         break;
         case MAX_LEVEL - 10:
          title = " #YM#yortal#n         ";
          break;
        case MAX_LEVEL - 11:
          title = " #YN#yewbie#n         ";
          break;
        case MAX_LEVEL - 12:
          title = " #YU#yndefined#n      ";
          break;
      }   
    }  
       

    /* I'm aware it says faith, but I was just to lazy to change it to kingdom - Jobo */
//    if (wch->pcdata->kingdom >= 1 && wch->pcdata->kingdom <= MAX_KINGDOM)
    	if (!IS_NPC(ch))
    	{
	if (wch->pcdata->kingdom == 1)
        sprintf(faith, "of #YR#yu#7le#yr#Ys#n");
  	else if (wch->pcdata->kingdom == 2)
       	sprintf(faith, "of #BF#bo#nr#7sa#nk#be#Bn#n");
       	else if (wch->pcdata->kingdom == 3)
       	sprintf(faith, "of #RS#ry#yn#Yd#7i#Yc#ya#rt#Re#n");
       	else if (wch->pcdata->kingdom == 4)
       	sprintf(faith, "of #LI#ln#7v#la#Ld#7e#Lr#n");
       	else if (wch->pcdata->kingdom == 5)
       	sprintf(faith, "of #RR#ri#7s#Ye #Rof #RE#rv#Ri#rl#n");
       	else if (wch->pcdata->kingdom == 6)
       	sprintf(faith, "of #rN#Ro#7s#Yf#ye#rr#Ra#7t#Yu#n");
       	else
       	sprintf(faith, "");
	}

	if (!IS_NPC(ch))
	{
	if (wch->relrank == 0 && wch->god == 0)
	sprintf(relrank, "#R[      ]#n");
	if (wch->relrank == 0 && wch->god != 0)
	sprintf(relrank, "#R[#YM#yE#RM#yB#RE#rR#R]");
	if (wch->relrank == 1 && wch->god != 0)
	sprintf(relrank, "#R[#YJUNIOR#R]#n");
	if (wch->relrank == 2 && wch->god != 0)
	sprintf(relrank, "#R[#LSENIOR#R]#n");
	if (wch->relrank == 3 && wch->god != 0)
	sprintf(relrank, "#R[#0DEPUTY#R]#n");
	if (wch->relrank == 4 && wch->god != 0)
	sprintf(relrank, "#R[#YSECOND#R]#n");
	if (wch->relrank == 5 && wch->god != 0)
	sprintf(relrank, "#R[#7CHOSEN#R]#n");
	}

	if (!IS_NPC(ch))
	{
	if (wch->god == 0) sprintf(god,"Athiest");
	if (wch->god == 1) sprintf(god,"Astinus");
	if (wch->god ==2) sprintf(god,"Chemosh");
	if (wch->god ==3) sprintf(god,"Hiddukel");
	if (wch->god ==4) sprintf(god,"Nuitari");
	if (wch->god ==5) sprintf(god,"Sargonnas");
	if (wch->god ==6) sprintf(god,"Zeboim");
	if (wch->god ==7) sprintf(god,"Branchala");
	if (wch->god ==8) sprintf(god,"Habbakuk");
	if (wch->god ==9) sprintf(god,"Kiri-Jolith");
	if (wch->god ==10) sprintf(god,"Majere");
	if (wch->god ==11) sprintf(god,"Mishakal");
	if (wch->god ==12) sprintf(god,"Solinari");
	if (wch->god ==13) sprintf(god,"Chislev");
	if (wch->god ==14) sprintf(god,"Gilean");
	if (wch->god ==15) sprintf(god,"Lunitari");
	if (wch->god ==16) sprintf(god,"Reorx");
	if (wch->god ==17) sprintf(god,"Shinare");
	if (wch->god ==18) sprintf(god,"Sirrion");
	if (wch->god ==19) sprintf(god,"Zivilyn");
	if (wch->god ==20) sprintf(god,"Takhisis");
	if (wch->god ==21) sprintf(god,"Paladine");
	}

    max_on = UMAX ( count, max_on );

    if ( count > max_ever )
    {
        sync_stats (  );
    }


      if (wch->class == CLASS_DEMON)        sprintf(kav,"Demon");
	if (wch->class == CLASS_WEREWOLF)     sprintf(kav,"Werewolf");
	if (wch->class == CLASS_VAMPIRE)      sprintf(kav,"Vampire");
	if (wch->class == CLASS_DROW)         sprintf(kav,"Drow");
	if (wch->class == CLASS_TANARRI)      sprintf(kav,"Tanarri");
	if (wch->class == CLASS_ANGEL)        sprintf(kav,"Angel");
	if (wch->class == CLASS_UNDEAD_KNIGHT) sprintf(kav,"Undead Knight");
	if (wch->class == CLASS_ASSASSIN)     sprintf(kav,"Assassin");
	if (wch->class == CLASS_WRAITH)       sprintf(kav,"Wraith");
	if (wch->class == CLASS_ELEMENTAL)    sprintf(kav,"Elemental");
	if (wch->class == CLASS_PALADIN)      sprintf(kav,"Paladin");
	if (wch->class == CLASS_HUMAN)        sprintf(kav,"Technomage");
	if (wch->class == CLASS_SHINOBI)      sprintf(kav,"Shinobi");
	if (wch->class == CLASS_HYDRA)        sprintf(kav,"Hydra");
	if (wch->class == CLASS_SKYBLADE)     sprintf(kav,"Skyblade");
	if (wch->class == CLASS_GIANT)        sprintf(kav,"Giant");
	if (wch->class == CLASS_DRAGON)       sprintf(kav,"Dragon");
	if (wch->class == CLASS_ANTIPALADIN)  sprintf(kav,"Anti-Paladin");
	if (wch->class == CLASS_ZOMBIE)       sprintf(kav,"Zombie");
	if (wch->class == CLASS_BLADE_MASTER) sprintf(kav,"Blade Master");
	if (wch->class == CLASS_PRIEST)       sprintf(kav,"Priest");
	if (wch->class == CLASS_UNDEAD_LYCAN) sprintf(kav, "Undead Lycan");
	if (wch->class == CLASS_HELLS_SOLDIER)sprintf(kav, "Hells Soldier");
	if (wch->class == CLASS_GAIA_WOLF)    sprintf(kav, "Gaia Wolf");
	if (wch->class == CLASS_SHADOWBORN)   sprintf(kav, "Shadowborn");
	if (wch->class == CLASS_DRUID)        sprintf(kav, "Druid");
	if (wch->class == CLASS_SHADOW_DRAGON)sprintf(kav, "Shadow Dragon");
	if (wch->class == CLASS_SHADOW_FIEND) sprintf(kav, "Shadow Fiend");
	if (wch->class == CLASS_STALKER)      sprintf(kav, "Stalker");
	if (wch->class == CLASS_HELL_SPAWN)   sprintf(kav, "Hell Spawn");
	if (wch->class == CLASS_BLACK_ASSASSIN) sprintf(kav, "Black Assassin");
	if (wch->class == CLASS_VAMPIRIC_MIST)  sprintf(kav, "Vampiric Mist");
	if (wch->class == CLASS_GHOUL)         sprintf(kav,"Ghoul");
  if (wch->class == CLASS_SILVER_DRAGON) sprintf(kav,"Silver Dragon");
  if (wch->class == CLASS_GOLD_DRAGON) sprintf(kav,"Gold Dragon");


	if (wch->class == 0)		sprintf(kav, "none");


    /* 
     * Let's figure out where to place the player.
     */
        
    if (wch->level > 6 )
    {
      sprintf(buf1 + strlen(buf1), " %37s   %s\n\r", wch->pcdata->switchname, title);
      a1 = TRUE;
    }
    else if (wch->level >= 3 && wch->level <= 6)
    {
      if (mightRate > 3500)
      {
        sprintf(buf2 + strlen(buf2), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith ,god);
        a2 = TRUE; avatars = TRUE;
      }
      else if (mightRate > 3250)
      {
        sprintf(buf3 + strlen(buf3), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith, god);
        a3 = TRUE; avatars = TRUE;
      }
      else if (mightRate > 3000)
      {
        sprintf(buf4 + strlen(buf4), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith, god);
        a4 = TRUE; avatars = TRUE;
      }
      else if (mightRate > 2750)
      {
        sprintf(buf5 + strlen(buf5), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith, god);
        a5 = TRUE; avatars = TRUE;
      }
      else if (mightRate > 2500)
      {
        sprintf(buf6 + strlen(buf6), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith, god);
        a6 = TRUE; avatars = TRUE;
      }
      else if (mightRate > 2250)
      {
        sprintf(buf7 + strlen(buf7), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith, god);
        a7 = TRUE; avatars = TRUE;
      }
      else if (mightRate > 2000)
      {
        sprintf(buf8 + strlen(buf8), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",   
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith, god);
        a8 = TRUE; avatars = TRUE;
      }
      else if (mightRate > 1750)
      {
        sprintf(buf9 + strlen(buf9), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith, god);
        a9 = TRUE; avatars = TRUE;
      }
      else if (mightRate > 1500)
      {
        sprintf(buf10 + strlen(buf10), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith, god);
        a10 = TRUE; avatars = TRUE;
      }
      else if (mightRate > 1250)
      {
        sprintf(buf11 + strlen(buf11), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith, god);
        a11 = TRUE; avatars = TRUE;
      }
      else if (mightRate > 1000)
      {
        sprintf(buf12 + strlen(buf12), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith, god);
        a12 = TRUE; avatars = TRUE;
      }
      else if (mightRate > 750)
      {
        sprintf(buf13 + strlen(buf13), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith, god);
        a13 = TRUE; avatars = TRUE;
      }
      else if (mightRate > 500)
      {
        sprintf(buf14 + strlen(buf14), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith, god);
        a14 = TRUE; avatars = TRUE;
      }
      else if (mightRate >= 150)   
      {
        sprintf(buf15 + strlen(buf15), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith, god);
        a15 = TRUE; avatars = TRUE;
      }
      else
      {
        sprintf(buf16 + strlen(buf16), " %-6s #7%s #0the %s #G%s#0 #R%s#0 %s worships %s\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title, kav, faith, god);
        a16 = TRUE; avatars = TRUE;
      }
    }
    else if (wch->level < 3)
    {
      sprintf(buf17 + strlen(buf17), " %-6s #7%s #0the %s #G%s#0\n\r",
        pkratio, wch->pcdata->switchname, sexbuf, title);
      a17 = TRUE;
    }
  }

  /*   
   * Let's send the whole thing to the player.
   */

//    switch(number_range(1,4))
//      {
//    case 1:
     

//    sprintf(buf, "\n\r #R(*)*********************(**)= #rKinder von der Nacht#R =(**)*********************(*)#n\n\r");
//    send_to_char(buf, ch);
//
//    sprintf(buf, "\n\r #R(*)*********************(**)= #rXraks Message#R =(**)*********************(*)#n\n\r");
//    send_to_char(buf, ch);
    
//    if(!IS_NPC(ch)){
//    sprintf(buf, "%s\n\r",ch->pcdata->xrakwho); 
//      send_to_char(NULL,buf); 


//}


// if (wch->xrakwho != NULL && strlen(wch->xrakwho) > 1) 
//{
//	sprintf(buf, "%s\n\r",ch->xrakwho); 
//      send_to_char(buf, ch);
//
//}

// if (wch->xrakwho == NULL && strlen(wch->xrakwho) == 1) 
//{
//         stc( "#gHRM\n\r", ch);
//
//}

// else (wch->xrakwho == NULL)
//   return;


char *wordwrapchange(char *word)
{
  char newword[MAX_STRING_LENGTH];
  char newword2[MAX_STRING_LENGTH];
  int i = 0, x = 0, n = 0, v = 0;
  // i = original word position
  // x = newword position
  // n = spacer
  // v = letter count

  for ( i = 0; i < strlen(word); i++ )
  {
    if ( word[i] == ' ' && v > 500 )
    {
      v = 0;
      newword[x++] = '\n';
      for ( n = 0; n < 29; n++ ) { newword[x++] = ' '; }
    }
    newword[x++] = word[i];
    v++;
  }
  newword[x++] = '\0';
  strcpy(newword2,newword);
  return str_dup(newword2);
}


    
    mxp_to_char(ch, "#7X#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#7X#n      <U><I><B>#7Ch#ni#0ld#nr#7en #Co#cf #Ct#ch#Ce #7N#ni#0g#nh#7t</B></U></I>         #7X#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#7X#n#n\n\r", MXP_ALL); 
// mxp_to_char(ch, "<U><B>This is underlined bold text</B></U>\n\r", MXP_ALL);
//    send_to_char(buf, ch);


    if (a1)
    {
    sprintf(buf, "#7X#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#7X#n                #YS#ytaff               #7X#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#7X#n#n\n\r"); 



    send_to_char(buf, ch);
    send_to_char(buf1, ch);
  }         
  if (avatars)
  {
//    sprintf(buf, "\n\r #g*>=<*>=<*>=<*>=<*>=<*>=<*>=<*>=<*><>     #gAvatars     #g<><*>=<*>=<*>=<*>=<*>=<*>=<*>=<*>=<*>#n\n\r");
    sprintf(buf, "#7X#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#7X#n                #YA#yvatars             #7X#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#7X#n\n\r"); 


    send_to_char(buf, ch);
    if (a2) send_to_char(buf2, ch);
    if (a3) send_to_char(buf3, ch);
    if (a4) send_to_char(buf4, ch);
    if (a5) send_to_char(buf5, ch);
    if (a6) send_to_char(buf6, ch);
    if (a7) send_to_char(buf7, ch);
    if (a8) send_to_char(buf8, ch);
    if (a9) send_to_char(buf9, ch);
    if (a10) send_to_char(buf10, ch);
    if (a11) send_to_char(buf11, ch);
    if (a12) send_to_char(buf12, ch);
    if (a13) send_to_char(buf13, ch);
    if (a14) send_to_char(buf14, ch);
    if (a15) send_to_char(buf15, ch);
    if (a16) send_to_char(buf16, ch);
  }
  if (a17)
  {
//    sprintf(buf, "\n\r #R<*>=<*>=<*>=<*>=<*>=<*>=<*>=<*>=<*><>     #gMortals     #R<><*>=<*>=<*>=<*>=<*>=<*>=<*>=<*>=<*>#n\n\r");
//    sprintf(buf, "#4    -   -  - - -#6- ---===#7            #gMortals             #6===--- -#4- - -  -   -#n\n\r"); 
    sprintf(buf, "#7X#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#7X                #YM#yortals             #7X#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#7X#n\n\r");

    send_to_char(buf, ch);
    send_to_char(buf17, ch);
  }
    sprintf(buf, "#7X#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#7X                #YM#yud #YI#ynfo            #7X#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#7X#n\n\r");
  send_to_char(buf, ch);
  send_to_char("\n\r",ch);
  sprintf(buf, "   #7%d#n/#7%d #YV#yisible #Yp#ylayers #Ya#ynd #7%d #Yv#yisible #Yi#ymmortals #Yc#yonnected #Yt#yo#n  #7Ch#ni#0ld#nr#7en #Co#cf #Ct#ch#Ce #7N#ni#0g#nh#7t#n\n\r",
    nPlayerVis, nPlayerAll, nImmVis);
  send_to_char(buf, ch);
  a = mudinfo[MUDINFO_UPDATED] / 120;
  b = a / 24;
  c = a - b * 24;
  sprintf(buf, "    #n[#YT#yhe #YS#ytatistics #YB#yelow #YR#yeset#n:#7 %d #Yd#yays #Ya#ynd #7%d #Yh#yours #Ya#ygo#n]#n\n\r",b,c);
  send_to_char(buf, ch);

  sprintf(buf, "    #n[#YA#yverage #YO#ynline#n:#7 %d#n][#YP#yeak #YO#ynline#n:#7 %d#n][#YP#yeak #YO#ynline #YS#yince #YA#yug #Y3#yrd, #Y2010#n:#7 %d#n]#n\n\r",
  (mudinfo[MUDINFO_MCCP_USERS] + mudinfo[MUDINFO_OTHER_USERS]) / mudinfo[MUDINFO_UPDATED],
  mudinfo[MUDINFO_PEAK_USERS], max_ever);
  send_to_char(buf, ch);


// New stuff starts here -Xrak
  a = mudinfo[MUDINFO_MBYTE] * 1024 + mudinfo[MUDINFO_BYTE] / 1024;
  b = a / (mudinfo[MUDINFO_UPDATED] * 3);
  c = b / 10;
  c = c * 10;
  c = b - c;
  sprintf(buf, "    #n[#YP#ylayers #YS#yince #YM#yarch#7 29 2005#n:#7 %d#n][#YD#yatatransfer #n:#Y A#yverage #YR#yate#c: #n%d.%d #Yk#yb/#Ys#yec#n]\n\r",
  top_playerid, b / 10, c);
  send_to_char(buf, ch);
  b = mudinfo[MUDINFO_DATA_PEAK] / (3 * 1024);
  c = b / 10;
  c = c * 10;
  c = b - c;
  sprintf(buf, "    #n[#YD#yata #YT#yransfers#n]#R:#n [#YP#yeak #YR#yate#7: %d.%d #Yk#yb/#Ys#yec#n][#YT#yhis #YR#yeboot#n:#7 %dMB#n][#YT#yhis #YW#yeek#n:#7 %dMB#n]#n\n\r",
  b / 10, c, mudinfo[MUDINFO_MBYTE_S], mudinfo[MUDINFO_MBYTE] );

  send_to_char(buf, ch);
// The comment used to end here -xrak

/*   maxon1 += nPlayerVis;
  maxon1 += nPlayerAll;
  maxon1 += nImmVis;
  max_on = UMAX ( maxon1, max_on );

  max_on = maxon1;

    if ( max_on > max_ever )
    {
        sync_stats (  );
    }
*/

  send_to_char("\n\r",ch);
   sprintf(buf, "#7X#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#7X       #7Ch#ni#0ld#nr#7en #Co#cf #Ct#ch#Ce #7N#ni#0g#nh#7t#n        #7X#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#R=#r=#7X#n\n\r");
  send_to_char(buf, ch);
  return;
}