Merge pull request #397 from EmosewaMC/AvantGardensSurvivalBuffStation

Fixed an issue where the Avant Gardens Survival buff station was not spawning and implemented its' script
This commit is contained in:
Gie "Max" Vanommeslaeghe 2022-01-22 15:53:58 +01:00 committed by GitHub
commit 02bf5937dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#include "AgSurvivalBuffStation.h"
#include "SkillComponent.h"
#include "dLogger.h"
void AgSurvivalBuffStation::OnRebuildComplete(Entity* self, Entity* target) {
auto skillComponent = self->GetComponent<SkillComponent>();
if (skillComponent == nullptr) return;
skillComponent->CalculateBehavior(201, 1784, self->GetObjectID());
self->AddCallbackTimer(10.0f, [self]() {
self->Smash();
});
}

View File

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

View File

@ -302,6 +302,7 @@ void BaseSurvivalServer::StartWaves(Entity *self) {
self->SetVar<bool>(FirstTimeDoneVariable, true);
self->SetVar<std::string>(MissionTypeVariable, state.players.size() == 1 ? "survival_time_solo" : "survival_time_team");
ActivateSpawnerNetwork(spawnerNetworks.rewardNetworks);
ActivateSpawnerNetwork(spawnerNetworks.smashNetworks);
self->SetNetworkVar<bool>(WavesStartedVariable, true);
self->SetNetworkVar<std::string>(StartWaveMessageVariable, "Start!");

View File

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