|
Принятые патчи Иногда выкладывают патчи, которые потом в итоге все-таки принимают в ядро.
Повод для гордости. |
|
Опции темы | Поиск в этой теме | Опции просмотра |
06.03.2010, 19:19 | #1 |
Умный
Старожил
Регистрация: 06.03.2010
Сообщений: 886
Сказал(а) спасибо: 698
Поблагодарили 433 раз(а) в 181 сообщениях
Записей в дневнике: 4
|
[9651] Improved quest POI's code
Улучшенная система указания квестов.
Автор: Blizzy Оригинальная тема Код:
Author: Blizzy <Blizzy@.worldofwarcraft.ro> 2010-03-02 05:48:04 Committer: Blizzy <Blizzy@.worldofwarcraft.ro> 2010-03-02 05:48:04 Parent: 6f01ad7465e5005472d5ea59f04d8b9b2a9049f9 ([9499] Add replacement spells for GO type 10 that may have dummy spellId in _template) Child: 0000000000000000000000000000000000000000 (Local uncommitted changes, not checked in to index) Branch: master Follows: v0.16-dev1 Precedes: Improved quest POI's code now with db support Quest Tracking Feature is full working ---------------------------- src/game/ObjectMgr.cpp ---------------------------- index b1540da..aae9230 100644 @@ -6482,8 +6482,8 @@ void ObjectMgr::LoadQuestPOI() uint32 count = 0; - // 0 1 2 3 4 5 6 - QueryResult *result = WorldDatabase.Query("SELECT questId, objIndex, mapId, unk1, unk2, unk3, unk4 FROM quest_poi"); + // 0 1 2 3 4 5 6 7 + QueryResult *result = WorldDatabase.Query("SELECT questId, poiId, objIndex, mapId, areaId, floorId, unk3, unk4 FROM quest_poi"); if(!result) { @@ -6504,16 +6504,17 @@ void ObjectMgr::LoadQuestPOI() bar.step(); uint32 questId = fields[0].GetUInt32(); - 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(); + uint32 poiId = fields[1].GetUInt32(); + int32 objIndex = fields[2].GetInt32(); + uint32 mapId = fields[3].GetUInt32(); + uint32 areaId = fields[4].GetUInt32(); + uint32 floorId = fields[5].GetUInt32(); + uint32 unk3 = fields[6].GetUInt32(); + uint32 unk4 = fields[7].GetUInt32(); - QuestPOI POI(objIndex, mapId, unk1, unk2, unk3, unk4); + QuestPOI POI(poiId, objIndex, mapId, areaId, floorId, unk3, unk4); - QueryResult *points = WorldDatabase.PQuery("SELECT x, y FROM quest_poi_points WHERE questId='%u' AND objIndex='%i'", questId, objIndex); + QueryResult *points = WorldDatabase.PQuery("SELECT x, y FROM quest_poi_points WHERE questId='%u' AND poiId='%i'", questId, poiId); if(points) { ----------------------------- src/game/ObjectMgr.h ----------------------------- index 4442f56..a1a47ae 100644 @@ -260,16 +260,17 @@ struct QuestPOIPoint struct QuestPOI { + uint32 PoiId; int32 ObjectiveIndex; uint32 MapId; - uint32 Unk1; - uint32 Unk2; + uint32 AreaId; + uint32 FloorId; uint32 Unk3; uint32 Unk4; std::vector<QuestPOIPoint> points; - 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) {} + QuestPOI() : PoiId(0), ObjectiveIndex(0), MapId(0), AreaId(0), FloorId(0), Unk3(0), Unk4(0) {} + QuestPOI(uint32 poiId, int32 objIndex, uint32 mapId, uint32 areaId, uint32 floorId, uint32 unk3, uint32 unk4) : PoiId(poiId), ObjectiveIndex(objIndex), MapId(mapId), AreaId(areaId), FloorId(floorId), Unk3(unk3), Unk4(unk4) {} }; typedef std::vector<QuestPOI> QuestPOIVector; -------------------------- src/game/QueryHandler.cpp -------------------------- index 41d934a..bcdc955 100644 @@ -485,7 +485,7 @@ void WorldSession::HandleQueryQuestsCompleted( WorldPacket & /*recv_data */) SendPacket(&data); } -void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) +void WorldSession::HandleQuestPOIQuery( WorldPacket & recv_data ) { uint32 count; recv_data >> count; // quest count, max=25 @@ -520,16 +520,15 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) data << uint32(questId); // quest ID data << uint32(POI->size()); // POI count - int index = 0; for(QuestPOIVector::const_iterator itr = POI->begin(); itr != POI->end(); ++itr) { - data << uint32(index); // POI index - data << int32(itr->ObjectiveIndex); // objective index - data << uint32(itr->MapId); // mapid - data << uint32(itr->Unk1); // unknown - data << uint32(itr->Unk2); // unknown - data << uint32(itr->Unk3); // unknown - data << uint32(itr->Unk4); // unknown + data << uint32(itr->PoiId); // POI index + data << int32(itr->ObjectiveIndex); // Objective index + data << uint32(itr->MapId); // Mapid + data << uint32(itr->AreaId); // WorldMapArea index + data << uint32(itr->FloorId); // Floorid + data << uint32(itr->Unk3); // Unknown + data << uint32(itr->Unk4); // Unknown data << uint32(itr->points.size()); // POI points count for(std::vector<QuestPOIPoint>::const_iterator itr2 = itr->points.begin(); itr2 != itr->points.end(); ++itr2) @@ -537,7 +536,6 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) data << int32(itr2->x); // POI point x data << int32(itr2->y); // POI point y } - ++index; } } else @@ -553,7 +551,6 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) } } - data.hexlike(); SendPacket(&data); } Код:
-- -- Table structure for table `quest_poi` -- DROP TABLE IF EXISTS `quest_poi`; CREATE TABLE IF NOT EXISTS `quest_poi` ( `questId` int(11) UNSIGNED NOT NULL DEFAULT '0', `poiId` int(11) UNSIGNED NOT NULL DEFAULT '0', `objIndex` int(11) NOT NULL DEFAULT '0', `mapId` int(11) UNSIGNED NOT NULL DEFAULT '0', `areaId` int(11) UNSIGNED NOT NULL DEFAULT '0', `floorId` int(11) UNSIGNED NOT NULL DEFAULT '0', `unk3` int(11) UNSIGNED NOT NULL DEFAULT '0', `unk4` int(11) UNSIGNED NOT NULL DEFAULT '0', KEY `questId` (`poiId`,`questId`), KEY `poiId` (`poiId`,`questId`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; -- -- Table structure for table `quest_poi_points` -- DROP TABLE IF EXISTS `quest_poi_points`; CREATE TABLE IF NOT EXISTS `quest_poi_points` ( `questId` int(11) UNSIGNED NOT NULL DEFAULT '0', `poiId` int(11) UNSIGNED NOT NULL DEFAULT '0', `x` int(11) NOT NULL DEFAULT '0', `y` int(11) NOT NULL DEFAULT '0', KEY `questId` (`poiId`,`questId`), KEY `poiId` (`poiId`,`questId`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; Код:
-- -- Update for existing tables -- ALTER TABLE `quest_poi` CHANGE `questid` `questId` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0' ; ALTER TABLE `quest_poi` ADD `poiId` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `questId` ; ALTER TABLE `quest_poi` CHANGE `unk1` `areaId` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0' ; ALTER TABLE `quest_poi` CHANGE `unk2` `florId` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0' ; ALTER TABLE `quest_poi_points` CHANGE `objIndex` `poiId` INT( 11 ) NOT NULL DEFAULT '0' ; ALTER TABLE `quest_poi` DROP PRIMARY KEY , ADD INDEX `questId` ( `poiId` , `questId` ), ADD INDEX `poiId` ( `poiId` , `questId` ); ALTER TABLE `quest_poi_points` DROP INDEX `idx`, ADD INDEX `questId` ( `poiId` , `questId` ), ADD INDEX `poiId` ( `poiId` , `questId` ); |
|
|
Похожие темы | ||||
Тема | Автор | Раздел | Ответов | Последнее сообщение |
[10820] Speedup and cleanup quest counters update code. | newsbot | CMaNGOS Commits | 0 | 03.12.2010 05:13 |
[10631] Small code style cleanup in quest related functions | newsbot | CMaNGOS Commits | 0 | 20.10.2010 11:00 |
[hack] Improved Counterspell | Chipleo | MaNGOS 0.12 (2.4.3) | 5 | 29.04.2010 00:48 |
[9685] Code style cleanups in quest code. | newsbot | CMaNGOS Commits | 0 | 07.04.2010 02:30 |
[9651] Correct code for quest points of interest. | newsbot | CMaNGOS Commits | 0 | 31.03.2010 22:00 |