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