DarkflameServer/dScripts/GfJailWalls.cpp

30 lines
920 B
C++
Raw Normal View History

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