]>
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
, "PRINT" ) == 0 ) {
131 cout
<< "Printing Clients List: " << endl
;
133 cout
<< " \n Printing Player List: " << endl
;
135 } else if ( stricmp ( cmd
, "LIST" ) == 0 ) {
137 } else if ( stricmp ( cmd
, "REGISTER" ) == 0 ) {
139 } else if ( stricmp ( cmd
, "IDENTIFY" ) == 0 ) {
141 } else if ( stricmp ( cmd
, "HELP" ) == 0 ) {
142 } else if ( stricmp ( cmd
, "STATS" ) == 0 ) {
144 } else if ( stricmp ( cmd
, "SHUTDOWN" ) == 0 ) {
146 raw ( "SQUIT %s :leaving" , servername
);
147 } else if ( stricmp ( cmd
, "SAVE" ) == 0 ) {
149 } else if ( stricmp ( cmd
, "LOAD" ) == 0 ) {
151 } else if ( stricmp ( cmd
, "RAW" ) == 0 ) {
152 char * rest
= strtok ( NULL
, "" );
156 source
--; // Bring the : back so we don't leak memory
157 cmd
--; // Same thing :)
160 int stricmp ( const char * s1
, const char * s2
)
164 while (( c
= tolower (* s1
)) == tolower (* s2
)) {
170 if ( c
< tolower (* s2
))
175 void showstats ( const char * u
, const char * nick
)
177 aClient
* ni
, * sender
= find ( u
);
183 cout
<< " \n\n u: " << u
<< " \n nick: " << nick
<< endl
;
184 if (!( ni
= findbynick ( nick
)))
186 notice ( s_GameServ
, u
, " %s not found" , nick
);
191 notice ( s_GameServ
, sender
-> getNick (), "Stats for %s :" , ni
-> stats
-> name
);
193 sprintf ( buf
, "Experience: %l d" , ni
-> stats
-> exp
);
194 space
= spaces ( strlen ( buf
), " " );
195 notice ( s_GameServ
, sender
-> getNick (), " %s%s Level: %d " , buf
, space
,
199 sprintf ( buf
, "Gold: %l d" , ni
-> stats
-> gold
);
200 space
= spaces ( strlen ( buf
), " " );
201 notice ( s_GameServ
, sender
-> getNick (), " %s%s Gold in Bank: %l d" , buf
, space
, ni
-> stats
-> bank
);
204 notice ( s_GameServ
, sender
-> getNick (), "Health Points: %d of %d " , ni
-> stats
-> hp
,
207 sprintf ( buf
, "Strength: %d " , ni
-> stats
-> strength
+ webonus
[ ni
-> stats
-> weapon
]);
208 space
= spaces ( strlen ( buf
), " " );
209 notice ( s_GameServ
, sender
-> getNick (), " %s%s Defense: %d " ,
210 buf
, space
, ni
-> stats
-> defense
+ arbonus
[ ni
-> stats
-> armor
]);
213 sprintf ( buf
, "Armor: %s " , armors
[ ni
-> stats
-> armor
]);
214 space
= spaces ( strlen ( buf
), " " );
215 notice ( s_GameServ
, sender
-> getNick (), " %s%s Weapon: %s " , buf
, space
,
216 weapons
[ ni
-> stats
-> weapon
]);
219 sprintf ( buf
, "Forest Fights: %d " , ni
-> stats
-> forest_fights
);
220 space
= spaces ( strlen ( buf
), " " );
221 notice ( s_GameServ
, sender
-> getNick (), " %s%s Player Fights: %d " , buf
, space
, ni
-> stats
-> player_fights
);
228 char * spaces ( int len
, char * seperator
)
231 final
= new char [ 40 ];
233 strcpy ( final
, seperator
);
234 for ( y
= 0 ; y
< 40 - len
; y
++)
235 strcat ( final
, seperator
);
239 void raw ( const char * fmt
, ...)
244 input
= new char [ 1024 ];
246 memset ( input
, 0 , sizeof ( input
)); // Initialize to NULL
252 case 'd' : sprintf ( input
, " %s%d " , input
, va_arg ( args
, int )); break ;
253 case 's' : sprintf ( input
, " %s%s " , input
, va_arg ( args
, char *)); break ;
254 case 'S' : sprintf ( input
, " %s%s " , input
, s_GameServ
); break ;
257 sprintf ( input
, " %s%l d" , input
, va_arg ( args
, long int )); break ;
262 sprintf ( input
, " %s%c " , input
, * t
);
266 sprintf ( input
, " %s%s " , input
, " \r\n " );
267 cout
<< "input: " << input
<< flush
;
268 sock_puts ( sock
, input
);
272 /* Send a NOTICE from the given source to the given nick. */
274 void notice ( const char * source
, const char * dest
, const char * fmt
, ...)
279 input
= new char [ 1024 ];
284 sprintf ( input
, ": %s NOTICE %s :" , source
, dest
);
288 sprintf ( input
, ": %s NOTICE %s :" , source
, dest
);
295 case 'd' : sprintf ( input
, " %s%d " , input
, va_arg ( args
, int )); break ;
296 case 's' : sprintf ( input
, " %s%s " , input
, va_arg ( args
, char *)); break ;
297 case 'S' : sprintf ( input
, " %s%s " , input
, s_GameServ
); break ;
300 sprintf ( input
, " %s%l d" , input
, va_arg ( args
, long int )); break ;
305 sprintf ( input
, " %s%c " , input
, * t
);
309 sprintf ( input
, " %s%s " , input
, " \r\n " );
310 cout
<< "input: " << input
<< flush
;
311 sock_puts ( sock
, input
);
317 int strnicmp ( const char * s1
, const char * s2
, size_t len
)
323 while (( c
= tolower (* s1
)) == tolower (* s2
) && len
> 0 ) {
324 if ( c
== 0 || -- len
== 0 )
329 if ( c
< tolower (* s2
))
334 char * strtok ( char * str
, const char * delim
)
336 static char * current
= NULL
;
343 current
+= strspn ( current
, delim
);
344 ret
= * current
? current
: NULL
;
345 current
+= strcspn ( current
, delim
);
353 void do_list ( char * u
)
355 ListNode
< aClient
> * temp
;
356 temp
= players
. First ();
357 if (! players
. isEmpty ())
359 notice ( s_GameServ
, u
, "People Playing:" );
362 notice ( s_GameServ
, u
, "IRC: %s Game: %s " , temp
-> getData ()-> getNick (), temp
-> getData ()-> stats
-> name
);
365 notice ( s_GameServ
, u
, "End of List" );
368 notice ( s_GameServ
, u
, "No one is playing" );
370 void do_register ( char * u
)
374 password
= strtok ( NULL
, " " );
376 static char saltChars
[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./" ;
379 salt
[ 0 ] = saltChars
[ rand () % strlen ( saltChars
)];
380 salt
[ 1 ] = saltChars
[ rand () % strlen ( saltChars
)];
385 notice ( s_GameServ
, u
, "SYNTAX: /msg %S REGISTER PASSWORD" );
387 else if ( user
= find ( u
))
391 user
-> stats
= new Player ( user
);
392 user
-> stats
-> started
= 1 ;
393 user
-> stats
-> user
= user
; // Set the backwards pointer
394 strcpy ( user
-> stats
-> password
, crypt ( password
, salt
));
395 players
. insertAtBack ( user
);
399 notice ( s_GameServ
, u
, "Already registered. Contact a %S admin for help." );
404 void do_identify ( char * u
)
406 char * password
, * name
;
408 name
= strtok ( NULL
, " " );
409 password
= strtok ( NULL
, " " );
411 if (! password
|| ! name
)
413 notice ( s_GameServ
, u
, "SYNTAX: /msg %S IDENTIFY NAME PASSWORD" );
415 else if (!( p
= findplayer ( name
)) || ! p
-> stats
)
416 notice ( s_GameServ
, u
, "Player %s not found" , name
);
417 else if (! check_password ( name
, password
))
419 notice ( s_GameServ
, u
, "Password incorrect" );
421 else if ( user
= find ( u
))
425 ListNode
< aClient
> * temp
;
426 temp
= players
. Find ( p
);
429 notice ( s_GameServ
, u
, "Fatal error. Contact %S Admin. Buf: %s " ,
433 user
-> stats
= new Player ( p
-> stats
-> name
);
434 cout
<< "Setting data for identified" << endl
;
435 user
-> stats
-> setData ( p
-> stats
);
436 cout
<< "Player Identified" << endl
<< flush
;
440 notice ( s_GameServ
, u
, "Password Accepted. Identified." );
445 notice ( s_GameServ
, u
, "Already identified. Contact a %S admin for help." );
450 void do_stats ( char * u
)
455 nick
= strtok ( NULL
, " " );
459 showstats ( u
, source
-> getNick ());
465 masters
[ 0 ]. name
= "Old Bones" ;
466 masters
[ 0 ]. weapon
= "Dull Sword Cane" ;
467 masters
[ 0 ]. strength
= 30 ;
470 masters
[ 0 ]. maxhp
= 30 ;
471 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!" ;
473 masters
[ 1 ]. name
= "Master Chang" ;
474 masters
[ 1 ]. weapon
= "Nanchaku" ;
475 masters
[ 1 ]. strength
= 57 ;
478 masters
[ 1 ]. maxhp
= 40 ;
479 masters
[ 1 ]. death
= "You try to make out what Master Chang is saying, but the only thing you catch is something about a grasshopper." ;
481 masters
[ 2 ]. name
= "Chuck Norris" ;
482 masters
[ 2 ]. weapon
= "Ranger Kick" ;
483 masters
[ 2 ]. strength
= 85 ;
486 masters
[ 2 ]. maxhp
= 70 ;
487 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!" ;
490 masters
[ 3 ]. name
= "Mr. Miagi" ;
491 masters
[ 3 ]. weapon
= "Petrified Bonsai" ;
492 masters
[ 3 ]. strength
= 100 ;
495 masters
[ 3 ]. maxhp
= 120 ;
496 masters
[ 3 ]. death
= "Skill comes from repeating the correct but seemingly mundane actions. Wax ON, wax OFF!" ;
498 masters
[ 4 ]. name
= "Jackie Chan" ;
499 masters
[ 4 ]. weapon
= "Drunken Boxing" ;
500 masters
[ 4 ]. strength
= 125 ;
501 masters
[ 4 ]. maxhp
= 200 ;
504 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!" ;
506 masters
[ 5 ]. name
= "Jet Li" ;
507 masters
[ 5 ]. weapon
= "Motorcycle" ;
508 masters
[ 5 ]. strength
= 150 ;
509 masters
[ 5 ]. maxhp
= 400 ;
512 masters
[ 5 ]. death
= "Failure is a fuel for excuses. It's the doing the do, that makes the making." ;
515 masters
[ 6 ]. name
= "Muhammad Ali" ;
516 masters
[ 6 ]. weapon
= "Quick Jab" ;
517 masters
[ 6 ]. strength
= 175 ;
518 masters
[ 6 ]. maxhp
= 600 ;
521 masters
[ 6 ]. death
= "It's just a job. Grass grows, birds fly, waves pound the sand. I beat people up." ;
523 masters
[ 7 ]. name
= "Li Mu Bai" ;
524 masters
[ 7 ]. weapon
= "Green Destiny" ;
525 masters
[ 7 ]. strength
= 200 ;
526 masters
[ 7 ]. maxhp
= 800 ;
529 masters
[ 7 ]. death
= "No growth without resistance. No action without reaction. No desire without restraint." ;
532 masters
[ 8 ]. name
= "Jimmy Wang Yu" ;
533 masters
[ 8 ]. weapon
= "Flying Guillotine" ;
534 masters
[ 8 ]. strength
= 275 ;
535 masters
[ 8 ]. maxhp
= 1200 ;
538 masters
[ 8 ]. death
= "You have beaten the one armed boxer. Proceed with caution!" ;
540 masters
[ 9 ]. name
= "Wong Fei Hung" ;
541 masters
[ 9 ]. weapon
= "Drunken Boxing" ;
542 masters
[ 9 ]. strength
= 350 ;
543 masters
[ 9 ]. maxhp
= 1800 ;
546 masters
[ 9 ]. death
= "" ;
548 masters
[ 10 ]. name
= "Bruce Lee" ;
549 masters
[ 10 ]. strength
= 575 ;
550 masters
[ 10 ]. maxhp
= 2500 ;
551 masters
[ 10 ]. gold
= 0 ;
553 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." ;
558 // Hard coded for now - Kain
559 monsters
[ 0 ][ 0 ]. name
= "Slime" ;
560 monsters
[ 0 ][ 0 ]. weapon
= "Acid Goo" ;
561 monsters
[ 0 ][ 0 ]. strength
= 6 ;
562 monsters
[ 0 ][ 0 ]. gold
= 50 ;
563 monsters
[ 0 ][ 0 ]. exp
= 3 ;
564 monsters
[ 0 ][ 0 ]. maxhp
= 9 ;
565 monsters
[ 0 ][ 0 ]. death
= "The slime oozes into nothing... you clean the acid goo off of your weapon" ;
567 monsters
[ 0 ][ 1 ]. name
= "Ghost" ;
568 monsters
[ 0 ][ 1 ]. weapon
= "Cold Breath" ;
569 monsters
[ 0 ][ 1 ]. strength
= 8 ;
570 monsters
[ 0 ][ 1 ]. gold
= 100 ;
571 monsters
[ 0 ][ 1 ]. exp
= 10 ;
572 monsters
[ 0 ][ 1 ]. maxhp
= 10 ;
573 monsters
[ 0 ][ 1 ]. death
= "You feel a chill as the spirit leaves the realm." ;
575 monsters
[ 0 ][ 2 ]. name
= "Ugly Rodent" ;
576 monsters
[ 0 ][ 2 ]. weapon
= "Sharp Teeth" ;
577 monsters
[ 0 ][ 2 ]. strength
= 9 ;
578 monsters
[ 0 ][ 2 ]. gold
= 75 ;
579 monsters
[ 0 ][ 2 ]. exp
= 8 ;
580 monsters
[ 0 ][ 2 ]. maxhp
= 13 ;
581 monsters
[ 0 ][ 2 ]. death
= "You stomp on the Ugly Rodent's remains for a finishing blow." ;
583 monsters
[ 0 ][ 3 ]. name
= "Whart Hog" ;
584 monsters
[ 0 ][ 3 ]. weapon
= "Tusks" ;
585 monsters
[ 0 ][ 3 ]. strength
= 10 ;
586 monsters
[ 0 ][ 3 ]. gold
= 80 ;
587 monsters
[ 0 ][ 3 ]. exp
= 6 ;
588 monsters
[ 0 ][ 3 ]. maxhp
= 10 ;
589 monsters
[ 0 ][ 3 ]. death
= "You cook and eat the hog for good measure!" ;
591 monsters
[ 0 ][ 4 ]. name
= "Pesky Kid" ;
592 monsters
[ 0 ][ 4 ]. weapon
= "Slingshot" ;
593 monsters
[ 0 ][ 4 ]. strength
= 8 ;
594 monsters
[ 0 ][ 4 ]. gold
= 30 ;
595 monsters
[ 0 ][ 4 ]. exp
= 4 ;
596 monsters
[ 0 ][ 4 ]. maxhp
= 6 ;
597 monsters
[ 0 ][ 4 ]. death
= "You take his slingshot and snap the band, sending the kid crying home to mom!" ;
599 monsters
[ 0 ][ 5 ]. name
= "Playground Bully" ;
600 monsters
[ 0 ][ 5 ]. weapon
= "Painful Noogie" ;
601 monsters
[ 0 ][ 5 ]. strength
= 11 ;
602 monsters
[ 0 ][ 5 ]. gold
= 44 ;
603 monsters
[ 0 ][ 5 ]. exp
= 6 ;
604 monsters
[ 0 ][ 5 ]. maxhp
= 10 ;
605 monsters
[ 0 ][ 5 ]. death
= "You give him an indian burn, and punt him across the schoolyard!" ;
607 monsters
[ 0 ][ 6 ]. name
= "Small Imp" ;
608 monsters
[ 0 ][ 6 ]. weapon
= "Dagger" ;
609 monsters
[ 0 ][ 6 ]. strength
= 6 ;
610 monsters
[ 0 ][ 6 ]. gold
= 64 ;
611 monsters
[ 0 ][ 6 ]. exp
= 10 ;
612 monsters
[ 0 ][ 6 ]. maxhp
= 10 ;
613 monsters
[ 0 ][ 6 ]. death
= "You can't help but laugh as he stumbles and falls onto his own dagger!" ;
615 monsters
[ 0 ][ 7 ]. name
= "Little Monkey" ;
616 monsters
[ 0 ][ 7 ]. weapon
= "Monkey Wrench" ;
617 monsters
[ 0 ][ 7 ]. strength
= 6 ;
618 monsters
[ 0 ][ 7 ]. gold
= 53 ;
619 monsters
[ 0 ][ 7 ]. exp
= 9 ;
620 monsters
[ 0 ][ 7 ]. maxhp
= 9 ;
621 monsters
[ 0 ][ 7 ]. death
= "You want to cook it, but you just can't think of eating something that looks so human!" ;
623 monsters
[ 0 ][ 8 ]. name
= "Grub Worm" ;
624 monsters
[ 0 ][ 8 ]. weapon
= "Minor Nudge" ;
625 monsters
[ 0 ][ 8 ]. strength
= 2 ;
626 monsters
[ 0 ][ 8 ]. gold
= 10 ;
627 monsters
[ 0 ][ 8 ]. exp
= 3 ;
628 monsters
[ 0 ][ 8 ]. maxhp
= 3 ;
629 monsters
[ 0 ][ 8 ]. death
= "You decide to save the poor little fella for your next fishing trip." ;
631 monsters
[ 0 ][ 9 ]. name
= "Drakee" ;
632 monsters
[ 0 ][ 9 ]. weapon
= "Tail Slap" ;
633 monsters
[ 0 ][ 9 ]. strength
= 5 ;
634 monsters
[ 0 ][ 9 ]. gold
= 22 ;
635 monsters
[ 0 ][ 9 ]. exp
= 7 ;
636 monsters
[ 0 ][ 9 ]. maxhp
= 5 ;
637 monsters
[ 0 ][ 9 ]. death
= "You pull the little Drakee by its tale and slam it down on a dry stump!" ;
639 monsters
[ 0 ][ 10 ]. name
= "Fat Slob" ;
640 monsters
[ 0 ][ 10 ]. weapon
= "Smelly Breath" ;
641 monsters
[ 0 ][ 10 ]. strength
= 6 ;
642 monsters
[ 0 ][ 10 ]. gold
= 40 ;
643 monsters
[ 0 ][ 10 ]. exp
= 10 ;
644 monsters
[ 0 ][ 10 ]. maxhp
= 7 ;
645 monsters
[ 0 ][ 10 ]. death
= "You kick his stomach for fun, and are thrown back by the spring of it all!" ;
647 monsters
[ 0 ][ 11 ]. name
= "Lost Warrior" ;
648 monsters
[ 0 ][ 11 ]. weapon
= "Long Sword" ;
649 monsters
[ 0 ][ 11 ]. strength
= 10 ;
650 monsters
[ 0 ][ 11 ]. gold
= 250 ;
651 monsters
[ 0 ][ 11 ]. exp
= 19 ;
652 monsters
[ 0 ][ 11 ]. maxhp
= 15 ;
653 monsters
[ 0 ][ 11 ]. death
= "You give him a proper burial in respect for the dead warrior." ;
655 monsters
[ 1 ][ 0 ]. name
= "Lost Warrior's Cousin Larry" ;
656 monsters
[ 1 ][ 0 ]. weapon
= "Wood Axe" ;
657 monsters
[ 1 ][ 0 ]. strength
= 19 ;
658 monsters
[ 1 ][ 0 ]. gold
= 134 ;
659 monsters
[ 1 ][ 0 ]. exp
= 24 ;
660 monsters
[ 1 ][ 0 ]. maxhp
= 30 ;
661 monsters
[ 1 ][ 0 ]. death
= "He was pretty pissed you killed his cousin, but he seems to have suffered the same fate!" ;
663 monsters
[ 1 ][ 1 ]. name
= "Sandman" ;
664 monsters
[ 1 ][ 1 ]. weapon
= "Sleeping Dust" ;
665 monsters
[ 1 ][ 1 ]. strength
= 25 ;
666 monsters
[ 1 ][ 1 ]. gold
= 80 ;
667 monsters
[ 1 ][ 1 ]. exp
= 6 ;
668 monsters
[ 1 ][ 1 ]. maxhp
= 27 ;
669 monsters
[ 1 ][ 1 ]. death
= "You put the sandman to his final sleep." ;
671 monsters
[ 1 ][ 2 ]. name
= "Dirty Transvestite" ;
672 monsters
[ 1 ][ 2 ]. weapon
= "Stiletto Heel" ;
673 monsters
[ 1 ][ 2 ]. strength
= 21 ;
674 monsters
[ 1 ][ 2 ]. gold
= 160 ;
675 monsters
[ 1 ][ 2 ]. exp
= 12 ;
676 monsters
[ 1 ][ 2 ]. maxhp
= 25 ;
677 monsters
[ 1 ][ 2 ]. death
= "You shudder at the thought of ever mistaking this for a woman!" ;
679 monsters
[ 1 ][ 3 ]. name
= "Goblin Gardener" ;
680 monsters
[ 1 ][ 3 ]. weapon
= "Garden Spade" ;
681 monsters
[ 1 ][ 3 ]. strength
= 18 ;
682 monsters
[ 1 ][ 3 ]. gold
= 130 ;
683 monsters
[ 1 ][ 3 ]. exp
= 8 ;
684 monsters
[ 1 ][ 3 ]. maxhp
= 20 ;
685 monsters
[ 1 ][ 3 ]. death
= "You trample on his garden after slaying him... that felt good!" ;
687 monsters
[ 1 ][ 4 ]. name
= "Evil Elf" ;
688 monsters
[ 1 ][ 4 ]. weapon
= "Elvish Bow" ;
689 monsters
[ 1 ][ 4 ]. strength
= 23 ;
690 monsters
[ 1 ][ 4 ]. gold
= 136 ;
691 monsters
[ 1 ][ 4 ]. exp
= 13 ;
692 monsters
[ 1 ][ 4 ]. maxhp
= 24 ;
693 monsters
[ 1 ][ 4 ]. death
= "Elves are usually nice you thought... hmm." ;
695 monsters
[ 1 ][ 5 ]. name
= "Viking Warrior" ;
696 monsters
[ 1 ][ 5 ]. weapon
= "Broad Sword" ;
697 monsters
[ 1 ][ 5 ]. strength
= 21 ;
698 monsters
[ 1 ][ 5 ]. gold
= 330 ;
699 monsters
[ 1 ][ 5 ]. exp
= 20 ;
700 monsters
[ 1 ][ 5 ]. maxhp
= 18 ;
701 monsters
[ 1 ][ 5 ]. death
= "You heard vikings were big, but not THAT big you thought." ;
703 monsters
[ 1 ][ 6 ]. name
= "Wicked Witch" ;
704 monsters
[ 1 ][ 6 ]. weapon
= "Cackling Laugh" ;
705 monsters
[ 1 ][ 6 ]. strength
= 20 ;
706 monsters
[ 1 ][ 6 ]. gold
= 130 ;
707 monsters
[ 1 ][ 6 ]. exp
= 20 ;
708 monsters
[ 1 ][ 6 ]. maxhp
= 26 ;
709 monsters
[ 1 ][ 6 ]. death
= "Just for kicks, you splash some water on her and watch her melt." ;
711 monsters
[ 1 ][ 7 ]. name
= "Vampire Bat" ;
712 monsters
[ 1 ][ 7 ]. weapon
= "Blood Sucking Fangs" ;
713 monsters
[ 1 ][ 7 ]. strength
= 18 ;
714 monsters
[ 1 ][ 7 ]. gold
= 125 ;
715 monsters
[ 1 ][ 7 ]. exp
= 21 ;
716 monsters
[ 1 ][ 7 ]. maxhp
= 29 ;
717 monsters
[ 1 ][ 7 ]. death
= "You fry up the bat and eat it... needs garlic." ;
719 monsters
[ 1 ][ 8 ]. name
= "Thorn Bush" ;
720 monsters
[ 1 ][ 8 ]. weapon
= "101 Thorns" ;
721 monsters
[ 1 ][ 8 ]. strength
= 16 ;
722 monsters
[ 1 ][ 8 ]. gold
= 94 ;
723 monsters
[ 1 ][ 8 ]. exp
= 15 ;
724 monsters
[ 1 ][ 8 ]. maxhp
= 25 ;
725 monsters
[ 1 ][ 8 ]. death
= "You set the bush ablaze and roast some marshmallows." ;
727 monsters
[ 1 ][ 9 ]. name
= "Barbarian" ;
728 monsters
[ 1 ][ 9 ]. weapon
= "Heavy Sword" ;
729 monsters
[ 1 ][ 9 ]. strength
= 29 ;
730 monsters
[ 1 ][ 9 ]. gold
= 250 ;
731 monsters
[ 1 ][ 9 ]. exp
= 25 ;
732 monsters
[ 1 ][ 9 ]. maxhp
= 30 ;
733 monsters
[ 1 ][ 9 ]. death
= "You listen to him moan as he falls over dead." ;
735 monsters
[ 1 ][ 10 ]. name
= "Crypt Rat" ;
736 monsters
[ 1 ][ 10 ]. weapon
= "Stinging Bite" ;
737 monsters
[ 1 ][ 10 ]. strength
= 25 ;
738 monsters
[ 1 ][ 10 ]. gold
= 119 ;
739 monsters
[ 1 ][ 10 ]. exp
= 20 ;
740 monsters
[ 1 ][ 10 ]. maxhp
= 26 ;
741 monsters
[ 1 ][ 10 ]. death
= "You squash the little rodent for fear that it might not be dead." ;
743 monsters
[ 1 ][ 11 ]. name
= "Small Orc" ;
744 monsters
[ 1 ][ 11 ]. weapon
= "blade" ;
745 monsters
[ 1 ][ 11 ]. strength
= 28 ;
746 monsters
[ 1 ][ 11 ]. gold
= 300 ;
747 monsters
[ 1 ][ 11 ]. exp
= 30 ;
748 monsters
[ 1 ][ 11 ]. maxhp
= 36 ;
749 monsters
[ 1 ][ 11 ]. death
= "It's an ugly one, and it would've grown up to be a terror..." ;
751 monsters
[ 2 ][ 0 ]. name
= "Teferi" ;
752 monsters
[ 2 ][ 0 ]. weapon
= "Puzzle Box" ;
753 monsters
[ 2 ][ 0 ]. strength
= 29 ;
754 monsters
[ 2 ][ 0 ]. gold
= 380 ;
755 monsters
[ 2 ][ 0 ]. exp
= 18 ;
756 monsters
[ 2 ][ 0 ]. maxhp
= 29 ;
757 monsters
[ 2 ][ 0 ]. death
= "It was a puzzling experience." ;
759 monsters
[ 2 ][ 1 ]. name
= "Spineless Thug" ;
760 monsters
[ 2 ][ 1 ]. weapon
= "Spiked Bat" ;
761 monsters
[ 2 ][ 1 ]. strength
= 37 ;
762 monsters
[ 2 ][ 1 ]. gold
= 384 ;
763 monsters
[ 2 ][ 1 ]. exp
= 27 ;
764 monsters
[ 2 ][ 1 ]. maxhp
= 32 ;
765 monsters
[ 2 ][ 1 ]. death
= "See you at the crossroads!" ;
767 monsters
[ 2 ][ 2 ]. name
= "Pyromaniac" ;
768 monsters
[ 2 ][ 2 ]. weapon
= "Pyrotechnics" ;
769 monsters
[ 2 ][ 2 ]. strength
= 29 ;
770 monsters
[ 2 ][ 2 ]. gold
= 563 ;
771 monsters
[ 2 ][ 2 ]. exp
= 22 ;
772 monsters
[ 2 ][ 2 ]. maxhp
= 45 ;
773 monsters
[ 2 ][ 2 ]. death
= "He chants FIRE FIRE as he falls to the ground... a burning heap of flesh." ;
775 monsters
[ 2 ][ 3 ]. name
= "Evil Enchantress" ;
776 monsters
[ 2 ][ 3 ]. weapon
= "Deadly Spell" ;
777 monsters
[ 2 ][ 3 ]. strength
= 50 ;
778 monsters
[ 2 ][ 3 ]. gold
= 830 ;
779 monsters
[ 2 ][ 3 ]. exp
= 35 ;
780 monsters
[ 2 ][ 3 ]. maxhp
= 35 ;
781 monsters
[ 2 ][ 3 ]. death
= "She looked just about as good as she fought." ;
783 monsters
[ 2 ][ 4 ]. name
= "Killer Leprechaun" ;
784 monsters
[ 2 ][ 4 ]. weapon
= "Gold Rush" ;
785 monsters
[ 2 ][ 4 ]. strength
= 35 ;
786 monsters
[ 2 ][ 4 ]. gold
= 1300 ;
787 monsters
[ 2 ][ 4 ]. exp
= 30 ;
788 monsters
[ 2 ][ 4 ]. maxhp
= 37 ;
789 monsters
[ 2 ][ 4 ]. death
= "You steal his pot of gold... that's a lot of money!" ;
791 monsters
[ 2 ][ 5 ]. name
= "Avalanche Rider" ;
792 monsters
[ 2 ][ 5 ]. weapon
= "Huge Snowball" ;
793 monsters
[ 2 ][ 5 ]. strength
= 32 ;
794 monsters
[ 2 ][ 5 ]. gold
= 700 ;
795 monsters
[ 2 ][ 5 ]. exp
= 32 ;
796 monsters
[ 2 ][ 5 ]. maxhp
= 38 ;
797 monsters
[ 2 ][ 5 ]. death
= "You take his snowboard and snap it in two!" ;
799 monsters
[ 2 ][ 6 ]. name
= "Blundering Idiot" ;
800 monsters
[ 2 ][ 6 ]. weapon
= "Stupidity" ;
801 monsters
[ 2 ][ 6 ]. strength
= 14 ;
802 monsters
[ 2 ][ 6 ]. gold
= 700 ;
803 monsters
[ 2 ][ 6 ]. exp
= 20 ;
804 monsters
[ 2 ][ 6 ]. maxhp
= 29 ;
805 monsters
[ 2 ][ 6 ]. death
= "Now there's one person you don't feel sorry for killing!" ;
807 monsters
[ 2 ][ 7 ]. name
= "Militant Anarchist" ;
808 monsters
[ 2 ][ 7 ]. weapon
= "Molotov Cocktail" ;
809 monsters
[ 2 ][ 7 ]. strength
= 33 ;
810 monsters
[ 2 ][ 7 ]. gold
= 245 ;
811 monsters
[ 2 ][ 7 ]. exp
= 45 ;
812 monsters
[ 2 ][ 7 ]. maxhp
= 32 ;
813 monsters
[ 2 ][ 7 ]. death
= "Order has been restored for now..." ;
815 monsters
[ 2 ][ 8 ]. name
= "Scathe Zombies" ;
816 monsters
[ 2 ][ 8 ]. weapon
= "Death Grip" ;
817 monsters
[ 2 ][ 8 ]. strength
= 38 ;
818 monsters
[ 2 ][ 8 ]. gold
= 763 ;
819 monsters
[ 2 ][ 8 ]. exp
= 15 ;
820 monsters
[ 2 ][ 8 ]. maxhp
= 45 ;
821 monsters
[ 2 ][ 8 ]. death
= "That was perhaps the scariest experience of your life." ;
823 monsters
[ 2 ][ 9 ]. name
= "Spitting Llama" ;
824 monsters
[ 2 ][ 9 ]. weapon
= "Spit Spray" ;
825 monsters
[ 2 ][ 9 ]. strength
= 48 ;
826 monsters
[ 2 ][ 9 ]. gold
= 638 ;
827 monsters
[ 2 ][ 9 ]. exp
= 28 ;
828 monsters
[ 2 ][ 9 ]. maxhp
= 34 ;
829 monsters
[ 2 ][ 9 ]. death
= "You wipe the spit off your face and fling it back at the Llama." ;
831 monsters
[ 2 ][ 10 ]. name
= "Juggalo" ;
832 monsters
[ 2 ][ 10 ]. weapon
= "Clown Axe" ;
833 monsters
[ 2 ][ 10 ]. strength
= 60 ;
834 monsters
[ 2 ][ 10 ]. gold
= 650 ;
835 monsters
[ 2 ][ 10 ]. exp
= 30 ;
836 monsters
[ 2 ][ 10 ]. maxhp
= 29 ;
837 monsters
[ 2 ][ 10 ]. death
= "What is a Juggalo? I don't know!" ;
839 monsters
[ 2 ][ 11 ]. name
= "The Boogie Man" ;
840 monsters
[ 2 ][ 11 ]. weapon
= "Striking Fear" ;
841 monsters
[ 2 ][ 11 ]. strength
= 46 ;
842 monsters
[ 2 ][ 11 ]. gold
= 600 ;
843 monsters
[ 2 ][ 11 ]. exp
= 35 ;
844 monsters
[ 2 ][ 11 ]. maxhp
= 27 ;
845 monsters
[ 2 ][ 11 ]. death
= "He's scared you for the very last time!" ;
847 monsters
[ 3 ][ 0 ]. name
= "Living Fire" ;
848 monsters
[ 3 ][ 0 ]. weapon
= "Scorching Wind" ;
849 monsters
[ 3 ][ 0 ]. strength
= 55 ;
850 monsters
[ 3 ][ 0 ]. gold
= 1100 ;
851 monsters
[ 3 ][ 0 ]. exp
= 36 ;
852 monsters
[ 3 ][ 0 ]. maxhp
= 55 ;
853 monsters
[ 3 ][ 0 ]. death
= "You extinguish the Living Flame once and for all!" ;
855 monsters
[ 3 ][ 1 ]. name
= "Raging Orc" ;
856 monsters
[ 3 ][ 1 ]. weapon
= "Orcish Artillary" ;
857 monsters
[ 3 ][ 1 ]. strength
= 89 ;
858 monsters
[ 3 ][ 1 ]. gold
= 900 ;
859 monsters
[ 3 ][ 1 ]. exp
= 25 ;
860 monsters
[ 3 ][ 1 ]. maxhp
= 50 ;
861 monsters
[ 3 ][ 1 ]. death
= "This orc was a bit tougher than you remembered!" ;
863 monsters
[ 3 ][ 2 ]. name
= "Huge Tarantula" ;
864 monsters
[ 3 ][ 2 ]. weapon
= "Tangling Web" ;
865 monsters
[ 3 ][ 2 ]. strength
= 59 ;
866 monsters
[ 3 ][ 2 ]. gold
= 1000 ;
867 monsters
[ 3 ][ 2 ]. exp
= 35 ;
868 monsters
[ 3 ][ 2 ]. maxhp
= 60 ;
869 monsters
[ 3 ][ 2 ]. death
= "You're glad you overcame your arachniphobia so soon!" ;
871 monsters
[ 3 ][ 3 ]. name
= "Rabid Wolf" ;
872 monsters
[ 3 ][ 3 ]. weapon
= "Cujo Bite" ;
873 monsters
[ 3 ][ 3 ]. strength
= 40 ;
874 monsters
[ 3 ][ 3 ]. gold
= 1200 ;
875 monsters
[ 3 ][ 3 ]. exp
= 47 ;
876 monsters
[ 3 ][ 3 ]. maxhp
= 76 ;
877 monsters
[ 3 ][ 3 ]. death
= "The mutt falls over dead as white foam drips from its deadly canines..." ;
879 monsters
[ 3 ][ 4 ]. name
= "Goblin Fighter" ;
880 monsters
[ 3 ][ 4 ]. weapon
= "Morning Star" ;
881 monsters
[ 3 ][ 4 ]. strength
= 38 ;
882 monsters
[ 3 ][ 4 ]. gold
= 700 ;
883 monsters
[ 3 ][ 4 ]. exp
= 30 ;
884 monsters
[ 3 ][ 4 ]. maxhp
= 75 ;
885 monsters
[ 3 ][ 4 ]. death
= "He almost caught you with his chain mace, but you sliced off his head." ;
887 monsters
[ 3 ][ 5 ]. name
= "Grizzly Bear" ;
888 monsters
[ 3 ][ 5 ]. weapon
= "Razor Claws" ;
889 monsters
[ 3 ][ 5 ]. strength
= 68 ;
890 monsters
[ 3 ][ 5 ]. gold
= 1747 ;
891 monsters
[ 3 ][ 5 ]. exp
= 81 ;
892 monsters
[ 3 ][ 5 ]. maxhp
= 51 ;
893 monsters
[ 3 ][ 5 ]. death
= "It almost got you this time... better be careful" ;
895 monsters
[ 3 ][ 6 ]. name
= "Skeleton Man" ;
896 monsters
[ 3 ][ 6 ]. weapon
= "Leg Bone" ;
897 monsters
[ 3 ][ 6 ]. strength
= 70 ;
898 monsters
[ 3 ][ 6 ]. gold
= 597 ;
899 monsters
[ 3 ][ 6 ]. exp
= 57 ;
900 monsters
[ 3 ][ 6 ]. maxhp
= 60 ;
901 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!" ;
903 monsters
[ 3 ][ 7 ]. name
= "Young Werewolf" ;
904 monsters
[ 3 ][ 7 ]. weapon
= "Howling Bites" ;
905 monsters
[ 3 ][ 7 ]. strength
= 75 ;
906 monsters
[ 3 ][ 7 ]. gold
= 1742 ;
907 monsters
[ 3 ][ 7 ]. exp
= 65 ;
908 monsters
[ 3 ][ 7 ]. maxhp
= 42 ;
909 monsters
[ 3 ][ 7 ]. death
= "You scatter the wolf's body parts in hopes he will stay dead!" ;
911 monsters
[ 3 ][ 8 ]. name
= "Dark Infantry" ;
912 monsters
[ 3 ][ 8 ]. weapon
= "Flesh Reaper" ;
913 monsters
[ 3 ][ 8 ]. strength
= 69 ;
914 monsters
[ 3 ][ 8 ]. gold
= 870 ;
915 monsters
[ 3 ][ 8 ]. exp
= 43 ;
916 monsters
[ 3 ][ 8 ]. maxhp
= 65 ;
917 monsters
[ 3 ][ 8 ]. death
= "Light has prevailed this time... but it's only so long before you meet again." ;
919 monsters
[ 3 ][ 9 ]. name
= "Erie Spirit" ;
920 monsters
[ 3 ][ 9 ]. weapon
= "Deadly Grin" ;
921 monsters
[ 3 ][ 9 ]. strength
= 63 ;
922 monsters
[ 3 ][ 9 ]. gold
= 1300 ;
923 monsters
[ 3 ][ 9 ]. exp
= 32 ;
924 monsters
[ 3 ][ 9 ]. maxhp
= 50 ;
925 monsters
[ 3 ][ 9 ]. death
= "His cousin the ghost was a little bit easier." ;
927 monsters
[ 3 ][ 10 ]. name
= "Gollum" ;
928 monsters
[ 3 ][ 10 ]. weapon
= "Precious Treasure" ;
929 monsters
[ 3 ][ 10 ]. strength
= 66 ;
930 monsters
[ 3 ][ 10 ]. gold
= 1492 ;
931 monsters
[ 3 ][ 10 ]. exp
= 73 ;
932 monsters
[ 3 ][ 10 ]. maxhp
= 54 ;
933 monsters
[ 3 ][ 10 ]. death
= "Gollum screams out \" MY PRECIOUS \" as his small body falls limp from your blow." ;
935 monsters
[ 3 ][ 11 ]. name
= "Rock Fighter" ;
936 monsters
[ 3 ][ 11 ]. weapon
= "Small Boulders" ;
937 monsters
[ 3 ][ 11 ]. strength
= 87 ;
938 monsters
[ 3 ][ 11 ]. gold
= 1742 ;
939 monsters
[ 3 ][ 11 ]. exp
= 99 ;
940 monsters
[ 3 ][ 11 ]. maxhp
= 65 ;
941 monsters
[ 3 ][ 11 ]. death
= "You dodge his last rock, and counter with a low blow, cutting off his legs." ;
944 monsters
[ 4 ][ 0 ]. name
= "Giant Sphinx" ;
945 monsters
[ 4 ][ 0 ]. weapon
= "Ancient Curse" ;
946 monsters
[ 4 ][ 0 ]. strength
= 120 ;
947 monsters
[ 4 ][ 0 ]. gold
= 1000 ;
948 monsters
[ 4 ][ 0 ]. exp
= 100 ;
949 monsters
[ 4 ][ 0 ]. maxhp
= 80 ;
950 monsters
[ 4 ][ 0 ]. death
= "You look in awe at the great wonder, collapsed at your feet!" ;
952 monsters
[ 4 ][ 1 ]. name
= "Giant Ogre" ;
953 monsters
[ 4 ][ 1 ]. weapon
= "Big Log" ;
954 monsters
[ 4 ][ 1 ]. strength
= 130 ;
955 monsters
[ 4 ][ 1 ]. gold
= 857 ;
956 monsters
[ 4 ][ 1 ]. exp
= 175 ;
957 monsters
[ 4 ][ 1 ]. maxhp
= 100 ;
958 monsters
[ 4 ][ 1 ]. death
= "Your witz outmatched the ogres brawn... big dumb thing." ;
960 monsters
[ 4 ][ 2 ]. name
= "Massive Cockroach" ;
961 monsters
[ 4 ][ 2 ]. weapon
= "Piercing Hiss" ;
962 monsters
[ 4 ][ 2 ]. strength
= 125 ;
963 monsters
[ 4 ][ 2 ]. gold
= 700 ;
964 monsters
[ 4 ][ 2 ]. exp
= 150 ;
965 monsters
[ 4 ][ 2 ]. maxhp
= 112 ;
966 monsters
[ 4 ][ 2 ]. death
= "Where's the exterminator when you need one?" ;
968 monsters
[ 4 ][ 3 ]. name
= "Big Venomous Snake" ;
969 monsters
[ 4 ][ 3 ]. weapon
= "Poison Fangs" ;
970 monsters
[ 4 ][ 3 ]. strength
= 140 ;
971 monsters
[ 4 ][ 3 ]. gold
= 900 ;
972 monsters
[ 4 ][ 3 ]. exp
= 175 ;
973 monsters
[ 4 ][ 3 ]. maxhp
= 126 ;
974 monsters
[ 4 ][ 3 ]. death
= "After killing this beast you check for puncture marks... you find none, luckily." ;
976 monsters
[ 4 ][ 4 ]. name
= "Lizard Man" ;
977 monsters
[ 4 ][ 4 ]. weapon
= "Deadly Jaws" ;
978 monsters
[ 4 ][ 4 ]. strength
= 145 ;
979 monsters
[ 4 ][ 4 ]. gold
= 1250 ;
980 monsters
[ 4 ][ 4 ]. exp
= 175 ;
981 monsters
[ 4 ][ 4 ]. maxhp
= 150 ;
982 monsters
[ 4 ][ 4 ]. death
= "His scales made for tough armor, and his jaws for a tougher opponent!" ;
984 monsters
[ 4 ][ 5 ]. name
= "Face Dancer" ;
985 monsters
[ 4 ][ 5 ]. weapon
= "Illusion Scyth" ;
986 monsters
[ 4 ][ 5 ]. strength
= 138 ;
987 monsters
[ 4 ][ 5 ]. gold
= 1603 ;
988 monsters
[ 4 ][ 5 ]. exp
= 198 ;
989 monsters
[ 4 ][ 5 ]. maxhp
= 173 ;
990 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!" ;
992 monsters
[ 4 ][ 6 ]. name
= "Darklord Longbow Archer" ;
993 monsters
[ 4 ][ 6 ]. weapon
= "Deadly Bow and Arrows" ;
994 monsters
[ 4 ][ 6 ]. strength
= 145 ;
995 monsters
[ 4 ][ 6 ]. gold
= 1569 ;
996 monsters
[ 4 ][ 6 ]. exp
= 243 ;
997 monsters
[ 4 ][ 6 ]. maxhp
= 170 ;
998 monsters
[ 4 ][ 6 ]. death
= "Your face turns white with horror after you realize you just met the devil's protector!" ;
1000 monsters
[ 4 ][ 7 ]. name
= "Hell's Paladin" ;
1001 monsters
[ 4 ][ 7 ]. weapon
= "Sword of Hellfire" ;
1002 monsters
[ 4 ][ 7 ]. strength
= 200 ;
1003 monsters
[ 4 ][ 7 ]. gold
= 2191 ;
1004 monsters
[ 4 ][ 7 ]. exp
= 254 ;
1005 monsters
[ 4 ][ 7 ]. maxhp
= 175 ;
1006 monsters
[ 4 ][ 7 ]. death
= "This is starting to get tough you think. Do you really want to go to level 12?" ;
1008 monsters
[ 4 ][ 8 ]. name
= "The Unknown Soldier" ;
1009 monsters
[ 4 ][ 8 ]. weapon
= "Soul Torture" ;
1010 monsters
[ 4 ][ 8 ]. strength
= 175 ;
1011 monsters
[ 4 ][ 8 ]. gold
= 1890 ;
1012 monsters
[ 4 ][ 8 ]. exp
= 200 ;
1013 monsters
[ 4 ][ 8 ]. maxhp
= 180 ;
1014 monsters
[ 4 ][ 8 ]. death
= "Who was that? Where was he from? And what was that weapon??" ;
1016 monsters
[ 4 ][ 9 ]. name
= "Undead Cult Leader" ;
1017 monsters
[ 4 ][ 9 ]. weapon
= "Lance of Deceit" ;
1018 monsters
[ 4 ][ 9 ]. strength
= 180 ;
1019 monsters
[ 4 ][ 9 ]. gold
= 1792 ;
1020 monsters
[ 4 ][ 9 ]. exp
= 195 ;
1021 monsters
[ 4 ][ 9 ]. maxhp
= 190 ;
1022 monsters
[ 4 ][ 9 ]. death
= "His words fall on deaf ears... this is one cult you will NOT be part of!" ;
1024 monsters
[ 4 ][ 10 ]. name
= "Water Serpent" ;
1025 monsters
[ 4 ][ 10 ]. weapon
= "Forked Tongue" ;
1026 monsters
[ 4 ][ 10 ]. strength
= 150 ;
1027 monsters
[ 4 ][ 10 ]. gold
= 1500 ;
1028 monsters
[ 4 ][ 10 ]. exp
= 176 ;
1029 monsters
[ 4 ][ 10 ]. maxhp
= 220 ;
1030 monsters
[ 4 ][ 10 ]. death
= "The serpent squeals as you cut off its head!" ;
1032 monsters
[ 4 ][ 11 ]. name
= "Silverback Gorilla" ;
1033 monsters
[ 4 ][ 11 ]. weapon
= "Deadly Banana Peel" ;
1034 monsters
[ 4 ][ 11 ]. strength
= 160 ;
1035 monsters
[ 4 ][ 11 ]. gold
= 1300 ;
1036 monsters
[ 4 ][ 11 ]. exp
= 150 ;
1037 monsters
[ 4 ][ 11 ]. maxhp
= 178 ;
1038 monsters
[ 4 ][ 11 ]. death
= "Was that gorilla or guerilla?" ;
1041 void display_monster ( char * u
)
1045 aClient
* user
= find ( u
);
1046 Player
* ni
= user
-> stats
;
1048 notice ( s_GameServ
, u
, "Your Hitpoints: \ 2 %d \ 2 ", ni
-> hp
);
1049 notice ( s_GameServ
, u
, " %s 's Hitpoints: \ 2 %d \ 2 ", ni
-> fight
-> name
, ni
-> fight
-> hp
);
1050 notice ( s_GameServ
, u
, "Here are your commands:" );
1051 notice ( s_GameServ
, u
, "/msg %S attack" );
1052 notice ( s_GameServ
, u
, "/msg %S run" );
1053 notice ( s_GameServ
, u
, "What will you do?" );
1057 void display_players ( char * u
)
1061 aClient
* ni
= find ( u
);
1063 aClient
* battle
= ni
-> stats
-> battle
;
1065 notice ( s_GameServ
, u
, "Your Hitpoints: \ 2 %d \ 2 ", ni
-> stats
-> hp
);
1066 notice ( s_GameServ
, u
, " %s 's Hitpoints: \ 2 %d \ 2 ", battle
-> getNick (),
1069 notice ( s_GameServ
, u
, "Here are your commands:" );
1070 notice ( s_GameServ
, u
, "/msg %s attack" , s_GameServ
);
1071 notice ( s_GameServ
, u
, "/msg %s run" , s_GameServ
);
1072 notice ( s_GameServ
, u
, "What will you do?" );
1077 bool is_playing ( char * u
)
1080 if (!( user
= find ( u
)))
1086 return user
-> stats
!= NULL
;
1090 bool is_fighting ( char * u
)
1094 if (!( user
= find ( u
)))
1098 else if ( user
-> stats
)
1100 return user
-> stats
-> fight
!= NULL
|| user
-> stats
-> battle
!= NULL
1101 || user
-> stats
-> master
!= NULL
;
1107 bool player_fight ( char * u
)
1111 if (!( user
= find ( u
)))
1113 else if ( user
-> stats
)
1114 return user
-> stats
-> battle
!= NULL
;
1119 bool master_fight ( char * u
)
1123 if (!( user
= find ( u
)))
1125 else if ( user
-> stats
)
1126 return user
-> stats
-> master
!= NULL
;
1131 bool isnt_fighting ( char * u
)
1133 return ! is_fighting ( u
);
1136 void do_fight ( char * u
)
1138 aClient
* ni
, * battle
;
1140 char * nick
= strtok ( NULL
, " " );
1144 notice ( s_GameServ
, u
, "SYNTAX: /msg %S FIGHT PLAYER" );
1146 else if (!( ni
= find ( u
)))
1150 else if (!( battle
= find ( nick
)))
1152 notice ( s_GameServ
, u
, "You can't attack %s while they aren't playing!" , nick
);
1154 else if (! is_playing ( u
))
1156 notice ( s_GameServ
, u
, "You are not playing!" );
1159 * Offline fighting not implemented yet.
1160 * else if (!(fight = finduser(nick)))
1162 * ni->stats->battle = battle;
1163 * battle->battle = ni;
1165 * battle->yourturn = 0;
1166 * notice(s_GameServ, u, "You decide to fight %s while they're not online!",
1167 * battle->getNick());
1168 * display_players(u);
1171 else if ( is_playing ( u
) && is_playing ( nick
))
1173 // Set your battle pointer to the other player
1174 ni
-> stats
-> battle
= battle
;
1176 // Set the other player's battle pointer to you
1177 battle
-> stats
-> battle
= ni
;
1179 // The initiator gets the first move (perhaps this should be 50/50)
1180 ni
-> stats
-> yourturn
= 1 ;
1181 battle
-> stats
-> yourturn
= 0 ;
1183 // Initiate Battle sequence!
1184 notice ( s_GameServ
, u
, "You challenge %s to an online duel!" , battle
-> getNick ());
1185 notice ( s_GameServ
, battle
-> getNick (), " %s has challenged you to an online duel!" , u
);
1186 notice ( s_GameServ
, battle
-> getNick (), " %s gets to go first because he initiated!" , u
);
1187 notice ( s_GameServ
, battle
-> getNick (), "Please wait while %s decides what to do." , u
);
1192 void do_attack ( char * u
)
1195 aClient
* ni
, * battle
; // The player and perhaps the player they're fighting
1196 Monster
* fight
; // The monster they may be fighting
1198 if (!( ni
= find ( u
)))
1200 notice ( s_GameServ
, u
, "You're not playing!" );
1203 else if (! ni
-> stats
-> fight
&& ! ni
-> stats
-> battle
&& ! ni
-> stats
-> master
)
1205 notice ( s_GameServ
, u
, "You're not in battle!" );
1210 if (! ni
-> stats
-> master
) // This is not a master fight
1211 fight
= ni
-> stats
-> fight
; // Monster Could be NULL
1212 else // This IS a master fight
1213 fight
= ni
-> stats
-> master
; // Master Could be NULL
1215 battle
= ni
-> stats
-> battle
; // Player Could be NULL
1217 // One has to be !NULL based on the previous else if
1218 // We wouldn't be here if they were all NULL
1221 if (! player_fight ( u
))
1224 hit
= (( ni
-> stats
-> strength
+ webonus
[ ni
-> stats
-> weapon
]) / 2 ) +
1225 ( rand () % (( ni
-> stats
-> strength
+ webonus
[ ni
-> stats
-> weapon
]) / 2 ));
1228 mhit
= ( fight
-> strength
/ 2 ) +
1229 ( rand () % ( fight
-> strength
/ 2 ) - ( ni
-> stats
-> defense
+
1230 arbonus
[ ni
-> stats
-> armor
]));
1235 mhit
= ((( battle
-> stats
-> strength
+ webonus
[ battle
-> stats
-> weapon
]) / 2 ) +
1236 ( rand () % (( battle
-> stats
-> strength
+ webonus
[ battle
-> stats
-> weapon
])) / 2 ) -
1237 ( ni
-> stats
-> defense
+ arbonus
[ ni
-> stats
-> armor
]));
1240 hit
= ((( ni
-> stats
-> strength
+ webonus
[ ni
-> stats
-> weapon
]) / 2 ) +
1241 ( rand () % (( ni
-> stats
-> strength
+ webonus
[ ni
-> stats
-> weapon
])) / 2 ) -
1242 ( battle
-> stats
-> defense
+ arbonus
[ battle
-> stats
-> armor
]));
1245 if (! player_fight ( u
))
1248 notice ( s_GameServ
, u
, "You attack \1f %s \1f for \ 2 %d \ 2 points!", fight
-> name
, hit
);
1250 notice ( s_GameServ
, u
, "You miss \1f %s \1f completely!", fight
-> name
);
1252 if ( hit
>= fight
-> hp
)
1254 if ( master_fight ( u
))
1255 notice ( s_GameServ
, u
, "You have bested %s !" , fight
-> name
);
1257 notice ( s_GameServ
, u
, "You have killed \ 2 %s \ 2 !", fight
-> name
);
1259 notice ( s_GameServ
, u
, " %s " , fight
-> death
);
1260 notice ( s_GameServ
, u
, "You recieve \ 2 %d \ 2 experience and \ 2 %d \ 2 gold!",
1261 fight
-> exp
, fight
-> gold
);
1263 // If your new experience (or gold) will be greater than 2 billion,
1264 // then set your exp to 2bil. (2 billion max)... otherwise add them.
1265 // This could be a problem with overflowing out of the sign bit.
1266 // Unsigned long int maybe? Leave it for now.
1267 ni
-> stats
-> exp
= ( ( ni
-> stats
-> exp
+ fight
-> exp
) > 2000000000 ? 2000000000 :
1268 ni
-> stats
-> exp
+ fight
-> exp
);
1269 ni
-> stats
-> gold
= ( ni
-> stats
-> gold
+ fight
-> gold
> 2000000000 ? 2000000000 :
1270 ni
-> stats
-> gold
+ fight
-> gold
);
1271 ni
-> stats
-> fight
= NULL
; // They're dead so remove the pointer
1273 if ( master_fight ( u
))
1275 notice ( s_GameServ
, u
, "You are now level %d !" , ni
-> stats
-> level
+ 1 );
1276 notice ( s_GameServ
, u
, "You gain %d Strength, and %d Defense points!" ,
1277 strbonus
[ ni
-> stats
-> level
- 1 ], defbonus
[ ni
-> stats
-> level
- 1 ]);
1279 // Increase your level
1282 // Increase your maximum hit points
1283 ni
-> stats
-> maxhp
+= hpbonus
[ ni
-> stats
-> level
- 1 ];
1285 // Heal the player by setting hp to their max
1286 ni
-> stats
-> hp
= ni
-> stats
-> maxhp
;
1288 // Add to your strength
1289 ni
-> stats
-> strength
+= strbonus
[ ni
-> stats
-> level
- 1 ];
1291 // Add to your defensive power
1292 ni
-> stats
-> defense
+= defbonus
[ ni
-> stats
-> level
- 1 ];
1294 // Clear the pointer for your master
1295 ni
-> stats
-> master
= NULL
;
1305 notice ( s_GameServ
, u
, "\1f %s \1f hits you with their \1f %s \1f for \ 2 %d \ 2 damage!",
1306 fight
-> name
, fight
-> weapon
, mhit
);
1309 notice ( s_GameServ
, u
, " %s completely misses you!" , fight
-> name
);
1311 if ( mhit
>= ni
-> stats
-> hp
)
1313 if (! master_fight ( u
))
1315 notice ( s_GameServ
, u
, "You have been \ 2 \1f killed\1f \ 2 by %s !" , fight
-> name
);
1316 notice ( s_GameServ
, u
, "You lose all gold on hand and lose 10 percent " \
1317 "of your experience!" );
1318 ni
-> stats
-> gold
= 0 ;
1319 ni
-> stats
-> exp
-= ( long int )( ni
-> stats
-> exp
* .10 );
1320 ni
-> stats
-> fight
= NULL
;
1325 notice ( s_GameServ
, u
, " %s has bested you! You will have to wait " \
1326 "until tomorrow to try again" , ni
-> stats
-> master
-> name
);
1327 ni
-> stats
-> fight
= NULL
;
1328 ni
-> stats
-> master
= NULL
;
1335 ni
-> stats
-> hp
-= mhit
;
1341 else if ( player_fight ( u
))
1343 /* Offline fighting not available yet
1344 if (!(online = finduser(ni->stats->battle->nick)) || !nick_identified(online))
1347 notice(s_GameServ, u, "You attack \1f %s\1f for \ 2 %d\ 2 points!", battle->nick, hit);
1349 notice(s_GameServ, u, "You miss \1f %s\1f completely!", battle->nick);
1350 if (hit >= battle->stats->hp)
1352 notice(s_GameServ, u, "You have killed \ 2 %s\ 2 !", battle->nick);
1353 * notice(s_GameServ, u, "You recieve \ 2 %d\ 2 experience and \ 2 %ld\ 2 gold!",
1354 (long int)(battle->stats->exp * .10), battle->stats->gold);
1355 if (2000000000 - ni->stats->exp > (long int)(battle->stats->exp * .10))
1357 ni->stats->exp += (long int)(battle->stats->exp * .10);
1358 battle->stats->exp -= (long int)(battle->stats->exp * .10);
1362 battle->stats->exp -= (long int)(battle->stats->exp * .10);
1363 ni->stats->exp = 2000000000;
1366 if (2000000000 - ni->stats->gold > battle->stats->gold)
1368 * ni->stats->gold += battle->stats->gold;
1369 battle->stats->gold = 0;
1373 battle->stats->gold = 2000000000 - ni->stats->gold;
1374 ni->stats->gold = 2000000000;
1376 * ni->stats->battle->stats->alive = 0;
1377 ni->stats->battle->battle = NULL;
1378 ni->stats->battle = NULL;
1384 * battle->stats->hp -= hit;
1387 notice(s_GameServ, u, "\1f %s\1f hits you with their \1f %s\1f for \ 2 %d\ 2 damage!",
1388 battle->nick, weapons[battle->stats->weapon], mhit);
1391 notice(s_GameServ, u, "%s completely misses you!", battle->nick);
1393 if (mhit >= ni->stats->hp)
1395 notice(s_GameServ, u, "You have been \ 2 \1f killed\1f \ 2 by %s!", battle->nick);
1396 if (2000000000 - battle->stats->gold > ni->stats->gold)
1398 notice(s_GameServ, u, "%s took all your gold!", battle->nick);
1399 battle->stats->gold += ni->stats->gold;
1400 * ni->stats->gold = 0;
1404 notice(s_GameServ, u, "You're lucky, %s couldn't carry all your gold.",
1406 ni->stats->gold -= (2000000000 - battle->stats->gold);
1407 notice(s_GameServ, u, "You were left dead with %d gold.",
1408 * (long int)ni->stats->gold);
1409 battle->stats->gold = 2000000000;
1411 ni->stats->battle->battle = NULL;
1412 ni->stats->battle = NULL;
1413 ni->stats->alive = 0;
1419 ni->stats->hp -= mhit;
1425 * end offline fighting */
1427 if ( is_playing ( battle
-> getNick ()))
1429 if ( ni
-> stats
-> yourturn
== 0 )
1431 notice ( s_GameServ
, u
, "Please wait until %s decides what to do!" ,
1437 notice ( s_GameServ
, u
, "You attack \1f %s \1f for \ 2 %d \ 2 points!", battle
-> getNick (), hit
);
1439 notice ( s_GameServ
, battle
-> getNick (), " %s has hit you with their %s for " \
1440 "\ 2 %d \ 2 damage!", u
, weapons
[ ni
-> stats
-> weapon
],
1442 ni
-> stats
-> yourturn
= 0 ;
1443 battle
-> stats
-> yourturn
= 1 ;
1444 display_players ( battle
-> getNick ());
1448 notice ( s_GameServ
, u
, "You miss \1f %s \1f completely!", battle
-> getNick ());
1449 notice ( s_GameServ
, battle
-> getNick (), " %s misses you completely!" , u
);
1450 ni
-> stats
-> yourturn
= 0 ;
1451 battle
-> stats
-> yourturn
= 1 ;
1452 display_players ( battle
-> getNick ());
1454 if ( hit
>= battle
-> stats
-> hp
)
1456 notice ( s_GameServ
, u
, "You have killed \ 2 %s \ 2 !", battle
-> getNick ());
1457 notice ( s_GameServ
, u
, "You recieve \ 2 %d \ 2 experience and \ 2 %l d\ 2 gold!" ,
1458 ( long int )( battle
-> stats
-> exp
* .10 ), battle
-> stats
-> gold
);
1459 notice ( s_GameServ
, battle
-> getNick (), "You have been killed by \ 2 %s \ 2 !", u
);
1460 battle
-> stats
-> hp
= 0 ;
1461 battle
-> stats
-> alive
= 0 ;
1463 if ( 2000000000 - ni
-> stats
-> exp
> ( long int )( battle
-> stats
-> exp
* .10 ))
1465 ni
-> stats
-> exp
+= ( long int )( battle
-> stats
-> exp
* .10 );
1466 battle
-> stats
-> exp
-= ( long int )( battle
-> stats
-> exp
* .10 );
1470 battle
-> stats
-> exp
-= ( long int )( battle
-> stats
-> exp
* .10 );
1471 ni
-> stats
-> exp
= 2000000000 ;
1474 if ( 2000000000 - ni
-> stats
-> gold
> battle
-> stats
-> gold
)
1476 notice ( s_GameServ
, battle
-> getNick (), "You lose ten percent of experience and " \
1477 "all gold on hand!" );
1478 ni
-> stats
-> gold
+= battle
-> stats
-> gold
;
1479 battle
-> stats
-> gold
= 0 ;
1483 battle
-> stats
-> gold
= 2000000000 - ni
-> stats
-> gold
;
1484 notice ( s_GameServ
, battle
-> getNick (), "You lose ten percent of your experience!" );
1486 notice ( s_GameServ
, battle
-> getNick (), "However, %s could not carry all of your " \
1489 notice ( s_GameServ
, battle
-> getNick (), "Luckily, you still have \ 2 %l d\ 2 gold " \
1490 "left. All is not lost!" , battle
-> stats
-> gold
);
1492 ni
-> stats
-> gold
= 2000000000 ;
1494 battle
-> stats
-> battle
= NULL
;
1495 ni
-> stats
-> battle
= NULL
;
1501 battle
-> stats
-> hp
-= hit
;
1502 //display_players(battle->getNick());
1503 ni
-> stats
-> yourturn
= 0 ;
1504 battle
-> stats
-> yourturn
= 1 ;
1505 notice ( s_GameServ
, u
, "Please wait while %s decides what to do!" ,
1513 void do_heal ( char * u
)
1516 char * amount
= strtok ( NULL
, " " );
1521 notice ( s_GameServ
, u
, "SYNTAX: /msg %S HEAL {ALL | #}" );
1523 else if (!( ni
= find ( u
)) || ! ni
-> stats
)
1525 notice ( s_GameServ
, u
, "You aren't playing!" );
1527 else if ( is_fighting ( u
))
1529 notice ( s_GameServ
, u
, "You can't heal in battle!" );
1531 else if ( ni
-> stats
-> hp
>= ni
-> stats
-> maxhp
)
1533 notice ( s_GameServ
, u
, "You don't need healing!" );
1535 else if ( stricmp ( amount
, "ALL" ) == 0 )
1537 price
= ni
-> stats
-> level
* 3 ;
1538 if ( ni
-> stats
-> gold
< ( ni
-> stats
-> maxhp
- ni
-> stats
-> hp
) * price
)
1540 notice ( s_GameServ
, u
, "Healing \ 2 %d \ 2 points for \ 2 %d \ 2 gold per point.",
1541 ( long int ) ni
-> stats
-> gold
/ price
, price
);
1542 ni
-> stats
-> hp
+= ni
-> stats
-> gold
/ price
;
1543 ni
-> stats
-> gold
%= price
;
1547 notice ( s_GameServ
, u
, "Healing all possible points at \ 2 %d \ 2 gold "\
1548 "per point." , price
);
1549 notice ( s_GameServ
, u
, "\ 2 %d \ 2 points healed for \ 2 %l d\ 2 gold. HP at MAX!" ,
1550 ( ni
-> stats
-> maxhp
- ni
-> stats
-> hp
),
1551 ( price
* ( ni
-> stats
-> maxhp
- ni
-> stats
-> hp
)) );
1552 ni
-> stats
-> gold
-= price
* ( ni
-> stats
-> maxhp
- ni
-> stats
-> hp
);
1553 ni
-> stats
-> hp
= ni
-> stats
-> maxhp
;
1556 else if ( isstringnum ( amount
))
1558 num
= stringtoint ( amount
);
1559 price
= ni
-> stats
-> level
* 3 ;
1560 if ( ni
-> stats
-> gold
< price
* num
)
1562 notice ( s_GameServ
, u
, "You only have enough gold to heal \ 2 %d \ 2 points!",
1563 ( long int ) ni
-> stats
-> gold
/ price
);
1565 else if ( num
<= ni
-> stats
-> maxhp
- ni
-> stats
-> hp
)
1567 notice ( s_GameServ
, u
, "Healing \ 2 %d \ 2 points at \ 2 %d \ 2 gold per point.",
1569 ni
-> stats
-> hp
+= num
;
1570 ni
-> stats
-> gold
-= num
* price
;
1572 else if ( num
> ni
-> stats
-> maxhp
- ni
-> stats
-> hp
)
1574 notice ( s_GameServ
, u
, "Healing all possible points at \ 2 %d \ 2 gold "\
1575 "per point." , price
);
1576 notice ( s_GameServ
, u
, "\ 2 %d \ 2 points healed. HP at MAX!",
1577 ( ni
-> stats
-> maxhp
- ni
-> stats
-> hp
));
1578 ni
-> stats
-> gold
-= price
* ( ni
-> stats
-> maxhp
- ni
-> stats
-> hp
);
1579 ni
-> stats
-> hp
= ni
-> stats
-> maxhp
;
1582 else if ( amount
[ 0 ] == '-' )
1583 notice ( s_GameServ
, u
, "You trying to cheat?" );
1585 notice ( s_GameServ
, u
, "SYNTAX: /msg %S HEAL {ALL | #}" );
1588 int isstringnum ( char * num
)
1591 for ( x
= 0 ; x
< strlen ( num
); x
++)
1593 if (( int ) num
[ x
] < 48 || ( int ) num
[ x
] > 57 )
1599 long int stringtoint ( char * number
)
1601 long int x
, len
= strlen ( number
), sum
= 0 ;
1603 return chartoint ( number
[ 0 ]);
1604 sum
+= chartoint ( number
[ len
- 1 ]);
1605 for ( x
= len
- 2 ; x
>= 0 ; x
--)
1607 sum
+= chartoint ( number
[ x
]) * pow ( 10 , abs ( x
- len
+ 1 ));
1612 long int pow ( int x
, int y
)
1618 if ( x
!= 0 && y
!= 0 )
1620 for ( count
= 1 ; count
<= y
- 1 ; count
++)
1628 long int chartoint ( char ch
)
1663 ListNode
< aClient
> * ptr
= players
. First ();
1667 outfile
. open ( playerdata
);
1671 cerr
<< "Error opening " << playerdata
<< endl
;
1677 it
= ptr
-> getData ()-> stats
;
1678 outfile
<< it
-> name
<< ' ' << it
-> level
<< ' ' << it
-> exp
<< ' ' << it
-> gold
<< ' ' << it
-> bank
<< ' '
1679 << it
-> hp
<< ' ' << it
-> maxhp
<< ' ' << it
-> strength
<< ' ' << it
-> defense
<< ' '
1680 << it
-> armor
<< ' ' << it
-> weapon
<< ' ' << ( it
-> alive
? "alive" : "dead" ) << ' '
1681 << it
-> forest_fights
<< ' ' << it
-> player_fights
<< ' '
1682 << it
-> password
<< endl
;
1693 char * alive
, * tempname
, * buf
, * password
;
1694 buf
= new char [ 1023 ];
1696 infile
. open ( playerdata
);
1700 cerr
<< "Error opening " << playerdata
<< endl
;
1704 while ( infile
. getline ( buf
, 1024 , ' \n ' ))
1706 cout
<< "temp = new aClient;" << endl
<< flush
;
1708 cout
<< "tempname = strtok(buf, " ");" << endl
<< flush
;
1709 tempname
= strtok ( buf
, " " );
1711 cout
<< "temp->stats = new Player(tempname);" << endl
<< flush
;
1713 temp
-> stats
= new Player ( tempname
);
1715 cout
<< "p = temp->stats;" << endl
<< flush
;
1718 //Kain 1 1 0 500 10 10 0 0 1 1 alive 100 3
1719 p
-> level
= stringtoint ( strtok ( NULL
, " " ));
1720 p
-> exp
= stringtoint ( strtok ( NULL
, " " ));
1721 p
-> gold
= stringtoint ( strtok ( NULL
, " " ));
1722 p
-> bank
= stringtoint ( strtok ( NULL
, " " ));
1723 p
-> hp
= stringtoint ( strtok ( NULL
, " " ));
1724 p
-> maxhp
= stringtoint ( strtok ( NULL
, " " ));
1725 p
-> strength
= stringtoint ( strtok ( NULL
, " " ));
1726 p
-> defense
= stringtoint ( strtok ( NULL
, " " ));
1727 p
-> armor
= stringtoint ( strtok ( NULL
, " " ));
1728 p
-> weapon
= stringtoint ( strtok ( NULL
, " " ));
1729 alive
= strtok ( NULL
, " " );
1730 p
-> alive
= ( stricmp ( alive
, "ALIVE" ) == 0 ? true : false );
1731 p
-> forest_fights
= stringtoint ( strtok ( NULL
, " " ));
1732 p
-> player_fights
= stringtoint ( strtok ( NULL
, " " ));
1733 password
= strtok ( NULL
, " " );
1734 strcpy ( p
-> password
, password
);
1735 temp
-> setNick ( "NULL" );
1737 printf ( " %s %d %l d %l d %l d %d %d %d %d %d %d %s %d %d %s \n " , p
-> name
, p
-> level
,
1738 p
-> exp
, p
-> gold
, p
-> bank
, p
-> hp
, p
-> maxhp
, p
-> strength
, p
-> defense
, p
-> armor
, p
-> weapon
,
1739 alive
, p
-> forest_fights
, p
-> player_fights
, p
-> password
);
1741 cout
<< "Inserting " << temp
-> stats
-> name
<< " at back of list" << endl
;
1742 players
. insertAtBack ( temp
);
1743 cout
<< temp
-> stats
-> name
<< " Inserted, now deleting" << endl
;
1745 cout
<< "Deleted" << endl
;
1750 bool passcmp ( char * encrypted
, char * plaintext
)
1753 char * plaintext2
, * plainToencrypt
;
1756 plaintext2
= new char [ strlen ( encrypted
) + strlen ( plaintext
)]; // Extra
1757 strcpy ( plaintext2
, plaintext
);
1759 salt
[ 0 ] = encrypted
[ 0 ];
1760 salt
[ 1 ] = encrypted
[ 1 ];
1763 plainToencrypt
= crypt ( plaintext2
, salt
);
1765 same
= ( strcmp (( const char *) encrypted
, plainToencrypt
) == 0 ? true : false );
1767 delete [] plaintext2
;
1772 bool check_password ( char * name
, char * plaintext
)
1776 if (!( client
= findplayer ( name
)))
1780 return passcmp ( client
-> stats
-> password
, plaintext
);
1784 void do_store ( char * u
)
1786 char * cmd
= strtok ( NULL
, " " );
1787 char * item
= strtok ( NULL
, " " );
1788 char * num
= strtok ( NULL
, " " );
1793 notice ( s_GameServ
, u
, "SYNTAX: STORE LIST {ARMOR | WEAPONS}" );
1794 notice ( s_GameServ
, u
, " \ 2 STORE SELL {ARMOR | WEAPON}\ 2 " );
1795 notice ( s_GameServ
, u
, " \ 2 STORE BUY {ARMOR | WEAPON} \1f NUMBER\1f \ 2 " );
1797 else if ( stricmp ( cmd
, "LIST" ) == 0 )
1799 if ( stricmp ( item
, "WEAPONS" ) == 0 )
1801 notice ( s_GameServ
, u
, "Welcome to Kain's Armory" );
1802 notice ( s_GameServ
, u
, "Here are the weapons we have available for the killing, sire:" );
1803 for ( int x
= 1 ; x
< WNA
; x
++)
1805 space
= spaces ( strlen ( weapons
[ x
]), "." );
1806 notice ( s_GameServ
, u
, " %s%d . %s%s%d " ,( x
< 10 ? " " : "" ), x
, weapons
[ x
], space
, prices
[ x
- 1 ]);
1809 notice ( s_GameServ
, u
, "To purchase a weapon, type /msg %S STORE BUY \ 2 NUM\ 2 ." );
1810 notice ( s_GameServ
, u
, "Where num. is the weapon number from the menu above." );
1813 else if ( stricmp ( item
, "ARMOR" ) == 0 )
1815 notice ( s_GameServ
, u
, "Welcome to Kain's Armory" );
1816 notice ( s_GameServ
, u
, "I hope you enjoy the fine armor we have available for your protection:" );
1817 for ( int x
= 1 ; x
< WNA
; x
++)
1819 space
= spaces ( strlen ( armors
[ x
]), "." );
1820 notice ( s_GameServ
, u
, " %s%d . %s%s%d " ,( x
< 10 ? " " : "" ), x
, armors
[ x
], space
, prices
[ x
- 1 ]);
1823 notice ( s_GameServ
, u
, "To purchase armor, type /msg %S store buy armor num." );
1824 notice ( s_GameServ
, u
, "Where num. is the armor number from the menu above." );
1828 } else if ( stricmp ( cmd
, "BUY" ) == 0 ) {