mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
feat(Core/SmartScripts): Add support to friendly+hostile to SMART_EVENT_OOC_LOS and SMART_EVENT_IC_LOS (#10037)
* . * .
This commit is contained in:
committed by
GitHub
parent
7fb6b7e15f
commit
c377c62c7a
@@ -4229,9 +4229,11 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
//if range is ok and we are actually in LOS
|
||||
if (me->IsWithinDistInMap(unit, range) && me->IsWithinLOSInMap(unit))
|
||||
{
|
||||
SmartEvent::LOSHostilityMode hostilityMode = static_cast<SmartEvent::LOSHostilityMode>(e.event.los.hostilityMode);
|
||||
//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)))
|
||||
if ((hostilityMode == SmartEvent::LOSHostilityMode::Any) ||
|
||||
(hostilityMode == SmartEvent::LOSHostilityMode::NotHostile && !me->IsHostileTo(unit)) ||
|
||||
(hostilityMode == SmartEvent::LOSHostilityMode::Hostile && me->IsHostileTo(unit)))
|
||||
{
|
||||
if (e.event.los.playerOnly && unit->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
@@ -4251,9 +4253,11 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
//if range is ok and we are actually in LOS
|
||||
if (me->IsWithinDistInMap(unit, range) && me->IsWithinLOSInMap(unit))
|
||||
{
|
||||
SmartEvent::LOSHostilityMode hostilityMode = static_cast<SmartEvent::LOSHostilityMode>(e.event.los.hostilityMode);
|
||||
//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)))
|
||||
if ((hostilityMode == SmartEvent::LOSHostilityMode::Any) ||
|
||||
(hostilityMode == SmartEvent::LOSHostilityMode::NotHostile && !me->IsHostileTo(unit)) ||
|
||||
(hostilityMode == SmartEvent::LOSHostilityMode::Hostile && me->IsHostileTo(unit)))
|
||||
{
|
||||
if (e.event.los.playerOnly && unit->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user