Re: [Stupid newbie coder] Question

From: Brian Pape (bpape@ezl.com)
Date: 05/21/96


> xp_percent = GET_EXP(ch) / titles[(int) GET_CLASS(ch)][GET_LEVEL(ch)+1].exp;
>
> xp_percent should be the approx, percentage of xp the character has
> gotten for his next level.  I've gotten all sorts of errors, done all
> sorts of fixes, but for some reason, i always get < .1
>
> What's wrong with it?

If you are using the circle cumulative experience method, say they have
10000 exp, and 11,000 is required for the next level...  you need to
subtract the exp they have for their current level first:

float xp_percent;
xp_percent = (GET_EXP(ch)-titles[(int)GET_CLASS(ch)][GET_LEVEL(ch)]) /
              titles[(int)GET_CLASS(ch)][GET_LEVEL(ch)+1];

Brian Pape
bpape@ezl.com



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