diff --git a/Source/Game/AI/SmartScripts/SmartAIManager.cs b/Source/Game/AI/SmartScripts/SmartAIManager.cs index 59a4dbe58..d8f6bf4b3 100644 --- a/Source/Game/AI/SmartScripts/SmartAIManager.cs +++ b/Source/Game/AI/SmartScripts/SmartAIManager.cs @@ -1938,6 +1938,7 @@ namespace Game.AI public uint maxDist; public uint cooldownMin; public uint cooldownMax; + public uint playerOnly; } public struct Respawn { diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index 6fbdf12e9..d00d5d544 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -3162,9 +3162,11 @@ namespace Game.AI if (me.IsWithinDistInMap(unit, range) && me.IsWithinLOSInMap(unit)) { //if friendly event&&who is not hostile OR hostile event&&who is hostile - if ((e.Event.los.noHostile != 0 && !me.IsHostileTo(unit)) || - (e.Event.los.noHostile == 0 && me.IsHostileTo(unit))) + if ((e.Event.los.noHostile != 0 && !me.IsHostileTo(unit)) || (e.Event.los.noHostile == 0 && me.IsHostileTo(unit))) { + if (e.Event.los.playerOnly && !unit.IsTypeId(TypeId.Player)) + return; + RecalcTimer(e, e.Event.los.cooldownMin, e.Event.los.cooldownMax); ProcessAction(e, unit); } @@ -3182,9 +3184,11 @@ namespace Game.AI if (me.IsWithinDistInMap(unit, range) && me.IsWithinLOSInMap(unit)) { //if friendly event&&who is not hostile OR hostile event&&who is hostile - if ((e.Event.los.noHostile != 0 && !me.IsHostileTo(unit)) || - (e.Event.los.noHostile == 0 && me.IsHostileTo(unit))) + if ((e.Event.los.noHostile != 0 && !me.IsHostileTo(unit)) || (e.Event.los.noHostile == 0 && me.IsHostileTo(unit))) { + if (e.Event.los.playerOnly && !unit.IsTypeId(TypeId.Player)) + return; + RecalcTimer(e, e.Event.los.cooldownMin, e.Event.los.cooldownMax); ProcessAction(e, unit); }