public static IsSafeResult isSafePoint(Vector2 point, bool igonre = false) { var result = new IsSafeResult(); result.SkillshotList = new List<Skillshot>(); result.casters = new List<Obj_AI_Base>(); bool safe = (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo)) || point.To3D().CountEnemiesInRange(500) > Variables._Player.HealthPercent % 65; if (!safe) { result.IsSafe = false; return result; } foreach (var skillshot in Variables.EvadeDetectedSkillshots) { if (skillshot.IsDanger(point) && skillshot.IsAboutToHit(500, Variables._Player)) { result.SkillshotList.Add(skillshot); result.casters.Add(skillshot.Unit); } } result.IsSafe = (result.SkillshotList.Count == 0); return result; }
private static void DrawCircleOnMinimap(float positionX, float positionY, float range) { float step = 2 * (float)Math.PI / 70; float h = positionX; float k = positionY; float r = range; float x_save = 0; float y_save = 0; for (float theta = 0; theta < 2 * Math.PI + 20; theta += step) { float x = h + r * (float)Math.Cos(theta); float y = k - r * (float)Math.Sin(theta); if (theta == 0) { x_save = x; y_save = y; } Vector2 saveVector = new Vector2(x_save, y_save); Vector2 newVector = new Vector2(x, y); if (x > 0 && x < 14500 && y > 0 && y < 14500 && x_save > 0 && x_save < 14500 && y_save > 0 && y_save < 14500) // Map limits (to fix bugged drawing) Drawing.DrawLine(Drawing.WorldToMinimap(saveVector.To3D()), Drawing.WorldToMinimap(newVector.To3D()), 1, System.Drawing.Color.YellowGreen); x_save = x; y_save = y; } }
public static bool IsCondemable(this AIHeroClient unit, Vector2 pos = new Vector2()) { if (unit.HasBuffOfType(BuffType.SpellImmunity) || unit.HasBuffOfType(BuffType.SpellShield) || LastCheck + 50 > Environment.TickCount || _Player.IsDashing()) return false; var prediction = ESpell.GetPrediction(unit); var predictionsList = pos.IsValid() ? new List<Vector3>() {pos.To3D()} : new List<Vector3> { unit.ServerPosition, unit.Position, prediction.CastPosition, prediction.UnitPosition }; var wallsFound = 0; Program.Points = new List<Vector2>(); foreach (var position in predictionsList) { for (var i = 0; i < Program.CondemnMenu["pushDistance"].Cast<Slider>().CurrentValue; i += (int) unit.BoundingRadius) { var cPos = _Player.Position.Extend(position, _Player.Distance(position) + i).To3D(); Program.Points.Add(cPos.To2D()); if (NavMesh.GetCollisionFlags(cPos).HasFlag(CollisionFlags.Wall) || NavMesh.GetCollisionFlags(cPos).HasFlag(CollisionFlags.Building)) { wallsFound++; break; } } } if ((wallsFound/ predictionsList.Count) >= Program.CondemnMenu["condemnPercent"].Cast<Slider>().CurrentValue/100f) { return true; } return false; }
private static void CastQ(Obj_AI_Base unit, Vector2 unitPosition, int minTargets = 0) { var points = new List<Vector2>(); var hitBoxes = new List<int>(); var startPoint = ObjectManager.Player.ServerPosition.To2D(); var originalDirection = Q.Range*(unitPosition - startPoint).Normalized(); foreach (var enemy in ObjectManager.Get<Obj_AI_Hero>()) { if (enemy.IsValidTarget() && enemy.NetworkId != unit.NetworkId) { var pos = Q.GetPrediction(enemy); if (pos.HitChance >= Prediction.HitChance.LowHitchance) { points.Add(pos.Position.To2D()); hitBoxes.Add((int) enemy.BoundingRadius); } } } var posiblePositions = new List<Vector2>(); for (var i = 0; i < 3; i++) { if (i == 0) posiblePositions.Add(unitPosition + originalDirection.Rotated(0)); if (i == 1) posiblePositions.Add(startPoint + originalDirection.Rotated(Qangle)); if (i == 2) posiblePositions.Add(startPoint + originalDirection.Rotated(-Qangle)); } if (startPoint.Distance(unitPosition) < 900) { for (var i = 0; i < 3; i++) { var pos = posiblePositions[i]; var direction = (pos - startPoint).Normalized().Perpendicular(); var k = (2/3*(unit.BoundingRadius + Q.Width)); posiblePositions.Add(startPoint - k*direction); posiblePositions.Add(startPoint + k*direction); } } var bestPosition = new Vector2(); var bestHit = -1; foreach (var position in posiblePositions) { var hits = CountHits(position, points, hitBoxes); if (hits > bestHit) { bestPosition = position; bestHit = hits; } } if (bestHit + 1 <= minTargets) return; Q.Cast(bestPosition.To3D(), true); }
private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args) { if (sender == null || !sender.IsValid || args == null) { return; } var target = args.Target; if (target == null || !target.IsValid) { return; } if (sender.IsMe && sender.UnderTurret(true) && target.IsEnemy) { } if (sender is Obj_AI_Turret && target.IsMe) { } if (sender is Obj_AI_Minion && target.IsMe) { var orbwalkingPos = new Vector2 { X = ObjectManager.Player.Position.X + ObjConstants.DefensiveAdditioner, Y = ObjectManager.Player.Position.Y + ObjConstants.DefensiveAdditioner }; ObjectManager.Player.IssueOrder(GameObjectOrder.MoveTo, orbwalkingPos.To3D()); } }
public static void Drawing_OnDraw() { Vector2 drakeWallQPos = new Vector2(12050, 4827); Vector2 midWallQPos = new Vector2(6962, 8952); if (drakeWallQPos.Distance(_Player) < 3000) new Circle() { Color = _Player.Distance(drakeWallQPos) <= 100 ? Color.DodgerBlue : Color.White, Radius = 100 }.Draw(drakeWallQPos.To3D()); if (midWallQPos.Distance(_Player) < 3000) new Circle() { Color = _Player.Distance(midWallQPos) <= 100 ? Color.DodgerBlue : Color.White, Radius = 100 }.Draw(midWallQPos.To3D()); }
public static bool GetPredPos(Obj_AI_Hero enemy, bool additionalReactionTime = false, bool additionalBarrelTime = false) { PredPos = SPrediction.Prediction.GetFastUnitPosition(enemy, Config.Menu.Item("misc.enemyReactionTime").GetValue<Slider>().Value); float reactionDistance = Config.Menu.Item("misc.enemyReactionTime").GetValue<Slider>().Value + (additionalReactionTime? Config.Menu.Item("misc.additionalReactionTime").GetValue<Slider>().Value : 0) * enemy.MoveSpeed*0.001f; if (PredPos.Distance(enemy) > reactionDistance) { PredPos = enemy.Position.Extend(PredPos.To3D(), reactionDistance).To2D(); } return true; }
//Quickscope : Attempt to cast QE quickcombo to target position, pos : target position (use correctThisPos for optimal results), targettarget (1hp required) : the initial barrel to use, if the target barrel is within E range and distance to player is greater than 500 (avoid long backward walking) it will move to it before casting the combo public static void quickscope(BarrelsManager.Barrel target, Vector2 pos) { bool canconnect = false; bool shouldmove = false; bool inposition = false; bool done = false; //Verify if the wanted position is within range if (Program.Player.Position.Distance(pos.To3D()) < Program.E.Range) { canconnect = true; } else { canconnect = false; } //Verify if we should move in order to get the combo if ((Program.Player.Distance(target.barrel) > 610 && Program.Player.Distance(target.barrel) < 1000) || (Program.Player.Distance(target.barrel) < 590 && Program.Player.Distance(target.barrel) > 500)) shouldmove = true; else if (Program.Player.Distance(target.barrel) >= 590 && Program.Player.Distance(target.barrel) <= 610) { shouldmove = false; inposition = true; } else shouldmove = false; //If requirements are K we move if (shouldmove && canconnect) { Vector3 position = Program.Player.Position; double vX = position.X - target.barrel.Position.X; double vY = position.Y - target.barrel.Position.Y; double magV = Math.Sqrt(vX * vX + vY * vY); double aX = Math.Round(target.barrel.Position.X + vX / magV * 600); double aY = Math.Round(target.barrel.Position.Y + vY / magV * 600); Vector2 newPosition = new Vector2(Convert.ToInt32(aX), Convert.ToInt32(aY)); if (position.Distance(target.barrel.Position) - 580 >= 50) //If correction is far from hero Program.Player.IssueOrder(GameObjectOrder.MoveTo, newPosition.To3D()); else //If correction is within hero hitbox (wont move cauz distance too small) { Program.Player.IssueOrder(GameObjectOrder.MoveTo, new Vector2(Program.Player.Position.X - 200, Program.Player.Position.Y - 200).To3D()); Utility.DelayAction.Add(50, () => Program.Player.IssueOrder(GameObjectOrder.MoveTo, newPosition.To3D())); } } //If all is K we quickscope if (inposition && target.barrel.Health == 1 && !done) { Program.Q.CastOnUnit(target.barrel); Program.E.Cast(pos); done = true; } }
public static void Insec(Obj_AI_Hero target) { Rpos = Player.Position.To2D().Extend(target.Position.To2D(), Player.Distance(target) + 250); if (Rpos.Distance(Player.Position) <= R.Range) { if (Player.Distance(Rpos.Extend(target.Position.To2D(), 700 - target.Distance(Rpos))) < E.Range && !IsWall(Rpos.To3D()) && target.IsFacing(Player)) { R.Cast(Rpos); } } }
public static bool PutWard(Vector2 pos) { //Loop through inventory and place down whatever wards you have. Taken from Lee Sin scripts int wardItem; if ((wardItem = GetWardId()) != -1) { foreach (var slot in ObjectManager.Player.InventoryItems.Where(slot => slot.Id == (ItemId)wardItem)) { Items.UseItem(wardItem, pos.To3D()); return true; } } return false; }
public static bool putWard(Vector2 pos) { int wardItem; if ((wardItem = getJumpWardId()) != -1) { foreach (var slot in Player.InventoryItems.Where(slot => slot.Id == (ItemId) wardItem)) { if (lastward < Environment.TickCount) { ObjectManager.Player.Spellbook.CastSpell(slot.SpellSlot, pos.To3D()); lastward = Environment.TickCount + 2000; return true; } return false; } } return false; }
public static Vector3 PassivePosition(Obj_AI_Base target) { var passive = FioraPassiveObjects.FirstOrDefault(x => x.Position.Distance(target.Position) <= 50); var position = Prediction.Position.PredictUnitPosition(target, 250); if (passive == null) return new Vector3(); if (passive.Name.Contains("NE")) { var pos = new Vector2 { X = position.X, Y = position.Y + 150 }; return pos.To3D(); } if (passive.Name.Contains("SE")) { var pos = new Vector2 { X = position.X - 150, Y = position.Y }; return pos.To3D(); } if (passive.Name.Contains("NW")) { var pos = new Vector2 { X = position.X + 150, Y = position.Y }; return pos.To3D(); } if (passive.Name.Contains("SW")) { var pos = new Vector2 { X = position.X, Y = position.Y - 150 }; return pos.To3D(); } return new Vector3(); }
public static void MoveTo(Vector2 movePos) { if (!Situation.ShouldDodge()) { return; } Evade.lastEvadeCommand = new EvadeCommand { order = EvadeOrderCommand.MoveTo, targetPosition = movePos, timestamp = EvadeUtils.TickCount, isProcessed = false }; Evade.lastMoveToPosition = movePos; Evade.lastMoveToServerPos = myHero.ServerPosition.To2D(); myHero.IssueOrder(GameObjectOrder.MoveTo, movePos.To3D(), false); }
public static void Condemn360(Obj_AI_Hero hero, Vector2 pos = new Vector2()) { if (hero.HasBuffOfType(BuffType.SpellImmunity) || hero.HasBuffOfType(BuffType.SpellShield) || LastCheck + 50 > Environment.TickCount || ObjectManager.Player.IsDashing()) { return; } var prediction = VayneSpells.E.GetPrediction(hero); var predictionsList = pos.IsValid() ? new List<Vector3>() { pos.To3D() } : new List<Vector3> { hero.ServerPosition, hero.Position, prediction.CastPosition, prediction.UnitPosition }; var wallsFound = 0; Points = new List<Vector2>(); foreach (var position in predictionsList) { for (var i = 0; i < PushDistance; i += (int)hero.BoundingRadius) // 420 = push distance { var cPos = ObjectManager.Player.Position.Extend(position, ObjectManager.Player.Distance(position) + i).To2D(); Points.Add(cPos); if (NavMesh.GetCollisionFlags(cPos.To3D()).HasFlag(CollisionFlags.Wall) || NavMesh.GetCollisionFlags(cPos.To3D()).HasFlag(CollisionFlags.Building)) { wallsFound++; break; } } } if ((wallsFound / predictionsList.Count) >= 33 / 100f) { VayneSpells.E.Cast(hero); } }
public static void PutWard(Vector2 pos, ItemId warditem) { foreach (var slot in Player.InventoryItems.Where(slot => slot.Id == warditem)) { ObjectManager.Player.Spellbook.CastSpell(slot.SpellSlot, pos.To3D()); return; } }
public static List<Vector3> PassiveRadiusPoint(Obj_AI_Base target) { var passive = FioraPassiveObjects.FirstOrDefault(x => x.Position.Distance(target.Position) <= 50); var position = Prediction.Position.PredictUnitPosition(target, 250); if (passive == null) return new List<Vector3>(); if (passive.Name.Contains("NE")) { var pos1 = new Vector2 { X = position.X + 150/(float) Math.Sqrt(2), Y = position.Y + 150/(float) Math.Sqrt(2) }; var pos2 = new Vector2 { X = position.X - 150/(float) Math.Sqrt(2), Y = position.Y + 150/(float) Math.Sqrt(2) }; return new List<Vector3>() { pos1.To3D(), pos2.To3D() }; } if (passive.Name.Contains("SE")) { var pos1 = new Vector2 { X = position.X - 150/(float) Math.Sqrt(2), Y = position.Y - 150/(float) Math.Sqrt(2) }; var pos2 = new Vector2 { X = position.X - 150/(float) Math.Sqrt(2), Y = position.Y + 150/(float) Math.Sqrt(2) }; return new List<Vector3>() { pos1.To3D(), pos2.To3D() }; } if (passive.Name.Contains("NW")) { var pos1 = new Vector2 { X = position.X + 150/(float) Math.Sqrt(2), Y = position.Y - 150/(float) Math.Sqrt(2) }; var pos2 = new Vector2 { X = position.X + 150/(float) Math.Sqrt(2), Y = position.Y + 150/(float) Math.Sqrt(2) }; return new List<Vector3>() { pos1.To3D(), pos2.To3D() }; } if (passive.Name.Contains("SW")) { var pos1 = new Vector2 { X = position.X + 150/(float) Math.Sqrt(2), Y = position.Y - 150/(float) Math.Sqrt(2) }; var pos2 = new Vector2 { X = position.X - 150/(float) Math.Sqrt(2), Y = position.Y - 150/(float) Math.Sqrt(2) }; return new List<Vector3>() { pos1.To3D(), pos2.To3D() }; } return new List<Vector3>(); }
public static PredictionOutput GetPrediction(PredictionInput input) { var mainTargetPrediction = Prediction.GetPrediction(input, false, true); var posibleTargets = new List<PossibleTarget> { new PossibleTarget { Position = mainTargetPrediction.UnitPosition.To2D(), Unit = input.Unit } }; if (mainTargetPrediction.Hitchance >= HitChance.Medium) { //Add the posible targets in range: posibleTargets.AddRange(GetPossibleTargets(input)); } if (posibleTargets.Count > 1) { var candidates = new List<Vector2>(); foreach (var target in posibleTargets) { target.Position = target.Position - input.From.To2D(); } for (var i = 0; i < posibleTargets.Count; i++) { for (var j = 0; j < posibleTargets.Count; j++) { if (i != j) { var p = (posibleTargets[i].Position + posibleTargets[j].Position) * 0.5f; if (!candidates.Contains(p)) { candidates.Add(p); } } } } var bestCandidateHits = -1; var bestCandidate = new Vector2(); var positionsList = posibleTargets.Select(t => t.Position).ToList(); foreach (var candidate in candidates) { var hits = GetHits(candidate, input.Range, input.Radius, positionsList); if (hits > bestCandidateHits) { bestCandidate = candidate; bestCandidateHits = hits; } } bestCandidate = bestCandidate + input.From.To2D(); if (bestCandidateHits > 1 && input.From.To2D().Distance(bestCandidate, true) > 50 * 50) { return new PredictionOutput { Hitchance = mainTargetPrediction.Hitchance, _aoeTargetsHitCount = bestCandidateHits, UnitPosition = mainTargetPrediction.UnitPosition, CastPosition = bestCandidate.To3D(), Input = input }; } } return mainTargetPrediction; }
public static Vector3 GetTendency(Obj_AI_Base unit) { var paths = GetStoredPaths(unit, MaxTime); var result = new Vector2(); foreach (var path in paths) { var k = 1; //(MaxTime - path.Time); result = result + k * (path.EndPoint - unit.ServerPosition.To2D() /*path.StartPoint*/).Normalized(); } result /= paths.Count; return result.To3D(); }
public static bool CheckMovePath(Vector2 movePos, float extraDelay = 0) { /*if (EvadeSpell.lastSpellEvadeCommand.evadeSpellData != null) { var evadeSpell = EvadeSpell.lastSpellEvadeCommand.evadeSpellData; float evadeTime = ObjectCache.gamePing; if (EvadeSpell.lastSpellEvadeCommand.evadeSpellData.evadeType == EvadeType.Dash) evadeTime += evadeSpell.spellDelay + ObjectCache.myHeroCache.serverPos2D.Distance(movePos) / (evadeSpell.speed / 1000); else if (EvadeSpell.lastSpellEvadeCommand.evadeSpellData.evadeType == EvadeType.Blink) evadeTime += evadeSpell.spellDelay; if (Evade.GetTickCount - EvadeSpell.lastSpellEvadeCommand.timestamp < evadeTime) { Console.WriteLine("in" + CheckMoveToDirection(EvadeSpell.lastSpellEvadeCommand.targetPosition, movePos)); return CheckMoveToDirection(EvadeSpell.lastSpellEvadeCommand.targetPosition, movePos); } }*/ var startPoint = myHero.Position; if (myHero.IsDashing()) { var dashItem = myHero.GetDashInfo(); startPoint = dashItem.EndPos.Normalized(); // startPoint = dashItem.EndPos.To3D(); } var path = myHero.GetPath(startPoint, movePos.To3D()); //from serverpos Vector2 lastPoint = Vector2.Zero; foreach (Vector3 point in path) { var point2D = point.To2D(); if (lastPoint != Vector2.Zero && CheckMoveToDirection(lastPoint, point2D, extraDelay)) { return true; } if (lastPoint != Vector2.Zero) { lastPoint = point2D; } else { lastPoint = myHero.ServerPosition.To2D(); } } return false; }
public static IOrderedEnumerable<PositionInfo> GetBestPositionTest() { int posChecked = 0; int maxPosToCheck = 50; int posRadius = 50; int radiusIndex = 0; Vector2 heroPoint = ObjectCache.myHeroCache.serverPos2D; Vector2 lastMovePos = Game.CursorPos.To2D(); var extraDelayBuffer = ObjectCache.menuCache.cache["ExtraPingBuffer"].Cast<Slider>().CurrentValue; var extraEvadeDistance = ObjectCache.menuCache.cache["ExtraEvadeDistance"].Cast<Slider>().CurrentValue; if (ObjectCache.menuCache.cache["HigherPrecision"].Cast<CheckBox>().CurrentValue) { maxPosToCheck = 150; posRadius = 25; } List<PositionInfo> posTable = new List<PositionInfo>(); List<Vector2> fastestPositions = GetFastestPositions(); Spell lowestEvadeTimeSpell; var lowestEvadeTime = SpellDetector.GetLowestEvadeTime(out lowestEvadeTimeSpell); foreach (var pos in fastestPositions) //add the fastest positions into list of candidates { posTable.Add(InitPositionInfo(pos, extraDelayBuffer, extraEvadeDistance, lastMovePos, lowestEvadeTimeSpell)); } while (posChecked < maxPosToCheck) { radiusIndex++; int curRadius = radiusIndex * (2 * posRadius); int curCircleChecks = (int)Math.Ceiling((2 * Math.PI * (double)curRadius) / (2 * (double)posRadius)); for (int i = 1; i < curCircleChecks; i++) { posChecked++; var cRadians = (2 * Math.PI / (curCircleChecks - 1)) * i; //check decimals var pos = new Vector2((float)Math.Floor(heroPoint.X + curRadius * Math.Cos(cRadians)), (float)Math.Floor(heroPoint.Y + curRadius * Math.Sin(cRadians))); posTable.Add(InitPositionInfo(pos, extraDelayBuffer, extraEvadeDistance, lastMovePos, lowestEvadeTimeSpell)); if (pos.IsWall()) { //Render.Circle.DrawCircle(new Vector3(pos.X, pos.Y, myHero.Position.Z), (float)25, Color.White, 3); } /* if (posDangerLevel > 0) { Render.Circle.DrawCircle(new Vector3(pos.X, pos.Y, myHero.Position.Z), (float) posRadius, Color.White, 3); }*/ var path = myHero.GetPath(pos.To3D()); //Render.Circle.DrawCircle(path[path.Length - 1], (float)posRadius, Color.White, 3); //Render.Circle.DrawCircle(new Vector3(pos.X, pos.Y, myHero.Position.Z), (float)posRadius, Color.White, 3); //var posOnScreen = Drawing.WorldToScreen(path[path.Length - 1]); //Drawing.DrawText(posOnScreen.X, posOnScreen.Y, Color.Aqua, "" + path.Length); } } var sortedPosTable = posTable.OrderBy(p => p.isDangerousPos).ThenBy(p => p.posDangerLevel).ThenBy(p => p.posDangerCount).ThenBy(p => p.distanceToMouse); return sortedPosTable; }
public static bool CheckPointCollision(Obj_AI_Base unit, Vector2 movePos) { var path = unit.GetPath(movePos.To3D()); if (path.Length > 0) { if (movePos.Distance(path[path.Length - 1].To2D()) > 5) { return true; } } return false; }
public static bool CheckPathCollision(Obj_AI_Base unit, Vector2 movePos) { var path = unit.GetPath(ObjectCache.myHeroCache.serverPos2D.To3D(), movePos.To3D()); if (path.Length > 0) { if (movePos.Distance(path[path.Length - 1].To2D()) > 5 || path.Length > 2) { return true; } } return false; }
public static void CastSpell(EvadeSpellData spellData, Vector2 movePos) { EvadeSpell.lastSpellEvadeCommand = new EvadeCommand { order = EvadeOrderCommand.CastSpell, targetPosition = movePos, evadeSpellData = spellData, timestamp = EvadeUtils.TickCount, isProcessed = false }; myHero.Spellbook.CastSpell(spellData.spellKey, movePos.To3D(), false); }
private static void LockROnTarget() { var target = R.GetTarget(); if (target == null) { return; } var endPos = (Player.ServerPosition - target.ServerPosition).Normalized(); var predPos = R.GetPrediction(target).CastPosition.To2D(); var fullPoint = new Vector2(predPos.X + endPos.X * R.Range * 0.98f, predPos.Y + endPos.Y * R.Range * 0.98f); var closestPoint = Player.ServerPosition.To2D().Closest(new List<Vector2> { predPos, fullPoint }); if (closestPoint.IsValid() && !closestPoint.IsWall() && predPos.Distance(closestPoint) > E.Range) { Player.IssueOrder(GameObjectOrder.MoveTo, closestPoint.To3D()); } else if (fullPoint.IsValid() && !fullPoint.IsWall() && predPos.Distance(fullPoint) < R.Range && predPos.Distance(fullPoint) > 100) { Player.IssueOrder(GameObjectOrder.MoveTo, fullPoint.To3D()); } }
internal void CastWE(Obj_AI_Base unit, Vector2 unitPosition, int minTargets = 0, EloBuddy.SDK.Enumerations.HitChance hc = EloBuddy.SDK.Enumerations.HitChance.Medium) { var points = new List<Vector2>(); var hitBoxes = new List<int>(); Vector2 startPoint = Khazix.ServerPosition.LSTo2D(); Vector2 originalDirection = W.Range * (unitPosition - startPoint).Normalized(); foreach (AIHeroClient enemy in HeroManager.Enemies) { if (enemy.LSIsValidTarget() && enemy.NetworkId != unit.NetworkId) { var pos = WE.GetPrediction(enemy); if (pos.HitChance >= hc) { points.Add(pos.UnitPosition.LSTo2D()); hitBoxes.Add((int)enemy.BoundingRadius + 275); } } } var posiblePositions = new List<Vector2>(); for (int i = 0; i < 3; i++) { if (i == 0) posiblePositions.Add(unitPosition + originalDirection.Rotated(0)); if (i == 1) posiblePositions.Add(startPoint + originalDirection.Rotated(Wangle)); if (i == 2) posiblePositions.Add(startPoint + originalDirection.Rotated(-Wangle)); } if (startPoint.LSDistance(unitPosition) < 900) { for (int i = 0; i < 3; i++) { Vector2 pos = posiblePositions[i]; Vector2 direction = (pos - startPoint).Normalized().Perpendicular(); float k = (2 / 3 * (unit.BoundingRadius + W.Width)); posiblePositions.Add(startPoint - k * direction); posiblePositions.Add(startPoint + k * direction); } } var bestPosition = new Vector2(); int bestHit = -1; foreach (Vector2 position in posiblePositions) { int hits = CountHits(position, points, hitBoxes); if (hits > bestHit) { bestPosition = position; bestHit = hits; } } if (bestHit + 1 <= minTargets) return; W.Cast(bestPosition.To3D(), false); }
public static bool Cast(this SummonerSpell spell, Vector2 position) { return IsReady(spell) && (ObjectManager.Player.Distance(position, true) < spell.Range * spell.Range) && ObjectManager.Player.Spellbook.CastSpell(spell.Slot, position.To3D()); }
public static List<Vector3> UltiPassivePos(Obj_AI_Base target) { var poses = new List<Vector3>(); var passive = ObjectManager.Get<Obj_GeneralParticleEmitter>() .Where(x => x.Name.Contains("Fiora_Base_R_Mark") || (x.Name.Contains("Fiora_Base_R") && x.Name.Contains("Timeout_FioraOnly.troy"))); var position = Prediction.Position.PredictUnitPosition(target, 250); foreach (var x in passive) { if (x.Name.Contains("NE")) { var pos = new Vector2 { X = position.X, Y = position.Y + 150 }; poses.Add(pos.To3D()); } else if (x.Name.Contains("SE")) { var pos = new Vector2 { X = position.X - 150, Y = position.Y }; poses.Add(pos.To3D()); } else if (x.Name.Contains("NW")) { var pos = new Vector2 { X = position.X + 150, Y = position.Y }; poses.Add(pos.To3D()); } else if (x.Name.Contains("SW")) { var pos = new Vector2 { X = position.X, Y = position.Y - 150 }; poses.Add(pos.To3D()); } } return poses; }
public static bool threeSixty(AIHeroClient unit, Vector2 pos = new Vector2()) { if (unit.HasBuffOfType(BuffType.SpellImmunity) || unit.HasBuffOfType(BuffType.SpellShield) || ObjectManager.Player.LSIsDashing()) return false; var prediction = E.GetPrediction(unit); var predictionsList = pos.IsValid() ? new List<Vector3> { pos.To3D() } : new List<Vector3> { unit.ServerPosition, unit.Position, prediction.CastPosition, prediction.UnitPosition }; var wallsFound = 0; Points = new List<Vector2>(); foreach (var position in predictionsList) { for (var i = 0; i < getSliderItem(emenu, "PushDistance"); i += (int)unit.BoundingRadius) // 420 = push distance { var cPos = ObjectManager.Player.Position.LSExtend(position, ObjectManager.Player.LSDistance(position) + i); Points.Add(cPos.LSTo2D()); if (NavMesh.GetCollisionFlags(cPos).HasFlag(CollisionFlags.Wall) || NavMesh.GetCollisionFlags(cPos).HasFlag(CollisionFlags.Building)) { wallsFound++; break; } } } if (wallsFound / predictionsList.Count >= 33 / 100f) { return true; } return false; }
public static void moveTo(Vector2 Pos) { myHero.IssueOrder(GameObjectOrder.MoveTo, Pos.To3D()); }
//credits Brian(L$) public static void LockR() { var target = TargetSelector.GetTarget(1800, DamageType.Physical); if (target == null) { return; } var endPos = (ObjectManager.Player.ServerPosition - target.ServerPosition).Normalized(); var predPos = R.GetPrediction(target).CastPosition.To2D(); var fullPoint = new Vector2(predPos.X + endPos.X*R.Range*0.98f, predPos.Y + endPos.Y*R.Range*0.98f); var closestPoint = ObjectManager.Player.ServerPosition.To2D() .Closest(new List<Vector2> {predPos, fullPoint}); if (closestPoint.IsValid() && !NavMesh.GetCollisionFlags(closestPoint).HasFlag(CollisionFlags.Wall) && !NavMesh.GetCollisionFlags(closestPoint).HasFlag(CollisionFlags.Building) && predPos.Distance(closestPoint) > E.Range) { Orbwalker.MoveTo(closestPoint.To3D()); } else if (fullPoint.IsValid() && !NavMesh.GetCollisionFlags(fullPoint).HasFlag(CollisionFlags.Wall) && !NavMesh.GetCollisionFlags(fullPoint).HasFlag(CollisionFlags.Building) && predPos.Distance(fullPoint) < R.Range && predPos.Distance(fullPoint) > 100) { Orbwalker.MoveTo(fullPoint.To3D()); } }