Requires DataManager and optionally espParser!
Has to be required before any of the modules that use it.
Includes an optional module skillOver100.lua which allows natural skill progression over 100. You need to require after main.lua (such as require("custom.LevelingFramework.skillOver100")). For it to function you should also change the skillCap value in LevelingFramework config.
You can find the configuration file in server/data/custom/__config_LevelingFramework.json after first server launch.
messageenabledwhether LevelingFramework should display a message and play a sound like for normal level ups. Defaulttrue.texttext of the skill increase message. DefaultYour %s skill increased to %s.soundpath to the skill increase sound file. Defaultfx/inter/levelUP.wav.idid of the GUI message box. Default6666.
importESPswhether to parse ESP files on startup. Setting this totruewill significantly increase your server starting times and RAM usage overall. It is recommended to use thelfimportespscommand when necessary. Defaultfalse.cmdRankrank required to use thelfimportespscommand. Default2(admin).skillCapprevent increasing skills above this value. Default100. GMST values, more info here OpenMW ResearchskillNameslist of skill names to display. Default are English version names.fMajorSkillBonusDefault0.75.fMinorSkillBonusDefault1.fMiscSkillBonusDefault1.25.fSpecialSkillBonusDefault0.8.iLevelUpTotalDefault10.iLevelUpMajorMultDefault1.iLevelUpMinorMultDefault1.iLevelUpMajorMultAttributeDefault1.iLevelUpMinorMultAttributeDefault1.iLevelupMiscMultAttriubteDefault1.
Methods:
importESPs()trigger ESP import manuallyincreaseSkill(pid, skillName, value, keepProgress)increases a skill byvaluewhole levels. Sets skill progress to 0 unlesskeepProgressis trueprogressSkill(pid, skillName, progress, count)progresses the skill byprogresscountamount of times. Events:LevelingFramework_OnSkillIncreaseis triggered whenever a skill is increased through this script's methods.
callback arguments arepidandarguments, whereargumentsis a table with the arguments passed toincreaseSkill:skillName,value,keepProgress.
This allows your validators to change values beforeincreaseSkilllogic takes place, such as to implement a custom skill cap (look into event hooks inmain.luafor an example)
Commands:
lfimportespsload skill and class data from ESPs
In my CustomAlchemy script I do the following
LevelingFramework.progressSkill(pid, "Alchemy", 2, potion_count)
Players[pid]:LoadSkills()
Players[pid]:LoadLevel()
to progress players' alchemy skill, using vanilla values of 2 progress per potion brewed.
Note Players[pid]:LoadSkills() and Players[pid]:LoadLevel(), LevelingFramework's functions only operate Players[pid].data, you need to call these functions to sync changes with the client.