• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 0.X Limit Magic Level for Knights

potinho

Intermediate OT User
Joined
Oct 11, 2009
Messages
1,397
Solutions
17
Reaction score
148
Location
Brazil
Good morning people,

Is there anything in sources (mostly old ones like mine) that can limit Magic Level? I ask because the Knights on my server can't pass ML 13, I haven't seen if there is a limitation for mages, as many have already passed ML 130. Could you help me?

up

up
 
Good morning people,

Is there anything in sources (mostly old ones like mine) that can limit Magic Level? I ask because the Knights on my server can't pass ML 13, I haven't seen if there is a limitation for mages, as many have already passed ML 130. Could you help me?

what do you mean they "cant"

Generally, trying to advance past that ml13 on a knight with the standard exp rate is going to be incredibly long and hard, without boosted rates.

You can adjust the rate at which they advance in magic in the vocations xml file.
 
what do you mean they "cant"

Generally, trying to advance past that ml13 on a knight with the standard exp rate is going to be incredibly long and hard, without boosted rates.

You can adjust the rate at which they advance in magic in the vocations xml file.
I understand, I found it strange that there are players who have been training for months and have been leveling up. I have a player who has been training for 23 days and hasn't advanced 1% in his ml, missing 16% to advance. Funny that the training was viable until it reached 16% to level up to ML 14 (being a knight).
 
Can't answer the knight question but there is an overall limit of 255 for all vocations.
A player told me that he even managed to get ml 14, but after SS he went back to 13, with the same 16% missing for 14, it seems that knights are limited until then. It is already the second player that reports this to me.
 
You're getting past the max value of int32 (2,147,483,647).
From 13 to 14 mlvl you need to burn 2,550,916,800 mana points (version >= 7.6). ~84.2% of that number equals the max value of int32, which is exactly the point you're getting stuck at.
You probably store the mana spent for the next mlvl as int, so it overflows to negative.
 
Last edited:
You're getting past the max value of int32 (2,147,483,647).
Only from 13 to 14 mlvl you need to burn 2,550,916,800 mana points (version >= 7.6). ~84.2% of that number is exactly the max value of int32, which is the point you're getting stuck at.
You probably store the total mana spent as double or unsigned int, but apparently not the mana spent for the next mlvl, so it overflows to negative.t
Is there a way to fix?
 
Is there a way to fix?
link that repo

It looks fine in tfs sources, apart from death function in version 0.4, where it uses uint32 to calculate total mana instead of uint64, but this is unrelated.
So you either use other sources (probably some old long outdated server?) or the problem is elsewhere. E.g. you use int for manaSpent in your data base instead of big int. This would explain why some player was able to advance but the progress was not saved.
 
Last edited:
Which files did u check? Maybe is kind different here. Here is the bugged player:

View attachment 67907
I checked player.h and player.cpp, if you used the same mysql schema it looks fine too
Code:
`manaspent` BIGINT UNSIGNED NOT NULL DEFAULT 0,

The "bugged player" in your screenshot actually has 14 mlvl, so it contradicts the info you provided before.
 
I checked player.h and player.cpp, if you used the same mysql schema it looks fine too
Code:
`manaspent` BIGINT UNSIGNED NOT NULL DEFAULT 0,

The "bugged player" in your screenshot actually has 14 mlvl, so it contradicts the info you provided before.
I put it in game, addind a mlvl to see if unlock 13 value and mlvl goes on up percent value
 
Back
Top