home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************/
- /* Goodies Generator for Eye of the Beholder */
- /* ***************************************** */
- /* */
- /* Garry J. Vass
- Frankfurt, Germany
-
- Notes:
- This program fills the packs of EOB characters with
- those "hard to find" items, great weapons and armor,
- potions, scrolls, and so forth.
-
- The source code is given for two reasons: first to
- examine to assure that it is virus free; second to
- assure that it is used as intended - see my note
- below...
-
- Use it at your own risk. I have no liability for
- any outcome, even to the extent that the program
- does what it says.
-
- A further caution. The immediate temptation is to
- run this program several times, check out your
- goodies in EOB, and then drop the things you don't
- need on the dungeon floor. Sooner or later, you'll
- build up a pile of discarded items so large that
- EOB will crash. A better ploy is to move to different
- levels and drop things discretely.
-
- Another note. Since you now have an unlimited supply
- of scrolls and potions, they can be used as "pathway
- markers" when exploring new dungeon areas! For some
- reason, however, these discarded items are not retained
- between game sessions.
-
- I found the program to compile clean under Borland
- and Zortech. If you want to use it, but do not
- have a compiler, simply request a friend or
- colleague to provide you with an executable
- version.
-
- Last note. There is nothing magic about the tables
- below. There are many more scrolls, for example,
- than those given in the table. Items start at
- 1 and continue through 445. Feel free to experiment
- around!
-
- ***************************************************************/
- int Scrolls[] = {
- 213,214,218,220,222,223,234,241,251,252,253,
- 258,261,264,267,271,278,281,283,288,289,290,
- 300,307,308,245, -1 };
- int Armor[] = {
- 273,171,209,304,294,232,43,
- 296,292,293,44,297,269,266, -1 };
- int Weapons[] = {
- 349,329,346,45,336,380,442,443,49,274,208,
- 262,231,257,67,215,38,291,177,255,256,295, -1 };
- int Wands[] = {
- 272,309,299,306,210,210,21,32, -1 };
- int Heavy_magic[] = {
- 332,326,333,319,317,318,316,322,320,390,407, -1 };
- int Keys[] = {
- 313,260,82,324,337,80,303,376,400, -1 };
- int Potions_food[] = {
- 386,387,379,392,315,372,430,398,397,396,
- 406,403,421,404, -1 };
- int Pot_luck[ 20 ];
- #include <stdio.h>
- #include <io.h>
- #include <fcntl.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- #include <conio.h>
- int Stuff[ 4 ] = { 123, 366, 609, 852 };
- int Packs[ 14 ];
- char Buf[ 1000 ];
- int *Ibuf;
- int getopts( void )
- {
- int s;
- int i;
- char ch;
- printf( "Selections available...\n" );
- printf( "A. Scrolls\n" );
- printf( "B. Weapons\n" );
- printf( "C. Armor\n" );
- printf( "D. Potions/food\n" );
- printf( "E. Keys\n" );
- printf( "F. Wands\n" );
- printf( "G. Desparato\n" );
- printf( "H. Grab bag\n" );
- printf( "Your choice... -> " );
- ch = toupper( getch() );
- printf( "\n\n" );
- switch( ch ) {
- case 'A':
- Ibuf = Scrolls;
- break;
- case 'B':
- Ibuf = Weapons;
- break;
- case 'C':
- Ibuf = Armor;
- break;
- case 'D':
- Ibuf = Potions_food;
- break;
- case 'E':
- Ibuf = Keys;
- break;
- case 'F':
- Ibuf = Wands;
- break;
- case 'G':
- Ibuf = Heavy_magic;
- break;
- case 'H':
- Ibuf = Pot_luck;
- s = random( 255 );
- for( i = 0; i < 20; i++ ) {
- Pot_luck[ i ] = s++;
- }
- Pot_luck[ 19 ] = -1;
- break;
- default:
- printf( "Try again later\n" );
- exit( 0 );
- }
- return( ch );
- }
- int Total = 0;
- int main( int argc, char *argv[] )
- {
- int i;
- int h;
- int a;
- int p = 0;
- if( argc ) {
- strcpy( Buf, argv[ 1 ] );
- strupr( Buf );
- h = open( "eobdata.sav", O_RDWR | O_BINARY );
- if( h > 1 ) {
- int r = read( h, Buf, 980 ); // 4 characters
- if( r == 980 ) {
- getopts();
- for( i = 0; i < 4; i++ ) {
- memmove( Packs, Buf + Stuff[ i ], sizeof( int ) * 14 );
- for( a = 0; a < 14; a++ ) {
- if( Packs[ a ] == 0 ) {
- Packs[ a ] = Ibuf[ p ];
- ++Total;
- }
- ++p;
- if( Ibuf[ p ] < 0 ) {
- p = 0;
- }
- }
- memmove( Buf + Stuff[ i ], Packs, sizeof( int ) * 14 );
- }
- lseek( h, 0, SEEK_SET );
- write( h, Buf, r );
-
- } else {
- printf( "Cannot locate characters\n" );
- }
- close( h );
- printf( "%d items delivered\n", Total );
- } else {
- printf( "Cannot locate file!\n" );
- }
- } else {
- printf( "No starting point defined\n" );
- }
- return( 0 );
-
- }
-
-