DarkflameServer/dScripts/02_server/Map/General/VisToggleNotifierServer.cpp
David Markowitz c1e8546d48
fix: add Nexus Tower missing scripts (#1349)
add final missing scripts for nt

also fix the turnin for the breadcrumb missions not showing the completion window.

Fix another missing script

Add another script

fix include guards

Fix dirt clouds not appearing on mission accept
2023-12-22 23:53:21 -08:00

24 lines
815 B
C++

#include "VisToggleNotifierServer.h"
#include "eMissionState.h"
#include "Game.h"
#include "dZoneManager.h"
void VisToggleNotifierServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionId, eMissionState missionState) {
auto itr = m_GameVariables.find(missionId);
if (itr != m_GameVariables.end()) {
bool visible = true;
if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
visible = false;
}
auto spawners = Game::zoneManager->GetSpawnersByName(itr->second);
if (spawners.empty()) return;
for (const auto spawner : spawners) {
auto spawnedObjIds = spawner->GetSpawnedObjectIDs();
for (const auto& objId : spawnedObjIds) {
GameMessages::SendNotifyClientObject(objId, u"SetVisibility", visible);
}
}
}
}