2021-12-05 17:54:36 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "dCommonVars.h"
|
|
|
|
#include "Entity.h"
|
|
|
|
#include <map>
|
2024-02-25 22:59:10 +00:00
|
|
|
#include <set>
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-02-25 22:59:10 +00:00
|
|
|
struct VanityObjectLocation
|
2021-12-05 17:54:36 +00:00
|
|
|
{
|
|
|
|
float m_Chance = 1.0f;
|
|
|
|
NiPoint3 m_Position;
|
|
|
|
NiQuaternion m_Rotation;
|
2024-02-25 22:59:10 +00:00
|
|
|
float m_Scale = 1.0f;
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|
|
|
|
|
2024-02-25 22:59:10 +00:00
|
|
|
struct VanityObject
|
2021-12-05 17:54:36 +00:00
|
|
|
{
|
2023-11-10 00:33:39 +00:00
|
|
|
LWOOBJID m_ID = LWOOBJID_EMPTY;
|
2021-12-05 17:54:36 +00:00
|
|
|
std::string m_Name;
|
|
|
|
LOT m_LOT;
|
|
|
|
std::vector<LOT> m_Equipment;
|
|
|
|
std::vector<std::string> m_Phrases;
|
|
|
|
std::string m_Script;
|
2024-02-25 22:59:10 +00:00
|
|
|
std::map<uint32_t, std::vector<VanityObjectLocation>> m_Locations;
|
|
|
|
std::vector<LDFBaseData*> m_Config;
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class VanityUtilities
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static void SpawnVanity();
|
|
|
|
|
2024-02-25 22:59:10 +00:00
|
|
|
static Entity* SpawnObject(
|
|
|
|
const VanityObject& object,
|
|
|
|
const VanityObjectLocation& location
|
2023-11-10 00:33:39 +00:00
|
|
|
);
|
|
|
|
|
2023-11-10 03:28:52 +00:00
|
|
|
static LWOOBJID SpawnSpawner(
|
2024-02-25 22:59:10 +00:00
|
|
|
const VanityObject& object,
|
|
|
|
const VanityObjectLocation& location
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
static std::string ParseMarkdown(
|
|
|
|
const std::string& file
|
|
|
|
);
|
|
|
|
|
|
|
|
static void ParseXML(
|
|
|
|
const std::string& file
|
|
|
|
);
|
|
|
|
|
2024-02-25 22:59:10 +00:00
|
|
|
static VanityObject* GetObject(const std::string& name);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static void SetupNPCTalk(Entity* npc);
|
|
|
|
|
|
|
|
static void NPCTalk(Entity* npc);
|
|
|
|
|
2024-02-25 22:59:10 +00:00
|
|
|
static std::vector<VanityObject> m_Objects;
|
|
|
|
|
|
|
|
static std::set<std::string> m_LoadedFiles;
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|