diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 960453d97..170dc2992 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -4029,10 +4029,32 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui case SMART_EVENT_ON_SPELLCLICK: ProcessAction(e, unit, var0, var1, bvar, spell, gob); break; - // Xinef: added no report use distinction for gameobjects + case SMART_EVENT_GOSSIP_HELLO: - if (e.event.gossipHello.noReportUse && var0) - return; + switch (e.event.gossipHello.filter) + { + case 0: + // no filter set, always execute action + break; + case 1: + // GossipHello only filter set, skip action if reportUse + if (var0) + { + return; + } + break; + case 2: + // reportUse only filter set, skip action if GossipHello + if (!var0) + { + return; + } + break; + default: + // Ignore any other value + break; + } + ProcessAction(e, unit, var0, var1, bvar, spell, gob); break; case SMART_EVENT_IS_BEHIND_TARGET: diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 0da8dff9b..ce9d229cc 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -162,7 +162,7 @@ enum SMART_EVENT SMART_EVENT_LINK = 61, // INTERNAL USAGE, no params, used to link together multiple events, does not use any extra resources to iterate event lists needlessly SMART_EVENT_GOSSIP_SELECT = 62, // menuID, actionID SMART_EVENT_JUST_CREATED = 63, // none - SMART_EVENT_GOSSIP_HELLO = 64, // none + SMART_EVENT_GOSSIP_HELLO = 64, // event_para_1 (only) 0 = no filter set, always execute action, 1 = GossipHello only filter set, skip action if reportUse, 2 = reportUse only filter set, skip action if GossipHello SMART_EVENT_FOLLOW_COMPLETED = 65, // none SMART_EVENT_UNUSED_66 = 66, // UNUSED SMART_EVENT_IS_BEHIND_TARGET = 67, // cooldownMin, CooldownMax @@ -362,7 +362,7 @@ struct SmartEvent struct { - uint32 noReportUse; + uint32 filter; } gossipHello; struct