]>
Commit | Line | Data |
---|---|---|
c1068b6e | 1 | #include "config.h" |
2 | #include "extern.h" | |
85ce9d3e | 3 | #include "sockhelp.h" |
4 | #include "aClient.h" | |
5 | #include "list.h" | |
85ce9d3e | 6 | #include <cctype> |
7 | #include <fstream.h> | |
c1068b6e | 8 | |
9 | #if defined(HAVE_CRYPT_H) | |
10 | ||
e3c5fe46 | 11 | #include <crypt.h> |
85ce9d3e | 12 | |
c1068b6e | 13 | #elif defined(HAVE_UNISTD_H) |
14 | ||
15 | #include <unistd.h> | |
16 | ||
17 | #endif | |
c8ada07e | 18 | |
85ce9d3e | 19 | List<aClient> players; |
c8ada07e | 20 | Monster *monsters[LEVELS][MONSTERS]; // Monsters per level. Total = MONSTERS * LEVELS |
21 | ||
22 | Monster *masters[LEVELS]; // A master for each level | |
85ce9d3e | 23 | |
a8fb9757 | 24 | // Database functions |
85ce9d3e | 25 | int save_gs_dbase(); |
26 | int load_gs_dbase(); | |
27 | ||
28 | // String functions | |
29 | #undef strtok | |
30 | char *strtok(char *str, const char *delim); | |
31 | int stricmp(const char *s1, const char *s2); | |
32 | int strnicmp(const char *s1, const char *s2, size_t len); | |
33 | // String Functions | |
34 | ||
e3c5fe46 | 35 | |
36 | /********** Password functions **********/ | |
37 | ||
38 | bool passcmp(char *encrypted, char *plaintext); // Compares an encrypted pass with a plain text one | |
39 | ||
40 | bool check_password(char *name, char *plaintext); // Finds a password for the given name, and checks it with passcmp against the plaintext password given. | |
41 | ||
42 | /********** Password functions **********/ | |
43 | ||
44 | ||
45 | /********** GameServ Booleans **********/ | |
46 | ||
47 | bool is_playing(char *u); // True if the given nickname in the clients list is playing. | |
48 | bool has_started(char *u); // True if the given nickname in the clients list has started playing. | |
49 | bool is_fighting(char *u); // True if the given nick in the clients list is fighting anything. | |
50 | bool isnt_fighting(char *u); // True if the given nick isn't fighting. Same as !is_fighting(u). | |
51 | bool player_fight(char *u); // True if the player is fighting another player. | |
52 | bool master_fight(char *u); // True if the player is fighting their master. | |
53 | ||
54 | /********** GameServ Booleans **********/ | |
85ce9d3e | 55 | |
56 | ||
57 | void display_monster(char *u); | |
58 | void display_players(char *u); | |
59 | long int chartoint(char ch); | |
60 | int isstringnum(char *num); | |
61 | long int pow (int x, int y); | |
62 | long int stringtoint(char *number); | |
63 | ||
64 | char *spaces(int len, char *seperator); | |
85ce9d3e | 65 | void refresh(aClient *ni); |
66 | void refreshall(); | |
67 | void reset(aClient *ni); | |
c8ada07e | 68 | void init_masters(); |
85ce9d3e | 69 | void init_monsters(); |
c8ada07e | 70 | void delete_monsters(); |
71 | void delete_masters(); | |
85ce9d3e | 72 | |
73 | void do_list(char *u); | |
74 | void do_register(char *u); | |
75 | void do_identify(char *u); | |
76 | void do_play(char *u); | |
77 | void do_quitg(char *u); | |
78 | void do_reset(char *u); | |
79 | void do_fight(char *u); | |
80 | void do_store(char *u); | |
81 | void do_heal(char *u); | |
82 | void do_bank(char *u); | |
83 | void do_attack(char *u); | |
84 | void do_run(char *u); | |
ab4f4ec0 | 85 | void do_master(char *u); |
86 | void see_master(char *u); | |
85ce9d3e | 87 | void do_stats(char *u); |
85ce9d3e | 88 | |
89 | void showstats(const char *u, const char *nick); | |
e282e9d2 | 90 | void showBankBalance(const char *u); |
85ce9d3e | 91 | |
92 | #define WNA 16 | |
93 | char *weapons[WNA] = { "Fists", "Stick", "Dagger", "Quarterstaff", "Short Sword", | |
94 | "Long Sword", "Silver Spear", "Battle Axe", "The Ragnarok", | |
95 | "Chain Saw", "Poison Sword", "Flame Sword", "Earth Hammer", | |
96 | "Light Saber", "Masamune", "Mystical Sword"}; | |
97 | ||
98 | char *armors[WNA] = { "Nothing", "Clothes", "Leather Vest", "Chain Mail", "Plate Armor", | |
99 | "Full Body Armor", "Magic Mail", "Graphite Suit", "Steel Suit", | |
100 | "Force Field", "Armor of Light", "Mythril Vest", "DemiGod Armor", | |
101 | "Hades' Cloak", "Dragon Scales", "Mystical Armor"}; | |
102 | ||
103 | int prices[WNA - 1] = {200, 1000, 3000, 10000, 30000, 100000, 150000, 200000, 400000, | |
104 | 1000000, 4000000, 10000000, 40000000, 100000000, 400000000}; | |
105 | int webonus[WNA] = {0, 10, 15, 25, 35, 45, 65, 85, 125, 185, 255, 355, 505, 805, 1205, 1805}; | |
106 | int arbonus[WNA] = {0, 1, 3, 10, 15, 25, 35, 50, 75, 100, 150, 225, 300, 400, 600, 1000}; | |
107 | ||
108 | int hpbonus[11] = {10, 15, 20, 30, 50, 75, 125, 185, 250, 350, 550}; | |
109 | int strbonus[11] = {5, 7, 10, 12, 20, 35, 50, 75, 110, 150, 200}; | |
110 | int defbonus[11] = {2, 3, 5, 10, 15, 22, 35, 60, 80, 120, 150}; | |
111 | ||
112 | ||
113 | void gameserv(char *source, char *buf) | |
114 | { | |
115 | char *cmd, input[1024]; | |
116 | cmd = strtok(buf, " "); | |
117 | ||
118 | source++; // Get rid of that : at the beginning of a :Nick privmsg Gameserv :text | |
119 | cmd++; // Get rid of that : at the beginning of the :text (command) | |
120 | ||
121 | cout << "Source: " << source << "\ncmd: " << cmd << endl; | |
122 | if (strnicmp(cmd, ":\1PING", 6) == 0) | |
123 | { | |
124 | char *timestamp; | |
125 | timestamp = strtok(NULL, "\1"); | |
126 | notice(s_GameServ, source, "\1PING %s\1", timestamp); | |
127 | } else if (stricmp(cmd, ":\1VERSION\1") == 0) { | |
128 | notice(s_GameServ, source, "\1VERSION GameServ v1.0b\1"); | |
129 | } else if (stricmp(cmd, "SEARCH") == 0) { | |
130 | cmd = strtok(NULL, " "); | |
131 | ||
132 | if (!cmd) | |
133 | notice(s_GameServ, source, "SYNTAX: /msg %S SEARCH FOREST"); | |
134 | else | |
135 | do_forest(source); | |
136 | } else if (stricmp(cmd, "FIGHT") == 0) { | |
137 | do_fight(source); | |
138 | } else if (stricmp(cmd, "ATTACK") == 0) { | |
139 | do_attack(source); | |
c8ada07e | 140 | } else if (stricmp(cmd, "RUN") == 0) { |
141 | do_run(source); | |
85ce9d3e | 142 | } else if (stricmp(cmd, "HEAL") == 0) { |
143 | do_heal(source); | |
ab4f4ec0 | 144 | } else if (stricmp(cmd, "MASTER") == 0) { |
145 | do_master(source); | |
ad7dfaa0 | 146 | } else if (stricmp(cmd, "STORE") == 0) { |
147 | do_store(source); | |
8c126acc | 148 | } else if (stricmp(cmd, "BANK") == 0) { |
149 | do_bank(source); | |
85ce9d3e | 150 | } else if (stricmp(cmd, "PRINT") == 0) { |
151 | cout << "Printing Clients List: " << endl; | |
152 | clients.print(); | |
0a1518fa | 153 | cout << "\nPrinting Player List: " << endl; |
85ce9d3e | 154 | players.print(); |
155 | } else if (stricmp(cmd, "LIST") == 0) { | |
156 | do_list(source); | |
157 | } else if (stricmp(cmd, "REGISTER") == 0) { | |
158 | do_register(source); | |
159 | } else if (stricmp(cmd, "IDENTIFY") == 0) { | |
160 | do_identify(source); | |
161 | } else if (stricmp(cmd, "HELP") == 0) { | |
162 | } else if (stricmp(cmd, "STATS") == 0) { | |
163 | do_stats(source); | |
164 | } else if (stricmp(cmd, "SHUTDOWN") == 0) { | |
ad7dfaa0 | 165 | save_gs_dbase(); |
85ce9d3e | 166 | raw("SQUIT %s :leaving", servername); |
167 | } else if (stricmp(cmd, "SAVE") == 0) { | |
168 | save_gs_dbase(); | |
169 | } else if (stricmp(cmd, "LOAD") == 0) { | |
170 | load_gs_dbase(); | |
171 | } else if (stricmp(cmd, "RAW") == 0) { | |
172 | char *rest = strtok(NULL, ""); | |
173 | raw(rest); | |
174 | } | |
175 | ||
176 | source--; // Bring the : back so we don't leak memory | |
177 | cmd--; // Same thing :) | |
178 | } | |
179 | ||
180 | int stricmp(const char *s1, const char *s2) | |
181 | { | |
182 | register int c; | |
183 | ||
184 | while ((c = tolower(*s1)) == tolower(*s2)) { | |
185 | if (c == 0) | |
186 | return 0; | |
187 | s1++; | |
188 | s2++; | |
189 | } | |
190 | if (c < tolower(*s2)) | |
191 | return -1; | |
192 | return 1; | |
193 | } | |
194 | ||
195 | void showstats(const char *u, const char *nick) | |
196 | { | |
197 | aClient *ni, *sender = find(u); | |
198 | char *buf; | |
199 | buf = new char[50]; | |
200 | char *space; | |
201 | ||
202 | ||
203 | cout << "\n\nu: " << u << "\nnick: " << nick << endl; | |
204 | if (!(ni = findbynick(nick))) | |
205 | { | |
206 | notice(s_GameServ, u, "%s not found", nick); | |
207 | } | |
208 | else if (ni->stats) | |
209 | { | |
210 | ||
211 | notice(s_GameServ, sender->getNick(), "Stats for %s:", ni->stats->name); | |
212 | ||
213 | sprintf(buf, "Experience: %ld", ni->stats->exp); | |
214 | space = spaces(strlen(buf), " "); | |
215 | notice(s_GameServ, sender->getNick(), "%s%sLevel: %d", buf, space, | |
216 | ni->stats->level); | |
1cf88153 | 217 | delete [] space; |
85ce9d3e | 218 | |
219 | sprintf(buf, "Gold: %ld", ni->stats->gold); | |
220 | space = spaces(strlen(buf), " "); | |
221 | notice(s_GameServ, sender->getNick(), "%s%sGold in Bank: %ld", buf, space, ni->stats->bank); | |
1cf88153 | 222 | delete [] space; |
85ce9d3e | 223 | |
224 | notice(s_GameServ, sender->getNick(), "Health Points: %d of %d", ni->stats->hp, | |
225 | ni->stats->maxhp); | |
226 | ||
227 | sprintf(buf, "Strength: %d", ni->stats->strength + webonus[ni->stats->weapon]); | |
228 | space = spaces(strlen(buf), " "); | |
229 | notice(s_GameServ, sender->getNick(), "%s%sDefense: %d", | |
230 | buf, space, ni->stats->defense + arbonus[ni->stats->armor]); | |
1cf88153 | 231 | delete [] space; |
85ce9d3e | 232 | |
233 | sprintf(buf, "Armor: %s", armors[ni->stats->armor]); | |
234 | space = spaces(strlen(buf), " "); | |
235 | notice(s_GameServ, sender->getNick(), "%s%sWeapon: %s", buf, space, | |
236 | weapons[ni->stats->weapon]); | |
1cf88153 | 237 | delete [] space; |
85ce9d3e | 238 | |
239 | sprintf(buf, "Forest Fights: %d", ni->stats->forest_fights); | |
240 | space = spaces(strlen(buf), " "); | |
241 | notice(s_GameServ, sender->getNick(), "%s%sPlayer Fights: %d", buf, space, ni->stats->player_fights); | |
1cf88153 | 242 | delete [] space; |
85ce9d3e | 243 | } |
1cf88153 | 244 | delete [] buf; |
85ce9d3e | 245 | |
246 | } | |
247 | ||
248 | char *spaces(int len, char *seperator) | |
249 | { | |
250 | char *final; | |
251 | final = new char[40]; | |
252 | int y; | |
253 | strcpy(final, seperator); | |
254 | for (y = 0; y < 40 - len; y++) | |
255 | strcat(final, seperator); | |
256 | return final; | |
257 | } | |
258 | ||
259 | void raw(const char *fmt, ...) | |
260 | { | |
261 | va_list args; | |
262 | char *input; | |
263 | const char *t = fmt; | |
264 | input = new char[1024]; | |
265 | va_start(args, fmt); | |
266 | memset(input, 0, sizeof(input)); // Initialize to NULL | |
267 | for (; *t; t++) | |
268 | { | |
269 | if (*t == '%') | |
270 | { | |
271 | switch(*++t) { | |
272 | case 'd': sprintf(input, "%s%d", input, va_arg(args, int)); break; | |
273 | case 's': sprintf(input, "%s%s", input, va_arg(args, char *)); break; | |
274 | case 'S': sprintf(input, "%s%s", input, s_GameServ); break; | |
275 | case 'l': | |
276 | if (*++t == 'd') | |
277 | sprintf(input, "%s%ld", input, va_arg(args, long int)); break; | |
278 | } | |
279 | } | |
280 | else | |
281 | { | |
282 | sprintf(input, "%s%c", input, *t); | |
283 | } | |
284 | ||
285 | } | |
286 | sprintf(input, "%s%s", input, "\r\n"); | |
287 | cout << "input: " << input << flush; | |
288 | sock_puts(sock, input); | |
1cf88153 | 289 | delete [] input; |
85ce9d3e | 290 | va_end(args); |
291 | } | |
292 | /* Send a NOTICE from the given source to the given nick. */ | |
293 | ||
294 | void notice(const char *source, const char *dest, const char *fmt, ...) | |
295 | { | |
296 | va_list args; | |
297 | char *input; | |
298 | const char *t = fmt; | |
299 | input = new char[1024]; | |
300 | va_start(args, fmt); | |
301 | if (dest[0] == ':') | |
302 | { | |
303 | dest++; | |
304 | sprintf(input, ":%s NOTICE %s :", source, dest); | |
305 | dest--; | |
306 | } | |
307 | else | |
308 | sprintf(input, ":%s NOTICE %s :", source, dest); | |
309 | ||
310 | for (; *t; t++) | |
311 | { | |
312 | if (*t == '%') | |
313 | { | |
314 | switch(*++t) { | |
315 | case 'd': sprintf(input, "%s%d", input, va_arg(args, int)); break; | |
316 | case 's': sprintf(input, "%s%s", input, va_arg(args, char *)); break; | |
317 | case 'S': sprintf(input, "%s%s", input, s_GameServ); break; | |
318 | case 'l': | |
319 | if (*++t == 'd') | |
320 | sprintf(input, "%s%ld", input, va_arg(args, long int)); break; | |
321 | } | |
322 | } | |
323 | else | |
324 | { | |
325 | sprintf(input, "%s%c", input, *t); | |
326 | } | |
327 | ||
328 | } | |
329 | sprintf(input, "%s%s", input, "\r\n"); | |
330 | cout << "input: " << input << flush; | |
331 | sock_puts(sock, input); | |
1cf88153 | 332 | delete [] input; |
85ce9d3e | 333 | va_end(args); |
334 | } | |
335 | ||
336 | ||
337 | int strnicmp(const char *s1, const char *s2, size_t len) | |
338 | { | |
339 | register int c; | |
340 | ||
341 | if (!len) | |
342 | return 0; | |
343 | while ((c = tolower(*s1)) == tolower(*s2) && len > 0) { | |
344 | if (c == 0 || --len == 0) | |
345 | return 0; | |
346 | s1++; | |
347 | s2++; | |
348 | } | |
349 | if (c < tolower(*s2)) | |
350 | return -1; | |
351 | return 1; | |
352 | } | |
353 | ||
354 | char *strtok(char *str, const char *delim) | |
355 | { | |
356 | static char *current = NULL; | |
357 | char *ret; | |
358 | ||
359 | if (str) | |
360 | current = str; | |
361 | if (!current) | |
362 | return NULL; | |
363 | current += strspn(current, delim); | |
364 | ret = *current ? current : NULL; | |
365 | current += strcspn(current, delim); | |
366 | if (!*current) | |
367 | current = NULL; | |
368 | else | |
369 | *current++ = 0; | |
370 | return ret; | |
371 | } | |
372 | ||
373 | void do_list(char *u) | |
374 | { | |
375 | ListNode<aClient> *temp; | |
376 | temp = players.First(); | |
377 | if (!players.isEmpty()) | |
378 | { | |
379 | notice(s_GameServ, u, "People Playing:"); | |
380 | while(temp) | |
381 | { | |
382 | notice(s_GameServ, u, "IRC: %s Game: %s", temp->getData()->getNick(), temp->getData()->stats->name); | |
383 | temp = temp->Next(); | |
384 | } | |
385 | notice(s_GameServ, u, "End of List"); | |
386 | } | |
387 | else | |
388 | notice(s_GameServ, u, "No one is playing"); | |
389 | } | |
390 | void do_register(char *u) | |
391 | { | |
392 | char *password; | |
393 | aClient *user; | |
394 | password = strtok(NULL, " "); | |
395 | ||
e3c5fe46 | 396 | static char saltChars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; |
397 | static char salt[3]; | |
398 | ||
399 | salt[0] = saltChars[rand() % strlen(saltChars)]; | |
400 | salt[1] = saltChars[rand() % strlen(saltChars)]; | |
401 | salt[3] = '\0'; | |
402 | ||
85ce9d3e | 403 | if (!password) |
404 | { | |
405 | notice(s_GameServ, u, "SYNTAX: /msg %S REGISTER PASSWORD"); | |
406 | } | |
407 | else if (user = find(u)) | |
408 | { | |
409 | if (!user->stats) | |
410 | { | |
411 | user->stats = new Player(user); | |
412 | user->stats->started = 1; | |
413 | user->stats->user = user; // Set the backwards pointer | |
e3c5fe46 | 414 | strcpy(user->stats->password, crypt(password, salt)); |
85ce9d3e | 415 | players.insertAtBack(user); |
416 | } | |
417 | else | |
418 | { | |
419 | notice(s_GameServ, u, "Already registered. Contact a %S admin for help."); | |
420 | } | |
421 | } | |
422 | } | |
423 | ||
424 | void do_identify(char *u) | |
425 | { | |
0a1518fa | 426 | char *password, *name; |
427 | aClient *user, *p; | |
428 | name = strtok(NULL, " "); | |
85ce9d3e | 429 | password = strtok(NULL, " "); |
cdc9a6db | 430 | |
0a1518fa | 431 | if (!password || !name) |
85ce9d3e | 432 | { |
0a1518fa | 433 | notice(s_GameServ, u, "SYNTAX: /msg %S IDENTIFY NAME PASSWORD"); |
85ce9d3e | 434 | } |
0a1518fa | 435 | else if (!(p = findplayer(name)) || !p->stats) |
436 | notice(s_GameServ, u, "Player %s not found", name); | |
437 | else if (!check_password(name, password)) | |
85ce9d3e | 438 | { |
0a1518fa | 439 | notice(s_GameServ, u, "Password incorrect"); |
85ce9d3e | 440 | } |
0a1518fa | 441 | else if (user = find(u)) |
85ce9d3e | 442 | { |
443 | if (!user->stats) | |
444 | { | |
1cf88153 | 445 | ListNode<aClient> *temp; |
446 | temp = players.Find(p); | |
447 | if (!temp) | |
448 | { | |
449 | notice(s_GameServ, u, "Fatal error. Contact %S Admin. Buf: %s", | |
450 | strtok(NULL, "")); | |
451 | return; | |
452 | } | |
cdc9a6db | 453 | user->stats = new Player(p->stats->name); |
454 | cout << "Setting data for identified" << endl; | |
1cf88153 | 455 | user->stats->setData(p->stats); |
cdc9a6db | 456 | cout << "Player Identified" << endl << flush; |
457 | ||
458 | temp->setPtr(user); | |
459 | ||
460 | notice(s_GameServ, u, "Password Accepted. Identified."); | |
1cf88153 | 461 | |
85ce9d3e | 462 | } |
463 | else | |
464 | { | |
465 | notice(s_GameServ, u, "Already identified. Contact a %S admin for help."); | |
466 | } | |
467 | } | |
468 | } | |
469 | ||
470 | void do_stats(char *u) | |
471 | { | |
472 | char *nick; | |
473 | aClient *source; | |
474 | ||
475 | nick = strtok(NULL, " "); | |
476 | source = find(u); | |
477 | ||
478 | if (!nick) | |
479 | showstats(u, source->getNick()); | |
480 | else | |
481 | showstats(u, nick); | |
482 | } | |
ad7dfaa0 | 483 | void init_masters() |
484 | { | |
ab4f4ec0 | 485 | delete_masters(); |
c8ada07e | 486 | |
487 | for (int x = 0; x < LEVELS; x++) | |
488 | masters[x] = new Monster; | |
489 | ||
490 | strcpy(masters[0]->name, "Old Bones"); | |
491 | strcpy(masters[0]->weapon, "Dull Sword Cane"); | |
492 | masters[0]->strength = 30; | |
493 | masters[0]->gold = 0; | |
494 | masters[0]->exp = 0; | |
495 | masters[0]->maxhp = 30; | |
e282e9d2 | 496 | masters[0]->hp = 30; |
c8ada07e | 497 | strcpy(masters[0]->death, "You have done well my student, but the road is long. Use your new strength with humility and honor as you progress in levels!"); |
e282e9d2 | 498 | |
c8ada07e | 499 | strcpy(masters[1]->name, "Master Chang"); |
500 | strcpy(masters[1]->weapon, "Nanchaku"); | |
501 | masters[1]->strength = 57; | |
502 | masters[1]->gold = 0; | |
503 | masters[1]->exp = 0; | |
504 | masters[1]->maxhp = 40; | |
e282e9d2 | 505 | masters[1]->hp = 40; |
c8ada07e | 506 | strcpy(masters[1]->death, "You try to make out what Master Chang is saying, but the only thing you catch is something about a grasshopper."); |
507 | ||
508 | strcpy(masters[2]->name, "Chuck Norris"); | |
509 | strcpy(masters[2]->weapon, "Ranger Kick"); | |
510 | masters[2]->strength = 85; | |
511 | masters[2]->gold = 0; | |
512 | masters[2]->exp = 0; | |
513 | masters[2]->maxhp = 70; | |
e282e9d2 | 514 | masters[2]->hp = 70; |
c8ada07e | 515 | strcpy(masters[2]->death, "Be strong, and keep your goals in site. Drink milk, and don't do drugs. One day you may be fighting next to me as a Texas Ranger YEEHAW!"); |
516 | ||
517 | ||
518 | strcpy(masters[3]->name, "Mr. Miagi"); | |
519 | strcpy(masters[3]->weapon, "Petrified Bonsai"); | |
520 | masters[3]->strength = 100; | |
521 | masters[3]->gold = 0; | |
522 | masters[3]->exp = 0; | |
523 | masters[3]->maxhp = 120; | |
e282e9d2 | 524 | masters[3]->hp = 120; |
c8ada07e | 525 | strcpy(masters[3]->death, "Skill comes from repeating the correct but seemingly mundane actions. Wax ON, wax OFF!"); |
526 | ||
527 | strcpy(masters[4]->name, "Jackie Chan"); | |
e282e9d2 | 528 | strcpy(masters[4]->weapon, "Kung Fu Kick"); |
c8ada07e | 529 | masters[4]->strength = 125; |
c8ada07e | 530 | masters[4]->gold = 0; |
531 | masters[4]->exp = 0; | |
e282e9d2 | 532 | masters[4]->maxhp = 200; |
533 | masters[4]->hp = 200; | |
c8ada07e | 534 | strcpy(masters[4]->death, "I like to let people talk who like to talk... it's easier to find out how full of it they really are!"); |
535 | ||
536 | strcpy(masters[5]->name, "Jet Li"); | |
537 | strcpy(masters[5]->weapon, "Motorcycle"); | |
538 | masters[5]->strength = 150; | |
c8ada07e | 539 | masters[5]->gold = 0; |
540 | masters[5]->exp = 0; | |
e282e9d2 | 541 | masters[5]->maxhp = 400; |
542 | masters[5]->hp = 400; | |
c8ada07e | 543 | strcpy(masters[5]->death, "Failure is a fuel for excuses. It's the doing the do, that makes the making."); |
544 | ||
545 | ||
546 | strcpy(masters[6]->name, "Muhammad Ali"); | |
547 | strcpy(masters[6]->weapon, "Quick Jab"); | |
548 | masters[6]->strength = 175; | |
c8ada07e | 549 | masters[6]->gold = 0; |
550 | masters[6]->exp = 0; | |
e282e9d2 | 551 | masters[6]->maxhp = 600; |
552 | masters[6]->hp = 600; | |
c8ada07e | 553 | strcpy(masters[6]->death, "It's just a job. Grass grows, birds fly, waves pound the sand. I beat people up."); |
554 | ||
555 | strcpy(masters[7]->name, "Li Mu Bai"); | |
556 | strcpy(masters[7]->weapon, "Green Destiny"); | |
557 | masters[7]->strength = 200; | |
c8ada07e | 558 | masters[7]->gold = 0; |
559 | masters[7]->exp = 0; | |
e282e9d2 | 560 | masters[7]->maxhp = 800; |
561 | masters[7]->hp = 800; | |
c8ada07e | 562 | strcpy(masters[7]->death, "No growth without resistance. No action without reaction. No desire without restraint."); |
563 | ||
564 | ||
565 | strcpy(masters[8]->name, "Jimmy Wang Yu"); | |
566 | strcpy(masters[8]->weapon, "Flying Guillotine"); | |
567 | masters[8]->strength = 275; | |
c8ada07e | 568 | masters[8]->gold = 0; |
569 | masters[8]->exp = 0; | |
e282e9d2 | 570 | masters[8]->maxhp = 1200; |
571 | masters[8]->hp = 1200; | |
c8ada07e | 572 | strcpy(masters[8]->death, "You have beaten the one armed boxer. Proceed with caution!"); |
573 | ||
574 | strcpy(masters[9]->name, "Wong Fei Hung"); | |
575 | strcpy(masters[9]->weapon, "Drunken Boxing"); | |
576 | masters[9]->strength = 350; | |
c8ada07e | 577 | masters[9]->gold = 0; |
578 | masters[9]->exp = 0; | |
e282e9d2 | 579 | masters[9]->maxhp = 1800; |
580 | masters[9]->hp = 1800; | |
581 | strcpy(masters[9]->death, "Hiccup! Monkey drinks master's wine!"); | |
c8ada07e | 582 | |
583 | strcpy(masters[10]->name, "Bruce Lee"); | |
584 | strcpy(masters[10]->weapon, "Fists of fury"); | |
585 | masters[10]->strength = 575; | |
c8ada07e | 586 | masters[10]->gold = 0; |
587 | masters[10]->exp = 0; | |
e282e9d2 | 588 | masters[10]->maxhp = 2500; |
589 | masters[10]->hp = 2500; | |
c8ada07e | 590 | strcpy(masters[10]->death, "You must learn to concentrate. It is like a finger pointing away to the moon... DONT concentrate on the finger, or you will miss all the heavenly glory."); |
ad7dfaa0 | 591 | } |
85ce9d3e | 592 | |
593 | void init_monsters() | |
594 | { | |
c8ada07e | 595 | delete_monsters(); |
596 | for (int x = 0; x < LEVELS; x++) | |
597 | for (int y = 0; y < MONSTERS; y++) | |
598 | monsters[x][y] = new Monster(); | |
599 | ||
85ce9d3e | 600 | // Hard coded for now - Kain |
c8ada07e | 601 | |
602 | strcpy(monsters[0][0]->name, "Slime"); | |
603 | strcpy(monsters[0][0]->weapon, "Acid Goo"); | |
604 | monsters[0][0]->strength = 6; | |
605 | monsters[0][0]->gold = 50; | |
606 | monsters[0][0]->exp = 3; | |
607 | monsters[0][0]->maxhp = 9; | |
608 | strcpy(monsters[0][0]->death, "The slime oozes into nothing... you clean the acid goo off of your weapon"); | |
609 | ||
610 | strcpy(monsters[0][1]->name, "Ghost"); | |
611 | strcpy(monsters[0][1]->weapon, "Cold Breath"); | |
612 | monsters[0][1]->strength = 8; | |
613 | monsters[0][1]->gold = 100; | |
614 | monsters[0][1]->exp = 10; | |
615 | monsters[0][1]->maxhp = 10; | |
616 | strcpy(monsters[0][1]->death, "You feel a chill as the spirit leaves the realm."); | |
617 | ||
618 | strcpy(monsters[0][2]->name, "Ugly Rodent"); | |
619 | strcpy(monsters[0][2]->weapon, "Sharp Teeth"); | |
620 | monsters[0][2]->strength = 9; | |
621 | monsters[0][2]->gold = 75; | |
622 | monsters[0][2]->exp = 8; | |
623 | monsters[0][2]->maxhp = 13; | |
624 | strcpy(monsters[0][2]->death, "You stomp on the Ugly Rodent's remains for a finishing blow."); | |
625 | ||
626 | strcpy(monsters[0][3]->name, "Whart Hog"); | |
627 | strcpy(monsters[0][3]->weapon, "Tusks"); | |
628 | monsters[0][3]->strength = 10; | |
629 | monsters[0][3]->gold = 80; | |
630 | monsters[0][3]->exp = 6; | |
631 | monsters[0][3]->maxhp = 10; | |
632 | strcpy(monsters[0][3]->death, "You cook and eat the hog for good measure!"); | |
633 | ||
634 | strcpy(monsters[0][4]->name, "Pesky Kid"); | |
635 | strcpy(monsters[0][4]->weapon, "Slingshot"); | |
636 | monsters[0][4]->strength = 8; | |
637 | monsters[0][4]->gold = 30; | |
638 | monsters[0][4]->exp = 4; | |
639 | monsters[0][4]->maxhp = 6; | |
640 | strcpy(monsters[0][4]->death, "You take his slingshot and snap the band, sending the kid crying home to mom!"); | |
641 | ||
642 | strcpy(monsters[0][5]->name, "Playground Bully"); | |
643 | strcpy(monsters[0][5]->weapon, "Painful Noogie"); | |
644 | monsters[0][5]->strength = 11; | |
645 | monsters[0][5]->gold = 44; | |
646 | monsters[0][5]->exp = 6; | |
647 | monsters[0][5]->maxhp = 10; | |
648 | strcpy(monsters[0][5]->death, "You give him an indian burn, and punt him across the schoolyard!"); | |
649 | ||
650 | strcpy(monsters[0][6]->name, "Small Imp"); | |
651 | strcpy(monsters[0][6]->weapon, "Dagger"); | |
652 | monsters[0][6]->strength = 6; | |
653 | monsters[0][6]->gold = 64; | |
654 | monsters[0][6]->exp = 10; | |
655 | monsters[0][6]->maxhp = 10; | |
656 | strcpy(monsters[0][6]->death, "You can't help but laugh as he stumbles and falls onto his own dagger!"); | |
657 | ||
658 | strcpy(monsters[0][7]->name, "Little Monkey"); | |
659 | strcpy(monsters[0][7]->weapon, "Monkey Wrench"); | |
660 | monsters[0][7]->strength = 6; | |
661 | monsters[0][7]->gold = 53; | |
662 | monsters[0][7]->exp = 9; | |
663 | monsters[0][7]->maxhp = 9; | |
664 | strcpy(monsters[0][7]->death, "You want to cook it, but you just can't think of eating something that looks so human!"); | |
665 | ||
666 | strcpy(monsters[0][8]->name, "Grub Worm"); | |
667 | strcpy(monsters[0][8]->weapon, "Minor Nudge"); | |
668 | monsters[0][8]->strength = 2; | |
669 | monsters[0][8]->gold = 10; | |
670 | monsters[0][8]->exp = 3; | |
671 | monsters[0][8]->maxhp = 3; | |
672 | strcpy(monsters[0][8]->death, "You decide to save the poor little fella for your next fishing trip."); | |
673 | ||
674 | strcpy(monsters[0][9]->name, "Drakee"); | |
675 | strcpy(monsters[0][9]->weapon, "Tail Slap"); | |
676 | monsters[0][9]->strength = 5; | |
677 | monsters[0][9]->gold = 22; | |
678 | monsters[0][9]->exp = 7; | |
679 | monsters[0][9]->maxhp = 5; | |
680 | strcpy(monsters[0][9]->death, "You pull the little Drakee by its tale and slam it down on a dry stump!"); | |
681 | ||
682 | strcpy(monsters[0][10]->name, "Fat Slob"); | |
683 | strcpy(monsters[0][10]->weapon, "Smelly Breath"); | |
684 | monsters[0][10]->strength = 6; | |
685 | monsters[0][10]->gold = 40; | |
686 | monsters[0][10]->exp = 10; | |
687 | monsters[0][10]->maxhp = 7; | |
688 | strcpy(monsters[0][10]->death, "You kick his stomach for fun, and are thrown back by the spring of it all!"); | |
689 | ||
690 | strcpy(monsters[0][11]->name, "Lost Warrior"); | |
691 | strcpy(monsters[0][11]->weapon, "Long Sword"); | |
692 | monsters[0][11]->strength = 10; | |
693 | monsters[0][11]->gold = 250; | |
694 | monsters[0][11]->exp = 19; | |
695 | monsters[0][11]->maxhp = 15; | |
696 | strcpy(monsters[0][11]->death, "You give him a proper burial in respect for the dead warrior."); | |
697 | ||
698 | strcpy(monsters[1][0]->name, "Lost Warrior's Cousin Larry"); | |
699 | strcpy(monsters[1][0]->weapon, "Wood Axe"); | |
700 | monsters[1][0]->strength = 19; | |
701 | monsters[1][0]->gold = 134; | |
702 | monsters[1][0]->exp = 24; | |
703 | monsters[1][0]->maxhp = 30; | |
704 | strcpy(monsters[1][0]->death, "He was pretty pissed you killed his cousin, but he seems to have suffered the same fate!"); | |
705 | ||
706 | strcpy(monsters[1][1]->name, "Sandman"); | |
707 | strcpy(monsters[1][1]->weapon, "Sleeping Dust"); | |
708 | monsters[1][1]->strength = 25; | |
709 | monsters[1][1]->gold = 80; | |
710 | monsters[1][1]->exp = 6; | |
711 | monsters[1][1]->maxhp = 27; | |
712 | strcpy(monsters[1][1]->death, "You put the sandman to his final sleep."); | |
713 | ||
714 | strcpy(monsters[1][2]->name, "Dirty Prostitute"); | |
715 | strcpy(monsters[1][2]->weapon, "Stiletto Heel"); | |
716 | monsters[1][2]->strength = 21; | |
717 | monsters[1][2]->gold = 160; | |
718 | monsters[1][2]->exp = 12; | |
719 | monsters[1][2]->maxhp = 25; | |
720 | strcpy(monsters[1][2]->death, "Your pimp hand is strong!"); | |
721 | ||
722 | strcpy(monsters[1][3]->name, "Goblin Gardener"); | |
723 | strcpy(monsters[1][3]->weapon, "Garden Spade"); | |
724 | monsters[1][3]->strength = 18; | |
725 | monsters[1][3]->gold = 130; | |
726 | monsters[1][3]->exp = 8; | |
727 | monsters[1][3]->maxhp = 20; | |
728 | strcpy(monsters[1][3]->death, "You trample on his garden after slaying him... that felt good!"); | |
729 | ||
730 | strcpy(monsters[1][4]->name, "Evil Elf"); | |
731 | strcpy(monsters[1][4]->weapon, "Dark Bow"); | |
732 | monsters[1][4]->strength = 23; | |
733 | monsters[1][4]->gold = 136; | |
734 | monsters[1][4]->exp = 13; | |
735 | monsters[1][4]->maxhp = 24; | |
736 | strcpy(monsters[1][4]->death, "Elves are usually nice you thought... hmm."); | |
737 | ||
738 | strcpy(monsters[1][5]->name, "Viking Warrior"); | |
739 | strcpy(monsters[1][5]->weapon, "Broad Sword"); | |
740 | monsters[1][5]->strength = 21; | |
741 | monsters[1][5]->gold = 330; | |
742 | monsters[1][5]->exp = 20; | |
743 | monsters[1][5]->maxhp = 18; | |
744 | strcpy(monsters[1][5]->death, "You heard vikings were big, but not THAT big you thought."); | |
745 | ||
746 | strcpy(monsters[1][6]->name, "Wicked Witch"); | |
747 | strcpy(monsters[1][6]->weapon, "Cackling Laugh"); | |
748 | monsters[1][6]->strength = 20; | |
749 | monsters[1][6]->gold = 130; | |
750 | monsters[1][6]->exp = 20; | |
751 | monsters[1][6]->maxhp = 26; | |
752 | strcpy(monsters[1][6]->death, "Just for kicks, you splash some water on her and watch her melt."); | |
753 | ||
754 | strcpy(monsters[1][7]->name, "Vampire Bat"); | |
755 | strcpy(monsters[1][7]->weapon, "Blood Sucking Fangs"); | |
756 | monsters[1][7]->strength = 18; | |
757 | monsters[1][7]->gold = 125; | |
758 | monsters[1][7]->exp = 21; | |
759 | monsters[1][7]->maxhp = 29; | |
760 | strcpy(monsters[1][7]->death, "You fry up the bat and eat it... needs garlic."); | |
761 | ||
762 | strcpy(monsters[1][8]->name, "Thorn Bush"); | |
763 | strcpy(monsters[1][8]->weapon, "101 Thorns"); | |
764 | monsters[1][8]->strength = 16; | |
765 | monsters[1][8]->gold = 94; | |
766 | monsters[1][8]->exp = 15; | |
767 | monsters[1][8]->maxhp = 25; | |
768 | strcpy(monsters[1][8]->death, "You set the bush ablaze and roast some marshmallows."); | |
769 | ||
770 | strcpy(monsters[1][9]->name, "Barbarian"); | |
771 | strcpy(monsters[1][9]->weapon, "Heavy Sword"); | |
772 | monsters[1][9]->strength = 29; | |
773 | monsters[1][9]->gold = 250; | |
774 | monsters[1][9]->exp = 25; | |
775 | monsters[1][9]->maxhp = 30; | |
776 | strcpy(monsters[1][9]->death, "You listen to him moan as he falls over dead."); | |
777 | ||
778 | strcpy(monsters[1][10]->name, "Crypt Rat"); | |
779 | strcpy(monsters[1][10]->weapon, "Stinging Bite"); | |
780 | monsters[1][10]->strength = 25; | |
781 | monsters[1][10]->gold = 119; | |
782 | monsters[1][10]->exp = 20; | |
783 | monsters[1][10]->maxhp = 26; | |
784 | strcpy(monsters[1][10]->death, "You squash the little rodent for fear that it might not be dead."); | |
785 | ||
786 | strcpy(monsters[1][11]->name, "Small Orc"); | |
787 | strcpy(monsters[1][11]->weapon, "blade"); | |
788 | monsters[1][11]->strength = 28; | |
789 | monsters[1][11]->gold = 300; | |
790 | monsters[1][11]->exp = 30; | |
791 | monsters[1][11]->maxhp = 36; | |
792 | strcpy(monsters[1][11]->death, "It's an ugly one, and it would've grown up to be a terror..."); | |
793 | ||
794 | strcpy(monsters[2][0]->name, "Teferi"); | |
795 | strcpy(monsters[2][0]->weapon, "Puzzle Box"); | |
796 | monsters[2][0]->strength = 29; | |
797 | monsters[2][0]->gold = 380; | |
798 | monsters[2][0]->exp = 18; | |
799 | monsters[2][0]->maxhp = 29; | |
800 | strcpy(monsters[2][0]->death, "It was a puzzling experience."); | |
801 | ||
802 | strcpy(monsters[2][1]->name, "Spineless Thug"); | |
803 | strcpy(monsters[2][1]->weapon, "Spiked Bat"); | |
804 | monsters[2][1]->strength = 37; | |
805 | monsters[2][1]->gold = 384; | |
806 | monsters[2][1]->exp = 27; | |
807 | monsters[2][1]->maxhp = 32; | |
808 | strcpy(monsters[2][1]->death, "See you at the crossroads!"); | |
809 | ||
810 | strcpy(monsters[2][2]->name, "Pyromaniac"); | |
811 | strcpy(monsters[2][2]->weapon, "Flame Thrower"); | |
812 | monsters[2][2]->strength = 29; | |
813 | monsters[2][2]->gold = 563; | |
814 | monsters[2][2]->exp = 22; | |
815 | monsters[2][2]->maxhp = 45; | |
816 | strcpy(monsters[2][2]->death, "He chants FIRE FIRE as he falls to the ground... a burning heap of flesh."); | |
817 | ||
818 | strcpy(monsters[2][3]->name, "Evil Enchantress"); | |
819 | strcpy(monsters[2][3]->weapon, "Deadly Spell"); | |
820 | monsters[2][3]->strength = 50; | |
821 | monsters[2][3]->gold = 830; | |
822 | monsters[2][3]->exp = 35; | |
823 | monsters[2][3]->maxhp = 35; | |
824 | strcpy(monsters[2][3]->death, "She looked just about as good as she fought."); | |
825 | ||
826 | strcpy(monsters[2][4]->name, "Killer Leprechaun"); | |
827 | strcpy(monsters[2][4]->weapon, "Gold Rush"); | |
828 | monsters[2][4]->strength = 35; | |
829 | monsters[2][4]->gold = 1300; | |
830 | monsters[2][4]->exp = 30; | |
831 | monsters[2][4]->maxhp = 37; | |
832 | strcpy(monsters[2][4]->death, "You steal his pot of gold... that's a lot of money!"); | |
833 | ||
834 | strcpy(monsters[2][5]->name, "Avalanche Rider"); | |
835 | strcpy(monsters[2][5]->weapon, "Huge Snowball"); | |
836 | monsters[2][5]->strength = 32; | |
837 | monsters[2][5]->gold = 700; | |
838 | monsters[2][5]->exp = 32; | |
839 | monsters[2][5]->maxhp = 38; | |
840 | strcpy(monsters[2][5]->death, "You take his snowboard and snap it in two!"); | |
841 | ||
842 | strcpy(monsters[2][6]->name, "Blundering Idiot"); | |
843 | strcpy(monsters[2][6]->weapon, "Stupidity"); | |
844 | monsters[2][6]->strength = 14; | |
845 | monsters[2][6]->gold = 700; | |
846 | monsters[2][6]->exp = 20; | |
847 | monsters[2][6]->maxhp = 29; | |
848 | strcpy(monsters[2][6]->death, "Now there's one person you don't feel sorry for killing!"); | |
849 | ||
850 | strcpy(monsters[2][7]->name, "Militant Anarchist"); | |
851 | strcpy(monsters[2][7]->weapon, "Molotov Cocktail"); | |
852 | monsters[2][7]->strength = 33; | |
853 | monsters[2][7]->gold = 245; | |
854 | monsters[2][7]->exp = 45; | |
855 | monsters[2][7]->maxhp = 32; | |
856 | strcpy(monsters[2][7]->death, "Order has been restored for now..."); | |
857 | ||
858 | strcpy(monsters[2][8]->name, "Scathe Zombies"); | |
859 | strcpy(monsters[2][8]->weapon, "Death Grip"); | |
860 | monsters[2][8]->strength = 38; | |
861 | monsters[2][8]->gold = 763; | |
862 | monsters[2][8]->exp = 15; | |
863 | monsters[2][8]->maxhp = 45; | |
864 | strcpy(monsters[2][8]->death, "That was perhaps the scariest experience of your life."); | |
865 | ||
866 | strcpy(monsters[2][9]->name, "Spitting Llama"); | |
867 | strcpy(monsters[2][9]->weapon, "Spit Spray"); | |
868 | monsters[2][9]->strength = 48; | |
869 | monsters[2][9]->gold = 638; | |
870 | monsters[2][9]->exp = 28; | |
871 | monsters[2][9]->maxhp = 34; | |
872 | strcpy(monsters[2][9]->death, "You wipe the spit off your face and fling it back at the Llama."); | |
873 | ||
874 | strcpy(monsters[2][10]->name, "Juggalo"); | |
875 | strcpy(monsters[2][10]->weapon, "Clown Axe"); | |
876 | monsters[2][10]->strength = 60; | |
877 | monsters[2][10]->gold = 650; | |
878 | monsters[2][10]->exp = 30; | |
879 | monsters[2][10]->maxhp = 29; | |
880 | strcpy(monsters[2][10]->death, "What is a Juggalo? I don't know!"); | |
881 | ||
882 | strcpy(monsters[2][11]->name, "The Boogie Man"); | |
883 | strcpy(monsters[2][11]->weapon, "Striking Fear"); | |
884 | monsters[2][11]->strength = 46; | |
885 | monsters[2][11]->gold = 600; | |
886 | monsters[2][11]->exp = 35; | |
887 | monsters[2][11]->maxhp = 27; | |
888 | strcpy(monsters[2][11]->death, "He's scared you for the very last time!"); | |
889 | ||
890 | strcpy(monsters[3][0]->name, "Living Fire"); | |
891 | strcpy(monsters[3][0]->weapon, "Scorching Wind"); | |
892 | monsters[3][0]->strength = 55; | |
893 | monsters[3][0]->gold = 1100; | |
894 | monsters[3][0]->exp = 36; | |
895 | monsters[3][0]->maxhp = 55; | |
896 | strcpy(monsters[3][0]->death, "You extinguish the Living Flame once and for all!"); | |
897 | ||
898 | strcpy(monsters[3][1]->name, "Raging Orc"); | |
899 | strcpy(monsters[3][1]->weapon, "Orcish Artillary"); | |
900 | monsters[3][1]->strength = 89; | |
901 | monsters[3][1]->gold = 900; | |
902 | monsters[3][1]->exp = 25; | |
903 | monsters[3][1]->maxhp = 50; | |
904 | strcpy(monsters[3][1]->death, "This orc was a bit tougher than you remembered!"); | |
905 | ||
906 | strcpy(monsters[3][2]->name, "Huge Tarantula"); | |
907 | strcpy(monsters[3][2]->weapon, "Tangling Web"); | |
908 | monsters[3][2]->strength = 59; | |
909 | monsters[3][2]->gold = 1000; | |
910 | monsters[3][2]->exp = 35; | |
911 | monsters[3][2]->maxhp = 60; | |
912 | strcpy(monsters[3][2]->death, "You're glad you overcame your arachniphobia so soon!"); | |
913 | ||
914 | strcpy(monsters[3][3]->name, "Rabid Wolf"); | |
915 | strcpy(monsters[3][3]->weapon, "Cujo Bite"); | |
916 | monsters[3][3]->strength = 40; | |
917 | monsters[3][3]->gold = 1200; | |
918 | monsters[3][3]->exp = 47; | |
919 | monsters[3][3]->maxhp = 76; | |
920 | strcpy(monsters[3][3]->death, "The mutt falls over dead as white foam drips from its deadly canines..."); | |
921 | ||
922 | strcpy(monsters[3][4]->name, "Goblin Fighter"); | |
923 | strcpy(monsters[3][4]->weapon, "Morning Star"); | |
924 | monsters[3][4]->strength = 38; | |
925 | monsters[3][4]->gold = 700; | |
926 | monsters[3][4]->exp = 30; | |
927 | monsters[3][4]->maxhp = 75; | |
928 | strcpy(monsters[3][4]->death, "He almost caught you with his chain mace, but you sliced off his head."); | |
929 | ||
930 | strcpy(monsters[3][5]->name, "Grizzly Bear"); | |
931 | strcpy(monsters[3][5]->weapon, "Razor Claws"); | |
932 | monsters[3][5]->strength = 68; | |
933 | monsters[3][5]->gold = 1747; | |
934 | monsters[3][5]->exp = 81; | |
935 | monsters[3][5]->maxhp = 51; | |
936 | strcpy(monsters[3][5]->death, "It almost got you this time... better be careful"); | |
937 | ||
938 | strcpy(monsters[3][6]->name, "Skeleton Man"); | |
939 | strcpy(monsters[3][6]->weapon, "Leg Bone"); | |
940 | monsters[3][6]->strength = 70; | |
941 | monsters[3][6]->gold = 597; | |
942 | monsters[3][6]->exp = 57; | |
943 | monsters[3][6]->maxhp = 60; | |
944 | strcpy(monsters[3][6]->death, "As a finisher, you wind up with the broad side of your weapon and hit his skull off for a home run!"); | |
945 | ||
946 | strcpy(monsters[3][7]->name, "Young Werewolf"); | |
947 | strcpy(monsters[3][7]->weapon, "Howling Bites"); | |
948 | monsters[3][7]->strength = 75; | |
949 | monsters[3][7]->gold = 1742; | |
950 | monsters[3][7]->exp = 65; | |
951 | monsters[3][7]->maxhp = 42; | |
952 | strcpy(monsters[3][7]->death, "You scatter the wolf's body parts in hopes he will stay dead!"); | |
953 | ||
954 | strcpy(monsters[3][8]->name, "Dark Infantry"); | |
955 | strcpy(monsters[3][8]->weapon, "Flesh Reaper"); | |
956 | monsters[3][8]->strength = 69; | |
957 | monsters[3][8]->gold = 870; | |
958 | monsters[3][8]->exp = 43; | |
959 | monsters[3][8]->maxhp = 65; | |
960 | strcpy(monsters[3][8]->death, "Light has prevailed this time... but it's only so long before you meet again."); | |
961 | ||
962 | strcpy(monsters[3][9]->name, "Erie Spirit"); | |
963 | strcpy(monsters[3][9]->weapon, "Deadly Grin"); | |
964 | monsters[3][9]->strength = 63; | |
965 | monsters[3][9]->gold = 1300; | |
966 | monsters[3][9]->exp = 32; | |
967 | monsters[3][9]->maxhp = 50; | |
968 | strcpy(monsters[3][9]->death, "His cousin the ghost was a little bit easier."); | |
969 | ||
970 | strcpy(monsters[3][10]->name, "Gollum"); | |
971 | strcpy(monsters[3][10]->weapon, "Precious Treasure"); | |
972 | monsters[3][10]->strength = 66; | |
973 | monsters[3][10]->gold = 1492; | |
974 | monsters[3][10]->exp = 73; | |
975 | monsters[3][10]->maxhp = 54; | |
976 | strcpy(monsters[3][10]->death, "Gollum screams out \"MY PRECIOUS\" as his small body falls limp from your blow."); | |
977 | ||
978 | strcpy(monsters[3][11]->name, "Rock Fighter"); | |
979 | strcpy(monsters[3][11]->weapon, "Small Boulders"); | |
980 | monsters[3][11]->strength = 87; | |
981 | monsters[3][11]->gold = 1742; | |
982 | monsters[3][11]->exp = 99; | |
983 | monsters[3][11]->maxhp = 65; | |
984 | strcpy(monsters[3][11]->death, "You dodge his last rock, and counter with a low blow, cutting off his legs."); | |
985 | ||
986 | ||
987 | strcpy(monsters[4][0]->name, "Giant Sphinx"); | |
988 | strcpy(monsters[4][0]->weapon, "Ancient Curse"); | |
989 | monsters[4][0]->strength = 120; | |
990 | monsters[4][0]->gold = 1000; | |
991 | monsters[4][0]->exp = 100; | |
992 | monsters[4][0]->maxhp = 80; | |
993 | strcpy(monsters[4][0]->death, "You look in awe at the great wonder, collapsed at your feet!"); | |
994 | ||
995 | strcpy(monsters[4][1]->name, "Giant Ogre"); | |
996 | strcpy(monsters[4][1]->weapon, "Big Log"); | |
997 | monsters[4][1]->strength = 130; | |
998 | monsters[4][1]->gold = 857; | |
999 | monsters[4][1]->exp = 175; | |
1000 | monsters[4][1]->maxhp = 100; | |
1001 | strcpy(monsters[4][1]->death, "Your wits outmatched the ogre's brawn... big dumb thing."); | |
1002 | ||
1003 | strcpy(monsters[4][2]->name, "Massive Cockroach"); | |
1004 | strcpy(monsters[4][2]->weapon, "Piercing Hiss"); | |
1005 | monsters[4][2]->strength = 125; | |
1006 | monsters[4][2]->gold = 700; | |
1007 | monsters[4][2]->exp = 150; | |
1008 | monsters[4][2]->maxhp = 112; | |
1009 | strcpy(monsters[4][2]->death, "Where's the exterminator when you need one?"); | |
1010 | ||
1011 | strcpy(monsters[4][3]->name, "Big Venomous Snake"); | |
1012 | strcpy(monsters[4][3]->weapon, "Poison Fangs"); | |
1013 | monsters[4][3]->strength = 140; | |
1014 | monsters[4][3]->gold = 900; | |
1015 | monsters[4][3]->exp = 175; | |
1016 | monsters[4][3]->maxhp = 126; | |
1017 | strcpy(monsters[4][3]->death, "After killing this beast you check for puncture marks... you find none, luckily."); | |
1018 | ||
1019 | strcpy(monsters[4][4]->name, "Lizard Man"); | |
1020 | strcpy(monsters[4][4]->weapon, "Deadly Jaws"); | |
1021 | monsters[4][4]->strength = 145; | |
1022 | monsters[4][4]->gold = 1250; | |
1023 | monsters[4][4]->exp = 175; | |
1024 | monsters[4][4]->maxhp = 150; | |
1025 | strcpy(monsters[4][4]->death, "His scales made for tough armor, and his jaws for a tougher opponent!"); | |
1026 | ||
1027 | strcpy(monsters[4][5]->name, "Face Dancer"); | |
1028 | strcpy(monsters[4][5]->weapon, "Illusion Scyth"); | |
1029 | monsters[4][5]->strength = 138; | |
1030 | monsters[4][5]->gold = 1603; | |
1031 | monsters[4][5]->exp = 198; | |
1032 | monsters[4][5]->maxhp = 173; | |
1033 | strcpy(monsters[4][5]->death, "His carcus takes the shape of many things before it dies. His true form is so repulsive, you know why he changed faces so much!"); | |
1034 | ||
1035 | strcpy(monsters[4][6]->name, "Darklord Longbow Archer"); | |
1036 | strcpy(monsters[4][6]->weapon, "Deadly Bow and Arrows"); | |
1037 | monsters[4][6]->strength = 145; | |
1038 | monsters[4][6]->gold = 1569; | |
1039 | monsters[4][6]->exp = 243; | |
1040 | monsters[4][6]->maxhp = 170; | |
1041 | strcpy(monsters[4][6]->death, "Your face turns white with horror after you realize you just met the devil's protector!"); | |
1042 | ||
1043 | strcpy(monsters[4][7]->name, "Hell's Paladin"); | |
1044 | strcpy(monsters[4][7]->weapon, "Sword of Hellfire"); | |
1045 | monsters[4][7]->strength = 200; | |
1046 | monsters[4][7]->gold = 2191; | |
1047 | monsters[4][7]->exp = 254; | |
1048 | monsters[4][7]->maxhp = 175; | |
1049 | strcpy(monsters[4][7]->death, "This is starting to get tough you think. Do you really want to go to level 6?"); | |
1050 | ||
1051 | strcpy(monsters[4][8]->name, "The Unknown Soldier"); | |
1052 | strcpy(monsters[4][8]->weapon, "Soul Torture"); | |
1053 | monsters[4][8]->strength = 175; | |
1054 | monsters[4][8]->gold = 1890; | |
1055 | monsters[4][8]->exp = 200; | |
1056 | monsters[4][8]->maxhp = 180; | |
1057 | strcpy(monsters[4][8]->death, "Who was that? Where was he from? And what was that weapon??"); | |
1058 | ||
1059 | strcpy(monsters[4][9]->name, "Undead Cult Leader"); | |
1060 | strcpy(monsters[4][9]->weapon, "Lance of Deceit"); | |
1061 | monsters[4][9]->strength = 180; | |
1062 | monsters[4][9]->gold = 1792; | |
1063 | monsters[4][9]->exp = 195; | |
1064 | monsters[4][9]->maxhp = 190; | |
1065 | strcpy(monsters[4][9]->death, "His words fall on deaf ears... this is one cult you will NOT be part of!"); | |
1066 | ||
1067 | strcpy(monsters[4][10]->name, "Water Serpent"); | |
1068 | strcpy(monsters[4][10]->weapon, "Forked Tongue"); | |
1069 | monsters[4][10]->strength = 150; | |
1070 | monsters[4][10]->gold = 1500; | |
1071 | monsters[4][10]->exp = 176; | |
1072 | monsters[4][10]->maxhp = 220; | |
1073 | strcpy(monsters[4][10]->death, "The serpent squeals as you cut off its head!"); | |
1074 | ||
1075 | strcpy(monsters[4][11]->name, "Silverback Gorilla"); | |
1076 | strcpy(monsters[4][11]->weapon, "Deadly Banana Peel"); | |
1077 | monsters[4][11]->strength = 160; | |
1078 | monsters[4][11]->gold = 1300; | |
1079 | monsters[4][11]->exp = 150; | |
1080 | monsters[4][11]->maxhp = 178; | |
1081 | strcpy(monsters[4][11]->death, "Was that gorilla or guerilla?"); | |
cb1ad920 | 1082 | |
1083 | strcpy( monsters[5][0]->name, ""); | |
1084 | strcpy( monsters[5][0]->weapon, ""); | |
1085 | monsters[5][0]->strength = 200; | |
1086 | monsters[5][0]->gold = 2500; | |
1087 | monsters[5][0]->exp = 200; | |
1088 | monsters[5][0]->maxhp = 200; | |
1089 | strcpy( monsters[5][0]->death, ""); | |
1090 | ||
1091 | strcpy( monsters[5][1]->name, ""); | |
1092 | strcpy( monsters[5][1]->weapon, ""); | |
1093 | monsters[5][1]->strength = 230; | |
1094 | monsters[5][1]->gold = 3215; | |
1095 | monsters[5][1]->exp = 230; | |
1096 | monsters[5][1]->maxhp = 210; | |
1097 | strcpy( monsters[5][1]->death, ""); | |
1098 | ||
1099 | strcpy( monsters[5][2]->name, ""); | |
1100 | strcpy( monsters[5][2]->weapon, ""); | |
1101 | monsters[5][2]->strength = 215; | |
1102 | monsters[5][2]->gold = 2750; | |
1103 | monsters[5][2]->exp = 245; | |
1104 | monsters[5][2]->maxhp = 214; | |
1105 | strcpy( monsters[5][2]->death, ""); | |
1106 | ||
1107 | strcpy( monsters[5][3]->name, "Cheap Bastard"); | |
1108 | strcpy( monsters[5][3]->weapon, "Sack of Pennies"); | |
1109 | monsters[5][3]->strength = 245; | |
1110 | monsters[5][3]->gold = 1000; | |
1111 | monsters[5][3]->exp = 195; | |
1112 | monsters[5][3]->maxhp = 200; | |
1113 | strcpy( monsters[5][3]->death, "You hear him scream, \"MY COINS!!\" as you run off with his sack."); | |
1114 | ||
1115 | strcpy( monsters[5][4]->name, ""); | |
1116 | strcpy( monsters[5][4]->weapon, ""); | |
1117 | monsters[5][4]->strength = 300; | |
1118 | monsters[5][4]->gold = 4500; | |
1119 | monsters[5][4]->exp = 375; | |
1120 | monsters[5][4]->maxhp = 221; | |
1121 | strcpy( monsters[5][4]->death, ""); | |
1122 | ||
1123 | strcpy( monsters[5][5]->name, ""); | |
1124 | strcpy( monsters[5][5]->weapon, ""); | |
1125 | monsters[5][5]->strength = 1; | |
1126 | monsters[5][5]->gold = 1; | |
1127 | monsters[5][5]->exp = 1; | |
1128 | monsters[5][5]->maxhp = 1; | |
1129 | strcpy( monsters[5][5]->death, ""); | |
1130 | ||
1131 | strcpy( monsters[5][6]->name, ""); | |
1132 | strcpy( monsters[5][6]->weapon, ""); | |
1133 | monsters[5][6]->strength = 1; | |
1134 | monsters[5][6]->gold = 1; | |
1135 | monsters[5][6]->exp = 1; | |
1136 | monsters[5][6]->maxhp = 1; | |
1137 | strcpy( monsters[5][6]->death, ""); | |
1138 | ||
1139 | strcpy( monsters[5][7]->name, ""); | |
1140 | strcpy( monsters[5][7]->weapon, ""); | |
1141 | monsters[5][7]->strength = 1; | |
1142 | monsters[5][7]->gold = 1; | |
1143 | monsters[5][7]->exp = 1; | |
1144 | monsters[5][7]->maxhp = 1; | |
1145 | strcpy( monsters[5][7]->death, ""); | |
1146 | ||
1147 | strcpy( monsters[5][8]->name, ""); | |
1148 | strcpy( monsters[5][8]->weapon, ""); | |
1149 | monsters[5][8]->strength = 1; | |
1150 | monsters[5][8]->gold = 1; | |
1151 | monsters[5][8]->exp = 1; | |
1152 | monsters[5][8]->maxhp = 1; | |
1153 | strcpy( monsters[5][8]->death, ""); | |
1154 | ||
1155 | strcpy( monsters[5][9]->name, ""); | |
1156 | strcpy( monsters[5][9]->weapon, ""); | |
1157 | monsters[5][9]->strength = 1; | |
1158 | monsters[5][9]->gold = 1; | |
1159 | monsters[5][9]->exp = 1; | |
1160 | monsters[5][9]->maxhp = 1; | |
1161 | strcpy( monsters[5][9]->death, ""); | |
1162 | ||
1163 | strcpy( monsters[5][10]->name, ""); | |
1164 | strcpy( monsters[5][10]->weapon, ""); | |
1165 | monsters[5][10]->strength = 1; | |
1166 | monsters[5][10]->gold = 1; | |
1167 | monsters[5][10]->exp = 1; | |
1168 | monsters[5][10]->maxhp = 1; | |
1169 | strcpy( monsters[5][10]->death, ""); | |
1170 | ||
1171 | strcpy( monsters[5][11]->name, ""); | |
1172 | strcpy( monsters[5][11]->weapon, ""); | |
1173 | monsters[5][11]->strength = 1; | |
1174 | monsters[5][11]->gold = 1; | |
1175 | monsters[5][11]->exp = 1; | |
1176 | monsters[5][11]->maxhp = 1; | |
1177 | strcpy( monsters[5][11]->death, ""); | |
1178 | ||
1179 | strcpy( monsters[6][0]->name, ""); | |
1180 | strcpy( monsters[6][0]->weapon, ""); | |
1181 | monsters[6][0]->strength = 1; | |
1182 | monsters[6][0]->gold = 1; | |
1183 | monsters[6][0]->exp = 1; | |
1184 | monsters[6][0]->maxhp = 1; | |
1185 | strcpy( monsters[6][0]->death, ""); | |
1186 | ||
1187 | strcpy( monsters[6][1]->name, ""); | |
1188 | strcpy( monsters[6][1]->weapon, ""); | |
1189 | monsters[6][1]->strength = 1; | |
1190 | monsters[6][1]->gold = 1; | |
1191 | monsters[6][1]->exp = 1; | |
1192 | monsters[6][1]->maxhp = 1; | |
1193 | strcpy( monsters[6][1]->death, ""); | |
1194 | ||
1195 | strcpy( monsters[6][2]->name, ""); | |
1196 | strcpy( monsters[6][2]->weapon, ""); | |
1197 | monsters[6][2]->strength = 1; | |
1198 | monsters[6][2]->gold = 1; | |
1199 | monsters[6][2]->exp = 1; | |
1200 | monsters[6][2]->maxhp = 1; | |
1201 | strcpy( monsters[6][2]->death, ""); | |
1202 | ||
1203 | strcpy( monsters[6][3]->name, ""); | |
1204 | strcpy( monsters[6][3]->weapon, ""); | |
1205 | monsters[6][3]->strength = 1; | |
1206 | monsters[6][3]->gold = 1; | |
1207 | monsters[6][3]->exp = 1; | |
1208 | monsters[6][3]->maxhp = 1; | |
1209 | strcpy( monsters[6][3]->death, ""); | |
1210 | ||
1211 | strcpy( monsters[6][4]->name, ""); | |
1212 | strcpy( monsters[6][4]->weapon, ""); | |
1213 | monsters[6][4]->strength = 1; | |
1214 | monsters[6][4]->gold = 1; | |
1215 | monsters[6][4]->exp = 1; | |
1216 | monsters[6][4]->maxhp = 1; | |
1217 | strcpy( monsters[6][4]->death, ""); | |
1218 | ||
1219 | strcpy( monsters[6][5]->name, ""); | |
1220 | strcpy( monsters[6][5]->weapon, ""); | |
1221 | monsters[6][5]->strength = 1; | |
1222 | monsters[6][5]->gold = 1; | |
1223 | monsters[6][5]->exp = 1; | |
1224 | monsters[6][5]->maxhp = 1; | |
1225 | strcpy( monsters[6][5]->death, ""); | |
1226 | ||
1227 | strcpy( monsters[6][6]->name, ""); | |
1228 | strcpy( monsters[6][6]->weapon, ""); | |
1229 | monsters[6][6]->strength = 1; | |
1230 | monsters[6][6]->gold = 1; | |
1231 | monsters[6][6]->exp = 1; | |
1232 | monsters[6][6]->maxhp = 1; | |
1233 | strcpy( monsters[6][6]->death, ""); | |
1234 | ||
1235 | strcpy( monsters[6][7]->name, ""); | |
1236 | strcpy( monsters[6][7]->weapon, ""); | |
1237 | monsters[6][7]->strength = 1; | |
1238 | monsters[6][7]->gold = 1; | |
1239 | monsters[6][7]->exp = 1; | |
1240 | monsters[6][7]->maxhp = 1; | |
1241 | strcpy( monsters[6][7]->death, ""); | |
1242 | ||
1243 | strcpy( monsters[6][8]->name, ""); | |
1244 | strcpy( monsters[6][8]->weapon, ""); | |
1245 | monsters[6][8]->strength = 1; | |
1246 | monsters[6][8]->gold = 1; | |
1247 | monsters[6][8]->exp = 1; | |
1248 | monsters[6][8]->maxhp = 1; | |
1249 | strcpy( monsters[6][8]->death, ""); | |
1250 | ||
1251 | strcpy( monsters[6][9]->name, ""); | |
1252 | strcpy( monsters[6][9]->weapon, ""); | |
1253 | monsters[6][9]->strength = 1; | |
1254 | monsters[6][9]->gold = 1; | |
1255 | monsters[6][9]->exp = 1; | |
1256 | monsters[6][9]->maxhp = 1; | |
1257 | strcpy( monsters[6][9]->death, ""); | |
1258 | ||
1259 | strcpy( monsters[6][10]->name, ""); | |
1260 | strcpy( monsters[6][10]->weapon, ""); | |
1261 | monsters[6][10]->strength = 1; | |
1262 | monsters[6][10]->gold = 1; | |
1263 | monsters[6][10]->exp = 1; | |
1264 | monsters[6][10]->maxhp = 1; | |
1265 | strcpy( monsters[6][10]->death, ""); | |
1266 | ||
1267 | strcpy( monsters[6][11]->name, ""); | |
1268 | strcpy( monsters[6][11]->weapon, ""); | |
1269 | monsters[6][11]->strength = 1; | |
1270 | monsters[6][11]->gold = 1; | |
1271 | monsters[6][11]->exp = 1; | |
1272 | monsters[6][11]->maxhp = 1; | |
1273 | strcpy( monsters[6][11]->death, ""); | |
1274 | ||
1275 | strcpy( monsters[7][0]->name, ""); | |
1276 | strcpy( monsters[7][0]->weapon, ""); | |
1277 | monsters[7][0]->strength = 1; | |
1278 | monsters[7][0]->gold = 1; | |
1279 | monsters[7][0]->exp = 1; | |
1280 | monsters[7][0]->maxhp = 1; | |
1281 | strcpy( monsters[7][0]->death, ""); | |
1282 | ||
1283 | strcpy( monsters[7][1]->name, ""); | |
1284 | strcpy( monsters[7][1]->weapon, ""); | |
1285 | monsters[7][1]->strength = 1; | |
1286 | monsters[7][1]->gold = 1; | |
1287 | monsters[7][1]->exp = 1; | |
1288 | monsters[7][1]->maxhp = 1; | |
1289 | strcpy( monsters[7][1]->death, ""); | |
1290 | ||
1291 | strcpy( monsters[7][2]->name, ""); | |
1292 | strcpy( monsters[7][2]->weapon, ""); | |
1293 | monsters[7][2]->strength = 1; | |
1294 | monsters[7][2]->gold = 1; | |
1295 | monsters[7][2]->exp = 1; | |
1296 | monsters[7][2]->maxhp = 1; | |
1297 | strcpy( monsters[7][2]->death, ""); | |
1298 | ||
1299 | strcpy( monsters[7][3]->name, ""); | |
1300 | strcpy( monsters[7][3]->weapon, ""); | |
1301 | monsters[7][3]->strength = 1; | |
1302 | monsters[7][3]->gold = 1; | |
1303 | monsters[7][3]->exp = 1; | |
1304 | monsters[7][3]->maxhp = 1; | |
1305 | strcpy( monsters[7][3]->death, ""); | |
1306 | ||
1307 | strcpy( monsters[7][4]->name, ""); | |
1308 | strcpy( monsters[7][4]->weapon, ""); | |
1309 | monsters[7][4]->strength = 1; | |
1310 | monsters[7][4]->gold = 1; | |
1311 | monsters[7][4]->exp = 1; | |
1312 | monsters[7][4]->maxhp = 1; | |
1313 | strcpy( monsters[7][4]->death, ""); | |
1314 | ||
1315 | strcpy( monsters[7][5]->name, ""); | |
1316 | strcpy( monsters[7][5]->weapon, ""); | |
1317 | monsters[7][5]->strength = 1; | |
1318 | monsters[7][5]->gold = 1; | |
1319 | monsters[7][5]->exp = 1; | |
1320 | monsters[7][5]->maxhp = 1; | |
1321 | strcpy( monsters[7][5]->death, ""); | |
1322 | ||
1323 | strcpy( monsters[7][6]->name, ""); | |
1324 | strcpy( monsters[7][6]->weapon, ""); | |
1325 | monsters[7][6]->strength = 1; | |
1326 | monsters[7][6]->gold = 1; | |
1327 | monsters[7][6]->exp = 1; | |
1328 | monsters[7][6]->maxhp = 1; | |
1329 | strcpy( monsters[7][6]->death, ""); | |
1330 | ||
1331 | strcpy( monsters[7][7]->name, ""); | |
1332 | strcpy( monsters[7][7]->weapon, ""); | |
1333 | monsters[7][7]->strength = 1; | |
1334 | monsters[7][7]->gold = 1; | |
1335 | monsters[7][7]->exp = 1; | |
1336 | monsters[7][7]->maxhp = 1; | |
1337 | strcpy( monsters[7][7]->death, ""); | |
1338 | ||
1339 | strcpy( monsters[7][8]->name, ""); | |
1340 | strcpy( monsters[7][8]->weapon, ""); | |
1341 | monsters[7][8]->strength = 1; | |
1342 | monsters[7][8]->gold = 1; | |
1343 | monsters[7][8]->exp = 1; | |
1344 | monsters[7][8]->maxhp = 1; | |
1345 | strcpy( monsters[7][8]->death, ""); | |
1346 | ||
1347 | strcpy( monsters[7][9]->name, ""); | |
1348 | strcpy( monsters[7][9]->weapon, ""); | |
1349 | monsters[7][9]->strength = 1; | |
1350 | monsters[7][9]->gold = 1; | |
1351 | monsters[7][9]->exp = 1; | |
1352 | monsters[7][9]->maxhp = 1; | |
1353 | strcpy( monsters[7][9]->death, ""); | |
1354 | ||
1355 | strcpy( monsters[7][10]->name, ""); | |
1356 | strcpy( monsters[7][10]->weapon, ""); | |
1357 | monsters[7][10]->strength = 1; | |
1358 | monsters[7][10]->gold = 1; | |
1359 | monsters[7][10]->exp = 1; | |
1360 | monsters[7][10]->maxhp = 1; | |
1361 | strcpy( monsters[7][10]->death, ""); | |
1362 | ||
1363 | strcpy( monsters[7][11]->name, ""); | |
1364 | strcpy( monsters[7][11]->weapon, ""); | |
1365 | monsters[7][11]->strength = 1; | |
1366 | monsters[7][11]->gold = 1; | |
1367 | monsters[7][11]->exp = 1; | |
1368 | monsters[7][11]->maxhp = 1; | |
1369 | strcpy( monsters[7][11]->death, ""); | |
1370 | ||
1371 | strcpy( monsters[8][0]->name, ""); | |
1372 | strcpy( monsters[8][0]->weapon, ""); | |
1373 | monsters[8][0]->strength = 1; | |
1374 | monsters[8][0]->gold = 1; | |
1375 | monsters[8][0]->exp = 1; | |
1376 | monsters[8][0]->maxhp = 1; | |
1377 | strcpy( monsters[8][0]->death, ""); | |
1378 | ||
1379 | strcpy( monsters[8][1]->name, ""); | |
1380 | strcpy( monsters[8][1]->weapon, ""); | |
1381 | monsters[8][1]->strength = 1; | |
1382 | monsters[8][1]->gold = 1; | |
1383 | monsters[8][1]->exp = 1; | |
1384 | monsters[8][1]->maxhp = 1; | |
1385 | strcpy( monsters[8][1]->death, ""); | |
1386 | ||
1387 | strcpy( monsters[8][2]->name, ""); | |
1388 | strcpy( monsters[8][2]->weapon, ""); | |
1389 | monsters[8][2]->strength = 1; | |
1390 | monsters[8][2]->gold = 1; | |
1391 | monsters[8][2]->exp = 1; | |
1392 | monsters[8][2]->maxhp = 1; | |
1393 | strcpy( monsters[8][2]->death, ""); | |
1394 | ||
1395 | strcpy( monsters[8][3]->name, ""); | |
1396 | strcpy( monsters[8][3]->weapon, ""); | |
1397 | monsters[8][3]->strength = 1; | |
1398 | monsters[8][3]->gold = 1; | |
1399 | monsters[8][3]->exp = 1; | |
1400 | monsters[8][3]->maxhp = 1; | |
1401 | strcpy( monsters[8][3]->death, ""); | |
1402 | ||
1403 | strcpy( monsters[8][4]->name, ""); | |
1404 | strcpy( monsters[8][4]->weapon, ""); | |
1405 | monsters[8][4]->strength = 1; | |
1406 | monsters[8][4]->gold = 1; | |
1407 | monsters[8][4]->exp = 1; | |
1408 | monsters[8][4]->maxhp = 1; | |
1409 | strcpy( monsters[8][4]->death, ""); | |
1410 | ||
1411 | strcpy( monsters[8][5]->name, ""); | |
1412 | strcpy( monsters[8][5]->weapon, ""); | |
1413 | monsters[8][5]->strength = 1; | |
1414 | monsters[8][5]->gold = 1; | |
1415 | monsters[8][5]->exp = 1; | |
1416 | monsters[8][5]->maxhp = 1; | |
1417 | strcpy( monsters[8][5]->death, ""); | |
1418 | ||
1419 | strcpy( monsters[8][6]->name, ""); | |
1420 | strcpy( monsters[8][6]->weapon, ""); | |
1421 | monsters[8][6]->strength = 1; | |
1422 | monsters[8][6]->gold = 1; | |
1423 | monsters[8][6]->exp = 1; | |
1424 | monsters[8][6]->maxhp = 1; | |
1425 | strcpy( monsters[8][6]->death, ""); | |
1426 | ||
1427 | strcpy( monsters[8][7]->name, ""); | |
1428 | strcpy( monsters[8][7]->weapon, ""); | |
1429 | monsters[8][7]->strength = 1; | |
1430 | monsters[8][7]->gold = 1; | |
1431 | monsters[8][7]->exp = 1; | |
1432 | monsters[8][7]->maxhp = 1; | |
1433 | strcpy( monsters[8][7]->death, ""); | |
1434 | ||
1435 | strcpy( monsters[8][8]->name, ""); | |
1436 | strcpy( monsters[8][8]->weapon, ""); | |
1437 | monsters[8][8]->strength = 1; | |
1438 | monsters[8][8]->gold = 1; | |
1439 | monsters[8][8]->exp = 1; | |
1440 | monsters[8][8]->maxhp = 1; | |
1441 | strcpy( monsters[8][8]->death, ""); | |
1442 | ||
1443 | strcpy( monsters[8][9]->name, ""); | |
1444 | strcpy( monsters[8][9]->weapon, ""); | |
1445 | monsters[8][9]->strength = 1; | |
1446 | monsters[8][9]->gold = 1; | |
1447 | monsters[8][9]->exp = 1; | |
1448 | monsters[8][9]->maxhp = 1; | |
1449 | strcpy( monsters[8][9]->death, ""); | |
1450 | ||
1451 | strcpy( monsters[8][10]->name, ""); | |
1452 | strcpy( monsters[8][10]->weapon, ""); | |
1453 | monsters[8][10]->strength = 1; | |
1454 | monsters[8][10]->gold = 1; | |
1455 | monsters[8][10]->exp = 1; | |
1456 | monsters[8][10]->maxhp = 1; | |
1457 | strcpy( monsters[8][10]->death, ""); | |
1458 | ||
1459 | strcpy( monsters[8][11]->name, ""); | |
1460 | strcpy( monsters[8][11]->weapon, ""); | |
1461 | monsters[8][11]->strength = 1; | |
1462 | monsters[8][11]->gold = 1; | |
1463 | monsters[8][11]->exp = 1; | |
1464 | monsters[8][11]->maxhp = 1; | |
1465 | strcpy( monsters[8][11]->death, ""); | |
1466 | ||
1467 | strcpy( monsters[9][0]->name, ""); | |
1468 | strcpy( monsters[9][0]->weapon, ""); | |
1469 | monsters[9][0]->strength = 1; | |
1470 | monsters[9][0]->gold = 1; | |
1471 | monsters[9][0]->exp = 1; | |
1472 | monsters[9][0]->maxhp = 1; | |
1473 | strcpy( monsters[9][0]->death, ""); | |
1474 | ||
1475 | strcpy( monsters[9][1]->name, ""); | |
1476 | strcpy( monsters[9][1]->weapon, ""); | |
1477 | monsters[9][1]->strength = 1; | |
1478 | monsters[9][1]->gold = 1; | |
1479 | monsters[9][1]->exp = 1; | |
1480 | monsters[9][1]->maxhp = 1; | |
1481 | strcpy( monsters[9][1]->death, ""); | |
1482 | ||
1483 | strcpy( monsters[9][2]->name, ""); | |
1484 | strcpy( monsters[9][2]->weapon, ""); | |
1485 | monsters[9][2]->strength = 1; | |
1486 | monsters[9][2]->gold = 1; | |
1487 | monsters[9][2]->exp = 1; | |
1488 | monsters[9][2]->maxhp = 1; | |
1489 | strcpy( monsters[9][2]->death, ""); | |
1490 | ||
1491 | strcpy( monsters[9][3]->name, ""); | |
1492 | strcpy( monsters[9][3]->weapon, ""); | |
1493 | monsters[9][3]->strength = 1; | |
1494 | monsters[9][3]->gold = 1; | |
1495 | monsters[9][3]->exp = 1; | |
1496 | monsters[9][3]->maxhp = 1; | |
1497 | strcpy( monsters[9][3]->death, ""); | |
1498 | ||
1499 | strcpy( monsters[9][4]->name, ""); | |
1500 | strcpy( monsters[9][4]->weapon, ""); | |
1501 | monsters[9][4]->strength = 1; | |
1502 | monsters[9][4]->gold = 1; | |
1503 | monsters[9][4]->exp = 1; | |
1504 | monsters[9][4]->maxhp = 1; | |
1505 | strcpy( monsters[9][4]->death, ""); | |
1506 | ||
1507 | strcpy( monsters[9][5]->name, ""); | |
1508 | strcpy( monsters[9][5]->weapon, ""); | |
1509 | monsters[9][5]->strength = 1; | |
1510 | monsters[9][5]->gold = 1; | |
1511 | monsters[9][5]->exp = 1; | |
1512 | monsters[9][5]->maxhp = 1; | |
1513 | strcpy( monsters[9][5]->death, ""); | |
1514 | ||
1515 | strcpy( monsters[9][6]->name, ""); | |
1516 | strcpy( monsters[9][6]->weapon, ""); | |
1517 | monsters[9][6]->strength = 1; | |
1518 | monsters[9][6]->gold = 1; | |
1519 | monsters[9][6]->exp = 1; | |
1520 | monsters[9][6]->maxhp = 1; | |
1521 | strcpy( monsters[9][6]->death, ""); | |
1522 | ||
1523 | strcpy( monsters[9][7]->name, ""); | |
1524 | strcpy( monsters[9][7]->weapon, ""); | |
1525 | monsters[9][7]->strength = 1; | |
1526 | monsters[9][7]->gold = 1; | |
1527 | monsters[9][7]->exp = 1; | |
1528 | monsters[9][7]->maxhp = 1; | |
1529 | strcpy( monsters[9][7]->death, ""); | |
1530 | ||
1531 | strcpy( monsters[9][8]->name, ""); | |
1532 | strcpy( monsters[9][8]->weapon, ""); | |
1533 | monsters[9][8]->strength = 1; | |
1534 | monsters[9][8]->gold = 1; | |
1535 | monsters[9][8]->exp = 1; | |
1536 | monsters[9][8]->maxhp = 1; | |
1537 | strcpy( monsters[9][8]->death, ""); | |
1538 | ||
1539 | strcpy( monsters[9][9]->name, ""); | |
1540 | strcpy( monsters[9][9]->weapon, ""); | |
1541 | monsters[9][9]->strength = 1; | |
1542 | monsters[9][9]->gold = 1; | |
1543 | monsters[9][9]->exp = 1; | |
1544 | monsters[9][9]->maxhp = 1; | |
1545 | strcpy( monsters[9][9]->death, ""); | |
1546 | ||
1547 | strcpy( monsters[9][10]->name, ""); | |
1548 | strcpy( monsters[9][10]->weapon, ""); | |
1549 | monsters[9][10]->strength = 1; | |
1550 | monsters[9][10]->gold = 1; | |
1551 | monsters[9][10]->exp = 1; | |
1552 | monsters[9][10]->maxhp = 1; | |
1553 | strcpy( monsters[9][10]->death, ""); | |
1554 | ||
1555 | strcpy( monsters[9][11]->name, ""); | |
1556 | strcpy( monsters[9][11]->weapon, ""); | |
1557 | monsters[9][11]->strength = 1; | |
1558 | monsters[9][11]->gold = 1; | |
1559 | monsters[9][11]->exp = 1; | |
1560 | monsters[9][11]->maxhp = 1; | |
1561 | strcpy( monsters[9][11]->death, ""); | |
1562 | ||
1563 | strcpy( monsters[10][0]->name, ""); | |
1564 | strcpy( monsters[10][0]->weapon, ""); | |
1565 | monsters[10][0]->strength = 1; | |
1566 | monsters[10][0]->gold = 1; | |
1567 | monsters[10][0]->exp = 1; | |
1568 | monsters[10][0]->maxhp = 1; | |
1569 | strcpy( monsters[10][0]->death, ""); | |
1570 | ||
1571 | strcpy( monsters[10][1]->name, ""); | |
1572 | strcpy( monsters[10][1]->weapon, ""); | |
1573 | monsters[10][1]->strength = 1; | |
1574 | monsters[10][1]->gold = 1; | |
1575 | monsters[10][1]->exp = 1; | |
1576 | monsters[10][1]->maxhp = 1; | |
1577 | strcpy( monsters[10][1]->death, ""); | |
1578 | ||
1579 | strcpy( monsters[10][2]->name, ""); | |
1580 | strcpy( monsters[10][2]->weapon, ""); | |
1581 | monsters[10][2]->strength = 1; | |
1582 | monsters[10][2]->gold = 1; | |
1583 | monsters[10][2]->exp = 1; | |
1584 | monsters[10][2]->maxhp = 1; | |
1585 | strcpy( monsters[10][2]->death, ""); | |
1586 | ||
1587 | strcpy( monsters[10][3]->name, ""); | |
1588 | strcpy( monsters[10][3]->weapon, ""); | |
1589 | monsters[10][3]->strength = 1; | |
1590 | monsters[10][3]->gold = 1; | |
1591 | monsters[10][3]->exp = 1; | |
1592 | monsters[10][3]->maxhp = 1; | |
1593 | strcpy( monsters[10][3]->death, ""); | |
1594 | ||
1595 | strcpy( monsters[10][4]->name, ""); | |
1596 | strcpy( monsters[10][4]->weapon, ""); | |
1597 | monsters[10][4]->strength = 1; | |
1598 | monsters[10][4]->gold = 1; | |
1599 | monsters[10][4]->exp = 1; | |
1600 | monsters[10][4]->maxhp = 1; | |
1601 | strcpy( monsters[10][4]->death, ""); | |
1602 | ||
1603 | strcpy( monsters[10][5]->name, ""); | |
1604 | strcpy( monsters[10][5]->weapon, ""); | |
1605 | monsters[10][5]->strength = 1; | |
1606 | monsters[10][5]->gold = 1; | |
1607 | monsters[10][5]->exp = 1; | |
1608 | monsters[10][5]->maxhp = 1; | |
1609 | strcpy( monsters[10][5]->death, ""); | |
1610 | ||
1611 | strcpy( monsters[10][6]->name, ""); | |
1612 | strcpy( monsters[10][6]->weapon, ""); | |
1613 | monsters[10][6]->strength = 1; | |
1614 | monsters[10][6]->gold = 1; | |
1615 | monsters[10][6]->exp = 1; | |
1616 | monsters[10][6]->maxhp = 1; | |
1617 | strcpy( monsters[10][6]->death, ""); | |
1618 | ||
1619 | strcpy( monsters[10][7]->name, ""); | |
1620 | strcpy( monsters[10][7]->weapon, ""); | |
1621 | monsters[10][7]->strength = 1; | |
1622 | monsters[10][7]->gold = 1; | |
1623 | monsters[10][7]->exp = 1; | |
1624 | monsters[10][7]->maxhp = 1; | |
1625 | strcpy( monsters[10][7]->death, ""); | |
1626 | ||
1627 | strcpy( monsters[10][8]->name, ""); | |
1628 | strcpy( monsters[10][8]->weapon, ""); | |
1629 | monsters[10][8]->strength = 1; | |
1630 | monsters[10][8]->gold = 1; | |
1631 | monsters[10][8]->exp = 1; | |
1632 | monsters[10][8]->maxhp = 1; | |
1633 | strcpy( monsters[10][8]->death, ""); | |
1634 | ||
1635 | strcpy( monsters[10][9]->name, ""); | |
1636 | strcpy( monsters[10][9]->weapon, ""); | |
1637 | monsters[10][9]->strength = 1; | |
1638 | monsters[10][9]->gold = 1; | |
1639 | monsters[10][9]->exp = 1; | |
1640 | monsters[10][9]->maxhp = 1; | |
1641 | strcpy( monsters[10][9]->death, ""); | |
1642 | ||
1643 | strcpy( monsters[10][10]->name, ""); | |
1644 | strcpy( monsters[10][10]->weapon, ""); | |
1645 | monsters[10][10]->strength = 1; | |
1646 | monsters[10][10]->gold = 1; | |
1647 | monsters[10][10]->exp = 1; | |
1648 | monsters[10][10]->maxhp = 1; | |
1649 | strcpy( monsters[10][10]->death, ""); | |
1650 | ||
1651 | strcpy( monsters[10][11]->name, ""); | |
1652 | strcpy( monsters[10][11]->weapon, ""); | |
1653 | monsters[10][11]->strength = 1; | |
1654 | monsters[10][11]->gold = 1; | |
1655 | monsters[10][11]->exp = 1; | |
1656 | monsters[10][11]->maxhp = 1; | |
1657 | strcpy( monsters[10][11]->death, ""); | |
1658 | ||
1659 | strcpy( monsters[11][0]->name, ""); | |
1660 | strcpy( monsters[11][0]->weapon, ""); | |
1661 | monsters[11][0]->strength = 1; | |
1662 | monsters[11][0]->gold = 1; | |
1663 | monsters[11][0]->exp = 1; | |
1664 | monsters[11][0]->maxhp = 1; | |
1665 | strcpy( monsters[11][0]->death, ""); | |
1666 | ||
1667 | strcpy( monsters[11][1]->name, ""); | |
1668 | strcpy( monsters[11][1]->weapon, ""); | |
1669 | monsters[11][1]->strength = 1; | |
1670 | monsters[11][1]->gold = 1; | |
1671 | monsters[11][1]->exp = 1; | |
1672 | monsters[11][1]->maxhp = 1; | |
1673 | strcpy( monsters[11][1]->death, ""); | |
1674 | ||
1675 | strcpy( monsters[11][2]->name, ""); | |
1676 | strcpy( monsters[11][2]->weapon, ""); | |
1677 | monsters[11][2]->strength = 1; | |
1678 | monsters[11][2]->gold = 1; | |
1679 | monsters[11][2]->exp = 1; | |
1680 | monsters[11][2]->maxhp = 1; | |
1681 | strcpy( monsters[11][2]->death, ""); | |
1682 | ||
1683 | strcpy( monsters[11][3]->name, ""); | |
1684 | strcpy( monsters[11][3]->weapon, ""); | |
1685 | monsters[11][3]->strength = 1; | |
1686 | monsters[11][3]->gold = 1; | |
1687 | monsters[11][3]->exp = 1; | |
1688 | monsters[11][3]->maxhp = 1; | |
1689 | strcpy( monsters[11][3]->death, ""); | |
1690 | ||
1691 | strcpy( monsters[11][4]->name, ""); | |
1692 | strcpy( monsters[11][4]->weapon, ""); | |
1693 | monsters[11][4]->strength = 1; | |
1694 | monsters[11][4]->gold = 1; | |
1695 | monsters[11][4]->exp = 1; | |
1696 | monsters[11][4]->maxhp = 1; | |
1697 | strcpy( monsters[11][4]->death, ""); | |
1698 | ||
1699 | strcpy( monsters[11][5]->name, ""); | |
1700 | strcpy( monsters[11][5]->weapon, ""); | |
1701 | monsters[11][5]->strength = 1; | |
1702 | monsters[11][5]->gold = 1; | |
1703 | monsters[11][5]->exp = 1; | |
1704 | monsters[11][5]->maxhp = 1; | |
1705 | strcpy( monsters[11][5]->death, ""); | |
1706 | ||
1707 | strcpy( monsters[11][6]->name, ""); | |
1708 | strcpy( monsters[11][6]->weapon, ""); | |
1709 | monsters[11][6]->strength = 1; | |
1710 | monsters[11][6]->gold = 1; | |
1711 | monsters[11][6]->exp = 1; | |
1712 | monsters[11][6]->maxhp = 1; | |
1713 | strcpy( monsters[11][6]->death, ""); | |
1714 | ||
1715 | strcpy( monsters[11][7]->name, ""); | |
1716 | strcpy( monsters[11][7]->weapon, ""); | |
1717 | monsters[11][7]->strength = 1; | |
1718 | monsters[11][7]->gold = 1; | |
1719 | monsters[11][7]->exp = 1; | |
1720 | monsters[11][7]->maxhp = 1; | |
1721 | strcpy( monsters[11][7]->death, ""); | |
1722 | ||
1723 | strcpy( monsters[11][8]->name, ""); | |
1724 | strcpy( monsters[11][8]->weapon, ""); | |
1725 | monsters[11][8]->strength = 1; | |
1726 | monsters[11][8]->gold = 1; | |
1727 | monsters[11][8]->exp = 1; | |
1728 | monsters[11][8]->maxhp = 1; | |
1729 | strcpy( monsters[11][8]->death, ""); | |
1730 | ||
1731 | strcpy( monsters[11][9]->name, ""); | |
1732 | strcpy( monsters[11][9]->weapon, ""); | |
1733 | monsters[11][9]->strength = 1; | |
1734 | monsters[11][9]->gold = 1; | |
1735 | monsters[11][9]->exp = 1; | |
1736 | monsters[11][9]->maxhp = 1; | |
1737 | strcpy( monsters[11][9]->death, ""); | |
1738 | ||
1739 | strcpy( monsters[11][10]->name, ""); | |
1740 | strcpy( monsters[11][10]->weapon, ""); | |
1741 | monsters[11][10]->strength = 1; | |
1742 | monsters[11][10]->gold = 1; | |
1743 | monsters[11][10]->exp = 1; | |
1744 | monsters[11][10]->maxhp = 1; | |
1745 | strcpy( monsters[11][10]->death, ""); | |
1746 | ||
1747 | strcpy( monsters[11][11]->name, ""); | |
1748 | strcpy( monsters[11][11]->weapon, ""); | |
1749 | monsters[11][11]->strength = 1; | |
1750 | monsters[11][11]->gold = 1; | |
1751 | monsters[11][11]->exp = 1; | |
1752 | monsters[11][11]->maxhp = 1; | |
1753 | strcpy( monsters[11][11]->death, ""); | |
c8ada07e | 1754 | } |
1755 | ||
1756 | void delete_monsters() | |
1757 | { | |
1758 | for (int x = 0; x < LEVELS; x++) | |
1759 | for (int y = 0; y < MONSTERS; y++) | |
1760 | if (monsters[x][y]) | |
1761 | delete monsters[x][y]; | |
1762 | } | |
1763 | ||
1764 | void delete_masters() | |
1765 | { | |
1766 | for (int x = 0; x < LEVELS; x++) | |
1767 | if (masters[x]) | |
1768 | delete masters[x]; | |
85ce9d3e | 1769 | } |
1770 | ||
1771 | void display_monster(char *u) | |
1772 | { | |
1773 | if (is_playing(u)) | |
1774 | { | |
1775 | aClient *user = find(u); | |
1776 | Player *ni = user->stats; | |
1777 | ||
1778 | notice(s_GameServ, u, "Your Hitpoints: \ 2%d\ 2", ni->hp); | |
1779 | notice(s_GameServ, u, "%s's Hitpoints: \ 2%d\ 2", ni->fight->name, ni->fight->hp); | |
1780 | notice(s_GameServ, u, "Here are your commands:"); | |
1781 | notice(s_GameServ, u, "/msg %S attack"); | |
1782 | notice(s_GameServ, u, "/msg %S run"); | |
1783 | notice(s_GameServ, u, "What will you do?"); | |
1784 | } | |
1785 | } | |
1786 | ||
1787 | void display_players(char *u) | |
1788 | { | |
1789 | if (is_playing(u)) | |
1790 | { | |
1791 | aClient *ni = find(u); | |
1792 | ||
1793 | aClient *battle = ni->stats->battle; | |
1794 | ||
1795 | notice(s_GameServ, u, "Your Hitpoints: \ 2%d\ 2", ni->stats->hp); | |
1796 | notice(s_GameServ, u, "%s's Hitpoints: \ 2%d\ 2", battle->getNick(), | |
1797 | battle->stats->hp); | |
1798 | ||
1799 | notice(s_GameServ, u, "Here are your commands:"); | |
1800 | notice(s_GameServ, u, "/msg %s attack", s_GameServ); | |
1801 | notice(s_GameServ, u, "/msg %s run", s_GameServ); | |
1802 | notice(s_GameServ, u, "What will you do?"); | |
1803 | } | |
1804 | } | |
1805 | ||
1806 | ||
1807 | bool is_playing(char *u) | |
1808 | { | |
1809 | aClient *user; | |
1810 | if (!(user = find(u))) | |
1811 | { | |
1812 | return false; | |
1813 | } | |
1814 | else | |
1815 | { | |
1816 | return user->stats != NULL; | |
1817 | } | |
1818 | } | |
1819 | ||
1820 | bool is_fighting(char *u) | |
1821 | { | |
1822 | aClient *user; | |
1823 | ||
1824 | if (!(user = find(u))) | |
1825 | { | |
1826 | return false; | |
1827 | } | |
1828 | else if (user->stats) | |
1829 | { | |
1830 | return user->stats->fight != NULL || user->stats->battle != NULL | |
1831 | || user->stats->master != NULL; | |
1832 | } | |
1833 | else | |
1834 | return false; | |
1835 | } | |
1836 | ||
1837 | bool player_fight(char *u) | |
1838 | { | |
1839 | aClient *user; | |
1840 | ||
1841 | if (!(user = find(u))) | |
1842 | return false; | |
1843 | else if (user->stats) | |
1844 | return user->stats->battle != NULL; | |
1845 | else | |
1846 | return false; | |
1847 | } | |
1848 | ||
1849 | bool master_fight(char *u) | |
1850 | { | |
1851 | aClient *user; | |
1852 | ||
1853 | if (!(user = find(u))) | |
1854 | return false; | |
1855 | else if (user->stats) | |
1856 | return user->stats->master != NULL; | |
1857 | else | |
1858 | return false; | |
1859 | } | |
1860 | ||
1861 | bool isnt_fighting(char *u) | |
1862 | { | |
1863 | return !is_fighting(u); | |
1864 | } | |
1865 | ||
1866 | void do_fight(char *u) | |
1867 | { | |
1868 | aClient *ni, *battle; | |
1869 | ||
1870 | char *nick = strtok(NULL, " "); | |
1871 | ||
1872 | if (!nick) | |
1873 | { | |
1874 | notice(s_GameServ, u, "SYNTAX: /msg %S FIGHT PLAYER"); | |
1875 | } | |
1876 | else if (!(ni = find(u))) | |
1877 | { | |
1878 | return; | |
1879 | } | |
1880 | else if (!(battle = find(nick))) | |
1881 | { | |
1882 | notice(s_GameServ, u, "You can't attack %s while they aren't playing!", nick); | |
1883 | } | |
1884 | else if (!is_playing(u)) | |
1885 | { | |
1886 | notice(s_GameServ, u, "You are not playing!"); | |
1887 | } | |
1888 | /* | |
1889 | * Offline fighting not implemented yet. | |
1890 | * else if (!(fight = finduser(nick))) | |
1891 | * { | |
1892 | * ni->stats->battle = battle; | |
1893 | * battle->battle = ni; | |
1894 | * ni->yourturn = 1; | |
1895 | * battle->yourturn = 0; | |
1896 | * notice(s_GameServ, u, "You decide to fight %s while they're not online!", | |
1897 | * battle->getNick()); | |
1898 | * display_players(u); | |
1899 | * } | |
1900 | */ | |
ab4f4ec0 | 1901 | else if (is_playing(u) && is_playing(nick) && stricmp(ni->stats->name, battle->stats->name) != 0) |
85ce9d3e | 1902 | { |
1903 | // Set your battle pointer to the other player | |
1904 | ni->stats->battle = battle; | |
1905 | ||
1906 | // Set the other player's battle pointer to you | |
1907 | battle->stats->battle = ni; | |
1908 | ||
1909 | // The initiator gets the first move (perhaps this should be 50/50) | |
1910 | ni->stats->yourturn = 1; | |
1911 | battle->stats->yourturn = 0; | |
1912 | ||
1913 | // Initiate Battle sequence! | |
1914 | notice(s_GameServ, u, "You challenge %s to an online duel!", battle->getNick()); | |
1915 | notice(s_GameServ, battle->getNick(), "%s has challenged you to an online duel!", u); | |
1916 | notice(s_GameServ, battle->getNick(), "%s gets to go first because he initiated!", u); | |
1917 | notice(s_GameServ, battle->getNick(), "Please wait while %s decides what to do.", u); | |
1918 | display_players(u); | |
1919 | } | |
1920 | } | |
c8ada07e | 1921 | void do_run(char *u) |
1922 | { | |
1923 | aClient *user; | |
1924 | Player *p, *p2; | |
85ce9d3e | 1925 | |
c8ada07e | 1926 | if (!(user = find(u))) |
1927 | { | |
1928 | notice(s_GameServ, u, "Couldn't find you. Error. Contact a %S admin"); | |
1929 | return; | |
1930 | } | |
1931 | ||
1932 | p = user->stats; | |
1933 | ||
1934 | if (p->battle) | |
1935 | p2 = p->battle->stats; | |
1936 | ||
1937 | if (!is_fighting(u)) | |
1938 | notice(s_GameServ, u, "You run in place... try fighting next time."); | |
1939 | else if (!player_fight(u) && !master_fight(u)) | |
1940 | { | |
1941 | notice(s_GameServ, u, "You run away from \ 2%s\ 2 like a little baby!", p->fight->name); | |
1942 | delete p->fight; | |
1943 | p->fight = NULL; | |
1944 | } | |
1945 | else if (player_fight(u) && p->yourturn) | |
1946 | { | |
1947 | notice(s_GameServ, u, "You run away from \ 2%s\ 2 like a little baby!", p2->name); | |
1948 | notice(s_GameServ, p->battle->getNick(), "\ 2%s\ 2 ran away from you like a little baby!", p->name); | |
1949 | p2->battle = NULL; | |
1950 | } | |
1951 | else if (player_fight(u) && !p->yourturn) | |
1952 | { | |
1953 | notice(s_GameServ, u, "It is not your turn. Please wait until \ 2%s\ 2 decides what to do.", p2->name); | |
1954 | } | |
1955 | else if (master_fight(u)) | |
1956 | { | |
1957 | notice(s_GameServ, u, "You cannot run from \ 2%s\ 2! FIGHT!", p->master->name); | |
1958 | } | |
1959 | p->battle = NULL; | |
1960 | } | |
85ce9d3e | 1961 | void do_attack(char *u) |
1962 | { | |
1963 | int hit, mhit; | |
1964 | aClient *ni, *battle; // The player and perhaps the player they're fighting | |
1965 | Monster *fight; // The monster they may be fighting | |
1966 | ||
1967 | if (!(ni = find(u))) | |
1968 | { | |
1969 | notice(s_GameServ, u, "You're not playing!"); | |
1970 | return; | |
1971 | } | |
1972 | else if (!ni->stats->fight && !ni->stats->battle && !ni->stats->master) | |
1973 | { | |
1974 | notice(s_GameServ, u, "You're not in battle!"); | |
1975 | return; | |
1976 | } | |
1977 | else | |
1978 | { | |
1979 | if (!ni->stats->master) // This is not a master fight | |
1980 | fight = ni->stats->fight; // Monster Could be NULL | |
1981 | else // This IS a master fight | |
1982 | fight = ni->stats->master; // Master Could be NULL | |
1983 | ||
1984 | battle = ni->stats->battle; // Player Could be NULL | |
1985 | ||
1986 | // One has to be !NULL based on the previous else if | |
1987 | // We wouldn't be here if they were all NULL | |
1988 | } | |
1989 | ||
1990 | if (!player_fight(u)) | |
1991 | { | |
1992 | // Player's Hit | |
1993 | hit = ((ni->stats->strength + webonus[ni->stats->weapon]) / 2) + | |
1994 | (rand() % ((ni->stats->strength + webonus[ni->stats->weapon]) / 2)); | |
1995 | ||
1996 | // Opponent's Hit | |
1997 | mhit = (fight->strength / 2) + | |
1998 | (rand() % (fight->strength / 2) - (ni->stats->defense + | |
1999 | arbonus[ni->stats->armor])); | |
2000 | } | |
2001 | else | |
2002 | { | |
2003 | // Opponent's Hit | |
2004 | mhit = (((battle->stats->strength + webonus[battle->stats->weapon]) / 2) + | |
2005 | (rand() % ((battle->stats->strength + webonus[battle->stats->weapon])) / 2) - | |
2006 | (ni->stats->defense + arbonus[ni->stats->armor])); | |
2007 | ||
2008 | // Player's Hit | |
2009 | hit = (((ni->stats->strength + webonus[ni->stats->weapon]) / 2) + | |
2010 | (rand() % ((ni->stats->strength + webonus[ni->stats->weapon])) / 2) - | |
2011 | (battle->stats->defense + arbonus[battle->stats->armor])); | |
2012 | } | |
2013 | ||
2014 | if (!player_fight(u)) | |
2015 | { | |
2016 | if (hit > 0) | |
2017 | notice(s_GameServ, u, "You attack \1f%s\1f for \ 2%d\ 2 points!", fight->name, hit); | |
2018 | else | |
2019 | notice(s_GameServ, u, "You miss \1f%s\1f completely!", fight->name); | |
2020 | ||
2021 | if (hit >= fight->hp) | |
2022 | { | |
2023 | if (master_fight(u)) | |
2024 | notice(s_GameServ, u, "You have bested %s!", fight->name); | |
2025 | else | |
2026 | notice(s_GameServ, u, "You have killed \ 2%s\ 2!", fight->name); | |
2027 | ||
2028 | notice(s_GameServ, u, "%s", fight->death); | |
2029 | notice(s_GameServ, u, "You recieve \ 2%d\ 2 experience and \ 2%d\ 2 gold!", | |
2030 | fight->exp, fight->gold); | |
2031 | ||
2032 | // If your new experience (or gold) will be greater than 2 billion, | |
2033 | // then set your exp to 2bil. (2 billion max)... otherwise add them. | |
2034 | // This could be a problem with overflowing out of the sign bit. | |
2035 | // Unsigned long int maybe? Leave it for now. | |
2036 | ni->stats->exp = ( (ni->stats->exp + fight->exp) > 2000000000 ? 2000000000 : | |
2037 | ni->stats->exp + fight->exp); | |
2038 | ni->stats->gold = (ni->stats->gold + fight->gold > 2000000000 ? 2000000000 : | |
2039 | ni->stats->gold + fight->gold); | |
c8ada07e | 2040 | |
85ce9d3e | 2041 | |
2042 | if (master_fight(u)) | |
2043 | { | |
2044 | notice(s_GameServ, u, "You are now level %d!", ni->stats->level + 1); | |
2045 | notice(s_GameServ, u, "You gain %d Strength, and %d Defense points!", | |
2046 | strbonus[ni->stats->level - 1], defbonus[ni->stats->level - 1]); | |
2047 | ||
2048 | // Increase your level | |
2049 | ni->stats->level++; | |
2050 | ||
2051 | // Increase your maximum hit points | |
2052 | ni->stats->maxhp += hpbonus[ni->stats->level - 1]; | |
2053 | ||
2054 | // Heal the player by setting hp to their max | |
2055 | ni->stats->hp = ni->stats->maxhp; | |
2056 | ||
2057 | // Add to your strength | |
2058 | ni->stats->strength += strbonus[ni->stats->level - 1]; | |
2059 | ||
2060 | // Add to your defensive power | |
2061 | ni->stats->defense += defbonus[ni->stats->level - 1]; | |
2062 | ||
2063 | // Clear the pointer for your master | |
2064 | ni->stats->master = NULL; | |
2065 | } | |
ab4f4ec0 | 2066 | |
2067 | // They're dead so remove the pointer | |
2068 | delete ni->stats->fight; | |
2069 | ni->stats->fight = NULL; | |
2070 | ni->stats->master = NULL; | |
2071 | ||
85ce9d3e | 2072 | return; |
2073 | } | |
2074 | else | |
2075 | { | |
2076 | if (hit > 0) | |
2077 | fight->hp -= hit; | |
2078 | if (mhit > 0) | |
2079 | { | |
e282e9d2 | 2080 | notice(s_GameServ, u, "\1f%s\1f attacks with their \1f%s\1f for \ 2%d\ 2 damage!", |
85ce9d3e | 2081 | fight->name, fight->weapon, mhit); |
2082 | } | |
2083 | else if (mhit <= 0) | |
2084 | notice(s_GameServ, u, "%s completely misses you!", fight->name); | |
2085 | ||
2086 | if (mhit >= ni->stats->hp) | |
2087 | { | |
2088 | if (!master_fight(u)) | |
2089 | { | |
2090 | notice(s_GameServ, u, "You have been \ 2\1fkilled\1f\ 2 by %s!", fight->name); | |
2091 | notice(s_GameServ, u, "You lose all gold on hand and lose 10 percent "\ | |
2092 | "of your experience!"); | |
2093 | ni->stats->gold = 0; | |
2094 | ni->stats->exp -= (long int)(ni->stats->exp * .10); | |
2095 | ni->stats->fight = NULL; | |
2096 | return; | |
2097 | } | |
2098 | else | |
2099 | { | |
2100 | notice(s_GameServ, u, "%s has bested you! You will have to wait "\ | |
2101 | "until tomorrow to try again", ni->stats->master->name); | |
2102 | ni->stats->fight = NULL; | |
2103 | ni->stats->master = NULL; | |
2104 | return; | |
2105 | } | |
2106 | } | |
2107 | else | |
2108 | { | |
2109 | if (mhit > 0) | |
2110 | ni->stats->hp -= mhit; | |
2111 | display_monster(u); | |
2112 | return; | |
2113 | } | |
2114 | } | |
2115 | } | |
2116 | else if (player_fight(u)) | |
2117 | { | |
2118 | /* Offline fighting not available yet | |
2119 | if (!(online = finduser(ni->stats->battle->nick)) || !nick_identified(online)) | |
2120 | { | |
2121 | if (hit > 0) | |
2122 | notice(s_GameServ, u, "You attack \1f%s\1f for \ 2%d\ 2 points!", battle->nick, hit); | |
2123 | else | |
2124 | notice(s_GameServ, u, "You miss \1f%s\1f completely!", battle->nick); | |
2125 | if (hit >= battle->stats->hp) | |
2126 | { | |
2127 | notice(s_GameServ, u, "You have killed \ 2%s\ 2!", battle->nick); | |
2128 | * notice(s_GameServ, u, "You recieve \ 2%d\ 2 experience and \ 2%ld\ 2 gold!", | |
2129 | (long int)(battle->stats->exp * .10), battle->stats->gold); | |
2130 | if (2000000000 - ni->stats->exp > (long int)(battle->stats->exp * .10)) | |
2131 | { | |
2132 | ni->stats->exp += (long int)(battle->stats->exp * .10); | |
2133 | battle->stats->exp -= (long int)(battle->stats->exp * .10); | |
2134 | } | |
2135 | * else | |
2136 | { | |
2137 | battle->stats->exp -= (long int)(battle->stats->exp * .10); | |
2138 | ni->stats->exp = 2000000000; | |
2139 | } | |
2140 | ||
2141 | if (2000000000 - ni->stats->gold > battle->stats->gold) | |
2142 | { | |
2143 | * ni->stats->gold += battle->stats->gold; | |
2144 | battle->stats->gold = 0; | |
2145 | } | |
2146 | else | |
2147 | { | |
2148 | battle->stats->gold = 2000000000 - ni->stats->gold; | |
2149 | ni->stats->gold = 2000000000; | |
2150 | } | |
2151 | * ni->stats->battle->stats->alive = 0; | |
2152 | ni->stats->battle->battle = NULL; | |
2153 | ni->stats->battle = NULL; | |
2154 | return; | |
2155 | } | |
2156 | else | |
2157 | { | |
2158 | if (hit > 0) | |
2159 | * battle->stats->hp -= hit; | |
2160 | if (mhit > 0) | |
2161 | { | |
2162 | notice(s_GameServ, u, "\1f%s\1f hits you with their \1f%s\1f for \ 2%d\ 2 damage!", | |
2163 | battle->nick, weapons[battle->stats->weapon], mhit); | |
2164 | } | |
2165 | else if (mhit <= 0) | |
2166 | notice(s_GameServ, u, "%s completely misses you!", battle->nick); | |
2167 | * | |
2168 | if (mhit >= ni->stats->hp) | |
2169 | { | |
2170 | notice(s_GameServ, u, "You have been \ 2\1fkilled\1f\ 2 by %s!", battle->nick); | |
2171 | if (2000000000 - battle->stats->gold > ni->stats->gold) | |
2172 | { | |
2173 | notice(s_GameServ, u, "%s took all your gold!", battle->nick); | |
2174 | battle->stats->gold += ni->stats->gold; | |
2175 | * ni->stats->gold = 0; | |
2176 | } | |
2177 | else | |
2178 | { | |
2179 | notice(s_GameServ, u, "You're lucky, %s couldn't carry all your gold.", | |
2180 | battle->nick); | |
2181 | ni->stats->gold -= (2000000000 - battle->stats->gold); | |
2182 | notice(s_GameServ, u, "You were left dead with %d gold.", | |
2183 | * (long int)ni->stats->gold); | |
2184 | battle->stats->gold = 2000000000; | |
2185 | } | |
2186 | ni->stats->battle->battle = NULL; | |
2187 | ni->stats->battle = NULL; | |
2188 | ni->stats->alive = 0; | |
2189 | return; | |
2190 | } | |
2191 | * else | |
2192 | { | |
2193 | if (mhit > 0) | |
2194 | ni->stats->hp -= mhit; | |
2195 | display_players(u); | |
2196 | return; | |
2197 | } | |
2198 | } | |
2199 | } | |
2200 | * end offline fighting */ | |
2201 | ||
2202 | if (is_playing(battle->getNick())) | |
2203 | { | |
2204 | if (ni->stats->yourturn == 0) | |
2205 | { | |
2206 | notice(s_GameServ, u, "Please wait until %s decides what to do!", | |
2207 | battle->getNick()); | |
2208 | return; | |
2209 | } | |
2210 | if (hit > 0) | |
2211 | { | |
2212 | notice(s_GameServ, u, "You attack \1f%s\1f for \ 2%d\ 2 points!", battle->getNick(), hit); | |
2213 | ||
2214 | notice(s_GameServ, battle->getNick(), "%s has hit you with their %s for "\ | |
2215 | "\ 2%d\ 2 damage!", u, weapons[ni->stats->weapon], | |
2216 | hit); | |
2217 | ni->stats->yourturn = 0; | |
2218 | battle->stats->yourturn = 1; | |
2219 | display_players(battle->getNick()); | |
2220 | } | |
2221 | else | |
2222 | { | |
2223 | notice(s_GameServ, u, "You miss \1f%s\1f completely!", battle->getNick()); | |
2224 | notice(s_GameServ, battle->getNick(), "%s misses you completely!", u); | |
2225 | ni->stats->yourturn = 0; | |
2226 | battle->stats->yourturn = 1; | |
2227 | display_players(battle->getNick()); | |
2228 | } | |
2229 | if (hit >= battle->stats->hp) | |
2230 | { | |
2231 | notice(s_GameServ, u, "You have killed \ 2%s\ 2!", battle->getNick()); | |
2232 | notice(s_GameServ, u, "You recieve \ 2%d\ 2 experience and \ 2%ld\ 2 gold!", | |
2233 | (long int)(battle->stats->exp * .10), battle->stats->gold); | |
2234 | notice(s_GameServ, battle->getNick(), "You have been killed by \ 2%s\ 2!", u); | |
2235 | battle->stats->hp = 0; | |
2236 | battle->stats->alive = 0; | |
2237 | ||
2238 | if (2000000000 - ni->stats->exp > (long int)(battle->stats->exp * .10)) | |
2239 | { | |
2240 | ni->stats->exp += (long int)(battle->stats->exp * .10); | |
2241 | battle->stats->exp -= (long int)(battle->stats->exp * .10); | |
2242 | } | |
2243 | else | |
2244 | { | |
2245 | battle->stats->exp -= (long int)(battle->stats->exp * .10); | |
2246 | ni->stats->exp = 2000000000; | |
2247 | } | |
2248 | ||
2249 | if (2000000000 - ni->stats->gold > battle->stats->gold) | |
2250 | { | |
2251 | notice(s_GameServ, battle->getNick(), "You lose ten percent of experience and "\ | |
2252 | "all gold on hand!"); | |
2253 | ni->stats->gold += battle->stats->gold; | |
2254 | battle->stats->gold = 0; | |
2255 | } | |
2256 | else | |
2257 | { | |
2258 | battle->stats->gold = 2000000000 - ni->stats->gold; | |
2259 | notice(s_GameServ, battle->getNick(), "You lose ten percent of your experience!"); | |
2260 | ||
2261 | notice(s_GameServ, battle->getNick(), "However, %s could not carry all of your "\ | |
2262 | "gold.", u); | |
2263 | ||
2264 | notice(s_GameServ, battle->getNick(), "Luckily, you still have \ 2%ld\ 2 gold "\ | |
2265 | "left. All is not lost!", battle->stats->gold); | |
2266 | ||
2267 | ni->stats->gold = 2000000000; | |
2268 | } | |
2269 | battle->stats->battle = NULL; | |
2270 | ni->stats->battle = NULL; | |
2271 | return; | |
2272 | } | |
2273 | else | |
2274 | { | |
2275 | if (hit > 0) | |
2276 | battle->stats->hp -= hit; | |
2277 | //display_players(battle->getNick()); | |
2278 | ni->stats->yourturn = 0; | |
2279 | battle->stats->yourturn = 1; | |
2280 | notice(s_GameServ, u, "Please wait while %s decides what to do!", | |
2281 | battle->getNick()); | |
2282 | ||
2283 | return; | |
2284 | } | |
2285 | } | |
2286 | } | |
2287 | } | |
2288 | void do_heal(char *u) | |
2289 | { | |
2290 | aClient *ni; | |
2291 | char *amount = strtok(NULL, " "); | |
2292 | int price, num; | |
2293 | ||
2294 | if (!amount) | |
2295 | { | |
2296 | notice(s_GameServ, u, "SYNTAX: /msg %S HEAL {ALL | #}"); | |
2297 | } | |
2298 | else if (!(ni = find(u)) || !ni->stats) | |
2299 | { | |
2300 | notice(s_GameServ, u, "You aren't playing!"); | |
2301 | } | |
2302 | else if (is_fighting(u)) | |
2303 | { | |
2304 | notice(s_GameServ, u, "You can't heal in battle!"); | |
2305 | } | |
2306 | else if (ni->stats->hp >= ni->stats->maxhp) | |
2307 | { | |
2308 | notice(s_GameServ, u, "You don't need healing!"); | |
2309 | } | |
2310 | else if (stricmp(amount, "ALL") == 0) | |
2311 | { | |
2312 | price = ni->stats->level * 3; | |
2313 | if (ni->stats->gold < (ni->stats->maxhp - ni->stats->hp) * price) | |
2314 | { | |
2315 | notice(s_GameServ, u, "Healing \ 2%d\ 2 points for \ 2%d\ 2 gold per point.", | |
2316 | (long int)ni->stats->gold/price, price); | |
2317 | ni->stats->hp += ni->stats->gold / price; | |
2318 | ni->stats->gold %= price; | |
2319 | } | |
2320 | else | |
2321 | { | |
2322 | notice(s_GameServ, u, "Healing all possible points at \ 2%d\ 2 gold "\ | |
2323 | "per point.", price); | |
ad7dfaa0 | 2324 | notice(s_GameServ, u, "\ 2%d\ 2 points healed for \ 2%ld\ 2 gold. HP at MAX!", |
2325 | (ni->stats->maxhp - ni->stats->hp), | |
2326 | (price * (ni->stats->maxhp - ni->stats->hp)) ); | |
85ce9d3e | 2327 | ni->stats->gold -= price * (ni->stats->maxhp - ni->stats->hp); |
2328 | ni->stats->hp = ni->stats->maxhp; | |
2329 | } | |
2330 | } | |
2331 | else if (isstringnum(amount)) | |
2332 | { | |
2333 | num = stringtoint(amount); | |
2334 | price = ni->stats->level * 3; | |
2335 | if (ni->stats->gold < price * num) | |
2336 | { | |
2337 | notice(s_GameServ, u, "You only have enough gold to heal \ 2%d\ 2 points!", | |
2338 | (long int)ni->stats->gold/price); | |
2339 | } | |
2340 | else if (num <= ni->stats->maxhp - ni->stats->hp) | |
2341 | { | |
2342 | notice(s_GameServ, u, "Healing \ 2%d\ 2 points at \ 2%d\ 2 gold per point.", | |
2343 | num, price); | |
2344 | ni->stats->hp += num; | |
2345 | ni->stats->gold -= num * price; | |
2346 | } | |
2347 | else if (num > ni->stats->maxhp - ni->stats->hp) | |
2348 | { | |
2349 | notice(s_GameServ, u, "Healing all possible points at \ 2%d\ 2 gold "\ | |
2350 | "per point.", price); | |
2351 | notice(s_GameServ, u, "\ 2%d\ 2 points healed. HP at MAX!", | |
2352 | (ni->stats->maxhp - ni->stats->hp)); | |
2353 | ni->stats->gold -= price * (ni->stats->maxhp - ni->stats->hp); | |
2354 | ni->stats->hp = ni->stats->maxhp; | |
2355 | } | |
2356 | } | |
2357 | else if (amount[0] == '-') | |
2358 | notice(s_GameServ, u, "You trying to cheat?"); | |
2359 | else | |
2360 | notice(s_GameServ, u, "SYNTAX: /msg %S HEAL {ALL | #}"); | |
2361 | } | |
2362 | ||
2363 | int isstringnum(char *num) | |
2364 | { | |
2365 | int x; | |
2366 | for (x = 0; x < strlen(num); x++) | |
2367 | { | |
2368 | if ((int)num[x] < 48 || (int)num[x] > 57) | |
2369 | return 0; | |
2370 | } | |
2371 | return 1; | |
2372 | } | |
2373 | ||
2374 | long int stringtoint(char *number) | |
2375 | { | |
8c126acc | 2376 | cout << "stringtoint: " << number << endl; |
85ce9d3e | 2377 | long int x, len = strlen(number), sum = 0; |
2378 | if (len == 1) | |
2379 | return chartoint(number[0]); | |
2380 | sum += chartoint(number[len - 1]); | |
2381 | for (x = len - 2; x >= 0; x--) | |
2382 | { | |
8c126acc | 2383 | cout << "Adding: " << chartoint(number[x]) * pow(10, abs(x - len + 1)) << |
2384 | endl; | |
85ce9d3e | 2385 | sum += chartoint(number[x]) * pow(10, abs(x - len + 1)); |
2386 | } | |
2387 | return sum; | |
2388 | } | |
2389 | ||
2390 | long int pow(int x, int y) | |
2391 | { | |
2392 | long int value = 0; | |
2393 | int count = 0; | |
2394 | value += x; | |
2395 | ||
2396 | if (x != 0 && y != 0) | |
2397 | { | |
2398 | for (count = 1; count <= y - 1; count++) | |
2399 | value *= x; | |
2400 | } | |
2401 | else | |
2402 | return 1; | |
2403 | return value; | |
2404 | } | |
2405 | ||
2406 | long int chartoint(char ch) | |
2407 | { | |
8c126acc | 2408 | if (int(ch) >= 48 && int(ch) <= 57) |
2409 | return int(ch) - 48; | |
2410 | else | |
2411 | return 0; | |
85ce9d3e | 2412 | } |
2413 | ||
2414 | int save_gs_dbase() | |
2415 | { | |
2416 | ListNode<aClient> *ptr = players.First(); | |
2417 | Player *it; | |
2418 | ofstream outfile; | |
2419 | ||
2420 | outfile.open(playerdata); | |
2421 | ||
2422 | if (!outfile) | |
2423 | { | |
2424 | cerr << "Error opening " << playerdata << endl; | |
2425 | return 0; | |
2426 | } | |
2427 | ||
2428 | while(ptr) | |
2429 | { | |
2430 | it = ptr->getData()->stats; | |
2431 | outfile << it->name << ' ' << it->level << ' ' << it->exp << ' ' << it->gold << ' ' << it->bank << ' ' | |
2432 | << it->hp << ' ' << it->maxhp << ' ' << it->strength << ' ' << it->defense << ' ' | |
2433 | << it->armor << ' ' << it->weapon << ' ' << (it->alive ? "alive" : "dead") << ' ' | |
e3c5fe46 | 2434 | << it->forest_fights << ' ' << it->player_fights << ' ' |
2435 | << it->password << endl; | |
85ce9d3e | 2436 | ptr = ptr->Next(); |
2437 | } | |
2438 | outfile.close(); | |
2439 | } | |
2440 | ||
2441 | int load_gs_dbase() | |
2442 | { | |
2443 | ifstream infile; | |
2444 | aClient *temp; | |
2445 | Player *p; | |
e3c5fe46 | 2446 | char *alive, *tempname, *buf, *password; |
85ce9d3e | 2447 | buf = new char[1023]; |
2448 | ||
2449 | infile.open(playerdata); | |
2450 | ||
2451 | if (infile.fail()) | |
2452 | { | |
2453 | cerr << "Error opening " << playerdata << endl; | |
2454 | return 0; | |
2455 | } | |
2456 | ||
2457 | while (infile.getline(buf, 1024, '\n')) | |
2458 | { | |
cbf6551f | 2459 | cout << "temp = new aClient;" << endl << flush; |
85ce9d3e | 2460 | temp = new aClient; |
cbf6551f | 2461 | cout << "tempname = strtok(buf, " ");" << endl << flush; |
85ce9d3e | 2462 | tempname = strtok(buf, " "); |
cbf6551f | 2463 | |
2464 | cout << "temp->stats = new Player(tempname);" << endl << flush; | |
2465 | ||
85ce9d3e | 2466 | temp->stats = new Player(tempname); |
cbf6551f | 2467 | |
2468 | cout << "p = temp->stats;" << endl << flush; | |
85ce9d3e | 2469 | p = temp->stats; |
2470 | ||
2471 | //Kain 1 1 0 500 10 10 0 0 1 1 alive 100 3 | |
2472 | p->level = stringtoint(strtok(NULL, " ")); | |
2473 | p->exp = stringtoint(strtok(NULL, " ")); | |
2474 | p->gold = stringtoint(strtok(NULL, " ")); | |
2475 | p->bank = stringtoint(strtok(NULL, " ")); | |
2476 | p->hp = stringtoint(strtok(NULL, " ")); | |
2477 | p->maxhp = stringtoint(strtok(NULL, " ")); | |
2478 | p->strength = stringtoint(strtok(NULL, " ")); | |
2479 | p->defense = stringtoint(strtok(NULL, " ")); | |
2480 | p->armor = stringtoint(strtok(NULL, " ")); | |
2481 | p->weapon = stringtoint(strtok(NULL, " ")); | |
2482 | alive = strtok(NULL, " "); | |
2483 | p->alive = (stricmp(alive, "ALIVE") == 0 ? true : false); | |
2484 | p->forest_fights = stringtoint(strtok(NULL, " ")); | |
2485 | p->player_fights = stringtoint(strtok(NULL, " ")); | |
e3c5fe46 | 2486 | password = strtok(NULL, " "); |
2487 | strcpy(p->password, password); | |
85ce9d3e | 2488 | temp->setNick("NULL"); |
2489 | ||
e3c5fe46 | 2490 | printf("%s %d %ld %ld %ld %d %d %d %d %d %d %s %d %d %s\n", p->name, p->level, |
2491 | p->exp, p->gold, p->bank, p->hp, p->maxhp, p->strength, p->defense, p->armor, p->weapon, | |
2492 | alive, p->forest_fights, p->player_fights, p->password); | |
2493 | ||
cbf6551f | 2494 | cout << "Inserting " << temp->stats->name << " at back of list" << endl; |
85ce9d3e | 2495 | players.insertAtBack(temp); |
cbf6551f | 2496 | cout << temp->stats->name << " Inserted, now deleting" << endl; |
85ce9d3e | 2497 | delete temp; |
cbf6551f | 2498 | cout << "Deleted" << endl; |
85ce9d3e | 2499 | } |
1cf88153 | 2500 | delete [] buf; |
85ce9d3e | 2501 | } |
2502 | ||
e3c5fe46 | 2503 | bool passcmp(char *encrypted, char *plaintext) |
2504 | { | |
2505 | char salt[3]; | |
cdc9a6db | 2506 | char *plaintext2, *plainToencrypt; |
2507 | bool same = false; | |
2508 | ||
2509 | plaintext2 = new char[strlen(encrypted) + strlen(plaintext)]; // Extra | |
2510 | strcpy(plaintext2, plaintext); | |
2511 | ||
e3c5fe46 | 2512 | salt[0] = encrypted[0]; |
2513 | salt[1] = encrypted[1]; | |
2514 | salt[3] = '\0'; | |
cdc9a6db | 2515 | |
2516 | plainToencrypt = crypt(plaintext2, salt); | |
2517 | ||
2518 | same = (strcmp((const char *)encrypted, plainToencrypt) == 0 ? true : false); | |
2519 | ||
2520 | delete []plaintext2; | |
2521 | ||
2522 | return same; | |
e3c5fe46 | 2523 | } |
2524 | ||
2525 | bool check_password(char *name, char *plaintext) | |
2526 | { | |
0a1518fa | 2527 | aClient *client; |
e3c5fe46 | 2528 | |
0a1518fa | 2529 | if (!(client = findplayer(name))) |
2530 | return false; | |
2531 | else | |
e3c5fe46 | 2532 | { |
0a1518fa | 2533 | return passcmp(client->stats->password, plaintext); |
e3c5fe46 | 2534 | } |
e3c5fe46 | 2535 | } |
1cf88153 | 2536 | |
ad7dfaa0 | 2537 | void do_store(char *u) |
2538 | { | |
2539 | char *cmd = strtok(NULL, " "); | |
2540 | char *item = strtok(NULL, " "); | |
2541 | char *num = strtok(NULL, " "); | |
2542 | char *space; | |
8c126acc | 2543 | int wep; |
2544 | aClient *user; | |
2545 | Player *p; | |
ad7dfaa0 | 2546 | |
8c126acc | 2547 | if (!is_playing(u) || !(user = find(u))) |
2548 | notice(s_GameServ, u, "You must be playing to use the store!"); | |
2549 | else if (!cmd || !item) | |
ad7dfaa0 | 2550 | { |
2551 | notice(s_GameServ, u, "SYNTAX: STORE LIST {ARMOR | WEAPONS}"); | |
2552 | notice(s_GameServ, u, " \ 2STORE SELL {ARMOR | WEAPON}\ 2"); | |
2553 | notice(s_GameServ, u, " \ 2STORE BUY {ARMOR | WEAPON} \1fNUMBER\1f\ 2"); | |
2554 | } | |
2555 | else if (stricmp(cmd, "LIST") == 0) | |
2556 | { | |
2557 | if (stricmp(item, "WEAPONS") == 0) | |
2558 | { | |
2559 | notice(s_GameServ, u, "Welcome to Kain's Armory"); | |
2560 | notice(s_GameServ, u, "Here are the weapons we have available for the killing, sire:"); | |
2561 | for (int x = 1; x < WNA; x++) | |
2562 | { | |
2563 | space = spaces(strlen(weapons[x]), "."); | |
2564 | notice(s_GameServ, u, "%s%d. %s%s%d",(x < 10 ? " " : ""), x, weapons[x], space, prices[x - 1]); | |
2565 | free(space); | |
2566 | } | |
2567 | notice(s_GameServ, u, "To purchase a weapon, type /msg %S STORE BUY \ 2NUM\ 2."); | |
2568 | notice(s_GameServ, u, "Where num. is the weapon number from the menu above."); | |
2569 | ||
2570 | } | |
2571 | else if (stricmp(item, "ARMOR") == 0) | |
2572 | { | |
2573 | notice(s_GameServ, u, "Welcome to Kain's Armory"); | |
2574 | notice(s_GameServ, u, "I hope you enjoy the fine armor we have available for your protection:"); | |
2575 | for (int x = 1; x < WNA; x++) | |
2576 | { | |
2577 | space = spaces(strlen(armors[x]), "."); | |
2578 | notice(s_GameServ, u, "%s%d. %s%s%d",(x < 10 ? " " : ""), x, armors[x], space, prices[x - 1]); | |
2579 | free(space); | |
2580 | } | |
2581 | notice(s_GameServ, u, "To purchase armor, type /msg %S store buy armor num."); | |
2582 | notice(s_GameServ, u, "Where num. is the armor number from the menu above."); | |
2583 | ||
2584 | ||
2585 | } | |
2586 | } else if (stricmp(cmd, "BUY") == 0) { | |
8c126acc | 2587 | if (!num) |
2588 | { | |
2589 | notice(s_GameServ, u, "SYNTAX: \ 2STORE BUY {ARMOR | WEAPON} \1fNUMBER\1f\ 2"); | |
2590 | return; | |
2591 | } | |
2592 | else if (!isstringnum(num)) | |
2593 | { | |
2594 | notice(s_GameServ, u, "You must specify a number between 1 and %d. Not %s!", WNA - 1, num); | |
2595 | return; | |
2596 | } | |
2597 | if (stricmp(item, "WEAPON") == 0) | |
2598 | { | |
2599 | wep = stringtoint(num); | |
2600 | if (wep >= WNA || wep < 1) | |
2601 | { | |
2602 | notice(s_GameServ, u, "The number %d is out of range. The number you provide must be between 1 and %d.", wep, WNA - 1); | |
2603 | return; | |
2604 | } | |
2605 | ||
2606 | p = user->stats; | |
2607 | ||
2608 | if (p->weapon != 0) | |
2609 | notice(s_GameServ, u, "You have to sell your %s first!", weapons[p->weapon]); | |
2610 | else if (p->gold < prices[wep - 1]) | |
2611 | notice(s_GameServ, u, "You don't have enough gold for %s!", weapons[wep]); | |
2612 | else | |
2613 | { | |
2614 | notice(s_GameServ, u, "You have purchased %s! Thanks for the gold!", weapons[wep]); | |
2615 | p->weapon = wep; | |
2616 | p->gold -= prices[wep - 1]; | |
2617 | } | |
2618 | } | |
2619 | else if (stricmp(item, "ARMOR") == 0) | |
2620 | { | |
2621 | wep = stringtoint(num); | |
2622 | if (wep >= WNA || wep < 1) | |
2623 | { | |
2624 | notice(s_GameServ, u, "The number %d is out of range. The number you provide must be between 1 and %d.", wep, WNA - 1); | |
2625 | return; | |
2626 | } | |
2627 | ||
2628 | p = user->stats; | |
2629 | ||
2630 | if (p->armor != 0) | |
2631 | notice(s_GameServ, u, "You have to sell your %s first!", armors[p->armor]); | |
2632 | else if (p->gold < prices[wep - 1]) | |
2633 | notice(s_GameServ, u, "You don't have enough gold for %s!", armors[wep]); | |
2634 | else | |
2635 | { | |
2636 | notice(s_GameServ, u, "You have purchased %s! Thanks for the gold!", armors[wep]); | |
2637 | p->armor = wep; | |
2638 | p->gold -= prices[wep - 1]; | |
2639 | } | |
2640 | } | |
2641 | } | |
2642 | else if (stricmp(cmd, "SELL" ) == 0) | |
2643 | { | |
2644 | p = user->stats; | |
2645 | ||
2646 | if (stricmp(item, "WEAPON") == 0) | |
2647 | { | |
2648 | if (p->weapon == 0) | |
2649 | { | |
2650 | notice(s_GameServ, u, "You want me to chop off your hands?"); | |
2651 | return; | |
2652 | } | |
2653 | else if (p->gold == 2000000000) | |
2654 | { | |
2655 | notice(s_GameServ, u, "You have enough gold. I'll just take that off your hands, sire."); | |
2656 | p->weapon = 0; | |
2657 | } | |
2658 | else if (2000000000 - p->gold < (prices[p->weapon - 1] / 2)) | |
2659 | { | |
2660 | notice(s_GameServ, u, "Thank you for your business! You now have as much gold as you can carry."); | |
2661 | notice(s_GameServ, u, "However, you have no weapon... can I interest you in the %s?", weapons[WNA - 1]); | |
2662 | p->gold = 2000000000; | |
2663 | p->weapon = 0; | |
2664 | } | |
2665 | else | |
2666 | { | |
2667 | notice(s_GameServ, u, "Thank you for your business! You now have %d more gold but no weapon!", (prices[p->weapon - 1] / 2)); | |
2668 | p->gold += (prices[p->weapon - 1] / 2); | |
2669 | p->weapon = 0; | |
2670 | } | |
2671 | } | |
2672 | else if (stricmp(item, "ARMOR") == 0) | |
2673 | { | |
2674 | p = user->stats; | |
2675 | ||
2676 | if (p->armor == 0) | |
2677 | { | |
2678 | notice(s_GameServ, u, "I don't think you can be any more naked..."); | |
2679 | return; | |
2680 | } | |
2681 | if (p->gold == 2000000000) | |
2682 | { | |
2683 | notice(s_GameServ, u, "You have enough gold. I'll just take that off your hands, sire."); | |
2684 | p->armor = 0; | |
2685 | } | |
2686 | else if (2000000000 - p->gold < (prices[p->armor - 1] / 2)) | |
2687 | { | |
2688 | notice(s_GameServ, u, "Thank you for your business! You now have as much gold as you can carry."); | |
2689 | notice(s_GameServ, u, "However, you have no armor... can I interest you in %s?", armors[WNA - 1]); | |
2690 | p->gold = 2000000000; | |
2691 | p->armor = 0; | |
2692 | } | |
2693 | else | |
2694 | { | |
2695 | notice(s_GameServ, u, "Thank you for your business! You now have %d more gold but no armor!", | |
2696 | (prices[p->armor - 1] / 2)); | |
2697 | ||
2698 | p->gold += (prices[p->armor - 1] / 2); | |
2699 | p->armor = 0; | |
2700 | } | |
2701 | } | |
2702 | else | |
2703 | { | |
2704 | notice(s_GameServ, u, "SYNTAX: STORE LIST {ARMOR | WEAPONS}"); | |
2705 | notice(s_GameServ, u, " \ 2STORE SELL {ARMOR | WEAPON}\ 2"); | |
2706 | notice(s_GameServ, u, " \ 2STORE BUY {ARMOR | WEAPON} \1fNUMBER\1f\ 2"); | |
2707 | } | |
2708 | } | |
2709 | } | |
2710 | ||
2711 | void do_bank(char *u) | |
2712 | { | |
2713 | char *cmd = strtok(NULL, " "); | |
2714 | char *amount = strtok(NULL, " "); | |
2715 | char *nick = strtok(NULL, " "); | |
2716 | ||
2717 | aClient *user; | |
2718 | Player *p; | |
2719 | ||
2720 | if (!cmd || !amount || (stricmp(cmd, "TRANSFER") == 0 && !nick)) | |
2721 | { | |
2722 | notice(s_GameServ, u, "BANK {WITHDRAW | DEPOSIT} {ALL | AMOUNT}"); | |
e282e9d2 | 2723 | notice (s_GameServ, u, "BANK BALANCE"); |
8c126acc | 2724 | return; |
2725 | } | |
2726 | else if (!is_playing(u) || !(user = find(u))) | |
2727 | { | |
2728 | notice(s_GameServ, u, "You must be playing to use the bank!"); | |
2729 | return; | |
ad7dfaa0 | 2730 | } |
8c126acc | 2731 | else if (!isstringnum(amount) && stricmp(amount, "ALL") != 0) |
2732 | { | |
2733 | notice(s_GameServ, u, "I don't know how to convert alphabet letters into currency, sire!"); | |
2734 | return; | |
2735 | } | |
2736 | ||
2737 | p = user->stats; | |
2738 | ||
e282e9d2 | 2739 | if (stricmp(cmd, "BALANCE") == 0) |
2740 | { | |
2741 | showBankBalance(u); | |
2742 | } | |
2743 | else if (stricmp(cmd, "DEPOSIT") == 0) | |
8c126acc | 2744 | { |
2745 | if (p->bank == 2000000000) | |
2746 | { | |
2747 | notice(s_GameServ, u, "Your bank account is full, sire!"); | |
2748 | return; | |
2749 | } | |
2750 | else if (stricmp(amount, "ALL") == 0) | |
2751 | { | |
2752 | if (2000000000 - p->bank < p->gold) | |
2753 | { | |
2754 | notice(s_GameServ, u, "You don't have enough room for all of your gold."); | |
2755 | notice(s_GameServ, u, "Depositing %ld gold into your account", (2000000000 - p->bank)); | |
2756 | p->gold -= (2000000000 - p->bank); | |
2757 | p->bank = 2000000000; | |
e282e9d2 | 2758 | showBankBalance(u); |
8c126acc | 2759 | } |
2760 | else | |
2761 | { | |
2762 | notice(s_GameServ, u, "Depositing %ld gold into your account!", p->gold); | |
2763 | p->bank += p->gold; | |
2764 | p->gold = 0; | |
e282e9d2 | 2765 | showBankBalance(u); |
8c126acc | 2766 | } |
2767 | } | |
2768 | else if (stringtoint(amount) > p->gold) | |
2769 | { | |
2770 | notice(s_GameServ, u, "Sire, you only have %ld gold!", p->gold); | |
e282e9d2 | 2771 | showBankBalance(u); |
8c126acc | 2772 | return; |
2773 | } | |
2774 | else | |
2775 | { | |
2776 | if (2000000000 - p->bank < stringtoint(amount)) | |
2777 | { | |
2778 | notice(s_GameServ, u, "You don't have room in your account for that much."); | |
2779 | notice(s_GameServ, u, "Capping off your account with %ld gold!", (2000000000 - p->bank)); | |
2780 | p->gold -= (2000000000 - p->bank); | |
2781 | p->bank = 2000000000; | |
e282e9d2 | 2782 | showBankBalance(u); |
8c126acc | 2783 | } |
2784 | else | |
2785 | { | |
2786 | notice(s_GameServ, u, "Depositing %d gold into your account!", stringtoint(amount)); | |
2787 | p->bank += stringtoint(amount); | |
2788 | p->gold -= stringtoint(amount); | |
e282e9d2 | 2789 | showBankBalance(u); |
8c126acc | 2790 | } |
2791 | } | |
2792 | } | |
2793 | else if (stricmp(cmd, "WITHDRAW") == 0) | |
2794 | { | |
2795 | if (p->gold == 2000000000) | |
2796 | { | |
2797 | notice(s_GameServ, u, "You cannot carry any more gold, sire!"); | |
e282e9d2 | 2798 | showBankBalance(u); |
8c126acc | 2799 | return; |
2800 | } | |
2801 | else if (stricmp(amount, "ALL") == 0) | |
2802 | { | |
2803 | if (2000000000 - p->gold < p->bank) | |
2804 | { | |
2805 | notice(s_GameServ, u, "You don't have enough room to carry all that gold."); | |
2806 | notice(s_GameServ, u, "Withdrawing %ld gold from your account", (2000000000 - p->gold)); | |
2807 | p->bank -= (2000000000 - p->gold); | |
2808 | p->gold = 2000000000; | |
e282e9d2 | 2809 | showBankBalance(u); |
8c126acc | 2810 | } |
2811 | else | |
2812 | { | |
2813 | notice(s_GameServ, u, "Withdrawing %ld gold from your account!", p->bank); | |
2814 | p->gold += p->bank; | |
2815 | p->bank = 0; | |
e282e9d2 | 2816 | showBankBalance(u); |
8c126acc | 2817 | } |
2818 | } | |
2819 | else if (stringtoint(amount) > p->bank) | |
2820 | { | |
2821 | notice(s_GameServ, u, "Sire, you only have %ld gold in the bank!", p->bank); | |
e282e9d2 | 2822 | showBankBalance(u); |
8c126acc | 2823 | return; |
2824 | } | |
2825 | else | |
2826 | { | |
2827 | if (2000000000 - p->gold < stringtoint(amount)) | |
2828 | { | |
2829 | notice(s_GameServ, u, "You don't enough have room to carry that much gold!"); | |
2830 | notice(s_GameServ, u, "You fill your pockets with %ld gold!", | |
2831 | (2000000000 - p->gold)); | |
2832 | p->bank -= (2000000000 - p->gold); | |
2833 | p->gold = 2000000000; | |
e282e9d2 | 2834 | showBankBalance(u); |
8c126acc | 2835 | } |
2836 | else | |
2837 | { | |
2838 | notice(s_GameServ, u, "Withdrawing %d gold from your account!", stringtoint(amount)); | |
2839 | p->gold += stringtoint(amount); | |
2840 | p->bank -= stringtoint(amount); | |
e282e9d2 | 2841 | showBankBalance(u); |
8c126acc | 2842 | } |
2843 | } | |
2844 | } | |
2845 | ||
ad7dfaa0 | 2846 | } |
ab4f4ec0 | 2847 | |
2848 | void do_master(char *u) | |
2849 | { | |
2850 | aClient *user; | |
2851 | if (!(user = find(u))) | |
2852 | { | |
2853 | notice(s_GameServ, u, "Fatal error. Contact a(n) %S admin. buf: %s", strtok(NULL, "")); | |
2854 | return; | |
2855 | } | |
2856 | ||
2857 | if (is_fighting(u)) | |
2858 | { | |
2859 | notice(s_GameServ, u, "You're in the middle of a fight! Pay attention!"); | |
2860 | return; | |
2861 | } | |
2862 | else if (!is_playing(u)) | |
2863 | { | |
2864 | notice(s_GameServ, u, "You must be playing to see your master!"); | |
2865 | return; | |
2866 | } | |
2867 | else | |
2868 | { | |
2869 | Player *p = user->stats; | |
2870 | long int need = 0; | |
2871 | switch(p->level) | |
2872 | { | |
2873 | case 1: | |
2874 | need = 100; | |
2875 | break; | |
2876 | case 2: | |
2877 | need = 400; | |
2878 | break; | |
2879 | case 3: | |
2880 | need = 1000; | |
2881 | break; | |
2882 | case 4: | |
2883 | need = 4000; | |
2884 | break; | |
2885 | case 5: | |
2886 | need = 10000; | |
2887 | break; | |
2888 | case 6: | |
2889 | need = 40000; | |
2890 | break; | |
2891 | case 7: | |
2892 | need = 100000; | |
2893 | break; | |
2894 | case 8: | |
2895 | need = 400000; | |
2896 | break; | |
2897 | case 9: | |
2898 | need = 1000000; | |
2899 | break; | |
2900 | case 10: | |
2901 | need = 4000000; | |
2902 | break; | |
2903 | case 11: | |
2904 | need = 10000000; | |
2905 | break; | |
2906 | case 12: | |
2907 | need = p->exp + 1; | |
2908 | notice(s_GameServ, u, "You are at level 12. You are the master. What's left? The DRAGON!"); | |
2909 | break; | |
2910 | default: | |
2911 | need = p->exp + 1; // Unknown level... don't let them fight a fake master! | |
2912 | break; | |
2913 | } | |
2914 | if (p->exp >= need) | |
2915 | see_master(u); | |
2916 | else | |
2917 | notice(s_GameServ, u, "You are not worthy of fighting %s! You need %ld more experience.", masters[p->level - 1]->name, (need - p->exp)); | |
2918 | } | |
2919 | } | |
2920 | ||
2921 | void see_master(char *u) | |
2922 | { | |
2923 | aClient *user; | |
2924 | if (!(user = find(u))) | |
2925 | { | |
2926 | notice(s_GameServ, u, "Fatal error. Contact a(n) %S admin. buf: %s", strtok(NULL, "")); | |
2927 | return; | |
2928 | } | |
2929 | ||
2930 | if (!is_fighting(u) && is_playing(u)) | |
2931 | { | |
2932 | Player *p = user->stats; | |
2933 | p->master = new Monster(masters[p->level - 1]); | |
2934 | p->fight = p->master; | |
2935 | display_monster(u); // Since master is the same structure, use this function | |
2936 | } | |
2937 | } | |
e282e9d2 | 2938 | |
2939 | void showBankBalance(const char *u) | |
2940 | { | |
2941 | aClient *user; | |
2942 | Player *p; | |
2943 | if (!(user = find(u))) | |
2944 | return; | |
2945 | ||
2946 | p = user->stats; | |
2947 | ||
2948 | if (!p) | |
2949 | return; | |
2950 | ||
2951 | notice(s_GameServ, u, "Account Balance: %ld Gold On hand: %ld", p->bank, p->gold); | |
2952 | ||
2953 | } |