/// <summary> /// Returns the number of feathers which can hit the target unit. /// </summary> /// <param name="unit">The unit.</param> public int CountFeathersHitOnUnit(Obj_AI_Base unit) { var hit = 0; foreach (var feather in Feathers) { var playerToFeatherRectangle = new Vector2Geometry.Rectangle((Vector2)UtilityClass.Player.ServerPosition, (Vector2)feather.Value, SpellClass.E.Width); if (playerToFeatherRectangle.IsInside((Vector2)unit.ServerPosition)) { hit++; } } return(hit); }
/// <summary> /// Gets the approximative number of mines hit by the target inside the MineField after W Cast. /// </summary> /// <param name="unit">The unit.</param> public int GetBestBouldersHitPositionHitBoulders(Obj_AI_Base unit) { var mostBouldersHit = 0; foreach (var mine in MineField) { var unitToMineRectangle = new Vector2Geometry.Rectangle((Vector2)unit.ServerPosition, (Vector2)unit.ServerPosition.Extend((Vector2)mine.Value, WPushDistance), unit.BoundingRadius); var bouldersHit = MineField.Count(o => unitToMineRectangle.IsInside((Vector2)o.Value)); if (bouldersHit > mostBouldersHit) { mostBouldersHit = bouldersHit; } } return(mostBouldersHit); }
/// <summary> /// Initializes the drawings. /// </summary> public void Drawings() { /// <summary> /// Loads the Q drawing. /// </summary> if (SpellClass.Q.Ready && MenuClass.Drawings["q"].As <MenuBool>().Enabled) { Render.Circle(UtilityClass.Player.Position, SpellClass.Q.Range, 30, Color.LightGreen); } /// <summary> /// Loads the Feather linking drawing. /// </summary> if (!UtilityClass.Player.SpellBook.GetSpell(SpellSlot.E).State.HasFlag(SpellState.Cooldown) && MenuClass.Drawings["feathers"].As <MenuBool>().Enabled) { foreach (var feather in Feathers) { var drawFeatherPos = feather.Value.FixHeight(); var realFeatherHitbox = new Vector2Geometry.Rectangle((Vector2)UtilityClass.Player.ServerPosition, (Vector2)drawFeatherPos, SpellClass.E.Width); var drawFeatherHitbox = new Vector3Geometry.Rectangle(UtilityClass.Player.Position, drawFeatherPos, SpellClass.E.Width); drawFeatherHitbox.Draw( GameObjects.EnemyHeroes.Any(h => h.IsValidTarget() && realFeatherHitbox.IsInside((Vector2)h.Position)) ? Color.Blue : Color.Yellow); Render.Circle(drawFeatherPos, SpellClass.E.Width, 5, Color.OrangeRed); } } /// <summary> /// Loads the R drawing. /// </summary> if (SpellClass.R.Ready && MenuClass.Drawings["r"].As <MenuBool>().Enabled) { Render.Circle(UtilityClass.Player.Position, SpellClass.R.Range, 30, Color.Red); } }
/// <summary> /// Called on tick update. /// </summary> public void Combo() { if (BallPosition == null) { return; } /// <summary> /// The W Combo Logic. /// </summary> if (SpellClass.W.Ready && MenuClass.Spells["w"]["combo"].As <MenuBool>().Enabled) { if (GameObjects.EnemyHeroes.Any(t => !Invulnerable.Check(t, DamageType.Magical, false) && t.IsValidTarget(SpellClass.W.Width - t.BoundingRadius - SpellClass.W.Delay * t.BoundingRadius, false, false, (Vector3)BallPosition))) { SpellClass.W.Cast(); } } /// <summary> /// The E Logics. /// </summary> if (SpellClass.E.Ready) { /// <summary> /// The E Engager Logic. /// </summary> if (MenuClass.Spells["r"]["aoe"] != null && MenuClass.Spells["r"]["aoe"].As <MenuSliderBool>().Enabled&& MenuClass.Spells["e"]["engager"].As <MenuBool>().Enabled) { var bestAllies = GameObjects.AllyHeroes .Where(a => !a.IsMe && a.IsValidTarget(SpellClass.E.Range, true) && MenuClass.Spells["e"]["engagerswhitelist"][a.ChampionName.ToLower()].As <MenuBool>().Enabled); var bestAlly = bestAllies .FirstOrDefault(a => GameObjects.EnemyHeroes.Count(t => !Invulnerable.Check(t, DamageType.Magical, false) && t.IsValidTarget(SpellClass.R.Width - t.BoundingRadius - SpellClass.R.Delay * t.BoundingRadius, false, false, a.ServerPosition)) >= MenuClass.Spells["r"]["aoe"].As <MenuSliderBool>().Value); if (bestAlly != null) { UtilityClass.CastOnUnit(SpellClass.E, bestAlly); } } /// <summary> /// The E Combo Logic. /// </summary> if (MenuClass.Spells["e"]["combo"].As <MenuBool>().Enabled) { var bestAllies = GameObjects.AllyHeroes .Where(a => a.IsValidTarget(SpellClass.E.Range, true) && MenuClass.Spells["e"]["combowhitelist"][a.ChampionName.ToLower()].As <MenuBool>().Enabled) .OrderBy(o => o.GetRealHealth()); foreach (var ally in bestAllies) { var allyToBallRectangle = new Vector2Geometry.Rectangle( (Vector2)ally.ServerPosition, (Vector2)ally.ServerPosition.Extend((Vector3)BallPosition, ally.Distance((Vector3)BallPosition) + 30f), SpellClass.E.Width); if (GameObjects.EnemyHeroes.Any(t => t.IsValidTarget() && !Invulnerable.Check(t, DamageType.Magical) && allyToBallRectangle.IsInside((Vector2)t.ServerPosition))) { UtilityClass.CastOnUnit(SpellClass.E, ally); return; } } } } /// <summary> /// The Combo Q Logic. /// </summary> if (SpellClass.Q.Ready && MenuClass.Spells["q"]["combo"].As <MenuBool>().Enabled) { var bestTarget = Extensions.GetBestEnemyHeroTargetInRange(SpellClass.Q.Range); if (bestTarget != null) { if (SpellClass.E.Ready && !UtilityClass.Player.HasBuff("orianaghostself") && bestTarget.Distance((Vector3)BallPosition) >= bestTarget.Distance(UtilityClass.Player) && MenuClass.E2["gaine"].As <MenuBool>().Enabled) { UtilityClass.CastOnUnit(SpellClass.E, UtilityClass.Player); return; } SpellClass.Q.GetPredictionInput(bestTarget).From = (Vector3)BallPosition; SpellClass.Q.Cast(SpellClass.Q.GetPrediction(bestTarget).CastPosition); } } }