DarkflameServer/dGame/dUtilities/VanityUtilities.h

76 lines
1.4 KiB
C
Raw Normal View History

#pragma once
#include "dCommonVars.h"
#include "Entity.h"
#include <map>
struct VanityNPCLocation
{
2022-07-28 13:39:57 +00:00
float m_Chance = 1.0f;
NiPoint3 m_Position;
NiQuaternion m_Rotation;
};
struct VanityNPC
{
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<std::string, bool> m_Flags;
std::map<uint32_t, std::vector<VanityNPCLocation>> m_Locations;
std::vector<LDFBaseData*> ldf;
};
struct VanityParty
{
2022-07-28 13:39:57 +00:00
uint32_t m_Zone;
float m_Chance = 1.0f;
std::vector<VanityNPCLocation> m_Locations;
};
class VanityUtilities
{
public:
2022-07-28 13:39:57 +00:00
static void SpawnVanity();
2022-07-28 13:39:57 +00:00
static Entity* SpawnNPC(
LOT lot,
const std::string& name,
const NiPoint3& position,
const NiQuaternion& rotation,
const std::vector<LOT>& inventory,
2023-11-10 00:59:43 +00:00
const std::vector<LDFBaseData*>& ldf
);
2023-11-10 03:28:52 +00:00
static LWOOBJID SpawnSpawner(
LOT lot,
const NiPoint3& position,
const NiQuaternion& rotation,
2022-07-28 13:39:57 +00:00
const std::vector<LDFBaseData*>& ldf
);
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
);
2022-07-28 13:39:57 +00:00
static VanityNPC* GetNPC(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);
2022-07-28 13:39:57 +00:00
static std::vector<VanityNPC> m_NPCs;
2022-07-28 13:39:57 +00:00
static std::vector<VanityParty> m_Parties;
2022-07-28 13:39:57 +00:00
static std::vector<std::string> m_PartyPhrases;
};