From f9c739139d52524c063ec80c5cd9854d61f7a38c Mon Sep 17 00:00:00 2001 From: TrullyONE Date: Sat, 3 Jan 2009 07:26:39 +0200 Subject: *Transport events implemented. Need DB support for travelmasters. New script command 18: SCRIPT_COMMAND_PLAYSOUND. --HG-- branch : trunk --- src/game/ObjectMgr.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/game/ObjectMgr.cpp') diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 594cfaf0877..8d14db9e377 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -7541,3 +7541,39 @@ ObjectMgr::ScriptNameMap & GetScriptNames() { return objmgr.GetScriptNames(); } + +void ObjectMgr::LoadTransportEvents() +{ + + QueryResult *result = WorldDatabase.Query("SELECT entry, waypoint_id, event_id FROM transport_events"); + + if( !result ) + { + barGoLink bar1( 1 ); + bar1.step(); + sLog.outString( "\n>> Transport events table is empty \n" ); + return; + } + + barGoLink bar1( result->GetRowCount() ); + + do + { + bar1.step(); + + Field *fields = result->Fetch(); + + //Load event values + uint32 entry = fields[0].GetUInt32(); + uint32 waypoint_id = fields[1].GetUInt32(); + uint32 event_id = fields[2].GetUInt32(); + + uint32 event_count = (entry*100)+waypoint_id; + TransportEventMap[event_count] = event_id; + } + while(result->NextRow()); + + sLog.outString( "\n>> Loaded %u transport events \n", result->GetRowCount() ); + + delete result; +} \ No newline at end of file -- cgit v1.2.3