/*New Training System written by Cherun for Lazerus, if you use this code all I ask if that you
 *Leave All credits to me in the code part and please be honest about it
 */
First you need to open your interp.c and interp.h
Find the line
{"train",	do_train,	POS_RESTING,	0,	LOG_NORMAL,	1},
Take that out and put
{"train",	do_train_part_one,	POS_RESTING,	0,	LOG_NORMAL,	1},
{"convert",	do_convert,	POS_RESTING,	0,	LOG_NORMAL,	1},


In interp.h remove the do_train declaration and put
DECLARE_DO_FUN(	do_train_part_one);
DECLARE_DO_FUN(	do_train_part_two);
DECLARE_DO_FUN(	do_convert		 );


Then Open up merc.h go to your pc_data
Find the line
int				last_level;
Underneath it put
/* Part of Training Code */
	int				train_one;
	int				train_two;
	int				train_three;
	int				train_four;
	int				train_five;

Now find the line in pc_data that looks like this
char *			title;
Underneath that put
char *			train_target;

To Be honest it can go anywhere in pc_data I just say put it under that for rom muds

Next open up save.c
Find something that looks like this
if (ch->train != 0)
   fprintf (fp, "Trai %d\n", ch->train);

Underneath it put this in
if (ch->pcdata->train_one != 0)
        fprintf (fp, "TrainOne %d\n", ch->pcdata->train_one);
if (ch->pcdata->train_two != 0)
		fprintf (fp, "TrainTwo %d\n", ch->pcdata->train_two);
if (ch->pcdata->train_three != 0)
        fprintf (fp, "TrainThree %d\n", ch->pcdata->train_three);
if (ch->pcdata->train_four != 0)
        fprintf (fp, "TrainFour %d\n", ch->pcdata->train_four);
if (ch->pcdata->train_five != 0)
        fprintf (fp, "TrainFive %d\n", ch->pcdata->train_five);



Now find the line 
KEY ("Trai", ch->train, fread_number (fp));
Underneat it add this

KEY ("TrainOne", ch->pcdata->train_one, fread_number (fp));
KEY ("TrainTwo", ch->pcdata->train_two, fread_number (fp));
KEY ("TrainThree", ch->pcdata->train_three, fread_number (fp));
KEY ("TrainFour", ch->pcdata->train_four, fread_number (fp));
KEY ("TrainFive", ch->pcdata->train_five, fread_number (fp));

Now find the line
fprintf (fp, "Titl %s~\n", ch->pcdata->title);

Put this underneath it
fprintf (fp, "TrainTarget %s~\n", ch->pcdata->train_target);

Now open up act_move.c
Remove the do_train function Place this do_convert function in its place
/*
 * Lazerus's Training System by Cherun
 */
void do_convert (CHAR_DATA * ch, char *argument)
{
	int value;
	int cost;

	if ((argument[0] = '\0'))
	{
	send_to_char("Convert your expierence into how many trains?\n\r",ch);
	return;
	}

	if (!is_number (argument))
    {
        send_to_char ("Please Specify a numerical value of Trains.\n\r", ch);
        return;
    }

    value = atoi (argument);
    if (value < 1 || value > 10)
    {
        send_to_char ("You may only gain 1 to 10 trains at a time.\n\r", ch);
        return;
    }
	cost = value * 5000;

	if (ch->exp < cost)
		{
		act("You do not have enough for that conversion.\n\r",ch, NULL, NULL, TO_CHAR);
		return;
		}
	

	ch->exp -= cost;
	ch->train += value;
	act("You sucessfully convert expierence over into training points.\n\r",ch,NULL,NULL,TO_CHAR);
	act("$n converts $s expierence over into training points.\n\r",ch,NULL,NULL,TO_ROOM);
	WAIT_STATE(ch, 5);
	return;
}


Then after it Place this do_train_part_two function


void do_train_part_two (CHAR_DATA * ch, char *argument)
{
    char buf[MAX_STRING_LENGTH];
    sh_int stat = -1;
    char *pOutput = NULL;
    int cost;

    if (IS_NPC (ch))
        return;
	/* Make sure the base cost equals something :-P */
    cost = 1;

    if (!str_cmp (argument, "str"))
    {
		cost = ch->perm_stat[STAT_STR] + 2;
        stat = STAT_STR;
        pOutput = "strength";
    }

    else if (!str_cmp (argument, "int"))
    {
		cost = ch->perm_stat[STAT_INT] + 2;
        stat = STAT_INT;
        pOutput = "intelligence";
    }

    else if (!str_cmp (argument, "wis"))
    {
		cost = ch->perm_stat[STAT_WIS] + 2;
        stat = STAT_WIS;
        pOutput = "wisdom";
    }

    else if (!str_cmp (argument, "dex"))
    {
		cost = ch->perm_stat[STAT_DEX] + 2;
        stat = STAT_DEX;
        pOutput = "dexterity";
    }

    else if (!str_cmp (argument, "con"))
    {
	
		cost = ch->perm_stat[STAT_CON] + 2;
        stat = STAT_CON;
        pOutput = "constitution";
    }

    else if (!str_cmp (argument, "hp"))
        cost = 1;

    else if (!str_cmp (argument, "mana"))
        cost = 1;

	else if (!str_cmp (argument, "move"))
		cost = 1;

    else
    {
        strcpy (buf, "You can train:");
        if (ch->perm_stat[STAT_STR] < get_max_train (ch, STAT_STR))
            strcat (buf, " str");
        if (ch->perm_stat[STAT_INT] < get_max_train (ch, STAT_INT))
            strcat (buf, " int");
        if (ch->perm_stat[STAT_WIS] < get_max_train (ch, STAT_WIS))
            strcat (buf, " wis");
        if (ch->perm_stat[STAT_DEX] < get_max_train (ch, STAT_DEX))
            strcat (buf, " dex");
        if (ch->perm_stat[STAT_CON] < get_max_train (ch, STAT_CON))
            strcat (buf, " con");
        strcat (buf, " hp mana move");

        if (buf[strlen (buf) - 1] != ':')
        {
            strcat (buf, ".\n\r");
            send_to_char (buf, ch);
        }
        else
        {
            send_to_char("You failed at training due to lack of Training Points.\n\r",ch);
        }

        return;
    }

    if (!str_cmp ("hp", argument))
    {
        if (cost > ch->train)
        {
            send_to_char ("You failed at training due to lack of Training Points.\n\r", ch);
            return;
        }

        ch->train -= cost;
		if (ch->perm_stat[STAT_CON] >= 5)
		{
		ch->pcdata->perm_hit += 15;
        ch->max_hit += 15;
        ch->hit += 15;
		}
		if (ch->perm_stat[STAT_CON] >= 10)
		{
		ch->pcdata->perm_hit += 20;
        ch->max_hit += 20;
        ch->hit += 20;
		}
		if (ch->perm_stat[STAT_CON] >= 15)
		{
		ch->pcdata->perm_hit += 25;
        ch->max_hit += 25;
        ch->hit += 25;
		}
		if (ch->perm_stat[STAT_CON] >= 20)
		{
		ch->pcdata->perm_hit += 30;
        ch->max_hit += 30;
        ch->hit += 30;
		}
		if (ch->perm_stat[STAT_CON] >= 25)
		{
		ch->pcdata->perm_hit += 35;
        ch->max_hit += 35;
        ch->hit += 35;
		}
		else
		{
        ch->pcdata->perm_hit += 10;
        ch->max_hit += 10;
        ch->hit += 10;
		}
        return;
    }

    if (!str_cmp ("mana", argument))
    {
        if (cost > ch->train)
        {
            send_to_char ("You failed at training due to lack of Training Points.\n\r", ch);
            return;
        }
		ch->train -= cost;
		if (ch->perm_stat[STAT_INT] >= 5)
		{
		ch->pcdata->perm_mana += 15;
		ch->max_mana += 15;
		ch->mana += 15;
		}
		if (ch->perm_stat[STAT_INT] >= 10)
		{
		ch->pcdata->perm_mana += 20;
		ch->max_mana += 20;
		ch->mana += 20;
		}
		if (ch->perm_stat[STAT_INT] >= 15)
		{
		ch->pcdata->perm_mana += 25;
		ch->max_mana += 25;
		ch->mana += 25;
		}
		if (ch->perm_stat[STAT_INT] >= 20)
		{
		ch->pcdata->perm_mana += 30;
		ch->max_mana += 30;
		ch->mana += 30;
		}
		if (ch->perm_stat[STAT_INT] >= 25)
		{
		ch->pcdata->perm_mana += 35;
		ch->max_mana += 35;
		ch->mana += 35;
		}
		else
		{
        ch->pcdata->perm_mana += 10;
        ch->max_mana += 10;
        ch->mana += 10;
		}
        return;
    }

	if (!str_cmp ("move", argument))
    {
        if (cost > ch->train)
        {
            send_to_char ("You failed at training due to lack of Training Points.\n\r", ch);
            return;
        }

        ch->train -= cost;
		if (ch->perm_stat[STAT_DEX] >= 5)
		{
		ch->pcdata->perm_move += 15;
		ch->max_move += 15;
		ch->move += 15;
		}
		if (ch->perm_stat[STAT_DEX] >= 10)
		{
		ch->pcdata->perm_move += 20;
		ch->max_move += 20;
		ch->move += 20;
		}
		if (ch->perm_stat[STAT_DEX] >= 15)
		{
		ch->pcdata->perm_move += 25;
		ch->max_move += 25;
		ch->move += 25;
		}
		if (ch->perm_stat[STAT_DEX] >= 20)
		{
		ch->pcdata->perm_move += 30;
		ch->max_move += 30;
		ch->move += 30;
		}
		if (ch->perm_stat[STAT_DEX] >= 25)
		{
		ch->pcdata->perm_move += 35;
		ch->max_move += 35;
		ch->move += 35;
		}
		else
		{
        ch->pcdata->perm_move += 10;
        ch->max_move += 10;
        ch->move += 10;
		}
        return;
    }

    if (ch->perm_stat[stat] >= get_max_train (ch, stat))
    {
        act ("Your $T is already at maximum.", ch, NULL, pOutput, TO_CHAR);
        return;
    }

    if (cost > ch->train)
    {
        send_to_char ("You failed at training due to lack of Training Points.\n\r", ch);
        return;
    }

    ch->train -= cost;

    ch->perm_stat[stat] += 1;
    return;
}

Now open up Update.c Here is the tricky part, the expiernced coder you should already know
how to put this here if your using rom, here is what to do

in void update_handler

find this line:
static int pulse_music;

underneath it add this..
DESCRIPTOR_DATA *d;
CHAR_DATA *ch = NULL;

then at the botton of update_handler
find these lines

 aggr_update ();
 tail_chain ();
 return;

Right above then add this

for ( d = descriptor_list; d != NULL; d = d->next )
		{
	    if ( d->connected == CON_PLAYING &&   (ch = d->character) != NULL &&  !IS_NPC(ch))
	    {

	if (ch->pcdata->train_one > 0)
		{
		    ch->pcdata->train_one--;
		    if (ch->pcdata->train_one < 1)
		    {
			    send_to_char("You begin to train.\n\r",ch);
			    act("$n begins to train.",ch,NULL,NULL,TO_ROOM);
			}
		}
	if (ch->pcdata->train_two > 0)
		{
		    ch->pcdata->train_two--;
		    if (ch->pcdata->train_two < 1)
		    {
			    send_to_char("Your training kicks up a bit.\n\r",ch);
			    act("$n's training begins to quicken.",ch,NULL,NULL,TO_ROOM);
			}
		}
	if (ch->pcdata->train_three > 0)
		{
		    ch->pcdata->train_three--;
		    if (ch->pcdata->train_three < 1)
		    {
			    send_to_char("Your training becomes more harsh.\n\r",ch);
			    act("$n's training becomes real harsh.",ch,NULL,NULL,TO_ROOM);
			}
		}
	if (ch->pcdata->train_four > 0)
		{
		    ch->pcdata->train_four--;
		    if (ch->pcdata->train_four < 1)
		    {
			    send_to_char("You begin to sweat alot.\n\r",ch);
			    act("$n begins to sweat alot.",ch,NULL,NULL,TO_ROOM);
			}
		}
	if (ch->pcdata->train_five > 0)
		{
		    ch->pcdata->train_five--;
		    if (ch->pcdata->train_five < 1)
		    {
			    send_to_char("You have compeleted your training.\n\r",ch);
			    act("$n has completed their training.",ch,NULL,NULL,TO_ROOM);
				do_train_part_two(ch, ch->pcdata->train_target );
			}
		}
		}
		}


Then ONE last thing go back into interp.c
Find the void interpret (CHAR_DATA * ch, char *argument) <--It looks like that

In that void find this line
if (ch->position < cmd_table[cmd].position)

Above it add

if (ch->pcdata->train_five > 0)
	{
	send_to_char("You must concentrate on training!\n\r",ch);
	return;
	}


That should be it, if you have any questions my email is cherun@tampabay.net or AIM me at lordvolcheka1
Remeber Please give me credit :) and Below is a Helpfile for Train if you need one

0 TRAIN~
Syntax: train <str int wis dex con hp mana move>
In order to train a stat you must first CONVERT 
expierence over into trains
Synax: convert <amount of trains>
You may only convert expierence into a max of 10 trains
it costs 5000 expierence per 1 train

Str, int, wis, dex, and con
All raise in value as they go up in levels
Hp mana and Move all cost 1 train
The more Int you have the more mana per train you recieve
The more Dex you have the more Move per train you recieve
The more Con you have the more Hp per train you recieve

New Train Done by Cherun of LazerusMud
~