From 209ce83fc9664558c0986c9c56689c30d1951d4e Mon Sep 17 00:00:00 2001 From: Melledy <121644117+Melledy@users.noreply.github.com> Date: Sun, 7 Dec 2025 21:06:53 -0800 Subject: [PATCH] Reset shop purchases each month --- .../java/emu/nebula/game/inventory/Inventory.java | 14 ++++++++++++++ src/main/java/emu/nebula/game/player/Player.java | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/src/main/java/emu/nebula/game/inventory/Inventory.java b/src/main/java/emu/nebula/game/inventory/Inventory.java index 20afb22..5826354 100644 --- a/src/main/java/emu/nebula/game/inventory/Inventory.java +++ b/src/main/java/emu/nebula/game/inventory/Inventory.java @@ -829,6 +829,20 @@ public class Inventory extends PlayerManager implements GameDatabaseObject { return change.setSuccess(true); } + public void resetShopPurchases() { + // Clear shop purchases if it's not empty + if (!this.getShopBuyCount().isEmpty()) { + this.getShopBuyCount().clear(); + Nebula.getGameDatabase().update(this, this.getUid(), "shopBuyCount", this.getShopBuyCount()); + } + + // Clear mall purchases if it's not empty + if (!this.getMallBuyCount().isEmpty()) { + this.getMallBuyCount().clear(); + Nebula.getGameDatabase().update(this, this.getUid(), "mallBuyCount", this.getMallBuyCount()); + } + } + // Database public void loadFromDatabase() { diff --git a/src/main/java/emu/nebula/game/player/Player.java b/src/main/java/emu/nebula/game/player/Player.java index 72335bf..4ec7346 100644 --- a/src/main/java/emu/nebula/game/player/Player.java +++ b/src/main/java/emu/nebula/game/player/Player.java @@ -691,6 +691,11 @@ public class Player implements GameDatabaseObject { // Reset daily quests this.getQuestManager().resetDailyQuests(); this.getBattlePassManager().getBattlePass().resetDailyQuests(resetWeekly); + + // Reset monthly shop purchases + if (resetMonthly) { + this.getInventory().resetShopPurchases(); + } } // Trigger quests + achievements