install.txt
./Class_Snippet/install.txt · 2.4 KB
From the archive class-remove.tar.gz
Download the archive « Back to the archive contents
Follow the steps in order and all should be well.
1) Add the do_save_class function at the bottom of this file to the end of
save.c.
2) Add the following line to interp.h
DECLARE_DO_FUN( do_save_class );
3) Add the following line to interp.c under the Miscellaneous Commands
{ "saveclass", do_save_class, POS_DEAD, ML, LOG_ALWAYS, 0 },
4) Create the /data/class/ directory in your Rom24 directory.
5) Recompile your code, run the mud.
6) Log into the mud and type "saveclass" (no quotes). Shutdown the MUD.
7) I recommend deleting the do_save_class function and the corresponding two
lines in interp.h and interp.c, but you don't have to.
8) Open snippet.c and proceed through it making all the changes.
9) Do a clean recompile of your MUD.
10) Start it up!
do_save_classes function follows
*******************************************************************************
void do_save_class( CHAR_DATA *ch, char *argument )
{
FILE *fp;
char buf[MAX_STRING_LENGTH];
int i,sn;
for( i = 0; i < MAX_CLASS; i++ )
{
sprintf( buf, "../data/class/%s.class", class_table[i].name );
fp = fopen( buf, "w" );
fprintf( fp, "#CLASS\n" );
fprintf( fp, "Name %s~\n", class_table[i].name );
fprintf( fp, "WhoN %s\n", class_table[i].who_name );
fprintf( fp, "Prime %d\n", class_table[i].attr_prime );
fprintf( fp, "Weapon %d\n", class_table[i].weapon );
fprintf( fp, "Guild1 %d\n", class_table[i].guild[0] );
fprintf( fp, "Guild2 %d\n", class_table[i].guild[1] );
fprintf( fp, "Skill %d\n", class_table[i].skill_adept );
fprintf( fp, "Thac00 %d\n", class_table[i].thac0_00 );
fprintf( fp, "Thac32 %d\n", class_table[i].thac0_32 );
fprintf( fp, "HPMin %d\n", class_table[i].hp_min );
fprintf( fp, "HPMax %d\n", class_table[i].hp_max );
fprintf( fp, "FMana %d\n", class_table[i].fMana );
fprintf( fp, "Base %s~\n", class_table[i].base_group );
fprintf( fp, "Default %s~\n", class_table[i].default_group );
fprintf( fp, "End\n" );
fprintf( fp, "#SKILLS\n" );
for( sn = 0; sn < MAX_SKILL; sn++ )
{
if ( skill_table[sn].name == NULL )
break;
if ( skill_table[sn].skill_level[i] < LEVEL_IMMORTAL )
{
fprintf( fp, "%s~\n%d %d\n", skill_table[sn].name, skill_table[sn].skill_level[i],
skill_table[sn].rating[i] );
}
}
fprintf( fp, "End~\n" );
fprintf( fp, "#END\n" );
fclose( fp );
}
send_to_char( "Ok.\n\r", ch );
} /* save_classes */