DarkflameServer/dScripts/ai/GF/GfJailWalls.cpp

31 lines
911 B
C++
Raw Normal View History

#include "GfJailWalls.h"
#include "dZoneManager.h"
#include "GeneralUtils.h"
#include "eRebuildState.h"
2022-07-28 13:39:57 +00:00
void GfJailWalls::OnRebuildComplete(Entity* self, Entity* target) {
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
for (auto* spawner : Game::zoneManager->GetSpawnersByName("Jail0" + wall)) {
2022-07-28 13:39:57 +00:00
spawner->Deactivate();
}
for (auto* spawner : Game::zoneManager->GetSpawnersByName("JailCaptain0" + wall)) {
2022-07-28 13:39:57 +00:00
spawner->Deactivate();
}
}
2022-07-28 13:39:57 +00:00
void GfJailWalls::OnRebuildNotifyState(Entity* self, eRebuildState state) {
if (state != eRebuildState::RESETTING) return;
2022-07-28 13:39:57 +00:00
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
for (auto* spawner : Game::zoneManager->GetSpawnersByName("Jail0" + wall)) {
2022-07-28 13:39:57 +00:00
spawner->Activate();
}
for (auto* spawner : Game::zoneManager->GetSpawnersByName("JailCaptain0" + wall)) {
2022-07-28 13:39:57 +00:00
spawner->Activate();
}
}