Restore When Leveling Snippet

Posted by Yourdrunkendad on Mon 04 Aug 2003 05:14 AM — 5 posts, 18,870 views.

#0
I tried using a snippet to restore char's when they level, here it is..

This is a very basic Auto-Restore code to be put in void gain_exp in update.c under the line that reads advance_level(ch,FALSE );

put this line:

affect_strip(ch,gsn_plague);
affect_strip(ch,gsn_poison);
affect_strip(ch,gsn_blindness);
affect_strip(ch,gsn_sleep);
affect_strip(ch,gsn_curse);

ch->hit = ch->max_hit;
ch->mana = ch->max_mana;
ch->move = ch->max_move;
update_pos( ch);
send_to_char( "<name of god> has give you the power to continue ", ch );

the problem is that my update.c doesn't have the line
advance_level(ch,FALSE );
Does anyone know what to do with this? Or know of another way that works?

Thanks for taking to time to read this
Australia Forum Administrator #1
In my update.c I see this stuff:


    while ( ch->level < LEVEL_AVATAR && ch->exp >= exp_level(ch, ch->level+1))
    {
        set_char_color( AT_WHITE + AT_BLINK, ch );
        ch_printf( ch, "You have now obtained experience level %d!\n\r", ++ch->l
evel );
        advance_level( ch );
    }


It isn't exactly the same but should be close enough.
#2
Ok I tried putting it there, however when compiling got these errors:

update.c: In function 'gain_exp' :
update.c:232: 'gsn_plague' undeclared <first use in this function.
update.c:232: <each undeclared idientifer is reported only once
update.c:232: for each function it appears in.>
make[1]: *** [o/update.o] Error 1
make: *** [all] Error 2

Any ideas?
USA #3
Take out the line affect_strip(ch,gsn_plague); would be my guess.
#4
Ahh yes, I removed the plague part of it that god rid of the errors but it still didn't work.

So I tried moving it into the advance_level fuction instead, now it works.

~Cheers~