43 lines
768 B
C++
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
|