/* Version 2.0 *

This is probably the final version for this code. I found a few things I didn't like and I
changed them so I figured i'd share them with the rom list. I made it so that the info
messages only show up every three ticks. If you wish to change this simply change the if
statement concerning display in update.c I've also included gpoint, an idea I also got from
playing on a rot mud. 

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];
    int amount;

    argument = one_argument( argument, arg );
    one_argument( argument, arg1 ); 

    if ( arg[0] == '\0' )
    {
        send_to_char("Syntax: double <on|off> ticks.\n\r",ch);
        return;
    }
    
    if (!str_cmp(arg, "on"))
    {
        if ( arg1[0] == '\0' || !is_number( arg1 ) )
        {
            send_to_char("You need to apply the number of ticks.\n\r", ch );
            return;
        }

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

        if ( amount < 0 || amount > 500 )
        {
            send_to_char( "Please choose an amount between 0 and 500.\n\r", ch );
            return;
        }
 
        global_exp = amount;
        double_exp = TRUE;
        info( ch, 0, "{G[INFO]:{x {R%s has declared %d ticks of double exp for everyone!{x\n\r", ch->name, amount );
        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;
        info( ch, 0, "{G[INFO]:{x {R%s has removed double experience!{x\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;      
sh_int  display;


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)
     {

        display++;

        if ( display >= 3 )
        {
            info( NULL, 0, "{G[INFO]:{x {BThere are %d ticks of double exp left.{x\n\r", global_exp );
            display = 0;
            return;
        }

        if (global_exp == 0)
        {
            info( NULL, 0, "{G[INFO]:{x {BDouble exp has run out!{x\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;     
extern          sh_int                  display;


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;
}    


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


************************************** END Doublexp ***************************************


This is the code for gpoint a simple little addition

merc.h
******

in struct char_data below:

int subtype;

add this:
int                 gpoint;   
  

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

in function do_goto strip out the code that pertains to the following code.

I believe it will look something like this. Note anything with a minus needs to be removed
anything with a + needs to be added.

  -  if ( argument[0] == '\0' )
  -  {    
  -     send_to_char( "Goto where?\n\r", ch );
  -     return;
  -  }


  + if ( argument[0] == '\0' && ( !ch->gpoint ) )
  + {
  +     send_to_char( "Goto where?\n\r", ch );
  +     return;
  + }

  + if ( ( argument[0] == '\0' ) && (ch->gpoint ) )
  + {
  +     sprintf(arg, "%d", ch->gpoint);
  + }

  + else
  + {
  +     sprintf(arg, "%s", argument);
  + }       

  - if ( ( location = find_location( ch, argument ) ) == NULL )
  - {
  -     send_to_char( "No such location.\n\r", ch );
  -     return;
  - }  
   
  + if ( ( location = find_location( ch, arg ) ) == NULL )
  + {
  +     send_to_char( "No such location.\n\r", ch );
  +     return;
  + }  
   
/* at the end of act_wiz.c add this */
void do_gpoint( CHAR_DATA *ch, char *argument )
{
   int amount;

    if ( IS_NPC( ch ) )
    {
        send_to_char( "Mobs don't need goto points!\n\r", ch );
        return;
    }

    if (  argument[0] == '\0' || !is_number( argument ) )
    {
        send_to_char( "Your goto point has been cleared!\n\r", ch );
        ch->gpoint = 0;
        return;
    }

    amount = atoi( argument );

    if ( amount <= 0 )
    {
        send_to_char( "Please set your goto point to a number greater than 0.\n\r", ch );
        return;
    }

    ch->gpoint = amount; 
    printf_to_char( ch, "Your goto point is set to %d\n\r", ch->gpoint );
    
    return;
}

As usual put these commands into interp.c and interp.h. Make clean and do a compile
copyover/reboot and enjoy. If you find any bugs or I left anything out let me know.