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

Closes #21497

(cherry picked from commit 5ad38c31b0)
This commit is contained in:
Killyana
2018-03-11 18:46:07 +01:00
committed by Shauren
parent 6879440acb
commit 77ee6dca45
2 changed files with 17 additions and 8 deletions
@@ -3125,10 +3125,14 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
//if friendly event&&who is not hostile OR hostile event&&who is hostile
if ((e.event.los.noHostile && !me->IsHostileTo(unit)) ||
(!e.event.los.noHostile && me->IsHostileTo(unit)))
{
RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax);
ProcessAction(e, unit);
}
if (!me || !unit)
return;
if (e.event.los.playerOnly && unit->GetTypeId() != TYPEID_PLAYER)
return;
if (e.event.los.playerOnly == TYPEID_PLAYER)
return;
RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax);
ProcessAction(e, unit);
}
break;
}
@@ -3145,10 +3149,14 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
//if friendly event&&who is not hostile OR hostile event&&who is hostile
if ((e.event.los.noHostile && !me->IsHostileTo(unit)) ||
(!e.event.los.noHostile && me->IsHostileTo(unit)))
{
RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax);
ProcessAction(e, unit);
}
if (!me || !unit)
return;
if (e.event.los.playerOnly && unit->GetTypeId() != TYPEID_PLAYER)
return;
if (e.event.los.playerOnly == TYPEID_PLAYER)
return;
RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax);
ProcessAction(e, unit);
}
break;
}