Added ScriptName to transports table for script system rewrite
--HG-- branch : trunk
This commit is contained in:
@@ -744,6 +744,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
|
||||
void EventInform(uint32 eventId);
|
||||
|
||||
uint64 GetRotation() const { return m_rotation; }
|
||||
virtual uint32 GetScriptId() const { return GetGOInfo()->ScriptId; }
|
||||
protected:
|
||||
uint32 m_spellId;
|
||||
time_t m_respawnTime; // (secs) time of next respawn (or despawn if GO have owner()),
|
||||
|
||||
@@ -347,6 +347,7 @@ class Item : public Object
|
||||
|
||||
void BuildUpdate(UpdateDataMapType&);
|
||||
|
||||
uint32 GetScriptId() const { return GetProto()->ScriptId; }
|
||||
private:
|
||||
std::string m_text;
|
||||
uint8 m_slot;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
void MapManager::LoadTransports()
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, name, period FROM transports");
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, name, period, ScriptName FROM transports");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -60,6 +60,7 @@ void MapManager::LoadTransports()
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
std::string name = fields[1].GetCppString();
|
||||
t->m_period = fields[2].GetUInt32();
|
||||
t->ScriptId = objmgr.GetScriptId(fields[3].GetString());
|
||||
|
||||
const GameObjectInfo *goinfo = objmgr.GetGameObjectInfo(entry);
|
||||
|
||||
@@ -182,6 +183,7 @@ void MapManager::LoadTransportNPCs()
|
||||
Transport::Transport() : GameObject()
|
||||
{
|
||||
m_updateFlag = (UPDATEFLAG_TRANSPORT | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_ROTATION);
|
||||
ScriptId = 0;
|
||||
}
|
||||
|
||||
bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress, uint32 dynflags)
|
||||
|
||||
@@ -59,6 +59,7 @@ class Transport : public GameObject
|
||||
void UpdateNPCPositions();
|
||||
void BuildStartMovePacket(Map const *targetMap);
|
||||
void BuildStopMovePacket(Map const *targetMap);
|
||||
uint32 GetScriptId() const { return ScriptId; }
|
||||
private:
|
||||
struct WayPoint
|
||||
{
|
||||
@@ -89,6 +90,7 @@ class Transport : public GameObject
|
||||
PlayerSet m_passengers;
|
||||
|
||||
uint32 currenttguid;
|
||||
uint32 ScriptId;
|
||||
public:
|
||||
WayPointMap m_WayPoints;
|
||||
uint32 m_nextNodeTime;
|
||||
|
||||
@@ -8740,6 +8740,8 @@ void ObjectMgr::LoadScriptNames()
|
||||
"UNION "
|
||||
"SELECT DISTINCT(ScriptName) FROM spell_script_names WHERE ScriptName <> '' "
|
||||
"UNION "
|
||||
"SELECT DISTINCT(ScriptName) FROM transports WHERE ScriptName <> '' "
|
||||
"UNION "
|
||||
"SELECT DISTINCT(script) FROM instance_template WHERE script <> ''");
|
||||
|
||||
if (!result)
|
||||
|
||||
Reference in New Issue
Block a user