private bool FindGatherSpot() { if (GatherSpot != null) { return(false); } if (GatherSpots != null && Node.Location.Distance3D(ExProfileBehavior.Me.Location) > Distance) { GatherSpot = GatherSpots.OrderBy(gs => gs.NodeLocation.Distance3D(Node.Location)) .FirstOrDefault(gs => gs.NodeLocation.Distance3D(Node.Location) <= Distance); } // Either GatherSpots is null, the node is already in range, or there are no matches, use fallback if (GatherSpot == null) { if (Node == null || Node.Location == Vector3.Zero) { ResetInternal(); return(false); } SetFallbackGatherSpot(Node.Location, true); } Logger.Info(Localization.Localization.ExGather_GatherSpotSet + GatherSpot); return(true); }
internal void ResetInternal() { interactedWithNode = false; GatherSpot = null; Node = null; GatherItem = null; CollectableItem = null; }
private void SetFallbackGatherSpot(Vector3 location, bool useMesh) { switch (DefaultGatherSpotType) { // TODO: Smart stealth implementation (where any enemy within x distance and i'm not behind them, use stealth approach and set stealth location as current) // If flying, land in area closest to node not in sight of an enemy and stealth. case GatherSpotType.StealthGatherSpot: GatherSpot = new StealthGatherSpot { NodeLocation = location, UseMesh = useMesh }; break; // ReSharper disable once RedundantCaseLabel case GatherSpotType.GatherSpot: default: GatherSpot = new GatherSpot { NodeLocation = location, UseMesh = useMesh }; break; } }
private bool FindGatherSpot() { if (GatherSpot != null) { return false; } if (GatherSpots != null && Node.Location.Distance3D(Me.Location) > Distance) { GatherSpot = GatherSpots.OrderBy(gs => gs.NodeLocation.Distance3D(Node.Location)) .FirstOrDefault(gs => gs.NodeLocation.Distance3D(Node.Location) <= Distance); } // Either GatherSpots is null, the node is already in range, or there are no matches, use fallback if (GatherSpot == null) { SetFallbackGatherSpot(Node.Location, true); } Logger.Info("GatherSpot set -> " + GatherSpot); return true; }
private void SetFallbackGatherSpot(Vector3 location, bool useMesh) { switch (DefaultGatherSpotType) { // TODO: Smart stealth implementation (where any enemy within x distance and i'm not behind them, use stealth approach and set stealth location as current) // If flying, land in area closest to node not in sight of an enemy and stealth. case GatherSpotType.StealthApproachGatherSpot: case GatherSpotType.StealthGatherSpot: GatherSpot = new StealthGatherSpot { NodeLocation = location, UseMesh = useMesh }; break; // ReSharper disable once RedundantCaseLabel case GatherSpotType.GatherSpot: default: GatherSpot = new GatherSpot { NodeLocation = location, UseMesh = useMesh }; break; } }
private bool FindGatherSpot() { if (GatherSpot != null) { return false; } if (GatherSpots != null && Node.Location.Distance3D(ExProfileBehavior.Me.Location) > Distance) { GatherSpot = GatherSpots.OrderBy(gs => gs.NodeLocation.Distance3D(Node.Location)) .FirstOrDefault(gs => gs.NodeLocation.Distance3D(Node.Location) <= Distance); } // Either GatherSpots is null, the node is already in range, or there are no matches, use fallback if (GatherSpot == null) { if (Node == null || Node.Location == Vector3.Zero) { ResetInternal(); return false; } SetFallbackGatherSpot(Node.Location, true); } Logger.Info(Localization.Localization.ExGather_GatherSpotSet + GatherSpot); return true; }