From 4f3b93e359ac523e3fc3494653aa8a26e62845a8 Mon Sep 17 00:00:00 2001 From: Melledy <121644117+Melledy@users.noreply.github.com> Date: Mon, 23 Feb 2026 21:36:37 -0800 Subject: [PATCH] Fix proving grounds weekly quest and reward calculations --- .../nebula/game/instance/InstanceManager.java | 19 ++- .../emu/nebula/game/quest/QuestCondType.java | 157 ------------------ .../emu/nebula/game/quest/QuestCondition.java | 27 ++- 3 files changed, 32 insertions(+), 171 deletions(-) delete mode 100644 src/main/java/emu/nebula/game/quest/QuestCondType.java diff --git a/src/main/java/emu/nebula/game/instance/InstanceManager.java b/src/main/java/emu/nebula/game/instance/InstanceManager.java index 9cbfa2f..b28f1e5 100644 --- a/src/main/java/emu/nebula/game/instance/InstanceManager.java +++ b/src/main/java/emu/nebula/game/instance/InstanceManager.java @@ -156,13 +156,11 @@ public class InstanceManager extends PlayerManager { if (settleData.isWin()) { // Calculate rewards int entries = this.getPlayer().getInventory().getResourceCount(GameConstants.WEEKLY_ENTRY_ITEM_ID); + var rewards = new ItemParamMap(); if (entries > 0) { // Generate regular rewards - settleData.setRewards(data.getRewards().generate()); - - // Add regular rewards - getPlayer().getInventory().addItems(settleData.getRewards(), change); + rewards.add(data.getRewards().generate()); // Remove weekly entry getPlayer().getInventory().removeItem(GameConstants.WEEKLY_ENTRY_ITEM_ID, 1, change); @@ -171,10 +169,16 @@ public class InstanceManager extends PlayerManager { // Add first clear rewards even if we dont have the entry ticket if (settleData.isFirst()) { // Generate first clear rewards - settleData.setRewards(data.getFirstRewards().generate()); + rewards.add(data.getFirstRewards().generate()); + } + + // Calculate rewards if we have any + if (!rewards.isEmpty()) { + // Set rewards in settle data + settleData.setRewards(rewards); - // Add to inventory - getPlayer().getInventory().addItems(settleData.getFirstRewards(), change); + // Add rewards to inventory + getPlayer().getInventory().addItems(rewards, change); } // Log @@ -182,6 +186,7 @@ public class InstanceManager extends PlayerManager { // Quest triggers this.getPlayer().trigger(QuestCondition.WeekBoosClearSpecificDifficultyAndTotal, 1); + this.getPlayer().trigger(QuestCondition.WeekBossClearTotal, 1); this.getPlayer().trigger(QuestCondition.BattleTotal, 1); } diff --git a/src/main/java/emu/nebula/game/quest/QuestCondType.java b/src/main/java/emu/nebula/game/quest/QuestCondType.java deleted file mode 100644 index 74b79c5..0000000 --- a/src/main/java/emu/nebula/game/quest/QuestCondType.java +++ /dev/null @@ -1,157 +0,0 @@ -package emu.nebula.game.quest; - -import it.unimi.dsi.fastutil.ints.Int2ObjectMap; -import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; -import lombok.Getter; - -public enum QuestCondType { - BattleTotal (3), - BattlesTotalWithPartner (4), - CharacterAcquireQuantityRarityAndAdvancement (6), - CharacterAdvanceTotal (7), - CharacterSkillUpTotal (8), - CharacterSkillWithSpecificUpTotal (9), - CharacterUpTotal (12), - CharacterWithSpecificAdvance (13), - CharacterWithSpecificUpLevel (15), - CharactersWithSpecificNumberLevelAndAttributes (17), - CharactersWithSpecificQuantityAdvancementCountAndAttribute (19), - CharactersWithSpecificQuantityRarityAndLevel (22), - ChatTotal (23), - DailyInstanceClearSpecificDifficultyAndTotal (24), - DailyInstanceClearSpecificTypeAndTotal (25), - DailyInstanceClearTotal (26), - DiscAcquireQuantityLevelAndRarity (30), - DiscAcquireQuantityPhaseAndRarity (31), - DiscAcquireQuantityStarAndRarity (32), - DiscLimitBreakTotal (33), - DiscPromoteTotal (34), - DiscStrengthenTotal (35), - DiscWithSpecificQuantityLevelAndRarity (36), - DiscWithSpecificQuantityPhaseAndRarity (37), - DiscWithSpecificQuantityStarAndRarity (38), - EnergyDeplete (39), - GachaTotal (44), - GiftGiveTotal (45), - InfinityTowerClearSpecificFloor (46), - InfinityTowerClearTotal (47), - ItemsAdd (48), - ItemsDeplete (49), - ItemsProductTotal (50), - LoginTotal (51), - QuestTravelerDuelChallengeTotal (52), - QuestTourGuideSpecific (53), - QuestWithSpecificType (55), - RegionBossClearSpecificFullStarWithBossIdAndDifficulty (56), - RegionBossClearSpecificLevelWithDifficultyAndTotal (57), - RegionBossClearSpecificTotal (58), - RegionBossClearTotal (59), - SkillsWithSpecificQuantityAndLevel (60), - StageClearSpecificStars (62), - StoryClear (63), - TravelerDuelChallengeSpecificBoosLevelWithDifficultyAndTotal (64), - TravelerDuelChallengeClearSpecificBossLevelAndAffix (67), - TravelerDuelClearSpecificBossTotal (69), - WorldClassSpecific (71), - RegionBossClearSpecificTypeWithTotal (72), - CharactersWithSpecificDatingCount (73), - CharactersDatingTotal (74), - VampireSurvivorPassedSpecificLevel (77), - CharacterParticipateTowerNumber (78), - CharacterAllSkillReachSpecificLevel (79), - VampireClearTotal (81), - VampireWithSpecificClearTotal (82), - AgentFinishTotal (83), - AgentWithSpecificFinishTotal (84), - ActivityMiningEnterLayer (86), - ActivityMiningDestroyGrid (87), - BossRushTotalStars (88), - InfinityTowerClearSpecificDifficultyAndTotal (89), - SkillInstanceClearTotal (90), - VampireSurvivorSpecificPassedLevel (91), - WeekBoosClearSpecificDifficultyAndTotal (92), - NpcAffinityWithSpecificLevel (93), - CharacterPassedWithSpecificTowerAndCount (94), - ActivityCookieLevelAccPackage (96), - ActivityCookieLevelScore (97), - ActivityCookieTypeAccPackage (98), - ActivityCookieTypeAccPackCookie (99), - ActivityCookieTypeAccRhythm (100), - ActivityCookieTypeChallenge (101), - CharGemInstanceClearTotal (104), - DailyShopReceiveShopTotal (105), - AgentApplyTotal (106), - ActivityScore (107), - ActivityTypeAvgReadWithSpecificIdAndLevelId (108), - ActivityTypeLevelPassedWithSpecificIdAndLevelId (109), - ActivityTypeLevel3StarPassedWithSpecificIdAndLevelId (110), - ActivityTypeLevelStarWithSpecificIdAndLevelTypeTotal (111), - ActivityTypeLevelPassedWithSpecificIdAndLevelIdAndSpecificPositionAndCharElem (112), - ActivityTypeLevelPassedSpecificIdTotal (113), - StorySetClearSpecific (116), - CharacterWithSpecificSkillAndLevel (118), - DiscWithSpecificQuantityLevelAndAttr (119), - TutorialLevelClearSpecific (120), - TutorialLevelSpecificClearTotal (121), - DiscWithSpecificQuantityPhaseAndAttr (122), - WeekBossClearTotal (123), - ActivityStoryReadStory (124), - ClientReport (200), - TowerBattleTimes (501), - TowerBossChallengeSpecificHighRewardWithTotal (502), - TowerBuildSpecificCharacter (503), - TowerBuildSpecificScoreWithTotal (504), - TowerClearSpecificCharacterTypeWithTotal (505), - TowerClearSpecificGroupIdAndDifficulty (506), - TowerClearSpecificLevelWithDifficultyAndTotal (507), - TowerClearTotal (508), - TowerEnterRoom (509), - TowerEnterTotal (510), - TowerEventTimes (511), - TowerFateTimes (512), - TowerItemsGet (513), - TowerSpecificDifficultyShopBuyTimes (514), - TowerGrowthSpecificNote (515), - TowerClearSpecificLevelWithDifficultyAndTotalHistory (516), - TowerBookWithSpecificEvent (517), - TowerBookWithSpecificFateCard (518), - TowerBookWithSpecificPotential (520), - TowerBuildSpecificDifficultyAndScoreWithTotal (521), - TowerSpecificDifficultyStrengthenMachineTotal (522), - TowerSpecificDifficultyKillBossTotal (524), - TowerBookSpecificCharWithPotentialTotal (525), - TowerBuildSpecificCharSpecificScoreWithTotal (526), - TowerGrowthWithSpecificNote (527), - TowerSpecificFateCardReRollTotal (528), - TowerSpecificPotentialReRollTotal (529), - TowerSpecificShopReRollTotal (530), - TowerSpecificNoteActivateTotal (531), - TowerSpecificNoteLevelTotal (532), - TowerSpecificPotentialBonusTotal (533), - TowerSpecificPotentialLuckyTotal (534), - TowerSpecificShopBuyDiscountTotal (535), - TowerSpecificSecondarySkillActivateTotal (536), - TowerSpecificGetExtraNoteLvTotal (537), - TowerEnterFloor (538), - TowerSweepTimes (539), - TowerSweepTotal (540), - TowerBattleWithPartner (541); - - @Getter - private final int value; - private final static Int2ObjectMap map = new Int2ObjectOpenHashMap<>(); - - static { - for (QuestCondType type : QuestCondType.values()) { - map.put(type.getValue(), type); - } - } - - private QuestCondType(int value) { - this.value = value; - } - - public static QuestCondType getByValue(int value) { - return map.get(value); - } -} diff --git a/src/main/java/emu/nebula/game/quest/QuestCondition.java b/src/main/java/emu/nebula/game/quest/QuestCondition.java index 54ba9b9..dfa2bf8 100644 --- a/src/main/java/emu/nebula/game/quest/QuestCondition.java +++ b/src/main/java/emu/nebula/game/quest/QuestCondition.java @@ -41,7 +41,6 @@ public enum QuestCondition { LoginTotal (51), QuestTravelerDuelChallengeTotal (52), QuestTourGuideSpecific (53), - QuestTravelerDuelSpecific (54), QuestWithSpecificType (55), RegionBossClearSpecificFullStarWithBossIdAndDifficulty (56), RegionBossClearSpecificLevelWithDifficultyAndTotal (57), @@ -51,12 +50,8 @@ public enum QuestCondition { StageClearSpecificStars (62), StoryClear (63), TravelerDuelChallengeSpecificBoosLevelWithDifficultyAndTotal (64), - TravelerDuelClearBossTotal (65), - TravelerDuelClearSpecificBossIdAndDifficulty (66), TravelerDuelChallengeClearSpecificBossLevelAndAffix (67), - TravelerDuelClearSpecificBossLevelWithDifficultyAndTotal (68), TravelerDuelClearSpecificBossTotal (69), - TravelerDuelChallengeRankUploadTotal (70), WorldClassSpecific (71), RegionBossClearSpecificTypeWithTotal (72), CharactersWithSpecificDatingCount (73), @@ -64,7 +59,6 @@ public enum QuestCondition { VampireSurvivorPassedSpecificLevel (77), CharacterParticipateTowerNumber (78), CharacterAllSkillReachSpecificLevel (79), - TravelerDuelPlayTotal (80), VampireClearTotal (81), VampireWithSpecificClearTotal (82), AgentFinishTotal (83), @@ -94,10 +88,28 @@ public enum QuestCondition { ActivityTypeLevelStarWithSpecificIdAndLevelTypeTotal (111), ActivityTypeLevelPassedWithSpecificIdAndLevelIdAndSpecificPositionAndCharElem (112), ActivityTypeLevelPassedSpecificIdTotal (113), + StorySetClearSpecific (116), + CharacterWithSpecificSkillAndLevel (118), + DiscWithSpecificQuantityLevelAndAttr (119), + TutorialLevelClearSpecific (120), + TutorialLevelSpecificClearTotal (121), + DiscWithSpecificQuantityPhaseAndAttr (122), + WeekBossClearTotal (123), + ActivityStoryReadStory (124), ClientReport (200), + TowerBattleTimes (501), + TowerBossChallengeSpecificHighRewardWithTotal (502), + TowerBuildSpecificCharacter (503), TowerBuildSpecificScoreWithTotal (504), + TowerClearSpecificCharacterTypeWithTotal (505), + TowerClearSpecificGroupIdAndDifficulty (506), TowerClearSpecificLevelWithDifficultyAndTotal (507), + TowerClearTotal (508), + TowerEnterRoom (509), TowerEnterTotal (510), + TowerEventTimes (511), + TowerFateTimes (512), + TowerItemsGet (513), TowerSpecificDifficultyShopBuyTimes (514), TowerGrowthSpecificNote (515), TowerClearSpecificLevelWithDifficultyAndTotalHistory (516), @@ -122,7 +134,8 @@ public enum QuestCondition { TowerSpecificGetExtraNoteLvTotal (537), TowerEnterFloor (538), TowerSweepTimes (539), - TowerSweepTotal (540); + TowerSweepTotal (540), + TowerBattleWithPartner (541); @Getter private final int value;