From 3a49852fa7c13658268e91a1f47a96c547c0e451 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 3 Nov 2021 11:47:35 -0400 Subject: [PATCH] Core/Conditions: Added conditions for old areatrigger system (AreaTrigger.db2) Port From (https://github.com/TrinityCore/TrinityCore/commit/6ebd5926fb61a5457d7048504d2f92bc3c9318ab) --- Source/Game/Conditions/ConditionManager.cs | 7 +++++++ Source/Game/Handlers/MiscHandler.cs | 3 +++ 2 files changed, 10 insertions(+) diff --git a/Source/Game/Conditions/ConditionManager.cs b/Source/Game/Conditions/ConditionManager.cs index f0f958508..d821c43c8 100644 --- a/Source/Game/Conditions/ConditionManager.cs +++ b/Source/Game/Conditions/ConditionManager.cs @@ -1111,6 +1111,13 @@ namespace Game return false; } break; + case ConditionSourceType.AreatriggerClientTriggered: + if (!CliDB.AreaTriggerStorage.ContainsKey(cond.SourceEntry)) + { + Log.outError(LogFilter.Sql, $"{cond} SourceEntry in `condition` table, does not exists in AreaTrigger.db2, ignoring."); + return false; + } + break; default: Log.outError(LogFilter.Sql, $"{cond.ToString()} Invalid ConditionSourceType in `condition` table, ignoring."); return false; diff --git a/Source/Game/Handlers/MiscHandler.cs b/Source/Game/Handlers/MiscHandler.cs index bd7b9eae4..675e3840a 100644 --- a/Source/Game/Handlers/MiscHandler.cs +++ b/Source/Game/Handlers/MiscHandler.cs @@ -195,6 +195,9 @@ namespace Game if (player.IsDebugAreaTriggers) player.SendSysMessage(packet.Entered ? CypherStrings.DebugAreatriggerEntered : CypherStrings.DebugAreatriggerLeft, packet.AreaTriggerID); + if (!Global.ConditionMgr.IsObjectMeetingNotGroupedConditions(ConditionSourceType.AreatriggerClientTriggered, atEntry.Id, player)) + return; + if (Global.ScriptMgr.OnAreaTrigger(player, atEntry, packet.Entered)) return;