DarkflameServer/dGame/dUtilities/VanityUtilities.h

63 lines
1.1 KiB
C
Raw Normal View History

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