mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-20 19:52:48 +00:00
feat(scripts): the Assembly Engineer turret works as TURRET.lua
The turret (LOT 9303-9305, 12618) had no script: it fought as soon as it was spawned and lasted the generic 60 seconds. As TURRET.lua: its combat AI is off until it is built, it can't be stunned, interrupted, knocked back or pulled, and it dies 30 seconds after it was placed once nobody is building it. Kill credit going to the builder is not done. Check: summon the turret with Engineer gear: it doesn't shoot until built, then fights and goes away after about 30 seconds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
15
dScripts/EquipmentScripts/Turret.h
Normal file
15
dScripts/EquipmentScripts/Turret.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
// TURRET.lua: the Assembly Engineer turret. Its combat AI is off until it is built; it can't be stunned, interrupted,
|
||||
// knocked back or pulled; it dies 30 seconds after it was placed, once nobody is building it.
|
||||
class Turret : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnQuickBuildStart(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
private:
|
||||
static void SetCombatAI(Entity* self, bool enabled);
|
||||
static constexpr int32_t KILL_TIME = 30;
|
||||
};
|
||||
Reference in New Issue
Block a user