mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Globals: Fix Quest codestyle and member variable initialization
(cherry picked from commit 09701b0229)
This commit is contained in:
@@ -598,13 +598,13 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, ObjectGuid npcGU
|
||||
|
||||
if (canComplete)
|
||||
{
|
||||
packet.CompEmoteDelay = quest->EmoteOnCompleteDelay;
|
||||
packet.CompEmoteType = quest->EmoteOnComplete;
|
||||
packet.CompEmoteDelay = quest->GetCompleteEmoteDelay();
|
||||
packet.CompEmoteType = quest->GetCompleteEmote();
|
||||
}
|
||||
else
|
||||
{
|
||||
packet.CompEmoteDelay = quest->EmoteOnIncompleteDelay;
|
||||
packet.CompEmoteType = quest->EmoteOnIncomplete;
|
||||
packet.CompEmoteDelay = quest->GetIncompleteEmoteDelay();
|
||||
packet.CompEmoteType = quest->GetIncompleteEmote();
|
||||
}
|
||||
|
||||
packet.QuestFlags[0] = quest->GetFlags();
|
||||
|
||||
@@ -16088,10 +16088,10 @@ bool Player::SatisfyQuestLog(bool msg) const
|
||||
bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg)
|
||||
{
|
||||
// No previous quest (might be first quest in a series)
|
||||
if (qInfo->prevQuests.empty())
|
||||
if (qInfo->PrevQuests.empty())
|
||||
return true;
|
||||
|
||||
for (Quest::PrevQuests::const_iterator iter = qInfo->prevQuests.begin(); iter != qInfo->prevQuests.end(); ++iter)
|
||||
for (auto iter = qInfo->PrevQuests.begin(); iter != qInfo->PrevQuests.end(); ++iter)
|
||||
{
|
||||
uint32 prevId = abs(*iter);
|
||||
|
||||
@@ -16393,10 +16393,10 @@ bool Player::SatisfyQuestNextChain(Quest const* qInfo, bool msg) const
|
||||
bool Player::SatisfyQuestPrevChain(Quest const* qInfo, bool msg)
|
||||
{
|
||||
// No previous quest in chain
|
||||
if (qInfo->prevChainQuests.empty())
|
||||
if (qInfo->PrevChainQuests.empty())
|
||||
return true;
|
||||
|
||||
for (Quest::PrevChainQuests::const_iterator iter = qInfo->prevChainQuests.begin(); iter != qInfo->prevChainQuests.end(); ++iter)
|
||||
for (auto iter = qInfo->PrevChainQuests.begin(); iter != qInfo->PrevChainQuests.end(); ++iter)
|
||||
{
|
||||
QuestStatusMap::const_iterator itr = m_QuestStatus.find(*iter);
|
||||
|
||||
|
||||
@@ -4103,223 +4103,223 @@ void ObjectMgr::LoadQuests()
|
||||
if (qinfo->GetQuestType() >= MAX_QUEST_TYPES)
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestType());
|
||||
|
||||
if (qinfo->SpecialFlags & ~QUEST_SPECIAL_FLAGS_DB_ALLOWED)
|
||||
if (qinfo->_specialFlags & ~QUEST_SPECIAL_FLAGS_DB_ALLOWED)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u",
|
||||
qinfo->GetQuestId(), qinfo->SpecialFlags, QUEST_SPECIAL_FLAGS_DB_ALLOWED);
|
||||
qinfo->SpecialFlags &= QUEST_SPECIAL_FLAGS_DB_ALLOWED;
|
||||
qinfo->GetQuestId(), qinfo->_specialFlags, QUEST_SPECIAL_FLAGS_DB_ALLOWED);
|
||||
qinfo->_specialFlags &= QUEST_SPECIAL_FLAGS_DB_ALLOWED;
|
||||
}
|
||||
|
||||
if (qinfo->Flags & QUEST_FLAGS_DAILY && qinfo->Flags & QUEST_FLAGS_WEEKLY)
|
||||
if (qinfo->_flags & QUEST_FLAGS_DAILY && qinfo->_flags & QUEST_FLAGS_WEEKLY)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Weekly Quest %u is marked as daily quest in `Flags`, removed daily flag.", qinfo->GetQuestId());
|
||||
qinfo->Flags &= ~QUEST_FLAGS_DAILY;
|
||||
qinfo->_flags &= ~QUEST_FLAGS_DAILY;
|
||||
}
|
||||
|
||||
if (qinfo->Flags & QUEST_FLAGS_DAILY)
|
||||
if (qinfo->_flags & QUEST_FLAGS_DAILY)
|
||||
{
|
||||
if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE))
|
||||
if (!(qinfo->_specialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE))
|
||||
{
|
||||
TC_LOG_DEBUG("sql.sql", "Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
|
||||
qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE;
|
||||
qinfo->_specialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE;
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->Flags & QUEST_FLAGS_WEEKLY)
|
||||
if (qinfo->_flags & QUEST_FLAGS_WEEKLY)
|
||||
{
|
||||
if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE))
|
||||
if (!(qinfo->_specialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE))
|
||||
{
|
||||
TC_LOG_DEBUG("sql.sql", "Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
|
||||
qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE;
|
||||
qinfo->_specialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE;
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_MONTHLY)
|
||||
if (qinfo->_specialFlags & QUEST_SPECIAL_FLAGS_MONTHLY)
|
||||
{
|
||||
if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE))
|
||||
if (!(qinfo->_specialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE))
|
||||
{
|
||||
TC_LOG_DEBUG("sql.sql", "Monthly quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
|
||||
qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE;
|
||||
qinfo->_specialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE;
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->Flags & QUEST_FLAGS_TRACKING)
|
||||
if (qinfo->_flags & QUEST_FLAGS_TRACKING)
|
||||
{
|
||||
// at auto-reward can be rewarded only RewardChoiceItemId[0]
|
||||
for (int j = 1; j < QUEST_REWARD_CHOICES_COUNT; ++j )
|
||||
for (uint32 j = 1; j < QUEST_REWARD_CHOICES_COUNT; ++j )
|
||||
{
|
||||
if (uint32 id = qinfo->RewardChoiceItemId[j])
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RewardChoiceItemId%d` = %u but item from `RewardChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_TRACKING.",
|
||||
qinfo->GetQuestId(), j+1, id, j+1);
|
||||
qinfo->GetQuestId(), j + 1, id, j + 1);
|
||||
// no changes, quest ignore this data
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->MinLevel == -1 || qinfo->MinLevel > DEFAULT_MAX_LEVEL)
|
||||
if (qinfo->_minLevel == -1 || qinfo->_minLevel > DEFAULT_MAX_LEVEL)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u should be disabled because `MinLevel` = %i", qinfo->GetQuestId(), int32(qinfo->MinLevel));
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u should be disabled because `MinLevel` = %i", qinfo->GetQuestId(), int32(qinfo->_minLevel));
|
||||
// no changes needed, sending -1 in SMSG_QUEST_QUERY_RESPONSE is valid
|
||||
}
|
||||
|
||||
// client quest log visual (area case)
|
||||
if (qinfo->QuestSortID > 0)
|
||||
if (qinfo->_questSortID > 0)
|
||||
{
|
||||
if (!sAreaTableStore.LookupEntry(qinfo->QuestSortID))
|
||||
if (!sAreaTableStore.LookupEntry(qinfo->_questSortID))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `QuestSortID` = %u (zone case) but zone with this id does not exist.",
|
||||
qinfo->GetQuestId(), qinfo->QuestSortID);
|
||||
qinfo->GetQuestId(), qinfo->_questSortID);
|
||||
// no changes, quest not dependent from this value but can have problems at client
|
||||
}
|
||||
}
|
||||
// client quest log visual (sort case)
|
||||
if (qinfo->QuestSortID < 0)
|
||||
if (qinfo->_questSortID < 0)
|
||||
{
|
||||
QuestSortEntry const* qSort = sQuestSortStore.LookupEntry(-int32(qinfo->QuestSortID));
|
||||
QuestSortEntry const* qSort = sQuestSortStore.LookupEntry(-int32(qinfo->_questSortID));
|
||||
if (!qSort)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `QuestSortID` = %i (sort case) but quest sort with this id does not exist.",
|
||||
qinfo->GetQuestId(), qinfo->QuestSortID);
|
||||
qinfo->GetQuestId(), qinfo->_questSortID);
|
||||
// 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 RequiredSkillId value (skill case)
|
||||
if (uint32 skill_id = SkillByQuestSort(-int32(qinfo->QuestSortID)))
|
||||
if (uint32 skill_id = SkillByQuestSort(-int32(qinfo->_questSortID)))
|
||||
{
|
||||
if (qinfo->RequiredSkillId != skill_id)
|
||||
if (qinfo->_requiredSkillId != skill_id)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `QuestSortID` = %i but `RequiredSkillId` does not have a corresponding value (%d).",
|
||||
qinfo->GetQuestId(), qinfo->QuestSortID, skill_id);
|
||||
qinfo->GetQuestId(), qinfo->_questSortID, skill_id);
|
||||
//override, and force proper value here?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// AllowableClasses, can be 0/CLASSMASK_ALL_PLAYABLE to allow any class
|
||||
if (qinfo->AllowableClasses)
|
||||
if (qinfo->_allowableClasses)
|
||||
{
|
||||
if (!(qinfo->AllowableClasses & CLASSMASK_ALL_PLAYABLE))
|
||||
if (!(qinfo->_allowableClasses & CLASSMASK_ALL_PLAYABLE))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u does not contain any playable classes in `AllowableClasses` (%u), value set to 0 (all classes).", qinfo->GetQuestId(), qinfo->AllowableClasses);
|
||||
qinfo->AllowableClasses = 0;
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u does not contain any playable classes in `AllowableClasses` (%u), value set to 0 (all classes).", qinfo->GetQuestId(), qinfo->_allowableClasses);
|
||||
qinfo->_allowableClasses = 0;
|
||||
}
|
||||
}
|
||||
// AllowableRaces, can be -1/RACEMASK_ALL_PLAYABLE to allow any race
|
||||
if (qinfo->AllowableRaces.RawValue != uint64(-1))
|
||||
if (qinfo->_allowableRaces.RawValue != uint64(-1))
|
||||
{
|
||||
if (qinfo->AllowableRaces && !(qinfo->AllowableRaces.RawValue & RACEMASK_ALL_PLAYABLE))
|
||||
if (qinfo->_allowableRaces && !(qinfo->_allowableRaces.RawValue & RACEMASK_ALL_PLAYABLE))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u does not contain any playable races in `AllowableRaces` (" UI64FMTD "), value set to -1 (all races).", qinfo->GetQuestId(), qinfo->AllowableRaces.RawValue);
|
||||
qinfo->AllowableRaces.RawValue = uint64(-1);
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u does not contain any playable races in `AllowableRaces` (" UI64FMTD "), value set to -1 (all races).", qinfo->GetQuestId(), qinfo->_allowableRaces.RawValue);
|
||||
qinfo->_allowableRaces.RawValue = uint64(-1);
|
||||
}
|
||||
}
|
||||
// RequiredSkillId, can be 0
|
||||
if (qinfo->RequiredSkillId)
|
||||
if (qinfo->_requiredSkillId)
|
||||
{
|
||||
if (!sSkillLineStore.LookupEntry(qinfo->RequiredSkillId))
|
||||
if (!sSkillLineStore.LookupEntry(qinfo->_requiredSkillId))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredSkillId` = %u but this skill does not exist",
|
||||
qinfo->GetQuestId(), qinfo->RequiredSkillId);
|
||||
qinfo->GetQuestId(), qinfo->_requiredSkillId);
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->RequiredSkillPoints)
|
||||
if (qinfo->_requiredSkillPoints)
|
||||
{
|
||||
if (qinfo->RequiredSkillPoints > sWorld->GetConfigMaxSkillValue())
|
||||
if (qinfo->_requiredSkillPoints > sWorld->GetConfigMaxSkillValue())
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredSkillPoints` = %u but max possible skill is %u, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RequiredSkillPoints, sWorld->GetConfigMaxSkillValue());
|
||||
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->RequiredMinRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredMinRepFaction))
|
||||
if (qinfo->_requiredMinRepFaction && !sFactionStore.LookupEntry(qinfo->_requiredMinRepFaction))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredMinRepFaction` = %u but faction template %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RequiredMinRepFaction, qinfo->RequiredMinRepFaction);
|
||||
qinfo->GetQuestId(), qinfo->_requiredMinRepFaction, qinfo->_requiredMinRepFaction);
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
|
||||
if (qinfo->RequiredMaxRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredMaxRepFaction))
|
||||
if (qinfo->_requiredMaxRepFaction && !sFactionStore.LookupEntry(qinfo->_requiredMaxRepFaction))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredMaxRepFaction` = %u but faction template %u does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RequiredMaxRepFaction, qinfo->RequiredMaxRepFaction);
|
||||
qinfo->GetQuestId(), qinfo->_requiredMaxRepFaction, qinfo->_requiredMaxRepFaction);
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
|
||||
if (qinfo->RequiredMinRepValue && qinfo->RequiredMinRepValue > ReputationMgr::Reputation_Cap)
|
||||
if (qinfo->_requiredMinRepValue && qinfo->_requiredMinRepValue > ReputationMgr::Reputation_Cap)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredMinRepValue` = %d but max reputation is %u, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RequiredMinRepValue, ReputationMgr::Reputation_Cap);
|
||||
qinfo->GetQuestId(), qinfo->_requiredMinRepValue, ReputationMgr::Reputation_Cap);
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
|
||||
if (qinfo->RequiredMinRepValue && qinfo->RequiredMaxRepValue && qinfo->RequiredMaxRepValue <= qinfo->RequiredMinRepValue)
|
||||
if (qinfo->_requiredMinRepValue && qinfo->_requiredMaxRepValue && qinfo->_requiredMaxRepValue <= qinfo->_requiredMinRepValue)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredMaxRepValue` = %d and `RequiredMinRepValue` = %d, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RequiredMaxRepValue, qinfo->RequiredMinRepValue);
|
||||
qinfo->GetQuestId(), qinfo->_requiredMaxRepValue, qinfo->_requiredMinRepValue);
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
|
||||
if (!qinfo->RequiredMinRepFaction && qinfo->RequiredMinRepValue != 0)
|
||||
if (!qinfo->_requiredMinRepFaction && qinfo->_requiredMinRepValue != 0)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredMinRepValue` = %d but `RequiredMinRepFaction` is 0, value has no effect",
|
||||
qinfo->GetQuestId(), qinfo->RequiredMinRepValue);
|
||||
qinfo->GetQuestId(), qinfo->_requiredMinRepValue);
|
||||
// warning
|
||||
}
|
||||
|
||||
if (!qinfo->RequiredMaxRepFaction && qinfo->RequiredMaxRepValue != 0)
|
||||
if (!qinfo->_requiredMaxRepFaction && qinfo->_requiredMaxRepValue != 0)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RequiredMaxRepValue` = %d but `RequiredMaxRepFaction` is 0, value has no effect",
|
||||
qinfo->GetQuestId(), qinfo->RequiredMaxRepValue);
|
||||
qinfo->GetQuestId(), qinfo->_requiredMaxRepValue);
|
||||
// warning
|
||||
}
|
||||
|
||||
if (qinfo->RewardTitleId && !sCharTitlesStore.LookupEntry(qinfo->RewardTitleId))
|
||||
if (qinfo->_rewardTitleId && !sCharTitlesStore.LookupEntry(qinfo->_rewardTitleId))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RewardTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.",
|
||||
qinfo->GetQuestId(), qinfo->RewardTitleId, qinfo->RewardTitleId);
|
||||
qinfo->RewardTitleId = 0;
|
||||
qinfo->GetQuestId(), qinfo->_rewardTitleId, qinfo->_rewardTitleId);
|
||||
qinfo->_rewardTitleId = 0;
|
||||
// quest can't reward this title
|
||||
}
|
||||
|
||||
if (qinfo->SourceItemId)
|
||||
if (qinfo->_sourceItemId)
|
||||
{
|
||||
if (!sObjectMgr->GetItemTemplate(qinfo->SourceItemId))
|
||||
if (!sObjectMgr->GetItemTemplate(qinfo->_sourceItemId))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "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
|
||||
qinfo->GetQuestId(), qinfo->_sourceItemId, qinfo->_sourceItemId);
|
||||
qinfo->_sourceItemId = 0; // quest can't be done for this requirement
|
||||
}
|
||||
else if (qinfo->SourceItemIdCount == 0)
|
||||
else if (qinfo->_sourceItemIdCount == 0)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `StartItem` = %u but `ProvidedItemCount` = 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
|
||||
qinfo->GetQuestId(), qinfo->_sourceItemId);
|
||||
qinfo->_sourceItemIdCount = 1; // update to 1 for allow quest work for backward compatibility with DB
|
||||
}
|
||||
}
|
||||
else if (qinfo->SourceItemIdCount>0)
|
||||
else if (qinfo->_sourceItemIdCount > 0)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `SourceItemId` = 0 but `SourceItemIdCount` = %u, useless value.",
|
||||
qinfo->GetQuestId(), qinfo->SourceItemIdCount);
|
||||
qinfo->SourceItemIdCount=0; // no quest work changes in fact
|
||||
qinfo->GetQuestId(), qinfo->_sourceItemIdCount);
|
||||
qinfo->_sourceItemIdCount = 0; // no quest work changes in fact
|
||||
}
|
||||
|
||||
if (qinfo->SourceSpellID)
|
||||
if (qinfo->_sourceSpellID)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->SourceSpellID);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->_sourceSpellID);
|
||||
if (!spellInfo)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "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
|
||||
qinfo->GetQuestId(), qinfo->_sourceSpellID, qinfo->_sourceSpellID);
|
||||
qinfo->_sourceSpellID = 0; // quest can't be done for this requirement
|
||||
}
|
||||
else if (!SpellMgr::IsSpellValid(spellInfo))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "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
|
||||
qinfo->GetQuestId(), qinfo->_sourceSpellID, qinfo->_sourceSpellID);
|
||||
qinfo->_sourceSpellID = 0; // quest can't be done for this requirement
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4501,7 +4501,7 @@ void ObjectMgr::LoadQuests()
|
||||
{
|
||||
if (qinfo->RewardFactionId[j])
|
||||
{
|
||||
if (abs(qinfo->RewardFactionValue[j]) > 9)
|
||||
if (std::abs(qinfo->RewardFactionValue[j]) > 9)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has RewardFactionValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewardFactionValue[j]);
|
||||
}
|
||||
@@ -4542,59 +4542,59 @@ void ObjectMgr::LoadQuests()
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->RewardSpell > 0)
|
||||
if (qinfo->_rewardSpell > 0)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RewardSpell);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->_rewardSpell);
|
||||
|
||||
if (!spellInfo)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell);
|
||||
qinfo->RewardSpell = 0; // no spell will be cast on player
|
||||
qinfo->GetQuestId(), qinfo->_rewardSpell, qinfo->_rewardSpell);
|
||||
qinfo->_rewardSpell = 0; // no spell will be cast on player
|
||||
}
|
||||
|
||||
else if (!SpellMgr::IsSpellValid(spellInfo))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSpellCast` = %u but spell %u is broken, quest will not have a spell reward.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell);
|
||||
qinfo->RewardSpell = 0; // no spell will be cast on player
|
||||
qinfo->GetQuestId(), qinfo->_rewardSpell, qinfo->_rewardSpell);
|
||||
qinfo->_rewardSpell = 0; // no spell will be cast on player
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->RewardMailTemplateId)
|
||||
if (qinfo->_rewardMailTemplateId)
|
||||
{
|
||||
if (!sMailTemplateStore.LookupEntry(qinfo->RewardMailTemplateId))
|
||||
if (!sMailTemplateStore.LookupEntry(qinfo->_rewardMailTemplateId))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "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
|
||||
qinfo->RewardMailSenderEntry = 0;
|
||||
qinfo->GetQuestId(), qinfo->_rewardMailTemplateId, qinfo->_rewardMailTemplateId);
|
||||
qinfo->_rewardMailTemplateId = 0; // no mail will send to player
|
||||
qinfo->_rewardMailDelay = 0; // no mail will send to player
|
||||
qinfo->_rewardMailSenderEntry = 0;
|
||||
}
|
||||
else if (usedMailTemplates.find(qinfo->RewardMailTemplateId) != usedMailTemplates.end())
|
||||
else if (usedMailTemplates.find(qinfo->_rewardMailTemplateId) != usedMailTemplates.end())
|
||||
{
|
||||
std::map<uint32, uint32>::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->RewardMailTemplateId);
|
||||
auto used_mt_itr = usedMailTemplates.find(qinfo->_rewardMailTemplateId);
|
||||
TC_LOG_ERROR("sql.sql", "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
|
||||
qinfo->RewardMailSenderEntry = 0;
|
||||
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
|
||||
qinfo->_rewardMailSenderEntry = 0;
|
||||
}
|
||||
else
|
||||
usedMailTemplates[qinfo->RewardMailTemplateId] = qinfo->GetQuestId();
|
||||
usedMailTemplates.emplace(qinfo->_rewardMailTemplateId, qinfo->GetQuestId());
|
||||
}
|
||||
|
||||
if (qinfo->NextQuestInChain)
|
||||
if (qinfo->_nextQuestInChain)
|
||||
{
|
||||
QuestMap::iterator qNextItr = _questTemplates.find(qinfo->NextQuestInChain);
|
||||
auto qNextItr = _questTemplates.find(qinfo->_nextQuestInChain);
|
||||
if (qNextItr == _questTemplates.end())
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "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;
|
||||
qinfo->GetQuestId(), qinfo->_nextQuestInChain, qinfo->_nextQuestInChain);
|
||||
qinfo->_nextQuestInChain = 0;
|
||||
}
|
||||
else
|
||||
qNextItr->second->prevChainQuests.push_back(qinfo->GetQuestId());
|
||||
qNextItr->second->PrevChainQuests.push_back(qinfo->GetQuestId());
|
||||
}
|
||||
|
||||
for (uint8 j = 0; j < QUEST_REWARD_CURRENCY_COUNT; ++j)
|
||||
@@ -4623,79 +4623,79 @@ void ObjectMgr::LoadQuests()
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->SoundAccept)
|
||||
if (qinfo->_soundAccept)
|
||||
{
|
||||
if (!sSoundKitStore.LookupEntry(qinfo->SoundAccept))
|
||||
if (!sSoundKitStore.LookupEntry(qinfo->_soundAccept))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `SoundAccept` = %u but sound %u does not exist, set to 0.",
|
||||
qinfo->GetQuestId(), qinfo->SoundAccept, qinfo->SoundAccept);
|
||||
qinfo->SoundAccept = 0; // no sound will be played
|
||||
qinfo->GetQuestId(), qinfo->_soundAccept, qinfo->_soundAccept);
|
||||
qinfo->_soundAccept = 0; // no sound will be played
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->SoundTurnIn)
|
||||
if (qinfo->_soundTurnIn)
|
||||
{
|
||||
if (!sSoundKitStore.LookupEntry(qinfo->SoundTurnIn))
|
||||
if (!sSoundKitStore.LookupEntry(qinfo->_soundTurnIn))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `SoundTurnIn` = %u but sound %u does not exist, set to 0.",
|
||||
qinfo->GetQuestId(), qinfo->SoundTurnIn, qinfo->SoundTurnIn);
|
||||
qinfo->SoundTurnIn = 0; // no sound will be played
|
||||
qinfo->GetQuestId(), qinfo->_soundTurnIn, qinfo->_soundTurnIn);
|
||||
qinfo->_soundTurnIn = 0; // no sound will be played
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->RewardSkillId)
|
||||
if (qinfo->_rewardSkillId)
|
||||
{
|
||||
if (!sSkillLineStore.LookupEntry(qinfo->RewardSkillId))
|
||||
if (!sSkillLineStore.LookupEntry(qinfo->_rewardSkillId))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSkillId` = %u but this skill does not exist",
|
||||
qinfo->GetQuestId(), qinfo->RewardSkillId);
|
||||
qinfo->GetQuestId(), qinfo->_rewardSkillId);
|
||||
}
|
||||
if (!qinfo->RewardSkillPoints)
|
||||
if (!qinfo->_rewardSkillPoints)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSkillId` = %u but `RewardSkillPoints` is 0",
|
||||
qinfo->GetQuestId(), qinfo->RewardSkillId);
|
||||
qinfo->GetQuestId(), qinfo->_rewardSkillId);
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->RewardSkillPoints)
|
||||
if (qinfo->_rewardSkillPoints)
|
||||
{
|
||||
if (qinfo->RewardSkillPoints > sWorld->GetConfigMaxSkillValue())
|
||||
if (qinfo->_rewardSkillPoints > sWorld->GetConfigMaxSkillValue())
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSkillPoints` = %u but max possible skill is %u, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->RewardSkillPoints, sWorld->GetConfigMaxSkillValue());
|
||||
qinfo->GetQuestId(), qinfo->_rewardSkillPoints, sWorld->GetConfigMaxSkillValue());
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
if (!qinfo->RewardSkillId)
|
||||
if (!qinfo->_rewardSkillId)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSkillPoints` = %u but `RewardSkillId` is 0",
|
||||
qinfo->GetQuestId(), qinfo->RewardSkillPoints);
|
||||
qinfo->GetQuestId(), qinfo->_rewardSkillPoints);
|
||||
}
|
||||
}
|
||||
|
||||
// fill additional data stores
|
||||
if (qinfo->PrevQuestID)
|
||||
if (qinfo->_prevQuestID)
|
||||
{
|
||||
if (_questTemplates.find(abs(qinfo->GetPrevQuestId())) == _questTemplates.end())
|
||||
TC_LOG_ERROR("sql.sql", "Quest %d has PrevQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetPrevQuestId());
|
||||
else
|
||||
qinfo->prevQuests.push_back(qinfo->PrevQuestID);
|
||||
qinfo->PrevQuests.push_back(qinfo->_prevQuestID);
|
||||
}
|
||||
|
||||
if (qinfo->NextQuestID)
|
||||
if (qinfo->_nextQuestID)
|
||||
{
|
||||
QuestMap::iterator qNextItr = _questTemplates.find(abs(qinfo->GetNextQuestId()));
|
||||
if (qNextItr == _questTemplates.end())
|
||||
TC_LOG_ERROR("sql.sql", "Quest %d has NextQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId());
|
||||
else
|
||||
{
|
||||
int32 signedQuestId = qinfo->NextQuestID < 0 ? -int32(qinfo->GetQuestId()) : int32(qinfo->GetQuestId());
|
||||
qNextItr->second->prevQuests.push_back(signedQuestId);
|
||||
int32 signedQuestId = qinfo->_nextQuestID < 0 ? -int32(qinfo->GetQuestId()) : int32(qinfo->GetQuestId());
|
||||
qNextItr->second->PrevQuests.push_back(signedQuestId);
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->ExclusiveGroup)
|
||||
mExclusiveQuestGroups.insert(std::pair<int32, uint32>(qinfo->ExclusiveGroup, qinfo->GetQuestId()));
|
||||
if (qinfo->LimitTime)
|
||||
if (qinfo->_exclusiveGroup)
|
||||
mExclusiveQuestGroups.insert(std::pair<int32, uint32>(qinfo->_exclusiveGroup, qinfo->GetQuestId()));
|
||||
if (qinfo->_limitTime)
|
||||
qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED);
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
_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;
|
||||
}
|
||||
_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());
|
||||
_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;
|
||||
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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user