Core/Conditions: Added CONDITION_SCENE_IN_PROGRESS, useful for cases where you need phase things when a scene is in progress.
Port From (https://github.com/TrinityCore/TrinityCore/commit/bd401af0912eca2c938b6dd93fdb7689b9146c89)
This commit is contained in:
@@ -74,6 +74,7 @@ namespace Framework.Constants
|
|||||||
TypeMask = 52, // TypeMask 0 0 true if object is type object's TypeMask matches provided TypeMask
|
TypeMask = 52, // TypeMask 0 0 true if object is type object's TypeMask matches provided TypeMask
|
||||||
BattlePetCount = 53, // SpecieId count ComparisonType true if player has `count` of battle pet species
|
BattlePetCount = 53, // SpecieId count ComparisonType true if player has `count` of battle pet species
|
||||||
ScenarioStep = 54, // ScenarioStepId 0 0 true if player is at scenario with current step equal to ScenarioStepID
|
ScenarioStep = 54, // ScenarioStepId 0 0 true if player is at scenario with current step equal to ScenarioStepID
|
||||||
|
SceneInProgress = 55, // SceneScriptPackageId 0 0 true if player is playing a scene with ScriptPackageId equal to given value
|
||||||
Max
|
Max
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -411,6 +411,12 @@ namespace Game.Conditions
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ConditionTypes.SceneInProgress:
|
||||||
|
{
|
||||||
|
if (player != null)
|
||||||
|
condMeets = player.GetSceneMgr().GetActiveSceneCount(ConditionValue1) > 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
condMeets = false;
|
condMeets = false;
|
||||||
break;
|
break;
|
||||||
@@ -527,6 +533,9 @@ namespace Game.Conditions
|
|||||||
case ConditionTypes.ScenarioStep:
|
case ConditionTypes.ScenarioStep:
|
||||||
mask |= GridMapTypeMask.All;
|
mask |= GridMapTypeMask.All;
|
||||||
break;
|
break;
|
||||||
|
case ConditionTypes.SceneInProgress:
|
||||||
|
mask |= GridMapTypeMask.Player;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Cypher.Assert(false, "Condition.GetSearcherTypeMaskForCondition - missing condition handling!");
|
Cypher.Assert(false, "Condition.GetSearcherTypeMaskForCondition - missing condition handling!");
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1767,6 +1767,15 @@ namespace Game
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ConditionTypes.SceneInProgress:
|
||||||
|
{
|
||||||
|
if (!CliDB.SceneScriptPackageStorage.ContainsKey(cond.ConditionValue1))
|
||||||
|
{
|
||||||
|
Log.outError(LogFilter.Sql, $"{cond.ToString(true)} has non existing SceneScriptPackageId in value1 ({cond.ConditionValue1}), skipped.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
Log.outError(LogFilter.Sql, $"{cond.ToString()} Invalid ConditionType in `condition` table, ignoring.");
|
Log.outError(LogFilter.Sql, $"{cond.ToString()} Invalid ConditionType in `condition` table, ignoring.");
|
||||||
return false;
|
return false;
|
||||||
@@ -2986,7 +2995,8 @@ namespace Game
|
|||||||
new ConditionTypeInfo("Object Entry or Guid", true, true, true),
|
new ConditionTypeInfo("Object Entry or Guid", true, true, true),
|
||||||
new ConditionTypeInfo("Object TypeMask", true, false, false),
|
new ConditionTypeInfo("Object TypeMask", true, false, false),
|
||||||
new ConditionTypeInfo("BattlePet Species Learned", true, true, true),
|
new ConditionTypeInfo("BattlePet Species Learned", true, true, true),
|
||||||
new ConditionTypeInfo("On Scenario Step", true, false, false)
|
new ConditionTypeInfo("On Scenario Step", true, false, false),
|
||||||
|
new ConditionTypeInfo("Scene In Progress", true, false, false)
|
||||||
};
|
};
|
||||||
|
|
||||||
public struct ConditionTypeInfo
|
public struct ConditionTypeInfo
|
||||||
|
|||||||
Reference in New Issue
Block a user