diff --git a/config/config.json b/config/config.json index 932b338..68976bf 100644 --- a/config/config.json +++ b/config/config.json @@ -4,5 +4,6 @@ "LooseKeyPileProbability": 0.2, "AlterKeyCardProbability": true, "LooseKeycardProbability": 0.02, - "staticRelativeProbability": 1658 + "drawerStaticRelativeProbability": 1658, + "jacketStaticRelativeProbability": 829 } \ No newline at end of file diff --git a/package.json b/package.json index 4f18914..a1639b5 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "LooseKeyModifier", - "version": "1.0.1", + "version": "1.0.2", "main": "src/mod.js", "license": "See License file", "author": "Kaeno", - "akiVersion": "^3.5.1", + "akiVersion": "^3.6.1", "devDependencies": { "@types/node": "16.18.10", diff --git a/src/mod.ts b/src/mod.ts index 799249c..f38a2f6 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -30,18 +30,40 @@ class Lkm implements IPostDBLoadMod { continue; } - for (const itemDistribution of staticy) + if (staticName === "578f87b7245977356274f2cd") // Drawer { - if (itemHelper.isOfBaseclass(itemDistribution.tpl, BaseClasses.KEY_MECHANICAL)) + for (const itemDistribution of staticy) { - const matchingItem = staticy.find(s => s.tpl === itemDistribution.tpl); - if (matchingItem) + if (itemHelper.isOfBaseclass(itemDistribution.tpl, BaseClasses.KEY_MECHANICAL)) { - if (itemDistribution.relativeProbability < config.staticRelativeProbability) + const matchingItem = staticy.find(s => s.tpl === itemDistribution.tpl); + if (matchingItem) { - // By Default this is based of the Yotota Key and been divided by 2 - itemDistribution.relativeProbability = config.staticRelativeProbability; - count++; + if (itemDistribution.relativeProbability < config.drawerStaticRelativeProbability) + { + // By Default this is based of the Yotota Key and been divided by 2 + itemDistribution.relativeProbability = config.drawerStaticRelativeProbability; + count++; + } + } + } + } + } + if (staticName === "578f8778245977358849a9b5") // Jackets + { + for (const itemDistribution of staticy) + { + if (itemHelper.isOfBaseclass(itemDistribution.tpl, BaseClasses.KEY_MECHANICAL)) + { + const matchingItem = staticy.find(s => s.tpl === itemDistribution.tpl); + if (matchingItem) + { + if (itemDistribution.relativeProbability < (config.jacketStaticRelativeProbability)) + { + // By Default this is based of the Yotota Key and been divided by 4 + itemDistribution.relativeProbability = (config.jacketStaticRelativeProbability); + count++; + } } } }