mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[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:
parent
4ad879a3da
commit
1606bb2e45
4 changed files with 20 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue