// If player is close to a target that is interesting to us, ignore the target... // The player may be going for the same mob, and we don't want to draw attention. // We'll blacklist the mob for a bit, in case the player is running around, or following // us. The excaption is ithe player is in our party, then we can freely kill any target // close to him. private bool BlacklistIfPlayerNearby(WoWObject target) { WoWUnit nearestCompetingPlayer = ObjectManager.GetObjectsOfType <WoWUnit>(true, false) .OrderBy(player => player.Location.Distance(target.Location)) .FirstOrDefault(player => player.IsPlayer && player.IsAlive && !player.IsInOurParty()); // If player is too close to the target, ignore target for a bit... if ((nearestCompetingPlayer != null) && (nearestCompetingPlayer.Location.Distance(target.Location) <= NonCompeteDistance)) { target.LocallyBlacklist(_delay_BlacklistPlayerTooClose); return(true); } return(false); }
// If player is close to a target that is interesting to us, ignore the target... // The player may be going for the same mob, and we don't want to draw attention. // We'll blacklist the mob for a bit, in case the player is running around, or following // us. The excaption is ithe player is in our party, then we can freely kill any target // close to him. private bool BlacklistIfPlayerNearby(WoWObject target) { WoWUnit nearestCompetingPlayer = ObjectManager.GetObjectsOfType<WoWUnit>(true, false) .OrderBy(player => player.Location.Distance(target.Location)) .FirstOrDefault(player => player.IsPlayer && player.IsAlive && !player.IsInOurParty()); // If player is too close to the target, ignore target for a bit... if ((nearestCompetingPlayer != null) && (nearestCompetingPlayer.Location.Distance(target.Location) <= NonCompeteDistance)) { target.LocallyBlacklist(Delay_BlacklistPlayerTooClose); return (true); } return (false); }