home *** CD-ROM | disk | FTP | other *** search
/ 1,000 Games (Collectors Edition) - Disc 2 / 1000GamesDisc2.iso / solution / editors / lore / lol_lamp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-17  |  2.8 KB  |  91 lines

  1. /*
  2.     LANDS OF LORE OIL DELIVERY SERVICE
  3.     ----------------------------------
  4.  
  5.     Are you still stumbling around in those mines
  6.     pushing buttons and turning cranks and jumping
  7.     down pits and leaving rocks on plates?  If so,
  8.     you are probably running out of oil.
  9.  
  10.     This little whizbang fills up your lamp, the
  11.     only cheat really needed in this great game.
  12.  
  13.     Now let's get a few prerequisites out of the
  14.     way first:
  15.  
  16.     Number 1:  You've got to have a lamp.  If you don't
  17.                have one yet, then don't use the program.
  18.     Number 2:  I developed this program with the
  19.                English Screen English Box version of LOL.
  20.                If you are using another language, be
  21.                careful.
  22.  
  23.     To use this program, please follow the
  24.     steps below:
  25.  
  26.     1.  Make backups of your saved games.  LOL
  27.         saved games are _save001.dat, _save002.dat,
  28.         and so on.
  29.  
  30.     2.  Move lol_lamp.exe into the same directory
  31.         where your saved games are.
  32.  
  33.     3.  Figure out which game needs to be fixed.
  34.         If you are not sure, you can enter, for
  35.         example, type _save008.dat, and see
  36.         your description for that game.  We'll
  37.         assume that you want to change
  38.         _save008.dat.
  39.  
  40.     4.  Then enter LOL_LAMP _save008.dat.
  41.         That's all.
  42.  
  43. HACKER'S NOTES
  44. --------------
  45.     1.  The party gold is two words further down from the oil.
  46.     2.  The party knapsack goes from 607 to 701 as words,
  47.         but beware that the interpretation of these bytes
  48.         is game-phase dependent (i.e., a 0x4F is a flask
  49.         only in certain places.  Dwarven Boots, however,
  50.         0xA1 is globally stable).  Dropping more than
  51.         32 items in a room locks the machine.
  52.    3.   The word immediately before the character's name
  53.         contains his status (1 = ok, 9 = dead, etc).
  54. */
  55. #include  <stdio.h>
  56. #include     <io.h>
  57. #include  <fcntl.h>
  58. #include <stdlib.h>
  59. #include <string.h>
  60. #include  <ctype.h>
  61. #include  <conio.h>
  62. #define LAMP_LIGHT  1110
  63. char light;
  64. int h;
  65. int r;
  66. int main( int argc, char *argv[] )
  67. {// What?  You want dox?
  68.     if( argc ) {
  69.         h = open( argv[ 1 ], O_RDWR | O_BINARY );
  70.         if( h > 1 ) {
  71.             lseek( h, LAMP_LIGHT, SEEK_SET );
  72.             r = read( h, &light, 1 );
  73.             if( r == 1 ) {
  74.                 light = 0x93;
  75.                 printf( "Lantern boosted\n" );
  76.                 lseek( h, LAMP_LIGHT, SEEK_SET );
  77.                 write( h, &light, 1 );
  78.             } else {
  79.                 printf( "Something untoward has taken place\n" );
  80.             }
  81.             close( h );
  82.         } else {
  83.             printf( "Cannot locate file!\n" );
  84.         }
  85.     } else {
  86.         printf( "You have to tell me which file!\n" );
  87.     }
  88.     return( 0 );
  89. }
  90.  
  91.