From cf3bc71a7436c2ec2ecb739420ea5482ebf0f2cf Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 16 Dec 2021 12:36:53 -0500 Subject: [PATCH] Core/SmartAI: Improve SMART_EVENT_GOSSIP_HELLO Port From (https://github.com/TrinityCore/TrinityCore/commit/e9aed3e442374db74ebc98edc39ba4ee46acf123) --- Source/Game/AI/SmartScripts/SmartAIManager.cs | 2 +- Source/Game/AI/SmartScripts/SmartScript.cs | 22 +++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Source/Game/AI/SmartScripts/SmartAIManager.cs b/Source/Game/AI/SmartScripts/SmartAIManager.cs index 48849b68d..f29901dcd 100644 --- a/Source/Game/AI/SmartScripts/SmartAIManager.cs +++ b/Source/Game/AI/SmartScripts/SmartAIManager.cs @@ -2172,7 +2172,7 @@ namespace Game.AI } public struct GossipHello { - public uint noReportUse; + public uint filter; } public struct Gossip { diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index 75c1d68ea..b10203596 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -3272,8 +3272,26 @@ namespace Game.AI break; case SmartEvents.GossipHello: { - if (e.Event.gossipHello.noReportUse != 0 && var0 != 0) - return; + switch (e.Event.gossipHello.filter) + { + case 0: + // no filter set, always execute action + break; + case 1: + // OnGossipHello only filter set, skip action if OnReportUse + if (var0 != 0) + return; + break; + case 2: + // OnReportUse only filter set, skip action if OnGossipHello + if (var0 == 0) + return; + break; + default: + // Ignore any other value + break; + } + ProcessAction(e, unit, var0, var1, bvar, spell, gob); break; }