From bd8c8513eb5bc1c09d5a3de35e238bcabbd353e4 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sun, 6 Apr 2025 16:13:38 +0200 Subject: [PATCH 1/2] feat: handle droptable rewards from level key --- package-lock.json | 8 ++++---- package.json | 2 +- src/services/missionInventoryUpdateService.ts | 10 ++++++++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 890754cc..c036a710 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "morgan": "^1.10.0", "ncp": "^2.0.0", "typescript": ">=5.5 <5.6.0", - "warframe-public-export-plus": "^0.5.50", + "warframe-public-export-plus": "^0.5.51", "warframe-riven-info": "^0.1.2", "winston": "^3.17.0", "winston-daily-rotate-file": "^5.0.0" @@ -3789,9 +3789,9 @@ } }, "node_modules/warframe-public-export-plus": { - "version": "0.5.50", - "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.50.tgz", - "integrity": "sha512-KlhdY/Q5sRAIn/RhmdviKBoX3gk+Jtuen0cWnFB2zqK7eKYMDtd79bKOtTPtnK9zCNzh6gFug2wEeDVam3Bwlw==" + "version": "0.5.51", + "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.51.tgz", + "integrity": "sha512-V1mMf3Q9711fBtE2LbbliGTemYIxMuuKlCOnv4juttKppVXI/e4zPNpVo/eSvTbqTP7RMm/WPsooOUxn42si7Q==" }, "node_modules/warframe-riven-info": { "version": "0.1.2", diff --git a/package.json b/package.json index 36bf7738..53f5b252 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "morgan": "^1.10.0", "ncp": "^2.0.0", "typescript": ">=5.5 <5.6.0", - "warframe-public-export-plus": "^0.5.50", + "warframe-public-export-plus": "^0.5.51", "warframe-riven-info": "^0.1.2", "winston": "^3.17.0", "winston-daily-rotate-file": "^5.0.0" diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index 60fda2d4..eef2bad4 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -721,6 +721,16 @@ export const addFixedLevelRewards = ( MissionRewards.push(item); } } + if (rewards.droptable) { + logger.debug(`rolling ${rewards.droptable} for level key rewards`); + const reward = getRandomRewardByChance(ExportRewards[rewards.droptable][0]); + if (reward) { + MissionRewards.push({ + StoreItem: reward.type, + ItemCount: reward.itemCount + }); + } + } return missionBonusCredits; }; -- 2.47.2 From 7ca8c9d857f9241320defaae75fd96ac9cc9101e Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sun, 6 Apr 2025 16:27:22 +0200 Subject: [PATCH 2/2] handle droptable possibly missing in ExportRewards --- src/services/missionInventoryUpdateService.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index eef2bad4..aab12457 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -722,13 +722,17 @@ export const addFixedLevelRewards = ( } } if (rewards.droptable) { - logger.debug(`rolling ${rewards.droptable} for level key rewards`); - const reward = getRandomRewardByChance(ExportRewards[rewards.droptable][0]); - if (reward) { - MissionRewards.push({ - StoreItem: reward.type, - ItemCount: reward.itemCount - }); + if (rewards.droptable in ExportRewards) { + logger.debug(`rolling ${rewards.droptable} for level key rewards`); + const reward = getRandomRewardByChance(ExportRewards[rewards.droptable][0]); + if (reward) { + MissionRewards.push({ + StoreItem: reward.type, + ItemCount: reward.itemCount + }); + } + } else { + logger.error(`unknown droptable ${rewards.droptable}`); } } return missionBonusCredits; -- 2.47.2