mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 19:03:43 +00:00
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>
16 lines
658 B
C++
16 lines
658 B
C++
#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;
|
|
};
|