diff options
author | Shauren <shauren.trinity@gmail.com> | 2017-05-20 00:09:37 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2017-05-20 00:09:37 +0200 |
commit | f2039981e086e5db6c7ad9a45a11f13392c5fbd9 (patch) | |
tree | 65cfae5f95d8fef899559bda00a68aab14ff043c /src | |
parent | 506de194954a52452cba69fc890482edf0afd0b2 (diff) |
Core/Game: Include cleanup, part 3
Diffstat (limited to 'src')
75 files changed, 319 insertions, 197 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 1509db2de59..12220998df2 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -98,6 +98,16 @@ bool SummonList::HasEntry(uint32 entry) const return false; } +void SummonList::DoActionImpl(int32 action, StorageType const& summons) +{ + for (auto const& guid : summons) + { + Creature* summon = ObjectAccessor::GetCreature(*me, guid); + if (summon && summon->IsAIEnabled) + summon->AI()->DoAction(action); + } +} + ScriptedAI::ScriptedAI(Creature* creature) : CreatureAI(creature), IsFleeing(false), _isCombatMovementAllowed(true) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 0c1cf34aff2..e9c8168cf63 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -101,12 +101,7 @@ public: // We need to use a copy of SummonList here, otherwise original SummonList would be modified StorageType listCopy = storage_; Trinity::Containers::RandomResize<StorageType, Predicate>(listCopy, std::forward<Predicate>(predicate), max); - for (StorageType::iterator i = listCopy.begin(); i != listCopy.end(); ) - { - Creature* summon = ObjectAccessor::GetCreature(*me, *i++); - if (summon && summon->IsAIEnabled) - summon->AI()->DoAction(info); - } + DoActionImpl(info, listCopy); } void DoZoneInCombat(uint32 entry = 0, float maxRangeToNearestTarget = 250.0f); @@ -114,6 +109,8 @@ public: bool HasEntry(uint32 entry) const; private: + void DoActionImpl(int32 action, StorageType const& summons); + Creature* me; StorageType storage_; }; diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index f3cab9bb02e..efa096196f3 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -24,10 +24,11 @@ SDCategory: Npc EndScriptData */ #include "ScriptedEscortAI.h" +#include "Group.h" #include "Log.h" +#include "ObjectAccessor.h" #include "Player.h" #include "ScriptedCreature.h" -#include "Group.h" enum Points { @@ -66,6 +67,11 @@ void npc_escortAI::AttackStart(Unit* who) } } +Player* npc_escortAI::GetPlayerForEscort() +{ + return ObjectAccessor::GetPlayer(*me, m_uiPlayerGUID); +} + //see followerAI bool npc_escortAI::AssistPlayerInCombatAgainst(Unit* who) { diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h index 8d24d662a5b..fd3c7b5cefc 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h @@ -109,7 +109,7 @@ struct TC_GAME_API npc_escortAI : public ScriptedAI ObjectGuid GetEventStarterGUID() const { return m_uiPlayerGUID; } protected: - Player* GetPlayerForEscort() { return ObjectAccessor::GetPlayer(*me, m_uiPlayerGUID); } + Player* GetPlayerForEscort(); private: bool AssistPlayerInCombatAgainst(Unit* who); diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index a563e76999c..e6fa110ad7f 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -25,9 +25,10 @@ EndScriptData */ #include "ScriptedFollowerAI.h" #include "Log.h" +#include "Group.h" +#include "ObjectAccessor.h" #include "Player.h" #include "ScriptedCreature.h" -#include "Group.h" const float MAX_PLAYER_DISTANCE = 100.0f; diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index a6df13e4dcd..56bff376efb 100644 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -24,8 +24,8 @@ #include "Player.h" #include "Realm.h" #include "ScriptMgr.h" -#include "Util.h" #include "SHA1.h" +#include "Util.h" #include "World.h" #include "WorldSession.h" diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 523c12ac099..da219cd4798 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -27,6 +27,7 @@ #include "GuildMgr.h" #include "Language.h" #include "Log.h" +#include "Mail.h" #include "ObjectMgr.h" #include "World.h" diff --git a/src/server/game/Achievements/CriteriaHandler.cpp b/src/server/game/Achievements/CriteriaHandler.cpp index 0925e5464e9..081c758478e 100644 --- a/src/server/game/Achievements/CriteriaHandler.cpp +++ b/src/server/game/Achievements/CriteriaHandler.cpp @@ -1661,8 +1661,7 @@ bool CriteriaHandler::AdditionalRequirementsSatisfied(ModifierTreeNode const* tr { if (!unit) return false; - Creature const* const creature = unit->ToCreature(); - if (!creature || creature->GetCreatureType() != reqValue) + if (unit->GetTypeId() != TYPEID_UNIT || unit->GetCreatureType() != reqValue) return false; break; } diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.h b/src/server/game/AuctionHouseBot/AuctionHouseBot.h index c2244ec724e..dc14d33e1ec 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBot.h +++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.h @@ -19,6 +19,7 @@ #define AUCTION_HOUSE_BOT_H #include "Define.h" +#include "SharedDefines.h" class AuctionBotSeller; class AuctionBotBuyer; diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp index f943995a152..3f6e0877353 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp @@ -18,9 +18,12 @@ #include "AuctionHouseBotSeller.h" #include "AuctionHouseMgr.h" #include "DatabaseEnv.h" +#include "DB2Stores.h" +#include "Item.h" #include "Log.h" #include "ObjectMgr.h" #include "Random.h" +#include <sstream> AuctionBotSeller::AuctionBotSeller() { @@ -70,8 +73,8 @@ bool AuctionBotSeller::Initialize() tempItems.insert((*it2)->item); } } - for (std::set<uint32>::const_iterator it = tempItems.begin(); it != tempItems.end(); ++it) - npcItems.push_back(*it); + for (uint32 itemId : tempItems) + npcItems.push_back(itemId); TC_LOG_DEBUG("ahbot", "Npc vendor filter has %u items", (uint32)npcItems.size()); diff --git a/src/server/game/BattlePets/BattlePetMgr.h b/src/server/game/BattlePets/BattlePetMgr.h index 48e3393fb57..9182e7478c8 100644 --- a/src/server/game/BattlePets/BattlePetMgr.h +++ b/src/server/game/BattlePets/BattlePetMgr.h @@ -18,9 +18,9 @@ #ifndef BattlePetMgr_h__ #define BattlePetMgr_h__ -#include "DatabaseEnvFwd.h" -#include "DB2Stores.h" #include "BattlePetPackets.h" +#include "DatabaseEnvFwd.h" +#include <unordered_map> enum BattlePetMisc { diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index 7eca59ffd73..2e243dd851d 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -18,6 +18,7 @@ #include "Battlefield.h" #include "BattlefieldMgr.h" #include "Battleground.h" +#include "BattlegroundPackets.h" #include "CellImpl.h" #include "CreatureTextMgr.h" #include "GridNotifiers.h" @@ -27,11 +28,9 @@ #include "Log.h" #include "Map.h" #include "MapManager.h" +#include "MiscPackets.h" #include "ObjectAccessor.h" #include "ObjectMgr.h" -#include "WorldPacket.h" -#include "BattlegroundPackets.h" -#include "MiscPackets.h" #include "WorldStatePackets.h" Battlefield::Battlefield() diff --git a/src/server/game/Battlefield/Zones/BattlefieldTB.cpp b/src/server/game/Battlefield/Zones/BattlefieldTB.cpp index 0163b6c0195..b4f9ff8cfca 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldTB.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldTB.cpp @@ -33,7 +33,7 @@ #include "Player.h" #include "SpellAuras.h" #include "TemporarySummon.h" -#include "WorldSession.h" +#include "World.h" #include "WorldStatePackets.h" BattlefieldTB::~BattlefieldTB() { } diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 815b37064bb..7e3cea34858 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -21,16 +21,16 @@ #include "BattlefieldWG.h" #include "AchievementMgr.h" -#include "CreatureTextMgr.h" #include "Battleground.h" -#include "MapManager.h" +#include "CreatureTextMgr.h" #include "Log.h" +#include "MapManager.h" #include "ObjectMgr.h" #include "Opcodes.h" #include "Player.h" #include "SpellAuras.h" #include "TemporarySummon.h" -#include "WorldSession.h" +#include "World.h" #include "WorldStatePackets.h" struct BfWGCoordGY diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index a4cffb5f540..68d2a076860 100644 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -21,6 +21,7 @@ #include "DatabaseEnv.h" #include "Group.h" #include "Log.h" +#include "ObjectAccessor.h" #include "ObjectMgr.h" #include "Player.h" #include "World.h" diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h index 4aa73039f01..d87b66121c7 100644 --- a/src/server/game/Battlegrounds/ArenaTeam.h +++ b/src/server/game/Battlegrounds/ArenaTeam.h @@ -20,7 +20,7 @@ #define TRINITYCORE_ARENATEAM_H #include "Define.h" -#include "QueryResult.h" +#include "DatabaseEnvFwd.h" #include "ObjectGuid.h" #include <list> #include <string> diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index d8c01e0c935..8aba555031b 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -16,9 +16,10 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ArenaScore.h" #include "Battleground.h" +#include "ArenaScore.h" #include "BattlegroundMgr.h" +#include "BattlegroundPackets.h" #include "BattlegroundScore.h" #include "Creature.h" #include "CreatureTextMgr.h" @@ -26,19 +27,19 @@ #include "Formulas.h" #include "GridNotifiersImpl.h" #include "Group.h" -#include "GuildMgr.h" #include "Guild.h" +#include "GuildMgr.h" #include "Log.h" +#include "MiscPackets.h" #include "Object.h" #include "ObjectMgr.h" #include "Player.h" #include "ReputationMgr.h" #include "SpellAuras.h" +#include "TemporarySummon.h" +#include "Transport.h" #include "Util.h" #include "WorldPacket.h" -#include "Transport.h" -#include "BattlegroundPackets.h" -#include "MiscPackets.h" #include "WorldStatePackets.h" namespace Trinity diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index dc77288b738..59cd9f3cecf 100644 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -16,11 +16,11 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "BattlegroundQueue.h" #include "ArenaTeam.h" #include "ArenaTeamMgr.h" -#include "BattlegroundPackets.h" #include "BattlegroundMgr.h" -#include "BattlegroundQueue.h" +#include "BattlegroundPackets.h" #include "Chat.h" #include "Group.h" #include "Log.h" diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 6ab9970aea1..0a599b15882 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -17,14 +17,14 @@ */ #include "BattlegroundWS.h" +#include "BattlegroundMgr.h" +#include "BattlegroundPackets.h" #include "GameObject.h" #include "Language.h" #include "Log.h" #include "Object.h" -#include "BattlegroundMgr.h" #include "Player.h" #include "WorldPacket.h" -#include "BattlegroundPackets.h" #include "WorldStatePackets.h" // these variables aren't used outside of this file, so declare them only here diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index 73ca33e9ba2..3c17ffb33e7 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -23,8 +23,8 @@ #include "Log.h" #include "Mail.h" #include "ObjectAccessor.h" -#include "Opcodes.h" #include "Player.h" +#include <sstream> CalendarInvite::~CalendarInvite() { diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 5605cb730eb..f394ac806e4 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -20,15 +20,18 @@ #include "AccountMgr.h" #include "ChannelAppenders.h" #include "Chat.h" +#include "ChatPackets.h" #include "DatabaseEnv.h" #include "GridNotifiers.h" #include "GridNotifiersImpl.h" #include "Language.h" #include "Log.h" +#include "ObjectAccessor.h" #include "ObjectMgr.h" #include "Player.h" #include "SocialMgr.h" #include "World.h" +#include <sstream> Channel::Channel(uint32 channelId, uint32 team /*= 0*/, AreaTableEntry const* zoneEntry /*= nullptr*/) : _announceEnabled(false), // no join/leave announces diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index a4596f64549..9fc51df3ac7 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -16,16 +16,18 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "Common.h" +#include "Chat.h" #include "AccountMgr.h" #include "CellImpl.h" -#include "Chat.h" #include "ChatLink.h" +#include "ChatPackets.h" +#include "Common.h" #include "DatabaseEnv.h" #include "GridNotifiersImpl.h" #include "Group.h" #include "Language.h" #include "Log.h" +#include "ObjectAccessor.h" #include "ObjectMgr.h" #include "Player.h" #include "Realm.h" @@ -85,6 +87,16 @@ bool ChatHandler::isAvailable(ChatCommand const& cmd) const return HasPermission(cmd.Permission); } +bool ChatHandler::HasPermission(uint32 permission) const +{ + return m_session->HasPermission(permission); +} + +std::string ChatHandler::GetNameLink() const +{ + return GetNameLink(m_session->GetPlayer()); +} + bool ChatHandler::HasLowerSecurity(Player* target, ObjectGuid guid, bool strong) { WorldSession* target_session = nullptr; diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index e6cb5e445f1..5321d34a930 100644 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -19,12 +19,9 @@ #ifndef TRINITYCORE_CHAT_H #define TRINITYCORE_CHAT_H +#include "ObjectGuid.h" #include "SharedDefines.h" #include "StringFormat.h" -#include "WorldSession.h" -#include "RBAC.h" -#include "Packets/ChatPackets.h" - #include <vector> class ChatHandler; @@ -100,8 +97,8 @@ class TC_GAME_API ChatHandler // function with different implementation for chat/console virtual bool isAvailable(ChatCommand const& cmd) const; - virtual bool HasPermission(uint32 permission) const { return m_session->HasPermission(permission); } - virtual std::string GetNameLink() const { return GetNameLink(m_session->GetPlayer()); } + virtual bool HasPermission(uint32 permission) const; + virtual std::string GetNameLink() const; virtual bool needReportToTarget(Player* chr) const; virtual LocaleConstant GetSessionDbcLocale() const; virtual int GetSessionDbLocaleIndex() const; diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index 74f1a1c8696..b2f6986cc69 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -16,11 +16,14 @@ */ #include "ChatLink.h" +#include "AchievementMgr.h" +#include "DB2Stores.h" +#include "Item.h" #include "Log.h" -#include "SpellMgr.h" #include "ObjectMgr.h" +#include "QuestDef.h" #include "SpellInfo.h" -#include "AchievementMgr.h" +#include "SpellMgr.h" // Supported shift-links (client generated and server side) // |color|Hachievement:achievement_id:player_guid:0:0:0:0:0:0:0:0|h[name]|h|r diff --git a/src/server/game/Combat/HostileRefManager.cpp b/src/server/game/Combat/HostileRefManager.cpp index bcb7a0b471f..2c977f61941 100644 --- a/src/server/game/Combat/HostileRefManager.cpp +++ b/src/server/game/Combat/HostileRefManager.cpp @@ -17,9 +17,10 @@ */ #include "HostileRefManager.h" +#include "DB2Structure.h" +#include "SpellInfo.h" #include "ThreatManager.h" #include "Unit.h" -#include "SpellInfo.h" HostileRefManager::~HostileRefManager() { diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index b292ed3c63e..630d3c5a730 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -20,6 +20,7 @@ #include "AchievementMgr.h" #include "DatabaseEnv.h" #include "GameEventMgr.h" +#include "GameObject.h" #include "Group.h" #include "InstanceScript.h" #include "Log.h" @@ -28,8 +29,8 @@ #include "Player.h" #include "Pet.h" #include "ReputationMgr.h" -#include "ScriptedCreature.h" #include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "SpellAuras.h" #include "SpellMgr.h" diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index a31c45cee52..9e87f6271cb 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -27,6 +27,7 @@ #include "LFGQueue.h" #include "LFGScripts.h" #include "Log.h" +#include "ObjectAccessor.h" #include "ObjectMgr.h" #include "Player.h" #include "RBAC.h" diff --git a/src/server/game/Entities/AreaTrigger/AreaTrigger.cpp b/src/server/game/Entities/AreaTrigger/AreaTrigger.cpp index 784a64a4a78..bfe8018af08 100644 --- a/src/server/game/Entities/AreaTrigger/AreaTrigger.cpp +++ b/src/server/game/Entities/AreaTrigger/AreaTrigger.cpp @@ -16,6 +16,7 @@ */ #include "AreaTrigger.h" +#include "AreaTriggerAI.h" #include "AreaTriggerDataStore.h" #include "AreaTriggerPackets.h" #include "AreaTriggerTemplate.h" @@ -33,7 +34,6 @@ #include "Transport.h" #include "Unit.h" #include "UpdateData.h" -#include "AreaTriggerAI.h" AreaTrigger::AreaTrigger() : WorldObject(false), MapObject(), _duration(0), _totalDuration(0), _timeSinceCreated(0), _previousCheckOrientation(std::numeric_limits<float>::infinity()), diff --git a/src/server/game/Entities/AreaTrigger/AreaTrigger.h b/src/server/game/Entities/AreaTrigger/AreaTrigger.h index 91d63520959..1b6bf9952b6 100644 --- a/src/server/game/Entities/AreaTrigger/AreaTrigger.h +++ b/src/server/game/Entities/AreaTrigger/AreaTrigger.h @@ -19,7 +19,6 @@ #define TRINITYCORE_AREATRIGGER_H #include "Object.h" -#include "Position.h" #include "Spline.h" #include "MapObject.h" diff --git a/src/server/game/Entities/AreaTrigger/AreaTriggerTemplate.cpp b/src/server/game/Entities/AreaTrigger/AreaTriggerTemplate.cpp index a4a1d4f4222..5a34fbcb474 100644 --- a/src/server/game/Entities/AreaTrigger/AreaTriggerTemplate.cpp +++ b/src/server/game/Entities/AreaTrigger/AreaTriggerTemplate.cpp @@ -16,9 +16,35 @@ */ #include "AreaTriggerTemplate.h" - +#include <G3D/Vector3.h> +#include <algorithm> +#include <cstring> #include <cmath> +AreaTriggerScaleInfo::AreaTriggerScaleInfo() +{ + memset(OverrideScale, 0, sizeof(OverrideScale)); + memset(ExtraScale, 0, sizeof(ExtraScale)); + + ExtraScale[5].AsFloat = 1.0000001f; + ExtraScale[6].AsInt32 = 1; +} + +AreaTriggerTemplate::AreaTriggerTemplate() +{ + Id = 0; + Type = AREATRIGGER_TYPE_MAX; + Flags = 0; + ScriptId = 0; + MaxSearchRadius = 0.0f; + + memset(DefaultDatas.Data, 0, sizeof(DefaultDatas.Data)); +} + +AreaTriggerTemplate::~AreaTriggerTemplate() +{ +} + // Init the MaxSearchRadius that will be used in TrinitySearcher, avoiding calculate it at each update void AreaTriggerTemplate::InitMaxSearchRadius() { @@ -58,3 +84,30 @@ void AreaTriggerTemplate::InitMaxSearchRadius() break; } } + +AreaTriggerMiscTemplate::AreaTriggerMiscTemplate() +{ + MiscId = 0; + AreaTriggerEntry = 0; + + MoveCurveId = 0; + ScaleCurveId = 0; + MorphCurveId = 0; + FacingCurveId = 0; + + DecalPropertiesId = 0; + + TimeToTarget = 0; + TimeToTargetScale = 0; + + Template = nullptr; +} + +AreaTriggerMiscTemplate::~AreaTriggerMiscTemplate() +{ +} + +bool AreaTriggerMiscTemplate::HasSplines() const +{ + return SplinePoints.size() >= 2; +} diff --git a/src/server/game/Entities/AreaTrigger/AreaTriggerTemplate.h b/src/server/game/Entities/AreaTrigger/AreaTriggerTemplate.h index d6ef0a43d79..64db8856666 100644 --- a/src/server/game/Entities/AreaTrigger/AreaTriggerTemplate.h +++ b/src/server/game/Entities/AreaTrigger/AreaTriggerTemplate.h @@ -19,9 +19,13 @@ #define TRINITYCORE_AREATRIGGER_TEMPLATE_H #include "Define.h" -#include <G3D/Vector3.h> #include <vector> -#include <cstring> + +namespace G3D +{ + class Vector2; + class Vector3; +} #define MAX_AREATRIGGER_ENTITY_DATA 6 #define MAX_AREATRIGGER_SCALE 7 @@ -78,14 +82,7 @@ struct AreaTriggerAction struct AreaTriggerScaleInfo { - AreaTriggerScaleInfo() - { - memset(OverrideScale, 0, sizeof(OverrideScale)); - memset(ExtraScale, 0, sizeof(ExtraScale)); - - ExtraScale[5].AsFloat = 1.0000001f; - ExtraScale[6].AsInt32 = 1; - } + AreaTriggerScaleInfo(); union { @@ -103,16 +100,8 @@ struct AreaTriggerScaleInfo class AreaTriggerTemplate { public: - AreaTriggerTemplate() - { - Id = 0; - Type = AREATRIGGER_TYPE_MAX; - Flags = 0; - ScriptId = 0; - MaxSearchRadius = 0.0f; - - memset(DefaultDatas.Data, 0, sizeof(DefaultDatas.Data)); - } + AreaTriggerTemplate(); + ~AreaTriggerTemplate(); bool HasFlag(uint32 flag) const { return (Flags & flag) != 0; } @@ -176,25 +165,10 @@ public: class AreaTriggerMiscTemplate { public: - AreaTriggerMiscTemplate() - { - MiscId = 0; - AreaTriggerEntry = 0; - - MoveCurveId = 0; - ScaleCurveId = 0; - MorphCurveId = 0; - FacingCurveId = 0; - - DecalPropertiesId = 0; - - TimeToTarget = 0; - TimeToTargetScale = 0; - - Template = nullptr; - } + AreaTriggerMiscTemplate(); + ~AreaTriggerMiscTemplate(); - bool HasSplines() const { return SplinePoints.size() >= 2; } + bool HasSplines() const; uint32 MiscId; uint32 AreaTriggerEntry; diff --git a/src/server/game/Entities/Creature/GossipDef.h b/src/server/game/Entities/Creature/GossipDef.h index 222443188fa..66b009a92ef 100644 --- a/src/server/game/Entities/Creature/GossipDef.h +++ b/src/server/game/Entities/Creature/GossipDef.h @@ -21,10 +21,10 @@ #include "Common.h" #include "ObjectGuid.h" -#include "QuestDef.h" #include "NPCHandler.h" #include <map> +class Quest; class WorldSession; #define GOSSIP_MAX_MENU_ITEMS 32 diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 35bf4942af2..0459b6322dc 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -21,23 +21,17 @@ #include "ObjectGridLoader.h" #include "UpdateData.h" -#include <iostream> -#include "Corpse.h" -#include "Object.h" #include "AreaTrigger.h" +#include "Creature.h" +#include "Corpse.h" #include "Conversation.h" #include "DynamicObject.h" #include "GameObject.h" +#include "Packet.h" #include "Player.h" -#include "Unit.h" -#include "CreatureAI.h" #include "Spell.h" -#include "WorldSession.h" -#include "Packet.h" - -class Player; -//class Map; +#include "UnitAI.h" namespace Trinity { @@ -156,8 +150,7 @@ namespace Trinity if (!player->HaveAtClient(i_source)) return; - if (WorldSession* session = player->GetSession()) - session->SendPacket(i_message); + player->SendDirectMessage(i_message); } }; @@ -1014,8 +1007,8 @@ namespace Trinity if (!u->IsWithinLOSInMap(i_enemy)) return; - if (u->AI()) - u->AI()->AttackStart(i_enemy); + if (u->GetAI() && u->IsAIEnabled) + u->GetAI()->AttackStart(i_enemy); } private: Unit* const i_funit; diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 61eb874d882..9618146160e 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -459,12 +459,6 @@ void MotionMaster::MoveCirclePath(float x, float y, float z, float radius, bool void MotionMaster::MoveSmoothPath(uint32 pointId, G3D::Vector3 const* pathPoints, size_t pathSize, bool walk, bool fly) { - Movement::PointsArray path(pathPoints, pathPoints + pathSize); - MoveSmoothPath(pointId, path, walk, fly); -} - -void MotionMaster::MoveSmoothPath(uint32 pointId, Movement::PointsArray const& path, bool walk, bool fly) -{ Movement::MoveSplineInit init(_owner); if (fly) { @@ -472,6 +466,7 @@ void MotionMaster::MoveSmoothPath(uint32 pointId, Movement::PointsArray const& p init.SetUncompressed(); } + Movement::PointsArray path(pathPoints, pathPoints + pathSize); init.MovebyPath(path); init.SetSmooth(); init.SetWalk(walk); @@ -502,7 +497,7 @@ void MotionMaster::MoveAlongSplineChain(uint32 pointId, uint16 dbChainId, bool w MoveAlongSplineChain(pointId, *chain, walk); } -void MotionMaster::MoveAlongSplineChain(uint32 pointId, SplineChain const& chain, bool walk) +void MotionMaster::MoveAlongSplineChain(uint32 pointId, std::vector<SplineChainLink> const& chain, bool walk) { Mutate(new SplineChainMovementGenerator(pointId, chain, walk), MOTION_SLOT_ACTIVE); } diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index 467783ca116..e338b61244e 100644 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -20,15 +20,23 @@ #define TRINITY_MOTIONMASTER_H #include "Common.h" -#include <vector> +#include "Errors.h" +#include "ObjectGuid.h" +#include "Position.h" #include "SharedDefines.h" -#include "Object.h" -#include "MoveSplineInitArgs.h" -#include "SplineChain.h" +#include <vector> class MovementGenerator; class Unit; class PathGenerator; +struct Position; +struct SplineChainLink; +struct SplineChainResumeInfo; + +namespace G3D +{ + class Vector3; +} namespace Movement { struct SpellEffectExtraData; @@ -208,10 +216,9 @@ class TC_GAME_API MotionMaster //: private std::stack<MovementGenerator *> void MoveJump(float x, float y, float z, float o, float speedXY, float speedZ, uint32 id = EVENT_JUMP, bool hasOrientation = false, JumpArrivalCastArgs const* arrivalCast = nullptr, Movement::SpellEffectExtraData const* spellEffectExtraData = nullptr); void MoveCirclePath(float x, float y, float z, float radius, bool clockwise, uint8 stepCount); void MoveSmoothPath(uint32 pointId, G3D::Vector3 const* pathPoints, size_t pathSize, bool walk = false, bool fly = false); - void MoveSmoothPath(uint32 pointId, Movement::PointsArray const& points, bool walk = false, bool fly = false); // Walk along spline chain stored in DB (script_spline_chain_meta and script_spline_chain_waypoints) void MoveAlongSplineChain(uint32 pointId, uint16 dbChainId, bool walk); - void MoveAlongSplineChain(uint32 pointId, SplineChain const& chain, bool walk); + void MoveAlongSplineChain(uint32 pointId, std::vector<SplineChainLink> const& chain, bool walk); void ResumeSplineChain(SplineChainResumeInfo const& info); void MoveFall(uint32 id = 0); diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h index e07d4b5a2d9..bc39a13724b 100644 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h @@ -22,6 +22,7 @@ #include "MovementGenerator.h" #include "FollowerReference.h" +class Creature; namespace Movement { struct SpellEffectExtraData; diff --git a/src/server/game/Movement/Waypoints/WaypointManager.h b/src/server/game/Movement/Waypoints/WaypointManager.h index 97227becbc1..8ba0a272fb7 100644 --- a/src/server/game/Movement/Waypoints/WaypointManager.h +++ b/src/server/game/Movement/Waypoints/WaypointManager.h @@ -19,7 +19,9 @@ #ifndef TRINITY_WAYPOINTMANAGER_H #define TRINITY_WAYPOINTMANAGER_H +#include "Define.h" #include <vector> +#include <unordered_map> enum WaypointMoveType { diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.h b/src/server/game/OutdoorPvP/OutdoorPvP.h index 2d06cc7238b..d5b10a81184 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.h +++ b/src/server/game/OutdoorPvP/OutdoorPvP.h @@ -74,7 +74,6 @@ struct creature_type float o; }; -// some class predefs class Creature; class GameObject; class Map; diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 43b416e78d8..9ce57084b6a 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -19,18 +19,14 @@ #ifndef TRINITYCORE_QUEST_H #define TRINITYCORE_QUEST_H -#include "Define.h" +#include "Common.h" +#include "DBCEnums.h" #include "DatabaseEnvFwd.h" #include "SharedDefines.h" -#include "DBCEnums.h" - -#include <string> #include <vector> class Player; -class ObjectMgr; - namespace WorldPackets { namespace Quest diff --git a/src/server/game/Texts/ChatTextBuilder.cpp b/src/server/game/Texts/ChatTextBuilder.cpp new file mode 100644 index 00000000000..366664af856 --- /dev/null +++ b/src/server/game/Texts/ChatTextBuilder.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "ChatTextBuilder.h" +#include "ChatPackets.h" +#include "DB2Stores.h" +#include "Unit.h" + +WorldPackets::Packet* Trinity::BroadcastTextBuilder::operator()(LocaleConstant locale) const +{ + BroadcastTextEntry const* bct = sBroadcastTextStore.LookupEntry(_textId); + WorldPackets::Chat::Chat* chat = new WorldPackets::Chat::Chat(); + chat->Initialize(_msgType, bct ? Language(bct->Language) : LANG_UNIVERSAL, _source, _target, bct ? DB2Manager::GetBroadcastTextValue(bct, locale, _source->getGender()) : "", _achievementId, "", locale); + return chat; +} + +WorldPackets::Packet* Trinity::CustomChatTextBuilder::operator()(LocaleConstant locale) const +{ + WorldPackets::Chat::Chat* chat = new WorldPackets::Chat::Chat(); + chat->Initialize(_msgType, _language, _source, _target, _text, 0, "", locale); + return chat; +} diff --git a/src/server/game/Texts/ChatTextBuilder.h b/src/server/game/Texts/ChatTextBuilder.h index 825ceff20f3..8ed611be469 100644 --- a/src/server/game/Texts/ChatTextBuilder.h +++ b/src/server/game/Texts/ChatTextBuilder.h @@ -18,9 +18,17 @@ #ifndef __CHATTEXT_BUILDER_H #define __CHATTEXT_BUILDER_H -#include "Chat.h" -#include "ObjectMgr.h" -#include "Packets/ChatPackets.h" +#include "Common.h" +#include "SharedDefines.h" +#include <string> + +class Unit; +class WorldObject; + +namespace WorldPackets +{ + class Packet; +} namespace Trinity { @@ -30,13 +38,7 @@ namespace Trinity BroadcastTextBuilder(Unit const* obj, ChatMsg msgType, uint32 textId, WorldObject const* target = nullptr, uint32 achievementId = 0) : _source(obj), _msgType(msgType), _textId(textId), _target(target), _achievementId(achievementId) { } - WorldPackets::Chat::Chat* operator()(LocaleConstant locale) const - { - BroadcastTextEntry const* bct = sBroadcastTextStore.LookupEntry(_textId); - WorldPackets::Chat::Chat* chat = new WorldPackets::Chat::Chat(); - chat->Initialize(_msgType, bct ? Language(bct->Language) : LANG_UNIVERSAL, _source, _target, bct ? DB2Manager::GetBroadcastTextValue(bct, locale, _source->getGender()) : "", _achievementId, "", locale); - return chat; - } + WorldPackets::Packet* operator()(LocaleConstant locale) const; private: Unit const* _source; @@ -52,12 +54,7 @@ namespace Trinity CustomChatTextBuilder(WorldObject const* obj, ChatMsg msgType, std::string const& text, Language language = LANG_UNIVERSAL, WorldObject const* target = nullptr) : _source(obj), _msgType(msgType), _text(text), _language(language), _target(target) { } - WorldPackets::Chat::Chat* operator()(LocaleConstant locale) const - { - WorldPackets::Chat::Chat* chat = new WorldPackets::Chat::Chat(); - chat->Initialize(_msgType, _language, _source, _target, _text, 0, "", locale); - return chat; - } + WorldPackets::Packet* operator()(LocaleConstant locale) const; private: WorldObject const* _source; diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 7a1e726ca03..ad02e6618fc 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -34,7 +34,7 @@ class CreatureTextBuilder CreatureTextBuilder(WorldObject const* obj, uint8 gender, ChatMsg msgtype, uint8 textGroup, uint32 id, uint32 language, WorldObject const* target) : _source(obj), _gender(gender), _msgType(msgtype), _textGroup(textGroup), _textId(id), _language(language), _target(target) { } - WorldPackets::Chat::Chat* operator()(LocaleConstant locale) const + WorldPackets::Packet* operator()(LocaleConstant locale) const { std::string const& text = sCreatureTextMgr->GetLocalizedChatString(_source->GetEntry(), _gender, _textGroup, _textId, locale); WorldPackets::Chat::Chat* chat = new WorldPackets::Chat::Chat(); @@ -58,7 +58,7 @@ class PlayerTextBuilder PlayerTextBuilder(WorldObject const* obj, WorldObject const* speaker, uint8 gender, ChatMsg msgtype, uint8 textGroup, uint32 id, uint32 language, WorldObject const* target) : _source(obj), _talker(speaker), _gender(gender), _msgType(msgtype), _textGroup(textGroup), _textId(id), _language(language), _target(target) { } - WorldPackets::Chat::Chat* operator()(LocaleConstant locale) const + WorldPackets::Packet* operator()(LocaleConstant locale) const { std::string const& text = sCreatureTextMgr->GetLocalizedChatString(_source->GetEntry(), _gender, _textGroup, _textId, locale); WorldPackets::Chat::Chat* chat = new WorldPackets::Chat::Chat(); diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index ea891e6a78d..475fda31f20 100644 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -128,7 +128,7 @@ class CreatureTextLocalizer delete _packetCache[i]; } - void operator()(Player* player) + void operator()(Player const* player) const { LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); WorldPackets::Chat::Chat* messageTemplate; @@ -136,29 +136,32 @@ class CreatureTextLocalizer // create if not cached yet if (!_packetCache[loc_idx]) { - messageTemplate = _builder(loc_idx); + messageTemplate = static_cast<WorldPackets::Chat::Chat*>(_builder(loc_idx)); + messageTemplate->Write(); _packetCache[loc_idx] = messageTemplate; } else messageTemplate = _packetCache[loc_idx]; - WorldPackets::Chat::Chat message(*messageTemplate); - switch (_msgType) { case CHAT_MSG_MONSTER_WHISPER: case CHAT_MSG_RAID_BOSS_WHISPER: + { + WorldPackets::Chat::Chat message(*messageTemplate); message.SetReceiver(player, loc_idx); - break; + player->SendDirectMessage(message.Write()); + return; + } default: break; } - player->SendDirectMessage(message.Write()); + player->SendDirectMessage(messageTemplate->GetRawPacket()); } private: - std::vector<WorldPackets::Chat::Chat*> _packetCache; + mutable std::vector<WorldPackets::Chat::Chat*> _packetCache; Builder const& _builder; ChatMsg _msgType; }; @@ -178,11 +181,9 @@ void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder if (!whisperTarget) return; - if (Player* whisperPlayer = const_cast<Player*>(whisperTarget->ToPlayer())) - { - if (Group* group = whisperPlayer->GetGroup()) + if (Player const* whisperPlayer = whisperTarget->ToPlayer()) + if (Group const* group = whisperPlayer->GetGroup()) group->BroadcastWorker(localizer); - } return; } case CHAT_MSG_MONSTER_WHISPER: diff --git a/src/server/scripts/Commands/cs_achievement.cpp b/src/server/scripts/Commands/cs_achievement.cpp index e843888783d..8a7a1003e8c 100644 --- a/src/server/scripts/Commands/cs_achievement.cpp +++ b/src/server/scripts/Commands/cs_achievement.cpp @@ -22,11 +22,12 @@ Comment: All achievement related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "AchievementMgr.h" #include "Chat.h" #include "Language.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" class achievement_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_ahbot.cpp b/src/server/scripts/Commands/cs_ahbot.cpp index 08fa562cdb6..82ba2156fe4 100644 --- a/src/server/scripts/Commands/cs_ahbot.cpp +++ b/src/server/scripts/Commands/cs_ahbot.cpp @@ -16,9 +16,10 @@ */ #include "ScriptMgr.h" +#include "AuctionHouseBot.h" #include "Chat.h" #include "Language.h" -#include "AuctionHouseBot.h" +#include "RBAC.h" static const uint32 ahbotQualityIds[MAX_AUCTION_QUALITY] = { diff --git a/src/server/scripts/Commands/cs_arena.cpp b/src/server/scripts/Commands/cs_arena.cpp index 10194b7c896..2ca02645e53 100644 --- a/src/server/scripts/Commands/cs_arena.cpp +++ b/src/server/scripts/Commands/cs_arena.cpp @@ -22,13 +22,14 @@ Comment: All arena team related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "ArenaTeamMgr.h" #include "Chat.h" #include "Language.h" #include "Log.h" #include "ObjectMgr.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" class arena_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_bf.cpp b/src/server/scripts/Commands/cs_bf.cpp index 6c4097a79b6..06687949f5b 100644 --- a/src/server/scripts/Commands/cs_bf.cpp +++ b/src/server/scripts/Commands/cs_bf.cpp @@ -23,8 +23,9 @@ Category: commandscripts EndScriptData */ #include "ScriptMgr.h" -#include "Chat.h" #include "BattlefieldMgr.h" +#include "Chat.h" +#include "RBAC.h" class bf_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_cast.cpp b/src/server/scripts/Commands/cs_cast.cpp index 2731f65a475..416daaa4b35 100644 --- a/src/server/scripts/Commands/cs_cast.cpp +++ b/src/server/scripts/Commands/cs_cast.cpp @@ -27,6 +27,7 @@ EndScriptData */ #include "Creature.h" #include "Language.h" #include "Player.h" +#include "RBAC.h" class cast_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_cheat.cpp b/src/server/scripts/Commands/cs_cheat.cpp index 3765cd0d6d3..4eda4cc5017 100644 --- a/src/server/scripts/Commands/cs_cheat.cpp +++ b/src/server/scripts/Commands/cs_cheat.cpp @@ -22,10 +22,11 @@ Comment: All cheat related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" #include "Language.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" class cheat_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index f98d5e35a4c..1d93561eb85 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -22,11 +22,13 @@ Comment: All debug related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "BattlefieldMgr.h" #include "BattlegroundMgr.h" #include "Cell.h" #include "CellImpl.h" #include "Chat.h" +#include "ChatPackets.h" #include "Conversation.h" #include "GossipDef.h" #include "GridNotifiers.h" @@ -37,7 +39,7 @@ EndScriptData */ #include "MapManager.h" #include "MovementPackets.h" #include "ObjectMgr.h" -#include "ScriptMgr.h" +#include "RBAC.h" #include "SpellPackets.h" #include "Transport.h" #include <fstream> diff --git a/src/server/scripts/Commands/cs_deserter.cpp b/src/server/scripts/Commands/cs_deserter.cpp index d1778d14999..333411d78cb 100644 --- a/src/server/scripts/Commands/cs_deserter.cpp +++ b/src/server/scripts/Commands/cs_deserter.cpp @@ -22,10 +22,11 @@ * This file contains the CommandScripts for all deserter sub-commands */ +#include "ScriptMgr.h" #include "Chat.h" -#include "Player.h" #include "Language.h" -#include "ScriptMgr.h" +#include "Player.h" +#include "RBAC.h" #include "SpellAuras.h" enum Spells diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp index 6c1df3910c5..724778fe0ca 100644 --- a/src/server/scripts/Commands/cs_disable.cpp +++ b/src/server/scripts/Commands/cs_disable.cpp @@ -22,6 +22,7 @@ Comment: All disable related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" #include "CriteriaHandler.h" #include "DatabaseEnv.h" @@ -30,7 +31,7 @@ EndScriptData */ #include "ObjectMgr.h" #include "OutdoorPvP.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" #include "SpellMgr.h" class disable_commandscript : public CommandScript diff --git a/src/server/scripts/Commands/cs_event.cpp b/src/server/scripts/Commands/cs_event.cpp index 05b49f9b4e7..633891bd4af 100644 --- a/src/server/scripts/Commands/cs_event.cpp +++ b/src/server/scripts/Commands/cs_event.cpp @@ -22,11 +22,12 @@ Comment: All event related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" #include "GameEventMgr.h" #include "Language.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" class event_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 802f8830ff8..c71a7ad2782 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -22,13 +22,14 @@ Comment: All go related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" #include "DatabaseEnv.h" #include "Language.h" #include "MapManager.h" #include "ObjectMgr.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" #include "SupportMgr.h" #include "Transport.h" diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 9fafa61be20..859fad4eae0 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -22,6 +22,7 @@ Comment: All gobject related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" #include "DatabaseEnv.h" #include "GameEventMgr.h" @@ -32,7 +33,7 @@ EndScriptData */ #include "Opcodes.h" #include "Player.h" #include "PoolMgr.h" -#include "ScriptMgr.h" +#include "RBAC.h" class gobject_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_group.cpp b/src/server/scripts/Commands/cs_group.cpp index 8abad46babe..311ed64cf18 100644 --- a/src/server/scripts/Commands/cs_group.cpp +++ b/src/server/scripts/Commands/cs_group.cpp @@ -15,6 +15,7 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "ScriptMgr.h" #include "Chat.h" #include "DatabaseEnv.h" #include "GroupMgr.h" @@ -22,7 +23,7 @@ #include "LFG.h" #include "ObjectMgr.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" class group_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_guild.cpp b/src/server/scripts/Commands/cs_guild.cpp index d21357a8ef9..02765540582 100644 --- a/src/server/scripts/Commands/cs_guild.cpp +++ b/src/server/scripts/Commands/cs_guild.cpp @@ -22,6 +22,7 @@ Comment: All guild related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "AchievementMgr.h" #include "Chat.h" #include "Language.h" @@ -29,7 +30,7 @@ EndScriptData */ #include "GuildMgr.h" #include "ObjectAccessor.h" #include "ObjectMgr.h" -#include "ScriptMgr.h" +#include "RBAC.h" #include <iomanip> class guild_commandscript : public CommandScript diff --git a/src/server/scripts/Commands/cs_honor.cpp b/src/server/scripts/Commands/cs_honor.cpp index 4cff715fd2c..55b80c727fd 100644 --- a/src/server/scripts/Commands/cs_honor.cpp +++ b/src/server/scripts/Commands/cs_honor.cpp @@ -22,11 +22,12 @@ Comment: All honor related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" #include "Language.h" #include "ObjectMgr.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" class honor_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp index 039668784fe..c5743f29424 100644 --- a/src/server/scripts/Commands/cs_instance.cpp +++ b/src/server/scripts/Commands/cs_instance.cpp @@ -27,9 +27,10 @@ EndScriptData */ #include "Group.h" #include "InstanceSaveMgr.h" #include "InstanceScript.h" +#include "Language.h" #include "MapManager.h" #include "Player.h" -#include "Language.h" +#include "RBAC.h" class instance_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 15b90d9490c..cfddaac6aa0 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -22,14 +22,15 @@ Comment: All learn related commands Category: commandscripts EndScriptData */ -#include "Chat.h" #include "ScriptMgr.h" -#include "ObjectMgr.h" +#include "Chat.h" #include "Language.h" -#include "SpellMgr.h" -#include "SpellInfo.h" -#include "Player.h" +#include "ObjectMgr.h" #include "Pet.h" +#include "Player.h" +#include "RBAC.h" +#include "SpellInfo.h" +#include "SpellMgr.h" class learn_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_lfg.cpp b/src/server/scripts/Commands/cs_lfg.cpp index 07123744e18..13670f4dad3 100644 --- a/src/server/scripts/Commands/cs_lfg.cpp +++ b/src/server/scripts/Commands/cs_lfg.cpp @@ -15,6 +15,7 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "ScriptMgr.h" #include "Chat.h" #include "DatabaseEnv.h" #include "Group.h" @@ -23,7 +24,7 @@ #include "LFGMgr.h" #include "ObjectMgr.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" void GetPlayerInfo(ChatHandler* handler, Player* player) { diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index c324c292463..af22e91fedd 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -22,13 +22,14 @@ Comment: All list related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" #include "DatabaseEnv.h" #include "Language.h" #include "ObjectAccessor.h" #include "ObjectMgr.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" #include "SpellAuraEffects.h" class list_commandscript : public CommandScript diff --git a/src/server/scripts/Commands/cs_message.cpp b/src/server/scripts/Commands/cs_message.cpp index e9c681f1904..edddedd6e98 100644 --- a/src/server/scripts/Commands/cs_message.cpp +++ b/src/server/scripts/Commands/cs_message.cpp @@ -22,14 +22,16 @@ Comment: All message related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" +#include "ChatPackets.h" #include "Channel.h" #include "ChannelMgr.h" #include "DatabaseEnv.h" #include "Language.h" -#include "Player.h" #include "ObjectMgr.h" -#include "ScriptMgr.h" +#include "Player.h" +#include "RBAC.h" #include "World.h" class message_commandscript : public CommandScript diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp index c56114f0ebd..3e8081eb835 100644 --- a/src/server/scripts/Commands/cs_mmaps.cpp +++ b/src/server/scripts/Commands/cs_mmaps.cpp @@ -24,18 +24,18 @@ */ #include "ScriptMgr.h" +#include "CellImpl.h" #include "Chat.h" #include "DisableMgr.h" +#include "GridNotifiersImpl.h" +#include "Map.h" +#include "MMapFactory.h" #include "ObjectMgr.h" +#include "PathGenerator.h" #include "Player.h" #include "PointMovementGenerator.h" -#include "PathGenerator.h" -#include "MMapFactory.h" -#include "Map.h" +#include "RBAC.h" #include "TargetedMovementGenerator.h" -#include "GridNotifiers.h" -#include "GridNotifiersImpl.h" -#include "CellImpl.h" class mmaps_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index bc8940a88a1..9246eb4b532 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -22,13 +22,13 @@ Comment: All modify related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" #include "Log.h" -#include "Opcodes.h" #include "Pet.h" #include "Player.h" +#include "RBAC.h" #include "ReputationMgr.h" -#include "ScriptMgr.h" #include "SpellPackets.h" class modify_commandscript : public CommandScript diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 34f77727ca3..981d33c9537 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -22,6 +22,7 @@ Comment: All npc related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" #include "CreatureAI.h" #include "CreatureGroups.h" @@ -31,7 +32,7 @@ EndScriptData */ #include "ObjectMgr.h" #include "Pet.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" #include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand #include "Transport.h" #include "World.h" diff --git a/src/server/scripts/Commands/cs_pet.cpp b/src/server/scripts/Commands/cs_pet.cpp index 7591600365a..61843fbb00c 100644 --- a/src/server/scripts/Commands/cs_pet.cpp +++ b/src/server/scripts/Commands/cs_pet.cpp @@ -15,13 +15,14 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "ScriptMgr.h" #include "Chat.h" #include "Language.h" #include "Log.h" #include "Pet.h" -#include "Player.h" #include "ObjectMgr.h" -#include "ScriptMgr.h" +#include "Player.h" +#include "RBAC.h" static inline Pet* GetSelectedPlayerPetOrOwn(ChatHandler* handler) { diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 5234b3c240b..483585f8b57 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -22,12 +22,13 @@ Comment: All quest related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" #include "DatabaseEnv.h" #include "ObjectMgr.h" #include "Player.h" +#include "RBAC.h" #include "ReputationMgr.h" -#include "ScriptMgr.h" #include "World.h" class quest_commandscript : public CommandScript diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index ebce9ccd9c4..c2026b53fac 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -22,15 +22,16 @@ Comment: All reset related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "AchievementMgr.h" #include "Chat.h" #include "DatabaseEnv.h" #include "Language.h" #include "Log.h" #include "ObjectAccessor.h" -#include "Player.h" #include "Pet.h" -#include "ScriptMgr.h" +#include "Player.h" +#include "RBAC.h" #include "World.h" #include <boost/thread/shared_mutex.hpp> #include <boost/thread/locks.hpp> diff --git a/src/server/scripts/Commands/cs_scene.cpp b/src/server/scripts/Commands/cs_scene.cpp index a86f94bcf29..b37b09a16b3 100644 --- a/src/server/scripts/Commands/cs_scene.cpp +++ b/src/server/scripts/Commands/cs_scene.cpp @@ -18,8 +18,9 @@ #include "ScriptMgr.h" #include "Chat.h" #include "Language.h" -#include "Player.h" #include "ObjectMgr.h" +#include "Player.h" +#include "RBAC.h" class scene_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_send.cpp b/src/server/scripts/Commands/cs_send.cpp index 724a1ef7567..37777da1af0 100644 --- a/src/server/scripts/Commands/cs_send.cpp +++ b/src/server/scripts/Commands/cs_send.cpp @@ -15,13 +15,14 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "ScriptMgr.h" #include "Chat.h" #include "DatabaseEnv.h" #include "Language.h" +#include "ObjectMgr.h" #include "Pet.h" #include "Player.h" -#include "ObjectMgr.h" -#include "ScriptMgr.h" +#include "RBAC.h" class send_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index d02e3da9208..7f108bb2994 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -22,6 +22,7 @@ Comment: All server related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" #include "Config.h" #include "GitRevision.h" @@ -29,7 +30,7 @@ EndScriptData */ #include "Log.h" #include "ObjectAccessor.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" #include "Util.h" #include "World.h" diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index c910b942bbf..4dcb8ed1d97 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -22,6 +22,7 @@ Comment: All tele related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" #include "DatabaseEnv.h" #include "Group.h" @@ -29,7 +30,7 @@ EndScriptData */ #include "MapManager.h" #include "ObjectMgr.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" class tele_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp index 299a7c78e42..bb7f27d4ad9 100644 --- a/src/server/scripts/Commands/cs_titles.cpp +++ b/src/server/scripts/Commands/cs_titles.cpp @@ -22,11 +22,12 @@ Comment: All titles related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" #include "Language.h" #include "ObjectMgr.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" class titles_commandscript : public CommandScript { diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 620b68950a4..ab62af74479 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -22,12 +22,13 @@ Comment: All wp related commands Category: commandscripts EndScriptData */ +#include "ScriptMgr.h" #include "Chat.h" #include "DatabaseEnv.h" #include "Language.h" #include "ObjectMgr.h" #include "Player.h" -#include "ScriptMgr.h" +#include "RBAC.h" #include "WaypointManager.h" class wp_commandscript : public CommandScript |