• 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!

exp stages problem

andu

Sold 649 scripts, 25 maps and 9 events!
Joined
Aug 7, 2009
Messages
969
Solutions
17
Reaction score
354
GitHub
olrios
Twitch
olrios
Once player reaches level 36 he no longer gets any exp. Where's the problem? Worked well in 0.3 and 0.4 but doesn't work in 1.2 at all.

XML:
<stages>
    <config enabled="1" />
    <stage minlevel="1" maxlevel="35" multiplier="5"/>
    <stage minlevel="36" maxlevel="36" multiplier="4.9152"/>
    <stage minlevel="37" maxlevel="37" multiplier="4.7628"/>
    <stage minlevel="38" maxlevel="38" multiplier="4.6128"/>
    <stage minlevel="39" maxlevel="39" multiplier="4.4652"/>
    <stage minlevel="40" maxlevel="40" multiplier="4.32"/>
    
...
 
There is no support for floating point values for exp stage multipliers anymore.
 
Solution
LUA faster then XML?

Solved it by editing event/scripts/player.lua under gainExperience
Lua:
local function getExpStage(level)
    if level <= 35 then
        return 5.0
    else
        local stages = {
            [36] = 4.9152,
            [37] = 4.7628,
            [38] = 4.6128,
            [39] = 4.4652,
            ...
        }
        return stages[level]
    end
    return 1
end
 
Don't know which would be faster (you should mean Lua vs pugixml library in c++), but it shouldn't even matter.
 
Back
Top