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:
@@ -1938,6 +1938,7 @@ namespace Game.AI
|
|||||||
public uint maxDist;
|
public uint maxDist;
|
||||||
public uint cooldownMin;
|
public uint cooldownMin;
|
||||||
public uint cooldownMax;
|
public uint cooldownMax;
|
||||||
|
public uint playerOnly;
|
||||||
}
|
}
|
||||||
public struct Respawn
|
public struct Respawn
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3162,9 +3162,11 @@ namespace Game.AI
|
|||||||
if (me.IsWithinDistInMap(unit, range) && me.IsWithinLOSInMap(unit))
|
if (me.IsWithinDistInMap(unit, range) && me.IsWithinLOSInMap(unit))
|
||||||
{
|
{
|
||||||
//if friendly event&&who is not hostile OR hostile event&&who is hostile
|
//if friendly event&&who is not hostile OR hostile event&&who is hostile
|
||||||
if ((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)))
|
||||||
(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);
|
RecalcTimer(e, e.Event.los.cooldownMin, e.Event.los.cooldownMax);
|
||||||
ProcessAction(e, unit);
|
ProcessAction(e, unit);
|
||||||
}
|
}
|
||||||
@@ -3182,9 +3184,11 @@ namespace Game.AI
|
|||||||
if (me.IsWithinDistInMap(unit, range) && me.IsWithinLOSInMap(unit))
|
if (me.IsWithinDistInMap(unit, range) && me.IsWithinLOSInMap(unit))
|
||||||
{
|
{
|
||||||
//if friendly event&&who is not hostile OR hostile event&&who is hostile
|
//if friendly event&&who is not hostile OR hostile event&&who is hostile
|
||||||
if ((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)))
|
||||||
(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);
|
RecalcTimer(e, e.Event.los.cooldownMin, e.Event.los.cooldownMax);
|
||||||
ProcessAction(e, unit);
|
ProcessAction(e, unit);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user