/* Version 1.2 */

I hadn't really tested this command so when I tested it out I
realized I had made some errors. Here are the fixes for it, note
this is probably the final version. 

act_wiz.c
*********

At the top of the file with the other local variables add:

bool    double_exp = FALSE;   



I put this at the bottom of act_wiz.c but you can put it
anywhere you like. Uncomment the info code if you use the 
info channel on your mud. 

/* 
 * Credit goes to Ramone Hamilton for the idea and parts of the
 * code for the tick timer.
 * Other credits go to the Rot mud and it's authors for the concept.
 * Last but not least to the Rom consortium for the code base 
 * I don't require that you give me any sort of credit just keep
 * this header intact. 
 * Please report any bugs, flames or ideas to Synon23@hotmail.com
 */ 

void do_doublexp( CHAR_DATA *ch, char *argument )
{
    char arg[MIL];
    char arg1[MIL];

    argument = one_argument( argument, arg );
    one_argument( argument, arg1 ); /* Change to this */
                                                
    if ( arg[0] == '\0' )
    {
        send_to_char("Syntax: double <on|off>.\n\r",ch);
        return;
    }                   

    if (!str_cmp(arg, "on"))
    {
        if ( arg1[0] == '\0' )
        {
            send_to_char("You need to appply the number of ticks.\n\r", ch );
            return;
        }

        if (double_exp)
        {
            send_to_char("Double exp is already in affect!\n\r",ch);
            return;
        }  

        global_exp = atoi( arg1 );
        double_exp = TRUE;
        /* info( ch, 0, "%s has declared %d ticks double exp for
everyone\n\r", ch->name ); */ /* Now shows how many ticks are set
to begin with */
        send_to_char("Double exp is now in affect!\n\r",ch);
        return;
    }
                 
    if (!str_cmp(arg, "off"))
    {
        if (!double_exp)
        {
           send_to_char("Double exp is not on please turn it on first!\n\r",ch);
            return;
        }

        double_exp = FALSE;
        global_exp = 0; /* Better set this to 0 */
        /* info( ch, 0, "%s has removed double experience!\n\r",ch->name ); */
        send_to_char( "You have turned off double exp!\n\r", ch );
        return;
    }
}                 


update.c
********


At the top of the file below: 

int     save_number = 0;
  

Put this:

int     global_exp;      



Then in function update_char:


Near the end of the function or any logical spot I put this

 
    /* Note this makes use of the info channel so if you don't have it 
     * change this to your global channel. 
     */ 

    if ( global_exp-- > 0)
    {
        info( NULL, 0, "Their are %d ticks of double exp left.\n\r", global_exp );
        if (global_exp == 0)
        {
            info( NULL, 0, "Double exp has run out!\n\r" );
            double_exp = FALSE;
            return;
        }
    }         


merc.h
******

In the global variables below 


extern          OBJ_DATA          *     obj_free;  


Put this:

extern          bool                    double_exp;
extern          int                     global_exp;     


fight.c
*******

in the function xp_compute

add a new variable

int bonus;


at the end of the function below

xp = xp * gch->level/( UMAX(1,total_levels -1) );    


put this:

bonus = xp;


if (double_exp)
{
    xp += bonus;
    info( victim, 0, "You gain %d bonus exp points!\n\r", bonus );
}    


add definitions for doublexp in interp.c and interp.h and that
should do it. If I left anything out please let me know.