Core/ConditionMgr: You can now add conditions to QuestAccept (at CanTakeQuest check)
--HG-- branch : trunk
This commit is contained in:
1 parent
c4ed3430cf
commit
5de3183180
4 files changed
+29
-3
No files matched your search
@@ -14014,7 +14014,8 @@ bool Player::CanTakeQuest(Quest const *pQuest, bool msg)
|
||||
&& SatisfyQuestPreviousQuest(pQuest, msg) && SatisfyQuestTimed(pQuest, msg)
|
||||
&& SatisfyQuestNextChain(pQuest, msg) && SatisfyQuestPrevChain(pQuest, msg)
|
||||
&& SatisfyQuestDay(pQuest, msg) && SatisfyQuestWeek(pQuest, msg)
|
||||
&& !sDisableMgr.IsDisabledFor(DISABLE_TYPE_QUEST, pQuest->GetQuestId(), this);
|
||||
&& !sDisableMgr.IsDisabledFor(DISABLE_TYPE_QUEST, pQuest->GetQuestId(), this)
|
||||
&& SatisfyQuestConditions(pQuest, msg);
|
||||
}
|
||||
|
||||
bool Player::CanAddQuest(Quest const *pQuest, bool msg)
|
||||
@@ -14752,6 +14753,19 @@ bool Player::SatisfyQuestStatus(Quest const* qInfo, bool msg)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Player::SatisfyQuestConditions(Quest const* qInfo, bool msg)
|
||||
{
|
||||
ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_ACCEPT, qInfo->GetQuestId());
|
||||
if (!sConditionMgr.IsPlayerMeetToConditions(this, conditions))
|
||||
{
|
||||
if (msg)
|
||||
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
|
||||
sLog.outDebug("Player::SatisfyQuestConditions: conditions not met for quest %u", qInfo->GetQuestId());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Player::SatisfyQuestTimed(Quest const* qInfo, bool msg)
|
||||
{
|
||||
if (!m_timedquests.empty() && qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED))
|
||||
|
||||
Reference in new issue
Block a user