Core|DB/Quests: Rename and re-order fields in quest_template table, for the sake of consistency
Order should match SMSG_QUEST_QUERY_RESPONSE
This commit is contained in:
1 parent
a919265623
commit
5a4636c145
10 files changed
+516
-513
No files matched your search
@@ -3691,42 +3691,41 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
mExclusiveQuestGroups.clear();
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9 10
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, Method, ZoneOrSort, MinLevel, MaxLevel, QuestLevel, Type, RequiredClasses, RequiredRaces, RequiredSkill, RequiredSkillValue, "
|
||||
// 11 12 13 14 15 16 17 18 19 20
|
||||
"RepObjectiveFaction, RepObjectiveValue, RepObjectiveFaction2, RepObjectiveValue2, RequiredMinRepFaction, RequiredMinRepValue, RequiredMaxRepFaction, RequiredMaxRepValue, SuggestedPlayers, LimitTime, "
|
||||
// 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
||||
"QuestFlags, SpecialFlags, CharTitleId, PlayersSlain, BonusTalents, RewardArenaPoints, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestInChain, RewXPId, SrcItemId, SrcItemCount, SrcSpell, "
|
||||
// 35 36 37 38 39 40 41 42 43 44 45
|
||||
"Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, CompletedText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, "
|
||||
// 46 47 48 49 50 51 52 53 54 55 56 57
|
||||
"ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemId5, ReqItemId6, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4, ReqItemCount5, ReqItemCount6, "
|
||||
// 58 59 60 61 62 63 64 65
|
||||
"ReqSourceId1, ReqSourceId2, ReqSourceId3, ReqSourceId4, ReqSourceCount1, ReqSourceCount2, ReqSourceCount3, ReqSourceCount4, "
|
||||
// 66 67 68 69 70 71 72 73
|
||||
"ReqCreatureOrGOId1, ReqCreatureOrGOId2, ReqCreatureOrGOId3, ReqCreatureOrGOId4, ReqCreatureOrGOCount1, ReqCreatureOrGOCount2, ReqCreatureOrGOCount3, ReqCreatureOrGOCount4, "
|
||||
// 74 75 76 77
|
||||
"ReqSpellCast1, ReqSpellCast2, ReqSpellCast3, ReqSpellCast4, "
|
||||
// 78 79 80 81 82 83
|
||||
"RewChoiceItemId1, RewChoiceItemId2, RewChoiceItemId3, RewChoiceItemId4, RewChoiceItemId5, RewChoiceItemId6, "
|
||||
// 84 85 86 87 88 89
|
||||
"RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6, "
|
||||
// 90 91 92 93 94 95 96 97
|
||||
"RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4, "
|
||||
// 98 99 100 101 102 103 104 105 106 107
|
||||
"RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValueId1, RewRepValueId2, RewRepValueId3, RewRepValueId4, RewRepValueId5, "
|
||||
// 108 109 110 111 112
|
||||
"RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5, "
|
||||
// 113 114 115 116 117 118 119 120 121 122 123 124
|
||||
"RewHonorAddition, RewHonorMultiplier, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt, "
|
||||
// 125 126 127 128 129 130 131 132
|
||||
"DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, "
|
||||
// 133 134 135 136 137 138
|
||||
"IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, "
|
||||
// 139 140 141 142
|
||||
"OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, "
|
||||
// 143 144
|
||||
"StartScript, CompleteScript"
|
||||
QueryResult result = WorldDatabase.Query("SELECT "
|
||||
//0 1 2 3 4 5 6 7 8 9 10 11 12
|
||||
"Id, Method, Level, MinLevel, MaxLevel, ZoneOrSort, Type, SuggestedPlayers, LimitTime, RequiredClasses, RequiredRaces, RequiredSkillId, RequiredSkillPoints, "
|
||||
// 13 14 15 16 17 18 19 20
|
||||
"RequiredFactionId1, RequiredFactionId2, RequiredFactionValue1, RequiredFactionValue2, RequiredMinRepFaction, RequiredMaxRepFaction, RequiredMinRepValue, RequiredMaxRepValue, "
|
||||
// 21 22 23 24 25 26 27 28 29 30 31
|
||||
"PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestIdChain, RewardXPId, RewardOrRequiredMoney, RewardMoneyMaxLevel, RewardSpell, RewardSpellCast, RewardHonor, RewardHonorMultiplier, "
|
||||
// 32 33 34 35 36 37 38 39 40 41 42
|
||||
"RewardMailTemplateId, RewardMailDelay, SourceItemId, SourceItemCount, SourceSpellId, Flags, SpecialFlags, RewardTitleId, RequiredPlayerKills, RewardTalents, RewardArenaPoints, "
|
||||
// 43 44 45 46 47 48 49 50
|
||||
"RewardItemId1, RewardItemId2, RewardItemId3, RewardItemId4, RewardItemCount1, RewardItemCount2, RewardItemCount3, RewardItemCount4, "
|
||||
// 51 52 53 54 55 56 57 58 59 60 61 62
|
||||
"RewardChoiceItemId1, RewardChoiceItemId2, RewardChoiceItemId3, RewardChoiceItemId4, RewardChoiceItemId5, RewardChoiceItemId6, RewardChoiceItemCount1, RewardChoiceItemCount2, RewardChoiceItemCount3, RewardChoiceItemCount4, RewardChoiceItemCount5, RewardChoiceItemCount6, "
|
||||
// 63 64 65 66 67 68 69 70 71 72
|
||||
"RewardFactionId1, RewardFactionId2, RewardFactionId3, RewardFactionId4, RewardFactionId5, RewardFactionValueId1, RewardFactionValueId2, RewardFactionValueId3, RewardFactionValueId4, RewardFactionValueId5, "
|
||||
// 73 74 75 76 77
|
||||
"RewardFactionValueIdOverride1, RewardFactionValueIdOverride2, RewardFactionValueIdOverride3, RewardFactionValueIdOverride4, RewardFactionValueIdOverride5, "
|
||||
// 78 79 80 81
|
||||
"PointMapId, PointX, PointY, PointOption, "
|
||||
// 82 83 84 85 86 87 88
|
||||
"Title, Objectives, Details, EndText, OfferRewardText, RequestItemsText, CompletedText, "
|
||||
// 89 90 91 92 93 94 95 96
|
||||
"RequiredNpcOrGo1, RequiredNpcOrGo2, RequiredNpcOrGo3, RequiredNpcOrGo4, RequiredNpcOrGoCount1, RequiredNpcOrGoCount2, RequiredNpcOrGoCount3, RequiredNpcOrGoCount4, "
|
||||
// 97 98 99 100 101 102 103 104
|
||||
"RequiredSourceItemId1, RequiredSourceItemId2, RequiredSourceItemId3, RequiredSourceItemId4, RequiredSourceItemCount1, RequiredSourceItemCount2, RequiredSourceItemCount3, RequiredSourceItemCount4, "
|
||||
// 105 106 107 108 109 110 111 112 113 114 115 116
|
||||
"RequiredItemId1, RequiredItemId2, RequiredItemId3, RequiredItemId4, RequiredItemId5, RequiredItemId6, RequiredItemCount1, RequiredItemCount2, RequiredItemCount3, RequiredItemCount4, RequiredItemCount5, RequiredItemCount6, "
|
||||
// 117 118 119 120 121 122 123 124 125
|
||||
"RequiredSpellCast1, RequiredSpellCast2, RequiredSpellCast3, RequiredSpellCast4, Unknown0, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, "
|
||||
// 126 127 128 129 130 131 132 133 134 135
|
||||
"DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, EmoteOnIncomplete, EmoteOnComplete, "
|
||||
// 136 137 138 139 140 141 142 143
|
||||
"OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, "
|
||||
// 144 145 146
|
||||
"StartScript, CompleteScript, WDBVerified"
|
||||
" FROM quest_template");
|
||||
if (!result)
|
||||
{
|
||||
@@ -3764,45 +3763,45 @@ void ObjectMgr::LoadQuests()
|
||||
sLog->outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod());
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED)
|
||||
if (qinfo->Flags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u",
|
||||
qinfo->GetQuestId(), qinfo->QuestFlags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20);
|
||||
qinfo->QuestFlags &= QUEST_TRINITY_FLAGS_DB_ALLOWED;
|
||||
qinfo->GetQuestId(), qinfo->Flags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20);
|
||||
qinfo->Flags &= QUEST_TRINITY_FLAGS_DB_ALLOWED;
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & QUEST_FLAGS_DAILY && qinfo->QuestFlags & QUEST_FLAGS_WEEKLY)
|
||||
if (qinfo->Flags & QUEST_FLAGS_DAILY && qinfo->Flags & QUEST_FLAGS_WEEKLY)
|
||||
{
|
||||
sLog->outErrorDb("Weekly Quest %u is marked as daily quest in `QuestFlags`, removed daily flag.", qinfo->GetQuestId());
|
||||
qinfo->QuestFlags &= ~QUEST_FLAGS_DAILY;
|
||||
sLog->outErrorDb("Weekly Quest %u is marked as daily quest in `Flags`, removed daily flag.", qinfo->GetQuestId());
|
||||
qinfo->Flags &= ~QUEST_FLAGS_DAILY;
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & QUEST_FLAGS_DAILY)
|
||||
if (qinfo->Flags & QUEST_FLAGS_DAILY)
|
||||
{
|
||||
if (!(qinfo->QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE))
|
||||
if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE))
|
||||
{
|
||||
sLog->outErrorDb("Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
|
||||
qinfo->QuestFlags |= QUEST_TRINITY_FLAGS_REPEATABLE;
|
||||
qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE;
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & QUEST_FLAGS_WEEKLY)
|
||||
if (qinfo->Flags & QUEST_FLAGS_WEEKLY)
|
||||
{
|
||||
if (!(qinfo->QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE))
|
||||
if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE))
|
||||
{
|
||||
sLog->outErrorDb("Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
|
||||
qinfo->QuestFlags |= QUEST_TRINITY_FLAGS_REPEATABLE;
|
||||
qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE;
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & QUEST_FLAGS_AUTO_REWARDED)
|
||||
if (qinfo->Flags & QUEST_FLAGS_AUTO_REWARDED)
|
||||
{
|
||||
// at auto-reward can be rewarded only RewChoiceItemId[0]
|
||||
// at auto-reward can be rewarded only RewardChoiceItemId[0]
|
||||
for (int j = 1; j < QUEST_REWARD_CHOICES_COUNT; ++j )
|
||||
{
|
||||
if (uint32 id = qinfo->RewChoiceItemId[j])
|
||||
if (uint32 id = qinfo->RewardChoiceItemId[j])
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but item from `RewChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.",
|
||||
sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but item from `RewardChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.",
|
||||
qinfo->GetQuestId(), j+1, id, j+1);
|
||||
// no changes, quest ignore this data
|
||||
}
|
||||
@@ -3829,12 +3828,12 @@ void ObjectMgr::LoadQuests()
|
||||
qinfo->GetQuestId(), qinfo->ZoneOrSort);
|
||||
// no changes, quest not dependent from this value but can have problems at client (note some may be 0, we must allow this so no check)
|
||||
}
|
||||
//check for proper RequiredSkill value (skill case)
|
||||
//check for proper RequiredSkillId value (skill case)
|
||||
if (int32 skill_id = SkillByQuestSort(-int32(qinfo->ZoneOrSort)))
|
||||
{
|
||||
if (qinfo->RequiredSkill != skill_id)
|
||||
if (qinfo->RequiredSkillId != skill_id)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkill` does not have a corresponding value (%i).",
|
||||
sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkillId` does not have a corresponding value (%i).",
|
||||
qinfo->GetQuestId(), qinfo->ZoneOrSort, skill_id);
|
||||
//override, and force proper value here?
|
||||
}
|
||||
@@ -3859,38 +3858,38 @@ void ObjectMgr::LoadQuests()
|
||||
qinfo->RequiredRaces = 0;
|
||||
}
|
||||
}
|
||||
// RequiredSkill, can be 0
|
||||
if (qinfo->RequiredSkill)
|
||||
// RequiredSkillId, can be 0
|
||||
if (qinfo->RequiredSkillId)
|
||||
{
|
||||
if (!sSkillLineStore.LookupEntry(qinfo->RequiredSkill))
|
||||
if (!sSkillLineStore.LookupEntry(qinfo->RequiredSkillId))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RequiredSkill` = %u but this skill does not exist",
|
||||
qinfo->GetQuestId(), qinfo->RequiredSkill);
|
||||
sLog->outErrorDb("Quest %u has `RequiredSkillId` = %u but this skill does not exist",
|
||||
qinfo->GetQuestId(), qinfo->RequiredSkillId);
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->RequiredSkillValue)
|
||||
if (qinfo->RequiredSkillPoints)
|
||||
{
|
||||
if (qinfo->RequiredSkillValue > sWorld->GetConfigMaxSkillValue())
|
||||
if (qinfo->RequiredSkillPoints > sWorld->GetConfigMaxSkillValue())
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RequiredSkillValue` = %u but max possible skill is %u, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RequiredSkillValue, sWorld->GetConfigMaxSkillValue());
|
||||
sLog->outErrorDb("Quest %u has `RequiredSkillPoints` = %u but max possible skill is %u, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RequiredSkillPoints, sWorld->GetConfigMaxSkillValue());
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
}
|
||||
// else Skill quests can have 0 skill level, this is ok
|
||||
|
||||
if (qinfo->RepObjectiveFaction2 && !sFactionStore.LookupEntry(qinfo->RepObjectiveFaction2))
|
||||
if (qinfo->RequiredFactionId2 && !sFactionStore.LookupEntry(qinfo->RequiredFactionId2))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RepObjectiveFaction2` = %u but faction template %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RepObjectiveFaction2, qinfo->RepObjectiveFaction2);
|
||||
sLog->outErrorDb("Quest %u has `RequiredFactionId2` = %u but faction template %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RequiredFactionId2, qinfo->RequiredFactionId2);
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
|
||||
if (qinfo->RepObjectiveFaction && !sFactionStore.LookupEntry(qinfo->RepObjectiveFaction))
|
||||
if (qinfo->RequiredFactionId1 && !sFactionStore.LookupEntry(qinfo->RequiredFactionId1))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RepObjectiveFaction` = %u but faction template %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RepObjectiveFaction, qinfo->RepObjectiveFaction);
|
||||
sLog->outErrorDb("Quest %u has `RequiredFactionId1` = %u but faction template %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RequiredFactionId1, qinfo->RequiredFactionId1);
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
|
||||
@@ -3922,17 +3921,17 @@ void ObjectMgr::LoadQuests()
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
|
||||
if (!qinfo->RepObjectiveFaction && qinfo->RepObjectiveValue != 0)
|
||||
if (!qinfo->RequiredFactionId1 && qinfo->RequiredFactionValue1 != 0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RepObjectiveValue` = %d but `RepObjectiveFaction` is 0, value has no effect",
|
||||
qinfo->GetQuestId(), qinfo->RepObjectiveValue);
|
||||
sLog->outErrorDb("Quest %u has `RequiredFactionValue1` = %d but `RequiredFactionId1` is 0, value has no effect",
|
||||
qinfo->GetQuestId(), qinfo->RequiredFactionValue1);
|
||||
// warning
|
||||
}
|
||||
|
||||
if (!qinfo->RepObjectiveFaction2 && qinfo->RepObjectiveValue2 != 0)
|
||||
if (!qinfo->RequiredFactionId2 && qinfo->RequiredFactionValue2 != 0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RepObjectiveValue2` = %d but `RepObjectiveFaction2` is 0, value has no effect",
|
||||
qinfo->GetQuestId(), qinfo->RepObjectiveValue2);
|
||||
sLog->outErrorDb("Quest %u has `RequiredFactionValue2` = %d but `RequiredFactionId2` is 0, value has no effect",
|
||||
qinfo->GetQuestId(), qinfo->RequiredFactionValue2);
|
||||
// warning
|
||||
}
|
||||
|
||||
@@ -3950,61 +3949,61 @@ void ObjectMgr::LoadQuests()
|
||||
// warning
|
||||
}
|
||||
|
||||
if (qinfo->CharTitleId && !sCharTitlesStore.LookupEntry(qinfo->CharTitleId))
|
||||
if (qinfo->RewardTitleId && !sCharTitlesStore.LookupEntry(qinfo->RewardTitleId))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `CharTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.",
|
||||
sLog->outErrorDb("Quest %u has `RewardTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.",
|
||||
qinfo->GetQuestId(), qinfo->GetCharTitleId(), qinfo->GetCharTitleId());
|
||||
qinfo->CharTitleId = 0;
|
||||
qinfo->RewardTitleId = 0;
|
||||
// quest can't reward this title
|
||||
}
|
||||
|
||||
if (qinfo->SrcItemId)
|
||||
if (qinfo->SourceItemId)
|
||||
{
|
||||
if (!sObjectMgr->GetItemTemplate(qinfo->SrcItemId))
|
||||
if (!sObjectMgr->GetItemTemplate(qinfo->SourceItemId))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `SrcItemId` = %u but item with entry %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->SrcItemId, qinfo->SrcItemId);
|
||||
qinfo->SrcItemId = 0; // quest can't be done for this requirement
|
||||
sLog->outErrorDb("Quest %u has `SourceItemId` = %u but item with entry %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->SourceItemId, qinfo->SourceItemId);
|
||||
qinfo->SourceItemId = 0; // quest can't be done for this requirement
|
||||
}
|
||||
else if (qinfo->SrcItemCount == 0)
|
||||
else if (qinfo->SourceItemIdCount == 0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `SrcItemId` = %u but `SrcItemCount` = 0, set to 1 but need fix in DB.",
|
||||
qinfo->GetQuestId(), qinfo->SrcItemId);
|
||||
qinfo->SrcItemCount = 1; // update to 1 for allow quest work for backward compatibility with DB
|
||||
sLog->outErrorDb("Quest %u has `SourceItemId` = %u but `SourceItemIdCount` = 0, set to 1 but need fix in DB.",
|
||||
qinfo->GetQuestId(), qinfo->SourceItemId);
|
||||
qinfo->SourceItemIdCount = 1; // update to 1 for allow quest work for backward compatibility with DB
|
||||
}
|
||||
}
|
||||
else if (qinfo->SrcItemCount>0)
|
||||
else if (qinfo->SourceItemIdCount>0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `SrcItemId` = 0 but `SrcItemCount` = %u, useless value.",
|
||||
qinfo->GetQuestId(), qinfo->SrcItemCount);
|
||||
qinfo->SrcItemCount=0; // no quest work changes in fact
|
||||
sLog->outErrorDb("Quest %u has `SourceItemId` = 0 but `SourceItemIdCount` = %u, useless value.",
|
||||
qinfo->GetQuestId(), qinfo->SourceItemIdCount);
|
||||
qinfo->SourceItemIdCount=0; // no quest work changes in fact
|
||||
}
|
||||
|
||||
if (qinfo->SrcSpell)
|
||||
if (qinfo->SourceSpellid)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->SrcSpell);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->SourceSpellid);
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `SrcSpell` = %u but spell %u doesn't exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->SrcSpell, qinfo->SrcSpell);
|
||||
qinfo->SrcSpell = 0; // quest can't be done for this requirement
|
||||
sLog->outErrorDb("Quest %u has `SourceSpellid` = %u but spell %u doesn't exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->SourceSpellid, qinfo->SourceSpellid);
|
||||
qinfo->SourceSpellid = 0; // quest can't be done for this requirement
|
||||
}
|
||||
else if (!SpellMgr::IsSpellValid(spellInfo))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `SrcSpell` = %u but spell %u is broken, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->SrcSpell, qinfo->SrcSpell);
|
||||
qinfo->SrcSpell = 0; // quest can't be done for this requirement
|
||||
sLog->outErrorDb("Quest %u has `SourceSpellid` = %u but spell %u is broken, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->SourceSpellid, qinfo->SourceSpellid);
|
||||
qinfo->SourceSpellid = 0; // quest can't be done for this requirement
|
||||
}
|
||||
}
|
||||
|
||||
for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
uint32 id = qinfo->ReqItemId[j];
|
||||
uint32 id = qinfo->RequiredItemId[j];
|
||||
if (id)
|
||||
{
|
||||
if (qinfo->ReqItemCount[j] == 0)
|
||||
if (qinfo->RequiredItemCount[j] == 0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqItemId%d` = %u but `ReqItemCount%d` = 0, quest can't be done.",
|
||||
sLog->outErrorDb("Quest %u has `RequiredItemId%d` = %u but `RequiredItemCount%d` = 0, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, id, j+1);
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
@@ -4013,37 +4012,37 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
if (!sObjectMgr->GetItemTemplate(id))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqItemId%d` = %u but item with entry %u does not exist, quest can't be done.",
|
||||
sLog->outErrorDb("Quest %u has `RequiredItemId%d` = %u but item with entry %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, id, id);
|
||||
qinfo->ReqItemCount[j] = 0; // prevent incorrect work of quest
|
||||
qinfo->RequiredItemCount[j] = 0; // prevent incorrect work of quest
|
||||
}
|
||||
}
|
||||
else if (qinfo->ReqItemCount[j]>0)
|
||||
else if (qinfo->RequiredItemCount[j]>0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqItemId%d` = 0 but `ReqItemCount%d` = %u, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->ReqItemCount[j]);
|
||||
qinfo->ReqItemCount[j] = 0; // prevent incorrect work of quest
|
||||
sLog->outErrorDb("Quest %u has `RequiredItemId%d` = 0 but `RequiredItemCount%d` = %u, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredItemCount[j]);
|
||||
qinfo->RequiredItemCount[j] = 0; // prevent incorrect work of quest
|
||||
}
|
||||
}
|
||||
|
||||
for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j)
|
||||
{
|
||||
uint32 id = qinfo->ReqSourceId[j];
|
||||
uint32 id = qinfo->RequiredSourceItemid[j];
|
||||
if (id)
|
||||
{
|
||||
if (!sObjectMgr->GetItemTemplate(id))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqSourceId%d` = %u but item with entry %u does not exist, quest can't be done.",
|
||||
sLog->outErrorDb("Quest %u has `RequiredSourceItemid%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
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (qinfo->ReqSourceCount[j]>0)
|
||||
if (qinfo->RequiredSourceItemId[j]>0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqSourceId%d` = 0 but `ReqSourceCount%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->ReqSourceCount[j]);
|
||||
sLog->outErrorDb("Quest %u has `RequiredSourceItemid%d` = 0 but `RequiredSourceItemId%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredSourceItemId[j]);
|
||||
// no changes, quest ignore this data
|
||||
}
|
||||
}
|
||||
@@ -4051,7 +4050,7 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
uint32 id = qinfo->ReqSpell[j];
|
||||
uint32 id = qinfo->RequiredSpellCast[j];
|
||||
if (id)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id);
|
||||
@@ -4062,12 +4061,12 @@ void ObjectMgr::LoadQuests()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!qinfo->ReqCreatureOrGOId[j])
|
||||
if (!qinfo->RequiredNpcOrGo[j])
|
||||
{
|
||||
bool found = false;
|
||||
for (uint8 k = 0; k < MAX_SPELL_EFFECTS; ++k)
|
||||
{
|
||||
if ((spellInfo->Effects[k].Effect == SPELL_EFFECT_QUEST_COMPLETE && uint32(spellInfo->Effects[k].MiscValue) == qinfo->QuestId) ||
|
||||
if ((spellInfo->Effects[k].Effect == SPELL_EFFECT_QUEST_COMPLETE && uint32(spellInfo->Effects[k].MiscValue) == qinfo->Id) ||
|
||||
spellInfo->Effects[k].Effect == SPELL_EFFECT_SEND_EVENT)
|
||||
{
|
||||
found = true;
|
||||
@@ -4079,7 +4078,7 @@ void ObjectMgr::LoadQuests()
|
||||
{
|
||||
if (!qinfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
|
||||
{
|
||||
sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and ReqCreatureOrGOId%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or ReqCreatureOrGOId%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->QuestId, j+1, j+1);
|
||||
sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and RequiredNpcOrGo%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or RequiredNpcOrGo%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->Id, j+1, j+1);
|
||||
|
||||
// this will prevent quest completing without objective
|
||||
const_cast<Quest*>(qinfo)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
|
||||
@@ -4087,7 +4086,7 @@ void ObjectMgr::LoadQuests()
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u and ReqCreatureOrGOId%d = 0 but spell %u does not have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT effect for this quest, quest can't be done.",
|
||||
sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u and RequiredNpcOrGo%d = 0 but spell %u does not have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT effect for this quest, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, id, j+1, id);
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
@@ -4097,19 +4096,19 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
int32 id = qinfo->ReqCreatureOrGOId[j];
|
||||
int32 id = qinfo->RequiredNpcOrGo[j];
|
||||
if (id < 0 && !sObjectMgr->GetGameObjectTemplate(-id))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %i but gameobject %u does not exist, quest can't be done.",
|
||||
sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %i but gameobject %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, id, uint32(-id));
|
||||
qinfo->ReqCreatureOrGOId[j] = 0; // quest can't be done for this requirement
|
||||
qinfo->RequiredNpcOrGo[j] = 0; // quest can't be done for this requirement
|
||||
}
|
||||
|
||||
if (id > 0 && !sObjectMgr->GetCreatureTemplate(id))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %i but creature with entry %u does not exist, quest can't be done.",
|
||||
sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %i but creature with entry %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, id, uint32(id));
|
||||
qinfo->ReqCreatureOrGOId[j] = 0; // quest can't be done for this requirement
|
||||
qinfo->RequiredNpcOrGo[j] = 0; // quest can't be done for this requirement
|
||||
}
|
||||
|
||||
if (id)
|
||||
@@ -4118,179 +4117,179 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
qinfo->SetFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO);
|
||||
|
||||
if (!qinfo->ReqCreatureOrGOCount[j])
|
||||
if (!qinfo->RequiredNpcOrGoCount[j])
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %u but `ReqCreatureOrGOCount%d` = 0, quest can't be done.",
|
||||
sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %u but `RequiredNpcOrGoCount%d` = 0, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, id, j+1);
|
||||
// no changes, quest can be incorrectly done, but we already report this
|
||||
}
|
||||
}
|
||||
else if (qinfo->ReqCreatureOrGOCount[j]>0)
|
||||
else if (qinfo->RequiredNpcOrGoCount[j]>0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = 0 but `ReqCreatureOrGOCount%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->ReqCreatureOrGOCount[j]);
|
||||
sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = 0 but `RequiredNpcOrGoCount%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredNpcOrGoCount[j]);
|
||||
// no changes, quest ignore this data
|
||||
}
|
||||
}
|
||||
|
||||
for (uint8 j = 0; j < QUEST_REWARD_CHOICES_COUNT; ++j)
|
||||
{
|
||||
uint32 id = qinfo->RewChoiceItemId[j];
|
||||
uint32 id = qinfo->RewardChoiceItemId[j];
|
||||
if (id)
|
||||
{
|
||||
if (!sObjectMgr->GetItemTemplate(id))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
|
||||
sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
|
||||
qinfo->GetQuestId(), j+1, id, id);
|
||||
qinfo->RewChoiceItemId[j] = 0; // no changes, quest will not reward this
|
||||
qinfo->RewardChoiceItemId[j] = 0; // no changes, quest will not reward this
|
||||
}
|
||||
|
||||
if (!qinfo->RewChoiceItemCount[j])
|
||||
if (!qinfo->RewardChoiceItemCount[j])
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but `RewChoiceItemCount%d` = 0, quest can't be done.",
|
||||
sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but `RewardChoiceItemCount%d` = 0, quest can't be done.",
|
||||
qinfo->GetQuestId(), j+1, id, j+1);
|
||||
// no changes, quest can't be done
|
||||
}
|
||||
}
|
||||
else if (qinfo->RewChoiceItemCount[j]>0)
|
||||
else if (qinfo->RewardChoiceItemCount[j]>0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = 0 but `RewChoiceItemCount%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RewChoiceItemCount[j]);
|
||||
sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = 0 but `RewardChoiceItemCount%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RewardChoiceItemCount[j]);
|
||||
// no changes, quest ignore this data
|
||||
}
|
||||
}
|
||||
|
||||
for (uint8 j = 0; j < QUEST_REWARDS_COUNT; ++j)
|
||||
{
|
||||
uint32 id = qinfo->RewItemId[j];
|
||||
uint32 id = qinfo->RewardItemId[j];
|
||||
if (id)
|
||||
{
|
||||
if (!sObjectMgr->GetItemTemplate(id))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
|
||||
sLog->outErrorDb("Quest %u has `RewardItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
|
||||
qinfo->GetQuestId(), j+1, id, id);
|
||||
qinfo->RewItemId[j] = 0; // no changes, quest will not reward this item
|
||||
qinfo->RewardItemId[j] = 0; // no changes, quest will not reward this item
|
||||
}
|
||||
|
||||
if (!qinfo->RewItemCount[j])
|
||||
if (!qinfo->RewardItemIdCount[j])
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewItemId%d` = %u but `RewItemCount%d` = 0, quest will not reward this item.",
|
||||
sLog->outErrorDb("Quest %u has `RewardItemId%d` = %u but `RewardItemIdCount%d` = 0, quest will not reward this item.",
|
||||
qinfo->GetQuestId(), j+1, id, j+1);
|
||||
// no changes
|
||||
}
|
||||
}
|
||||
else if (qinfo->RewItemCount[j]>0)
|
||||
else if (qinfo->RewardItemIdCount[j]>0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewItemId%d` = 0 but `RewItemCount%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RewItemCount[j]);
|
||||
sLog->outErrorDb("Quest %u has `RewardItemId%d` = 0 but `RewardItemIdCount%d` = %u.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RewardItemIdCount[j]);
|
||||
// no changes, quest ignore this data
|
||||
}
|
||||
}
|
||||
|
||||
for (uint8 j = 0; j < QUEST_REPUTATIONS_COUNT; ++j)
|
||||
{
|
||||
if (qinfo->RewRepFaction[j])
|
||||
if (qinfo->RewardFactionId[j])
|
||||
{
|
||||
if (abs(qinfo->RewRepValueId[j]) > 9)
|
||||
if (abs(qinfo->RewardFactionValueId[j]) > 9)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has RewRepValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewRepValueId[j]);
|
||||
sLog->outErrorDb("Quest %u has RewardFactionValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewardFactionValueId[j]);
|
||||
}
|
||||
if (!sFactionStore.LookupEntry(qinfo->RewRepFaction[j]))
|
||||
if (!sFactionStore.LookupEntry(qinfo->RewardFactionId[j]))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewRepFaction%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(), j+1, qinfo->RewRepFaction[j], qinfo->RewRepFaction[j]);
|
||||
qinfo->RewRepFaction[j] = 0; // quest will not reward this
|
||||
sLog->outErrorDb("Quest %u has `RewardFactionId%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(), j+1, qinfo->RewardFactionId[j], qinfo->RewardFactionId[j]);
|
||||
qinfo->RewardFactionId[j] = 0; // quest will not reward this
|
||||
}
|
||||
}
|
||||
|
||||
else if (qinfo->RewRepValue[j] != 0)
|
||||
else if (qinfo->RewardFactionValueIdOverride[j] != 0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewRepFaction%d` = 0 but `RewRepValue%d` = %i.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RewRepValue[j]);
|
||||
sLog->outErrorDb("Quest %u has `RewardFactionId%d` = 0 but `RewardFactionValueIdOverride%d` = %i.",
|
||||
qinfo->GetQuestId(), j+1, j+1, qinfo->RewardFactionValueIdOverride[j]);
|
||||
// no changes, quest ignore this data
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->RewSpell)
|
||||
if (qinfo->RewardSpell)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RewSpell);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RewardSpell);
|
||||
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u does not exist, spell removed as display reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewSpell, qinfo->RewSpell);
|
||||
qinfo->RewSpell = 0; // no spell reward will display for this quest
|
||||
sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u does not exist, spell removed as display reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell);
|
||||
qinfo->RewardSpell = 0; // no spell reward will display for this quest
|
||||
}
|
||||
|
||||
else if (!SpellMgr::IsSpellValid(spellInfo))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is broken, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewSpell, qinfo->RewSpell);
|
||||
qinfo->RewSpell = 0; // no spell reward will display for this quest
|
||||
sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is broken, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell);
|
||||
qinfo->RewardSpell = 0; // no spell reward will display for this quest
|
||||
}
|
||||
|
||||
else if (GetTalentSpellCost(qinfo->RewSpell))
|
||||
else if (GetTalentSpellCost(qinfo->RewardSpell))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is talent, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewSpell, qinfo->RewSpell);
|
||||
qinfo->RewSpell = 0; // no spell reward will display for this quest
|
||||
sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell);
|
||||
qinfo->RewardSpell = 0; // no spell reward will display for this quest
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->RewSpellCast > 0)
|
||||
if (qinfo->RewardSpellCast > 0)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RewSpellCast);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RewardSpellCast);
|
||||
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewSpellCast, qinfo->RewSpellCast);
|
||||
qinfo->RewSpellCast = 0; // no spell will be casted on player
|
||||
sLog->outErrorDb("Quest %u has `RewardSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
|
||||
qinfo->RewardSpellCast = 0; // no spell will be casted on player
|
||||
}
|
||||
|
||||
else if (!SpellMgr::IsSpellValid(spellInfo))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewSpellCast` = %u but spell %u is broken, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewSpellCast, qinfo->RewSpellCast);
|
||||
qinfo->RewSpellCast = 0; // no spell will be casted on player
|
||||
sLog->outErrorDb("Quest %u has `RewardSpellCast` = %u but spell %u is broken, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
|
||||
qinfo->RewardSpellCast = 0; // no spell will be casted on player
|
||||
}
|
||||
|
||||
else if (GetTalentSpellCost(qinfo->RewSpellCast))
|
||||
else if (GetTalentSpellCost(qinfo->RewardSpellCast))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is talent, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewSpellCast, qinfo->RewSpellCast);
|
||||
qinfo->RewSpellCast = 0; // no spell will be casted on player
|
||||
sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
|
||||
qinfo->RewardSpellCast = 0; // no spell will be casted on player
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->RewMailTemplateId)
|
||||
if (qinfo->RewardMailTemplateId)
|
||||
{
|
||||
if (!sMailTemplateStore.LookupEntry(qinfo->RewMailTemplateId))
|
||||
if (!sMailTemplateStore.LookupEntry(qinfo->RewardMailTemplateId))
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RewMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewMailTemplateId, qinfo->RewMailTemplateId);
|
||||
qinfo->RewMailTemplateId = 0; // no mail will send to player
|
||||
qinfo->RewMailDelaySecs = 0; // no mail will send to player
|
||||
sLog->outErrorDb("Quest %u has `RewardMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId);
|
||||
qinfo->RewardMailTemplateId = 0; // no mail will send to player
|
||||
qinfo->RewardMailDelay = 0; // no mail will send to player
|
||||
}
|
||||
else if (usedMailTemplates.find(qinfo->RewMailTemplateId) != usedMailTemplates.end())
|
||||
else if (usedMailTemplates.find(qinfo->RewardMailTemplateId) != usedMailTemplates.end())
|
||||
{
|
||||
std::map<uint32, uint32>::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->RewMailTemplateId);
|
||||
sLog->outErrorDb("Quest %u has `RewMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewMailTemplateId, qinfo->RewMailTemplateId, used_mt_itr->second);
|
||||
qinfo->RewMailTemplateId = 0; // no mail will send to player
|
||||
qinfo->RewMailDelaySecs = 0; // no mail will send to player
|
||||
std::map<uint32, uint32>::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->RewardMailTemplateId);
|
||||
sLog->outErrorDb("Quest %u has `RewardMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId, used_mt_itr->second);
|
||||
qinfo->RewardMailTemplateId = 0; // no mail will send to player
|
||||
qinfo->RewardMailDelay = 0; // no mail will send to player
|
||||
}
|
||||
else
|
||||
usedMailTemplates[qinfo->RewMailTemplateId] = qinfo->GetQuestId();
|
||||
usedMailTemplates[qinfo->RewardMailTemplateId] = qinfo->GetQuestId();
|
||||
}
|
||||
|
||||
if (qinfo->NextQuestInChain)
|
||||
if (qinfo->NextQuestIdChain)
|
||||
{
|
||||
QuestMap::iterator qNextItr = mQuestTemplates.find(qinfo->NextQuestInChain);
|
||||
QuestMap::iterator qNextItr = mQuestTemplates.find(qinfo->NextQuestIdChain);
|
||||
if (qNextItr == mQuestTemplates.end())
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `NextQuestInChain` = %u but quest %u does not exist, quest chain will not work.",
|
||||
qinfo->GetQuestId(), qinfo->NextQuestInChain, qinfo->NextQuestInChain);
|
||||
qinfo->NextQuestInChain = 0;
|
||||
sLog->outErrorDb("Quest %u has `NextQuestIdChain` = %u but quest %u does not exist, quest chain will not work.",
|
||||
qinfo->GetQuestId(), qinfo->NextQuestIdChain, qinfo->NextQuestIdChain);
|
||||
qinfo->NextQuestIdChain = 0;
|
||||
}
|
||||
else
|
||||
qNextItr->second->prevChainQuests.push_back(qinfo->GetQuestId());
|
||||
@@ -4327,7 +4326,7 @@ void ObjectMgr::LoadQuests()
|
||||
mExclusiveQuestGroups.insert(std::pair<int32, uint32>(qinfo->ExclusiveGroup, qinfo->GetQuestId()));
|
||||
if (qinfo->LimitTime)
|
||||
qinfo->SetFlag(QUEST_TRINITY_FLAGS_TIMED);
|
||||
if (qinfo->PlayersSlain)
|
||||
if (qinfo->RequiredPlayerKills)
|
||||
qinfo->SetFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user