mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-21 11:24:47 +01:00
dungeon drop implementation (#2215)
* dungeon drop implementation * Update src/main/java/emu/grasscutter/game/dungeons/DungeonManager.java Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com> --------- Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com>
This commit is contained in:
@@ -134,7 +134,12 @@ public final class DungeonManager {
|
||||
}
|
||||
|
||||
// Get and roll rewards.
|
||||
List<GameItem> rewards = new ArrayList<>(this.rollRewards(useCondensed));
|
||||
List<GameItem> rewards = player.getServer().getDropSystem().handleDungeonRewardDrop(dungeonData.getStatueDrop(), useCondensed);
|
||||
if (rewards.isEmpty()) {
|
||||
//fallback to legacy drop system
|
||||
Grasscutter.getLogger().debug("dungeon drop failed for {}", dungeonData.getId());
|
||||
rewards = new ArrayList<>(this.rollRewards(useCondensed));
|
||||
}
|
||||
// Add rewards to player and send notification.
|
||||
player.getInventory().addItems(rewards, ActionReason.DungeonStatueDrop);
|
||||
player.sendPacket(new PacketGadgetAutoPickDropInfoNotify(rewards));
|
||||
@@ -187,7 +192,7 @@ public final class DungeonManager {
|
||||
amount += Utils.drawRandomListElement(candidateAmounts, entry.getProbabilities());
|
||||
}
|
||||
|
||||
// Double rewards in multiplay mode, if specified.
|
||||
// Double rewards in multiply mode, if specified.
|
||||
if (entry.isMpDouble() && this.getScene().getPlayerCount() > 1) {
|
||||
amount *= 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user