Re: [CODE]Exp formula

From: Peter Ajamian (peter@pajamian.dhs.org)
Date: 01/31/01


"Dustin E. Miller" wrote:
>
> >> Peter Ajamian suggested:
> >> return (get_exp(level - 1) + MIN(((level + 4) / 5) * 10000, 50000));
> hmm, i've had to modify this a bit and when i compile it gives invalid type
> argument '->' heres what exp_to_level looks like..

Actually this won't work.  The original patch decided to make extensive
changes to remove the level_exp function which was completely
unnecessary and call the new function exp_to_level which a char_data
pointer instead of the player's level.  You're gonna have to do a little
bit of work to get this method to work right...

<snips your entire code>

You mixed together two functions.  The first one was commented out in
the patch and is not even supposed to be used, here's the second one...

int exp_to_level(struct char_data *ch)
{
  // thanks to Peter Ajamian for cutting this down to just one
  // line of code from my original 12.   CC - 11/7/00
  return MIN(((GET_LEVEL(ch) + 4) / 5) * 10000, 50000);
}

While you're at it, get rid of the // comments and change them to /* ...
*/ comments...

Here's the modified function...

/*
 * Why would this function even bother to replace level_exp?
 * Anyways, modified to pas the level instead of a struct char_data *
 * and to change back to a system where experience is not reset for
 * each level.  -- Peter Ajamian 01/31/01 (happy birthday to me <G>)
 */
int exp_to_level(char level)
{
  /*
   * thanks to Peter Ajamian for cutting this down to just one
   * line of code from my original 12.   CC - 11/7/00
   */
  return exp_to_level(level - 1) + MIN(((level + 4) / 5) * 10000,
50000);
}

Next make sure and find all references to exp_to_level(ch) and change
them to exp_to_level(GET_LEVEL(ch)).

This may not work if you end up with too much experience at the high
levels.  If that happens then you can do what I sugessted in an earlier
post.

Regards, Peter

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/03/01 PST