mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Move dZoneManager to game namespace (#1143)
* convert zone manager to game namespace * Destroy logger last
This commit is contained in:
@@ -52,7 +52,7 @@ void BossSpiderQueenEnemyServer::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void BossSpiderQueenEnemyServer::OnDie(Entity* self, Entity* killer) {
|
||||
if (dZoneManager::Instance()->GetZoneID().GetMapID() == instanceZoneID) {
|
||||
if (Game::zoneManager->GetZoneID().GetMapID() == instanceZoneID) {
|
||||
auto* missionComponent = killer->GetComponent<MissionComponent>();
|
||||
if (missionComponent == nullptr)
|
||||
return;
|
||||
@@ -276,7 +276,7 @@ void BossSpiderQueenEnemyServer::RunRainOfFire(Entity* self) {
|
||||
|
||||
auto index = 0u;
|
||||
for (const auto& rofGroup : ROFTargetGroupIDTable) {
|
||||
const auto spawners = dZoneManager::Instance()->GetSpawnersInGroup(rofGroup);
|
||||
const auto spawners = Game::zoneManager->GetSpawnersInGroup(rofGroup);
|
||||
|
||||
std::vector<LWOOBJID> spawned;
|
||||
|
||||
|
@@ -42,7 +42,7 @@ void AmDropshipComputer::OnDie(Entity* self, Entity* killer) {
|
||||
|
||||
const auto nextPipeNum = pipeNum + 1;
|
||||
|
||||
const auto samePipeSpawners = dZoneManager::Instance()->GetSpawnersByName(myGroup);
|
||||
const auto samePipeSpawners = Game::zoneManager->GetSpawnersByName(myGroup);
|
||||
|
||||
if (!samePipeSpawners.empty()) {
|
||||
samePipeSpawners[0]->SoftReset();
|
||||
@@ -53,7 +53,7 @@ void AmDropshipComputer::OnDie(Entity* self, Entity* killer) {
|
||||
if (killer != nullptr && killer->IsPlayer()) {
|
||||
const auto nextPipe = pipeGroup + std::to_string(nextPipeNum);
|
||||
|
||||
const auto nextPipeSpawners = dZoneManager::Instance()->GetSpawnersByName(nextPipe);
|
||||
const auto nextPipeSpawners = Game::zoneManager->GetSpawnersByName(nextPipe);
|
||||
|
||||
if (!nextPipeSpawners.empty()) {
|
||||
nextPipeSpawners[0]->Activate();
|
||||
@@ -61,7 +61,7 @@ void AmDropshipComputer::OnDie(Entity* self, Entity* killer) {
|
||||
} else {
|
||||
const auto nextPipe = pipeGroup + "1";
|
||||
|
||||
const auto firstPipeSpawners = dZoneManager::Instance()->GetSpawnersByName(nextPipe);
|
||||
const auto firstPipeSpawners = Game::zoneManager->GetSpawnersByName(nextPipe);
|
||||
|
||||
if (!firstPipeSpawners.empty()) {
|
||||
firstPipeSpawners[0]->Activate();
|
||||
|
@@ -93,13 +93,13 @@ void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
|
||||
}
|
||||
|
||||
void ImgBrickConsoleQB::SpawnBrick(Entity* self) {
|
||||
const auto netDevil = dZoneManager::Instance()->GetSpawnersByName("MaelstromBug");
|
||||
const auto netDevil = Game::zoneManager->GetSpawnersByName("MaelstromBug");
|
||||
if (!netDevil.empty()) {
|
||||
netDevil[0]->Reset();
|
||||
netDevil[0]->Deactivate();
|
||||
}
|
||||
|
||||
const auto brick = dZoneManager::Instance()->GetSpawnersByName("Imagination");
|
||||
const auto brick = Game::zoneManager->GetSpawnersByName("Imagination");
|
||||
if (!brick.empty()) {
|
||||
brick[0]->Activate();
|
||||
}
|
||||
@@ -117,7 +117,7 @@ void ImgBrickConsoleQB::SmashCanister(Entity* self) {
|
||||
canister->Smash(canister->GetObjectID(), eKillType::VIOLENT);
|
||||
}
|
||||
|
||||
const auto canister = dZoneManager::Instance()->GetSpawnersByName("BrickCanister");
|
||||
const auto canister = Game::zoneManager->GetSpawnersByName("BrickCanister");
|
||||
if (!canister.empty()) {
|
||||
canister[0]->Reset();
|
||||
canister[0]->Deactivate();
|
||||
@@ -195,29 +195,29 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer) {
|
||||
|
||||
const auto firstPipe = pipeGroup + "1";
|
||||
|
||||
const auto samePipeSpawner = dZoneManager::Instance()->GetSpawnersByName(myGroup);
|
||||
const auto samePipeSpawner = Game::zoneManager->GetSpawnersByName(myGroup);
|
||||
if (!samePipeSpawner.empty()) {
|
||||
samePipeSpawner[0]->Reset();
|
||||
samePipeSpawner[0]->Deactivate();
|
||||
}
|
||||
|
||||
const auto firstPipeSpawner = dZoneManager::Instance()->GetSpawnersByName(firstPipe);
|
||||
const auto firstPipeSpawner = Game::zoneManager->GetSpawnersByName(firstPipe);
|
||||
if (!firstPipeSpawner.empty()) {
|
||||
firstPipeSpawner[0]->Activate();
|
||||
}
|
||||
|
||||
const auto netdevil = dZoneManager::Instance()->GetSpawnersByName("Imagination");
|
||||
const auto netdevil = Game::zoneManager->GetSpawnersByName("Imagination");
|
||||
if (!netdevil.empty()) {
|
||||
netdevil[0]->Reset();
|
||||
netdevil[0]->Deactivate();
|
||||
}
|
||||
|
||||
const auto brick = dZoneManager::Instance()->GetSpawnersByName("MaelstromBug");
|
||||
const auto brick = Game::zoneManager->GetSpawnersByName("MaelstromBug");
|
||||
if (!brick.empty()) {
|
||||
brick[0]->Activate();
|
||||
}
|
||||
|
||||
const auto canister = dZoneManager::Instance()->GetSpawnersByName("BrickCanister");
|
||||
const auto canister = Game::zoneManager->GetSpawnersByName("BrickCanister");
|
||||
if (!canister.empty()) {
|
||||
canister[0]->Activate();
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ void RaceMaelstromGeiser::OnProximityUpdate(Entity* self, Entity* entering, std:
|
||||
|
||||
GameMessages::SendDie(vehicle, self->GetObjectID(), LWOOBJID_EMPTY, true, eKillType::VIOLENT, u"", 0, 0, 0, true, false, 0);
|
||||
|
||||
auto* zoneController = dZoneManager::Instance()->GetZoneControlObject();
|
||||
auto* zoneController = Game::zoneManager->GetZoneControlObject();
|
||||
|
||||
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
|
||||
|
||||
|
@@ -48,8 +48,8 @@ void PetDigServer::OnStartup(Entity* self) {
|
||||
// Reset any bouncers that might've been created by the previous dig
|
||||
if (digInfo.bouncer) {
|
||||
auto bounceNumber = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"BouncerNumber"));
|
||||
auto bouncerSpawners = dZoneManager::Instance()->GetSpawnersByName("PetBouncer" + bounceNumber);
|
||||
auto switchSpawners = dZoneManager::Instance()->GetSpawnersByName("PetBouncerSwitch" + bounceNumber);
|
||||
auto bouncerSpawners = Game::zoneManager->GetSpawnersByName("PetBouncer" + bounceNumber);
|
||||
auto switchSpawners = Game::zoneManager->GetSpawnersByName("PetBouncerSwitch" + bounceNumber);
|
||||
|
||||
for (auto* bouncerSpawner : bouncerSpawners) {
|
||||
for (auto* bouncer : bouncerSpawner->m_Info.nodes)
|
||||
@@ -142,8 +142,8 @@ void PetDigServer::HandleXBuildDig(const Entity* self, Entity* owner, Entity* pe
|
||||
|
||||
void PetDigServer::HandleBouncerDig(const Entity* self, const Entity* owner) {
|
||||
auto bounceNumber = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"BouncerNumber"));
|
||||
auto bouncerSpawners = dZoneManager::Instance()->GetSpawnersByName("PetBouncer" + bounceNumber);
|
||||
auto switchSpawners = dZoneManager::Instance()->GetSpawnersByName("PetBouncerSwitch" + bounceNumber);
|
||||
auto bouncerSpawners = Game::zoneManager->GetSpawnersByName("PetBouncer" + bounceNumber);
|
||||
auto switchSpawners = Game::zoneManager->GetSpawnersByName("PetBouncerSwitch" + bounceNumber);
|
||||
|
||||
for (auto* bouncerSpawner : bouncerSpawners) {
|
||||
bouncerSpawner->Activate();
|
||||
|
@@ -4,7 +4,7 @@
|
||||
#include "Amf3.h"
|
||||
|
||||
void NsLegoClubDoor::OnStartup(Entity* self) {
|
||||
self->SetVar(u"currentZone", (int32_t)dZoneManager::Instance()->GetZoneID().GetMapID());
|
||||
self->SetVar(u"currentZone", (int32_t)Game::zoneManager->GetZoneID().GetMapID());
|
||||
self->SetVar(u"choiceZone", m_ChoiceZoneID);
|
||||
self->SetVar(u"teleportAnim", m_TeleportAnim);
|
||||
self->SetVar(u"teleportString", m_TeleportString);
|
||||
|
@@ -4,7 +4,7 @@
|
||||
#include "Amf3.h"
|
||||
|
||||
void NsLupTeleport::OnStartup(Entity* self) {
|
||||
self->SetVar(u"currentZone", (int32_t)dZoneManager::Instance()->GetZoneID().GetMapID());
|
||||
self->SetVar(u"currentZone", (int32_t)Game::zoneManager->GetZoneID().GetMapID());
|
||||
self->SetVar(u"choiceZone", m_ChoiceZoneID);
|
||||
self->SetVar(u"teleportAnim", m_TeleportAnim);
|
||||
self->SetVar(u"teleportString", m_TeleportString);
|
||||
|
@@ -61,7 +61,7 @@ void ZoneAgProperty::OnPlayerLoaded(Entity* self, Entity* player) {
|
||||
self->SetVar<int32_t>(u"numberOfPlayers", numberOfPlayers + 1);
|
||||
}
|
||||
|
||||
if (dZoneManager::Instance()->GetZone()->GetZoneID().GetMapID() == 1102) {
|
||||
if (Game::zoneManager->GetZone()->GetZoneID().GetMapID() == 1102) {
|
||||
GameMessages::SendPlay2DAmbientSound(player, GUIDMaelstrom);
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"maelstromSkyOn", 0, 0,
|
||||
LWOOBJID_EMPTY, "", player->GetSystemAddress());
|
||||
@@ -93,7 +93,7 @@ void ZoneAgProperty::OnZoneLoadedInfo(Entity* self) {
|
||||
void ZoneAgProperty::LoadInstance(Entity* self) {
|
||||
SetGameVariables(self);
|
||||
|
||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(self->GetVar<std::string>(InstancerSpawner))) {
|
||||
for (auto* spawner : Game::zoneManager->GetSpawnersByName(self->GetVar<std::string>(InstancerSpawner))) {
|
||||
for (auto* spawnerNode : spawner->m_Info.nodes) {
|
||||
spawnerNode->config.push_back(
|
||||
new LDFData<std::string>(u"custom_script_server",
|
||||
@@ -180,7 +180,7 @@ void ZoneAgProperty::StartMaelstrom(Entity* self, Entity* player) {
|
||||
}
|
||||
|
||||
uint32_t ZoneAgProperty::RetrieveSpawnerId(Entity* self, const std::string& spawner) {
|
||||
auto spawnerIDs = dZoneManager::Instance()->GetSpawnersByName(spawner);
|
||||
auto spawnerIDs = Game::zoneManager->GetSpawnersByName(spawner);
|
||||
if (spawnerIDs.empty())
|
||||
return 0;
|
||||
|
||||
@@ -193,7 +193,7 @@ void ZoneAgProperty::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
void ZoneAgProperty::BaseTimerDone(Entity* self, const std::string& timerName) {
|
||||
if (timerName == "GuardFlyAway") {
|
||||
const auto zoneId = dZoneManager::Instance()->GetZone()->GetWorldID();
|
||||
const auto zoneId = Game::zoneManager->GetZone()->GetWorldID();
|
||||
if (zoneId != 1150)
|
||||
return;
|
||||
|
||||
|
@@ -13,7 +13,7 @@ void CavePrisonCage::OnStartup(Entity* self) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto* spawner = dZoneManager::Instance()->GetSpawnersByName("PrisonCounterweight_0" + GeneralUtils::UTF16ToWTF8(myNum))[0];
|
||||
auto* spawner = Game::zoneManager->GetSpawnersByName("PrisonCounterweight_0" + GeneralUtils::UTF16ToWTF8(myNum))[0];
|
||||
|
||||
self->SetVar<Spawner*>(u"CWSpawner", spawner);
|
||||
|
||||
|
@@ -31,7 +31,7 @@ void Lieutenant::OnDie(Entity* self, Entity* killer) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto spawners = dZoneManager::Instance()->GetSpawnersByName(spawnerName);
|
||||
const auto spawners = Game::zoneManager->GetSpawnersByName(spawnerName);
|
||||
|
||||
if (spawners.empty()) {
|
||||
return;
|
||||
|
@@ -12,7 +12,7 @@ void MonCoreNookDoors::SpawnDoor(Entity* self) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto spawners = dZoneManager::Instance()->GetSpawnersByName("MonCoreNookDoor0" + doorNum);
|
||||
const auto spawners = Game::zoneManager->GetSpawnersByName("MonCoreNookDoor0" + doorNum);
|
||||
|
||||
if (spawners.empty()) {
|
||||
return;
|
||||
|
@@ -22,7 +22,7 @@ void NjMonastryBossInstance::OnStartup(Entity* self) {
|
||||
|
||||
// Add a notification request for all the spawned entities, corresponds to notifySpawnedObjectLoaded
|
||||
for (const auto& spawnerName : spawnerNames) {
|
||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(spawnerName)) {
|
||||
for (auto* spawner : Game::zoneManager->GetSpawnersByName(spawnerName)) {
|
||||
spawner->AddEntitySpawnedCallback([self, this](Entity* entity) {
|
||||
const auto lot = entity->GetLOT();
|
||||
switch (lot) {
|
||||
@@ -153,7 +153,7 @@ void NjMonastryBossInstance::OnActivityTimerDone(Entity* self, const std::string
|
||||
}
|
||||
}
|
||||
} else if (timerName == SpawnCounterWeightTimer) {
|
||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(CounterweightSpawner);
|
||||
auto spawners = Game::zoneManager->GetSpawnersByName(CounterweightSpawner);
|
||||
if (!spawners.empty()) {
|
||||
// Spawn the counter weight at a specific waypoint, there's one for each round
|
||||
auto* spawner = spawners.front();
|
||||
@@ -173,7 +173,7 @@ void NjMonastryBossInstance::OnActivityTimerDone(Entity* self, const std::string
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0,
|
||||
LWOOBJID_EMPTY, BottomFrakSpawn, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (timerName == SpawnLowerFrakjawTimer) {
|
||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(LowerFrakjawSpawner);
|
||||
auto spawners = Game::zoneManager->GetSpawnersByName(LowerFrakjawSpawner);
|
||||
if (!spawners.empty()) {
|
||||
auto* spawner = spawners.front();
|
||||
spawner->Activate();
|
||||
@@ -182,7 +182,7 @@ void NjMonastryBossInstance::OnActivityTimerDone(Entity* self, const std::string
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0,
|
||||
LWOOBJID_EMPTY, FireRailSpawn, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(FireRailSpawner);
|
||||
auto spawners = Game::zoneManager->GetSpawnersByName(FireRailSpawner);
|
||||
if (!spawners.empty()) {
|
||||
auto* spawner = spawners.front();
|
||||
spawner->Activate();
|
||||
@@ -210,7 +210,7 @@ void NjMonastryBossInstance::StartFight(Entity* self) {
|
||||
self->SetVar<bool>(FightStartedVariable, true);
|
||||
|
||||
// Activate the frakjaw spawner
|
||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(LedgeFrakjawSpawner)) {
|
||||
for (auto* spawner : Game::zoneManager->GetSpawnersByName(LedgeFrakjawSpawner)) {
|
||||
spawner->Activate();
|
||||
}
|
||||
}
|
||||
@@ -455,7 +455,7 @@ void NjMonastryBossInstance::LowerFrakjaw(Entity* self, Entity* frakjaw) {
|
||||
}
|
||||
|
||||
void NjMonastryBossInstance::SpawnOnNetwork(Entity* self, const LOT& toSpawn, const uint32_t& numberToSpawn, const std::string& spawnerName) {
|
||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(spawnerName);
|
||||
auto spawners = Game::zoneManager->GetSpawnersByName(spawnerName);
|
||||
if (spawners.empty() || numberToSpawn <= 0)
|
||||
return;
|
||||
|
||||
@@ -485,7 +485,7 @@ void NjMonastryBossInstance::FightOver(Entity* self) {
|
||||
|
||||
// Remove all the enemies from the battlefield
|
||||
for (auto i = 1; i < 5; i++) {
|
||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(BaseEnemiesSpawner + std::to_string(i));
|
||||
auto spawners = Game::zoneManager->GetSpawnersByName(BaseEnemiesSpawner + std::to_string(i));
|
||||
if (!spawners.empty()) {
|
||||
auto* spawner = spawners.front();
|
||||
spawner->Deactivate();
|
||||
|
@@ -40,7 +40,7 @@ void MinigameTreasureChestServer::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
sac->PlayerRemove(user->GetObjectID());
|
||||
|
||||
auto* zoneControl = dZoneManager::Instance()->GetZoneControlObject();
|
||||
auto* zoneControl = Game::zoneManager->GetZoneControlObject();
|
||||
if (zoneControl != nullptr) {
|
||||
zoneControl->OnFireEventServerSide(self, "Survival_Update", 0);
|
||||
}
|
||||
@@ -56,7 +56,7 @@ uint32_t MinigameTreasureChestServer::CalculateActivityRating(Entity* self, LWOO
|
||||
void MinigameTreasureChestServer::OnStartup(Entity* self) {
|
||||
|
||||
// BONS treasure chest thinks it's on FV, causing it to start a lobby
|
||||
if (dZoneManager::Instance()->GetZoneID().GetMapID() == 1204) {
|
||||
if (Game::zoneManager->GetZoneID().GetMapID() == 1204) {
|
||||
auto* sac = self->GetComponent<ScriptedActivityComponent>();
|
||||
if (sac != nullptr) {
|
||||
sac->SetInstanceMapID(1204);
|
||||
|
@@ -92,7 +92,7 @@ void BasePropertyServer::BasePlayerLoaded(Entity* self, Entity* player) {
|
||||
Game::entityManager->DestructEntity(plaque);
|
||||
}
|
||||
|
||||
const auto& mapID = dZoneManager::Instance()->GetZone()->GetZoneID();
|
||||
const auto& mapID = Game::zoneManager->GetZone()->GetZoneID();
|
||||
|
||||
if (propertyOwner > 0) {
|
||||
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||
@@ -278,31 +278,31 @@ void BasePropertyServer::RequestDie(Entity* self, Entity* other) {
|
||||
}
|
||||
|
||||
void BasePropertyServer::ActivateSpawner(const std::string& spawnerName) {
|
||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(spawnerName)) {
|
||||
for (auto* spawner : Game::zoneManager->GetSpawnersByName(spawnerName)) {
|
||||
spawner->Activate();
|
||||
}
|
||||
}
|
||||
|
||||
void BasePropertyServer::DeactivateSpawner(const std::string& spawnerName) {
|
||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(spawnerName)) {
|
||||
for (auto* spawner : Game::zoneManager->GetSpawnersByName(spawnerName)) {
|
||||
spawner->Deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
void BasePropertyServer::TriggerSpawner(const std::string& spawnerName) {
|
||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersInGroup(spawnerName)) {
|
||||
for (auto* spawner : Game::zoneManager->GetSpawnersInGroup(spawnerName)) {
|
||||
spawner->Spawn();
|
||||
}
|
||||
}
|
||||
|
||||
void BasePropertyServer::ResetSpawner(const std::string& spawnerName) {
|
||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(spawnerName)) {
|
||||
for (auto* spawner : Game::zoneManager->GetSpawnersByName(spawnerName)) {
|
||||
spawner->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void BasePropertyServer::DestroySpawner(const std::string& spawnerName) {
|
||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(spawnerName)) {
|
||||
for (auto* spawner : Game::zoneManager->GetSpawnersByName(spawnerName)) {
|
||||
if (!spawner) return;
|
||||
spawner->DestroyAllEntities();
|
||||
spawner->Deactivate();
|
||||
@@ -322,10 +322,10 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
|
||||
} else if (timerName == StartQuickbuildTimer) {
|
||||
HandleQuickBuildTimer(self);
|
||||
} else if (timerName == "GuardFlyAway") {
|
||||
const auto zoneId = dZoneManager::Instance()->GetZone()->GetWorldID();
|
||||
const auto zoneId = Game::zoneManager->GetZone()->GetWorldID();
|
||||
|
||||
// No guard for the spider instance fight
|
||||
if (dZoneManager::Instance()->GetZoneID().GetMapID() == 1150)
|
||||
if (Game::zoneManager->GetZoneID().GetMapID() == 1150)
|
||||
return;
|
||||
|
||||
const auto entities = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(GuardGroup));
|
||||
@@ -366,7 +366,7 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
|
||||
self->AddTimer(TurnSkyOffTimer, 1.5f);
|
||||
self->AddTimer(KillFXObjectTimer, 8.0f);
|
||||
} else if (timerName == TurnSkyOffTimer) {
|
||||
auto* controller = dZoneManager::Instance()->GetZoneControlObject();
|
||||
auto* controller = Game::zoneManager->GetZoneControlObject();
|
||||
GameMessages::SendNotifyClientObject(controller->GetObjectID(), u"SkyOff", 0, 0,
|
||||
LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (timerName == KillStrombiesTimer) {
|
||||
|
@@ -52,7 +52,7 @@ void BaseRandomServer::SpawnSection(Entity* self, const std::string& sectionName
|
||||
}
|
||||
|
||||
void BaseRandomServer::SetSpawnerNetwork(Entity* self, const std::string& spawnerName, int32_t spawnNum, LOT spawnLOT) {
|
||||
const auto& spawners = dZoneManager::Instance()->GetSpawnersByName(spawnerName);
|
||||
const auto& spawners = Game::zoneManager->GetSpawnersByName(spawnerName);
|
||||
|
||||
if (spawnLOT == 11217 && spawnNum > 1) {
|
||||
spawnNum = 1;
|
||||
|
@@ -399,7 +399,7 @@ void BaseSurvivalServer::SpawnerReset(SpawnerNetworkCollection& spawnerNetworkCo
|
||||
|
||||
for (auto& spawner : spawnerNetworkCollection.networks) {
|
||||
for (auto& spawnerName : spawner.names) {
|
||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(spawnerName + spawner.number);
|
||||
auto spawners = Game::zoneManager->GetSpawnersByName(spawnerName + spawner.number);
|
||||
if (!spawners.empty()) {
|
||||
auto* spawnerObject = spawners.at(0);
|
||||
|
||||
@@ -428,7 +428,7 @@ void BaseSurvivalServer::SpawnerUpdate(Entity* self, SpawnerNetworkCollection& s
|
||||
// If we want to spawn something specific now
|
||||
if (amount != 0) {
|
||||
auto spawnerNetwork = spawnerNetworkCollection.networks.at(0);
|
||||
auto possibleSpawners = dZoneManager::Instance()->GetSpawnersByName(spawnerNetwork.names.at(0) + spawnerNetwork.number);
|
||||
auto possibleSpawners = Game::zoneManager->GetSpawnersByName(spawnerNetwork.names.at(0) + spawnerNetwork.number);
|
||||
if (!possibleSpawners.empty()) {
|
||||
SpawnNow(possibleSpawners.at(0), amount);
|
||||
return;
|
||||
@@ -444,7 +444,7 @@ void BaseSurvivalServer::SpawnerUpdate(Entity* self, SpawnerNetworkCollection& s
|
||||
const auto& name = spawnerNetwork.names.at(i);
|
||||
const auto& toSpawn = newSet.at(i);
|
||||
|
||||
auto possibleSpawners = dZoneManager::Instance()->GetSpawnersByName(name + spawnerNetwork.number);
|
||||
auto possibleSpawners = Game::zoneManager->GetSpawnersByName(name + spawnerNetwork.number);
|
||||
if (!possibleSpawners.empty()) {
|
||||
SpawnNow(possibleSpawners.front(), toSpawn);
|
||||
}
|
||||
@@ -495,7 +495,7 @@ SpawnerNetwork BaseSurvivalServer::GetRandomSpawner(SpawnerNetworkCollection& sp
|
||||
void BaseSurvivalServer::ActivateSpawnerNetwork(SpawnerNetworkCollection& spawnerNetworkCollection) {
|
||||
for (auto& spawner : spawnerNetworkCollection.networks) {
|
||||
for (const auto& spawnerName : spawner.names) {
|
||||
auto possibleSpawners = dZoneManager::Instance()->GetSpawnersByName(spawnerName + spawner.number);
|
||||
auto possibleSpawners = Game::zoneManager->GetSpawnersByName(spawnerName + spawner.number);
|
||||
if (!possibleSpawners.empty()) {
|
||||
auto* spawnerObject = possibleSpawners.at(0);
|
||||
spawnerObject->Activate();
|
||||
@@ -509,7 +509,7 @@ void BaseSurvivalServer::UpdateMobLots(SpawnerNetworkCollection& spawnerNetworkC
|
||||
for (auto& spawner : spawnerNetworkCollection.networks) {
|
||||
for (auto& spawnerName : spawner.names) {
|
||||
if (!spawnerName.empty()) {
|
||||
auto spawnerObjects = dZoneManager::Instance()->GetSpawnersByName(spawnerName + spawner.number);
|
||||
auto spawnerObjects = Game::zoneManager->GetSpawnersByName(spawnerName + spawner.number);
|
||||
if (!spawnerObjects.empty()) {
|
||||
auto splitName = GeneralUtils::SplitString(spawnerName, '_');
|
||||
auto cleanName = splitName.size() > 1 ? splitName.at(1) : splitName.at(0);
|
||||
|
@@ -6,7 +6,7 @@ void BaseWavesGenericEnemy::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void BaseWavesGenericEnemy::OnDie(Entity* self, Entity* killer) {
|
||||
auto* zoneControlObject = dZoneManager::Instance()->GetZoneControlObject();
|
||||
auto* zoneControlObject = Game::zoneManager->GetZoneControlObject();
|
||||
if (zoneControlObject != nullptr) {
|
||||
zoneControlObject->OnFireEventServerSide(killer, "Survival_Update", GetPoints());
|
||||
}
|
||||
|
@@ -392,7 +392,7 @@ void BaseWavesServer::GameWon(Entity* self) {
|
||||
|
||||
// Done
|
||||
void BaseWavesServer::SpawnNow(const std::string& spawnerName, uint32_t amount, LOT spawnLot) {
|
||||
const auto spawners = dZoneManager::Instance()->GetSpawnersByName(spawnerName);
|
||||
const auto spawners = Game::zoneManager->GetSpawnersByName(spawnerName);
|
||||
for (auto* spawner : spawners) {
|
||||
if (spawnLot != LOT_NULL) {
|
||||
spawner->SetSpawnLot(spawnLot);
|
||||
@@ -581,7 +581,7 @@ void BaseWavesServer::UpdateMissionForAllPlayers(Entity* self, uint32_t missionI
|
||||
|
||||
void BaseWavesServer::ClearSpawners() {
|
||||
for (const auto& spawnerName : spawners) {
|
||||
const auto spawnerObjects = dZoneManager::Instance()->GetSpawnersByName(spawnerName);
|
||||
const auto spawnerObjects = Game::zoneManager->GetSpawnersByName(spawnerName);
|
||||
|
||||
for (auto* spawnerObject : spawnerObjects) {
|
||||
spawnerObject->Reset();
|
||||
|
@@ -42,7 +42,7 @@ void ActVehicleDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
|
||||
GameMessages::SendDie(vehicle, self->GetObjectID(), LWOOBJID_EMPTY, true, eKillType::VIOLENT, u"", 0, 0, 0, true, false, 0);
|
||||
|
||||
auto* zoneController = dZoneManager::Instance()->GetZoneControlObject();
|
||||
auto* zoneController = Game::zoneManager->GetZoneControlObject();
|
||||
|
||||
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
|
||||
|
||||
|
@@ -29,7 +29,7 @@ void FvBrickPuzzleServer::OnDie(Entity* self, Entity* killer) {
|
||||
|
||||
const auto nextPipeNum = pipeNum + 1;
|
||||
|
||||
const auto samePipeSpawners = dZoneManager::Instance()->GetSpawnersByName(myGroup);
|
||||
const auto samePipeSpawners = Game::zoneManager->GetSpawnersByName(myGroup);
|
||||
|
||||
if (!samePipeSpawners.empty()) {
|
||||
samePipeSpawners[0]->SoftReset();
|
||||
@@ -40,7 +40,7 @@ void FvBrickPuzzleServer::OnDie(Entity* self, Entity* killer) {
|
||||
if (killer != nullptr && killer->IsPlayer()) {
|
||||
const auto nextPipe = pipeGroup + std::to_string(nextPipeNum);
|
||||
|
||||
const auto nextPipeSpawners = dZoneManager::Instance()->GetSpawnersByName(nextPipe);
|
||||
const auto nextPipeSpawners = Game::zoneManager->GetSpawnersByName(nextPipe);
|
||||
|
||||
if (!nextPipeSpawners.empty()) {
|
||||
nextPipeSpawners[0]->Activate();
|
||||
@@ -48,7 +48,7 @@ void FvBrickPuzzleServer::OnDie(Entity* self, Entity* killer) {
|
||||
} else {
|
||||
const auto nextPipe = pipeGroup + "1";
|
||||
|
||||
const auto firstPipeSpawners = dZoneManager::Instance()->GetSpawnersByName(nextPipe);
|
||||
const auto firstPipeSpawners = Game::zoneManager->GetSpawnersByName(nextPipe);
|
||||
|
||||
if (!firstPipeSpawners.empty()) {
|
||||
firstPipeSpawners[0]->Activate();
|
||||
|
@@ -9,9 +9,9 @@ void FvFacilityBrick::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void FvFacilityBrick::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
|
||||
auto* brickSpawner = dZoneManager::Instance()->GetSpawnersByName("ImaginationBrick")[0];
|
||||
auto* bugSpawner = dZoneManager::Instance()->GetSpawnersByName("MaelstromBug")[0];
|
||||
auto* canisterSpawner = dZoneManager::Instance()->GetSpawnersByName("BrickCanister")[0];
|
||||
auto* brickSpawner = Game::zoneManager->GetSpawnersByName("ImaginationBrick")[0];
|
||||
auto* bugSpawner = Game::zoneManager->GetSpawnersByName("MaelstromBug")[0];
|
||||
auto* canisterSpawner = Game::zoneManager->GetSpawnersByName("BrickCanister")[0];
|
||||
|
||||
if (name == "ConsoleLeftUp") {
|
||||
GameMessages::SendStopFXEffect(self, true, "LeftPipeOff");
|
||||
|
@@ -6,11 +6,11 @@
|
||||
void GfJailWalls::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
||||
|
||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName("Jail0" + wall)) {
|
||||
for (auto* spawner : Game::zoneManager->GetSpawnersByName("Jail0" + wall)) {
|
||||
spawner->Deactivate();
|
||||
}
|
||||
|
||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName("JailCaptain0" + wall)) {
|
||||
for (auto* spawner : Game::zoneManager->GetSpawnersByName("JailCaptain0" + wall)) {
|
||||
spawner->Deactivate();
|
||||
}
|
||||
}
|
||||
@@ -20,11 +20,11 @@ void GfJailWalls::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
|
||||
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
||||
|
||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName("Jail0" + wall)) {
|
||||
for (auto* spawner : Game::zoneManager->GetSpawnersByName("Jail0" + wall)) {
|
||||
spawner->Activate();
|
||||
}
|
||||
|
||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName("JailCaptain0" + wall)) {
|
||||
for (auto* spawner : Game::zoneManager->GetSpawnersByName("JailCaptain0" + wall)) {
|
||||
spawner->Activate();
|
||||
}
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ void TriggerAmbush::OnProximityUpdate(Entity* self, Entity* entering, std::strin
|
||||
|
||||
self->SetVar(u"triggered", true);
|
||||
|
||||
const auto spawners = dZoneManager::Instance()->GetSpawnersByName("Ambush");
|
||||
const auto spawners = Game::zoneManager->GetSpawnersByName("Ambush");
|
||||
|
||||
for (auto* spawner : spawners) {
|
||||
spawner->Activate();
|
||||
@@ -27,7 +27,7 @@ void TriggerAmbush::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
self->SetVar(u"triggered", false);
|
||||
|
||||
const auto spawners = dZoneManager::Instance()->GetSpawnersByName("Ambush");
|
||||
const auto spawners = Game::zoneManager->GetSpawnersByName("Ambush");
|
||||
|
||||
for (auto* spawner : spawners) {
|
||||
spawner->Reset();
|
||||
|
@@ -142,7 +142,7 @@ void SGCannon::OnMessageBoxResponse(Entity* self, Entity* sender, int32_t button
|
||||
|
||||
if (identifier == u"Scoreboardinfo") {
|
||||
GameMessages::SendDisplayMessageBox(player->GetObjectID(), true,
|
||||
dZoneManager::Instance()->GetZoneControlObject()->GetObjectID(),
|
||||
Game::zoneManager->GetZoneControlObject()->GetObjectID(),
|
||||
u"Shooting_Gallery_Retry", 2, u"Retry?",
|
||||
u"", player->GetSystemAddress());
|
||||
} else {
|
||||
@@ -262,7 +262,7 @@ void SGCannon::OnActivityTimerDone(Entity* self, const std::string& name) {
|
||||
}
|
||||
const auto& toSpawn = activeSpawns.at(spawnNumber);
|
||||
const auto pathIndex = GeneralUtils::GenerateRandomNumber<float_t>(0, toSpawn.spawnPaths.size() - 1);
|
||||
const auto* path = dZoneManager::Instance()->GetZone()->GetPath(toSpawn.spawnPaths.at(pathIndex));
|
||||
const auto* path = Game::zoneManager->GetZone()->GetPath(toSpawn.spawnPaths.at(pathIndex));
|
||||
if (!path) {
|
||||
Game::logger->Log("SGCannon", "Path %s at index %i is null", toSpawn.spawnPaths.at(pathIndex).c_str(), pathIndex);
|
||||
return;
|
||||
|
@@ -29,7 +29,7 @@ void AgPropguards::OnMissionDialogueOK(Entity* self, Entity* target, int mission
|
||||
if (spawnerName.empty())
|
||||
spawnerName = "Guard";
|
||||
|
||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(spawnerName);
|
||||
auto spawners = Game::zoneManager->GetSpawnersByName(spawnerName);
|
||||
for (auto* spawner : spawners) {
|
||||
spawner->Deactivate();
|
||||
}
|
||||
|
Reference in New Issue
Block a user