Skip to content

Commit

Permalink
[10520] Implement CONDITION_QUEST_NONE
Browse files Browse the repository at this point in the history
For case when need check that quest not taken and not completed in past.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
  • Loading branch information
virusav authored and VladimirMangos committed Sep 23, 2010
1 parent 605c333 commit c1ca5a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/game/ObjectMgr.cpp
Expand Up @@ -8108,6 +8108,12 @@ bool PlayerCondition::Meets(Player const * player) const
}
return false;
}
case CONDITION_QUEST_NONE:
{
if (!player->IsCurrentQuest(value1) && !player->GetQuestRewardStatus(value1))
return true;
return false;
}
default:
return false;
}
Expand Down Expand Up @@ -8219,6 +8225,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
case CONDITION_QUESTREWARDED:
case CONDITION_QUESTTAKEN:
case CONDITION_QUESTAVAILABLE:
case CONDITION_QUEST_NONE:
{
Quest const *Quest = sObjectMgr.GetQuestTemplate(value1);
if (!Quest)
Expand Down
3 changes: 2 additions & 1 deletion src/game/ObjectMgr.h
Expand Up @@ -607,9 +607,10 @@ enum ConditionType
CONDITION_QUESTAVAILABLE = 19, // quest_id 0 for case when loot/gossip possible only if player can start quest
CONDITION_ACHIEVEMENT = 20, // ach_id 0, 1 (0: has achievement, 1: hasn't achievement) for player
CONDITION_ACHIEVEMENT_REALM = 21, // ach_id 0, 1 (0: has achievement, 1: hasn't achievement) for server
CONDITION_QUEST_NONE = 22 // quest_id 0 (quest did not take and not rewarded)
};

#define MAX_CONDITION 22 // maximum value in ConditionType enum
#define MAX_CONDITION 23 // maximum value in ConditionType enum

struct PlayerCondition
{
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10519"
#define REVISION_NR "10520"
#endif // __REVISION_NR_H__

0 comments on commit c1ca5a5

Please sign in to comment.