mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
fix: add Nexus Tower missing scripts (#1349)
add final missing scripts for nt also fix the turnin for the breadcrumb missions not showing the completion window. Fix another missing script Add another script fix include guards Fix dirt clouds not appearing on mission accept
This commit is contained in:
@@ -3,6 +3,7 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL
|
||||
"BaseInteractDropLootServer.cpp"
|
||||
"Binoculars.cpp"
|
||||
"ExplodingAsset.cpp"
|
||||
"FrictionVolumeServer.cpp"
|
||||
"ForceVolumeServer.cpp"
|
||||
"GrowingFlower.cpp"
|
||||
"ImaginationBackpackHealServer.cpp"
|
||||
@@ -17,6 +18,8 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL
|
||||
"StoryBoxInteractServer.cpp"
|
||||
"TokenConsoleServer.cpp"
|
||||
"TouchMissionUpdateServer.cpp"
|
||||
"VisToggleNotifierServer.cpp"
|
||||
"NTNaomiDirtServer.cpp"
|
||||
"WishingWellServer.cpp")
|
||||
|
||||
add_subdirectory(Ninjago)
|
||||
|
19
dScripts/02_server/Map/General/FrictionVolumeServer.cpp
Normal file
19
dScripts/02_server/Map/General/FrictionVolumeServer.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "FrictionVolumeServer.h"
|
||||
#include "PhantomPhysicsComponent.h"
|
||||
#include "ePhysicsEffectType.h"
|
||||
#include "Game.h"
|
||||
#include "EntityManager.h"
|
||||
|
||||
void FrictionVolumeServer::OnStartup(Entity* self) {
|
||||
auto frictionAmount = self->GetVar<float>(u"FrictionAmt");
|
||||
if (frictionAmount == 0.0f) frictionAmount = DefaultFrictionAmount;
|
||||
|
||||
auto* phantomPhysicsComponent = self->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!phantomPhysicsComponent) return;
|
||||
|
||||
phantomPhysicsComponent->SetEffectType(ePhysicsEffectType::FRICTION);
|
||||
phantomPhysicsComponent->SetDirectionalMultiplier(frictionAmount);
|
||||
phantomPhysicsComponent->SetPhysicsEffectActive(true);
|
||||
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
}
|
13
dScripts/02_server/Map/General/FrictionVolumeServer.h
Normal file
13
dScripts/02_server/Map/General/FrictionVolumeServer.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef __FRICTIONVOLUMESERVER__H__
|
||||
#define __FRICTIONVOLUMESERVER__H__
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class FrictionVolumeServer : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
private:
|
||||
const float DefaultFrictionAmount = 1.5f;
|
||||
};
|
||||
|
||||
#endif //!__FRICTIONVOLUMESERVER__H__
|
14
dScripts/02_server/Map/General/NTNaomiDirtServer.cpp
Normal file
14
dScripts/02_server/Map/General/NTNaomiDirtServer.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "NTNaomiDirtServer.h"
|
||||
|
||||
namespace {
|
||||
std::map<int32_t, std::string> VisibilityMissionTable = {
|
||||
{1253, std::string("Dirt_Clouds_Sent")},
|
||||
{1276, std::string("Dirt_Clouds_Assem")},
|
||||
{1277, std::string("Dirt_Clouds_Para")},
|
||||
{1283, std::string("Dirt_Clouds_Halls")}
|
||||
};
|
||||
};
|
||||
|
||||
void NTNaomiDirtServer::OnStartup(Entity* self) {
|
||||
SetGameVariables(VisibilityMissionTable);
|
||||
}
|
11
dScripts/02_server/Map/General/NTNaomiDirtServer.h
Normal file
11
dScripts/02_server/Map/General/NTNaomiDirtServer.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef __NTNAOMIDIRTSERVER__H__
|
||||
#define __NTNAOMIDIRTSERVER__H__
|
||||
|
||||
#include "VisToggleNotifierServer.h"
|
||||
|
||||
class NTNaomiDirtServer : public VisToggleNotifierServer {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
};
|
||||
|
||||
#endif //!__NTNAOMIDIRTSERVER__H__
|
23
dScripts/02_server/Map/General/VisToggleNotifierServer.cpp
Normal file
23
dScripts/02_server/Map/General/VisToggleNotifierServer.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "VisToggleNotifierServer.h"
|
||||
#include "eMissionState.h"
|
||||
#include "Game.h"
|
||||
#include "dZoneManager.h"
|
||||
|
||||
void VisToggleNotifierServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionId, eMissionState missionState) {
|
||||
auto itr = m_GameVariables.find(missionId);
|
||||
if (itr != m_GameVariables.end()) {
|
||||
bool visible = true;
|
||||
if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
|
||||
visible = false;
|
||||
}
|
||||
|
||||
auto spawners = Game::zoneManager->GetSpawnersByName(itr->second);
|
||||
if (spawners.empty()) return;
|
||||
for (const auto spawner : spawners) {
|
||||
auto spawnedObjIds = spawner->GetSpawnedObjectIDs();
|
||||
for (const auto& objId : spawnedObjIds) {
|
||||
GameMessages::SendNotifyClientObject(objId, u"SetVisibility", visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
15
dScripts/02_server/Map/General/VisToggleNotifierServer.h
Normal file
15
dScripts/02_server/Map/General/VisToggleNotifierServer.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef __VISTOGGLENOTIFIERSERVER__H__
|
||||
#define __VISTOGGLENOTIFIERSERVER__H__
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class VisToggleNotifierServer : public CppScripts::Script {
|
||||
public:
|
||||
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
|
||||
protected:
|
||||
void SetGameVariables(std::map<int32_t, std::string>& gameVariables) { m_GameVariables = gameVariables; }
|
||||
private:
|
||||
std::map<int32_t, std::string> m_GameVariables;
|
||||
};
|
||||
|
||||
#endif //!__VISTOGGLENOTIFIERSERVER__H__
|
@@ -18,9 +18,12 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_NT
|
||||
"NtXRayServer.cpp"
|
||||
"NtSleepingGuard.cpp"
|
||||
"NtImagimeterVisibility.cpp"
|
||||
"NTPipeVisibilityServer.cpp"
|
||||
"NtSentinelWalkwayServer.cpp"
|
||||
"NtDarkitectRevealServer.cpp"
|
||||
"NtParadoxTeleServer.cpp"
|
||||
"NtVentureSpeedPadServer.cpp"
|
||||
"NtVentureCannonServer.cpp"
|
||||
"NtBcSubmitServer.cpp"
|
||||
"NtNaomiBreadcrumbServer.cpp"
|
||||
PARENT_SCOPE)
|
||||
|
15
dScripts/02_server/Map/NT/NTPipeVisibilityServer.cpp
Normal file
15
dScripts/02_server/Map/NT/NTPipeVisibilityServer.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "NTPipeVisibilityServer.h"
|
||||
#include "Entity.h"
|
||||
#include "Character.h"
|
||||
|
||||
void NTPipeVisibilityServer::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
const auto flag = self->GetVar<int32_t>(u"flag");
|
||||
if (flag == 0) return;
|
||||
|
||||
auto* character = target->GetCharacter();
|
||||
if (!character) return;
|
||||
|
||||
character->SetPlayerFlag(flag, true);
|
||||
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"PipeBuilt");
|
||||
}
|
11
dScripts/02_server/Map/NT/NTPipeVisibilityServer.h
Normal file
11
dScripts/02_server/Map/NT/NTPipeVisibilityServer.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef __NTPIPEVISIBILITYSERVER__H__
|
||||
#define __NTPIPEVISIBILITYSERVER__H__
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class NTPipeVisibilityServer : public CppScripts::Script {
|
||||
public:
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
};
|
||||
|
||||
#endif //!__NTPIPEVISIBILITYSERVER__H__
|
34
dScripts/02_server/Map/NT/NtBcSubmitServer.cpp
Normal file
34
dScripts/02_server/Map/NT/NtBcSubmitServer.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "NtBcSubmitServer.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
|
||||
#include "Entity.h"
|
||||
#include "MissionComponent.h"
|
||||
|
||||
// https://explorer.lu/missions/
|
||||
// Key is the main mission, value is the breadcrumb mission to reset upon Mission Dialogue Ok.
|
||||
// To see the actual missions, just append the number to the end of the URL.
|
||||
namespace {
|
||||
std::map<uint32_t, uint32_t> ResetMissionsTable = {
|
||||
{999, 1335},
|
||||
{1002, 1355},
|
||||
{1006, 1349},
|
||||
{1009, 1348},
|
||||
{1379, 1335},
|
||||
{1380, 1355},
|
||||
{1378, 1349},
|
||||
{1377, 1348},
|
||||
};
|
||||
}
|
||||
|
||||
void NtBcSubmitServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
|
||||
auto* missionComponent = target->GetComponent<MissionComponent>();
|
||||
if (!missionComponent) return;
|
||||
|
||||
auto it = ResetMissionsTable.find(missionID);
|
||||
if (it == ResetMissionsTable.end()) return;
|
||||
|
||||
const auto missionToReset = it->second;
|
||||
missionComponent->ResetMission(missionToReset);
|
||||
}
|
11
dScripts/02_server/Map/NT/NtBcSubmitServer.h
Normal file
11
dScripts/02_server/Map/NT/NtBcSubmitServer.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef __NTBCSUBMITSERVER__H__
|
||||
#define __NTBCSUBMITSERVER__H__
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class NtBcSubmitServer : public virtual CppScripts::Script {
|
||||
public:
|
||||
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
|
||||
};
|
||||
|
||||
#endif //!__NTBCSUBMITSERVER__H__
|
@@ -37,4 +37,5 @@ void NtDukeServer::OnMissionDialogueOK(Entity* self, Entity* target, int mission
|
||||
inventoryComponent->RemoveItem(m_SwordLot, lotCount);
|
||||
}
|
||||
}
|
||||
NtBcSubmitServer::OnMissionDialogueOK(self, target, missionID, missionState);
|
||||
}
|
||||
|
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
#include "NtFactionSpyServer.h"
|
||||
#include "NtBcSubmitServer.h"
|
||||
|
||||
class NtDukeServer : public NtFactionSpyServer {
|
||||
class NtDukeServer : public NtFactionSpyServer, public NtBcSubmitServer {
|
||||
void SetVariables(Entity* self) override;
|
||||
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
|
||||
const uint32_t m_SwordMissionID = 1448;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include "NtFactionSpyServer.h"
|
||||
#include "NtBcSubmitServer.h"
|
||||
|
||||
class NtHaelServer : public NtFactionSpyServer {
|
||||
class NtHaelServer : public NtFactionSpyServer, public NtBcSubmitServer {
|
||||
void SetVariables(Entity* self) override;
|
||||
};
|
||||
|
43
dScripts/02_server/Map/NT/NtNaomiBreadcrumbServer.cpp
Normal file
43
dScripts/02_server/Map/NT/NtNaomiBreadcrumbServer.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#include "NtNaomiBreadcrumbServer.h"
|
||||
#include <map>
|
||||
|
||||
#include "eMissionState.h"
|
||||
#include "MissionComponent.h"
|
||||
|
||||
// https://explorer.lu/missions/
|
||||
// Key is the main mission, value is the breadcrumb mission to reset upon Mission Dialogue Ok.
|
||||
// To see the actual missions, just append the number to the end of the URL.
|
||||
namespace {
|
||||
std::map<int32_t, std::vector<int32_t>> CompleteBcMissionTable = {
|
||||
{1377, {1378, 1379, 1380, 1349, 1335, 1355}},
|
||||
{1378, {1377, 1379, 1380, 1348, 1335, 1355}},
|
||||
{1379, {1377, 1378, 1380, 1348, 1349, 1355}},
|
||||
{1380, {1377, 1378, 1379, 1348, 1349, 1335}},
|
||||
};
|
||||
|
||||
std::map<int32_t, int32_t> MatchingBCTable = {
|
||||
{1377, 1348},
|
||||
{1378, 1349},
|
||||
{1379, 1335},
|
||||
{1380, 1355}
|
||||
};
|
||||
}
|
||||
|
||||
void NtNaomiBreadcrumbServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
|
||||
auto* missionComponent = target->GetComponent<MissionComponent>();
|
||||
if (!missionComponent) return;
|
||||
|
||||
auto itr = MatchingBCTable.find(missionID);
|
||||
if (itr == MatchingBCTable.end()) return;
|
||||
|
||||
missionComponent->AcceptMission(itr->second);
|
||||
|
||||
auto it = CompleteBcMissionTable.find(missionID);
|
||||
if (it == CompleteBcMissionTable.end()) return;
|
||||
|
||||
if (missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE) {
|
||||
for (const auto& bcMission : it->second) {
|
||||
missionComponent->ResetMission(bcMission);
|
||||
}
|
||||
}
|
||||
}
|
11
dScripts/02_server/Map/NT/NtNaomiBreadcrumbServer.h
Normal file
11
dScripts/02_server/Map/NT/NtNaomiBreadcrumbServer.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef __NTNAOMIBREADCRUMBSERVER__H__
|
||||
#define __NTNAOMIBREADCRUMBSERVER__H__
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class NtNaomiBreadcrumbServer : public CppScripts::Script {
|
||||
public:
|
||||
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
|
||||
};
|
||||
|
||||
#endif //!__NTNAOMIBREADCRUMBSERVER__H__
|
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
#include "NtFactionSpyServer.h"
|
||||
#include "NtBcSubmitServer.h"
|
||||
|
||||
class NtOverbuildServer : public NtFactionSpyServer {
|
||||
class NtOverbuildServer : public NtFactionSpyServer, public NtBcSubmitServer {
|
||||
void SetVariables(Entity* self) override;
|
||||
const std::u16string m_OtherEntitiesGroupVariable = u"SpyConvo2Group";
|
||||
};
|
||||
|
@@ -11,4 +11,5 @@ void NtVandaServer::OnMissionDialogueOK(Entity* self, Entity* target, int missio
|
||||
inventoryComponent->RemoveItem(alienPartLot, 1);
|
||||
}
|
||||
}
|
||||
NtBcSubmitServer::OnMissionDialogueOK(self, target, missionID, missionState);
|
||||
}
|
||||
|
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
#include "NtBcSubmitServer.h"
|
||||
|
||||
class NtVandaServer : public CppScripts::Script {
|
||||
class NtVandaServer : public NtBcSubmitServer {
|
||||
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
|
||||
const uint32_t m_AlienPartMissionID = 1183;
|
||||
const std::vector<LOT> m_AlienPartLots = { 12479, 12480, 12481 };
|
||||
|
Reference in New Issue
Block a user