public static Vector3 TryFindObjectivePosition(IList <ObjectiveActor> objectives, int searchRadius, out ObjectiveActor foundObjective) { var objectiveMarkers = new HashSet <int>(objectives.Select(o => o.MarkerNameHash)); var miniMapMarker = AdvDia.CurrentWorldMarkers .FirstOrDefault(m => objectiveMarkers.Contains(m.NameHash) && m.Position.Distance(AdvDia.MyPosition) <= searchRadius && !EntryPortals.IsEntryPortal(AdvDia.CurrentWorldDynamicId, m.NameHash)); if (miniMapMarker != null) { foundObjective = objectives.FirstOrDefault(o => o.MarkerNameHash == miniMapMarker.Id); return(miniMapMarker.Position); } foundObjective = null; return(Vector3.Zero); }
public static TrinityMarker ScanForMarker(int markerNameHash, WorldMarkerType type, int searchRadius) { return(Core.Markers.Where(m => m.NameHash == markerNameHash && m.Position.Distance(AdvDia.MyPosition) <= searchRadius && !EntryPortals.IsEntryPortal(AdvDia.CurrentWorldDynamicId, m.NameHash)).OrderByDescending(a => a.MarkerType == type).FirstOrDefault()); }
public static TrinityMarker ScanForMarker(WorldMarkerType type, int searchRadius) { return(Core.Markers.FirstOrDefault(m => m.MarkerType == type && m.Position.Distance(AdvDia.MyPosition) <= searchRadius && !EntryPortals.IsEntryPortal(AdvDia.CurrentWorldDynamicId, m.NameHash))); }
public static Vector3 ScanForRiftExitMarkerLocation(int searchRadius = 2000) { var marker = Core.Markers.FirstOrDefault(m => m.MarkerType == WorldMarkerType.QuestSceneEntrance || m.MarkerType == WorldMarkerType.RiftPortalForward && m.Position.Distance(AdvDia.MyPosition) <= searchRadius && !EntryPortals.IsEntryPortal(AdvDia.CurrentWorldDynamicId, m.NameHash)); return(marker?.Position ?? Vector3.Zero); }
public static Vector3 ScanForMarkerLocation(WorldMarkerType type, int searchRadius) { var marker = Core.Markers.FirstOrDefault(m => m.MarkerType == type && m.Position.Distance(AdvDia.MyPosition) <= searchRadius && !EntryPortals.IsEntryPortal(AdvDia.CurrentWorldDynamicId, m.NameHash)); return(marker?.Position ?? Vector3.Zero); }
public static Vector3 ScanForMarkerLocation(int markerNameHash, int searchRadius) { var miniMapMarker = AdvDia.CurrentWorldMarkers .FirstOrDefault(m => m.NameHash == markerNameHash && m.Position.Distance2D(AdvDia.MyPosition) <= searchRadius && !EntryPortals.IsEntryPortal(AdvDia.CurrentWorldDynamicId, m.NameHash)); if (miniMapMarker != null) { return(miniMapMarker.Position); } return(Vector3.Zero); }
public static TrinityMarker ScanForMarker(string name, int searchRadius) { return(Core.Markers.FirstOrDefault(m => m.Name.ToLowerInvariant().Contains(name.ToLowerInvariant()) && m.Position.Distance(AdvDia.MyPosition) <= searchRadius && !EntryPortals.IsEntryPortal(AdvDia.CurrentWorldDynamicId, m.NameHash))); }
public static Vector3 ScanForMarkerLocation(string name, int searchRadius) { var marker = Core.Markers.FirstOrDefault(m => m.Name.ToLowerInvariant().Contains(name.ToLowerInvariant()) && m.Position.Distance(AdvDia.MyPosition) <= searchRadius && !EntryPortals.IsEntryPortal(AdvDia.CurrentWorldDynamicId, m.NameHash)); return(marker?.Position ?? Vector3.Zero); }