[11822] Add more functionality to CONDITION_QUESTTAKEN

Add options 1/ 2 in second argument to check if a quest is INCOMPLETE/ COMPLETE, default will behave like currently

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
PSZ 2011-10-14 18:05:17 +02:00 committed by Schmoozerd
parent 4ad879a3da
commit 1606bb2e45
4 changed files with 20 additions and 6 deletions

View file

@ -13522,13 +13522,21 @@ bool Player::IsActiveQuest( uint32 quest_id ) const
return itr != mQuestStatus.end() && itr->second.m_status != QUEST_STATUS_NONE;
}
bool Player::IsCurrentQuest( uint32 quest_id ) const
bool Player::IsCurrentQuest(uint32 quest_id, uint8 completed_or_not) const
{
QuestStatusMap::const_iterator itr = mQuestStatus.find(quest_id);
if (itr == mQuestStatus.end())
return false;
return itr->second.m_status == QUEST_STATUS_INCOMPLETE || (itr->second.m_status == QUEST_STATUS_COMPLETE && !itr->second.m_rewarded);
switch (completed_or_not)
{
case 1:
return itr->second.m_status == QUEST_STATUS_INCOMPLETE;
case 2:
return itr->second.m_status == QUEST_STATUS_COMPLETE && !itr->second.m_rewarded;
default:
return itr->second.m_status == QUEST_STATUS_INCOMPLETE || (itr->second.m_status == QUEST_STATUS_COMPLETE && !itr->second.m_rewarded);
}
}
Quest const* Player::GetNextQuest(ObjectGuid guid, Quest const *pQuest)