private bool CombatTargetingOnInclusionCalcuation(NetworkObject entity)
{
try
{
var m = entity as Monster;
if (m == null)
return false;
if (AreaStateCache.Current.IsBlacklisted(m))
return false;
// Do not consider inactive/dead mobs.
if (!m.IsActive)
return false;
// Ignore any mob that cannot die.
if (m.CannotDie)
return false;
// Ignore mobs that are too far to care about.
if (m.Distance > (_currentLeashRange != -1 ? ExampleRoutineSettings.Instance.CombatRange : 300))
return false;
// Ignore any mob near Divine Shrine: thanks ExVault!
if (m.HasAura("shrine_godmode"))
return false;
if (m.HasAura("bloodlines_necrovigil"))
{
Log.ErrorFormat("[CombatTargetingOnInclusionCalcuation] {0} ({1}) has bloodlines_necrovigil!", m.Name, m.Id);
AreaStateCache.Current.Blacklist(m.Id, TimeSpan.FromHours(1), "bloodlines_necrovigil");
return false;
}
// Ignore Piety's portals.
if (m.Name == "Chilling Portal" || m.Name == "Burning Portal")
{
return false;
}
}
catch (Exception ex)
{
Log.Error("[CombatOnInclusionCalcuation]", ex);
return false;
}
return true;
}