mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-16 11:44:22 +00:00
feat: implement a bunch of basic scripts that don't really do anything
None of these do anything noticeable or break anything
This commit is contained in:
@@ -962,5 +962,12 @@ namespace GameMessages {
|
||||
|
||||
LWOOBJID childID{};
|
||||
};
|
||||
|
||||
struct ObjectLoaded : public GameMsg {
|
||||
ObjectLoaded() : GameMsg(MessageType::Game::OBJECT_LOADED) {}
|
||||
|
||||
LWOOBJID objectID{};
|
||||
LOT lot{};
|
||||
};
|
||||
};
|
||||
#endif // GAMEMESSAGES_H
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set(DSCRIPTS_SOURCES_02_SERVER_DLU
|
||||
"DLUVanityTeleportingObject.cpp"
|
||||
"RegisterWithZoneControl.cpp"
|
||||
PARENT_SCOPE)
|
||||
|
||||
8
dScripts/02_server/DLU/RegisterWithZoneControl.cpp
Normal file
8
dScripts/02_server/DLU/RegisterWithZoneControl.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "RegisterWithZoneControl.h"
|
||||
|
||||
void RegisterWithZoneControl::OnStartup(Entity* self) {
|
||||
GameMessages::ObjectLoaded objLoaded;
|
||||
objLoaded.objectID = self->GetObjectID();
|
||||
objLoaded.lot = self->GetLOT();
|
||||
objLoaded.Send(Game::entityManager->GetZoneControlEntity()->GetObjectID());
|
||||
}
|
||||
6
dScripts/02_server/DLU/RegisterWithZoneControl.h
Normal file
6
dScripts/02_server/DLU/RegisterWithZoneControl.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "CppScripts.h"
|
||||
|
||||
class RegisterWithZoneControl : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
};
|
||||
@@ -13,7 +13,6 @@ void ResetMissions(Entity& user) {
|
||||
}
|
||||
|
||||
void OldManNPC::OnUse(Entity* self, Entity* user) {
|
||||
LOG("");
|
||||
const auto* const missionComponent = user->GetComponent<MissionComponent>();
|
||||
if (!missionComponent) return;
|
||||
|
||||
@@ -24,7 +23,6 @@ void OldManNPC::OnUse(Entity* self, Entity* user) {
|
||||
}
|
||||
|
||||
const auto missionState = mission->GetMissionState();
|
||||
LOG("mission state %i", missionState);
|
||||
if (missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE) {
|
||||
ResetMissions(*user);
|
||||
}
|
||||
|
||||
@@ -339,6 +339,8 @@
|
||||
#include "ImaginationBackPack.h"
|
||||
#include "NsWinterRaceServer.h"
|
||||
|
||||
#include "RegisterWithZoneControl.h"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <functional>
|
||||
@@ -663,6 +665,7 @@ namespace {
|
||||
|
||||
//WBL
|
||||
{"scripts\\zone\\LUPs\\WBL_generic_zone.lua", []() {return new WblGenericZone();}},
|
||||
{"scripts\\zone\\LUPs\\Moonbase Intro\\MOONBASE-INTRO_INTRO_CINEMATIC.lua", []() {return new WblGenericZone();}},
|
||||
|
||||
//Alpha
|
||||
{"scripts\\ai\\FV\\L_TRIGGER_GAS.lua", []() {return new TriggerGas();}},
|
||||
@@ -708,7 +711,8 @@ namespace {
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\VEHICLE_DEATH_TRIGGER_WATER_SERVER.lua", []() {return new VehicleDeathTriggerWaterServer();}},
|
||||
{"scripts\\equipmenttriggers\\L_TRIAL_FACTION_ARMOR_SERVER.lua", []() {return new TrialFactionArmorServer();}},
|
||||
{"scripts\\equipmenttriggers\\ImaginationBackPack.lua", []() {return new ImaginationBackPack();}},
|
||||
|
||||
{"scripts\\ai\\MINIGAME\\SG_GF\\SERVER\\SG_CANNON_INSTANCE_ACTOR.lua", [](){return new RegisterWithZoneControl();}},
|
||||
{"scripts\\ai\\MINIGAME\\SG_GF\\SERVER\\SG_CANNON_INSTANCE_EFFECT.lua", [](){return new RegisterWithZoneControl();}},
|
||||
};
|
||||
|
||||
std::set<std::string> g_ExcludedScripts = {
|
||||
@@ -732,6 +736,11 @@ namespace {
|
||||
"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_InfectedCitizen.lua",
|
||||
"scripts\\ai\\MINIGAME\\SIEGE\\OBJECTS\\ATTACKER_BOUNCER_SERVER.lua",
|
||||
"scripts\\ai\\AG\\L_AG_ZONE_PLAYER.lua",
|
||||
"scripts\\ai\\GENERAL\\L_NPC_GENERIC_MOVEMENT.lua", // Really old alpha script
|
||||
"scripts\\zone\\LUPs\\DeepFreeze Intro\\WBL_Enemy_Beaver.lua" // Really old alpha script
|
||||
"scripts\\ai\\GENERAL\\L_NPC_GENERIC_WANDER_SMALL.lua" // Really old alpha script
|
||||
"scripts\\ai\\NP\\L_NPC_NP_OLD_MAN_SHERLAND.lua" // This NPC doesn't even exist in modern crux, the only place this is used...
|
||||
"scripts\\02_server\\Map\\General\\L_SIMPLE_MOVER_SWITCH.lua" // This platform does not exist even when moved manually on a client
|
||||
};
|
||||
};
|
||||
|
||||
@@ -745,7 +754,8 @@ CppScripts::Script* const CppScripts::GetScript(Entity* parent, const std::strin
|
||||
Script* script = itrTernary != scriptLoader.cend() ? itrTernary->second() : &InvalidToReturn;
|
||||
|
||||
if (script == &InvalidToReturn && !scriptName.empty() && !g_ExcludedScripts.contains(scriptName)) {
|
||||
LOG_DEBUG("LOT %i attempted to load CppScript for '%s', but returned InvalidScript.", parent->GetLOT(), scriptName.c_str());
|
||||
const auto [x, y, z] = parent->GetPosition();
|
||||
LOG_DEBUG("LOT %i at %f %f %f attempted to load CppScript for '%s', but returned InvalidScript.", parent->GetLOT(), x, y, z, scriptName.c_str());
|
||||
}
|
||||
|
||||
g_Scripts[scriptName] = script;
|
||||
|
||||
Reference in New Issue
Block a user