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