aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-03-27 19:07:41 -0500
committermat <github@matdoes.dev>2022-03-27 19:07:41 -0500
commitac72f729ba04c3ed8523e16c86bf8f61e3271fa7 (patch)
tree20669a507b7abcb93b2a423395d35fd3d8f6ec9a
parent5105df276bfba0425d8acde26ab00862a83a7d82 (diff)
downloadskyblock-api-ac72f729ba04c3ed8523e16c86bf8f61e3271fa7.tar.gz
skyblock-api-ac72f729ba04c3ed8523e16c86bf8f61e3271fa7.tar.bz2
skyblock-api-ac72f729ba04c3ed8523e16c86bf8f61e3271fa7.zip
Add levelXpRequired to skills with 0 xp
-rw-r--r--src/cleaners/skyblock/skills.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cleaners/skyblock/skills.ts b/src/cleaners/skyblock/skills.ts
index ac5c10c..9aa3fb7 100644
--- a/src/cleaners/skyblock/skills.ts
+++ b/src/cleaners/skyblock/skills.ts
@@ -176,13 +176,15 @@ export async function cleanSkills(data: typedHypixelApi.SkyBlockProfileMember):
// add missing skills
const missingSkillNames = allSkillNames.filter(skillName => !skills.some(skill => skill.name === skillName))
for (const skillName of missingSkillNames) {
+ const skillMaxLevel = skillsMaxLevel[skillName] ?? skillsDefaultMaxLevel
+ const xpTable = (skillMaxLevel <= 25 ? skillXpTableEasier : skillXpTable).slice(0, skillMaxLevel)
skills.push({
name: skillName,
xp: 0,
level: 0,
- maxLevel: skillsMaxLevel[skillName] ?? skillsDefaultMaxLevel,
+ maxLevel: skillMaxLevel,
levelXp: 0,
- levelXpRequired: 0
+ levelXpRequired: xpTable[0]
})
}