Merge branch 'main' into pr/1107

This commit is contained in:
David Markowitz
2023-07-21 19:40:30 -07:00
59 changed files with 194 additions and 211 deletions

View File

@@ -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;

View File

@@ -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();

View File

@@ -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();
}

View File

@@ -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>();

View File

@@ -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();

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;

View File

@@ -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();

View File

@@ -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);