mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
DB/World schema: split quest_template and quest_template_addon and renamed some fields (#291)
This commit is contained in:
committed by
Francesco Borzì
parent
fd305ad8a6
commit
f549a25501
@@ -0,0 +1,55 @@
|
||||
INSERT INTO version_db_world (`sql_rev`) VALUES ('1482409122200235830');
|
||||
-- creating `quest_template_addon` table
|
||||
DROP TABLE IF EXISTS `quest_template_addon`;
|
||||
CREATE TABLE IF NOT EXISTS `quest_template_addon` ( -- old names:
|
||||
`ID` mediumint(8) unsigned NOT NULL DEFAULT '0', -- ID
|
||||
`MaxLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', -- MaxLevel
|
||||
`AllowableClasses` int(10) unsigned NOT NULL DEFAULT '0', -- RequiredClasses
|
||||
`SourceSpellID` mediumint(8) unsigned NOT NULL DEFAULT '0', -- SourceSpellId
|
||||
`PrevQuestID` mediumint(8) NOT NULL DEFAULT '0', -- PrevQuestId
|
||||
`NextQuestID` mediumint(8) NOT NULL DEFAULT '0', -- NextQuestId
|
||||
`ExclusiveGroup` mediumint(8) NOT NULL DEFAULT '0', -- ExclusiveGroup
|
||||
`RewardMailTemplateID` mediumint(8) unsigned NOT NULL DEFAULT '0', -- RewardMailTemplateId
|
||||
`RewardMailDelay` int(10) unsigned NOT NULL DEFAULT '0', -- RewardMailDelay
|
||||
`RequiredSkillID` smallint(5) unsigned NOT NULL DEFAULT '0', -- RequiredSkillId
|
||||
`RequiredSkillPoints` smallint(5) unsigned NOT NULL DEFAULT '0', -- RequiredSkillPoints
|
||||
`RequiredMinRepFaction` smallint(5) unsigned NOT NULL DEFAULT '0', -- RequiredMinRepFaction
|
||||
`RequiredMaxRepFaction` smallint(5) unsigned NOT NULL DEFAULT '0', -- RequiredMaxRepFaction
|
||||
`RequiredMinRepValue` mediumint(8) NOT NULL DEFAULT '0', -- RequiredMinRepValue
|
||||
`RequiredMaxRepValue` mediumint(8) NOT NULL DEFAULT '0', -- RequiredMaxRepValue
|
||||
`ProvidedItemCount` tinyint(3) unsigned NOT NULL DEFAULT '0', -- SourceItemCount
|
||||
`SpecialFlags` tinyint(3) unsigned NOT NULL DEFAULT '0', -- SpecialFlags
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
-- moving data from `quest_template` to `quest_template_addon`
|
||||
INSERT INTO `quest_template_addon`
|
||||
(`ID`, `MaxLevel`, `AllowableClasses`, `SourceSpellID`, `PrevQuestID`, `NextQuestID`, `ExclusiveGroup`, `RewardMailTemplateID`, `RewardMailDelay`, `RequiredSkillID`, `RequiredSkillPoints`, `RequiredMinRepFaction`, `RequiredMaxRepFaction`, `RequiredMinRepValue`, `RequiredMaxRepValue`, `ProvidedItemCount`, `SpecialFlags`)
|
||||
(SELECT `ID`, `MaxLevel`, `RequiredClasses`, `SourceSpellId`, `PrevQuestId`, `NextQuestId`, `ExclusiveGroup`, `RewardMailTemplateId`, `RewardMailDelay`, `RequiredSkillId`, `RequiredSkillPoints`, `RequiredMinRepFaction`, `RequiredMaxRepFaction`, `RequiredMinRepValue`, `RequiredMaxRepValue`, `SourceItemCount`, `SpecialFlags` FROM `quest_template`);
|
||||
|
||||
|
||||
-- drop `quest_template` fields
|
||||
ALTER TABLE `quest_template`
|
||||
DROP `MaxLevel`,
|
||||
DROP `RequiredClasses`,
|
||||
DROP `SourceSpellId`,
|
||||
DROP `PrevQuestId`,
|
||||
DROP `NextQuestId`,
|
||||
DROP `ExclusiveGroup`,
|
||||
DROP `RewardMailTemplateId`,
|
||||
DROP `RewardMailDelay`,
|
||||
DROP `RequiredSkillId`,
|
||||
DROP `RequiredSkillPoints`,
|
||||
DROP `RequiredMinRepFaction`,
|
||||
DROP `RequiredMaxRepFaction`,
|
||||
DROP `RequiredMinRepValue`,
|
||||
DROP `RequiredMaxRepValue`,
|
||||
DROP `SourceItemCount`,
|
||||
DROP `SpecialFlags`;
|
||||
|
||||
|
||||
-- alter `quest_template` fields
|
||||
ALTER TABLE `quest_template`
|
||||
CHANGE COLUMN `Method` `QuestType` TINYINT(3) UNSIGNED NOT NULL DEFAULT '2' AFTER `ID`,
|
||||
CHANGE COLUMN `QuestType` `QuestInfoID` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `QuestSortID`;
|
||||
@@ -1529,7 +1529,7 @@ bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guidLow, uint32 linkedGuidLow)
|
||||
const CreatureData* slave = GetCreatureData(linkedGuidLow);
|
||||
if (!slave)
|
||||
{
|
||||
//TC_LOG_ERROR("sql.sql", "Creature '%u' linking to non-existent creature '%u'.", guidLow, linkedGuidLow);
|
||||
// sLog->outError("sql.sql", "Creature '%u' linking to non-existent creature '%u'.", guidLow, linkedGuidLow);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3852,36 +3852,36 @@ void ObjectMgr::LoadQuests()
|
||||
mExclusiveQuestGroups.clear();
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT "
|
||||
//0 1 2 3 4 5 6 7 8 9 10 11 12
|
||||
"ID, Method, QuestLevel, MinLevel, MaxLevel, QuestSortID, QuestType, SuggestedGroupNum, TimeAllowed, RequiredClasses, AllowableRaces, 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, RewardNextQuest, RewardXPDifficulty, RewardMoney, RewardBonusMoney, RewardDisplaySpell, RewardSpell, RewardHonor, RewardKillHonor, "
|
||||
// 32 33 34 35 36 37 38 39 40 41 42
|
||||
"RewardMailTemplateId, RewardMailDelay, StartItem, SourceItemCount, SourceSpellId, Flags, SpecialFlags, RewardTitle, RequiredPlayerKills, RewardTalents, RewardArenaPoints, "
|
||||
// 43 44 45 46 47 48 49 50
|
||||
//0 1 2 3 4 5 6 7 8
|
||||
"ID, QuestType, QuestLevel, MinLevel, QuestSortID, QuestInfoID, SuggestedGroupNum, TimeAllowed, AllowableRaces,"
|
||||
// 9 10 11 12
|
||||
"RequiredFactionId1, RequiredFactionId2, RequiredFactionValue1, RequiredFactionValue2, "
|
||||
// 13 14 15 16 17 18 19 20
|
||||
"RewardNextQuest, RewardXPDifficulty, RewardMoney, RewardBonusMoney, RewardDisplaySpell, RewardSpell, RewardHonor, RewardKillHonor, "
|
||||
// 21 22 23 24 25 26
|
||||
"StartItem, Flags, RewardTitle, RequiredPlayerKills, RewardTalents, RewardArenaPoints, "
|
||||
// 27 28 29 30 31 32 33 34
|
||||
"RewardItem1, RewardItem2, RewardItem3, RewardItem4, RewardAmount1, RewardAmount2, RewardAmount3, RewardAmount4, "
|
||||
// 51 52 53 54 55 56 57 58 59 60 61 62
|
||||
// 35 36 37 38 39 40 41 42 43 44 45 46
|
||||
"RewardChoiceItemID1, RewardChoiceItemID2, RewardChoiceItemID3, RewardChoiceItemID4, RewardChoiceItemID5, RewardChoiceItemID6, RewardChoiceItemQuantity1, RewardChoiceItemQuantity2, RewardChoiceItemQuantity3, RewardChoiceItemQuantity4, RewardChoiceItemQuantity5, RewardChoiceItemQuantity6, "
|
||||
// 63 64 65 66 67 68 69 70 71 72
|
||||
// 47 48 49 50 51 52 53 54 55 56
|
||||
"RewardFactionID1, RewardFactionID2, RewardFactionID3, RewardFactionID4, RewardFactionID5, RewardFactionValue1, RewardFactionValue2, RewardFactionValue3, RewardFactionValue4, RewardFactionValue5, "
|
||||
// 73 74 75 76 77
|
||||
// 57 58 59 60 61
|
||||
"RewardFactionOverride1, RewardFactionOverride2, RewardFactionOverride3, RewardFactionOverride4, RewardFactionOverride5, "
|
||||
// 78 79 80 81
|
||||
// 62 63 64 65
|
||||
"POIContinent, POIx, POIy, POIPriority, "
|
||||
// 82 83 84 85 86 87 88
|
||||
// 66 67 68 69 70 71 72
|
||||
"LogTitle, LogDescription, QuestDescription, AreaDescription, OfferRewardText, RequestItemsText, QuestCompletionLog, "
|
||||
// 89 90 91 92 93 94 95 96
|
||||
// 73 74 75 76 77 78 79 80
|
||||
"RequiredNpcOrGo1, RequiredNpcOrGo2, RequiredNpcOrGo3, RequiredNpcOrGo4, RequiredNpcOrGoCount1, RequiredNpcOrGoCount2, RequiredNpcOrGoCount3, RequiredNpcOrGoCount4, "
|
||||
// 97 98 99 100 101 102 103 104
|
||||
// 81 82 83 84 85 86 87 88
|
||||
"ItemDrop1, ItemDrop2, ItemDrop3, ItemDrop4, ItemDropQuantity1, ItemDropQuantity2, ItemDropQuantity3, ItemDropQuantity4, "
|
||||
// 105 106 107 108 109 110 111 112 113 114 115 116
|
||||
// 89 90 91 92 93 94 95 96 97 98 99 100
|
||||
"RequiredItemId1, RequiredItemId2, RequiredItemId3, RequiredItemId4, RequiredItemId5, RequiredItemId6, RequiredItemCount1, RequiredItemCount2, RequiredItemCount3, RequiredItemCount4, RequiredItemCount5, RequiredItemCount6, "
|
||||
// 117 118 119 120 121 122 123 124 125 126 127 128 129
|
||||
// 101 102 103 104 105 106 107 108 109 110 111 112 113
|
||||
"Unknown0, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, "
|
||||
// 130 131 132 133 134 135 136 137 138 139 140
|
||||
"EmoteOnIncomplete, EmoteOnComplete, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, VerifiedBuild"
|
||||
// 114 115 116 117 118 119 120 121 122 123
|
||||
"EmoteOnIncomplete, EmoteOnComplete, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4"
|
||||
" FROM quest_template");
|
||||
if (!result)
|
||||
{
|
||||
@@ -3921,6 +3921,27 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
std::map<uint32, uint32> usedMailTemplates;
|
||||
|
||||
// Load `quest_template_addon`
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
result = WorldDatabase.Query("SELECT ID, MaxLevel, AllowableClasses, SourceSpellID, PrevQuestID, NextQuestID, ExclusiveGroup, RewardMailTemplateID, RewardMailDelay, "
|
||||
//9 10 11 12 13 14 15 16
|
||||
"RequiredSkillID, RequiredSkillPoints, RequiredMinRepFaction, RequiredMaxRepFaction, RequiredMinRepValue, RequiredMaxRepValue, ProvidedItemCount, SpecialFlags FROM quest_template_addon");
|
||||
|
||||
if (!result) {
|
||||
sLog->outError(">> Loaded 0 quest template addons. DB table `quest_template_addon` is empty.");
|
||||
} else {
|
||||
do {
|
||||
Field* fields = result->Fetch();
|
||||
uint32 questId = fields[0].GetUInt32();
|
||||
|
||||
auto itr = _questTemplates.find(questId);
|
||||
if (itr != _questTemplates.end())
|
||||
itr->second->LoadQuestTemplateAddon(fields);
|
||||
else
|
||||
sLog->outError("Table `quest_template_addon` has data for quest %u but such quest does not exist", questId);
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
// Post processing
|
||||
for (QuestMap::iterator iter = _questTemplates.begin(); iter != _questTemplates.end(); ++iter)
|
||||
{
|
||||
@@ -9302,5 +9323,5 @@ void ObjectMgr::LoadCreatureQuestItems()
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
sLog->outString("server.loading", ">> Loaded %u creature quest items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString(">> Loaded %u creature quest items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
@@ -16,121 +16,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;
|
||||
@@ -156,6 +137,29 @@ Quest::Quest(Field* questRecord)
|
||||
_eventIdForQuest = 0;
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
@@ -184,6 +184,8 @@ class Quest
|
||||
friend class ObjectMgr;
|
||||
public:
|
||||
Quest(Field* questRecord);
|
||||
void LoadQuestTemplateAddon(Field* fields);
|
||||
|
||||
uint32 XPValue(Player* player) const;
|
||||
|
||||
bool HasFlag(uint32 flag) const { return (Flags & flag) != 0; }
|
||||
@@ -313,21 +315,13 @@ class Quest
|
||||
uint32 Method;
|
||||
int32 ZoneOrSort;
|
||||
uint32 MinLevel;
|
||||
uint32 MaxLevel;
|
||||
int32 Level;
|
||||
uint32 Type;
|
||||
uint32 RequiredClasses;
|
||||
uint32 RequiredRaces;
|
||||
uint32 RequiredSkillId;
|
||||
uint32 RequiredSkillPoints;
|
||||
uint32 RequiredFactionId1;
|
||||
int32 RequiredFactionValue1;
|
||||
uint32 RequiredFactionId2;
|
||||
int32 RequiredFactionValue2;
|
||||
uint32 RequiredMinRepFaction;
|
||||
int32 RequiredMinRepValue;
|
||||
uint32 RequiredMaxRepFaction;
|
||||
int32 RequiredMaxRepValue;
|
||||
uint32 SuggestedPlayers;
|
||||
uint32 LimitTime;
|
||||
uint32 Flags;
|
||||
@@ -335,14 +329,9 @@ class Quest
|
||||
uint32 RequiredPlayerKills;
|
||||
uint32 RewardTalents;
|
||||
int32 RewardArenaPoints;
|
||||
int32 PrevQuestId;
|
||||
int32 NextQuestId;
|
||||
int32 ExclusiveGroup;
|
||||
uint32 NextQuestIdChain;
|
||||
uint32 RewardXPId;
|
||||
uint32 SourceItemId;
|
||||
uint32 SourceItemIdCount;
|
||||
uint32 SourceSpellid;
|
||||
std::string Title;
|
||||
std::string Details;
|
||||
std::string Objectives;
|
||||
@@ -356,8 +345,6 @@ class Quest
|
||||
uint32 RewardMoneyMaxLevel;
|
||||
uint32 RewardSpell;
|
||||
int32 RewardSpellCast;
|
||||
uint32 RewardMailTemplateId;
|
||||
uint32 RewardMailDelay;
|
||||
uint32 PointMapId;
|
||||
float PointX;
|
||||
float PointY;
|
||||
@@ -365,7 +352,23 @@ class Quest
|
||||
uint32 EmoteOnIncomplete;
|
||||
uint32 EmoteOnComplete;
|
||||
|
||||
uint32 SpecialFlags; // custom flags, not sniffed/WDB
|
||||
// quest_template_addon table (custom data)
|
||||
uint32 MaxLevel = 0;
|
||||
uint32 RequiredClasses = 0;
|
||||
uint32 SourceSpellid = 0;
|
||||
int32 PrevQuestId = 0;
|
||||
int32 NextQuestId = 0;
|
||||
int32 ExclusiveGroup = 0;
|
||||
uint32 RewardMailTemplateId = 0;
|
||||
uint32 RewardMailDelay = 0;
|
||||
uint32 RequiredSkillId = 0;
|
||||
uint32 RequiredSkillPoints = 0;
|
||||
uint32 RequiredMinRepFaction = 0;
|
||||
int32 RequiredMinRepValue = 0;
|
||||
uint32 RequiredMaxRepFaction = 0;
|
||||
int32 RequiredMaxRepValue = 0;
|
||||
uint32 SourceItemIdCount = 0;
|
||||
uint32 SpecialFlags = 0; // custom flags, not sniffed/WDB
|
||||
};
|
||||
|
||||
struct QuestStatusData
|
||||
|
||||
Reference in New Issue
Block a user