Core/Condition: Implemented condition CONDITION_PRIVATE_OBJECT

Port From (https://github.com/TrinityCore/TrinityCore/commit/f28b4eed3d875ccedde574b0abc7258290b4c0a3)
This commit is contained in:
hondacrx
2023-09-04 08:06:51 -04:00
parent 04250a71f8
commit 296e818f77
3 changed files with 67 additions and 57 deletions
@@ -62,6 +62,7 @@ namespace Framework.Constants
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 SceneInProgress = 55, // SceneScriptPackageId 0 0 true if player is playing a scene with ScriptPackageId equal to given value
PlayerCondition = 56, // PlayerConditionId 0 0 true if player satisfies PlayerCondition PlayerCondition = 56, // PlayerConditionId 0 0 true if player satisfies PlayerCondition
PrivateObject = 57, // 0 0 0 true if entity is private object
Max Max
} }
+8
View File
@@ -435,6 +435,11 @@ namespace Game.Conditions
} }
break; break;
} }
case ConditionTypes.PrivateObject:
{
condMeets = !obj.GetPrivateObjectOwner().IsEmpty();
break;
}
default: default:
break; break;
} }
@@ -556,6 +561,9 @@ namespace Game.Conditions
case ConditionTypes.PlayerCondition: case ConditionTypes.PlayerCondition:
mask |= GridMapTypeMask.Player; mask |= GridMapTypeMask.Player;
break; break;
case ConditionTypes.PrivateObject:
mask |= GridMapTypeMask.All & ~GridMapTypeMask.Player;
break;
default: default:
Cypher.Assert(false, "Condition.GetSearcherTypeMaskForCondition - missing condition handling!"); Cypher.Assert(false, "Condition.GetSearcherTypeMaskForCondition - missing condition handling!");
break; break;
@@ -1796,6 +1796,7 @@ namespace Game
case ConditionTypes.Charmed: case ConditionTypes.Charmed:
case ConditionTypes.Taxi: case ConditionTypes.Taxi:
case ConditionTypes.Gamemaster: case ConditionTypes.Gamemaster:
case ConditionTypes.PrivateObject:
break; break;
case ConditionTypes.DifficultyId: case ConditionTypes.DifficultyId:
if (!CliDB.DifficultyStorage.ContainsKey(cond.ConditionValue1)) if (!CliDB.DifficultyStorage.ContainsKey(cond.ConditionValue1))