aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Conditions/ConditionMgr.cpp
diff options
context:
space:
mode:
authorSnapperRy <snapperryen@gmail.com>2016-07-16 21:10:54 +0200
committerSnapperRy <snapperryen@gmail.com>2016-07-16 21:10:54 +0200
commitb4b3c10c69f73a0fd1e8efe4fd8684676f33948d (patch)
treed21e02182f2e3df24158e0d2f7f0f5a474d14d0e /src/server/game/Conditions/ConditionMgr.cpp
parentcee1c0789acb7d75e453ed355a5d68781a5dec4c (diff)
Core/Conditions: implement CONDITION_DAILY_QUEST_DONE to check whether or not a daily quest has been completed by a player in that day.
Also use it to fix two quest chains broken in commit 7905651. Should be the only ones of their kind.
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.cpp')
-rw-r--r--src/server/game/Conditions/ConditionMgr.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 74e94135b86..6317fae2767 100644
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -103,7 +103,8 @@ ConditionMgr::ConditionTypeInfo const ConditionMgr::StaticConditionTypeData[COND
{ "Realm Achievement", true, false, false },
{ "In Water", false, false, false },
{ "Terrain Swap", false, false, false },
- { "Sit/stand state", true, true, false }
+ { "Sit/stand state", true, true, false },
+ { "Daily Quest Completed",true, false, false }
};
// Checks if object meets the condition
@@ -448,6 +449,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
}
break;
}
+ case CONDITION_DAILY_QUEST_DONE:
+ {
+ if (Player* player = object->ToPlayer())
+ condMeets = player->IsDailyQuestDone(ConditionValue1);
+ break;
+ }
default:
condMeets = false;
break;
@@ -621,6 +628,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition() const
case CONDITION_STAND_STATE:
mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER;
break;
+ case CONDITION_DAILY_QUEST_DONE:
+ mask |= GRID_MAP_TYPE_MASK_PLAYER;
+ break;
default:
ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
break;
@@ -1791,6 +1801,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const
case CONDITION_QUESTTAKEN:
case CONDITION_QUEST_NONE:
case CONDITION_QUEST_COMPLETE:
+ case CONDITION_DAILY_QUEST_DONE:
{
if (!sObjectMgr->GetQuestTemplate(cond->ConditionValue1))
{