54 m_destiny(who->DestinyMgr()),
55 m_self(who->GetSelf()),
60 m_shieldBoosterTimer(0),
61 m_armorRepairTimer(0),
63 m_warpScramblerTimer(0),
126 }
else if (radius < 60) {
128 }
else if (radius < 150) {
130 }
else if (radius < 280) {
132 }
else if (radius < 550) {
294 std::vector<Client*> clientVec;
298 for (
auto cur : clientVec) {
301 if (cur->GetShipSE() ==
nullptr)
311 pDestiny = cur->GetShipSE()->DestinyMgr();
312 if (pDestiny ==
nullptr)
339 if (pSE ==
nullptr) {
414 _log(NPC__AI_TRACE,
"%s(%u): Wandering: No Targets within my sight range of %um", \
429 if (pSE ==
nullptr) {
438 _log(NPC__AI_TRACE,
"%s(%u): Just for shits-n-giggles, I\'m gonna orbit %s(%u) at %um.", \
453 _log(NPC__AI_TRACE,
"%s(%u): Idle: returning to idle.", \
484 _log(NPC__AI_TRACE,
"%s(%u): Begin chasing. Target is %s(%u).", \
498 _log(NPC__AI_TRACE,
"%s(%u): Begin following. Target is %s(%u).", \
512 _log(NPC__AI_TRACE,
"%s(%u): Begin engaging. Target is %s(%u).", \
527 _log(NPC__AI_TRACE,
"%s(%u): Begin fleeing. Target is %s(%u).", \
543 _log(NPC__AI_TRACE,
"%s(%u): Begin signaling. Target is %s(%u).", \
560 _log(NPC__AI_TRACE,
"%s(%u): CheckDistance: %s(%u) is too far away (%u). Return to Idle.", \
581 _log(NPC__AI_TRACE,
"%s(%u): CheckDistance: target: %s(%u), state: %s, dist: %.0f, flyRange: %u, boostRange: %u.", \
595 _log(NPC__AI_TRACE,
"%s(%u): Targeting of %s(%u) failed. Begin Chasing.", \
599 _log(NPC__AI_TRACE,
"%s(%u): Targeting of %s(%u) failed. Clear Target and Return to Idle.", \
620 _log(NPC__AI_TRACE,
"%s(%u): Targeted by %s(%u) while %s.", \
625 _log(NPC__AI_TRACE,
"%s(%u): Begin Approaching and start Targeting sequence.", \
632 _log(NPC__AI_TRACE,
"%s(%u): Targeting of %s(%u) failed. Begin Chasing.", \
636 _log(NPC__AI_TRACE,
"%s(%u): Targeting of %s(%u) failed. Clear Target and Return to Idle.", \
676 _log(NPC__AI_TRACE,
"%s(%u): Target %s(%u) lost. No targets remain. Return to Idle.", \
680 _log(NPC__AI_TRACE,
"%s(%u): Target %s(%u) lost, but more targets remain.", \
698 _log(NPC__AI_TRACE,
"%s(%u): Target %s(%u) no longer in bubble. Clear target and move on",
705 _log(NPC__AI_TRACE,
"%s(%u): Target %s(%u) has no destiny manager. Clear target and move on",
713 _log(NPC__AI_TRACE,
"%s(%u): Target %s(%u) is cloaked. Clear target and move on",
741 std::string guid =
"effects.Laser";
746 pSE->
GetID(),0,guid,1,1,
759 if (
sConfig.npc.UseDamageMultiplier)
786 if (missileRef.get() ==
nullptr)
804 if (pMissile ==
nullptr)
807 double missileSpeed = missileRef->GetAttribute(
AttrMaxVelocity).get_float();
808 double travelTime = (distance/missileSpeed);
823 if (
sConfig.npc.DefenderMissileChance)
824 chance =
sConfig.npc.DefenderMissileChance;
834 if (targetTime < 1) {
837 }
else if (radius < 60) {
839 }
else if (radius < 150) {
841 }
else if (radius < 280) {
843 }
else if (radius < 550) {
871 default:
return "Invalid";
#define sConfig
A macro for easier access to the singleton.
void Target(SystemEntity *pSE)
double m_damageMultiplier
SystemEntity * GetSE(uint32 entityID) const
#define _log(type, fmt,...)
uint16 m_launcherCycleTime
void ClearTarget(SystemEntity *tSE)
bool HasAttribute(const uint16 attrID) const
void MakeMissile(Missile *missile)
SystemBubble * SysBubble()
bool InBubble(const GPoint &pt, bool inWarp=false) const
double MakeRandomFloat(double low, double high)
Generates random real from interval [low; high].
void SetHitTimer(uint32 setTime)
bool IsChaining(uint16 bubbleID)
Timer m_shieldBoosterTimer
void SetMaxVelocity(float maxVelocity)
const float GetSystemSecurityRating()
void Attack(SystemEntity *pSE)
TargetManager * TargetMgr()
const GPoint & GetPosition() const
void CheckDistance(SystemEntity *pSE)
SystemEntity * GetRandomEntity()
void SetEngaged(SystemEntity *pSE)
void SetFollowing(SystemEntity *pSE)
void MoveSpawn(NPC *pNPC, SystemBubble *pBubble)
void SendSpecialEffect(uint32 entityID, uint32 moduleID, uint32 moduleTypeID, uint32 targetID, uint32 chargeTypeID, std::string guid, bool isOffensive, bool start, bool isActive, int32 duration, uint32 repeat, int32 graphicInfo=0) const
DestinyManager * m_destiny
uint16 m_armorRepairDuration
SystemEntity * GetFirstTarget(bool need_locked=false)
DestinyManager * DestinyMgr()
SystemManager * SystemMgr()
void SetChasing(SystemEntity *pSE)
bool Check(bool reset=true)
uint16 m_shieldBoosterDuration
void SetSpeed(double speed)
const char * GetName() const
uint16 m_preferedSigRadius
float m_armorRepairDelayChance
PyServiceMgr * GetServiceMgr()
void MissileLaunched(Missile *pMissile)
void Follow(SystemEntity *pSE, uint32 distance)
void TargetLost(SystemEntity *pSE)
void GotoPoint(const GPoint &point)
void DisableRepTimers(bool shield=true, bool armor=true)
Timer m_warpScramblerTimer
void WarpTo(const GPoint &where, int32 distance=0, bool autoPilot=false, SystemEntity *pSE=nullptr)
int64 MakeRandomInt(int64 low, int64 high)
Generates random integer from interval [low; high].
bool HasNoTargets() const
void Orbit(SystemEntity *pSE, uint32 distance=0)
EvilNumber GetAttribute(const uint16 attrID) const
void LaunchMissile(uint16 typeID, SystemEntity *pSE)
std::string GetStateName(int8 stateID)
void AttackTarget(SystemEntity *pSE)
void SetSignaling(SystemEntity *pSE)
GaExpInl GaFloat distance(const GaVec3 &oth) const
virtual void MissileLaunched(Missile *pMissile)
void Targeted(SystemEntity *pSE)
bool ApplyDamage(Damage &d)
bool IsTargetedBy(SystemEntity *pSE)
void ClearTarget(SystemEntity *pSE)
void SetFleeing(SystemEntity *pSE)
bool StartTargeting(SystemEntity *tSE, ShipItemRef sRef)
void GetPlayers(std::vector< Client * > &into) const
float m_shieldBoosterDelayChance
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)