Ok, maybe I'm totally wrong about the code in here, but I am very sure that I did all the right steps.
I declared the function in mud.h "DECLARE_DO_FUN", and all that jazz...
Did all the do_fun fun in tables.c, and generally matched it so that it's declaration was everywhere that mpgoto was at...
Here's the code...
I can explain line-by-line if there are any questions, but now to the point:
It doesn't do anything. Period. When I write "mpgivepl $n 5000" in a prog it doesn't do anything. Not even the first bug "Entering MPgivepl"...
So I'm wondering if I need to declare it elsewhere, that somehow grepping couldn't find, or maybe I just screwed up in the code.
-Tiernan
P.S. this is DBSC, a derivative of SMAUG.
I declared the function in mud.h "DECLARE_DO_FUN", and all that jazz...
Did all the do_fun fun in tables.c, and generally matched it so that it's declaration was everywhere that mpgoto was at...
Here's the code...
/* allows the mobile to gift pl to people */
void do_mpgivepl( CHAR_DATA *ch, char *argument )
{
CHAR_DATA *victim;
char arg[MAX_INPUT_LENGTH];
char buf[MAX_INPUT_LENGTH];
long int pl_gain = 0;
progbug( "Entering MPgivepl", ch );
if ( !IS_NPC( ch ) )
{
send_to_char( "Huh?\n\r", ch );
progbug( "Mpgivepl - ch not NPC", ch );
return;
}
if ( IS_NPC(victim) )
{
progbug( "Mpadvance - Victim is NPC", ch );
return;
}
argument = one_argument(argument, arg);
if ( arg[0] == '\0' || argument[0] == '\0' )
{
progbug( "Mpgivepl - Bad argument", ch );
return;
}
pl_gain = atoi(argument);
if( (victim = get_char_room(ch,arg)) == NULL )
{
progbug( "Mpgivepl - Target not found", ch );
return;
}
gain_exp(ch, pl_gain);
bug( argument, 0 );
sprintf( buf, "Your powerlevel increases by %s points!", num_punct(pl_gain) );
act( AT_HIT, buf, ch, NULL, victim, TO_CHAR );
}
I can explain line-by-line if there are any questions, but now to the point:
It doesn't do anything. Period. When I write "mpgivepl $n 5000" in a prog it doesn't do anything. Not even the first bug "Entering MPgivepl"...
So I'm wondering if I need to declare it elsewhere, that somehow grepping couldn't find, or maybe I just screwed up in the code.
-Tiernan
P.S. this is DBSC, a derivative of SMAUG.