mirror of
https://github.com/Melledy/Nebula.git
synced 2026-09-19 09:09:54 +02:00
Update item pool for daily mall gifts
This commit is contained in:
@@ -3,6 +3,7 @@ package emu.nebula;
|
||||
import java.time.ZoneId;
|
||||
|
||||
import emu.nebula.game.inventory.ItemParam;
|
||||
import emu.nebula.game.inventory.ItemParamMap;
|
||||
import emu.nebula.util.WeightedList;
|
||||
|
||||
public class GameConstants {
|
||||
@@ -56,13 +57,18 @@ public class GameConstants {
|
||||
|
||||
// Daily gifts (Custom)
|
||||
|
||||
public static final WeightedList<ItemParam> DAILY_GIFTS = new WeightedList<>();
|
||||
public static final WeightedList<ItemParam> DAILY_SHOP_GIFTS = new WeightedList<>();
|
||||
public static final WeightedList<ItemParamMap> DAILY_MALL_GIFTS = new WeightedList<>();
|
||||
|
||||
static {
|
||||
DAILY_GIFTS.add(1000, new ItemParam(GOLD_ITEM_ID, 8888));
|
||||
DAILY_GIFTS.add(250, new ItemParam(GOLD_ITEM_ID, 18888));
|
||||
DAILY_GIFTS.add(250, new ItemParam(33001, 10));
|
||||
DAILY_GIFTS.add(10, new ItemParam(GEM_ITEM_ID, 50));
|
||||
DAILY_SHOP_GIFTS.add(1000, new ItemParam(GOLD_ITEM_ID, 8888));
|
||||
DAILY_SHOP_GIFTS.add(250, new ItemParam(GOLD_ITEM_ID, 18888));
|
||||
DAILY_SHOP_GIFTS.add(250, new ItemParam(33001, 10));
|
||||
DAILY_SHOP_GIFTS.add(10, new ItemParam(GEM_ITEM_ID, 50)); // Custom
|
||||
|
||||
DAILY_MALL_GIFTS.add(100, ItemParamMap.of(GOLD_ITEM_ID, 25_000, 82001, 5));
|
||||
DAILY_MALL_GIFTS.add(100, ItemParamMap.of(GOLD_ITEM_ID, 25_000, 82004, 5));
|
||||
DAILY_MALL_GIFTS.add(100, ItemParamMap.of(GOLD_ITEM_ID, 25_000, 82007, 5));
|
||||
}
|
||||
|
||||
// Helper functions
|
||||
|
||||
@@ -144,4 +144,31 @@ public class ItemParamMap extends Int2IntLinkedOpenHashMap implements ObjectBidi
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
public static ItemParamMap of(int... entries) {
|
||||
// Create
|
||||
var params = new ItemParamMap();
|
||||
|
||||
// Add items
|
||||
for (int i = 0; i < entries.length; i++) {
|
||||
// Get intial item id
|
||||
int itemId = entries[i];
|
||||
int count = 0;
|
||||
|
||||
// Increment
|
||||
i++;
|
||||
|
||||
// Get count
|
||||
if (i < entries.length) {
|
||||
count = entries[i];
|
||||
|
||||
// Add to item param map
|
||||
params.add(itemId, count);
|
||||
}
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ public class QuestManager extends PlayerManager implements GameDatabaseObject {
|
||||
return change.setSuccess(true);
|
||||
}
|
||||
|
||||
// Daily shop reward
|
||||
// Daily rewards
|
||||
|
||||
public PlayerChangeInfo claimDailyShopGift() {
|
||||
// Sanity check
|
||||
@@ -476,7 +476,7 @@ public class QuestManager extends PlayerManager implements GameDatabaseObject {
|
||||
}
|
||||
|
||||
// Daily shop reward
|
||||
var reward = GameConstants.DAILY_GIFTS.next();
|
||||
var reward = GameConstants.DAILY_SHOP_GIFTS.next();
|
||||
var change = this.getPlayer().getInventory().addItem(reward.getId(), reward.getCount());
|
||||
|
||||
// Set and update in database
|
||||
@@ -497,8 +497,8 @@ public class QuestManager extends PlayerManager implements GameDatabaseObject {
|
||||
}
|
||||
|
||||
// Daily mall reward
|
||||
var reward = GameConstants.DAILY_GIFTS.next();
|
||||
var change = this.getPlayer().getInventory().addItem(reward.getId(), reward.getCount());
|
||||
var rewards = GameConstants.DAILY_MALL_GIFTS.next();
|
||||
var change = this.getPlayer().getInventory().addItems(rewards);
|
||||
|
||||
// Set and update in database
|
||||
this.dailyMallReward = true;
|
||||
|
||||
Reference in New Issue
Block a user