private Vector3 GetTumblePos(Obj_AI_Base target) { if (Orbwalker.ActiveMode != OrbwalkingMode.Combo) { return(GetAggressiveTumblePos(target)); } var cursorPos = Game.CursorPos; var targetCrowdControl = from tuplet in CachedCrowdControl where tuplet.Item1 == target.CharData.BaseSkinName select tuplet.Item2; if (!IsDangerousPosition(cursorPos) && !(targetCrowdControl.FirstOrDefault() != null && targetCrowdControl.Any( crowdControlEntry => target.Spellbook.GetSpell(crowdControlEntry.Slot).IsReady()))) { return(cursorPos); } //if the target is not a melee and he's alone he's not really a danger to us, proceed to 1v1 him :^ ) if (!target.IsMelee && ObjectManager.Player.CountEnemyHeroesInRange(800) == 1) { return(cursorPos); } var targetWaypoints = MathUtils.GetWaypoints(target); if (targetWaypoints[targetWaypoints.Count - 1].Distance(ObjectManager.Player.ServerPosition) > 550) { return(Vector3.Zero); } var aRC = new Geometry.Circle(ObjectManager.Player.ServerPosition.ToVector2(), 300).ToPolygon().ToClipperPath(); var targetPosition = target.ServerPosition; var pList = (from p in aRC select new Vector2(p.X, p.Y).ToVector3() into v3 let dist = v3.Distance(targetPosition) where !IsDangerousPosition(v3) && dist < 500 select v3).ToList(); if (ObjectManager.Player.UnderTurret() || ObjectManager.Player.CountEnemyHeroesInRange(800) == 1 || cursorPos.CountEnemyHeroesInRange(450) <= 1) { return(pList.Count > 1 ? pList.OrderBy(el => el.Distance(cursorPos)).FirstOrDefault() : Vector3.Zero); } return(pList.Count > 1 ? pList.OrderByDescending(el => el.Distance(cursorPos)).FirstOrDefault() : Vector3.Zero); }
public static void OnRender() { if (Global.Player.IsDead) { return; } if (Global.Orbwalker.Mode != OrbwalkingMode.None && MenuConfig.Drawings["Debug"].Enabled) { var circle = new Geometry.Circle(Global.Player.GetDashInfo().EndPos, 200); Render.Circle(circle.Center.To3D(), circle.Radius, 100, Color.DarkGray); } if (SpellConfig.R.Ready && MenuConfig.Drawings["R"].Enabled) { Render.Circle(Global.Player.Position, SpellConfig.R.Range, (uint)MenuConfig.Drawings["Segments"].Value, Color.Cyan); } if (MenuConfig.Drawings["Range"].Enabled && MenuConfig.Combo["Dash"].Value == 0 && Global.Orbwalker.Mode != OrbwalkingMode.None) { Render.Circle(Game.CursorPos, MenuConfig.Combo["Range"].Value, (uint)MenuConfig.Drawings["Segments"].Value, Color.White); } if (MenuConfig.Drawings["Debug"].Enabled) { Render.WorldToScreen(Global.Player.Position, out var temp); Render.Text("Q Mode: " + Extension.CurrentMode + " | Range: " + SpellConfig.Q.Range, new Vector2(temp.X - 55, temp.Y + 40), RenderTextFlags.Center, Color.Cyan); } if (SpellConfig.E.Ready && MenuConfig.Drawings["Path"].Enabled) { if (MinionHelper.ExtendedMinion.IsZero || MinionHelper.ExtendedTarget.IsZero) { return; } Render.WorldToScreen(MinionHelper.ExtendedTarget, out var targetV2); Render.WorldToScreen(MinionHelper.ExtendedMinion, out var minionV2); Render.WorldToScreen(Global.Player.ServerPosition, out var playerV2); Render.Line(playerV2, minionV2, Color.DeepSkyBlue); Render.Line(minionV2, targetV2, Color.DeepPink); Render.Circle(MinionHelper.ExtendedMinion, 50, 300, Color.White); } }
public void Draw(Drawer drawer) { var forward = Vector3.forward; var alpha = 0.3f; var color = LeapColor.cerulean.WithAlpha(alpha); // Near surface. var nearVec = forward * near; var nearRad = Mathf.Tan(angle / 2f * Mathf.Deg2Rad) * near; var nearCircle = new Geometry.Circle(center: nearVec, direction: forward, radius: nearRad, transform: transform); nearCircle.Draw(drawer, color); // Far surface. var farVec = forward * far; var farRad = Mathf.Tan(angle / 2f * Mathf.Deg2Rad) * far; var farCircle = new Geometry.Circle(center: farVec, direction: forward, radius: farRad, transform: transform); farCircle.Draw(drawer, color); var nearCirclePoints = nearCircle.Points(7); var farCirclePoints = farCircle.Points(7); for (var i = 0; i < 7; i++) { nearCirclePoints.MoveNext(); farCirclePoints.MoveNext(); drawer.Line(nearCirclePoints.Current, farCirclePoints.Current); } for (var rMult = 0.8f; rMult > 0.1f; rMult -= 0.2f) { drawer.color = color.WithAlpha(rMult * rMult * alpha); nearCircle.radius = nearRad * rMult; nearCircle.Draw(drawer); } for (var rMult = 0.8f; rMult > 0.1f; rMult -= 0.2f) { drawer.color = color.WithAlpha(rMult * rMult * alpha); farCircle.radius = farRad * rMult; farCircle.Draw(drawer); } }
private static Vector3 EcastPos(AIBaseClient target = null) { if (target == null) { return(Vector3.Zero); } var circles = new Geometry.Circle(target.Position, 400f).Points.OrderBy(c => c.DistanceToPlayer()); var check = false; var pos = Vector3.Zero; foreach (var circle in circles) { for (int i = 0; i <= 700; i++) { var flag = NavMesh.GetCollisionFlags((ObjectManager.Player.Position.ToVector2().Extend(circle, i)).ToVector3()); if (flag.HasFlag(CollisionFlags.Building) || flag.HasFlag(CollisionFlags.Wall)) { check = true; i += 800; pos = circle.ToVector3(); } else { check = false; } } if (!check) { continue; } } if (check) { return(pos); } else { return(Vector3.Zero); } }
public Skillshot(DetectionType detectionType, SpellData spellData, int startT, Vector2 start, Vector2 end, Obj_AI_Base unit) { DetectionType = detectionType; SpellData = spellData; StartTick = startT; Start = start; End = end; MissilePosition = start; Direction = (end - start).Normalized(); Unit = unit; switch (spellData.Type) { case SkillShotType.SkillshotCircle: Circle = new Geometry.Circle(CollisionEnd, spellData.Radius); break; case SkillShotType.SkillshotLine: Rectangle = new Geometry.Rectangle(Start, CollisionEnd, spellData.Radius); break; case SkillShotType.SkillshotMissileLine: Rectangle = new Geometry.Rectangle(Start, CollisionEnd, spellData.Radius); break; case SkillShotType.SkillshotCone: Sector = new Geometry.Sector( start, CollisionEnd - start, spellData.Radius * (float)Math.PI / 180, spellData.Range); break; case SkillShotType.SkillshotRing: Ring = new Geometry.Ring(CollisionEnd, spellData.Radius, spellData.RingRadius); break; case SkillShotType.SkillshotArc: Arc = new Geometry.Arc(start, end, EvadeManager.SkillShotsExtraRadius + (int)ObjectManager.Player.BoundingRadius); break; } UpdatePolygon(); }
private static void AUTOWHIT(EventArgs args) { if (ME.IsDead || !BrandSettings.Whit.Enabled) { return; } if (!W.IsReady()) { return; } var targets = TargetSelector.GetTargets(W.Range).OrderBy(i => i.DistanceToPlayer()); if (targets == null) { return; } foreach (var target in targets) { if (target == null) { return; } var pred = FSpred.Prediction.Prediction.GetPrediction(W, target); if (pred != null && pred.Hitchance >= FSpred.Prediction.HitChance.High) { WPoly = new Geometry.Circle(pred.CastPosition, 260f); var targethit = GameObjects.EnemyHeroes.Where(i => WPoly.IsInside(i.Position)); var targethitcount = targethit.Count(); if (targethitcount >= BrandSettings.Whit.ActiveValue && pred.CastPosition.DistanceToPlayer() <= W.Range) { if (W.Cast(pred.CastPosition)) { return; } } } } }
public Triangle(Vector3 a, Vector3 b, Vector3 c) { pointA = a; pointB = b; pointC = c; AB = new Line(pointA, pointB); BC = new Line(pointB, pointC); CA = new Line(pointC, pointA); lines = new Line[4]; lines[0] = AB; lines[1] = BC; lines[2] = CA; numPointsInCircle = 0; circumCircle = new Geometry.Circle(); circumCircle = CalculateCircumcircle(this); }
private Vector3 GetSafeTumblePos(AIHeroClient target) { if (!target.IsValidTarget()) { return(Vector3.Zero); } var targetPosition = target.ServerPosition; var myTumbleRangeCircle = new Geometry.Circle(ObjectManager.Player.ServerPosition.To2D(), 300).ToPolygon().ToClipperPath(); var goodCandidates = from p in myTumbleRangeCircle select new Vector2(p.X, p.Y).To3D() into v3 let dist = v3.Distance(targetPosition) where dist > Menu.Item("QMinDist", true).GetValue <Slider>().Value&& dist < 500 select v3; return(goodCandidates.OrderBy(candidate => candidate.Distance(Game.CursorPos)).FirstOrDefault()); }
private static Vector3 Rpos() { var pos = Vector3.Zero; var targets = GameObjects.EnemyHeroes.Where(i => i.IsValidTarget(R.Range) && i.HasBuff("kaisapassivemarker")); var turret = GameObjects.EnemyTurrets.Where(i => i.IsValidTarget(R.Range)).FirstOrDefault(); if (targets == null) { pos = Vector3.Zero; } foreach (var target in targets) { Geometry.Circle newcircle = new Geometry.Circle(target.Position, ObjectManager.Player.GetRealAutoAttackRange() - 200, 20); var circle = newcircle.Points.Where(c => c.CountEnemyHeroesInRange(400) <= 2).FirstOrDefault(); return(circle.ToVector3()); } return(pos); }
public static bool GetLineAoeCanHit(float spellrange, float spellwidth, AIBaseClient target, HitChance hitChance, Vector3 endRange, bool boundingRadius = true) { if (target == null || target.IsDashing()) { return(false); } var targetPosition = target.PreviousPosition.ToVector2(); var fromPosition = ObjectManager.Player.PreviousPosition; var width = spellwidth + (boundingRadius ? target.BoundingRadius * BoundingRadiusMultiplicator : 0); var boundradius = (boundingRadius ? target.BoundingRadius * BoundingRadiusMultiplicator : target.BoundingRadius); var rect = new Geometry.Rectangle(fromPosition, endRange, width); var circ = new Geometry.Circle(targetPosition, boundradius); return(circ.Points.Select(point => rect.IsInside(point)).FirstOrDefault()); }
private static Vector3 GetQCastPos(this AIHeroClient target) { if (target.CombatType != GameObjectCombatType.Melee && !Game.CursorPos.IsWall()) { return(Game.CursorPos); } var allcastpos = new List <EnsoulSharp.SDK.Clipper.IntPoint>(); if (ObjectManager.Player.CountEnemyHeroesInRange(800) > 1) { var circel = new Geometry.Circle(ObjectManager.Player.Position, 300).ToClipperPath(); allcastpos.AddRange(circel.Where(c => !Helper.UnderTower(new Vector3(c.X, c.Y, 0)) && (target.IsFacing(ObjectManager.Player)) ? (new Vector3(c.X, c.Y, 0)).Distance(target) <= 530 : (new Vector3(c.X, c.Y, 0)).Distance(target) <= 555 - 0.2 * target.MoveSpeed).ToList()); } if (allcastpos != null && allcastpos.Count > 1) { var getpos = allcastpos.OrderBy(p => new Vector3(p.X, p.Y, 0).Distance(Game.CursorPos)).FirstOrDefault(); return(new Vector3(getpos.X, getpos.Y, 0)); } return(Game.CursorPos); }
private static void AUTORHIT(EventArgs args) { if (ME.IsDead || !BrandSettings.AutoR.Enabled) { return; } if (!R.IsReady()) { return; } var targets = TargetSelector.GetTargets(R.Range + 600).OrderBy(i => i.DistanceToPlayer()); if (targets == null) { return; } foreach (var target in targets) { if (target == null) { return; } RPoly = new Geometry.Circle(target.Position, 600f); var targethit = GameObjects.EnemyHeroes.Where(i => !i.IsDead && RPoly.IsInside(i)); var targethitcount = targethit.Count(); if (targethitcount >= BrandSettings.AutoR.ActiveValue && target.IsValidTarget(R.Range)) { if (R.Cast(target) == CastStates.SuccessfullyCasted || R.CastOnUnit(target)) { return; } } } }
private static void AUTOEHIT(EventArgs args) { if (ME.IsDead) { return; } if (!E.IsReady()) { return; } var targets = TargetSelector.GetTargets(E.Range + 375f).OrderBy(i => i.DistanceToPlayer()); if (targets == null) { return; } foreach (var target in targets) { if (target == null) { return; } EPoly = new Geometry.Circle(target.Position, 375f); var targethit = GameObjects.EnemyHeroes.Where(i => EPoly.IsInside(i.Position)); var targethitcount = targethit.Count(); if (targethitcount >= 2 && target.IsValidTarget(E.Range) && target.Burning()) { if (E.Cast(target) == CastStates.SuccessfullyCasted || E.CastOnUnit(target)) { return; } } } }
public static void OnUpdate() { if (MenuConfig.LaneClear["Check"].Enabled && Global.Player.CountEnemyHeroesInRange(1500) != 0) { return; } var minion = GameObjects.EnemyMinions.OrderBy(x => x.Distance(Global.Player)).FirstOrDefault(x => x.IsValidTarget(SpellManager.Q.Range)); if (minion == null) { return; } if (MenuConfig.LaneClear["Q"].Enabled && SpellManager.Q.Ready) { var range = SpellManager.Q.Range; var circle = new Geometry.Circle(minion.ServerPosition.To2D(), range); var possible = GameObjects.EnemyMinions.Where(x => x.IsValidTarget(range, false, true, circle.Center.To3D())).OrderBy(x => x.Distance(minion)); if (possible.Count() >= MenuConfig.LaneClear["Q"].Value) { SpellManager.Q.Cast(minion); } } if (MenuConfig.LaneClear["E"].Enabled && SpellManager.E.Ready) { var range = SpellManager.E.Range; var circle = new Geometry.Circle(minion.ServerPosition.To2D(), range); var count = GameObjects.EnemyMinions.Count(x => x.IsValidTarget(range, false, true, circle.Center.To3D())); if (count >= MenuConfig.LaneClear["E"].Value) { SpellManager.E.Cast(minion); } } }
private static void AIHeroClient_OnProcessSpellCast(AIBaseClient sender, AIBaseClientProcessSpellCastEventArgs args) { var targetz = TargetSelector.GetTarget(W.Range); var useW = ComboMenu["WLowHp"].GetValue <MenuBool>().Enabled; var MinHealth = ComboMenu["minHealth"].GetValue <MenuSlider>().Value; if (useW && !_Player.IsRecalling() && targetz.IsValidTarget(425)) { if (Player.Instance.HealthPercent <= MinHealth) { W.Cast(); } } if ((args.Slot == SpellSlot.Q || args.Slot == SpellSlot.W || args.Slot == SpellSlot.E || args.Slot == SpellSlot.R) && sender.IsEnemy && Q.IsReady() && _Player.Distance(sender) <= args.SData.CastRange && Orbwalker.ActiveMode.HasFlag(OrbwalkerMode.Combo)) { if (args.SData.TargettingType == SpellDataTargetType.Unit || args.SData.TargettingType == SpellDataTargetType.SelfAndUnit || args.SData.TargettingType == SpellDataTargetType.Self) { if ((args.Target.NetworkId == Player.Instance.NetworkId && args.Time < 1.5 || args.End.Distance(Player.Instance.Position) <= Player.Instance.BoundingRadius * 3) && Evade[args.SData.Name].GetValue <MenuBool>().Enabled) { QEvade(); } } else if (args.SData.TargettingType == SpellDataTargetType.LocationAoe) { var castvector = new Geometry.Circle(args.End, args.SData.CastRadius).IsInside( Player.Instance.Position); if (castvector && Evade[args.SData.Name].GetValue <MenuBool>().Enabled) { QEvade(); } } else if (args.SData.TargettingType == SpellDataTargetType.Cone) { var castvector = new Geometry.Arc(args.Start, args.End, args.SData.CastConeAngle, args.SData.CastRange) .IsInside(Player.Instance.Position); if (castvector && Evade[args.SData.Name].GetValue <MenuBool>().Enabled) { QEvade(); } } else if (args.SData.TargettingType == SpellDataTargetType.SelfAoe) { var castvector = new Geometry.Circle(sender.Position, args.SData.CastRadius).IsInside( Player.Instance.Position); if (castvector && Evade[args.SData.Name].GetValue <MenuBool>().Enabled) { QEvade(); } } else { var castvector = new Geometry.Rectangle(args.Start, args.End, args.SData.LineWidth).IsInside( Player.Instance.Position); if (castvector && Evade[args.SData.Name].GetValue <MenuBool>().Enabled) { QEvade(); } } if (args.SData.Name == "yasuoq3w") { QEvade(); } if (args.SData.Name == "ZedR") { if (Q.IsReady()) { QEvade(); } else { if (W.IsReady()) { W.Cast(); } } } if (args.SData.Name == "KarthusFallenOne") { QEvade(); } if (args.SData.Name == "SoulShackles") { QEvade(); } if (args.SData.Name == "AbsoluteZero") { QEvade(); } if (args.SData.Name == "NocturneUnspeakableHorror") { QEvade(); } } }
private static Vector3 Rpos() { var pos = Vector3.Zero; var targets = GameObjects.EnemyHeroes.Where(i => i.IsValidTarget(R.Range) && i.HasBuff("kaisapassivemarker")); var turret = GameObjects.EnemyTurrets.Where(i => i.IsValidTarget(R.Range)).FirstOrDefault(); if (targets == null) { pos = Vector3.Zero; } foreach (var target in targets) { Geometry.Circle newcircle = new Geometry.Circle(target.Position, ObjectManager.Player.GetRealAutoAttackRange() - 200, 20); foreach (var circle in newcircle.Points) { if (circle.CountEnemyHeroesInRange(400) <= 2) { pos = circle.ToVector3(); } } } /*foreach(var target in targets) * { * if (target == null || !target.HasBuff("kaisapassivemarker")) pos = Vector3.Zero; * Geometry.Circle newcircle = new Geometry.Circle(target.Position, ObjectManager.Player.GetRealAutoAttackRange() - 75, 20); * foreach(var checkpoint in newcircle.Points.Where(i => i.DistanceToPlayer() < R.Range)) * { * if (GetHeroesInRange(R.Range) == 0) pos = Vector3.Zero; * if(GetHeroesInRange(1000) >= 2) * { * if (checkpoint.CountEnemyHeroesInRange(400) < GetHeroesInRange(1000)) * { * pos = checkpoint.ToVector3(); * } * } * else * { * if(checkpoint.Distance(turret) > ObjectManager.Player.GetRealAutoAttackRange()) * { * pos = checkpoint.ToVector3(); * } * } * } * }*/ /*foreach (var target in targets.Where(i => i.IsValidTarget(R.Range))) * { * if (target == null) pos = Vector3.Zero; * Geometry.Circle newcircle = new Geometry.Circle(target.Position, ObjectManager.Player.GetRealAutoAttackRange() - 150, 20); * foreach (var checkpoint in newcircle.Points.Where(i => i.DistanceToPlayer() < R.Range)) * { * if (checkpoint.CountEnemyHeroesInRange(400) == 1) * { * if (GetHeroesInRange(700) >= 2) * { * if (GetHeroesInRange(700) > checkpoint.CountEnemyHeroesInRange(400)) * { * if (checkpoint.Distance(turret) > ObjectManager.Player.GetRealAutoAttackRange()) * { * pos = checkpoint.ToVector3(); * } * } * } * } * if (checkpoint.CountEnemyHeroesInRange(400) == 2) * { * if (GetHeroesInRange(700) >= 3) * { * if (GetHeroesInRange(700) > checkpoint.CountEnemyHeroesInRange(400)) * { * if (checkpoint.Distance(turret) > ObjectManager.Player.GetRealAutoAttackRange()) * { * pos = checkpoint.ToVector3(); * } * } * } * } * if (GetHeroesInRange(700) > checkpoint.CountEnemyHeroesInRange(400) + 1) * { * if (checkpoint.Distance(turret) > ObjectManager.Player.GetRealAutoAttackRange()) * { * pos = checkpoint.ToVector3(); * } * } * } * }*/ return(pos); }
private static void NewEPred() { var targets = GameObjects.EnemyHeroes.Where(i => i.IsValidTarget(775) && !i.IsDead); foreach (var target in targets) { if (target != null || !target.HasBuff("ireliamark")) { var echeck = Echeck.GetPrediction(target); float ereal = (E.Range * 2) / 20000; if (E.IsReady(0)) { if (!objPlayer.HasBuff("IreliaE")) { if (echeck.CastPosition.DistanceToPlayer() < 975) { Geometry.Circle circle = new Geometry.Circle(objPlayer.Position, 500, 50); { foreach (var onecircle in circle.Points) { if (onecircle.DistanceToPlayer() > 300 && onecircle.Distance(target) > 300) { E.Cast(onecircle); } } } } } else { for (int i = 775; i > 1; i--) { var epred = E.GetPrediction(target); if (epred.CastPosition.DistanceToPlayer() < 730) { var castepos = Vector2.Zero; var epos = epred.CastPosition.DistanceToPlayer(); Geometry.Circle onecircle = new Geometry.Circle(objPlayer.Position, i); foreach (var circle in onecircle.Points) { E.Delay = (circle.DistanceToPlayer() - epos) / E.Speed + 0.25f + ereal; if (epred.CastPosition.Extend(ECatPos, -i).ToVector2().DistanceToPlayer() < 775) { castepos = epred.CastPosition.Extend(ECatPos, -i).ToVector2(); } } if (castepos != Vector2.Zero) { E.Cast(castepos); } } } } } } } }
private static void EcomboCastPostion(AIHeroClient aiheroClient_0) { Vector3 vector = Vector3.Zero; Vector3 vector2 = Vector3.Zero; if (!Extensions.IsValidTarget(aiheroClient_0, E.Range, true)) { aiheroClient_0 = TargetSelector.GetTarget(E.Range, false); } if (aiheroClient_0 != null && !aiheroClient_0.HasBuffOfType(BuffType.SpellImmunity) && !aiheroClient_0.HasBuffOfType(BuffType.SpellShield)) { SpellPrediction.PredictionOutput prediction = E.GetPrediction(aiheroClient_0); if (prediction.Hitchance >= HitChance.High) { if (objPlayer.HasBuff("IreliaE")) { Geometry.Circle circle = new Geometry.Circle(ObjectManager.Player.Position, 730); foreach (Vector2 vector3 in circle.Points.Where(i => i.DistanceToPlayer() < 775 //&& ( //((aiheroClient_0.DistanceToPlayer() > 264 && aiheroClient_0.DistanceToPlayer() < 424) ? i.DistanceToPlayer() / 2000 <= prediction.CastPosition.DistanceToPlayer() / 1600 + 0.2 : i.DistanceToPlayer() / 2000 <= prediction.CastPosition.DistanceToPlayer() / 1600 + 0.4) //&& ((aiheroClient_0.DistanceToPlayer() < 504 && aiheroClient_0.DistanceToPlayer() > 424) ? i.DistanceToPlayer() / 2000 <= prediction.CastPosition.DistanceToPlayer() / 1600 + 0.1 : i.DistanceToPlayer() / 2000 <= prediction.CastPosition.DistanceToPlayer() / 1600 + 0.4) //&& ((aiheroClient_0.DistanceToPlayer() > 504) ? i.DistanceToPlayer() / 2000 <= prediction.CastPosition.DistanceToPlayer() / 1600 + 0.05 : i.DistanceToPlayer() / 2000 <= prediction.CastPosition.DistanceToPlayer() / 1600 + 0.4) //) )) { var projectionInfo = prediction.CastPosition.ProjectOn(vector3.ToVector3(), ECatPos); if (projectionInfo.IsOnSegment && projectionInfo.LinePoint.Distance(prediction.CastPosition) <= 50) { vector = vector3.ToVector3(); vector2 = ECatPos; } } if (vector.DistanceToPlayer() <= E.Range) { if (vector != Vector3.Zero && vector2 != Vector3.Zero && Extensions.Distance(vector, vector2) > 200) { if (objPlayer.HasBuff("IreliaE")) { E.Cast(vector, false); } else { return; } } else { return; } } } else { Geometry.Circle circle = new Geometry.Circle(ObjectManager.Player.Position, 450); foreach (Vector2 vector3 in circle.Points) { foreach (Vector2 vector4 in circle.Points) { var projectionInfo = prediction.CastPosition.ProjectOn(vector3.ToVector3(), vector4.ToVector3()); if (projectionInfo.IsOnSegment && projectionInfo.LinePoint.Distance(aiheroClient_0.Position) <= 120 && projectionInfo.LinePoint.Distance(prediction.CastPosition) <= 120) { vector = Extensions.ToVector3(vector3, 0f); vector2 = Extensions.ToVector3(vector4, 0f); } } } if (Extensions.DistanceToPlayer(vector) <= E.Range && Extensions.DistanceToPlayer(vector2) <= E.Range) { if (vector.Distance(vector2) > 100 && vector != Vector3.Zero && vector2 != Vector3.Zero) { if (!objPlayer.HasBuff("IreliaE") && vector2.Distance(aiheroClient_0) > 100) { E.Cast(vector2, false); } else { return; } } } } } } }
public static Result GetCircleAoePrediction(this Spell spell, AIHeroClient target, HitChance hitChance, bool boundingRadius = true, bool extended = true, Vector3?sourcePosition = null) { try { if (spell == null || target == null) { return(new Result(Vector3.Zero, new List <AIHeroClient>())); } var fromPosition = sourcePosition ?? ObjectManager.Player.PreviousPosition; var hits = new List <AIHeroClient>(); var center = Vector3.Zero; var radius = float.MaxValue; var range = spell.Range + (extended ? spell.Width * 0.85f : 0) + (boundingRadius ? target.BoundingRadius * BoundingRadiusMultiplicator : 0); var positions = (from t in GameObjects.EnemyHeroes where t.IsValidTarget(range * 1.5f, true, fromPosition) let prediction = spell.GetPrediction(t) where prediction.Hitchance >= hitChance select new Position(t, prediction.UnitPosition)).ToList(); var spellWidth = spell.Width; if (positions.Any()) { var mainTarget = positions.FirstOrDefault(p => p.Hero.NetworkId == target.NetworkId); var possibilities = ProduceEnumeration( positions.Where( p => p.UnitPosition.Distance(mainTarget.UnitPosition) <= spell.Width * 0.85f).ToList()) .Where(p => p.Count > 0 && p.Any(t => t.Hero.NetworkId == mainTarget.Hero.NetworkId)) .ToList(); foreach (var possibility in possibilities) { var mec = MEC.GetMec(possibility.Select(p => p.UnitPosition.ToVector2()).ToList()); var distance = spell.From.Distance(mec.Center.ToVector3()); if (mec.Radius < spellWidth && distance < range) { var lHits = new List <AIHeroClient>(); var circle = new Geometry.Circle( spell.From.Extend( mec.Center.ToVector3(), spell.Range > distance ? distance : spell.Range), spell.Width); if (boundingRadius) { lHits.AddRange( from position in positions where new Geometry.Circle( position.UnitPosition, position.Hero.BoundingRadius * BoundingRadiusMultiplicator).Points.Any( p => circle.IsInside(p)) select position.Hero); } else { lHits.AddRange( from position in positions where circle.IsInside(position.UnitPosition) select position.Hero); } if ((lHits.Count > hits.Count || lHits.Count == hits.Count && mec.Radius < radius || lHits.Count == hits.Count && spell.From.Distance(circle.Center.ToVector3()) < spell.From.Distance(center)) && lHits.Any(p => p.NetworkId == target.NetworkId)) { center = ToVector32(circle.Center); radius = mec.Radius; hits.Clear(); hits.AddRange(lHits); } } } if (!center.Equals(Vector3.Zero)) { return(new Result(center, hits)); } } } catch (Exception ex) { Console.WriteLine(ex); } return(new Result(Vector3.Zero, new List <AIHeroClient>())); }
public static void OnUpdate() { if (SpellConfig.E.Ready && !MenuConfig.LaneClear["EAA"].Enabled) { var minion = GameObjects.EnemyMinions.FirstOrDefault(x => x.IsValidTarget() && x.Distance(Global.Player) <= SpellConfig.E.Range && !x.HasBuff("YasuoDashWrapper")); if (!SpellConfig.E.Ready || minion == null || MenuConfig.LaneClear["Turret"].Enabled && minion.IsUnderEnemyTurret() || MenuConfig.LaneClear["Check"].Enabled && Global.Player.CountEnemyHeroesInRange(2000) != 0) { return; } switch (MenuConfig.LaneClear["Mode"].Value) { case 1: if (minion.Health > Global.Player.GetSpellDamage(minion, SpellSlot.E)) { return; } SpellConfig.E.CastOnUnit(minion); break; case 2: SpellConfig.E.CastOnUnit(minion); break; } } if (SpellConfig.Q.Ready) { switch (Extension.CurrentMode) { case Mode.Normal: { var m = GameObjects.EnemyMinions.LastOrDefault(x => x.IsValidSpellTarget(SpellConfig.Q.Range)); if (m == null || Global.Player.IsDashing()) { return; } SpellConfig.Q.Cast(m); } break; case Mode.Tornado: { var m = GameObjects.EnemyMinions.LastOrDefault(x => x.IsValidSpellTarget(SpellConfig.Q.Range)); if (m == null || Global.Player.IsDashing()) { return; } var rect = SpellConfig.Q3Rect(m); var count = GameObjects.EnemyMinions.Count(x => rect.IsInside(x.ServerPosition.To2D())); if (MenuConfig.LaneClear["Q3"].Enabled && count >= 3) { SpellConfig.Q.Cast(m); } } break; case Mode.DashingTornado: case Mode.Dashing: var dashM = GameObjects.EnemyMinions.FirstOrDefault(x => x.Distance(Global.Player.GetDashInfo().EndPos) <= 220); if (dashM == null) { return; } var circle = new Geometry.Circle(Global.Player.GetDashInfo().EndPos, 220); var circleCount = GameObjects.EnemyMinions.Count(x => !x.IsDead && x.IsValidTarget() && circle.Center.Distance(x.ServerPosition) <= circle.Radius); if (circleCount >= 3) { Console.WriteLine($"COUNT: {circleCount}"); SpellConfig.Q.Cast(dashM); } break; } } }
public static bool PointInsideCircle(Geometry.Circle circle, Vector3 point) { float distance = Vector3.Distance(point, circle.center); return(distance <= circle.radius); }
private static void Harass() { foreach (var enemyInRange in ObjectManager.Get <Obj_AI_Hero>() .Where( enemy => enemy.IsValidTarget(_q.Range) && Config.Item("Harass-" + enemy.ChampionName).GetValue <bool>())) { var qPred = _q.GetPrediction(enemyInRange); var wPred = _w.GetPrediction(enemyInRange); var manaPercent = (Player.Mana / Player.MaxMana) * 100; if (Config.Item("Harass-Use-Q").GetValue <bool>() && _q.IsReady() && manaPercent >= Config.Item("Harass-Mana-Q").GetValue <Slider>().Value&& qPred.Hitchance >= HarassHitChance) { _q.Cast(qPred.CastPosition); } if (Config.Item("Harass-Use-W").GetValue <bool>() && _w.IsReady() && manaPercent >= Config.Item("Harass-Mana-W").GetValue <Slider>().Value&& Player.Distance(enemyInRange) < _w.Range && wPred.Hitchance >= HarassHitChance) { _w.Cast(enemyInRange); } if (!_e.IsReady() || !_q.IsReady() || qPred.Hitchance > HitChance.Impossible || Player.Distance(enemyInRange) > _q.Range || Player.Mana <= (Player.Spellbook.GetSpell(SpellSlot.E).ManaCost + Player.Spellbook.GetSpell(SpellSlot.Q).ManaCost) || !Config.Item("Harass-Use-E").GetValue <bool>() || manaPercent < Config.Item("Harass-Mana-E").GetValue <Slider>().Value) { return; } var c = new Geometry.Circle(Player.Position.To2D(), 490); var point = c.ToPolygon().Points.OrderByDescending(vector2 => vector2.Distance(enemyInRange.Position.To2D())).Reverse(); for (var i = 1; i < 3; i++) { var pointTo = point.ElementAt(i).To3D(); if (pointTo.IsWall() || pointTo.UnderTurret(true) || ObjectManager.Get <Obj_AI_Hero>().Any(enemy => enemy != enemyInRange && enemy.IsValidTarget(300, true, pointTo))) { continue; } var qNewPred = new PredictionInput { Unit = enemyInRange, Radius = _q.Width, From = pointTo, Aoe = false, Delay = 0.5f, Range = _q.Range, Speed = _q.Speed, Type = SkillshotType.SkillshotLine, Collision = true }; var qHit = Prediction.GetPrediction(qNewPred); if (qHit.Hitchance < HarassHitChance || !_e.IsReady() || !_q.IsReady()) { continue; } _e.Cast(pointTo); break; } } }
public static void EPrediction(bool Checkbuff = true) { var target = TargetSelector.GetTarget(775); if (!Irelia.E.IsReady() || target == null) { return; } { if (target != null && (!target.HasBuff("ireliamark") || !Checkbuff)) { //float ereal = 0.275f + Game.Ping / 1000; if (Irelia.E.IsReady(0)) { if (Irelia.E.Name != "IreliaE" && Irelia.E1Pos.IsValid()) { if (MenuSettings.ESettings.Emode.Index == 0) { var pos = FSpred.Prediction.Prediction.PredictUnitPosition(target, MenuSettings.ESettings.EDelay.Value).ToVector3(); { if (pos.IsValid()) { int range = 1000; if (ObjectManager.Player.CountEnemyHeroesInRange(775) > 2) { range = 1000; } else { range = 350; } for (int i = range; i > 50; i--) { var poscast = pos.Extend(Irelia.E1Pos, -i); if (poscast.IsValid() && poscast.Distance(ObjectManager.Player.Position) < 775) { Irelia.E.Cast(poscast); return; } else { continue; } } } } } if (MenuSettings.ESettings.Emode.Index == 2) { var tempE = new Spell(SpellSlot.Unknown, 775); tempE.SetSkillshot(MenuSettings.ESettings.EDelay.Value / 1000, 1, 2000, false, EnsoulSharp.SDK.SpellType.Line); { var pred = FSpred.Prediction.Prediction.GetPrediction(tempE, target); if (pred.Hitchance >= FSpred.Prediction.HitChance.High && pred.CastPosition.IsValid()) { int range = 0; if (ObjectManager.Player.CountEnemyHeroesInRange(775) > 2) { range = 1000; } else { range = 350; } for (int i = range; i > 50; i--) { var pos = pred.CastPosition.Extend(Irelia.E1Pos, -i); if (pos.IsValid() && pos.Distance(ObjectManager.Player.Position) < 775) { Irelia.E.Cast(pos); return; } else { continue; } } } else { return; } } } if (MenuSettings.ESettings.Emode.Index == 1) { var tempE = new Spell(SpellSlot.Unknown, 775); tempE.SetSkillshot(0.25f, 1, 2000, false, EnsoulSharp.SDK.SpellType.Line); { var pred = FSpred.Prediction.Prediction.GetPrediction(tempE, target); if (pred.Hitchance >= FSpred.Prediction.HitChance.High && pred.CastPosition.IsValid()) { int range = 2000; if (ObjectManager.Player.CountEnemyHeroesInRange(775) > 2) { range = 2000; } else { range = MenuSettings.ESettings.E1vs1Range.Value; } for (int i = range; i > 50; i--) { var spelldelay = new Spell(SpellSlot.Unknown, 775); var pos = pred.CastPosition.Extend(Irelia.E1Pos, -i); spelldelay.SetSkillshot(0.25f + (pos.Distance(ObjectManager.Player.Position) - pred.CastPosition.Distance(ObjectManager.Player.Position)) / 2000, 1f, 2000, false, EnsoulSharp.SDK.SpellType.Line ); var spelldelaypred = SebbyLibPorted.Prediction.Prediction.GetPrediction(spelldelay, target); if (spelldelaypred.Hitchance >= SebbyLibPorted.Prediction.HitChance.High) { var castpos = spelldelaypred.CastPosition.Extend(Irelia.E1Pos, -i + 10); if (castpos.Distance(ObjectManager.Player.Position) <= 775) { Irelia.E.Cast(castpos); return; } else { continue; } } else { return; } } } else { return; } } } } else { { if (Irelia.E.GetPrediction(target).CastPosition.DistanceToPlayer() <= 800) { if (ObjectManager.Player.CountEnemyHeroesInRange(775) >= 2) { foreach (var gettarget in ObjectManager.Get <AIHeroClient>().Where(i => !i.IsAlly && !i.IsDead && i.IsValidTarget(775)).OrderBy(i => i.DistanceToPlayer())) { if (gettarget == null) { return; } if (gettarget.NetworkId == target.NetworkId) { continue; } else { if (target.DistanceToPlayer() > gettarget.DistanceToPlayer()) { var castpos = gettarget.Position.Extend(target.Position, -200); if (castpos.DistanceToPlayer() <= 775) { Irelia.E.Cast(castpos); return; } else { continue; } } else { var castpos = target.Position.Extend(gettarget.Position, -200); if (castpos.DistanceToPlayer() <= 775) { Irelia.E.Cast(castpos); return; } else { continue; } } } } } else { Geometry.Circle circle = new Geometry.Circle(ObjectManager.Player.Position, 600, 50); { foreach (var onecircle in circle.Points) { if (onecircle.Distance(target) > 600) { if (Irelia.E.Cast(onecircle)) { var vector2 = FSpred.Prediction.Prediction.GetPrediction(target, 600); var v3 = Vector2.Zero; if (vector2.CastPosition.IsValid() && vector2.CastPosition.Distance(ObjectManager.Player.Position) < Irelia.E.Range - 100) { for (int j = 50; j <= 900; j += 50) { var vector3 = vector2.CastPosition.Extend(Irelia.E1Pos.ToVector2(), -j); if (vector3.Distance(ObjectManager.Player) >= Irelia.E.Range && v3 != Vector2.Zero) { Irelia.E.Cast(v3); break; } else { v3 = vector3.ToVector2(); continue; } } } } } } } } } else { return; } } /*if (Irelia.E.GetPrediction(target).CastPosition.DistanceToPlayer() <= 800) * { * Geometry.Circle circle = new Geometry.Circle(ObjectManager.Player.Position, 600, 50); * * { * foreach (var onecircle in circle.Points) * { * if (onecircle.Distance(target) > 600) * { * if (Irelia.E.Cast(onecircle)) * { * var vector2 = FSpred.Prediction.Prediction.GetPrediction(target, 600); * var v3 = Vector2.Zero; * if (vector2.CastPosition.IsValid() && vector2.CastPosition.Distance(ObjectManager.Player.Position) < Irelia.E.Range - 100) * for (int j = 50; j <= 900; j += 50) * { * var vector3 = vector2.CastPosition.Extend(Irelia.E1Pos.ToVector2(), -j); * if (vector3.Distance(ObjectManager.Player) >= Irelia.E.Range && v3 != Vector2.Zero) * { * if (Irelia.E.Cast(v3)) * { * return; * } * break; * } * else * { * v3 = vector3.ToVector2(); * continue; * } * } * } * } * } * } * } * if (ObjectManager.Player.IsDashing()) * { * if (ObjectManager.Player.GetDashInfo().EndPos.Distance(target) < 775) * { * Geometry.Circle circle = new Geometry.Circle(ObjectManager.Player.Position, 775, 50); * * { * foreach (var onecircle in circle.Points.Where(i => i.Distance(target) > 775)) * { * if (Irelia.E.Cast(onecircle)) * { * var vector2 = FSpred.Prediction.Prediction.PredictUnitPosition(target, 600); * var v3 = vector2; * if (vector2.IsValid() && vector2.Distance(ObjectManager.Player.Position.ToVector2()) < Irelia.E.Range - 100) * for (int j = 50; j <= 900; j += 50) * { * var vector3 = vector2.Extend(Irelia.E1Pos.ToVector2(), -j); * if (vector3.Distance(ObjectManager.Player) >= Irelia.E.Range) * { * if (Irelia.E.Cast(v3.ToVector3())) * { * return; * } * break; * } * else * { * v3 = vector3; * continue; * } * } * } * } * } * } * }*/ } } } } }
private static void AIHeroClient_OnProcessSpellCast(AIBaseClient sender, AIBaseClientProcessSpellCastEventArgs args) { if ((args.Slot == SpellSlot.Q || args.Slot == SpellSlot.W || args.Slot == SpellSlot.E || args.Slot == SpellSlot.R) && sender.IsEnemy && W.IsReady() && _Player.Distance(sender) <= args.SData.CastRange && Orbwalker.ActiveMode == OrbwalkerMode.Combo) { if (args.SData.TargetingType == SpellDataTargetType.Unit || args.SData.TargetingType == SpellDataTargetType.SelfAndUnit || args.SData.TargetingType == SpellDataTargetType.Self) { if ((args.Target.NetworkId == ObjectManager.Player.NetworkId && args.Time < 1.5 || args.End.Distance(ObjectManager.Player.Position) <= ObjectManager.Player.BoundingRadius * 3) && Evade[args.SData.Name].GetValue <MenuBool>().Enabled) { W.Cast(); } } else if (args.SData.TargetingType == SpellDataTargetType.LocationAoe) { var castvector = new Geometry.Circle(args.End, args.SData.CastRadius).IsInside( ObjectManager.Player.Position); if (castvector && Evade[args.SData.Name].GetValue <MenuBool>().Enabled) { W.Cast(); } } else if (args.SData.TargetingType == SpellDataTargetType.Cone) { var castvector = new Geometry.Arc(args.Start, args.End, args.SData.CastConeAngle, args.SData.CastRange) .IsInside(ObjectManager.Player.Position); if (castvector && Evade[args.SData.Name].GetValue <MenuBool>().Enabled) { W.Cast(); } } else if (args.SData.TargetingType == SpellDataTargetType.SelfAoe) { var castvector = new Geometry.Circle(sender.Position, args.SData.CastRadius).IsInside( ObjectManager.Player.Position); if (castvector && Evade[args.SData.Name].GetValue <MenuBool>().Enabled) { W.Cast(); } } else { var castvector = new Geometry.Rectangle(args.Start, args.End, args.SData.LineWidth).IsInside( ObjectManager.Player.Position); if (castvector && Evade[args.SData.Name].GetValue <MenuBool>().Enabled) { W.Cast(); } } if (args.SData.Name == "yasuoq3w") { W.Cast(); } if (args.SData.Name == "ZedR") { W.Cast(); } if (args.SData.Name == "KarthusFallenOne") { W.Cast(); } if (args.SData.Name == "SoulShackles") { W.Cast(); } if (args.SData.Name == "AbsoluteZero") { W.Cast(); } if (args.SData.Name == "NocturneUnspeakableHorror") { W.Cast(); } } }
private static void Game_OnUpdate(EventArgs args) { if (Player.IsDead) { return; } var target = TargetSelector.GetTarget(R.Range + E.Range); if (target == null) { return; } if (Orbwalker.ActiveMode <= OrbwalkerMode.Harass) { if (Orbwalker.ActiveMode == OrbwalkerMode.Harass) { if (E.IsReady() && ESettings.EHarass.Enabled) { if (target.IsValidTarget(E.Range)) { if (E.Cast(target) == CastStates.SuccessfullyCasted) { return; } } } } else { if (E.IsReady() && ESettings.ECombo.Enabled) { if (target.IsValidTarget(E.Range)) { if (E.Cast(target) == CastStates.SuccessfullyCasted) { return; } } } } if (W.IsReady() && WSettings.WCH.Enabled) { if (!QEmp() && Variables.TickCount > LastE + 500 && !Player.IsDashing()) { AllPos = new Geometry.Circle(Player.Position, 1000); var canwater = false; var canrock = false; var cangrass = false; if (AllPos != null) { if (AllPos.Points.Any(i => i != target.Position.ToVector2() && NavMesh.IsWater((uint)i.X, (uint)i.Y))) { canwater = true; } else { canwater = false; } if (AllPos.Points.Any(i => i != target.Position.ToVector2() && (i.IsWall() || i.IsBuilding()))) { canrock = true; } else { canrock = false; } if (AllPos.Points.Any(i => i != target.Position.ToVector2() && ObjectManager.Get <GrassObject>() != null && ObjectManager.Get <GrassObject>().Any(a => a.Distance(i) < 375))) { cangrass = true; } else { cangrass = false; } if (WSettings.WWater.Value >= WSettings.WRock.Value && WSettings.WWater.Value >= WSettings.WGrass.Value && canwater) { if (W.Cast(AllPos.Points.OrderBy(i => i.Distance(target)).FirstOrDefault(i => i != target.Position.ToVector2() && NavMesh.IsWater((uint)i.X, (uint)i.Y)))) { return; } } else if (WSettings.WRock.Value >= WSettings.WRock.Value && WSettings.WRock.Value >= WSettings.WGrass.Value && canrock) { if (W.Cast(AllPos.Points.OrderBy(i => i.Distance(target)).FirstOrDefault(i => i != target.Position.ToVector2() && (i.IsWall() || i.IsBuilding())))) { return; } } else if (WSettings.WGrass.Value >= WSettings.WGrass.Value && WSettings.WGrass.Value >= WSettings.WRock.Value && cangrass) { if (W.Cast(AllPos.Points.OrderBy(i => i.Distance(target)).FirstOrDefault(i => i != target.Position.ToVector2() && ObjectManager.Get <GrassObject>() != null && ObjectManager.Get <GrassObject>().Any(a => a.Distance(i) < 375)))) { return; } } } else { canwater = false; canrock = false; cangrass = false; } } } if (Q1.IsReady() && QSettings.QCH.Enabled) { if (QEmp()) { var pred = SebbyLibPorted.Prediction.Prediction.GetPrediction(Q2, target); if (pred.Hitchance >= SebbyLibPorted.Prediction.HitChance.High) { if (Q2.Cast(pred.CastPosition)) { return; } } } else { var pred = SebbyLibPorted.Prediction.Prediction.GetPrediction(Q1, target); if (pred.Hitchance >= SebbyLibPorted.Prediction.HitChance.High) { if (Q1.Cast(pred.CastPosition)) { return; } } } } } }
private static void Harass() { foreach (var enemyInRange in ObjectManager.Get<Obj_AI_Hero>() .Where( enemy => enemy.IsValidTarget(_q.Range) && Config.Item("Harass-" + enemy.ChampionName).GetValue<bool>())) { var qPred = _q.GetPrediction(enemyInRange); var wPred = _w.GetPrediction(enemyInRange); var manaPercent = (Player.Mana / Player.MaxMana) * 100; if (Config.Item("Harass-Use-Q").GetValue<bool>() && _q.IsReady() && manaPercent >= Config.Item("Harass-Mana-Q").GetValue<Slider>().Value && qPred.Hitchance >= HarassHitChance) _q.Cast(qPred.CastPosition); if (Config.Item("Harass-Use-W").GetValue<bool>() && _w.IsReady() && manaPercent >= Config.Item("Harass-Mana-W").GetValue<Slider>().Value && Player.Distance(enemyInRange) < _w.Range && wPred.Hitchance >= HarassHitChance) _w.Cast(enemyInRange); if (!_e.IsReady() || !_q.IsReady() || qPred.Hitchance > HitChance.Impossible || Player.Distance(enemyInRange) > _q.Range || Player.Mana <= (Player.Spellbook.GetSpell(SpellSlot.E).ManaCost + Player.Spellbook.GetSpell(SpellSlot.Q).ManaCost) || !Config.Item("Harass-Use-E").GetValue<bool>() || manaPercent < Config.Item("Harass-Mana-E").GetValue<Slider>().Value) return; var c = new Geometry.Circle(Player.Position.To2D(), 490); var point = c.ToPolygon().Points.OrderByDescending(vector2 => vector2.Distance(enemyInRange.Position.To2D())).Reverse(); for (var i = 1; i < 3; i++) { var pointTo = point.ElementAt(i).To3D(); if (pointTo.IsWall() || pointTo.UnderTurret(true) || ObjectManager.Get<Obj_AI_Hero>().Any(enemy => enemy != enemyInRange && enemy.IsValidTarget(300, true, pointTo))) continue; var qNewPred = new PredictionInput { Unit = enemyInRange, Radius = _q.Width, From = pointTo, Aoe = false, Delay = 0.5f, Range = _q.Range, Speed = _q.Speed, Type = SkillshotType.SkillshotLine, Collision = true }; var qHit = Prediction.GetPrediction(qNewPred); if (qHit.Hitchance < HarassHitChance || !_e.IsReady() || !_q.IsReady()) continue; _e.Cast(pointTo); break; } } }