Core/SAI: Add event_parm5 "player only" for EVENT_OOC_LOS and EVENT_IC_LOS

Port From (https://github.com/TrinityCore/TrinityCore/commit/77ee6dca456110336700460b25273a4de8061248)
This commit is contained in:
hondacrx
2021-03-04 15:37:34 -05:00
parent 9318cf2781
commit a43e8468dc
2 changed files with 9 additions and 4 deletions
+8 -4
View File
@@ -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);
}