Implement taxi/transport event scripts support. Author: Vladimir

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-06-23 01:59:32 +02:00
parent ffaffe3fd7
commit 968c27f55f
8 changed files with 72 additions and 28 deletions
+17 -20
View File
@@ -4813,26 +4813,9 @@ void ObjectMgr::LoadEventScripts()
// Load all possible script entries from gameobjects
for (uint32 i = 1; i < sGOStorage.MaxEntry; ++i)
{
GameObjectInfo const * goInfo = sGOStorage.LookupEntry<GameObjectInfo>(i);
if (goInfo)
{
switch(goInfo->type)
{
case GAMEOBJECT_TYPE_GOOBER:
if (goInfo->goober.eventId)
evt_scripts.insert(goInfo->goober.eventId);
break;
case GAMEOBJECT_TYPE_CHEST:
if (goInfo->chest.eventId)
evt_scripts.insert(goInfo->chest.eventId);
break;
case GAMEOBJECT_TYPE_CAMERA:
if (goInfo->camera.eventID)
evt_scripts.insert(goInfo->camera.eventID);
default:
break;
}
}
if (GameObjectInfo const * goInfo = sGOStorage.LookupEntry<GameObjectInfo>(i))
if (uint32 eventId = goInfo->GetEventScriptId())
evt_scripts.insert(eventId);
}
// Load all possible script entries from spells
for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i)
@@ -4851,6 +4834,20 @@ void ObjectMgr::LoadEventScripts()
}
}
for(size_t path_idx = 0; path_idx < sTaxiPathNodesByPath.size(); ++path_idx)
{
for(size_t node_idx = 0; node_idx < sTaxiPathNodesByPath[path_idx].size(); ++node_idx)
{
TaxiPathNodeEntry const& node = sTaxiPathNodesByPath[path_idx][node_idx];
if (node.arrivalEventID)
evt_scripts.insert(node.arrivalEventID);
if (node.departureEventID)
evt_scripts.insert(node.departureEventID);
}
}
// Then check if all scripts are in above list of possible script entries
for (ScriptMapMap::const_iterator itr = sEventScripts.begin(); itr != sEventScripts.end(); ++itr)
{