DarkflameServer/dScripts/NtOverbuildServer.cpp

31 lines
1.1 KiB
C++
Raw Normal View History

#include "NtOverbuildServer.h"
#include "EntityManager.h"
2022-07-28 13:39:57 +00:00
void NtOverbuildServer::SetVariables(Entity* self) {
self->SetVar<float_t>(m_SpyProximityVariable, 30.0f);
2022-07-28 13:39:57 +00:00
self->SetVar<SpyData>(m_SpyDataVariable, {
NT_FACTION_SPY_OVERBUILD, 13891, 1320
});
2022-07-28 13:39:57 +00:00
self->SetVar<std::vector<SpyDialogue>>(m_SpyDialogueTableVariable, {
{ "OVERBUILD_NT_CONVO_1", 0 },
{ "OVERBUILD_NT_CONVO_2", 1 },
{ "OVERBUILD_NT_CONVO_3", 0 },
{ "OVERBUILD_NT_CONVO_4", 1 },
{ "OVERBUILD_NT_CONVO_5", 0 },
{ "OVERBUILD_NT_CONVO_6", 1 },
{ "OVERBUILD_NT_CONVO_7", 0 },
});
2022-07-28 13:39:57 +00:00
// Find the second object Dr. Overbuild interacts with
LWOOBJID otherConvoObjectID = LWOOBJID_EMPTY;
for (auto* otherConvoObject : EntityManager::Instance()->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(m_OtherEntitiesGroupVariable)))) {
otherConvoObjectID = otherConvoObject->GetObjectID();
break;
}
2022-07-28 13:39:57 +00:00
// If there's an alternating conversation, indices should be provided using the conversationID variables
self->SetVar<std::vector<LWOOBJID>>(m_SpyCinematicObjectsVariable, { self->GetObjectID(), otherConvoObjectID });
}