Files
cursebreaker-parser/include/configs/npcs.hpp
cdemeyer-teachx a1c9a2e54d refactor
2025-11-12 11:34:51 +09:00

43 lines
768 B
C++

#pragma once
#include <string>
#include <vector>
#include <unordered_map>
#include <tinyxml2.h>
#include "constants.h"
namespace cursebreaker {
struct NPCStat
{
StatType type{};
uint16_t value{};
};
struct NPC
{
uint16_t id{};
uint16_t level{};
uint16_t health{};
uint16_t mana{};
uint16_t experience{};
uint16_t lootTableId{};
std::string name;
std::string description;
std::string faction;
std::vector<NPCStat> stats;
std::vector<uint16_t> lootItems; // alternative simple loot
NPC() = default;
};
// NPCs configuration functions
bool loadNPCsFromXML(const std::string& filepath);
const NPC* getNPCById(uint16_t id);
const std::unordered_map<uint16_t, NPC>& getAllNPCs();
} // namespace cursebreaker