Core/GuardAI: Guards don't evade if the target casts Vanish and also can detect players with Feign Death.
Core/Scripts: Moved scripts from ScriptedGuardAI to guards.cpp Core/Creature: Removed custom npcflags UNIT_NPC_FLAG_GUARD (now moved to flag_extras) and UNIT_NPC_FLAG_OUTDOORPVP (not used) Thanks to Kaelima, Xanadu, Shauren and linencloth. Signed-off-by: Manuel Carrasco <[email protected]>
This commit is contained in:
@@ -11879,9 +11879,19 @@ bool Unit::canAttack(Unit const* target, bool force) const
|
||||
else if (!IsHostileTo(target))
|
||||
return false;
|
||||
|
||||
if (!target->isAttackableByAOE() || target->HasUnitState(UNIT_STAT_DIED))
|
||||
if (!target->isAttackableByAOE())
|
||||
return false;
|
||||
|
||||
if (target->HasUnitState(UNIT_STAT_DIED))
|
||||
{
|
||||
if (!ToCreature() || !ToCreature()->isGuard())
|
||||
return false;
|
||||
|
||||
// guards can detect fake death
|
||||
if (!target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_vehicle)
|
||||
if (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user