mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-21 14:14:22 +00:00
Compare commits
2 Commits
issue-1339
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83707e2210 | ||
|
|
ccc029424c |
@@ -369,8 +369,21 @@ public:
|
|||||||
|
|
||||||
template<typename AmfType = AMFArrayValue>
|
template<typename AmfType = AMFArrayValue>
|
||||||
AmfType& PushDebug(const std::string_view name) {
|
AmfType& PushDebug(const std::string_view name) {
|
||||||
|
size_t i = 0;
|
||||||
|
for (; i < m_Dense.size(); i++) {
|
||||||
|
const auto& cast = dynamic_cast<AMFArrayValue*>(m_Dense[i].get());
|
||||||
|
if (!cast) continue;
|
||||||
|
|
||||||
|
const auto& nameValue = cast->Get<std::string>("name");
|
||||||
|
if (!nameValue || nameValue->GetValue() != name) continue;
|
||||||
|
|
||||||
|
// found a duplicate, return this instead
|
||||||
|
auto valueCast = dynamic_cast<AmfType*>(cast->Get("value"));
|
||||||
|
if (valueCast) return *valueCast;
|
||||||
|
}
|
||||||
|
|
||||||
auto* value = PushArray();
|
auto* value = PushArray();
|
||||||
value->Insert("name", name.data());
|
value->Insert<std::string>("name", name.data());
|
||||||
return value->Insert<AmfType>("value", std::make_unique<AmfType>());
|
return value->Insert<AmfType>("value", std::make_unique<AmfType>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -613,14 +613,15 @@ void Entity::Initialize() {
|
|||||||
|
|
||||||
if (rebuildResetTime != 0.0f) {
|
if (rebuildResetTime != 0.0f) {
|
||||||
quickBuildComponent->SetResetTime(rebuildResetTime);
|
quickBuildComponent->SetResetTime(rebuildResetTime);
|
||||||
|
|
||||||
// Known bug with moving platform in FV that casues it to build at the end instead of the start.
|
|
||||||
// This extends the smash time so players can ride up the lift.
|
|
||||||
if (m_TemplateID == 9483) {
|
|
||||||
quickBuildComponent->SetResetTime(quickBuildComponent->GetResetTime() + 25);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto objectID = GetObjectID();
|
||||||
|
// FV tree handler for when built so it sets the state to moving at the correct time
|
||||||
|
if (GetLOT() == 9483) quickBuildComponent->AddQuickBuildCompleteCallback([objectID](Entity* user) {
|
||||||
|
auto* const entity = Game::entityManager->GetEntity(objectID);
|
||||||
|
if (entity) GameMessages::SendPlatformResync(entity, UNASSIGNED_SYSTEM_ADDRESS, false, 0, 1, 1, eMovementPlatformState::Moving, true);
|
||||||
|
});
|
||||||
|
|
||||||
const auto activityID = GetVar<int32_t>(u"activityID");
|
const auto activityID = GetVar<int32_t>(u"activityID");
|
||||||
|
|
||||||
if (activityID > 0) {
|
if (activityID > 0) {
|
||||||
@@ -1616,7 +1617,7 @@ void Entity::Kill(Entity* murderer, const eKillType killType) {
|
|||||||
|
|
||||||
const auto& grpNameQBShowBricks = GetVarAsString(u"grpNameQBShowBricks");
|
const auto& grpNameQBShowBricks = GetVarAsString(u"grpNameQBShowBricks");
|
||||||
if (!grpNameQBShowBricks.empty()) {
|
if (!grpNameQBShowBricks.empty()) {
|
||||||
for (auto* const spawner : Game::zoneManager->GetSpawnersByName(grpNameQBShowBricks)) if (spawner) spawner->Spawn();
|
for (auto* const spawner : Game::zoneManager->GetSpawnersByName(grpNameQBShowBricks)) if (spawner) spawner->Spawn();
|
||||||
for (auto* const spawner : Game::zoneManager->GetSpawnersInGroup(grpNameQBShowBricks)) if (spawner) spawner->Spawn();
|
for (auto* const spawner : Game::zoneManager->GetSpawnersInGroup(grpNameQBShowBricks)) if (spawner) spawner->Spawn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -366,18 +366,19 @@ void GameMessages::SendResetMissions(Entity* entity, const SystemAddress& sysAdd
|
|||||||
|
|
||||||
void GameMessages::SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint,
|
void GameMessages::SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint,
|
||||||
int iIndex, int iDesiredWaypointIndex, int nextIndex,
|
int iIndex, int iDesiredWaypointIndex, int nextIndex,
|
||||||
eMovementPlatformState movementState) {
|
eMovementPlatformState movementState, bool special) {
|
||||||
CBITSTREAM;
|
CBITSTREAM;
|
||||||
CMSGHEADER;
|
CMSGHEADER;
|
||||||
|
|
||||||
|
const auto objID = entity->GetObjectID();
|
||||||
const auto lot = entity->GetLOT();
|
const auto lot = entity->GetLOT();
|
||||||
|
|
||||||
if (lot == 12341 || lot == 5027 || lot == 5028 || lot == 14335 || lot == 14447 || lot == 14449 || lot == 11306 || lot == 11308) {
|
if (lot == 12341 || lot == 5027 || lot == 5028 || lot == 14335 || lot == 14447 || lot == 14449 || lot == 11306 || lot == 11308 || lot == 9483) {
|
||||||
iDesiredWaypointIndex = (lot == 11306 || lot == 11308) ? 1 : 0;
|
iDesiredWaypointIndex = (lot == 11306 || lot == 11308) ? 1 : 0;
|
||||||
iIndex = 0;
|
iIndex = lot == 9483 ? 1 : 0;
|
||||||
nextIndex = 0;
|
nextIndex = lot == 9483 && !special ? 1 : 0;
|
||||||
bStopAtDesiredWaypoint = true;
|
bStopAtDesiredWaypoint = true;
|
||||||
movementState = eMovementPlatformState::Stationary;
|
movementState = lot == 9483 && !special ? eMovementPlatformState::Stopped : eMovementPlatformState::Stationary;
|
||||||
}
|
}
|
||||||
|
|
||||||
bitStream.Write(entity->GetObjectID());
|
bitStream.Write(entity->GetObjectID());
|
||||||
@@ -6484,8 +6485,8 @@ namespace GameMessages {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TeamPickupItem::Serialize(RakNet::BitStream& stream) const {
|
void TeamPickupItem::Serialize(RakNet::BitStream& stream) const {
|
||||||
stream.Write(lootID);
|
stream.Write(lootID);
|
||||||
stream.Write(lootOwnerID);
|
stream.Write(lootOwnerID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToggleGMInvis::Serialize(RakNet::BitStream& stream) const {
|
void ToggleGMInvis::Serialize(RakNet::BitStream& stream) const {
|
||||||
|
|||||||
@@ -103,9 +103,11 @@ namespace GameMessages {
|
|||||||
void SendPlayNDAudioEmitter(Entity* entity, const SystemAddress& sysAddr, std::string audioGUID);
|
void SendPlayNDAudioEmitter(Entity* entity, const SystemAddress& sysAddr, std::string audioGUID);
|
||||||
|
|
||||||
void SendStartPathing(Entity* entity);
|
void SendStartPathing(Entity* entity);
|
||||||
|
|
||||||
|
// special is for the FV tree platform, feature is complete if we just do that so meh
|
||||||
void SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint = false,
|
void SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint = false,
|
||||||
int iIndex = 0, int iDesiredWaypointIndex = 1, int nextIndex = 1,
|
int iIndex = 0, int iDesiredWaypointIndex = 1, int nextIndex = 1,
|
||||||
eMovementPlatformState movementState = eMovementPlatformState::Moving);
|
eMovementPlatformState movementState = eMovementPlatformState::Moving, bool special = false);
|
||||||
|
|
||||||
void SendResetMissions(Entity* entity, const SystemAddress& sysAddr, const int32_t missionid = -1);
|
void SendResetMissions(Entity* entity, const SystemAddress& sysAddr, const int32_t missionid = -1);
|
||||||
void SendRestoreToPostLoadStats(Entity* entity, const SystemAddress& sysAddr);
|
void SendRestoreToPostLoadStats(Entity* entity, const SystemAddress& sysAddr);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB
|
|||||||
"EnemySkeletonSpawner.cpp"
|
"EnemySkeletonSpawner.cpp"
|
||||||
"FallingTile.cpp"
|
"FallingTile.cpp"
|
||||||
"FlameJetServer.cpp"
|
"FlameJetServer.cpp"
|
||||||
|
"LightningOrbServer.cpp"
|
||||||
"ImaginationShrineServer.cpp"
|
"ImaginationShrineServer.cpp"
|
||||||
"Lieutenant.cpp"
|
"Lieutenant.cpp"
|
||||||
"MonCoreNookDoors.cpp"
|
"MonCoreNookDoors.cpp"
|
||||||
|
|||||||
12
dScripts/02_server/Map/njhub/LightningOrbServer.cpp
Normal file
12
dScripts/02_server/Map/njhub/LightningOrbServer.cpp
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#include "LightningOrbServer.h"
|
||||||
|
|
||||||
|
void LightningOrbServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||||
|
GameMessages::GetPosition playerPos;
|
||||||
|
playerPos.Send(target->GetObjectID());
|
||||||
|
GameMessages::GetPosition selfPos;
|
||||||
|
selfPos.Send(self->GetObjectID());
|
||||||
|
const NiPoint3 newVec((playerPos.pos.x - selfPos.pos.x) * 2.5, 15, (playerPos.pos.z - selfPos.pos.z) * 2.5);
|
||||||
|
// ahhhh aron said to put a TODO here moving platforms don't work lol. disable this so people can actually do the puzzle
|
||||||
|
// GameMessages::SendKnockback(target->GetObjectID(), self->GetObjectID(), self->GetObjectID(), 0, newVec);
|
||||||
|
// GameMessages::SendPlayFXEffect(target->GetObjectID(), -1, u"knockback", "knockback");
|
||||||
|
}
|
||||||
8
dScripts/02_server/Map/njhub/LightningOrbServer.h
Normal file
8
dScripts/02_server/Map/njhub/LightningOrbServer.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "CppScripts.h"
|
||||||
|
|
||||||
|
class LightningOrbServer : public CppScripts::Script
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void OnCollisionPhantom(Entity* self, Entity* target) override;
|
||||||
|
};
|
||||||
@@ -274,6 +274,7 @@
|
|||||||
#include "MonCoreNookDoors.h"
|
#include "MonCoreNookDoors.h"
|
||||||
#include "MonCoreSmashableDoors.h"
|
#include "MonCoreSmashableDoors.h"
|
||||||
#include "FlameJetServer.h"
|
#include "FlameJetServer.h"
|
||||||
|
#include "LightningOrbServer.h"
|
||||||
#include "BurningTile.h"
|
#include "BurningTile.h"
|
||||||
#include "NjEarthDragonPetServer.h"
|
#include "NjEarthDragonPetServer.h"
|
||||||
#include "NjEarthPetServer.h"
|
#include "NjEarthPetServer.h"
|
||||||
@@ -628,6 +629,7 @@ namespace {
|
|||||||
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return new MonCoreSmashableDoors();}},
|
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return new MonCoreSmashableDoors();}},
|
||||||
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return new MonCoreSmashableDoors();}},
|
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return new MonCoreSmashableDoors();}},
|
||||||
{"scripts\\02_server\\Map\\njhub\\L_FLAME_JET_SERVER.lua", []() {return new FlameJetServer();}},
|
{"scripts\\02_server\\Map\\njhub\\L_FLAME_JET_SERVER.lua", []() {return new FlameJetServer();}},
|
||||||
|
{"scripts\\02_server\\Map\\njhub\\L_LIGHTNING_ORB_SERVER.lua", []() {return new LightningOrbServer();}},
|
||||||
{"scripts\\02_server\\Map\\njhub\\L_BURNING_TILE.lua", []() {return new BurningTile();}},
|
{"scripts\\02_server\\Map\\njhub\\L_BURNING_TILE.lua", []() {return new BurningTile();}},
|
||||||
{"scripts\\02_server\\Map\\njhub\\L_SPAWN_EARTH_PET_SERVER.lua", []() {return new NjEarthDragonPetServer();}},
|
{"scripts\\02_server\\Map\\njhub\\L_SPAWN_EARTH_PET_SERVER.lua", []() {return new NjEarthDragonPetServer();}},
|
||||||
{"scripts\\02_server\\Map\\njhub\\L_EARTH_PET_SERVER.lua", []() {return new NjEarthPetServer();}},
|
{"scripts\\02_server\\Map\\njhub\\L_EARTH_PET_SERVER.lua", []() {return new NjEarthPetServer();}},
|
||||||
|
|||||||
Reference in New Issue
Block a user