Core/SmartAI: Improve SMART_EVENT_GOSSIP_HELLO

Port From (https://github.com/TrinityCore/TrinityCore/commit/e9aed3e442374db74ebc98edc39ba4ee46acf123)
This commit is contained in:
hondacrx
2021-12-16 12:36:53 -05:00
parent 24b0f058a9
commit cf3bc71a74
2 changed files with 21 additions and 3 deletions
@@ -2172,7 +2172,7 @@ namespace Game.AI
}
public struct GossipHello
{
public uint noReportUse;
public uint filter;
}
public struct Gossip
{
+20 -2
View File
@@ -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;
}