diff options
author | Intel <chemicstry@gmail.com> | 2014-12-29 14:07:17 +0200 |
---|---|---|
committer | Intel <chemicstry@gmail.com> | 2014-12-29 14:07:17 +0200 |
commit | 381416d0223e24f6b215ffca753f1fcefff781a3 (patch) | |
tree | 7ce4d1dde5ac6dab0e995b73c05212fe85563edb | |
parent | df2c6cf40c1404c7981e70f3f7d6dff89b8b57bf (diff) |
Core/Quests: Fixed quest loading from DB and improved error output
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 19 | ||||
-rw-r--r-- | src/server/game/Quests/QuestDef.cpp | 24 | ||||
-rw-r--r-- | src/server/game/Quests/QuestDef.h | 3 |
3 files changed, 28 insertions, 18 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 237b1e18194..95dda7fb8f1 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3699,7 +3699,7 @@ void ObjectMgr::LoadQuests() { if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) { - TC_LOG_ERROR("sql.sql", "Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); + TC_LOG_DEBUG("sql.sql", "Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; } } @@ -3708,7 +3708,7 @@ void ObjectMgr::LoadQuests() { if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) { - TC_LOG_ERROR("sql.sql", "Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); + TC_LOG_DEBUG("sql.sql", "Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; } } @@ -3717,7 +3717,7 @@ void ObjectMgr::LoadQuests() { if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) { - TC_LOG_ERROR("sql.sql", "Monthly quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); + TC_LOG_DEBUG("sql.sql", "Monthly quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; } } @@ -3906,6 +3906,15 @@ void ObjectMgr::LoadQuests() { QuestObjective& obj = qinfo->Objectives[j]; + // Might be intended in blizz so it is debug output + if (!obj.ID) + { + TC_LOG_DEBUG("sql.sql", "Quest %u is missing objective %u", qinfo->GetQuestId(), j); + // Prevent objective to be parsed as QUEST_OBJECTIVE_MONSTER + obj.Type = QUEST_OBJECTIVE_NONE; + continue; + } + if (!obj.ObjectID) { TC_LOG_ERROR("sql.sql", "Quest %u objective %u has `ObjectID` = 0, quest can't be done.", qinfo->GetQuestId(), j); @@ -3977,7 +3986,7 @@ void ObjectMgr::LoadQuests() { if (!sObjectMgr->GetItemTemplate(id)) { - TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredSourceItemId%d` = %u but item with entry %u does not exist, quest can't be done.", + TC_LOG_ERROR("sql.sql", "Quest %u has `ItemDrop%d` = %u but item with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(), j+1, id, id); // no changes, quest can't be done for this requirement } @@ -3986,7 +3995,7 @@ void ObjectMgr::LoadQuests() { if (qinfo->ItemDropQuantity[j]>0) { - TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredSourceItemId%d` = 0 but `RequiredSourceItemCount%d` = %u.", + TC_LOG_ERROR("sql.sql", "Quest %u has `ItemDrop%d` = 0 but `ItemDropQuantity%d` = %u.", qinfo->GetQuestId(), j+1, j+1, qinfo->ItemDropQuantity[j]); // no changes, quest ignore this data } diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 3c45f5efb38..11d175ce6ab 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -49,17 +49,17 @@ Quest::Quest(Field* questRecord) for (uint32 i = 0; i < QUEST_ITEM_DROP_COUNT; ++i) { - RewardItemId[i] = questRecord[22+i].GetUInt32(); - RewardItemCount[i] = questRecord[23+i].GetUInt32(); - ItemDrop[i] = questRecord[24+i].GetUInt32(); - ItemDropQuantity[i] = questRecord[25+i].GetUInt32(); + RewardItemId[i] = questRecord[22+i*4].GetUInt32(); + RewardItemCount[i] = questRecord[23+i*4].GetUInt32(); + ItemDrop[i] = questRecord[24+i*4].GetUInt32(); + ItemDropQuantity[i] = questRecord[25+i*4].GetUInt32(); } for (uint32 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) { - RewardChoiceItemId[i] = questRecord[38+i].GetUInt32(); - RewardChoiceItemCount[i] = questRecord[39+i].GetUInt32(); - RewardChoiceItemDisplayId[i] = questRecord[40+i].GetUInt32(); + RewardChoiceItemId[i] = questRecord[38+i*3].GetUInt32(); + RewardChoiceItemCount[i] = questRecord[39+i*3].GetUInt32(); + RewardChoiceItemDisplayId[i] = questRecord[40+i*3].GetUInt32(); } POIContinent = questRecord[56].GetUInt32(); @@ -78,17 +78,17 @@ Quest::Quest(Field* questRecord) for (uint32 i = 0; i < QUEST_REWARD_REPUTATIONS_COUNT; ++i) { - RewardFactionId[i] = questRecord[67+i].GetUInt32(); - RewardFactionValue[i] = questRecord[68+i].GetInt32(); - RewardFactionOverride[i] = questRecord[69+i].GetInt32(); + RewardFactionId[i] = questRecord[67+i*3].GetUInt32(); + RewardFactionValue[i] = questRecord[68+i*3].GetInt32(); + RewardFactionOverride[i] = questRecord[69+i*3].GetInt32(); } RewardReputationMask = questRecord[82].GetUInt32(); for (uint32 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) { - RewardCurrencyId[i] = questRecord[83+i].GetUInt32(); - RewardCurrencyCount[i] = questRecord[84+i].GetUInt32(); + RewardCurrencyId[i] = questRecord[83+i*2].GetUInt32(); + RewardCurrencyCount[i] = questRecord[84+i*2].GetUInt32(); } SoundAccept = questRecord[91].GetUInt32(); diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index d5e81bc261b..8db3e0d6d88 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -199,7 +199,8 @@ enum QuestObjectiveType QUEST_OBJECTIVE_AREATRIGGER = 10, QUEST_OBJECTIVE_WINPETBATTLEAGAINSTNPC = 11, QUEST_OBJECTIVE_DEFEATBATTLEPET = 12, - QUEST_OBJECTIVE_WINPVPPETBATTLES = 13 + QUEST_OBJECTIVE_WINPVPPETBATTLES = 13, + QUEST_OBJECTIVE_NONE = 255 // Used on empty objectives to not confuse with QUEST_OBJECTIVE_MONSTER }; struct QuestLocale |