Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 05-04-2002, 11:10 AM   #1
Tavish
Member
 
Join Date: Apr 2002
Location: USA
Posts: 130
Tavish is on a distinguished road
Send a message via MSN to Tavish
I have just toyed around with the exp_per_level function on a modified ROM codebase.  What I am attempting to do seemed quite simple but for some reason I am stuck with a strange return.

[code] int exp_per_level(CHAR_DATA *ch, int points)
{
   int expl,multip,tnl;
expl = 0;
tnl = UMAX(1000,points*25);

if (ch->level > 10)
{
multip =  (ch->level - 5) / 5;
expl = tnl * (multip + 1);
}
else
{
expl = tnl;
}
  return expl * pc_race_table[ch->race].class_mult[ch->class]/100;
}[/quote]

Starting at level 11 the exp_per_level begins to multiply (or at least it should).  I can advance characters to each multipler jump (11,16,21 etc.) and the tnl works just fine.  When a player levels from 10 to 11 the old fashion way the 11 to 12 tnl is outrageous, upwards of 14000.

What am I missing?
Tavish is offline   Reply With Quote
Old 05-04-2002, 11:43 AM   #2
Alastair
Member
 
Join Date: Apr 2002
Location: Switzerland
Posts: 120
Alastair is on a distinguished road
Send a message via Yahoo to Alastair
Just a quick browsing, but I think your problem is here:
[code] multip =  (ch->level - 5) / 5;
expl = tnl * (multip + 1);[/quote]

A quick calculation shows that your tnl multiplier is 2.2 on level 11.

Whereas the multiplier only kicks in at level 11.
Alastair is offline   Reply With Quote
Old 05-04-2002, 04:14 PM   #3
Teelf
Member
 
Join Date: Apr 2002
Location: Seattle
Posts: 32
Teelf is on a distinguished road
Quote:
Originally Posted by
A quick calculation shows that your tnl multiplier is 2.2 on level 11.
The multiplier would actually be 2, but I think that is what Tavish is trying to accomplish?

You said it works fine when you jump a character to a level.  This function doesn't seem to care how they came to be their current level. So barring any freaky table lookup data, I am led to believe the problem lies elsewhere.

What is done with the return result?
Teelf is offline   Reply With Quote
Old 05-04-2002, 05:18 PM   #4
Tavish
Member
 
Join Date: Apr 2002
Location: USA
Posts: 130
Tavish is on a distinguished road
Send a message via MSN to Tavish
Thats the strange thing, and what I was hoping someone would know. The return's biggest use is in advance_level.


[code]
from gain_exp..

while ( ch->level < LEVEL_HERO && ch->exp >=
exp_per_level(ch,ch->pcdata->points) * (ch->level+1) )[/quote]

Now that basically stock code there, and calls a function advance_level which does the stat additions.
Tavish is offline   Reply With Quote
Old 05-04-2002, 06:25 PM   #5
Teelf
Member
 
Join Date: Apr 2002
Location: Seattle
Posts: 32
Teelf is on a distinguished road
Ok.  I think I get it.  

What your doing is manipulating the exp_per_level function based on the persons level.  Which, when you think about it, isn't a good thing.  

You are saying that when a person is level 10, their exp per level is 1000 (for example).  So they need (10 + 1) * 1000 exp or 11,000 exp to make lvl 11.  Then when they make lvl 11, they now need 2000 per level, (11 + 1) * 2000 or 24,000 exp to make lvl 12.  They only have 11,000, so they need 13,000 to make the next lvl.  

You'll have to move that lvl check somewhere else.  I'm not familiar with ROM, so I couldn't say where.

Good luck!
Teelf is offline   Reply With Quote
Old 05-04-2002, 09:29 PM   #6
Tavish
Member
 
Join Date: Apr 2002
Location: USA
Posts: 130
Tavish is on a distinguished road
Send a message via MSN to Tavish
Grrrr.. OK at least now I see what I was missing. Thanks Teelf. It was getting quite aggrevating as to why I could advance the player and the tnl be fine, plus someone actually went and made the 13000 needed for 12 and the tnl for 13 went back to normal. Just wasn't looking at the whole picture right, but now I can readjust it.
Tavish is offline   Reply With Quote
Reply


Thread Tools


what am I missing? - Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing Catagory TTTGames-Robert Bugs and Suggestions 0 01-31-2005 09:43 PM
possible suggestion (maybe missing it) zifnab Bugs and Suggestions 0 02-17-2004 10:14 AM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 01:53 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2014