aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2012-11-20 12:30:30 +0100
committerSpp <spp@jorge.gr>2012-11-20 12:30:30 +0100
commitb5c9ab88023c49ab0e3ab2365c789cd27a6629f1 (patch)
treeba8df66f7d6ce1eb446f62d2766ad310c2626a24 /src
parent81606e5d1ea562b6842ff327fffb551aecd5a79c (diff)
Core/Misc: Reduction of header dependencies - Step II
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h1
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp22
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.h1
-rwxr-xr-xsrc/server/game/Achievements/AchievementMgr.cpp34
-rw-r--r--src/server/game/Battlefield/Zones/BattlefieldWG.cpp5
-rwxr-xr-xsrc/server/game/Battlegrounds/Battleground.cpp14
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundQueue.cpp9
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp5
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.cpp13
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.h5
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.cpp1
-rwxr-xr-xsrc/server/game/Entities/Creature/Creature.cpp54
-rwxr-xr-xsrc/server/game/Entities/Object/Object.cpp113
-rwxr-xr-xsrc/server/game/Entities/Pet/Pet.h67
-rw-r--r--src/server/game/Entities/Pet/PetDefines.h80
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp250
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h26
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp65
-rwxr-xr-xsrc/server/game/Globals/ObjectAccessor.cpp26
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.cpp44
-rwxr-xr-xsrc/server/game/Guilds/Guild.cpp11
-rwxr-xr-xsrc/server/game/Handlers/AuctionHouseHandler.cpp1
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp36
-rwxr-xr-xsrc/server/game/Handlers/GroupHandler.cpp15
-rwxr-xr-xsrc/server/game/Handlers/LootHandler.cpp2
-rwxr-xr-xsrc/server/game/Handlers/NPCHandler.cpp1
-rwxr-xr-xsrc/server/game/Handlers/SkillHandler.cpp7
-rwxr-xr-xsrc/server/game/Instances/InstanceScript.cpp13
-rwxr-xr-xsrc/server/game/Maps/Map.cpp21
-rwxr-xr-xsrc/server/game/Scripting/MapScripts.cpp13
-rwxr-xr-xsrc/server/game/Scripting/ScriptMgr.cpp4
-rwxr-xr-xsrc/server/game/Scripting/ScriptMgr.h2
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp2
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp1
-rwxr-xr-xsrc/server/game/Tickets/TicketMgr.cpp1
-rw-r--r--src/server/scripts/Commands/cs_account.cpp3
-rw-r--r--src/server/scripts/Commands/cs_achievement.cpp3
-rw-r--r--src/server/scripts/Commands/cs_ban.cpp5
-rw-r--r--src/server/scripts/Commands/cs_cast.cpp2
-rw-r--r--src/server/scripts/Commands/cs_character.cpp5
-rw-r--r--src/server/scripts/Commands/cs_cheat.cpp5
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp1
-rw-r--r--src/server/scripts/Commands/cs_disable.cpp7
-rw-r--r--src/server/scripts/Commands/cs_event.cpp5
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp1
-rw-r--r--src/server/scripts/Commands/cs_go.cpp1
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp1
-rw-r--r--src/server/scripts/Commands/cs_guild.cpp3
-rw-r--r--src/server/scripts/Commands/cs_honor.cpp5
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp2
-rw-r--r--src/server/scripts/Commands/cs_lfg.cpp1
-rw-r--r--src/server/scripts/Commands/cs_list.cpp1
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp5
-rw-r--r--src/server/scripts/Commands/cs_message.cpp1
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp2
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp6
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp2
-rw-r--r--src/server/scripts/Commands/cs_quest.cpp5
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp22
-rw-r--r--src/server/scripts/Commands/cs_reset.cpp5
-rw-r--r--src/server/scripts/Commands/cs_server.cpp5
-rw-r--r--src/server/scripts/Commands/cs_tele.cpp7
-rw-r--r--src/server/scripts/Commands/cs_ticket.cpp7
-rw-r--r--src/server/scripts/Commands/cs_titles.cpp5
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp7
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp12
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp2
-rwxr-xr-xsrc/server/shared/Dynamic/LinkedReference/Reference.h1
68 files changed, 602 insertions, 508 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index ca6450aa746..6f748f9dee2 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -22,7 +22,6 @@
#include "Creature.h"
#include "CreatureAI.h"
#include "Unit.h"
-#include "ConditionMgr.h"
#include "Spell.h"
#include "SmartScript.h"
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index b8c0f952df9..a22978632fe 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -15,25 +15,25 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "Cell.h"
+#include "CellImpl.h"
+#include "CreatureTextMgr.h"
#include "DatabaseEnv.h"
-#include "ObjectMgr.h"
-#include "ObjectDefines.h"
+#include "GossipDef.h"
#include "GridDefines.h"
#include "GridNotifiers.h"
-#include "SpellMgr.h"
#include "GridNotifiersImpl.h"
-#include "Cell.h"
-#include "CellImpl.h"
+#include "Group.h"
#include "InstanceScript.h"
+#include "Language.h"
+#include "ObjectDefines.h"
+#include "ObjectMgr.h"
#include "ScriptedCreature.h"
-#include "GossipDef.h"
-#include "ScriptedCreature.h"
-#include "SmartScript.h"
+#include "ScriptedGossip.h"
#include "SmartAI.h"
-#include "Group.h"
+#include "SmartScript.h"
+#include "SpellMgr.h"
#include "Vehicle.h"
-#include "ScriptedGossip.h"
-#include "CreatureTextMgr.h"
class TrinityStringTextBuilder
{
diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h
index 2a0eceb574a..61e22b25d17 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.h
+++ b/src/server/game/AI/SmartScripts/SmartScript.h
@@ -22,7 +22,6 @@
#include "Creature.h"
#include "CreatureAI.h"
#include "Unit.h"
-#include "ConditionMgr.h"
#include "Spell.h"
#include "GridNotifiers.h"
diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp
index 0504effa651..2c20db8e5d4 100755
--- a/src/server/game/Achievements/AchievementMgr.cpp
+++ b/src/server/game/Achievements/AchievementMgr.cpp
@@ -16,30 +16,32 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "Common.h"
-#include "DBCEnums.h"
-#include "ObjectMgr.h"
-#include "ArenaTeamMgr.h"
-#include "GuildMgr.h"
-#include "World.h"
-#include "WorldPacket.h"
-#include "DatabaseEnv.h"
#include "AchievementMgr.h"
#include "ArenaTeam.h"
+#include "ArenaTeamMgr.h"
+#include "BattlegroundAB.h"
+#include "Battleground.h"
#include "CellImpl.h"
+#include "Common.h"
+#include "DatabaseEnv.h"
+#include "DBCEnums.h"
+#include "DisableMgr.h"
#include "GameEventMgr.h"
#include "GridNotifiersImpl.h"
#include "Guild.h"
+#include "GuildMgr.h"
+#include "InstanceScript.h"
#include "Language.h"
+#include "Map.h"
+#include "MapManager.h"
+#include "ObjectMgr.h"
#include "Player.h"
-#include "SpellMgr.h"
-#include "DisableMgr.h"
+#include "ReputationMgr.h"
#include "ScriptMgr.h"
-#include "MapManager.h"
-#include "Battleground.h"
-#include "BattlegroundAB.h"
-#include "Map.h"
-#include "InstanceScript.h"
+#include "SpellMgr.h"
+#include "World.h"
+#include "WorldPacket.h"
+
namespace Trinity
{
@@ -355,7 +357,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
return false;
return target->getGender() == gender.gender;
case ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT:
- return sScriptMgr->OnCriteriaCheck(this, const_cast<Player*>(source), const_cast<Unit*>(target));
+ return sScriptMgr->OnCriteriaCheck(ScriptId, const_cast<Player*>(source), const_cast<Unit*>(target));
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY:
if (source->GetMap()->IsRaid())
if (source->GetMap()->Is25ManRaid() != ((difficulty.difficulty & RAID_DIFFICULTY_MASK_25MAN) != 0))
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
index 9d48bc6115f..812dd5a1c2a 100644
--- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
+++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
@@ -20,11 +20,12 @@
// TODO: Use spell victory/defeat in wg instead of RewardMarkOfHonor() && RewardHonor
// TODO: Add proper implement of achievement
-#include "ObjectMgr.h"
#include "BattlefieldWG.h"
+#include "ObjectMgr.h"
+#include "Player.h"
#include "SpellAuras.h"
+#include "TemporarySummon.h"
#include "Vehicle.h"
-#include "Player.h"
enum WGVehicles
{
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 54422a8c5d3..40a74a49b69 100755
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -16,24 +16,24 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "Player.h"
-#include "ObjectMgr.h"
-#include "ArenaTeamMgr.h"
-#include "World.h"
-#include "WorldPacket.h"
#include "ArenaTeam.h"
+#include "ArenaTeamMgr.h"
#include "Battleground.h"
#include "BattlegroundMgr.h"
#include "Creature.h"
#include "Formulas.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
-#include "Language.h"
#include "MapManager.h"
#include "Object.h"
-#include "SpellAuras.h"
+#include "ObjectMgr.h"
+#include "Player.h"
+#include "ReputationMgr.h"
#include "SpellAuraEffects.h"
+#include "SpellAuras.h"
#include "Util.h"
+#include "World.h"
+#include "WorldPacket.h"
namespace Trinity
{
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
index cc53de7e39a..c610cafa1b1 100755
--- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
@@ -16,14 +16,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "BattlegroundQueue.h"
#include "ArenaTeam.h"
+#include "ArenaTeamMgr.h"
#include "BattlegroundMgr.h"
+#include "BattlegroundQueue.h"
#include "Chat.h"
-#include "ObjectMgr.h"
-#include "ArenaTeamMgr.h"
-#include "Log.h"
#include "Group.h"
+#include "Log.h"
+#include "Language.h"
+#include "ObjectMgr.h"
#include "Player.h"
/*********************************************************/
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp
index a64184261c7..02c5167c9ec 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp
@@ -17,11 +17,12 @@
*/
#include "BattlegroundDS.h"
-#include "ObjectAccessor.h"
+#include "Creature.h"
+#include "GameObject.h"
#include "Language.h"
+#include "ObjectAccessor.h"
#include "Player.h"
#include "WorldPacket.h"
-#include "GameObject.h"
BattlegroundDS::BattlegroundDS()
{
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 72f00406c69..2f3cb0fbaaf 100755
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -16,15 +16,16 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "Player.h"
-#include "SpellAuras.h"
-#include "SpellMgr.h"
+#include "ConditionMgr.h"
#include "GameEventMgr.h"
-#include "ObjectMgr.h"
#include "InstanceScript.h"
-#include "ConditionMgr.h"
-#include "ScriptMgr.h"
+#include "ObjectMgr.h"
+#include "Player.h"
+#include "ReputationMgr.h"
#include "ScriptedCreature.h"
+#include "ScriptMgr.h"
+#include "SpellAuras.h"
+#include "SpellMgr.h"
#include "Spell.h"
// Checks if object meets the condition
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index 57af0562dcd..7b0dc1f20bf 100755
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -19,8 +19,11 @@
#ifndef TRINITY_CONDITIONMGR_H
#define TRINITY_CONDITIONMGR_H
-#include "LootMgr.h"
+#include "Define.h"
+#include "Errors.h"
#include <ace/Singleton.h>
+#include <list>
+#include <map>
class Player;
class Unit;
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index c91be00080e..7cb9efa2f2f 100755
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -21,6 +21,7 @@
#include "DisableMgr.h"
#include "ObjectMgr.h"
#include "SocialMgr.h"
+#include "Language.h"
#include "LFGMgr.h"
#include "LFGScripts.h"
#include "LFGGroupData.h"
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 9bcd4d9c1e2..2300876048b 100755
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -16,40 +16,42 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "BattlegroundMgr.h"
+#include "CellImpl.h"
#include "Common.h"
-#include "DatabaseEnv.h"
-#include "WorldPacket.h"
-#include "World.h"
-#include "ObjectMgr.h"
-#include "GroupMgr.h"
-#include "SpellMgr.h"
-#include "Creature.h"
-#include "QuestDef.h"
-#include "GossipDef.h"
-#include "Player.h"
-#include "PoolMgr.h"
-#include "Opcodes.h"
-#include "Log.h"
-#include "LootMgr.h"
-#include "MapManager.h"
#include "CreatureAI.h"
#include "CreatureAISelector.h"
+#include "CreatureGroups.h"
+#include "Creature.h"
+#include "DatabaseEnv.h"
#include "Formulas.h"
-#include "WaypointMovementGenerator.h"
-#include "InstanceScript.h"
-#include "BattlegroundMgr.h"
-#include "Util.h"
+#include "GameEventMgr.h"
+#include "GossipDef.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
-#include "CellImpl.h"
-#include "OutdoorPvPMgr.h"
-#include "GameEventMgr.h"
-#include "CreatureGroups.h"
-#include "Vehicle.h"
-#include "SpellAuraEffects.h"
#include "Group.h"
-#include "MoveSplineInit.h"
+#include "GroupMgr.h"
+#include "InstanceScript.h"
+#include "Log.h"
+#include "LootMgr.h"
+#include "MapManager.h"
#include "MoveSpline.h"
+#include "MoveSplineInit.h"
+#include "ObjectMgr.h"
+#include "Opcodes.h"
+#include "OutdoorPvPMgr.h"
+#include "Player.h"
+#include "PoolMgr.h"
+#include "QuestDef.h"
+#include "SpellAuraEffects.h"
+#include "SpellMgr.h"
+#include "TemporarySummon.h"
+#include "Util.h"
+#include "Vehicle.h"
+#include "WaypointMovementGenerator.h"
+#include "World.h"
+#include "WorldPacket.h"
+
// apply implementation of the singletons
TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index d8287b68fc5..7818cdc6942 100755
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -2360,119 +2360,6 @@ TempSummon* WorldObject::SummonCreature(uint32 entry, const Position &pos, TempS
return NULL;
}
-Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, uint32 duration)
-{
- Pet* pet = new Pet(this, petType);
-
- if (petType == SUMMON_PET && pet->LoadPetFromDB(this, entry))
- {
- // Remove Demonic Sacrifice auras (known pet)
- Unit::AuraEffectList const& auraClassScripts = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr != auraClassScripts.end();)
- {
- if ((*itr)->GetMiscValue() == 2228)
- {
- RemoveAurasDueToSpell((*itr)->GetId());
- itr = auraClassScripts.begin();
- }
- else
- ++itr;
- }
-
- if (duration > 0)
- pet->SetDuration(duration);
-
- return NULL;
- }
-
- // petentry == 0 for hunter "call pet" (current pet summoned if any)
- if (!entry)
- {
- delete pet;
- return NULL;
- }
-
- pet->Relocate(x, y, z, ang);
- if (!pet->IsPositionValid())
- {
- sLog->outError(LOG_FILTER_GENERAL, "Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)", pet->GetGUIDLow(), pet->GetEntry(), pet->GetPositionX(), pet->GetPositionY());
- delete pet;
- return NULL;
- }
-
- Map* map = GetMap();
- uint32 pet_number = sObjectMgr->GeneratePetNumber();
- if (!pet->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number))
- {
- sLog->outError(LOG_FILTER_GENERAL, "no such creature entry %u", entry);
- delete pet;
- return NULL;
- }
-
- pet->SetCreatorGUID(GetGUID());
- pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
-
- pet->setPowerType(POWER_MANA);
- pet->SetUInt32Value(UNIT_NPC_FLAGS, 0);
- pet->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pet->InitStatsForLevel(getLevel());
-
- SetMinion(pet, true);
-
- switch (petType)
- {
- case SUMMON_PET:
- // this enables pet details window (Shift+P)
- pet->GetCharmInfo()->SetPetNumber(pet_number, true);
- pet->SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
- pet->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
- pet->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
- pet->SetFullHealth();
- pet->SetPower(POWER_MANA, pet->GetMaxPower(POWER_MANA));
- pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped in this case
- break;
- default:
- break;
- }
-
- map->AddToMap(pet->ToCreature());
-
- switch (petType)
- {
- case SUMMON_PET:
- pet->InitPetCreateSpells();
- pet->InitTalentForLevel();
- pet->SavePetToDB(PET_SAVE_AS_CURRENT);
- PetSpellInitialize();
- break;
- default:
- break;
- }
-
- if (petType == SUMMON_PET)
- {
- // Remove Demonic Sacrifice auras (known pet)
- Unit::AuraEffectList const& auraClassScripts = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr != auraClassScripts.end();)
- {
- if ((*itr)->GetMiscValue() == 2228)
- {
- RemoveAurasDueToSpell((*itr)->GetId());
- itr = auraClassScripts.begin();
- }
- else
- ++itr;
- }
- }
-
- if (duration > 0)
- pet->SetDuration(duration);
-
- //ObjectAccessor::UpdateObjectVisibility(pet);
-
- return pet;
-}
-
GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime)
{
if (!IsInWorld())
diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h
index f24bb665710..a1dd57a26cc 100755
--- a/src/server/game/Entities/Pet/Pet.h
+++ b/src/server/game/Entities/Pet/Pet.h
@@ -19,50 +19,11 @@
#ifndef TRINITYCORE_PET_H
#define TRINITYCORE_PET_H
-#include "ObjectDefines.h"
-#include "Unit.h"
+#include "PetDefines.h"
#include "TemporarySummon.h"
-enum PetType
-{
- SUMMON_PET = 0,
- HUNTER_PET = 1,
- MAX_PET_TYPE = 4
-};
-
-#define MAX_PET_STABLES 4
-
-// stored in character_pet.slot
-enum PetSaveMode
-{
- PET_SAVE_AS_DELETED = -1, // not saved in fact
- PET_SAVE_AS_CURRENT = 0, // in current slot (with player)
- PET_SAVE_FIRST_STABLE_SLOT = 1,
- PET_SAVE_LAST_STABLE_SLOT = MAX_PET_STABLES, // last in DB stable slot index (including), all higher have same meaning as PET_SAVE_NOT_IN_SLOT
- PET_SAVE_NOT_IN_SLOT = 100 // for avoid conflict with stable size grow will use 100
-};
-
-enum HappinessState
-{
- UNHAPPY = 1,
- CONTENT = 2,
- HAPPY = 3
-};
-
-enum PetSpellState
-{
- PETSPELL_UNCHANGED = 0,
- PETSPELL_CHANGED = 1,
- PETSPELL_NEW = 2,
- PETSPELL_REMOVED = 3
-};
-
-enum PetSpellType
-{
- PETSPELL_NORMAL = 0,
- PETSPELL_FAMILY = 1,
- PETSPELL_TALENT = 2
-};
+#define PET_FOCUS_REGEN_INTERVAL 4 * IN_MILLISECONDS
+#define HAPPINESS_LEVEL_SIZE 333000
struct PetSpell
{
@@ -71,31 +32,9 @@ struct PetSpell
PetSpellType type;
};
-enum ActionFeedback
-{
- FEEDBACK_NONE = 0,
- FEEDBACK_PET_DEAD = 1,
- FEEDBACK_NOTHING_TO_ATT = 2,
- FEEDBACK_CANT_ATT_TARGET = 3
-};
-
-enum PetTalk
-{
- PET_TALK_SPECIAL_SPELL = 0,
- PET_TALK_ATTACK = 1
-};
-
typedef UNORDERED_MAP<uint32, PetSpell> PetSpellMap;
typedef std::vector<uint32> AutoSpellList;
-#define HAPPINESS_LEVEL_SIZE 333000
-
-#define ACTIVE_SPELLS_MAX 4
-
-#define PET_FOLLOW_DIST 1.0f
-#define PET_FOLLOW_ANGLE (M_PI/2)
-#define PET_FOCUS_REGEN_INTERVAL 4 * IN_MILLISECONDS
-
class Player;
class Pet : public Guardian
diff --git a/src/server/game/Entities/Pet/PetDefines.h b/src/server/game/Entities/Pet/PetDefines.h
new file mode 100644
index 00000000000..76de2647c8c
--- /dev/null
+++ b/src/server/game/Entities/Pet/PetDefines.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * 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/>.
+ */
+
+#ifndef TRINITYCORE_PET_DEFINES_H
+#define TRINITYCORE_PET_DEFINES_H
+
+enum PetType
+{
+ SUMMON_PET = 0,
+ HUNTER_PET = 1,
+ MAX_PET_TYPE = 4
+};
+
+#define MAX_PET_STABLES 4
+
+// stored in character_pet.slot
+enum PetSaveMode
+{
+ PET_SAVE_AS_DELETED = -1, // not saved in fact
+ PET_SAVE_AS_CURRENT = 0, // in current slot (with player)
+ PET_SAVE_FIRST_STABLE_SLOT = 1,
+ PET_SAVE_LAST_STABLE_SLOT = MAX_PET_STABLES, // last in DB stable slot index (including), all higher have same meaning as PET_SAVE_NOT_IN_SLOT
+ PET_SAVE_NOT_IN_SLOT = 100 // for avoid conflict with stable size grow will use 100
+};
+
+enum HappinessState
+{
+ UNHAPPY = 1,
+ CONTENT = 2,
+ HAPPY = 3
+};
+
+enum PetSpellState
+{
+ PETSPELL_UNCHANGED = 0,
+ PETSPELL_CHANGED = 1,
+ PETSPELL_NEW = 2,
+ PETSPELL_REMOVED = 3
+};
+
+enum PetSpellType
+{
+ PETSPELL_NORMAL = 0,
+ PETSPELL_FAMILY = 1,
+ PETSPELL_TALENT = 2
+};
+
+enum ActionFeedback
+{
+ FEEDBACK_NONE = 0,
+ FEEDBACK_PET_DEAD = 1,
+ FEEDBACK_NOTHING_TO_ATT = 2,
+ FEEDBACK_CANT_ATT_TARGET = 3
+};
+
+enum PetTalk
+{
+ PET_TALK_SPECIAL_SPELL = 0,
+ PET_TALK_ATTACK = 1
+};
+
+#define PET_FOLLOW_DIST 1.0f
+#define PET_FOLLOW_ANGLE (M_PI/2)
+
+#endif
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 21db9ac4ff9..a95ce52c3f6 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -16,67 +16,68 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "Common.h"
-#include "Language.h"
-#include "DatabaseEnv.h"
-#include "Log.h"
-#include "Opcodes.h"
-#include "SpellMgr.h"
-#include "World.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
-#include "UpdateMask.h"
#include "Player.h"
-#include "Vehicle.h"
-#include "SkillDiscovery.h"
-#include "QuestDef.h"
-#include "GossipDef.h"
-#include "UpdateData.h"
+#include "AccountMgr.h"
+#include "AchievementMgr.h"
+#include "ArenaTeam.h"
+#include "ArenaTeamMgr.h"
+#include "Battlefield.h"
+#include "BattlefieldMgr.h"
+#include "BattlefieldWG.h"
+#include "BattlegroundAV.h"
+#include "Battleground.h"
+#include "BattlegroundMgr.h"
+#include "CellImpl.h"
#include "Channel.h"
#include "ChannelMgr.h"
-#include "MapManager.h"
-#include "MapInstanced.h"
-#include "InstanceSaveMgr.h"
-#include "GridNotifiers.h"
-#include "GridNotifiersImpl.h"
-#include "CellImpl.h"
-#include "ObjectMgr.h"
-#include "ArenaTeamMgr.h"
-#include "GuildMgr.h"
-#include "GroupMgr.h"
-#include "ObjectAccessor.h"
+#include "CharacterDatabaseCleaner.h"
+#include "Chat.h"
+#include <cmath>
+#include "Common.h"
+#include "ConditionMgr.h"
#include "CreatureAI.h"
+#include "DatabaseEnv.h"
+#include "DisableMgr.h"
#include "Formulas.h"
+#include "GameEventMgr.h"
+#include "GossipDef.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
#include "Group.h"
+#include "GroupMgr.h"
#include "Guild.h"
-#include "Pet.h"
-#include "Util.h"
-#include "Transport.h"
-#include "Weather.h"
-#include "Battleground.h"
-#include "BattlegroundAV.h"
-#include "BattlegroundMgr.h"
+#include "GuildMgr.h"
+#include "InstanceSaveMgr.h"
+#include "InstanceScript.h"
+#include "Language.h"
+#include "LFGMgr.h"
+#include "Log.h"
+#include "MapInstanced.h"
+#include "MapManager.h"
+#include "ObjectAccessor.h"
+#include "ObjectMgr.h"
+#include "Opcodes.h"
#include "OutdoorPvP.h"
#include "OutdoorPvPMgr.h"
-#include "ArenaTeam.h"
-#include "Chat.h"
-#include "Spell.h"
+#include "ReputationMgr.h"
+#include "Pet.h"
+#include "QuestDef.h"
+#include "SkillDiscovery.h"
#include "SocialMgr.h"
-#include "GameEventMgr.h"
-#include "AchievementMgr.h"
-#include "SpellAuras.h"
#include "SpellAuraEffects.h"
-#include "ConditionMgr.h"
-#include "DisableMgr.h"
+#include "SpellAuras.h"
+#include "Spell.h"
+#include "SpellMgr.h"
+#include "Transport.h"
+#include "UpdateData.h"
+#include "UpdateMask.h"
+#include "Util.h"
+#include "Vehicle.h"
+#include "Weather.h"
#include "WeatherMgr.h"
-#include "LFGMgr.h"
-#include "CharacterDatabaseCleaner.h"
-#include "InstanceScript.h"
-#include <cmath>
-#include "AccountMgr.h"
-#include "Battlefield.h"
-#include "BattlefieldMgr.h"
-#include "BattlefieldWG.h"
+#include "World.h"
+#include "WorldPacket.h"
+#include "WorldSession.h"
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS)
@@ -643,7 +644,7 @@ void KillRewarder::Reward()
#ifdef _MSC_VER
#pragma warning(disable:4355)
#endif
-Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_reputationMgr(this)
+Player::Player(WorldSession* session): Unit(true)
{
#ifdef _MSC_VER
#pragma warning(default:4355)
@@ -869,6 +870,8 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep
SetPendingBind(0, 0);
_activeCheats = CHEAT_NONE;
+ m_achievementMgr = new AchievementMgr(this);
+ m_reputationMgr = new ReputationMgr(this);
}
Player::~Player()
@@ -904,6 +907,8 @@ Player::~Player()
delete m_declinedname;
delete m_runes;
+ delete m_achievementMgr;
+ delete m_reputationMgr;
sWorld->DecreasePlayerCount();
}
@@ -1609,7 +1614,7 @@ void Player::Update(uint32 p_time)
}
}
- m_achievementMgr.UpdateTimedAchievements(p_time);
+ m_achievementMgr->UpdateTimedAchievements(p_time);
if (HasUnitState(UNIT_STATE_MELEE_ATTACKING) && !HasUnitState(UNIT_STATE_CASTING))
{
@@ -16732,7 +16737,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f);
// load achievements before anything else to prevent multiple gains for the same achievement/criteria on every loading (as loading does call UpdateAchievementCriteria)
- m_achievementMgr.LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADACHIEVEMENTS), holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADCRITERIAPROGRESS));
+ m_achievementMgr->LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADACHIEVEMENTS), holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADCRITERIAPROGRESS));
uint32 money = fields[8].GetUInt32();
if (money > MAX_MONEY_AMOUNT)
@@ -17176,7 +17181,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
learnDefaultSpells();
// must be before inventory (some items required reputation check)
- m_reputationMgr.LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADREPUTATION));
+ m_reputationMgr->LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADREPUTATION));
_LoadInventory(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADINVENTORY), time_diff);
@@ -17284,7 +17289,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
_LoadDeclinedNames(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADDECLINEDNAMES));
- m_achievementMgr.CheckAllAchievementCriteria();
+ m_achievementMgr->CheckAllAchievementCriteria();
_LoadEquipmentSets(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADEQUIPMENTSETS));
@@ -18828,8 +18833,8 @@ void Player::SaveToDB(bool create /*=false*/)
_SaveActions(trans);
_SaveAuras(trans);
_SaveSkills(trans);
- m_achievementMgr.SaveToDB(trans);
- m_reputationMgr.SaveToDB(trans);
+ m_achievementMgr->SaveToDB(trans);
+ m_reputationMgr->SaveToDB(trans);
_SaveEquipmentSets(trans);
GetSession()->SaveTutorialsData(trans); // changed only while character in game
_SaveGlyphs(trans);
@@ -22077,8 +22082,8 @@ void Player::SendInitialPacketsBeforeAddToMap()
GetSession()->SendPacket(&data);
SendInitialActionButtons();
- m_reputationMgr.SendInitialReputations();
- m_achievementMgr.SendAllAchievementData();
+ m_reputationMgr->SendInitialReputations();
+ m_achievementMgr->SendAllAchievementData();
SendEquipmentSetList();
@@ -24189,42 +24194,42 @@ void Player::HandleFall(MovementInfo const& movementInfo)
void Player::ResetAchievements()
{
- m_achievementMgr.Reset();
+ m_achievementMgr->Reset();
}
void Player::SendRespondInspectAchievements(Player* player) const
{
- m_achievementMgr.SendRespondInspectAchievements(player);
+ m_achievementMgr->SendRespondInspectAchievements(player);
}
bool Player::HasAchieved(uint32 achievementId) const
{
- return m_achievementMgr.HasAchieved(achievementId);
+ return m_achievementMgr->HasAchieved(achievementId);
}
void Player::StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost/* = 0*/)
{
- m_achievementMgr.StartTimedAchievement(type, entry, timeLost);
+ m_achievementMgr->StartTimedAchievement(type, entry, timeLost);
}
void Player::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
{
- m_achievementMgr.RemoveTimedAchievement(type, entry);
+ m_achievementMgr->RemoveTimedAchievement(type, entry);
}
void Player::ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, bool evenIfCriteriaComplete /* = false*/)
{
- m_achievementMgr.ResetAchievementCriteria(type, miscValue1, miscValue2, evenIfCriteriaComplete);
+ m_achievementMgr->ResetAchievementCriteria(type, miscValue1, miscValue2, evenIfCriteriaComplete);
}
void Player::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= NULL*/)
{
- m_achievementMgr.UpdateAchievementCriteria(type, miscValue1, miscValue2, unit);
+ m_achievementMgr->UpdateAchievementCriteria(type, miscValue1, miscValue2, unit);
}
void Player::CompletedAchievement(AchievementEntry const* entry)
{
- m_achievementMgr.CompletedAchievement(entry);
+ m_achievementMgr->CompletedAchievement(entry);
}
void Player::LearnTalent(uint32 talentId, uint32 talentRank)
@@ -25594,3 +25599,116 @@ Guild* Player::GetGuild()
uint32 guildId = GetGuildId();
return guildId ? sGuildMgr->GetGuildById(guildId) : NULL;
}
+
+Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, uint32 duration)
+{
+ Pet* pet = new Pet(this, petType);
+
+ if (petType == SUMMON_PET && pet->LoadPetFromDB(this, entry))
+ {
+ // Remove Demonic Sacrifice auras (known pet)
+ Unit::AuraEffectList const& auraClassScripts = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
+ for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr != auraClassScripts.end();)
+ {
+ if ((*itr)->GetMiscValue() == 2228)
+ {
+ RemoveAurasDueToSpell((*itr)->GetId());
+ itr = auraClassScripts.begin();
+ }
+ else
+ ++itr;
+ }
+
+ if (duration > 0)
+ pet->SetDuration(duration);
+
+ return NULL;
+ }
+
+ // petentry == 0 for hunter "call pet" (current pet summoned if any)
+ if (!entry)
+ {
+ delete pet;
+ return NULL;
+ }
+
+ pet->Relocate(x, y, z, ang);
+ if (!pet->IsPositionValid())
+ {
+ sLog->outError(LOG_FILTER_GENERAL, "Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)", pet->GetGUIDLow(), pet->GetEntry(), pet->GetPositionX(), pet->GetPositionY());
+ delete pet;
+ return NULL;
+ }
+
+ Map* map = GetMap();
+ uint32 pet_number = sObjectMgr->GeneratePetNumber();
+ if (!pet->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number))
+ {
+ sLog->outError(LOG_FILTER_GENERAL, "no such creature entry %u", entry);
+ delete pet;
+ return NULL;
+ }
+
+ pet->SetCreatorGUID(GetGUID());
+ pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
+
+ pet->setPowerType(POWER_MANA);
+ pet->SetUInt32Value(UNIT_NPC_FLAGS, 0);
+ pet->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pet->InitStatsForLevel(getLevel());
+
+ SetMinion(pet, true);
+
+ switch (petType)
+ {
+ case SUMMON_PET:
+ // this enables pet details window (Shift+P)
+ pet->GetCharmInfo()->SetPetNumber(pet_number, true);
+ pet->SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
+ pet->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
+ pet->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
+ pet->SetFullHealth();
+ pet->SetPower(POWER_MANA, pet->GetMaxPower(POWER_MANA));
+ pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped in this case
+ break;
+ default:
+ break;
+ }
+
+ map->AddToMap(pet->ToCreature());
+
+ switch (petType)
+ {
+ case SUMMON_PET:
+ pet->InitPetCreateSpells();
+ pet->InitTalentForLevel();
+ pet->SavePetToDB(PET_SAVE_AS_CURRENT);
+ PetSpellInitialize();
+ break;
+ default:
+ break;
+ }
+
+ if (petType == SUMMON_PET)
+ {
+ // Remove Demonic Sacrifice auras (known pet)
+ Unit::AuraEffectList const& auraClassScripts = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
+ for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr != auraClassScripts.end();)
+ {
+ if ((*itr)->GetMiscValue() == 2228)
+ {
+ RemoveAurasDueToSpell((*itr)->GetId());
+ itr = auraClassScripts.begin();
+ }
+ else
+ ++itr;
+ }
+ }
+
+ if (duration > 0)
+ pet->SetDuration(duration);
+
+ //ObjectAccessor::UpdateObjectVisibility(pet);
+
+ return pet;
+}
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 3b1f47b8f69..07c00031e6b 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -19,26 +19,27 @@
#ifndef _PLAYER_H
#define _PLAYER_H
-#include "AchievementMgr.h"
-#include "Common.h"
-#include "DatabaseEnv.h"
-#include "DBCEnums.h"
+#include "DBCStores.h"
#include "GroupReference.h"
-#include "Item.h"
#include "MapReference.h"
-#include "Pet.h"
+
+#include "Item.h"
+#include "PetDefines.h"
#include "QuestDef.h"
-#include "ReputationMgr.h"
#include "Unit.h"
-#include "WorldSession.h"
#include "SpellMgr.h"
#include <string>
#include <vector>
struct Mail;
+struct VendorItem;
+
+class AchievementMgr;
+class ReputationMgr;
class Channel;
class Creature;
+class CreatureTemplate;
class DynamicObject;
class Group;
class Guild;
@@ -47,6 +48,7 @@ class Pet;
class PlayerMenu;
class PlayerSocial;
class SpellCastTargets;
+class TrainerSpell;
class UpdateMask;
typedef std::deque<Mail*> PlayerMails;
@@ -2012,8 +2014,8 @@ class Player : public Unit, public GridObject<Player>
uint8 GetGrantableLevels() { return m_grantableLevels; }
void SetGrantableLevels(uint8 val) { m_grantableLevels = val; }
- ReputationMgr& GetReputationMgr() { return m_reputationMgr; }
- ReputationMgr const& GetReputationMgr() const { return m_reputationMgr; }
+ ReputationMgr& GetReputationMgr() { return *m_reputationMgr; }
+ ReputationMgr const& GetReputationMgr() const { return *m_reputationMgr; }
ReputationRank GetReputationRank(uint32 faction_id) const;
void RewardReputation(Unit* victim, float rate);
void RewardReputation(Quest const* quest);
@@ -2835,8 +2837,8 @@ class Player : public Unit, public GridObject<Player>
uint32 m_temporaryUnsummonedPetNumber;
uint32 m_oldpetspell;
- AchievementMgr m_achievementMgr;
- ReputationMgr m_reputationMgr;
+ AchievementMgr* m_achievementMgr;
+ ReputationMgr* m_reputationMgr;
SpellCooldowns m_spellCooldowns;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index c886c046427..13b3335cfdc 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -16,49 +16,50 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "Battlefield.h"
+#include "BattlefieldMgr.h"
+#include "Battleground.h"
+#include "CellImpl.h"
#include "Common.h"
+#include "ConditionMgr.h"
+#include "CreatureAI.h"
#include "CreatureAIImpl.h"
-#include "Log.h"
-#include "Opcodes.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
-#include "World.h"
-#include "ObjectMgr.h"
-#include "SpellMgr.h"
-#include "Unit.h"
-#include "QuestDef.h"
-#include "Player.h"
+#include "CreatureGroups.h"
#include "Creature.h"
-#include "Spell.h"
+#include "Formulas.h"
+#include "GridNotifiersImpl.h"
#include "Group.h"
-#include "SpellAuras.h"
-#include "SpellAuraEffects.h"
+#include "InstanceSaveMgr.h"
+#include "InstanceScript.h"
+#include "Log.h"
#include "MapManager.h"
+#include "MoveSpline.h"
+#include "MoveSplineInit.h"
#include "ObjectAccessor.h"
-#include "CreatureAI.h"
-#include "Formulas.h"
-#include "Pet.h"
-#include "Util.h"
-#include "Totem.h"
-#include "Battleground.h"
+#include "ObjectMgr.h"
+#include "Opcodes.h"
#include "OutdoorPvP.h"
-#include "InstanceSaveMgr.h"
-#include "GridNotifiersImpl.h"
-#include "CellImpl.h"
-#include "CreatureGroups.h"
-#include "PetAI.h"
#include "PassiveAI.h"
+#include "PetAI.h"
+#include "Pet.h"
+#include "Player.h"
+#include "QuestDef.h"
+#include "ReputationMgr.h"
+#include "SpellAuraEffects.h"
+#include "SpellAuras.h"
+#include "Spell.h"
+#include "SpellInfo.h"
+#include "SpellMgr.h"
#include "TemporarySummon.h"
-#include "Vehicle.h"
+#include "Totem.h"
#include "Transport.h"
-#include "InstanceScript.h"
-#include "SpellInfo.h"
-#include "MoveSplineInit.h"
-#include "MoveSpline.h"
-#include "ConditionMgr.h"
+#include "Unit.h"
#include "UpdateFieldFlags.h"
-#include "Battlefield.h"
-#include "BattlefieldMgr.h"
+#include "Util.h"
+#include "Vehicle.h"
+#include "World.h"
+#include "WorldPacket.h"
+#include "WorldSession.h"
#include <math.h>
diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp
index 6999eb301f5..cedb20eccf1 100755
--- a/src/server/game/Globals/ObjectAccessor.cpp
+++ b/src/server/game/Globals/ObjectAccessor.cpp
@@ -17,25 +17,25 @@
*/
#include "ObjectAccessor.h"
-#include "ObjectMgr.h"
-
-#include "Player.h"
+#include "CellImpl.h"
+#include "Corpse.h"
#include "Creature.h"
-#include "GameObject.h"
#include "DynamicObject.h"
-#include "Vehicle.h"
-#include "WorldPacket.h"
-#include "Item.h"
-#include "Corpse.h"
+#include "GameObject.h"
#include "GridNotifiers.h"
-#include "MapManager.h"
-#include "Map.h"
-#include "CellImpl.h"
#include "GridNotifiersImpl.h"
-#include "Opcodes.h"
-#include "ObjectDefines.h"
+#include "Item.h"
+#include "Map.h"
#include "MapInstanced.h"
+#include "MapManager.h"
+#include "ObjectDefines.h"
+#include "ObjectMgr.h"
+#include "Opcodes.h"
+#include "Pet.h"
+#include "Player.h"
+#include "Vehicle.h"
#include "World.h"
+#include "WorldPacket.h"
#include <cmath>
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 245079f2495..a94a12a99fe 100755
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -16,36 +16,38 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "AccountMgr.h"
+#include "AchievementMgr.h"
+#include "ArenaTeam.h"
+#include "ArenaTeamMgr.h"
+#include "Chat.h"
#include "Common.h"
#include "DatabaseEnv.h"
+#include "DisableMgr.h"
+#include "GameEventMgr.h"
+#include "GossipDef.h"
+#include "GroupMgr.h"
+#include "GuildMgr.h"
+#include "InstanceSaveMgr.h"
+#include "Language.h"
+#include "LFGMgr.h"
#include "Log.h"
#include "MapManager.h"
#include "ObjectMgr.h"
-#include "ArenaTeamMgr.h"
-#include "GuildMgr.h"
-#include "GroupMgr.h"
+#include "Pet.h"
+#include "PoolMgr.h"
+#include "ReputationMgr.h"
+#include "ScriptMgr.h"
+#include "SpellAuras.h"
+#include "Spell.h"
#include "SpellMgr.h"
-#include "UpdateMask.h"
-#include "World.h"
-#include "ArenaTeam.h"
+#include "SpellScript.h"
#include "Transport.h"
-#include "Language.h"
-#include "GameEventMgr.h"
-#include "Spell.h"
-#include "Chat.h"
-#include "AccountMgr.h"
-#include "InstanceSaveMgr.h"
-#include "SpellAuras.h"
+#include "UpdateMask.h"
#include "Util.h"
-#include "WaypointManager.h"
-#include "GossipDef.h"
#include "Vehicle.h"
-#include "AchievementMgr.h"
-#include "DisableMgr.h"
-#include "ScriptMgr.h"
-#include "SpellScript.h"
-#include "PoolMgr.h"
-#include "LFGMgr.h"
+#include "WaypointManager.h"
+#include "World.h"
ScriptMapMap sQuestEndScripts;
ScriptMapMap sQuestStartScripts;
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index e1be2049dad..5cb02603598 100755
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -16,16 +16,17 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "AccountMgr.h"
+#include "CalendarMgr.h"
+#include "Chat.h"
+#include "Config.h"
#include "DatabaseEnv.h"
#include "Guild.h"
#include "GuildMgr.h"
+#include "Language.h"
+#include "Log.h"
#include "ScriptMgr.h"
-#include "Chat.h"
-#include "Config.h"
#include "SocialMgr.h"
-#include "Log.h"
-#include "AccountMgr.h"
-#include "CalendarMgr.h"
#define MAX_GUILD_BANK_TAB_TEXT_LEN 500
#define EMBLEM_PRICE 10 * GOLD
diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp
index 3c3a6978384..7e23429be2f 100755
--- a/src/server/game/Handlers/AuctionHouseHandler.cpp
+++ b/src/server/game/Handlers/AuctionHouseHandler.cpp
@@ -24,6 +24,7 @@
#include "AuctionHouseMgr.h"
#include "Log.h"
+#include "Language.h"
#include "Opcodes.h"
#include "UpdateMask.h"
#include "Util.h"
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index d0aad7072f7..0b01c796511 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -16,35 +16,37 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "Common.h"
-#include "ObjectAccessor.h"
-#include "ObjectMgr.h"
-#include "ArenaTeamMgr.h"
-#include "GuildMgr.h"
-#include "SystemConfig.h"
-#include "World.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
-#include "DatabaseEnv.h"
-
+#include "AccountMgr.h"
#include "ArenaTeam.h"
+#include "ArenaTeamMgr.h"
+#include "Battleground.h"
+#include "CalendarMgr.h"
#include "Chat.h"
+#include "Common.h"
+#include "DatabaseEnv.h"
#include "Group.h"
#include "Guild.h"
+#include "GuildMgr.h"
#include "Language.h"
+#include "LFGMgr.h"
#include "Log.h"
+#include "ObjectAccessor.h"
+#include "ObjectMgr.h"
#include "Opcodes.h"
-#include "Player.h"
+#include "Pet.h"
#include "PlayerDump.h"
+#include "Player.h"
+#include "ReputationMgr.h"
+#include "ScriptMgr.h"
#include "SharedDefines.h"
#include "SocialMgr.h"
+#include "SystemConfig.h"
#include "UpdateMask.h"
#include "Util.h"
-#include "ScriptMgr.h"
-#include "Battleground.h"
-#include "AccountMgr.h"
-#include "LFGMgr.h"
-#include "CalendarMgr.h"
+#include "World.h"
+#include "WorldPacket.h"
+#include "WorldSession.h"
+
class LoginQueryHolder : public SQLQueryHolder
{
diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp
index 223a5316c7a..8555b4a6a1f 100755
--- a/src/server/game/Handlers/GroupHandler.cpp
+++ b/src/server/game/Handlers/GroupHandler.cpp
@@ -18,19 +18,20 @@
#include "Common.h"
#include "DatabaseEnv.h"
-#include "Opcodes.h"
+#include "Group.h"
+#include "GroupMgr.h"
#include "Log.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
-#include "World.h"
#include "ObjectMgr.h"
-#include "GroupMgr.h"
+#include "Opcodes.h"
+#include "Pet.h"
#include "Player.h"
-#include "Group.h"
#include "SocialMgr.h"
-#include "Util.h"
#include "SpellAuras.h"
+#include "Util.h"
#include "Vehicle.h"
+#include "World.h"
+#include "WorldPacket.h"
+#include "WorldSession.h"
class Aura;
diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp
index 83deaaa1bc6..635afd55a87 100755
--- a/src/server/game/Handlers/LootHandler.cpp
+++ b/src/server/game/Handlers/LootHandler.cpp
@@ -28,7 +28,7 @@
#include "Object.h"
#include "Group.h"
#include "World.h"
-#include "Util.h"
+#include "Creature.h"
void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recvData)
{
diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp
index 0265d1e6f60..ef0f8e130b6 100755
--- a/src/server/game/Handlers/NPCHandler.cpp
+++ b/src/server/game/Handlers/NPCHandler.cpp
@@ -31,6 +31,7 @@
#include "ObjectAccessor.h"
#include "Creature.h"
#include "Pet.h"
+#include "ReputationMgr.h"
#include "BattlegroundMgr.h"
#include "Battleground.h"
#include "ScriptMgr.h"
diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp
index 88ae01f59be..ec389142182 100755
--- a/src/server/game/Handlers/SkillHandler.cpp
+++ b/src/server/game/Handlers/SkillHandler.cpp
@@ -18,13 +18,14 @@
#include "Common.h"
#include "DatabaseEnv.h"
-#include "Opcodes.h"
#include "Log.h"
+#include "ObjectAccessor.h"
+#include "Opcodes.h"
#include "Player.h"
+#include "Pet.h"
+#include "UpdateMask.h"
#include "WorldPacket.h"
#include "WorldSession.h"
-#include "ObjectAccessor.h"
-#include "UpdateMask.h"
void WorldSession::HandleLearnTalentOpcode(WorldPacket & recvData)
{
diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp
index f8df5862df0..a2628fbb265 100755
--- a/src/server/game/Instances/InstanceScript.cpp
+++ b/src/server/game/Instances/InstanceScript.cpp
@@ -16,15 +16,16 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "InstanceScript.h"
-#include "DatabaseEnv.h"
-#include "Map.h"
-#include "Player.h"
-#include "GameObject.h"
#include "Creature.h"
#include "CreatureAI.h"
-#include "Log.h"
+#include "DatabaseEnv.h"
+#include "GameObject.h"
+#include "InstanceScript.h"
#include "LFGMgr.h"
+#include "Log.h"
+#include "Map.h"
+#include "Player.h"
+#include "Pet.h"
void InstanceScript::SaveToDB()
{
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index d40be13c6d8..115d56a607c 100755
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -17,23 +17,24 @@
*/
#include "Map.h"
-#include "GridStates.h"
-#include "ScriptMgr.h"
-#include "VMapFactory.h"
-#include "MapInstanced.h"
+#include "Battleground.h"
#include "CellImpl.h"
+#include "DynamicTree.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
-#include "Transport.h"
+#include "GridStates.h"
+#include "Group.h"
#include "InstanceScript.h"
-#include "ObjectAccessor.h"
+#include "LFGMgr.h"
+#include "MapInstanced.h"
#include "MapManager.h"
+#include "ObjectAccessor.h"
#include "ObjectMgr.h"
-#include "Group.h"
-#include "LFGMgr.h"
-#include "DynamicTree.h"
+#include "Pet.h"
+#include "ScriptMgr.h"
+#include "Transport.h"
#include "Vehicle.h"
-#include "Battleground.h"
+#include "VMapFactory.h"
union u_map_magic
{
diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp
index 517ea6cb6bd..069ae71b7cb 100755
--- a/src/server/game/Scripting/MapScripts.cpp
+++ b/src/server/game/Scripting/MapScripts.cpp
@@ -16,19 +16,20 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "Map.h"
-#include "World.h"
#include "CellImpl.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
-#include "Transport.h"
-#include "ScriptedCreature.h"
-#include "WaypointManager.h"
#include "GossipDef.h"
+#include "Map.h"
#include "MapManager.h"
-#include "ObjectMgr.h"
#include "MapRefManager.h"
+#include "ObjectMgr.h"
+#include "Pet.h"
+#include "ScriptedCreature.h"
#include "ScriptMgr.h"
+#include "Transport.h"
+#include "WaypointManager.h"
+#include "World.h"
/// Put scripts in the execution queue
void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, Object* target)
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index d1e7f87ccff..ac745eb1b5f 100755
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -1187,12 +1187,12 @@ void ScriptMgr::OnShutdown()
FOREACH_SCRIPT(WorldScript)->OnShutdown();
}
-bool ScriptMgr::OnCriteriaCheck(AchievementCriteriaData const* data, Player* source, Unit* target)
+bool ScriptMgr::OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target)
{
ASSERT(source);
// target can be NULL.
- GET_SCRIPT_RET(AchievementCriteriaScript, data->ScriptId, tmpscript, false);
+ GET_SCRIPT_RET(AchievementCriteriaScript, scriptId, tmpscript, false);
return tmpscript->OnCheck(source, target);
}
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index 0f16c648b20..947be2b73fe 100755
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -979,7 +979,7 @@ class ScriptMgr
public: /* AchievementCriteriaScript */
- bool OnCriteriaCheck(AchievementCriteriaData const* data, Player* source, Unit* target);
+ bool OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target);
public: /* PlayerScript */
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 5e9e8cc090b..b29f1498152 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -38,6 +38,8 @@
#include "Vehicle.h"
#include "Battlefield.h"
#include "BattlefieldMgr.h"
+#include "Pet.h"
+#include "ReputationMgr.h"
class Aura;
//
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 1f0532d9b1e..15a3887ac0e 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -63,6 +63,7 @@
#include "GameObjectAI.h"
#include "AccountMgr.h"
#include "InstanceScript.h"
+#include "ReputationMgr.h"
pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
{
diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp
index 5667b31048e..3003221b650 100755
--- a/src/server/game/Tickets/TicketMgr.cpp
+++ b/src/server/game/Tickets/TicketMgr.cpp
@@ -20,6 +20,7 @@
#include "TicketMgr.h"
#include "DatabaseEnv.h"
#include "Log.h"
+#include "Language.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Chat.h"
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 6b6e94f75fb..9269bbb07ee 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -22,10 +22,11 @@ Comment: All account related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
#include "AccountMgr.h"
#include "Chat.h"
+#include "Language.h"
#include "Player.h"
+#include "ScriptMgr.h"
class account_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_achievement.cpp b/src/server/scripts/Commands/cs_achievement.cpp
index 1cb9c4829ec..9f5c861c52f 100644
--- a/src/server/scripts/Commands/cs_achievement.cpp
+++ b/src/server/scripts/Commands/cs_achievement.cpp
@@ -22,9 +22,10 @@ Comment: All achievement related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
#include "Chat.h"
+#include "Language.h"
#include "Player.h"
+#include "ScriptMgr.h"
class achievement_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp
index af04a3b7989..3d340f3aaea 100644
--- a/src/server/scripts/Commands/cs_ban.cpp
+++ b/src/server/scripts/Commands/cs_ban.cpp
@@ -22,12 +22,13 @@ Comment: All ban related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
-#include "Chat.h"
#include "AccountMgr.h"
+#include "Chat.h"
+#include "Language.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
+#include "ScriptMgr.h"
class ban_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_cast.cpp b/src/server/scripts/Commands/cs_cast.cpp
index 5a45f980c2c..7539ebd2b0c 100644
--- a/src/server/scripts/Commands/cs_cast.cpp
+++ b/src/server/scripts/Commands/cs_cast.cpp
@@ -24,6 +24,8 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
+#include "Creature.h"
+#include "Language.h"
#include "Player.h"
class cast_commandscript : public CommandScript
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp
index a352f930410..f8db39e0338 100644
--- a/src/server/scripts/Commands/cs_character.cpp
+++ b/src/server/scripts/Commands/cs_character.cpp
@@ -22,12 +22,13 @@ Comment: All character related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
-#include "Chat.h"
#include "AccountMgr.h"
+#include "Chat.h"
#include "ObjectMgr.h"
#include "PlayerDump.h"
#include "Player.h"
+#include "ReputationMgr.h"
+#include "ScriptMgr.h"
class character_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_cheat.cpp b/src/server/scripts/Commands/cs_cheat.cpp
index 1fe50038d59..026177ece6d 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 "ObjectMgr.h"
#include "Chat.h"
+#include "Language.h"
+#include "ObjectMgr.h"
#include "Player.h"
+#include "ScriptMgr.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 99ed8cc4301..956d9ac3376 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -31,6 +31,7 @@ EndScriptData */
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "GossipDef.h"
+#include "Language.h"
#include <fstream>
diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp
index d9be14f67e4..73ed341a21c 100644
--- a/src/server/scripts/Commands/cs_disable.cpp
+++ b/src/server/scripts/Commands/cs_disable.cpp
@@ -22,13 +22,14 @@ Comment: All disable related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
-#include "ObjectMgr.h"
#include "Chat.h"
#include "DisableMgr.h"
+#include "Language.h"
+#include "ObjectMgr.h"
#include "OutdoorPvP.h"
-#include "SpellMgr.h"
#include "Player.h"
+#include "ScriptMgr.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 8d053a2f061..b0a646b7288 100644
--- a/src/server/scripts/Commands/cs_event.cpp
+++ b/src/server/scripts/Commands/cs_event.cpp
@@ -22,10 +22,11 @@ Comment: All event related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
-#include "GameEventMgr.h"
#include "Chat.h"
+#include "GameEventMgr.h"
+#include "Language.h"
#include "Player.h"
+#include "ScriptMgr.h"
class event_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index 520df4b7b85..0c24a9d8746 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -26,6 +26,7 @@ EndScriptData */
#include "ObjectMgr.h"
#include "Chat.h"
#include "AccountMgr.h"
+#include "Language.h"
#include "World.h"
#include "Player.h"
diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp
index 82ca77eb65b..6d75e63d053 100644
--- a/src/server/scripts/Commands/cs_go.cpp
+++ b/src/server/scripts/Commands/cs_go.cpp
@@ -27,6 +27,7 @@ EndScriptData */
#include "MapManager.h"
#include "TicketMgr.h"
#include "Chat.h"
+#include "Language.h"
#include "Player.h"
class go_commandscript : public CommandScript
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index 7955678b8fd..5a24df4ee66 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -28,6 +28,7 @@ EndScriptData */
#include "PoolMgr.h"
#include "MapManager.h"
#include "Chat.h"
+#include "Language.h"
#include "Player.h"
class gobject_commandscript : public CommandScript
diff --git a/src/server/scripts/Commands/cs_guild.cpp b/src/server/scripts/Commands/cs_guild.cpp
index a453122aef6..73955a6b9b2 100644
--- a/src/server/scripts/Commands/cs_guild.cpp
+++ b/src/server/scripts/Commands/cs_guild.cpp
@@ -22,11 +22,12 @@ Comment: All guild related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
#include "Chat.h"
+#include "Language.h"
#include "Guild.h"
#include "GuildMgr.h"
#include "ObjectAccessor.h"
+#include "ScriptMgr.h"
class guild_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_honor.cpp b/src/server/scripts/Commands/cs_honor.cpp
index 76f5badb707..c1d9229ccd3 100644
--- a/src/server/scripts/Commands/cs_honor.cpp
+++ b/src/server/scripts/Commands/cs_honor.cpp
@@ -22,10 +22,11 @@ Comment: All honor related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
-#include "ObjectMgr.h"
#include "Chat.h"
+#include "Language.h"
+#include "ObjectMgr.h"
#include "Player.h"
+#include "ScriptMgr.h"
class honor_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index 786b949b5b4..9c383153d46 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -25,9 +25,11 @@ EndScriptData */
#include "Chat.h"
#include "ScriptMgr.h"
#include "ObjectMgr.h"
+#include "Language.h"
#include "SpellMgr.h"
#include "SpellInfo.h"
#include "Player.h"
+#include "Pet.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 6739694f228..c4da37d032c 100644
--- a/src/server/scripts/Commands/cs_lfg.cpp
+++ b/src/server/scripts/Commands/cs_lfg.cpp
@@ -17,6 +17,7 @@
#include "ScriptMgr.h"
#include "Chat.h"
+#include "Language.h"
#include "LFGMgr.h"
#include "Group.h"
#include "Player.h"
diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp
index 8d333338be3..977369d1405 100644
--- a/src/server/scripts/Commands/cs_list.cpp
+++ b/src/server/scripts/Commands/cs_list.cpp
@@ -25,6 +25,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "SpellAuraEffects.h"
+#include "Language.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp
index f07862342fd..e7e86fedef0 100644
--- a/src/server/scripts/Commands/cs_lookup.cpp
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -22,13 +22,14 @@ Comment: All lookup related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
-#include "Chat.h"
#include "AccountMgr.h"
+#include "Chat.h"
#include "GameEventMgr.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
+#include "ReputationMgr.h"
+#include "ScriptMgr.h"
class lookup_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_message.cpp b/src/server/scripts/Commands/cs_message.cpp
index d7c2f6117ac..30c94442c51 100644
--- a/src/server/scripts/Commands/cs_message.cpp
+++ b/src/server/scripts/Commands/cs_message.cpp
@@ -25,6 +25,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "ChannelMgr.h"
+#include "Language.h"
#include "Player.h"
class message_commandscript : public CommandScript
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 1cd78759d60..8a5af6c0df3 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -23,6 +23,7 @@
#include "GridNotifiers.h"
#include "Group.h"
#include "InstanceSaveMgr.h"
+#include "Language.h"
#include "MovementGenerator.h"
#include "ObjectAccessor.h"
#include "SpellAuras.h"
@@ -30,6 +31,7 @@
#include "WeatherMgr.h"
#include "ace/INET_Addr.h"
#include "Player.h"
+#include "Pet.h"
class misc_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index 1fc5e99a094..23a1d90368f 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -22,10 +22,12 @@ Comment: All modify related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
-#include "ObjectMgr.h"
#include "Chat.h"
+#include "ObjectMgr.h"
+#include "Pet.h"
#include "Player.h"
+#include "ReputationMgr.h"
+#include "ScriptMgr.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 91711072545..28e0744c29d 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -27,9 +27,11 @@ EndScriptData */
#include "Chat.h"
#include "Transport.h"
#include "CreatureGroups.h"
+#include "Language.h"
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
#include "CreatureAI.h"
#include "Player.h"
+#include "Pet.h"
class npc_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp
index 5776022e59f..22d6e0831d6 100644
--- a/src/server/scripts/Commands/cs_quest.cpp
+++ b/src/server/scripts/Commands/cs_quest.cpp
@@ -22,10 +22,11 @@ Comment: All quest related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
-#include "ObjectMgr.h"
#include "Chat.h"
+#include "ObjectMgr.h"
#include "Player.h"
+#include "ReputationMgr.h"
+#include "ScriptMgr.h"
class quest_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 10b3fd1b997..c2791c815ad 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -22,22 +22,24 @@ Comment: All reload related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
-#include "ObjectMgr.h"
-#include "SpellMgr.h"
-#include "TicketMgr.h"
-#include "MapManager.h"
+#include "AchievementMgr.h"
+#include "AuctionHouseMgr.h"
+#include "Chat.h"
#include "CreatureEventAIMgr.h"
+#include "CreatureTextMgr.h"
#include "DisableMgr.h"
+#include "Language.h"
#include "LFGMgr.h"
-#include "AuctionHouseMgr.h"
-#include "CreatureTextMgr.h"
-#include "SmartAI.h"
+#include "MapManager.h"
+#include "ObjectMgr.h"
+#include "ScriptMgr.h"
#include "SkillDiscovery.h"
#include "SkillExtraItems.h"
-#include "Chat.h"
-#include "WaypointManager.h"
+#include "SmartAI.h"
+#include "SpellMgr.h"
+#include "TicketMgr.h"
#include "WardenCheckMgr.h"
+#include "WaypointManager.h"
class reload_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp
index d4610d57292..21a22381ae0 100644
--- a/src/server/scripts/Commands/cs_reset.cpp
+++ b/src/server/scripts/Commands/cs_reset.cpp
@@ -22,10 +22,13 @@ Comment: All reset related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
+#include "AchievementMgr.h"
#include "Chat.h"
+#include "Language.h"
#include "ObjectAccessor.h"
#include "Player.h"
+#include "Pet.h"
+#include "ScriptMgr.h"
class reset_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp
index 131d7a4149a..bb4f9be5ffe 100644
--- a/src/server/scripts/Commands/cs_server.cpp
+++ b/src/server/scripts/Commands/cs_server.cpp
@@ -22,12 +22,13 @@ Comment: All server related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
#include "Chat.h"
-#include "SystemConfig.h"
#include "Config.h"
+#include "Language.h"
#include "ObjectAccessor.h"
#include "Player.h"
+#include "ScriptMgr.h"
+#include "SystemConfig.h"
class server_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp
index 553559afd1c..756bd75387b 100644
--- a/src/server/scripts/Commands/cs_tele.cpp
+++ b/src/server/scripts/Commands/cs_tele.cpp
@@ -22,12 +22,13 @@ Comment: All tele related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
-#include "ObjectMgr.h"
-#include "MapManager.h"
#include "Chat.h"
#include "Group.h"
+#include "Language.h"
+#include "MapManager.h"
+#include "ObjectMgr.h"
#include "Player.h"
+#include "ScriptMgr.h"
class tele_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp
index 72804ed5727..c0b3809c836 100644
--- a/src/server/scripts/Commands/cs_ticket.cpp
+++ b/src/server/scripts/Commands/cs_ticket.cpp
@@ -22,12 +22,13 @@ Comment: All ticket related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
-#include "Chat.h"
#include "AccountMgr.h"
+#include "Chat.h"
+#include "Language.h"
#include "ObjectMgr.h"
-#include "TicketMgr.h"
#include "Player.h"
+#include "TicketMgr.h"
+#include "ScriptMgr.h"
class ticket_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp
index d25899cb094..c6e11c930fb 100644
--- a/src/server/scripts/Commands/cs_titles.cpp
+++ b/src/server/scripts/Commands/cs_titles.cpp
@@ -22,10 +22,11 @@ Comment: All titles related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
-#include "ObjectMgr.h"
#include "Chat.h"
+#include "Language.h"
+#include "ObjectMgr.h"
#include "Player.h"
+#include "ScriptMgr.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 33adfe62391..c0b2938c156 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -22,11 +22,12 @@ Comment: All wp related commands
Category: commandscripts
EndScriptData */
-#include "ScriptMgr.h"
-#include "ObjectMgr.h"
-#include "WaypointManager.h"
#include "Chat.h"
+#include "Language.h"
+#include "ObjectMgr.h"
#include "Player.h"
+#include "ScriptMgr.h"
+#include "WaypointManager.h"
class wp_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 8e3be212081..026a0c7b280 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -23,17 +23,19 @@
*/
#include "ScriptMgr.h"
-#include "SpellScript.h"
-#include "SpellAuraEffects.h"
-#include "SkillDiscovery.h"
+#include "Battleground.h"
#include "Cell.h"
#include "CellImpl.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
-#include "InstanceScript.h"
#include "Group.h"
+#include "InstanceScript.h"
#include "LFGMgr.h"
-#include "Battleground.h"
+#include "Pet.h"
+#include "ReputationMgr.h"
+#include "SkillDiscovery.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
class spell_gen_absorb0_hitlimit1 : public SpellScriptLoader
{
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index 0f8fa9614a7..a73af6892ca 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -21,7 +21,7 @@
* Scriptnames of files in this file should be prefixed with "spell_hun_".
*/
-#include "Player.h"
+#include "Pet.h"
#include "ScriptMgr.h"
#include "Cell.h"
#include "CellImpl.h"
diff --git a/src/server/shared/Dynamic/LinkedReference/Reference.h b/src/server/shared/Dynamic/LinkedReference/Reference.h
index 6c9710381b9..22921b075fe 100755
--- a/src/server/shared/Dynamic/LinkedReference/Reference.h
+++ b/src/server/shared/Dynamic/LinkedReference/Reference.h
@@ -20,6 +20,7 @@
#define _REFERENCE_H
#include "Dynamic/LinkedList.h"
+#include <assert.h>
//=====================================================