TrinityCore
Corpse Class Referencefinal

#include <Corpse.h>

Classes

struct  ValuesUpdateForPlayerWithMaskSender
 

Public Member Functions

 Corpse (CorpseType type=CORPSE_BONES)
 
 ~Corpse ()
 
void BuildValuesUpdateForPlayerWithMask (UpdateData *data, UF::ObjectData::Mask const &requestedObjectMask, UF::CorpseData::Mask const &requestedCorpseMask, Player const *target) const
 
void AddToWorld () override
 
void RemoveFromWorld () override
 
bool Create (ObjectGuid::LowType guidlow, Map *map)
 
bool Create (ObjectGuid::LowType guidlow, Player *owner)
 
void Update (uint32 diff) override
 
void SaveToDB ()
 
bool LoadCorpseFromDB (ObjectGuid::LowType guid, Field *fields)
 
void DeleteFromDB (CharacterDatabaseTransaction trans)
 
CorpseDynFlags GetCorpseDynamicFlags () const
 
void SetCorpseDynamicFlag (CorpseDynFlags dynamicFlags)
 
void RemoveCorpseDynamicFlag (CorpseDynFlags dynamicFlags)
 
void ReplaceAllCorpseDynamicFlags (CorpseDynFlags dynamicFlags)
 
ObjectGuid GetCreatorGUID () const override
 
ObjectGuid GetOwnerGUID () const override
 
void SetOwnerGUID (ObjectGuid owner)
 
void SetPartyGUID (ObjectGuid partyGuid)
 
void SetGuildGUID (ObjectGuid guildGuid)
 
void SetDisplayId (uint32 displayId)
 
void SetRace (uint8 race)
 
void SetClass (uint8 playerClass)
 
void SetSex (uint8 sex)
 
void ReplaceAllFlags (uint32 flags)
 
void SetFactionTemplate (int32 factionTemplate)
 
uint32 GetFaction () const override
 
void SetFaction (uint32 faction) override
 
void SetItem (uint32 slot, uint32 item)
 
template<typename Iter >
void SetCustomizations (Trinity::IteratorPair< Iter > customizations)
 
time_t const & GetGhostTime () const
 
void ResetGhostTime ()
 
CorpseType GetType () const
 
CellCoord const & GetCellCoord () const
 
void SetCellCoord (CellCoord const &cellCoord)
 
LootGetLootForPlayer (Player const *) const override
 
bool IsExpired (time_t t) const
 
- Public Member Functions inherited from WorldObject
virtual ~WorldObject ()
 
virtual void Update (uint32 diff)
 
void AddToWorld () override
 
void RemoveFromWorld () override
 
void GetNearPoint2D (WorldObject const *searcher, float &x, float &y, float distance, float absAngle) const
 
void GetNearPoint (WorldObject const *searcher, float &x, float &y, float &z, float distance2d, float absAngle) const
 
void GetClosePoint (float &x, float &y, float &z, float size, float distance2d=0, float relAngle=0) const
 
void MovePosition (Position &pos, float dist, float angle)
 
Position GetNearPosition (float dist, float angle)
 
void MovePositionToFirstCollision (Position &pos, float dist, float angle)
 
Position GetFirstCollisionPosition (float dist, float angle)
 
Position GetRandomNearPosition (float radius)
 
void GetContactPoint (WorldObject const *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
 
virtual float GetCombatReach () const
 
void UpdateGroundPositionZ (float x, float y, float &z) const
 
void UpdateAllowedPositionZ (float x, float y, float &z, float *groundZ=nullptr) const
 
void GetRandomPoint (Position const &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const
 
Position GetRandomPoint (Position const &srcPos, float distance) const
 
uint32 GetInstanceId () const
 
PhaseShiftGetPhaseShift ()
 
PhaseShift const & GetPhaseShift () const
 
PhaseShiftGetSuppressedPhaseShift ()
 
PhaseShift const & GetSuppressedPhaseShift () const
 
bool InSamePhase (PhaseShift const &phaseShift) const
 
bool InSamePhase (WorldObject const *obj) const
 
int32 GetDBPhase () const
 
void SetDBPhase (int32 p)
 
uint32 GetZoneId () const
 
uint32 GetAreaId () const
 
void GetZoneAndAreaId (uint32 &zoneid, uint32 &areaid) const
 
bool IsInWorldPvpZone () const
 
bool IsOutdoors () const
 
ZLiquidStatus GetLiquidStatus () const
 
InstanceScriptGetInstanceScript () const
 
std::string const & GetName () const
 
void SetName (std::string newname)
 
std::string GetNameForLocaleIdx (LocaleConstant) const override
 
float GetDistance (WorldObject const *obj) const
 
float GetDistance (Position const &pos) const
 
float GetDistance (float x, float y, float z) const
 
float GetDistance2d (WorldObject const *obj) const
 
float GetDistance2d (float x, float y) const
 
float GetDistanceZ (WorldObject const *obj) const
 
bool IsSelfOrInSameMap (WorldObject const *obj) const
 
bool IsInMap (WorldObject const *obj) const
 
bool IsWithinDist3d (float x, float y, float z, float dist) const
 
bool IsWithinDist3d (Position const *pos, float dist) const
 
bool IsWithinDist2d (float x, float y, float dist) const
 
bool IsWithinDist2d (Position const *pos, float dist) const
 
bool IsWithinDist (WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
 
bool IsWithinDistInMap (WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
 
bool IsWithinLOS (float x, float y, float z, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
 
bool IsWithinLOSInMap (WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
 
Position GetHitSpherePointFor (Position const &dest) const
 
void GetHitSpherePointFor (Position const &dest, float &x, float &y, float &z) const
 
bool GetDistanceOrder (WorldObject const *obj1, WorldObject const *obj2, bool is3D=true) const
 
bool IsInRange (WorldObject const *obj, float minRange, float maxRange, bool is3D=true) const
 
bool IsInRange2d (float x, float y, float minRange, float maxRange) const
 
bool IsInRange3d (float x, float y, float z, float minRange, float maxRange) const
 
bool isInFront (WorldObject const *target, float arc=float(M_PI)) const
 
bool isInBack (WorldObject const *target, float arc=float(M_PI)) const
 
bool IsInBetween (Position const &pos1, Position const &pos2, float size=0) const
 
bool IsInBetween (WorldObject const *obj1, WorldObject const *obj2, float size=0) const
 
virtual void CleanupsBeforeDelete (bool finalCleanup=true)
 
virtual void SendMessageToSet (WorldPacket const *data, bool self) const
 
virtual void SendMessageToSetInRange (WorldPacket const *data, float dist, bool self) const
 
virtual void SendMessageToSet (WorldPacket const *data, Player const *skipped_rcvr) const
 
void SendCombatLogMessage (WorldPackets::CombatLog::CombatLogServerPacket *combatLog) const
 
virtual uint8 GetLevelForTarget (WorldObject const *) const
 
void PlayDistanceSound (uint32 soundId, Player *target=nullptr)
 
void PlayDirectSound (uint32 soundId, Player *target=nullptr, uint32 broadcastTextId=0)
 
void PlayDirectMusic (uint32 musicId, Player *target=nullptr)
 
void PlayObjectSound (int32 soundKitId, ObjectGuid targetObject, Player *target=nullptr, int32 broadcastTextId=0)
 
void AddObjectToRemoveList ()
 
float GetGridActivationRange () const
 
float GetVisibilityRange () const
 
float GetSightRange (WorldObject const *target=nullptr) const
 
bool CanSeeOrDetect (WorldObject const *obj, bool implicitDetect=false, bool distanceCheck=false, bool checkAlert=false) const
 
virtual void SetMap (Map *map)
 
virtual void ResetMap ()
 
MapGetMap () const
 
MapFindMap () const
 
void SetZoneScript ()
 
ZoneScriptFindZoneScript () const
 
ZoneScriptGetZoneScript () const
 
ScenarioGetScenario () const
 
TempSummonSummonCreature (uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
 
TempSummonSummonCreature (uint32 entry, float x, float y, float z, float o=0, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
 
TempSummonSummonPersonalClone (Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, Player *privateObjectOwner=nullptr)
 
GameObjectSummonGameObject (uint32 entry, Position const &pos, QuaternionData const &rot, Seconds respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
 
GameObjectSummonGameObject (uint32 entry, float x, float y, float z, float ang, QuaternionData const &rot, Seconds respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
 
CreatureSummonTrigger (float x, float y, float z, float ang, Milliseconds despawnTime, CreatureAI *(*GetAI)(Creature *)=nullptr)
 
void SummonCreatureGroup (uint8 group, std::list< TempSummon * > *list=nullptr)
 
CreatureFindNearestCreature (uint32 entry, float range, bool alive=true) const
 
CreatureFindNearestCreatureWithOptions (float range, FindCreatureOptions const &options) const
 
GameObjectFindNearestGameObject (uint32 entry, float range, bool spawnedOnly=true) const
 
GameObjectFindNearestGameObjectWithOptions (float range, FindGameObjectOptions const &options) const
 
GameObjectFindNearestUnspawnedGameObject (uint32 entry, float range) const
 
GameObjectFindNearestGameObjectOfType (GameobjectTypes type, float range) const
 
PlayerSelectNearestPlayer (float range) const
 
virtual ObjectGuid GetCreatorGUID () const =0
 
virtual ObjectGuid GetOwnerGUID () const =0
 
virtual ObjectGuid GetCharmerOrOwnerGUID () const
 
ObjectGuid GetCharmerOrOwnerOrOwnGUID () const
 
UnitGetOwner () const
 
UnitGetCharmerOrOwner () const
 
UnitGetCharmerOrOwnerOrSelf () const
 
PlayerGetCharmerOrOwnerPlayerOrPlayerItself () const
 
PlayerGetAffectingPlayer () const
 
PlayerGetSpellModOwner () const
 
int32 CalculateSpellDamage (Unit const *target, SpellEffectInfo const &spellEffectInfo, int32 const *basePoints=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
 
float GetSpellMaxRangeForTarget (Unit const *target, SpellInfo const *spellInfo) const
 
float GetSpellMinRangeForTarget (Unit const *target, SpellInfo const *spellInfo) const
 
double ApplyEffectModifiers (SpellInfo const *spellInfo, uint8 effIndex, double value) const
 
int32 CalcSpellDuration (SpellInfo const *spellInfo, std::vector< SpellPowerCost > const *powerCosts) const
 
int32 ModSpellDuration (SpellInfo const *spellInfo, WorldObject const *target, int32 duration, bool positive, uint32 effectMask) const
 
void ModSpellCastTime (SpellInfo const *spellInfo, int32 &castTime, Spell *spell=nullptr) const
 
void ModSpellDurationTime (SpellInfo const *spellInfo, int32 &durationTime, Spell *spell=nullptr) const
 
virtual float MeleeSpellMissChance (Unit const *victim, WeaponAttackType attType, SpellInfo const *spellInfo) const
 
virtual SpellMissInfo MeleeSpellHitResult (Unit *victim, SpellInfo const *spellInfo) const
 
SpellMissInfo MagicSpellHitResult (Unit *victim, SpellInfo const *spellInfo) const
 
SpellMissInfo SpellHitResult (Unit *victim, SpellInfo const *spellInfo, bool canReflect=false) const
 
void SendSpellMiss (Unit *target, uint32 spellID, SpellMissInfo missInfo)
 
virtual uint32 GetFaction () const =0
 
virtual void SetFaction (uint32)
 
FactionTemplateEntry const * GetFactionTemplateEntry () const
 
ReputationRank GetReactionTo (WorldObject const *target) const
 
bool IsHostileTo (WorldObject const *target) const
 
bool IsHostileToPlayers () const
 
bool IsFriendlyTo (WorldObject const *target) const
 
bool IsNeutralToAll () const
 
SpellCastResult CastSpell (CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
 
void SendPlayOrphanSpellVisual (ObjectGuid const &target, uint32 spellVisualId, float travelSpeed, bool speedAsTime=false, bool withSourceOrientation=false)
 
void SendPlayOrphanSpellVisual (Position const &targetLocation, uint32 spellVisualId, float travelSpeed, bool speedAsTime=false, bool withSourceOrientation=false)
 
void SendCancelOrphanSpellVisual (uint32 id)
 
bool IsValidAttackTarget (WorldObject const *target, SpellInfo const *bySpell=nullptr) const
 
bool IsValidAssistTarget (WorldObject const *target, SpellInfo const *bySpell=nullptr) const
 
UnitGetMagicHitRedirectTarget (Unit *victim, SpellInfo const *spellInfo)
 
virtual uint32 GetCastSpellXSpellVisualId (SpellInfo const *spellInfo) const
 
template<typename Container >
void GetGameObjectListWithEntryInGrid (Container &gameObjectContainer, uint32 entry, float maxSearchRange=250.0f) const
 
template<typename Container >
void GetGameObjectListWithOptionsInGrid (Container &gameObjectContainer, float maxSearchRange, FindGameObjectOptions const &options) const
 
template<typename Container >
void GetCreatureListWithEntryInGrid (Container &creatureContainer, uint32 entry, float maxSearchRange=250.0f) const
 
template<typename Container >
void GetCreatureListWithOptionsInGrid (Container &creatureContainer, float maxSearchRange, FindCreatureOptions const &options) const
 
template<typename Container >
void GetPlayerListInGrid (Container &playerContainer, float maxSearchRange, bool alive=true) const
 
void DestroyForNearbyPlayers ()
 
virtual void UpdateObjectVisibility (bool forced=true)
 
virtual void UpdateObjectVisibilityOnCreate ()
 
virtual void UpdateObjectVisibilityOnDestroy ()
 
void UpdatePositionData ()
 
void BuildUpdate (UpdateDataMapType &) override
 
bool AddToObjectUpdate () override
 
void RemoveFromObjectUpdate () override
 
void AddToNotify (uint16 f)
 
bool isNeedNotify (uint16 f) const
 
uint16 GetNotifyFlags () const
 
void ResetAllNotifies ()
 
bool isActiveObject () const
 
void setActive (bool isActiveObject)
 
bool IsFarVisible () const
 
void SetFarVisible (bool on)
 
bool IsVisibilityOverridden () const
 
void SetVisibilityDistanceOverride (VisibilityDistanceType type)
 
void SetWorldObject (bool apply)
 
bool IsPermanentWorldObject () const
 
bool IsWorldObject () const
 
TransportBaseGetTransport () const
 
float GetTransOffsetX () const
 
float GetTransOffsetY () const
 
float GetTransOffsetZ () const
 
float GetTransOffsetO () const
 
Position const & GetTransOffset () const
 
uint32 GetTransTime () const
 
int8 GetTransSeat () const
 
virtual ObjectGuid GetTransGUID () const
 
void SetTransport (TransportBase *t)
 
virtual float GetStationaryX () const
 
virtual float GetStationaryY () const
 
virtual float GetStationaryZ () const
 
virtual float GetStationaryO () const
 
float GetFloorZ () const
 
virtual float GetCollisionHeight () const
 
float GetMapWaterOrGroundLevel (float x, float y, float z, float *ground=nullptr) const
 
float GetMapHeight (float x, float y, float z, bool vmap=true, float distanceToSearch=50.0f) const
 
std::string GetDebugInfo () const override
 
virtual uint16 GetAIAnimKitId () const
 
virtual uint16 GetMovementAnimKitId () const
 
virtual uint16 GetMeleeAnimKitId () const
 
bool IsPrivateObject () const
 
ObjectGuid GetPrivateObjectOwner () const
 
void SetPrivateObjectOwner (ObjectGuid const &owner)
 
bool CheckPrivateObjectOwnerVisibility (WorldObject const *seer) const
 
SmoothPhasingGetOrCreateSmoothPhasing ()
 
SmoothPhasingGetSmoothPhasing ()
 
SmoothPhasing const * GetSmoothPhasing () const
 
- Public Member Functions inherited from Object
virtual ~Object ()
 
bool IsInWorld () const
 
virtual void AddToWorld ()
 
virtual void RemoveFromWorld ()
 
ObjectGuid const & GetGUID () const
 
uint32 GetEntry () const
 
void SetEntry (uint32 entry)
 
float GetObjectScale () const
 
virtual void SetObjectScale (float scale)
 
uint32 GetDynamicFlags () const
 
bool HasDynamicFlag (uint32 flag) const
 
void SetDynamicFlag (uint32 flag)
 
void RemoveDynamicFlag (uint32 flag)
 
void ReplaceAllDynamicFlags (uint32 flag)
 
TypeID GetTypeId () const
 
bool isType (uint16 mask) const
 
virtual void BuildCreateUpdateBlockForPlayer (UpdateData *data, Player *target) const
 
void SendUpdateToPlayer (Player *player)
 
void BuildValuesUpdateBlockForPlayer (UpdateData *data, Player const *target) const
 
void BuildValuesUpdateBlockForPlayerWithFlag (UpdateData *data, UF::UpdateFieldFlag flags, Player const *target) const
 
void BuildDestroyUpdateBlock (UpdateData *data) const
 
void BuildOutOfRangeUpdateBlock (UpdateData *data) const
 
ByteBufferPrepareValuesUpdateBuffer (UpdateData *data) const
 
virtual void DestroyForPlayer (Player *target) const
 
void SendOutOfRangeForPlayer (Player *target) const
 
virtual void ClearUpdateMask (bool remove)
 
virtual std::string GetNameForLocaleIdx (LocaleConstant locale) const =0
 
virtual bool hasQuest (uint32) const
 
virtual bool hasInvolvedQuest (uint32) const
 
void SetIsNewObject (bool enable)
 
bool IsDestroyedObject () const
 
void SetDestroyedObject (bool destroyed)
 
virtual void BuildUpdate (UpdateDataMapType &)
 
void BuildFieldsUpdate (Player *, UpdateDataMapType &) const
 
bool IsPlayer () const
 
PlayerToPlayer ()
 
Player const * ToPlayer () const
 
bool IsCreature () const
 
CreatureToCreature ()
 
Creature const * ToCreature () const
 
bool IsUnit () const
 
UnitToUnit ()
 
Unit const * ToUnit () const
 
bool IsGameObject () const
 
GameObjectToGameObject ()
 
GameObject const * ToGameObject () const
 
bool IsCorpse () const
 
CorpseToCorpse ()
 
Corpse const * ToCorpse () const
 
bool IsDynObject () const
 
DynamicObjectToDynObject ()
 
DynamicObject const * ToDynObject () const
 
bool IsAreaTrigger () const
 
AreaTriggerToAreaTrigger ()
 
AreaTrigger const * ToAreaTrigger () const
 
bool IsSceneObject () const
 
SceneObjectToSceneObject ()
 
SceneObject const * ToSceneObject () const
 
bool IsConversation () const
 
ConversationToConversation ()
 
Conversation const * ToConversation () const
 
template<typename T >
void ForceUpdateFieldChange (UF::UpdateFieldSetter< T > const &)
 
virtual std::string GetDebugInfo () const
 
virtual LootGetLootForPlayer (Player const *player) const
 
virtual void BuildValuesUpdateWithFlag (ByteBuffer *data, UF::UpdateFieldFlag flags, Player const *target) const
 
- Public Member Functions inherited from WorldLocation
 WorldLocation (uint32 mapId=MAPID_INVALID, float x=0.f, float y=0.f, float z=0.f, float o=0.f)
 
 WorldLocation (uint32 mapId, Position const &position)
 
void WorldRelocate (WorldLocation const &loc)
 
void WorldRelocate (WorldLocation const *loc)
 
void WorldRelocate (uint32 mapId, Position const &pos)
 
void WorldRelocate (uint32 mapId=MAPID_INVALID, float x=0.f, float y=0.f, float z=0.f, float o=0.f)
 
WorldLocation GetWorldLocation () const
 
uint32 GetMapId () const
 
std::string GetDebugInfo () const
 
- Public Member Functions inherited from Position
 Position (float x=0, float y=0, float z=0, float o=0)
 
bool operator== (Position const &a) const
 
void Relocate (float x, float y)
 
void Relocate (float x, float y, float z)
 
void Relocate (float x, float y, float z, float o)
 
void Relocate (Position const &pos)
 
void Relocate (Position const *pos)
 
void RelocateOffset (Position const &offset)
 
void SetOrientation (float orientation)
 
float GetPositionX () const
 
float GetPositionY () const
 
float GetPositionZ () const
 
float GetOrientation () const
 
void GetPosition (float &x, float &y) const
 
void GetPosition (float &x, float &y, float &z) const
 
void GetPosition (float &x, float &y, float &z, float &o) const
 
Position GetPosition () const
 
Streamer< XY > PositionXYStream ()
 
ConstStreamer< XY > PositionXYStream () const
 
Streamer< XYZ > PositionXYZStream ()
 
ConstStreamer< XYZ > PositionXYZStream () const
 
Streamer< XYZO > PositionXYZOStream ()
 
ConstStreamer< XYZO > PositionXYZOStream () const
 
Streamer< PackedXYZ > PositionPackedXYZStream ()
 
ConstStreamer< PackedXYZ > PositionPackedXYZStream () const
 
bool IsPositionValid () const
 
float GetExactDist2dSq (const float x, const float y) const
 
float GetExactDist2dSq (Position const &pos) const
 
float GetExactDist2dSq (Position const *pos) const
 
float GetExactDist2d (const float x, const float y) const
 
float GetExactDist2d (Position const &pos) const
 
float GetExactDist2d (Position const *pos) const
 
float GetExactDistSq (float x, float y, float z) const
 
float GetExactDistSq (Position const &pos) const
 
float GetExactDistSq (Position const *pos) const
 
float GetExactDist (float x, float y, float z) const
 
float GetExactDist (Position const &pos) const
 
float GetExactDist (Position const *pos) const
 
void GetPositionOffsetTo (Position const &endPos, Position &retOffset) const
 
Position GetPositionWithOffset (Position const &offset) const
 
float GetAbsoluteAngle (float x, float y) const
 
float GetAbsoluteAngle (Position const &pos) const
 
float GetAbsoluteAngle (Position const *pos) const
 
float ToAbsoluteAngle (float relAngle) const
 
float ToRelativeAngle (float absAngle) const
 
float GetRelativeAngle (float x, float y) const
 
float GetRelativeAngle (Position const &pos) const
 
float GetRelativeAngle (Position const *pos) const
 
bool IsInDist2d (float x, float y, float dist) const
 
bool IsInDist2d (Position const *pos, float dist) const
 
bool IsInDist (float x, float y, float z, float dist) const
 
bool IsInDist (Position const &pos, float dist) const
 
bool IsInDist (Position const *pos, float dist) const
 
bool IsWithinBox (Position const &center, float xradius, float yradius, float zradius) const
 
bool IsWithinDoubleVerticalCylinder (Position const *center, float radius, float height) const
 
bool HasInArc (float arcangle, Position const *pos, float border=2.0f) const
 
bool HasInLine (Position const *pos, float objSize, float width) const
 
std::string ToString () const
 
- Public Member Functions inherited from GridObject< Corpse >
virtual ~GridObject ()
 
bool IsInGrid () const
 
void AddToGrid (GridRefManager< Corpse > &m)
 
void RemoveFromGrid ()
 

Static Public Member Functions

static void DeleteFromDB (ObjectGuid const &ownerGuid, CharacterDatabaseTransaction trans)
 
- Static Public Member Functions inherited from WorldObject
static bool InSamePhase (WorldObject const *a, WorldObject const *b)
 
static ReputationRank GetFactionReactionTo (FactionTemplateEntry const *factionTemplateEntry, WorldObject const *target)
 
- Static Public Member Functions inherited from Object
static ObjectGuid GetGUID (Object const *o)
 
static PlayerToPlayer (Object *o)
 
static Player const * ToPlayer (Object const *o)
 
static CreatureToCreature (Object *o)
 
static Creature const * ToCreature (Object const *o)
 
static UnitToUnit (Object *o)
 
static Unit const * ToUnit (Object const *o)
 
static GameObjectToGameObject (Object *o)
 
static GameObject const * ToGameObject (Object const *o)
 
static CorpseToCorpse (Object *o)
 
static Corpse const * ToCorpse (Object const *o)
 
static DynamicObjectToDynObject (Object *o)
 
static DynamicObject const * ToDynObject (Object const *o)
 
static AreaTriggerToAreaTrigger (Object *o)
 
static AreaTrigger const * ToAreaTrigger (Object const *o)
 
static SceneObjectToSceneObject (Object *o)
 
static SceneObject const * ToSceneObject (Object const *o)
 
static ConversationToConversation (Object *o)
 
static Conversation const * ToConversation (Object const *o)
 
- Static Public Member Functions inherited from Position
static float NormalizeOrientation (float o)
 

Public Attributes

std::unique_ptr< Lootm_loot
 
PlayerlootRecipient
 
UF::UpdateField< UF::CorpseData, 0, TYPEID_CORPSEm_corpseData
 
- Public Attributes inherited from WorldObject
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPESm_stealth
 
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPESm_stealthDetect
 
FlaggedValuesArray32< int32, uint64, InvisibilityType, TOTAL_INVISIBILITY_TYPESm_invisibility
 
FlaggedValuesArray32< int32, uint64, InvisibilityType, TOTAL_INVISIBILITY_TYPESm_invisibilityDetect
 
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPESm_serverSideVisibility
 
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPESm_serverSideVisibilityDetect
 
uint32 LastUsedScriptID
 
MovementInfo m_movementInfo
 
EventProcessor m_Events
 
- Public Attributes inherited from Object
UF::UpdateFieldHolder m_values
 
UF::UpdateField< UF::ObjectData, 0, TYPEID_OBJECTm_objectData
 
- Public Attributes inherited from WorldLocation
uint32 m_mapId
 
- Public Attributes inherited from Position
float m_positionX
 
float m_positionY
 
float m_positionZ
 

Protected Member Functions

void BuildValuesCreate (ByteBuffer *data, Player const *target) const override
 
void BuildValuesUpdate (ByteBuffer *data, Player const *target) const override
 
void ClearUpdateMask (bool remove) override
 
- Protected Member Functions inherited from WorldObject
 WorldObject (bool isWorldObject)
 
virtual void ProcessPositionDataChanged (PositionFullTerrainStatus const &data)
 
void SetLocationMapId (uint32 _mapId)
 
void SetLocationInstanceId (uint32 _instanceId)
 
virtual bool CanNeverSee (WorldObject const *obj) const
 
virtual bool CanAlwaysSee (WorldObject const *) const
 
virtual bool IsNeverVisibleFor (WorldObject const *seer, bool allowServersideObjects=false) const
 
virtual bool IsAlwaysVisibleFor (WorldObject const *seer) const
 
virtual bool IsInvisibleDueToDespawn (WorldObject const *seer) const
 
virtual bool IsAlwaysDetectableFor (WorldObject const *seer) const
 
- Protected Member Functions inherited from Object
 Object ()
 
void _Create (ObjectGuid const &guid)
 
template<typename T >
void SetUpdateFieldValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type value)
 
template<typename T >
void SetUpdateFieldFlagValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type flag)
 
template<typename T >
void RemoveUpdateFieldFlagValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type flag)
 
template<typename T >
UF::DynamicUpdateFieldSetter< T >::insert_result AddDynamicUpdateFieldValue (UF::DynamicUpdateFieldSetter< T > setter)
 
template<typename T >
UF::DynamicUpdateFieldSetter< T >::insert_result InsertDynamicUpdateFieldValue (UF::DynamicUpdateFieldSetter< T > setter, uint32 index)
 
template<typename T >
void RemoveDynamicUpdateFieldValue (UF::DynamicUpdateFieldSetter< T > setter, uint32 index)
 
template<typename T >
void ClearDynamicUpdateFieldValues (UF::DynamicUpdateFieldSetter< T > setter)
 
template<typename T >
void RemoveOptionalUpdateFieldValue (UF::OptionalUpdateFieldSetter< T > setter)
 
template<typename T >
void SetUpdateFieldStatValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type value)
 
template<typename T >
void ApplyModUpdateFieldValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type mod, bool apply)
 
template<typename T >
void ApplyPercentModUpdateFieldValue (UF::UpdateFieldSetter< T > setter, float percent, bool apply)
 
template<typename Action >
void DoWithSuppressingObjectUpdates (Action &&action)
 
void BuildMovementUpdate (ByteBuffer *data, CreateObjectBits flags, Player *target) const
 
virtual UF::UpdateFieldFlag GetUpdateFieldFlagsFor (Player const *target) const
 
virtual void BuildValuesCreate (ByteBuffer *data, Player const *target) const =0
 
virtual void BuildValuesUpdate (ByteBuffer *data, Player const *target) const =0
 
virtual bool AddToObjectUpdate ()=0
 
virtual void RemoveFromObjectUpdate ()=0
 
void AddToObjectUpdateIfNeeded ()
 

Private Attributes

CorpseType m_type
 
time_t m_time
 
CellCoord _cellCoord
 

Additional Inherited Members

- Protected Attributes inherited from WorldObject
std::string m_name
 
bool m_isActive
 
bool m_isFarVisible
 
Optional< float > m_visibilityDistanceOverride
 
bool const m_isWorldObject
 
ZoneScriptm_zoneScript
 
TransportBasem_transport
 
uint32 m_zoneId
 
uint32 m_areaId
 
float m_staticFloorZ
 
bool m_outdoors
 
ZLiquidStatus m_liquidStatus
 
- Protected Attributes inherited from Object
uint16 m_objectType
 
TypeID m_objectTypeId
 
CreateObjectBits m_updateFlag
 
bool m_objectUpdated
 

Detailed Description

Definition at line 52 of file Corpse.h.

Constructor & Destructor Documentation

◆ Corpse()

Corpse::Corpse ( CorpseType  type = CORPSE_BONES)
explicit

Definition at line 33 of file Corpse.cpp.

33 : WorldObject(type != CORPSE_BONES), m_type(type)
34{
37
39
41
42 lootRecipient = nullptr;
43}
@ CORPSE_BONES
Definition: Corpse.h:31
@ TYPEID_CORPSE
Definition: ObjectGuid.h:45
@ TYPEMASK_CORPSE
Definition: ObjectGuid.h:65
Player * lootRecipient
Definition: Corpse.h:134
CorpseType m_type
Definition: Corpse.h:141
time_t m_time
Definition: Corpse.h:142
uint16 m_objectType
Definition: Object.h:386
CreateObjectBits m_updateFlag
Definition: Object.h:389
TypeID m_objectTypeId
Definition: Object.h:388
WorldObject(bool isWorldObject)
Definition: Object.cpp:867
time_t GetGameTime()
Definition: GameTime.cpp:44
bool Stationary
Definition: Object.h:87
+ Here is the call graph for this function:

◆ ~Corpse()

Corpse::~Corpse ( )

Definition at line 45 of file Corpse.cpp.

45{ }

Member Function Documentation

◆ AddToWorld()

void Corpse::AddToWorld ( )
overridevirtual
  • Register the corpse for guid lookup

Reimplemented from Object.

Definition at line 47 of file Corpse.cpp.

48{
50 if (!IsInWorld())
52
54}
Definition: Corpse.h:53
MapStoredObjectTypesContainer & GetObjectsStore()
Definition: Map.h:418
ObjectGuid const & GetGUID() const
Definition: Object.h:159
bool IsInWorld() const
Definition: Object.h:153
virtual void AddToWorld()
Definition: Object.cpp:107
bool Insert(KEY_TYPE const &handle, SPECIFIC_TYPE *obj)
Map * GetMap() const
Definition: Object.h:604
+ Here is the call graph for this function:

◆ BuildValuesCreate()

void Corpse::BuildValuesCreate ( ByteBuffer data,
Player const *  target 
) const
overrideprotectedvirtual

Implements Object.

Definition at line 241 of file Corpse.cpp.

242{
244 std::size_t sizePos = data->wpos();
245 *data << uint32(0);
246 *data << uint8(flags);
247 m_objectData->WriteCreate(*data, flags, this, target);
248 m_corpseData->WriteCreate(*data, flags, this, target);
249 data->put<uint32>(sizePos, data->wpos() - sizePos - 4);
250}
uint8_t uint8
Definition: Define.h:145
uint32_t uint32
Definition: Define.h:143
uint16 flags
Definition: DisableMgr.cpp:49
size_t wpos() const
Definition: ByteBuffer.h:412
void put(std::size_t pos, T value)
Definition: ByteBuffer.h:220
UF::UpdateField< UF::CorpseData, 0, TYPEID_CORPSE > m_corpseData
Definition: Corpse.h:138
UF::UpdateField< UF::ObjectData, 0, TYPEID_OBJECT > m_objectData
Definition: Object.h:254
virtual UF::UpdateFieldFlag GetUpdateFieldFlagsFor(Player const *target) const
Definition: Object.cpp:763
UpdateFieldFlag
Definition: UpdateField.h:34
+ Here is the call graph for this function:

◆ BuildValuesUpdate()

void Corpse::BuildValuesUpdate ( ByteBuffer data,
Player const *  target 
) const
overrideprotectedvirtual

Implements Object.

Definition at line 252 of file Corpse.cpp.

253{
255 std::size_t sizePos = data->wpos();
256 *data << uint32(0);
258
260 m_objectData->WriteUpdate(*data, flags, this, target);
261
263 m_corpseData->WriteUpdate(*data, flags, this, target);
264
265 data->put<uint32>(sizePos, data->wpos() - sizePos - 4);
266}
@ TYPEID_OBJECT
Definition: ObjectGuid.h:35
UF::UpdateFieldHolder m_values
Definition: Object.h:253
bool HasChanged(uint32 index) const
Definition: UpdateField.h:701
uint32 GetChangedObjectTypeMask() const
Definition: UpdateField.h:696
+ Here is the call graph for this function:

◆ BuildValuesUpdateForPlayerWithMask()

void Corpse::BuildValuesUpdateForPlayerWithMask ( UpdateData data,
UF::ObjectData::Mask const &  requestedObjectMask,
UF::CorpseData::Mask const &  requestedCorpseMask,
Player const *  target 
) const

Definition at line 268 of file Corpse.cpp.

270{
272 if (requestedObjectMask.IsAnySet())
273 valuesMask.Set(TYPEID_OBJECT);
274
275 if (requestedCorpseMask.IsAnySet())
276 valuesMask.Set(TYPEID_CORPSE);
277
279 std::size_t sizePos = buffer.wpos();
280 buffer << uint32(0);
281 buffer << uint32(valuesMask.GetBlock(0));
282
283 if (valuesMask[TYPEID_OBJECT])
284 m_objectData->WriteUpdate(buffer, requestedObjectMask, true, this, target);
285
286 if (valuesMask[TYPEID_CORPSE])
287 m_corpseData->WriteUpdate(buffer, requestedCorpseMask, true, this, target);
288
289 buffer.put<uint32>(sizePos, buffer.wpos() - sizePos - 4);
290
291 data->AddUpdateBlock();
292}
ByteBuffer & PrepareValuesUpdateBuffer(UpdateData *data) const
Definition: Object.cpp:218
void AddUpdateBlock()
Definition: UpdateData.h:49
uint32 GetBlock(uint32 index) const
Definition: UpdateMask.h:53
void Set(uint32 index)
Definition: UpdateMask.h:84
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearUpdateMask()

void Corpse::ClearUpdateMask ( bool  remove)
overrideprotectedvirtual

Reimplemented from Object.

Definition at line 305 of file Corpse.cpp.

306{
309}
virtual void ClearUpdateMask(bool remove)
Definition: Object.cpp:783
void ClearChangesMask(UpdateField< T, BlockBit, Bit >(Derived::*field))
Definition: UpdateField.h:690
+ Here is the call graph for this function:

◆ Create() [1/2]

bool Corpse::Create ( ObjectGuid::LowType  guidlow,
Map map 
)

Definition at line 65 of file Corpse.cpp.

66{
67 Object::_Create(ObjectGuid::Create<HighGuid::Corpse>(map->GetId(), 0, guidlow));
68 return true;
69}
uint32 GetId() const
Definition: Map.cpp:3195
void _Create(ObjectGuid const &guid)
Definition: Object.cpp:101
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Create() [2/2]

bool Corpse::Create ( ObjectGuid::LowType  guidlow,
Player owner 
)

Definition at line 71 of file Corpse.cpp.

72{
73 ASSERT(owner);
74
75 Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation());
76
77 if (!IsPositionValid())
78 {
79 TC_LOG_ERROR("entities.player", "Corpse (guidlow {}, owner {}) not created. Suggested coordinates isn't valid (X: {} Y: {})",
80 guidlow, owner->GetName(), owner->GetPositionX(), owner->GetPositionY());
81 return false;
82 }
83
84 Object::_Create(ObjectGuid::Create<HighGuid::Corpse>(owner->GetMapId(), 0, guidlow));
85
86 SetObjectScale(1.0f);
87 SetOwnerGUID(owner->GetGUID());
88
90
92
93 return true;
94}
#define ASSERT
Definition: Errors.h:68
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:165
CellCoord _cellCoord
Definition: Corpse.h:143
void SetOwnerGUID(ObjectGuid owner)
Definition: Corpse.h:99
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:158
virtual void SetObjectScale(float scale)
Definition: Object.h:164
static void InheritPhaseShift(WorldObject *target, WorldObject const *source)
uint32 GetMapId() const
Definition: Position.h:185
std::string const & GetName() const
Definition: Object.h:536
CellCoord ComputeCellCoord(float x, float y)
Definition: GridDefines.h:206
float GetPositionZ() const
Definition: Position.h:78
float GetOrientation() const
Definition: Position.h:79
bool IsPositionValid() const
Definition: Position.cpp:42
float GetPositionX() const
Definition: Position.h:76
float GetPositionY() const
Definition: Position.h:77
void Relocate(float x, float y)
Definition: Position.h:63
+ Here is the call graph for this function:

◆ DeleteFromDB() [1/2]

void Corpse::DeleteFromDB ( CharacterDatabaseTransaction  trans)

Definition at line 156 of file Corpse.cpp.

157{
158 DeleteFromDB(GetOwnerGUID(), trans);
159}
ObjectGuid GetOwnerGUID() const override
Definition: Corpse.h:98
void DeleteFromDB(CharacterDatabaseTransaction trans)
Definition: Corpse.cpp:156
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeleteFromDB() [2/2]

void Corpse::DeleteFromDB ( ObjectGuid const &  ownerGuid,
CharacterDatabaseTransaction  trans 
)
static

Definition at line 161 of file Corpse.cpp.

162{
164 stmt->setUInt64(0, ownerGuid.GetCounter());
165 CharacterDatabase.ExecuteOrAppend(trans, stmt);
166
167 stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSE_PHASES);
168 stmt->setUInt64(0, ownerGuid.GetCounter());
169 CharacterDatabase.ExecuteOrAppend(trans, stmt);
170
171 stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSE_CUSTOMIZATIONS);
172 stmt->setUInt64(0, ownerGuid.GetCounter());
173 CharacterDatabase.ExecuteOrAppend(trans, stmt);
174}
@ CHAR_DEL_CORPSE_CUSTOMIZATIONS
@ CHAR_DEL_CORPSE
@ CHAR_DEL_CORPSE_PHASES
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
void setUInt64(const uint8 index, const uint64 value)
+ Here is the call graph for this function:

◆ GetCellCoord()

CellCoord const & Corpse::GetCellCoord ( ) const
inline

Definition at line 128 of file Corpse.h.

128{ return _cellCoord; }
+ Here is the caller graph for this function:

◆ GetCorpseDynamicFlags()

CorpseDynFlags Corpse::GetCorpseDynamicFlags ( ) const
inline

Definition at line 92 of file Corpse.h.

92{ return CorpseDynFlags(*m_corpseData->DynamicFlags); }
CorpseDynFlags
+ Here is the caller graph for this function:

◆ GetCreatorGUID()

ObjectGuid Corpse::GetCreatorGUID ( ) const
inlineoverridevirtual

Implements WorldObject.

Definition at line 97 of file Corpse.h.

97{ return m_corpseData->Owner; }

◆ GetFaction()

uint32 Corpse::GetFaction ( ) const
inlineoverridevirtual

Implements WorldObject.

Definition at line 108 of file Corpse.h.

108{ return m_corpseData->FactionTemplate; }

◆ GetGhostTime()

time_t const & Corpse::GetGhostTime ( ) const
inline

Definition at line 124 of file Corpse.h.

124{ return m_time; }
+ Here is the caller graph for this function:

◆ GetLootForPlayer()

Loot * Corpse::GetLootForPlayer ( Player const *  ) const
inlineoverridevirtual

Reimplemented from Object.

Definition at line 132 of file Corpse.h.

132{ return m_loot.get(); }
std::unique_ptr< Loot > m_loot
Definition: Corpse.h:131

◆ GetOwnerGUID()

ObjectGuid Corpse::GetOwnerGUID ( ) const
inlineoverridevirtual

Implements WorldObject.

Definition at line 98 of file Corpse.h.

98{ return m_corpseData->Owner; }
+ Here is the caller graph for this function:

◆ GetType()

CorpseType Corpse::GetType ( ) const
inline

Definition at line 126 of file Corpse.h.

126{ return m_type; }
+ Here is the caller graph for this function:

◆ IsExpired()

bool Corpse::IsExpired ( time_t  t) const

Definition at line 229 of file Corpse.cpp.

230{
231 // Deleted character
232 if (!sCharacterCache->HasCharacterCacheEntry(GetOwnerGUID()))
233 return true;
234
235 if (m_type == CORPSE_BONES)
236 return m_time < t - 60 * MINUTE;
237 else
238 return m_time < t - 3 * DAY;
239}
#define sCharacterCache
@ MINUTE
Definition: Common.h:29
@ DAY
Definition: Common.h:31
+ Here is the call graph for this function:

◆ LoadCorpseFromDB()

bool Corpse::LoadCorpseFromDB ( ObjectGuid::LowType  guid,
Field fields 
)

Definition at line 181 of file Corpse.cpp.

182{
183 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
184 // SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, race, class, gender, flags, dynFlags, time, corpseType, instanceId, guid FROM corpse WHERE mapId = ? AND instanceId = ?
185
186 float posX = fields[0].GetFloat();
187 float posY = fields[1].GetFloat();
188 float posZ = fields[2].GetFloat();
189 float o = fields[3].GetFloat();
190 uint32 mapId = fields[4].GetUInt16();
191
192 Object::_Create(ObjectGuid::Create<HighGuid::Corpse>(mapId, 0, guid));
193
194 SetObjectScale(1.0f);
195 SetDisplayId(fields[5].GetUInt32());
196 std::vector<std::string_view> items = Trinity::Tokenize(fields[6].GetStringView(), ' ', false);
197 if (items.size() == m_corpseData->Items.size())
198 for (size_t index = 0; index < m_corpseData->Items.size(); ++index)
199 SetItem(index, Trinity::StringTo<uint32>(items[index]).value_or(0));
200
201 SetRace(fields[7].GetUInt8());
202 SetClass(fields[8].GetUInt8());
203 SetSex(fields[9].GetUInt8());
204 ReplaceAllFlags(fields[10].GetUInt8());
205 ReplaceAllCorpseDynamicFlags(CorpseDynFlags(fields[11].GetUInt8()));
206 SetOwnerGUID(ObjectGuid::Create<HighGuid::Player>(fields[15].GetUInt64()));
207 SetFactionTemplate(sChrRacesStore.AssertEntry(m_corpseData->RaceID)->FactionID);
208
209 m_time = time_t(fields[12].GetUInt32());
210
211 uint32 instanceId = fields[14].GetUInt32();
212
213 // place
214 SetLocationInstanceId(instanceId);
215 SetLocationMapId(mapId);
216 Relocate(posX, posY, posZ, o);
217
218 if (!IsPositionValid())
219 {
220 TC_LOG_ERROR("entities.player", "Corpse ({}, owner: {}) is not created, given coordinates are not valid (X: {}, Y: {}, Z: {})",
221 GetGUID().ToString(), GetOwnerGUID().ToString(), posX, posY, posZ);
222 return false;
223 }
224
226 return true;
227}
DB2Storage< ChrRacesEntry > sChrRacesStore("ChrRaces.db2", &ChrRacesLoadInfo::Instance)
void ReplaceAllFlags(uint32 flags)
Definition: Corpse.h:106
void SetRace(uint8 race)
Definition: Corpse.h:103
void SetClass(uint8 playerClass)
Definition: Corpse.h:104
void SetSex(uint8 sex)
Definition: Corpse.h:105
void SetDisplayId(uint32 displayId)
Definition: Corpse.h:102
void SetFactionTemplate(int32 factionTemplate)
Definition: Corpse.h:107
void ReplaceAllCorpseDynamicFlags(CorpseDynFlags dynamicFlags)
Definition: Corpse.h:95
void SetItem(uint32 slot, uint32 item)
Definition: Corpse.h:110
uint16 GetUInt16() const
Definition: Field.cpp:46
float GetFloat() const
Definition: Field.cpp:94
uint32 GetUInt32() const
Definition: Field.cpp:62
void SetLocationInstanceId(uint32 _instanceId)
Definition: Object.h:796
void SetLocationMapId(uint32 _mapId)
Definition: Object.h:795
TC_COMMON_API std::vector< std::string_view > Tokenize(std::string_view str, char sep, bool keepEmpty)
Definition: Util.cpp:56
std::string ToString() const
Definition: Position.cpp:128
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveCorpseDynamicFlag()

void Corpse::RemoveCorpseDynamicFlag ( CorpseDynFlags  dynamicFlags)
inline

Definition at line 94 of file Corpse.h.

void RemoveUpdateFieldFlagValue(UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type flag)
Definition: Object.h:286
MutableFieldReference< T, false > ModifyValue(UpdateField< T, BlockBit, Bit >(Derived::*field))
Definition: UpdateField.h:683
UpdateField< uint32, 0, 2 > DynamicFlags
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveFromWorld()

void Corpse::RemoveFromWorld ( )
overridevirtual
  • Remove the corpse from the accessor

Reimplemented from Object.

Definition at line 56 of file Corpse.cpp.

57{
59 if (IsInWorld())
61
63}
bool Remove(KEY_TYPE const &handle)
void RemoveFromWorld() override
Definition: Object.cpp:1009
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReplaceAllCorpseDynamicFlags()

void Corpse::ReplaceAllCorpseDynamicFlags ( CorpseDynFlags  dynamicFlags)
inline

Definition at line 95 of file Corpse.h.

void SetUpdateFieldValue(UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type value)
Definition: Object.h:272
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReplaceAllFlags()

void Corpse::ReplaceAllFlags ( uint32  flags)
inline

Definition at line 106 of file Corpse.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ResetGhostTime()

void Corpse::ResetGhostTime ( )

Definition at line 176 of file Corpse.cpp.

177{
179}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SaveToDB()

void Corpse::SaveToDB ( )

Definition at line 104 of file Corpse.cpp.

105{
106 // prevent DB data inconsistence problems and duplicates
107 CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
108 DeleteFromDB(trans);
109
110 std::ostringstream items;
111 for (size_t index = 0; index < m_corpseData->Items.size(); ++index)
112 items << m_corpseData->Items[index] << ' ';
113
114 uint16 index = 0;
116 stmt->setUInt64(index++, GetOwnerGUID().GetCounter()); // guid
117 stmt->setFloat (index++, GetPositionX()); // posX
118 stmt->setFloat (index++, GetPositionY()); // posY
119 stmt->setFloat (index++, GetPositionZ()); // posZ
120 stmt->setFloat (index++, GetOrientation()); // orientation
121 stmt->setUInt16(index++, GetMapId()); // mapId
122 stmt->setUInt32(index++, m_corpseData->DisplayID); // displayId
123 stmt->setString(index++, items.str()); // itemCache
124 stmt->setUInt8 (index++, m_corpseData->RaceID); // race
125 stmt->setUInt8 (index++, m_corpseData->Class); // class
126 stmt->setUInt8 (index++, m_corpseData->Sex); // gender
127 stmt->setUInt8 (index++, m_corpseData->Flags); // flags
128 stmt->setUInt8 (index++, m_corpseData->DynamicFlags); // dynFlags
129 stmt->setUInt32(index++, uint32(m_time)); // time
130 stmt->setUInt8 (index++, GetType()); // corpseType
131 stmt->setUInt32(index++, GetInstanceId()); // instanceId
132 trans->Append(stmt);
133
134 for (PhaseShift::PhaseRef const& phase : GetPhaseShift().GetPhases())
135 {
136 index = 0;
137 stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE_PHASES);
138 stmt->setUInt64(index++, GetOwnerGUID().GetCounter()); // OwnerGuid
139 stmt->setUInt32(index++, phase.Id); // PhaseId
140 trans->Append(stmt);
141 }
142
143 for (UF::ChrCustomizationChoice customization : m_corpseData->Customizations)
144 {
145 index = 0;
146 stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE_CUSTOMIZATIONS);
147 stmt->setUInt64(index++, GetOwnerGUID().GetCounter()); // OwnerGuid
148 stmt->setUInt32(index++, customization.ChrCustomizationOptionID);
149 stmt->setUInt32(index++, customization.ChrCustomizationChoiceID);
150 trans->Append(stmt);
151 }
152
153 CharacterDatabase.CommitTransaction(trans);
154}
@ CHAR_INS_CORPSE_PHASES
@ CHAR_INS_CORPSE_CUSTOMIZATIONS
@ CHAR_INS_CORPSE
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
uint16_t uint16
Definition: Define.h:144
CorpseType GetType() const
Definition: Corpse.h:126
PhaseShift & GetPhaseShift()
Definition: Object.h:505
uint32 GetInstanceId() const
Definition: Object.h:503
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetCellCoord()

void Corpse::SetCellCoord ( CellCoord const &  cellCoord)
inline

Definition at line 129 of file Corpse.h.

129{ _cellCoord = cellCoord; }
+ Here is the caller graph for this function:

◆ SetClass()

void Corpse::SetClass ( uint8  playerClass)
inline

Definition at line 104 of file Corpse.h.

UpdateField< uint8, 0, 9 > Class
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetCorpseDynamicFlag()

void Corpse::SetCorpseDynamicFlag ( CorpseDynFlags  dynamicFlags)
inline

Definition at line 93 of file Corpse.h.

void SetUpdateFieldFlagValue(UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type flag)
Definition: Object.h:279
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetCustomizations()

template<typename Iter >
void Corpse::SetCustomizations ( Trinity::IteratorPair< Iter >  customizations)
inline

Definition at line 113 of file Corpse.h.

114 {
116 for (auto&& customization : customizations)
117 {
119 newChoice.ChrCustomizationOptionID = customization.ChrCustomizationOptionID;
120 newChoice.ChrCustomizationChoiceID = customization.ChrCustomizationChoiceID;
121 }
122 }
void ClearDynamicUpdateFieldValues(UF::DynamicUpdateFieldSetter< T > setter)
Definition: Object.h:314
UF::DynamicUpdateFieldSetter< T >::insert_result AddDynamicUpdateFieldValue(UF::DynamicUpdateFieldSetter< T > setter)
Definition: Object.h:293
DynamicUpdateField< UF::ChrCustomizationChoice, 0, 1 > Customizations
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetDisplayId()

void Corpse::SetDisplayId ( uint32  displayId)
inline

Definition at line 102 of file Corpse.h.

UpdateField< uint32, 0, 6 > DisplayID
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetFaction()

void Corpse::SetFaction ( uint32  faction)
inlineoverridevirtual

Reimplemented from WorldObject.

Definition at line 109 of file Corpse.h.

109{ SetFactionTemplate(faction); }

◆ SetFactionTemplate()

void Corpse::SetFactionTemplate ( int32  factionTemplate)
inline

Definition at line 107 of file Corpse.h.

UpdateField< int32, 0, 11 > FactionTemplate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetGuildGUID()

void Corpse::SetGuildGUID ( ObjectGuid  guildGuid)
inline

Definition at line 101 of file Corpse.h.

UpdateField< ObjectGuid, 0, 5 > GuildGUID
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetItem()

void Corpse::SetItem ( uint32  slot,
uint32  item 
)
inline

Definition at line 110 of file Corpse.h.

UpdateFieldArray< uint32, 19, 13, 14 > Items
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetOwnerGUID()

void Corpse::SetOwnerGUID ( ObjectGuid  owner)
inline

Definition at line 99 of file Corpse.h.

UpdateField< ObjectGuid, 0, 3 > Owner
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetPartyGUID()

void Corpse::SetPartyGUID ( ObjectGuid  partyGuid)
inline

Definition at line 100 of file Corpse.h.

UpdateField< ObjectGuid, 0, 4 > PartyGUID
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetRace()

void Corpse::SetRace ( uint8  race)
inline

Definition at line 103 of file Corpse.h.

UpdateField< uint8, 0, 7 > RaceID
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetSex()

void Corpse::SetSex ( uint8  sex)
inline

Definition at line 105 of file Corpse.h.

UpdateField< uint8, 0, 8 > Sex
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Update()

void Corpse::Update ( uint32  diff)
overridevirtual

Reimplemented from WorldObject.

Definition at line 96 of file Corpse.cpp.

97{
99
100 if (m_loot)
101 m_loot->Update();
102}
virtual void Update(uint32 diff)
Definition: Object.cpp:891
+ Here is the call graph for this function:

Member Data Documentation

◆ _cellCoord

CellCoord Corpse::_cellCoord
private

Definition at line 143 of file Corpse.h.

◆ lootRecipient

Player* Corpse::lootRecipient

Definition at line 134 of file Corpse.h.

◆ m_corpseData

UF::UpdateField<UF::CorpseData, 0, TYPEID_CORPSE> Corpse::m_corpseData

Definition at line 138 of file Corpse.h.

◆ m_loot

std::unique_ptr<Loot> Corpse::m_loot

Definition at line 131 of file Corpse.h.

◆ m_time

time_t Corpse::m_time
private

Definition at line 142 of file Corpse.h.

◆ m_type

CorpseType Corpse::m_type
private

Definition at line 141 of file Corpse.h.


The documentation for this class was generated from the following files: