Ersir Posted January 23, 2019 Share Posted January 23, 2019 (edited) Hi, 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 Cheers ! local function doPrint(txt) print("-->ResetToLevelNineErsir::"..txt) end 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 end end end end Events.OnGameStart.Add(doPerkLimitation) Edited January 23, 2019 by Ersir additional details Link to comment Share on other sites More sharing options...
nickodemos Posted January 23, 2019 Share Posted January 23, 2019 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. Link to comment Share on other sites More sharing options...
Ersir Posted January 24, 2019 Author Share Posted January 24, 2019 I'm not sure you realize it's not a suggestion regarding game behavior, but a request for help regarding modding If you do, sorry, I just had the impression otherwise. Link to comment Share on other sites More sharing options...
nickodemos Posted January 24, 2019 Share Posted January 24, 2019 Yes I got that but I was putting it in as a "Hope for the future" and my idea on it. Sorry about taking over the thread with something you was not asking for. Link to comment Share on other sites More sharing options...
Ersir Posted January 24, 2019 Author Share Posted January 24, 2019 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now