Re: Exp equation instead of switch statement

From: Alex Mann (
Date: 06/01/01

> > I am about to start adding a specialisation system including about
> > 13 new classes for a remort style system. But before i do that i would
> > to replace the current exp levels system, the giant switch statement
> > is huge for each class which has 100 levels. I want to replace it with
> > equation which works out and outputs the exp per level, either one
> > which allows for the different exp for classes, or an equation which i
> > use for each class, altering the stats so exp to level is different for
> > class.

Thomas Arp replied

>We're currently using the table below - we've changed level_exp() to be
>like this:
>int level_exp(int chclass, int level, int chrace)
>and then calculate the exp like this:
>   (float mult;)
>   switch (chrace) {
>     case RACE_HUMAN:     mult = 1.0; break;
>     case RACE_DWARF:     mult = 1.8; break;
>     case RACE_ELF:       mult = 1.6; break;
etc etc

This worked fine thanks after some alterations to suit my mud this seems to
be working really well.

however do_advance seems to not work under this system, and i was wondering
if anyone had got it , to work using a similar system, or can tell me which
part of the advance equation is screwing up.

Alex Mann 4445
Get Your Private, Free E-mail from MSN Hotmail at

   | FAQ: |
   | Archives: |

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