aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Quests
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-03-16 00:24:52 -0300
committerfunjoker <funjoker109@gmail.com>2020-04-24 17:18:48 +0200
commit4472a3cbf366f11b1c0d0eaa782e045c95f0254b (patch)
tree84c43388f5744dcc2382f6ab3f8fe004f0ec0cbe /src/server/game/Quests
parenta098b454b8292839ae246735cf27340b1080f190 (diff)
Core/Globals: Fix Quest codestyle and member variable initialization
(cherry picked from commit 09701b0229f84e3c0b014f6a161f945f3d226d8b)
Diffstat (limited to 'src/server/game/Quests')
-rw-r--r--src/server/game/Quests/QuestDef.cpp211
-rw-r--r--src/server/game/Quests/QuestDef.h412
2 files changed, 301 insertions, 322 deletions
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp
index 92a039344a5..48f057bbd3f 100644
--- a/src/server/game/Quests/QuestDef.cpp
+++ b/src/server/game/Quests/QuestDef.cpp
@@ -27,43 +27,36 @@
Quest::Quest(Field* questRecord)
{
- EmoteOnIncomplete = 0;
- EmoteOnComplete = 0;
- _rewItemsCount = 0;
- _rewChoiceItemsCount = 0;
- _eventIdForQuest = 0;
- _rewCurrencyCount = 0;
-
- ID = questRecord[0].GetUInt32();
- Type = questRecord[1].GetUInt8();
- Level = questRecord[2].GetInt32();
- ScalingFactionGroup = questRecord[3].GetInt32();
- MaxScalingLevel = questRecord[4].GetInt32();
- PackageID = questRecord[5].GetUInt32();
- MinLevel = questRecord[6].GetInt32();
- QuestSortID = questRecord[7].GetInt16();
- QuestInfoID = questRecord[8].GetUInt16();
- SuggestedPlayers = questRecord[9].GetUInt8();
- NextQuestInChain = questRecord[10].GetUInt32();
- RewardXPDifficulty = questRecord[11].GetUInt32();
- RewardXPMultiplier = questRecord[12].GetFloat();
- RewardMoney = questRecord[13].GetUInt32();
- RewardMoneyDifficulty = questRecord[14].GetUInt32();
- RewardMoneyMultiplier = questRecord[15].GetFloat();
- RewardBonusMoney = questRecord[16].GetUInt32();
+ _id = questRecord[0].GetUInt32();
+ _type = questRecord[1].GetUInt8();
+ _level = questRecord[2].GetInt32();
+ _scalingFactionGroup = questRecord[3].GetInt32();
+ _maxScalingLevel = questRecord[4].GetInt32();
+ _packageID = questRecord[5].GetUInt32();
+ _minLevel = questRecord[6].GetInt32();
+ _questSortID = questRecord[7].GetInt16();
+ _questInfoID = questRecord[8].GetUInt16();
+ _suggestedPlayers = questRecord[9].GetUInt8();
+ _nextQuestInChain = questRecord[10].GetUInt32();
+ _rewardXPDifficulty = questRecord[11].GetUInt32();
+ _rewardXPMultiplier = questRecord[12].GetFloat();
+ _rewardMoney = questRecord[13].GetUInt32();
+ _rewardMoneyDifficulty = questRecord[14].GetUInt32();
+ _rewardMoneyMultiplier = questRecord[15].GetFloat();
+ _rewardBonusMoney = questRecord[16].GetUInt32();
for (uint32 i = 0; i < QUEST_REWARD_DISPLAY_SPELL_COUNT; ++i)
RewardDisplaySpell[i] = questRecord[17 + i].GetUInt32();
- RewardSpell = questRecord[20].GetUInt32();
- RewardHonor = questRecord[21].GetUInt32();
- RewardKillHonor = questRecord[22].GetUInt32();
- SourceItemId = questRecord[23].GetUInt32();
- RewardArtifactXPDifficulty = questRecord[24].GetUInt32();
- RewardArtifactXPMultiplier = questRecord[25].GetFloat();
- RewardArtifactCategoryID = questRecord[26].GetUInt32();
- Flags = questRecord[27].GetUInt32();
- FlagsEx = questRecord[28].GetUInt32();
- FlagsEx2 = questRecord[29].GetUInt32();
+ _rewardSpell = questRecord[20].GetUInt32();
+ _rewardHonor = questRecord[21].GetUInt32();
+ _rewardKillHonor = questRecord[22].GetUInt32();
+ _sourceItemId = questRecord[23].GetUInt32();
+ _rewardArtifactXPDifficulty = questRecord[24].GetUInt32();
+ _rewardArtifactXPMultiplier = questRecord[25].GetFloat();
+ _rewardArtifactCategoryID = questRecord[26].GetUInt32();
+ _flags = questRecord[27].GetUInt32();
+ _flagsEx = questRecord[28].GetUInt32();
+ _flagsEx2 = questRecord[29].GetUInt32();
for (uint32 i = 0; i < QUEST_ITEM_DROP_COUNT; ++i)
{
@@ -86,19 +79,19 @@ Quest::Quest(Field* questRecord)
++_rewChoiceItemsCount;
}
- POIContinent = questRecord[64].GetUInt32();
- POIx = questRecord[65].GetFloat();
- POIy = questRecord[66].GetFloat();
- POIPriority = questRecord[67].GetUInt32();
+ _poiContinent = questRecord[64].GetUInt32();
+ _poix = questRecord[65].GetFloat();
+ _poiy = questRecord[66].GetFloat();
+ _poiPriority = questRecord[67].GetUInt32();
- RewardTitleId = questRecord[68].GetUInt32();
- RewardArenaPoints = questRecord[69].GetUInt32();
- RewardSkillId = questRecord[70].GetUInt32();
- RewardSkillPoints = questRecord[71].GetUInt32();
+ _rewardTitleId = questRecord[68].GetUInt32();
+ _rewardArenaPoints = questRecord[69].GetUInt32();
+ _rewardSkillId = questRecord[70].GetUInt32();
+ _rewardSkillPoints = questRecord[71].GetUInt32();
- QuestGiverPortrait = questRecord[72].GetUInt32();
- QuestGiverPortraitMount = questRecord[73].GetUInt32();
- QuestTurnInPortrait = questRecord[74].GetUInt32();
+ _questGiverPortrait = questRecord[72].GetUInt32();
+ _questGiverPortraitMount = questRecord[73].GetUInt32();
+ _questTurnInPortrait = questRecord[74].GetUInt32();
for (uint32 i = 0; i < QUEST_REWARD_REPUTATIONS_COUNT; ++i)
{
@@ -108,7 +101,7 @@ Quest::Quest(Field* questRecord)
RewardFactionCapIn[i] = questRecord[78 + i * 4].GetUInt32();
}
- RewardReputationMask = questRecord[95].GetUInt32();
+ _rewardReputationMask = questRecord[95].GetUInt32();
for (uint32 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i)
{
@@ -119,33 +112,25 @@ Quest::Quest(Field* questRecord)
++_rewCurrencyCount;
}
- SoundAccept = questRecord[104].GetUInt32();
- SoundTurnIn = questRecord[105].GetUInt32();
- AreaGroupID = questRecord[106].GetUInt32();
- LimitTime = questRecord[107].GetUInt32();
- AllowableRaces.RawValue = questRecord[108].GetUInt64();
- TreasurePickerID = questRecord[109].GetInt32();
- Expansion = questRecord[110].GetInt32();
- ManagedWorldStateID = questRecord[111].GetInt32();
- QuestSessionBonus = questRecord[112].GetInt32();
-
- LogTitle = questRecord[113].GetString();
- LogDescription = questRecord[114].GetString();
- QuestDescription = questRecord[115].GetString();
- AreaDescription = questRecord[116].GetString();
- PortraitGiverText = questRecord[117].GetString();
- PortraitGiverName = questRecord[118].GetString();
- PortraitTurnInText = questRecord[119].GetString();
- PortraitTurnInName = questRecord[120].GetString();
- QuestCompletionLog = questRecord[121].GetString();
-
- for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i)
- {
- DetailsEmote[i] = 0;
- DetailsEmoteDelay[i] = 0;
- OfferRewardEmote[i] = 0;
- OfferRewardEmoteDelay[i] = 0;
- }
+ _soundAccept = questRecord[104].GetUInt32();
+ _soundTurnIn = questRecord[105].GetUInt32();
+ _areaGroupID = questRecord[106].GetUInt32();
+ _limitTime = questRecord[107].GetUInt32();
+ _allowableRaces.RawValue = questRecord[108].GetUInt64();
+ _treasurePickerID = questRecord[109].GetInt32();
+ _expansion = questRecord[110].GetInt32();
+ _managedWorldStateID = questRecord[111].GetInt32();
+ _questSessionBonus = questRecord[112].GetInt32();
+
+ _logTitle = questRecord[113].GetString();
+ _logDescription = questRecord[114].GetString();
+ _questDescription = questRecord[115].GetString();
+ _areaDescription = questRecord[116].GetString();
+ _portraitGiverText = questRecord[117].GetString();
+ _portraitGiverName = questRecord[118].GetString();
+ _portraitTurnInText = questRecord[119].GetString();
+ _portraitTurnInName = questRecord[120].GetString();
+ _questCompletionLog = questRecord[121].GetString();
}
void Quest::LoadQuestDetails(Field* fields)
@@ -167,18 +152,18 @@ void Quest::LoadQuestDetails(Field* fields)
void Quest::LoadQuestRequestItems(Field* fields)
{
- EmoteOnComplete = fields[1].GetUInt16();
- EmoteOnIncomplete = fields[2].GetUInt16();
+ _emoteOnComplete = fields[1].GetUInt16();
+ _emoteOnIncomplete = fields[2].GetUInt16();
- if (!sEmotesStore.LookupEntry(EmoteOnComplete))
- TC_LOG_ERROR("sql.sql", "Table `quest_request_items` has non-existing EmoteOnComplete (%u) set for quest %u.", EmoteOnComplete, fields[0].GetUInt32());
+ if (!sEmotesStore.LookupEntry(_emoteOnComplete))
+ TC_LOG_ERROR("sql.sql", "Table `quest_request_items` has non-existing EmoteOnComplete (%u) set for quest %u.", _emoteOnComplete, fields[0].GetUInt32());
- if (!sEmotesStore.LookupEntry(EmoteOnIncomplete))
- TC_LOG_ERROR("sql.sql", "Table `quest_request_items` has non-existing EmoteOnIncomplete (%u) set for quest %u.", EmoteOnIncomplete, fields[0].GetUInt32());
+ if (!sEmotesStore.LookupEntry(_emoteOnIncomplete))
+ TC_LOG_ERROR("sql.sql", "Table `quest_request_items` has non-existing EmoteOnIncomplete (%u) set for quest %u.", _emoteOnIncomplete, fields[0].GetUInt32());
- EmoteOnCompleteDelay = fields[3].GetUInt32();
- EmoteOnIncompleteDelay = fields[4].GetUInt32();
- RequestItemsText = fields[5].GetString();
+ _emoteOnCompleteDelay = fields[3].GetUInt32();
+ _emoteOnIncompleteDelay = fields[4].GetUInt32();
+ _requestItemsText = fields[5].GetString();
}
void Quest::LoadQuestOfferReward(Field* fields)
@@ -197,32 +182,32 @@ void Quest::LoadQuestOfferReward(Field* fields)
for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i)
OfferRewardEmoteDelay[i] = fields[5 + i].GetUInt32();
- OfferRewardText = fields[9].GetString();
+ _offerRewardText = fields[9].GetString();
}
void Quest::LoadQuestTemplateAddon(Field* fields)
{
- MaxLevel = fields[1].GetUInt8();
- AllowableClasses = 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();
- RewardMailSenderEntry = fields[16].GetUInt32();
- SpecialFlags = fields[17].GetUInt8();
- ScriptId = sObjectMgr->GetScriptId(fields[18].GetString());
-
- if (SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT)
- Flags |= QUEST_FLAGS_AUTO_ACCEPT;
+ _maxLevel = fields[1].GetUInt8();
+ _allowableClasses = 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();
+ _rewardMailSenderEntry = fields[16].GetUInt32();
+ _specialFlags = fields[17].GetUInt8();
+ _scriptId = sObjectMgr->GetScriptId(fields[18].GetString());
+
+ if (_specialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT)
+ _flags |= QUEST_FLAGS_AUTO_ACCEPT;
}
void Quest::LoadQuestObjective(Field* fields)
@@ -252,7 +237,7 @@ void Quest::LoadQuestObjectiveVisualEffect(Field* fields)
{
uint8 effectIndex = fields[3].GetUInt8();
if (effectIndex >= obj.VisualEffects.size())
- obj.VisualEffects.resize(effectIndex+1, 0);
+ obj.VisualEffects.resize(effectIndex + 1, 0);
obj.VisualEffects[effectIndex] = fields[4].GetInt32();
break;
@@ -266,20 +251,20 @@ uint32 Quest::XPValue(Player const* player) const
{
uint32 questLevel = player->GetQuestLevel(this);
QuestXPEntry const* questXp = sQuestXPStore.LookupEntry(questLevel);
- if (!questXp || RewardXPDifficulty >= 10)
+ if (!questXp || _rewardXPDifficulty >= 10)
return 0;
float multiplier = 1.0f;
if (questLevel != player->getLevel())
multiplier = sXpGameTable.GetRow(std::min<int32>(player->getLevel(), questLevel))->Divisor / sXpGameTable.GetRow(player->getLevel())->Divisor;
- int32 diffFactor = 2 * (questLevel + (Level == -1 ? 0 : 5) - player->getLevel()) + 10;
+ int32 diffFactor = 2 * (questLevel + (_level == -1 ? 0 : 5) - player->getLevel()) + 10;
if (diffFactor < 1)
diffFactor = 1;
else if (diffFactor > 10)
diffFactor = 10;
- uint32 xp = diffFactor * questXp->Difficulty[RewardXPDifficulty] * RewardXPMultiplier / 10 * multiplier;
+ uint32 xp = diffFactor * questXp->Difficulty[_rewardXPDifficulty] * _rewardXPMultiplier / 10 * multiplier;
if (xp <= 100)
xp = 5 * ((xp + 2) / 5);
else if (xp <= 500)
@@ -354,7 +339,7 @@ uint32 Quest::GetRewMoneyMaxLevel() const
return 0;
// Else, return the rewarded copper sum modified by the rate
- return uint32(RewardBonusMoney * sWorld->getRate(RATE_MONEY_MAX_LEVEL_QUEST));
+ return uint32(_rewardBonusMoney * sWorld->getRate(RATE_MONEY_MAX_LEVEL_QUEST));
}
bool Quest::IsAutoAccept() const
@@ -364,12 +349,12 @@ bool Quest::IsAutoAccept() const
bool Quest::IsAutoComplete() const
{
- return !sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_COMPLETE) && Type == QUEST_TYPE_AUTOCOMPLETE;
+ return !sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_COMPLETE) && _type == QUEST_TYPE_AUTOCOMPLETE;
}
bool Quest::IsRaidQuest(Difficulty difficulty) const
{
- switch (QuestInfoID)
+ switch (_questInfoID)
{
case QUEST_INFO_RAID:
return true;
@@ -381,7 +366,7 @@ bool Quest::IsRaidQuest(Difficulty difficulty) const
break;
}
- if ((Flags & QUEST_FLAGS_RAID) != 0)
+ if ((_flags & QUEST_FLAGS_RAID) != 0)
return true;
return false;
@@ -481,7 +466,7 @@ WorldPacket Quest::BuildQueryData(LocaleConstant loc) const
response.Info.RewardXPMultiplier = GetXPMultiplier();
if (!HasFlag(QUEST_FLAGS_HIDDEN_REWARDS))
- response.Info.RewardMoney = RewardMoney;
+ response.Info.RewardMoney = GetRewMoney();
response.Info.RewardMoneyDifficulty = GetRewMoneyDifficulty();
response.Info.RewardMoneyMultiplier = GetMoneyMultiplier();
diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h
index aefd9509f6b..015bc10e8bf 100644
--- a/src/server/game/Quests/QuestDef.h
+++ b/src/server/game/Quests/QuestDef.h
@@ -357,107 +357,131 @@ class TC_GAME_API Quest
uint32 XPValue(Player const* player) const;
uint32 MoneyValue(Player const* player) const;
- bool HasFlag(QuestFlags flag) const { return (Flags & uint32(flag)) != 0; }
- bool HasFlagEx(QuestFlagsEx flag) const { return (FlagsEx & uint32(flag)) != 0; }
- bool HasFlagEx2(QuestFlagsEx2 flag) const { return (FlagsEx2 & uint32(flag)) != 0; }
+ bool HasFlag(QuestFlags flag) const { return (_flags & uint32(flag)) != 0; }
+ bool HasFlagEx(QuestFlagsEx flag) const { return (_flagsEx & uint32(flag)) != 0; }
+ bool HasFlagEx2(QuestFlagsEx2 flag) const { return (_flagsEx2 & uint32(flag)) != 0; }
- bool HasSpecialFlag(uint32 flag) const { return (SpecialFlags & flag) != 0; }
- void SetSpecialFlag(uint32 flag) { SpecialFlags |= flag; }
+ bool HasSpecialFlag(uint32 flag) const { return (_specialFlags & flag) != 0; }
+ void SetSpecialFlag(uint32 flag) { _specialFlags |= flag; }
// table data accessors:
- uint32 GetQuestId() const { return ID; }
- uint32 GetQuestType() const { return Type; }
- uint32 GetQuestPackageID() const { return PackageID; }
- int32 GetZoneOrSort() const { return QuestSortID; }
- int32 GetMinLevel() const { return MinLevel; }
- uint32 GetMaxLevel() const { return MaxLevel; }
- int32 GetQuestLevel() const { return Level; }
- int32 GetQuestScalingFactionGroup() const { return ScalingFactionGroup; }
- int32 GetQuestMaxScalingLevel() const { return MaxScalingLevel; }
- uint32 GetQuestInfoID() const { return QuestInfoID; }
- uint32 GetAllowableClasses() const { return AllowableClasses; }
- Trinity::RaceMask<uint64> GetAllowableRaces() const { return AllowableRaces; }
- uint32 GetRequiredSkill() const { return RequiredSkillId; }
- uint32 GetRequiredSkillValue() const { return RequiredSkillPoints; }
- uint32 GetRequiredMinRepFaction() const { return RequiredMinRepFaction; }
- int32 GetRequiredMinRepValue() const { return RequiredMinRepValue; }
- uint32 GetRequiredMaxRepFaction() const { return RequiredMaxRepFaction; }
- int32 GetRequiredMaxRepValue() const { return RequiredMaxRepValue; }
- uint32 GetSuggestedPlayers() const { return SuggestedPlayers; }
- uint32 GetLimitTime() const { return LimitTime; }
- int32 GetPrevQuestId() const { return PrevQuestID; }
- int32 GetNextQuestId() const { return NextQuestID; }
- int32 GetExclusiveGroup() const { return ExclusiveGroup; }
- uint32 GetNextQuestInChain() const { return NextQuestInChain; }
- int32 GetRewArenaPoints() const {return RewardArenaPoints; }
- uint32 GetXPDifficulty() const { return RewardXPDifficulty; }
- float GetXPMultiplier() const { return RewardXPMultiplier; }
- float GetMoneyMultiplier() const { return RewardMoneyMultiplier; }
- uint32 GetSrcItemId() const { return SourceItemId; }
- uint32 GetSrcItemCount() const { return SourceItemIdCount; }
- uint32 GetSrcSpell() const { return SourceSpellID; }
- std::string const& GetLogTitle() const { return LogTitle; }
- std::string const& GetLogDescription() const { return LogDescription; }
- std::string const& GetQuestDescription() const { return QuestDescription; }
- std::string const& GetAreaDescription() const { return AreaDescription; }
- std::string const& GetOfferRewardText() const { return OfferRewardText; }
- std::string const& GetRequestItemsText() const { return RequestItemsText; }
- std::string const& GetQuestCompletionLog() const { return QuestCompletionLog; }
- std::string const& GetPortraitGiverText() const { return PortraitGiverText; }
- std::string const& GetPortraitGiverName() const { return PortraitGiverName; }
- std::string const& GetPortraitTurnInText() const { return PortraitTurnInText; }
- std::string const& GetPortraitTurnInName() const { return PortraitTurnInName; }
+ uint32 GetQuestId() const { return _id; }
+ uint32 GetQuestType() const { return _type; }
+ uint32 GetQuestPackageID() const { return _packageID; }
+ int32 GetZoneOrSort() const { return _questSortID; }
+ int32 GetMinLevel() const { return _minLevel; }
+ uint32 GetMaxLevel() const { return _maxLevel; }
+ int32 GetQuestLevel() const { return _level; }
+ int32 GetQuestScalingFactionGroup() const { return _scalingFactionGroup; }
+ int32 GetQuestMaxScalingLevel() const { return _maxScalingLevel; }
+ uint32 GetQuestInfoID() const { return _questInfoID; }
+ uint32 GetAllowableClasses() const { return _allowableClasses; }
+ Trinity::RaceMask<uint64> GetAllowableRaces() const { return _allowableRaces; }
+ uint32 GetRequiredSkill() const { return _requiredSkillId; }
+ uint32 GetRequiredSkillValue() const { return _requiredSkillPoints; }
+ uint32 GetRequiredMinRepFaction() const { return _requiredMinRepFaction; }
+ int32 GetRequiredMinRepValue() const { return _requiredMinRepValue; }
+ uint32 GetRequiredMaxRepFaction() const { return _requiredMaxRepFaction; }
+ int32 GetRequiredMaxRepValue() const { return _requiredMaxRepValue; }
+ uint32 GetSuggestedPlayers() const { return _suggestedPlayers; }
+ uint32 GetLimitTime() const { return _limitTime; }
+ int32 GetPrevQuestId() const { return _prevQuestID; }
+ int32 GetNextQuestId() const { return _nextQuestID; }
+ int32 GetExclusiveGroup() const { return _exclusiveGroup; }
+ uint32 GetNextQuestInChain() const { return _nextQuestInChain; }
+ int32 GetRewArenaPoints() const {return _rewardArenaPoints; }
+ uint32 GetXPDifficulty() const { return _rewardXPDifficulty; }
+ float GetXPMultiplier() const { return _rewardXPMultiplier; }
+ float GetMoneyMultiplier() const { return _rewardMoneyMultiplier; }
+ uint32 GetSrcItemId() const { return _sourceItemId; }
+ uint32 GetSrcItemCount() const { return _sourceItemIdCount; }
+ uint32 GetSrcSpell() const { return _sourceSpellID; }
+ std::string const& GetLogTitle() const { return _logTitle; }
+ std::string const& GetLogDescription() const { return _logDescription; }
+ std::string const& GetQuestDescription() const { return _questDescription; }
+ std::string const& GetAreaDescription() const { return _areaDescription; }
+ std::string const& GetOfferRewardText() const { return _offerRewardText; }
+ std::string const& GetRequestItemsText() const { return _requestItemsText; }
+ std::string const& GetQuestCompletionLog() const { return _questCompletionLog; }
+ std::string const& GetPortraitGiverText() const { return _portraitGiverText; }
+ std::string const& GetPortraitGiverName() const { return _portraitGiverName; }
+ std::string const& GetPortraitTurnInText() const { return _portraitTurnInText; }
+ std::string const& GetPortraitTurnInName() const { return _portraitTurnInName; }
QuestObjectives const& GetObjectives() const { return Objectives; }
- uint32 GetRewMoneyDifficulty() const { return RewardMoneyDifficulty; }
- uint32 GetRewHonor() const { return RewardHonor; }
- uint32 GetRewKillHonor() const { return RewardKillHonor; }
- uint32 GetArtifactXPDifficulty() const { return RewardArtifactXPDifficulty; }
- float GetArtifactXPMultiplier() const { return RewardArtifactXPMultiplier; }
- uint32 GetArtifactCategoryId() const { return RewardArtifactCategoryID; }
+ uint32 GetRewMoney() const { return _rewardMoney; }
+ uint32 GetRewMoneyDifficulty() const { return _rewardMoneyDifficulty; }
+ uint32 GetRewHonor() const { return _rewardHonor; }
+ uint32 GetRewKillHonor() const { return _rewardKillHonor; }
+ uint32 GetArtifactXPDifficulty() const { return _rewardArtifactXPDifficulty; }
+ float GetArtifactXPMultiplier() const { return _rewardArtifactXPMultiplier; }
+ uint32 GetArtifactCategoryId() const { return _rewardArtifactCategoryID; }
uint32 GetRewMoneyMaxLevel() const; // use in XP calculation at client
- uint32 GetRewSpell() const { return RewardSpell; }
- uint32 GetRewMailTemplateId() const { return RewardMailTemplateId; }
- uint32 GetRewMailDelaySecs() const { return RewardMailDelay; }
- uint32 GetRewMailSenderEntry() const { return RewardMailSenderEntry; }
- uint32 GetRewTitle() const { return RewardTitleId; }
- uint32 GetPOIContinent() const { return POIContinent; }
- float GetPOIx() const { return POIx; }
- float GetPOIy() const { return POIy; }
- uint32 GetPOIPriority() const { return POIPriority; }
- uint32 GetSoundAccept() const { return SoundAccept; }
- uint32 GetSoundTurnIn() const { return SoundTurnIn; }
- uint32 GetIncompleteEmote() const { return EmoteOnIncomplete; }
- uint32 GetCompleteEmote() const { return EmoteOnComplete; }
- bool IsRepeatable() const { return SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE; }
+ uint32 GetRewSpell() const { return _rewardSpell; }
+ uint32 GetRewMailTemplateId() const { return _rewardMailTemplateId; }
+ uint32 GetRewMailDelaySecs() const { return _rewardMailDelay; }
+ uint32 GetRewMailSenderEntry() const { return _rewardMailSenderEntry; }
+ uint32 GetRewTitle() const { return _rewardTitleId; }
+ uint32 GetPOIContinent() const { return _poiContinent; }
+ float GetPOIx() const { return _poix; }
+ float GetPOIy() const { return _poiy; }
+ uint32 GetPOIPriority() const { return _poiPriority; }
+ uint32 GetSoundAccept() const { return _soundAccept; }
+ uint32 GetSoundTurnIn() const { return _soundTurnIn; }
+ uint32 GetIncompleteEmote() const { return _emoteOnIncomplete; }
+ uint32 GetCompleteEmote() const { return _emoteOnComplete; }
+ uint32 GetIncompleteEmoteDelay() const { return _emoteOnIncompleteDelay; }
+ uint32 GetCompleteEmoteDelay() const { return _emoteOnCompleteDelay; }
+ bool IsRepeatable() const { return _specialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE; }
bool IsAutoAccept() const;
bool IsAutoComplete() const;
- uint32 GetFlags() const { return Flags; }
- uint32 GetFlagsEx() const { return FlagsEx; }
- uint32 GetFlagsEx2() const { return FlagsEx2; }
- uint32 GetSpecialFlags() const { return SpecialFlags; }
- uint32 GetScriptId() const { return ScriptId; }
- uint32 GetAreaGroupID() const { return AreaGroupID; }
- uint32 GetRewardSkillId() const { return RewardSkillId; }
- uint32 GetRewardSkillPoints() const { return RewardSkillPoints; }
- uint32 GetRewardReputationMask() const { return RewardReputationMask; }
- int32 GetTreasurePickerId() const { return TreasurePickerID; }
- int32 GetExpansion() const { return Expansion; }
- int32 GetManagedWorldStateId() const { return ManagedWorldStateID; }
- int32 GetQuestSessionBonus() const { return QuestSessionBonus; }
- uint32 GetQuestGiverPortrait() const { return QuestGiverPortrait; }
- int32 GetQuestGiverPortraitMount() const { return QuestGiverPortraitMount; }
- uint32 GetQuestTurnInPortrait() const { return QuestTurnInPortrait; }
- bool IsDaily() const { return (Flags & QUEST_FLAGS_DAILY) != 0; }
- bool IsWeekly() const { return (Flags & QUEST_FLAGS_WEEKLY) != 0; }
- bool IsMonthly() const { return (SpecialFlags & QUEST_SPECIAL_FLAGS_MONTHLY) != 0; }
- bool IsSeasonal() const { return (QuestSortID == -QUEST_SORT_SEASONAL || QuestSortID == -QUEST_SORT_SPECIAL || QuestSortID == -QUEST_SORT_LUNAR_FESTIVAL || QuestSortID == -QUEST_SORT_MIDSUMMER || QuestSortID == -QUEST_SORT_BREWFEST || QuestSortID == -QUEST_SORT_LOVE_IS_IN_THE_AIR || QuestSortID == -QUEST_SORT_NOBLEGARDEN) && !IsRepeatable(); }
- bool IsDailyOrWeekly() const { return (Flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY)) != 0; }
+ uint32 GetFlags() const { return _flags; }
+ uint32 GetFlagsEx() const { return _flagsEx; }
+ uint32 GetFlagsEx2() const { return _flagsEx2; }
+ uint32 GetSpecialFlags() const { return _specialFlags; }
+ uint32 GetScriptId() const { return _scriptId; }
+ uint32 GetAreaGroupID() const { return _areaGroupID; }
+ uint32 GetRewardSkillId() const { return _rewardSkillId; }
+ uint32 GetRewardSkillPoints() const { return _rewardSkillPoints; }
+ uint32 GetRewardReputationMask() const { return _rewardReputationMask; }
+ int32 GetTreasurePickerId() const { return _treasurePickerID; }
+ int32 GetExpansion() const { return _expansion; }
+ int32 GetManagedWorldStateId() const { return _managedWorldStateID; }
+ int32 GetQuestSessionBonus() const { return _questSessionBonus; }
+ uint32 GetQuestGiverPortrait() const { return _questGiverPortrait; }
+ int32 GetQuestGiverPortraitMount() const { return _questGiverPortraitMount; }
+ uint32 GetQuestTurnInPortrait() const { return _questTurnInPortrait; }
+ bool IsDaily() const { return (_flags & QUEST_FLAGS_DAILY) != 0; }
+ bool IsWeekly() const { return (_flags & QUEST_FLAGS_WEEKLY) != 0; }
+ bool IsMonthly() const { return (_specialFlags & QUEST_SPECIAL_FLAGS_MONTHLY) != 0; }
+ bool IsSeasonal() const { return (_questSortID == -QUEST_SORT_SEASONAL || _questSortID == -QUEST_SORT_SPECIAL || _questSortID == -QUEST_SORT_LUNAR_FESTIVAL || _questSortID == -QUEST_SORT_MIDSUMMER || _questSortID == -QUEST_SORT_BREWFEST || _questSortID == -QUEST_SORT_LOVE_IS_IN_THE_AIR || _questSortID == -QUEST_SORT_NOBLEGARDEN) && !IsRepeatable(); }
+ bool IsDailyOrWeekly() const { return (_flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY)) != 0; }
bool IsRaidQuest(Difficulty difficulty) const;
bool IsAllowedInRaid(Difficulty difficulty) const;
- bool IsDFQuest() const { return (SpecialFlags & QUEST_SPECIAL_FLAGS_DF_QUEST) != 0; }
+ bool IsDFQuest() const { return (_specialFlags & QUEST_SPECIAL_FLAGS_DF_QUEST) != 0; }
uint32 CalculateHonorGain(uint8 level) const;
bool CanIncreaseRewardedQuestCounters() const;
+ // multiple values
+ uint32 RewardDisplaySpell[QUEST_REWARD_DISPLAY_SPELL_COUNT] = { };
+ uint32 RewardItemId[QUEST_REWARD_ITEM_COUNT] = { };
+ uint32 RewardItemCount[QUEST_REWARD_ITEM_COUNT] = { };
+ uint32 ItemDrop[QUEST_ITEM_DROP_COUNT] = { };
+ uint32 ItemDropQuantity[QUEST_ITEM_DROP_COUNT] = { };
+ uint32 RewardChoiceItemId[QUEST_REWARD_CHOICES_COUNT] = { };
+ uint32 RewardChoiceItemCount[QUEST_REWARD_CHOICES_COUNT] = { };
+ uint32 RewardChoiceItemDisplayId[QUEST_REWARD_CHOICES_COUNT] = { };
+ uint32 RewardFactionId[QUEST_REWARD_REPUTATIONS_COUNT] = { };
+ int32 RewardFactionValue[QUEST_REWARD_REPUTATIONS_COUNT] = { };
+ int32 RewardFactionOverride[QUEST_REWARD_REPUTATIONS_COUNT] = { };
+ uint32 RewardFactionCapIn[QUEST_REWARD_REPUTATIONS_COUNT] = { };
+ uint32 RewardCurrencyId[QUEST_REWARD_CURRENCY_COUNT] = { };
+ uint32 RewardCurrencyCount[QUEST_REWARD_CURRENCY_COUNT] = { };
+ QuestObjectives Objectives = { };
+ uint32 DetailsEmote[QUEST_EMOTE_COUNT] = { };
+ uint32 DetailsEmoteDelay[QUEST_EMOTE_COUNT] = { };
+ uint32 OfferRewardEmote[QUEST_EMOTE_COUNT] = { };
+ uint32 OfferRewardEmoteDelay[QUEST_EMOTE_COUNT] = { };
+
uint32 GetRewChoiceItemsCount() const { return _rewChoiceItemsCount; }
uint32 GetRewItemsCount() const { return _rewItemsCount; }
uint32 GetRewCurrencyCount() const { return _rewCurrencyCount; }
@@ -471,141 +495,111 @@ class TC_GAME_API Quest
void BuildQuestRewards(WorldPackets::Quest::QuestRewards& rewards, Player* player) const;
- typedef std::vector<int32> PrevQuests;
- PrevQuests prevQuests;
- typedef std::vector<uint32> PrevChainQuests;
- PrevChainQuests prevChainQuests;
+ std::vector<int32> PrevQuests;
+ std::vector<uint32> PrevChainQuests;
WorldPacket QueryData[TOTAL_LOCALES];
private:
- uint32 _rewChoiceItemsCount;
- uint32 _rewItemsCount;
- uint16 _eventIdForQuest;
- uint32 _rewCurrencyCount;
+ uint32 _rewChoiceItemsCount = 0;
+ uint32 _rewItemsCount = 0;
+ uint16 _eventIdForQuest = 0;
+ uint32 _rewCurrencyCount = 0;
- public:
// wdb data (quest query response)
- uint32 ID;
- uint32 Type;
- int32 Level;
- int32 ScalingFactionGroup;
- int32 MaxScalingLevel;
- uint32 PackageID;
- int32 MinLevel;
- int32 QuestSortID;
- uint32 QuestInfoID;
- uint32 SuggestedPlayers;
- uint32 NextQuestInChain;
- uint32 RewardXPDifficulty;
- float RewardXPMultiplier;
- int32 RewardMoney;
- uint32 RewardMoneyDifficulty;
- float RewardMoneyMultiplier;
- uint32 RewardBonusMoney;
- uint32 RewardDisplaySpell[QUEST_REWARD_DISPLAY_SPELL_COUNT];
- uint32 RewardSpell;
- uint32 RewardHonor;
- uint32 RewardKillHonor;
- uint32 RewardArtifactXPDifficulty;
- float RewardArtifactXPMultiplier;
- uint32 RewardArtifactCategoryID;
- uint32 SourceItemId;
- uint32 Flags;
- uint32 FlagsEx;
- uint32 FlagsEx2;
- uint32 RewardItemId[QUEST_REWARD_ITEM_COUNT];
- uint32 RewardItemCount[QUEST_REWARD_ITEM_COUNT];
- uint32 ItemDrop[QUEST_ITEM_DROP_COUNT];
- uint32 ItemDropQuantity[QUEST_ITEM_DROP_COUNT];
- uint32 RewardChoiceItemId[QUEST_REWARD_CHOICES_COUNT];
- uint32 RewardChoiceItemCount[QUEST_REWARD_CHOICES_COUNT];
- uint32 RewardChoiceItemDisplayId[QUEST_REWARD_CHOICES_COUNT];
- uint32 POIContinent;
- float POIx;
- float POIy;
- uint32 POIPriority;
- uint32 RewardTitleId;
- int32 RewardArenaPoints;
- uint32 RewardSkillId;
- uint32 RewardSkillPoints;
- uint32 QuestGiverPortrait;
- int32 QuestGiverPortraitMount;
- uint32 QuestTurnInPortrait;
- uint32 RewardFactionId[QUEST_REWARD_REPUTATIONS_COUNT];
- int32 RewardFactionValue[QUEST_REWARD_REPUTATIONS_COUNT];
- int32 RewardFactionOverride[QUEST_REWARD_REPUTATIONS_COUNT];
- uint32 RewardFactionCapIn[QUEST_REWARD_REPUTATIONS_COUNT];
- uint32 RewardReputationMask;
- uint32 RewardCurrencyId[QUEST_REWARD_CURRENCY_COUNT];
- uint32 RewardCurrencyCount[QUEST_REWARD_CURRENCY_COUNT];
- uint32 SoundAccept;
- uint32 SoundTurnIn;
- uint32 AreaGroupID;
- uint32 LimitTime;
- Trinity::RaceMask<uint64> AllowableRaces;
- int32 TreasurePickerID;
- int32 Expansion;
- int32 ManagedWorldStateID;
- int32 QuestSessionBonus;
- QuestObjectives Objectives;
- std::string LogTitle;
- std::string LogDescription;
- std::string QuestDescription;
- std::string AreaDescription;
- std::string PortraitGiverText;
- std::string PortraitGiverName;
- std::string PortraitTurnInText;
- std::string PortraitTurnInName;
- std::string QuestCompletionLog;
-
- protected:
-
- // quest_detais table
- uint32 DetailsEmote[QUEST_EMOTE_COUNT] = { };
- uint32 DetailsEmoteDelay[QUEST_EMOTE_COUNT] = { };
+ uint32 _id = 0;
+ uint32 _type = 0;
+ int32 _level = 0;
+ int32 _scalingFactionGroup = 0;
+ int32 _maxScalingLevel = 0;
+ uint32 _packageID = 0;
+ int32 _minLevel = 0;
+ int32 _questSortID = 0;
+ uint32 _questInfoID = 0;
+ uint32 _suggestedPlayers = 0;
+ uint32 _nextQuestInChain = 0;
+ uint32 _rewardXPDifficulty = 0;
+ float _rewardXPMultiplier = 0.f;
+ int32 _rewardMoney = 0;
+ uint32 _rewardMoneyDifficulty = 0;
+ float _rewardMoneyMultiplier = 0.f;
+ uint32 _rewardBonusMoney = 0;
+ uint32 _rewardSpell = 0;
+ uint32 _rewardHonor = 0;
+ uint32 _rewardKillHonor = 0;
+ uint32 _rewardArtifactXPDifficulty = 0;
+ float _rewardArtifactXPMultiplier = 0.f;
+ uint32 _rewardArtifactCategoryID = 0;
+ uint32 _sourceItemId = 0;
+ uint32 _flags = 0;
+ uint32 _flagsEx = 0;
+ uint32 _flagsEx2 = 0;
+ uint32 _poiContinent = 0;
+ float _poix = 0.f;
+ float _poiy = 0.f;
+ uint32 _poiPriority = 0;
+ uint32 _rewardTitleId = 0;
+ int32 _rewardArenaPoints = 0;
+ uint32 _rewardSkillId = 0;
+ uint32 _rewardSkillPoints = 0;
+ uint32 _questGiverPortrait = 0;
+ int32 _questGiverPortraitMount = 0;
+ uint32 _questTurnInPortrait = 0;
+ uint32 _rewardReputationMask;
+ uint32 _soundAccept = 0;
+ uint32 _soundTurnIn = 0;
+ uint32 _areaGroupID = 0;
+ uint32 _limitTime = 0;
+ Trinity::RaceMask<uint64> _allowableRaces;
+ int32 _treasurePickerID = 0;
+ int32 _expansion = 0;
+ int32 _managedWorldStateID = 0;
+ int32 _questSessionBonus = 0;
+ std::string _logTitle;
+ std::string _logDescription;
+ std::string _questDescription;
+ std::string _areaDescription;
+ std::string _portraitGiverText;
+ std::string _portraitGiverName;
+ std::string _portraitTurnInText;
+ std::string _portraitTurnInName;
+ std::string _questCompletionLog;
// quest_request_items table
- uint32 EmoteOnComplete = 0;
- uint32 EmoteOnIncomplete = 0;
- uint32 EmoteOnCompleteDelay = 0;
- uint32 EmoteOnIncompleteDelay = 0;
- std::string RequestItemsText;
+ uint32 _emoteOnComplete = 0;
+ uint32 _emoteOnIncomplete = 0;
+ uint32 _emoteOnCompleteDelay = 0;
+ uint32 _emoteOnIncompleteDelay = 0;
+ std::string _requestItemsText;
// quest_offer_reward table
- uint32 OfferRewardEmote[QUEST_EMOTE_COUNT] = { };
- uint32 OfferRewardEmoteDelay[QUEST_EMOTE_COUNT] = { };
- std::string OfferRewardText;
+ std::string _offerRewardText;
// quest_template_addon table (custom data)
- uint32 MaxLevel = 0;
- uint32 AllowableClasses = 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 RewardMailSenderEntry = 0;
- uint32 SpecialFlags = 0; // custom flags, not sniffed/WDB
- uint32 ScriptId = 0;
+ uint32 _maxLevel = 0;
+ uint32 _allowableClasses = 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 _rewardMailSenderEntry = 0;
+ uint32 _specialFlags = 0; // custom flags, not sniffed/WDB
+ uint32 _scriptId = 0;
};
struct QuestStatusData
{
- QuestStatusData(): Status(QUEST_STATUS_NONE), Timer(0)
- {
- }
-
- QuestStatus Status;
- uint32 Timer;
- std::vector<int32> ObjectiveData;
+ QuestStatus Status = QUEST_STATUS_NONE;
+ uint32 Timer = 0;
+ std::vector<int32> ObjectiveData = { };
};
#endif