From a08487a9e555ff4fa6a24a2ddf2fc5c18a5925a1 Mon Sep 17 00:00:00 2001 From: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Date: Mon, 23 Jun 2025 21:10:19 +0200 Subject: [PATCH] fix: use correct dropTable for bounty stage reward Re #388 --- src/services/missionInventoryUpdateService.ts | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index 7ee1b3c5..9f45f810 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -1629,7 +1629,19 @@ function getRandomMissionDrops( } rewardManifests = [job.rewards]; if (job.xpAmounts.length > 1) { - rotations = [RewardInfo.JobStage! % (job.xpAmounts.length - 1)]; + const curentStage = RewardInfo.JobStage! + 1; + const totalStage = job.xpAmounts.length; + let tableIndex = 1; // Stage 2, Stage 3 of 4, and Stage 3 of 5 + + if (curentStage == 1) { + tableIndex = 0; + } else if (curentStage == totalStage) { + tableIndex = 3; + } else if (totalStage == 5 && curentStage == 4) { + tableIndex = 2; + } + + rotations = [tableIndex]; } else { rotations = [0]; } @@ -1638,11 +1650,8 @@ function getRandomMissionDrops( (RewardInfo.JobStage === job.xpAmounts.length - 1 || job.isVault) && !isEndlessJob ) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (ExportRewards[job.rewards]) { - rewardManifests.push(job.rewards); - rotations.push(ExportRewards[job.rewards].length - 1); - } + rewardManifests.push(job.rewards); + rotations.push(3); } } }