Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

No exp gained or lost after level cap increase

Newbie Spellweaver
Joined
Sep 6, 2012
Messages
7
Reaction score
0
Hello everyone,

I have always been a fan of this community and for the first time I'm here to ask for your help. I had a KPT client/server sitting around with lvl cap 140, so I decided to get back to my developing days by increasing it's level cap to 150. After following the MANY guides that are in this forum, I was able to level my character to 150 but only using the /expup command. For some reason, the monsters won't give me any exp after 140. Likewise, the character won't loose any exp when it dies after 140.

Would you have any idea why would the command work but not the proper levelling up way? May I have missed a configuration somewhere? Also, as an FYI, I didn't have to move the table as I had enough space underneath.

Thanks in advance! :):
 
Last edited by a moderator:
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
Sounds like you also forgot to patch .

You must have patched it to 140, so those addresses will jmp out to another routine, but that routine will be checking 8C / 8B rather than 96 / 95. (Tolrok says 96, but I'm fairly sure the compare should be one less than max level: untested)
 
Newbie Spellweaver
Joined
Sep 6, 2012
Messages
7
Reaction score
0
Thanks for the pointer Bob! My server is slightly modified from when I owned a private server with another friend. We already extended the table and we had to move a few things out. The point is, I can't find this line:

CMP DWORD PTR DS:[EBX+C8],##

I found and modified all the lines that have "CMP register, 96" but that didn't do the trick. One thing that could help me is to understand the parent method and the method itself where that CMP is used. Would EBX+C8 be the address where the current exp/level is stored?

Many thanks for your help in such a random question!
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
It's C "structure" compilation. EBX is the character structure for the current character, C8 is the offset for the Level.

Code:
if (EBX.C8 < MaxLevel)
{
    EBX.Exp+=Monster.ExpGain;
};
Except it would probably look more like
Code:
if (ThisChar.Level < MaxLevel)
{
    ThisChar.Exp += Monster.ExpGain;
};
Tolrok assumes your client is already 150 max level, and there are similar comparators in the client IINM. Any help?
 
Newbie Spellweaver
Joined
Sep 6, 2012
Messages
7
Reaction score
0
Thanks for the help Bob. I tested the CMP register, level line and that was not the problem: when I lowered the level of that line to 0C, I got DC1 after levelling to 13 but I still gained/lost experience.

The code seems do something like:

- routine that calculates if you have levelled up
1 = level up​
0 = not level up​

- If 1 -> get the exp from the exp table and put it in the character (if this is right, technically you couldn't level up and have 0.001% directly)

- If 0 -> routine that calculates the current experience iterating over the exp table and using the current level

Have you seen anything like it in other clients? I guess somewhere, there is a code that I'm not calling where the data is stored in the server when it's above 140 and that's why the cmd /expup works since it injects directly into my DB. Could I also be missing something in the client?

Another thought: any idea where the death routine is? Maybe I can trace it back from there.

Many thanks!
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
All routines are in different places in different clients, and you haven't linked to any. There is no Death routine in the server. (which is problematic in it's self)

Yes, that looks familiar. I don't think the client tells the server it levelled up, or the other way around. Level up is a "user interface" thing, and the server is only concerned with game save (backup of the character structure in memory) and the Exp within it.

The server checks that you haven't exceeded maximum experience. It checks levels according to the Exp:Level table and iterates reading the sequence of QWords for experience once for each level, stopping when it hits MaxLevel. (why it doesn't stop when it hits the FFFFFFFFFFFFFFFF QWord instead, I'm not sure. If your clients gamesave (character structure memory upload) claims to have gained more Exp than the Exp recorded in the MaxLevel element of the Exp:Level table then some routines will DC you, some will discard that "game save" and others still will try to "correct" the erroneous Experience and push it back to the client.

The same seems true of Health, Mana, Stamina and even Gold, sometimes.

So essentially the client must support Level up to that point, and then you just need to stop the server getting upset that you are over-levelled. (I think that's how it works)

I have a feeling there was more than one Exp recorded in the character structure, and one was rounded to the nearest level. Presumably that is used for calculating TNL? (percentage of exp between last level up and next level up)
 
Back
Top