Files
cursebreaker-parser/include/configs/loot.hpp
cdemeyer-teachx a1c9a2e54d refactor
2025-11-12 11:34:51 +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