diff options
author | Shauren <shauren.trinity@gmail.com> | 2025-09-27 23:25:37 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2025-09-27 23:25:37 +0200 |
commit | 175424d3cb645f20cadd77c006081afaab066ad9 (patch) | |
tree | febc1f01b6fe1cf674e107d57d70965d3288316b /src/server/game | |
parent | 5b2106d6de99e18b42081b2ae2828a1f558065ea (diff) |
Core/Misc: Reduce differences between branches3.3.5
Diffstat (limited to 'src/server/game')
22 files changed, 85 insertions, 74 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 8b68e951a64..1974f01e1fd 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -187,7 +187,7 @@ LFGDungeonData const* LFGMgr::GetLFGDungeon(uint32 id) return nullptr; } -void LFGMgr::LoadLFGDungeons(bool reload /* = false */) +void LFGMgr::LoadLFGDungeons() { uint32 oldMSTime = getMSTime(); @@ -223,10 +223,9 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */) // Fill teleport locations from DB // 0 1 2 3 4 QueryResult result = WorldDatabase.Query("SELECT dungeonId, position_x, position_y, position_z, orientation FROM lfg_dungeon_template"); - if (!result) { - TC_LOG_INFO("server.loading", ">> Loaded 0 lfg entrance positions. DB table `lfg_dungeon_template` is empty!"); + TC_LOG_INFO("server.loading", ">> Loaded 0 lfg dungeon templates. DB table `lfg_dungeon_template` is empty!"); return; } @@ -243,17 +242,19 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */) continue; } - LFGDungeonData& data = dungeonItr->second; - data.x = fields[1].GetFloat(); - data.y = fields[2].GetFloat(); - data.z = fields[3].GetFloat(); - data.o = fields[4].GetFloat(); + LFGDungeonData& data = dungeonItr->second; + data.x = fields[1].GetFloat(); + data.y = fields[2].GetFloat(); + data.z = fields[3].GetFloat(); + data.o = fields[4].GetFloat(); ++count; } while (result->NextRow()); - TC_LOG_INFO("server.loading", ">> Loaded {} lfg entrance positions in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); + TC_LOG_INFO("server.loading", ">> Loaded {} lfg dungeon templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); + + CachedDungeonMapStore.clear(); // Fill all other teleport coords from areatriggers for (LFGDungeonContainer::iterator itr = LfgDungeonStore.begin(); itr != LfgDungeonStore.end(); ++itr) @@ -266,7 +267,7 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */) AreaTriggerTeleport const* at = sObjectMgr->GetMapEntranceTrigger(dungeon.map); if (!at) { - TC_LOG_ERROR("sql.sql", "Failed to load dungeon {}, cant find areatrigger for map {}", dungeon.name, dungeon.map); + TC_LOG_ERROR("sql.sql", "Failed to load dungeon {} (Id: {}), cant find areatrigger for map {}", dungeon.name, dungeon.id, dungeon.map); continue; } @@ -281,11 +282,6 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */) CachedDungeonMapStore[dungeon.group].insert(dungeon.id); CachedDungeonMapStore[0].insert(dungeon.id); } - - if (reload) - { - CachedDungeonMapStore.clear(); - } } LFGMgr* LFGMgr::instance() @@ -1700,41 +1696,41 @@ LfgLockMap const LFGMgr::GetLockedDungeons(ObjectGuid guid) if (!dungeon) // should never happen - We provide a list from sLFGDungeonStore continue; - uint32 lockData = 0; + uint32 lockStatus = 0; if (denyJoin) - lockData = LFG_LOCKSTATUS_RAID_LOCKED; + lockStatus = LFG_LOCKSTATUS_RAID_LOCKED; else if (dungeon->expansion > expansion) - lockData = LFG_LOCKSTATUS_INSUFFICIENT_EXPANSION; + lockStatus = LFG_LOCKSTATUS_INSUFFICIENT_EXPANSION; else if (DisableMgr::IsDisabledFor(DISABLE_TYPE_MAP, dungeon->map, player)) - lockData = LFG_LOCKSTATUS_RAID_LOCKED; + lockStatus = LFG_LOCKSTATUS_RAID_LOCKED; else if (DisableMgr::IsDisabledFor(DISABLE_TYPE_LFG_MAP, dungeon->map, player)) - lockData = LFG_LOCKSTATUS_RAID_LOCKED; + lockStatus = LFG_LOCKSTATUS_RAID_LOCKED; else if (dungeon->difficulty > DUNGEON_DIFFICULTY_NORMAL && player->GetBoundInstance(dungeon->map, Difficulty(dungeon->difficulty))) - lockData = LFG_LOCKSTATUS_RAID_LOCKED; + lockStatus = LFG_LOCKSTATUS_RAID_LOCKED; else if (dungeon->minlevel[expansion] > level) - lockData = LFG_LOCKSTATUS_TOO_LOW_LEVEL; + lockStatus = LFG_LOCKSTATUS_TOO_LOW_LEVEL; else if (dungeon->maxlevel[expansion] < level) - lockData = LFG_LOCKSTATUS_TOO_HIGH_LEVEL; + lockStatus = LFG_LOCKSTATUS_TOO_HIGH_LEVEL; else if (dungeon->seasonal && !IsSeasonActive(dungeon->id)) - lockData = LFG_LOCKSTATUS_NOT_IN_SEASON; + lockStatus = LFG_LOCKSTATUS_NOT_IN_SEASON; else if (AccessRequirement const* ar = sObjectMgr->GetAccessRequirement(dungeon->map, Difficulty(dungeon->difficulty))) { if (ar->item_level && player->GetAverageItemLevel() < ar->item_level) - lockData = LFG_LOCKSTATUS_TOO_LOW_GEAR_SCORE; + lockStatus = LFG_LOCKSTATUS_TOO_LOW_GEAR_SCORE; else if (ar->achievement && !player->HasAchieved(ar->achievement)) - lockData = LFG_LOCKSTATUS_MISSING_ACHIEVEMENT; + lockStatus = LFG_LOCKSTATUS_MISSING_ACHIEVEMENT; else if (player->GetTeam() == ALLIANCE && ar->quest_A && !player->GetQuestRewardStatus(ar->quest_A)) - lockData = LFG_LOCKSTATUS_QUEST_NOT_COMPLETED; + lockStatus = LFG_LOCKSTATUS_QUEST_NOT_COMPLETED; else if (player->GetTeam() == HORDE && ar->quest_H && !player->GetQuestRewardStatus(ar->quest_H)) - lockData = LFG_LOCKSTATUS_QUEST_NOT_COMPLETED; + lockStatus = LFG_LOCKSTATUS_QUEST_NOT_COMPLETED; else if (ar->item) { if (!player->HasItemCount(ar->item) && (!ar->item2 || !player->HasItemCount(ar->item2))) - lockData = LFG_LOCKSTATUS_MISSING_ITEM; + lockStatus = LFG_LOCKSTATUS_MISSING_ITEM; } else if (ar->item2 && !player->HasItemCount(ar->item2)) - lockData = LFG_LOCKSTATUS_MISSING_ITEM; + lockStatus = LFG_LOCKSTATUS_MISSING_ITEM; } /* @todo VoA closed if WG is not under team control (LFG_LOCKSTATUS_RAID_LOCKED) @@ -1743,8 +1739,8 @@ LfgLockMap const LFGMgr::GetLockedDungeons(ObjectGuid guid) lockData = LFG_LOCKSTATUS_ATTUNEMENT_TOO_HIGH_LEVEL; */ - if (lockData) - lock[dungeon->Entry()] = lockData; + if (lockStatus) + lock[dungeon->Entry()] = lockStatus; } return lock; diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index d8a19d14a52..04597e7cfce 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -318,7 +318,7 @@ class TC_GAME_API LFGMgr /// Loads rewards for random dungeons void LoadRewards(); /// Loads dungeons from dbc and adds teleport coords - void LoadLFGDungeons(bool reload = false); + void LoadLFGDungeons(); // Multiple files /// Check if given guid applied for random dungeon diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index fa44b3deac5..b358aca1514 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -191,7 +191,7 @@ WorldPacket CreatureTemplate::BuildQueryData(LocaleConstant loc) const queryTemp.Allow = true; queryTemp.Stats.Name = locName; - queryTemp.Stats.NameAlt = locTitle; + queryTemp.Stats.Title = locTitle; queryTemp.Stats.CursorName = IconName; queryTemp.Stats.Flags = type_flags; queryTemp.Stats.CreatureType = type; @@ -2681,7 +2681,7 @@ void Creature::UpdateMovementFlags() } if (!isInAir) - RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING); + SetFall(false); SetSwim(CanSwim() && IsInWater()); } diff --git a/src/server/game/Entities/Creature/CreatureData.h b/src/server/game/Entities/Creature/CreatureData.h index ce702002cfe..b38fb3ab09f 100644 --- a/src/server/game/Entities/Creature/CreatureData.h +++ b/src/server/game/Entities/Creature/CreatureData.h @@ -517,7 +517,7 @@ struct VendorItemData return &m_items[slot]; } bool Empty() const { return m_items.empty(); } - uint8 GetItemCount() const { return m_items.size(); } + uint32 GetItemCount() const { return uint32(m_items.size()); } void AddItem(uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost) { m_items.emplace_back(item, maxcount, ptime, ExtendedCost); diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 62e9dc02ca5..86fb4986242 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -289,9 +289,9 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u return false; } - if (goinfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT) + if (goinfo->type == GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) { - TC_LOG_ERROR("sql.sql", "Gameobject (GUID: {} Entry: {}) not created: gameobject type GAMEOBJECT_TYPE_MO_TRANSPORT cannot be manually created.", guidlow, name_id); + TC_LOG_ERROR("sql.sql", "Gameobject (GUID: {} Entry: {}) not created: gameobject type GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT cannot be manually created.", guidlow, name_id); return false; } @@ -1244,7 +1244,7 @@ bool GameObject::IsTransport() const if (!gInfo) return false; - return gInfo->type == GAMEOBJECT_TYPE_TRANSPORT || gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT; + return gInfo->type == GAMEOBJECT_TYPE_TRANSPORT || gInfo->type == GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT; } // is Dynamic transport = non-stop Transport @@ -1255,7 +1255,7 @@ bool GameObject::IsDynTransport() const if (!gInfo) return false; - return gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT || (gInfo->type == GAMEOBJECT_TYPE_TRANSPORT && !gInfo->transport.pause); + return gInfo->type == GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT || (gInfo->type == GAMEOBJECT_TYPE_TRANSPORT && !gInfo->transport.pause); } bool GameObject::IsDestructibleBuilding() const @@ -1925,7 +1925,7 @@ void GameObject::Use(Unit* user) return; } - case GAMEOBJECT_TYPE_SUMMONING_RITUAL: //18 + case GAMEOBJECT_TYPE_RITUAL: //18 { if (user->GetTypeId() != TYPEID_PLAYER) return; @@ -2731,7 +2731,7 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player co dynFlags |= GO_DYNFLAG_LO_SPARKLE; break; case GAMEOBJECT_TYPE_TRANSPORT: - case GAMEOBJECT_TYPE_MO_TRANSPORT: + case GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT: { if (uint32 transportPeriod = GetTransportPeriod()) { diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index a73e6ce8fff..a047b4c9560 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -288,13 +288,13 @@ class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject> GameObjectModel* m_model; void GetRespawnPosition(float &x, float &y, float &z, float* ori = nullptr) const; - Transport* ToTransport() { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MO_TRANSPORT) return reinterpret_cast<Transport*>(this); else return nullptr; } - Transport const* ToTransport() const { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MO_TRANSPORT) return reinterpret_cast<Transport const*>(this); else return nullptr; } + Transport* ToTransport() { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return reinterpret_cast<Transport*>(this); else return nullptr; } + Transport const* ToTransport() const { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return reinterpret_cast<Transport const*>(this); else return nullptr; } - float GetStationaryX() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetPositionX(); return GetPositionX(); } - float GetStationaryY() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetPositionY(); return GetPositionY(); } - float GetStationaryZ() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetPositionZ(); return GetPositionZ(); } - float GetStationaryO() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetOrientation(); return GetOrientation(); } + float GetStationaryX() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return m_stationaryPosition.GetPositionX(); return GetPositionX(); } + float GetStationaryY() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return m_stationaryPosition.GetPositionY(); return GetPositionY(); } + float GetStationaryZ() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return m_stationaryPosition.GetPositionZ(); return GetPositionZ(); } + float GetStationaryO() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return m_stationaryPosition.GetOrientation(); return GetOrientation(); } void RelocateStationaryPosition(float x, float y, float z, float o) { m_stationaryPosition.Relocate(x, y, z, o); } float GetInteractionDistance() const; diff --git a/src/server/game/Entities/GameObject/GameObjectData.h b/src/server/game/Entities/GameObject/GameObjectData.h index a4e4a4bdce2..7cba8baeabd 100644 --- a/src/server/game/Entities/GameObject/GameObjectData.h +++ b/src/server/game/Entities/GameObject/GameObjectData.h @@ -227,7 +227,7 @@ struct GameObjectTemplate uint32 conditionID1; //4 } camera; //14 GAMEOBJECT_TYPE_MAPOBJECT - empty - //15 GAMEOBJECT_TYPE_MO_TRANSPORT + //15 GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT struct { uint32 taxiPathId; //0 @@ -242,7 +242,7 @@ struct GameObjectTemplate } moTransport; //16 GAMEOBJECT_TYPE_DUELFLAG - empty //17 GAMEOBJECT_TYPE_FISHINGNODE - empty - //18 GAMEOBJECT_TYPE_SUMMONING_RITUAL + //18 GAMEOBJECT_TYPE_RITUAL struct { uint32 reqParticipants; //0 diff --git a/src/server/game/Entities/Object/ObjectGuid.h b/src/server/game/Entities/Object/ObjectGuid.h index 44097221333..e17e4c98a38 100644 --- a/src/server/game/Entities/Object/ObjectGuid.h +++ b/src/server/game/Entities/Object/ObjectGuid.h @@ -71,7 +71,7 @@ enum class HighGuid Vehicle = 0xF150, // blizz F550 DynamicObject = 0xF100, // blizz F100 Corpse = 0xF101, // blizz F100 - Mo_Transport = 0x1FC0, // blizz 1FC0 (for GAMEOBJECT_TYPE_MO_TRANSPORT) + Mo_Transport = 0x1FC0, // blizz 1FC0 (for GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) Instance = 0x1F40, // blizz 1F40 Group = 0x1F50, }; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 0da59a48923..9ace0cab7bf 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -946,7 +946,6 @@ class TC_GAME_API Player : public Unit, public GridObject<Player> bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, SpellEffectInfo const& spellEffectInfo, WorldObject const* caster, bool requireImmunityPurgesEffectAttribute = false) const override; - bool IsFalling() { return GetPositionZ() < m_lastFallZ; } bool IsInAreaTriggerRadius(AreaTriggerEntry const* trigger) const; void SendInitialPacketsBeforeAddToMap(); diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp index 0337e9031ba..7609cd6d095 100644 --- a/src/server/game/Entities/Totem/Totem.cpp +++ b/src/server/game/Entities/Totem/Totem.cpp @@ -93,9 +93,7 @@ void Totem::InitStats(uint32 duration) void Totem::InitSummon() { if (m_type == TOTEM_PASSIVE && GetSpell()) - { CastSpell(this, GetSpell(), true); - } // Some totems can have both instant effect and passive spell if (GetSpell(1)) @@ -129,7 +127,7 @@ void Totem::UnSummon(uint32 msTime) if (GetEntry() == SENTRY_TOTEM_ENTRY) GetOwner()->RemoveAurasDueToSpell(SENTRY_TOTEM_SPELLID); - //remove aura all party members too + // remove aura all party members too if (Player* owner = GetOwner()->ToPlayer()) { owner->SendAutoRepeatCancel(this); diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 53f0157f7b2..a8815c3ab7a 100644 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -96,7 +96,7 @@ bool Transport::Create(ObjectGuid::LowType guidlow, uint32 entry, uint32 mapid, SetEntry(goinfo->entry); SetDisplayId(goinfo->displayId); SetGoState(!goinfo->moTransport.canBeStopped ? GO_STATE_READY : GO_STATE_ACTIVE); - SetGoType(GAMEOBJECT_TYPE_MO_TRANSPORT); + SetGoType(GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT); SetGoAnimProgress(animprogress); SetName(goinfo->name); SetLocalRotation(0.0f, 0.0f, 0.0f, 1.0f); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 65b3afed4dd..5719e422edb 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13293,6 +13293,22 @@ bool Unit::SetDisableGravity(bool disable, bool /*packetOnly = false*/, bool /*u return true; } +bool Unit::SetFall(bool enable) +{ + if (enable == HasUnitMovementFlag(MOVEMENTFLAG_FALLING)) + return false; + + if (enable) + { + AddUnitMovementFlag(MOVEMENTFLAG_FALLING); + m_movementInfo.SetFallTime(0); + } + else + RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING | MOVEMENTFLAG_FALLING_FAR); + + return true; +} + bool Unit::SetSwim(bool enable) { if (enable == HasUnitMovementFlag(MOVEMENTFLAG_SWIMMING)) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 1ded28f3b57..8f4ed233ab0 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1219,6 +1219,7 @@ class TC_GAME_API Unit : public WorldObject bool IsHovering() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_HOVER); } virtual bool SetWalk(bool enable); virtual bool SetDisableGravity(bool disable, bool packetOnly = false, bool updateAnimTier = true); + bool SetFall(bool enable); virtual bool SetSwim(bool enable); virtual bool SetCanFly(bool enable, bool packetOnly = false); virtual bool SetWaterWalking(bool enable, bool packetOnly = false); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 945084e9655..9afe36d596b 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5945,7 +5945,7 @@ void ObjectMgr::LoadSpellScriptNames() SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) { - TC_LOG_ERROR("sql.sql", "Scriptname: `{}` spell (Id: {}) does not exist.", scriptName, spellId); + TC_LOG_ERROR("sql.sql", "Scriptname: `{}` spell (Id: {}) does not exist.", scriptName, fields[0].GetInt32()); continue; } @@ -7791,7 +7791,7 @@ void ObjectMgr::LoadGameObjectTemplate() CheckGOLockId(&got, got.camera.lockId, 0); break; } - case GAMEOBJECT_TYPE_MO_TRANSPORT: //15 + case GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT: //15 { if (got.moTransport.taxiPathId) { @@ -7803,7 +7803,7 @@ void ObjectMgr::LoadGameObjectTemplate() _transportMaps.insert(transportMap); break; } - case GAMEOBJECT_TYPE_SUMMONING_RITUAL: //18 + case GAMEOBJECT_TYPE_RITUAL: //18 break; case GAMEOBJECT_TYPE_SPELLCASTER: //22 { diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index 8c43bba5301..0ec3abe0b42 100644 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -249,6 +249,7 @@ class TC_GAME_API Group GroupReference const* GetFirstMember() const { return m_memberMgr.getFirst(); } uint32 GetMembersCount() const { return m_memberSlots.size(); } uint32 GetInviteeCount() const { return m_invitees.size(); } + GroupType GetGroupType() const { return m_groupType; } uint8 GetMemberGroup(ObjectGuid guid) const; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 4653ff5038d..1515c079311 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -362,7 +362,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPackets::Character::LogoutRequ uint32 reason = 0; if (GetPlayer()->IsInCombat() && !canLogoutInCombat) reason = 1; - else if (GetPlayer()->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FALLING | MOVEMENTFLAG_FALLING_FAR)) + else if (GetPlayer()->IsFalling()) reason = 3; // is jumping or falling else if (GetPlayer()->duel || GetPlayer()->HasAura(9454)) // is dueling or frozen by GM via freeze command reason = 2; // FIXME - Need the correct value diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 96f810f3792..4fdae221e41 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -952,8 +952,7 @@ void MotionMaster::MoveFall(uint32 id/* = 0*/) if (_owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) return; - _owner->AddUnitMovementFlag(MOVEMENTFLAG_FALLING); - _owner->m_movementInfo.SetFallTime(0); + _owner->SetFall(true); // Don't run spline movement for players if (_owner->GetTypeId() == TYPEID_PLAYER) diff --git a/src/server/game/Server/Packets/QueryPackets.cpp b/src/server/game/Server/Packets/QueryPackets.cpp index 9e0c21847fc..8710e0c715a 100644 --- a/src/server/game/Server/Packets/QueryPackets.cpp +++ b/src/server/game/Server/Packets/QueryPackets.cpp @@ -31,7 +31,7 @@ WorldPacket const* WorldPackets::Query::QueryCreatureResponse::Write() { _worldPacket << Stats.Name; _worldPacket << uint8(0) << uint8(0) << uint8(0); // name2, name3, name4, always empty - _worldPacket << Stats.NameAlt; + _worldPacket << Stats.Title; _worldPacket << Stats.CursorName; // "Directions" for guard, string for Icons 2.3.0 _worldPacket << uint32(Stats.Flags); // flags _worldPacket << uint32(Stats.CreatureType); // CreatureType.dbc diff --git a/src/server/game/Server/Packets/QueryPackets.h b/src/server/game/Server/Packets/QueryPackets.h index 8c36c07afcd..8191e901d7b 100644 --- a/src/server/game/Server/Packets/QueryPackets.h +++ b/src/server/game/Server/Packets/QueryPackets.h @@ -45,7 +45,7 @@ namespace WorldPackets struct CreatureStats { std::string Name; - std::string NameAlt; + std::string Title; std::string CursorName; uint32 Flags = 0; uint32 CreatureType = 0; diff --git a/src/server/game/Server/WorldSocket.h b/src/server/game/Server/WorldSocket.h index 77511f774e3..1cec1e5cd1f 100644 --- a/src/server/game/Server/WorldSocket.h +++ b/src/server/game/Server/WorldSocket.h @@ -19,12 +19,12 @@ #define __WORLDSOCKET_H__ #include "Common.h" -#include "AuthCrypt.h" #include "ServerPktHeader.h" #include "Socket.h" #include "Util.h" #include "WorldPacket.h" #include "WorldSession.h" +#include "WorldPacketCrypt.h" #include "MPSCQueue.h" #include <boost/asio/ip/tcp.hpp> @@ -113,7 +113,7 @@ private: bool HandlePing(WorldPacket& recvPacket); std::array<uint8, 4> _authSeed; - AuthCrypt _authCrypt; + WorldPacketCrypt _authCrypt; TimePoint _LastPingTime; uint32 _OverSpeedPings; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index bc6d3677094..8ad99d8d0b5 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -78,7 +78,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleModStealth, // 16 SPELL_AURA_MOD_STEALTH &AuraEffect::HandleModStealthDetect, // 17 SPELL_AURA_MOD_DETECT &AuraEffect::HandleModInvisibility, // 18 SPELL_AURA_MOD_INVISIBILITY - &AuraEffect::HandleModInvisibilityDetect, // 19 SPELL_AURA_MOD_INVISIBILITY_DETECTION + &AuraEffect::HandleModInvisibilityDetect, // 19 SPELL_AURA_MOD_INVISIBILITY_DETECT &AuraEffect::HandleNoImmediateEffect, // 20 SPELL_AURA_OBS_MOD_HEALTH implemented in AuraEffect::PeriodicTick &AuraEffect::HandleNoImmediateEffect, // 21 SPELL_AURA_OBS_MOD_POWER implemented in AuraEffect::PeriodicTick &AuraEffect::HandleAuraModResistance, // 22 SPELL_AURA_MOD_RESISTANCE @@ -1084,7 +1084,6 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const { uint32 spellId = 0; uint32 spellId2 = 0; - //uint32 spellId3 = 0; uint32 HotWSpellId = 0; switch (GetMiscValue()) @@ -1222,7 +1221,8 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const // Heart of the Wild if (HotWSpellId) - { // hacky, but the only way as spell family is not SPELLFAMILY_DRUID + { + // hacky, but the only way as spell family is not SPELLFAMILY_DRUID Unit::AuraEffectList const& mModTotalStatPct = target->GetAuraEffectsByType(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE); for (AuraEffect const* aurEff : mModTotalStatPct) { @@ -1237,6 +1237,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const } } } + switch (GetMiscValue()) { case FORM_CAT: @@ -1910,7 +1911,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo SpellShapeshiftFormEntry const* shapeInfo = sSpellShapeshiftFormStore.LookupEntry(form); ASSERT(shapeInfo); // Learn spells for shapeshift form - no need to send action bars or add spells to spellbook - for (uint8 i = 0; i<MAX_SHAPESHIFT_SPELLS; ++i) + for (uint8 i = 0; i < MAX_SHAPESHIFT_SPELLS; ++i) { if (!shapeInfo->PresetSpellID[i]) continue; @@ -2305,12 +2306,12 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode, Unit* target = aurApp->GetTarget(); - //Prevent handling aura twice + // Prevent handling aura twice AuraType type = GetAuraType(); if (apply ? target->GetAuraEffectsByType(type).size() > 1 : target->HasAuraType(type)) return; - void(*flagChangeFunc)(Unit * u) = nullptr; + void(*flagChangeFunc)(Unit* u) = nullptr; uint32 slot; WeaponAttackType attType; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index e31db03f80e..9fc4471259d 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -4720,7 +4720,7 @@ void Spell::EffectTransmitted() Map* cMap = unitCaster->GetMap(); // if gameobject is summoning object, it should be spawned right on caster's position - if (goinfo->type == GAMEOBJECT_TYPE_SUMMONING_RITUAL) + if (goinfo->type == GAMEOBJECT_TYPE_RITUAL) unitCaster->GetPosition(fx, fy, fz); GameObject* pGameObj = new GameObject; @@ -4755,7 +4755,7 @@ void Spell::EffectTransmitted() duration = std::min(duration, duration - lastSec*IN_MILLISECONDS + FISHING_BOBBER_READY_TIME*IN_MILLISECONDS); break; } - case GAMEOBJECT_TYPE_SUMMONING_RITUAL: + case GAMEOBJECT_TYPE_RITUAL: { if (unitCaster->GetTypeId() == TYPEID_PLAYER) { |