private void CheckOutofRange(bool checkDodge) { if (this.Input.RangeCheckFrom.LSTo2D().LSDistance(this.CastPosition) > this.Input.SpellRange - (checkDodge ? GetArrivalTime(this.Input.From.LSTo2D().LSDistance(this.CastPosition), this.Input.SpellDelay, this.Input.SpellMissileSpeed) * this.Unit.MoveSpeed * (100 - ConfigMenu.MaxRangeIgnore) / 100f : 0)) { this.HitChance = EloBuddy.SDK.Enumerations.HitChance.Unknown; } }
private void CheckCollisions() { if (Input.SpellCollisionable && (CollisionResult.Objects.HasFlag(Collision.Flags.Minions) || CollisionResult.Objects.HasFlag(Collision.Flags.YasuoWall))) { HitChance = EloBuddy.SDK.Enumerations.HitChance.Collision; } }
public Result(Input inp, Obj_AI_Base unit, Vector2 castpos, Vector2 unitpos, EloBuddy.SDK.Enumerations.HitChance hc, Collision.Result col) { Input = inp; Unit = unit; CastPosition = castpos; UnitPosition = unitpos; HitChance = hc; CollisionResult = col; }
private void handeQ(AIHeroClient target, EloBuddy.SDK.Enumerations.HitChance hitChance) { if (player.LSDistance(target) <= Orbwalking.GetRealAutoAttackRange(target) && !Orbwalker.CanAutoAttack && target.GetBuffCount("TahmKenchPDebuffCounter") != 2) { Q.CastIfHitchanceEquals(target, hitChance, getCheckBoxItem(config, "packets")); } else if (player.LSDistance(target) > Orbwalking.GetRealAutoAttackRange(target)) { Q.CastIfHitchanceEquals(target, hitChance, getCheckBoxItem(config, "packets")); } }
internal bool UseQ(AIHeroClient target, EloBuddy.SDK.Enumerations.HitChance minhc = EloBuddy.SDK.Enumerations.HitChance.Medium, bool UseQ1 = true, bool UseQ2 = true) { if (target == null) { return(false); } if (Yasuo.LSIsDashing() || InDash) { return(false); } var tready = TornadoReady; if ((tready && !UseQ2) || !tready && !UseQ1) { return(false); } if (GetMode() == Modes.Beta && !ShouldNormalQ(target)) { if (tready && GetBool("Combo.UseEQ", YasuoMenu.ComboM)) { if (Spells[E].IsReady() && target.IsDashable(500)) { var dashPos = GetDashPos(target); if (dashPos.To3D().CountEnemiesInRange(QRadius) >= 1) { //Cast E to trigger EQ if (GetBool("Misc.saveQ4QE", YasuoMenu.MiscM) && isHealthy && GetBool("Combo.UseE", YasuoMenu.ComboM) && (GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || !GetDashPos(target).PointUnderEnemyTurret())) { return(Spells[E].CastOnUnit(target)); } } } } } else { LeagueSharp.Common.Spell sp = tready ? Spells[Q2] : Spells[Q]; var pred = sp.GetPrediction(target); if (pred.HitChance >= minhc) { return(sp.Cast(pred.CastPosition)); } } return(false); }
private static void CastQ(Obj_AI_Base target, EloBuddy.SDK.Enumerations.HitChance hitChance = EloBuddy.SDK.Enumerations.HitChance.High) { if (!_spellQ.IsReady()) { return; } if (target == null || !target.LSIsValidTarget()) { return; } _spellQ.CastIfHitchanceEquals(target, hitChance); }
/// <summary> /// Spell extension for cast arc spell with SPrediction /// </summary> /// <param name="s">Spell to cast</param> /// <param name="t">Target for spell</param> /// <param name="hc">Minimum HitChance to cast</param> /// <param name="reactionIgnoreDelay">Delay to ignore target's reaction time</param> /// <param name="minHit">Minimum Hit Count to cast</param> /// <param name="rangeCheckFrom">Position where spell will be casted from</param> /// <param name="filterHPPercent">Minimum HP Percent to cast (for target)</param> /// <returns>true if spell has casted</returns> public static bool SPredictionCastArc(this Spell s, AIHeroClient t, EloBuddy.SDK.Enumerations.HitChance hc, bool arconly = true, int reactionIgnoreDelay = 0, byte minHit = 1, Vector3?rangeCheckFrom = null, float filterHPPercent = 100) { if (ConfigMenu.SelectedPrediction == 1) { throw new NotSupportedException("Arc Prediction not supported in Common prediction"); } if (minHit > 1) { return(SPredictionCastAoeArc(s, minHit)); } if (t.HealthPercent > filterHPPercent) { return(false); } if (rangeCheckFrom == null) { rangeCheckFrom = ObjectManager.Player.ServerPosition; } var avgt = t.AvgMovChangeTime() + reactionIgnoreDelay; float movt = t.LastMovChangeTime(); var avgp = t.AvgPathLenght(); var result = ArcPrediction.GetPrediction(t, s.Width, s.Delay, s.Speed, s.Range, s.Collision, t.GetWaypoints(), avgt, movt, avgp, t.LastAngleDiff(), s.From.LSTo2D(), s.RangeCheckFrom.LSTo2D(), arconly); if (result.HitChance >= hc) { s.Cast(result.CastPosition); return(true); } return(false); }
/// <summary> /// Spell extension for cast vector spell with SPrediction /// </summary> /// <param name="s">Spell to cast</param> /// <param name="t">Target for spell</param> /// <param name="ringRadius">Ring Radius</param> /// <param name="hc">Minimum HitChance to cast</param> /// <param name="reactionIgnoreDelay">Delay to ignore target's reaction time</param> /// <param name="minHit">Minimum Hit Count to cast</param> /// <param name="rangeCheckFrom">Position where spell will be casted from</param> /// <param name="filterHPPercent">Minimum HP Percent to cast (for target)</param> /// <returns>true if spell has casted</returns> public static bool SPredictionCastRing(this Spell s, AIHeroClient t, float ringRadius, EloBuddy.SDK.Enumerations.HitChance hc, bool onlyEdge = true, int reactionIgnoreDelay = 0, byte minHit = 1, Vector3?rangeCheckFrom = null, float filterHPPercent = 100) { if (ConfigMenu.SelectedPrediction == 1) { throw new NotSupportedException("Vector Prediction not supported in Common prediction"); } if (minHit > 1) { throw new NotSupportedException("Ring aoe prediction not supported yet"); } if (t.HealthPercent > filterHPPercent) { return(false); } if (rangeCheckFrom == null) { rangeCheckFrom = ObjectManager.Player.ServerPosition; } var avgt = t.AvgMovChangeTime() + reactionIgnoreDelay; float movt = t.LastMovChangeTime(); var avgp = t.AvgPathLenght(); Prediction.Result result; if (onlyEdge) { result = RingPrediction.GetPrediction(t, s.Width, ringRadius, s.Delay, s.Speed, s.Range, s.Collision, t.GetWaypoints(), avgt, movt, avgp, s.From.LSTo2D(), rangeCheckFrom.Value.LSTo2D()); } else { result = CirclePrediction.GetPrediction(t, s.Width, s.Delay, s.Speed, s.Range + ringRadius, s.Collision, t.GetWaypoints(), avgt, movt, avgp, 360, s.From.LSTo2D(), rangeCheckFrom.Value.LSTo2D()); } Drawings.s_DrawTick = Utils.TickCount; Drawings.s_DrawPos = result.CastPosition; Drawings.s_DrawHitChance = result.HitChance.ToString(); Drawings.s_DrawDirection = (result.CastPosition - s.From.LSTo2D()).LSNormalized().LSPerpendicular(); Drawings.s_DrawWidth = (int)ringRadius; if (result.HitChance >= hc) { s.Cast(result.CastPosition); return(true); } return(false); }
/// <summary> /// Spell extension for cast spell with SPrediction /// </summary> /// <param name="s">Spell to cast</param> /// <param name="t">Target for spell</param> /// <param name="hc">Minimum HitChance to cast</param> /// <param name="reactionIgnoreDelay">Delay to ignore target's reaction time</param> /// <param name="minHit">Minimum Hit Count to cast</param> /// <param name="rangeCheckFrom">Position where spell will be casted from</param> /// <param name="filterHPPercent">Minimum HP Percent to cast (for target)</param> /// <returns>true if spell has casted</returns> public static bool SPredictionCast(this Spell s, AIHeroClient t, EloBuddy.SDK.Enumerations.HitChance hc, int reactionIgnoreDelay = 0, byte minHit = 1, Vector3?rangeCheckFrom = null, float filterHPPercent = 100) { if (rangeCheckFrom == null) { rangeCheckFrom = ObjectManager.Player.ServerPosition; } if (t == null) { return(s.Cast()); } if (!s.IsSkillshot) { return(s.Cast(t)); } #region if common prediction selected if (ConfigMenu.SelectedPrediction == 1) { var pout = s.GetPrediction(t, minHit > 1); if (minHit > 1) { if (pout.GetCollisionObjects <AIHeroClient>().Length >= minHit) { return(s.Cast(pout.CastPosition)); } else { return(false); } } if (pout.HitChance >= hc) { return(s.Cast(pout.CastPosition)); } return(false); } #endregion if (minHit > 1) { return(SPredictionCastAoe(s, minHit)); } if (t.HealthPercent > filterHPPercent) { return(false); } var avgt = t.AvgMovChangeTime() + reactionIgnoreDelay; float movt = t.LastMovChangeTime(); var avgp = t.AvgPathLenght(); var waypoints = t.GetWaypoints(); Prediction.Result result; switch (s.Type) { case SkillshotType.SkillshotLine: result = LinePrediction.GetPrediction(t, s.Width, s.Delay, s.Speed, s.Range, s.Collision, waypoints, avgt, movt, avgp, t.LastAngleDiff(), s.From.LSTo2D(), s.RangeCheckFrom.LSTo2D()); break; case SkillshotType.SkillshotCircle: result = CirclePrediction.GetPrediction(t, s.Width, s.Delay, s.Speed, s.Range, s.Collision, waypoints, avgt, movt, avgp, t.LastAngleDiff(), s.From.LSTo2D(), s.RangeCheckFrom.LSTo2D()); break; case SkillshotType.SkillshotCone: result = ConePrediction.GetPrediction(t, s.Width, s.Delay, s.Speed, s.Range, s.Collision, waypoints, avgt, movt, avgp, t.LastAngleDiff(), s.From.LSTo2D(), s.RangeCheckFrom.LSTo2D()); break; default: throw new InvalidOperationException("Unknown spell type"); } Drawings.s_DrawTick = Utils.TickCount; Drawings.s_DrawPos = result.CastPosition; Drawings.s_DrawHitChance = result.HitChance.ToString(); Drawings.s_DrawDirection = (result.CastPosition - s.From.LSTo2D()).LSNormalized().LSPerpendicular(); Drawings.s_DrawWidth = (int)s.Width; if (result.HitChance >= hc) { s.Cast(result.CastPosition); return(true); } return(false); }
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); }
private void CheckOutofRange(bool checkDodge) { if (this.Input.RangeCheckFrom.LSTo2D().LSDistance(this.CastPosition) > this.Input.SpellRange - (checkDodge ? GetArrivalTime(this.Input.From.LSTo2D().LSDistance(this.CastPosition), this.Input.SpellDelay, this.Input.SpellMissileSpeed) * this.Unit.MoveSpeed * (100 - ConfigMenu.MaxRangeIgnore) / 100f : 0)) this.HitChance = EloBuddy.SDK.Enumerations.HitChance.Unknown; }
private void CheckCollisions() { if (Input.SpellCollisionable && (CollisionResult.Objects.HasFlag(Collision.Flags.Minions) || CollisionResult.Objects.HasFlag(Collision.Flags.YasuoWall))) HitChance = EloBuddy.SDK.Enumerations.HitChance.Collision; }