mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 13:37:22 +00:00
chore: cleanup some vanity npc logic (#1174)
* Dont setup talk for vanity npc's if they are no phrases no ghosting ldfkey for canity npc's * void, oops * formatting
This commit is contained in:
parent
9a07020a51
commit
952786c166
@ -85,6 +85,7 @@ public:
|
|||||||
bool GetPlayerReadyForUpdates() const { return m_PlayerIsReadyForUpdates; }
|
bool GetPlayerReadyForUpdates() const { return m_PlayerIsReadyForUpdates; }
|
||||||
|
|
||||||
bool GetIsGhostingCandidate() const;
|
bool GetIsGhostingCandidate() const;
|
||||||
|
void SetIsGhostingCandidate(bool value) { m_IsGhostingCandidate = value; };
|
||||||
|
|
||||||
int8_t GetObservers() const;
|
int8_t GetObservers() const;
|
||||||
|
|
||||||
|
@ -80,11 +80,11 @@ void VanityUtilities::SpawnVanity() {
|
|||||||
|
|
||||||
// Spawn the NPC
|
// Spawn the NPC
|
||||||
auto* npcEntity = SpawnNPC(npc.m_LOT, npc.m_Name, location.m_Position, location.m_Rotation, npc.m_Equipment, npc.ldf);
|
auto* npcEntity = SpawnNPC(npc.m_LOT, npc.m_Name, location.m_Position, location.m_Rotation, npc.m_Equipment, npc.ldf);
|
||||||
|
if (!npc.m_Phrases.empty()) {
|
||||||
npcEntity->SetVar<std::vector<std::string>>(u"chats", m_PartyPhrases);
|
npcEntity->SetVar<std::vector<std::string>>(u"chats", m_PartyPhrases);
|
||||||
|
|
||||||
SetupNPCTalk(npcEntity);
|
SetupNPCTalk(npcEntity);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ void VanityUtilities::SpawnVanity() {
|
|||||||
|
|
||||||
// Spawn the NPC
|
// Spawn the NPC
|
||||||
auto* npcEntity = SpawnNPC(npc.m_LOT, npc.m_Name, location.m_Position, location.m_Rotation, npc.m_Equipment, npc.ldf);
|
auto* npcEntity = SpawnNPC(npc.m_LOT, npc.m_Name, location.m_Position, location.m_Rotation, npc.m_Equipment, npc.ldf);
|
||||||
|
if (!npc.m_Phrases.empty()){
|
||||||
npcEntity->SetVar<std::vector<std::string>>(u"chats", npc.m_Phrases);
|
npcEntity->SetVar<std::vector<std::string>>(u"chats", npc.m_Phrases);
|
||||||
|
|
||||||
auto* scriptComponent = npcEntity->GetComponent<ScriptComponent>();
|
auto* scriptComponent = npcEntity->GetComponent<ScriptComponent>();
|
||||||
@ -127,9 +127,9 @@ void VanityUtilities::SpawnVanity() {
|
|||||||
npcEntity->SetVar<bool>(GeneralUtils::ASCIIToUTF16(npc.first), npc.second);
|
npcEntity->SetVar<bool>(GeneralUtils::ASCIIToUTF16(npc.first), npc.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetupNPCTalk(npcEntity);
|
SetupNPCTalk(npcEntity);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (zoneID == 1200) {
|
if (zoneID == 1200) {
|
||||||
{
|
{
|
||||||
@ -160,6 +160,7 @@ Entity* VanityUtilities::SpawnNPC(LOT lot, const std::string& name, const NiPoin
|
|||||||
|
|
||||||
auto* entity = Game::entityManager->CreateEntity(info);
|
auto* entity = Game::entityManager->CreateEntity(info);
|
||||||
entity->SetVar(u"npcName", name);
|
entity->SetVar(u"npcName", name);
|
||||||
|
if (entity->GetVar<bool>(u"noGhosting")) entity->SetIsGhostingCandidate(false);
|
||||||
|
|
||||||
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user