aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2017-06-04 01:00:45 +0200
committerShauren <shauren.trinity@gmail.com>2017-06-04 01:00:45 +0200
commitb453e124231a90321fe79fbf3a62acdcfa54a691 (patch)
treeca2a815b923080385ed9a3a69aefe20ee54a7969 /src/server/game/AI
parentec72a59b08e71ebc7ba00b32592ec903a7995a84 (diff)
Core/Game: Include cleanup part 5
* ObjectMgr.h * Player.h * Unit.h * G3D should no longer propagate everywhere from Spline/MotionMaster
Diffstat (limited to 'src/server/game/AI')
-rw-r--r--src/server/game/AI/CoreAI/CombatAI.cpp1
-rw-r--r--src/server/game/AI/CoreAI/GuardAI.cpp1
-rw-r--r--src/server/game/AI/CoreAI/PetAI.cpp1
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.cpp11
-rw-r--r--src/server/game/AI/CreatureAI.cpp2
-rw-r--r--src/server/game/AI/PlayerAI/PlayerAI.cpp4
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp6
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp4
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp19
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp6
12 files changed, 44 insertions, 15 deletions
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp
index 88ef940ace3..da414114239 100644
--- a/src/server/game/AI/CoreAI/CombatAI.cpp
+++ b/src/server/game/AI/CoreAI/CombatAI.cpp
@@ -21,6 +21,7 @@
#include "Creature.h"
#include "CreatureAIImpl.h"
#include "Log.h"
+#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "SpellInfo.h"
diff --git a/src/server/game/AI/CoreAI/GuardAI.cpp b/src/server/game/AI/CoreAI/GuardAI.cpp
index 399f9b8a514..a71af8a88fe 100644
--- a/src/server/game/AI/CoreAI/GuardAI.cpp
+++ b/src/server/game/AI/CoreAI/GuardAI.cpp
@@ -20,6 +20,7 @@
#include "Creature.h"
#include "Errors.h"
#include "Log.h"
+#include "MotionMaster.h"
#include "Player.h"
GuardAI::GuardAI(Creature* creature) : ScriptedAI(creature)
diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp
index 413e5555e45..2dc5e03e6e5 100644
--- a/src/server/game/AI/CoreAI/PetAI.cpp
+++ b/src/server/game/AI/CoreAI/PetAI.cpp
@@ -21,6 +21,7 @@
#include "Errors.h"
#include "Group.h"
#include "Log.h"
+#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Pet.h"
#include "Player.h"
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp
index 4507d064bea..7469152f2bb 100644
--- a/src/server/game/AI/CoreAI/UnitAI.cpp
+++ b/src/server/game/AI/CoreAI/UnitAI.cpp
@@ -17,14 +17,15 @@
*/
#include "UnitAI.h"
-#include "Player.h"
#include "Creature.h"
-#include "SpellAuras.h"
+#include "CreatureAIImpl.h"
+#include "MotionMaster.h"
+#include "Player.h"
+#include "Spell.h"
#include "SpellAuraEffects.h"
-#include "SpellMgr.h"
+#include "SpellAuras.h"
#include "SpellInfo.h"
-#include "Spell.h"
-#include "CreatureAIImpl.h"
+#include "SpellMgr.h"
void UnitAI::AttackStart(Unit* victim)
{
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 2dd54975ba6..42dfa052eef 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -23,7 +23,9 @@
#include "CreatureTextMgr.h"
#include "Language.h"
#include "Log.h"
+#include "Map.h"
#include "MapReference.h"
+#include "MotionMaster.h"
#include "Player.h"
#include "SpellMgr.h"
#include "TemporarySummon.h"
diff --git a/src/server/game/AI/PlayerAI/PlayerAI.cpp b/src/server/game/AI/PlayerAI/PlayerAI.cpp
index d670df82528..f3c4b36dccf 100644
--- a/src/server/game/AI/PlayerAI/PlayerAI.cpp
+++ b/src/server/game/AI/PlayerAI/PlayerAI.cpp
@@ -17,11 +17,15 @@
#include "PlayerAI.h"
#include "Creature.h"
+#include "Item.h"
+#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "Spell.h"
#include "SpellAuras.h"
#include "SpellAuraEffects.h"
+#include "SpellHistory.h"
+#include "SpellMgr.h"
enum Spells
{
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
index f9334bf9710..a7af9dd0011 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -18,14 +18,18 @@
#include "ScriptedCreature.h"
#include "AreaBoundary.h"
+#include "DB2Stores.h"
#include "Cell.h"
#include "CellImpl.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
#include "Log.h"
-#include "ObjectMgr.h"
+#include "MotionMaster.h"
+#include "ObjectAccessor.h"
#include "Spell.h"
+#include "SpellMgr.h"
+#include "TemporarySummon.h"
// Spell summary for ScriptedAI::SelectSpell
struct TSpellSummary
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index e0de158831c..8f75faf6350 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -27,6 +27,8 @@ EndScriptData */
#include "Creature.h"
#include "Group.h"
#include "Log.h"
+#include "Map.h"
+#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index 7a1bcb14680..746154dab53 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -25,8 +25,10 @@ EndScriptData */
#include "ScriptedFollowerAI.h"
#include "Creature.h"
-#include "Log.h"
#include "Group.h"
+#include "Log.h"
+#include "Map.h"
+#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index 18ea269fbb0..6bf18bea890 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -16,10 +16,12 @@
*/
#include "SmartAI.h"
+#include "DB2Structure.h"
#include "Creature.h"
#include "GameObject.h"
#include "Group.h"
#include "Log.h"
+#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "PetDefines.h"
#include "Player.h"
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 0280af9498e..6b160a45d30 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -20,21 +20,26 @@
#include "ChatTextBuilder.h"
#include "Creature.h"
#include "CreatureTextMgr.h"
+#include "CreatureTextMgrImpl.h"
+#include "DB2Stores.h"
#include "GameEventMgr.h"
#include "GameObject.h"
#include "GossipDef.h"
#include "GridNotifiersImpl.h"
+#include "Group.h"
#include "InstanceScript.h"
#include "Language.h"
#include "Log.h"
#include "Map.h"
+#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Random.h"
#include "SmartAI.h"
#include "SpellAuras.h"
+#include "SpellMgr.h"
+#include "TemporarySummon.h"
#include "Vehicle.h"
-#include <G3D/Quat.h>
SmartScript::SmartScript()
{
@@ -1447,8 +1452,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
continue;
Position pos = (*itr)->GetPositionWithOffset(Position(e.target.x, e.target.y, e.target.z, e.target.o));
- G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(pos.GetOrientation(), 0.f, 0.f);
- summoner->SummonGameObject(e.action.summonGO.entry, pos, QuaternionData(rot.x, rot.y, rot.z, rot.w), e.action.summonGO.despawnTime);
+ summoner->SummonGameObject(e.action.summonGO.entry, pos, QuaternionData::fromEulerAnglesZYX(pos.GetOrientation(), 0.f, 0.f), e.action.summonGO.despawnTime);
}
delete targets;
@@ -1457,8 +1461,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (e.GetTargetType() != SMART_TARGET_POSITION)
break;
- G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(e.target.o, 0.f, 0.f);
- summoner->SummonGameObject(e.action.summonGO.entry, Position(e.target.x, e.target.y, e.target.z, e.target.o), QuaternionData(rot.x, rot.y, rot.z, rot.w), e.action.summonGO.despawnTime);
+ summoner->SummonGameObject(e.action.summonGO.entry, Position(e.target.x, e.target.y, e.target.z, e.target.o), QuaternionData::fromEulerAnglesZYX(e.target.o, 0.f, 0.f), e.action.summonGO.despawnTime);
break;
}
case SMART_ACTION_KILL_UNIT:
@@ -1700,12 +1703,12 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (!target)
{
- G3D::Vector3 dest(e.target.x, e.target.y, e.target.z);
+ Position dest(e.target.x, e.target.y, e.target.z);
if (e.action.MoveToPos.transport)
if (TransportBase* trans = me->GetDirectTransport())
- trans->CalculatePassengerPosition(dest.x, dest.y, dest.z);
+ trans->CalculatePassengerPosition(dest.m_positionX, dest.m_positionY, dest.m_positionZ);
- me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, dest.x, dest.y, dest.z, e.action.MoveToPos.disablePathfinding == 0);
+ me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, dest, e.action.MoveToPos.disablePathfinding == 0);
}
else
me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), e.action.MoveToPos.disablePathfinding == 0);
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index e20c512b93c..bb4eec88183 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -16,14 +16,20 @@
*/
#include "SmartScriptMgr.h"
+#include "DB2Stores.h"
#include "CreatureTextMgr.h"
#include "DatabaseEnv.h"
#include "GameEventMgr.h"
#include "InstanceScript.h"
#include "Log.h"
+#include "MotionMaster.h"
+#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
+#include "Timer.h"
+#include "UnitDefines.h"
+#include <algorithm>
SmartWaypointMgr* SmartWaypointMgr::instance()
{