DB/World schema backport: split quest_template and quest_template_addon

Closes #14982

Signed-off-by: DDuarte <dnpd.dd@gmail.com>
This commit is contained in:
ShinDarth authored and DDuarte committed 2015-07-02 00:27:38 +01:00
1 parent 7c7d258482
commit 5178395a4f
4 files changed
+190 -110

No files matched your search

+79 -75
View File
@@ -26,121 +26,102 @@ Quest::Quest(Field* questRecord)
Method = questRecord[1].GetUInt8();
Level = questRecord[2].GetInt16();
MinLevel = questRecord[3].GetUInt8();
MaxLevel = questRecord[4].GetUInt8();
ZoneOrSort = questRecord[5].GetInt16();
Type = questRecord[6].GetUInt16();
SuggestedPlayers = questRecord[7].GetUInt8();
LimitTime = questRecord[8].GetUInt32();
RequiredClasses = questRecord[9].GetUInt16();
RequiredRaces = questRecord[10].GetUInt16();
RequiredSkillId = questRecord[11].GetUInt16();
RequiredSkillPoints = questRecord[12].GetUInt16();
RequiredFactionId1 = questRecord[13].GetUInt16();
RequiredFactionId2 = questRecord[14].GetUInt16();
RequiredFactionValue1 = questRecord[15].GetInt32();
RequiredFactionValue2 = questRecord[16].GetInt32();
RequiredMinRepFaction = questRecord[17].GetUInt16();
RequiredMaxRepFaction = questRecord[18].GetUInt16();
RequiredMinRepValue = questRecord[19].GetInt32();
RequiredMaxRepValue = questRecord[20].GetInt32();
PrevQuestId = questRecord[21].GetInt32();
NextQuestId = questRecord[22].GetInt32();
ExclusiveGroup = questRecord[23].GetInt32();
NextQuestIdChain = questRecord[24].GetUInt32();
RewardXPId = questRecord[25].GetUInt8();
RewardOrRequiredMoney = questRecord[26].GetInt32();
RewardMoneyMaxLevel = questRecord[27].GetUInt32();
RewardSpell = questRecord[28].GetUInt32();
RewardSpellCast = questRecord[29].GetInt32();
RewardHonor = questRecord[30].GetUInt32();
RewardHonorMultiplier = questRecord[31].GetFloat();
RewardMailTemplateId = questRecord[32].GetUInt32();
RewardMailDelay = questRecord[33].GetUInt32();
SourceItemId = questRecord[34].GetUInt32();
SourceItemIdCount = questRecord[35].GetUInt8();
SourceSpellid = questRecord[36].GetUInt32();
Flags = questRecord[37].GetUInt32();
SpecialFlags = questRecord[38].GetUInt8();
RewardTitleId = questRecord[39].GetUInt8();
RequiredPlayerKills = questRecord[40].GetUInt8();
RewardTalents = questRecord[41].GetUInt8();
RewardArenaPoints = questRecord[42].GetUInt16();
ZoneOrSort = questRecord[4].GetInt16();
Type = questRecord[5].GetUInt16();
SuggestedPlayers = questRecord[6].GetUInt8();
LimitTime = questRecord[7].GetUInt32();
RequiredRaces = questRecord[8].GetUInt16();
RequiredFactionId1 = questRecord[9].GetUInt16();
RequiredFactionId2 = questRecord[10].GetUInt16();
RequiredFactionValue1 = questRecord[11].GetInt32();
RequiredFactionValue2 = questRecord[12].GetInt32();
NextQuestIdChain = questRecord[13].GetUInt32();
RewardXPId = questRecord[14].GetUInt8();
RewardOrRequiredMoney = questRecord[15].GetInt32();
RewardMoneyMaxLevel = questRecord[16].GetUInt32();
RewardSpell = questRecord[17].GetUInt32();
RewardSpellCast = questRecord[18].GetInt32();
RewardHonor = questRecord[19].GetUInt32();
RewardHonorMultiplier = questRecord[20].GetFloat();
SourceItemId = questRecord[21].GetUInt32();
Flags = questRecord[22].GetUInt32();
RewardTitleId = questRecord[23].GetUInt8();
RequiredPlayerKills = questRecord[24].GetUInt8();
RewardTalents = questRecord[25].GetUInt8();
RewardArenaPoints = questRecord[26].GetUInt16();
for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)
RewardItemId[i] = questRecord[43+i].GetUInt32();
RewardItemId[i] = questRecord[27+i].GetUInt32();
for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)
RewardItemIdCount[i] = questRecord[47+i].GetUInt16();
RewardItemIdCount[i] = questRecord[31+i].GetUInt16();
for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
RewardChoiceItemId[i] = questRecord[51+i].GetUInt32();
RewardChoiceItemId[i] = questRecord[35+i].GetUInt32();
for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
RewardChoiceItemCount[i] = questRecord[57+i].GetUInt16();
RewardChoiceItemCount[i] = questRecord[41+i].GetUInt16();
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
RewardFactionId[i] = questRecord[63+i].GetUInt16();
RewardFactionId[i] = questRecord[47+i].GetUInt16();
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
RewardFactionValueId[i] = questRecord[68+i].GetInt32();
RewardFactionValueId[i] = questRecord[52+i].GetInt32();
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
RewardFactionValueIdOverride[i] = questRecord[73+i].GetInt32();
RewardFactionValueIdOverride[i] = questRecord[57+i].GetInt32();
PointMapId = questRecord[78].GetUInt16();
PointX = questRecord[79].GetFloat();
PointY = questRecord[80].GetFloat();
PointOption = questRecord[81].GetUInt32();
Title = questRecord[82].GetString();
Objectives = questRecord[83].GetString();
Details = questRecord[84].GetString();
EndText = questRecord[85].GetString();
OfferRewardText = questRecord[86].GetString();
RequestItemsText = questRecord[87].GetString();
CompletedText = questRecord[88].GetString();
PointMapId = questRecord[62].GetUInt16();
PointX = questRecord[63].GetFloat();
PointY = questRecord[64].GetFloat();
PointOption = questRecord[65].GetUInt32();
Title = questRecord[66].GetString();
Objectives = questRecord[67].GetString();
Details = questRecord[68].GetString();
EndText = questRecord[69].GetString();
OfferRewardText = questRecord[70].GetString();
RequestItemsText = questRecord[71].GetString();
CompletedText = questRecord[72].GetString();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
RequiredNpcOrGo[i] = questRecord[89+i].GetInt32();
RequiredNpcOrGo[i] = questRecord[73+i].GetInt32();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
RequiredNpcOrGoCount[i] = questRecord[93+i].GetUInt16();
RequiredNpcOrGoCount[i] = questRecord[77+i].GetUInt16();
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
RequiredSourceItemId[i] = questRecord[97+i].GetUInt32();
RequiredSourceItemId[i] = questRecord[81+i].GetUInt32();
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
RequiredSourceItemCount[i] = questRecord[101+i].GetUInt16();
RequiredSourceItemCount[i] = questRecord[85+i].GetUInt16();
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
RequiredItemId[i] = questRecord[105+i].GetUInt32();
RequiredItemId[i] = questRecord[89+i].GetUInt32();
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
RequiredItemCount[i] = questRecord[111+i].GetUInt16();
RequiredItemCount[i] = questRecord[95+i].GetUInt16();
// int8 Unknown0 = questRecord[117].GetUInt8();
// int8 Unknown0 = questRecord[101].GetUInt8();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
ObjectiveText[i] = questRecord[118+i].GetString();
ObjectiveText[i] = questRecord[102+i].GetString();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
DetailsEmote[i] = questRecord[122+i].GetUInt16();
DetailsEmote[i] = questRecord[106+i].GetUInt16();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
DetailsEmoteDelay[i] = questRecord[126+i].GetUInt32();
DetailsEmoteDelay[i] = questRecord[110+i].GetUInt32();
EmoteOnIncomplete = questRecord[130].GetUInt16();
EmoteOnComplete = questRecord[131].GetUInt16();
EmoteOnIncomplete = questRecord[114].GetUInt16();
EmoteOnComplete = questRecord[115].GetUInt16();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
OfferRewardEmote[i] = questRecord[132+i].GetInt16();
OfferRewardEmote[i] = questRecord[116+i].GetInt16();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
OfferRewardEmoteDelay[i] = questRecord[136+i].GetInt32();
OfferRewardEmoteDelay[i] = questRecord[120+i].GetInt32();
//int32 VerifiedBuild = questRecord[140].GetInt32();
if (SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT)
Flags |= QUEST_FLAGS_AUTO_ACCEPT;
//int32 VerifiedBuild = questRecord[124].GetInt32();
_reqItemsCount = 0;
_reqCreatureOrGOcount = 0;
@@ -164,6 +145,29 @@ Quest::Quest(Field* questRecord)
++_rewChoiceItemsCount;
}
void Quest::LoadQuestTemplateAddon(Field* fields)
{
MaxLevel = fields[1].GetUInt8();
RequiredClasses = fields[2].GetUInt32();
SourceSpellid = fields[3].GetUInt32();
PrevQuestId = fields[4].GetInt32();
NextQuestId = fields[5].GetInt32();
ExclusiveGroup = fields[6].GetInt32();
RewardMailTemplateId = fields[7].GetUInt32();
RewardMailDelay = fields[8].GetUInt32();
RequiredSkillId = fields[9].GetUInt16();
RequiredSkillPoints = fields[10].GetUInt16();
RequiredMinRepFaction = fields[11].GetUInt16();
RequiredMaxRepFaction = fields[12].GetUInt16();
RequiredMinRepValue = fields[13].GetInt32();
RequiredMaxRepValue = fields[14].GetInt32();
SourceItemIdCount = fields[15].GetUInt8();
SpecialFlags = fields[16].GetUInt8();
if (SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT)
Flags |= QUEST_FLAGS_AUTO_ACCEPT;
}
uint32 Quest::XPValue(Player* player) const
{
if (player)