From d76b728a998ec76f3c57025981a2a01a546244cb Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Thu, 3 Dec 2009 19:22:12 +0300 Subject: [PATCH] - Quest POI fix. --- sql/330/2_quest_poi.sql | 9 ++++++--- src/game/ObjectMgr.cpp | 9 ++++++--- src/game/ObjectMgr.h | 7 +++++-- src/game/QueryHandler.cpp | 6 +++--- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/sql/330/2_quest_poi.sql b/sql/330/2_quest_poi.sql index b3b8dd2b0..92c4b81ce 100644 --- a/sql/330/2_quest_poi.sql +++ b/sql/330/2_quest_poi.sql @@ -4,6 +4,9 @@ CREATE TABLE `quest_poi` ( `objIndex` int(11) NOT NULL DEFAULT '0', `mapId` int(11) unsigned NOT NULL DEFAULT '0', `unk1` int(11) unsigned NOT NULL DEFAULT '0', + `unk2` int(11) unsigned NOT NULL DEFAULT '0', + `unk3` int(11) unsigned NOT NULL DEFAULT '0', + `unk4` int(11) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`questid`,`objIndex`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; @@ -17,9 +20,9 @@ CREATE TABLE `quest_poi_points` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- Sample data for quest 456 -INSERT INTO quest_poi VALUES (456, 0, 1, 0); -INSERT INTO quest_poi VALUES (456, 1, 1, 0); -INSERT INTO quest_poi VALUES (456, -1, 1, 0); +INSERT INTO quest_poi VALUES (456, 0, 1, 0, 0, 0, 0); +INSERT INTO quest_poi VALUES (456, 1, 1, 0, 0, 0, 0); +INSERT INTO quest_poi VALUES (456, -1, 1, 0, 0, 0, 0); INSERT INTO quest_poi_points VALUES (456, 0, 0x28CF, 0x0217); INSERT INTO quest_poi_points VALUES (456, 0, 0x29F4, 0x02AA); diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index b978bffa4..8bc9e779c 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -6357,8 +6357,8 @@ void ObjectMgr::LoadQuestPOI() { uint32 count = 0; - // 0 1 2 3 - QueryResult *result = WorldDatabase.Query("SELECT questId, objIndex, mapId, unk1 FROM quest_poi"); + // 0 1 2 3 4 5 6 + QueryResult *result = WorldDatabase.Query("SELECT questId, objIndex, mapId, unk1, unk2, unk3, unk4 FROM quest_poi"); if(!result) { @@ -6382,8 +6382,11 @@ void ObjectMgr::LoadQuestPOI() int32 objIndex = fields[1].GetInt32(); uint32 mapId = fields[2].GetUInt32(); uint32 unk1 = fields[3].GetUInt32(); + uint32 unk2 = fields[4].GetUInt32(); + uint32 unk3 = fields[5].GetUInt32(); + uint32 unk4 = fields[6].GetUInt32(); - QuestPOI POI(objIndex, mapId, unk1); + QuestPOI POI(objIndex, mapId, unk1, unk2, unk3, unk4); QueryResult *points = WorldDatabase.PQuery("SELECT x, y FROM quest_poi_points WHERE questId='%u' AND objIndex='%i'", questId, objIndex); diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 6946b2593..6f50c7305 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -230,10 +230,13 @@ struct QuestPOI int32 ObjectiveIndex; uint32 MapId; uint32 Unk1; + uint32 Unk2; + uint32 Unk3; + uint32 Unk4; std::vector points; - QuestPOI() : ObjectiveIndex(0), MapId(0), Unk1(0) {} - QuestPOI(int32 objIndex, uint32 mapId, uint32 unk1) : ObjectiveIndex(objIndex), MapId(mapId), Unk1(unk1) {} + QuestPOI() : ObjectiveIndex(0), MapId(0), Unk1(0), Unk2(0), Unk3(0), Unk4(0) {} + QuestPOI(int32 objIndex, uint32 mapId, uint32 unk1, uint32 unk2, uint32 unk3, uint32 unk4) : ObjectiveIndex(objIndex), MapId(mapId), Unk1(unk1), Unk2(unk2), Unk3(unk3), Unk4(unk4) {} }; typedef std::vector QuestPOIVector; diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index 62f37645b..7170420e2 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -527,9 +527,9 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) data << int32(itr->ObjectiveIndex); // objective index data << uint32(itr->MapId); // mapid data << uint32(itr->Unk1); // unknown - data << uint32(0); - data << uint32(0); - data << uint32(0); + data << uint32(itr->Unk2); // unknown + data << uint32(itr->Unk3); // unknown + data << uint32(itr->Unk4); // unknown data << uint32(itr->points.size()); // POI points count for(std::vector::const_iterator itr2 = itr->points.begin(); itr2 != itr->points.end(); ++itr2)