mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
feat: add missing force field, jetpack NPC and Skullkin volume scripts
Ported from the live server scripts that ship with the client: - scripts\ai\LS\ForceFieldEffect.lua (LEGO Club and Starbase 3001 force fields): plays effect 3671 "cast" on whatever touches the phantom. - scripts\ai\NP\L_NPC_NP_JETPACK_GUY.lua (jetpack ambient NPCs): plays the object's "launch" effect when used. - scripts\02_server\Map\AM\L_SKELETON_SPAWNER_VOLUME.lua (Crux Prime Skullkin area): with 10 or more players in the volume the Skullkin engineer, miner and patroller networks maintain 2/6/6 instead of 1/4/4, with a 60 second cooldown between changes and a catch-up check when it ends. Only players are counted, and the count never goes below zero. WBL_Enemy_Grabbler.lua only sets wander variables for the old Lua movement AI, so it joins the other alpha wander scripts in the excluded list instead of logging as missing. Refs #746 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
set(DSCRIPTS_SOURCES_AI_GENERAL
|
||||
"ForceFieldEffect.cpp"
|
||||
"InstanceExitTransferPlayerToLastNonInstance.cpp"
|
||||
"LegoDieRoll.cpp")
|
||||
|
||||
|
||||
10
dScripts/ai/GENERAL/ForceFieldEffect.cpp
Normal file
10
dScripts/ai/GENERAL/ForceFieldEffect.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "ForceFieldEffect.h"
|
||||
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
|
||||
void ForceFieldEffect::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
if (!target) return;
|
||||
|
||||
GameMessages::SendPlayFXEffect(target, 3671, u"cast", "", LWOOBJID_EMPTY);
|
||||
}
|
||||
8
dScripts/ai/GENERAL/ForceFieldEffect.h
Normal file
8
dScripts/ai/GENERAL/ForceFieldEffect.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
// Plays a sparkle effect on anything that touches this phantom physics object.
|
||||
class ForceFieldEffect : public CppScripts::Script {
|
||||
public:
|
||||
void OnCollisionPhantom(Entity* self, Entity* target) override;
|
||||
};
|
||||
@@ -1,4 +1,5 @@
|
||||
set(DSCRIPTS_SOURCES_AI_NP
|
||||
"NpcNpJetpackGuy.cpp"
|
||||
"NpcNpSpacemanBob.cpp")
|
||||
|
||||
add_library(dScriptsAiNP OBJECT ${DSCRIPTS_SOURCES_AI_NP})
|
||||
|
||||
9
dScripts/ai/NP/NpcNpJetpackGuy.cpp
Normal file
9
dScripts/ai/NP/NpcNpJetpackGuy.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "NpcNpJetpackGuy.h"
|
||||
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
|
||||
void NpcNpJetpackGuy::OnUse(Entity* self, Entity* user) {
|
||||
// No effect ID, the client plays the object's own effect of this type.
|
||||
GameMessages::SendPlayFXEffect(self, -1, u"launch", "", LWOOBJID_EMPTY);
|
||||
}
|
||||
8
dScripts/ai/NP/NpcNpJetpackGuy.h
Normal file
8
dScripts/ai/NP/NpcNpJetpackGuy.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
// Plays the launch effect when a player talks to the jetpack NPC.
|
||||
class NpcNpJetpackGuy : public CppScripts::Script {
|
||||
public:
|
||||
void OnUse(Entity* self, Entity* user) override;
|
||||
};
|
||||
Reference in New Issue
Block a user