AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
StaticTransport Class Reference

#include "Transport.h"

Inheritance diagram for StaticTransport:
Transport GameObject TransportBase WorldObject GridObject< GameObject > MovableMapObject Object WorldLocation Position

Public Member Functions

 StaticTransport ()
 
 ~StaticTransport () override
 
bool Create (ObjectGuid::LowType guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, G3D::Quat const &rotation, uint32 animprogress, GOState go_state, uint32 artKit=0) override
 
void CleanupsBeforeDelete (bool finalCleanup=true) override
 
void BuildUpdate (UpdateDataMapType &data_map, UpdatePlayerSet &) override
 
void Update (uint32 diff) override
 
void RelocateToProgress (uint32 progress)
 
void UpdatePosition (float x, float y, float z, float o)
 
void UpdatePassengerPositions ()
 
void AddPassenger (WorldObject *passenger, bool withAll=false) override
 
void RemovePassenger (WorldObject *passenger, bool withAll=false) override
 
uint32 GetPauseTime () const
 
void SetPauseTime (uint32 val)
 
uint32 GetPeriod () const
 
- Public Member Functions inherited from Transport
 Transport ()
 
void CalculatePassengerPosition (float &x, float &y, float &z, float *o=nullptr) const override
 This method transforms supplied transport offsets into global coordinates. More...
 
void CalculatePassengerOffset (float &x, float &y, float &z, float *o=nullptr) const override
 This method transforms supplied global coordinates into local offsets. More...
 
virtual void AddPassenger (WorldObject *passenger, bool withAll=false)=0
 
virtual void RemovePassenger (WorldObject *passenger, bool withAll=false)=0
 
PassengerSet const & GetPassengers () const
 
uint32 GetPathProgress () const
 
void SetPathProgress (uint32 val)
 
- Public Member Functions inherited from GameObject
 GameObject ()
 
 ~GameObject () override
 
void BuildValuesUpdate (uint8 updateType, ByteBuffer *data, Player *target) override
 
void AddToWorld () override
 
void RemoveFromWorld () override
 
void CleanupsBeforeDelete (bool finalCleanup=true) override
 
uint32 GetDynamicFlags () const override
 
void ReplaceAllDynamicFlags (uint32 flag) override
 
virtual bool Create (ObjectGuid::LowType guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, G3D::Quat const &rotation, uint32 animprogress, GOState go_state, uint32 artKit=0)
 
void Update (uint32 p_time) override
 
GameObjectTemplate const * GetGOInfo () const
 
GameObjectTemplateAddon const * GetTemplateAddon () const
 
GameObjectData const * GetGameObjectData () const
 
GameObjectValue const * GetGOValue () const
 
bool IsTransport () const
 
bool IsDestructibleBuilding () const
 
ObjectGuid::LowType GetSpawnId () const
 
void SetLocalRotationAngles (float z_rot, float y_rot, float x_rot)
 
void SetLocalRotation (G3D::Quat const &rot)
 
void SetTransportPathRotation (float qx, float qy, float qz, float qw)
 
G3D::Quat const & GetLocalRotation () const
 
int64 GetPackedLocalRotation () const
 
G3D::Quat GetWorldRotation () const
 
std::string const & GetNameForLocaleIdx (LocaleConstant locale_idx) const override
 
void SaveToDB (bool saveAddon=false)
 
void SaveToDB (uint32 mapid, uint8 spawnMask, uint32 phaseMask, bool saveAddon=false)
 
bool LoadFromDB (ObjectGuid::LowType guid, Map *map)
 
bool LoadGameObjectFromDB (ObjectGuid::LowType guid, Map *map, bool addToMap=true)
 
void DeleteFromDB ()
 
void SetOwnerGUID (ObjectGuid owner)
 
ObjectGuid GetOwnerGUID () const
 
UnitGetOwner () const
 
void SetSpellId (uint32 id)
 
uint32 GetSpellId () const
 
time_t GetRespawnTime () const
 
time_t GetRespawnTimeEx () const
 
void SetRespawnTime (int32 respawn)
 
void SetRespawnDelay (int32 respawn)
 
void Respawn ()
 
bool isSpawned () const
 
bool isSpawnedByDefault () const
 
void SetSpawnedByDefault (bool b)
 
uint32 GetRespawnDelay () const
 
void Refresh ()
 
void DespawnOrUnsummon (Milliseconds delay=0ms, Seconds forcedRespawnTime=0s)
 
void Delete ()
 
void GetFishLoot (Loot *loot, Player *loot_owner)
 
void GetFishLootJunk (Loot *loot, Player *loot_owner)
 
GameobjectTypes GetGoType () const
 
void SetGoType (GameobjectTypes type)
 
GOState GetGoState () const
 
void SetGoState (GOState state)
 
uint8 GetGoArtKit () const
 
void SetGoArtKit (uint8 artkit)
 
uint8 GetGoAnimProgress () const
 
void SetGoAnimProgress (uint8 animprogress)
 
void SetPhaseMask (uint32 newPhaseMask, bool update) override
 
void EnableCollision (bool enable)
 
GameObjectFlags GetGameObjectFlags () const
 
bool HasGameObjectFlag (GameObjectFlags flags) const
 
void SetGameObjectFlag (GameObjectFlags flags)
 
void RemoveGameObjectFlag (GameObjectFlags flags)
 
void ReplaceAllGameObjectFlags (GameObjectFlags flags)
 
void Use (Unit *user)
 
LootState getLootState () const
 
void SetLootState (LootState s, Unit *unit=nullptr)
 
uint16 GetLootMode () const
 
bool HasLootMode (uint16 lootMode) const
 
void SetLootMode (uint16 lootMode)
 
void AddLootMode (uint16 lootMode)
 
void RemoveLootMode (uint16 lootMode)
 
void ResetLootMode ()
 
void AddToSkillupList (ObjectGuid playerGuid)
 
bool IsInSkillupList (ObjectGuid playerGuid) const
 
void AddUniqueUse (Player *player)
 
void AddUse ()
 
uint32 GetUseCount () const
 
uint32 GetUniqueUseCount () const
 
void SaveRespawnTime () override
 
void SaveRespawnTime (uint32 forceDelay)
 
PlayerGetLootRecipient () const
 
GroupGetLootRecipientGroup () const
 
void SetLootRecipient (Creature *creature)
 
void SetLootRecipient (Map *map)
 
bool IsLootAllowedFor (Player const *player) const
 
bool HasLootRecipient () const
 
void SetLootGenerationTime ()
 
uint32 GetLootGenerationTime () const
 
GameObjectGetLinkedTrap ()
 
void SetLinkedTrap (GameObject *linkedTrap)
 
bool hasQuest (uint32 quest_id) const override
 
bool hasInvolvedQuest (uint32 quest_id) const override
 
bool ActivateToQuest (Player *target) const
 
void UseDoorOrButton (uint32 time_to_restore=0, bool alternative=false, Unit *user=nullptr)
 
void ResetDoorOrButton ()
 
void TriggeringLinkedGameObject (uint32 trapEntry, Unit *target)
 
bool IsNeverVisible () const override
 
bool IsAlwaysVisibleFor (WorldObject const *seer) const override
 
bool IsInvisibleDueToDespawn () const override
 
uint8 getLevelForTarget (WorldObject const *target) const override
 
GameObjectLookupFishingHoleAround (float range)
 
void CastSpell (Unit *target, uint32 spell)
 
void SendCustomAnim (uint32 anim)
 
bool IsInRange (float x, float y, float z, float radius) const
 
void ModifyHealth (int32 change, Unit *attackerOrHealer=nullptr, uint32 spellId=0)
 
void SetDestructibleBuildingModifyState (bool allow)
 
void SetDestructibleState (GameObjectDestructibleState state, Player *eventInvoker=nullptr, bool setHealth=false)
 
GameObjectDestructibleState GetDestructibleState () const
 
void EventInform (uint32 eventId)
 
virtual uint32 GetScriptId () const
 
GameObjectAIAI () const
 
std::string const & GetAIName () const
 
void SetDisplayId (uint32 displayid)
 
uint32 GetDisplayId () const
 
void GetRespawnPosition (float &x, float &y, float &z, float *ori=nullptr) const
 
void SetPosition (float x, float y, float z, float o)
 
void SetPosition (const Position &pos)
 
bool IsStaticTransport () const
 
bool IsMotionTransport () const
 
TransportToTransport ()
 
Transport const * ToTransport () const
 
StaticTransportToStaticTransport ()
 
StaticTransport const * ToStaticTransport () const
 
MotionTransportToMotionTransport ()
 
MotionTransport const * ToMotionTransport () const
 
float GetStationaryX () const override
 
float GetStationaryY () const override
 
float GetStationaryZ () const override
 
float GetStationaryO () const override
 
float GetInteractionDistance () const
 
void UpdateModelPosition ()
 
bool IsAtInteractDistance (Position const &pos, float radius) const
 
bool IsAtInteractDistance (Player const *player, SpellInfo const *spell=nullptr) const
 
bool IsWithinDistInMap (Player const *player) const
 
SpellInfo const * GetSpellForLock (Player const *player) const
 
bool ValidateGameobjectType () const
 
bool IsInstanceGameobject () const
 
uint8 GameobjectStateToInt (GOState *state) const
 
bool IsAllowedToSaveToDB () const
 
void AllowSaveToDB (bool enable)
 
void SaveStateToDB ()
 
std::string GetDebugInfo () const override
 
bool IsWithinDistInMap (WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
 
- Public Member Functions inherited from WorldObject
 ~WorldObject () override
 
virtual void Update (uint32)
 
void _Create (ObjectGuid::LowType guidlow, HighGuid guidhigh, uint32 phaseMask)
 
void AddToWorld () override
 
void RemoveFromWorld () override
 
void GetNearPoint2D (WorldObject const *searcher, float &x, float &y, float distance, float absAngle, Position const *startPos=nullptr) const
 
void GetNearPoint2D (float &x, float &y, float distance, float absAngle, Position const *startPos=nullptr) const
 
void GetNearPoint (WorldObject const *searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle, float controlZ=0, Position const *startPos=nullptr) const
 
void GetVoidClosePoint (float &x, float &y, float &z, float size, float distance2d=0, float relAngle=0, float controlZ=0) const
 
bool GetClosePoint (float &x, float &y, float &z, float size, float distance2d=0, float angle=0, WorldObject const *forWho=nullptr, bool force=false) 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 startX, float startY, float startZ, float destX, float destY)
 
Position GetFirstCollisionPosition (float destX, float destY, float destZ)
 
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
 
void GetChargeContactPoint (WorldObject const *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
 
float GetObjectSize () 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 (const Position &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const
 
Position GetRandomPoint (const Position &srcPos, float distance) const
 
uint32 GetInstanceId () const
 
virtual void SetPhaseMask (uint32 newPhaseMask, bool update)
 
uint32 GetPhaseMask () const
 
bool InSamePhase (WorldObject const *obj) const
 
bool InSamePhase (uint32 phasemask) const
 
uint32 GetZoneId () const
 
uint32 GetAreaId () const
 
void GetZoneAndAreaId (uint32 &zoneid, uint32 &areaid) const
 
bool IsOutdoors () const
 
LiquidData const & GetLiquidData () const
 
InstanceScriptGetInstanceScript () const
 
std::string const & GetName () const
 
void SetName (std::string const &newname)
 
virtual std::string const & GetNameForLocaleIdx (LocaleConstant) const
 
float GetDistance (WorldObject const *obj) const
 
float GetDistance (const Position &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 (const Position *pos, float dist) const
 
bool IsWithinDist2d (float x, float y, float dist) const
 
bool IsWithinDist2d (const Position *pos, float dist) const
 
bool IsWithinDist (WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
 
bool IsWithinDistInMap (WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
 
bool IsWithinLOS (float x, float y, float z, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS) const
 
bool IsWithinLOSInMap (WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
 
Position GetHitSpherePointFor (Position const &dest, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
 
void GetHitSpherePointFor (Position const &dest, float &x, float &y, float &z, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) 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=M_PI) const
 
bool isInBack (WorldObject const *target, float arc=M_PI) 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
 
virtual uint8 getLevelForTarget (WorldObject const *) const
 
void PlayDistanceSound (uint32 sound_id, Player *target=nullptr)
 
void PlayDirectSound (uint32 sound_id, Player *target=nullptr)
 
void PlayRadiusSound (uint32 sound_id, float radius)
 
void PlayDirectMusic (uint32 music_id, Player *target=nullptr)
 
void PlayRadiusMusic (uint32 music_id, float radius)
 
void SendObjectDeSpawnAnim (ObjectGuid guid)
 
virtual void SaveRespawnTime ()
 
void AddObjectToRemoveList ()
 
float GetGridActivationRange () const
 
float GetVisibilityRange () const
 
virtual float GetSightRange (WorldObject const *target=nullptr) const
 
bool CanSeeOrDetect (WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false, bool checkAlert=false) const
 
void SendPlayMusic (uint32 Music, bool OnlySelf)
 
virtual void SetMap (Map *map)
 
virtual void ResetMap ()
 
MapGetMap () const
 
MapFindMap () const
 
void SetZoneScript ()
 
void ClearZoneScript ()
 
ZoneScriptGetZoneScript () const
 
TempSummonSummonCreature (uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
 
TempSummonSummonCreature (uint32 id, float x, float y, float z, float ang=0, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false)
 
GameObjectSummonGameObject (uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
 
CreatureSummonTrigger (float x, float y, float z, float ang, uint32 dur, bool setLevel=false, CreatureAI *(*GetAI)(Creature *)=nullptr)
 
void SummonCreatureGroup (uint8 group, std::list< TempSummon * > *list=nullptr)
 
CreatureFindNearestCreature (uint32 entry, float range, bool alive=true) const
 
GameObjectFindNearestGameObject (uint32 entry, float range, bool onlySpawned=false) const
 
GameObjectFindNearestGameObjectOfType (GameobjectTypes type, float range) const
 
PlayerSelectNearestPlayer (float distance=0) const
 
void GetGameObjectListWithEntryInGrid (std::list< GameObject * > &lList, uint32 uiEntry, float fMaxSearchRange) const
 
void GetCreatureListWithEntryInGrid (std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
 
void GetDeadCreatureListInGrid (std::list< Creature * > &lList, float maxSearchRange, bool alive=false) const
 
void DestroyForNearbyPlayers ()
 
virtual void UpdateObjectVisibility (bool forced=true, bool fromUpdate=false)
 
void BuildUpdate (UpdateDataMapType &data_map, UpdatePlayerSet &player_set) override
 
void GetCreaturesWithEntryInRange (std::list< Creature * > &creatureList, float radius, uint32 entry)
 
void SetPositionDataUpdate ()
 
void UpdatePositionData ()
 
void AddToObjectUpdate () override
 
void RemoveFromObjectUpdate () override
 
void AddToNotify (uint16 f)
 
void RemoveFromNotify (uint16 f)
 
bool isNeedNotify (uint16 f) const
 
uint16 GetNotifyFlags () const
 
bool NotifyExecuted (uint16 f) const
 
void SetNotified (uint16 f)
 
void ResetAllNotifies ()
 
bool isActiveObject () const
 
void setActive (bool isActiveObject)
 
bool IsFarVisible () const
 
bool IsVisibilityOverridden () const
 
void SetVisibilityDistanceOverride (VisibilityDistanceType type)
 
void SetWorldObject (bool apply)
 
bool IsPermanentWorldObject () const
 
bool IsWorldObject () const
 
bool IsInWintergrasp () const
 
TransportGetTransport () const
 
float GetTransOffsetX () const
 
float GetTransOffsetY () const
 
float GetTransOffsetZ () const
 
float GetTransOffsetO () const
 
uint32 GetTransTime () const
 
int8 GetTransSeat () const
 
virtual ObjectGuid GetTransGUID () const
 
void SetTransport (Transport *t)
 
virtual float GetStationaryX () const
 
virtual float GetStationaryY () const
 
virtual float GetStationaryZ () const
 
virtual float GetStationaryO () 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
 
float GetFloorZ () const
 
float GetMinHeightInWater () const
 Get the minimum height of a object that should be in water to start floating/swim. More...
 
virtual float GetCollisionHeight () const
 
virtual float GetCollisionWidth () const
 
virtual float GetCollisionRadius () const
 
void AddAllowedLooter (ObjectGuid guid)
 
void ResetAllowedLooters ()
 
void SetAllowedLooters (GuidUnorderedSet const looters)
 
bool HasAllowedLooter (ObjectGuid guid) const
 
GuidUnorderedSet const & GetAllowedLooters () const
 
void RemoveAllowedLooter (ObjectGuid guid)
 
std::string GetDebugInfo () const override
 
- Public Member Functions inherited from Object
virtual ~Object ()
 
bool IsInWorld () const
 
virtual void AddToWorld ()
 
virtual void RemoveFromWorld ()
 
ObjectGuid GetGUID () const
 
PackedGuid const & GetPackGUID () const
 
uint32 GetEntry () const
 
void SetEntry (uint32 entry)
 
float GetObjectScale () const
 
virtual void SetObjectScale (float scale)
 
virtual uint32 GetDynamicFlags () const
 
bool HasDynamicFlag (uint32 flag) const
 
virtual void SetDynamicFlag (uint32 flag)
 
virtual void RemoveDynamicFlag (uint32 flag)
 
virtual void ReplaceAllDynamicFlags (uint32 flag)
 
TypeID GetTypeId () const
 
bool isType (uint16 mask) const
 
virtual void BuildCreateUpdateBlockForPlayer (UpdateData *data, Player *target)
 
void SendUpdateToPlayer (Player *player)
 
void BuildValuesUpdateBlockForPlayer (UpdateData *data, Player *target)
 
void BuildOutOfRangeUpdateBlock (UpdateData *data) const
 
void BuildMovementUpdateBlock (UpdateData *data, uint32 flags=0) const
 
virtual void DestroyForPlayer (Player *target, bool onDeath=false) const
 
int32 GetInt32Value (uint16 index) const
 
uint32 GetUInt32Value (uint16 index) const
 
uint64 GetUInt64Value (uint16 index) const
 
float GetFloatValue (uint16 index) const
 
uint8 GetByteValue (uint16 index, uint8 offset) const
 
uint16 GetUInt16Value (uint16 index, uint8 offset) const
 
ObjectGuid GetGuidValue (uint16 index) const
 
void SetInt32Value (uint16 index, int32 value)
 
void SetUInt32Value (uint16 index, uint32 value)
 
void UpdateUInt32Value (uint16 index, uint32 value)
 
void SetUInt64Value (uint16 index, uint64 value)
 
void SetFloatValue (uint16 index, float value)
 
void SetByteValue (uint16 index, uint8 offset, uint8 value)
 
void SetUInt16Value (uint16 index, uint8 offset, uint16 value)
 
void SetInt16Value (uint16 index, uint8 offset, int16 value)
 
void SetGuidValue (uint16 index, ObjectGuid value)
 
void SetStatFloatValue (uint16 index, float value)
 
void SetStatInt32Value (uint16 index, int32 value)
 
bool AddGuidValue (uint16 index, ObjectGuid value)
 
bool RemoveGuidValue (uint16 index, ObjectGuid value)
 
void ApplyModUInt32Value (uint16 index, int32 val, bool apply)
 
void ApplyModInt32Value (uint16 index, int32 val, bool apply)
 
void ApplyModUInt64Value (uint16 index, int32 val, bool apply)
 
void ApplyModPositiveFloatValue (uint16 index, float val, bool apply)
 
void ApplyModSignedFloatValue (uint16 index, float val, bool apply)
 
void ApplyPercentModFloatValue (uint16 index, float val, bool apply)
 
void SetFlag (uint16 index, uint32 newFlag)
 
void RemoveFlag (uint16 index, uint32 oldFlag)
 
void ToggleFlag (uint16 index, uint32 flag)
 
bool HasFlag (uint16 index, uint32 flag) const
 
void ApplyModFlag (uint16 index, uint32 flag, bool apply)
 
void SetByteFlag (uint16 index, uint8 offset, uint8 newFlag)
 
void RemoveByteFlag (uint16 index, uint8 offset, uint8 newFlag)
 
bool HasByteFlag (uint16 index, uint8 offset, uint8 flag) const
 
void SetFlag64 (uint16 index, uint64 newFlag)
 
void RemoveFlag64 (uint16 index, uint64 oldFlag)
 
void ToggleFlag64 (uint16 index, uint64 flag)
 
bool HasFlag64 (uint16 index, uint64 flag) const
 
void ApplyModFlag64 (uint16 index, uint64 flag, bool apply)
 
void ClearUpdateMask (bool remove)
 
uint16 GetValuesCount () const
 
virtual bool hasQuest (uint32) const
 
virtual bool hasInvolvedQuest (uint32) const
 
virtual void BuildUpdate (UpdateDataMapType &, UpdatePlayerSet &)
 
void BuildFieldsUpdate (Player *, UpdateDataMapType &)
 
void SetFieldNotifyFlag (uint16 flag)
 
void RemoveFieldNotifyFlag (uint16 flag)
 
void ForceValuesUpdateAtIndex (uint32)
 
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 IsDynamicObject () const
 
DynamicObjectToDynObject ()
 
DynamicObject const * ToDynObject () const
 
bool IsItem () const
 
virtual std::string GetDebugInfo () 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 (const WorldLocation &loc)
 
void WorldRelocate (uint32 mapId=MAPID_INVALID, float x=0.f, float y=0.f, float z=0.f, float o=0.f)
 
void SetMapId (uint32 mapId)
 
uint32 GetMapId () const
 
void GetWorldLocation (uint32 &mapId, float &x, float &y) const
 
void GetWorldLocation (uint32 &mapId, float &x, float &y, float &z) const
 
void GetWorldLocation (uint32 &mapId, float &x, float &y, float &z, float &o) const
 
void GetWorldLocation (WorldLocation *location) const
 
WorldLocation GetWorldLocation () const
 
std::string GetDebugInfo () const
 
- Public Member Functions inherited from Position
 Position (float x=0, float y=0, float z=0, float o=0)
 
 Position (Position const &loc)
 
 Position (Position &&)=default
 
Positionoperator= (const Position &)=default
 
Positionoperator= (Position &&)=default
 
bool operator== (Position const &a) const
 
bool operator!= (Position const &a)
 
 operator G3D::Vector3 () const
 
void Relocate (float x, float y)
 
void Relocate (float x, float y, float z)
 
void Relocate (float x, float y, float z, float orientation)
 
void Relocate (const Position &pos)
 
void Relocate (const Position *pos)
 
void RelocatePolarOffset (float angle, float dist, float z=0.0f)
 
void RelocateOffset (const Position &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
 
Position::PositionXYZStreamer PositionXYZStream ()
 
Position::PositionXYZOStreamer PositionXYZOStream ()
 
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 (const Position &endPos, Position &retOffset) const
 
Position GetPositionWithOffset (Position const &offset) const
 
float GetAngle (const Position *pos) const
 
float GetAngle (float x, float y) const
 
float GetAbsoluteAngle (float x, float y) const
 
float GetAbsoluteAngle (Position const &pos) const
 
float GetAbsoluteAngle (Position const *pos) const
 
float GetRelativeAngle (const Position *pos) const
 
float GetRelativeAngle (float x, float y) const
 
float ToAbsoluteAngle (float relAngle) const
 
void GetSinCos (float x, float y, float &vsin, float &vcos) const
 
bool IsInDist2d (float x, float y, float dist) const
 
bool IsInDist2d (const Position *pos, float dist) const
 
bool IsInDist (float x, float y, float z, float dist) const
 
bool IsInDist (const Position *pos, float dist) const
 
bool IsWithinBox (const Position &center, float xradius, float yradius, float zradius) const
 
bool HasInArc (float arcangle, const Position *pos, float targetRadius=0.0f) const
 
bool HasInLine (Position const *pos, float width) const
 
std::string ToString () const
 
- Public Member Functions inherited from GridObject< GameObject >
bool IsInGrid () const
 
void AddToGrid (GridRefMgr< GameObject > &m)
 
void RemoveFromGrid ()
 
virtual void CalculatePassengerPosition (float &x, float &y, float &z, float *o=nullptr) const =0
 This method transforms supplied transport offsets into global coordinates. More...
 
virtual void CalculatePassengerOffset (float &x, float &y, float &z, float *o=nullptr) const =0
 This method transforms supplied global coordinates into local offsets. More...
 

Private Attributes

bool _needDoInitialRelocation
 

Additional Inherited Members

- Public Types inherited from Transport
typedef std::set< WorldObject * > PassengerSet
 
- Static Public Member Functions inherited from GameObject
static void SetGoArtKit (uint8 artkit, GameObject *go, ObjectGuid::LowType lowguid=0)
 
- Static Public Member Functions inherited from Object
static ObjectGuid GetGUID (Object const *o)
 
- Static Public Member Functions inherited from Position
static float NormalizeOrientation (float o)
 
- Public Attributes inherited from GameObject
Loot loot
 
uint32 m_groupLootTimer
 
uint32 lootingGroupLowGUID
 
GameObjectModelm_model
 
- Public Attributes inherited from WorldObject
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPESm_stealth
 
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPESm_stealthDetect
 
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPESm_invisibility
 
FlaggedValuesArray32< int32, uint32, 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
 
ElunaEventProcessor * elunaEvents
 
- Public Attributes inherited from Object
DataMap CustomData
 
- Public Attributes inherited from WorldLocation
uint32 m_mapId
 
- Public Attributes inherited from Position
float m_positionX = 0
 
float m_positionY = 0
 
float m_positionZ = 0
 
float m_orientation = 0
 
- Static Public Attributes inherited from GameObject
static std::unordered_map< int, goEventFlaggameObjectToEventFlag = { }
 
- Protected Types inherited from GameObject
typedef std::map< uint32, ObjectGuidChairSlotAndUser
 
- Protected Member Functions inherited from GameObject
bool AIM_Initialize ()
 
GameObjectModelCreateModel ()
 
void UpdateModel ()
 
- 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 IsNeverVisible () const
 
virtual bool IsAlwaysVisibleFor (WorldObject const *) const
 
virtual bool IsInvisibleDueToDespawn () const
 
virtual bool IsAlwaysDetectableFor (WorldObject const *) const
 
- Protected Member Functions inherited from Object
 Object ()
 
void _InitValues ()
 
void _Create (ObjectGuid::LowType guidlow, uint32 entry, HighGuid guidhigh)
 
std::string _ConcatFields (uint16 startIndex, uint16 size) const
 
bool _LoadIntoDataField (std::string const &data, uint32 startOffset, uint32 count)
 
uint32 GetUpdateFieldData (Player const *target, uint32 *&flags) const
 
void BuildMovementUpdate (ByteBuffer *data, uint16 flags) const
 
virtual void BuildValuesUpdate (uint8 updateType, ByteBuffer *data, Player *target)
 
virtual void AddToObjectUpdate ()=0
 
virtual void RemoveFromObjectUpdate ()=0
 
void AddToObjectUpdateIfNeeded ()
 
- Protected Member Functions inherited from MovableMapObject
 MovableMapObject ()=default
 
- Protected Member Functions inherited from TransportBase
 TransportBase ()=default
 
virtual ~TransportBase ()=default
 
- Static Protected Member Functions inherited from TransportBase
static void CalculatePassengerPosition (float &x, float &y, float &z, float *o, float transX, float transY, float transZ, float transO)
 
static void CalculatePassengerOffset (float &x, float &y, float &z, float *o, float transX, float transY, float transZ, float transO)
 
- Protected Attributes inherited from Transport
PassengerSet _passengers
 
- Protected Attributes inherited from GameObject
uint32 m_spellId
 
time_t m_respawnTime
 
uint32 m_respawnDelayTime
 
uint32 m_despawnDelay
 
Seconds m_despawnRespawnTime
 
Seconds m_restockTime
 
LootState m_lootState
 
bool m_spawnedByDefault
 
uint32 m_cooldownTime
 
std::unordered_map< ObjectGuid, int32m_SkillupList
 
ObjectGuid m_ritualOwnerGUID
 
GuidSet m_unique_users
 
uint32 m_usetimes
 
ChairSlotAndUser ChairListSlots
 
ObjectGuid::LowType m_spawnId
 For new or temporary gameobjects is 0 for saved it is lowguid. More...
 
GameObjectTemplate const * m_goInfo
 
GameObjectData const * m_goData
 
GameObjectValue m_goValue
 
bool m_allowModifyDestructibleBuilding
 
int64 m_packedRotation
 
G3D::Quat m_localRotation
 
Position m_stationaryPosition
 
ObjectGuid m_lootRecipient
 
ObjectGuid::LowType m_lootRecipientGroup
 
uint16 m_LootMode
 
uint32 m_lootGenerationTime
 
ObjectGuid m_linkedTrap
 
ObjectGuid _lootStateUnitGUID
 
- Protected Attributes inherited from WorldObject
std::string m_name
 
bool m_isActive
 
bool m_isFarVisible
 
Optional< float > m_visibilityDistanceOverride
 
const bool m_isWorldObject
 
ZoneScriptm_zoneScript
 
uint32 _zoneId
 
uint32 _areaId
 
float _floorZ
 
bool _outdoors
 
LiquidData _liquidData
 
bool _updatePositionData
 
Transportm_transport
 
- Protected Attributes inherited from Object
uint16 m_objectType
 
TypeID m_objectTypeId
 
uint16 m_updateFlag
 
union {
   int32 *   m_int32Values
 
   uint32 *   m_uint32Values
 
   float *   m_floatValues
 
}; 
 
UpdateMask _changesMask
 
uint16 m_valuesCount
 
uint16 _fieldNotifyFlags
 
bool m_objectUpdated
 

Detailed Description

Constructor & Destructor Documentation

◆ StaticTransport()

StaticTransport::StaticTransport ( )
669{
671}
@ UPDATEFLAG_ROTATION
Definition: UpdateData.h:48
@ UPDATEFLAG_LOWGUID
Definition: UpdateData.h:43
@ UPDATEFLAG_TRANSPORT
Definition: UpdateData.h:40
@ UPDATEFLAG_STATIONARY_POSITION
Definition: UpdateData.h:45
uint16 m_updateFlag
Definition: Object.h:243
Transport()
Definition: Transport.h:31
bool _needDoInitialRelocation
Definition: Transport.h:133

References Object::m_updateFlag, UPDATEFLAG_LOWGUID, UPDATEFLAG_ROTATION, UPDATEFLAG_STATIONARY_POSITION, and UPDATEFLAG_TRANSPORT.

◆ ~StaticTransport()

StaticTransport::~StaticTransport ( )
override
674{
675 ASSERT(_passengers.empty());
676}
#define ASSERT
Definition: Errors.h:68
PassengerSet _passengers
Definition: Transport.h:44

References Transport::_passengers, and ASSERT.

Member Function Documentation

◆ AddPassenger()

void StaticTransport::AddPassenger ( WorldObject passenger,
bool  withAll = false 
)
overridevirtual

Implements Transport.

966{
967 if (_passengers.insert(passenger).second)
968 {
969 if (Player* plr = passenger->ToPlayer())
970 sScriptMgr->OnAddPassenger(ToTransport(), plr);
971
972 if (withAll)
973 {
974 if (Transport* t = passenger->GetTransport()) // SHOULD NEVER HAPPEN
975 t->RemovePassenger(passenger, false);
976
977 float x, y, z, o;
978 passenger->GetPosition(x, y, z, o);
979 CalculatePassengerOffset(x, y, z, &o);
980
981 passenger->SetTransport(this);
983 passenger->m_movementInfo.transport.guid = GetGUID();
984 passenger->m_movementInfo.transport.pos.Relocate(x, y, z, o);
985 }
986 }
987}
#define sScriptMgr
Definition: ScriptMgr.h:708
@ MOVEMENTFLAG_ONTRANSPORT
Definition: UnitDefines.h:353
Transport * ToTransport()
Definition: GameObject.h:322
Player * ToPlayer()
Definition: Object.h:198
ObjectGuid GetGUID() const
Definition: Object.h:110
uint32 flags
Definition: Object.h:279
struct MovementInfo::TransportInfo transport
ObjectGuid guid
Definition: Object.h:296
Position pos
Definition: Object.h:297
void SetTransport(Transport *t)
Definition: Object.h:607
Transport * GetTransport() const
Definition: Object.h:599
MovementInfo m_movementInfo
Definition: Object.h:609
void GetPosition(float &x, float &y) const
Definition: Position.h:122
void Relocate(float x, float y)
Definition: Position.h:73
Definition: Player.h:1064
Definition: Transport.h:29
void CalculatePassengerOffset(float &x, float &y, float &z, float *o=nullptr) const override
This method transforms supplied global coordinates into local offsets.
Definition: Transport.h:33

References Transport::_passengers, Transport::CalculatePassengerOffset(), MovementInfo::flags, Object::GetGUID(), Position::GetPosition(), WorldObject::GetTransport(), MovementInfo::TransportInfo::guid, WorldObject::m_movementInfo, MOVEMENTFLAG_ONTRANSPORT, MovementInfo::TransportInfo::pos, Position::Relocate(), WorldObject::SetTransport(), sScriptMgr, Object::ToPlayer(), GameObject::ToTransport(), and MovementInfo::transport.

◆ BuildUpdate()

void StaticTransport::BuildUpdate ( UpdateDataMapType data_map,
UpdatePlayerSet  
)
overridevirtual

Reimplemented from WorldObject.

801{
802 Map::PlayerList const& players = GetMap()->GetPlayers();
803 if (players.IsEmpty())
804 return;
805
806 for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
807 BuildFieldsUpdate(itr->GetSource(), data_map);
808
809 ClearUpdateMask(true);
810}
bool IsEmpty() const
Definition: LinkedList.h:97
Definition: LinkedList.h:139
void BuildFieldsUpdate(Player *, UpdateDataMapType &)
Definition: Object.cpp:545
void ClearUpdateMask(bool remove)
Definition: Object.cpp:533
Map * GetMap() const
Definition: Object.h:531
PlayerList const & GetPlayers() const
Definition: Map.h:486
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37

References MapRefMgr::begin(), Object::BuildFieldsUpdate(), Object::ClearUpdateMask(), MapRefMgr::end(), WorldObject::GetMap(), Map::GetPlayers(), and LinkedListHead::IsEmpty().

◆ CleanupsBeforeDelete()

void StaticTransport::CleanupsBeforeDelete ( bool  finalCleanup = true)
overridevirtual

Reimplemented from GameObject.

787{
788 while (!_passengers.empty())
789 {
790 WorldObject* obj = *_passengers.begin();
791 RemovePassenger(obj);
792 obj->SetTransport(nullptr);
795 }
796
798}
void CleanupsBeforeDelete(bool finalCleanup=true) override
Definition: GameObject.cpp:104
void RemoveMovementFlag(uint32 flag)
Definition: Object.h:333
void Reset()
Definition: Object.h:287
Definition: Object.h:405
void RemovePassenger(WorldObject *passenger, bool withAll=false) override
Definition: Transport.cpp:989

References Transport::_passengers, GameObject::CleanupsBeforeDelete(), WorldObject::m_movementInfo, MOVEMENTFLAG_ONTRANSPORT, MovementInfo::RemoveMovementFlag(), RemovePassenger(), MovementInfo::TransportInfo::Reset(), WorldObject::SetTransport(), and MovementInfo::transport.

◆ Create()

bool StaticTransport::Create ( ObjectGuid::LowType  guidlow,
uint32  name_id,
Map map,
uint32  phaseMask,
float  x,
float  y,
float  z,
float  ang,
G3D::Quat const &  rotation,
uint32  animprogress,
GOState  go_state,
uint32  artKit = 0 
)
overridevirtual

Reimplemented from GameObject.

679{
680 ASSERT(map);
681 SetMap(map);
682
683 Relocate(x, y, z, ang);
684 m_stationaryPosition.Relocate(x, y, z, ang);
685 if (!IsPositionValid())
686 {
687 LOG_ERROR("entities.transport", "Gameobject (GUID: {} Entry: {}) not created. Suggested coordinates isn't valid (X: {} Y: {})", guidlow, name_id, x, y);
688 return false;
689 }
690
691 SetPhaseMask(phaseMask, false);
692
694
696 if (m_zoneScript)
697 {
698 name_id = m_zoneScript->GetGameObjectEntry(guidlow, name_id);
699 if (!name_id)
700 return false;
701 }
702
703 GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(name_id);
704 if (!goinfo)
705 {
706 LOG_ERROR("sql.sql", "Gameobject (GUID: {} Entry: {}) not created: non-existing entry in `gameobject_template`. Map: {} (X: {} Y: {} Z: {})", guidlow, name_id, map->GetId(), x, y, z);
707 return false;
708 }
709
710 Object::_Create(guidlow, 0, HighGuid::Transport);
711
712 m_goInfo = goinfo;
713
714 if (goinfo->type >= MAX_GAMEOBJECT_TYPE)
715 {
716 LOG_ERROR("sql.sql", "Gameobject (GUID: {} Entry: {}) not created: non-existing GO type '{}' in `gameobject_template`. It will crash client if created.", guidlow, name_id, goinfo->type);
717 return false;
718 }
719
720 // pussywizard: temporarily calculate WorldRotation from orientation, do so until values in db are correct
721 //SetWorldRotation( /*for StaticTransport we need 2 rotation Quats in db for World- and Path- Rotation*/ );
723 // pussywizard: PathRotation for StaticTransport (only StaticTransports have PathRotation)
724 SetTransportPathRotation(rotation.x, rotation.y, rotation.z, rotation.w);
725
726 SetObjectScale(goinfo->size);
727
728 if (GameObjectTemplateAddon const* addon = GetTemplateAddon())
729 {
730 SetUInt32Value(GAMEOBJECT_FACTION, addon->faction);
732 }
733
734 SetEntry(goinfo->entry);
735 SetName(goinfo->name);
736
737 SetDisplayId(goinfo->displayId);
738
739 if (!m_model)
741
743 SetGoState(go_state);
744 SetGoArtKit(artKit);
745
747 SetGoAnimProgress(animprogress);
748 m_goValue.Transport.AnimationInfo = sTransportMgr->GetTransportAnimInfo(goinfo->entry);
749 //ASSERT(m_goValue.Transport.AnimationInfo);
751 {
752 LOG_ERROR("vehicle", "StaticTransport::Create: No AnimationInfo was found for GameObject entry ({})", goinfo->entry);
753 return false;
754 }
755 //ASSERT(m_goValue.Transport.AnimationInfo->TotalTime > 0);
757 {
758 LOG_ERROR("vehicle", "StaticTransport::Create: AnimationInfo->TotalTime is 0 for GameObject entry ({})", goinfo->entry);
759 return false;
760 }
762 if (goinfo->transport.startOpen && goinfo->transport.pauseAtTime)
763 {
766 }
767 else
769
770 if (GameObjectAddon const* addon = sObjectMgr->GetGameObjectAddon(guidlow))
771 {
772 if (addon->InvisibilityValue)
773 {
774 m_invisibility.AddFlag(addon->invisibilityType);
775 m_invisibility.AddValue(addon->invisibilityType, addon->InvisibilityValue);
776 }
777 }
778
781
782 this->setActive(true);
783 return true;
784}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:156
#define sTransportMgr
Definition: TransportMgr.h:163
#define sObjectMgr
Definition: ObjectMgr.h:1623
@ GAMEOBJECT_FACTION
Definition: UpdateFields.h:402
@ GO_STATE_READY
Definition: GameObjectData.h:691
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:690
GameobjectTypes
Definition: SharedDefines.h:1559
#define MAX_GAMEOBJECT_TYPE
Definition: SharedDefines.h:1598
GameObjectFlags
Definition: SharedDefines.h:1602
TransportAnimation const * AnimationInfo
Definition: GameObject.h:56
struct GameObjectValue::@223 Transport
void SetLocalRotationAngles(float z_rot, float y_rot, float x_rot)
Definition: GameObject.cpp:2255
void SetGoState(GOState state)
Definition: GameObject.cpp:2477
GameObjectValue m_goValue
Definition: GameObject.h:393
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:137
void SetTransportPathRotation(float qx, float qy, float qz, float qw)
Definition: GameObject.cpp:2247
void SetGoArtKit(uint8 artkit)
Definition: GameObject.cpp:1443
Position m_stationaryPosition
Definition: GameObject.h:398
void SetPhaseMask(uint32 newPhaseMask, bool update) override
Definition: GameObject.cpp:2596
void SetGoAnimProgress(uint8 animprogress)
Definition: GameObject.h:211
GameObjectModel * CreateModel()
Definition: GameObject.cpp:2956
void SetGoType(GameobjectTypes type)
Definition: GameObject.h:205
bool AIM_Initialize()
Definition: GameObject.cpp:85
GameObjectModel * m_model
Definition: GameObject.h:313
GameObjectTemplateAddon const * GetTemplateAddon() const
Definition: GameObject.cpp:912
void SetDisplayId(uint32 displayid)
Definition: GameObject.cpp:2590
GameObjectTemplate const * m_goInfo
Definition: GameObject.h:391
void ReplaceAllGameObjectFlags(GameObjectFlags flags)
Definition: GameObject.h:221
Definition: GameObjectData.h:32
uint32 ScriptId
Definition: GameObjectData.h:394
uint32 type
Definition: GameObjectData.h:34
uint32 entry
Definition: GameObjectData.h:33
uint32 startOpen
Definition: GameObjectData.h:46
std::string name
Definition: GameObjectData.h:36
float size
Definition: GameObjectData.h:40
uint32 pauseAtTime
Definition: GameObjectData.h:187
uint32 displayId
Definition: GameObjectData.h:35
struct GameObjectTemplate::@227::@239 transport
Definition: GameObjectData.h:665
Definition: GameObjectData.h:682
void _Create(ObjectGuid::LowType guidlow, uint32 entry, HighGuid guidhigh)
Definition: Object.cpp:134
void SetEntry(uint32 entry)
Definition: Object.h:113
virtual void SetObjectScale(float scale)
Definition: Object.h:116
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:650
void AddFlag(FLAG_TYPE flag)
Definition: Object.h:368
void AddValue(FLAG_TYPE flag, T_VALUES value)
Definition: Object.h:373
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibility
Definition: Object.h:520
uint32 LastUsedScriptID
Definition: Object.h:596
void SetName(std::string const &newname)
Definition: Object.h:459
void SetZoneScript()
Definition: Object.cpp:2333
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
ZoneScript * m_zoneScript
Definition: Object.h:643
virtual void SetMap(Map *map)
Definition: Object.cpp:2105
void UpdatePositionData()
Definition: Object.cpp:1154
static float NormalizeOrientation(float o)
Definition: Position.h:233
float GetOrientation() const
Definition: Position.h:120
bool IsPositionValid() const
Definition: Position.cpp:175
void SetPathProgress(uint32 val)
Definition: Transport.h:41
void SetPauseTime(uint32 val)
Definition: Transport.h:130
uint32 GetId() const
Definition: Map.h:379
uint32 TotalTime
Definition: TransportMgr.h:93
virtual uint32 GetGameObjectEntry(ObjectGuid::LowType, uint32 entry)
Definition: ZoneScript.h:33

References Object::_Create(), _needDoInitialRelocation, FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::AddFlag(), FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::AddValue(), GameObject::AIM_Initialize(), GameObjectValue::AnimationInfo, ASSERT, GameObject::CreateModel(), GameObjectTemplate::displayId, GameObjectTemplate::entry, GAMEOBJECT_FACTION, ZoneScript::GetGameObjectEntry(), GameObject::GetGOInfo(), Map::GetId(), Position::GetOrientation(), GameObject::GetTemplateAddon(), GO_STATE_ACTIVE, GO_STATE_READY, Position::IsPositionValid(), WorldObject::LastUsedScriptID, LOG_ERROR, GameObject::m_goInfo, GameObject::m_goValue, WorldObject::m_invisibility, GameObject::m_model, GameObject::m_stationaryPosition, WorldObject::m_zoneScript, MAX_GAMEOBJECT_TYPE, GameObjectTemplate::name, Position::NormalizeOrientation(), GameObjectTemplate::pauseAtTime, Position::Relocate(), GameObject::ReplaceAllGameObjectFlags(), GameObjectTemplate::ScriptId, WorldObject::setActive(), GameObject::SetDisplayId(), Object::SetEntry(), GameObject::SetGoAnimProgress(), GameObject::SetGoArtKit(), GameObject::SetGoState(), GameObject::SetGoType(), GameObject::SetLocalRotationAngles(), WorldObject::SetMap(), WorldObject::SetName(), Object::SetObjectScale(), Transport::SetPathProgress(), SetPauseTime(), GameObject::SetPhaseMask(), GameObject::SetTransportPathRotation(), Object::SetUInt32Value(), WorldObject::SetZoneScript(), GameObjectTemplate::size, sObjectMgr, GameObjectTemplate::startOpen, sTransportMgr, TransportAnimation::TotalTime, GameObjectValue::Transport, GameObjectTemplate::transport, GameObjectTemplate::type, and WorldObject::UpdatePositionData().

◆ GetPauseTime()

uint32 StaticTransport::GetPauseTime ( ) const
inline
@ GAMEOBJECT_LEVEL
Definition: UpdateFields.h:403
uint32 GetUInt32Value(uint16 index) const
Definition: Object.cpp:305

References GAMEOBJECT_LEVEL, and Object::GetUInt32Value().

Referenced by GetPeriod(), and Update().

◆ GetPeriod()

uint32 StaticTransport::GetPeriod ( ) const
inline

◆ RelocateToProgress()

void StaticTransport::RelocateToProgress ( uint32  progress)
866{
867 TransportAnimationEntry const* curr = nullptr, *next = nullptr;
868 float percPos;
869 if (m_goValue.Transport.AnimationInfo->GetAnimNode(progress, curr, next, percPos))
870 {
871 // curr node offset
872 G3D::Vector3 pos = G3D::Vector3(curr->X, curr->Y, curr->Z);
873
874 // move by percentage of segment already passed
875 pos += G3D::Vector3(percPos * (next->X - curr->X), percPos * (next->Y - curr->Y), percPos * (next->Z - curr->Z));
876
877 // rotate path by PathRotation
878 // pussywizard: PathRotation in db is only simple orientation rotation, so don't use sophisticated and not working code
879 // reminder: WorldRotation only influences model rotation, not the path
880 float sign = GetFloatValue(GAMEOBJECT_PARENTROTATION + 2) >= 0.0f ? 1.0f : -1.0f;
881 float pathRotAngle = sign * 2.0f * acos(GetFloatValue(GAMEOBJECT_PARENTROTATION + 3));
882 float cs = cos(pathRotAngle), sn = std::sin(pathRotAngle);
883 float nx = pos.x * cs - pos.y * sn;
884 float ny = pos.x * sn + pos.y * cs;
885 pos.x = nx;
886 pos.y = ny;
887
888 // add stationary position to the calculated offset
889 pos += G3D::Vector3(GetStationaryX(), GetStationaryY(), GetStationaryZ());
890
891 // rotate by AnimRotation at current segment
892 // pussywizard: AnimRotation in dbc is only simple orientation rotation, so don't use sophisticated and not working code
893 G3D::Quat currRot, nextRot;
894 float percRot;
895 m_goValue.Transport.AnimationInfo->GetAnimRotation(progress, currRot, nextRot, percRot);
896 float signCurr = currRot.z >= 0.0f ? 1.0f : -1.0f;
897 float oriRotAngleCurr = signCurr * 2.0f * acos(currRot.w);
898 float signNext = nextRot.z >= 0.0f ? 1.0f : -1.0f;
899 float oriRotAngleNext = signNext * 2.0f * acos(nextRot.w);
900 float oriRotAngle = oriRotAngleCurr + percRot * (oriRotAngleNext - oriRotAngleCurr);
901
902 // check if position is valid
903 if (!Acore::IsValidMapCoord(pos.x, pos.y, pos.z))
904 return;
905
906 // update position to new one
907 // also adding simplified orientation rotation here
908 UpdatePosition(pos.x, pos.y, pos.z, NormalizeOrientation(GetStationaryO() + oriRotAngle));
909 }
910}
@ GAMEOBJECT_PARENTROTATION
Definition: UpdateFields.h:400
bool IsValidMapCoord(float c)
Definition: GridDefines.h:216
float GetStationaryZ() const override
Definition: GameObject.h:333
float GetStationaryY() const override
Definition: GameObject.h:332
float GetStationaryX() const override
Definition: GameObject.h:331
float GetStationaryO() const override
Definition: GameObject.h:334
float GetFloatValue(uint16 index) const
Definition: Object.cpp:317
void UpdatePosition(float x, float y, float z, float o)
Definition: Transport.cpp:912
bool GetAnimNode(uint32 time, TransportAnimationEntry const *&curr, TransportAnimationEntry const *&next, float &percPos) const
Definition: TransportMgr.cpp:493
void GetAnimRotation(uint32 time, G3D::Quat &curr, G3D::Quat &next, float &percRot) const
Definition: TransportMgr.cpp:512
Definition: DBCStructure.h:2003
float Y
Definition: DBCStructure.h:2008
float Z
Definition: DBCStructure.h:2009
float X
Definition: DBCStructure.h:2007

References GameObjectValue::AnimationInfo, GAMEOBJECT_PARENTROTATION, TransportAnimation::GetAnimNode(), TransportAnimation::GetAnimRotation(), Object::GetFloatValue(), GameObject::GetStationaryO(), GameObject::GetStationaryX(), GameObject::GetStationaryY(), GameObject::GetStationaryZ(), Acore::IsValidMapCoord(), GameObject::m_goValue, Position::NormalizeOrientation(), GameObjectValue::Transport, UpdatePosition(), TransportAnimationEntry::X, TransportAnimationEntry::Y, and TransportAnimationEntry::Z.

Referenced by Update().

◆ RemovePassenger()

void StaticTransport::RemovePassenger ( WorldObject passenger,
bool  withAll = false 
)
overridevirtual

Implements Transport.

990{
991 if (_passengers.erase(passenger))
992 {
993 if (Player* plr = passenger->ToPlayer())
994 {
995 sScriptMgr->OnRemovePassenger(ToTransport(), plr);
996 plr->SetFallInformation(GameTime::GetGameTime().count(), plr->GetPositionZ());
997 }
998
999 if (withAll)
1000 {
1001 passenger->SetTransport(nullptr);
1002 passenger->m_movementInfo.flags &= ~MOVEMENTFLAG_ONTRANSPORT;
1003 passenger->m_movementInfo.transport.guid.Clear();
1004 passenger->m_movementInfo.transport.pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
1005 }
1006 }
1007}
Seconds GetGameTime()
Definition: GameTime.cpp:38
void Clear()
Definition: ObjectGuid.h:138

References Transport::_passengers, ObjectGuid::Clear(), MovementInfo::flags, GameTime::GetGameTime(), MovementInfo::TransportInfo::guid, WorldObject::m_movementInfo, MovementInfo::TransportInfo::pos, Position::Relocate(), WorldObject::SetTransport(), sScriptMgr, Object::ToPlayer(), GameObject::ToTransport(), and MovementInfo::transport.

Referenced by CleanupsBeforeDelete().

◆ SetPauseTime()

void StaticTransport::SetPauseTime ( uint32  val)
inline

References GAMEOBJECT_LEVEL, and Object::SetUInt32Value().

Referenced by Create().

◆ Update()

void StaticTransport::Update ( uint32  diff)
overridevirtual

Reimplemented from GameObject.

813{
814 GameObject::Update(diff);
815
816 if (!IsInWorld())
817 return;
818
820 return;
821
823 {
826 }
827
828 if (GetPauseTime())
829 {
830 if (GetGoState() == GO_STATE_READY)
831 {
832 if (GetPathProgress() == 0) // waiting at it's destination for state change, do nothing
833 return;
834
835 if (GetPathProgress() < GetPauseTime()) // GOState has changed before previous state was reached, move to new destination immediately
837 else if (GetPathProgress() + diff < GetPeriod())
839 else
841 }
842 else
843 {
844 if (GetPathProgress() == GetPauseTime()) // waiting at it's destination for state change, do nothing
845 return;
846
847 if (GetPathProgress() > GetPauseTime()) // GOState has changed before previous state was reached, move to new destination immediately
849 else if (GetPathProgress() + diff < GetPauseTime())
851 else
853 }
854 }
855 else
856 {
858 if (GetPathProgress() >= GetPeriod())
860 }
861
863}
GOState GetGoState() const
Definition: GameObject.h:206
void Update(uint32 p_time) override
Definition: GameObject.cpp:447
bool IsInWorld() const
Definition: Object.h:104
uint32 GetPathProgress() const
Definition: Transport.h:40
void RelocateToProgress(uint32 progress)
Definition: Transport.cpp:865
uint32 GetPeriod() const
Definition: Transport.h:131

References _needDoInitialRelocation, GameObjectValue::AnimationInfo, GameObject::GetGoState(), Transport::GetPathProgress(), GetPauseTime(), GetPeriod(), GO_STATE_READY, Object::IsInWorld(), GameObject::m_goValue, RelocateToProgress(), Transport::SetPathProgress(), GameObjectValue::Transport, and GameObject::Update().

◆ UpdatePassengerPositions()

void StaticTransport::UpdatePassengerPositions ( )
922{
923 for (PassengerSet::iterator itr = _passengers.begin(); itr != _passengers.end(); ++itr)
924 {
925 WorldObject* passenger = *itr;
926
927 // if passenger is on vehicle we have to assume the vehicle is also on transport and its the vehicle that will be updating its passengers
928 if (Unit* unit = passenger->ToUnit())
929 if (unit->GetVehicle())
930 continue;
931
932 // Do not use Unit::UpdatePosition here, we don't want to remove auras as if regular movement occurred
933 float x, y, z, o;
934 passenger->m_movementInfo.transport.pos.GetPosition(x, y, z, o);
935 CalculatePassengerPosition(x, y, z, &o);
936
937 // check if position is valid
938 if (!Acore::IsValidMapCoord(x, y, z))
939 continue;
940
941 switch (passenger->GetTypeId())
942 {
943 case TYPEID_UNIT:
944 GetMap()->CreatureRelocation(passenger->ToCreature(), x, y, z, o);
945 break;
946 case TYPEID_PLAYER:
947 if (passenger->IsInWorld())
948 {
949 GetMap()->PlayerRelocation(passenger->ToPlayer(), x, y, z, o);
950 passenger->ToPlayer()->SetFallInformation(GameTime::GetGameTime().count(), z);
951 }
952 break;
954 GetMap()->GameObjectRelocation(passenger->ToGameObject(), x, y, z, o);
955 break;
957 GetMap()->DynamicObjectRelocation(passenger->ToDynObject(), x, y, z, o);
958 break;
959 default:
960 break;
961 }
962 }
963}
@ TYPEID_DYNAMICOBJECT
Definition: ObjectGuid.h:38
@ TYPEID_GAMEOBJECT
Definition: ObjectGuid.h:37
@ TYPEID_UNIT
Definition: ObjectGuid.h:35
@ TYPEID_PLAYER
Definition: ObjectGuid.h:36
DynamicObject * ToDynObject()
Definition: Object.h:218
TypeID GetTypeId() const
Definition: Object.h:124
GameObject * ToGameObject()
Definition: Object.h:210
Creature * ToCreature()
Definition: Object.h:202
Unit * ToUnit()
Definition: Object.h:206
void SetFallInformation(uint32 time, float z)
Definition: Player.h:2316
void CalculatePassengerPosition(float &x, float &y, float &z, float *o=nullptr) const override
This method transforms supplied transport offsets into global coordinates.
Definition: Transport.h:32
Definition: Unit.h:630
void PlayerRelocation(Player *, float x, float y, float z, float o)
Definition: Map.cpp:1000
void GameObjectRelocation(GameObject *go, float x, float y, float z, float o)
Definition: Map.cpp:1044
void CreatureRelocation(Creature *creature, float x, float y, float z, float o)
Definition: Map.cpp:1022
void DynamicObjectRelocation(DynamicObject *go, float x, float y, float z, float o)
Definition: Map.cpp:1065

References Transport::_passengers, Transport::CalculatePassengerPosition(), Map::CreatureRelocation(), Map::DynamicObjectRelocation(), Map::GameObjectRelocation(), GameTime::GetGameTime(), WorldObject::GetMap(), Position::GetPosition(), Object::GetTypeId(), Object::IsInWorld(), Acore::IsValidMapCoord(), WorldObject::m_movementInfo, Map::PlayerRelocation(), MovementInfo::TransportInfo::pos, Player::SetFallInformation(), Object::ToCreature(), Object::ToDynObject(), Object::ToGameObject(), Object::ToPlayer(), Object::ToUnit(), MovementInfo::transport, TYPEID_DYNAMICOBJECT, TYPEID_GAMEOBJECT, TYPEID_PLAYER, and TYPEID_UNIT.

Referenced by UpdatePosition().

◆ UpdatePosition()

void StaticTransport::UpdatePosition ( float  x,
float  y,
float  z,
float  o 
)
913{
914 if (!GetMap()->IsGridLoaded(x, y)) // pussywizard: should not happen, but just in case
915 GetMap()->LoadGrid(x, y);
916
917 GetMap()->GameObjectRelocation(this, x, y, z, o); // this also relocates the model
919}
void UpdatePassengerPositions()
Definition: Transport.cpp:921
void LoadGrid(float x, float y)
Definition: Map.cpp:492

References Map::GameObjectRelocation(), WorldObject::GetMap(), Map::LoadGrid(), and UpdatePassengerPositions().

Referenced by RelocateToProgress().

Member Data Documentation

◆ _needDoInitialRelocation

bool StaticTransport::_needDoInitialRelocation
private

Referenced by Create(), and Update().