xref: /csrg-svn/games/larn/data.c (revision 49714)
1*49714Sbostic /*-
2*49714Sbostic  * Copyright (c) 1988 The Regents of the University of California.
335250Sbostic  * All rights reserved.
435250Sbostic  *
5*49714Sbostic  * %sccs.include.redist.c%
635250Sbostic  */
735250Sbostic 
835250Sbostic #ifndef lint
9*49714Sbostic static char sccsid[] = "@(#)data.c	5.3 (Berkeley) 05/13/91";
1035250Sbostic #endif /* not lint */
1135250Sbostic 
1235250Sbostic /*	data.c		Larn is copyrighted 1986 by Noah Morgan. */
1335250Sbostic #define NODEFS
1435250Sbostic #include "header.h"
1535250Sbostic 
1635250Sbostic /*
1735250Sbostic 	class[c[LEVEL]-1] gives the correct name of the players experience level
1835250Sbostic  */
1935250Sbostic static char aa1[] =	" mighty evil master";
2035250Sbostic static char aa2[] =	"apprentice demi-god";
2135250Sbostic static char aa3[] =	"  minor demi-god   ";
2235250Sbostic static char aa4[] =	"  major demi-god   ";
2335250Sbostic static char aa5[] =	"    minor deity    ";
2435250Sbostic static char aa6[] =	"    major deity    ";
2535250Sbostic static char aa7[] =	"  novice guardian  ";
2635250Sbostic static char aa8[] =	"apprentice guardian";
2735250Sbostic static char aa9[] =	"    The Creator    ";
2835250Sbostic char *class[]=
2935250Sbostic {	"  novice explorer  ", "apprentice explorer", " practiced explorer",/*  -3*/
3035250Sbostic 	"   expert explorer ", "  novice adventurer", "     adventurer    ",/*  -6*/
3135250Sbostic 	"apprentice conjurer", "     conjurer      ", "  master conjurer  ",/*  -9*/
3235250Sbostic 	"  apprentice mage  ", "        mage       ", "  experienced mage ",/* -12*/
3335250Sbostic 	"     master mage   ", " apprentice warlord", "   novice warlord  ",/* -15*/
3435250Sbostic 	"   expert warlord  ", "   master warlord  ", " apprentice gorgon ",/* -18*/
3535250Sbostic 	"       gorgon      ", "  practiced gorgon ", "   master gorgon   ",/* -21*/
3635250Sbostic 	"    demi-gorgon    ", "    evil master    ", " great evil master ",/* -24*/
3735250Sbostic 	  aa1       ,   aa1       ,   aa1       ,/* -27*/
3835250Sbostic 	  aa1       ,   aa1       ,   aa1       ,/* -30*/
3935250Sbostic 	  aa1       ,   aa1       ,   aa1       ,/* -33*/
4035250Sbostic 	  aa1       ,   aa1       ,   aa1       ,/* -36*/
4135250Sbostic 	  aa1       ,   aa1       ,   aa1       ,/* -39*/
4235250Sbostic 	  aa2       ,   aa2       ,   aa2       ,/* -42*/
4335250Sbostic 	  aa2       ,   aa2       ,   aa2       ,/* -45*/
4435250Sbostic 	  aa2       ,   aa2       ,   aa2       ,/* -48*/
4535250Sbostic 	  aa3       ,   aa3       ,   aa3       ,/* -51*/
4635250Sbostic 	  aa3       ,   aa3       ,   aa3       ,/* -54*/
4735250Sbostic 	  aa3       ,   aa3       ,   aa3       ,/* -57*/
4835250Sbostic 	  aa4       ,   aa4       ,   aa4       ,/* -60*/
4935250Sbostic 	  aa4       ,   aa4       ,   aa4       ,/* -63*/
5035250Sbostic 	  aa4       ,   aa4       ,   aa4       ,/* -66*/
5135250Sbostic 	  aa5       ,   aa5       ,   aa5       ,/* -69*/
5235250Sbostic 	  aa5       ,   aa5       ,   aa5       ,/* -72*/
5335250Sbostic 	  aa5       ,   aa5       ,   aa5       ,/* -75*/
5435250Sbostic 	  aa6       ,   aa6       ,   aa6       ,/* -78*/
5535250Sbostic 	  aa6       ,   aa6       ,   aa6       ,/* -81*/
5635250Sbostic 	  aa6       ,   aa6       ,   aa6       ,/* -84*/
5735250Sbostic 	  aa7       ,   aa7       ,   aa7       ,/* -87*/
5835250Sbostic 	  aa8       ,   aa8       ,   aa8       ,/* -90*/
5935250Sbostic 	  aa8       ,   aa8       ,   aa8       ,/* -93*/
6035250Sbostic 	"  earth guardian   ", "   air guardian    ", "   fire guardian   ",/* -96*/
6135250Sbostic 	"  water guardian   ", "  time guardian    ", " ethereal guardian ",/* -99*/
6235250Sbostic 	  aa9       ,   aa9       ,   aa9       ,/* -102*/
6335250Sbostic };
6435250Sbostic 
6535250Sbostic /*
6635250Sbostic 	table of experience needed to be a certain level of player
6735250Sbostic 	skill[c[LEVEL]] is the experience required to attain the next level
6835250Sbostic  */
6935250Sbostic #define MEG 1000000
7035250Sbostic long skill[] = {
7135250Sbostic 0, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120,                  /*  1-11 */
7235250Sbostic 10240, 20480, 40960, 100000, 200000, 400000, 700000, 1*MEG,          /* 12-19 */
7335250Sbostic 2*MEG,3*MEG,4*MEG,5*MEG,6*MEG,8*MEG,10*MEG,                          /* 20-26 */
7435250Sbostic 12*MEG,14*MEG,16*MEG,18*MEG,20*MEG,22*MEG,24*MEG,26*MEG,28*MEG,      /* 27-35 */
7535250Sbostic 30*MEG,32*MEG,34*MEG,36*MEG,38*MEG,40*MEG,42*MEG,44*MEG,46*MEG,      /* 36-44 */
7635250Sbostic 48*MEG,50*MEG,52*MEG,54*MEG,56*MEG,58*MEG,60*MEG,62*MEG,64*MEG,      /* 45-53 */
7735250Sbostic 66*MEG,68*MEG,70*MEG,72*MEG,74*MEG,76*MEG,78*MEG,80*MEG,82*MEG,      /* 54-62 */
7835250Sbostic 84*MEG,86*MEG,88*MEG,90*MEG,92*MEG,94*MEG,96*MEG,98*MEG,100*MEG,     /* 63-71 */
7935250Sbostic 105*MEG,110*MEG,115*MEG,120*MEG, 125*MEG, 130*MEG, 135*MEG, 140*MEG, /* 72-79 */
8035250Sbostic 145*MEG,150*MEG,155*MEG,160*MEG, 165*MEG, 170*MEG, 175*MEG, 180*MEG, /* 80-87 */
8135250Sbostic 185*MEG,190*MEG,195*MEG,200*MEG, 210*MEG, 220*MEG, 230*MEG, 240*MEG, /* 88-95 */
8235250Sbostic 250*MEG,260*MEG,270*MEG,280*MEG, 290*MEG, 300*MEG                    /* 96-101*/
8335250Sbostic };
8435250Sbostic #undef MEG
8535250Sbostic 
8635250Sbostic char *lpbuf,*lpnt,*inbuffer,*lpend;	/* input/output pointers to the buffers */
8735250Sbostic struct cel *cell;	/*	pointer to the dungeon storage	*/
8835250Sbostic short hitp[MAXX][MAXY];		/*	monster hp on level		*/
8935250Sbostic short iarg[MAXX][MAXY];	/*	arg for the item array	*/
9035250Sbostic char item[MAXX][MAXY];	/*	objects in maze if any	*/
9135250Sbostic char know[MAXX][MAXY];	/*	1 or 0 if here before	*/
9235250Sbostic char mitem[MAXX][MAXY];	/*	monster item array 		*/
9335250Sbostic char moved[MAXX][MAXY];	/*	monster movement flags  */
9435250Sbostic char stealth[MAXX][MAXY];	/*  0=sleeping 1=awake monst*/
9535250Sbostic char iven[26];			/*	inventory for player			*/
9635250Sbostic short ivenarg[26];		/*	inventory for player			*/
9735250Sbostic char lastmonst[40];		/*	this has the name of the current monster	*/
9835252Sbostic char beenhere[MAXLEVEL+MAXVLEVEL]={0};	/*  1 if have been on this level */
9935250Sbostic char VERSION=VER;	/*	this is the present version # of the program	*/
10035250Sbostic char SUBVERSION=SUBVER;
10135250Sbostic char nosignal=0;	/* set to 1 to disable the signals from doing anything */
10235250Sbostic char predostuff=0;	/*  2 means that the trap handling routines must do a
10335250Sbostic 						showplayer() after a trap.  0 means don't showplayer()
10435250Sbostic 						0 - we are in create player screen
10535250Sbostic 						1 - we are in welcome screen
10635250Sbostic 						2 - we are in the normal game	*/
10735250Sbostic char loginname[20];		/* players login name */
10835250Sbostic char logname[LOGNAMESIZE];	/* players name storage for scoring				*/
10935250Sbostic char sex=1;				/*  default is a man  0=woman						*/
11035250Sbostic char boldon=1;			/*  1=bold objects  0=inverse objects				*/
11135250Sbostic char ckpflag=0;			/*	1 if want checkpointing of game, 0 otherwise	*/
11235250Sbostic char cheat=0;			/*	1 if the player has fudged save file			*/
11335250Sbostic char level=0;			/*  cavelevel player is on = c[CAVELEVEL]			*/
11435250Sbostic char wizard=0;			/*	the wizard mode flag							*/
11535250Sbostic short lastnum=0;		/* the number of the monster last hitting player 	*/
11635250Sbostic short hitflag=0;		/*	flag for if player has been hit when running 	*/
11735250Sbostic short hit2flag=0;		/*	flag for if player has been hit when running 	*/
11835250Sbostic short hit3flag=0;		/*	flag for if player has been hit flush input 	*/
11935250Sbostic short playerx,playery;	/*	the room on the present level of the player		*/
12035250Sbostic short lastpx,lastpy;	/*	0 --- MAXX-1  or  0 --- MAXY-1					*/
12135250Sbostic short oldx,oldy;
12235250Sbostic short lasthx=0,lasthy=0;	/* location of monster last hit by player		*/
12335250Sbostic short nobeep=0;			/* true if program is not to beep  					*/
12435250Sbostic unsigned long randx=33601;	/*	the random number seed						*/
12535250Sbostic long initialtime=0;			/* time playing began 							*/
12635250Sbostic long gtime=0;				/*	the clock for the game						*/
12735250Sbostic long outstanding_taxes=0;	/* present tax bill from score file 			*/
12835250Sbostic long c[100],cbak[100];		/*	the character description arrays			*/
12935250Sbostic int enable_scroll=0;		/* constant for enabled/disabled scrolling regn */
13035250Sbostic char aborted[] = " aborted";
13135250Sbostic struct sphere *spheres=0; /*pointer to linked list for spheres of annihilation*/
13235250Sbostic char *levelname[]=
13335250Sbostic { " H"," 1"," 2"," 3"," 4"," 5"," 6"," 7"," 8"," 9","10","V1","V2","V3" };
13435250Sbostic 
13535250Sbostic char objnamelist[]=" ATOP%^F&^+M=%^$$f*OD#~][[)))(((||||||||{?!BC}o:@.<<<<EVV))([[]]](^ [H*** ^^ S tsTLc............................................";
13635250Sbostic char monstnamelist[]=" BGHJKOScjtAELNQRZabhiCTYdegmvzFWflorXV pqsyUkMwDDPxnDDuD        ...............................................................";
13735250Sbostic char *objectname[]=
13835250Sbostic { 0,"a holy altar","a handsome jewel encrusted throne","the orb","a pit",
13935250Sbostic   "a staircase leading upwards","an elevator going up","a bubbling fountain",
14035250Sbostic   "a great marble statue","a teleport trap","the college of Larn",
14135250Sbostic   "a mirror","the DND store","a staircase going down","an elevator going down",
14235250Sbostic   "the bank of Larn","the 5th branch of the Bank of Larn",
14335250Sbostic   "a dead fountain","gold","an open door","a closed door",
14435250Sbostic   "a wall","The Eye of Larn","plate mail","chain mail","leather armor",
14535250Sbostic   "a sword of slashing","Bessman's flailing hammer","a sunsword",
14635250Sbostic   "a two handed sword","a spear","a dagger",
14735250Sbostic   "ring of extra regeneration","a ring of regeneration","a ring of protection",
14835250Sbostic   "an energy ring","a ring of dexterity","a ring of strength",
14935250Sbostic   "a ring of cleverness","a ring of increase damage","a belt of striking",
15035250Sbostic   "a magic scroll","a magic potion","a book","a chest",
15135250Sbostic   "an amulet of invisibility","an orb of dragon slaying",
15235250Sbostic   "a scarab of negate spirit","a cube of undead control",
15335250Sbostic   "device of theft prevention","a brilliant diamond","a ruby",
15435250Sbostic   "an enchanting emerald","a sparkling sapphire","the dungeon entrance",
15535250Sbostic   "a volcanic shaft leaning downward","the base of a volcanic shaft",
15635250Sbostic   "a battle axe","a longsword","a flail","ring mail","studded leather armor",
15735250Sbostic   "splint mail","plate armor","stainless plate armor","a lance of death",
15835250Sbostic   "an arrow trap","an arrow trap","a shield","your home",
15935250Sbostic   "gold","gold","gold","a dart trap",
16035250Sbostic   "a dart trap","a trapdoor","a trapdoor","the local trading post",
16135250Sbostic   "a teleport trap", "a massive throne",
16235250Sbostic   "a sphere of annihilation","a handsome jewel encrusted throne",
16335250Sbostic   "the Larn Revenue Service","a fortune cookie","","","","","","",
16435250Sbostic   "","","","","","","","","","","","","","","","","","","",""
16535250Sbostic  };
16635250Sbostic 
16735250Sbostic 
16835250Sbostic /*
16935250Sbostic  *	for the monster data
17035250Sbostic  *
17135250Sbostic  *	array to do rnd() to create monsters <= a given level
17235250Sbostic  */
17335250Sbostic char monstlevel[] = { 5, 11, 17, 22, 27, 33, 39, 42, 46, 50, 53, 56, 59 };
17435250Sbostic 
17535250Sbostic struct monst monster[] = {
17635250Sbostic /*	NAME			LV	AC	DAM	ATT	DEF	GEN INT GOLD	HP	EXP
17735250Sbostic ----------------------------------------------------------------- */
17835250Sbostic { "",				0,	0,	0,	0,	0,	 0,  3,   0,	0,	0	},
17935250Sbostic { "bat",			1,	0,	1,	0,	0,	 0,  3,   0,	1,	1	},
18035250Sbostic { "gnome",			1,	10,	1,	0,	0,	 0,  8,  30,	2,	2	},
18135250Sbostic { "hobgoblin",		1,	14,	2,	0,	0,	 0,  5,  25,	3,	2	},
18235250Sbostic { "jackal",			1,	17,	1,	0,	0,	 0,  4,   0,	1,	1	},
18335250Sbostic { "kobold",			1,	20,	1,	0,	0,	 0,  7,  10,	1,	1	},
18435250Sbostic 
18535250Sbostic { "orc",			2,	12,	1,	0,	0,	 0,  9,  40,	4,	2	},
18635250Sbostic { "snake",			2,	15,	1,	0,	0,	 0,  3,   0,	3,	1	},
18735250Sbostic { "giant centipede",2,	14,	0,	4,	0,	 0,  3,   0,	1,	2	},
18835250Sbostic { "jaculi",			2,	20,	1,	0,	0,	 0,  3,   0,	2,	1	},
18935250Sbostic { "troglodyte",		2,	10,	2,	0,	0,	 0,  5,  80,	4,	3	},
19035250Sbostic { "giant ant",		2,	8,	1,	4,	0,	 0,  4,   0,	5,	5	},
19135250Sbostic 
19235250Sbostic /*	NAME			LV	AC	DAM	ATT	DEF	GEN INT GOLD	HP	EXP
19335250Sbostic ----------------------------------------------------------------- */
19435250Sbostic 
19535250Sbostic { "floating eye",	3,	8,	1,	0,	0,	 0,  3,   0,	 5,	 2	},
19635250Sbostic { "leprechaun",		3,	3,	0,	8,	0,	 0,  3,1500,    13,	45	},
19735250Sbostic { "nymph",			3,	3,	0,	14,	0,	 0,  9,   0,	18,	45	},
19835250Sbostic { "quasit",			3,	5,	3,	0,	0,	 0,  3,   0,	10,	15	},
19935250Sbostic { "rust monster",	3,	4,	0,	1,	0,	 0,  3,   0,	18,	25	},
20035250Sbostic { "zombie",			3,	12,	2,	0,	0,	 0,  3,   0,	 6,	 7	},
20135250Sbostic 
20235250Sbostic { "assassin bug",	4,	9,	3,	0,	0,	 0,  3,   0,	20,	15	},
20335250Sbostic { "bugbear",		4,	5,	4,	15,	0,	 0,  5,  40,	20,	35	},
20435250Sbostic { "hell hound",		4,	5,	2,	2,	0,	 0,  6,   0,	16,	35	},
20535250Sbostic { "ice lizard",		4,	11,	2,	10,	0,	 0,  6,  50,	16,	25	},
20635250Sbostic { "centaur",		4,	6,	4,	0,	0,	 0, 10,  40,	24,	45	},
20735250Sbostic 
20835250Sbostic /*	NAME			LV	AC	DAM	ATT	DEF	GEN INT GOLD	HP	EXP
20935250Sbostic ----------------------------------------------------------------- */
21035250Sbostic 
21135250Sbostic { "troll",			5,	4,	5,	0,	0,	 0,  9,  80,	50,	300	},
21235250Sbostic { "yeti",			5,	6,	4,	0,	0,	 0,  5,  50, 	35,	100	},
21335250Sbostic { "white dragon",	5,	2,	4,	5,	0,	 0, 16, 500,	55,	1000},
21435250Sbostic { "elf",			5,	8,	1,	0,	0,	 0, 15,  50,	22,	35	},
21535250Sbostic { "gelatinous cube",5,	9,	1,	0,	0,	 0,  3,   0,	22,	45	},
21635250Sbostic 
21735250Sbostic { "metamorph",		6,	7,	3,	0,	0,	 0,  3,  0,		30,	40	},
21835250Sbostic { "vortex",			6,	4,	3,	0,	0,	 0,  3,  0,		30,	55	},
21935250Sbostic { "ziller",			6,	15,	3,	0,	0,	 0,  3,  0,		30,	35	},
22035250Sbostic { "violet fungi",	6,	12,	3,	0,	0,	 0,  3,  0,	 	38,	100	},
22135250Sbostic { "wraith",			6,	3,	1,	6,	0,	 0,  3,  0,		30,	325	},
22235250Sbostic { "forvalaka",		6,	2,	5,	0,	0,	 0,  7,  0,		50,	280	},
22335250Sbostic 
22435250Sbostic /*	NAME			LV	AC	DAM	ATT	DEF	GEN INT GOLD	HP	EXP
22535250Sbostic ----------------------------------------------------------------- */
22635250Sbostic 
22735250Sbostic { "lama nobe",		7,	7,	3,	0,	0,	 0,  6,  0,		35,	80	},
22835250Sbostic { "osequip",		7,	4,	3,	16,	0,	 0,  4,  0,		35,	100	},
22935250Sbostic { "rothe",			7,	15,	5,	0,	0,	 0,  3,  100,	50,	250	},
23035250Sbostic { "xorn",			7,	0,	6,	0,	0,	 0, 13,  0,		60,	300	},
23135250Sbostic { "vampire",		7,	3,	4,	6,	0,	 0, 17,  0,		50,	1000},
23235250Sbostic { "invisible stalker",7,3,	6,	0,	0,	 0,  5,  0,		50,	350	},
23335250Sbostic 
23435250Sbostic { "poltergeist",	8,	1,	4,	0,	0,	 0,  3,  0,		50,	450	},
23535250Sbostic { "disenchantress",	8,	3,	0,	9,	0,	 0,  3,  0,		50,	500	},
23635250Sbostic { "shambling mound",8,	2,	5,	0,	0,	 0,  6,  0,		45,	400	},
23735250Sbostic { "yellow mold",	8,	12,	4,	0,	0,	 0,  3,  0,		35,	250	},
23835250Sbostic { "umber hulk",		8,	3,	7,	11,	0,	 0, 14,  0,		65,	600	},
23935250Sbostic 
24035250Sbostic /*	NAME			LV	AC	DAM	ATT	DEF	GEN INT GOLD	HP	EXP
24135250Sbostic ----------------------------------------------------------------- */
24235250Sbostic 
24335250Sbostic { "gnome king",		9,	-1,	10,	0,	0,	 0, 18,  2000,	100,3000	},
24435250Sbostic { "mimic",			9,	 5,	6,	0,	0,	 0,  8,  0,		55,	99		},
24535250Sbostic { "water lord",		9, -10,	15,	7,	0,	 0, 20,  0,		150,15000	},
24635250Sbostic { "bronze dragon",	9,	 2,	9,	3,	0,	 0, 16,  300,	80, 4000	},
24735250Sbostic { "green dragon",	9,	 3,	8,	10,	0,	 0, 15,  200,	70, 2500	},
24835250Sbostic { "purple worm",	9,	-1,	11,	0,	0,	 0,  3,  100,	120,15000	},
24935250Sbostic { "xvart",			9,	-2,	12,	0,	0,	 0, 13,  0,		90,	1000	},
25035250Sbostic 
25135250Sbostic { "spirit naga",	10, -20,12,	12,	0,	 0, 23,  0,		95, 20000	},
25235250Sbostic { "silver dragon",	10,	-1,	12,	3,	0,	 0, 20,  700,	100,10000	},
25335250Sbostic { "platinum dragon",10,	-5,	15,	13,	0,	 0, 22,  1000,	130,24000	},
25435250Sbostic { "green urchin",	10,	-3,	12,	0,	0,	 0,  3,  0,		85, 5000	},
25535250Sbostic { "red dragon",		10,	-2,	13,	3,	0,	 0, 19,  800,	110,14000	},
25635250Sbostic 
25735250Sbostic { "type I demon lord",	12,-30,	18,	0,	 0,  0, 20,	0,	140,50000	},
25835250Sbostic { "type II demon lord",	13,-30,	18,	0,	 0,  0, 21,	0,	160,75000	},
25935250Sbostic { "type III demon lord",14,-30,	18,	0,	 0,  0, 22,	0,	180,100000	},
26035250Sbostic { "type IV demon lord",	15,-35,	20,	0,	 0,  0, 23,	0,	200,125000	},
26135250Sbostic { "type V demon lord",	16,-40,	22,	0,	 0,  0, 24,	0,	220,150000	},
26235250Sbostic { "type VI demon lord",	17,-45,	24,	0,	 0,  0, 25,	0,	240,175000	},
26335250Sbostic { "type VII demon lord",18,-70,	27,	6,	 0,  0, 26,	0,	260,200000	},
26435250Sbostic { "demon prince",		25,-127,30,	6,	 0,  0, 28,	0,	345,300000	}
26535250Sbostic 
26635250Sbostic /*	NAME				LV	AC	DAM	ATT	DEF	GEN INT GOLD	HP	EXP
26735250Sbostic --------------------------------------------------------------------- */
26835250Sbostic  };
26935250Sbostic 
27035250Sbostic /*	name array for scrolls		*/
27135250Sbostic 
27235250Sbostic char *scrollname[] = {
27335250Sbostic "\0enchant armor",
27435250Sbostic "\0enchant weapon",
27535250Sbostic "\0enlightenment",
27635250Sbostic "\0blank paper",
27735250Sbostic "\0create monster",
27835250Sbostic "\0create artifact",
27935250Sbostic "\0aggravate monsters",
28035250Sbostic "\0time warp",
28135250Sbostic "\0teleportation",
28235250Sbostic "\0expanded awareness",
28335250Sbostic "\0haste monsters",
28435250Sbostic "\0monster healing",
28535250Sbostic "\0spirit protection",
28635250Sbostic "\0undead protection",
28735250Sbostic "\0stealth",
28835250Sbostic "\0magic mapping",
28935250Sbostic "\0hold monsters",
29035250Sbostic "\0gem perfection",
29135250Sbostic "\0spell extension",
29235250Sbostic "\0identify",
29335250Sbostic "\0remove curse",
29435250Sbostic "\0annihilation",
29535250Sbostic "\0pulverization",
29635250Sbostic "\0life protection",
29735250Sbostic "\0 ",
29835250Sbostic "\0 ",
29935250Sbostic "\0 ",
30035250Sbostic "\0 "
30135250Sbostic  };
30235250Sbostic 
30335250Sbostic /*	name array for magic potions	*/
30435250Sbostic char *potionname[] = {
30535250Sbostic "\0sleep",
30635250Sbostic "\0healing",
30735250Sbostic "\0raise level",
30835250Sbostic "\0increase ability",
30935250Sbostic "\0wisdom",
31035250Sbostic "\0strength",
31135250Sbostic "\0raise charisma",
31235250Sbostic "\0dizziness",
31335250Sbostic "\0learning",
31435250Sbostic "\0gold detection",
31535250Sbostic "\0monster detection",
31635250Sbostic "\0forgetfulness",
31735250Sbostic "\0water",
31835250Sbostic "\0blindness",
31935250Sbostic "\0confusion",
32035250Sbostic "\0heroism",
32135250Sbostic "\0sturdiness",
32235250Sbostic "\0giant strength",
32335250Sbostic "\0fire resistance",
32435250Sbostic "\0treasure finding",
32535250Sbostic "\0instant healing",
32635250Sbostic " cure dianthroritis",
32735250Sbostic "\0poison",
32835250Sbostic "\0see invisible",
32935250Sbostic "\0 ",
33035250Sbostic "\0 ",
33135250Sbostic "\0 ",
33235250Sbostic "\0 ",
33335250Sbostic "\0 ",
33435250Sbostic "\0 ",
33535250Sbostic "\0 ",
33635250Sbostic "\0 ",
33735250Sbostic "\0 ",
33835250Sbostic "\0 ",
33935250Sbostic "\0 "
34035250Sbostic  };
34135250Sbostic 
34235250Sbostic 
34335250Sbostic /*
34435250Sbostic 	spell data
34535250Sbostic  */
34635252Sbostic char spelknow[SPNUM]={0};
34735250Sbostic char splev[] = { 1, 4, 9, 14, 18, 22, 26, 29, 32, 35, 37, 37, 37, 37, 37 };
34835250Sbostic 
34935250Sbostic char *spelcode[]={
35035250Sbostic 	"pro",	"mle",	"dex",	"sle",	"chm",	"ssp",
35135250Sbostic 	"web",	"str",	"enl",	"hel",	"cbl",	"cre",	"pha",	"inv",
35235250Sbostic 	"bal",	"cld",	"ply",	"can",	"has",	"ckl",	"vpr",
35335250Sbostic 	"dry",	"lit",	"drl",	"glo",	"flo",	"fgr",
35435250Sbostic 	"sca",	"hld",	"stp",	"tel",	"mfi", /* 31 */
35535250Sbostic 	"sph",	"gen",	"sum",	"wtw",	"alt",	"per"
35635250Sbostic  };
35735250Sbostic 
35835250Sbostic char *spelname[]={
35935250Sbostic 	"protection",				"magic missile",		"dexterity",
36035250Sbostic 	"sleep",					"charm monster",		"sonic spear",
36135250Sbostic 
36235250Sbostic 	"web",						"strength",				"enlightenment",
36335250Sbostic 	"healing",					"cure blindness",		"create monster",
36435250Sbostic 	"phantasmal forces",		"invisibility",
36535250Sbostic 
36635250Sbostic 	"fireball",					"cold",					"polymorph",
36735250Sbostic 	"cancellation",				"haste self",			"cloud kill",
36835250Sbostic 	"vaporize rock",
36935250Sbostic 
37035250Sbostic 	"dehydration",				"lightning",			"drain life",
37135250Sbostic 	"invulnerability",			"flood",				"finger of death",
37235250Sbostic 
37335250Sbostic 	"scare monster",			"hold monster",			"time stop",
37435250Sbostic 	"teleport away",			"magic fire",
37535250Sbostic 
37635250Sbostic 	"sphere of annihilation",	"genocide",				"summon demon",
37735250Sbostic 	"walk through walls",		"alter reality",		"permanence",
37835250Sbostic 	""
37935250Sbostic  };
38035250Sbostic 
38135250Sbostic char *speldescript[]={
38235250Sbostic /* 1 */
38335250Sbostic 	"generates a +2 protection field",
38435250Sbostic 	"creates and hurls a magic missile equivalent to a + 1 magic arrow",
38535250Sbostic 	"adds +2 to the casters dexterity",
38635250Sbostic 	"causes some monsters to go to sleep",
38735250Sbostic 	"some monsters may be awed at your magnificence",
38835250Sbostic 	"causes your hands to emit a screeching sound toward what they point",
38935250Sbostic /* 7 */
39035250Sbostic 	"causes strands of sticky thread to entangle an enemy",
39135250Sbostic 	"adds +2 to the casters strength for a short term",
39235250Sbostic 	"the caster becomes aware of things around him",
39335250Sbostic 	"restores some hp to the caster",
39435250Sbostic 	"restores sight to one so unfortunate as to be blinded",
39535250Sbostic 	"creates a monster near the caster appropriate for the location",
39635250Sbostic 	"creates illusions, and if believed, monsters die",
39735250Sbostic 	"the caster becomes invisible",
39835250Sbostic /* 15 */
39935250Sbostic 	"makes a ball of fire that burns on what it hits",
40035250Sbostic 	"sends forth a cone of cold which freezes what it touches",
40135250Sbostic 	"you can find out what this does for yourself",
40235250Sbostic 	"negates the ability of a monster to use his special abilities",
40335250Sbostic 	"speeds up the casters movements",
40435250Sbostic 	"creates a fog of poisonous gas which kills all that is within it",
40535250Sbostic 	"this changes rock to air",
40635250Sbostic /* 22 */
40735250Sbostic 	"dries up water in the immediate vicinity",
40835250Sbostic 	"you finger will emit a lightning bolt when this spell is cast",
40935250Sbostic 	"subtracts hit points from both you and a monster",
41035250Sbostic 	"this globe helps to protect the player from physical attack",
41135250Sbostic 	"this creates an avalanche of H2O to flood the immediate chamber",
41235250Sbostic 	"this is a holy spell and calls upon your god to back you up",
41335250Sbostic /* 28 */
41435250Sbostic 	"terrifies the monster so that hopefully he wont hit the magic user",
41535250Sbostic 	"the monster is frozen in his tracks if this is successful",
41635250Sbostic 	"all movement in the caverns ceases for a limited duration",
41735250Sbostic 	"moves a particular monster around in the dungeon (hopefully away from you)",
41835250Sbostic 	"this causes a curtain of fire to appear all around you",
41935250Sbostic /* 33 */
42035250Sbostic 	"anything caught in this sphere is instantly killed.  Warning -- dangerous",
42135250Sbostic 	"eliminates a species of monster from the game -- use sparingly",
42235250Sbostic 	"summons a demon who hopefully helps you out",
42335250Sbostic 	"allows the player to walk through walls for a short period of time",
42435250Sbostic 	"god only knows what this will do",
42535250Sbostic 	"makes a character spell permanent, i. e. protection, strength, etc.",
42635250Sbostic 	""
42735250Sbostic  };
42835250Sbostic 
42935250Sbostic char spelweird[MAXMONST+8][SPNUM] = {
43035250Sbostic /*                      p m d s c s    w s e h c c p i    b c p c h c v    d l d g f f    s h s t m    s g s w a p */
43135250Sbostic /*                      r l e l h s    e t n e b r h n    a l l a a k p    r i r l l g    c l t e f    p e u t l e */
43235250Sbostic /*                      o e x e m p    b r l l l e a v    l d y n s l r    y t l o o r    a d p l i    h n m w t r */
43335250Sbostic 
43435250Sbostic 
43535250Sbostic /*            bat */ {  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,   0,0,0,0,0,0 },
43635250Sbostic /*          gnome */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
43735250Sbostic /*      hobgoblin */ {  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,   0,0,0,0,0,0 },
43835250Sbostic /*         jackal */ {  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,   0,0,0,0,0,0 },
43935250Sbostic /*         kobold */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
44035250Sbostic 
44135250Sbostic /*            orc */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   4,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
44235250Sbostic /*          snake */ {  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,   0,0,0,0,0,0 },
44335250Sbostic /*giant centipede */ {  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,   0,0,0,0,0,0 },
44435250Sbostic /*         jaculi */ {  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,   0,0,0,0,0,0 },
44535250Sbostic /*     troglodyte */ {  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,   0,0,0,0,0,0 },
44635250Sbostic 
44735250Sbostic /*      giant ant */ {  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,   0,0,0,0,0,0 },
44835250Sbostic /*   floating eye */ {  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,   0,0,0,0,0,0 },
44935250Sbostic /*     leprechaun */ {  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,   0,0,0,0,0,0 },
45035250Sbostic /*          nymph */ {  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,   0,0,0,0,0,0 },
45135250Sbostic /*         quasit */ {  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,   0,0,0,0,0,0 },
45235250Sbostic 
45335250Sbostic /*   rust monster */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   4,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
45435250Sbostic /*         zombie */ {  0,0,0,8,0,4,   0,0,0,0,0,0,0,0,   0,0,0,0,0,4,0,   4,0,0,0,0,4,   0,0,0,0,0,   0,0,0,0,0,0 },
45535250Sbostic /*   assassin bug */ {  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,   0,0,0,0,0,0 },
45635250Sbostic /*        bugbear */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
45735250Sbostic /*     hell hound */ {  0,6,0,0,0,0,   12,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 },
45835250Sbostic 
45935250Sbostic /*     ice lizard */ {  0,0,0,0,0,0,   11,0,0,0,0,0,0,0,  0,15,0,0,0,0,0,  0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
46035250Sbostic /*        centaur */ {  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,   0,0,0,0,0,0 },
46135250Sbostic /*          troll */ {  0,7,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   4,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
46235250Sbostic /*           yeti */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,15,0,0,0,0,0,  0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
46335250Sbostic /*   white dragon */ {  0,0,0,0,0,0,   0,0,0,0,0,0,14,0,  0,15,0,0,0,0,0,  4,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
46435250Sbostic 
46535250Sbostic /*            elf */ {  0,0,0,0,0,0,   0,0,0,0,0,0,14,5,  0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
46635250Sbostic /*gelatinous cube */ {  0,0,0,0,0,0,   2,0,0,0,0,0,0,0,   0,0,0,0,0,4,0,   0,0,0,0,0,4,   0,0,0,0,0,   0,0,0,0,0,0 },
46735250Sbostic /*      metamorph */ {  0,13,0,0,0,0,  2,0,0,0,0,0,0,0,   0,0,0,0,0,4,0,   4,0,0,0,0,4,   0,0,0,0,0,   0,0,0,0,0,0 },
46835250Sbostic /*         vortex */ {  0,13,0,0,0,10, 1,0,0,0,0,0,0,0,   0,0,0,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   0,0,0,0,0,0 },
46935250Sbostic /*         ziller */ {  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,   0,0,0,0,0,0 },
47035250Sbostic 
47135250Sbostic /*   violet fungi */ {  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,   0,0,0,0,0,0 },
47235250Sbostic /*         wraith */ {  0,0,0,8,0,4,   0,0,0,0,0,0,0,0,   0,0,0,0,0,4,0,   4,0,0,0,0,4,   0,0,0,0,0,   0,0,0,0,0,0 },
47335250Sbostic /*      forvalaka */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
47435250Sbostic /*      lama nobe */ {  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,   0,0,0,0,0,0 },
47535250Sbostic /*        osequip */ {  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,   0,0,0,0,0,0 },
47635250Sbostic 
47735250Sbostic /*          rothe */ {  0,7,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
47835250Sbostic /*           xorn */ {  0,7,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   4,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
47935250Sbostic /*        vampire */ {  0,0,0,8,0,4,   0,0,0,0,0,0,0,0,   0,0,0,0,0,4,0,   0,0,0,0,0,4,   0,0,0,0,0,   0,0,0,0,0,0 },
48035250Sbostic /*invisible staker*/ {  0,0,0,0,0,0,   1,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 },
48135250Sbostic /*    poltergeist */ {  0,13,0,8,0,4,  1,0,0,0,0,0,0,0,   0,4,0,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   0,0,0,0,0,0 },
48235250Sbostic 
48335250Sbostic /* disenchantress */ {  0,0,0,8,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,0,0 },
48435250Sbostic /*shambling mound */ {  0,0,0,0,0,10,  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 },
48535250Sbostic /*    yellow mold */ {  0,0,0,8,0,0,   1,0,0,0,0,0,4,0,   0,0,0,0,0,4,0,   0,0,0,0,0,4,   0,0,0,0,0,   0,0,0,0,0,0 },
48635250Sbostic /*     umber hulk */ {  0,7,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
48735250Sbostic /*     gnome king */ {  0,7,0,0,3,0,   0,0,0,0,0,0,0,5,   0,0,9,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
48835250Sbostic 
48935250Sbostic /*          mimic */ {  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,   0,0,0,0,0,0 },
49035250Sbostic /*     water lord */ {  0,13,0,8,3,4,  1,0,0,0,0,0,0,0,   0,0,9,0,0,4,0,   0,0,0,0,16,4,  0,0,0,0,0,   0,0,0,0,0,0 },
49135250Sbostic /*  bronze dragon */ {  0,7,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,0,0,0,0 },
49235250Sbostic /*   green dragon */ {  0,7,0,0,0,0,   11,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 },
49335250Sbostic /*    purple worm */ {  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,   0,0,0,0,0,0 },
49435250Sbostic 
49535250Sbostic /*          xvart */ {  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,   0,0,0,0,0,0 },
49635250Sbostic /*    spirit naga */ {  0,13,0,8,3,4,  1,0,0,0,0,0,0,5,   0,4,9,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   0,0,0,0,0,0 },
49735250Sbostic /*  silver dragon */ {  0,6,0,9,0,0,   12,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 },
49835250Sbostic /*platinum dragon */ {  0,7,0,9,0,0,   11,0,0,0,0,0,14,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 },
49935250Sbostic /*   green urchin */ {  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,   0,0,0,0,0,0 },
50035250Sbostic /*     red dragon */ {  0,6,0,0,0,0,   12,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 },
50135250Sbostic 
50235250Sbostic /*                      p m d s c s    w s e h c c p i    b c p c h c v    d l d g f f    s h s t m    s g s w a p */
50335250Sbostic /*                      r l e l h s    e t n e b r h n    a l l a a k p    r i r l l g    c l t e f    p e u t l e */
50435250Sbostic /*                      o e x e m p    b r l l l e a v    l d y n s l r    y t l o o r    a d p l i    h n m w t r */
50535250Sbostic 
50635250Sbostic /*     demon lord */ {  0,7,0,4,3,0,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   9,0,0,0,0,0 },
50735250Sbostic /*     demon lord */ {  0,7,0,4,3,0,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   9,0,0,0,0,0 },
50835250Sbostic /*     demon lord */ {  0,7,0,4,3,0,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   9,0,0,0,0,0 },
50935250Sbostic /*     demon lord */ {  0,7,0,4,3,0,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   9,0,0,0,0,0 },
51035250Sbostic /*     demon lord */ {  0,7,0,4,3,0,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   9,0,0,0,0,0 },
51135250Sbostic /*     demon lord */ {  0,7,0,4,3,0,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   9,0,0,0,0,0 },
51235250Sbostic /*     demon lord */ {  0,7,0,4,3,0,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   9,0,0,0,0,0 },
51335250Sbostic /*   demon prince */ {  0,7,0,4,3,9,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   4,0,0,0,4,   9,0,0,0,0,0 }
51435250Sbostic 
51535250Sbostic  };
51635250Sbostic 
51735250Sbostic char *spelmes[] = { "",
51835250Sbostic /*  1 */	"the web had no effect on the %s",
51935250Sbostic /*  2 */	"the %s changed shape to avoid the web",
52035250Sbostic /*  3 */	"the %s isn't afraid of you",
52135250Sbostic /*  4 */	"the %s isn't affected",
52235250Sbostic /*  5 */	"the %s can see you with his infravision",
52335250Sbostic /*  6 */	"the %s vaporizes your missile",
52435250Sbostic /*  7 */	"your missile bounces off the %s",
52535250Sbostic /*  8 */	"the %s doesn't sleep",
52635250Sbostic /*  9 */	"the %s resists",
52735250Sbostic /* 10 */	"the %s can't hear the noise",
52835250Sbostic /* 11 */	"the %s's tail cuts it free of the web",
52935250Sbostic /* 12 */	"the %s burns through the web",
53035250Sbostic /* 13 */	"your missiles pass right through the %s",
53135250Sbostic /* 14 */	"the %s sees through your illusions",
53235250Sbostic /* 15 */	"the %s loves the cold!",
53335250Sbostic /* 16 */	"the %s loves the water!"
53435250Sbostic  };
53535250Sbostic 
53635250Sbostic char to_lower[]= /* tolower[character] = lower case converted character */
53735250Sbostic     {
53835250Sbostic     0000,0001,0002,0003,0004,0005,0006,0007,0010,0011,0012,0013,0014,0015,0016,0017, /* NUL-SI*/
53935250Sbostic     0020,0021,0022,0023,0024,0025,0026,0027,0030,0031,0032,0033,0034,0035,0036,0037, /* DLE-US*/
54035250Sbostic     0040,0041,0042,0043,0044,0045,0046,0047,0050,0051,0052,0053,0054,0055,0056,0057, /* SP-/ */
54135250Sbostic     0060,0061,0062,0063,0064,0065,0066,0067,0070,0071,0072,0073,0074,0075,0076,0077, /* 0-? */
54235250Sbostic     0100,0141,0142,0143,0144,0145,0146,0147,0150,0151,0152,0153,0154,0155,0156,0157, /* @-O */
54335250Sbostic     0160,0161,0162,0163,0164,0165,0166,0167,0170,0171,0172,0133,0134,0135,0136,0137, /* P-_ */
54435250Sbostic     0140,0141,0142,0143,0144,0145,0146,0147,0150,0151,0152,0153,0154,0155,0156,0157, /* `-o */
54535250Sbostic     0160,0161,0162,0163,0164,0165,0166,0167,0170,0171,0172,0173,0174,0175,0176,0177, /* p-DEL */
54635250Sbostic     };
54735250Sbostic 
54835250Sbostic char to_upper[]= /* toupper[character] = upper case converted character */
54935250Sbostic     {
55035250Sbostic     0000,0001,0002,0003,0004,0005,0006,0007,0010,0011,0012,0013,0014,0015,0016,0017, /* NUL-SI*/
55135250Sbostic     0020,0021,0022,0023,0024,0025,0026,0027,0030,0031,0032,0033,0034,0035,0036,0037, /* DLE-US*/
55235250Sbostic     0040,0041,0042,0043,0044,0045,0046,0047,0050,0051,0052,0053,0054,0055,0056,0057, /* SP-/ */
55335250Sbostic     0060,0061,0062,0063,0064,0065,0066,0067,0070,0071,0072,0073,0074,0075,0076,0077, /* 0-? */
55435250Sbostic     0100,0101,0102,0103,0104,0105,0106,0107,0110,0111,0112,0113,0114,0115,0116,0117, /* @-O */
55535250Sbostic     0120,0121,0122,0123,0124,0125,0126,0127,0130,0131,0132,0133,0134,0135,0136,0137, /* P-_ */
55635250Sbostic     0140,0101,0102,0103,0104,0105,0106,0107,0110,0111,0112,0113,0114,0115,0116,0117, /* `-o */
55735250Sbostic     0120,0121,0122,0123,0124,0125,0126,0127,0130,0131,0132,0173,0174,0175,0176,0177, /* p-DEL */
55835250Sbostic     };
55935250Sbostic 
56035250Sbostic char is_digit[]=  /* isdigit[character] = TRUE || FALSE */
56135250Sbostic     {
56235250Sbostic     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* NUL-SI*/
56335250Sbostic     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* DLE-US*/
56435250Sbostic     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* SP-/ */
56535250Sbostic     1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, /* 0-? */
56635250Sbostic     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* @-O */
56735250Sbostic     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* P-_ */
56835250Sbostic     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* `-o */
56935250Sbostic     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* p-DEL */
57035250Sbostic     };
57135250Sbostic 
57235250Sbostic char is_alpha[]=  /* isalpha[character] = TRUE || FALSE */
57335250Sbostic     {
57435250Sbostic     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* NUL-SI*/
57535250Sbostic     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* DLE-US*/
57635250Sbostic     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* SP-/ */
57735250Sbostic     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0-? */
57835250Sbostic     0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* @-O */
57935250Sbostic     1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* P-_ */
58035250Sbostic     0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* `-o */
58135250Sbostic     1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* p-DEL */
58235250Sbostic     };
58335250Sbostic 
58435250Sbostic /*
58535250Sbostic  *	function to create scroll numbers with appropriate probability of
58635250Sbostic  *	occurrence
58735250Sbostic  *
58835250Sbostic  *	0 - armor			1 - weapon		2 - enlightenment	3 - paper
58935250Sbostic  *	4 - create monster	5 - create item	6 - aggravate		7 - time warp
59035250Sbostic  *	8 - teleportation	9 - expanded awareness				10 - haste monst
59135250Sbostic  *	11 - heal monster	12 - spirit protection		13 - undead protection
59235250Sbostic  *	14 - stealth		15 - magic mapping			16 - hold monster
59335250Sbostic  *	17 - gem perfection 18 - spell extension		19 - identify
59435250Sbostic  *	20 - remove curse	21 - annihilation			22 - pulverization
59535250Sbostic  *  23 - life protection
59635250Sbostic  */
59735250Sbostic char scprob[]= { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3,
59835250Sbostic 	3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9,
59935250Sbostic 	9, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14,
60035250Sbostic 	15, 15, 16, 16, 16, 17, 17, 18, 18, 19, 19, 19, 20, 20, 20, 20, 21, 22,
60135250Sbostic 	22, 22, 23 };
60235250Sbostic 
60335250Sbostic /*
60435250Sbostic  *	function to return a potion number created with appropriate probability
60535250Sbostic  *	of occurrence
60635250Sbostic  *
60735250Sbostic  *	0 - sleep				1 - healing					2 - raise level
60835250Sbostic  *	3 - increase ability	4 - gain wisdom				5 - gain strength
60935250Sbostic  *	6 - charismatic character	7 - dizziness			8 - learning
61035250Sbostic  *	9 - gold detection		10 - monster detection		11 - forgetfulness
61135250Sbostic  *	12 - water				13 - blindness				14 - confusion
61235250Sbostic  *	15 - heroism			16 - sturdiness				17 - giant strength
61335250Sbostic  *	18 - fire resistance	19 - treasure finding		20 - instant healing
61435250Sbostic  *	21 - cure dianthroritis	22 - poison					23 - see invisible
61535250Sbostic  */
61635250Sbostic char potprob[] = { 0, 0, 1, 1, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 20, 22, 22, 23, 23 };
61735250Sbostic 
61835250Sbostic char nlpts[] = { 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7 };
61935250Sbostic char nch[] = { 0, 0, 0, 1, 1, 1, 2, 2, 3, 4 };
62035250Sbostic char nplt[] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 4 };
62135250Sbostic char ndgg[] = { 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 5 };
62235250Sbostic char nsw[] = { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 3 };
623