AzerothCore 3.3.5a
OpenSource WoW Emulator
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.
void CalculatePassengerOffset (float &x, float &y, float &z, float *o=nullptr) const override
 This method transforms supplied global coordinates into local offsets.
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) const 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 SendMessageToSetInRange (WorldPacket const *data, float dist, bool, bool includeMargin=false, Player const *skipped_rcvr=nullptr) const override
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
void SaveInstanceData (uint8 state)
void UpdateInstanceData (uint8 state)
bool FindStateSavedOnInstance ()
bool ValidateGameobjectType ()
uint8 GetStateSavedOnInstance ()
bool IsInstanceGameobject ()
uint8 GameobjectStateToInt (GOState *state)
bool IsAbleToSaveOnDb ()
void UpdateSaveToDb (bool enable)
void SavingStateOnDB ()
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, bool includeMargin=false, Player const *skipped_rcvr=nullptr) 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 PlayDirectMusic (uint32 music_id, Player *target=nullptr)
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.
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) const
void SendUpdateToPlayer (Player *player)
void BuildValuesUpdateBlockForPlayer (UpdateData *data, Player *target) const
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 &) const
void SetFieldNotifyFlag (uint16 flag)
void RemoveFieldNotifyFlag (uint16 flag)
void ForceValuesUpdateAtIndex (uint32)
bool IsPlayer () const
PlayerToPlayer ()
Player const * ToPlayer () const
CreatureToCreature ()
Creature const * ToCreature () const
UnitToUnit ()
Unit const * ToUnit () const
GameObjectToGameObject ()
GameObject const * ToGameObject () const
CorpseToCorpse ()
Corpse const * ToCorpse () const
DynamicObjectToDynObject ()
DynamicObject const * ToDynObject () 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.
virtual void CalculatePassengerOffset (float &x, float &y, float &z, float *o=nullptr) const =0
 This method transforms supplied global coordinates into local offsets.

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
- 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) const
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.
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
uint32 _zoneId
uint32 _areaId
float _floorZ
bool _outdoors
LiquidData _liquidData
bool _updatePositionData
- 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 ( )
Definition: UpdateData.h:48
Definition: UpdateData.h:43
Definition: UpdateData.h:40
Definition: UpdateData.h:45
uint16 m_updateFlag
Definition: Object.h:231
Definition: Transport.h:31
bool _needDoInitialRelocation
Definition: Transport.h:133


◆ ~StaticTransport()

StaticTransport::~StaticTransport ( )
676 ASSERT(_passengers.empty());
#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 

Implements Transport.

968 if (_passengers.insert(passenger).second)
969 {
970 if (Player* plr = passenger->ToPlayer())
971 sScriptMgr->OnAddPassenger(ToTransport(), plr);
973 if (withAll)
974 {
975 if (Transport* t = passenger->GetTransport()) // SHOULD NEVER HAPPEN
976 t->RemovePassenger(passenger, false);
978 float x, y, z, o;
979 passenger->GetPosition(x, y, z, o);
980 CalculatePassengerOffset(x, y, z, &o);
982 passenger->SetTransport(this);
984 passenger->m_movementInfo.transport.guid = GetGUID();
985 passenger->m_movementInfo.transport.pos.Relocate(x, y, z, o);
986 }
987 }
Definition: Unit.h:561
#define sScriptMgr
Definition: ScriptMgr.h:2762
Transport * ToTransport()
Definition: GameObject.h:325
Player * ToPlayer()
Definition: Object.h:195
ObjectGuid GetGUID() const
Definition: Object.h:107
uint32 flags
Definition: Object.h:267
struct MovementInfo::TransportInfo transport
ObjectGuid guid
Definition: Object.h:284
Position pos
Definition: Object.h:285
void SetTransport(Transport *t)
Definition: Object.h:593
Transport * GetTransport() const
Definition: Object.h:585
MovementInfo m_movementInfo
Definition: Object.h:595
void GetPosition(float &x, float &y) const
Definition: Position.h:122
void Relocate(float x, float y)
Definition: Position.h:73
Definition: Player.h:1056
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,

Reimplemented from WorldObject.

803 Map::PlayerList const& players = GetMap()->GetPlayers();
804 if (players.IsEmpty())
805 return;
807 for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
808 BuildFieldsUpdate(itr->GetSource(), data_map);
810 ClearUpdateMask(true);
bool IsEmpty() const
Definition: LinkedList.h:97
Definition: LinkedList.h:139
void BuildFieldsUpdate(Player *, UpdateDataMapType &) const
Definition: Object.cpp:545
void ClearUpdateMask(bool remove)
Definition: Object.cpp:533
Map * GetMap() const
Definition: Object.h:517
PlayerList const & GetPlayers() const
Definition: Map.h:484
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)

Reimplemented from GameObject.

789 while (!_passengers.empty())
790 {
791 WorldObject* obj = *_passengers.begin();
792 RemovePassenger(obj);
793 obj->SetTransport(nullptr);
796 }
void CleanupsBeforeDelete(bool finalCleanup=true) override
Definition: GameObject.cpp:105
void RemoveMovementFlag(uint32 flag)
Definition: Object.h:321
void Reset()
Definition: Object.h:275
Definition: Object.h:393
void RemovePassenger(WorldObject *passenger, bool withAll=false) override
Definition: Transport.cpp:990

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 

Reimplemented from GameObject.

681 ASSERT(map);
682 SetMap(map);
684 Relocate(x, y, z, ang);
685 m_stationaryPosition.Relocate(x, y, z, ang);
686 if (!IsPositionValid())
687 {
688 LOG_ERROR("entities.transport", "Gameobject (GUID: {} Entry: {}) not created. Suggested coordinates isn't valid (X: {} Y: {})", guidlow, name_id, x, y);
689 return false;
690 }
692 SetPhaseMask(phaseMask, false);
697 if (m_zoneScript)
698 {
699 name_id = m_zoneScript->GetGameObjectEntry(guidlow, name_id);
700 if (!name_id)
701 return false;
702 }
704 GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(name_id);
705 if (!goinfo)
706 {
707 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);
708 return false;
709 }
711 Object::_Create(guidlow, 0, HighGuid::Transport);
713 m_goInfo = goinfo;
715 if (goinfo->type >= MAX_GAMEOBJECT_TYPE)
716 {
717 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);
718 return false;
719 }
721 // pussywizard: temporarily calculate WorldRotation from orientation, do so until values in db are correct
722 //SetWorldRotation( /*for StaticTransport we need 2 rotation Quats in db for World- and Path- Rotation*/ );
724 // pussywizard: PathRotation for StaticTransport (only StaticTransports have PathRotation)
725 SetTransportPathRotation(rotation.x, rotation.y, rotation.z, rotation.w);
727 SetObjectScale(goinfo->size);
729 if (GameObjectTemplateAddon const* addon = GetTemplateAddon())
730 {
731 SetUInt32Value(GAMEOBJECT_FACTION, addon->faction);
733 }
735 SetEntry(goinfo->entry);
736 SetName(goinfo->name);
738 SetDisplayId(goinfo->displayId);
740 if (!m_model)
744 SetGoState(go_state);
745 SetGoArtKit(artKit);
748 SetGoAnimProgress(animprogress);
749 m_goValue.Transport.AnimationInfo = sTransportMgr->GetTransportAnimInfo(goinfo->entry);
750 //ASSERT(m_goValue.Transport.AnimationInfo);
752 {
753 LOG_ERROR("vehicle", "StaticTransport::Create: No AnimationInfo was found for GameObject entry ({})", goinfo->entry);
754 return false;
755 }
756 //ASSERT(m_goValue.Transport.AnimationInfo->TotalTime > 0);
758 {
759 LOG_ERROR("vehicle", "StaticTransport::Create: AnimationInfo->TotalTime is 0 for GameObject entry ({})", goinfo->entry);
760 return false;
761 }
763 if (goinfo->transport.startOpen && goinfo->transport.pauseAtTime)
764 {
767 }
768 else
771 if (GameObjectAddon const* addon = sObjectMgr->GetGameObjectAddon(guidlow))
772 {
773 if (addon->InvisibilityValue)
774 {
775 m_invisibility.AddFlag(addon->invisibilityType);
776 m_invisibility.AddValue(addon->invisibilityType, addon->InvisibilityValue);
777 }
778 }
783 this->setActive(true);
784 return true;
#define LOG_ERROR(filterType__,...)
Definition: Log.h:159
Definition: GameObjectData.h:691
Definition: GameObjectData.h:690
Definition: UpdateFields.h:402
#define sObjectMgr
Definition: ObjectMgr.h:1640
#define sTransportMgr
Definition: TransportMgr.h:163
Definition: SharedDefines.h:1531
Definition: SharedDefines.h:1570
Definition: SharedDefines.h:1574
struct GameObjectValue::@221 Transport
TransportAnimation const * AnimationInfo
Definition: GameObject.h:57
void SetLocalRotationAngles(float z_rot, float y_rot, float x_rot)
Definition: GameObject.cpp:2252
void SetGoState(GOState state)
Definition: GameObject.cpp:2467
GameObjectValue m_goValue
Definition: GameObject.h:400
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:138
void SetTransportPathRotation(float qx, float qy, float qz, float qw)
Definition: GameObject.cpp:2244
void SetGoArtKit(uint8 artkit)
Definition: GameObject.cpp:1441
Position m_stationaryPosition
Definition: GameObject.h:405
void SetPhaseMask(uint32 newPhaseMask, bool update) override
Definition: GameObject.cpp:2641
void SetGoAnimProgress(uint8 animprogress)
Definition: GameObject.h:212
GameObjectModel * CreateModel()
Definition: GameObject.cpp:3001
void SetGoType(GameobjectTypes type)
Definition: GameObject.h:206
bool AIM_Initialize()
Definition: GameObject.cpp:86
GameObjectModel * m_model
Definition: GameObject.h:316
GameObjectTemplateAddon const * GetTemplateAddon() const
Definition: GameObject.cpp:909
void SetDisplayId(uint32 displayid)
Definition: GameObject.cpp:2635
GameObjectTemplate const * m_goInfo
Definition: GameObject.h:398
void ReplaceAllGameObjectFlags(GameObjectFlags flags)
Definition: GameObject.h:222
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
struct GameObjectTemplate::@225::@237 transport
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
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:110
virtual void SetObjectScale(float scale)
Definition: Object.h:113
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:650
void AddFlag(FLAG_TYPE flag)
Definition: Object.h:356
void AddValue(FLAG_TYPE flag, T_VALUES value)
Definition: Object.h:361
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibility
Definition: Object.h:506
uint32 LastUsedScriptID
Definition: Object.h:582
void SetName(std::string const &newname)
Definition: Object.h:447
void SetZoneScript()
Definition: Object.cpp:2321
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
ZoneScript * m_zoneScript
Definition: Object.h:629
virtual void SetMap(Map *map)
Definition: Object.cpp:2096
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:378
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
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

◆ RelocateToProgress()

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

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 

Implements Transport.

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

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)

References GAMEOBJECT_LEVEL, and Object::SetUInt32Value().

Referenced by Create().

◆ Update()

void StaticTransport::Update ( uint32  diff)

Reimplemented from GameObject.

815 GameObject::Update(diff);
817 if (!IsInWorld())
818 return;
821 return;
824 {
827 }
829 if (GetPauseTime())
830 {
831 if (GetGoState() == GO_STATE_READY)
832 {
833 if (GetPathProgress() == 0) // waiting at it's destination for state change, do nothing
834 return;
836 if (GetPathProgress() < GetPauseTime()) // GOState has changed before previous state was reached, move to new destination immediately
838 else if (GetPathProgress() + diff < GetPeriod())
840 else
842 }
843 else
844 {
845 if (GetPathProgress() == GetPauseTime()) // waiting at it's destination for state change, do nothing
846 return;
848 if (GetPathProgress() > GetPauseTime()) // GOState has changed before previous state was reached, move to new destination immediately
850 else if (GetPathProgress() + diff < GetPauseTime())
852 else
854 }
855 }
856 else
857 {
859 if (GetPathProgress() >= GetPeriod())
861 }
GOState GetGoState() const
Definition: GameObject.h:207
void Update(uint32 p_time) override
Definition: GameObject.cpp:440
bool IsInWorld() const
Definition: Object.h:101
uint32 GetPathProgress() const
Definition: Transport.h:40
void RelocateToProgress(uint32 progress)
Definition: Transport.cpp:866
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 ( )
924 for (PassengerSet::iterator itr = _passengers.begin(); itr != _passengers.end(); ++itr)
925 {
926 WorldObject* passenger = *itr;
928 // 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
929 if (Unit* unit = passenger->ToUnit())
930 if (unit->GetVehicle())
931 continue;
933 // Do not use Unit::UpdatePosition here, we don't want to remove auras as if regular movement occurred
934 float x, y, z, o;
935 passenger->m_movementInfo.transport.pos.GetPosition(x, y, z, o);
936 CalculatePassengerPosition(x, y, z, &o);
938 // check if position is valid
939 if (!Acore::IsValidMapCoord(x, y, z))
940 continue;
942 switch (passenger->GetTypeId())
943 {
944 case TYPEID_UNIT:
945 GetMap()->CreatureRelocation(passenger->ToCreature(), x, y, z, o);
946 break;
948 if (passenger->IsInWorld())
949 {
950 GetMap()->PlayerRelocation(passenger->ToPlayer(), x, y, z, o);
951 passenger->ToPlayer()->SetFallInformation(GameTime::GetGameTime().count(), z);
952 }
953 break;
955 GetMap()->GameObjectRelocation(passenger->ToGameObject(), x, y, z, o);
956 break;
958 GetMap()->DynamicObjectRelocation(passenger->ToDynObject(), x, y, z, o);
959 break;
960 default:
961 break;
962 }
963 }
Definition: ObjectGuid.h:40
Definition: ObjectGuid.h:39
Definition: ObjectGuid.h:37
Definition: ObjectGuid.h:38
DynamicObject * ToDynObject()
Definition: Object.h:208
TypeID GetTypeId() const
Definition: Object.h:121
GameObject * ToGameObject()
Definition: Object.h:202
Creature * ToCreature()
Definition: Object.h:197
Unit * ToUnit()
Definition: Object.h:200
void SetFallInformation(uint32 time, float z)
Definition: Player.h:2295
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:1302
void PlayerRelocation(Player *, float x, float y, float z, float o)
Definition: Map.cpp:1003
void GameObjectRelocation(GameObject *go, float x, float y, float z, float o)
Definition: Map.cpp:1047
void CreatureRelocation(Creature *creature, float x, float y, float z, float o)
Definition: Map.cpp:1025
void DynamicObjectRelocation(DynamicObject *go, float x, float y, float z, float o)
Definition: Map.cpp:1068

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 
915 if (!GetMap()->IsGridLoaded(x, y)) // pussywizard: should not happen, but just in case
916 GetMap()->LoadGrid(x, y);
918 GetMap()->GameObjectRelocation(this, x, y, z, o); // this also relocates the model
void UpdatePassengerPositions()
Definition: Transport.cpp:922
void LoadGrid(float x, float y)
Definition: Map.cpp:494

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

Referenced by RelocateToProgress().

Member Data Documentation

◆ _needDoInitialRelocation

bool StaticTransport::_needDoInitialRelocation

Referenced by Create(), and Update().