Implement commissions

This commit is contained in:
Melledy
2025-11-12 03:25:23 -08:00
parent d4a7aa0320
commit be4a006c66
19 changed files with 526 additions and 40 deletions
@@ -0,0 +1,21 @@
package emu.nebula.game.inventory;
import java.util.ArrayList;
public class ItemRewardList extends ArrayList<ItemRewardParam> {
private static final long serialVersionUID = -4317949564663392685L;
public ItemRewardList() {
super();
}
public ItemParamMap generateRewards() {
var map = new ItemParamMap();
for (var param : this) {
map.add(param.getId(), param.getRandomCount());
}
return map;
}
}
@@ -0,0 +1,25 @@
package emu.nebula.game.inventory;
import emu.nebula.util.Utils;
import lombok.Getter;
@Getter
public class ItemRewardParam {
public int id;
public int min;
public int max;
public ItemRewardParam(int id, int min, int max) {
this.id = id;
this.min = min;
this.max = max;
}
public int getRandomCount() {
if (this.min == this.max) {
return this.min;
}
return Utils.randomRange(this.min, this.max);
}
}