Merge [SD2]
r1313 Implement new class SystemMgr for storage and management of script data.
Move database load to new class and instead use functions in class to retrieve data from storage.
--HG--
branch : trunk
This commit is contained in:
1 parent
ec5515ee49
commit
81ee07fa2a
6 files changed
+364
-296
No files matched your search
@@ -11,6 +11,7 @@ EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "escort_ai.h"
|
||||
#include "../system/system.h"
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -18,8 +19,6 @@ enum
|
||||
POINT_HOME = 0xFFFFFE
|
||||
};
|
||||
|
||||
extern std::list<PointMovement> PointMovementList;
|
||||
|
||||
void npc_escortAI::AttackStart(Unit* pWho)
|
||||
{
|
||||
if (!pWho)
|
||||
@@ -218,6 +217,11 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
|
||||
m_uiPlayerCheckTimer -= uiDiff;
|
||||
}
|
||||
|
||||
UpdateEscortAI(uiDiff);
|
||||
}
|
||||
|
||||
void npc_escortAI::UpdateEscortAI(const uint32 uiDiff)
|
||||
{
|
||||
if (CanMelee && UpdateVictim())
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -308,17 +312,17 @@ void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 Wait
|
||||
|
||||
void npc_escortAI::FillPointMovementListForCreature()
|
||||
{
|
||||
UNORDERED_MAP<uint32, std::vector<PointMovement> >::iterator pPointsEntries = PointMovementMap.find(m_creature->GetEntry());
|
||||
std::vector<ScriptPointMove> const &pPointsEntries = pSystemMgr.GetPointMoveList(m_creature->GetEntry());
|
||||
|
||||
if (pPointsEntries != PointMovementMap.end())
|
||||
if (pPointsEntries.empty())
|
||||
return;
|
||||
|
||||
std::vector<ScriptPointMove>::const_iterator itr;
|
||||
|
||||
for (itr = pPointsEntries.begin(); itr != pPointsEntries.end(); ++itr)
|
||||
{
|
||||
std::vector<PointMovement>::iterator itr;
|
||||
|
||||
for (itr = pPointsEntries->second.begin(); itr != pPointsEntries->second.end(); ++itr)
|
||||
{
|
||||
Escort_Waypoint pPoint(itr->m_uiPointId,itr->m_fX,itr->m_fY,itr->m_fZ,itr->m_uiWaitTime);
|
||||
WaypointList.push_back(pPoint);
|
||||
}
|
||||
Escort_Waypoint pPoint(itr->uiPointId, itr->fX, itr->fY, itr->fZ, itr->uiWaitTime);
|
||||
WaypointList.push_back(pPoint);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
#define DEFAULT_MAX_PLAYER_DISTANCE 50
|
||||
|
||||
extern UNORDERED_MAP<uint32, std::vector<PointMovement> > PointMovementMap;
|
||||
|
||||
struct Escort_Waypoint
|
||||
{
|
||||
Escort_Waypoint(uint32 _id, float _x, float _y, float _z, uint32 _w)
|
||||
@@ -50,7 +48,8 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
|
||||
|
||||
void EnterEvadeMode();
|
||||
|
||||
void UpdateAI(const uint32);
|
||||
void UpdateAI(const uint32); //the "internal" update, calls UpdateEscortAI()
|
||||
virtual void UpdateEscortAI(const uint32); //used when it's needed to add code in update (abilities, scripted events, etc)
|
||||
|
||||
void MovementInform(uint32, uint32);
|
||||
|
||||
|
||||
Reference in new issue
Block a user