• 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

Advanced OT User
Joined
Oct 11, 2009
Messages
1,403
Solutions
17
Reaction score
151
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
 
thanks for the tip. just for understand, what does this change in the table? will probably fix my problem?
Unsigned means that the value can't be negative (which is true for mana spent, you can't go below 0, even if you lose it on death) and with that it increases the limit (from 2,147,483,648 to 4,294,967,295). Also in sources you linked, manaspent is saved as unsigned int64 (even bigger than unsigned int32, but it won't matter).
So yes, it will fix your problem, people can now get twice as much manaspent.
 
Unsigned means that the value can't be negative (which is true for mana spent, you can't go below 0, even if you lose it on death) and with that it increases the limit (from 2,147,483,648 to 4,294,967,295). Also in sources you linked, manaspent is saved as unsigned int64 (even bigger than unsigned int32, but it won't matter).
So yes, it will fix your problem, people can now get twice as much manaspent.
thanks for answer!
 
Make manaspent unsigned.
will probably fix my problem?
Not exactly. The problem will soon appear again at the next mlvl (somewhere around halfway from 14 to 15). You should change it to BIGINT UNSIGNED like it was in the schema. It represents uint64, which is used in the sources, and ensures range as big as you will ever need.
 
Last edited:
Not exactly. The problem will soon appear again at the next mlvl (somewhere around halfway from 14 to 15). You should change it to BIGINT UNSIGNED like it was in the schema. It's the same as uint64, which is used in the sources, and ensures range as you will ever need.
Damn, 1 more level and the numbers are that much higher? Tibia has some weird ass formulas lol
 
Damn, 1 more level and the numbers are that much higher? Tibia has some weird ass formulas lol
Not exactly. The problem will soon appear again at the next mlvl (somewhere around halfway from 14 to 15). You should change it to BIGINT UNSIGNED like it was in the schema. It represents uint64, which is used in the sources, and ensures range as big as you will ever need.
1652793650799.png

have changed, thank you both guys!
 
bigint(20) I am pretty sure the (11) is how big the number can be in length: 11 = 00000000000
change it to (20) just to make sure there is no limitation for the bigint. 20 = 00000000000000000000
changed


21
manaspentbigint(20)UNSIGNEDNão0
 
bigint(20) I am pretty sure the (11) is how big the number can be in length: 11 = 00000000000
change it to (20) just to make sure there is no limitation for the bigint. 20 = 00000000000000000000
No, it's not. That number only specifies number of digits for padding which is irrelevant here. Bigint is always gonna have 64 bits, allowing you to store values up to 2^64 - 1.
 
Last edited:
You could just put in some code for player:getMagicLevel() in sources to return a max level for the knights vocation, regardless of what it actually is or should be.
 
Back
Top