|
|||||||
This is a discussion on "what am I missing?" in the Top Mud Sites MUD Coding forum : 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 ... |
|
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our MUD community today! If you have any problems with the registration process or your account login, please contact us. If you are a registered member of the old TMS forums, please click here
|
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
Member
|
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? |
|
|
|
|
|
#2 |
|
Member
|
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. |
|
|
|
|
|
#3 | |
|
Member
Join Date: Apr 2002
Location: Seattle
Posts: 32
![]() |
Quote:
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? |
|
|
|
|
|
|
#4 |
|
Member
|
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. |
|
|
|
|
|
#5 |
|
Member
Join Date: Apr 2002
Location: Seattle
Posts: 32
![]() |
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! |
|
|
|
|
|
#6 |
|
Member
|
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.
|
|
|
|
![]() |
| 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 |
|
|