mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-26 07:27:18 +00:00
Merge branch 'main' into pr/1107
This commit is contained in:
commit
34392932b3
@ -11,6 +11,7 @@ class RakPeerInterface;
|
|||||||
class AssetManager;
|
class AssetManager;
|
||||||
struct SystemAddress;
|
struct SystemAddress;
|
||||||
class EntityManager;
|
class EntityManager;
|
||||||
|
class dZoneManager;
|
||||||
|
|
||||||
namespace Game {
|
namespace Game {
|
||||||
extern dLogger* logger;
|
extern dLogger* logger;
|
||||||
@ -24,4 +25,5 @@ namespace Game {
|
|||||||
extern SystemAddress chatSysAddr;
|
extern SystemAddress chatSysAddr;
|
||||||
extern bool shouldShutdown;
|
extern bool shouldShutdown;
|
||||||
extern EntityManager* entityManager;
|
extern EntityManager* entityManager;
|
||||||
|
extern dZoneManager* zoneManager;
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ void Character::DoQuickXMLDataParse() {
|
|||||||
//To try and fix the AG landing into:
|
//To try and fix the AG landing into:
|
||||||
if (m_ZoneID == 1000 && Game::server->GetZoneID() == 1100) {
|
if (m_ZoneID == 1000 && Game::server->GetZoneID() == 1100) {
|
||||||
//sneakily insert our position:
|
//sneakily insert our position:
|
||||||
auto pos = dZoneManager::Instance()->GetZone()->GetSpawnPos();
|
auto pos = Game::zoneManager->GetZone()->GetSpawnPos();
|
||||||
character->SetAttribute("lzx", pos.x);
|
character->SetAttribute("lzx", pos.x);
|
||||||
character->SetAttribute("lzy", pos.y);
|
character->SetAttribute("lzy", pos.y);
|
||||||
character->SetAttribute("lzz", pos.z);
|
character->SetAttribute("lzz", pos.z);
|
||||||
@ -296,7 +296,7 @@ void Character::UnlockEmote(int emoteID) {
|
|||||||
void Character::SetBuildMode(bool buildMode) {
|
void Character::SetBuildMode(bool buildMode) {
|
||||||
m_BuildMode = buildMode;
|
m_BuildMode = buildMode;
|
||||||
|
|
||||||
auto* controller = dZoneManager::Instance()->GetZoneControlObject();
|
auto* controller = Game::zoneManager->GetZoneControlObject();
|
||||||
|
|
||||||
controller->OnFireEventServerSide(m_OurEntity, buildMode ? "OnBuildModeEnter" : "OnBuildModeLeave");
|
controller->OnFireEventServerSide(m_OurEntity, buildMode ? "OnBuildModeEnter" : "OnBuildModeLeave");
|
||||||
}
|
}
|
||||||
@ -312,7 +312,7 @@ void Character::SaveXMLToDatabase() {
|
|||||||
character->SetAttribute("gm", static_cast<uint32_t>(m_GMLevel));
|
character->SetAttribute("gm", static_cast<uint32_t>(m_GMLevel));
|
||||||
character->SetAttribute("cc", m_Coins);
|
character->SetAttribute("cc", m_Coins);
|
||||||
|
|
||||||
auto zoneInfo = dZoneManager::Instance()->GetZone()->GetZoneID();
|
auto zoneInfo = Game::zoneManager->GetZone()->GetZoneID();
|
||||||
// lzid garbage, binary concat of zoneID, zoneInstance and zoneClone
|
// lzid garbage, binary concat of zoneID, zoneInstance and zoneClone
|
||||||
if (zoneInfo.GetMapID() != 0 && zoneInfo.GetCloneID() == 0) {
|
if (zoneInfo.GetMapID() != 0 && zoneInfo.GetCloneID() == 0) {
|
||||||
uint64_t lzidConcat = zoneInfo.GetCloneID();
|
uint64_t lzidConcat = zoneInfo.GetCloneID();
|
||||||
|
@ -267,13 +267,13 @@ void Entity::Initialize() {
|
|||||||
|
|
||||||
if (m_Character->HasBeenToWorld(mapID) && targetSceneName.empty()) {
|
if (m_Character->HasBeenToWorld(mapID) && targetSceneName.empty()) {
|
||||||
pos = m_Character->GetRespawnPoint(mapID);
|
pos = m_Character->GetRespawnPoint(mapID);
|
||||||
rot = dZoneManager::Instance()->GetZone()->GetSpawnRot();
|
rot = Game::zoneManager->GetZone()->GetSpawnRot();
|
||||||
} else if (targetScene != nullptr) {
|
} else if (targetScene != nullptr) {
|
||||||
pos = targetScene->GetPosition();
|
pos = targetScene->GetPosition();
|
||||||
rot = targetScene->GetRotation();
|
rot = targetScene->GetRotation();
|
||||||
} else {
|
} else {
|
||||||
pos = dZoneManager::Instance()->GetZone()->GetSpawnPos();
|
pos = Game::zoneManager->GetZone()->GetSpawnPos();
|
||||||
rot = dZoneManager::Instance()->GetZone()->GetSpawnRot();
|
rot = Game::zoneManager->GetZone()->GetSpawnRot();
|
||||||
}
|
}
|
||||||
|
|
||||||
controllablePhysics->SetPosition(pos);
|
controllablePhysics->SetPosition(pos);
|
||||||
@ -505,7 +505,7 @@ void Entity::Initialize() {
|
|||||||
// ZoneControl script
|
// ZoneControl script
|
||||||
if (m_TemplateID == 2365) {
|
if (m_TemplateID == 2365) {
|
||||||
CDZoneTableTable* zoneTable = CDClientManager::Instance().GetTable<CDZoneTableTable>();
|
CDZoneTableTable* zoneTable = CDClientManager::Instance().GetTable<CDZoneTableTable>();
|
||||||
const auto zoneID = dZoneManager::Instance()->GetZoneID();
|
const auto zoneID = Game::zoneManager->GetZoneID();
|
||||||
const CDZoneTable* zoneData = zoneTable->Query(zoneID.GetMapID());
|
const CDZoneTable* zoneData = zoneTable->Query(zoneID.GetMapID());
|
||||||
|
|
||||||
if (zoneData != nullptr) {
|
if (zoneData != nullptr) {
|
||||||
@ -691,7 +691,7 @@ void Entity::Initialize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string pathName = GetVarAsString(u"attached_path");
|
std::string pathName = GetVarAsString(u"attached_path");
|
||||||
const Path* path = dZoneManager::Instance()->GetZone()->GetPath(pathName);
|
const Path* path = Game::zoneManager->GetZone()->GetPath(pathName);
|
||||||
|
|
||||||
//Check to see if we have an attached path and add the appropiate component to handle it:
|
//Check to see if we have an attached path and add the appropiate component to handle it:
|
||||||
if (path){
|
if (path){
|
||||||
@ -1544,14 +1544,14 @@ void Entity::Kill(Entity* murderer) {
|
|||||||
const auto& grpNameQBShowBricks = GetVar<std::string>(u"grpNameQBShowBricks");
|
const auto& grpNameQBShowBricks = GetVar<std::string>(u"grpNameQBShowBricks");
|
||||||
|
|
||||||
if (!grpNameQBShowBricks.empty()) {
|
if (!grpNameQBShowBricks.empty()) {
|
||||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(grpNameQBShowBricks);
|
auto spawners = Game::zoneManager->GetSpawnersByName(grpNameQBShowBricks);
|
||||||
|
|
||||||
Spawner* spawner = nullptr;
|
Spawner* spawner = nullptr;
|
||||||
|
|
||||||
if (!spawners.empty()) {
|
if (!spawners.empty()) {
|
||||||
spawner = spawners[0];
|
spawner = spawners[0];
|
||||||
} else {
|
} else {
|
||||||
spawners = dZoneManager::Instance()->GetSpawnersInGroup(grpNameQBShowBricks);
|
spawners = Game::zoneManager->GetSpawnersInGroup(grpNameQBShowBricks);
|
||||||
|
|
||||||
if (!spawners.empty()) {
|
if (!spawners.empty()) {
|
||||||
spawner = spawners[0];
|
spawner = spawners[0];
|
||||||
|
@ -60,7 +60,7 @@ void EntityManager::Initialize() {
|
|||||||
m_GhostingEnabled = std::find(
|
m_GhostingEnabled = std::find(
|
||||||
m_GhostingExcludedZones.begin(),
|
m_GhostingExcludedZones.begin(),
|
||||||
m_GhostingExcludedZones.end(),
|
m_GhostingExcludedZones.end(),
|
||||||
dZoneManager::Instance()->GetZoneID().GetMapID()
|
Game::zoneManager->GetZoneID().GetMapID()
|
||||||
) == m_GhostingExcludedZones.end();
|
) == m_GhostingExcludedZones.end();
|
||||||
|
|
||||||
// grab hardcore mode settings and load them with sane defaults
|
// grab hardcore mode settings and load them with sane defaults
|
||||||
@ -75,7 +75,7 @@ void EntityManager::Initialize() {
|
|||||||
|
|
||||||
// If cloneID is not zero, then hardcore mode is disabled
|
// If cloneID is not zero, then hardcore mode is disabled
|
||||||
// aka minigames and props
|
// aka minigames and props
|
||||||
if (dZoneManager::Instance()->GetZoneID().GetCloneID() != 0) m_HardcoreMode = false;
|
if (Game::zoneManager->GetZoneID().GetCloneID() != 0) m_HardcoreMode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity* EntityManager::CreateEntity(EntityInfo info, User* user, Entity* parentEntity, const bool controller, const LWOOBJID explicitId) {
|
Entity* EntityManager::CreateEntity(EntityInfo info, User* user, Entity* parentEntity, const bool controller, const LWOOBJID explicitId) {
|
||||||
|
@ -62,7 +62,7 @@ void Player::SetSystemAddress(const SystemAddress& value) {
|
|||||||
void Player::SetRespawnPos(const NiPoint3 position) {
|
void Player::SetRespawnPos(const NiPoint3 position) {
|
||||||
m_respawnPos = position;
|
m_respawnPos = position;
|
||||||
|
|
||||||
m_Character->SetRespawnPoint(dZoneManager::Instance()->GetZone()->GetWorldID(), position);
|
m_Character->SetRespawnPoint(Game::zoneManager->GetZone()->GetWorldID(), position);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::SetRespawnRot(const NiQuaternion rotation) {
|
void Player::SetRespawnRot(const NiQuaternion rotation) {
|
||||||
|
@ -23,11 +23,11 @@ void PropertyTeleportBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
|
|||||||
LWOMAPID targetMapId = m_MapId;
|
LWOMAPID targetMapId = m_MapId;
|
||||||
LWOCLONEID targetCloneId = character->GetPropertyCloneID();
|
LWOCLONEID targetCloneId = character->GetPropertyCloneID();
|
||||||
|
|
||||||
if (dZoneManager::Instance()->GetZoneID().GetCloneID() == character->GetPropertyCloneID()) {
|
if (Game::zoneManager->GetZoneID().GetCloneID() == character->GetPropertyCloneID()) {
|
||||||
targetMapId = character->GetLastNonInstanceZoneID();
|
targetMapId = character->GetLastNonInstanceZoneID();
|
||||||
targetCloneId = 0;
|
targetCloneId = 0;
|
||||||
} else {
|
} else {
|
||||||
character->SetLastNonInstanceZoneID(dZoneManager::Instance()->GetZoneID().GetMapID());
|
character->SetLastNonInstanceZoneID(Game::zoneManager->GetZoneID().GetMapID());
|
||||||
}
|
}
|
||||||
|
|
||||||
ZoneInstanceManager::Instance()->RequestZoneTransfer(Game::server, targetMapId, targetCloneId, false, [objId](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort) {
|
ZoneInstanceManager::Instance()->RequestZoneTransfer(Game::server, targetMapId, targetCloneId, false, [objId](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort) {
|
||||||
|
@ -419,7 +419,7 @@ void CharacterComponent::TrackMissionCompletion(bool isAchievement) {
|
|||||||
|
|
||||||
// Achievements are tracked separately for the zone
|
// Achievements are tracked separately for the zone
|
||||||
if (isAchievement) {
|
if (isAchievement) {
|
||||||
const auto mapID = dZoneManager::Instance()->GetZoneID().GetMapID();
|
const auto mapID = Game::zoneManager->GetZoneID().GetMapID();
|
||||||
GetZoneStatisticsForMap(mapID).m_AchievementsCollected++;
|
GetZoneStatisticsForMap(mapID).m_AchievementsCollected++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -480,7 +480,7 @@ void CharacterComponent::TrackArmorDelta(int32_t armor) {
|
|||||||
void CharacterComponent::TrackRebuildComplete() {
|
void CharacterComponent::TrackRebuildComplete() {
|
||||||
UpdatePlayerStatistic(QuickBuildsCompleted);
|
UpdatePlayerStatistic(QuickBuildsCompleted);
|
||||||
|
|
||||||
const auto mapID = dZoneManager::Instance()->GetZoneID().GetMapID();
|
const auto mapID = Game::zoneManager->GetZoneID().GetMapID();
|
||||||
GetZoneStatisticsForMap(mapID).m_QuickBuildsCompleted++;
|
GetZoneStatisticsForMap(mapID).m_QuickBuildsCompleted++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ void ControllablePhysicsComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto zoneInfo = dZoneManager::Instance()->GetZone()->GetZoneID();
|
auto zoneInfo = Game::zoneManager->GetZone()->GetZoneID();
|
||||||
|
|
||||||
if (zoneInfo.GetMapID() != 0 && zoneInfo.GetCloneID() == 0) {
|
if (zoneInfo.GetMapID() != 0 && zoneInfo.GetCloneID() == 0) {
|
||||||
character->SetAttribute("lzx", m_Position.x);
|
character->SetAttribute("lzx", m_Position.x);
|
||||||
|
@ -779,13 +779,13 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Check if this zone allows coin drops
|
//Check if this zone allows coin drops
|
||||||
if (dZoneManager::Instance()->GetPlayerLoseCoinOnDeath()) {
|
if (Game::zoneManager->GetPlayerLoseCoinOnDeath()) {
|
||||||
auto* character = m_Parent->GetCharacter();
|
auto* character = m_Parent->GetCharacter();
|
||||||
uint64_t coinsTotal = character->GetCoins();
|
uint64_t coinsTotal = character->GetCoins();
|
||||||
const uint64_t minCoinsToLose = dZoneManager::Instance()->GetWorldConfig()->coinsLostOnDeathMin;
|
const uint64_t minCoinsToLose = Game::zoneManager->GetWorldConfig()->coinsLostOnDeathMin;
|
||||||
if (coinsTotal >= minCoinsToLose) {
|
if (coinsTotal >= minCoinsToLose) {
|
||||||
const uint64_t maxCoinsToLose = dZoneManager::Instance()->GetWorldConfig()->coinsLostOnDeathMax;
|
const uint64_t maxCoinsToLose = Game::zoneManager->GetWorldConfig()->coinsLostOnDeathMax;
|
||||||
const float coinPercentageToLose = dZoneManager::Instance()->GetWorldConfig()->coinsLostOnDeathPercent;
|
const float coinPercentageToLose = Game::zoneManager->GetWorldConfig()->coinsLostOnDeathPercent;
|
||||||
|
|
||||||
uint64_t coinsToLose = std::max(static_cast<uint64_t>(coinsTotal * coinPercentageToLose), minCoinsToLose);
|
uint64_t coinsToLose = std::max(static_cast<uint64_t>(coinsTotal * coinPercentageToLose), minCoinsToLose);
|
||||||
coinsToLose = std::min(maxCoinsToLose, coinsToLose);
|
coinsToLose = std::min(maxCoinsToLose, coinsToLose);
|
||||||
|
@ -922,7 +922,7 @@ void InventoryComponent::UnEquipItem(Item* item) {
|
|||||||
// Trigger property event
|
// Trigger property event
|
||||||
if (PropertyManagementComponent::Instance() != nullptr && item->GetCount() > 0 && Inventory::FindInventoryTypeForLot(item->GetLot()) == MODELS) {
|
if (PropertyManagementComponent::Instance() != nullptr && item->GetCount() > 0 && Inventory::FindInventoryTypeForLot(item->GetLot()) == MODELS) {
|
||||||
PropertyManagementComponent::Instance()->GetParent()->OnZonePropertyModelRemovedWhileEquipped(m_Parent);
|
PropertyManagementComponent::Instance()->GetParent()->OnZonePropertyModelRemovedWhileEquipped(m_Parent);
|
||||||
dZoneManager::Instance()->GetZoneControlObject()->OnZonePropertyModelRemovedWhileEquipped(m_Parent);
|
Game::zoneManager->GetZoneControlObject()->OnZonePropertyModelRemovedWhileEquipped(m_Parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ std::unordered_map<AchievementCacheKey, std::vector<uint32_t>> MissionComponent:
|
|||||||
|
|
||||||
//! Initializer
|
//! Initializer
|
||||||
MissionComponent::MissionComponent(Entity* parent) : Component(parent) {
|
MissionComponent::MissionComponent(Entity* parent) : Component(parent) {
|
||||||
m_LastUsedMissionOrderUID = dZoneManager::Instance()->GetUniqueMissionIdStartingValue();
|
m_LastUsedMissionOrderUID = Game::zoneManager->GetUniqueMissionIdStartingValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
|
@ -59,7 +59,7 @@ MovingPlatformComponent::MovingPlatformComponent(Entity* parent, const std::stri
|
|||||||
m_MoverSubComponentType = eMoverSubComponentType::mover;
|
m_MoverSubComponentType = eMoverSubComponentType::mover;
|
||||||
m_MoverSubComponent = new MoverSubComponent(m_Parent->GetDefaultPosition());
|
m_MoverSubComponent = new MoverSubComponent(m_Parent->GetDefaultPosition());
|
||||||
m_PathName = GeneralUtils::ASCIIToUTF16(pathName);
|
m_PathName = GeneralUtils::ASCIIToUTF16(pathName);
|
||||||
m_Path = dZoneManager::Instance()->GetZone()->GetPath(pathName);
|
m_Path = Game::zoneManager->GetZone()->GetPath(pathName);
|
||||||
m_NoAutoStart = false;
|
m_NoAutoStart = false;
|
||||||
|
|
||||||
if (m_Path == nullptr) {
|
if (m_Path == nullptr) {
|
||||||
|
@ -236,7 +236,7 @@ void PetComponent::OnUse(Entity* originator) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& bricks = BrickDatabase::Instance()->GetBricks(buildFile);
|
const auto& bricks = BrickDatabase::GetBricks(buildFile);
|
||||||
|
|
||||||
if (bricks.empty()) {
|
if (bricks.empty()) {
|
||||||
ChatPackets::SendSystemMessage(originator->GetSystemAddress(), u"Failed to load the puzzle minigame for this pet.");
|
ChatPackets::SendSystemMessage(originator->GetSystemAddress(), u"Failed to load the puzzle minigame for this pet.");
|
||||||
|
@ -38,7 +38,7 @@ PropertyManagementComponent::PropertyManagementComponent(Entity* parent) : Compo
|
|||||||
|
|
||||||
instance = this;
|
instance = this;
|
||||||
|
|
||||||
const auto& worldId = dZoneManager::Instance()->GetZone()->GetZoneID();
|
const auto& worldId = Game::zoneManager->GetZone()->GetZoneID();
|
||||||
|
|
||||||
const auto zoneId = worldId.GetMapID();
|
const auto zoneId = worldId.GetMapID();
|
||||||
const auto cloneId = worldId.GetCloneID();
|
const auto cloneId = worldId.GetCloneID();
|
||||||
@ -98,7 +98,7 @@ void PropertyManagementComponent::SetOwner(Entity* value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<NiPoint3> PropertyManagementComponent::GetPaths() const {
|
std::vector<NiPoint3> PropertyManagementComponent::GetPaths() const {
|
||||||
const auto zoneId = dZoneManager::Instance()->GetZone()->GetWorldID();
|
const auto zoneId = Game::zoneManager->GetZone()->GetWorldID();
|
||||||
|
|
||||||
auto query = CDClientDatabase::CreatePreppedStmt(
|
auto query = CDClientDatabase::CreatePreppedStmt(
|
||||||
"SELECT path FROM PropertyTemplate WHERE mapID = ?;");
|
"SELECT path FROM PropertyTemplate WHERE mapID = ?;");
|
||||||
@ -192,7 +192,7 @@ bool PropertyManagementComponent::Claim(const LWOOBJID playerId) {
|
|||||||
auto character = entity->GetCharacter();
|
auto character = entity->GetCharacter();
|
||||||
if (!character) return false;
|
if (!character) return false;
|
||||||
|
|
||||||
auto* zone = dZoneManager::Instance()->GetZone();
|
auto* zone = Game::zoneManager->GetZone();
|
||||||
|
|
||||||
const auto& worldId = zone->GetZoneID();
|
const auto& worldId = zone->GetZoneID();
|
||||||
const auto propertyZoneId = worldId.GetMapID();
|
const auto propertyZoneId = worldId.GetMapID();
|
||||||
@ -240,7 +240,7 @@ bool PropertyManagementComponent::Claim(const LWOOBJID playerId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* zoneControlObject = dZoneManager::Instance()->GetZoneControlObject();
|
auto* zoneControlObject = Game::zoneManager->GetZoneControlObject();
|
||||||
for (CppScripts::Script* script : CppScripts::GetEntityScripts(zoneControlObject)) {
|
for (CppScripts::Script* script : CppScripts::GetEntityScripts(zoneControlObject)) {
|
||||||
script->OnZonePropertyRented(zoneControlObject, entity);
|
script->OnZonePropertyRented(zoneControlObject, entity);
|
||||||
}
|
}
|
||||||
@ -376,9 +376,9 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
|
|||||||
info.spawnerID = persistentId;
|
info.spawnerID = persistentId;
|
||||||
GeneralUtils::SetBit(info.spawnerID, eObjectBits::CLIENT);
|
GeneralUtils::SetBit(info.spawnerID, eObjectBits::CLIENT);
|
||||||
|
|
||||||
const auto spawnerId = dZoneManager::Instance()->MakeSpawner(info);
|
const auto spawnerId = Game::zoneManager->MakeSpawner(info);
|
||||||
|
|
||||||
auto* spawner = dZoneManager::Instance()->GetSpawner(spawnerId);
|
auto* spawner = Game::zoneManager->GetSpawner(spawnerId);
|
||||||
|
|
||||||
auto ldfModelBehavior = new LDFData<LWOOBJID>(u"modelBehaviors", 0);
|
auto ldfModelBehavior = new LDFData<LWOOBJID>(u"modelBehaviors", 0);
|
||||||
auto userModelID = new LDFData<LWOOBJID>(u"userModelID", info.spawnerID);
|
auto userModelID = new LDFData<LWOOBJID>(u"userModelID", info.spawnerID);
|
||||||
@ -433,7 +433,7 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
|
|||||||
|
|
||||||
const auto spawnerId = index->second;
|
const auto spawnerId = index->second;
|
||||||
|
|
||||||
auto* spawner = dZoneManager::Instance()->GetSpawner(spawnerId);
|
auto* spawner = Game::zoneManager->GetSpawner(spawnerId);
|
||||||
|
|
||||||
models.erase(id);
|
models.erase(id);
|
||||||
|
|
||||||
@ -496,7 +496,7 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
|
|||||||
GameMessages::SendPlaceModelResponse(entity->GetObjectID(), entity->GetSystemAddress(), NiPoint3::ZERO, LWOOBJID_EMPTY, 16, NiQuaternion::IDENTITY);
|
GameMessages::SendPlaceModelResponse(entity->GetObjectID(), entity->GetSystemAddress(), NiPoint3::ZERO, LWOOBJID_EMPTY, 16, NiQuaternion::IDENTITY);
|
||||||
|
|
||||||
if (spawner != nullptr) {
|
if (spawner != nullptr) {
|
||||||
dZoneManager::Instance()->RemoveSpawner(spawner->m_Info.spawnerID);
|
Game::zoneManager->RemoveSpawner(spawner->m_Info.spawnerID);
|
||||||
} else {
|
} else {
|
||||||
model->Smash(LWOOBJID_EMPTY, eKillType::SILENT);
|
model->Smash(LWOOBJID_EMPTY, eKillType::SILENT);
|
||||||
}
|
}
|
||||||
@ -549,7 +549,7 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
|
|||||||
GameMessages::SendPlaceModelResponse(entity->GetObjectID(), entity->GetSystemAddress(), NiPoint3::ZERO, LWOOBJID_EMPTY, 16, NiQuaternion::IDENTITY);
|
GameMessages::SendPlaceModelResponse(entity->GetObjectID(), entity->GetSystemAddress(), NiPoint3::ZERO, LWOOBJID_EMPTY, 16, NiQuaternion::IDENTITY);
|
||||||
|
|
||||||
if (spawner != nullptr) {
|
if (spawner != nullptr) {
|
||||||
dZoneManager::Instance()->RemoveSpawner(spawner->m_Info.spawnerID);
|
Game::zoneManager->RemoveSpawner(spawner->m_Info.spawnerID);
|
||||||
} else {
|
} else {
|
||||||
model->Smash(LWOOBJID_EMPTY, eKillType::SILENT);
|
model->Smash(LWOOBJID_EMPTY, eKillType::SILENT);
|
||||||
}
|
}
|
||||||
@ -652,9 +652,9 @@ void PropertyManagementComponent::Load() {
|
|||||||
|
|
||||||
node->config = settings;
|
node->config = settings;
|
||||||
|
|
||||||
const auto spawnerId = dZoneManager::Instance()->MakeSpawner(info);
|
const auto spawnerId = Game::zoneManager->MakeSpawner(info);
|
||||||
|
|
||||||
auto* spawner = dZoneManager::Instance()->GetSpawner(spawnerId);
|
auto* spawner = Game::zoneManager->GetSpawner(spawnerId);
|
||||||
|
|
||||||
auto* model = spawner->Spawn();
|
auto* model = spawner->Spawn();
|
||||||
|
|
||||||
@ -786,7 +786,7 @@ void PropertyManagementComponent::OnQueryPropertyData(Entity* originator, const
|
|||||||
author = m_Parent->GetObjectID();
|
author = m_Parent->GetObjectID();
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& worldId = dZoneManager::Instance()->GetZone()->GetZoneID();
|
const auto& worldId = Game::zoneManager->GetZone()->GetZoneID();
|
||||||
const auto zoneId = worldId.GetMapID();
|
const auto zoneId = worldId.GetMapID();
|
||||||
|
|
||||||
Game::logger->Log("Properties", "Getting property info for %d", zoneId);
|
Game::logger->Log("Properties", "Getting property info for %d", zoneId);
|
||||||
|
@ -43,7 +43,7 @@ void PropertyVendorComponent::OnBuyFromVendor(Entity* originator, const bool con
|
|||||||
|
|
||||||
GameMessages::SendPropertyRentalResponse(m_Parent->GetObjectID(), 0, 0, 0, 0, originator->GetSystemAddress());
|
GameMessages::SendPropertyRentalResponse(m_Parent->GetObjectID(), 0, 0, 0, 0, originator->GetSystemAddress());
|
||||||
|
|
||||||
auto* controller = dZoneManager::Instance()->GetZoneControlObject();
|
auto* controller = Game::zoneManager->GetZoneControlObject();
|
||||||
|
|
||||||
controller->OnFireEventServerSide(m_Parent, "propertyRented");
|
controller->OnFireEventServerSide(m_Parent, "propertyRented");
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ RacingControlComponent::RacingControlComponent(Entity* parent)
|
|||||||
|
|
||||||
m_MainWorld = 1200;
|
m_MainWorld = 1200;
|
||||||
const auto worldID = Game::server->GetZoneID();
|
const auto worldID = Game::server->GetZoneID();
|
||||||
if (dZoneManager::Instance()->CheckIfAccessibleZone((worldID / 10) * 10)) m_MainWorld = (worldID / 10) * 10;
|
if (Game::zoneManager->CheckIfAccessibleZone((worldID/10)*10)) m_MainWorld = (worldID/10)*10;
|
||||||
|
|
||||||
m_ActivityID = 42;
|
m_ActivityID = 42;
|
||||||
CDActivitiesTable* activitiesTable = CDClientManager::Instance().GetTable<CDActivitiesTable>();
|
CDActivitiesTable* activitiesTable = CDClientManager::Instance().GetTable<CDActivitiesTable>();
|
||||||
@ -106,7 +106,7 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
|
|||||||
|
|
||||||
// Calculate the vehicle's starting position.
|
// Calculate the vehicle's starting position.
|
||||||
|
|
||||||
auto* path = dZoneManager::Instance()->GetZone()->GetPath(
|
auto* path = Game::zoneManager->GetZone()->GetPath(
|
||||||
GeneralUtils::UTF16ToWTF8(m_PathName));
|
GeneralUtils::UTF16ToWTF8(m_PathName));
|
||||||
|
|
||||||
auto spawnPointEntities = Game::entityManager->GetEntitiesByLOT(4843);
|
auto spawnPointEntities = Game::entityManager->GetEntitiesByLOT(4843);
|
||||||
@ -373,8 +373,12 @@ void RacingControlComponent::HandleMessageBoxResponse(Entity* player, int32_t bu
|
|||||||
data->collectedRewards = true;
|
data->collectedRewards = true;
|
||||||
|
|
||||||
// Calculate the score, different loot depending on player count
|
// Calculate the score, different loot depending on player count
|
||||||
const auto score = m_LoadedPlayers * 10 + data->finished;
|
auto playersRating = m_LoadedPlayers;
|
||||||
|
if(m_LoadedPlayers == 1 && m_SoloRacing) {
|
||||||
|
playersRating *= 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto score = playersRating * 10 + data->finished;
|
||||||
LootGenerator::Instance().GiveActivityLoot(player, m_Parent, m_ActivityID, score);
|
LootGenerator::Instance().GiveActivityLoot(player, m_Parent, m_ActivityID, score);
|
||||||
|
|
||||||
// Giving rewards
|
// Giving rewards
|
||||||
@ -393,11 +397,11 @@ void RacingControlComponent::HandleMessageBoxResponse(Entity* player, int32_t bu
|
|||||||
if (m_SoloRacing || m_LoadedPlayers > 2) {
|
if (m_SoloRacing || m_LoadedPlayers > 2) {
|
||||||
missionComponent->Progress(eMissionTaskType::RACING, data->finished, (LWOOBJID)eRacingTaskParam::FINISH_WITH_PLACEMENT); // Finish in 1st place on a race
|
missionComponent->Progress(eMissionTaskType::RACING, data->finished, (LWOOBJID)eRacingTaskParam::FINISH_WITH_PLACEMENT); // Finish in 1st place on a race
|
||||||
if (data->finished == 1) {
|
if (data->finished == 1) {
|
||||||
missionComponent->Progress(eMissionTaskType::RACING, dZoneManager::Instance()->GetZone()->GetWorldID(), (LWOOBJID)eRacingTaskParam::FIRST_PLACE_MULTIPLE_TRACKS); // Finish in 1st place on multiple tracks.
|
missionComponent->Progress(eMissionTaskType::RACING, Game::zoneManager->GetZone()->GetWorldID(), (LWOOBJID)eRacingTaskParam::FIRST_PLACE_MULTIPLE_TRACKS); // Finish in 1st place on multiple tracks.
|
||||||
missionComponent->Progress(eMissionTaskType::RACING, dZoneManager::Instance()->GetZone()->GetWorldID(), (LWOOBJID)eRacingTaskParam::WIN_RACE_IN_WORLD); // Finished first place in specific world.
|
missionComponent->Progress(eMissionTaskType::RACING, Game::zoneManager->GetZone()->GetWorldID(), (LWOOBJID)eRacingTaskParam::WIN_RACE_IN_WORLD); // Finished first place in specific world.
|
||||||
}
|
}
|
||||||
if (data->finished == m_LoadedPlayers) {
|
if (data->finished == m_LoadedPlayers) {
|
||||||
missionComponent->Progress(eMissionTaskType::RACING, dZoneManager::Instance()->GetZone()->GetWorldID(), (LWOOBJID)eRacingTaskParam::LAST_PLACE_FINISH); // Finished first place in specific world.
|
missionComponent->Progress(eMissionTaskType::RACING, Game::zoneManager->GetZone()->GetWorldID(), (LWOOBJID)eRacingTaskParam::LAST_PLACE_FINISH); // Finished first place in specific world.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ((id == "ACT_RACE_EXIT_THE_RACE?" || id == "Exit") && button == m_ActivityExitConfirm) {
|
} else if ((id == "ACT_RACE_EXIT_THE_RACE?" || id == "Exit") && button == m_ActivityExitConfirm) {
|
||||||
@ -649,11 +653,11 @@ void RacingControlComponent::Update(float deltaTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Spawn imagination pickups
|
// Spawn imagination pickups
|
||||||
auto* minSpawner = dZoneManager::Instance()->GetSpawnersByName(
|
auto* minSpawner = Game::zoneManager->GetSpawnersByName(
|
||||||
"ImaginationSpawn_Min")[0];
|
"ImaginationSpawn_Min")[0];
|
||||||
auto* medSpawner = dZoneManager::Instance()->GetSpawnersByName(
|
auto* medSpawner = Game::zoneManager->GetSpawnersByName(
|
||||||
"ImaginationSpawn_Med")[0];
|
"ImaginationSpawn_Med")[0];
|
||||||
auto* maxSpawner = dZoneManager::Instance()->GetSpawnersByName(
|
auto* maxSpawner = Game::zoneManager->GetSpawnersByName(
|
||||||
"ImaginationSpawn_Max")[0];
|
"ImaginationSpawn_Max")[0];
|
||||||
|
|
||||||
minSpawner->Activate();
|
minSpawner->Activate();
|
||||||
@ -722,7 +726,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Race routines
|
// Race routines
|
||||||
auto* path = dZoneManager::Instance()->GetZone()->GetPath(
|
auto* path = Game::zoneManager->GetZone()->GetPath(
|
||||||
GeneralUtils::UTF16ToWTF8(m_PathName));
|
GeneralUtils::UTF16ToWTF8(m_PathName));
|
||||||
|
|
||||||
for (auto& player : m_RacingPlayers) {
|
for (auto& player : m_RacingPlayers) {
|
||||||
|
@ -149,7 +149,7 @@ void ScriptedActivityComponent::PlayerJoinLobby(Entity* player) {
|
|||||||
|
|
||||||
auto* character = player->GetCharacter();
|
auto* character = player->GetCharacter();
|
||||||
if (character != nullptr)
|
if (character != nullptr)
|
||||||
character->SetLastNonInstanceZoneID(dZoneManager::Instance()->GetZone()->GetWorldID());
|
character->SetLastNonInstanceZoneID(Game::zoneManager->GetZone()->GetWorldID());
|
||||||
|
|
||||||
for (Lobby* lobby : m_Queue) {
|
for (Lobby* lobby : m_Queue) {
|
||||||
if (lobby->players.size() < m_ActivityInfo.maxTeamSize || m_ActivityInfo.maxTeamSize == 1 && lobby->players.size() < m_ActivityInfo.maxTeams) {
|
if (lobby->players.size() < m_ActivityInfo.maxTeamSize || m_ActivityInfo.maxTeamSize == 1 && lobby->players.size() < m_ActivityInfo.maxTeams) {
|
||||||
@ -310,7 +310,7 @@ bool ScriptedActivityComponent::IsValidActivity(Entity* player) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ChatPackets::SendSystemMessage(player->GetSystemAddress(), u"Sorry, this activity is not ready.");
|
ChatPackets::SendSystemMessage(player->GetSystemAddress(), u"Sorry, this activity is not ready.");
|
||||||
static_cast<Player*>(player)->SendToZone(dZoneManager::Instance()->GetZone()->GetWorldID()); // Gets them out of this stuck state
|
static_cast<Player*>(player)->SendToZone(Game::zoneManager->GetZone()->GetWorldID()); // Gets them out of this stuck state
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}*/
|
}*/
|
||||||
|
@ -26,7 +26,7 @@ TriggerComponent::TriggerComponent(Entity* parent, const std::string triggerInfo
|
|||||||
uint32_t triggerID;
|
uint32_t triggerID;
|
||||||
GeneralUtils::TryParse<uint32_t>(tokens.at(1), triggerID);
|
GeneralUtils::TryParse<uint32_t>(tokens.at(1), triggerID);
|
||||||
|
|
||||||
m_Trigger = dZoneManager::Instance()->GetZone()->GetTrigger(sceneID, triggerID);
|
m_Trigger = Game::zoneManager->GetZone()->GetTrigger(sceneID, triggerID);
|
||||||
|
|
||||||
if (!m_Trigger) m_Trigger = new LUTriggers::Trigger();
|
if (!m_Trigger) m_Trigger = new LUTriggers::Trigger();
|
||||||
}
|
}
|
||||||
@ -409,25 +409,25 @@ void TriggerComponent::HandleSetPhysicsVolumeStatus(Entity* targetEntity, std::s
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TriggerComponent::HandleActivateSpawnerNetwork(std::string args){
|
void TriggerComponent::HandleActivateSpawnerNetwork(std::string args){
|
||||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(args)) {
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName(args)) {
|
||||||
if (spawner) spawner->Activate();
|
if (spawner) spawner->Activate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TriggerComponent::HandleDeactivateSpawnerNetwork(std::string args){
|
void TriggerComponent::HandleDeactivateSpawnerNetwork(std::string args){
|
||||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(args)) {
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName(args)) {
|
||||||
if (spawner) spawner->Deactivate();
|
if (spawner) spawner->Deactivate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TriggerComponent::HandleResetSpawnerNetwork(std::string args){
|
void TriggerComponent::HandleResetSpawnerNetwork(std::string args){
|
||||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(args)) {
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName(args)) {
|
||||||
if (spawner) spawner->Reset();
|
if (spawner) spawner->Reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TriggerComponent::HandleDestroySpawnerNetworkObjects(std::string args){
|
void TriggerComponent::HandleDestroySpawnerNetworkObjects(std::string args){
|
||||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(args)) {
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName(args)) {
|
||||||
if (spawner) spawner->DestroyAllEntities();
|
if (spawner) spawner->DestroyAllEntities();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
|
|||||||
|
|
||||||
// After we've done our thing, tell the client they're ready
|
// After we've done our thing, tell the client they're ready
|
||||||
GameMessages::SendPlayerReady(entity, sysAddr);
|
GameMessages::SendPlayerReady(entity, sysAddr);
|
||||||
GameMessages::SendPlayerReady(dZoneManager::Instance()->GetZoneControlObject(), sysAddr);
|
GameMessages::SendPlayerReady(Game::zoneManager->GetZoneControlObject(), sysAddr);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2340,13 +2340,13 @@ void GameMessages::HandleStartBuildingWithItem(RakNet::BitStream* inStream, Enti
|
|||||||
void GameMessages::HandlePropertyEditorBegin(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
void GameMessages::HandlePropertyEditorBegin(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
||||||
PropertyManagementComponent::Instance()->OnStartBuilding();
|
PropertyManagementComponent::Instance()->OnStartBuilding();
|
||||||
|
|
||||||
dZoneManager::Instance()->GetZoneControlObject()->OnZonePropertyEditBegin();
|
Game::zoneManager->GetZoneControlObject()->OnZonePropertyEditBegin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameMessages::HandlePropertyEditorEnd(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
void GameMessages::HandlePropertyEditorEnd(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
||||||
PropertyManagementComponent::Instance()->OnFinishBuilding();
|
PropertyManagementComponent::Instance()->OnFinishBuilding();
|
||||||
|
|
||||||
dZoneManager::Instance()->GetZoneControlObject()->OnZonePropertyEditEnd();
|
Game::zoneManager->GetZoneControlObject()->OnZonePropertyEditEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameMessages::HandlePropertyContentsFromClient(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
void GameMessages::HandlePropertyContentsFromClient(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
||||||
@ -2358,7 +2358,7 @@ void GameMessages::HandlePropertyContentsFromClient(RakNet::BitStream* inStream,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GameMessages::HandlePropertyModelEquipped(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
void GameMessages::HandlePropertyModelEquipped(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
||||||
dZoneManager::Instance()->GetZoneControlObject()->OnZonePropertyModelEquipped();
|
Game::zoneManager->GetZoneControlObject()->OnZonePropertyModelEquipped();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameMessages::HandlePlacePropertyModel(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
void GameMessages::HandlePlacePropertyModel(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
||||||
@ -2584,7 +2584,7 @@ void GameMessages::HandleBBBSaveRequest(RakNet::BitStream* inStream, Entity* ent
|
|||||||
GeneralUtils::SetBit(blueprintID, eObjectBits::PERSISTENT);
|
GeneralUtils::SetBit(blueprintID, eObjectBits::PERSISTENT);
|
||||||
|
|
||||||
//We need to get the propertyID: (stolen from Wincent's propertyManagementComp)
|
//We need to get the propertyID: (stolen from Wincent's propertyManagementComp)
|
||||||
const auto& worldId = dZoneManager::Instance()->GetZone()->GetZoneID();
|
const auto& worldId = Game::zoneManager->GetZone()->GetZoneID();
|
||||||
|
|
||||||
const auto zoneId = worldId.GetMapID();
|
const auto zoneId = worldId.GetMapID();
|
||||||
const auto cloneId = worldId.GetCloneID();
|
const auto cloneId = worldId.GetCloneID();
|
||||||
@ -3456,7 +3456,7 @@ void GameMessages::SendNotifyTamingModelLoadedOnServer(LWOOBJID objectId, const
|
|||||||
SEND_PACKET;
|
SEND_PACKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameMessages::SendNotifyPetTamingPuzzleSelected(LWOOBJID objectId, std::vector<Brick>& bricks, const SystemAddress& sysAddr) {
|
void GameMessages::SendNotifyPetTamingPuzzleSelected(LWOOBJID objectId, const std::vector<Brick>& bricks, const SystemAddress& sysAddr) {
|
||||||
CBITSTREAM;
|
CBITSTREAM;
|
||||||
CMSGHEADER;
|
CMSGHEADER;
|
||||||
|
|
||||||
@ -4122,7 +4122,7 @@ void GameMessages::HandleRacingClientReady(RakNet::BitStream* inStream, Entity*
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* racingControlComponent = dZoneManager::Instance()->GetZoneControlObject()->GetComponent<RacingControlComponent>();
|
auto* racingControlComponent = Game::zoneManager->GetZoneControlObject()->GetComponent<RacingControlComponent>();
|
||||||
|
|
||||||
if (racingControlComponent == nullptr) {
|
if (racingControlComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -4170,7 +4170,7 @@ void GameMessages::HandleRequestDie(RakNet::BitStream* inStream, Entity* entity,
|
|||||||
inStream->Read(lootOwnerID);
|
inStream->Read(lootOwnerID);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* zoneController = dZoneManager::Instance()->GetZoneControlObject();
|
auto* zoneController = Game::zoneManager->GetZoneControlObject();
|
||||||
|
|
||||||
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
|
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
|
||||||
|
|
||||||
@ -4213,7 +4213,7 @@ void GameMessages::HandleRacingPlayerInfoResetFinished(RakNet::BitStream* inStre
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* zoneController = dZoneManager::Instance()->GetZoneControlObject();
|
auto* zoneController = Game::zoneManager->GetZoneControlObject();
|
||||||
|
|
||||||
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
|
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
|
||||||
|
|
||||||
@ -4243,7 +4243,7 @@ void GameMessages::HandleUpdatePropertyPerformanceCost(RakNet::BitStream* inStre
|
|||||||
|
|
||||||
if (performanceCost == 0.0f) return;
|
if (performanceCost == 0.0f) return;
|
||||||
|
|
||||||
auto zone = dZoneManager::Instance()->GetZone();
|
auto zone = Game::zoneManager->GetZone();
|
||||||
const auto& worldId = zone->GetZoneID();
|
const auto& worldId = zone->GetZoneID();
|
||||||
const auto cloneId = worldId.GetCloneID();
|
const auto cloneId = worldId.GetCloneID();
|
||||||
const auto zoneId = worldId.GetMapID();
|
const auto zoneId = worldId.GetMapID();
|
||||||
@ -4975,7 +4975,7 @@ void GameMessages::HandleFireEventServerSide(RakNet::BitStream* inStream, Entity
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mapId == 0) {
|
if (mapId == 0) {
|
||||||
mapId = dZoneManager::Instance()->GetZoneID().GetMapID(); // Fallback to sending the player back to the same zone.
|
mapId = Game::zoneManager->GetZoneID().GetMapID(); // Fallback to sending the player back to the same zone.
|
||||||
}
|
}
|
||||||
|
|
||||||
Game::logger->Log("FireEventServerSide", "Player %llu has requested zone transfer to (%i, %i).", sender->GetObjectID(), (int)mapId, (int)cloneId);
|
Game::logger->Log("FireEventServerSide", "Player %llu has requested zone transfer to (%i, %i).", sender->GetObjectID(), (int)mapId, (int)cloneId);
|
||||||
|
@ -364,7 +364,7 @@ namespace GameMessages {
|
|||||||
//Pets:
|
//Pets:
|
||||||
void SendNotifyPetTamingMinigame(LWOOBJID objectId, LWOOBJID petId, LWOOBJID playerTamingId, bool bForceTeleport, ePetTamingNotifyType notifyType, NiPoint3 petsDestPos, NiPoint3 telePos, NiQuaternion teleRot, const SystemAddress& sysAddr);
|
void SendNotifyPetTamingMinigame(LWOOBJID objectId, LWOOBJID petId, LWOOBJID playerTamingId, bool bForceTeleport, ePetTamingNotifyType notifyType, NiPoint3 petsDestPos, NiPoint3 telePos, NiQuaternion teleRot, const SystemAddress& sysAddr);
|
||||||
|
|
||||||
void SendNotifyPetTamingPuzzleSelected(LWOOBJID objectId, std::vector<Brick>& bricks, const SystemAddress& sysAddr);
|
void SendNotifyPetTamingPuzzleSelected(LWOOBJID objectId, const std::vector<Brick>& bricks, const SystemAddress& sysAddr);
|
||||||
|
|
||||||
void SendNotifyTamingModelLoadedOnServer(LWOOBJID objectId, const SystemAddress& sysAddr);
|
void SendNotifyTamingModelLoadedOnServer(LWOOBJID objectId, const SystemAddress& sysAddr);
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ Mission::Mission(MissionComponent* missionComponent, const uint32_t missionId) {
|
|||||||
|
|
||||||
m_Timestamp = 0;
|
m_Timestamp = 0;
|
||||||
|
|
||||||
m_UniqueMissionID = dZoneManager::Instance()->GetUniqueMissionIdStartingValue();
|
m_UniqueMissionID = Game::zoneManager->GetUniqueMissionIdStartingValue();
|
||||||
|
|
||||||
m_Reward = 0;
|
m_Reward = 0;
|
||||||
|
|
||||||
@ -443,9 +443,9 @@ void Mission::YieldRewards() {
|
|||||||
int32_t coinsToSend = 0;
|
int32_t coinsToSend = 0;
|
||||||
if (info->LegoScore > 0) {
|
if (info->LegoScore > 0) {
|
||||||
eLootSourceType lootSource = info->isMission ? eLootSourceType::MISSION : eLootSourceType::ACHIEVEMENT;
|
eLootSourceType lootSource = info->isMission ? eLootSourceType::MISSION : eLootSourceType::ACHIEVEMENT;
|
||||||
if (levelComponent->GetLevel() >= dZoneManager::Instance()->GetWorldConfig()->levelCap) {
|
if (levelComponent->GetLevel() >= Game::zoneManager->GetWorldConfig()->levelCap) {
|
||||||
// Since the character is at the level cap we reward them with coins instead of UScore.
|
// Since the character is at the level cap we reward them with coins instead of UScore.
|
||||||
coinsToSend += info->LegoScore * dZoneManager::Instance()->GetWorldConfig()->levelCapCurrencyConversion;
|
coinsToSend += info->LegoScore * Game::zoneManager->GetWorldConfig()->levelCapCurrencyConversion;
|
||||||
} else {
|
} else {
|
||||||
characterComponent->SetUScore(characterComponent->GetUScore() + info->LegoScore);
|
characterComponent->SetUScore(characterComponent->GetUScore() + info->LegoScore);
|
||||||
GameMessages::SendModifyLEGOScore(entity, entity->GetSystemAddress(), info->LegoScore, lootSource);
|
GameMessages::SendModifyLEGOScore(entity, entity->GetSystemAddress(), info->LegoScore, lootSource);
|
||||||
|
@ -391,7 +391,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
|
|||||||
// The meaning of associate can be found in eRacingTaskParam.h
|
// The meaning of associate can be found in eRacingTaskParam.h
|
||||||
if (parameters.empty()) break;
|
if (parameters.empty()) break;
|
||||||
|
|
||||||
if (!InAllTargets(dZoneManager::Instance()->GetZone()->GetWorldID()) && !(parameters[0] == 4 || parameters[0] == 5) && !InAllTargets(value)) break;
|
if (!InAllTargets(Game::zoneManager->GetZone()->GetWorldID()) && !(parameters[0] == 4 || parameters[0] == 5) && !InAllTargets(value)) break;
|
||||||
|
|
||||||
if (parameters[0] != associate) break;
|
if (parameters[0] != associate) break;
|
||||||
|
|
||||||
|
@ -5,14 +5,12 @@
|
|||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "AssetManager.h"
|
#include "AssetManager.h"
|
||||||
#include "tinyxml2.h"
|
#include "tinyxml2.h"
|
||||||
|
#include "Brick.h"
|
||||||
|
|
||||||
std::vector<Brick> BrickDatabase::emptyCache{};
|
const BrickList& BrickDatabase::GetBricks(const LxfmlPath& lxfmlPath) {
|
||||||
BrickDatabase* BrickDatabase::m_Address = nullptr;
|
static std::unordered_map<LxfmlPath, BrickList> m_Cache;
|
||||||
|
static const BrickList emptyCache;
|
||||||
|
|
||||||
BrickDatabase::BrickDatabase() = default;
|
|
||||||
BrickDatabase::~BrickDatabase() = default;
|
|
||||||
|
|
||||||
std::vector<Brick>& BrickDatabase::GetBricks(const std::string& lxfmlPath) {
|
|
||||||
const auto cached = m_Cache.find(lxfmlPath);
|
const auto cached = m_Cache.find(lxfmlPath);
|
||||||
|
|
||||||
if (cached != m_Cache.end()) {
|
if (cached != m_Cache.end()) {
|
||||||
@ -45,7 +43,7 @@ std::vector<Brick>& BrickDatabase::GetBricks(const std::string& lxfmlPath) {
|
|||||||
return emptyCache;
|
return emptyCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Brick> parts;
|
BrickList parts;
|
||||||
|
|
||||||
auto* lxfml = doc->FirstChildElement("LXFML");
|
auto* lxfml = doc->FirstChildElement("LXFML");
|
||||||
auto* bricks = lxfml->FirstChildElement("Bricks");
|
auto* bricks = lxfml->FirstChildElement("Bricks");
|
||||||
|
@ -1,29 +1,16 @@
|
|||||||
|
#ifndef __BRICKDATABASE__H__
|
||||||
|
#define __BRICKDATABASE__H__
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
|
|
||||||
class BrickDatabase
|
class Brick;
|
||||||
{
|
using BrickList = std::vector<Brick>;
|
||||||
public:
|
using LxfmlPath = std::string;
|
||||||
static BrickDatabase* Instance() {
|
|
||||||
if (m_Address == nullptr) {
|
|
||||||
m_Address = new BrickDatabase();
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_Address;
|
namespace BrickDatabase {
|
||||||
}
|
const BrickList& GetBricks(const LxfmlPath& lxfmlPath);
|
||||||
|
|
||||||
std::vector<Brick>& GetBricks(const std::string& lxfmlPath);
|
|
||||||
|
|
||||||
explicit BrickDatabase();
|
|
||||||
|
|
||||||
~BrickDatabase();
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::unordered_map<std::string, std::vector<Brick>> m_Cache;
|
|
||||||
|
|
||||||
static std::vector<Brick> emptyCache;
|
|
||||||
|
|
||||||
static BrickDatabase* m_Address; //For singleton method
|
|
||||||
|
|
||||||
/* data */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif //!__BRICKDATABASE__H__
|
||||||
|
@ -195,7 +195,7 @@ void Mail::HandleSendMail(RakNet::BitStream* packet, const SystemAddress& sysAdd
|
|||||||
uint32_t itemID = static_cast<uint32_t>(attachmentID);
|
uint32_t itemID = static_cast<uint32_t>(attachmentID);
|
||||||
LOT itemLOT = 0;
|
LOT itemLOT = 0;
|
||||||
//Inventory::InventoryType itemType;
|
//Inventory::InventoryType itemType;
|
||||||
int mailCost = dZoneManager::Instance()->GetWorldConfig()->mailBaseFee;
|
int mailCost = Game::zoneManager->GetWorldConfig()->mailBaseFee;
|
||||||
int stackSize = 0;
|
int stackSize = 0;
|
||||||
auto inv = static_cast<InventoryComponent*>(entity->GetComponent(eReplicaComponentType::INVENTORY));
|
auto inv = static_cast<InventoryComponent*>(entity->GetComponent(eReplicaComponentType::INVENTORY));
|
||||||
Item* item = nullptr;
|
Item* item = nullptr;
|
||||||
@ -203,7 +203,7 @@ void Mail::HandleSendMail(RakNet::BitStream* packet, const SystemAddress& sysAdd
|
|||||||
if (itemID > 0 && attachmentCount > 0 && inv) {
|
if (itemID > 0 && attachmentCount > 0 && inv) {
|
||||||
item = inv->FindItemById(attachmentID);
|
item = inv->FindItemById(attachmentID);
|
||||||
if (item) {
|
if (item) {
|
||||||
mailCost += (item->GetInfo().baseValue * dZoneManager::Instance()->GetWorldConfig()->mailPercentAttachmentFee);
|
mailCost += (item->GetInfo().baseValue * Game::zoneManager->GetWorldConfig()->mailPercentAttachmentFee);
|
||||||
stackSize = item->GetCount();
|
stackSize = item->GetCount();
|
||||||
itemLOT = item->GetLot();
|
itemLOT = item->GetLot();
|
||||||
} else {
|
} else {
|
||||||
|
@ -272,7 +272,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatCommand == "leave-zone") {
|
if (chatCommand == "leave-zone") {
|
||||||
const auto currentZone = dZoneManager::Instance()->GetZone()->GetZoneID().GetMapID();
|
const auto currentZone = Game::zoneManager->GetZone()->GetZoneID().GetMapID();
|
||||||
|
|
||||||
LWOMAPID newZone = 0;
|
LWOMAPID newZone = 0;
|
||||||
if (currentZone % 100 == 0) {
|
if (currentZone % 100 == 0) {
|
||||||
@ -282,7 +282,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
newZone = (currentZone / 100) * 100;
|
newZone = (currentZone / 100) * 100;
|
||||||
}
|
}
|
||||||
// If new zone would be inaccessible, then default to Avant Gardens.
|
// If new zone would be inaccessible, then default to Avant Gardens.
|
||||||
if (!dZoneManager::Instance()->CheckIfAccessibleZone(newZone)) newZone = 1100;
|
if (!Game::zoneManager->CheckIfAccessibleZone(newZone)) newZone = 1100;
|
||||||
|
|
||||||
ChatPackets::SendSystemMessage(sysAddr, u"Leaving zone...");
|
ChatPackets::SendSystemMessage(sysAddr, u"Leaving zone...");
|
||||||
|
|
||||||
@ -336,7 +336,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatCommand == "resurrect") {
|
if (chatCommand == "resurrect") {
|
||||||
ScriptedActivityComponent* scriptedActivityComponent = dZoneManager::Instance()->GetZoneControlObject()->GetComponent<ScriptedActivityComponent>();
|
ScriptedActivityComponent* scriptedActivityComponent = Game::zoneManager->GetZoneControlObject()->GetComponent<ScriptedActivityComponent>();
|
||||||
|
|
||||||
if (scriptedActivityComponent) { // check if user is in activity world and if so, they can't resurrect
|
if (scriptedActivityComponent) { // check if user is in activity world and if so, they can't resurrect
|
||||||
ChatPackets::SendSystemMessage(sysAddr, u"You cannot resurrect in an activity world.");
|
ChatPackets::SendSystemMessage(sysAddr, u"You cannot resurrect in an activity world.");
|
||||||
@ -351,7 +351,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatCommand == "instanceinfo") {
|
if (chatCommand == "instanceinfo") {
|
||||||
const auto zoneId = dZoneManager::Instance()->GetZone()->GetZoneID();
|
const auto zoneId = Game::zoneManager->GetZone()->GetZoneID();
|
||||||
|
|
||||||
ChatPackets::SendSystemMessage(sysAddr, u"Map: " + (GeneralUtils::to_u16string(zoneId.GetMapID())) + u"\nClone: " + (GeneralUtils::to_u16string(zoneId.GetCloneID())) + u"\nInstance: " + (GeneralUtils::to_u16string(zoneId.GetInstanceID())));
|
ChatPackets::SendSystemMessage(sysAddr, u"Map: " + (GeneralUtils::to_u16string(zoneId.GetMapID())) + u"\nClone: " + (GeneralUtils::to_u16string(zoneId.GetCloneID())) + u"\nInstance: " + (GeneralUtils::to_u16string(zoneId.GetInstanceID())));
|
||||||
}
|
}
|
||||||
@ -1443,7 +1443,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((chatCommand == "freemoney" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) && args.size() == 1) {
|
if ((chatCommand == "freemoney" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) && args.size() == 1) {
|
||||||
int32_t money;
|
int64_t money;
|
||||||
|
|
||||||
if (!GeneralUtils::TryParse(args[0], money)) {
|
if (!GeneralUtils::TryParse(args[0], money)) {
|
||||||
ChatPackets::SendSystemMessage(sysAddr, u"Invalid money.");
|
ChatPackets::SendSystemMessage(sysAddr, u"Invalid money.");
|
||||||
@ -1541,7 +1541,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
|
|
||||||
const auto objid = entity->GetObjectID();
|
const auto objid = entity->GetObjectID();
|
||||||
|
|
||||||
if (force || dZoneManager::Instance()->CheckIfAccessibleZone(reqZone)) { // to prevent tomfoolery
|
if (force || Game::zoneManager->CheckIfAccessibleZone(reqZone)) { // to prevent tomfoolery
|
||||||
|
|
||||||
ZoneInstanceManager::Instance()->RequestZoneTransfer(Game::server, reqZone, cloneId, false, [objid](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort) {
|
ZoneInstanceManager::Instance()->RequestZoneTransfer(Game::server, reqZone, cloneId, false, [objid](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort) {
|
||||||
|
|
||||||
@ -1645,13 +1645,13 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatCommand == "activatespawner" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
|
if (chatCommand == "activatespawner" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
|
||||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(args[0]);
|
auto spawners = Game::zoneManager->GetSpawnersByName(args[0]);
|
||||||
|
|
||||||
for (auto* spawner : spawners) {
|
for (auto* spawner : spawners) {
|
||||||
spawner->Activate();
|
spawner->Activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
spawners = dZoneManager::Instance()->GetSpawnersInGroup(args[0]);
|
spawners = Game::zoneManager->GetSpawnersInGroup(args[0]);
|
||||||
|
|
||||||
for (auto* spawner : spawners) {
|
for (auto* spawner : spawners) {
|
||||||
spawner->Activate();
|
spawner->Activate();
|
||||||
@ -1685,13 +1685,13 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatCommand == "triggerspawner" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
|
if (chatCommand == "triggerspawner" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
|
||||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(args[0]);
|
auto spawners = Game::zoneManager->GetSpawnersByName(args[0]);
|
||||||
|
|
||||||
for (auto* spawner : spawners) {
|
for (auto* spawner : spawners) {
|
||||||
spawner->Spawn();
|
spawner->Spawn();
|
||||||
}
|
}
|
||||||
|
|
||||||
spawners = dZoneManager::Instance()->GetSpawnersInGroup(args[0]);
|
spawners = Game::zoneManager->GetSpawnersInGroup(args[0]);
|
||||||
|
|
||||||
for (auto* spawner : spawners) {
|
for (auto* spawner : spawners) {
|
||||||
spawner->Spawn();
|
spawner->Spawn();
|
||||||
|
@ -19,7 +19,7 @@ void WorldPackets::SendLoadStaticZone(const SystemAddress& sysAddr, float x, flo
|
|||||||
RakNet::BitStream bitStream;
|
RakNet::BitStream bitStream;
|
||||||
PacketUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::LOAD_STATIC_ZONE);
|
PacketUtils::WriteHeader(bitStream, eConnectionType::CLIENT, eClientMessageType::LOAD_STATIC_ZONE);
|
||||||
|
|
||||||
auto zone = dZoneManager::Instance()->GetZone()->GetZoneID();
|
auto zone = Game::zoneManager->GetZone()->GetZoneID();
|
||||||
bitStream.Write(static_cast<uint16_t>(zone.GetMapID()));
|
bitStream.Write(static_cast<uint16_t>(zone.GetMapID()));
|
||||||
bitStream.Write(static_cast<uint16_t>(zone.GetInstanceID()));
|
bitStream.Write(static_cast<uint16_t>(zone.GetInstanceID()));
|
||||||
//bitStream.Write(static_cast<uint32_t>(zone.GetCloneID()));
|
//bitStream.Write(static_cast<uint32_t>(zone.GetCloneID()));
|
||||||
|
@ -52,7 +52,7 @@ void BossSpiderQueenEnemyServer::OnStartup(Entity* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BossSpiderQueenEnemyServer::OnDie(Entity* self, Entity* killer) {
|
void BossSpiderQueenEnemyServer::OnDie(Entity* self, Entity* killer) {
|
||||||
if (dZoneManager::Instance()->GetZoneID().GetMapID() == instanceZoneID) {
|
if (Game::zoneManager->GetZoneID().GetMapID() == instanceZoneID) {
|
||||||
auto* missionComponent = killer->GetComponent<MissionComponent>();
|
auto* missionComponent = killer->GetComponent<MissionComponent>();
|
||||||
if (missionComponent == nullptr)
|
if (missionComponent == nullptr)
|
||||||
return;
|
return;
|
||||||
@ -276,7 +276,7 @@ void BossSpiderQueenEnemyServer::RunRainOfFire(Entity* self) {
|
|||||||
|
|
||||||
auto index = 0u;
|
auto index = 0u;
|
||||||
for (const auto& rofGroup : ROFTargetGroupIDTable) {
|
for (const auto& rofGroup : ROFTargetGroupIDTable) {
|
||||||
const auto spawners = dZoneManager::Instance()->GetSpawnersInGroup(rofGroup);
|
const auto spawners = Game::zoneManager->GetSpawnersInGroup(rofGroup);
|
||||||
|
|
||||||
std::vector<LWOOBJID> spawned;
|
std::vector<LWOOBJID> spawned;
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ void AmDropshipComputer::OnDie(Entity* self, Entity* killer) {
|
|||||||
|
|
||||||
const auto nextPipeNum = pipeNum + 1;
|
const auto nextPipeNum = pipeNum + 1;
|
||||||
|
|
||||||
const auto samePipeSpawners = dZoneManager::Instance()->GetSpawnersByName(myGroup);
|
const auto samePipeSpawners = Game::zoneManager->GetSpawnersByName(myGroup);
|
||||||
|
|
||||||
if (!samePipeSpawners.empty()) {
|
if (!samePipeSpawners.empty()) {
|
||||||
samePipeSpawners[0]->SoftReset();
|
samePipeSpawners[0]->SoftReset();
|
||||||
@ -53,7 +53,7 @@ void AmDropshipComputer::OnDie(Entity* self, Entity* killer) {
|
|||||||
if (killer != nullptr && killer->IsPlayer()) {
|
if (killer != nullptr && killer->IsPlayer()) {
|
||||||
const auto nextPipe = pipeGroup + std::to_string(nextPipeNum);
|
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()) {
|
if (!nextPipeSpawners.empty()) {
|
||||||
nextPipeSpawners[0]->Activate();
|
nextPipeSpawners[0]->Activate();
|
||||||
@ -61,7 +61,7 @@ void AmDropshipComputer::OnDie(Entity* self, Entity* killer) {
|
|||||||
} else {
|
} else {
|
||||||
const auto nextPipe = pipeGroup + "1";
|
const auto nextPipe = pipeGroup + "1";
|
||||||
|
|
||||||
const auto firstPipeSpawners = dZoneManager::Instance()->GetSpawnersByName(nextPipe);
|
const auto firstPipeSpawners = Game::zoneManager->GetSpawnersByName(nextPipe);
|
||||||
|
|
||||||
if (!firstPipeSpawners.empty()) {
|
if (!firstPipeSpawners.empty()) {
|
||||||
firstPipeSpawners[0]->Activate();
|
firstPipeSpawners[0]->Activate();
|
||||||
|
@ -93,13 +93,13 @@ void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ImgBrickConsoleQB::SpawnBrick(Entity* self) {
|
void ImgBrickConsoleQB::SpawnBrick(Entity* self) {
|
||||||
const auto netDevil = dZoneManager::Instance()->GetSpawnersByName("MaelstromBug");
|
const auto netDevil = Game::zoneManager->GetSpawnersByName("MaelstromBug");
|
||||||
if (!netDevil.empty()) {
|
if (!netDevil.empty()) {
|
||||||
netDevil[0]->Reset();
|
netDevil[0]->Reset();
|
||||||
netDevil[0]->Deactivate();
|
netDevil[0]->Deactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto brick = dZoneManager::Instance()->GetSpawnersByName("Imagination");
|
const auto brick = Game::zoneManager->GetSpawnersByName("Imagination");
|
||||||
if (!brick.empty()) {
|
if (!brick.empty()) {
|
||||||
brick[0]->Activate();
|
brick[0]->Activate();
|
||||||
}
|
}
|
||||||
@ -117,7 +117,7 @@ void ImgBrickConsoleQB::SmashCanister(Entity* self) {
|
|||||||
canister->Smash(canister->GetObjectID(), eKillType::VIOLENT);
|
canister->Smash(canister->GetObjectID(), eKillType::VIOLENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto canister = dZoneManager::Instance()->GetSpawnersByName("BrickCanister");
|
const auto canister = Game::zoneManager->GetSpawnersByName("BrickCanister");
|
||||||
if (!canister.empty()) {
|
if (!canister.empty()) {
|
||||||
canister[0]->Reset();
|
canister[0]->Reset();
|
||||||
canister[0]->Deactivate();
|
canister[0]->Deactivate();
|
||||||
@ -195,29 +195,29 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer) {
|
|||||||
|
|
||||||
const auto firstPipe = pipeGroup + "1";
|
const auto firstPipe = pipeGroup + "1";
|
||||||
|
|
||||||
const auto samePipeSpawner = dZoneManager::Instance()->GetSpawnersByName(myGroup);
|
const auto samePipeSpawner = Game::zoneManager->GetSpawnersByName(myGroup);
|
||||||
if (!samePipeSpawner.empty()) {
|
if (!samePipeSpawner.empty()) {
|
||||||
samePipeSpawner[0]->Reset();
|
samePipeSpawner[0]->Reset();
|
||||||
samePipeSpawner[0]->Deactivate();
|
samePipeSpawner[0]->Deactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto firstPipeSpawner = dZoneManager::Instance()->GetSpawnersByName(firstPipe);
|
const auto firstPipeSpawner = Game::zoneManager->GetSpawnersByName(firstPipe);
|
||||||
if (!firstPipeSpawner.empty()) {
|
if (!firstPipeSpawner.empty()) {
|
||||||
firstPipeSpawner[0]->Activate();
|
firstPipeSpawner[0]->Activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto netdevil = dZoneManager::Instance()->GetSpawnersByName("Imagination");
|
const auto netdevil = Game::zoneManager->GetSpawnersByName("Imagination");
|
||||||
if (!netdevil.empty()) {
|
if (!netdevil.empty()) {
|
||||||
netdevil[0]->Reset();
|
netdevil[0]->Reset();
|
||||||
netdevil[0]->Deactivate();
|
netdevil[0]->Deactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto brick = dZoneManager::Instance()->GetSpawnersByName("MaelstromBug");
|
const auto brick = Game::zoneManager->GetSpawnersByName("MaelstromBug");
|
||||||
if (!brick.empty()) {
|
if (!brick.empty()) {
|
||||||
brick[0]->Activate();
|
brick[0]->Activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto canister = dZoneManager::Instance()->GetSpawnersByName("BrickCanister");
|
const auto canister = Game::zoneManager->GetSpawnersByName("BrickCanister");
|
||||||
if (!canister.empty()) {
|
if (!canister.empty()) {
|
||||||
canister[0]->Activate();
|
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);
|
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>();
|
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
|
// Reset any bouncers that might've been created by the previous dig
|
||||||
if (digInfo.bouncer) {
|
if (digInfo.bouncer) {
|
||||||
auto bounceNumber = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"BouncerNumber"));
|
auto bounceNumber = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"BouncerNumber"));
|
||||||
auto bouncerSpawners = dZoneManager::Instance()->GetSpawnersByName("PetBouncer" + bounceNumber);
|
auto bouncerSpawners = Game::zoneManager->GetSpawnersByName("PetBouncer" + bounceNumber);
|
||||||
auto switchSpawners = dZoneManager::Instance()->GetSpawnersByName("PetBouncerSwitch" + bounceNumber);
|
auto switchSpawners = Game::zoneManager->GetSpawnersByName("PetBouncerSwitch" + bounceNumber);
|
||||||
|
|
||||||
for (auto* bouncerSpawner : bouncerSpawners) {
|
for (auto* bouncerSpawner : bouncerSpawners) {
|
||||||
for (auto* bouncer : bouncerSpawner->m_Info.nodes)
|
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) {
|
void PetDigServer::HandleBouncerDig(const Entity* self, const Entity* owner) {
|
||||||
auto bounceNumber = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"BouncerNumber"));
|
auto bounceNumber = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"BouncerNumber"));
|
||||||
auto bouncerSpawners = dZoneManager::Instance()->GetSpawnersByName("PetBouncer" + bounceNumber);
|
auto bouncerSpawners = Game::zoneManager->GetSpawnersByName("PetBouncer" + bounceNumber);
|
||||||
auto switchSpawners = dZoneManager::Instance()->GetSpawnersByName("PetBouncerSwitch" + bounceNumber);
|
auto switchSpawners = Game::zoneManager->GetSpawnersByName("PetBouncerSwitch" + bounceNumber);
|
||||||
|
|
||||||
for (auto* bouncerSpawner : bouncerSpawners) {
|
for (auto* bouncerSpawner : bouncerSpawners) {
|
||||||
bouncerSpawner->Activate();
|
bouncerSpawner->Activate();
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "Amf3.h"
|
#include "Amf3.h"
|
||||||
|
|
||||||
void NsLegoClubDoor::OnStartup(Entity* self) {
|
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"choiceZone", m_ChoiceZoneID);
|
||||||
self->SetVar(u"teleportAnim", m_TeleportAnim);
|
self->SetVar(u"teleportAnim", m_TeleportAnim);
|
||||||
self->SetVar(u"teleportString", m_TeleportString);
|
self->SetVar(u"teleportString", m_TeleportString);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "Amf3.h"
|
#include "Amf3.h"
|
||||||
|
|
||||||
void NsLupTeleport::OnStartup(Entity* self) {
|
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"choiceZone", m_ChoiceZoneID);
|
||||||
self->SetVar(u"teleportAnim", m_TeleportAnim);
|
self->SetVar(u"teleportAnim", m_TeleportAnim);
|
||||||
self->SetVar(u"teleportString", m_TeleportString);
|
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);
|
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::SendPlay2DAmbientSound(player, GUIDMaelstrom);
|
||||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"maelstromSkyOn", 0, 0,
|
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"maelstromSkyOn", 0, 0,
|
||||||
LWOOBJID_EMPTY, "", player->GetSystemAddress());
|
LWOOBJID_EMPTY, "", player->GetSystemAddress());
|
||||||
@ -93,7 +93,7 @@ void ZoneAgProperty::OnZoneLoadedInfo(Entity* self) {
|
|||||||
void ZoneAgProperty::LoadInstance(Entity* self) {
|
void ZoneAgProperty::LoadInstance(Entity* self) {
|
||||||
SetGameVariables(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) {
|
for (auto* spawnerNode : spawner->m_Info.nodes) {
|
||||||
spawnerNode->config.push_back(
|
spawnerNode->config.push_back(
|
||||||
new LDFData<std::string>(u"custom_script_server",
|
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) {
|
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())
|
if (spawnerIDs.empty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ void ZoneAgProperty::OnTimerDone(Entity* self, std::string timerName) {
|
|||||||
|
|
||||||
void ZoneAgProperty::BaseTimerDone(Entity* self, const std::string& timerName) {
|
void ZoneAgProperty::BaseTimerDone(Entity* self, const std::string& timerName) {
|
||||||
if (timerName == "GuardFlyAway") {
|
if (timerName == "GuardFlyAway") {
|
||||||
const auto zoneId = dZoneManager::Instance()->GetZone()->GetWorldID();
|
const auto zoneId = Game::zoneManager->GetZone()->GetWorldID();
|
||||||
if (zoneId != 1150)
|
if (zoneId != 1150)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ void CavePrisonCage::OnStartup(Entity* self) {
|
|||||||
return;
|
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);
|
self->SetVar<Spawner*>(u"CWSpawner", spawner);
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ void Lieutenant::OnDie(Entity* self, Entity* killer) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto spawners = dZoneManager::Instance()->GetSpawnersByName(spawnerName);
|
const auto spawners = Game::zoneManager->GetSpawnersByName(spawnerName);
|
||||||
|
|
||||||
if (spawners.empty()) {
|
if (spawners.empty()) {
|
||||||
return;
|
return;
|
||||||
|
@ -12,7 +12,7 @@ void MonCoreNookDoors::SpawnDoor(Entity* self) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto spawners = dZoneManager::Instance()->GetSpawnersByName("MonCoreNookDoor0" + doorNum);
|
const auto spawners = Game::zoneManager->GetSpawnersByName("MonCoreNookDoor0" + doorNum);
|
||||||
|
|
||||||
if (spawners.empty()) {
|
if (spawners.empty()) {
|
||||||
return;
|
return;
|
||||||
|
@ -22,7 +22,7 @@ void NjMonastryBossInstance::OnStartup(Entity* self) {
|
|||||||
|
|
||||||
// Add a notification request for all the spawned entities, corresponds to notifySpawnedObjectLoaded
|
// Add a notification request for all the spawned entities, corresponds to notifySpawnedObjectLoaded
|
||||||
for (const auto& spawnerName : spawnerNames) {
|
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) {
|
spawner->AddEntitySpawnedCallback([self, this](Entity* entity) {
|
||||||
const auto lot = entity->GetLOT();
|
const auto lot = entity->GetLOT();
|
||||||
switch (lot) {
|
switch (lot) {
|
||||||
@ -153,7 +153,7 @@ void NjMonastryBossInstance::OnActivityTimerDone(Entity* self, const std::string
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (timerName == SpawnCounterWeightTimer) {
|
} else if (timerName == SpawnCounterWeightTimer) {
|
||||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(CounterweightSpawner);
|
auto spawners = Game::zoneManager->GetSpawnersByName(CounterweightSpawner);
|
||||||
if (!spawners.empty()) {
|
if (!spawners.empty()) {
|
||||||
// Spawn the counter weight at a specific waypoint, there's one for each round
|
// Spawn the counter weight at a specific waypoint, there's one for each round
|
||||||
auto* spawner = spawners.front();
|
auto* spawner = spawners.front();
|
||||||
@ -173,7 +173,7 @@ void NjMonastryBossInstance::OnActivityTimerDone(Entity* self, const std::string
|
|||||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0,
|
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0,
|
||||||
LWOOBJID_EMPTY, BottomFrakSpawn, UNASSIGNED_SYSTEM_ADDRESS);
|
LWOOBJID_EMPTY, BottomFrakSpawn, UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
} else if (timerName == SpawnLowerFrakjawTimer) {
|
} else if (timerName == SpawnLowerFrakjawTimer) {
|
||||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(LowerFrakjawSpawner);
|
auto spawners = Game::zoneManager->GetSpawnersByName(LowerFrakjawSpawner);
|
||||||
if (!spawners.empty()) {
|
if (!spawners.empty()) {
|
||||||
auto* spawner = spawners.front();
|
auto* spawner = spawners.front();
|
||||||
spawner->Activate();
|
spawner->Activate();
|
||||||
@ -182,7 +182,7 @@ void NjMonastryBossInstance::OnActivityTimerDone(Entity* self, const std::string
|
|||||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0,
|
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0,
|
||||||
LWOOBJID_EMPTY, FireRailSpawn, UNASSIGNED_SYSTEM_ADDRESS);
|
LWOOBJID_EMPTY, FireRailSpawn, UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
|
|
||||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(FireRailSpawner);
|
auto spawners = Game::zoneManager->GetSpawnersByName(FireRailSpawner);
|
||||||
if (!spawners.empty()) {
|
if (!spawners.empty()) {
|
||||||
auto* spawner = spawners.front();
|
auto* spawner = spawners.front();
|
||||||
spawner->Activate();
|
spawner->Activate();
|
||||||
@ -210,7 +210,7 @@ void NjMonastryBossInstance::StartFight(Entity* self) {
|
|||||||
self->SetVar<bool>(FightStartedVariable, true);
|
self->SetVar<bool>(FightStartedVariable, true);
|
||||||
|
|
||||||
// Activate the frakjaw spawner
|
// Activate the frakjaw spawner
|
||||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(LedgeFrakjawSpawner)) {
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName(LedgeFrakjawSpawner)) {
|
||||||
spawner->Activate();
|
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) {
|
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)
|
if (spawners.empty() || numberToSpawn <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -485,7 +485,7 @@ void NjMonastryBossInstance::FightOver(Entity* self) {
|
|||||||
|
|
||||||
// Remove all the enemies from the battlefield
|
// Remove all the enemies from the battlefield
|
||||||
for (auto i = 1; i < 5; i++) {
|
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()) {
|
if (!spawners.empty()) {
|
||||||
auto* spawner = spawners.front();
|
auto* spawner = spawners.front();
|
||||||
spawner->Deactivate();
|
spawner->Deactivate();
|
||||||
|
@ -40,7 +40,7 @@ void MinigameTreasureChestServer::OnUse(Entity* self, Entity* user) {
|
|||||||
|
|
||||||
sac->PlayerRemove(user->GetObjectID());
|
sac->PlayerRemove(user->GetObjectID());
|
||||||
|
|
||||||
auto* zoneControl = dZoneManager::Instance()->GetZoneControlObject();
|
auto* zoneControl = Game::zoneManager->GetZoneControlObject();
|
||||||
if (zoneControl != nullptr) {
|
if (zoneControl != nullptr) {
|
||||||
zoneControl->OnFireEventServerSide(self, "Survival_Update", 0);
|
zoneControl->OnFireEventServerSide(self, "Survival_Update", 0);
|
||||||
}
|
}
|
||||||
@ -56,7 +56,7 @@ uint32_t MinigameTreasureChestServer::CalculateActivityRating(Entity* self, LWOO
|
|||||||
void MinigameTreasureChestServer::OnStartup(Entity* self) {
|
void MinigameTreasureChestServer::OnStartup(Entity* self) {
|
||||||
|
|
||||||
// BONS treasure chest thinks it's on FV, causing it to start a lobby
|
// 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>();
|
auto* sac = self->GetComponent<ScriptedActivityComponent>();
|
||||||
if (sac != nullptr) {
|
if (sac != nullptr) {
|
||||||
sac->SetInstanceMapID(1204);
|
sac->SetInstanceMapID(1204);
|
||||||
|
@ -92,7 +92,7 @@ void BasePropertyServer::BasePlayerLoaded(Entity* self, Entity* player) {
|
|||||||
Game::entityManager->DestructEntity(plaque);
|
Game::entityManager->DestructEntity(plaque);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& mapID = dZoneManager::Instance()->GetZone()->GetZoneID();
|
const auto& mapID = Game::zoneManager->GetZone()->GetZoneID();
|
||||||
|
|
||||||
if (propertyOwner > 0) {
|
if (propertyOwner > 0) {
|
||||||
auto* missionComponent = player->GetComponent<MissionComponent>();
|
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||||
@ -278,31 +278,31 @@ void BasePropertyServer::RequestDie(Entity* self, Entity* other) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BasePropertyServer::ActivateSpawner(const std::string& spawnerName) {
|
void BasePropertyServer::ActivateSpawner(const std::string& spawnerName) {
|
||||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(spawnerName)) {
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName(spawnerName)) {
|
||||||
spawner->Activate();
|
spawner->Activate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasePropertyServer::DeactivateSpawner(const std::string& spawnerName) {
|
void BasePropertyServer::DeactivateSpawner(const std::string& spawnerName) {
|
||||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(spawnerName)) {
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName(spawnerName)) {
|
||||||
spawner->Deactivate();
|
spawner->Deactivate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasePropertyServer::TriggerSpawner(const std::string& spawnerName) {
|
void BasePropertyServer::TriggerSpawner(const std::string& spawnerName) {
|
||||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersInGroup(spawnerName)) {
|
for (auto* spawner : Game::zoneManager->GetSpawnersInGroup(spawnerName)) {
|
||||||
spawner->Spawn();
|
spawner->Spawn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasePropertyServer::ResetSpawner(const std::string& spawnerName) {
|
void BasePropertyServer::ResetSpawner(const std::string& spawnerName) {
|
||||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(spawnerName)) {
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName(spawnerName)) {
|
||||||
spawner->Reset();
|
spawner->Reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasePropertyServer::DestroySpawner(const std::string& spawnerName) {
|
void BasePropertyServer::DestroySpawner(const std::string& spawnerName) {
|
||||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName(spawnerName)) {
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName(spawnerName)) {
|
||||||
if (!spawner) return;
|
if (!spawner) return;
|
||||||
spawner->DestroyAllEntities();
|
spawner->DestroyAllEntities();
|
||||||
spawner->Deactivate();
|
spawner->Deactivate();
|
||||||
@ -322,10 +322,10 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
|
|||||||
} else if (timerName == StartQuickbuildTimer) {
|
} else if (timerName == StartQuickbuildTimer) {
|
||||||
HandleQuickBuildTimer(self);
|
HandleQuickBuildTimer(self);
|
||||||
} else if (timerName == "GuardFlyAway") {
|
} 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
|
// No guard for the spider instance fight
|
||||||
if (dZoneManager::Instance()->GetZoneID().GetMapID() == 1150)
|
if (Game::zoneManager->GetZoneID().GetMapID() == 1150)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto entities = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(GuardGroup));
|
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(TurnSkyOffTimer, 1.5f);
|
||||||
self->AddTimer(KillFXObjectTimer, 8.0f);
|
self->AddTimer(KillFXObjectTimer, 8.0f);
|
||||||
} else if (timerName == TurnSkyOffTimer) {
|
} else if (timerName == TurnSkyOffTimer) {
|
||||||
auto* controller = dZoneManager::Instance()->GetZoneControlObject();
|
auto* controller = Game::zoneManager->GetZoneControlObject();
|
||||||
GameMessages::SendNotifyClientObject(controller->GetObjectID(), u"SkyOff", 0, 0,
|
GameMessages::SendNotifyClientObject(controller->GetObjectID(), u"SkyOff", 0, 0,
|
||||||
LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
|
LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
} else if (timerName == KillStrombiesTimer) {
|
} 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) {
|
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) {
|
if (spawnLOT == 11217 && spawnNum > 1) {
|
||||||
spawnNum = 1;
|
spawnNum = 1;
|
||||||
|
@ -402,7 +402,7 @@ void BaseSurvivalServer::SpawnerReset(SpawnerNetworkCollection& spawnerNetworkCo
|
|||||||
|
|
||||||
for (auto& spawner : spawnerNetworkCollection.networks) {
|
for (auto& spawner : spawnerNetworkCollection.networks) {
|
||||||
for (auto& spawnerName : spawner.names) {
|
for (auto& spawnerName : spawner.names) {
|
||||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(spawnerName + spawner.number);
|
auto spawners = Game::zoneManager->GetSpawnersByName(spawnerName + spawner.number);
|
||||||
if (!spawners.empty()) {
|
if (!spawners.empty()) {
|
||||||
auto* spawnerObject = spawners.at(0);
|
auto* spawnerObject = spawners.at(0);
|
||||||
|
|
||||||
@ -431,7 +431,7 @@ void BaseSurvivalServer::SpawnerUpdate(Entity* self, SpawnerNetworkCollection& s
|
|||||||
// If we want to spawn something specific now
|
// If we want to spawn something specific now
|
||||||
if (amount != 0) {
|
if (amount != 0) {
|
||||||
auto spawnerNetwork = spawnerNetworkCollection.networks.at(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()) {
|
if (!possibleSpawners.empty()) {
|
||||||
SpawnNow(possibleSpawners.at(0), amount);
|
SpawnNow(possibleSpawners.at(0), amount);
|
||||||
return;
|
return;
|
||||||
@ -447,7 +447,7 @@ void BaseSurvivalServer::SpawnerUpdate(Entity* self, SpawnerNetworkCollection& s
|
|||||||
const auto& name = spawnerNetwork.names.at(i);
|
const auto& name = spawnerNetwork.names.at(i);
|
||||||
const auto& toSpawn = newSet.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()) {
|
if (!possibleSpawners.empty()) {
|
||||||
SpawnNow(possibleSpawners.front(), toSpawn);
|
SpawnNow(possibleSpawners.front(), toSpawn);
|
||||||
}
|
}
|
||||||
@ -498,7 +498,7 @@ SpawnerNetwork BaseSurvivalServer::GetRandomSpawner(SpawnerNetworkCollection& sp
|
|||||||
void BaseSurvivalServer::ActivateSpawnerNetwork(SpawnerNetworkCollection& spawnerNetworkCollection) {
|
void BaseSurvivalServer::ActivateSpawnerNetwork(SpawnerNetworkCollection& spawnerNetworkCollection) {
|
||||||
for (auto& spawner : spawnerNetworkCollection.networks) {
|
for (auto& spawner : spawnerNetworkCollection.networks) {
|
||||||
for (const auto& spawnerName : spawner.names) {
|
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()) {
|
if (!possibleSpawners.empty()) {
|
||||||
auto* spawnerObject = possibleSpawners.at(0);
|
auto* spawnerObject = possibleSpawners.at(0);
|
||||||
spawnerObject->Activate();
|
spawnerObject->Activate();
|
||||||
@ -512,7 +512,7 @@ void BaseSurvivalServer::UpdateMobLots(SpawnerNetworkCollection& spawnerNetworkC
|
|||||||
for (auto& spawner : spawnerNetworkCollection.networks) {
|
for (auto& spawner : spawnerNetworkCollection.networks) {
|
||||||
for (auto& spawnerName : spawner.names) {
|
for (auto& spawnerName : spawner.names) {
|
||||||
if (!spawnerName.empty()) {
|
if (!spawnerName.empty()) {
|
||||||
auto spawnerObjects = dZoneManager::Instance()->GetSpawnersByName(spawnerName + spawner.number);
|
auto spawnerObjects = Game::zoneManager->GetSpawnersByName(spawnerName + spawner.number);
|
||||||
if (!spawnerObjects.empty()) {
|
if (!spawnerObjects.empty()) {
|
||||||
auto splitName = GeneralUtils::SplitString(spawnerName, '_');
|
auto splitName = GeneralUtils::SplitString(spawnerName, '_');
|
||||||
auto cleanName = splitName.size() > 1 ? splitName.at(1) : splitName.at(0);
|
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) {
|
void BaseWavesGenericEnemy::OnDie(Entity* self, Entity* killer) {
|
||||||
auto* zoneControlObject = dZoneManager::Instance()->GetZoneControlObject();
|
auto* zoneControlObject = Game::zoneManager->GetZoneControlObject();
|
||||||
if (zoneControlObject != nullptr) {
|
if (zoneControlObject != nullptr) {
|
||||||
zoneControlObject->OnFireEventServerSide(killer, "Survival_Update", GetPoints());
|
zoneControlObject->OnFireEventServerSide(killer, "Survival_Update", GetPoints());
|
||||||
}
|
}
|
||||||
|
@ -393,7 +393,7 @@ void BaseWavesServer::GameWon(Entity* self) {
|
|||||||
|
|
||||||
// Done
|
// Done
|
||||||
void BaseWavesServer::SpawnNow(const std::string& spawnerName, uint32_t amount, LOT spawnLot) {
|
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) {
|
for (auto* spawner : spawners) {
|
||||||
if (spawnLot != LOT_NULL) {
|
if (spawnLot != LOT_NULL) {
|
||||||
spawner->SetSpawnLot(spawnLot);
|
spawner->SetSpawnLot(spawnLot);
|
||||||
@ -582,7 +582,7 @@ void BaseWavesServer::UpdateMissionForAllPlayers(Entity* self, uint32_t missionI
|
|||||||
|
|
||||||
void BaseWavesServer::ClearSpawners() {
|
void BaseWavesServer::ClearSpawners() {
|
||||||
for (const auto& spawnerName : spawners) {
|
for (const auto& spawnerName : spawners) {
|
||||||
const auto spawnerObjects = dZoneManager::Instance()->GetSpawnersByName(spawnerName);
|
const auto spawnerObjects = Game::zoneManager->GetSpawnersByName(spawnerName);
|
||||||
|
|
||||||
for (auto* spawnerObject : spawnerObjects) {
|
for (auto* spawnerObject : spawnerObjects) {
|
||||||
spawnerObject->Reset();
|
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);
|
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>();
|
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ void FvBrickPuzzleServer::OnDie(Entity* self, Entity* killer) {
|
|||||||
|
|
||||||
const auto nextPipeNum = pipeNum + 1;
|
const auto nextPipeNum = pipeNum + 1;
|
||||||
|
|
||||||
const auto samePipeSpawners = dZoneManager::Instance()->GetSpawnersByName(myGroup);
|
const auto samePipeSpawners = Game::zoneManager->GetSpawnersByName(myGroup);
|
||||||
|
|
||||||
if (!samePipeSpawners.empty()) {
|
if (!samePipeSpawners.empty()) {
|
||||||
samePipeSpawners[0]->SoftReset();
|
samePipeSpawners[0]->SoftReset();
|
||||||
@ -40,7 +40,7 @@ void FvBrickPuzzleServer::OnDie(Entity* self, Entity* killer) {
|
|||||||
if (killer != nullptr && killer->IsPlayer()) {
|
if (killer != nullptr && killer->IsPlayer()) {
|
||||||
const auto nextPipe = pipeGroup + std::to_string(nextPipeNum);
|
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()) {
|
if (!nextPipeSpawners.empty()) {
|
||||||
nextPipeSpawners[0]->Activate();
|
nextPipeSpawners[0]->Activate();
|
||||||
@ -48,7 +48,7 @@ void FvBrickPuzzleServer::OnDie(Entity* self, Entity* killer) {
|
|||||||
} else {
|
} else {
|
||||||
const auto nextPipe = pipeGroup + "1";
|
const auto nextPipe = pipeGroup + "1";
|
||||||
|
|
||||||
const auto firstPipeSpawners = dZoneManager::Instance()->GetSpawnersByName(nextPipe);
|
const auto firstPipeSpawners = Game::zoneManager->GetSpawnersByName(nextPipe);
|
||||||
|
|
||||||
if (!firstPipeSpawners.empty()) {
|
if (!firstPipeSpawners.empty()) {
|
||||||
firstPipeSpawners[0]->Activate();
|
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) {
|
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* brickSpawner = Game::zoneManager->GetSpawnersByName("ImaginationBrick")[0];
|
||||||
auto* bugSpawner = dZoneManager::Instance()->GetSpawnersByName("MaelstromBug")[0];
|
auto* bugSpawner = Game::zoneManager->GetSpawnersByName("MaelstromBug")[0];
|
||||||
auto* canisterSpawner = dZoneManager::Instance()->GetSpawnersByName("BrickCanister")[0];
|
auto* canisterSpawner = Game::zoneManager->GetSpawnersByName("BrickCanister")[0];
|
||||||
|
|
||||||
if (name == "ConsoleLeftUp") {
|
if (name == "ConsoleLeftUp") {
|
||||||
GameMessages::SendStopFXEffect(self, true, "LeftPipeOff");
|
GameMessages::SendStopFXEffect(self, true, "LeftPipeOff");
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
void GfJailWalls::OnRebuildComplete(Entity* self, Entity* target) {
|
void GfJailWalls::OnRebuildComplete(Entity* self, Entity* target) {
|
||||||
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
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();
|
spawner->Deactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName("JailCaptain0" + wall)) {
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName("JailCaptain0" + wall)) {
|
||||||
spawner->Deactivate();
|
spawner->Deactivate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -20,11 +20,11 @@ void GfJailWalls::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
|||||||
|
|
||||||
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
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();
|
spawner->Activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName("JailCaptain0" + wall)) {
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName("JailCaptain0" + wall)) {
|
||||||
spawner->Activate();
|
spawner->Activate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ void TriggerAmbush::OnProximityUpdate(Entity* self, Entity* entering, std::strin
|
|||||||
|
|
||||||
self->SetVar(u"triggered", true);
|
self->SetVar(u"triggered", true);
|
||||||
|
|
||||||
const auto spawners = dZoneManager::Instance()->GetSpawnersByName("Ambush");
|
const auto spawners = Game::zoneManager->GetSpawnersByName("Ambush");
|
||||||
|
|
||||||
for (auto* spawner : spawners) {
|
for (auto* spawner : spawners) {
|
||||||
spawner->Activate();
|
spawner->Activate();
|
||||||
@ -27,7 +27,7 @@ void TriggerAmbush::OnTimerDone(Entity* self, std::string timerName) {
|
|||||||
|
|
||||||
self->SetVar(u"triggered", false);
|
self->SetVar(u"triggered", false);
|
||||||
|
|
||||||
const auto spawners = dZoneManager::Instance()->GetSpawnersByName("Ambush");
|
const auto spawners = Game::zoneManager->GetSpawnersByName("Ambush");
|
||||||
|
|
||||||
for (auto* spawner : spawners) {
|
for (auto* spawner : spawners) {
|
||||||
spawner->Reset();
|
spawner->Reset();
|
||||||
|
@ -142,7 +142,7 @@ void SGCannon::OnMessageBoxResponse(Entity* self, Entity* sender, int32_t button
|
|||||||
|
|
||||||
if (identifier == u"Scoreboardinfo") {
|
if (identifier == u"Scoreboardinfo") {
|
||||||
GameMessages::SendDisplayMessageBox(player->GetObjectID(), true,
|
GameMessages::SendDisplayMessageBox(player->GetObjectID(), true,
|
||||||
dZoneManager::Instance()->GetZoneControlObject()->GetObjectID(),
|
Game::zoneManager->GetZoneControlObject()->GetObjectID(),
|
||||||
u"Shooting_Gallery_Retry", 2, u"Retry?",
|
u"Shooting_Gallery_Retry", 2, u"Retry?",
|
||||||
u"", player->GetSystemAddress());
|
u"", player->GetSystemAddress());
|
||||||
} else {
|
} else {
|
||||||
@ -262,7 +262,7 @@ void SGCannon::OnActivityTimerDone(Entity* self, const std::string& name) {
|
|||||||
}
|
}
|
||||||
const auto& toSpawn = activeSpawns.at(spawnNumber);
|
const auto& toSpawn = activeSpawns.at(spawnNumber);
|
||||||
const auto pathIndex = GeneralUtils::GenerateRandomNumber<float_t>(0, toSpawn.spawnPaths.size() - 1);
|
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) {
|
if (!path) {
|
||||||
Game::logger->Log("SGCannon", "Path %s at index %i is null", toSpawn.spawnPaths.at(pathIndex).c_str(), pathIndex);
|
Game::logger->Log("SGCannon", "Path %s at index %i is null", toSpawn.spawnPaths.at(pathIndex).c_str(), pathIndex);
|
||||||
return;
|
return;
|
||||||
|
@ -29,7 +29,7 @@ void AgPropguards::OnMissionDialogueOK(Entity* self, Entity* target, int mission
|
|||||||
if (spawnerName.empty())
|
if (spawnerName.empty())
|
||||||
spawnerName = "Guard";
|
spawnerName = "Guard";
|
||||||
|
|
||||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(spawnerName);
|
auto spawners = Game::zoneManager->GetSpawnersByName(spawnerName);
|
||||||
for (auto* spawner : spawners) {
|
for (auto* spawner : spawners) {
|
||||||
spawner->Deactivate();
|
spawner->Deactivate();
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,7 @@ namespace Game {
|
|||||||
SystemAddress chatSysAddr;
|
SystemAddress chatSysAddr;
|
||||||
bool shouldShutdown = false;
|
bool shouldShutdown = false;
|
||||||
EntityManager* entityManager = nullptr;
|
EntityManager* entityManager = nullptr;
|
||||||
|
dZoneManager* zoneManager = nullptr;
|
||||||
} // namespace Game
|
} // namespace Game
|
||||||
|
|
||||||
bool chatDisabled = false;
|
bool chatDisabled = false;
|
||||||
@ -254,10 +255,11 @@ int main(int argc, char** argv) {
|
|||||||
PerformanceManager::SelectProfile(zoneID);
|
PerformanceManager::SelectProfile(zoneID);
|
||||||
|
|
||||||
Game::entityManager = new EntityManager();
|
Game::entityManager = new EntityManager();
|
||||||
|
Game::zoneManager = new dZoneManager();
|
||||||
//Load our level:
|
//Load our level:
|
||||||
if (zoneID != 0) {
|
if (zoneID != 0) {
|
||||||
dpWorld::Instance().Initialize(zoneID);
|
dpWorld::Instance().Initialize(zoneID);
|
||||||
dZoneManager::Instance()->Initialize(LWOZONEID(zoneID, instanceID, cloneID));
|
Game::zoneManager->Initialize(LWOZONEID(zoneID, instanceID, cloneID));
|
||||||
g_CloneID = cloneID;
|
g_CloneID = cloneID;
|
||||||
|
|
||||||
// pre calculate the FDB checksum
|
// pre calculate the FDB checksum
|
||||||
@ -399,7 +401,7 @@ int main(int argc, char** argv) {
|
|||||||
Metrics::EndMeasurement(MetricVariable::Ghosting);
|
Metrics::EndMeasurement(MetricVariable::Ghosting);
|
||||||
|
|
||||||
Metrics::StartMeasurement(MetricVariable::UpdateSpawners);
|
Metrics::StartMeasurement(MetricVariable::UpdateSpawners);
|
||||||
dZoneManager::Instance()->Update(deltaTime);
|
Game::zoneManager->Update(deltaTime);
|
||||||
Metrics::EndMeasurement(MetricVariable::UpdateSpawners);
|
Metrics::EndMeasurement(MetricVariable::UpdateSpawners);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -776,7 +778,7 @@ void HandlePacket(Packet* packet) {
|
|||||||
//Create our user and send them in:
|
//Create our user and send them in:
|
||||||
UserManager::Instance()->CreateUser(it->second.sysAddr, username, userHash);
|
UserManager::Instance()->CreateUser(it->second.sysAddr, username, userHash);
|
||||||
|
|
||||||
auto zone = dZoneManager::Instance()->GetZone();
|
auto zone = Game::zoneManager->GetZone();
|
||||||
if (zone) {
|
if (zone) {
|
||||||
float x = 0.0f;
|
float x = 0.0f;
|
||||||
float y = 0.0f;
|
float y = 0.0f;
|
||||||
@ -1015,7 +1017,7 @@ void HandlePacket(Packet* packet) {
|
|||||||
WorldPackets::SendCreateCharacter(packet->systemAddress, player, c->GetXMLData(), username, c->GetGMLevel());
|
WorldPackets::SendCreateCharacter(packet->systemAddress, player, c->GetXMLData(), username, c->GetGMLevel());
|
||||||
WorldPackets::SendServerState(packet->systemAddress);
|
WorldPackets::SendServerState(packet->systemAddress);
|
||||||
|
|
||||||
const auto respawnPoint = player->GetCharacter()->GetRespawnPoint(dZoneManager::Instance()->GetZone()->GetWorldID());
|
const auto respawnPoint = player->GetCharacter()->GetRespawnPoint(Game::zoneManager->GetZone()->GetWorldID());
|
||||||
|
|
||||||
Game::entityManager->ConstructEntity(player, UNASSIGNED_SYSTEM_ADDRESS, true);
|
Game::entityManager->ConstructEntity(player, UNASSIGNED_SYSTEM_ADDRESS, true);
|
||||||
|
|
||||||
@ -1065,7 +1067,7 @@ void HandlePacket(Packet* packet) {
|
|||||||
|
|
||||||
//Tell the player to generate BBB models, if any:
|
//Tell the player to generate BBB models, if any:
|
||||||
if (g_CloneID != 0) {
|
if (g_CloneID != 0) {
|
||||||
const auto& worldId = dZoneManager::Instance()->GetZone()->GetZoneID();
|
const auto& worldId = Game::zoneManager->GetZone()->GetZoneID();
|
||||||
|
|
||||||
const auto zoneId = Game::server->GetZoneID();
|
const auto zoneId = Game::server->GetZoneID();
|
||||||
const auto cloneId = g_CloneID;
|
const auto cloneId = g_CloneID;
|
||||||
@ -1175,7 +1177,7 @@ void HandlePacket(Packet* packet) {
|
|||||||
bitStream.Write(playerName[i]);
|
bitStream.Write(playerName[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto zone = dZoneManager::Instance()->GetZone()->GetZoneID();
|
auto zone = Game::zoneManager->GetZone()->GetZoneID();
|
||||||
bitStream.Write(zone.GetMapID());
|
bitStream.Write(zone.GetMapID());
|
||||||
bitStream.Write(zone.GetInstanceID());
|
bitStream.Write(zone.GetInstanceID());
|
||||||
bitStream.Write(zone.GetCloneID());
|
bitStream.Write(zone.GetCloneID());
|
||||||
@ -1332,10 +1334,11 @@ void FinalizeShutdown() {
|
|||||||
Metrics::Clear();
|
Metrics::Clear();
|
||||||
Database::Destroy("WorldServer");
|
Database::Destroy("WorldServer");
|
||||||
if (Game::chatFilter) delete Game::chatFilter;
|
if (Game::chatFilter) delete Game::chatFilter;
|
||||||
|
if (Game::zoneManager) delete Game::zoneManager;
|
||||||
if (Game::server) delete Game::server;
|
if (Game::server) delete Game::server;
|
||||||
if (Game::logger) delete Game::logger;
|
|
||||||
if (Game::config) delete Game::config;
|
if (Game::config) delete Game::config;
|
||||||
if (Game::entityManager) delete Game::entityManager;
|
if (Game::entityManager) delete Game::entityManager;
|
||||||
|
if (Game::logger) delete Game::logger;
|
||||||
|
|
||||||
worldShutdownSequenceComplete = true;
|
worldShutdownSequenceComplete = true;
|
||||||
|
|
||||||
|
@ -179,8 +179,8 @@ void Level::ReadSceneObjectDataChunk(std::istream& file, Header& header) {
|
|||||||
//This is a little bit of a bodge, but because the alpha client (HF) doesn't store the
|
//This is a little bit of a bodge, but because the alpha client (HF) doesn't store the
|
||||||
//spawn position / rotation like the later versions do, we need to check the LOT for the spawn pos & set it.
|
//spawn position / rotation like the later versions do, we need to check the LOT for the spawn pos & set it.
|
||||||
if (obj.lot == LOT_MARKER_PLAYER_START) {
|
if (obj.lot == LOT_MARKER_PLAYER_START) {
|
||||||
dZoneManager::Instance()->GetZone()->SetSpawnPos(obj.position);
|
Game::zoneManager->GetZone()->SetSpawnPos(obj.position);
|
||||||
dZoneManager::Instance()->GetZone()->SetSpawnRot(obj.rotation);
|
Game::zoneManager->GetZone()->SetSpawnRot(obj.rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::u16string ldfString = u"";
|
std::u16string ldfString = u"";
|
||||||
@ -297,7 +297,7 @@ void Level::ReadSceneObjectDataChunk(std::istream& file, Header& header) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Spawner* spawner = new Spawner(spawnInfo);
|
Spawner* spawner = new Spawner(spawnInfo);
|
||||||
dZoneManager::Instance()->AddSpawner(obj.id, spawner);
|
Game::zoneManager->AddSpawner(obj.id, spawner);
|
||||||
} else { //Regular object
|
} else { //Regular object
|
||||||
EntityInfo info;
|
EntityInfo info;
|
||||||
info.spawnerID = 0;
|
info.spawnerID = 0;
|
||||||
@ -328,7 +328,7 @@ void Level::ReadSceneObjectDataChunk(std::istream& file, Header& header) {
|
|||||||
if (!clientOnly) {
|
if (!clientOnly) {
|
||||||
|
|
||||||
// We should never have more than 1 zone control object
|
// We should never have more than 1 zone control object
|
||||||
const auto zoneControlObject = dZoneManager::Instance()->GetZoneControlObject();
|
const auto zoneControlObject = Game::zoneManager->GetZoneControlObject();
|
||||||
if (zoneControlObject != nullptr && info.lot == zoneControlObject->GetLOT())
|
if (zoneControlObject != nullptr && info.lot == zoneControlObject->GetLOT())
|
||||||
goto deleteSettings;
|
goto deleteSettings;
|
||||||
|
|
||||||
|
@ -47,8 +47,8 @@ Spawner::Spawner(const SpawnerInfo info) {
|
|||||||
|
|
||||||
if (m_Info.spawnOnSmashGroupName != "") {
|
if (m_Info.spawnOnSmashGroupName != "") {
|
||||||
std::vector<Entity*> spawnSmashEntities = Game::entityManager->GetEntitiesInGroup(m_Info.spawnOnSmashGroupName);
|
std::vector<Entity*> spawnSmashEntities = Game::entityManager->GetEntitiesInGroup(m_Info.spawnOnSmashGroupName);
|
||||||
std::vector<Spawner*> spawnSmashSpawners = dZoneManager::Instance()->GetSpawnersInGroup(m_Info.spawnOnSmashGroupName);
|
std::vector<Spawner*> spawnSmashSpawners = Game::zoneManager->GetSpawnersInGroup(m_Info.spawnOnSmashGroupName);
|
||||||
std::vector<Spawner*> spawnSmashSpawnersN = dZoneManager::Instance()->GetSpawnersByName(m_Info.spawnOnSmashGroupName);
|
std::vector<Spawner*> spawnSmashSpawnersN = Game::zoneManager->GetSpawnersByName(m_Info.spawnOnSmashGroupName);
|
||||||
for (Entity* ssEntity : spawnSmashEntities) {
|
for (Entity* ssEntity : spawnSmashEntities) {
|
||||||
m_SpawnSmashFoundGroup = true;
|
m_SpawnSmashFoundGroup = true;
|
||||||
ssEntity->AddDieCallback([=]() {
|
ssEntity->AddDieCallback([=]() {
|
||||||
|
@ -149,7 +149,7 @@ void Zone::LoadZoneIntoMemory() {
|
|||||||
info.activeOnLoad = path.spawner.spawnerNetActive;
|
info.activeOnLoad = path.spawner.spawnerNetActive;
|
||||||
info.isNetwork = true;
|
info.isNetwork = true;
|
||||||
Spawner* spawner = new Spawner(info);
|
Spawner* spawner = new Spawner(info);
|
||||||
dZoneManager::Instance()->AddSpawner(info.spawnerID, spawner);
|
Game::zoneManager->AddSpawner(info.spawnerID, spawner);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
|
|
||||||
#include "../dWorldServer/ObjectIDManager.h"
|
#include "../dWorldServer/ObjectIDManager.h"
|
||||||
|
|
||||||
dZoneManager* dZoneManager::m_Address = nullptr;
|
|
||||||
|
|
||||||
void dZoneManager::Initialize(const LWOZONEID& zoneID) {
|
void dZoneManager::Initialize(const LWOZONEID& zoneID) {
|
||||||
Game::logger->Log("dZoneManager", "Preparing zone: %i/%i/%i", zoneID.GetMapID(), zoneID.GetInstanceID(), zoneID.GetCloneID());
|
Game::logger->Log("dZoneManager", "Preparing zone: %i/%i/%i", zoneID.GetMapID(), zoneID.GetInstanceID(), zoneID.GetCloneID());
|
||||||
|
|
||||||
|
@ -25,14 +25,6 @@ private:
|
|||||||
void LoadWorldConfig();
|
void LoadWorldConfig();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static dZoneManager* Instance() {
|
|
||||||
if (!m_Address) {
|
|
||||||
m_Address = new dZoneManager();
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_Address;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Initialize(const LWOZONEID& zoneID);
|
void Initialize(const LWOZONEID& zoneID);
|
||||||
~dZoneManager();
|
~dZoneManager();
|
||||||
|
|
||||||
@ -64,7 +56,6 @@ private:
|
|||||||
*/
|
*/
|
||||||
uint32_t m_UniqueMissionIdStart = 0;
|
uint32_t m_UniqueMissionIdStart = 0;
|
||||||
|
|
||||||
static dZoneManager* m_Address; //Singleton
|
|
||||||
Zone* m_pZone = nullptr;
|
Zone* m_pZone = nullptr;
|
||||||
LWOZONEID m_ZoneID;
|
LWOZONEID m_ZoneID;
|
||||||
bool m_PlayerLoseCoinsOnDeath; //Do players drop coins in this zone when smashed
|
bool m_PlayerLoseCoinsOnDeath; //Do players drop coins in this zone when smashed
|
||||||
|
Loading…
Reference in New Issue
Block a user