Fix proving grounds weekly quest and reward calculations

This commit is contained in:
Melledy
2026-02-23 21:36:37 -08:00
parent 8809b1646e
commit 4f3b93e359
3 changed files with 32 additions and 171 deletions
@@ -156,13 +156,11 @@ public class InstanceManager extends PlayerManager {
if (settleData.isWin()) { if (settleData.isWin()) {
// Calculate rewards // Calculate rewards
int entries = this.getPlayer().getInventory().getResourceCount(GameConstants.WEEKLY_ENTRY_ITEM_ID); int entries = this.getPlayer().getInventory().getResourceCount(GameConstants.WEEKLY_ENTRY_ITEM_ID);
var rewards = new ItemParamMap();
if (entries > 0) { if (entries > 0) {
// Generate regular rewards // Generate regular rewards
settleData.setRewards(data.getRewards().generate()); rewards.add(data.getRewards().generate());
// Add regular rewards
getPlayer().getInventory().addItems(settleData.getRewards(), change);
// Remove weekly entry // Remove weekly entry
getPlayer().getInventory().removeItem(GameConstants.WEEKLY_ENTRY_ITEM_ID, 1, change); 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 // Add first clear rewards even if we dont have the entry ticket
if (settleData.isFirst()) { if (settleData.isFirst()) {
// Generate first clear rewards // Generate first clear rewards
settleData.setRewards(data.getFirstRewards().generate()); rewards.add(data.getFirstRewards().generate());
}
// Add to inventory // Calculate rewards if we have any
getPlayer().getInventory().addItems(settleData.getFirstRewards(), change); if (!rewards.isEmpty()) {
// Set rewards in settle data
settleData.setRewards(rewards);
// Add rewards to inventory
getPlayer().getInventory().addItems(rewards, change);
} }
// Log // Log
@@ -182,6 +186,7 @@ public class InstanceManager extends PlayerManager {
// Quest triggers // Quest triggers
this.getPlayer().trigger(QuestCondition.WeekBoosClearSpecificDifficultyAndTotal, 1); this.getPlayer().trigger(QuestCondition.WeekBoosClearSpecificDifficultyAndTotal, 1);
this.getPlayer().trigger(QuestCondition.WeekBossClearTotal, 1);
this.getPlayer().trigger(QuestCondition.BattleTotal, 1); this.getPlayer().trigger(QuestCondition.BattleTotal, 1);
} }
@@ -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<QuestCondType> 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);
}
}
@@ -41,7 +41,6 @@ public enum QuestCondition {
LoginTotal (51), LoginTotal (51),
QuestTravelerDuelChallengeTotal (52), QuestTravelerDuelChallengeTotal (52),
QuestTourGuideSpecific (53), QuestTourGuideSpecific (53),
QuestTravelerDuelSpecific (54),
QuestWithSpecificType (55), QuestWithSpecificType (55),
RegionBossClearSpecificFullStarWithBossIdAndDifficulty (56), RegionBossClearSpecificFullStarWithBossIdAndDifficulty (56),
RegionBossClearSpecificLevelWithDifficultyAndTotal (57), RegionBossClearSpecificLevelWithDifficultyAndTotal (57),
@@ -51,12 +50,8 @@ public enum QuestCondition {
StageClearSpecificStars (62), StageClearSpecificStars (62),
StoryClear (63), StoryClear (63),
TravelerDuelChallengeSpecificBoosLevelWithDifficultyAndTotal (64), TravelerDuelChallengeSpecificBoosLevelWithDifficultyAndTotal (64),
TravelerDuelClearBossTotal (65),
TravelerDuelClearSpecificBossIdAndDifficulty (66),
TravelerDuelChallengeClearSpecificBossLevelAndAffix (67), TravelerDuelChallengeClearSpecificBossLevelAndAffix (67),
TravelerDuelClearSpecificBossLevelWithDifficultyAndTotal (68),
TravelerDuelClearSpecificBossTotal (69), TravelerDuelClearSpecificBossTotal (69),
TravelerDuelChallengeRankUploadTotal (70),
WorldClassSpecific (71), WorldClassSpecific (71),
RegionBossClearSpecificTypeWithTotal (72), RegionBossClearSpecificTypeWithTotal (72),
CharactersWithSpecificDatingCount (73), CharactersWithSpecificDatingCount (73),
@@ -64,7 +59,6 @@ public enum QuestCondition {
VampireSurvivorPassedSpecificLevel (77), VampireSurvivorPassedSpecificLevel (77),
CharacterParticipateTowerNumber (78), CharacterParticipateTowerNumber (78),
CharacterAllSkillReachSpecificLevel (79), CharacterAllSkillReachSpecificLevel (79),
TravelerDuelPlayTotal (80),
VampireClearTotal (81), VampireClearTotal (81),
VampireWithSpecificClearTotal (82), VampireWithSpecificClearTotal (82),
AgentFinishTotal (83), AgentFinishTotal (83),
@@ -94,10 +88,28 @@ public enum QuestCondition {
ActivityTypeLevelStarWithSpecificIdAndLevelTypeTotal (111), ActivityTypeLevelStarWithSpecificIdAndLevelTypeTotal (111),
ActivityTypeLevelPassedWithSpecificIdAndLevelIdAndSpecificPositionAndCharElem (112), ActivityTypeLevelPassedWithSpecificIdAndLevelIdAndSpecificPositionAndCharElem (112),
ActivityTypeLevelPassedSpecificIdTotal (113), ActivityTypeLevelPassedSpecificIdTotal (113),
StorySetClearSpecific (116),
CharacterWithSpecificSkillAndLevel (118),
DiscWithSpecificQuantityLevelAndAttr (119),
TutorialLevelClearSpecific (120),
TutorialLevelSpecificClearTotal (121),
DiscWithSpecificQuantityPhaseAndAttr (122),
WeekBossClearTotal (123),
ActivityStoryReadStory (124),
ClientReport (200), ClientReport (200),
TowerBattleTimes (501),
TowerBossChallengeSpecificHighRewardWithTotal (502),
TowerBuildSpecificCharacter (503),
TowerBuildSpecificScoreWithTotal (504), TowerBuildSpecificScoreWithTotal (504),
TowerClearSpecificCharacterTypeWithTotal (505),
TowerClearSpecificGroupIdAndDifficulty (506),
TowerClearSpecificLevelWithDifficultyAndTotal (507), TowerClearSpecificLevelWithDifficultyAndTotal (507),
TowerClearTotal (508),
TowerEnterRoom (509),
TowerEnterTotal (510), TowerEnterTotal (510),
TowerEventTimes (511),
TowerFateTimes (512),
TowerItemsGet (513),
TowerSpecificDifficultyShopBuyTimes (514), TowerSpecificDifficultyShopBuyTimes (514),
TowerGrowthSpecificNote (515), TowerGrowthSpecificNote (515),
TowerClearSpecificLevelWithDifficultyAndTotalHistory (516), TowerClearSpecificLevelWithDifficultyAndTotalHistory (516),
@@ -122,7 +134,8 @@ public enum QuestCondition {
TowerSpecificGetExtraNoteLvTotal (537), TowerSpecificGetExtraNoteLvTotal (537),
TowerEnterFloor (538), TowerEnterFloor (538),
TowerSweepTimes (539), TowerSweepTimes (539),
TowerSweepTotal (540); TowerSweepTotal (540),
TowerBattleWithPartner (541);
@Getter @Getter
private final int value; private final int value;