aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Conditions/ConditionMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.cpp')
-rw-r--r--src/server/game/Conditions/ConditionMgr.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 27c6f88ba93..f372e282e49 100644
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -148,6 +148,7 @@ ConditionMgr::ConditionTypeInfo const ConditionMgr::StaticConditionTypeData[COND
{ "Object TypeMask", true, false, false },
{ "BattlePet Species Learned", true, true, true },
{ "On Scenario Step", true, false, false },
+ { "Scene In Progress", true, false, false },
};
// Checks if object meets the condition
@@ -583,6 +584,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
condMeets = step->ID == ConditionValue1;
break;
}
+ case CONDITION_SCENE_IN_PROGRESS:
+ {
+ if (Player* player = object->ToPlayer())
+ condMeets = player->GetSceneMgr().GetActiveSceneCount(ConditionValue1) > 0;
+ break;
+ }
default:
condMeets = false;
break;
@@ -790,6 +797,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition() const
case CONDITION_SCENARIO_STEP:
mask |= GRID_MAP_TYPE_MASK_ALL;
break;
+ case CONDITION_SCENE_IN_PROGRESS:
+ mask |= GRID_MAP_TYPE_MASK_PLAYER;
+ break;
default:
ABORT_MSG("Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
break;
@@ -2623,6 +2633,15 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const
}
break;
}
+ case CONDITION_SCENE_IN_PROGRESS:
+ {
+ if (!sSceneScriptPackageStore.LookupEntry(cond->ConditionValue1))
+ {
+ TC_LOG_ERROR("sql.sql", "%s has non existing SceneScriptPackageId in value1 (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
+ return false;
+ }
+ break;
+ }
default:
TC_LOG_ERROR("sql.sql", "%s Invalid ConditionType in `condition` table, ignoring.", cond->ToString().c_str());
return false;