Added ScriptName to transports table for script system rewrite

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-08-06 12:13:13 +02:00
parent 9cfef5c39f
commit 7cae47210e
7 changed files with 11 additions and 1 deletions
+1
View File
@@ -14728,6 +14728,7 @@ CREATE TABLE `transports` (
`entry` mediumint(8) unsigned NOT NULL DEFAULT '0',
`name` text,
`period` mediumint(8) unsigned NOT NULL DEFAULT '0',
`ScriptName` char(64) NOT NULL DEFAULT '',
PRIMARY KEY (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Transports';
/*!40101 SET character_set_client = @saved_cs_client */;
+1
View File
@@ -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);
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()),
+1
View File
@@ -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;
+2
View File
@@ -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)