Re: groups

From: VampLestat (vamp@csulb.edu)
Date: 01/25/94


On Tue, 25 Jan 1994, Eric Pilcher wrote:

> Assuming that the mobs all have well balanced experience which reflect
> the relative difficulty, a nice equation for awarding exp gained
> per each successful hit would be (% of damage done)(mob exp value).
> 
> This would also take successful kicks, spells, and wand use into
> consideration with respect to exp.

I've considered this, but its not really fair to the non-warrior 
classes.  They often aid the party in other was that dont directly do 
damage (pick locks, healing, information finding spells) yet they dont 
get as much XP because they dont actually deal out the damage.

I've coded it so that there is a cap on the amount of XP a character can 
get.  maxgain is set to be 1/10 of the XP distance for the current level 
of that character.

I've also added a tid bit of code so that 30th level characters dont 
imomrtal automatically.  If someone wants to immort I advance them by 
hand.  This prevents people that I feel should not have immort abilities 
from getting them, and I can give greater responsibility to my immortals.

Here's my gain_exp() with these fixes.


void    gain_exp(struct char_data *ch, int gain)
{
   int  i;
   long maxgain;
   bool is_altered = FALSE;

   if (IS_NPC(ch) || ((GET_LEVEL(ch) < LEVEL_IMMORT) && (GET_LEVEL(ch) > 0))) {

      if (gain > 0) {

/* Max gain for a pc is 1/10 of the width to the next level -vamp */

         if (IS_NPC(ch)){
         gain = MIN(100000, gain);
         } else {
         maxgain = (titles[GET_CLASS(ch)-1][GET_LEVEL(ch)+1].exp - titles[GET_CLASS(ch)-1][GET_LEVEL(ch)].exp) * .1;
         gain = MIN(maxgain, gain);
       }

         GET_EXP(ch) += gain;
         if (!IS_NPC(ch)) {
            for (i = 0; titles[GET_CLASS(ch)-1][i].exp <= GET_EXP(ch); i++) {

/* Do not allow lv 30 players to advance to lv 31 via simple exp.
   Must use the advance command, even though XP continues to pile up   -vamp
 */

               if ((i > GET_LEVEL(ch)) && (GET_LEVEL(ch) < LEVEL_MORTAL_MAX)) {
                  send_to_char("You rise a level!\n\r", ch);
                  GET_LEVEL(ch) = i;
                  advance_level(ch);
                  is_altered = TRUE;
               }
            }
         }
      }

      if (gain < 0) {
         gain = MAX(-500000, gain);  /* Never loose more than 1/2 mil */
         GET_EXP(ch) += gain;
         if (GET_EXP(ch) < 0)
            GET_EXP(ch) = 0;
      }

      if (is_altered) {
         set_title(ch);
         check_autowiz(ch);
      }
   }
}


_O_  Ryan L. Watkins                                     vamp@csulb.edu
 |   Academic Computing Services Cal State Long Beach - Network Support
 |   pgp key available via 'finger vamp@beach.csulb.edu' or key server



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