mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-22 21:43:35 +00:00
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:
commit
02bf5937dc
15
dScripts/AgSurvivalBuffStation.cpp
Normal file
15
dScripts/AgSurvivalBuffStation.cpp
Normal 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();
|
||||
});
|
||||
}
|
23
dScripts/AgSurvivalBuffStation.h
Normal file
23
dScripts/AgSurvivalBuffStation.h
Normal 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;
|
||||
};
|
@ -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!");
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user