Installation for Merc --------------------- 1. In your Makefile, below the main list of L_FLAGS, include the following: #IMC2 - Comment out to disable IMC2 support IMC = 1 Then directly below the list of O_FILES, add the following: [Note: BSD users - put a period in front of the word ifdef, and in front of the word endif] ifdef IMC O_FILES := imc.o $(O_FILES) C_FLAGS := $(C_FLAGS) -DIMC -DIMCMERC endif 2. Open merc.h and locate the following code: #define PULSE_PER_SECOND 4 #define PULSE_VIOLENCE ( 3 * PULSE_PER_SECOND) #define PULSE_MOBILE ( 4 * PULSE_PER_SECOND) #define PULSE_TICK (30 * PULSE_PER_SECOND) #define PULSE_AREA (60 * PULSE_PER_SECOND) Directly below that, add the following: #ifdef IMC #include "imc.h" #endif Locate your pc_data struct Add the following to the end of it: #ifdef IMC IMC_CHARDATA *imcchardata; #endif 3. Open interp.c and locate the following section: if ( !check_social( ch, command, argument ) Add the following condition to whatever series of ifchecks exist there: #ifdef IMC && !imc_command_hook( ch, command, argument ) #endif 4. Open comm.c and locate the following in main() : #if defined(unix) control = init_socket( port ); boot_db( ); sprintf( log_buf, "Merc is ready to rock on port %d.", port ); log_string( log_buf ); Add the following beneath that: #ifdef IMC imc_startup( FALSE ); // FALSE arg, so the autoconnect setting can govern it. #endif Then further down in main(), locate the following: while ( descriptor_list ) close_socket( descriptor_list ); Add the following beneath that: #ifdef IMC imc_shutdown( FALSE ); #endif Then in game_loop(), locate the following: /* * Autonomous game motion. */ update_handler( ); Directly ABOVE that, add the following: #ifdef IMC imc_loop(); #endif 5. Open save.c and locate fread_char: Find: case 'L': KEY( "Level", ch->level, fread_number( fp ) ); KEY( "LongDescr", ch->long_descr, fread_string( fp ) ); break; *ABOVE* that, add: case 'I': #ifdef IMC if( ( fMatch = imc_loadchar( ch, fp, word ) ) ) break; #endif break; Then in fwrite_char, locate: fprintf( fp, "End\n\n" ); Directly ABOVE that, add: #ifdef IMC imc_savechar( ch, fp ); #endif Then in load_char_obj(), locate the following: found = FALSE; fclose( fpReserve ); /* parsed player file directories by Yaz of 4th Realm */ /* decompress if .gz file exists - Thx Alander */ Directly ABOVE that, add the following: #ifdef IMC imc_initchar( ch ); #endif 6. Open db.c Locate free_char: Under the following block of code: free_string( ch->pcdata->pwd ); free_string( ch->pcdata->bamfin ); free_string( ch->pcdata->bamfout ); free_string( ch->pcdata->title ); Add: #ifdef IMC imc_freechardata( ch ); #endif 7. For users of copyover/hotboot ONLY: Locate do_copyover, and just before the buffers for the execl call are allocated, add the following: #ifdef IMC imc_shutdown( FALSE ); #endif 7b. Envy 2.2 ONLY: Go back to save.c, and locate the following in fread_char: else { sprintf( buf, "fread_char: Unknown key '%s' in pfile.", word ); bug( buf, 0 ); fread_to_eol( fp ); } Directly ABOVE that, add: #ifdef IMC else if( imc_loadchar( ch, fp, word ) ) ; #endif 7c. NiMud 4 ONLY: For the db.c section, apply the changes to free_char in mem.c In imc.c, under the #ifdef IMCMERC section near the top, change: #include "merc.h" To: #include "mud.h" 7d. EOS2 ONLY: In imc.c, function imclog, find: log_string( buf ); Replace with: log_string( buf, CHANNEL_LOG, -1 ); Return to the main IMC.txt file and continue where you left off.