Re: Mob Experience

From: Jeremy Elson (
Date: 04/23/96

> > 
> > Is there a way to have Mobs GAIN xp, everytime THEY kill something or
> > someone?
> > I mean there are some tough mobs out there that if in reality they would
> > be gaining xp for killing that many players!
> > 
> in limits.c, function gain_exp(), remove that code following.
> then MOBs can gain a exp, and if they have enough exp, can gain a level.
> void gain_exp(struct char_data * ch, int gain)
> {
>   int is_altered = FALSE;
>   int num_levels = 0;
>   char buf[128];
>   if (!IS_NPC(ch) && ((GET_LEVEL(ch) < 1 || GET_LEVEL(ch) >= LVL_IMMORT)))
>     return;
> ******************************
>   if (IS_NPC(ch)) {         |
>     GET_EXP(ch) += gain;    |
>     return;                 |-- remove this.
>   }                         |
> ******************************

If you want to remove that, make sure the mob's class is some sane value,
otherwise the MUD will crash when it tries to access that titles[] array.
Although, this will not be a problem any more in patchlevel 12, because
I'm planning on changing the titles[] array to a function call (making
exp formula-based rather than table-based.)  I'm doing this because people
seem to always forget to extend that array when adding new levels to the
MUD.  (Note, after I make that change, the *only* thing you'll have to do
to give your MUD more levels is change the LVL_xxx constants in structs.h!
Cool, eh?)

BTW, in case anyone is wondering, it's this kind of thing that I want to
get done before the production release of 3.0: really polish things so that
things are easy to change in the future, complete the documentation, etc.

This archive was generated by hypermail 2b30 : 12/18/00 PST