diff --git a/dScripts/AgSurvivalBuffStation.cpp b/dScripts/AgSurvivalBuffStation.cpp new file mode 100644 index 00000000..41a754d6 --- /dev/null +++ b/dScripts/AgSurvivalBuffStation.cpp @@ -0,0 +1,15 @@ +#include "AgSurvivalBuffStation.h" +#include "SkillComponent.h" +#include "dLogger.h" + +void AgSurvivalBuffStation::OnRebuildComplete(Entity* self, Entity* target) { + auto skillComponent = self->GetComponent(); + + if (skillComponent == nullptr) return; + + skillComponent->CalculateBehavior(201, 1784, self->GetObjectID()); + + self->AddCallbackTimer(10.0f, [self]() { + self->Smash(); + }); +} diff --git a/dScripts/AgSurvivalBuffStation.h b/dScripts/AgSurvivalBuffStation.h new file mode 100644 index 00000000..0b4d1865 --- /dev/null +++ b/dScripts/AgSurvivalBuffStation.h @@ -0,0 +1,23 @@ +#pragma once +#include "CppScripts.h" + +class AgSurvivalBuffStation : public CppScripts::Script +{ +public: + /** + * @brief When the rebuild of self is complete, we calculate the behavior that is assigned to self in the database. + * + * @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; +private: + /** + * Skill ID for the buff station. + */ + uint32_t skillIdForBuffStation = 201; + /** + * Behavior ID for the buff station. + */ + uint32_t behaviorIdForBuffStation = 1784; +}; \ No newline at end of file diff --git a/dScripts/BaseSurvivalServer.cpp b/dScripts/BaseSurvivalServer.cpp index 45ed22e3..1174f00b 100644 --- a/dScripts/BaseSurvivalServer.cpp +++ b/dScripts/BaseSurvivalServer.cpp @@ -302,6 +302,7 @@ void BaseSurvivalServer::StartWaves(Entity *self) { self->SetVar(FirstTimeDoneVariable, true); self->SetVar(MissionTypeVariable, state.players.size() == 1 ? "survival_time_solo" : "survival_time_team"); + ActivateSpawnerNetwork(spawnerNetworks.rewardNetworks); ActivateSpawnerNetwork(spawnerNetworks.smashNetworks); self->SetNetworkVar(WavesStartedVariable, true); self->SetNetworkVar(StartWaveMessageVariable, "Start!"); diff --git a/dScripts/CppScripts.cpp b/dScripts/CppScripts.cpp index f6029076..27f5e225 100644 --- a/dScripts/CppScripts.cpp +++ b/dScripts/CppScripts.cpp @@ -62,6 +62,7 @@ #include "VeMech.h" #include "VeMissionConsole.h" #include "VeEpsilonServer.h" +#include "AgSurvivalBuffStation.h" // NS Scripts #include "NsModularBuild.h" @@ -319,6 +320,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr script = new BaseEnemyMech(); else if (scriptName == "scripts\\zone\\AG\\L_ZONE_AG_SURVIVAL.lua") script = new ZoneAgSurvival(); + else if (scriptName == "scripts\\02_server\\Objects\\L_BUFF_STATION_SERVER.lua") + script = new AgSurvivalBuffStation(); else if (scriptName == "scripts\\ai\\AG\\L_AG_BUS_DOOR.lua") script = new AgBusDoor(); else if (scriptName == "scripts\\02_server\\Equipment\\L_MAESTROM_EXTRACTICATOR_SERVER.lua")