diff options
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
6 files changed, 15 insertions, 17 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 614f5826824..4f4f56d3fe3 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -311,8 +311,8 @@ void ScriptedAI::DoTeleportPlayer(Unit* unit, float x, float y, float z, float o if (Player* player = unit->ToPlayer()) player->TeleportTo(unit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT); else - TC_LOG_ERROR("scripts", "Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", - me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o); + TC_LOG_ERROR("scripts", "Creature %s Tried to teleport non-player unit (%s) to x: %f y:%f z: %f o: %f. Aborted.", + me->GetGUID().ToString().c_str(), unit->GetGUID().ToString().c_str(), x, y, z, o); } void ScriptedAI::DoTeleportAll(float x, float y, float z, float o) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index d1e54ab84fe..e9a797c7db8 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -40,7 +40,7 @@ class InstanceScript; class SummonList { public: - typedef std::list<uint64> StorageType; + typedef GuidList StorageType; typedef StorageType::iterator iterator; typedef StorageType::const_iterator const_iterator; typedef StorageType::size_type size_type; @@ -104,7 +104,7 @@ public: { // We need to use a copy of SummonList here, otherwise original SummonList would be modified StorageType listCopy = storage_; - Trinity::Containers::RandomResizeList<uint64, Predicate>(listCopy, predicate, max); + Trinity::Containers::RandomResizeList<ObjectGuid, Predicate>(listCopy, predicate, max); for (StorageType::iterator i = listCopy.begin(); i != listCopy.end(); ) { Creature* summon = ObjectAccessor::GetCreature(*me, *i++); @@ -126,7 +126,7 @@ class EntryCheckPredicate { public: EntryCheckPredicate(uint32 entry) : _entry(entry) { } - bool operator()(uint64 guid) { return GUID_ENPART(guid) == _entry; } + bool operator()(ObjectGuid guid) { return guid.GetEntry() == _entry; } private: uint32 _entry; @@ -135,7 +135,7 @@ class EntryCheckPredicate class DummyEntryCheckPredicate { public: - bool operator()(uint64) { return true; } + bool operator()(ObjectGuid) { return true; } }; struct ScriptedAI : public CreatureAI diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index d06f90c1aeb..0b69391f935 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -23,10 +23,10 @@ SDComment: SDCategory: Npc EndScriptData */ +#include "Player.h" #include "ScriptedCreature.h" #include "ScriptedEscortAI.h" #include "Group.h" -#include "Player.h" enum Points { @@ -35,7 +35,6 @@ enum Points }; npc_escortAI::npc_escortAI(Creature* creature) : ScriptedAI(creature), - m_uiPlayerGUID(0), m_uiWPWaitTimer(2500), m_uiPlayerCheckTimer(1000), m_uiEscortState(STATE_ESCORT_NONE), @@ -430,7 +429,7 @@ void npc_escortAI::SetRun(bool on) } /// @todo get rid of this many variables passed in function. -void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false */, uint64 playerGUID /* = 0 */, Quest const* quest /* = NULL */, bool instantRespawn /* = false */, bool canLoopPath /* = false */, bool resetWaypoints /* = true */) +void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false */, ObjectGuid playerGUID /* = 0 */, Quest const* quest /* = NULL */, bool instantRespawn /* = false */, bool canLoopPath /* = false */, bool resetWaypoints /* = true */) { if (me->GetVictim()) { @@ -486,7 +485,7 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); } - TC_LOG_DEBUG("scripts", "EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID); + TC_LOG_DEBUG("scripts", "EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, %s", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID.ToString().c_str()); CurrentWP = WaypointList.begin(); diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h index b8c9ee57aeb..22280ee3575 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h @@ -88,7 +88,7 @@ struct npc_escortAI : public ScriptedAI virtual void WaypointReached(uint32 pointId) = 0; virtual void WaypointStart(uint32 /*pointId*/) { } - void Start(bool isActiveAttacker = true, bool run = false, uint64 playerGUID = 0, Quest const* quest = NULL, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true); + void Start(bool isActiveAttacker = true, bool run = false, ObjectGuid playerGUID = ObjectGuid::Empty, Quest const* quest = NULL, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true); void SetRun(bool on = true); void SetEscortPaused(bool on); @@ -103,7 +103,7 @@ struct npc_escortAI : public ScriptedAI void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; } bool GetAttack() { return m_bIsActiveAttacker; }//used in EnterEvadeMode override void SetCanAttack(bool attack) { m_bIsActiveAttacker = attack; } - uint64 GetEventStarterGUID() { return m_uiPlayerGUID; } + ObjectGuid GetEventStarterGUID() { return m_uiPlayerGUID; } protected: Player* GetPlayerForEscort() { return ObjectAccessor::GetPlayer(*me, m_uiPlayerGUID); } @@ -116,7 +116,7 @@ struct npc_escortAI : public ScriptedAI void AddEscortState(uint32 escortState) { m_uiEscortState |= escortState; } void RemoveEscortState(uint32 escortState) { m_uiEscortState &= ~escortState; } - uint64 m_uiPlayerGUID; + ObjectGuid m_uiPlayerGUID; uint32 m_uiWPWaitTimer; uint32 m_uiPlayerCheckTimer; uint32 m_uiEscortState; diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index a106c98c786..00aa8eacc93 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -23,10 +23,10 @@ SDComment: This AI is under development SDCategory: Npc EndScriptData */ +#include "Player.h" #include "ScriptedCreature.h" #include "ScriptedFollowerAI.h" #include "Group.h" -#include "Player.h" const float MAX_PLAYER_DISTANCE = 100.0f; @@ -36,7 +36,6 @@ enum Points }; FollowerAI::FollowerAI(Creature* creature) : ScriptedAI(creature), - m_uiLeaderGUID(0), m_uiUpdateFollowTimer(2500), m_uiFollowState(STATE_FOLLOW_NONE), m_pQuestForFollow(NULL) @@ -320,7 +319,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); - TC_LOG_DEBUG("scripts", "FollowerAI start follow %s (GUID " UI64FMTD ")", player->GetName().c_str(), m_uiLeaderGUID); + TC_LOG_DEBUG("scripts", "FollowerAI start follow %s (%s)", player->GetName().c_str(), m_uiLeaderGUID.ToString().c_str()); } Player* FollowerAI::GetLeaderForFollower() diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h index adb17ef76b1..88b3ccd6a64 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h @@ -71,7 +71,7 @@ class FollowerAI : public ScriptedAI bool AssistPlayerInCombat(Unit* who); - uint64 m_uiLeaderGUID; + ObjectGuid m_uiLeaderGUID; uint32 m_uiUpdateFollowTimer; uint32 m_uiFollowState; |
