public static Vector3 GetFarmingPosition() { var lasthittable = Minions.GetMinionsInLane(SessionBasedData.EnemyTeam, SessionBasedData.MyLane) .OrderBy(m => m.Health) .FirstOrDefault(m => m.Health > 1 && m.Health < ObjectManager.Player.GetAutoAttackDamage(m) * 2); var farthestTurret = Turrets.GetTurretsPosition(ObjectManager.Player.Team, SessionBasedData.CurrentLane).Last(); if (lasthittable != null) { return(GetLastHitPosition(lasthittable)); } var ourMinion = ObjectManager.Get <Obj_AI_Minion>().Where(m => m.IsAlly && !m.IsDead && m.Position.IsInside(SessionBasedData.CurrentLanePolygon)).OrderBy(m => m.Distance(GameObjects.AllyNexus)) .LastOrDefault(); if (ourMinion != null && ourMinion is Obj_AI_Minion) { return (new Geometry.Circle(ourMinion .ServerPosition.Extend(GameObjects.AllyNexus.Position, Math.Min(Utility.Random.GetRandomInteger(100, 350) + GetMinDistanceFromEnemies(), 1350)).ToVector2(), Utility.Random.GetRandomInteger(100, 350)).ToPolygon().GetRandomPointInPolygon()); } return(Game.CursorPos); }
public static Geometry.Polygon GetLanePolygonExtendedToFarthestMinion(GameObjectTeam laneZoneTeam, Lane lane, GameObjectTeam minionTeam, int maxFieldDistance = 1000) { var farthestTurret = Turrets.GetTurretsPosition(laneZoneTeam, lane).Last(); var mostdamaged = Minions.GetMostDamagedMinion(minionTeam, lane); var farthestMinion = mostdamaged != null ? mostdamaged : Minions.GetMinionsInLane(minionTeam, lane) .OrderBy(m => m.Distance(farthestTurret)) .FirstOrDefault(); if (farthestMinion != null) { return (new Geometry.Rectangle(farthestMinion.ServerPosition.ToVector2(), farthestMinion.ServerPosition.ToVector2().Extend(farthestTurret, maxFieldDistance), 700).ToPolygon()); } return(GetLanePolygon(laneZoneTeam, lane)); }