Jump to content
Sign in to follow this  

[Help] Allow the player to gain XP even when he is at max

Recommended Posts



So I've been trying to find a way to still receive XP from a skill when that particular XP is already at its max level (e.g : get woodwork XP when building wooden floor while being a lvl 10 carpenter).


My original thoughts was to increase the max level, which I did, but as I suspected, that only had an effect on the GUI element (make sense considering I was modifying a GUI element/pane in the client directory, that file being /client/XpSystem/ISUIISSkillProgressBar.lua).


Then I though I could simply remove the 10th skill lvl from given character. But that doesn't seem to be working. I could'nt find a way to remove XP, wether I use the various functions with a negative value or tried to set it back to a certain lvl, that simply didn't seem to work (Current script below in spoiler).


If you have any idea regarding the feasibility of it, I'm all ears :D


Cheers !


local function doPrint(txt)

local function doPerkLimitation()
    local perkList = PerkFactory.PerkList
    local perkListSize = perkList:size()    

    doPrint("Perks to loop :"..perkListSize)

    for i = 0, perkListSize-1 do -- loop through PerkList
        local perk = perkList:get(i)
        local skill = perk:getType()
        local perkLevel = getPlayer():getPerkLevel(skill)
        if perkLevel > 9 then -- if maxed-out then put it to 9
            doPrint("Found a perk where max level is reached:"..tostring(skill))
            getPlayer():getXp():setXPToLevel(skill, 0) -- tried that
            getPlayer():getXp():AddXPNoMultiplier(skill, -5000) -- that too
            getPlayer():getXp():AddXP(Perks.Woodwork, -10000); -- and even the same function with the direct enum ref, just in case
            doPrint("Removed XP:")
            for i = 1,9 do -- then set it
                --player:LevelPerk(skill, false) -- though I would be lvl up back using that, but was never used because I couldn't get anywhere near removing XP/skill lvl


Edited by Ersir
additional details

Share this post

Link to post
Share on other sites

This would not be to bad an idea since say once you hit tenth level all skill book multipliers would be gone and you gain at regular level. But this still could be abused as it might be slower gains with carpentry it still is easy enough to do. Maybe once hit tenth drop it to normal skill level but at 0.25 percent gain.


Avg Skill Lvl / 4


Slow but it would still assist.

Share this post

Link to post
Share on other sites

I'm not sure you realize it's not a suggestion regarding game behavior, but a request for help regarding modding :D

If you do, sorry, I just had the impression otherwise.


Share this post

Link to post
Share on other sites

I don't have any problem with that, and your suggestions are welcome, I just wanted to be sure I was expressing myself clearly ^^

Again, if anyone has an idea regarding the way to remove a skill level, that would be much appreciated.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...