Fix weekly boss entry tickets and rewards

This commit is contained in:
Melledy
2025-12-07 15:45:19 -08:00
parent 7f0bdb1824
commit c6ac09f112
6 changed files with 93 additions and 12 deletions
@@ -1,7 +1,9 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.GameData;
import emu.nebula.data.ResourceType;
import emu.nebula.data.ResourceType.LoadPriority;
import emu.nebula.game.instance.InstanceData;
import emu.nebula.game.inventory.ItemRewardList;
import emu.nebula.game.inventory.ItemRewardParam;
@@ -10,9 +12,10 @@ import emu.nebula.util.JsonUtils;
import lombok.Getter;
@Getter
@ResourceType(name = "WeekBossLevel.json")
@ResourceType(name = "WeekBossLevel.json", loadPriority = LoadPriority.LOW)
public class WeekBossLevelDef extends BaseDef implements InstanceData {
private int Id;
private int Difficulty;
private int PreLevelId;
private int NeedWorldClass;
private String BaseAwardPreview;
@@ -44,14 +47,33 @@ public class WeekBossLevelDef extends BaseDef implements InstanceData {
for (int[] award : awards) {
int itemId = award[0];
int min = award[1];
int max = award.length >= 4 ? award[2] : min;
int max = award[1];
boolean isFirst = award[award.length - 1] == 1;
// Set reward count based on difficulty
if (min == -1) {
min = 0;
max = 1;
min = this.Difficulty;
max = this.Difficulty;
var item = GameData.getItemDataTable().get(itemId);
if (item != null) {
switch (item.getRarity()) {
case 2:
max = this.Difficulty * 3;
break;
case 3:
min = this.Difficulty * 2;
max = this.Difficulty * 6;
break;
case 4:
min = this.Difficulty * 3;
max = this.Difficulty * 9;
break;
}
}
}
// Create reward param
var reward = new ItemRewardParam(itemId, min, max);
if (isFirst) {