noexp.txt
snippets · 1.5 KB · 2010-03-30
NOEXP by Luke: for questors who don't want to level while questing.
Download « Back to the snippets list
NOEXP By Luke
INFO: I created this snippet for the questors who don't want to level when
they quest. Well.. I suppose you could adapt this and make it an imm
penalty. :) But I'm not that mean. ;) This has been tested pretty well..
so if it crashes your mud and you find out why, send me an e-mail.
Or e-mail me with whatever. ddecker@mmcable.com
Instructions are below
First off all, add a PLR flag in merc.h as such:
#define PLR_NOEXP (dd)
I put this in act_comm.c but it really doesn't matter where..:
void do_noexp (CHAR_DATA * ch, char *argument)
{
if (IS_NPC (ch))
{
send_to_char("No. You are an NPC. Quit talking and die!\n\r",ch);
return;
}
if (!IS_SET (ch->act, PLR_NOEXP))
{
SET_BIT(ch->act, PLR_NOEXP);
send_to_char("You will no longer get exp for kills. Remember to set this back when you want exp for kills!\n\r",ch);
return;
}
else
{
REMOVE_BIT(ch->act, PLR_NOEXP);
send_to_char("You turn your ability to gain exp back on.\n\r",ch);
return;
}
}
Now the good part, don't forget this part of it. ;) In fight.c inside void group_gain, when it computes the xp, drop this in:
if(IS_SET(gch->act, PLR_NOEXP))
{
send_to_char("You have NOEXP turned on! You gained no exp!\n\r",ch);
xp = 0;
}
Add the command do_noexp to interp.c and interp.h and you're good to go!
That should be it!