mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 10:44:08 +00:00
chore: rename rebuild to quickbuild (#1364)
* rename rebuild to quickbuild * fix includes
This commit is contained in:
@@ -14,7 +14,7 @@ void GfApeSmashingQB::OnTimerDone(Entity* self, std::string timerName) {
|
||||
}
|
||||
}
|
||||
|
||||
void GfApeSmashingQB::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void GfApeSmashingQB::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
auto* ape = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"ape"));
|
||||
if (ape != nullptr) {
|
||||
ape->OnFireEventServerSide(target, "rebuildDone");
|
||||
|
@@ -4,5 +4,5 @@
|
||||
class GfApeSmashingQB : public CppScripts::Script {
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
};
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include "AgBugsprayer.h"
|
||||
#include "SkillComponent.h"
|
||||
|
||||
void AgBugsprayer::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void AgBugsprayer::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
self->AddTimer("castSkill", 1);
|
||||
self->SetOwnerOverride(target->GetObjectID());
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@
|
||||
class AgBugsprayer : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
};
|
||||
|
||||
|
@@ -5,7 +5,7 @@ void AmBridge::OnStartup(Entity* self) {
|
||||
|
||||
}
|
||||
|
||||
void AmBridge::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void AmBridge::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console" + GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"bridge")));
|
||||
|
||||
if (consoles.empty()) {
|
||||
|
@@ -5,6 +5,6 @@ class AmBridge : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
};
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "AmDropshipComputer.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "InventoryComponent.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "eMissionState.h"
|
||||
@@ -10,9 +10,9 @@ void AmDropshipComputer::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void AmDropshipComputer::OnUse(Entity* self, Entity* user) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (rebuildComponent == nullptr || rebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
||||
if (quickBuildComponent == nullptr || quickBuildComponent->GetState() != eQuickBuildState::COMPLETED) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -70,13 +70,13 @@ void AmDropshipComputer::OnDie(Entity* self, Entity* killer) {
|
||||
}
|
||||
|
||||
void AmDropshipComputer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (rebuildComponent == nullptr) {
|
||||
if (quickBuildComponent == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (timerName == "reset" && rebuildComponent->GetState() == eRebuildState::OPEN) {
|
||||
if (timerName == "reset" && quickBuildComponent->GetState() == eQuickBuildState::OPEN) {
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "BaseCombatAIComponent.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "EntityInfo.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "MissionComponent.h"
|
||||
|
||||
void AmShieldGeneratorQuickbuild::OnStartup(Entity* self) {
|
||||
@@ -100,7 +100,7 @@ void AmShieldGeneratorQuickbuild::OnTimerDone(Entity* self, std::string timerNam
|
||||
}
|
||||
}
|
||||
|
||||
void AmShieldGeneratorQuickbuild::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void AmShieldGeneratorQuickbuild::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
StartShield(self);
|
||||
|
||||
auto enemiesInProximity = self->GetVar<std::vector<LWOOBJID>>(u"Enemies");
|
||||
@@ -174,9 +174,9 @@ void AmShieldGeneratorQuickbuild::BuffPlayers(Entity* self) {
|
||||
}
|
||||
|
||||
void AmShieldGeneratorQuickbuild::EnemyEnteredShield(Entity* self, Entity* intruder) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (rebuildComponent == nullptr || rebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
||||
if (quickBuildComponent == nullptr || quickBuildComponent->GetState() != eQuickBuildState::COMPLETED) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -8,7 +8,7 @@ public:
|
||||
void OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) override;
|
||||
void OnDie(Entity* self, Entity* killer) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
|
||||
void StartShield(Entity* self);
|
||||
void BuffPlayers(Entity* self);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "ImgBrickConsoleQB.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
@@ -19,18 +19,18 @@ void ImgBrickConsoleQB::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
if (quickBuildComponent->GetState() == eQuickBuildState::COMPLETED) {
|
||||
if (!self->GetNetworkVar<bool>(u"used")) {
|
||||
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console");
|
||||
|
||||
auto bothBuilt = false;
|
||||
|
||||
for (auto* console : consoles) {
|
||||
auto* consoleRebuildComponent = console->GetComponent<RebuildComponent>();
|
||||
auto* consoleQuickBuildComponent = console->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (consoleRebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
||||
if (consoleQuickBuildComponent->GetState() != eQuickBuildState::COMPLETED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ void ImgBrickConsoleQB::SmashCanister(Entity* self) {
|
||||
}
|
||||
}
|
||||
|
||||
void ImgBrickConsoleQB::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void ImgBrickConsoleQB::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
auto energyFX = 0;
|
||||
|
||||
const auto location = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"console"));
|
||||
@@ -145,9 +145,9 @@ void ImgBrickConsoleQB::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console");
|
||||
|
||||
for (auto* console : consoles) {
|
||||
auto* consoleRebuildComponent = console->GetComponent<RebuildComponent>();
|
||||
auto* consoleQuickBuildComponent = console->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (consoleRebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
||||
if (consoleQuickBuildComponent->GetState() != eQuickBuildState::COMPLETED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -166,9 +166,9 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer) {
|
||||
|
||||
self->SetVar(u"Died", true);
|
||||
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
if (quickBuildComponent->GetState() == eQuickBuildState::COMPLETED) {
|
||||
auto offFX = 0;
|
||||
|
||||
const auto location = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"console"));
|
||||
@@ -227,9 +227,9 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer) {
|
||||
|
||||
void ImgBrickConsoleQB::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "reset") {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (rebuildComponent->GetState() == eRebuildState::OPEN) {
|
||||
if (quickBuildComponent->GetState() == eQuickBuildState::OPEN) {
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
} else if (timerName == "Die") {
|
||||
|
@@ -8,7 +8,7 @@ public:
|
||||
void OnUse(Entity* self, Entity* user) override;
|
||||
void SpawnBrick(Entity* self);
|
||||
void SmashCanister(Entity* self);
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnDie(Entity* self, Entity* killer) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
|
||||
|
@@ -16,7 +16,7 @@ void MastTeleport::OnStartup(Entity* self) {
|
||||
self->SetNetworkVar<std::string>(u"hookPreconditions", "154;44", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
void MastTeleport::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void MastTeleport::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
if (Preconditions::Check(target, 154) && Preconditions::Check(target, 44)) {
|
||||
self->SetVar<LWOOBJID>(u"userID", target->GetObjectID());
|
||||
|
||||
|
@@ -4,6 +4,6 @@
|
||||
class MastTeleport : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
};
|
||||
|
@@ -1,13 +1,13 @@
|
||||
#include "NjRailActivatorsServer.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "Character.h"
|
||||
|
||||
void NjRailActivatorsServer::OnUse(Entity* self, Entity* user) {
|
||||
const auto flag = self->GetVar<int32_t>(u"RailFlagNum");
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
// Only allow use if this is not a quick build or the quick build is built
|
||||
if (rebuildComponent == nullptr || rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
if (quickBuildComponent == nullptr || quickBuildComponent->GetState() == eQuickBuildState::COMPLETED) {
|
||||
auto* character = user->GetCharacter();
|
||||
if (character != nullptr) {
|
||||
character->SetPlayerFlag(flag, true);
|
||||
|
@@ -1,10 +1,10 @@
|
||||
#include "NjRailPostServer.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "EntityManager.h"
|
||||
|
||||
void NjRailPostServer::OnStartup(Entity* self) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
if (rebuildComponent != nullptr) {
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
if (quickBuildComponent != nullptr) {
|
||||
self->SetNetworkVar<bool>(NetworkNotActiveVariable, true);
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,8 @@ void NjRailPostServer::OnNotifyObject(Entity* self, Entity* sender, const std::s
|
||||
}
|
||||
}
|
||||
|
||||
void NjRailPostServer::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
void NjRailPostServer::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||
if (state == eQuickBuildState::COMPLETED) {
|
||||
auto* relatedRail = GetRelatedRail(self);
|
||||
if (relatedRail == nullptr)
|
||||
return;
|
||||
@@ -30,7 +30,7 @@ void NjRailPostServer::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
return;
|
||||
|
||||
self->SetNetworkVar(NetworkNotActiveVariable, false);
|
||||
} else if (state == eRebuildState::RESETTING) {
|
||||
} else if (state == eQuickBuildState::RESETTING) {
|
||||
auto* relatedRail = GetRelatedRail(self);
|
||||
if (relatedRail == nullptr)
|
||||
return;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
class NjRailPostServer : public CppScripts::Script {
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) override;
|
||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
||||
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||
private:
|
||||
Entity* GetRelatedRail(Entity* self);
|
||||
const std::u16string NetworkNotActiveVariable = u"NetworkNotActive";
|
||||
|
@@ -11,7 +11,7 @@ void PropertyDevice::OnStartup(Entity* self) {
|
||||
}
|
||||
}
|
||||
|
||||
void PropertyDevice::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void PropertyDevice::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
auto propertyOwnerID = self->GetNetworkVar<std::string>(m_PropertyOwnerVariable);
|
||||
if (propertyOwnerID == std::to_string(LWOOBJID_EMPTY))
|
||||
return;
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
class PropertyDevice : public CppScripts::Script {
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
const std::u16string m_PropertyOwnerVariable = u"PropertyOwnerID";
|
||||
const uint32_t m_PropertyMissionID = 1291;
|
||||
};
|
||||
|
@@ -1,9 +1,9 @@
|
||||
#include "PropertyPlatform.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "MovingPlatformComponent.h"
|
||||
|
||||
void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void PropertyPlatform::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
|
||||
// if (movingPlatform != nullptr) {
|
||||
// movingPlatform->StopPathing();
|
||||
@@ -14,8 +14,8 @@ void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
}
|
||||
|
||||
void PropertyPlatform::OnUse(Entity* self, Entity* user) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
if (rebuildComponent != nullptr && rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
if (quickBuildComponent != nullptr && quickBuildComponent->GetState() == eQuickBuildState::COMPLETED) {
|
||||
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
|
||||
// if (movingPlatform != nullptr) {
|
||||
// movingPlatform->GotoWaypoint(1);
|
||||
|
@@ -4,7 +4,7 @@
|
||||
class PropertyPlatform : public CppScripts::Script {
|
||||
public:
|
||||
void OnUse(Entity* self, Entity* user) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
private:
|
||||
float_t movementDelay = 10.0f;
|
||||
float_t effectDelay = 5.0f;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "CDObjectSkillsTable.h"
|
||||
#include "CDSkillBehaviorTable.h"
|
||||
|
||||
void QbEnemyStunner::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void QbEnemyStunner::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
auto* destroyable = self->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyable != nullptr) {
|
||||
|
@@ -4,6 +4,6 @@
|
||||
class QbEnemyStunner : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
};
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include "GameMessages.h"
|
||||
#include "Character.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
@@ -12,13 +12,13 @@ void NsTokenConsoleServer::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void NsTokenConsoleServer::OnUse(Entity* self, Entity* user) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (rebuildComponent == nullptr) {
|
||||
if (quickBuildComponent == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (rebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
||||
if (quickBuildComponent->GetState() != eQuickBuildState::COMPLETED) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "Entity.h"
|
||||
#include "Character.h"
|
||||
|
||||
void NTPipeVisibilityServer::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void NTPipeVisibilityServer::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
const auto flag = self->GetVar<int32_t>(u"flag");
|
||||
if (flag == 0) return;
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
class NTPipeVisibilityServer : public CppScripts::Script {
|
||||
public:
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
};
|
||||
|
||||
#endif //!__NTPIPEVISIBILITYSERVER__H__
|
||||
|
@@ -4,7 +4,7 @@
|
||||
#include "Character.h"
|
||||
#include "ePlayerFlag.h"
|
||||
|
||||
void NTImagimeterVisibility::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void NTImagimeterVisibility::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
auto* character = target->GetCharacter();
|
||||
if (character) character->SetPlayerFlag(ePlayerFlag::NT_PLINTH_REBUILD, true);
|
||||
|
||||
|
@@ -3,5 +3,5 @@
|
||||
|
||||
class NTImagimeterVisibility : public CppScripts::Script {
|
||||
public:
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
};
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "GameMessages.h"
|
||||
#include "EntityManager.h"
|
||||
|
||||
void CatapultBouncerServer::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void CatapultBouncerServer::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"Built", 0, 0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->SetNetworkVar<bool>(u"Built", true);
|
||||
|
@@ -3,5 +3,5 @@
|
||||
|
||||
class CatapultBouncerServer : public CppScripts::Script {
|
||||
public:
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
};
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "CavePrisonCage.h"
|
||||
#include "EntityManager.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "Character.h"
|
||||
#include "dZoneManager.h"
|
||||
@@ -45,8 +45,8 @@ void CavePrisonCage::Setup(Entity* self, Spawner* spawner) {
|
||||
Game::entityManager->ConstructEntity(entity);
|
||||
}
|
||||
|
||||
void CavePrisonCage::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state != eRebuildState::RESETTING) {
|
||||
void CavePrisonCage::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||
if (state != eQuickBuildState::RESETTING) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -68,14 +68,14 @@ void CavePrisonCage::SpawnCounterweight(Entity* self, Spawner* spawner) {
|
||||
|
||||
self->SetVar<LWOOBJID>(u"Counterweight", counterweight->GetObjectID());
|
||||
|
||||
auto* rebuildComponent = counterweight->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = counterweight->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (rebuildComponent != nullptr) {
|
||||
rebuildComponent->AddRebuildStateCallback([this, self](eRebuildState state) {
|
||||
OnRebuildNotifyState(self, state);
|
||||
if (quickBuildComponent != nullptr) {
|
||||
quickBuildComponent->AddQuickBuildStateCallback([this, self](eQuickBuildState state) {
|
||||
OnQuickBuildNotifyState(self, state);
|
||||
});
|
||||
|
||||
rebuildComponent->AddRebuildCompleteCallback([this, self](Entity* user) {
|
||||
quickBuildComponent->AddQuickBuildCompleteCallback([this, self](Entity* user) {
|
||||
// The counterweight is a simple mover, which is not implemented, so we'll just set it's position
|
||||
auto* counterweight = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Counterweight"));
|
||||
|
||||
|
@@ -5,7 +5,7 @@ class CavePrisonCage : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void Setup(Entity* self, Spawner* spawner);
|
||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
||||
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||
void SpawnCounterweight(Entity* self, Spawner* spawner);
|
||||
void GetButton(Entity* self);
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
|
@@ -1,15 +1,15 @@
|
||||
#include "ImaginationShrineServer.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
|
||||
void ImaginationShrineServer::OnUse(Entity* self, Entity* user) {
|
||||
// If the rebuild component is complete, use the shrine
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (rebuildComponent == nullptr) {
|
||||
if (quickBuildComponent == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
if (quickBuildComponent->GetState() == eQuickBuildState::COMPLETED) {
|
||||
// Use the shrine
|
||||
BaseUse(self, user);
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ void RainOfArrows::OnStartup(Entity* self) {
|
||||
|
||||
}
|
||||
|
||||
void RainOfArrows::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void RainOfArrows::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
auto myPos = self->GetPosition();
|
||||
auto myRot = self->GetRotation();
|
||||
|
||||
|
@@ -5,7 +5,7 @@ class RainOfArrows : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
|
||||
private:
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "NjMonastryBossInstance.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "EntityManager.h"
|
||||
#include "dZoneManager.h"
|
||||
@@ -221,26 +221,26 @@ void NjMonastryBossInstance::HandleLedgedFrakjawSpawned(Entity* self, Entity* le
|
||||
}
|
||||
|
||||
void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* counterWeight) {
|
||||
auto* rebuildComponent = counterWeight->GetComponent<RebuildComponent>();
|
||||
if (rebuildComponent != nullptr) {
|
||||
rebuildComponent->AddRebuildStateCallback([this, self, counterWeight](eRebuildState state) {
|
||||
auto* quickBuildComponent = counterWeight->GetComponent<QuickBuildComponent>();
|
||||
if (quickBuildComponent != nullptr) {
|
||||
quickBuildComponent->AddQuickBuildStateCallback([this, self, counterWeight](eQuickBuildState state) {
|
||||
|
||||
switch (state) {
|
||||
case eRebuildState::BUILDING:
|
||||
case eQuickBuildState::BUILDING:
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification,
|
||||
0, 0, counterWeight->GetObjectID(),
|
||||
BaseCounterweightQB + std::to_string(self->GetVar<uint32_t>(WaveNumberVariable)),
|
||||
UNASSIGNED_SYSTEM_ADDRESS);
|
||||
return;
|
||||
case eRebuildState::INCOMPLETE:
|
||||
case eQuickBuildState::INCOMPLETE:
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), EndCinematicNotification,
|
||||
0, 0, LWOOBJID_EMPTY, "",
|
||||
UNASSIGNED_SYSTEM_ADDRESS);
|
||||
return;
|
||||
case eRebuildState::RESETTING:
|
||||
case eQuickBuildState::RESETTING:
|
||||
ActivityTimerStart(self, SpawnCounterWeightTimer, 0.0f, 0.0f);
|
||||
return;
|
||||
case eRebuildState::COMPLETED: {
|
||||
case eQuickBuildState::COMPLETED: {
|
||||
// TODO: Move the platform?
|
||||
|
||||
// The counterweight is actually a moving platform and we should listen to the last waypoint event here
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#include "SkillComponent.h"
|
||||
#include "TeamManager.h"
|
||||
|
||||
void AgSurvivalBuffStation::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void AgSurvivalBuffStation::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||
// We set the faction to 1 so that the buff station sees players as friendly targets to buff
|
||||
if (destroyableComponent != nullptr) destroyableComponent->SetFaction(1);
|
||||
|
@@ -10,7 +10,7 @@ public:
|
||||
* @param self The Entity that called this script.
|
||||
* @param target The target of the self that called this script.
|
||||
*/
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
private:
|
||||
/**
|
||||
|
@@ -9,7 +9,7 @@ class Entity;
|
||||
class NiPoint3;
|
||||
enum class eMissionState : int32_t;
|
||||
enum class ePetTamingNotifyType : uint32_t;
|
||||
enum class eRebuildState : uint32_t;
|
||||
enum class eQuickBuildState : uint32_t;
|
||||
|
||||
namespace CppScripts {
|
||||
/**
|
||||
@@ -154,23 +154,23 @@ namespace CppScripts {
|
||||
/**
|
||||
* Invoked when a player has started building this quickbuild.
|
||||
*
|
||||
* Equivalent to 'function onRebuildStart(self, msg)'
|
||||
* Equivalent to 'function onQuickBuildStart(self, msg)'
|
||||
*/
|
||||
virtual void OnRebuildStart(Entity* self, Entity* target) {};
|
||||
virtual void OnQuickBuildStart(Entity* self, Entity* target) {};
|
||||
|
||||
/**
|
||||
* Invoked when this quickbuild has changed state.
|
||||
*
|
||||
* Equivalent to 'function onRebuildNotifyState(self, msg)'
|
||||
* Equivalent to 'function onQuickBuildNotifyState(self, msg)'
|
||||
*/
|
||||
virtual void OnRebuildNotifyState(Entity* self, eRebuildState state) {};
|
||||
virtual void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {};
|
||||
|
||||
/**
|
||||
* Invoked when this quickbuild has been completed.
|
||||
*
|
||||
* Equivalent to 'function onRebuildComplete(self, msg)'
|
||||
* Equivalent to 'function OnQuickBuildComplete(self, msg)'
|
||||
*/
|
||||
virtual void OnRebuildComplete(Entity* self, Entity* target) {};
|
||||
virtual void OnQuickBuildComplete(Entity* self, Entity* target) {};
|
||||
|
||||
/**
|
||||
* Invoked when self has received either a hit or heal.
|
||||
|
@@ -1,22 +1,22 @@
|
||||
#include "ActMine.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
|
||||
void ActMine::OnStartup(Entity* self) {
|
||||
self->SetVar(u"RebuildComplete", false);
|
||||
self->SetVar(u"QuickBuildComplete", false);
|
||||
self->SetProximityRadius(MINE_RADIUS, "mineRadius");
|
||||
}
|
||||
|
||||
void ActMine::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
auto* rebuild = self->GetComponent<RebuildComponent>();
|
||||
void ActMine::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||
if (state == eQuickBuildState::COMPLETED) {
|
||||
auto* rebuild = self->GetComponent<QuickBuildComponent>();
|
||||
if (rebuild) {
|
||||
auto* builder = rebuild->GetBuilder();
|
||||
self->SetVar(u"Builder", builder->GetObjectID());
|
||||
}
|
||||
|
||||
self->SetVar(u"RebuildComplete", true);
|
||||
self->SetVar(u"QuickBuildComplete", true);
|
||||
self->SetVar(u"NumWarnings", 0);
|
||||
self->AddToGroup("reset");
|
||||
}
|
||||
@@ -26,7 +26,7 @@ void ActMine::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
void ActMine::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
|
||||
auto* detroyable = self->GetComponent<DestroyableComponent>();
|
||||
if (!detroyable) return;
|
||||
if (status == "ENTER" && self->GetVar<bool>(u"RebuildComplete") == true && detroyable->IsEnemy(entering)) {
|
||||
if (status == "ENTER" && self->GetVar<bool>(u"QuickBuildComplete") == true && detroyable->IsEnemy(entering)) {
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 242, u"orange", "sirenlight_B");
|
||||
self->AddTimer("Tick", TICK_TIME);
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@
|
||||
class ActMine : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
||||
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||
void OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
private:
|
||||
|
@@ -20,7 +20,7 @@ void AgJetEffectServer::OnUse(Entity* self, Entity* user) {
|
||||
self->AddTimer("CineDone", 7.5f + 5.0f); // 7.5f is time the cinematic takes to play
|
||||
}
|
||||
|
||||
void AgJetEffectServer::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void AgJetEffectServer::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
if (self->GetLOT() != 6209) return;
|
||||
auto entities = Game::entityManager->GetEntitiesInGroup("Jet_FX");
|
||||
if (entities.empty()) return;
|
||||
|
@@ -6,7 +6,7 @@ class AgJetEffectServer final : public CppScripts::Script
|
||||
public:
|
||||
void OnUse(Entity* self, Entity* user) override;
|
||||
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
private:
|
||||
|
@@ -7,7 +7,7 @@ void AgQbElevator::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
//when the QB is finished being built by a player
|
||||
void AgQbElevator::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void AgQbElevator::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
self->SetProximityRadius(proxRadius, "elevatorProx");
|
||||
self->SetI64(u"qbPlayer", target->GetObjectID());
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
class AgQbElevator : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "AgQbWall.h"
|
||||
|
||||
void AgQbWall::OnRebuildComplete(Entity* self, Entity* player) {
|
||||
void AgQbWall::OnQuickBuildComplete(Entity* self, Entity* player) {
|
||||
self->SetVar(u"player", player->GetObjectID());
|
||||
auto targetWallSpawners = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"spawner"));
|
||||
if (targetWallSpawners != "") {
|
||||
|
@@ -3,5 +3,5 @@
|
||||
|
||||
class AgQbWall : public CppScripts::Script {
|
||||
public:
|
||||
void OnRebuildComplete(Entity* self, Entity* player) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* player) override;
|
||||
};
|
||||
|
@@ -12,6 +12,6 @@ void AgTurret::OnTimerDone(Entity* self, std::string timerName) {
|
||||
}
|
||||
}
|
||||
|
||||
void AgTurret::OnRebuildStart(Entity* self, Entity* user) {
|
||||
void AgTurret::OnQuickBuildStart(Entity* self, Entity* user) {
|
||||
GameMessages::SendLockNodeRotation(self, "base");
|
||||
}
|
||||
|
@@ -4,5 +4,5 @@
|
||||
class AgTurret : public CppScripts::Script {
|
||||
void OnStartup(Entity* self);
|
||||
void OnTimerDone(Entity* self, std::string timerName);
|
||||
void OnRebuildStart(Entity* self, Entity* user);
|
||||
void OnQuickBuildStart(Entity* self, Entity* user);
|
||||
};
|
||||
|
@@ -1,10 +1,10 @@
|
||||
#include "ActNinjaTurret.h"
|
||||
#include "eRebuildState.h"
|
||||
#include "eQuickBuildState.h"
|
||||
|
||||
void ActNinjaTurret::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
void ActNinjaTurret::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||
if (state == eQuickBuildState::COMPLETED) {
|
||||
self->SetVar(u"AmBuilt", true);
|
||||
} else if (state == eRebuildState::RESETTING) {
|
||||
} else if (state == eQuickBuildState::RESETTING) {
|
||||
self->SetVar(u"AmBuilt", false);
|
||||
}
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@
|
||||
class ActNinjaTurret : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
||||
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
||||
int32_t param3) override;
|
||||
};
|
||||
|
@@ -1,11 +1,11 @@
|
||||
#include "ActParadoxPipeFix.h"
|
||||
#include "EntityManager.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eEndBehavior.h"
|
||||
|
||||
void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void ActParadoxPipeFix::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
const auto myGroup = "AllPipes";
|
||||
|
||||
const auto groupObjs = Game::entityManager->GetEntitiesInGroup(myGroup);
|
||||
@@ -19,9 +19,9 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto* rebuildComponent = object->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = object->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
if (quickBuildComponent->GetState() == eQuickBuildState::COMPLETED) {
|
||||
indexCount++;
|
||||
}
|
||||
}
|
||||
@@ -51,8 +51,8 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
}
|
||||
}
|
||||
|
||||
void ActParadoxPipeFix::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::RESETTING) {
|
||||
void ActParadoxPipeFix::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||
if (state == eQuickBuildState::RESETTING) {
|
||||
const auto refinery = Game::entityManager->GetEntitiesInGroup("Paradox");
|
||||
|
||||
if (!refinery.empty()) {
|
||||
|
@@ -4,7 +4,7 @@
|
||||
class ActParadoxPipeFix : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||
};
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "GeneralUtils.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "Spawner.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
|
||||
void FvBrickPuzzleServer::OnStartup(Entity* self) {
|
||||
const auto myGroup = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"spawner_name"));
|
||||
@@ -59,9 +59,9 @@ void FvBrickPuzzleServer::OnDie(Entity* self, Entity* killer) {
|
||||
|
||||
void FvBrickPuzzleServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "reset") {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (rebuildComponent != nullptr && rebuildComponent->GetState() == eRebuildState::OPEN) {
|
||||
if (quickBuildComponent != nullptr && quickBuildComponent->GetState() == eQuickBuildState::OPEN) {
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
}
|
||||
|
@@ -2,15 +2,15 @@
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "eRebuildState.h"
|
||||
#include "eQuickBuildState.h"
|
||||
|
||||
void FvConsoleLeftQuickbuild::OnStartup(Entity* self) {
|
||||
self->SetVar(u"IAmBuilt", false);
|
||||
self->SetVar(u"AmActive", false);
|
||||
}
|
||||
|
||||
void FvConsoleLeftQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
void FvConsoleLeftQuickbuild::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||
if (state == eQuickBuildState::COMPLETED) {
|
||||
self->SetVar(u"IAmBuilt", true);
|
||||
|
||||
const auto objects = Game::entityManager->GetEntitiesInGroup("Facility");
|
||||
@@ -18,7 +18,7 @@ void FvConsoleLeftQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState s
|
||||
if (!objects.empty()) {
|
||||
objects[0]->NotifyObject(self, "ConsoleLeftUp");
|
||||
}
|
||||
} else if (state == eRebuildState::RESETTING) {
|
||||
} else if (state == eQuickBuildState::RESETTING) {
|
||||
self->SetVar(u"IAmBuilt", false);
|
||||
self->SetVar(u"AmActive", false);
|
||||
|
||||
|
@@ -5,6 +5,6 @@ class FvConsoleLeftQuickbuild : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
||||
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||
void OnUse(Entity* self, Entity* user) override;
|
||||
};
|
||||
|
@@ -2,15 +2,15 @@
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "eRebuildState.h"
|
||||
#include "eQuickBuildState.h"
|
||||
|
||||
void FvConsoleRightQuickbuild::OnStartup(Entity* self) {
|
||||
self->SetVar(u"IAmBuilt", false);
|
||||
self->SetVar(u"AmActive", false);
|
||||
}
|
||||
|
||||
void FvConsoleRightQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
void FvConsoleRightQuickbuild::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||
if (state == eQuickBuildState::COMPLETED) {
|
||||
self->SetVar(u"IAmBuilt", true);
|
||||
|
||||
const auto objects = Game::entityManager->GetEntitiesInGroup("Facility");
|
||||
@@ -18,7 +18,7 @@ void FvConsoleRightQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState
|
||||
if (!objects.empty()) {
|
||||
objects[0]->NotifyObject(self, "ConsoleRightUp");
|
||||
}
|
||||
} else if (state == eRebuildState::RESETTING) {
|
||||
} else if (state == eQuickBuildState::RESETTING) {
|
||||
self->SetVar(u"IAmBuilt", false);
|
||||
self->SetVar(u"AmActive", false);
|
||||
|
||||
|
@@ -5,6 +5,6 @@ class FvConsoleRightQuickbuild : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
||||
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||
void OnUse(Entity* self, Entity* user) override;
|
||||
};
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "Entity.h"
|
||||
#include "eRebuildState.h"
|
||||
#include "eQuickBuildState.h"
|
||||
|
||||
void FvDragonSmashingGolemQb::OnStartup(Entity* self) {
|
||||
self->AddTimer("GolemBreakTimer", 10.5f);
|
||||
@@ -15,8 +15,8 @@ void FvDragonSmashingGolemQb::OnTimerDone(Entity* self, std::string timerName) {
|
||||
}
|
||||
}
|
||||
|
||||
void FvDragonSmashingGolemQb::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
void FvDragonSmashingGolemQb::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||
if (state == eQuickBuildState::COMPLETED) {
|
||||
RenderComponent::PlayAnimation(self, u"dragonsmash");
|
||||
|
||||
const auto dragonId = self->GetVar<LWOOBJID>(u"Dragon");
|
||||
|
@@ -6,5 +6,5 @@ class FvDragonSmashingGolemQb : public CppScripts::Script
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
||||
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||
};
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "Entity.h"
|
||||
#include "SkillComponent.h"
|
||||
|
||||
void GfArchway::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void GfArchway::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
auto* skillComponent = target->GetComponent<SkillComponent>();
|
||||
if (skillComponent) skillComponent->CalculateBehavior(SHIELDING_SKILL, SHIELDING_BEHAVIOR, target->GetObjectID(), true);
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
class GfArchway : public CppScripts::Script {
|
||||
public:
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
private:
|
||||
const uint32_t SHIELDING_SKILL = 863;
|
||||
const uint32_t SHIELDING_BEHAVIOR = 3788;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
#include "GfJailWalls.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "GeneralUtils.h"
|
||||
#include "eRebuildState.h"
|
||||
#include "eQuickBuildState.h"
|
||||
|
||||
void GfJailWalls::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void GfJailWalls::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
||||
|
||||
for (auto* spawner : Game::zoneManager->GetSpawnersByName("Jail0" + wall)) {
|
||||
@@ -15,8 +15,8 @@ void GfJailWalls::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
}
|
||||
}
|
||||
|
||||
void GfJailWalls::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state != eRebuildState::RESETTING) return;
|
||||
void GfJailWalls::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||
if (state != eQuickBuildState::RESETTING) return;
|
||||
|
||||
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
||||
|
||||
|
@@ -4,6 +4,6 @@
|
||||
class GfJailWalls final : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||
};
|
||||
|
@@ -4,7 +4,7 @@
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionState.h"
|
||||
|
||||
void PetDigBuild::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void PetDigBuild::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
auto flagNumber = self->GetVar<std::u16string>(u"flagNum");
|
||||
|
||||
EntityInfo info{};
|
||||
|
@@ -4,6 +4,6 @@
|
||||
class PetDigBuild : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnRebuildComplete(Entity* self, Entity* target);
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target);
|
||||
void OnDie(Entity* self, Entity* killer);
|
||||
};
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include "Item.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "EntityManager.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "SoundTriggerComponent.h"
|
||||
#include "InventoryComponent.h"
|
||||
#include "MissionComponent.h"
|
||||
@@ -20,13 +20,13 @@ void NsConcertInstrument::OnStartup(Entity* self) {
|
||||
self->SetVar<LWOOBJID>(u"oldItemRight", LWOOBJID_EMPTY);
|
||||
}
|
||||
|
||||
void NsConcertInstrument::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::RESETTING || state == eRebuildState::OPEN) {
|
||||
void NsConcertInstrument::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||
if (state == eQuickBuildState::RESETTING || state == eQuickBuildState::OPEN) {
|
||||
self->SetVar<LWOOBJID>(u"activePlayer", LWOOBJID_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
void NsConcertInstrument::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void NsConcertInstrument::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
if (!target->GetIsDead()) {
|
||||
self->SetVar<LWOOBJID>(u"activePlayer", target->GetObjectID());
|
||||
|
||||
@@ -93,9 +93,9 @@ void NsConcertInstrument::OnTimerDone(Entity* self, std::string name) {
|
||||
activePlayer->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
if (rebuildComponent != nullptr)
|
||||
rebuildComponent->ResetRebuild(false);
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
if (quickBuildComponent != nullptr)
|
||||
quickBuildComponent->ResetQuickBuild(false);
|
||||
|
||||
self->Smash(self->GetObjectID(), eKillType::VIOLENT);
|
||||
self->SetVar<LWOOBJID>(u"activePlayer", LWOOBJID_EMPTY);
|
||||
|
@@ -11,10 +11,10 @@ enum InstrumentLot {
|
||||
class NsConcertInstrument : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
||||
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
||||
int32_t param3) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnTimerDone(Entity* self, std::string name) override;
|
||||
private:
|
||||
static void StartPlayingInstrument(Entity* self, Entity* player);
|
||||
|
@@ -80,7 +80,7 @@ void NsConcertQuickBuild::OnDie(Entity* self, Entity* killer) {
|
||||
finishedQuickBuilds.erase(position);
|
||||
}
|
||||
|
||||
void NsConcertQuickBuild::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void NsConcertQuickBuild::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
const auto groupNumber = self->GetVar<int32_t>(u"groupNumber");
|
||||
finishedQuickBuilds.push_back(self->GetObjectID());
|
||||
self->SetNetworkVar<float>(u"startEffect", -1.0f);
|
||||
|
@@ -9,7 +9,7 @@ struct QuickBuildSet {
|
||||
class NsConcertQuickBuild : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnDie(Entity* self, Entity* killer) override;
|
||||
private:
|
||||
static std::vector<LWOOBJID> finishedQuickBuilds;
|
||||
|
@@ -6,7 +6,7 @@ void NsQbImaginationStatue::OnStartup(Entity* self) {
|
||||
|
||||
}
|
||||
|
||||
void NsQbImaginationStatue::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void NsQbImaginationStatue::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
if (target == nullptr) return;
|
||||
|
||||
self->SetVar(u"Player", target->GetObjectID());
|
||||
|
@@ -5,7 +5,7 @@ class NsQbImaginationStatue : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void SpawnLoot(Entity* self);
|
||||
};
|
||||
|
Reference in New Issue
Block a user