77 _log(NPC__TRACE,
"Created NPC object for %s (%u) - Data: O:%u, C:%u, A:%u, W:%u", \
107 if (
sConfig.debug.UseProfiling)
112 if (who ==
nullptr) {
202 std::string modeStr =
"Goto";
204 case 1: modeStr =
"Follow";
break;
205 case 2: modeStr =
"Stop";
break;
206 case 3: modeStr =
"Warp";
break;
207 case 4: modeStr =
"Orbit";
break;
208 case 5: modeStr =
"Missile";
break;
209 case 6: modeStr =
"Mushroom";
break;
210 case 7: modeStr =
"Boid";
break;
211 case 8: modeStr =
"Troll";
break;
212 case 9: modeStr =
"Miniball";
break;
213 case 10: modeStr =
"Field";
break;
214 case 11: modeStr =
"Rigid";
break;
215 case 12: modeStr =
"Formation";
break;
218 _log(SE__DESTINY,
"NPC::EncodeDestiny(): %s - id:%li, mode:%s, flags:0x%X, Vel:%.1f, %.1f, %.1f", \
321 if (pClient ==
nullptr) {
322 sLog.Error(
"NPC::Killed()",
"killer == IsDrone and pPlayer == nullptr");
327 killerID = killer->
GetID();
335 if (pClient !=
nullptr) {
343 if (wreckPosition.
isNaN()) {
344 sLog.Error(
"NPC::Killed()",
"Wreck Position is NaN");
355 wreck_name +=
" Wreck";
358 if (wreckItemRef.get() ==
nullptr) {
359 sLog.Error(
"NPC::Killed()",
"Creating Wreck Item Failed for %s of type %u", wreck_name.c_str(), wreckTypeID);
364 _log(PHYSICS__TRACE,
"NPC::Killed() - NPC %s(%u) Position: %.2f,%.2f,%.2f. Wreck %s(%u) Position: %.2f,%.2f,%.2f.", \
365 GetName(),
GetID(),
x(),
y(),
z(), wreckItemRef->name(), wreckItemRef->itemID(), wreckPosition.
x, wreckPosition.
y, wreckPosition.
z);
373 wreckEntity.
itemID = wreckItemRef->itemID();
375 wreckEntity.
ownerID = killerID;
376 wreckEntity.
typeID = wreckTypeID;
377 wreckEntity.
position = wreckPosition;
380 sLog.Error(
"NPC::Killed()",
"Spawning Wreck Failed for typeID %u", wreckTypeID);
381 wreckItemRef->Delete();
void Append(const T &value)
Appends a single value to buffer.
#define sConfig
A macro for easier access to the singleton.
virtual void EncodeDestiny(Buffer &into)
double GetFollowDistance()
#define _log(type, fmt,...)
#define IsWreckTypeID(typeID)
DestinyManager * m_destiny
bool HasAttribute(const uint16 attrID) const
virtual void TargetLost(SystemEntity *who)
void SendJettisonPacket() const
void Orbit(SystemEntity *who)
double MakeRandomFloat(double low, double high)
Generates random real from interval [low; high].
GaExpInl bool isNaN() const
static void AddKill(uint32 sysID)
virtual Client * GetPilot()
const GVector & GetVelocity() const
int32 GetCharacterID() const
static void AddFactionKill(uint32 sysID)
const float GetSystemSecurityRating()
void SpawnKilled(SystemBubble *pBubble, uint32 itemID)
CharacterRef GetChar() const
bool BuildDynamicEntity(const DBSystemDynamicEntity &entity, uint32 launcherID=0)
virtual void MissileLaunched(Missile *pMissile)
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
const ItemType & type() const
#define is_log_enabled(type)
#define sLog
Evaluates to a NewLog instance.
Generic class for buffers.
InventoryItemRef GetSelf()
NPC(InventoryItemRef self, PyServiceMgr &services, SystemManager *system, const FactionData &data, SpawnMgr *spawnMgr=nullptr)
void SetAttribute(uint16 attrID, int num, bool notify=true)
const char * GetName() const
void MissileLaunched(Missile *pMissile)
void TargetLost(SystemEntity *pSE)
void AwardBounty(Client *pClient)
void DisableRepTimers(bool shield=true, bool armor=true)
uint32 GetCorporationID()
virtual void TargetedAdd(SystemEntity *who)
const std::string & itemName() const
void UpdateShipVariables()
int main(int argc, char *argv[])
void DropLoot(WreckContainerRef wreckRef, uint32 groupID, uint32 owner)
EvilNumber GetAttribute(const uint16 attrID) const
virtual void UpdateDamage()
void AwardSecurityStatus(InventoryItemRef iRef, Character *pChar)
const GPoint & GetPosition() const
#define IsAlliance(itemID)
virtual void Killed(Damage &fatal_blow)
void Targeted(SystemEntity *pSE)
const char * itoa(int64 num)
Convers num to string.