[comp.sources.games] v05i041: umoria2 - single player dungeon simulation

games@tekred.TEK.COM (07/28/88)

Submitted by: "James E. Wilson" <wilson@ji.berkeley.edu>
Comp.sources.games: Volume 5, Issue 41
Archive-name: umoria2/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 18)."
# Contents:  MISC_NOTES store1.c variables.c
# Wrapped by billr@saab on Wed Jul 13 11:16:24 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'MISC_NOTES' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'MISC_NOTES'\"
else
echo shar: Extracting \"'MISC_NOTES'\" \(1026 characters\)
sed "s/^X//" >'MISC_NOTES' <<'END_OF_FILE'
X
XThe most recent version of UNIX Moria can be obtained via
Xanonymous ftp from ucbarpa.Berkeley.EDU at present.
XThe files are in the directory pub/wilson.
XIn the future, I shall try to keep the sources available on
Xucbarpa.Berkeley.EDU and/or ucbvax.Berkeley.EDU.
X
XRestoring touched save files is possible, but not very easy.
XThe following is a rough outline of the steps necessary:
X1) User changes mode of save file so that wizard can read it.
X2) Wizard changes umask so that files created will be publicly writable
X    i.e. for csh type 'umask 0'
X   Also, the directory that this is done in must be publicly writable.
X3) Wizard uses 'wizard restore' command to read in touched save file.
X4) While still in wizard mode, save the game.
X5) User can then read in the new save file, deleting it in the process.
X6) Wizard changes umask back to original value, i.e. 'umask 22'.
X
XEnter wizard mode by using the ^W command, help is ^H. (Or for the
Xrogue-like option, ^W and ^?).
X
XJim Wilson
Xwilson@ji.Berkeley.EDU
Xucbvax!ucbji!wilson
END_OF_FILE
if test 1026 -ne `wc -c <'MISC_NOTES'`; then
    echo shar: \"'MISC_NOTES'\" unpacked with wrong size!
fi
# end of 'MISC_NOTES'
fi
if test -f 'store1.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'store1.c'\"
else
echo shar: Extracting \"'store1.c'\" \(9177 characters\)
sed "s/^X//" >'store1.c' <<'END_OF_FILE'
X#include "constants.h"
X#include "config.h"
X#include "types.h"
X#include "externs.h"
X
X#ifdef USG
X#include <string.h>
X#else
X#include <strings.h>
X#endif
X
Xint search_list(x1, x2)
Xbyteint x1;
Xint x2;
X{
X  register int i, j;
X  register treasure_type *o_ptr;
X
X  i = 0;
X  j = 0;
X  do
X    {
X      o_ptr = &object_list[i];
X      if ((o_ptr->tval == x1) && (o_ptr->subval == x2))
X	j = o_ptr->cost;
X      i++;
X    }
X  while ((i != MAX_OBJECTS) && (j <= 0));
X  return(j);
X}
X
X
X/* Returns the value for any given object		-RAK-	*/
Xint item_value(item)
Xtreasure_type item;
X{
X  register int value;
X  register treasure_type *i_ptr;
X
X  i_ptr = &item;
X  value = i_ptr->cost;
X  if (((i_ptr->tval >= 20) && (i_ptr->tval <= 23)) ||
X      ((i_ptr->tval >= 30) && (i_ptr->tval <= 36)))
X    {	/* Weapons and armor	*/
X      if (index(i_ptr->name, '^') != 0)
X	value = search_list(i_ptr->tval, i_ptr->subval) * i_ptr->number;
X      else if ((i_ptr->tval >= 20) && (i_ptr->tval <= 23))
X	{
X	  if (i_ptr->tohit < 0)
X	    value = 0;
X	  else if (i_ptr->todam < 0)
X	    value = 0;
X	  else if (i_ptr->toac < 0)
X	    value = 0;
X	  else
X	    value = (i_ptr->cost+(i_ptr->tohit+i_ptr->todam+i_ptr->toac)*100)*
X	      i_ptr->number;
X	}
X      else
X	{
X	  if (i_ptr->toac < 0)
X	    value = 0;
X	  else
X	    value = (i_ptr->cost+i_ptr->toac*100)*i_ptr->number;
X	}
X    }
X  else if ((i_ptr->tval >= 10) && (i_ptr->tval <= 13))
X    {	/* Ammo			*/
X      if (index(i_ptr->name, '^') != 0)
X	value = search_list(i_ptr->tval, 1)*i_ptr->number;
X      else
X	{
X	  if (i_ptr->tohit < 0)
X	    value = 0;
X	  else if (i_ptr->todam < 0)
X	    value = 0;
X	  else if (i_ptr->toac < 0)
X	    value = 0;
X	  else
X	    value = (i_ptr->cost+(i_ptr->tohit+i_ptr->todam+i_ptr->toac)*10)*
X	      i_ptr->number;
X	}
X    }
X  else if ((i_ptr->tval == 70) || (i_ptr->tval == 71) ||
X	   (i_ptr->tval == 75) || (i_ptr->tval == 76) || (i_ptr->tval == 80))
X    {	/* Potions, Scrolls, and Food	*/
X      if (index(i_ptr->name, '|') != 0)
X	switch(i_ptr->tval)
X	  {
X	  case 70: case 71: value =  20; break;
X	  case 75: case 76: value =  20; break;
X	  case 80:          value =   1; break;
X	  default:          break;
X	  }
X    }
X  else if ((i_ptr->tval == 40) || (i_ptr->tval == 45))
X    {	/* Rings and amulets	*/
X      if (index(i_ptr->name, '|') != 0)
X	/* player does not know what type of ring/amulet this is */
X	switch(i_ptr->tval)
X	  {
X	  case 40: value = 45; break;
X	  case 45: value = 45; break;
X	  default: break;
X	  }
X      else if (index(i_ptr->name, '^') != 0)
X	/* player knows what type of ring, but does not know whether it is
X	   cursed or not, if refuse to buy cursed objects here, then
X	   player can use this to 'identify' cursed objects */
X	value = abs(i_ptr->cost);
X    }
X  else if ((i_ptr->tval == 55) || (i_ptr->tval == 60) || (i_ptr->tval == 65))
X    {	/* Wands rods, and staffs*/
X      if (index(i_ptr->name, '|') != 0)
X	switch(i_ptr->tval)
X	  {
X	  case 55: value = 70; break;
X	  case 60: value = 60; break;
X	  case 65: value = 50; break;
X	  default: break;
X	  }
X      else if (index(i_ptr->name, '^') == 0)
X	{
X	  value = i_ptr->cost + (i_ptr->cost/20.0)*i_ptr->p1;
X	}
X    }
X  return(value);
X}
X
X
X/* Asking price for an item				-RAK-	*/
Xint sell_price(snum, max_sell, min_sell, item)
Xint snum;
Xint *max_sell, *min_sell;
Xtreasure_type item;
X{
X  register int i;
X  register store_type *s_ptr;
X
X  s_ptr = &store[snum];
X  i = item_value(item);
X  if (item.cost > 0)
X    {
X      i += (i * rgold_adj[owners[s_ptr->owner].owner_race][py.misc.prace]);
X      if (i < 1)  i = 1;
X      *max_sell = (i * (1+owners[s_ptr->owner].max_inflate));
X      *min_sell = (i * (1+owners[s_ptr->owner].min_inflate));
X      if (min_sell > max_sell)  min_sell = max_sell;
X      return(i);
X    }
X  else
X    {
X      *max_sell = 0;
X      *min_sell = 0;
X      return(i);
X    }
X}
X
X
X/* Check to see if he will be carrying too many objects	-RAK-	*/
Xint store_check_num(store_num)
Xint store_num;
X{
X  register int store_check;
X  register int i;
X  register store_type *s_ptr;
X  register treasure_type *i_ptr;
X
X  store_check = FALSE;
X  s_ptr = &store[store_num];
X  if (s_ptr->store_ctr < STORE_INVEN_MAX)
X    store_check = TRUE;
X  else if ((inventory[INVEN_MAX].subval > 255) &&
X	   (inventory[INVEN_MAX].subval < 512))
X    for (i = 0; i < s_ptr->store_ctr; i++)
X      {
X	i_ptr = &s_ptr->store_inven[i].sitem;
X	if (i_ptr->tval == inventory[INVEN_MAX].tval)
X	  if (i_ptr->subval == inventory[INVEN_MAX].subval)
X	    store_check = TRUE;
X      }
X  return(store_check);
X}
X
X
X/* Insert INVEN_MAX at given location	*/
Xinsert_store(store_num, pos, icost)
Xregister int pos;
Xint store_num, icost;
X{
X  register int i;
X  register store_type *s_ptr;
X
X  s_ptr = &store[store_num];
X  for (i = s_ptr->store_ctr-1; i >= pos; i--)
X    s_ptr->store_inven[i+1] = s_ptr->store_inven[i];
X  s_ptr->store_inven[pos].sitem = inventory[INVEN_MAX];
X  s_ptr->store_inven[pos].scost = -icost;
X  s_ptr->store_ctr++;
X}
X
X
X/* Add the item in INVEN_MAX to stores inventory.	-RAK-	*/
Xstore_carry(store_num, ipos)
Xint store_num;
Xint *ipos;
X{
X  int item_num, item_val;
X  register int typ, subt;
X  int icost, dummy, flag;
X  register treasure_type *i_ptr;
X  register store_type *s_ptr;
X
X  *ipos = 0;
X  identify(inventory[INVEN_MAX]);
X  known2(inventory[INVEN_MAX].name);
X  (void) sell_price(store_num, &icost, &dummy, inventory[INVEN_MAX]);
X  if (icost > 0)
X    {
X      i_ptr = &inventory[INVEN_MAX];
X      s_ptr = &store[store_num];
X      item_val = 0;
X      item_num = i_ptr->number;
X      flag = FALSE;
X      typ  = i_ptr->tval;
X      subt = i_ptr->subval;
X      do
X	{
X	  i_ptr = &s_ptr->store_inven[item_val].sitem;
X	  if (typ == i_ptr->tval)
X	    {
X	      if (subt == i_ptr->subval) /* Adds to other item	*/
X		if (subt > 255)
X		  {
X		    if (i_ptr->number < 24)
X		      i_ptr->number += item_num;
X		    flag = TRUE;
X		  }
X	    }
X	  else if (typ > i_ptr->tval)
X	    {		/* Insert into list		*/
X	      insert_store(store_num, item_val, icost);
X	      flag = TRUE;
X	      *ipos = item_val;
X	    }
X	  item_val++;
X	}
X      while ((item_val < s_ptr->store_ctr) && (!flag));
X      if (!flag) 	/* Becomes last item in list	*/
X	{
X	  insert_store(store_num, (int)s_ptr->store_ctr, icost);
X	  *ipos = s_ptr->store_ctr - 1;
X	}
X    }
X}
X
X/* Destroy an item in the stores inventory.  Note that if	*/
X/* "one_of" is false, an entire slot is destroyed	-RAK-	*/
Xstore_destroy(store_num, item_val, one_of)
Xint store_num, item_val;
Xint one_of;
X{
X  register int j;
X  register store_type *s_ptr;
X  register treasure_type *i_ptr;
X
X  s_ptr = &store[store_num];
X  inventory[INVEN_MAX] = s_ptr->store_inven[item_val].sitem;
X  i_ptr = &s_ptr->store_inven[item_val].sitem;
X  if ((i_ptr->number > 1) && (i_ptr->subval < 512) && (one_of))
X    {
X      i_ptr->number--;
X      inventory[INVEN_MAX].number = 1;
X    }
X  else
X    {
X      for (j = item_val; j < s_ptr->store_ctr-1; j++)
X	s_ptr->store_inven[j] = s_ptr->store_inven[j+1];
X      s_ptr->store_inven[s_ptr->store_ctr-1].sitem = blank_treasure;
X      s_ptr->store_inven[s_ptr->store_ctr-1].scost = 0;
X      s_ptr->store_ctr--;
X    }
X}
X
X
X/* Initializes the stores with owners			-RAK-	*/
Xstore_init()
X{
X  register int i, j, k;
X  register store_type *s_ptr;
X
X  i = MAX_OWNERS / MAX_STORES;
X  for (j = 0; j < MAX_STORES; j++)
X    {
X      s_ptr = &store[j];
X      s_ptr->owner = MAX_STORES*(randint(i)-1) + j;
X      s_ptr->insult_cur = 0;
X      s_ptr->store_open = 0;
X      s_ptr->store_ctr  = 0;
X      for (k = 0; k < STORE_INVEN_MAX; k++)
X	{
X	  s_ptr->store_inven[k].sitem = blank_treasure;
X	  s_ptr->store_inven[k].scost = 0;
X	}
X    }
X}
X
X
X/* Creates an item and inserts it into store's inven	-RAK-	*/
Xstore_create(store_num)
Xint store_num;
X{
X  register int i, tries;
X  int cur_pos, dummy;
X  register store_type *s_ptr;
X  register treasure_type *t_ptr;
X
X  tries = 0;
X  popt(&cur_pos);
X  s_ptr = &store[store_num];
X  do
X    {
X      i = store_choice[store_num][randint(STORE_CHOICES)-1];
X      /* this index is one more than it should be, so subtract one */
X      /* see store_choice in variables.c */
X      t_list[cur_pos] = inventory_init[i-1];
X      magic_treasure(cur_pos, OBJ_TOWN_LEVEL);
X      inventory[INVEN_MAX] = t_list[cur_pos];
X      if (store_check_num(store_num))
X	{
X	  t_ptr = &t_list[cur_pos];
X	  if (t_ptr->cost > 0) 	/* Item must be good	*/
X	    if (t_ptr->cost < owners[s_ptr->owner].max_cost)
X	      {
X		store_carry(store_num, &dummy);
X		tries = 10;
X	      }
X	}
X      tries++;
X    }
X  while (tries <= 3);
X  pusht(cur_pos);
X}
X
X
X/* Initialize and up-keep the store's inventory.		-RAK-	*/
Xstore_maint()
X{
X  register int i, j;
X  register store_type *s_ptr;
X
X  for (i = 0; i < MAX_STORES; i++)
X    {
X      s_ptr = &store[i];
X      s_ptr->insult_cur = 0;
X      if (s_ptr->store_ctr > STORE_MAX_INVEN)
X	for (j = 0; j < (s_ptr->store_ctr-STORE_MAX_INVEN+2); j++)
X	  store_destroy(i, randint((int)s_ptr->store_ctr)-1, FALSE);
X      else if (s_ptr->store_ctr < STORE_MIN_INVEN)
X	{
X	  for (j = 0; j < (STORE_MIN_INVEN-s_ptr->store_ctr+2); j++)
X	    store_create(i);
X	}
X      else
X	{
X	  for (j = 0; j < (1+randint(STORE_TURN_AROUND)); j++)
X	    store_destroy(i, randint((int)s_ptr->store_ctr)-1, TRUE);
X	  for (j = 0; j < (1+randint(STORE_TURN_AROUND)); j++)
X	    store_create(i);
X	}
X    }
X}
END_OF_FILE
if test 9177 -ne `wc -c <'store1.c'`; then
    echo shar: \"'store1.c'\" unpacked with wrong size!
fi
# end of 'store1.c'
fi
if test -f 'variables.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'variables.c'\"
else
echo shar: Extracting \"'variables.c'\" \(41885 characters\)
sed "s/^X//" >'variables.c' <<'END_OF_FILE'
X#include "constants.h"
X#include "config.h"
X#include "types.h"
X
Xint character_generated = 0;    /* don't save score until char gen finished */
Xint character_saved = 0;        /* prevents save on kill after save_char() */
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 = 0;	                /* Cur dungeon level   */
Xint missile_ctr = 0;             /* Counter for missiles */
Xint msg_flag;	                /* Set with first msg  */
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	      */
Xint panic_save = 0;             /* this is true if playing from a panic save */
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, FALSE,
X		      FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE};
Xchar password1[12];
Xchar password2[12];
X
Xint wait_for_more = 0;
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 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,
X150000, 200000, 300000, 400000, 500000, 750000,1500000,2500000,5000000,10000000
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, -1,  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,  -1,  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{"blond 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{"blond 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/*          Exp  HP Dis Src Stl Fos bth btb sve S  I  W  D Co Ch  Pray  Mag */
X{"Warrior", 0.00, 9, 25, 14, 1, 38, 68, 55, 18, 5,-2,-2, 2, 2,-1, FALSE,FALSE},
X{"Mage",    0.30, 0, 30, 16, 2, 20, 34, 20, 36,-5, 3, 0, 0,-2, 0, FALSE,TRUE },
X{"Priest",  0.10, 3, 25, 16, 2, 32, 48, 35, 30, 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, 30, 2, 2, 0, 1, 1, 1, FALSE,TRUE },
X{"Paladin", 0.35, 6, 20, 12, 1, 38, 70, 40, 24, 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, 306, 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,   1,   0,   0,   0,   0, "0d0"  ,  0},
X{"the entrance to the Armory"                     , 110, '2',0x00000000,
X    0,      0, 102,   0,   1,   0,   0,   0,   0, "0d0"  ,  0},
X{"the entrance to the Weapon Smiths"              , 110, '3',0x00000000,
X    0,      0, 103,   0,   1,   0,   0,   0,   0, "0d0"  ,  0},
X{"the entrance to the Temple"                     , 110, '4',0x00000000,
X    0,      0, 104,   0,   1,   0,   0,   0,   0, "0d0"  ,  0},
X{"the entrance to the Alchemy Shop"               , 110, '5',0x00000000,
X    0,      0, 105,   0,   1,   0,   0,   0,   0, "0d0"  ,  0},
X{"the entrance to the Magic Shop"                 , 110, '6',0x00000000,
X    0,      0, 106,   0,   1,   0,   0,   0,   0, "0d0"  ,  0}
X};
X
X/* caution!! this indices are all one greater than they should be,
X   see store_create in store1.c */
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  "Cinnabar","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","Lapis 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_FILE
if test 41885 -ne `wc -c <'variables.c'`; then
    echo shar: \"'variables.c'\" unpacked with wrong size!
fi
# end of 'variables.c'
fi
echo shar: End of archive 7 \(of 18\).
cp /dev/null ark7isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 18 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.
exit 0