46#include <G3D/CoordinateFrame.h>
59 std::string locName =
name;
70 queryTemp.
Allow =
true;
84 if (std::vector<uint32>
const* items =
sObjectMgr->GetGameObjectQuestItemList(
entry))
86 if (i < items->
size())
91 return queryTemp.
Move();
96 return fabs(
x *
x +
y *
y +
z *
z +
w *
w - 1.0f) < 1e-5f;
101 G3D::Matrix3(G3D::Quat(
x,
y,
z,
w)).toEulerAnglesZYX(Z, Y, X);
106 G3D::Quat quat(G3D::Matrix3::fromEulerAnglesZYX(Z, Y, X));
111 m_model(nullptr), m_goValue(), m_stringIds(), m_AI(nullptr), m_respawnCompatibilityMode(false)
192 owner->RemoveGameObject(
this,
false);
198 TC_LOG_DEBUG(
"misc",
"Removed GameObject ({} Entry: {} SpellId: {} LinkedGO: {}) that just lost any reference to the owner ({}) GO list",
220 trans->SetDelayedAddModelToMap();
245 linkedTrap->DespawnOrUnsummon();
255bool GameObject::Create(
ObjectGuid::LowType guidlow,
uint32 name_id,
Map* map,
uint32 phaseMask,
Position const& pos,
QuaternionData const& rotation,
uint32 animprogress,
GOState go_state,
uint32 artKit ,
bool dynamic,
ObjectGuid::LowType spawnid)
292 TC_LOG_ERROR(
"sql.sql",
"Gameobject (GUID: {} Entry: {}) not created: gameobject type GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT cannot be manually created.", guidlow, name_id);
306 TC_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);
342 switch (goinfo->
type)
381 if (trapSpell->IsPositive())
383 bool targetsAlly =
false;
384 bool targetsEnemy =
false;
395 if (!spellEffectInfo.IsEffect())
398 targetsAlly = targetsAlly || isAllyTarget(spellEffectInfo.TargetA) || isAllyTarget(spellEffectInfo.TargetB);
399 targetsEnemy = targetsEnemy || isEnemyTarget(spellEffectInfo.TargetA) || isEnemyTarget(spellEffectInfo.TargetB);
460 TC_LOG_ERROR(
"misc",
"Could not initialize GameObjectAI");
488 if (owner->IsInCombat())
579 if (linkedRespawntime)
582 if (targetGuid == dbtableHighGuid)
680 Unit* target =
nullptr;
795 bg->HandleTriggerBuff(
GetGUID());
808 linkedTrap->DespawnOrUnsummon();
820 owner->CastSpell(owner, spellId,
false);
983 if (fishloot->
empty())
988 if (fishloot->
empty())
1003 if (fishloot->
empty())
1007 if (fishloot->
empty())
1020 TC_LOG_ERROR(
"misc",
"GameObject::SaveToDB failed, cannot get gameobject data!");
1062 trans->Append(stmt);
1068 stmt->
setUInt8(index++, spawnMask);
1081 trans->Append(stmt);
1092 TC_LOG_ERROR(
"sql.sql",
"Gameobject (GUID: {}) not found in table `gameobject`, can't load. ", spawnId);
1136 TC_LOG_WARN(
"sql.sql",
"GameObject {} (SpawnID {}) is not spawned by default, but tries to use a non-hack spawn system. This will not work. Defaulting to compatibility mode.", entry, spawnId);
1149 if (addToMap && !
GetMap()->AddToMap(
this))
1164 [spawnId, charTrans](
Map* map) ->
void
1167 std::vector<GameObject*> toUnload;
1168 for (auto const& pair : Trinity::Containers::MapEqualRange(map->GetGameObjectBySpawnIdStore(), spawnId))
1169 toUnload.push_back(pair.second);
1170 for (GameObject* obj : toUnload)
1171 map->AddObjectToRemoveList(obj);
1172 map->RemoveRespawnTime(SPAWN_TYPE_GAMEOBJECT, spawnId, charTrans);
1186 trans->Append(stmt);
1191 trans->Append(stmt);
1195 trans->Append(stmt);
1200 trans->Append(stmt);
1205 trans->Append(stmt);
1210 trans->Append(stmt);
1215 trans->Append(stmt);
1219 trans->Append(stmt);
1293 if (
GetGOInfo()->GetServerOnly() && !allowServersideObjects)
1340 return owner->GetLevelForTarget(target);
1346 if (
const Unit* targetUnit = target->
ToUnit())
1347 return targetUnit->GetLevel();
1445 trapGO->CastSpell(target, trapSpell->
Id);
1474 if (!time_to_restore)
1485 Unit* unitCaster = spellCaster ? spellCaster->
ToUnit() :
nullptr;
1490 TC_LOG_FATAL(
"spell",
"Spell {} has action type NONE in effect {}", spellId, effectIndex);
1558 if (templateAddon !=
nullptr)
1559 artKitValue = templateAddon->
artKits[artKitIndex];
1561 if (artKitValue == 0)
1562 TC_LOG_ERROR(
"sql.sql",
"GameObject {} hit by spell {} needs `artkit{}` in `gameobject_template_addon`",
GetEntry(), spellId, artKitIndex);
1572 TC_LOG_ERROR(
"spell",
"Spell {} has unhandled action {} in effect {}", spellId,
int32(action), effectIndex);
1594 data =
sObjectMgr->GetGameObjectData(lowguid);
1616 Unit* spellCaster = user;
1618 bool triggered =
false;
1619 bool addUse =
false;
1629 playerUser->PlayerTalkClass->ClearMenus();
1630 if (
AI()->OnGossipHello(playerUser))
1707 bool found_free_slot =
false;
1711 float relativeDistance = (info->
size*itr->first)-(info->
size*(info->
chair.
slots-1)/2.0f);
1713 float x_i =
GetPositionX() + relativeDistance * std::cos(orthogonalOrientation);
1714 float y_i =
GetPositionY() + relativeDistance * std::sin(orthogonalOrientation);
1716 if (!itr->second.IsEmpty())
1720 if (ChairUser->IsSitState() && ChairUser->GetStandState() !=
UNIT_STAND_STATE_SIT && ChairUser->GetExactDist2d(x_i, y_i) < 0.1f)
1723 itr->second.Clear();
1726 itr->second.Clear();
1729 found_free_slot =
true;
1734 if (thisDistance <= lowestDist)
1736 nearest_slot = itr->first;
1737 lowestDist = thisDistance;
1743 if (found_free_slot)
1745 ChairSlotAndUser::iterator itr =
ChairListSlots.find(nearest_slot);
1748 itr->second = player->
GetGUID();
1768 player->SendDirectMessage(&data);
1773 player->SendPreparedGossip(
this);
1791 if (
Group* group = player->GetGroup())
1793 for (
GroupReference const* itr = group->GetFirstMember(); itr !=
nullptr; itr = itr->next())
1794 if (
Player* member = itr->GetSource())
1795 if (member->IsAtGroupRewardDistance(
this))
1818 spellCaster =
nullptr;
1863 zone_skill =
sObjectMgr->GetFishingBaseSkillLevel(zone);
1867 TC_LOG_ERROR(
"sql.sql",
"Fishable areaId {} are not properly defined in `skill_fishing_base_level`.", subzone);
1872 if (skill < zone_skill)
1874 chance =
int32(pow((
double)skill/zone_skill, 2) * 100);
1883 TC_LOG_DEBUG(
"misc",
"Fishing check (skill: {} zone min skill: {} chance {} roll: {}", skill, zone_skill, chance, roll);
1892 if (chance >= roll || fishingPool)
1902 fishingPool->
Use(player);
1939 Player* m_ritualOwner =
nullptr;
1944 if (!m_ritualOwner && !owner)
1947 m_ritualOwner = player;
1964 spellCaster = owner;
1971 spellCaster = player;
1988 spellCaster = m_ritualOwner;
1992 if (spellId == 62330)
2042 if (ownerGuid != user->
GetGUID())
2045 ownerGuid = owner->GetCharmerOrOwnerOrOwnGUID();
2052 if (!group || !group->
IsMember(ownerGuid))
2075 if (!targetPlayer || targetPlayer == player || !targetPlayer->
IsInSameRaidWith(player))
2080 if (level < info->meetingstone.minLevel)
2083 if (level < info->meetingstone.minLevel)
2086 if (info->
entry == 194097)
2166 switch (info->
entry)
2207 TC_LOG_ERROR(
"misc",
"GameObject::Use(): unit ({}, name: {}) tries to use object ({}, name: {}) of unknown type ({})",
2220 TC_LOG_DEBUG(
"outdoorpvp",
"WORLD: {} non-dbc spell was handled by OutdoorPvP", spellId);
2229 castResult = spellCaster->
CastSpell(user, spellId, triggered);
2256 float dist = std::sqrt(dx*dx + dy*dy);
2259 if (G3D::fuzzyEq(dist, 0.0f))
2262 float sinB = dx / dist;
2263 float cosB = dy / dist;
2264 dx = dist * (cosA * cosB + sinA * sinB);
2265 dy = dist * (cosA * sinB - sinA * cosB);
2284 bgMap->GetBG()->ProcessEvent(
this, eventId, invoker);
2307 return std::ranges::any_of(
m_stringIds, [
id](std::string
const* stringId) {
return stringId && *stringId == id; });
2331 if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty())
2332 return cl->Name[uloc_idx];
2340 static const int32 PACK_YZ = 1 << 20;
2341 static const int32 PACK_X = PACK_YZ << 1;
2343 static const int32 PACK_YZ_MASK = (PACK_YZ << 1) - 1;
2344 static const int32 PACK_X_MASK = (PACK_X << 1) - 1;
2355 G3D::Quat rotation(qx, qy, qz, qw);
2374 G3D::Quat quat(G3D::Matrix3::fromEulerAnglesZYX(z_rot, y_rot, x_rot));
2385 G3D::Quat worldRotationQuat(worldRotation.
x, worldRotation.
y, worldRotation.
z, worldRotation.
w);
2386 G3D::Quat localRotationQuat(localRotation.
x, localRotation.
y, localRotation.
z, localRotation.
w);
2388 G3D::Quat resultRotation = localRotationQuat * worldRotationQuat;
2390 return QuaternionData(resultRotation.x, resultRotation.y, resultRotation.z, resultRotation.w);
2392 return localRotation;
2420 data << player->GetPackGUID();
2424 player->SendDirectMessage(&data);
2469 if (modelData->State1Wmo)
2470 modelId = modelData->State1Wmo;
2491 bg->DestroyGate(player,
this);
2498 if (modelData->State2Wmo)
2499 modelId = modelData->State2Wmo;
2517 if (modelData->State3Wmo)
2518 modelId = modelData->State3Wmo;
2560 bool collision =
false;
2563 collision = !collision;
2585 bool collision =
false;
2587 collision = !collision;
2725 updateMask.
SetBit(index);
2730 int16 pathProgress = -1;
2741 else if (targetIsGM)
2754 pathProgress =
int16(timer /
float(transportPeriod) * 65535.0f);
2762 fieldBuffer <<
uint16(dynFlags);
2763 fieldBuffer <<
int16(pathProgress);
2772 fieldBuffer << goFlags;
2780 data->
append(fieldBuffer);
2876 std::stringstream sstr;
2904 float minX = displayInfo->GeoBoxMin.X * scale - radius;
2905 float minY = displayInfo->GeoBoxMin.Y * scale - radius;
2906 float minZ = displayInfo->GeoBoxMin.Z * scale - radius;
2907 float maxX = displayInfo->GeoBoxMax.X * scale + radius;
2908 float maxY = displayInfo->GeoBoxMax.Y * scale + radius;
2909 float maxZ = displayInfo->GeoBoxMax.Z * scale + radius;
2912 G3D::Quat worldRotationQuat(worldRotation.
x, worldRotation.
y, worldRotation.
z, worldRotation.
w);
2915 .toWorldSpace(G3D::Box { { minX, minY, minZ }, { maxX, maxY, maxZ } })
2956 if (spellEffectInfo.CalcValue(player) >=
int32(lock->
Skill[i]))
@ ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT
DBCStorage< DestructibleModelDataEntry > sDestructibleModelDataStore(DestructibleModelDatafmt)
DBCStorage< LockEntry > sLockStore(LockEntryfmt)
DBCStorage< GameObjectDisplayInfoEntry > sGameObjectDisplayInfoStore(GameObjectDisplayInfofmt)
SQLTransaction< WorldDatabaseConnection > WorldDatabaseTransaction
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
std::chrono::seconds Seconds
Seconds shorthand typedef.
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
#define MAX_GAMEOBJECT_QUEST_ITEMS
#define FISHING_BOBBER_READY_TIME
@ GRID_MAP_TYPE_MASK_PLAYER
@ GRID_MAP_TYPE_MASK_CREATURE
#define TC_LOG_WARN(filterType__,...)
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
#define TC_LOG_FATAL(filterType__,...)
LootStore LootTemplates_Gameobject("gameobject_loot_template", "gameobject entry", true)
LootStore LootTemplates_Fishing("fishing_loot_template", "area id", true)
#define DEFAULT_VISIBILITY_DISTANCE
@ TEMPSUMMON_MANUAL_DESPAWN
#define INTERACTION_DISTANCE
ScriptMapMap sEventScripts
@ TELE_TO_NOT_LEAVE_COMBAT
@ TELE_TO_NOT_UNSUMMON_PET
@ TELE_TO_NOT_LEAVE_TRANSPORT
@ QUEST_STATUS_INCOMPLETE
@ DIALOG_STATUS_UNAVAILABLE
int32 irand(int32 min, int32 max)
uint32 urand(uint32 min, uint32 max)
@ GAMEOBJECT_TYPE_GUILD_BANK
@ GAMEOBJECT_TYPE_MINI_GAME
@ GAMEOBJECT_TYPE_MAP_OBJECT
@ GAMEOBJECT_TYPE_SPELL_FOCUS
@ GAMEOBJECT_TYPE_TRANSPORT
@ GAMEOBJECT_TYPE_MEETINGSTONE
@ GAMEOBJECT_TYPE_GENERIC
@ GAMEOBJECT_TYPE_FISHINGHOLE
@ GAMEOBJECT_TYPE_FLAGDROP
@ GAMEOBJECT_TYPE_QUESTGIVER
@ GAMEOBJECT_TYPE_MAILBOX
@ GAMEOBJECT_TYPE_SPELLCASTER
@ GAMEOBJECT_TYPE_FLAGSTAND
@ GAMEOBJECT_TYPE_DUNGEON_DIFFICULTY
@ GAMEOBJECT_TYPE_AREADAMAGE
@ GAMEOBJECT_TYPE_FISHINGNODE
@ GAMEOBJECT_TYPE_BARBER_CHAIR
@ GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT
@ GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING
#define MAX_GAMEOBJECT_TYPE
#define MAX_GAMEOBJECT_DATA
GameObjectDestructibleState
@ GO_DESTRUCTIBLE_DESTROYED
@ GO_DESTRUCTIBLE_REBUILDING
@ GO_DESTRUCTIBLE_DAMAGED
@ SPAWNGROUP_FLAG_COMPATIBILITY_MODE
@ LINKED_RESPAWN_CREATURE_TO_GO
@ LINKED_RESPAWN_GO_TO_GO
@ LINKED_RESPAWN_GO_TO_CREATURE
@ SPELL_AURA_MOD_INVISIBILITY
@ TARGET_OBJECT_TYPE_UNIT
@ UNIT_STAND_STATE_SIT_LOW_CHAIR
@ CURRENT_CHANNELED_SPELL
@ UPDATEFLAG_STATIONARY_POSITION
uint32 GameObjectUpdateFieldFlags[GAMEOBJECT_END]
@ GAMEOBJECT_PARENTROTATION
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
@ WORLD_DEL_EVENT_GAMEOBJECT
@ WORLD_DEL_SPAWNGROUP_MEMBER
@ WORLD_DEL_LINKED_RESPAWN
@ WORLD_DEL_GAMEOBJECT_ADDON
@ WORLD_DEL_LINKED_RESPAWN_MASTER
BattlegroundTypeId GetTypeID(bool GetRandom=false) const
virtual void EventPlayerClickedOnFlag(Player *, GameObject *)
void AddFlag(FLAG_TYPE flag)
void AddValue(FLAG_TYPE flag, T_VALUES value)
virtual void Damaged(WorldObject *, uint32)
virtual void OnStateChanged(uint32)
virtual void InitializeAI()
virtual void UpdateAI(uint32)
virtual void Destroyed(WorldObject *, uint32)
virtual void EventInform(uint32)
virtual void OnLootStateChanged(uint32, Unit *)
float GetScale() const override
uint32 GetDisplayId() const override
G3D::Vector3 GetPosition() const override
float GetOrientation() const override
uint32 GetPhaseMask() const override
GameObjectModelOwnerImpl(GameObject *owner)
bool IsSpawned() const override
void DebugVisualizeCorner(G3D::Vector3 const &corner) const override
static GameObjectModel * Create(std::unique_ptr< GameObjectModelOwnerBase > modelOwner, std::string const &dataPath)
void enable(uint32 ph_mask)
void getFishLootJunk(Loot *loot, Player *loot_owner)
void SetLocalRotationAngles(float z_rot, float y_rot, float x_rot)
bool HasStringId(std::string_view id) const
void GetRespawnPosition(float &x, float &y, float &z, float *ori=nullptr) const
void SetGoState(GOState state)
ObjectGuid GetOwnerGUID() const override
bool IsWithinDistInMap(Player const *player) const
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=nullptr)
GameObjectValue m_goValue
GameObjectTemplate const * GetGOInfo() const
GOState GetGoState() const
std::string GetDebugInfo() const override
bool LoadFromDB(ObjectGuid::LowType spawnId, Map *map, bool addToMap, bool=true)
void RemoveFlag(GameObjectFlags flags)
bool hasInvolvedQuest(uint32 quest_id) const override
void SetGoArtKit(uint8 artkit)
GameObjectData const * m_goData
LootState getLootState() const
uint32 GetSpellId() const
uint8 GetGoAnimProgress() const
Position m_stationaryPosition
void InheritStringIds(GameObject const *parent)
void SetLootRecipient(Unit *unit, Group *group=nullptr)
void SetPhaseMask(uint32 newPhaseMask, bool update) override
ObjectGuid m_lootRecipientGroup
QuaternionData const & GetLocalRotation() const
Group * GetLootRecipientGroup() const
uint32 GetUniqueUseCount() const
void ReplaceAllFlags(GameObjectFlags flags)
void RemoveFromWorld() override
void EnableCollision(bool enable)
uint8 GetGoArtKit() const
void SetGoAnimProgress(uint8 animprogress)
ObjectGuid m_lootStateUnitGUID
uint8 GetLevelForTarget(WorldObject const *target) const override
bool IsAtInteractDistance(Position const &pos, float radius) const
void SetOwnerGUID(ObjectGuid owner)
void DespawnOrUnsummon(Milliseconds delay=0ms, Seconds forceRespawnTime=0s)
void SetDestructibleState(GameObjectDestructibleState state, WorldObject *attackerOrHealer=nullptr, bool setHealth=false)
ChairSlotAndUser ChairListSlots
virtual uint32 GetTransportPeriod() const
void SetScriptStringId(std::string id)
bool ActivateToQuest(Player const *target) const
void SetFlag(GameObjectFlags flags)
Player * GetLootRecipient() const
bool IsAlwaysVisibleFor(WorldObject const *seer) const override
std::array< std::string const *, 3 > m_stringIds
bool HasLootRecipient() const
void SetLootState(LootState s, Unit *unit=nullptr)
uint32 m_respawnDelayTime
SpellInfo const * GetSpellForLock(Player const *player) const
GameObjectAI * AI() const
GameObject * GetLinkedTrap()
bool IsInRange(float x, float y, float z, float radius) const
void SetRespawnTime(int32 respawn)
void TriggeringLinkedGameObject(uint32 trapEntry, Unit *target)
void SetRespawnCompatibilityMode(bool mode=true)
GameobjectTypes GetGoType() const
void SetGoType(GameobjectTypes type)
Seconds m_despawnRespawnTime
QuaternionData m_localRotation
void SetLinkedTrap(GameObject *linkedTrap)
void SetLocalRotation(float qx, float qy, float qz, float qw)
GameObjectData const * GetGameObjectData() const
bool m_respawnCompatibilityMode
GameObjectTemplateAddon const * m_goTemplateAddon
ObjectGuid::LowType GetSpawnId() const
void SaveRespawnTime(uint32 forceDelay=0)
float GetInteractionDistance() const
void ActivateObject(GameObjectActions action, WorldObject *spellCaster=nullptr, uint32 spellId=0, int32 effectIndex=-1)
void SendCustomAnim(uint32 anim)
time_t GetRespawnTimeEx() const
bool hasQuest(uint32 quest_id) const override
uint32 GetDisplayId() const
GameObjectModel * m_model
void SetLevel(uint32 level)
uint32 GetScriptId() const
Optional< std::string > m_scriptStringId
void UpdateModelPosition()
GameObjectTemplateAddon const * GetTemplateAddon() const
void ModifyHealth(int32 change, WorldObject *attackerOrHealer=nullptr, uint32 spellId=0)
GameObject * LookupFishingHoleAround(float range)
void SetDisplayId(uint32 displayid)
GameObjectTemplate const * m_goInfo
void SetLootGenerationTime()
ObjectGuid::LowType m_spawnId
For new or temporary gameobjects is 0 for saved it is lowguid.
std::string_view GetStringId(StringIdType type) const
bool IsDynTransport() const
void SwitchDoorOrButton(bool activate, bool alternative=false)
void CleanupsBeforeDelete(bool finalCleanup=true) override
bool IsDestructibleBuilding() const
bool IsNeverVisible(bool allowServersideObjects) const override
bool IsInvisibleDueToDespawn() const override
QuaternionData GetWorldRotation() const
static bool DeleteFromDB(ObjectGuid::LowType spawnId)
void getFishLoot(Loot *loot, Player *loot_owner)
void UpdatePackedRotation()
Transport * ToTransport()
void AddToWorld() override
GameObjectDestructibleState GetDestructibleState() const
void Update(uint32 p_time) override
bool IsLootAllowedFor(Player const *player) const
void AddUniqueUse(Player *player)
std::string const & GetAIName() const
GameObjectOverride const * GetGameObjectOverride() const
void SetParentRotation(QuaternionData const &rotation)
ObjectGuid lootingGroupLowGUID
ObjectGuid m_ritualOwnerGUID
bool Create(ObjectGuid::LowType guidlow, uint32 name_id, Map *map, uint32 phaseMask, Position const &pos, QuaternionData const &rotation, uint32 animprogress, GOState go_state, uint32 artKit=0, bool dynamic=false, ObjectGuid::LowType spawnid=0)
std::string const & GetNameForLocaleIdx(LocaleConstant locale) const override
void EventInform(uint32 eventId, WorldObject *invoker=nullptr)
void SetSpellId(uint32 id)
void BuildValuesUpdate(uint8 updatetype, ByteBuffer *data, Player const *target) const override
ObjectGuid m_lootRecipient
void SetFaction(uint32 faction) override
uint32 m_lootGenerationTime
ObjectGuid GetGUID() const
bool IsMember(ObjectGuid guid) const
bool HaveQuestLootForPlayer(uint32 loot_id, Player const *player) const
void ScriptsStart(std::map< uint32, std::multimap< uint32, ScriptInfo > > const &scripts, uint32 id, Object *source, Object *target)
Put scripts in the execution queue.
MapStoredObjectTypesContainer & GetObjectsStore()
void RemoveGameObjectModel(GameObjectModel const &model)
time_t GetLinkedRespawnTime(ObjectGuid guid) const
void RemoveRespawnTime(SpawnObjectType type, ObjectGuid::LowType spawnId, CharacterDatabaseTransaction dbTrans=nullptr, bool alwaysDeleteFromDB=false)
void ApplyDynamicModeRespawnScaling(WorldObject const *obj, ObjectGuid::LowType spawnId, uint32 &respawnDelay, uint32 mode) const
ObjectGuid::LowType GenerateLowGuid()
time_t GetGORespawnTime(ObjectGuid::LowType spawnId) const
void SaveRespawnInfoDB(RespawnInfo const &info, CharacterDatabaseTransaction dbTrans=nullptr)
void SaveRespawnTime(SpawnObjectType type, ObjectGuid::LowType spawnId, uint32 entry, time_t respawnTime, uint32 gridId, CharacterDatabaseTransaction dbTrans=nullptr, bool startup=false)
GameObjectBySpawnIdContainer & GetGameObjectBySpawnIdStore()
void InsertGameObjectModel(GameObjectModel const &model)
void Respawn(RespawnInfo *info, CharacterDatabaseTransaction dbTrans=nullptr)
static ObjectGuid const Empty
std::string ToString() const
static std::string_view GetLocaleString(std::vector< std::string > const &data, size_t locale)
void SetByteValue(uint16 index, uint8 offset, uint8 value)
void BuildValuesUpdateBlockForPlayer(UpdateData *data, Player const *target) const
float GetObjectScale() const
PackedGuid const & GetPackGUID() const
static Unit * ToUnit(Object *o)
void AddToObjectUpdateIfNeeded()
void _Create(ObjectGuid const &guid)
void SetFloatValue(uint16 index, float value)
static ObjectGuid GetGUID(Object const *o)
void SetEntry(uint32 entry)
virtual void SetObjectScale(float scale)
void SetUInt32Value(uint16 index, uint32 value)
ObjectGuid GetGUID() const
static Player * ToPlayer(Object *o)
bool IsInSameRaidWith(Player const *p) const
bool UpdateFishingSkill()
void SendDirectMessage(WorldPacket const *data) const
uint16 GetSkillValue(uint32 skill) const
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, WorldObject *ref=nullptr)
bool CanUseBattlegroundObject(GameObject *gameobject) const
void SendPreparedGossip(WorldObject *source)
PlayerSpellMap const & GetSpellMap() const
bool HasQuestForGO(int32 goId) const
void SendLoot(ObjectGuid guid, LootType loot_type)
Battleground * GetBattleground() const
bool IsGameMaster() const
void SendCinematicStart(uint32 CinematicSequenceId) const
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options=0)
QuestStatus GetQuestStatus(uint32 quest_id) const
void PrepareGossipMenu(WorldObject *source, uint32 menuId=0, bool showQuests=false)
void setUInt16(uint8 index, uint16 value)
void setUInt32(uint8 index, uint32 value)
void setFloat(uint8 index, float value)
void setInt32(uint8 index, int32 value)
void setUInt8(uint8 index, uint8 value)
float GetMaxRange(bool positive=false, WorldObject *caster=nullptr, Spell *spell=nullptr) const
bool Remove(KEY_TYPE const &handle)
bool Insert(KEY_TYPE const &handle, SPECIFIC_TYPE *obj)
Vehicle * GetVehicle() const
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void RemoveGameObject(GameObject *gameObj, bool del)
void FinishSpell(CurrentSpellTypes spellType, bool ok=true)
void SetStandState(UnitStandStateType state)
ObjectGuid GetTarget() const
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
bool BuildPacket(WorldPacket *packet)
void AppendToPacket(ByteBuffer *data)
bool GetBit(uint32 index) const
virtual void SetPhaseMask(uint32 newPhaseMask, bool update)
uint32 GetPhaseMask() const
bool IsWithinDist3d(float x, float y, float z, float dist) const
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
void AddToWorld() override
void RemoveFromWorld() override
virtual bool IsInvisibleDueToDespawn() const
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibility
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
std::string GetDebugInfo() const override
ZoneScript * GetZoneScript() const
float GetDistance2d(WorldObject const *obj) const
ZoneScript * m_zoneScript
bool InSamePhase(uint32 phasemask) const
std::string const & GetName() const
virtual void SetMap(Map *map)
virtual bool IsAlwaysVisibleFor(WorldObject const *) const
void AddObjectToRemoveList()
virtual bool IsNeverVisible(bool allowServersideObjects) const
void DestroyForNearbyPlayers()
Transport * GetTransport() const
void UpdatePositionData()
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
void SetName(std::string newname)
void SendObjectDeSpawnAnim(ObjectGuid guid)
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealth
void SetVisibilityDistanceOverride(VisibilityDistanceType type)
void GetZoneAndAreaId(uint32 &zoneid, uint32 &areaid) const
bool IsFriendlyTo(WorldObject const *target) const
bool IsInMap(WorldObject const *obj) const
virtual void Update(uint32 diff)
virtual void UpdateObjectVisibility(bool forced=true)
virtual void CleanupsBeforeDelete(bool finalCleanup=true)
WorldPacket const * Write() override
virtual uint32 GetGameObjectEntry(ObjectGuid::LowType, uint32 entry)
virtual void OnGameObjectRemove(GameObject *)
virtual void ProcessEvent(WorldObject *, uint32)
virtual void OnGameObjectCreate(GameObject *)
@ SMSG_GAMEOBJECT_PAGETEXT
@ SMSG_GAMEOBJECT_CUSTOM_ANIM
@ SMSG_ENABLE_BARBER_SHOP
@ SMSG_DESTRUCTIBLE_BUILDING_DAMAGE
@ CONFIG_RESPAWN_DYNAMICMODE
ObjectData const gameObjectData[]
GameObjectAI * SelectGameObjectAI(GameObject *go)
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
void MultimapErasePair(M< K, V, Rest... > &multimap, K const &key, V const &value)
GridCoord ComputeGridCoord(float x, float y)
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
QuaternionData ParentRotation
InvisibilityType invisibilityType
std::array< uint32, 4 > artKits
struct GameObjectTemplate::@191::@210 spellcaster
struct GameObjectTemplate::@191::@199 chair
bool CannotBeUsedUnderImmunity() const
uint32 GetAutoCloseTime() const
WorldPacket QueryData[TOTAL_LOCALES]
bool IsLargeGameObject() const
bool IsUsableMounted() const
WorldPacket BuildQueryData(LocaleConstant loc) const
void InitializeQueryData()
bool IsInfiniteGameObject() const
bool IsDespawnAtAction() const
struct GameObjectTemplate::@191::@223 raw
uint32 GetCharges() const
struct GameObjectTemplate::@191::@203 transport
struct GameObjectTemplate::@191::@219 barberChair
struct GameObjectTemplate::@191::@202 goober
bool GetDespawnPossibility() const
struct GameObjectTemplate::@191::@205 camera
struct GameObjectTemplate::@191::@207 summoningRitual
struct GameObjectTemplate::@191::@196 chest
uint32 casterTargetSpellTargets
struct GameObjectTemplate::@191::@220 building
std::string castBarCaption
struct GameObjectTemplate::@191::@198 trap
struct GameObjectTemplate::@191::@197 _generic
uint32 Type[MAX_LOCK_CASE]
uint32 Index[MAX_LOCK_CASE]
uint32 Skill[MAX_LOCK_CASE]
bool FillLoot(uint32 lootId, LootStore const &store, Player *lootOwner, bool personal, bool noEmptyError=false, uint16 lootMode=LOOT_MODE_DEFAULT)
std::string ToString() const
float GetExactDist(float x, float y, float z) const
float GetPositionZ() const
float GetOrientation() const
bool IsPositionValid() const
Position GetPosition() const
float GetPositionX() const
void GetPosition(float &x, float &y) const
float GetPositionY() const
float GetExactDistSq(float x, float y, float z) const
void Relocate(float x, float y)
void toEulerAnglesZYX(float &Z, float &Y, float &X) const
static QuaternionData fromEulerAnglesZYX(float Z, float Y, float X)
ObjectGuid::LowType spawnId
uint32 QuestItems[MAX_GAMEOBJECT_QUEST_ITEMS]
uint32 Data[MAX_GAMEOBJECT_DATA]
std::string CastBarCaption
struct GameObjectValue::@190 Building
struct GameObjectValue::@187 Transport
struct GameObjectValue::@188 FishingHole
SpellTargetCheckTypes TargetSearcherCheckType
TransportAnimation const * AnimationInfo
struct GameObjectValue::@186 Trap