data.c revision 1.1 1 1.1 cgd /*-
2 1.1 cgd * Copyright (c) 1988 The Regents of the University of California.
3 1.1 cgd * All rights reserved.
4 1.1 cgd *
5 1.1 cgd * Redistribution and use in source and binary forms, with or without
6 1.1 cgd * modification, are permitted provided that the following conditions
7 1.1 cgd * are met:
8 1.1 cgd * 1. Redistributions of source code must retain the above copyright
9 1.1 cgd * notice, this list of conditions and the following disclaimer.
10 1.1 cgd * 2. Redistributions in binary form must reproduce the above copyright
11 1.1 cgd * notice, this list of conditions and the following disclaimer in the
12 1.1 cgd * documentation and/or other materials provided with the distribution.
13 1.1 cgd * 3. All advertising materials mentioning features or use of this software
14 1.1 cgd * must display the following acknowledgement:
15 1.1 cgd * This product includes software developed by the University of
16 1.1 cgd * California, Berkeley and its contributors.
17 1.1 cgd * 4. Neither the name of the University nor the names of its contributors
18 1.1 cgd * may be used to endorse or promote products derived from this software
19 1.1 cgd * without specific prior written permission.
20 1.1 cgd *
21 1.1 cgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 1.1 cgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 1.1 cgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 1.1 cgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 1.1 cgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 1.1 cgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 1.1 cgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 1.1 cgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 1.1 cgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 1.1 cgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 1.1 cgd * SUCH DAMAGE.
32 1.1 cgd */
33 1.1 cgd
34 1.1 cgd #ifndef lint
35 1.1 cgd static char sccsid[] = "@(#)data.c 5.3 (Berkeley) 5/13/91";
36 1.1 cgd #endif /* not lint */
37 1.1 cgd
38 1.1 cgd /* data.c Larn is copyrighted 1986 by Noah Morgan. */
39 1.1 cgd #define NODEFS
40 1.1 cgd #include "header.h"
41 1.1 cgd
42 1.1 cgd /*
43 1.1 cgd class[c[LEVEL]-1] gives the correct name of the players experience level
44 1.1 cgd */
45 1.1 cgd static char aa1[] = " mighty evil master";
46 1.1 cgd static char aa2[] = "apprentice demi-god";
47 1.1 cgd static char aa3[] = " minor demi-god ";
48 1.1 cgd static char aa4[] = " major demi-god ";
49 1.1 cgd static char aa5[] = " minor deity ";
50 1.1 cgd static char aa6[] = " major deity ";
51 1.1 cgd static char aa7[] = " novice guardian ";
52 1.1 cgd static char aa8[] = "apprentice guardian";
53 1.1 cgd static char aa9[] = " The Creator ";
54 1.1 cgd char *class[]=
55 1.1 cgd { " novice explorer ", "apprentice explorer", " practiced explorer",/* -3*/
56 1.1 cgd " expert explorer ", " novice adventurer", " adventurer ",/* -6*/
57 1.1 cgd "apprentice conjurer", " conjurer ", " master conjurer ",/* -9*/
58 1.1 cgd " apprentice mage ", " mage ", " experienced mage ",/* -12*/
59 1.1 cgd " master mage ", " apprentice warlord", " novice warlord ",/* -15*/
60 1.1 cgd " expert warlord ", " master warlord ", " apprentice gorgon ",/* -18*/
61 1.1 cgd " gorgon ", " practiced gorgon ", " master gorgon ",/* -21*/
62 1.1 cgd " demi-gorgon ", " evil master ", " great evil master ",/* -24*/
63 1.1 cgd aa1 , aa1 , aa1 ,/* -27*/
64 1.1 cgd aa1 , aa1 , aa1 ,/* -30*/
65 1.1 cgd aa1 , aa1 , aa1 ,/* -33*/
66 1.1 cgd aa1 , aa1 , aa1 ,/* -36*/
67 1.1 cgd aa1 , aa1 , aa1 ,/* -39*/
68 1.1 cgd aa2 , aa2 , aa2 ,/* -42*/
69 1.1 cgd aa2 , aa2 , aa2 ,/* -45*/
70 1.1 cgd aa2 , aa2 , aa2 ,/* -48*/
71 1.1 cgd aa3 , aa3 , aa3 ,/* -51*/
72 1.1 cgd aa3 , aa3 , aa3 ,/* -54*/
73 1.1 cgd aa3 , aa3 , aa3 ,/* -57*/
74 1.1 cgd aa4 , aa4 , aa4 ,/* -60*/
75 1.1 cgd aa4 , aa4 , aa4 ,/* -63*/
76 1.1 cgd aa4 , aa4 , aa4 ,/* -66*/
77 1.1 cgd aa5 , aa5 , aa5 ,/* -69*/
78 1.1 cgd aa5 , aa5 , aa5 ,/* -72*/
79 1.1 cgd aa5 , aa5 , aa5 ,/* -75*/
80 1.1 cgd aa6 , aa6 , aa6 ,/* -78*/
81 1.1 cgd aa6 , aa6 , aa6 ,/* -81*/
82 1.1 cgd aa6 , aa6 , aa6 ,/* -84*/
83 1.1 cgd aa7 , aa7 , aa7 ,/* -87*/
84 1.1 cgd aa8 , aa8 , aa8 ,/* -90*/
85 1.1 cgd aa8 , aa8 , aa8 ,/* -93*/
86 1.1 cgd " earth guardian ", " air guardian ", " fire guardian ",/* -96*/
87 1.1 cgd " water guardian ", " time guardian ", " ethereal guardian ",/* -99*/
88 1.1 cgd aa9 , aa9 , aa9 ,/* -102*/
89 1.1 cgd };
90 1.1 cgd
91 1.1 cgd /*
92 1.1 cgd table of experience needed to be a certain level of player
93 1.1 cgd skill[c[LEVEL]] is the experience required to attain the next level
94 1.1 cgd */
95 1.1 cgd #define MEG 1000000
96 1.1 cgd long skill[] = {
97 1.1 cgd 0, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, /* 1-11 */
98 1.1 cgd 10240, 20480, 40960, 100000, 200000, 400000, 700000, 1*MEG, /* 12-19 */
99 1.1 cgd 2*MEG,3*MEG,4*MEG,5*MEG,6*MEG,8*MEG,10*MEG, /* 20-26 */
100 1.1 cgd 12*MEG,14*MEG,16*MEG,18*MEG,20*MEG,22*MEG,24*MEG,26*MEG,28*MEG, /* 27-35 */
101 1.1 cgd 30*MEG,32*MEG,34*MEG,36*MEG,38*MEG,40*MEG,42*MEG,44*MEG,46*MEG, /* 36-44 */
102 1.1 cgd 48*MEG,50*MEG,52*MEG,54*MEG,56*MEG,58*MEG,60*MEG,62*MEG,64*MEG, /* 45-53 */
103 1.1 cgd 66*MEG,68*MEG,70*MEG,72*MEG,74*MEG,76*MEG,78*MEG,80*MEG,82*MEG, /* 54-62 */
104 1.1 cgd 84*MEG,86*MEG,88*MEG,90*MEG,92*MEG,94*MEG,96*MEG,98*MEG,100*MEG, /* 63-71 */
105 1.1 cgd 105*MEG,110*MEG,115*MEG,120*MEG, 125*MEG, 130*MEG, 135*MEG, 140*MEG, /* 72-79 */
106 1.1 cgd 145*MEG,150*MEG,155*MEG,160*MEG, 165*MEG, 170*MEG, 175*MEG, 180*MEG, /* 80-87 */
107 1.1 cgd 185*MEG,190*MEG,195*MEG,200*MEG, 210*MEG, 220*MEG, 230*MEG, 240*MEG, /* 88-95 */
108 1.1 cgd 250*MEG,260*MEG,270*MEG,280*MEG, 290*MEG, 300*MEG /* 96-101*/
109 1.1 cgd };
110 1.1 cgd #undef MEG
111 1.1 cgd
112 1.1 cgd char *lpbuf,*lpnt,*inbuffer,*lpend; /* input/output pointers to the buffers */
113 1.1 cgd struct cel *cell; /* pointer to the dungeon storage */
114 1.1 cgd short hitp[MAXX][MAXY]; /* monster hp on level */
115 1.1 cgd short iarg[MAXX][MAXY]; /* arg for the item array */
116 1.1 cgd char item[MAXX][MAXY]; /* objects in maze if any */
117 1.1 cgd char know[MAXX][MAXY]; /* 1 or 0 if here before */
118 1.1 cgd char mitem[MAXX][MAXY]; /* monster item array */
119 1.1 cgd char moved[MAXX][MAXY]; /* monster movement flags */
120 1.1 cgd char stealth[MAXX][MAXY]; /* 0=sleeping 1=awake monst*/
121 1.1 cgd char iven[26]; /* inventory for player */
122 1.1 cgd short ivenarg[26]; /* inventory for player */
123 1.1 cgd char lastmonst[40]; /* this has the name of the current monster */
124 1.1 cgd char beenhere[MAXLEVEL+MAXVLEVEL]={0}; /* 1 if have been on this level */
125 1.1 cgd char VERSION=VER; /* this is the present version # of the program */
126 1.1 cgd char SUBVERSION=SUBVER;
127 1.1 cgd char nosignal=0; /* set to 1 to disable the signals from doing anything */
128 1.1 cgd char predostuff=0; /* 2 means that the trap handling routines must do a
129 1.1 cgd showplayer() after a trap. 0 means don't showplayer()
130 1.1 cgd 0 - we are in create player screen
131 1.1 cgd 1 - we are in welcome screen
132 1.1 cgd 2 - we are in the normal game */
133 1.1 cgd char loginname[20]; /* players login name */
134 1.1 cgd char logname[LOGNAMESIZE]; /* players name storage for scoring */
135 1.1 cgd char sex=1; /* default is a man 0=woman */
136 1.1 cgd char boldon=1; /* 1=bold objects 0=inverse objects */
137 1.1 cgd char ckpflag=0; /* 1 if want checkpointing of game, 0 otherwise */
138 1.1 cgd char cheat=0; /* 1 if the player has fudged save file */
139 1.1 cgd char level=0; /* cavelevel player is on = c[CAVELEVEL] */
140 1.1 cgd char wizard=0; /* the wizard mode flag */
141 1.1 cgd short lastnum=0; /* the number of the monster last hitting player */
142 1.1 cgd short hitflag=0; /* flag for if player has been hit when running */
143 1.1 cgd short hit2flag=0; /* flag for if player has been hit when running */
144 1.1 cgd short hit3flag=0; /* flag for if player has been hit flush input */
145 1.1 cgd short playerx,playery; /* the room on the present level of the player */
146 1.1 cgd short lastpx,lastpy; /* 0 --- MAXX-1 or 0 --- MAXY-1 */
147 1.1 cgd short oldx,oldy;
148 1.1 cgd short lasthx=0,lasthy=0; /* location of monster last hit by player */
149 1.1 cgd short nobeep=0; /* true if program is not to beep */
150 1.1 cgd unsigned long randx=33601; /* the random number seed */
151 1.1 cgd long initialtime=0; /* time playing began */
152 1.1 cgd long gtime=0; /* the clock for the game */
153 1.1 cgd long outstanding_taxes=0; /* present tax bill from score file */
154 1.1 cgd long c[100],cbak[100]; /* the character description arrays */
155 1.1 cgd int enable_scroll=0; /* constant for enabled/disabled scrolling regn */
156 1.1 cgd char aborted[] = " aborted";
157 1.1 cgd struct sphere *spheres=0; /*pointer to linked list for spheres of annihilation*/
158 1.1 cgd char *levelname[]=
159 1.1 cgd { " H"," 1"," 2"," 3"," 4"," 5"," 6"," 7"," 8"," 9","10","V1","V2","V3" };
160 1.1 cgd
161 1.1 cgd char objnamelist[]=" ATOP%^F&^+M=%^$$f*OD#~][[)))(((||||||||{?!BC}o:@.<<<<EVV))([[]]](^ [H*** ^^ S tsTLc............................................";
162 1.1 cgd char monstnamelist[]=" BGHJKOScjtAELNQRZabhiCTYdegmvzFWflorXV pqsyUkMwDDPxnDDuD ...............................................................";
163 1.1 cgd char *objectname[]=
164 1.1 cgd { 0,"a holy altar","a handsome jewel encrusted throne","the orb","a pit",
165 1.1 cgd "a staircase leading upwards","an elevator going up","a bubbling fountain",
166 1.1 cgd "a great marble statue","a teleport trap","the college of Larn",
167 1.1 cgd "a mirror","the DND store","a staircase going down","an elevator going down",
168 1.1 cgd "the bank of Larn","the 5th branch of the Bank of Larn",
169 1.1 cgd "a dead fountain","gold","an open door","a closed door",
170 1.1 cgd "a wall","The Eye of Larn","plate mail","chain mail","leather armor",
171 1.1 cgd "a sword of slashing","Bessman's flailing hammer","a sunsword",
172 1.1 cgd "a two handed sword","a spear","a dagger",
173 1.1 cgd "ring of extra regeneration","a ring of regeneration","a ring of protection",
174 1.1 cgd "an energy ring","a ring of dexterity","a ring of strength",
175 1.1 cgd "a ring of cleverness","a ring of increase damage","a belt of striking",
176 1.1 cgd "a magic scroll","a magic potion","a book","a chest",
177 1.1 cgd "an amulet of invisibility","an orb of dragon slaying",
178 1.1 cgd "a scarab of negate spirit","a cube of undead control",
179 1.1 cgd "device of theft prevention","a brilliant diamond","a ruby",
180 1.1 cgd "an enchanting emerald","a sparkling sapphire","the dungeon entrance",
181 1.1 cgd "a volcanic shaft leaning downward","the base of a volcanic shaft",
182 1.1 cgd "a battle axe","a longsword","a flail","ring mail","studded leather armor",
183 1.1 cgd "splint mail","plate armor","stainless plate armor","a lance of death",
184 1.1 cgd "an arrow trap","an arrow trap","a shield","your home",
185 1.1 cgd "gold","gold","gold","a dart trap",
186 1.1 cgd "a dart trap","a trapdoor","a trapdoor","the local trading post",
187 1.1 cgd "a teleport trap", "a massive throne",
188 1.1 cgd "a sphere of annihilation","a handsome jewel encrusted throne",
189 1.1 cgd "the Larn Revenue Service","a fortune cookie","","","","","","",
190 1.1 cgd "","","","","","","","","","","","","","","","","","","",""
191 1.1 cgd };
192 1.1 cgd
193 1.1 cgd
194 1.1 cgd /*
196 1.1 cgd * for the monster data
197 1.1 cgd *
198 1.1 cgd * array to do rnd() to create monsters <= a given level
199 1.1 cgd */
200 1.1 cgd char monstlevel[] = { 5, 11, 17, 22, 27, 33, 39, 42, 46, 50, 53, 56, 59 };
201 1.1 cgd
202 1.1 cgd struct monst monster[] = {
203 1.1 cgd /* NAME LV AC DAM ATT DEF GEN INT GOLD HP EXP
204 1.1 cgd ----------------------------------------------------------------- */
205 1.1 cgd { "", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0 },
206 1.1 cgd { "bat", 1, 0, 1, 0, 0, 0, 3, 0, 1, 1 },
207 1.1 cgd { "gnome", 1, 10, 1, 0, 0, 0, 8, 30, 2, 2 },
208 1.1 cgd { "hobgoblin", 1, 14, 2, 0, 0, 0, 5, 25, 3, 2 },
209 1.1 cgd { "jackal", 1, 17, 1, 0, 0, 0, 4, 0, 1, 1 },
210 1.1 cgd { "kobold", 1, 20, 1, 0, 0, 0, 7, 10, 1, 1 },
211 1.1 cgd
212 1.1 cgd { "orc", 2, 12, 1, 0, 0, 0, 9, 40, 4, 2 },
213 1.1 cgd { "snake", 2, 15, 1, 0, 0, 0, 3, 0, 3, 1 },
214 1.1 cgd { "giant centipede",2, 14, 0, 4, 0, 0, 3, 0, 1, 2 },
215 1.1 cgd { "jaculi", 2, 20, 1, 0, 0, 0, 3, 0, 2, 1 },
216 1.1 cgd { "troglodyte", 2, 10, 2, 0, 0, 0, 5, 80, 4, 3 },
217 1.1 cgd { "giant ant", 2, 8, 1, 4, 0, 0, 4, 0, 5, 5 },
218 1.1 cgd
219 1.1 cgd /* NAME LV AC DAM ATT DEF GEN INT GOLD HP EXP
220 1.1 cgd ----------------------------------------------------------------- */
221 1.1 cgd
222 1.1 cgd { "floating eye", 3, 8, 1, 0, 0, 0, 3, 0, 5, 2 },
223 1.1 cgd { "leprechaun", 3, 3, 0, 8, 0, 0, 3,1500, 13, 45 },
224 1.1 cgd { "nymph", 3, 3, 0, 14, 0, 0, 9, 0, 18, 45 },
225 1.1 cgd { "quasit", 3, 5, 3, 0, 0, 0, 3, 0, 10, 15 },
226 1.1 cgd { "rust monster", 3, 4, 0, 1, 0, 0, 3, 0, 18, 25 },
227 1.1 cgd { "zombie", 3, 12, 2, 0, 0, 0, 3, 0, 6, 7 },
228 1.1 cgd
229 1.1 cgd { "assassin bug", 4, 9, 3, 0, 0, 0, 3, 0, 20, 15 },
230 1.1 cgd { "bugbear", 4, 5, 4, 15, 0, 0, 5, 40, 20, 35 },
231 1.1 cgd { "hell hound", 4, 5, 2, 2, 0, 0, 6, 0, 16, 35 },
232 1.1 cgd { "ice lizard", 4, 11, 2, 10, 0, 0, 6, 50, 16, 25 },
233 1.1 cgd { "centaur", 4, 6, 4, 0, 0, 0, 10, 40, 24, 45 },
234 1.1 cgd
235 1.1 cgd /* NAME LV AC DAM ATT DEF GEN INT GOLD HP EXP
236 1.1 cgd ----------------------------------------------------------------- */
237 1.1 cgd
238 1.1 cgd { "troll", 5, 4, 5, 0, 0, 0, 9, 80, 50, 300 },
239 1.1 cgd { "yeti", 5, 6, 4, 0, 0, 0, 5, 50, 35, 100 },
240 1.1 cgd { "white dragon", 5, 2, 4, 5, 0, 0, 16, 500, 55, 1000},
241 1.1 cgd { "elf", 5, 8, 1, 0, 0, 0, 15, 50, 22, 35 },
242 1.1 cgd { "gelatinous cube",5, 9, 1, 0, 0, 0, 3, 0, 22, 45 },
243 1.1 cgd
244 1.1 cgd { "metamorph", 6, 7, 3, 0, 0, 0, 3, 0, 30, 40 },
245 1.1 cgd { "vortex", 6, 4, 3, 0, 0, 0, 3, 0, 30, 55 },
246 1.1 cgd { "ziller", 6, 15, 3, 0, 0, 0, 3, 0, 30, 35 },
247 1.1 cgd { "violet fungi", 6, 12, 3, 0, 0, 0, 3, 0, 38, 100 },
248 1.1 cgd { "wraith", 6, 3, 1, 6, 0, 0, 3, 0, 30, 325 },
249 1.1 cgd { "forvalaka", 6, 2, 5, 0, 0, 0, 7, 0, 50, 280 },
250 1.1 cgd
251 1.1 cgd /* NAME LV AC DAM ATT DEF GEN INT GOLD HP EXP
252 1.1 cgd ----------------------------------------------------------------- */
253 1.1 cgd
254 1.1 cgd { "lama nobe", 7, 7, 3, 0, 0, 0, 6, 0, 35, 80 },
255 1.1 cgd { "osequip", 7, 4, 3, 16, 0, 0, 4, 0, 35, 100 },
256 1.1 cgd { "rothe", 7, 15, 5, 0, 0, 0, 3, 100, 50, 250 },
257 1.1 cgd { "xorn", 7, 0, 6, 0, 0, 0, 13, 0, 60, 300 },
258 1.1 cgd { "vampire", 7, 3, 4, 6, 0, 0, 17, 0, 50, 1000},
259 1.1 cgd { "invisible stalker",7,3, 6, 0, 0, 0, 5, 0, 50, 350 },
260 1.1 cgd
261 1.1 cgd { "poltergeist", 8, 1, 4, 0, 0, 0, 3, 0, 50, 450 },
262 1.1 cgd { "disenchantress", 8, 3, 0, 9, 0, 0, 3, 0, 50, 500 },
263 1.1 cgd { "shambling mound",8, 2, 5, 0, 0, 0, 6, 0, 45, 400 },
264 1.1 cgd { "yellow mold", 8, 12, 4, 0, 0, 0, 3, 0, 35, 250 },
265 1.1 cgd { "umber hulk", 8, 3, 7, 11, 0, 0, 14, 0, 65, 600 },
266 1.1 cgd
267 1.1 cgd /* NAME LV AC DAM ATT DEF GEN INT GOLD HP EXP
268 1.1 cgd ----------------------------------------------------------------- */
269 1.1 cgd
270 1.1 cgd { "gnome king", 9, -1, 10, 0, 0, 0, 18, 2000, 100,3000 },
271 1.1 cgd { "mimic", 9, 5, 6, 0, 0, 0, 8, 0, 55, 99 },
272 1.1 cgd { "water lord", 9, -10, 15, 7, 0, 0, 20, 0, 150,15000 },
273 1.1 cgd { "bronze dragon", 9, 2, 9, 3, 0, 0, 16, 300, 80, 4000 },
274 1.1 cgd { "green dragon", 9, 3, 8, 10, 0, 0, 15, 200, 70, 2500 },
275 1.1 cgd { "purple worm", 9, -1, 11, 0, 0, 0, 3, 100, 120,15000 },
276 1.1 cgd { "xvart", 9, -2, 12, 0, 0, 0, 13, 0, 90, 1000 },
277 1.1 cgd
278 1.1 cgd { "spirit naga", 10, -20,12, 12, 0, 0, 23, 0, 95, 20000 },
279 1.1 cgd { "silver dragon", 10, -1, 12, 3, 0, 0, 20, 700, 100,10000 },
280 1.1 cgd { "platinum dragon",10, -5, 15, 13, 0, 0, 22, 1000, 130,24000 },
281 1.1 cgd { "green urchin", 10, -3, 12, 0, 0, 0, 3, 0, 85, 5000 },
282 1.1 cgd { "red dragon", 10, -2, 13, 3, 0, 0, 19, 800, 110,14000 },
283 1.1 cgd
284 1.1 cgd { "type I demon lord", 12,-30, 18, 0, 0, 0, 20, 0, 140,50000 },
285 1.1 cgd { "type II demon lord", 13,-30, 18, 0, 0, 0, 21, 0, 160,75000 },
286 1.1 cgd { "type III demon lord",14,-30, 18, 0, 0, 0, 22, 0, 180,100000 },
287 1.1 cgd { "type IV demon lord", 15,-35, 20, 0, 0, 0, 23, 0, 200,125000 },
288 1.1 cgd { "type V demon lord", 16,-40, 22, 0, 0, 0, 24, 0, 220,150000 },
289 1.1 cgd { "type VI demon lord", 17,-45, 24, 0, 0, 0, 25, 0, 240,175000 },
290 1.1 cgd { "type VII demon lord",18,-70, 27, 6, 0, 0, 26, 0, 260,200000 },
291 1.1 cgd { "demon prince", 25,-127,30, 6, 0, 0, 28, 0, 345,300000 }
292 1.1 cgd
293 1.1 cgd /* NAME LV AC DAM ATT DEF GEN INT GOLD HP EXP
294 1.1 cgd --------------------------------------------------------------------- */
295 1.1 cgd };
296 1.1 cgd
297 1.1 cgd /* name array for scrolls */
298 1.1 cgd
299 1.1 cgd char *scrollname[] = {
300 1.1 cgd "\0enchant armor",
301 1.1 cgd "\0enchant weapon",
302 1.1 cgd "\0enlightenment",
303 1.1 cgd "\0blank paper",
304 1.1 cgd "\0create monster",
305 1.1 cgd "\0create artifact",
306 1.1 cgd "\0aggravate monsters",
307 1.1 cgd "\0time warp",
308 1.1 cgd "\0teleportation",
309 1.1 cgd "\0expanded awareness",
310 1.1 cgd "\0haste monsters",
311 1.1 cgd "\0monster healing",
312 1.1 cgd "\0spirit protection",
313 1.1 cgd "\0undead protection",
314 1.1 cgd "\0stealth",
315 1.1 cgd "\0magic mapping",
316 1.1 cgd "\0hold monsters",
317 1.1 cgd "\0gem perfection",
318 1.1 cgd "\0spell extension",
319 1.1 cgd "\0identify",
320 1.1 cgd "\0remove curse",
321 1.1 cgd "\0annihilation",
322 1.1 cgd "\0pulverization",
323 1.1 cgd "\0life protection",
324 1.1 cgd "\0 ",
325 1.1 cgd "\0 ",
326 1.1 cgd "\0 ",
327 1.1 cgd "\0 "
328 1.1 cgd };
329 1.1 cgd
330 1.1 cgd /* name array for magic potions */
331 1.1 cgd char *potionname[] = {
332 1.1 cgd "\0sleep",
333 1.1 cgd "\0healing",
334 1.1 cgd "\0raise level",
335 1.1 cgd "\0increase ability",
336 1.1 cgd "\0wisdom",
337 1.1 cgd "\0strength",
338 1.1 cgd "\0raise charisma",
339 1.1 cgd "\0dizziness",
340 1.1 cgd "\0learning",
341 1.1 cgd "\0gold detection",
342 1.1 cgd "\0monster detection",
343 1.1 cgd "\0forgetfulness",
344 1.1 cgd "\0water",
345 1.1 cgd "\0blindness",
346 1.1 cgd "\0confusion",
347 1.1 cgd "\0heroism",
348 1.1 cgd "\0sturdiness",
349 1.1 cgd "\0giant strength",
350 1.1 cgd "\0fire resistance",
351 1.1 cgd "\0treasure finding",
352 1.1 cgd "\0instant healing",
353 1.1 cgd " cure dianthroritis",
354 1.1 cgd "\0poison",
355 1.1 cgd "\0see invisible",
356 1.1 cgd "\0 ",
357 1.1 cgd "\0 ",
358 1.1 cgd "\0 ",
359 1.1 cgd "\0 ",
360 1.1 cgd "\0 ",
361 1.1 cgd "\0 ",
362 1.1 cgd "\0 ",
363 1.1 cgd "\0 ",
364 1.1 cgd "\0 ",
365 1.1 cgd "\0 ",
366 1.1 cgd "\0 "
367 1.1 cgd };
368 1.1 cgd
369 1.1 cgd
370 1.1 cgd /*
372 1.1 cgd spell data
373 1.1 cgd */
374 1.1 cgd char spelknow[SPNUM]={0};
375 1.1 cgd char splev[] = { 1, 4, 9, 14, 18, 22, 26, 29, 32, 35, 37, 37, 37, 37, 37 };
376 1.1 cgd
377 1.1 cgd char *spelcode[]={
378 1.1 cgd "pro", "mle", "dex", "sle", "chm", "ssp",
379 1.1 cgd "web", "str", "enl", "hel", "cbl", "cre", "pha", "inv",
380 1.1 cgd "bal", "cld", "ply", "can", "has", "ckl", "vpr",
381 1.1 cgd "dry", "lit", "drl", "glo", "flo", "fgr",
382 1.1 cgd "sca", "hld", "stp", "tel", "mfi", /* 31 */
383 1.1 cgd "sph", "gen", "sum", "wtw", "alt", "per"
384 1.1 cgd };
385 1.1 cgd
386 1.1 cgd char *spelname[]={
387 1.1 cgd "protection", "magic missile", "dexterity",
388 1.1 cgd "sleep", "charm monster", "sonic spear",
389 1.1 cgd
390 1.1 cgd "web", "strength", "enlightenment",
391 1.1 cgd "healing", "cure blindness", "create monster",
392 1.1 cgd "phantasmal forces", "invisibility",
393 1.1 cgd
394 1.1 cgd "fireball", "cold", "polymorph",
395 1.1 cgd "cancellation", "haste self", "cloud kill",
396 1.1 cgd "vaporize rock",
397 1.1 cgd
398 1.1 cgd "dehydration", "lightning", "drain life",
399 1.1 cgd "invulnerability", "flood", "finger of death",
400 1.1 cgd
401 1.1 cgd "scare monster", "hold monster", "time stop",
402 1.1 cgd "teleport away", "magic fire",
403 1.1 cgd
404 1.1 cgd "sphere of annihilation", "genocide", "summon demon",
405 1.1 cgd "walk through walls", "alter reality", "permanence",
406 1.1 cgd ""
407 1.1 cgd };
408 1.1 cgd
409 1.1 cgd char *speldescript[]={
410 1.1 cgd /* 1 */
411 1.1 cgd "generates a +2 protection field",
412 1.1 cgd "creates and hurls a magic missile equivalent to a + 1 magic arrow",
413 1.1 cgd "adds +2 to the casters dexterity",
414 1.1 cgd "causes some monsters to go to sleep",
415 1.1 cgd "some monsters may be awed at your magnificence",
416 1.1 cgd "causes your hands to emit a screeching sound toward what they point",
417 1.1 cgd /* 7 */
418 1.1 cgd "causes strands of sticky thread to entangle an enemy",
419 1.1 cgd "adds +2 to the casters strength for a short term",
420 1.1 cgd "the caster becomes aware of things around him",
421 1.1 cgd "restores some hp to the caster",
422 1.1 cgd "restores sight to one so unfortunate as to be blinded",
423 1.1 cgd "creates a monster near the caster appropriate for the location",
424 1.1 cgd "creates illusions, and if believed, monsters die",
425 1.1 cgd "the caster becomes invisible",
426 1.1 cgd /* 15 */
427 1.1 cgd "makes a ball of fire that burns on what it hits",
428 1.1 cgd "sends forth a cone of cold which freezes what it touches",
429 1.1 cgd "you can find out what this does for yourself",
430 1.1 cgd "negates the ability of a monster to use his special abilities",
431 1.1 cgd "speeds up the casters movements",
432 1.1 cgd "creates a fog of poisonous gas which kills all that is within it",
433 1.1 cgd "this changes rock to air",
434 1.1 cgd /* 22 */
435 1.1 cgd "dries up water in the immediate vicinity",
436 1.1 cgd "you finger will emit a lightning bolt when this spell is cast",
437 1.1 cgd "subtracts hit points from both you and a monster",
438 1.1 cgd "this globe helps to protect the player from physical attack",
439 1.1 cgd "this creates an avalanche of H2O to flood the immediate chamber",
440 1.1 cgd "this is a holy spell and calls upon your god to back you up",
441 1.1 cgd /* 28 */
442 1.1 cgd "terrifies the monster so that hopefully he wont hit the magic user",
443 1.1 cgd "the monster is frozen in his tracks if this is successful",
444 1.1 cgd "all movement in the caverns ceases for a limited duration",
445 1.1 cgd "moves a particular monster around in the dungeon (hopefully away from you)",
446 1.1 cgd "this causes a curtain of fire to appear all around you",
447 1.1 cgd /* 33 */
448 1.1 cgd "anything caught in this sphere is instantly killed. Warning -- dangerous",
449 1.1 cgd "eliminates a species of monster from the game -- use sparingly",
450 1.1 cgd "summons a demon who hopefully helps you out",
451 1.1 cgd "allows the player to walk through walls for a short period of time",
452 1.1 cgd "god only knows what this will do",
453 1.1 cgd "makes a character spell permanent, i. e. protection, strength, etc.",
454 1.1 cgd ""
455 1.1 cgd };
456 1.1 cgd
457 1.1 cgd char spelweird[MAXMONST+8][SPNUM] = {
458 1.1 cgd /* 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 */
459 1.1 cgd /* 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 */
460 1.1 cgd /* 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 */
461 1.1 cgd
462 1.1 cgd
463 1.1 cgd /* 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 },
464 1.1 cgd /* 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 },
465 1.1 cgd /* 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 },
466 1.1 cgd /* 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 },
467 1.1 cgd /* 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 },
468 1.1 cgd
469 1.1 cgd /* 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 },
470 1.1 cgd /* 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 },
471 1.1 cgd /*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 },
472 1.1 cgd /* 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 },
473 1.1 cgd /* 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 },
474 1.1 cgd
475 1.1 cgd /* 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 },
476 1.1 cgd /* 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 },
477 1.1 cgd /* 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 },
478 1.1 cgd /* 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 },
479 1.1 cgd /* 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 },
480 1.1 cgd
481 1.1 cgd /* 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 },
482 1.1 cgd /* 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 },
483 1.1 cgd /* 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 },
484 1.1 cgd /* 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 },
485 1.1 cgd /* 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 },
486 1.1 cgd
487 1.1 cgd /* 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 },
488 1.1 cgd /* 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 },
489 1.1 cgd /* 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 },
490 1.1 cgd /* 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 },
491 1.1 cgd /* 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 },
492 1.1 cgd
493 1.1 cgd /* 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 },
494 1.1 cgd /*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 },
495 1.1 cgd /* 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 },
496 1.1 cgd /* 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 },
497 1.1 cgd /* 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 },
498 1.1 cgd
499 1.1 cgd /* 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 },
500 1.1 cgd /* 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 },
501 1.1 cgd /* 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 },
502 1.1 cgd /* 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 },
503 1.1 cgd /* 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 },
504 1.1 cgd
505 1.1 cgd /* 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 },
506 1.1 cgd /* 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 },
507 1.1 cgd /* 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 },
508 1.1 cgd /*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 },
509 1.1 cgd /* 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 },
510 1.1 cgd
511 1.1 cgd /* 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 },
512 1.1 cgd /*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 },
513 1.1 cgd /* 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 },
514 1.1 cgd /* 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 },
515 1.1 cgd /* 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 },
516 1.1 cgd
517 1.1 cgd /* 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 },
518 1.1 cgd /* 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 },
519 1.1 cgd /* 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 },
520 1.1 cgd /* 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 },
521 1.1 cgd /* 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 },
522 1.1 cgd
523 1.1 cgd /* 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 },
524 1.1 cgd /* 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 },
525 1.1 cgd /* 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 },
526 1.1 cgd /*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 },
527 1.1 cgd /* 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 },
528 1.1 cgd /* 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 },
529 1.1 cgd
530 1.1 cgd /* 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 */
531 1.1 cgd /* 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 */
532 1.1 cgd /* 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 */
533 1.1 cgd
534 1.1 cgd /* 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 },
535 1.1 cgd /* 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 },
536 1.1 cgd /* 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 },
537 1.1 cgd /* 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 },
538 1.1 cgd /* 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 },
539 1.1 cgd /* 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 },
540 1.1 cgd /* 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 },
541 1.1 cgd /* 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 }
542 1.1 cgd
543 1.1 cgd };
544 1.1 cgd
545 1.1 cgd char *spelmes[] = { "",
546 1.1 cgd /* 1 */ "the web had no effect on the %s",
547 1.1 cgd /* 2 */ "the %s changed shape to avoid the web",
548 1.1 cgd /* 3 */ "the %s isn't afraid of you",
549 1.1 cgd /* 4 */ "the %s isn't affected",
550 1.1 cgd /* 5 */ "the %s can see you with his infravision",
551 1.1 cgd /* 6 */ "the %s vaporizes your missile",
552 1.1 cgd /* 7 */ "your missile bounces off the %s",
553 1.1 cgd /* 8 */ "the %s doesn't sleep",
554 1.1 cgd /* 9 */ "the %s resists",
555 1.1 cgd /* 10 */ "the %s can't hear the noise",
556 1.1 cgd /* 11 */ "the %s's tail cuts it free of the web",
557 1.1 cgd /* 12 */ "the %s burns through the web",
558 1.1 cgd /* 13 */ "your missiles pass right through the %s",
559 1.1 cgd /* 14 */ "the %s sees through your illusions",
560 1.1 cgd /* 15 */ "the %s loves the cold!",
561 1.1 cgd /* 16 */ "the %s loves the water!"
562 1.1 cgd };
563 1.1 cgd
564 1.1 cgd char to_lower[]= /* tolower[character] = lower case converted character */
565 1.1 cgd {
566 1.1 cgd 0000,0001,0002,0003,0004,0005,0006,0007,0010,0011,0012,0013,0014,0015,0016,0017, /* NUL-SI*/
567 1.1 cgd 0020,0021,0022,0023,0024,0025,0026,0027,0030,0031,0032,0033,0034,0035,0036,0037, /* DLE-US*/
568 1.1 cgd 0040,0041,0042,0043,0044,0045,0046,0047,0050,0051,0052,0053,0054,0055,0056,0057, /* SP-/ */
569 1.1 cgd 0060,0061,0062,0063,0064,0065,0066,0067,0070,0071,0072,0073,0074,0075,0076,0077, /* 0-? */
570 1.1 cgd 0100,0141,0142,0143,0144,0145,0146,0147,0150,0151,0152,0153,0154,0155,0156,0157, /* @-O */
571 1.1 cgd 0160,0161,0162,0163,0164,0165,0166,0167,0170,0171,0172,0133,0134,0135,0136,0137, /* P-_ */
572 1.1 cgd 0140,0141,0142,0143,0144,0145,0146,0147,0150,0151,0152,0153,0154,0155,0156,0157, /* `-o */
573 1.1 cgd 0160,0161,0162,0163,0164,0165,0166,0167,0170,0171,0172,0173,0174,0175,0176,0177, /* p-DEL */
574 1.1 cgd };
575 1.1 cgd
576 1.1 cgd char to_upper[]= /* toupper[character] = upper case converted character */
577 1.1 cgd {
578 1.1 cgd 0000,0001,0002,0003,0004,0005,0006,0007,0010,0011,0012,0013,0014,0015,0016,0017, /* NUL-SI*/
579 1.1 cgd 0020,0021,0022,0023,0024,0025,0026,0027,0030,0031,0032,0033,0034,0035,0036,0037, /* DLE-US*/
580 1.1 cgd 0040,0041,0042,0043,0044,0045,0046,0047,0050,0051,0052,0053,0054,0055,0056,0057, /* SP-/ */
581 1.1 cgd 0060,0061,0062,0063,0064,0065,0066,0067,0070,0071,0072,0073,0074,0075,0076,0077, /* 0-? */
582 1.1 cgd 0100,0101,0102,0103,0104,0105,0106,0107,0110,0111,0112,0113,0114,0115,0116,0117, /* @-O */
583 1.1 cgd 0120,0121,0122,0123,0124,0125,0126,0127,0130,0131,0132,0133,0134,0135,0136,0137, /* P-_ */
584 1.1 cgd 0140,0101,0102,0103,0104,0105,0106,0107,0110,0111,0112,0113,0114,0115,0116,0117, /* `-o */
585 1.1 cgd 0120,0121,0122,0123,0124,0125,0126,0127,0130,0131,0132,0173,0174,0175,0176,0177, /* p-DEL */
586 1.1 cgd };
587 1.1 cgd
588 1.1 cgd char is_digit[]= /* isdigit[character] = TRUE || FALSE */
589 1.1 cgd {
590 1.1 cgd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* NUL-SI*/
591 1.1 cgd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* DLE-US*/
592 1.1 cgd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* SP-/ */
593 1.1 cgd 1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, /* 0-? */
594 1.1 cgd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* @-O */
595 1.1 cgd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* P-_ */
596 1.1 cgd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* `-o */
597 1.1 cgd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* p-DEL */
598 1.1 cgd };
599 1.1 cgd
600 1.1 cgd char is_alpha[]= /* isalpha[character] = TRUE || FALSE */
601 1.1 cgd {
602 1.1 cgd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* NUL-SI*/
603 1.1 cgd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* DLE-US*/
604 1.1 cgd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* SP-/ */
605 1.1 cgd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0-? */
606 1.1 cgd 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* @-O */
607 1.1 cgd 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* P-_ */
608 1.1 cgd 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* `-o */
609 1.1 cgd 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* p-DEL */
610 1.1 cgd };
611 1.1 cgd
612 1.1 cgd /*
613 1.1 cgd * function to create scroll numbers with appropriate probability of
614 1.1 cgd * occurrence
615 1.1 cgd *
616 1.1 cgd * 0 - armor 1 - weapon 2 - enlightenment 3 - paper
617 1.1 cgd * 4 - create monster 5 - create item 6 - aggravate 7 - time warp
618 1.1 cgd * 8 - teleportation 9 - expanded awareness 10 - haste monst
619 1.1 cgd * 11 - heal monster 12 - spirit protection 13 - undead protection
620 1.1 cgd * 14 - stealth 15 - magic mapping 16 - hold monster
621 1.1 cgd * 17 - gem perfection 18 - spell extension 19 - identify
622 1.1 cgd * 20 - remove curse 21 - annihilation 22 - pulverization
623 1.1 cgd * 23 - life protection
624 1.1 cgd */
625 1.1 cgd char scprob[]= { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3,
626 1.1 cgd 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,
627 1.1 cgd 9, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14,
628 1.1 cgd 15, 15, 16, 16, 16, 17, 17, 18, 18, 19, 19, 19, 20, 20, 20, 20, 21, 22,
629 1.1 cgd 22, 22, 23 };
630 1.1 cgd
631 1.1 cgd /*
632 1.1 cgd * function to return a potion number created with appropriate probability
633 1.1 cgd * of occurrence
634 1.1 cgd *
635 1.1 cgd * 0 - sleep 1 - healing 2 - raise level
636 1.1 cgd * 3 - increase ability 4 - gain wisdom 5 - gain strength
637 1.1 cgd * 6 - charismatic character 7 - dizziness 8 - learning
638 1.1 cgd * 9 - gold detection 10 - monster detection 11 - forgetfulness
639 1.1 cgd * 12 - water 13 - blindness 14 - confusion
640 1.1 cgd * 15 - heroism 16 - sturdiness 17 - giant strength
641 1.1 cgd * 18 - fire resistance 19 - treasure finding 20 - instant healing
642 1.1 cgd * 21 - cure dianthroritis 22 - poison 23 - see invisible
643 1.1 cgd */
644 1.1 cgd 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 };
645 1.1 cgd
646 1.1 cgd char nlpts[] = { 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7 };
647 1.1 cgd char nch[] = { 0, 0, 0, 1, 1, 1, 2, 2, 3, 4 };
648 1.1 cgd char nplt[] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 4 };
649 char ndgg[] = { 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 5 };
650 char nsw[] = { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 3 };
651