Files
cursebreaker-parser/include/configs/loot.h
cdemeyer-teachx ff1b4a93b3 SQL setup
2025-11-12 12:34:20 +09:00

38 lines
729 B
C++

#pragma once
#include <string>
#include <vector>
#include <unordered_map>
#include <tinyxml2.h>
#include "constants.h"
namespace cursebreaker {
struct LootEntry
{
uint16_t itemId{};
uint16_t minAmount{};
uint16_t maxAmount{};
uint16_t chance{}; // percentage chance
uint16_t level{}; // minimum level required
};
struct LootTable
{
uint16_t id{};
std::string name;
std::string description;
std::vector<LootEntry> entries;
LootTable() = default;
};
// Loot configuration functions
bool loadLootTablesFromXML(const std::string& filepath);
const LootTable* getLootTableById(uint16_t id);
const std::unordered_map<uint16_t, LootTable>& getAllLootTables();
} // namespace cursebreaker