Added ScriptName to transports table for script system rewrite
--HG-- branch : trunk
This commit is contained in:
@@ -14728,6 +14728,7 @@ CREATE TABLE `transports` (
|
|||||||
`entry` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
`entry` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||||
`name` text,
|
`name` text,
|
||||||
`period` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
`period` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`ScriptName` char(64) NOT NULL DEFAULT '',
|
||||||
PRIMARY KEY (`entry`)
|
PRIMARY KEY (`entry`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Transports';
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Transports';
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE `transports` ADD `ScriptName` char(64) NOT NULL DEFAULT '' AFTER `period`;
|
||||||
@@ -744,6 +744,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
|
|||||||
void EventInform(uint32 eventId);
|
void EventInform(uint32 eventId);
|
||||||
|
|
||||||
uint64 GetRotation() const { return m_rotation; }
|
uint64 GetRotation() const { return m_rotation; }
|
||||||
|
virtual uint32 GetScriptId() const { return GetGOInfo()->ScriptId; }
|
||||||
protected:
|
protected:
|
||||||
uint32 m_spellId;
|
uint32 m_spellId;
|
||||||
time_t m_respawnTime; // (secs) time of next respawn (or despawn if GO have owner()),
|
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&);
|
void BuildUpdate(UpdateDataMapType&);
|
||||||
|
|
||||||
|
uint32 GetScriptId() const { return GetProto()->ScriptId; }
|
||||||
private:
|
private:
|
||||||
std::string m_text;
|
std::string m_text;
|
||||||
uint8 m_slot;
|
uint8 m_slot;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
void MapManager::LoadTransports()
|
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;
|
uint32 count = 0;
|
||||||
|
|
||||||
@@ -60,6 +60,7 @@ void MapManager::LoadTransports()
|
|||||||
uint32 entry = fields[0].GetUInt32();
|
uint32 entry = fields[0].GetUInt32();
|
||||||
std::string name = fields[1].GetCppString();
|
std::string name = fields[1].GetCppString();
|
||||||
t->m_period = fields[2].GetUInt32();
|
t->m_period = fields[2].GetUInt32();
|
||||||
|
t->ScriptId = objmgr.GetScriptId(fields[3].GetString());
|
||||||
|
|
||||||
const GameObjectInfo *goinfo = objmgr.GetGameObjectInfo(entry);
|
const GameObjectInfo *goinfo = objmgr.GetGameObjectInfo(entry);
|
||||||
|
|
||||||
@@ -182,6 +183,7 @@ void MapManager::LoadTransportNPCs()
|
|||||||
Transport::Transport() : GameObject()
|
Transport::Transport() : GameObject()
|
||||||
{
|
{
|
||||||
m_updateFlag = (UPDATEFLAG_TRANSPORT | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_ROTATION);
|
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)
|
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 UpdateNPCPositions();
|
||||||
void BuildStartMovePacket(Map const *targetMap);
|
void BuildStartMovePacket(Map const *targetMap);
|
||||||
void BuildStopMovePacket(Map const *targetMap);
|
void BuildStopMovePacket(Map const *targetMap);
|
||||||
|
uint32 GetScriptId() const { return ScriptId; }
|
||||||
private:
|
private:
|
||||||
struct WayPoint
|
struct WayPoint
|
||||||
{
|
{
|
||||||
@@ -89,6 +90,7 @@ class Transport : public GameObject
|
|||||||
PlayerSet m_passengers;
|
PlayerSet m_passengers;
|
||||||
|
|
||||||
uint32 currenttguid;
|
uint32 currenttguid;
|
||||||
|
uint32 ScriptId;
|
||||||
public:
|
public:
|
||||||
WayPointMap m_WayPoints;
|
WayPointMap m_WayPoints;
|
||||||
uint32 m_nextNodeTime;
|
uint32 m_nextNodeTime;
|
||||||
|
|||||||
@@ -8740,6 +8740,8 @@ void ObjectMgr::LoadScriptNames()
|
|||||||
"UNION "
|
"UNION "
|
||||||
"SELECT DISTINCT(ScriptName) FROM spell_script_names WHERE ScriptName <> '' "
|
"SELECT DISTINCT(ScriptName) FROM spell_script_names WHERE ScriptName <> '' "
|
||||||
"UNION "
|
"UNION "
|
||||||
|
"SELECT DISTINCT(ScriptName) FROM transports WHERE ScriptName <> '' "
|
||||||
|
"UNION "
|
||||||
"SELECT DISTINCT(script) FROM instance_template WHERE script <> ''");
|
"SELECT DISTINCT(script) FROM instance_template WHERE script <> ''");
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
|
|||||||
Reference in New Issue
Block a user