[comp.sources.games] v02i072: umoria - single player dungeon simulation, Part07/16

games-request@tekred.TEK.COM (11/05/87)

Submitted by: "James E. Wilson" <wilson@ji.berkeley.edu>
Comp.sources.games: Volume 2, Issue 72
Archive-name: umoria/Part07




#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 7 (of 16)."
# Contents:  death.c variables.c
# Wrapped by billr@tekred on Wed Nov  4 09:59:51 1987
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f death.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"death.c\"
else
echo shar: Extracting \"death.c\" \(10967 characters\)
sed "s/^X//" >death.c <<'END_OF_death.c'
X#include <stdio.h>
X#ifdef USG
X#include <string.h>
X#include <fcntl.h>
X#else
X#include <strings.h>
X#endif
X#include <pwd.h>
X#include <time.h>
X#include <ctype.h>
X#include <sys/types.h>
X#include <sys/file.h>
X
X#include "config.h"
X#include "constants.h"
X#include "types.h"
X#include "externs.h"
X#define MIN(a, b)	((a < b) ? a : b)
X
X#ifdef sun   /* correct SUN stupidity in the stdio.h file */
Xchar *sprintf();
X#endif
X
X#if defined(ultrix) || defined(sun) || defined(USG)
Xint getuid();
X#else
Xuid_t getuid();
X#endif
X
X#if defined(sun) || defined(USG) || defined(ultrix)
Xlong lseek();
X#else
Xoff_t lseek();
X#endif
X#ifdef USG
X#define L_SET 0
X#endif
X
X#if defined(ultrix) || defined(USG)
Xvoid perror();
Xvoid exit();
X#endif
X
X#ifdef USG
Xstruct passwd *getpwuid();
X#endif
X
Xchar *getlogin();
Xlong time();
X
Xdate(day)
Xchar *day;
X{
X  char *tmp;
X  long clock;
X
X  clock = time((long *) 0);
X  tmp = ctime(&clock);
X  tmp[11] = '\0';
X  (void) strcpy(day, tmp);
X}
X
X/* Centers a string within a 31 character string		-JWT-	 */
Xchar *fill_str(p1)
Xchar *p1;
X{
X  vtype s1, s2;
X  int i;
X
X  s1[0] = '\0';
X  s2[0] = '\0';
X  i = (strlen(p1) / 2);
X  (void) strcpy(s1, pad(s2, " ", 15 - i));
X  (void) strcat(s1, pad(p1, " ", 31));
X  s1[31] = '\0';
X  return (s1);
X}
X
X
X/* Prints a line to the screen efficiently		-RAK-	 */
Xdprint(str, row)
Xchar *str;
Xint row;
X{
X  int i, j, nblanks, xpos;
X  vtype prt_str;
X  char tmp_str[2];
X
X  tmp_str[1] = '\0';	/* yes, this is supposed to be a one */
X  prt_str[0] = '\0';
X  nblanks = 0;
X  xpos = 0;
X  for (i = 0; i < strlen(str); i++)
X    {
X      if (str[i] == ' ')
X	{
X	  if (xpos >= 0) 
X	    {
X	      nblanks++;
X	      if (nblanks > 5) 
X		{
X		  nblanks = 0;
X		  put_buffer(prt_str, row, xpos);
X		  prt_str[0] = '\0';
X		  xpos = -1;
X		}
X	    }
X	}
X      else 
X	{
X	  if (xpos == -1)
X	    xpos = i;
X	  if (nblanks > 0) 
X	    {
X	      for (j = 0; j < nblanks; j++)
X		(void) strcat(prt_str, " ");
X	      nblanks = 0;
X	    }
X	  tmp_str[0] = str[i];
X	  (void) strcat(prt_str, tmp_str);
X	}
X    }
X  if (xpos > 0)
X    put_buffer(prt_str, row, xpos);
X}
X
Xdisplay_scores()
X{
X  register int i = 0, j;
X  int fd;
X  high_scores score;
X  char list[20][256];
X
X  if (1 > (fd = open(MORIA_TOP, O_RDONLY, 0644)))
X    {
X      prt("Error opening top twenty file\n", 0, 0);
X      return ;
X    }
X
X  while (0 < read(fd, (char *)&score, sizeof(high_scores)))
X    {
X      (void) sprintf(list[i], "%-7d%-15.15s%-10.10s%-10.10s%-5d%-25.25s%5d", 
X		    (int)score.points, score.name,
X		    race[score.prace].trace, class[score.pclass].title, 
X		    (int)score.lev, score.died_from, score.dun_level);
X      i++;
X    }
X
X  controlz();
X  put_buffer("Points Name           Race      Class     Lv   Killed By                Dun Lv", 0, 0);
X  for (j = 0; j < i; j++)
X    put_buffer(list[j], j + 1, 0);
X  put_buffer("", j + 1, 0);
X  put_qio();
X  pause_line(23);
X}
X
X/* Prints the gravestone of the character		-RAK-	 */
Xprint_tomb()
X{
X  vtype str1, str2, str3, str4, str5, str6, str7, str8;
X  vtype dstr[20];
X  vtype fnam;
X  char command;
X  FILE *f1;
X  int i;
X  char day[11];
X  int flag;
X  char tmp_str[80];
X
X  date(day);
X  (void) strcpy(str1, fill_str(py.misc.name));
X  (void) strcpy(str2, fill_str(py.misc.title));
X  (void) strcpy(str3, fill_str(py.misc.tclass));
X  (void) sprintf(str4, "Level : %d", (int)py.misc.lev);
X  (void) strcpy(str4, fill_str(str4));
X  (void) sprintf(str5, "%d Exp", py.misc.exp);
X  (void) strcpy(str5, fill_str(str5));
X  (void) sprintf(str6, "%d Au", py.misc.au);
X  (void) strcpy(str6, fill_str(str6));
X  (void) sprintf(str7, "Died on Level : %d", dun_level);
X  (void) strcpy(str7, fill_str(str7));
X  (void) strcpy(str8, fill_str(died_from));
X  (void) strcpy(dstr[0], " ");
X  (void) strcpy(dstr[1], "               _______________________");
X  (void) strcpy(dstr[2], "              /                       \\         ___");
X  (void) strcpy(dstr[3],
X		"             /                         \\ ___   /   \\      ___");
X  (void) strcpy(dstr[4],
X		"            /            RIP            \\   \\  :   :     /   \\");
X  (void) strcpy(dstr[5],
X		"           /                             \\  : _;,,,;_    :   :");
X  (void) sprintf(dstr[6], "          /%s\\,;_          _;,,,;_", str1);
X  (void) strcpy(dstr[7], "         |               the               |   ___");
X  (void) sprintf(dstr[8], "         | %s |  /   \\", str2);
X  (void) strcpy(dstr[9], "         |                                 |  :   :");
X  (void) sprintf(dstr[10], "         | %s | _;,,,;_   ____", str3);
X  (void) sprintf(dstr[11], "         | %s |          /    \\", str4);
X  (void) sprintf(dstr[12], "         | %s |          :    :", str5);
X  (void) sprintf(dstr[13], "         | %s |          :    :", str6);
X  (void) sprintf(dstr[14], "         | %s |         _;,,,,;_", str7);
X  (void) strcpy(dstr[15], "         |            killed by            |");
X  (void) sprintf(dstr[16], "         | %s |", str8);
X  (void) sprintf(dstr[17], "         |           %s           |", day);
X  (void) strcpy(dstr[18], "        *|   *     *     *    *   *     *  | *");
X  (void) strcpy(dstr[19],
X		      "________)/\\\\_)_/___(\\/___(//_\\)/_\\//__\\\\(/_|_)_______");
X  clear_screen(0, 0);
X  for (i = 0; i <= 19; i++)
X    dprint(dstr[i], i);
X  flush();
X  if (get_com("Print to file? (Y/N)", &command))
X    switch (command)
X      {
X      case 'y':
X      case 'Y':
X	prt("Enter Filename:", 0, 0);
X	flag = FALSE;
X	do 
X	  {
X	    if (get_string(fnam, 0, 16, 60)) 
X	      {
X		if (strlen(fnam) == 0)
X		  (void) strcpy(fnam, "MORIACHR.DIE");
X		f1 = fopen(fnam, "w");
X		if (f1 == NULL)
X		  {
X		    (void) sprintf(tmp_str, "Error creating> %s", fnam);
X		    prt(tmp_str, 1, 0);
X		  }
X		else 
X		  {
X		    flag = TRUE;
X		    for (i = 0; i <= 19; i++)
X		      (void) fprintf(f1, "%s\n", dstr[i]);
X		  }
X		(void) fclose(f1);
X	      }
X	    else
X	      flag = TRUE;
X	  }
X	while (!flag);
X	break;
X      default:
X	break;
X      }
X}
X
X
X/* Calculates the total number of points earned		-JWT-	 */
Xint total_points()
X{
X  return (py.misc.max_exp + (100 * py.misc.max_lev));
X}
X
X
X/* Enters a players name on the top twenty list		-JWT-	 */
Xtop_twenty()
X{
X  register int i, j, k;
X  high_scores scores[20], myscore;
X  char *tmp;
X
X  if (wizard1)
X    exit_game();
X  clear_screen(0, 0);
X  
X  myscore.points = (long)total_points();
X  myscore.dun_level = dun_level;
X  myscore.lev = py.misc.lev;
X  myscore.max_lev = py.misc.max_lev;
X  myscore.mhp = py.misc.mhp;
X  myscore.chp = py.misc.chp;
X  myscore.uid = getuid();
X  /* First character of sex, lower case */
X  myscore.sex = tolower(py.misc.sex[0]); 
X  myscore.prace = py.misc.prace;
X  myscore.pclass = py.misc.pclass;
X  (void) strcpy(myscore.name, py.misc.name);
X  tmp = died_from;
X  if ('a' == *tmp)
X    {
X      if ('n' == *(++tmp))
X	{
X	  tmp++;
X	}
X      while (isspace(*tmp))
X	{
X	  tmp++;
X	}
X    }
X  (void) strncpy(myscore.died_from, tmp, strlen(tmp) - 1);
X  myscore.died_from[strlen(tmp) - 1] = '\0';
X  /* Get rid of '.' at end of death description */
X  
X  /*  First, get a lock on the high score file so no-one else tries */
X  /*  to write to it while we are using it */
X#ifdef USG
X  /* no flock sytem call, ignore the problem for now */
X#else
X  if (0 != flock(highscore_fd, LOCK_EX)) 
X    {
X      perror("Error gaining lock for score file");
X      exit(1);
X    }
X#endif
X
X  /*  Check to see if this score is a high one and where it goes */
X  i = 0;
X#if defined(sun) || defined(ultrix) || defined(USG)
X  (void) lseek(highscore_fd, (long)0, L_SET);
X#else
X  (void) lseek(highscore_fd, (off_t)0, L_SET);
X#endif
X  while ((i < 20)
X        && (0 != read(highscore_fd, (char *)&scores[i], sizeof(high_scores)))) 
X    {
X      i++;
X    }
X
X  j = 0;
X  while (j < i && (scores[j].points >= myscore.points))
X    {
X      j++;
X    }
X  /* i is now how many scores we have, and j is where we put this score */
X  
X  /* If its the first score, or it gets appended to the file */
X  if (0 == i || (i == j && j < 20))
X    {
X#if defined(sun) || defined(ultrix) || defined(USG)
X      (void) lseek(highscore_fd, (long)(j * sizeof(high_scores)), L_SET);
X#else
X      (void) lseek(highscore_fd, (off_t)(j * sizeof(high_scores)), L_SET);
X#endif
X      (void) write(highscore_fd, (char *)&myscore, sizeof(high_scores));
X    }
X  else if (j < i) 
X    {
X      /* If it gets inserted in the middle */
X      /* Bump all the scores up one place */
X      for (k = MIN(i, 19); k > j ; k--) 
X	{
X#if defined(sun) || defined(ultrix) || defined(USG)
X	  (void) lseek(highscore_fd, (long)(k * sizeof(high_scores)), L_SET);
X#else
X	  (void) lseek(highscore_fd, (off_t)(k * sizeof(high_scores)), L_SET);
X#endif
X	  (void) write(highscore_fd, (char *)&scores[k - 1], sizeof(high_scores));
X	}
X      /* Write out your score */
X#if defined(sun) || defined(ultrix) || defined(USG)
X      (void) lseek(highscore_fd, (long)(j * sizeof(high_scores)), L_SET);
X#else
X      (void) lseek(highscore_fd, (off_t)(j * sizeof(high_scores)), L_SET);
X#endif
X      (void) write(highscore_fd, (char *)&myscore, sizeof(high_scores));
X    }
X  
X#ifdef USG
X  /* no flock sytem call, ignore the problem for now */
X#else
X  (void) flock(highscore_fd, LOCK_UN);
X#endif
X  (void) close(highscore_fd);
X  display_scores();
X}
X
X
X/* Change the player into a King!			-RAK-	 */
Xkingly()
X{
X  struct misc *p_ptr;
X
X  /* Change the character attributes...		 */
X  dun_level = 0;
X  /* need dot on the end to be consistent with creature.c */
X  (void) strcpy(died_from, "Ripe Old Age.");
X  p_ptr = &py.misc;
X  p_ptr->lev += MAX_PLAYER_LEVEL;
X  if (p_ptr->sex[0] == 'M')
X    {
X      (void) strcpy(p_ptr->title, "Magnificent");
X      (void) strcpy(p_ptr->tclass, "*King*");
X    }
X  else 
X    {
X      (void) strcpy(p_ptr->title, "Beautiful");
X      (void) strcpy(p_ptr->tclass, "*Queen*");
X    }
X  p_ptr->au += 250000;
X  p_ptr->max_exp += 5000000;
X  p_ptr->exp = p_ptr->max_exp;
X  
X  /* Let the player know that he did good...	 */
X  clear_screen(0, 0);
X  dprint("                                  #", 1);
X  dprint("                                #####", 2);
X  dprint("                                  #", 3);
X  dprint("                            ,,,  $$$  ,,,", 4);
X  dprint("                        ,,==$   \"$$$$$\"   $==,,", 5);
X  dprint("                      ,$$        $$$        $$,", 6);
X  dprint("                      *>         <*>         <*", 7);
X  dprint("                      $$         $$$         $$", 8);
X  dprint("                      \"$$        $$$        $$\"", 9);
X  dprint("                       \"$$       $$$       $$\"", 10);
X  dprint("                        *#########*#########*", 11);
X  dprint("                        *#########*#########*", 12);
X  dprint("                          Veni, Vidi, Vici!", 15);
X  dprint("                     I came, I saw, I conquered!", 16);
X  dprint("                      All Hail the Mighty King!", 17);
X  flush();
X  pause_line(23);
X}
X
X
X/* Handles the gravestone end top-twenty routines	-RAK-	 */
Xupon_death()
X{
X  /* What happens upon dying...				-RAK-	 */
X  if (total_winner)
X    kingly();
X  print_tomb();
X  top_twenty();
X  exit_game();
X}
END_OF_death.c
if test 10967 -ne `wc -c <death.c`; then
    echo shar: \"death.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f variables.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"variables.c\"
else
echo shar: Extracting \"variables.c\" \(41630 characters\)
sed "s/^X//" >variables.c <<'END_OF_variables.c'
X#include "constants.h"
X#include "types.h"
X
Xint character_generated = 0;    /* don't save score until char gen finished */
Xint highscore_fd;	        /* File descriptor to high score file */
Xint player_max_exp;	        /* Max exp possible    */
Xchar norm_state[STATE_SIZE];	/* normal seed */
Xchar randes_state[STATE_SIZE];	/* For encoding colors */
Xint randes_seed;                /* for restarting randes_state */
Xchar town_state[STATE_SIZE];	/* Seed for town genera*/
Xint town_seed;                  /* for restarting town_seed */
Xint cur_height,cur_width;	/* Cur dungeon size    */
Xint dun_level;	                /* Cur dungeon level   */
Xint missile_ctr = 0;             /* Counter for missiles */
Xint msg_line;	                /* Contains message txt*/
Xint msg_flag;	                /* Set with first msg  */
Xvtype old_msg;	                /* Last message	      */
Xint generate;	                /* Generate next level */
Xint death = FALSE;	        /* True if died	      */
Xvtype died_from;	        /* What killed him     */
Xint find_flag;	                /* Used in MORIA for .(dir) */
Xint reset_flag;	                /* Used in MORIA, do not move creatures  */
Xint stat_column = 0;	        /* Column for stats    */
Xunsigned int print_stat = 0;	/* Flag for stats      */
Xint turn = 0;	                /* Cur turn of game    */
Xint wizard1 = FALSE;	        /* Wizard flag	      */
Xint wizard2 = FALSE;	        /* Wizard flag	      */
X/* keeps track of whether or not line has characters on it */
X/*  avoid unneccesary clearing of lines */
Xint used_line[23] = { FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
X			FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
X			FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE};
Xchar password1[12];
Xchar password2[12];
X
Xint key_bindings;
X
X/* Operating hours for Moria				-RAK-	*/
X/*       X = Open; . = Closed                                   */
Xchar  days[7][80] = { "SUN:XXXXXXXXXXXXXXXXXXXXXXXX",
X		    "MON:XXXXXXXX.........XXXXXXX",
X		    "TUE:XXXXXXXX.........XXXXXXX",
X		    "WED:XXXXXXXX.........XXXXXXX",
X		    "THU:XXXXXXXX.........XXXXXXX",
X		    "FRI:XXXXXXXX.........XXXXXXX",
X		    "SAT:XXXXXXXXXXXXXXXXXXXXXXXX" };
X
Xint closing_flag = 0;	         /* Used for closing   */
X
X/* Bit testing array						*/
Xunsigned int bit_array[32] = {0x00000001, 0x00000002, 0x00000004, 0x00000008,
X				0x00000010, 0x00000020, 0x00000040, 0x00000080,
X				0x00000100, 0x00000200, 0x00000400, 0x00000800,
X				0x00001000, 0x00002000, 0x00004000, 0x00008000,
X				0x00010000, 0x00020000, 0x00040000, 0x00080000,
X				0x00100000, 0x00200000, 0x00400000, 0x00800000,
X				0x01000000, 0x02000000, 0x04000000, 0x08000000,
X   			      0x10000000, 0x20000000, 0x40000000, 0x80000000};
X
X/*  Following are calculated from max dungeon sizes		*/
Xint max_panel_rows,max_panel_cols;
Xint quart_height,quart_width;
Xint panel_row,panel_col;
Xint panel_row_min,panel_row_max;
Xint panel_col_min,panel_col_max;
Xint panel_col_prt,panel_row_prt;
X
X/*  Following are all floor definitions				*/
Xcave_type cave[MAX_HEIGHT][MAX_WIDTH];
X/* Values for floor types					*/
X/* if fval is more than 4 bits then the save file routines must be changed */
Xcave_type blank_floor = { 0, 0, 0, FALSE, FALSE, FALSE, FALSE};
Xfloor_type dopen_floor = {1, TRUE};          /* Dark open floor       */
Xfloor_type lopen_floor = {2, TRUE};          /* Light open floor      */
Xfloor_type corr_floor1 = {4, TRUE};          /* Corridor open floor   */
Xfloor_type corr_floor2 = {5, TRUE};          /* Room junction marker  */
Xfloor_type corr_floor3 = {6, TRUE};          /* Door type floor       */
Xfloor_type corr_floor4 = {7, TRUE};          /* Secret door type floor*/
X/* Floor values 8 and 9 are used in generate             */
Xfloor_type rock_wall1 = {10, FALSE};         /* Granite rock wall     */
Xfloor_type rock_wall2 = {11, FALSE};         /* Magma rock wall       */
Xfloor_type rock_wall3 = {12, FALSE};         /* Quartz rock wall      */
Xfloor_type boundary_wall = {15, FALSE};       /* Indestructible wall   */
X
X/* Following are player variables				*/
X/* Player record is special					*/
Xplayer_type py = {
X  {"", "", "", "", "",
X     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
X     "", "", "", "", ""
X },
X  {0,0,0,0,0,0,0,0,0,0,0,0},
X  {0,0,0,0,0,7500,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
X     FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,
X     FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE}
X };
X
X/* Class titles for different levels				*/
Xbtype player_title[MAX_CLASS][MAX_PLAYER_LEVEL] = {
X	/* Warrior       */
X{"Novice","Veteran(1st)","Veteran(2nd)","Veteran(3rd)","Warrior(1st)",
X"Warrior(2nd)","Warrior(3rd)","Swordsman-1","Swordsman-2","Swordsman-3",
X"Hero","Swashbuckler","Myrmidon","Champion-1","Champion-2","Champion-3",
X"Superhero","Knight","Superior Knt","Gallant Knt","Knt Errant","Keeper",
X"Protector","Defender","Warder","Guardian Knt","Chevalier","Justiciar",
X"Lord (1st)","Lord (2nd)","Lord (3rd)","Lord (4th)","Lord (5th)","Lord (6th)",
X"Lord (7th)","Lord (8th)","Lord (9th)","Lord Gallant","Lord Keeper",
X"Lord Noble"},
X	/* Mage          */
X{"Novice","Apprentice","Trickster-1","Trickster-2","Trickster-3","Cabalist-1",
X"Cabalist-2","Cabalist-3","Visionist","Phantasmist","Shadowist","Spellbinder",
X"Illusionist","Evoker (1st)","Evoker (2nd)","Evoker (3rd)","Evoker (4th)",
X"Conjurer","Theurgist","Thaumaturge","Magician","Enchanter","Warlock",
X"Sorcerer","Necromancer","Mage (1st)","Mage (2nd)","Mage (3rd)","Mage (4th)",
X"Mage (5th)","Wizard (1st)","Wizard (2nd)","Wizard (3rd)","Wizard (4th)",
X"Wizard (5th)","Wizard (6th)","Wizard (7th)","Wizard (8th)","Wizard (9th)",
X"Wizard Lord"},
X	/* Priests       */
X{"Believer","Acolyte(1st)","Acolyte(2nd)","Acolyte(3rd)","Adept (1st)",
X"Adept (2nd)","Adept (3rd)","Priest (1st)","Priest (2nd)","Priest (3rd)",
X"Priest (4th)","Priest (5th)","Priest (6th)","Priest (7th)","Priest (8th)",
X"Priest (9th)","Curate (1st)","Curate (2nd)","Curate (3rd)","Curate (4th)",
X"Curate (5th)","Curate (6th)","Curate (7th)","Curate (8th)","Curate (9th)",
X"Canon (1st)","Canon (2nd)","Canon (3rd)","Canon (4th)","Canon (5th)",
X"Low Lama","Lama-1","Lama-2","Lama-3","High Lama","Great Lama","Patriarch",
X"High Priest","Great Priest","Noble Priest"},
X	/* Rogues        */
X{"Apprentice","Footpad","Cutpurse","Robber","Burglar","Filcher","Sharper",
X"Magsman","Common Rogue","Rogue (1st)","Rogue (2nd)","Rogue (3rd)",
X"Rogue (4th)","Rogue (5th)","Rogue (6th)","Rogue (7th)","Rogue (8th)",
X"Rogue (9th)","Master Rogue","Expert Rogue","Senior Rogue","Chief Rogue",
X"Prime Rogue","Low Thief","Thief (1st)","Thief (2nd)","Thief (3rd)",
X"Thief (4th)","Thief (5th)","Thief (6th)","Thief (7th)","Thief (8th)",
X"Thief (9th)","High Thief","Master Thief","Executioner","Low Assassin",
X"Assassin","High Assassin","Guildsmaster"},
X	/* Rangers       */
X{"Runner (1st)","Runner (2nd)","Runner (3rd)","Strider (1st)","Strider (2nd)",
X"Strider (3rd)","Scout (1st)","Scout (2nd)","Scout (3rd)","Scout (4th)",
X"Scout (5th)","Courser (1st)","Courser (2nd)","Courser (3rd)","Courser (4th)",
X"Courser (5th)","Tracker (1st)","Tracker (2nd)","Tracker (3rd)",
X"Tracker (4th)","Tracker (5th)","Tracker (6th)","Tracker (7th)",
X"Tracker (8th)","Tracker (9th)","Guide (1st)","Guide (2nd)","Guide (3rd)",
X"Guide (4th)","Guide (5th)","Guide (6th)","Guide (7th)","Guide (8th)",
X"Guide (9th)","Pathfinder-1","Pathfinder-2","Pathfinder-3","Ranger",
X"High Ranger","Ranger Lord"},
X	/* Paladins      */
X{"Gallant","Keeper (1st)","Keeper (2nd)","Keeper (3rd)","Keeper (4th)",
X"Keeper (5th)","Keeper (6th)","Keeper (7th)","Keeper (8th)","Keeper (9th)",
X"Protector-1","Protector-2","Protector-3","Protector-4","Protector-5",
X"Protector-6","Protector-7","Protector-8","Defender-1","Defender-2",
X"Defender-3","Defender-4","Defender-5","Defender-6","Defender-7","Defender-8",
X"Warder (1st)","Warder (2nd)","Warder (3rd)","Warder (4th)","Warder (5th)",
X"Warder (6th)","Warder (7th)","Warder (8th)","Warder (9th)","Guardian",
X"Chevalier","Justiciar","Paladin","High Lord"}
X};
X
X/* Base experience levels, may be adjusted up for race and/or class*/
Xint player_exp[MAX_PLAYER_LEVEL] = {
X     10,     25,     45,     70,    100,    140,    200,    280,    380,   500,
X    650,    850,   1100,   1400,   1800,   2300,   2900,   3600,   4400,  5400,
X   6800,   8400,  10200,  12500,  17500,  25000,  35000,  50000,  75000,100000,
X 150000, 200000, 300000, 400000, 500000, 750000,1500000,2500000,5000000,9999999
X};
X
Xdouble acc_exp = 0.0;	                  /* Accumulator for fractional exp*/
Xdtype bare_hands = "1d1";
Xint char_row = 0;
Xint char_col = 0;
Xint global_com_val;
X
X/*Race	STR,INT,WIS,DEX,CON,CHR,
X        Ages, heights, and weights,
X	Racial Bases for: dis,srh,stl,fos,bth,bthb,bsav,hitdie,
X	infra, choice-classes                                   */
Xrace_type race[MAX_RACES] = {
X   {"Human",     0,  0,  0,  0,  0,  0,
X      14,  6, 72,  6,180, 25, 66,  4,120, 20, 1.00,
X      0,  0,  0,  0,  0,  0,  0, 10,  0,  0x3F,
X    },
X   {"Half-Elf", -1,  1,  0,  1, -1,  1,
X      24, 16, 66,  6,130, 15, 62,  6,100, 10, 1.10,
X      2,  6,  1, -1,  0,  5,  3,  9,  0,  0x3F,
X    },
X   {"Elf",      -1,  2,  1,  1, -2,  1,
X      75, 75, 60,  4,100,  6, 54,  4, 80,  6, 1.20,
X      5,  8,  1, -2, -5, 15,  6,  8,  0,  0x1F,
X    },
X   {"Halfling", -2,  2,  1,  3,  1,  1,
X      21, 12, 36,  3, 60,  3, 33,  3, 50,  3, 1.10,
X      15, 12,  4, -5,-10, 20, 18,  6,  4,  0x0B,
X    },
X   {"Gnome",    -1,  2,  0,  2,  1, -2,
X      50, 40, 42,  3, 90,  6, 39,  3, 75,  3, 1.25,
X      10,  6,  3, -3, -8, 12, 12,  7,  3,  0x0F,
X    },
X   {"Dwarf",     2, -3,  1, -2,  2, -3,
X      35, 15, 48,  3,150, 10, 46,  3,120, 10, 1.20,
X      2,  7,  0,  0, 15,  0,  9,  9,  5,  0x05,
X    },
X   {"Half-Orc",  2, -1,  0,  0,  1, -4,
X      11,  4, 66,  1,150,  5, 62,  1,120,  5, 1.10,
X      -3,  0, -1,  3, 12, -5, -3, 10,  3,  0x0D,
X    },
X   {"Half-Troll",4, -4, -2, -4,  3, -6,
X      20, 10, 96, 10,300, 50, 84,  8,260, 40, 1.20,
X      -5, -1, -2,  5, 20,-10, -8, 12,  3,  0x05,
X    }
X };
X
X/* Background information					*/
Xbackground_type background[MAX_BACKGROUND] = {
X{"You are the illegitimate and unacknowledged child ",           10, 1, 2,-25},
X{"You are the illegitimate but acknowledged child ",             20, 1, 2,-15},
X{"You are one of several children ",                             95, 1, 2, -5},
X{"You are the 1st child ",                                      100, 1, 2,  0},
X{"of a Serf.  ",                                                 40, 2, 3, 15},
X{"of a Yeoman.  ",                                               65, 2, 3, 30},
X{"of a Townsman.  ",                                             80, 2, 3, 40},
X{"of a Guildsman.  ",                                            90, 2, 3, 55},
X{"of a Landed Knight.  ",                                        96, 2, 3, 70},
X{"of a Titled Noble.  ",                                         99, 2, 3, 80},
X{"of a Royal Blood Line.  ",                                    100, 2, 3, 90},
X{"You are the black sheep of the family.  ",                     20, 3,50,-30},
X{"You are a credit to the family.  ",                            80, 3,50,  5},
X{"You are a well liked child.  ",                               100, 3,50, 10},
X{"Your mother was a Green-Elf.  ",                               40, 4, 1,  0},
X{"Your father was a Green-Elf.  ",                               75, 4, 1,  5},
X{"Your mother was a Grey-Elf.  ",                                90, 4, 1,  5},
X{"Your father was a Grey-Elf.  ",                                95, 4, 1, 10},
X{"Your mother was a High-Elf.  ",                                98, 4, 1, 15},
X{"Your father was a High-Elf.  ",                               100, 4, 1, 20},
X{"You are one of several children ",                             60, 7, 8,  0},
X{"You are the only child ",                                     100, 7, 8,  5},
X{"of a Green-Elf ",                                              75, 8, 9,  0},
X{"of a Grey-Elf ",                                               95, 8, 9,  5},
X{"of a High-Elf ",                                              100, 8, 9, 10},
X{"Ranger.  ",                                                    40, 9,54, 30},
X{"Archer.  ",                                                    70, 9,54, 40},
X{"Warrior.  ",                                                   87, 9,54, 60},
X{"Mage.  ",                                                      95, 9,54, 75},
X{"Prince.  ",                                                    99, 9,54, 90},
X{"King.  ",                                                     100, 9,54, 95},
X{"You are one of several children of a Halfling ",               85,10,11, -5},
X{"You are the only child of a Halfling ",                       100,10,11,  5},
X{"Bum.  ",                                                       20,11, 3,  5},
X{"Tavern Owner.  ",                                              30,11, 3, 30},
X{"Miller.  ",                                                    40,11, 3, 40},
X{"Home Owner.  ",                                                50,11, 3, 50},
X{"Burglar.  ",                                                   80,11, 3, 60},
X{"Warrior.  ",                                                   95,11, 3, 65},
X{"Mage.  ",                                                     100,11, 3, 75},
X{"Clan Elder.  ",                                               100,11, 3, 90},
X{"You are one of several children of a Gnome ",                  85,13,14, -5},
X{"You are the only child of a Gnome ",                          100,13,14,  5},
X{"Beggar.  ",                                                    20,14, 3,  5},
X{"Braggart.  ",                                                   50,14, 3, 20},
X{"Prankster.  ",                                                 75,14, 3, 35},
X{"Warrior.  ",                                                   95,14, 3, 50},
X{"Mage.  ",                                                     100,14, 3, 75},
X{"You are one of two children of a Dwarven ",                    25,16,17,-10},
X{"You are the only child of a Dwarven ",                        100,16,17,  0},
X{"Thief.  ",                                                     10,17,18, 10},
X{"Prison Guard.  ",                                              25,17,18, 25},
X{"Miner.  ",                                                     75,17,18, 40},
X{"Warrior.  ",                                                   90,17,18, 60},
X{"Priest.  ",                                                    99,17,18, 80},
X{"King.  ",                                                     100,17,18,100},
X{"You are the black sheep of the family.  ",                     15,18,57,-40},
X{"You are a credit to the family.  ",                            85,18,57,  0},
X{"You are a well liked child.  ",                               100,18,57,  5},
X{"Your mother was an Orc, but it is unacknowledged.  ",          25,19,20,-25},
X{"Your father was an Orc, but it is unacknowledged.  ",         100,19,20,-25},
X{"You are the adopted child ",                                  100,20, 2,  0},
X{"Your mother was a Cave-Troll ",                                30,22,23,-30},
X{"Your father was a Cave-Troll ",                                60,22,23,-25},
X{"Your mother was a Hill-Troll ",                                75,22,23,-20},
X{"Your father was a Hill-Troll ",                                90,22,23,-15},
X{"Your mother was a Water-Troll ",                               95,22,23,-10},
X{"Your father was a Water-Troll ",                              100,22,23, -5},
X{"Cook.  ",                                                       5,23,62, 10},
X{"Warrior.  ",                                                   95,23,62,  5},
X{"Shaman.  ",                                                    99,23,62, 15},
X{"Clan Chief.  ",                                               100,23,62, 30},
X{"You have dark brown eyes, ",                                   20,50,51,  0},
X{"You have brown eyes, ",                                        60,50,51,  0},
X{"You have hazel eyes, ",                                        70,50,51,  0},
X{"You have green eyes, ",                                        80,50,51,  0},
X{"You have blue eyes, ",                                         90,50,51,  0},
X{"You have blue-gray eyes, ",                                   100,50,51,  0},
X{"straight ",                                                    70,51,52,  0},
X{"wavy ",                                                       90,51,52,  0},
X{"curly ",                                                      100,51,52,  0},
X{"black hair, ",                                                 30,52,53,  0},
X{"brown hair, ",                                                 70,52,53,  0},
X{"auburn hair, ",                                                80,52,53,  0},
X{"red hair, ",                                                   90,52,53,  0},
X{"blonde hair, ",                                               100,52,53,  0},
X{"and a very dark complexion.",                                  10,53,-1,  0},
X{"and a dark complexion.",                                       30,53,-1,  0},
X{"and an average complexion.",                                   80,53,-1,  0},
X{"and a fair complexion.",                                       90,53,-1,  0},
X{"and a very fair complexion.",                                 100,53,-1,  0},
X{"You have light grey eyes, ",                                   85,54,55,  0},
X{"You have light blue eyes, ",                                   95,54,55,  0},
X{"You have light green eyes, ",                                 100,54,55,  0},
X{"straight ",                                                    75,55,56,  0},
X{"wavy ",                                                      100,55,56,  0},
X{"black hair, and a fair complexion.",                           75,56,-1,  0},
X{"brown hair, and a fair complexion.",                           85,56,-1,  0},
X{"blonde hair, and a fair complexion.",                          95,56,-1,  0},
X{"silver hair, and a fair complexion.",                         100,56,-1,  0},
X{"You have dark brown eyes, ",                                   99,57,58,  0},
X{"You have glowing red eyes, ",                                 100,57,58, 10},
X{"straight ",                                                    90,58,59,  0},
X{"wavy ",                                                      100,58,59,  0},
X{"black hair, ",                                                 75,59,60,  0},
X{"brown hair, ",                                                100,59,60,  0},
X{"a one foot beard, ",                                           25,60,61,  0},
X{"a two foot beard, ",                                           60,60,61,  1},
X{"a three foot beard, ",                                         90,60,61,  3},
X{"a four foot beard, ",                                         100,60,61,  5},
X{"and a dark complexion.",                                      100,61,-1,  0},
X{"You have slime green eyes, ",                                  60,62,63,  0},
X{"You have puke yellow eyes, ",                                  85,62,63,  0},
X{"You have blue-bloodshot eyes, ",                               99,62,63,  0},
X{"You have glowing red eyes, ",                                 100,62,63,  5},
X{"dirty ",                                                       33,63,64,  0},
X{"mangy ",                                                       66,63,64,  0},
X{"oily ",                                                       100,63,64,  0},
X{"sea-weed green hair, ",                                        33,64,65,  0},
X{"bright red hair, ",                                            66,64,65,  0},
X{"dark purple hair, ",                                          100,64,65,  0},
X{"and green ",                                                   25,65,66,  0},
X{"and blue ",                                                    50,65,66,  0},
X{"and white ",                                                   75,65,66,  0},
X{"and black ",                                                  100,65,66,  0},
X{"ulcerous skin.",                                               33,66,-1,  0},
X{"scabby skin.",                                                 66,66,-1,  0},
X{"leprous skin.",                                               100,66,-1,  0}
X};
X
X/* Buying and selling adjustments for character race VS store	*/
X/* owner race                                                    */
Xdouble rgold_adj[MAX_RACES][MAX_RACES] = {
X			/*  Hum,  HfE,  Elf,  Hal,  Gno,  Dwa,  HfO,  HfT*/
X/*Human          */       { 0.00, 0.05, 0.05, 0.10, 0.13, 0.15, 0.20, 0.25},
X/*Half-Elf       */       { 0.10, 0.00, 0.00, 0.05, 0.10, 0.20, 0.25, 0.30},
X/*Elf            */       { 0.10, 0.05, 0.00, 0.05, 0.10, 0.20, 0.25, 0.30},
X/*Halfling       */       { 0.15, 0.10, 0.05,-0.05, 0.05, 0.10, 0.15, 0.30},
X/*Gnome          */       { 0.15, 0.15, 0.10, 0.05,-0.05, 0.10, 0.15, 0.30},
X/*Dwarf          */       { 0.15, 0.20, 0.20, 0.10, 0.10,-0.05, 0.25, 0.35},
X/*Half-Orc       */       { 0.15, 0.20, 0.25, 0.15, 0.15, 0.30, 0.10, 0.15},
X/*Half-Troll     */       { 0.10, 0.15, 0.15, 0.10, 0.10, 0.30, 0.10, 0.10}
X			};
X
X/* Classes...							*/
Xclass_type class[MAX_CLASS] = {
X{"Warrior", 0.00,  9, 25, 14, 1, 38, 68, 55,30, 5,-2,-2, 2, 2,-1, FALSE,FALSE},
X{"Mage",    0.30,  0, 30, 16, 2, 36, 34, 20,20,-5, 3, 0, 0,-2, 0, FALSE,TRUE },
X{"Priest",  0.10,  3, 25, 16, 2, 32, 48, 35,20, 0,-3, 3,-1, 1, 2, TRUE ,FALSE},
X{"Rogue",   0.00,  6, 45, 32, 4, 16, 60, 66,30, 3, 1,-2, 3, 2,-1, FALSE,TRUE },
X{"Ranger",  0.40,  4, 30, 24, 3, 24, 56, 72,25, 2, 2, 0, 1, 1, 1, FALSE,TRUE },
X{"Paladin", 0.35,  6, 20, 12, 1, 38, 70, 40,25, 3,-3, 1, 0, 2, 2, TRUE ,FALSE}
X};
X
X
X/* Each character class has a list of spells they can use.  In	*/
X/* cases the entire array is blank                               */
X
X spell_type magic_spell[MAX_CLASS][31] = {
X   { /* Warrior */
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE},
X     {""                            ,99,99,  0,  0,FALSE}
X   },
X   {               /* Mage          */
X     {"Magic Missile"               , 1, 1,  5, 22,FALSE},
X     {"Detect Monsters"             , 1, 1,  5, 23,FALSE},
X     {"Phase Door"                  , 1, 2,  4, 24,FALSE},
X     {"Light Area"                  , 1, 2,  4, 26,FALSE},
X     {"Cure Light Wounds"           , 3, 3,  8, 25,FALSE},
X     {"Find Hidden Traps/Doors"     , 3, 3,  6, 55,FALSE},
X     {"Stinking Cloud"              , 3, 4,  8, 27,FALSE},
X     {"Confusion"                   , 3, 4,  6, 30,FALSE},
X     {"Lightning Bolt"              , 5, 4, 25, 30,FALSE},
X     {"Trap/Door Destruction"       , 5, 5, 30, 30,FALSE},
X     {"Sleep I"                     , 5, 5, 20, 30,FALSE},
X     {"Cure Poison"                 , 5, 5, 25, 35,FALSE},
X     {"Teleport Self"               , 7, 6, 35, 35,FALSE},
X     {"Remove Curse"                , 7, 6, 40, 50,FALSE},
X     {"Frost Bolt"                  , 7, 6, 50, 40,FALSE},
X     {"Turn Stone to Mud"           , 9, 7, 75, 44,FALSE},
X     {"Create Food"                 , 9, 7, 75, 45,FALSE},
X     {"Recharge Item I"             , 9, 7, 90, 75,FALSE},
X     {"Sleep II"                    , 9, 7, 75, 45,FALSE},
X     {"Polymorph Other"             ,11, 7,100, 45,FALSE},
X     {"Identify"                    ,11, 7, 75, 99,FALSE},
X     {"Sleep III"                   ,13, 7, 90, 50,FALSE},
X     {"Fire Bolt"                   ,15, 9,100, 50,FALSE},
X     {"Slow Monster"                ,17, 9,125, 50,FALSE},
X     {"Frost Ball"                  ,19,12,150, 55,FALSE},
X     {"Recharge Item II"            ,21,12,175, 90,FALSE},
X     {"Teleport Other"              ,23,12,200, 60,FALSE},
X     {"Haste Self"                  ,25,12,250, 65,FALSE},
X     {"Fire Ball"                   ,29,18,350, 65,FALSE},
X     {"Word of Destruction"         ,33,21,500, 80,FALSE},
X     {"Genocide"                    ,37,25,800, 95,FALSE}
X   },
X   {               /* Priest        */
X     {"Detect Evil"                 , 1, 1,  3, 10,FALSE},
X     {"Cure Light Wounds"           , 1, 2,  4, 15,FALSE},
X     {"Bless"                       , 1, 2,  3, 20,FALSE},
X     {"Remove Fear"                 , 1, 2,  3, 25,FALSE},
X     {"Call Light"                  , 3, 2,  6, 25,FALSE},
X     {"Find Traps"                  , 3, 3,  8, 27,FALSE},
X     {"Detect Doors/Stairs"         , 3, 3,  8, 27,FALSE},
X     {"Slow Poison"                 , 3, 3, 10, 28,FALSE},
X     {"Blind Creature"              , 5, 4, 16, 29,FALSE},
X     {"Portal"                      , 5, 4, 20, 30,FALSE},
X     {"Cure Medium Wounds"          , 5, 4, 20, 32,FALSE},
X     {"Chant"                       , 5, 5, 20, 34,FALSE},
X     {"Sanctuary"                   , 7, 5, 30, 36,FALSE},
X     {"Create Food"                 , 7, 5, 30, 38,FALSE},
X     {"Remove Curse"                , 7, 6, 35, 38,FALSE},
X     {"Resist Heat and Cold"        , 7, 7, 35, 38,FALSE},
X     {"Neutralize Poison"           , 9, 6, 40, 38,FALSE},
X     {"Orb of Draining"             , 9, 7, 40, 38,FALSE},
X     {"Cure Serious Wounds"         , 9, 7, 40, 40,FALSE},
X     {"Sense Invisible"             ,11, 8, 40, 42,FALSE},
X     {"Protection from Evil"        ,11, 8, 50, 42,FALSE},
X     {"Earthquake"                  ,11, 9, 60, 55,FALSE},
X     {"Sense Surroundings"          ,13,10, 60, 45,FALSE},
X     {"Cure Critical Wounds"        ,13,11, 65, 45,FALSE},
X     {"Turn Undead"                 ,15,12, 80, 50,FALSE},
X     {"Prayer"                      ,15,14, 90, 50,FALSE},
X     {"Dispel Undead"              ,17,14,125, 55,FALSE},
X     {"Heal"                        ,21,16,150, 60,FALSE},
X     {"Dispel Evil"                ,25,20,300, 70,FALSE},
X     {"Glyph of Warding"            ,33,24,500, 90,FALSE},
X     {"Holy Word"                   ,39,32,800, 99,FALSE}
X   },
X   {               /* Rogue         */
X     {"Magic Missile"               ,99,99,  0,  0,FALSE},
X     {"Detect Monsters"             , 5, 1,  2, 50,FALSE},
X     {"Phase Door"                  , 7, 2,  4, 55,FALSE},
X     {"Light Area"                  , 9, 3,  6, 60,FALSE},
X     {"Cure Light Wounds"           ,11, 4,  8, 65,FALSE},
X     {"Find Hidden Traps/Doors"     ,13, 5, 10, 70,FALSE},
X     {"Stinking Cloud"              ,99,99,  0,  0,FALSE},
X     {"Confusion"                   ,15, 6, 12, 75,FALSE},
X     {"Lightning Bolt"              ,99,99,  0,  0,FALSE},
X     {"Trap/Door Destruction"       ,17, 7, 15, 80,FALSE},
X     {"Sleep I"                     ,19, 8, 20, 85,FALSE},
X     {"Cure Poison"                 ,21, 9, 25, 90,FALSE},
X     {"Teleport Self"               ,99,99,  0,  0,FALSE},
X     {"Remove Curse"                ,23,10, 30, 95,FALSE},
X     {"Frost Bolt"                  ,99,99,  0,  0,FALSE},
X     {"Turn Stone to Mud"           ,99,99,  0,  0,FALSE},
X     {"Create Food"                 ,25,12, 35, 95,FALSE},
X     {"Recharge Item I"             ,27,15, 45, 99,FALSE},
X     {"Sleep II"                    ,99,99,  0,  0,FALSE},
X     {"Polymorph Other"             ,99,99,  0,  0,FALSE},
X     {"Identify"                    ,29,18, 75, 99,FALSE},
X     {"Sleep III"                   ,99,99,  0,  0,FALSE},
X     {"Fire Bolt"                   ,99,99,  0,  0,FALSE},
X     {"Slow Monster"                ,99,99,  0,  0,FALSE},
X     {"Frost Ball"                  ,99,99,  0,  0,FALSE},
X     {"Recharge Item II"            ,99,99,  0,  0,FALSE},
X     {"Teleport Other"              ,99,99,  0,  0,FALSE},
X     {"Haste Self"                  ,99,99,  0,  0,FALSE},
X     {"Fire Ball"                   ,99,99,  0,  0,FALSE},
X     {"Word of Destruction"         ,99,99,  0,  0,FALSE},
X     {"Genocide"                    ,99,99,  0,  0,FALSE}
X   },
X   {               /* Ranger        */
X     {"Magic Missile"               , 3, 1,  6, 30,FALSE},
X     {"Detect Monsters"             , 3, 2,  6, 35,FALSE},
X     {"Phase Door"                  , 3, 2,  8, 35,FALSE},
X     {"Light Area"                  , 5, 3,  8, 35,FALSE},
X     {"Cure Light Wounds"           , 5, 3,  8, 40,FALSE},
X     {"Find Hidden Traps/Doors"     , 5, 4, 10, 45,FALSE},
X     {"Stinking Cloud"              , 7, 6, 24, 40,FALSE},
X     {"Confusion"                   , 7, 6, 20, 40,FALSE},
X     {"Lightning Bolt"              , 9, 7, 30, 40,FALSE},
X     {"Trap/Door Destruction"       , 9, 8, 30, 45,FALSE},
X     {"Sleep I"                     ,11, 8, 40, 40,FALSE},
X     {"Cure Poison"                 ,11, 9, 40, 45,FALSE},
X     {"Teleport Self"               ,13,10, 50, 45,FALSE},
X     {"Remove Curse"                ,13,11, 50, 55,FALSE},
X     {"Frost Bolt"                  ,15,12, 60, 50,FALSE},
X     {"Turn Stone to Mud"           ,15,13, 60, 50,FALSE},
X     {"Create Food"                 ,17,17, 60, 55,FALSE},
X     {"Recharge Item I"             ,17,17, 70, 90,FALSE},
X     {"Sleep II"                    ,21,17, 70, 55,FALSE},
X     {"Polymorph Other"             ,21,19, 70, 60,FALSE},
X     {"Identify"                    ,23,25, 80, 95,FALSE},
X     {"Sleep III"                   ,23,20, 80, 60,FALSE},
X     {"Fire Bolt"                   ,25,20, 80, 60,FALSE},
X     {"Slow Monster"                ,25,21, 80, 65,FALSE},
X     {"Frost Ball"                  ,27,21, 90, 65,FALSE},
X     {"Recharge Item II"            ,29,23, 90, 95,FALSE},
X     {"Teleport Other"              ,31,25,100, 70,FALSE},
X     {"Haste Self"                  ,33,25,150, 75,FALSE},
X     {"Fire Ball"                   ,35,25,200, 80,FALSE},
X     {"Word of Destruction"         ,37,30,500, 95,FALSE},
X     {""                            ,99,99,  0,  0,FALSE}
X   },
X   {               /* Paladin       */
X     {"Detect Evil"                 , 1, 1,  4, 30,FALSE},
X     {"Cure Light Wounds"           , 2, 2,  8, 35,FALSE},
X     {"Bless"                       , 3, 3, 12, 35,FALSE},
X     {"Remove Fear"                 , 5, 3, 20, 35,FALSE},
X     {"Call Light"                  , 5, 4, 20, 35,FALSE},
X     {"Find Traps"                  , 7, 5, 25, 40,FALSE},
X     {"Detect Doors/Stairs"         , 7, 5, 25, 40,FALSE},
X     {"Slow Poison"                 , 9, 7, 30, 40,FALSE},
X     {"Blind Creature"              , 9, 7, 30, 40,FALSE},
X     {"Portal"                      , 9, 8, 30, 40,FALSE},
X     {"Cure Medium Wounds"          ,11, 9, 40, 40,FALSE},
X     {"Chant"                       ,11,10, 40, 45,FALSE},
X     {"Sanctuary"                   ,11,10, 40, 45,FALSE},
X     {"Create Food"                 ,13,10, 50, 45,FALSE},
X     {"Remove Curse"                ,13,11, 50, 45,FALSE},
X     {"Resist Heat and Cold"        ,15,13, 60, 45,FALSE},
X     {"Neutralize Poison"           ,15,15, 60, 50,FALSE},
X     {"Orb of Draining"             ,17,15, 70, 50,FALSE},
X     {"Cure Serious Wounds"         ,17,15, 70, 50,FALSE},
X     {"Sense Invisible"             ,19,15, 75, 50,FALSE},
X     {"Protection from Evil"        ,19,15, 75, 50,FALSE},
X     {"Earthquake"                  ,21,17, 80, 50,FALSE},
X     {"Sense Surroundings"          ,23,17, 80, 50,FALSE},
X     {"Cure Critical Wounds"        ,25,20, 80, 50,FALSE},
X     {"Turn Undead"                 ,27,21, 90, 50,FALSE},
X     {"Prayer"                      ,29,22, 95, 50,FALSE},
X     {"Dispel Undead"              ,31,24,100, 60,FALSE},
X     {"Heal"                        ,33,28,125, 60,FALSE},
X     {"Dispel Evil"                ,35,32,150, 70,FALSE},
X     {"Glyph of Warding"            ,37,36,200, 90,FALSE},
X     {"Holy Word"                   ,39,38,500, 95,FALSE}
X   }
X };
X
Xtreasure_type mush = {"& pint~ of fine grade mush",  80, ',', 0x00000000,
X			1500, 0, 308, 1, 1, 0, 0, 0, 0, "1d1", 1};
X
X/* Each type of character starts out with a few provisions...	*/
X/* Note the the entries refer to array elements of INVENTORY_INIT array*/
Xbyteint player_init[MAX_CLASS][5] = {
X		{   0, 103,  41,   6,  32},     /* Warrior       */
X		{   0, 103,  41,   6,  66},     /* Mage          */
X		{   0, 103,  41,   6,  70},     /* Priest        */
X		{   0, 103,   6,  32,  66},     /* Rogue         */
X		{   0, 103,  41,   6,  66},     /* Ranger        */
X		{   0, 103,  41,   6,  70}      /* Paladin       */
X};
X
Xint total_winner = FALSE;
X
X/* Following are store definitions				*/
X
X/* Store owners have different characteristics for pricing and haggling*/
X/* Note: Store owners should be added in groups, one for each store    */
Xowner_type owners[MAX_OWNERS] = {
X{"Erick the Honest       (Human)      General Store",
X	  250, 0.75, 0.08, 0.04, 0, 12},
X{"Mauglin the Grumpy     (Dwarf)      Armory"       ,
X	32000, 1.00, 0.12, 0.04, 5,  5},
X{"Arndal Beast-Slayer    (Half-Elf)   Weaponsmith"  ,
X	10000, 0.85, 0.10, 0.05, 1,  8},
X{"Hardblow the Humble    (Human)      Temple"       ,
X	 3500, 0.75, 0.09, 0.06, 0, 15},
X{"Ga-nat the Greedy      (Gnome)      Alchemist"    ,
X	12000, 1.20, 0.15, 0.04, 4,  9},
X{"Valeria Starshine      (Elf)        Magic Shop"   ,
X	32000, 0.75, 0.10, 0.05, 2, 11},
X{"Andy the Friendly      (Halfling)   General Store",
X	  200, 0.70, 0.08, 0.05, 3, 15},
X{"Darg-Low the Grim      (Human)      Armory"       ,
X	10000, 0.90, 0.11, 0.04, 0,  9},
X{"Oglign Dragon-Slayer   (Dwarf)      Weaponsmith"  ,
X	32000, 0.95, 0.12, 0.04, 5,  8},
X{"Gunnar the Paladin     (Human)      Temple"       ,
X	 5000, 0.85, 0.10, 0.05, 0, 23},
X{"Mauser the Chemist     (Half-Elf)   Alchemist"    ,
X	10000, 0.90, 0.11, 0.05, 1,  8},
X{"Gopher the Great!      (Gnome)      Magic Shop"   ,
X	20000, 1.15, 0.13, 0.06, 4, 10},
X{"Lyar-el the Comely     (Elf)        General Store",
X	  300, 0.65, 0.07, 0.06, 2, 18},
X{"Mauglim the Horrible   (Half-Orc)   Armory"       ,
X	 3000, 1.00, 0.13, 0.05, 6,  9},
X{"Ithyl-Mak the Beastly  (Half-Troll) Weaponsmith"  ,
X	 3000, 1.10, 0.15, 0.06, 7,  8},
X{"Delilah the Pure       (Half-Elf)   Temple"       ,
X	25000, 0.80, 0.07, 0.06, 1, 20},
X{"Wizzle the Chaotic     (Halfling)   Alchemist"    ,
X	10000, 0.90, 0.10, 0.06, 3,  8},
X{"Inglorian the Mage     (Human?)     Magic Shop"   ,
X	32000, 1.00, 0.10, 0.07, 0, 10}
X};
X
Xstore_type store[MAX_STORES];
X
X/* Stores are just special traps 		*/
Xtreasure_type store_door[MAX_STORES] = {
X{"The entrance to the General Store."              , 110, '1',0x00000000,
X    0,      0, 101,   0,   0,   0,   0,   0,   0, "0d0"  ,  0},
X{"The entrance to the Armory."                     , 110, '2',0x00000000,
X    0,      0, 102,   0,   0,   0,   0,   0,   0, "0d0"  ,  0},
X{"The entrance to the Weapon Smiths."              , 110, '3',0x00000000,
X    0,      0, 103,   0,   0,   0,   0,   0,   0, "0d0"  ,  0},
X{"The entrance to the Temple."                     , 110, '4',0x00000000,
X    0,      0, 104,   0,   0,   0,   0,   0,   0, "0d0"  ,  0},
X{"The entrance to the Alchemy Shop."               , 110, '5',0x00000000,
X    0,      0, 105,   0,   0,   0,   0,   0,   0, "0d0"  ,  0},
X{"The entrance to the Magic Shop."                 , 110, '6',0x00000000,
X    0,      0, 106,   0,   0,   0,   0,   0,   0, "0d0"  ,  0}
X};
X
Xint store_choice[MAX_STORES][STORE_CHOICES] = {
X	/* General Store */
X{105,104,103,102,102,104,42,105,104,27,26,5,4,3,3,2,2,2,1,1,1,1,1,1,1,1
X},
X	/* Armory        */
X{30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,30,33,34,43,44,28,29,30,31
X},
X	/* Weaponsmith   */
X{ 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25, 6, 7,23,25,23,25
X},
X	/* Temple        */
X{71,72,73,74,59,59,77,79,80,81,84,85,13,14,15,96,97,98,100,79,79,80,80,81,72,98
X},
X	/* Alchemy shop  */
X{55,56,57,58,58,60,61,62,63,64,65,66,75,76,78,82,83,60,61,62,63,64,98,99,98,98
X},
X	/* Magic-User store*/
X{67,49,50,51,52,53,54,48,68,69,69,70,86,87,88,89,90,91,92,93,94,95,86,101,68,88
X}
X};
X
X
X/* code for these are all in sets.c  */
Xint general_store(), armory(), weaponsmith(),
X  temple(), alchemist(), magic_shop();
X
X/* Each store will buy only certain items, based on TVAL */
Xint (*store_buy[MAX_STORES])() = {
X       general_store, armory, weaponsmith, temple, alchemist, magic_shop};
X
X
X/* Following are arrays for descriptive pieces			*/
X
Xatype colors[MAX_COLORS] = {
X  "Amber","Azure","Blue","Blue Speckled","Blue Spotted",
X  "Black","Black Speckled","Black Spotted",
X  "Brown","Brown Speckled","Brown Spotted",
X  "Bubbling",
X  "Chartreuse","Clear","Cloudy",
X  "Copper","Copper Spotted","Crimson","Cyan",
X  "Dark Blue","Dark Green","Dark Red","Ecru",
X  "Gold","Gold Spotted",
X  "Green","Green Speckled","Green Spotted",
X  "Grey","Grey Spotted","Hazy","Indigo",
X  "Light Blue","Light Green","Magenta","Metallic Blue",
X  "Metallic Red","Metallic Green","Metallic Purple",
X  "Misty",
X  "Orange","Orange Speckled","Orange Spotted",
X  "Pink","Pink Speckled",
X  "Plaid","Puce","Purple","Purple Speckled",
X  "Purple Spotted","Red","Red Speckled","Red Spotted",
X  "Silver","Silver Speckled","Silver Spotted","Smoky",
X  "Tan","Tangerine","Topaz","Turquoise",
X  "Violet","Vermilion","White","White Speckled",
X  "White Spotted","Yellow"
X};
X
Xatype mushrooms[MAX_MUSH] = {
X  "Blue","Black","Brown","Copper","Crimson",
X  "Dark blue","Dark green","Dark red","Gold",
X  "Green","Grey","Light Blue","Light Green",
X  "Orange","Pink","Plaid","Purple","Red","Tan",
X  "Turquoise","Violet","White","Yellow",
X  "Wrinkled","Wooden","Slimy","Speckled",
X  "Spotted","Furry"
X};
X
Xatype woods[MAX_WOODS] = {
X  "Applewood","Ashen","Aspen","Avocado wood",
X  "Balsa","Banyan","Birch","Cedar","Cherrywood",
X  "Cinnibar","Cottonwood","Cypress","Dogwood",
X  "Driftwood","Ebony","Elm wood","Eucalyptus",
X  "Grapevine","Hawthorn","Hemlock","Hickory",
X  "Ironwood","Juniper","Locust","Mahogany",
X  "Magnolia","Manzanita","Maple","Mulberry",
X  "Oak","Pecan","Persimmon","Pine","Redwood",
X  "Rosewood","Spruce","Sumac","Sycamore","Teak",
X  "Walnut","Zebra wood"
X};
X
Xatype metals[MAX_METALS] = {
X  "Aluminum","Bone","Brass","Bronze","Cast Iron",
X  "Chromium","Copper","Gold","Iron","Lead",
X  "Magnesium","Molybdenum","Nickel",
X  "Pewter","Rusty","Silver","Steel","Tin",
X  "Titanium","Tungsten","Zirconium","Zinc",
X  "Aluminum Plated","Brass Plated","Copper Plated",
X  "Gold Plated","Nickel Plated","Silver Plated",
X  "Steel Plated","Tin Plated","Zinc Plated"
X};
X
Xatype rocks[MAX_ROCKS] = {
X  "Amber","Agate","Alexandrite","Amethyst","Antlerite",
X  "Aquamarine","Argentite","Azurite","Beryl","Bloodstone",
X  "Calcite","Carnelian","Coral","Corundum","Cryolite",
X  "Diamond","Diorite","Emerald","Flint","Fluorite",
X  "Gabbro","Garnet","Granite","Gypsum","Hematite","Jade",
X  "Jasper","Kryptonite","Lapus lazuli","Limestone",
X  "Malachite","Manganite","Marble","Moonstone",
X  "Neptunite","Obsidian","Onyx","Opal","Pearl","Pyrite",
X  "Quartz","Quartzite","Rhodonite","Rhyolite","Ruby",
X  "Sapphire","Sphalerite","Staurolite","Tiger eye","Topaz",
X  "Turquoise","Zircon"
X};
X
Xatype amulets[MAX_AMULETS] = {
X  "Birch","Cedar","Dogwood","Driftwood",
X  "Elm wood","Hemlock","Hickory","Mahogany",
X  "Maple","Oak","Pine","Redwood","Rosewood",
X  "Walnut","Aluminum","Bone","Brass","Bronze",
X  "Copper","Iron","Lead","Nickel","Agate","Amethyst",
X  "Diamond","Emerald","Flint","Garnet",
X  "Jade","Obsidian","Onyx","Opal","Pearl","Quartz",
X  "Ruby","Sapphire","Tiger eye","Topaz","Turquoise"
X};
X
Xdtype syllables[MAX_SYLLABLES] = {
X  "a","ab","ag","aks","ala","an","ankh","app",
X  "arg","arze","ash","aus","ban","bar","bat","bek",
X  "bie","bin","bit","bjor","blu","bot","bu",
X  "byt","comp","con","cos","cre","dalf","dan",
X  "den","doe","dok","eep","el","eng","er","ere","erk",
X  "esh","evs","fa","fid","for","fri","fu","gan",
X  "gar","glen","gop","gre","ha","he","hyd","i",
X  "ing","ion","ip","ish","it","ite","iv","jo",
X  "kho","kli","klis","la","lech","man","mar",
X  "me","mi","mic","mik","mon","mung","mur","nej",
X  "nelg","nep","ner","nes","nis","nih","nin","o",
X  "od","ood","org","orn","ox","oxy","pay","pet",
X  "ple","plu","po","pot","prok","re","rea","rhov",
X  "ri","ro","rog","rok","rol","sa","san","sat",
X  "see","sef","seh","shu","ski","sna","sne","snik",
X  "sno","so","sol","sri","sta","sun","ta","tab",
X  "tem","ther","ti","tox","trol","tue","turs","u",
X  "ulk","um","un","uni","ur","val","viv","vly",
X  "vom","wah","wed","werg","wex","whon","wun","x",
X  "yerg","yp","zun"
X};
END_OF_variables.c
if test 41630 -ne `wc -c <variables.c`; then
    echo shar: \"variables.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of archive 7 \(of 16\).
cp /dev/null ark7isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 16 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
be cbe