38 lines
729 B
C++
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
|