]>
jfr.im git - irc/gameservirc.git/blob - gameserv/gameserv.cpp
10 Monster monsters
[ 5 ][ 12 ];
19 char * strtok ( char * str
, const char * delim
);
20 int stricmp ( const char * s1
, const char * s2
);
21 int strnicmp ( const char * s1
, const char * s2
, size_t len
);
25 /********** Password functions **********/
27 bool passcmp ( char * encrypted
, char * plaintext
); // Compares an encrypted pass with a plain text one
29 bool check_password ( char * name
, char * plaintext
); // Finds a password for the given name, and checks it with passcmp against the plaintext password given.
31 /********** Password functions **********/
34 /********** GameServ Booleans **********/
36 bool is_playing ( char * u
); // True if the given nickname in the clients list is playing.
37 bool has_started ( char * u
); // True if the given nickname in the clients list has started playing.
38 bool is_fighting ( char * u
); // True if the given nick in the clients list is fighting anything.
39 bool isnt_fighting ( char * u
); // True if the given nick isn't fighting. Same as !is_fighting(u).
40 bool player_fight ( char * u
); // True if the player is fighting another player.
41 bool master_fight ( char * u
); // True if the player is fighting their master.
43 /********** GameServ Booleans **********/
46 void display_monster ( char * u
);
47 void display_players ( char * u
);
48 long int chartoint ( char ch
);
49 int isstringnum ( char * num
);
50 long int pow ( int x
, int y
);
51 long int stringtoint ( char * number
);
53 char * spaces ( int len
, char * seperator
);
55 void refresh ( aClient
* ni
);
57 void reset ( aClient
* ni
);
60 void do_list ( char * u
);
61 void do_register ( char * u
);
62 void do_identify ( char * u
);
63 void do_play ( char * u
);
64 void do_quitg ( char * u
);
65 void do_reset ( char * u
);
66 void do_fight ( char * u
);
67 void do_store ( char * u
);
68 void do_heal ( char * u
);
69 void do_bank ( char * u
);
70 void do_attack ( char * u
);
72 void do_visit ( char * u
);
73 void do_stats ( char * u
);
74 void see_mystic ( char * u
);
76 void showstats ( const char * u
, const char * nick
);
79 char * weapons
[ WNA
] = { "Fists" , "Stick" , "Dagger" , "Quarterstaff" , "Short Sword" ,
80 "Long Sword" , "Silver Spear" , "Battle Axe" , "The Ragnarok" ,
81 "Chain Saw" , "Poison Sword" , "Flame Sword" , "Earth Hammer" ,
82 "Light Saber" , "Masamune" , "Mystical Sword" };
84 char * armors
[ WNA
] = { "Nothing" , "Clothes" , "Leather Vest" , "Chain Mail" , "Plate Armor" ,
85 "Full Body Armor" , "Magic Mail" , "Graphite Suit" , "Steel Suit" ,
86 "Force Field" , "Armor of Light" , "Mythril Vest" , "DemiGod Armor" ,
87 "Hades' Cloak" , "Dragon Scales" , "Mystical Armor" };
89 int prices
[ WNA
- 1 ] = { 200 , 1000 , 3000 , 10000 , 30000 , 100000 , 150000 , 200000 , 400000 ,
90 1000000 , 4000000 , 10000000 , 40000000 , 100000000 , 400000000 };
91 int webonus
[ WNA
] = { 0 , 10 , 15 , 25 , 35 , 45 , 65 , 85 , 125 , 185 , 255 , 355 , 505 , 805 , 1205 , 1805 };
92 int arbonus
[ WNA
] = { 0 , 1 , 3 , 10 , 15 , 25 , 35 , 50 , 75 , 100 , 150 , 225 , 300 , 400 , 600 , 1000 };
94 int hpbonus
[ 11 ] = { 10 , 15 , 20 , 30 , 50 , 75 , 125 , 185 , 250 , 350 , 550 };
95 int strbonus
[ 11 ] = { 5 , 7 , 10 , 12 , 20 , 35 , 50 , 75 , 110 , 150 , 200 };
96 int defbonus
[ 11 ] = { 2 , 3 , 5 , 10 , 15 , 22 , 35 , 60 , 80 , 120 , 150 };
99 void gameserv ( char * source
, char * buf
)
101 char * cmd
, input
[ 1024 ];
102 cmd
= strtok ( buf
, " " );
104 source
++; // Get rid of that : at the beginning of a :Nick privmsg Gameserv :text
105 cmd
++; // Get rid of that : at the beginning of the :text (command)
107 cout
<< "Source: " << source
<< " \n cmd: " << cmd
<< endl
;
108 if ( strnicmp ( cmd
, ":\1PING" , 6 ) == 0 )
111 timestamp
= strtok ( NULL
, "\1" );
112 notice ( s_GameServ
, source
, "\1PING %s \1" , timestamp
);
113 } else if ( stricmp ( cmd
, ":\1VERSION\1" ) == 0 ) {
114 notice ( s_GameServ
, source
, "\1VERSION GameServ v1.0b\1" );
115 } else if ( stricmp ( cmd
, "SEARCH" ) == 0 ) {
116 cmd
= strtok ( NULL
, " " );
119 notice ( s_GameServ
, source
, "SYNTAX: /msg %S SEARCH FOREST" );
122 } else if ( stricmp ( cmd
, "FIGHT" ) == 0 ) {
124 } else if ( stricmp ( cmd
, "ATTACK" ) == 0 ) {
126 } else if ( stricmp ( cmd
, "HEAL" ) == 0 ) {
128 } else if ( stricmp ( cmd
, "STORE" ) == 0 ) {
130 } else if ( stricmp ( cmd
, "BANK" ) == 0 ) {
132 } else if ( stricmp ( cmd
, "PRINT" ) == 0 ) {
133 cout
<< "Printing Clients List: " << endl
;
135 cout
<< " \n Printing Player List: " << endl
;
137 } else if ( stricmp ( cmd
, "LIST" ) == 0 ) {
139 } else if ( stricmp ( cmd
, "REGISTER" ) == 0 ) {
141 } else if ( stricmp ( cmd
, "IDENTIFY" ) == 0 ) {
143 } else if ( stricmp ( cmd
, "HELP" ) == 0 ) {
144 } else if ( stricmp ( cmd
, "STATS" ) == 0 ) {
146 } else if ( stricmp ( cmd
, "SHUTDOWN" ) == 0 ) {
148 raw ( "SQUIT %s :leaving" , servername
);
149 } else if ( stricmp ( cmd
, "SAVE" ) == 0 ) {
151 } else if ( stricmp ( cmd
, "LOAD" ) == 0 ) {
153 } else if ( stricmp ( cmd
, "RAW" ) == 0 ) {
154 char * rest
= strtok ( NULL
, "" );
158 source
--; // Bring the : back so we don't leak memory
159 cmd
--; // Same thing :)
162 int stricmp ( const char * s1
, const char * s2
)
166 while (( c
= tolower (* s1
)) == tolower (* s2
)) {
172 if ( c
< tolower (* s2
))
177 void showstats ( const char * u
, const char * nick
)
179 aClient
* ni
, * sender
= find ( u
);
185 cout
<< " \n\n u: " << u
<< " \n nick: " << nick
<< endl
;
186 if (!( ni
= findbynick ( nick
)))
188 notice ( s_GameServ
, u
, " %s not found" , nick
);
193 notice ( s_GameServ
, sender
-> getNick (), "Stats for %s :" , ni
-> stats
-> name
);
195 sprintf ( buf
, "Experience: %l d" , ni
-> stats
-> exp
);
196 space
= spaces ( strlen ( buf
), " " );
197 notice ( s_GameServ
, sender
-> getNick (), " %s%s Level: %d " , buf
, space
,
201 sprintf ( buf
, "Gold: %l d" , ni
-> stats
-> gold
);
202 space
= spaces ( strlen ( buf
), " " );
203 notice ( s_GameServ
, sender
-> getNick (), " %s%s Gold in Bank: %l d" , buf
, space
, ni
-> stats
-> bank
);
206 notice ( s_GameServ
, sender
-> getNick (), "Health Points: %d of %d " , ni
-> stats
-> hp
,
209 sprintf ( buf
, "Strength: %d " , ni
-> stats
-> strength
+ webonus
[ ni
-> stats
-> weapon
]);
210 space
= spaces ( strlen ( buf
), " " );
211 notice ( s_GameServ
, sender
-> getNick (), " %s%s Defense: %d " ,
212 buf
, space
, ni
-> stats
-> defense
+ arbonus
[ ni
-> stats
-> armor
]);
215 sprintf ( buf
, "Armor: %s " , armors
[ ni
-> stats
-> armor
]);
216 space
= spaces ( strlen ( buf
), " " );
217 notice ( s_GameServ
, sender
-> getNick (), " %s%s Weapon: %s " , buf
, space
,
218 weapons
[ ni
-> stats
-> weapon
]);
221 sprintf ( buf
, "Forest Fights: %d " , ni
-> stats
-> forest_fights
);
222 space
= spaces ( strlen ( buf
), " " );
223 notice ( s_GameServ
, sender
-> getNick (), " %s%s Player Fights: %d " , buf
, space
, ni
-> stats
-> player_fights
);
230 char * spaces ( int len
, char * seperator
)
233 final
= new char [ 40 ];
235 strcpy ( final
, seperator
);
236 for ( y
= 0 ; y
< 40 - len
; y
++)
237 strcat ( final
, seperator
);
241 void raw ( const char * fmt
, ...)
246 input
= new char [ 1024 ];
248 memset ( input
, 0 , sizeof ( input
)); // Initialize to NULL
254 case 'd' : sprintf ( input
, " %s%d " , input
, va_arg ( args
, int )); break ;
255 case 's' : sprintf ( input
, " %s%s " , input
, va_arg ( args
, char *)); break ;
256 case 'S' : sprintf ( input
, " %s%s " , input
, s_GameServ
); break ;
259 sprintf ( input
, " %s%l d" , input
, va_arg ( args
, long int )); break ;
264 sprintf ( input
, " %s%c " , input
, * t
);
268 sprintf ( input
, " %s%s " , input
, " \r\n " );
269 cout
<< "input: " << input
<< flush
;
270 sock_puts ( sock
, input
);
274 /* Send a NOTICE from the given source to the given nick. */
276 void notice ( const char * source
, const char * dest
, const char * fmt
, ...)
281 input
= new char [ 1024 ];
286 sprintf ( input
, ": %s NOTICE %s :" , source
, dest
);
290 sprintf ( input
, ": %s NOTICE %s :" , source
, dest
);
297 case 'd' : sprintf ( input
, " %s%d " , input
, va_arg ( args
, int )); break ;
298 case 's' : sprintf ( input
, " %s%s " , input
, va_arg ( args
, char *)); break ;
299 case 'S' : sprintf ( input
, " %s%s " , input
, s_GameServ
); break ;
302 sprintf ( input
, " %s%l d" , input
, va_arg ( args
, long int )); break ;
307 sprintf ( input
, " %s%c " , input
, * t
);
311 sprintf ( input
, " %s%s " , input
, " \r\n " );
312 cout
<< "input: " << input
<< flush
;
313 sock_puts ( sock
, input
);
319 int strnicmp ( const char * s1
, const char * s2
, size_t len
)
325 while (( c
= tolower (* s1
)) == tolower (* s2
) && len
> 0 ) {
326 if ( c
== 0 || -- len
== 0 )
331 if ( c
< tolower (* s2
))
336 char * strtok ( char * str
, const char * delim
)
338 static char * current
= NULL
;
345 current
+= strspn ( current
, delim
);
346 ret
= * current
? current
: NULL
;
347 current
+= strcspn ( current
, delim
);
355 void do_list ( char * u
)
357 ListNode
< aClient
> * temp
;
358 temp
= players
. First ();
359 if (! players
. isEmpty ())
361 notice ( s_GameServ
, u
, "People Playing:" );
364 notice ( s_GameServ
, u
, "IRC: %s Game: %s " , temp
-> getData ()-> getNick (), temp
-> getData ()-> stats
-> name
);
367 notice ( s_GameServ
, u
, "End of List" );
370 notice ( s_GameServ
, u
, "No one is playing" );
372 void do_register ( char * u
)
376 password
= strtok ( NULL
, " " );
378 static char saltChars
[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./" ;
381 salt
[ 0 ] = saltChars
[ rand () % strlen ( saltChars
)];
382 salt
[ 1 ] = saltChars
[ rand () % strlen ( saltChars
)];
387 notice ( s_GameServ
, u
, "SYNTAX: /msg %S REGISTER PASSWORD" );
389 else if ( user
= find ( u
))
393 user
-> stats
= new Player ( user
);
394 user
-> stats
-> started
= 1 ;
395 user
-> stats
-> user
= user
; // Set the backwards pointer
396 strcpy ( user
-> stats
-> password
, crypt ( password
, salt
));
397 players
. insertAtBack ( user
);
401 notice ( s_GameServ
, u
, "Already registered. Contact a %S admin for help." );
406 void do_identify ( char * u
)
408 char * password
, * name
;
410 name
= strtok ( NULL
, " " );
411 password
= strtok ( NULL
, " " );
413 if (! password
|| ! name
)
415 notice ( s_GameServ
, u
, "SYNTAX: /msg %S IDENTIFY NAME PASSWORD" );
417 else if (!( p
= findplayer ( name
)) || ! p
-> stats
)
418 notice ( s_GameServ
, u
, "Player %s not found" , name
);
419 else if (! check_password ( name
, password
))
421 notice ( s_GameServ
, u
, "Password incorrect" );
423 else if ( user
= find ( u
))
427 ListNode
< aClient
> * temp
;
428 temp
= players
. Find ( p
);
431 notice ( s_GameServ
, u
, "Fatal error. Contact %S Admin. Buf: %s " ,
435 user
-> stats
= new Player ( p
-> stats
-> name
);
436 cout
<< "Setting data for identified" << endl
;
437 user
-> stats
-> setData ( p
-> stats
);
438 cout
<< "Player Identified" << endl
<< flush
;
442 notice ( s_GameServ
, u
, "Password Accepted. Identified." );
447 notice ( s_GameServ
, u
, "Already identified. Contact a %S admin for help." );
452 void do_stats ( char * u
)
457 nick
= strtok ( NULL
, " " );
461 showstats ( u
, source
-> getNick ());
467 masters
[ 0 ]. name
= "Old Bones" ;
468 masters
[ 0 ]. weapon
= "Dull Sword Cane" ;
469 masters
[ 0 ]. strength
= 30 ;
472 masters
[ 0 ]. maxhp
= 30 ;
473 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!" ;
475 masters
[ 1 ]. name
= "Master Chang" ;
476 masters
[ 1 ]. weapon
= "Nanchaku" ;
477 masters
[ 1 ]. strength
= 57 ;
480 masters
[ 1 ]. maxhp
= 40 ;
481 masters
[ 1 ]. death
= "You try to make out what Master Chang is saying, but the only thing you catch is something about a grasshopper." ;
483 masters
[ 2 ]. name
= "Chuck Norris" ;
484 masters
[ 2 ]. weapon
= "Ranger Kick" ;
485 masters
[ 2 ]. strength
= 85 ;
488 masters
[ 2 ]. maxhp
= 70 ;
489 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!" ;
492 masters
[ 3 ]. name
= "Mr. Miagi" ;
493 masters
[ 3 ]. weapon
= "Petrified Bonsai" ;
494 masters
[ 3 ]. strength
= 100 ;
497 masters
[ 3 ]. maxhp
= 120 ;
498 masters
[ 3 ]. death
= "Skill comes from repeating the correct but seemingly mundane actions. Wax ON, wax OFF!" ;
500 masters
[ 4 ]. name
= "Jackie Chan" ;
501 masters
[ 4 ]. weapon
= "Drunken Boxing" ;
502 masters
[ 4 ]. strength
= 125 ;
503 masters
[ 4 ]. maxhp
= 200 ;
506 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!" ;
508 masters
[ 5 ]. name
= "Jet Li" ;
509 masters
[ 5 ]. weapon
= "Motorcycle" ;
510 masters
[ 5 ]. strength
= 150 ;
511 masters
[ 5 ]. maxhp
= 400 ;
514 masters
[ 5 ]. death
= "Failure is a fuel for excuses. It's the doing the do, that makes the making." ;
517 masters
[ 6 ]. name
= "Muhammad Ali" ;
518 masters
[ 6 ]. weapon
= "Quick Jab" ;
519 masters
[ 6 ]. strength
= 175 ;
520 masters
[ 6 ]. maxhp
= 600 ;
523 masters
[ 6 ]. death
= "It's just a job. Grass grows, birds fly, waves pound the sand. I beat people up." ;
525 masters
[ 7 ]. name
= "Li Mu Bai" ;
526 masters
[ 7 ]. weapon
= "Green Destiny" ;
527 masters
[ 7 ]. strength
= 200 ;
528 masters
[ 7 ]. maxhp
= 800 ;
531 masters
[ 7 ]. death
= "No growth without resistance. No action without reaction. No desire without restraint." ;
534 masters
[ 8 ]. name
= "Jimmy Wang Yu" ;
535 masters
[ 8 ]. weapon
= "Flying Guillotine" ;
536 masters
[ 8 ]. strength
= 275 ;
537 masters
[ 8 ]. maxhp
= 1200 ;
540 masters
[ 8 ]. death
= "You have beaten the one armed boxer. Proceed with caution!" ;
542 masters
[ 9 ]. name
= "Wong Fei Hung" ;
543 masters
[ 9 ]. weapon
= "Drunken Boxing" ;
544 masters
[ 9 ]. strength
= 350 ;
545 masters
[ 9 ]. maxhp
= 1800 ;
548 masters
[ 9 ]. death
= "" ;
550 masters
[ 10 ]. name
= "Bruce Lee" ;
551 masters
[ 10 ]. strength
= 575 ;
552 masters
[ 10 ]. maxhp
= 2500 ;
553 masters
[ 10 ]. gold
= 0 ;
555 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." ;
560 // Hard coded for now - Kain
561 monsters
[ 0 ][ 0 ]. name
= "Slime" ;
562 monsters
[ 0 ][ 0 ]. weapon
= "Acid Goo" ;
563 monsters
[ 0 ][ 0 ]. strength
= 6 ;
564 monsters
[ 0 ][ 0 ]. gold
= 50 ;
565 monsters
[ 0 ][ 0 ]. exp
= 3 ;
566 monsters
[ 0 ][ 0 ]. maxhp
= 9 ;
567 monsters
[ 0 ][ 0 ]. death
= "The slime oozes into nothing... you clean the acid goo off of your weapon" ;
569 monsters
[ 0 ][ 1 ]. name
= "Ghost" ;
570 monsters
[ 0 ][ 1 ]. weapon
= "Cold Breath" ;
571 monsters
[ 0 ][ 1 ]. strength
= 8 ;
572 monsters
[ 0 ][ 1 ]. gold
= 100 ;
573 monsters
[ 0 ][ 1 ]. exp
= 10 ;
574 monsters
[ 0 ][ 1 ]. maxhp
= 10 ;
575 monsters
[ 0 ][ 1 ]. death
= "You feel a chill as the spirit leaves the realm." ;
577 monsters
[ 0 ][ 2 ]. name
= "Ugly Rodent" ;
578 monsters
[ 0 ][ 2 ]. weapon
= "Sharp Teeth" ;
579 monsters
[ 0 ][ 2 ]. strength
= 9 ;
580 monsters
[ 0 ][ 2 ]. gold
= 75 ;
581 monsters
[ 0 ][ 2 ]. exp
= 8 ;
582 monsters
[ 0 ][ 2 ]. maxhp
= 13 ;
583 monsters
[ 0 ][ 2 ]. death
= "You stomp on the Ugly Rodent's remains for a finishing blow." ;
585 monsters
[ 0 ][ 3 ]. name
= "Whart Hog" ;
586 monsters
[ 0 ][ 3 ]. weapon
= "Tusks" ;
587 monsters
[ 0 ][ 3 ]. strength
= 10 ;
588 monsters
[ 0 ][ 3 ]. gold
= 80 ;
589 monsters
[ 0 ][ 3 ]. exp
= 6 ;
590 monsters
[ 0 ][ 3 ]. maxhp
= 10 ;
591 monsters
[ 0 ][ 3 ]. death
= "You cook and eat the hog for good measure!" ;
593 monsters
[ 0 ][ 4 ]. name
= "Pesky Kid" ;
594 monsters
[ 0 ][ 4 ]. weapon
= "Slingshot" ;
595 monsters
[ 0 ][ 4 ]. strength
= 8 ;
596 monsters
[ 0 ][ 4 ]. gold
= 30 ;
597 monsters
[ 0 ][ 4 ]. exp
= 4 ;
598 monsters
[ 0 ][ 4 ]. maxhp
= 6 ;
599 monsters
[ 0 ][ 4 ]. death
= "You take his slingshot and snap the band, sending the kid crying home to mom!" ;
601 monsters
[ 0 ][ 5 ]. name
= "Playground Bully" ;
602 monsters
[ 0 ][ 5 ]. weapon
= "Painful Noogie" ;
603 monsters
[ 0 ][ 5 ]. strength
= 11 ;
604 monsters
[ 0 ][ 5 ]. gold
= 44 ;
605 monsters
[ 0 ][ 5 ]. exp
= 6 ;
606 monsters
[ 0 ][ 5 ]. maxhp
= 10 ;
607 monsters
[ 0 ][ 5 ]. death
= "You give him an indian burn, and punt him across the schoolyard!" ;
609 monsters
[ 0 ][ 6 ]. name
= "Small Imp" ;
610 monsters
[ 0 ][ 6 ]. weapon
= "Dagger" ;
611 monsters
[ 0 ][ 6 ]. strength
= 6 ;
612 monsters
[ 0 ][ 6 ]. gold
= 64 ;
613 monsters
[ 0 ][ 6 ]. exp
= 10 ;
614 monsters
[ 0 ][ 6 ]. maxhp
= 10 ;
615 monsters
[ 0 ][ 6 ]. death
= "You can't help but laugh as he stumbles and falls onto his own dagger!" ;
617 monsters
[ 0 ][ 7 ]. name
= "Little Monkey" ;
618 monsters
[ 0 ][ 7 ]. weapon
= "Monkey Wrench" ;
619 monsters
[ 0 ][ 7 ]. strength
= 6 ;
620 monsters
[ 0 ][ 7 ]. gold
= 53 ;
621 monsters
[ 0 ][ 7 ]. exp
= 9 ;
622 monsters
[ 0 ][ 7 ]. maxhp
= 9 ;
623 monsters
[ 0 ][ 7 ]. death
= "You want to cook it, but you just can't think of eating something that looks so human!" ;
625 monsters
[ 0 ][ 8 ]. name
= "Grub Worm" ;
626 monsters
[ 0 ][ 8 ]. weapon
= "Minor Nudge" ;
627 monsters
[ 0 ][ 8 ]. strength
= 2 ;
628 monsters
[ 0 ][ 8 ]. gold
= 10 ;
629 monsters
[ 0 ][ 8 ]. exp
= 3 ;
630 monsters
[ 0 ][ 8 ]. maxhp
= 3 ;
631 monsters
[ 0 ][ 8 ]. death
= "You decide to save the poor little fella for your next fishing trip." ;
633 monsters
[ 0 ][ 9 ]. name
= "Drakee" ;
634 monsters
[ 0 ][ 9 ]. weapon
= "Tail Slap" ;
635 monsters
[ 0 ][ 9 ]. strength
= 5 ;
636 monsters
[ 0 ][ 9 ]. gold
= 22 ;
637 monsters
[ 0 ][ 9 ]. exp
= 7 ;
638 monsters
[ 0 ][ 9 ]. maxhp
= 5 ;
639 monsters
[ 0 ][ 9 ]. death
= "You pull the little Drakee by its tale and slam it down on a dry stump!" ;
641 monsters
[ 0 ][ 10 ]. name
= "Fat Slob" ;
642 monsters
[ 0 ][ 10 ]. weapon
= "Smelly Breath" ;
643 monsters
[ 0 ][ 10 ]. strength
= 6 ;
644 monsters
[ 0 ][ 10 ]. gold
= 40 ;
645 monsters
[ 0 ][ 10 ]. exp
= 10 ;
646 monsters
[ 0 ][ 10 ]. maxhp
= 7 ;
647 monsters
[ 0 ][ 10 ]. death
= "You kick his stomach for fun, and are thrown back by the spring of it all!" ;
649 monsters
[ 0 ][ 11 ]. name
= "Lost Warrior" ;
650 monsters
[ 0 ][ 11 ]. weapon
= "Long Sword" ;
651 monsters
[ 0 ][ 11 ]. strength
= 10 ;
652 monsters
[ 0 ][ 11 ]. gold
= 250 ;
653 monsters
[ 0 ][ 11 ]. exp
= 19 ;
654 monsters
[ 0 ][ 11 ]. maxhp
= 15 ;
655 monsters
[ 0 ][ 11 ]. death
= "You give him a proper burial in respect for the dead warrior." ;
657 monsters
[ 1 ][ 0 ]. name
= "Lost Warrior's Cousin Larry" ;
658 monsters
[ 1 ][ 0 ]. weapon
= "Wood Axe" ;
659 monsters
[ 1 ][ 0 ]. strength
= 19 ;
660 monsters
[ 1 ][ 0 ]. gold
= 134 ;
661 monsters
[ 1 ][ 0 ]. exp
= 24 ;
662 monsters
[ 1 ][ 0 ]. maxhp
= 30 ;
663 monsters
[ 1 ][ 0 ]. death
= "He was pretty pissed you killed his cousin, but he seems to have suffered the same fate!" ;
665 monsters
[ 1 ][ 1 ]. name
= "Sandman" ;
666 monsters
[ 1 ][ 1 ]. weapon
= "Sleeping Dust" ;
667 monsters
[ 1 ][ 1 ]. strength
= 25 ;
668 monsters
[ 1 ][ 1 ]. gold
= 80 ;
669 monsters
[ 1 ][ 1 ]. exp
= 6 ;
670 monsters
[ 1 ][ 1 ]. maxhp
= 27 ;
671 monsters
[ 1 ][ 1 ]. death
= "You put the sandman to his final sleep." ;
673 monsters
[ 1 ][ 2 ]. name
= "Dirty Transvestite" ;
674 monsters
[ 1 ][ 2 ]. weapon
= "Stiletto Heel" ;
675 monsters
[ 1 ][ 2 ]. strength
= 21 ;
676 monsters
[ 1 ][ 2 ]. gold
= 160 ;
677 monsters
[ 1 ][ 2 ]. exp
= 12 ;
678 monsters
[ 1 ][ 2 ]. maxhp
= 25 ;
679 monsters
[ 1 ][ 2 ]. death
= "You shudder at the thought of ever mistaking this for a woman!" ;
681 monsters
[ 1 ][ 3 ]. name
= "Goblin Gardener" ;
682 monsters
[ 1 ][ 3 ]. weapon
= "Garden Spade" ;
683 monsters
[ 1 ][ 3 ]. strength
= 18 ;
684 monsters
[ 1 ][ 3 ]. gold
= 130 ;
685 monsters
[ 1 ][ 3 ]. exp
= 8 ;
686 monsters
[ 1 ][ 3 ]. maxhp
= 20 ;
687 monsters
[ 1 ][ 3 ]. death
= "You trample on his garden after slaying him... that felt good!" ;
689 monsters
[ 1 ][ 4 ]. name
= "Evil Elf" ;
690 monsters
[ 1 ][ 4 ]. weapon
= "Elvish Bow" ;
691 monsters
[ 1 ][ 4 ]. strength
= 23 ;
692 monsters
[ 1 ][ 4 ]. gold
= 136 ;
693 monsters
[ 1 ][ 4 ]. exp
= 13 ;
694 monsters
[ 1 ][ 4 ]. maxhp
= 24 ;
695 monsters
[ 1 ][ 4 ]. death
= "Elves are usually nice you thought... hmm." ;
697 monsters
[ 1 ][ 5 ]. name
= "Viking Warrior" ;
698 monsters
[ 1 ][ 5 ]. weapon
= "Broad Sword" ;
699 monsters
[ 1 ][ 5 ]. strength
= 21 ;
700 monsters
[ 1 ][ 5 ]. gold
= 330 ;
701 monsters
[ 1 ][ 5 ]. exp
= 20 ;
702 monsters
[ 1 ][ 5 ]. maxhp
= 18 ;
703 monsters
[ 1 ][ 5 ]. death
= "You heard vikings were big, but not THAT big you thought." ;
705 monsters
[ 1 ][ 6 ]. name
= "Wicked Witch" ;
706 monsters
[ 1 ][ 6 ]. weapon
= "Cackling Laugh" ;
707 monsters
[ 1 ][ 6 ]. strength
= 20 ;
708 monsters
[ 1 ][ 6 ]. gold
= 130 ;
709 monsters
[ 1 ][ 6 ]. exp
= 20 ;
710 monsters
[ 1 ][ 6 ]. maxhp
= 26 ;
711 monsters
[ 1 ][ 6 ]. death
= "Just for kicks, you splash some water on her and watch her melt." ;
713 monsters
[ 1 ][ 7 ]. name
= "Vampire Bat" ;
714 monsters
[ 1 ][ 7 ]. weapon
= "Blood Sucking Fangs" ;
715 monsters
[ 1 ][ 7 ]. strength
= 18 ;
716 monsters
[ 1 ][ 7 ]. gold
= 125 ;
717 monsters
[ 1 ][ 7 ]. exp
= 21 ;
718 monsters
[ 1 ][ 7 ]. maxhp
= 29 ;
719 monsters
[ 1 ][ 7 ]. death
= "You fry up the bat and eat it... needs garlic." ;
721 monsters
[ 1 ][ 8 ]. name
= "Thorn Bush" ;
722 monsters
[ 1 ][ 8 ]. weapon
= "101 Thorns" ;
723 monsters
[ 1 ][ 8 ]. strength
= 16 ;
724 monsters
[ 1 ][ 8 ]. gold
= 94 ;
725 monsters
[ 1 ][ 8 ]. exp
= 15 ;
726 monsters
[ 1 ][ 8 ]. maxhp
= 25 ;
727 monsters
[ 1 ][ 8 ]. death
= "You set the bush ablaze and roast some marshmallows." ;
729 monsters
[ 1 ][ 9 ]. name
= "Barbarian" ;
730 monsters
[ 1 ][ 9 ]. weapon
= "Heavy Sword" ;
731 monsters
[ 1 ][ 9 ]. strength
= 29 ;
732 monsters
[ 1 ][ 9 ]. gold
= 250 ;
733 monsters
[ 1 ][ 9 ]. exp
= 25 ;
734 monsters
[ 1 ][ 9 ]. maxhp
= 30 ;
735 monsters
[ 1 ][ 9 ]. death
= "You listen to him moan as he falls over dead." ;
737 monsters
[ 1 ][ 10 ]. name
= "Crypt Rat" ;
738 monsters
[ 1 ][ 10 ]. weapon
= "Stinging Bite" ;
739 monsters
[ 1 ][ 10 ]. strength
= 25 ;
740 monsters
[ 1 ][ 10 ]. gold
= 119 ;
741 monsters
[ 1 ][ 10 ]. exp
= 20 ;
742 monsters
[ 1 ][ 10 ]. maxhp
= 26 ;
743 monsters
[ 1 ][ 10 ]. death
= "You squash the little rodent for fear that it might not be dead." ;
745 monsters
[ 1 ][ 11 ]. name
= "Small Orc" ;
746 monsters
[ 1 ][ 11 ]. weapon
= "blade" ;
747 monsters
[ 1 ][ 11 ]. strength
= 28 ;
748 monsters
[ 1 ][ 11 ]. gold
= 300 ;
749 monsters
[ 1 ][ 11 ]. exp
= 30 ;
750 monsters
[ 1 ][ 11 ]. maxhp
= 36 ;
751 monsters
[ 1 ][ 11 ]. death
= "It's an ugly one, and it would've grown up to be a terror..." ;
753 monsters
[ 2 ][ 0 ]. name
= "Teferi" ;
754 monsters
[ 2 ][ 0 ]. weapon
= "Puzzle Box" ;
755 monsters
[ 2 ][ 0 ]. strength
= 29 ;
756 monsters
[ 2 ][ 0 ]. gold
= 380 ;
757 monsters
[ 2 ][ 0 ]. exp
= 18 ;
758 monsters
[ 2 ][ 0 ]. maxhp
= 29 ;
759 monsters
[ 2 ][ 0 ]. death
= "It was a puzzling experience." ;
761 monsters
[ 2 ][ 1 ]. name
= "Spineless Thug" ;
762 monsters
[ 2 ][ 1 ]. weapon
= "Spiked Bat" ;
763 monsters
[ 2 ][ 1 ]. strength
= 37 ;
764 monsters
[ 2 ][ 1 ]. gold
= 384 ;
765 monsters
[ 2 ][ 1 ]. exp
= 27 ;
766 monsters
[ 2 ][ 1 ]. maxhp
= 32 ;
767 monsters
[ 2 ][ 1 ]. death
= "See you at the crossroads!" ;
769 monsters
[ 2 ][ 2 ]. name
= "Pyromaniac" ;
770 monsters
[ 2 ][ 2 ]. weapon
= "Pyrotechnics" ;
771 monsters
[ 2 ][ 2 ]. strength
= 29 ;
772 monsters
[ 2 ][ 2 ]. gold
= 563 ;
773 monsters
[ 2 ][ 2 ]. exp
= 22 ;
774 monsters
[ 2 ][ 2 ]. maxhp
= 45 ;
775 monsters
[ 2 ][ 2 ]. death
= "He chants FIRE FIRE as he falls to the ground... a burning heap of flesh." ;
777 monsters
[ 2 ][ 3 ]. name
= "Evil Enchantress" ;
778 monsters
[ 2 ][ 3 ]. weapon
= "Deadly Spell" ;
779 monsters
[ 2 ][ 3 ]. strength
= 50 ;
780 monsters
[ 2 ][ 3 ]. gold
= 830 ;
781 monsters
[ 2 ][ 3 ]. exp
= 35 ;
782 monsters
[ 2 ][ 3 ]. maxhp
= 35 ;
783 monsters
[ 2 ][ 3 ]. death
= "She looked just about as good as she fought." ;
785 monsters
[ 2 ][ 4 ]. name
= "Killer Leprechaun" ;
786 monsters
[ 2 ][ 4 ]. weapon
= "Gold Rush" ;
787 monsters
[ 2 ][ 4 ]. strength
= 35 ;
788 monsters
[ 2 ][ 4 ]. gold
= 1300 ;
789 monsters
[ 2 ][ 4 ]. exp
= 30 ;
790 monsters
[ 2 ][ 4 ]. maxhp
= 37 ;
791 monsters
[ 2 ][ 4 ]. death
= "You steal his pot of gold... that's a lot of money!" ;
793 monsters
[ 2 ][ 5 ]. name
= "Avalanche Rider" ;
794 monsters
[ 2 ][ 5 ]. weapon
= "Huge Snowball" ;
795 monsters
[ 2 ][ 5 ]. strength
= 32 ;
796 monsters
[ 2 ][ 5 ]. gold
= 700 ;
797 monsters
[ 2 ][ 5 ]. exp
= 32 ;
798 monsters
[ 2 ][ 5 ]. maxhp
= 38 ;
799 monsters
[ 2 ][ 5 ]. death
= "You take his snowboard and snap it in two!" ;
801 monsters
[ 2 ][ 6 ]. name
= "Blundering Idiot" ;
802 monsters
[ 2 ][ 6 ]. weapon
= "Stupidity" ;
803 monsters
[ 2 ][ 6 ]. strength
= 14 ;
804 monsters
[ 2 ][ 6 ]. gold
= 700 ;
805 monsters
[ 2 ][ 6 ]. exp
= 20 ;
806 monsters
[ 2 ][ 6 ]. maxhp
= 29 ;
807 monsters
[ 2 ][ 6 ]. death
= "Now there's one person you don't feel sorry for killing!" ;
809 monsters
[ 2 ][ 7 ]. name
= "Militant Anarchist" ;
810 monsters
[ 2 ][ 7 ]. weapon
= "Molotov Cocktail" ;
811 monsters
[ 2 ][ 7 ]. strength
= 33 ;
812 monsters
[ 2 ][ 7 ]. gold
= 245 ;
813 monsters
[ 2 ][ 7 ]. exp
= 45 ;
814 monsters
[ 2 ][ 7 ]. maxhp
= 32 ;
815 monsters
[ 2 ][ 7 ]. death
= "Order has been restored for now..." ;
817 monsters
[ 2 ][ 8 ]. name
= "Scathe Zombies" ;
818 monsters
[ 2 ][ 8 ]. weapon
= "Death Grip" ;
819 monsters
[ 2 ][ 8 ]. strength
= 38 ;
820 monsters
[ 2 ][ 8 ]. gold
= 763 ;
821 monsters
[ 2 ][ 8 ]. exp
= 15 ;
822 monsters
[ 2 ][ 8 ]. maxhp
= 45 ;
823 monsters
[ 2 ][ 8 ]. death
= "That was perhaps the scariest experience of your life." ;
825 monsters
[ 2 ][ 9 ]. name
= "Spitting Llama" ;
826 monsters
[ 2 ][ 9 ]. weapon
= "Spit Spray" ;
827 monsters
[ 2 ][ 9 ]. strength
= 48 ;
828 monsters
[ 2 ][ 9 ]. gold
= 638 ;
829 monsters
[ 2 ][ 9 ]. exp
= 28 ;
830 monsters
[ 2 ][ 9 ]. maxhp
= 34 ;
831 monsters
[ 2 ][ 9 ]. death
= "You wipe the spit off your face and fling it back at the Llama." ;
833 monsters
[ 2 ][ 10 ]. name
= "Juggalo" ;
834 monsters
[ 2 ][ 10 ]. weapon
= "Clown Axe" ;
835 monsters
[ 2 ][ 10 ]. strength
= 60 ;
836 monsters
[ 2 ][ 10 ]. gold
= 650 ;
837 monsters
[ 2 ][ 10 ]. exp
= 30 ;
838 monsters
[ 2 ][ 10 ]. maxhp
= 29 ;
839 monsters
[ 2 ][ 10 ]. death
= "What is a Juggalo? I don't know!" ;
841 monsters
[ 2 ][ 11 ]. name
= "The Boogie Man" ;
842 monsters
[ 2 ][ 11 ]. weapon
= "Striking Fear" ;
843 monsters
[ 2 ][ 11 ]. strength
= 46 ;
844 monsters
[ 2 ][ 11 ]. gold
= 600 ;
845 monsters
[ 2 ][ 11 ]. exp
= 35 ;
846 monsters
[ 2 ][ 11 ]. maxhp
= 27 ;
847 monsters
[ 2 ][ 11 ]. death
= "He's scared you for the very last time!" ;
849 monsters
[ 3 ][ 0 ]. name
= "Living Fire" ;
850 monsters
[ 3 ][ 0 ]. weapon
= "Scorching Wind" ;
851 monsters
[ 3 ][ 0 ]. strength
= 55 ;
852 monsters
[ 3 ][ 0 ]. gold
= 1100 ;
853 monsters
[ 3 ][ 0 ]. exp
= 36 ;
854 monsters
[ 3 ][ 0 ]. maxhp
= 55 ;
855 monsters
[ 3 ][ 0 ]. death
= "You extinguish the Living Flame once and for all!" ;
857 monsters
[ 3 ][ 1 ]. name
= "Raging Orc" ;
858 monsters
[ 3 ][ 1 ]. weapon
= "Orcish Artillary" ;
859 monsters
[ 3 ][ 1 ]. strength
= 89 ;
860 monsters
[ 3 ][ 1 ]. gold
= 900 ;
861 monsters
[ 3 ][ 1 ]. exp
= 25 ;
862 monsters
[ 3 ][ 1 ]. maxhp
= 50 ;
863 monsters
[ 3 ][ 1 ]. death
= "This orc was a bit tougher than you remembered!" ;
865 monsters
[ 3 ][ 2 ]. name
= "Huge Tarantula" ;
866 monsters
[ 3 ][ 2 ]. weapon
= "Tangling Web" ;
867 monsters
[ 3 ][ 2 ]. strength
= 59 ;
868 monsters
[ 3 ][ 2 ]. gold
= 1000 ;
869 monsters
[ 3 ][ 2 ]. exp
= 35 ;
870 monsters
[ 3 ][ 2 ]. maxhp
= 60 ;
871 monsters
[ 3 ][ 2 ]. death
= "You're glad you overcame your arachniphobia so soon!" ;
873 monsters
[ 3 ][ 3 ]. name
= "Rabid Wolf" ;
874 monsters
[ 3 ][ 3 ]. weapon
= "Cujo Bite" ;
875 monsters
[ 3 ][ 3 ]. strength
= 40 ;
876 monsters
[ 3 ][ 3 ]. gold
= 1200 ;
877 monsters
[ 3 ][ 3 ]. exp
= 47 ;
878 monsters
[ 3 ][ 3 ]. maxhp
= 76 ;
879 monsters
[ 3 ][ 3 ]. death
= "The mutt falls over dead as white foam drips from its deadly canines..." ;
881 monsters
[ 3 ][ 4 ]. name
= "Goblin Fighter" ;
882 monsters
[ 3 ][ 4 ]. weapon
= "Morning Star" ;
883 monsters
[ 3 ][ 4 ]. strength
= 38 ;
884 monsters
[ 3 ][ 4 ]. gold
= 700 ;
885 monsters
[ 3 ][ 4 ]. exp
= 30 ;
886 monsters
[ 3 ][ 4 ]. maxhp
= 75 ;
887 monsters
[ 3 ][ 4 ]. death
= "He almost caught you with his chain mace, but you sliced off his head." ;
889 monsters
[ 3 ][ 5 ]. name
= "Grizzly Bear" ;
890 monsters
[ 3 ][ 5 ]. weapon
= "Razor Claws" ;
891 monsters
[ 3 ][ 5 ]. strength
= 68 ;
892 monsters
[ 3 ][ 5 ]. gold
= 1747 ;
893 monsters
[ 3 ][ 5 ]. exp
= 81 ;
894 monsters
[ 3 ][ 5 ]. maxhp
= 51 ;
895 monsters
[ 3 ][ 5 ]. death
= "It almost got you this time... better be careful" ;
897 monsters
[ 3 ][ 6 ]. name
= "Skeleton Man" ;
898 monsters
[ 3 ][ 6 ]. weapon
= "Leg Bone" ;
899 monsters
[ 3 ][ 6 ]. strength
= 70 ;
900 monsters
[ 3 ][ 6 ]. gold
= 597 ;
901 monsters
[ 3 ][ 6 ]. exp
= 57 ;
902 monsters
[ 3 ][ 6 ]. maxhp
= 60 ;
903 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!" ;
905 monsters
[ 3 ][ 7 ]. name
= "Young Werewolf" ;
906 monsters
[ 3 ][ 7 ]. weapon
= "Howling Bites" ;
907 monsters
[ 3 ][ 7 ]. strength
= 75 ;
908 monsters
[ 3 ][ 7 ]. gold
= 1742 ;
909 monsters
[ 3 ][ 7 ]. exp
= 65 ;
910 monsters
[ 3 ][ 7 ]. maxhp
= 42 ;
911 monsters
[ 3 ][ 7 ]. death
= "You scatter the wolf's body parts in hopes he will stay dead!" ;
913 monsters
[ 3 ][ 8 ]. name
= "Dark Infantry" ;
914 monsters
[ 3 ][ 8 ]. weapon
= "Flesh Reaper" ;
915 monsters
[ 3 ][ 8 ]. strength
= 69 ;
916 monsters
[ 3 ][ 8 ]. gold
= 870 ;
917 monsters
[ 3 ][ 8 ]. exp
= 43 ;
918 monsters
[ 3 ][ 8 ]. maxhp
= 65 ;
919 monsters
[ 3 ][ 8 ]. death
= "Light has prevailed this time... but it's only so long before you meet again." ;
921 monsters
[ 3 ][ 9 ]. name
= "Erie Spirit" ;
922 monsters
[ 3 ][ 9 ]. weapon
= "Deadly Grin" ;
923 monsters
[ 3 ][ 9 ]. strength
= 63 ;
924 monsters
[ 3 ][ 9 ]. gold
= 1300 ;
925 monsters
[ 3 ][ 9 ]. exp
= 32 ;
926 monsters
[ 3 ][ 9 ]. maxhp
= 50 ;
927 monsters
[ 3 ][ 9 ]. death
= "His cousin the ghost was a little bit easier." ;
929 monsters
[ 3 ][ 10 ]. name
= "Gollum" ;
930 monsters
[ 3 ][ 10 ]. weapon
= "Precious Treasure" ;
931 monsters
[ 3 ][ 10 ]. strength
= 66 ;
932 monsters
[ 3 ][ 10 ]. gold
= 1492 ;
933 monsters
[ 3 ][ 10 ]. exp
= 73 ;
934 monsters
[ 3 ][ 10 ]. maxhp
= 54 ;
935 monsters
[ 3 ][ 10 ]. death
= "Gollum screams out \" MY PRECIOUS \" as his small body falls limp from your blow." ;
937 monsters
[ 3 ][ 11 ]. name
= "Rock Fighter" ;
938 monsters
[ 3 ][ 11 ]. weapon
= "Small Boulders" ;
939 monsters
[ 3 ][ 11 ]. strength
= 87 ;
940 monsters
[ 3 ][ 11 ]. gold
= 1742 ;
941 monsters
[ 3 ][ 11 ]. exp
= 99 ;
942 monsters
[ 3 ][ 11 ]. maxhp
= 65 ;
943 monsters
[ 3 ][ 11 ]. death
= "You dodge his last rock, and counter with a low blow, cutting off his legs." ;
946 monsters
[ 4 ][ 0 ]. name
= "Giant Sphinx" ;
947 monsters
[ 4 ][ 0 ]. weapon
= "Ancient Curse" ;
948 monsters
[ 4 ][ 0 ]. strength
= 120 ;
949 monsters
[ 4 ][ 0 ]. gold
= 1000 ;
950 monsters
[ 4 ][ 0 ]. exp
= 100 ;
951 monsters
[ 4 ][ 0 ]. maxhp
= 80 ;
952 monsters
[ 4 ][ 0 ]. death
= "You look in awe at the great wonder, collapsed at your feet!" ;
954 monsters
[ 4 ][ 1 ]. name
= "Giant Ogre" ;
955 monsters
[ 4 ][ 1 ]. weapon
= "Big Log" ;
956 monsters
[ 4 ][ 1 ]. strength
= 130 ;
957 monsters
[ 4 ][ 1 ]. gold
= 857 ;
958 monsters
[ 4 ][ 1 ]. exp
= 175 ;
959 monsters
[ 4 ][ 1 ]. maxhp
= 100 ;
960 monsters
[ 4 ][ 1 ]. death
= "Your witz outmatched the ogres brawn... big dumb thing." ;
962 monsters
[ 4 ][ 2 ]. name
= "Massive Cockroach" ;
963 monsters
[ 4 ][ 2 ]. weapon
= "Piercing Hiss" ;
964 monsters
[ 4 ][ 2 ]. strength
= 125 ;
965 monsters
[ 4 ][ 2 ]. gold
= 700 ;
966 monsters
[ 4 ][ 2 ]. exp
= 150 ;
967 monsters
[ 4 ][ 2 ]. maxhp
= 112 ;
968 monsters
[ 4 ][ 2 ]. death
= "Where's the exterminator when you need one?" ;
970 monsters
[ 4 ][ 3 ]. name
= "Big Venomous Snake" ;
971 monsters
[ 4 ][ 3 ]. weapon
= "Poison Fangs" ;
972 monsters
[ 4 ][ 3 ]. strength
= 140 ;
973 monsters
[ 4 ][ 3 ]. gold
= 900 ;
974 monsters
[ 4 ][ 3 ]. exp
= 175 ;
975 monsters
[ 4 ][ 3 ]. maxhp
= 126 ;
976 monsters
[ 4 ][ 3 ]. death
= "After killing this beast you check for puncture marks... you find none, luckily." ;
978 monsters
[ 4 ][ 4 ]. name
= "Lizard Man" ;
979 monsters
[ 4 ][ 4 ]. weapon
= "Deadly Jaws" ;
980 monsters
[ 4 ][ 4 ]. strength
= 145 ;
981 monsters
[ 4 ][ 4 ]. gold
= 1250 ;
982 monsters
[ 4 ][ 4 ]. exp
= 175 ;
983 monsters
[ 4 ][ 4 ]. maxhp
= 150 ;
984 monsters
[ 4 ][ 4 ]. death
= "His scales made for tough armor, and his jaws for a tougher opponent!" ;
986 monsters
[ 4 ][ 5 ]. name
= "Face Dancer" ;
987 monsters
[ 4 ][ 5 ]. weapon
= "Illusion Scyth" ;
988 monsters
[ 4 ][ 5 ]. strength
= 138 ;
989 monsters
[ 4 ][ 5 ]. gold
= 1603 ;
990 monsters
[ 4 ][ 5 ]. exp
= 198 ;
991 monsters
[ 4 ][ 5 ]. maxhp
= 173 ;
992 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!" ;
994 monsters
[ 4 ][ 6 ]. name
= "Darklord Longbow Archer" ;
995 monsters
[ 4 ][ 6 ]. weapon
= "Deadly Bow and Arrows" ;
996 monsters
[ 4 ][ 6 ]. strength
= 145 ;
997 monsters
[ 4 ][ 6 ]. gold
= 1569 ;
998 monsters
[ 4 ][ 6 ]. exp
= 243 ;
999 monsters
[ 4 ][ 6 ]. maxhp
= 170 ;
1000 monsters
[ 4 ][ 6 ]. death
= "Your face turns white with horror after you realize you just met the devil's protector!" ;
1002 monsters
[ 4 ][ 7 ]. name
= "Hell's Paladin" ;
1003 monsters
[ 4 ][ 7 ]. weapon
= "Sword of Hellfire" ;
1004 monsters
[ 4 ][ 7 ]. strength
= 200 ;
1005 monsters
[ 4 ][ 7 ]. gold
= 2191 ;
1006 monsters
[ 4 ][ 7 ]. exp
= 254 ;
1007 monsters
[ 4 ][ 7 ]. maxhp
= 175 ;
1008 monsters
[ 4 ][ 7 ]. death
= "This is starting to get tough you think. Do you really want to go to level 12?" ;
1010 monsters
[ 4 ][ 8 ]. name
= "The Unknown Soldier" ;
1011 monsters
[ 4 ][ 8 ]. weapon
= "Soul Torture" ;
1012 monsters
[ 4 ][ 8 ]. strength
= 175 ;
1013 monsters
[ 4 ][ 8 ]. gold
= 1890 ;
1014 monsters
[ 4 ][ 8 ]. exp
= 200 ;
1015 monsters
[ 4 ][ 8 ]. maxhp
= 180 ;
1016 monsters
[ 4 ][ 8 ]. death
= "Who was that? Where was he from? And what was that weapon??" ;
1018 monsters
[ 4 ][ 9 ]. name
= "Undead Cult Leader" ;
1019 monsters
[ 4 ][ 9 ]. weapon
= "Lance of Deceit" ;
1020 monsters
[ 4 ][ 9 ]. strength
= 180 ;
1021 monsters
[ 4 ][ 9 ]. gold
= 1792 ;
1022 monsters
[ 4 ][ 9 ]. exp
= 195 ;
1023 monsters
[ 4 ][ 9 ]. maxhp
= 190 ;
1024 monsters
[ 4 ][ 9 ]. death
= "His words fall on deaf ears... this is one cult you will NOT be part of!" ;
1026 monsters
[ 4 ][ 10 ]. name
= "Water Serpent" ;
1027 monsters
[ 4 ][ 10 ]. weapon
= "Forked Tongue" ;
1028 monsters
[ 4 ][ 10 ]. strength
= 150 ;
1029 monsters
[ 4 ][ 10 ]. gold
= 1500 ;
1030 monsters
[ 4 ][ 10 ]. exp
= 176 ;
1031 monsters
[ 4 ][ 10 ]. maxhp
= 220 ;
1032 monsters
[ 4 ][ 10 ]. death
= "The serpent squeals as you cut off its head!" ;
1034 monsters
[ 4 ][ 11 ]. name
= "Silverback Gorilla" ;
1035 monsters
[ 4 ][ 11 ]. weapon
= "Deadly Banana Peel" ;
1036 monsters
[ 4 ][ 11 ]. strength
= 160 ;
1037 monsters
[ 4 ][ 11 ]. gold
= 1300 ;
1038 monsters
[ 4 ][ 11 ]. exp
= 150 ;
1039 monsters
[ 4 ][ 11 ]. maxhp
= 178 ;
1040 monsters
[ 4 ][ 11 ]. death
= "Was that gorilla or guerilla?" ;
1043 void display_monster ( char * u
)
1047 aClient
* user
= find ( u
);
1048 Player
* ni
= user
-> stats
;
1050 notice ( s_GameServ
, u
, "Your Hitpoints: \ 2 %d \ 2 ", ni
-> hp
);
1051 notice ( s_GameServ
, u
, " %s 's Hitpoints: \ 2 %d \ 2 ", ni
-> fight
-> name
, ni
-> fight
-> hp
);
1052 notice ( s_GameServ
, u
, "Here are your commands:" );
1053 notice ( s_GameServ
, u
, "/msg %S attack" );
1054 notice ( s_GameServ
, u
, "/msg %S run" );
1055 notice ( s_GameServ
, u
, "What will you do?" );
1059 void display_players ( char * u
)
1063 aClient
* ni
= find ( u
);
1065 aClient
* battle
= ni
-> stats
-> battle
;
1067 notice ( s_GameServ
, u
, "Your Hitpoints: \ 2 %d \ 2 ", ni
-> stats
-> hp
);
1068 notice ( s_GameServ
, u
, " %s 's Hitpoints: \ 2 %d \ 2 ", battle
-> getNick (),
1071 notice ( s_GameServ
, u
, "Here are your commands:" );
1072 notice ( s_GameServ
, u
, "/msg %s attack" , s_GameServ
);
1073 notice ( s_GameServ
, u
, "/msg %s run" , s_GameServ
);
1074 notice ( s_GameServ
, u
, "What will you do?" );
1079 bool is_playing ( char * u
)
1082 if (!( user
= find ( u
)))
1088 return user
-> stats
!= NULL
;
1092 bool is_fighting ( char * u
)
1096 if (!( user
= find ( u
)))
1100 else if ( user
-> stats
)
1102 return user
-> stats
-> fight
!= NULL
|| user
-> stats
-> battle
!= NULL
1103 || user
-> stats
-> master
!= NULL
;
1109 bool player_fight ( char * u
)
1113 if (!( user
= find ( u
)))
1115 else if ( user
-> stats
)
1116 return user
-> stats
-> battle
!= NULL
;
1121 bool master_fight ( char * u
)
1125 if (!( user
= find ( u
)))
1127 else if ( user
-> stats
)
1128 return user
-> stats
-> master
!= NULL
;
1133 bool isnt_fighting ( char * u
)
1135 return ! is_fighting ( u
);
1138 void do_fight ( char * u
)
1140 aClient
* ni
, * battle
;
1142 char * nick
= strtok ( NULL
, " " );
1146 notice ( s_GameServ
, u
, "SYNTAX: /msg %S FIGHT PLAYER" );
1148 else if (!( ni
= find ( u
)))
1152 else if (!( battle
= find ( nick
)))
1154 notice ( s_GameServ
, u
, "You can't attack %s while they aren't playing!" , nick
);
1156 else if (! is_playing ( u
))
1158 notice ( s_GameServ
, u
, "You are not playing!" );
1161 * Offline fighting not implemented yet.
1162 * else if (!(fight = finduser(nick)))
1164 * ni->stats->battle = battle;
1165 * battle->battle = ni;
1167 * battle->yourturn = 0;
1168 * notice(s_GameServ, u, "You decide to fight %s while they're not online!",
1169 * battle->getNick());
1170 * display_players(u);
1173 else if ( is_playing ( u
) && is_playing ( nick
))
1175 // Set your battle pointer to the other player
1176 ni
-> stats
-> battle
= battle
;
1178 // Set the other player's battle pointer to you
1179 battle
-> stats
-> battle
= ni
;
1181 // The initiator gets the first move (perhaps this should be 50/50)
1182 ni
-> stats
-> yourturn
= 1 ;
1183 battle
-> stats
-> yourturn
= 0 ;
1185 // Initiate Battle sequence!
1186 notice ( s_GameServ
, u
, "You challenge %s to an online duel!" , battle
-> getNick ());
1187 notice ( s_GameServ
, battle
-> getNick (), " %s has challenged you to an online duel!" , u
);
1188 notice ( s_GameServ
, battle
-> getNick (), " %s gets to go first because he initiated!" , u
);
1189 notice ( s_GameServ
, battle
-> getNick (), "Please wait while %s decides what to do." , u
);
1194 void do_attack ( char * u
)
1197 aClient
* ni
, * battle
; // The player and perhaps the player they're fighting
1198 Monster
* fight
; // The monster they may be fighting
1200 if (!( ni
= find ( u
)))
1202 notice ( s_GameServ
, u
, "You're not playing!" );
1205 else if (! ni
-> stats
-> fight
&& ! ni
-> stats
-> battle
&& ! ni
-> stats
-> master
)
1207 notice ( s_GameServ
, u
, "You're not in battle!" );
1212 if (! ni
-> stats
-> master
) // This is not a master fight
1213 fight
= ni
-> stats
-> fight
; // Monster Could be NULL
1214 else // This IS a master fight
1215 fight
= ni
-> stats
-> master
; // Master Could be NULL
1217 battle
= ni
-> stats
-> battle
; // Player Could be NULL
1219 // One has to be !NULL based on the previous else if
1220 // We wouldn't be here if they were all NULL
1223 if (! player_fight ( u
))
1226 hit
= (( ni
-> stats
-> strength
+ webonus
[ ni
-> stats
-> weapon
]) / 2 ) +
1227 ( rand () % (( ni
-> stats
-> strength
+ webonus
[ ni
-> stats
-> weapon
]) / 2 ));
1230 mhit
= ( fight
-> strength
/ 2 ) +
1231 ( rand () % ( fight
-> strength
/ 2 ) - ( ni
-> stats
-> defense
+
1232 arbonus
[ ni
-> stats
-> armor
]));
1237 mhit
= ((( battle
-> stats
-> strength
+ webonus
[ battle
-> stats
-> weapon
]) / 2 ) +
1238 ( rand () % (( battle
-> stats
-> strength
+ webonus
[ battle
-> stats
-> weapon
])) / 2 ) -
1239 ( ni
-> stats
-> defense
+ arbonus
[ ni
-> stats
-> armor
]));
1242 hit
= ((( ni
-> stats
-> strength
+ webonus
[ ni
-> stats
-> weapon
]) / 2 ) +
1243 ( rand () % (( ni
-> stats
-> strength
+ webonus
[ ni
-> stats
-> weapon
])) / 2 ) -
1244 ( battle
-> stats
-> defense
+ arbonus
[ battle
-> stats
-> armor
]));
1247 if (! player_fight ( u
))
1250 notice ( s_GameServ
, u
, "You attack \1f %s \1f for \ 2 %d \ 2 points!", fight
-> name
, hit
);
1252 notice ( s_GameServ
, u
, "You miss \1f %s \1f completely!", fight
-> name
);
1254 if ( hit
>= fight
-> hp
)
1256 if ( master_fight ( u
))
1257 notice ( s_GameServ
, u
, "You have bested %s !" , fight
-> name
);
1259 notice ( s_GameServ
, u
, "You have killed \ 2 %s \ 2 !", fight
-> name
);
1261 notice ( s_GameServ
, u
, " %s " , fight
-> death
);
1262 notice ( s_GameServ
, u
, "You recieve \ 2 %d \ 2 experience and \ 2 %d \ 2 gold!",
1263 fight
-> exp
, fight
-> gold
);
1265 // If your new experience (or gold) will be greater than 2 billion,
1266 // then set your exp to 2bil. (2 billion max)... otherwise add them.
1267 // This could be a problem with overflowing out of the sign bit.
1268 // Unsigned long int maybe? Leave it for now.
1269 ni
-> stats
-> exp
= ( ( ni
-> stats
-> exp
+ fight
-> exp
) > 2000000000 ? 2000000000 :
1270 ni
-> stats
-> exp
+ fight
-> exp
);
1271 ni
-> stats
-> gold
= ( ni
-> stats
-> gold
+ fight
-> gold
> 2000000000 ? 2000000000 :
1272 ni
-> stats
-> gold
+ fight
-> gold
);
1273 ni
-> stats
-> fight
= NULL
; // They're dead so remove the pointer
1275 if ( master_fight ( u
))
1277 notice ( s_GameServ
, u
, "You are now level %d !" , ni
-> stats
-> level
+ 1 );
1278 notice ( s_GameServ
, u
, "You gain %d Strength, and %d Defense points!" ,
1279 strbonus
[ ni
-> stats
-> level
- 1 ], defbonus
[ ni
-> stats
-> level
- 1 ]);
1281 // Increase your level
1284 // Increase your maximum hit points
1285 ni
-> stats
-> maxhp
+= hpbonus
[ ni
-> stats
-> level
- 1 ];
1287 // Heal the player by setting hp to their max
1288 ni
-> stats
-> hp
= ni
-> stats
-> maxhp
;
1290 // Add to your strength
1291 ni
-> stats
-> strength
+= strbonus
[ ni
-> stats
-> level
- 1 ];
1293 // Add to your defensive power
1294 ni
-> stats
-> defense
+= defbonus
[ ni
-> stats
-> level
- 1 ];
1296 // Clear the pointer for your master
1297 ni
-> stats
-> master
= NULL
;
1307 notice ( s_GameServ
, u
, "\1f %s \1f hits you with their \1f %s \1f for \ 2 %d \ 2 damage!",
1308 fight
-> name
, fight
-> weapon
, mhit
);
1311 notice ( s_GameServ
, u
, " %s completely misses you!" , fight
-> name
);
1313 if ( mhit
>= ni
-> stats
-> hp
)
1315 if (! master_fight ( u
))
1317 notice ( s_GameServ
, u
, "You have been \ 2 \1f killed\1f \ 2 by %s !" , fight
-> name
);
1318 notice ( s_GameServ
, u
, "You lose all gold on hand and lose 10 percent " \
1319 "of your experience!" );
1320 ni
-> stats
-> gold
= 0 ;
1321 ni
-> stats
-> exp
-= ( long int )( ni
-> stats
-> exp
* .10 );
1322 ni
-> stats
-> fight
= NULL
;
1327 notice ( s_GameServ
, u
, " %s has bested you! You will have to wait " \
1328 "until tomorrow to try again" , ni
-> stats
-> master
-> name
);
1329 ni
-> stats
-> fight
= NULL
;
1330 ni
-> stats
-> master
= NULL
;
1337 ni
-> stats
-> hp
-= mhit
;
1343 else if ( player_fight ( u
))
1345 /* Offline fighting not available yet
1346 if (!(online = finduser(ni->stats->battle->nick)) || !nick_identified(online))
1349 notice(s_GameServ, u, "You attack \1f %s\1f for \ 2 %d\ 2 points!", battle->nick, hit);
1351 notice(s_GameServ, u, "You miss \1f %s\1f completely!", battle->nick);
1352 if (hit >= battle->stats->hp)
1354 notice(s_GameServ, u, "You have killed \ 2 %s\ 2 !", battle->nick);
1355 * notice(s_GameServ, u, "You recieve \ 2 %d\ 2 experience and \ 2 %ld\ 2 gold!",
1356 (long int)(battle->stats->exp * .10), battle->stats->gold);
1357 if (2000000000 - ni->stats->exp > (long int)(battle->stats->exp * .10))
1359 ni->stats->exp += (long int)(battle->stats->exp * .10);
1360 battle->stats->exp -= (long int)(battle->stats->exp * .10);
1364 battle->stats->exp -= (long int)(battle->stats->exp * .10);
1365 ni->stats->exp = 2000000000;
1368 if (2000000000 - ni->stats->gold > battle->stats->gold)
1370 * ni->stats->gold += battle->stats->gold;
1371 battle->stats->gold = 0;
1375 battle->stats->gold = 2000000000 - ni->stats->gold;
1376 ni->stats->gold = 2000000000;
1378 * ni->stats->battle->stats->alive = 0;
1379 ni->stats->battle->battle = NULL;
1380 ni->stats->battle = NULL;
1386 * battle->stats->hp -= hit;
1389 notice(s_GameServ, u, "\1f %s\1f hits you with their \1f %s\1f for \ 2 %d\ 2 damage!",
1390 battle->nick, weapons[battle->stats->weapon], mhit);
1393 notice(s_GameServ, u, "%s completely misses you!", battle->nick);
1395 if (mhit >= ni->stats->hp)
1397 notice(s_GameServ, u, "You have been \ 2 \1f killed\1f \ 2 by %s!", battle->nick);
1398 if (2000000000 - battle->stats->gold > ni->stats->gold)
1400 notice(s_GameServ, u, "%s took all your gold!", battle->nick);
1401 battle->stats->gold += ni->stats->gold;
1402 * ni->stats->gold = 0;
1406 notice(s_GameServ, u, "You're lucky, %s couldn't carry all your gold.",
1408 ni->stats->gold -= (2000000000 - battle->stats->gold);
1409 notice(s_GameServ, u, "You were left dead with %d gold.",
1410 * (long int)ni->stats->gold);
1411 battle->stats->gold = 2000000000;
1413 ni->stats->battle->battle = NULL;
1414 ni->stats->battle = NULL;
1415 ni->stats->alive = 0;
1421 ni->stats->hp -= mhit;
1427 * end offline fighting */
1429 if ( is_playing ( battle
-> getNick ()))
1431 if ( ni
-> stats
-> yourturn
== 0 )
1433 notice ( s_GameServ
, u
, "Please wait until %s decides what to do!" ,
1439 notice ( s_GameServ
, u
, "You attack \1f %s \1f for \ 2 %d \ 2 points!", battle
-> getNick (), hit
);
1441 notice ( s_GameServ
, battle
-> getNick (), " %s has hit you with their %s for " \
1442 "\ 2 %d \ 2 damage!", u
, weapons
[ ni
-> stats
-> weapon
],
1444 ni
-> stats
-> yourturn
= 0 ;
1445 battle
-> stats
-> yourturn
= 1 ;
1446 display_players ( battle
-> getNick ());
1450 notice ( s_GameServ
, u
, "You miss \1f %s \1f completely!", battle
-> getNick ());
1451 notice ( s_GameServ
, battle
-> getNick (), " %s misses you completely!" , u
);
1452 ni
-> stats
-> yourturn
= 0 ;
1453 battle
-> stats
-> yourturn
= 1 ;
1454 display_players ( battle
-> getNick ());
1456 if ( hit
>= battle
-> stats
-> hp
)
1458 notice ( s_GameServ
, u
, "You have killed \ 2 %s \ 2 !", battle
-> getNick ());
1459 notice ( s_GameServ
, u
, "You recieve \ 2 %d \ 2 experience and \ 2 %l d\ 2 gold!" ,
1460 ( long int )( battle
-> stats
-> exp
* .10 ), battle
-> stats
-> gold
);
1461 notice ( s_GameServ
, battle
-> getNick (), "You have been killed by \ 2 %s \ 2 !", u
);
1462 battle
-> stats
-> hp
= 0 ;
1463 battle
-> stats
-> alive
= 0 ;
1465 if ( 2000000000 - ni
-> stats
-> exp
> ( long int )( battle
-> stats
-> exp
* .10 ))
1467 ni
-> stats
-> exp
+= ( long int )( battle
-> stats
-> exp
* .10 );
1468 battle
-> stats
-> exp
-= ( long int )( battle
-> stats
-> exp
* .10 );
1472 battle
-> stats
-> exp
-= ( long int )( battle
-> stats
-> exp
* .10 );
1473 ni
-> stats
-> exp
= 2000000000 ;
1476 if ( 2000000000 - ni
-> stats
-> gold
> battle
-> stats
-> gold
)
1478 notice ( s_GameServ
, battle
-> getNick (), "You lose ten percent of experience and " \
1479 "all gold on hand!" );
1480 ni
-> stats
-> gold
+= battle
-> stats
-> gold
;
1481 battle
-> stats
-> gold
= 0 ;
1485 battle
-> stats
-> gold
= 2000000000 - ni
-> stats
-> gold
;
1486 notice ( s_GameServ
, battle
-> getNick (), "You lose ten percent of your experience!" );
1488 notice ( s_GameServ
, battle
-> getNick (), "However, %s could not carry all of your " \
1491 notice ( s_GameServ
, battle
-> getNick (), "Luckily, you still have \ 2 %l d\ 2 gold " \
1492 "left. All is not lost!" , battle
-> stats
-> gold
);
1494 ni
-> stats
-> gold
= 2000000000 ;
1496 battle
-> stats
-> battle
= NULL
;
1497 ni
-> stats
-> battle
= NULL
;
1503 battle
-> stats
-> hp
-= hit
;
1504 //display_players(battle->getNick());
1505 ni
-> stats
-> yourturn
= 0 ;
1506 battle
-> stats
-> yourturn
= 1 ;
1507 notice ( s_GameServ
, u
, "Please wait while %s decides what to do!" ,
1515 void do_heal ( char * u
)
1518 char * amount
= strtok ( NULL
, " " );
1523 notice ( s_GameServ
, u
, "SYNTAX: /msg %S HEAL {ALL | #}" );
1525 else if (!( ni
= find ( u
)) || ! ni
-> stats
)
1527 notice ( s_GameServ
, u
, "You aren't playing!" );
1529 else if ( is_fighting ( u
))
1531 notice ( s_GameServ
, u
, "You can't heal in battle!" );
1533 else if ( ni
-> stats
-> hp
>= ni
-> stats
-> maxhp
)
1535 notice ( s_GameServ
, u
, "You don't need healing!" );
1537 else if ( stricmp ( amount
, "ALL" ) == 0 )
1539 price
= ni
-> stats
-> level
* 3 ;
1540 if ( ni
-> stats
-> gold
< ( ni
-> stats
-> maxhp
- ni
-> stats
-> hp
) * price
)
1542 notice ( s_GameServ
, u
, "Healing \ 2 %d \ 2 points for \ 2 %d \ 2 gold per point.",
1543 ( long int ) ni
-> stats
-> gold
/ price
, price
);
1544 ni
-> stats
-> hp
+= ni
-> stats
-> gold
/ price
;
1545 ni
-> stats
-> gold
%= price
;
1549 notice ( s_GameServ
, u
, "Healing all possible points at \ 2 %d \ 2 gold "\
1550 "per point." , price
);
1551 notice ( s_GameServ
, u
, "\ 2 %d \ 2 points healed for \ 2 %l d\ 2 gold. HP at MAX!" ,
1552 ( ni
-> stats
-> maxhp
- ni
-> stats
-> hp
),
1553 ( price
* ( ni
-> stats
-> maxhp
- ni
-> stats
-> hp
)) );
1554 ni
-> stats
-> gold
-= price
* ( ni
-> stats
-> maxhp
- ni
-> stats
-> hp
);
1555 ni
-> stats
-> hp
= ni
-> stats
-> maxhp
;
1558 else if ( isstringnum ( amount
))
1560 num
= stringtoint ( amount
);
1561 price
= ni
-> stats
-> level
* 3 ;
1562 if ( ni
-> stats
-> gold
< price
* num
)
1564 notice ( s_GameServ
, u
, "You only have enough gold to heal \ 2 %d \ 2 points!",
1565 ( long int ) ni
-> stats
-> gold
/ price
);
1567 else if ( num
<= ni
-> stats
-> maxhp
- ni
-> stats
-> hp
)
1569 notice ( s_GameServ
, u
, "Healing \ 2 %d \ 2 points at \ 2 %d \ 2 gold per point.",
1571 ni
-> stats
-> hp
+= num
;
1572 ni
-> stats
-> gold
-= num
* price
;
1574 else if ( num
> ni
-> stats
-> maxhp
- ni
-> stats
-> hp
)
1576 notice ( s_GameServ
, u
, "Healing all possible points at \ 2 %d \ 2 gold "\
1577 "per point." , price
);
1578 notice ( s_GameServ
, u
, "\ 2 %d \ 2 points healed. HP at MAX!",
1579 ( ni
-> stats
-> maxhp
- ni
-> stats
-> hp
));
1580 ni
-> stats
-> gold
-= price
* ( ni
-> stats
-> maxhp
- ni
-> stats
-> hp
);
1581 ni
-> stats
-> hp
= ni
-> stats
-> maxhp
;
1584 else if ( amount
[ 0 ] == '-' )
1585 notice ( s_GameServ
, u
, "You trying to cheat?" );
1587 notice ( s_GameServ
, u
, "SYNTAX: /msg %S HEAL {ALL | #}" );
1590 int isstringnum ( char * num
)
1593 for ( x
= 0 ; x
< strlen ( num
); x
++)
1595 if (( int ) num
[ x
] < 48 || ( int ) num
[ x
] > 57 )
1601 long int stringtoint ( char * number
)
1603 cout
<< "stringtoint: " << number
<< endl
;
1604 long int x
, len
= strlen ( number
), sum
= 0 ;
1606 return chartoint ( number
[ 0 ]);
1607 sum
+= chartoint ( number
[ len
- 1 ]);
1608 for ( x
= len
- 2 ; x
>= 0 ; x
--)
1610 cout
<< "Adding: " << chartoint ( number
[ x
]) * pow ( 10 , abs ( x
- len
+ 1 )) <<
1612 sum
+= chartoint ( number
[ x
]) * pow ( 10 , abs ( x
- len
+ 1 ));
1617 long int pow ( int x
, int y
)
1623 if ( x
!= 0 && y
!= 0 )
1625 for ( count
= 1 ; count
<= y
- 1 ; count
++)
1633 long int chartoint ( char ch
)
1635 if ( int ( ch
) >= 48 && int ( ch
) <= 57 )
1636 return int ( ch
) - 48 ;
1643 ListNode
< aClient
> * ptr
= players
. First ();
1647 outfile
. open ( playerdata
);
1651 cerr
<< "Error opening " << playerdata
<< endl
;
1657 it
= ptr
-> getData ()-> stats
;
1658 outfile
<< it
-> name
<< ' ' << it
-> level
<< ' ' << it
-> exp
<< ' ' << it
-> gold
<< ' ' << it
-> bank
<< ' '
1659 << it
-> hp
<< ' ' << it
-> maxhp
<< ' ' << it
-> strength
<< ' ' << it
-> defense
<< ' '
1660 << it
-> armor
<< ' ' << it
-> weapon
<< ' ' << ( it
-> alive
? "alive" : "dead" ) << ' '
1661 << it
-> forest_fights
<< ' ' << it
-> player_fights
<< ' '
1662 << it
-> password
<< endl
;
1673 char * alive
, * tempname
, * buf
, * password
;
1674 buf
= new char [ 1023 ];
1676 infile
. open ( playerdata
);
1680 cerr
<< "Error opening " << playerdata
<< endl
;
1684 while ( infile
. getline ( buf
, 1024 , ' \n ' ))
1686 cout
<< "temp = new aClient;" << endl
<< flush
;
1688 cout
<< "tempname = strtok(buf, " ");" << endl
<< flush
;
1689 tempname
= strtok ( buf
, " " );
1691 cout
<< "temp->stats = new Player(tempname);" << endl
<< flush
;
1693 temp
-> stats
= new Player ( tempname
);
1695 cout
<< "p = temp->stats;" << endl
<< flush
;
1698 //Kain 1 1 0 500 10 10 0 0 1 1 alive 100 3
1699 p
-> level
= stringtoint ( strtok ( NULL
, " " ));
1700 p
-> exp
= stringtoint ( strtok ( NULL
, " " ));
1701 p
-> gold
= stringtoint ( strtok ( NULL
, " " ));
1702 p
-> bank
= stringtoint ( strtok ( NULL
, " " ));
1703 p
-> hp
= stringtoint ( strtok ( NULL
, " " ));
1704 p
-> maxhp
= stringtoint ( strtok ( NULL
, " " ));
1705 p
-> strength
= stringtoint ( strtok ( NULL
, " " ));
1706 p
-> defense
= stringtoint ( strtok ( NULL
, " " ));
1707 p
-> armor
= stringtoint ( strtok ( NULL
, " " ));
1708 p
-> weapon
= stringtoint ( strtok ( NULL
, " " ));
1709 alive
= strtok ( NULL
, " " );
1710 p
-> alive
= ( stricmp ( alive
, "ALIVE" ) == 0 ? true : false );
1711 p
-> forest_fights
= stringtoint ( strtok ( NULL
, " " ));
1712 p
-> player_fights
= stringtoint ( strtok ( NULL
, " " ));
1713 password
= strtok ( NULL
, " " );
1714 strcpy ( p
-> password
, password
);
1715 temp
-> setNick ( "NULL" );
1717 printf ( " %s %d %l d %l d %l d %d %d %d %d %d %d %s %d %d %s \n " , p
-> name
, p
-> level
,
1718 p
-> exp
, p
-> gold
, p
-> bank
, p
-> hp
, p
-> maxhp
, p
-> strength
, p
-> defense
, p
-> armor
, p
-> weapon
,
1719 alive
, p
-> forest_fights
, p
-> player_fights
, p
-> password
);
1721 cout
<< "Inserting " << temp
-> stats
-> name
<< " at back of list" << endl
;
1722 players
. insertAtBack ( temp
);
1723 cout
<< temp
-> stats
-> name
<< " Inserted, now deleting" << endl
;
1725 cout
<< "Deleted" << endl
;
1730 bool passcmp ( char * encrypted
, char * plaintext
)
1733 char * plaintext2
, * plainToencrypt
;
1736 plaintext2
= new char [ strlen ( encrypted
) + strlen ( plaintext
)]; // Extra
1737 strcpy ( plaintext2
, plaintext
);
1739 salt
[ 0 ] = encrypted
[ 0 ];
1740 salt
[ 1 ] = encrypted
[ 1 ];
1743 plainToencrypt
= crypt ( plaintext2
, salt
);
1745 same
= ( strcmp (( const char *) encrypted
, plainToencrypt
) == 0 ? true : false );
1747 delete [] plaintext2
;
1752 bool check_password ( char * name
, char * plaintext
)
1756 if (!( client
= findplayer ( name
)))
1760 return passcmp ( client
-> stats
-> password
, plaintext
);
1764 void do_store ( char * u
)
1766 char * cmd
= strtok ( NULL
, " " );
1767 char * item
= strtok ( NULL
, " " );
1768 char * num
= strtok ( NULL
, " " );
1774 if (! is_playing ( u
) || !( user
= find ( u
)))
1775 notice ( s_GameServ
, u
, "You must be playing to use the store!" );
1776 else if (! cmd
|| ! item
)
1778 notice ( s_GameServ
, u
, "SYNTAX: STORE LIST {ARMOR | WEAPONS}" );
1779 notice ( s_GameServ
, u
, " \ 2 STORE SELL {ARMOR | WEAPON}\ 2 " );
1780 notice ( s_GameServ
, u
, " \ 2 STORE BUY {ARMOR | WEAPON} \1f NUMBER\1f \ 2 " );
1782 else if ( stricmp ( cmd
, "LIST" ) == 0 )
1784 if ( stricmp ( item
, "WEAPONS" ) == 0 )
1786 notice ( s_GameServ
, u
, "Welcome to Kain's Armory" );
1787 notice ( s_GameServ
, u
, "Here are the weapons we have available for the killing, sire:" );
1788 for ( int x
= 1 ; x
< WNA
; x
++)
1790 space
= spaces ( strlen ( weapons
[ x
]), "." );
1791 notice ( s_GameServ
, u
, " %s%d . %s%s%d " ,( x
< 10 ? " " : "" ), x
, weapons
[ x
], space
, prices
[ x
- 1 ]);
1794 notice ( s_GameServ
, u
, "To purchase a weapon, type /msg %S STORE BUY \ 2 NUM\ 2 ." );
1795 notice ( s_GameServ
, u
, "Where num. is the weapon number from the menu above." );
1798 else if ( stricmp ( item
, "ARMOR" ) == 0 )
1800 notice ( s_GameServ
, u
, "Welcome to Kain's Armory" );
1801 notice ( s_GameServ
, u
, "I hope you enjoy the fine armor we have available for your protection:" );
1802 for ( int x
= 1 ; x
< WNA
; x
++)
1804 space
= spaces ( strlen ( armors
[ x
]), "." );
1805 notice ( s_GameServ
, u
, " %s%d . %s%s%d " ,( x
< 10 ? " " : "" ), x
, armors
[ x
], space
, prices
[ x
- 1 ]);
1808 notice ( s_GameServ
, u
, "To purchase armor, type /msg %S store buy armor num." );
1809 notice ( s_GameServ
, u
, "Where num. is the armor number from the menu above." );
1813 } else if ( stricmp ( cmd
, "BUY" ) == 0 ) {
1816 notice ( s_GameServ
, u
, "SYNTAX: \ 2 STORE BUY {ARMOR | WEAPON} \1f NUMBER\1f \ 2 " );
1819 else if (! isstringnum ( num
))
1821 notice ( s_GameServ
, u
, "You must specify a number between 1 and %d . Not %s !" , WNA
- 1 , num
);
1824 if ( stricmp ( item
, "WEAPON" ) == 0 )
1826 wep
= stringtoint ( num
);
1827 if ( wep
>= WNA
|| wep
< 1 )
1829 notice ( s_GameServ
, u
, "The number %d is out of range. The number you provide must be between 1 and %d ." , wep
, WNA
- 1 );
1836 notice ( s_GameServ
, u
, "You have to sell your %s first!" , weapons
[ p
-> weapon
]);
1837 else if ( p
-> gold
< prices
[ wep
- 1 ])
1838 notice ( s_GameServ
, u
, "You don't have enough gold for %s !" , weapons
[ wep
]);
1841 notice ( s_GameServ
, u
, "You have purchased %s ! Thanks for the gold!" , weapons
[ wep
]);
1843 p
-> gold
-= prices
[ wep
- 1 ];
1846 else if ( stricmp ( item
, "ARMOR" ) == 0 )
1848 wep
= stringtoint ( num
);
1849 if ( wep
>= WNA
|| wep
< 1 )
1851 notice ( s_GameServ
, u
, "The number %d is out of range. The number you provide must be between 1 and %d ." , wep
, WNA
- 1 );
1858 notice ( s_GameServ
, u
, "You have to sell your %s first!" , armors
[ p
-> armor
]);
1859 else if ( p
-> gold
< prices
[ wep
- 1 ])
1860 notice ( s_GameServ
, u
, "You don't have enough gold for %s !" , armors
[ wep
]);
1863 notice ( s_GameServ
, u
, "You have purchased %s ! Thanks for the gold!" , armors
[ wep
]);
1865 p
-> gold
-= prices
[ wep
- 1 ];
1869 else if ( stricmp ( cmd
, "SELL" ) == 0 )
1873 if ( stricmp ( item
, "WEAPON" ) == 0 )
1877 notice ( s_GameServ
, u
, "You want me to chop off your hands?" );
1880 else if ( p
-> gold
== 2000000000 )
1882 notice ( s_GameServ
, u
, "You have enough gold. I'll just take that off your hands, sire." );
1885 else if ( 2000000000 - p
-> gold
< ( prices
[ p
-> weapon
- 1 ] / 2 ))
1887 notice ( s_GameServ
, u
, "Thank you for your business! You now have as much gold as you can carry." );
1888 notice ( s_GameServ
, u
, "However, you have no weapon... can I interest you in the %s ?" , weapons
[ WNA
- 1 ]);
1889 p
-> gold
= 2000000000 ;
1894 notice ( s_GameServ
, u
, "Thank you for your business! You now have %d more gold but no weapon!" , ( prices
[ p
-> weapon
- 1 ] / 2 ));
1895 p
-> gold
+= ( prices
[ p
-> weapon
- 1 ] / 2 );
1899 else if ( stricmp ( item
, "ARMOR" ) == 0 )
1905 notice ( s_GameServ
, u
, "I don't think you can be any more naked..." );
1908 if ( p
-> gold
== 2000000000 )
1910 notice ( s_GameServ
, u
, "You have enough gold. I'll just take that off your hands, sire." );
1913 else if ( 2000000000 - p
-> gold
< ( prices
[ p
-> armor
- 1 ] / 2 ))
1915 notice ( s_GameServ
, u
, "Thank you for your business! You now have as much gold as you can carry." );
1916 notice ( s_GameServ
, u
, "However, you have no armor... can I interest you in %s ?" , armors
[ WNA
- 1 ]);
1917 p
-> gold
= 2000000000 ;
1922 notice ( s_GameServ
, u
, "Thank you for your business! You now have %d more gold but no armor!" ,
1923 ( prices
[ p
-> armor
- 1 ] / 2 ));
1925 p
-> gold
+= ( prices
[ p
-> armor
- 1 ] / 2 );
1931 notice ( s_GameServ
, u
, "SYNTAX: STORE LIST {ARMOR | WEAPONS}" );
1932 notice ( s_GameServ
, u
, " \ 2 STORE SELL {ARMOR | WEAPON}\ 2 " );
1933 notice ( s_GameServ
, u
, " \ 2 STORE BUY {ARMOR | WEAPON} \1f NUMBER\1f \ 2 " );
1938 void do_bank ( char * u
)
1940 char * cmd
= strtok ( NULL
, " " );
1941 char * amount
= strtok ( NULL
, " " );
1942 char * nick
= strtok ( NULL
, " " );
1947 if (! cmd
|| ! amount
|| ( stricmp ( cmd
, "TRANSFER" ) == 0 && ! nick
))
1949 notice ( s_GameServ
, u
, "BANK {WITHDRAW | DEPOSIT} {ALL | AMOUNT}" );
1952 else if (! is_playing ( u
) || !( user
= find ( u
)))
1954 notice ( s_GameServ
, u
, "You must be playing to use the bank!" );
1957 else if (! isstringnum ( amount
) && stricmp ( amount
, "ALL" ) != 0 )
1959 notice ( s_GameServ
, u
, "I don't know how to convert alphabet letters into currency, sire!" );
1965 if ( stricmp ( cmd
, "DEPOSIT" ) == 0 )
1967 if ( p
-> bank
== 2000000000 )
1969 notice ( s_GameServ
, u
, "Your bank account is full, sire!" );
1972 else if ( stricmp ( amount
, "ALL" ) == 0 )
1974 if ( 2000000000 - p
-> bank
< p
-> gold
)
1976 notice ( s_GameServ
, u
, "You don't have enough room for all of your gold." );
1977 notice ( s_GameServ
, u
, "Depositing %l d gold into your account" , ( 2000000000 - p
-> bank
));
1978 p
-> gold
-= ( 2000000000 - p
-> bank
);
1979 p
-> bank
= 2000000000 ;
1983 notice ( s_GameServ
, u
, "Depositing %l d gold into your account!" , p
-> gold
);
1988 else if ( stringtoint ( amount
) > p
-> gold
)
1990 notice ( s_GameServ
, u
, "Sire, you only have %l d gold!" , p
-> gold
);
1995 if ( 2000000000 - p
-> bank
< stringtoint ( amount
))
1997 notice ( s_GameServ
, u
, "You don't have room in your account for that much." );
1998 notice ( s_GameServ
, u
, "Capping off your account with %l d gold!" , ( 2000000000 - p
-> bank
));
1999 p
-> gold
-= ( 2000000000 - p
-> bank
);
2000 p
-> bank
= 2000000000 ;
2004 notice ( s_GameServ
, u
, "Depositing %d gold into your account!" , stringtoint ( amount
));
2005 p
-> bank
+= stringtoint ( amount
);
2006 p
-> gold
-= stringtoint ( amount
);
2010 else if ( stricmp ( cmd
, "WITHDRAW" ) == 0 )
2012 if ( p
-> gold
== 2000000000 )
2014 notice ( s_GameServ
, u
, "You cannot carry any more gold, sire!" );
2017 else if ( stricmp ( amount
, "ALL" ) == 0 )
2019 if ( 2000000000 - p
-> gold
< p
-> bank
)
2021 notice ( s_GameServ
, u
, "You don't have enough room to carry all that gold." );
2022 notice ( s_GameServ
, u
, "Withdrawing %l d gold from your account" , ( 2000000000 - p
-> gold
));
2023 p
-> bank
-= ( 2000000000 - p
-> gold
);
2024 p
-> gold
= 2000000000 ;
2028 notice ( s_GameServ
, u
, "Withdrawing %l d gold from your account!" , p
-> bank
);
2033 else if ( stringtoint ( amount
) > p
-> bank
)
2035 notice ( s_GameServ
, u
, "Sire, you only have %l d gold in the bank!" , p
-> bank
);
2040 if ( 2000000000 - p
-> gold
< stringtoint ( amount
))
2042 notice ( s_GameServ
, u
, "You don't enough have room to carry that much gold!" );
2043 notice ( s_GameServ
, u
, "You fill your pockets with %l d gold!" ,
2044 ( 2000000000 - p
-> gold
));
2045 p
-> bank
-= ( 2000000000 - p
-> gold
);
2046 p
-> gold
= 2000000000 ;
2050 notice ( s_GameServ
, u
, "Withdrawing %d gold from your account!" , stringtoint ( amount
));
2051 p
-> gold
+= stringtoint ( amount
);
2052 p
-> bank
-= stringtoint ( amount
);