-----------------------------------------------------------------
SMAUG Remort 1.2 By Xerves (Released December 28, 2002)
Xerves is the admin/owner of Rafermand (mud.rafermand.net: 3002)
Website: http://www.rafermand.net
Contact: xerves@rafermand.net
----------------------------------------------------------------
The following is the install instructions for those who are new
to this code.  If you are looking for an upgrade to 1.1 to 1.2, try
the 1_1_1_2.txt file for that.  Remort, if you don't already know, allows
you to pick a new class (or race) when you reach avatar.  These classes
are better and more powerful than the classes you already have, and
you start out fresh, at level 2 with no gold, equipment, or skills.

New in 1.2
---------------
Remort is now done online, using the remort command.  You do not need
to log off anymore and pick a new class or race.

By changing a value in mud.h, you can remove the ability to use remort
races and by doing so, you cannot remort into a new race (makes sense
for most people, but it is left on by default)

Added the tier values for the races/classes into setrace/setclass so
you can modify them online (I still recommend doing it offline because
doing the skills/spells is much easier, and a test class is provided
as an example)

Most of the actual remort code is now in remort.c and allows for easier
additions once you understand the code.

Easier installation since you have to make less changes in comm.c.
---------------


----------------
COMM.C
----------------
There are only __6__ change here now, this was the most confusing for people, hope
this helps now...


In the function nanny, in the case value CON_GET_NEW_SEX, find the following

        /*
	 * Take this out SHADDAI
	 */
	for ( iClass = 0; iClass < MAX_PC_CLASS-2; iClass++ )
	{
	    if ( class_table[iClass]->who_name &&
	    	 class_table[iClass]->who_name[0] != '\0')
	
Change it to (NOTE:  There is a bug with the -2, it is removed)

        /*
	 * Take this out SHADDAI
	 */
	for ( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
	{
	    if ( class_table[iClass]->who_name &&
	    	 class_table[iClass]->who_name[0] != '\0' && !class_table[iClass]->remort_class)



In the new case down, CON_GET_NEW_CLASS, find the following

        if (!str_cmp(arg, "help"))
        {
        
	for ( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
	{
	  if ( class_table[iClass]->who_name &&
	       class_table[iClass]->who_name[0] != '\0')
	       
Change it to.

        if (!str_cmp(arg, "help"))
        {
        
	for ( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
	{
	  if ( class_table[iClass]->who_name &&
	       class_table[iClass]->who_name[0] != '\0' && !class_table[iClass]->remort_class)
	       
	       
	       
A few lines down, find the following

	write_to_buffer( d, "No such help topic.  Please choose a class: ", 0 );
	return;
	}

	for ( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
	{
	  if ( class_table[iClass]->who_name &&
	       class_table[iClass]->who_name[0] != '\0')
	       
Change it to the following

	write_to_buffer( d, "No such help topic.  Please choose a class: ", 0 );
	return;
	}

	for ( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
	{
	  if ( class_table[iClass]->who_name &&
	       class_table[iClass]->who_name[0] != '\0' && !class_table[iClass]->remort_class)
	       
	       
	       
Find the following a few lines down

	write_to_buffer( d, "\n\rYou may choose from the following races, or type help [race] to learn more:\n\r[", 0 );
	buf[0] = '\0';
	for ( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
	{
	  if (iRace != RACE_VAMPIRE
	  
Change it to the following

	write_to_buffer( d, "\n\rYou may choose from the following races, or type help [race] to learn more:\n\r[", 0 );
	buf[0] = '\0';
	for ( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
	{
	  if (iRace != RACE_VAMPIRE && !race_table[iRace]->remort_race	      
	  
	  
	  
In the following case, CON_GET_NEW_RACE, find the following

        if (!str_cmp( arg, "help") )
        {
          for ( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
	  {
	    if ( toupper(argument[0]) == toupper(race_table[iRace]->race_name[0])
	    
Change it to the following

        if (!str_cmp( arg, "help") )
        {
          for ( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
	  {
	    if ( toupper(argument[0]) == toupper(race_table[iRace]->race_name[0]) && !race_table[iRace]->remort_race 	    
	    
	    
	    
Find the following

   	  write_to_buffer( d, "No help on that topic.  Please choose a race: ", 0 );
	  return;
	}
	

	for ( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
	{
	    if ( toupper(arg[0]) == toupper(race_table[iRace]->race_name[0])
	    
Change it to the following

   	  write_to_buffer( d, "No help on that topic.  Please choose a race: ", 0 );
	  return;
	}
	

	for ( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
	{
	    if ( toupper(arg[0]) == toupper(race_table[iRace]->race_name[0]) && !race_table[iRace]->remort_race	   
	    
----------------
MUD.H
----------------	     	    
Find the following

#define MAX_LEVEL		   65
#define MAX_CLAN		   50
#define MAX_DEITY		   50

Before that, add this

#define REMORT_NO_RACE             0 //False

**NOTE** Change this value to 1 if you don't want them picking a race during remort


Find the following

DECLARE_DO_FUN(	do_remove	);

Before it add this

DECLARE_DO_FUN(	do_remor	);
DECLARE_DO_FUN(	do_remort	);


Find the following in class_type

    sh_int	exp_base;		/* Class base exp		*/
    
After it - before the ); - add the following

    sh_int      remort_class;
    
    
Find the following in race_type

    sh_int      race_recall;
    
After it - again before the ); - add the following

    sh_int      remort_race;
    
    
Find the following in pc_data    
    
    int			mdeaths;	/* Number of deaths due to mobs       */
    
After it add the following

    sh_int             tier;
    
    
    
---------------
SAVE.C
---------------

Find the following in fwrite_char

    fprintf( fp, "Armor        %d\n",	ch->armor		);
    
After it add the following

    fprintf( fp, "Tier         %d\n",   ch->pcdata->tier        );
    

Find the following in load_char_obj

    ch->saving_breath			= 0;
    
After it add the following

    ch->pcdata->tier                    = 1;


Find the following in fread_char

            KEY( "Trust", ch->trust, fread_number( fp ) );
            
After it add the following

	    KEY( "Tier", ch->pcdata->tier, fread_number ( fp ));
	    
	    
---------------
TABLES.C
---------------

Find the following

    if ( !str_cmp( name, "do_remove" ))		return do_remove;
    
Before it add

    if ( !str_cmp( name, "do_remor" ))		return do_remor;
    if ( !str_cmp( name, "do_remort" ))		return do_remort;	    
    

Find the following

    if ( skill == do_remove )		return "do_remove";
    
Before it add
 
    if ( skill == do_remor )		return "do_remor";
    if ( skill == do_remort )		return "do_remort";
    
    
Find the following in load_class_file

	    KEY( "Resist",	class->resist,		fread_number( fp ) );
	    
After it add the following

            KEY( "RemortClass", class->remort_class, fread_number(fp));
            
            
Find the following in write_class_file

    fprintf( fpout, "Suscept	 %d\n",		class->suscept		);
    
After it add the following

    fprintf( fpout, "RemortClass %d\n",         class->remort_class);            	    
    
    
Find the following in write_race_file

    fprintf( fpout, "Race_Recall %d\n",		race->race_recall	);

AFter it add the following

    fprintf( fpout, "RemortRace  %d\n",         race->remort_race       );
    
    
Find the following in load_race_file

            KEY( "Race_Recall",	race->race_recall, fread_number(fp));
            
After it add the following

	    KEY( "RemortRace",  race->remort_race, fread_number(fp));    



---------------
ACT_WIZ.C
---------------

Find the following in do_showclass

    pager_printf_color( ch, "&wMax Skill Adept: &W%-3d             &wThac0 : &W%-5d     &wThac32: &W%d\n\r",
	class->skill_adept, class->thac0_00, class->thac0_32 );
    pager_printf_color( ch, "&wHp Min/Hp Max  : &W%-2d/%-2d           &wMana  : &W%-3s      &wExpBase: &W%d\n\r",
	class->hp_min, class->hp_max, class->fMana ? "yes" : "no ", class->exp_base );

After it add the following

    pager_printf_color( ch, "&wTier:  &W%d\n\r", class->remort_class);
    
    
Find the following in do_setclass

    	send_to_char( "\n\rField being one of:\n\r",			ch );
	send_to_char( "  name prime weapon guild thac0 thac32\n\r",ch );
	
Change it to

	send_to_char( "\n\rField being one of:\n\r",			ch );
	send_to_char( "  name prime weapon guild thac0 thac32 tier\n\r",ch );
	
	
A bit down find the following

    if ( !str_cmp( arg2, "prime" ) )
    {
	int x = get_atype( argument );

	if ( x < APPLY_STR || (x > APPLY_CON && x != APPLY_LCK) )
	    send_to_char( "Invalid prime attribute!\n\r", ch );
	else
	{
	    class->attr_prime = x;
	    send_to_char( "Done.\n\r", ch );
	}
	return;
    }
    
After it, add the following
    
    if ( !str_cmp( arg2, "tier"))
    {
        if (atoi(argument) < 0 || atoi(argument) > 5)
        {
           send_to_char("Range is 0-5.\n\r", ch);
           return;
        }
        class->remort_class = atoi(argument);
        send_to_char("Done.\n\r", ch);
        return;
    }		
    
    
Find the following in do_setrace

        send_to_char( "\n\rField being one of:\n\r",                      ch );
        send_to_char( "  name classes strplus dexplus wisplus\n\r",  ch );    
        
Change it to

        send_to_char( "\n\rField being one of:\n\r",                      ch );
        send_to_char( "  name classes strplus dexplus wisplus tier\n\r",  ch );        



A few lines down find the following

    if ( !str_cmp( arg2, "dexplus" ) )
    {
        race->dex_plus = (sh_int) atoi( argument );
        send_to_char( "Done.\n\r", ch );
        return;
    }
    
After it add the following
    
    if ( !str_cmp( arg2, "tier" ) )
    {
        if (atoi(argument) < 0 || atoi(argument) > 5)
        {
           send_to_char("Range is 0-5.\n\r", ch);
           return;
        }
        race->remort_race = atoi(argument);
        send_to_char("Done.\n\r", ch);
        return;
    }
    
    
Find the following in do_showrace

    sprintf( buf, "Str Plus: %-3d\tDex Plus: %-3d\tWis Plus: %-3d\tInt Plus: %-3d\t\n\r",
                           race->str_plus, race->dex_plus, race->wis_plus, race->int_plus);
    send_to_char( buf, ch);
    sprintf( buf, "Con Plus: %-3d\tCha Plus: %-3d\tLck Plus: %-3d\n\r",
                           race->con_plus, race->cha_plus, race->lck_plus);    
                           
Before it add the following

    sprintf( buf, "Tier: %-2d\n\r", race->remort_race);                           
    send_to_char( buf, ch);
    

-------------
UPDATE.C
-------------

You might have this already fixed, it is a BUG!!!!  Anyway, this will mess you up if you
don't remove this.

    /* Nephandi alignment restrictions -h  */
      if(ch->class == CLASS_NEPHANDI){
          if(ch->alignment>-250){
            set_char_color( AT_BLOOD, ch );
            send_to_char( "Damn you heathen! Go forth and do evil or suffer the consequences!\n\r", ch );
            worsen_mental_state( ch, 35 );
            return;
        } 
     }    
     
Just delete it, there is no NEPHANDI class, and the first class you add, it will screw
you up.  So delete this!
    
-------------
MAKEFILE
-------------

You need to add the remort.c file to the MAKEFILE, this pretty much means you need to add
remort.c and remort.o to the file, here is how to do it if you don't know

NOTE:  Type this in yourself, do not copy and paste this, it will mess up your makefile!!!!

O_FILES = act_comm.o act_info.o act_move.o act_obj.o act_wiz.o boards.o \
          build.o clans.o comm.o comments.o const.o db.o deity.o fight.o \
          handler.o hashstr.o ibuild.o ident.o interp.o magic.o makeobjs.o \
          mapout.o misc.o mpxset.o mud_comm.o mud_prog.o player.o polymorph.o \
          requests.o reset.o save.o shops.o skills.o special.o tables.o \
          track.o update.o grub.o stat_obj.o ban.o services.o planes.o \
          imm_host.o $(IMC_OFILES) colorize.o remort.o

C_FILES = act_comm.c act_info.c act_move.c act_obj.c act_wiz.c boards.c \
          build.c clans.c comm.c comments.c const.c db.c deity.c fight.c \
          handler.c hashstr.c ibuild.c ident.c interp.c magic.c makeobjs.c \
          mapout.c misc.c mpxset.c mud_comm.c mud_prog.c player.c polymorph.c \
          requests.c reset.c save.c shops.c skills.c special.c tables.c \
          track.c update.c grub.c stat_obj.c ban.c services.c planes.c \
          imm_host.c $(IMC_CFILES) colorize.c remort.c
          
AS you see, remort.c and remort.o is added after colorize.o and colorize.c.  If you have
to add a new line, make sure to add a \ at the end of the previous line!!!          
    
-------------------------------------------------------------------------------------------

That is it, now do a make clean and let it recompile.  Once it is done, reboot or do a copyover.

Once that is done, type this in to put the commands in.

cedit remor create do_remor
cedit remort create do_remort
cedit remor level 2
cedit remort level 2
cedit save cmdtable

Once this is done, you can start working on your new class.  You can use the class provided (Swordsman)
in the zip file, but you will need to make a minor modification if you have changed any of your
classes (as in removed them or added new ones in).  Mainly, go into the last class you have, find its
number, then change the number in the Swordsman.class file to the next number in sequence.  Or you can
create it online with setclass, and it will give you the number you need, then edit it offline from
there (editing classes online is nice, but for doing a full setup, I recommend doing it offline because
you have to modify skills, add new ones, remove some, etc).

There you go, it is now done.  I just have to mention a few things.  I do not use this code in my
mud since we are now levelless/classless.  If there are any bugs, I won't find them, so please
notify me about them, so I can fix them for future users.  If you need help, don't hesitate to
email me, I don't require anything for help, just a friendly email.  I hope you enjoy this
code, and it was easier to install.

--Xerves

