Core/Quests: Fixed quest loading from DB and improved error output
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user