inventory system now functional, TODO: add mbucks cmds, allow item usage

This commit is contained in:
2025-03-31 09:05:42 +02:00
parent c47197b516
commit 2b90d51647
14 changed files with 204 additions and 40 deletions

9
src/items/lootbox.ts Normal file
View File

@@ -0,0 +1,9 @@
import { getInventory, updateInventory } from "../lib/userHelper";
export async function changeLootboxCount(username: string, amount = -1): Promise<itemChangeResult> {
let inv = await getInventory(username)
if (amount < 0 && inv.lootbox+ amount < 0) return {result: false, count: inv.lootbox}
inv.lootbox += amount
await updateInventory(username, inv)
return {result: true, count: inv.lootbox}
}