Ejemplo n.º 1
0
        private static void Mixed()
        {
            // harass
            var target = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);
            // Q lasthit minions
            var minions = MinionManager.GetMinions(Player.ServerPosition, Q.Range);
            Keg nbar    = NearestKeg(Player.ServerPosition.To2D());

            if (GetBool("bangplank.menu.farm.qlh") && Q.IsReady() && Player.ManaPercent >= Getslider("bangplank.menu.farm.qlhmana") && target == null)
            {
                if (minions != null)
                {
                    foreach (var m in minions)
                    {
                        if (m != null)
                        {
                            if (m.Health <= Player.GetSpellDamage(m, SpellSlot.Q))
                            {
                                Q.CastOnUnit(m);
                            }
                        }
                    }
                }
            }
            // Q
            if (GetBool("bangplank.menu.harass.q") && Q.IsReady() && Player.ManaPercent >= Getslider("bangplank.menu.harass.qmana") && TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical) != null

                )
            {
                if (LiveBarrels.Count == 0)
                {
                    Q.Cast(TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical));
                }
                if (LiveBarrels.Count >= 1 && nbar.KegObj.Distance(Player) > E.Range)
                {
                    Q.Cast(TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical));
                }
            }


            // Extended EQ, done but still some bugs remaining, going to fix them #TODO
            if (Q.IsReady() && E.IsReady() && GetBool("bangplank.menu.harass.extendedeq") && GetBool("bangplank.menu.misc.barrelmanager.edisabled") == false && Player.ManaPercent >= Getslider("bangplank.menu.harass.qmana"))
            {
                if (!LiveBarrels.Any())
                {
                    return;
                }


                if (Player.ServerPosition.Distance(nbar.KegObj.Position) < Q.Range && nbar.KegObj.Health < 3)
                {
                    if (target != null)
                    {
                        {
                            var prediction = Prediction.GetPrediction(target, 0.8f).CastPosition;
                            if (nbar.KegObj.Distance(prediction) < LinkRange)
                            {
                                E.Cast(prediction);

                                if (Player.Level < 13 && Player.Level >= 7 && nbar.KegObj.Health == 2)
                                {
                                    LeagueSharp.Common.Utility.DelayAction.Add((int)(580 - Game.Ping), () =>
                                    {
                                        Q.Cast(nbar.KegObj);
                                    }
                                                                               );
                                }

                                if (Player.Level >= 13 && nbar.KegObj.Health == 2)
                                {
                                    LeagueSharp.Common.Utility.DelayAction.Add((int)(80 - Game.Ping), () =>
                                    {
                                        Q.Cast(nbar.KegObj);
                                    }
                                                                               );
                                }
                                if (nbar.KegObj.Health == 1)
                                {
                                    Q.Cast(nbar.KegObj);
                                }
                            }
                        }
                    }
                }
            }
            BarrelManager();
        }
Ejemplo n.º 2
0
        private void Combo()
        {
            var target = TargetSelector.GetTarget(
                E.Range, TargetSelector.DamageType.Physical, true, HeroManager.Enemies.Where(h => h.IsInvulnerable));

            if (target == null)
            {
                return;
            }
            var  ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (config.Item("useIgnite", true).GetValue <bool>() &&
                ignitedmg > target.Health - Program.IncDamages.GetEnemyData(target.NetworkId).DamageTaken&& hasIgnite &&
                !CombatHelper.CheckCriticalBuffs(target) && !Q.IsReady() && !justQ)
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (config.Item("usew", true).GetValue <Slider>().Value > player.HealthPercent &&
                player.CountEnemiesInRange(500) > 0)
            {
                W.Cast();
            }
            if (R.IsReady() && config.Item("user", true).GetValue <bool>())
            {
                var Rtarget =
                    HeroManager.Enemies.FirstOrDefault(e => e.HealthPercent < 50 && e.CountAlliesInRange(660) > 0);
                if (Rtarget != null)
                {
                    R.CastIfWillHit(Rtarget, config.Item("Rmin", true).GetValue <Slider>().Value);
                }
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, ComboDamage(target), config.Item("AutoW", true).GetValue <bool>());
            }
            var dontQ   = false;
            var barrels =
                GetBarrels()
                .Where(
                    o =>
                    o.IsValid && !o.IsDead && o.Distance(player) < 1600 && o.SkinName == "GangplankBarrel" &&
                    o.GetBuff("gangplankebarrellife").Caster.IsMe)
                .ToList();

            if (config.Item("useq", true).GetValue <bool>() && Q.IsReady() && config.Item("usee", true).GetValue <bool>() &&
                E.IsReady() && Orbwalking.CanMove(100) && !justE)
            {
                var pred = Prediction.GetPrediction(target, 0.5f);
                if (pred.Hitchance >= HitChance.High)
                {
                    var Qbarrels = GetBarrels().Where(o => o.Distance(player) < Q.Range && KillableBarrel(o));
                    foreach (var Qbarrel in Qbarrels.OrderByDescending(b => b.Distance(target) < BarrelExplosionRange))
                    {
                        var targPred = Prediction.GetPrediction(target, GetQTime(Qbarrel));
                        if (Qbarrel.Distance(targPred.UnitPosition) < BarrelExplosionRange)
                        {
                            if (config.Item("useeAOE", true).GetValue <bool>() && barrels.Count < 2)
                            {
                                var enemies =
                                    HeroManager.Enemies.Where(
                                        e => e.Distance(player) < 1600 && e.Distance(Qbarrel) > BarrelExplosionRange)
                                    .Select(e => Prediction.GetPrediction(e, 05f));
                                var pos =
                                    GetBarrelPoints(Qbarrel.Position)
                                    .Where(p => p.Distance(Qbarrel.Position) < BarrelConnectionRange)
                                    .OrderByDescending(
                                        p => enemies.Count(e => e.UnitPosition.Distance(p) < BarrelExplosionRange))
                                    .ThenBy(p => p.Distance(target.Position))
                                    .FirstOrDefault();
                                if (pos.IsValid() && pos.CountEnemiesInRange(BarrelExplosionRange) > 0 &&
                                    enemies.Count(e => e.UnitPosition.Distance(pos) < BarrelExplosionRange) > 0)
                                {
                                    dontQ = true;
                                    E.Cast(pos);
                                }
                            }
                            break;
                        }
                        var point =
                            GetBarrelPoints(Qbarrel.Position)
                            .Where(
                                p =>
                                p.IsValid() && !p.IsWall() && p.Distance(player.Position) < E.Range &&
                                target.Distance(p) < BarrelExplosionRange &&
                                p.Distance(targPred.UnitPosition) < BarrelExplosionRange &&
                                Qbarrel.Distance(p) < BarrelConnectionRange &&
                                savedBarrels.Count(b => b.barrel.Position.Distance(p) < BarrelExplosionRange) <
                                1)
                            .OrderBy(p => p.Distance(pred.UnitPosition))
                            .FirstOrDefault();
                        if (point.IsValid())
                        {
                            dontQ = true;
                            E.Cast(point);
                            Utility.DelayAction.Add(1, () => Q.CastOnUnit(Qbarrel));
                            return;
                        }
                    }
                }
            }
            var meleeRangeBarrel =
                barrels.FirstOrDefault(
                    b =>
                    (b.Health < 2 || (b.Health == 2 && !KillableBarrel(b, true) && Q.IsReady() && !justQ)) &&
                    KillableBarrel(b, true) && b.Distance(player) < Orbwalking.GetRealAutoAttackRange(b));
            var secondb =
                barrels.Where(
                    b =>
                    b.Distance(meleeRangeBarrel) < BarrelConnectionRange &&
                    HeroManager.Enemies.Count(
                        o =>
                        o.IsValidTarget() && o.Distance(b) < BarrelExplosionRange &&
                        b.Distance(Prediction.GetPrediction(o, 500).UnitPosition) < BarrelExplosionRange) > 0);

            if (meleeRangeBarrel != null &&
                ((HeroManager.Enemies.Count(
                      o =>
                      o.IsValidTarget() && o.Distance(meleeRangeBarrel) < BarrelExplosionRange &&
                      meleeRangeBarrel.Distance(Prediction.GetPrediction(o, 500).UnitPosition) < BarrelExplosionRange) >
                  0) || secondb != null) && !Q.IsReady() && !justQ && Orbwalking.CanAttack())
            {
                orbwalker.SetAttack(false);
                player.IssueOrder(GameObjectOrder.AttackUnit, meleeRangeBarrel);
            }
            if (Q.IsReady())
            {
                if (barrels.Any())
                {
                    var detoneateTargetBarrels = barrels.Where(b => b.Distance(player) < Q.Range);
                    if (config.Item("detoneateTarget", true).GetValue <bool>())
                    {
                        if (detoneateTargetBarrels.Any())
                        {
                            foreach (var detoneateTargetBarrel in detoneateTargetBarrels)
                            {
                                if (!KillableBarrel(detoneateTargetBarrel))
                                {
                                    continue;
                                }
                                if (
                                    detoneateTargetBarrel.Distance(
                                        Prediction.GetPrediction(target, GetQTime(detoneateTargetBarrel)).UnitPosition) <
                                    BarrelExplosionRange &&
                                    target.Distance(detoneateTargetBarrel.Position) < BarrelExplosionRange)
                                {
                                    dontQ = true;
                                    Q.CastOnUnit(detoneateTargetBarrel, config.Item("packets").GetValue <bool>());
                                    return;
                                }
                                var detoneateTargetBarrelSeconds =
                                    barrels.Where(b => b.Distance(detoneateTargetBarrel) < BarrelConnectionRange);
                                if (detoneateTargetBarrelSeconds.Any())
                                {
                                    foreach (var detoneateTargetBarrelSecond in detoneateTargetBarrelSeconds)
                                    {
                                        if (
                                            detoneateTargetBarrelSecond.Distance(
                                                Prediction.GetPrediction(
                                                    target, GetQTime(detoneateTargetBarrel) + 0.15f).UnitPosition) <
                                            BarrelExplosionRange &&
                                            target.Distance(detoneateTargetBarrelSecond.Position) < BarrelExplosionRange)
                                        {
                                            dontQ = true;
                                            Q.CastOnUnit(detoneateTargetBarrel, config.Item("packets").GetValue <bool>());
                                            return;
                                        }
                                    }
                                }
                            }
                        }

                        if (config.Item("detoneateTargets", true).GetValue <Slider>().Value > 1)
                        {
                            var enemies =
                                HeroManager.Enemies.Where(e => e.IsValidTarget() && e.Distance(player) < 600)
                                .Select(e => Prediction.GetPrediction(e, 0.25f));
                            var enemies2 =
                                HeroManager.Enemies.Where(e => e.IsValidTarget() && e.Distance(player) < 600)
                                .Select(e => Prediction.GetPrediction(e, 0.35f));
                            if (detoneateTargetBarrels.Any())
                            {
                                foreach (var detoneateTargetBarrel in detoneateTargetBarrels)
                                {
                                    if (!KillableBarrel(detoneateTargetBarrel))
                                    {
                                        continue;
                                    }
                                    var enemyCount =
                                        enemies.Count(
                                            e =>
                                            e.UnitPosition.Distance(detoneateTargetBarrel.Position) <
                                            BarrelExplosionRange);
                                    if (enemyCount >= config.Item("detoneateTargets", true).GetValue <Slider>().Value&&
                                        detoneateTargetBarrel.CountEnemiesInRange(BarrelExplosionRange) >=
                                        config.Item("detoneateTargets", true).GetValue <Slider>().Value)
                                    {
                                        dontQ = true;
                                        Q.CastOnUnit(detoneateTargetBarrel, config.Item("packets").GetValue <bool>());
                                        return;
                                    }
                                    var detoneateTargetBarrelSeconds =
                                        barrels.Where(b => b.Distance(detoneateTargetBarrel) < BarrelConnectionRange);
                                    if (detoneateTargetBarrelSeconds.Any())
                                    {
                                        foreach (var detoneateTargetBarrelSecond in detoneateTargetBarrelSeconds)
                                        {
                                            if (enemyCount +
                                                enemies2.Count(
                                                    e =>
                                                    e.UnitPosition.Distance(detoneateTargetBarrelSecond.Position) <
                                                    BarrelExplosionRange) >=
                                                config.Item("detoneateTargets", true).GetValue <Slider>().Value&&
                                                detoneateTargetBarrelSecond.CountEnemiesInRange(BarrelExplosionRange) >=
                                                config.Item("detoneateTargets", true).GetValue <Slider>().Value)
                                            {
                                                dontQ = true;
                                                Q.CastOnUnit(
                                                    detoneateTargetBarrel, config.Item("packets").GetValue <bool>());
                                                return;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                if (config.Item("useeAlways", true).GetValue <bool>() && E.IsReady() && player.Distance(target) < E.Range &&
                    !justE && target.Health > Q.GetDamage(target) + player.GetAutoAttackDamage(target) &&
                    Orbwalking.CanMove(100) && config.Item("eStacksC", true).GetValue <Slider>().Value < E.Instance.Ammo)
                {
                    CastE(target, barrels);
                }
                var Qbarrels = GetBarrels().FirstOrDefault(o => o.Distance(player) < Q.Range);
                if (Qbarrels != null && E.Instance.Ammo > 0 && Q.IsReady() && config.Item("usee", true).GetValue <bool>() &&
                    target.Health > Q.GetDamage(target))
                {
                    dontQ = true;
                }
                if (config.Item("useq", true).GetValue <bool>() && Q.CanCast(target) && Orbwalking.CanMove(100) && !justE &&
                    !dontQ)
                {
                    CastQonHero(target, barrels);
                }
            }
        }
Ejemplo n.º 3
0
        private void Cast_W(string source, bool useQ, bool useE)
        {
            var target = SimpleTs.GetTarget(Q.Range + W.Range - 100, SimpleTs.DamageType.Physical);

            if (target == null)
            {
                return;
            }

            if (GetMarked() != null)
            {
                target = GetMarked();
            }

            if (E.Level < 1)
            {
                useE = false;
            }
            if (Q.Level < 1)
            {
                useQ = false;
            }

            if (wSpell.ToggleState == 0 && W.IsReady() && Environment.TickCount - W.LastCastAttemptT > 0)
            {
                if (Player.Distance(target) < W.Range + target.BoundingRadius)
                {
                    var pred = Prediction.GetPrediction(target, 250f);

                    if ((!useQ || Q.IsReady()) && (!useE || E.IsReady()))
                    {
                        if (IsWall(pred.UnitPosition.To2D()))
                        {
                            return;
                        }

                        W.Cast(pred.UnitPosition);
                        W.LastCastAttemptT = Environment.TickCount + 500;

                        _predWq = useQ ? pred.CastPosition : Vector3.Zero;

                        if (useE && pred.UnitPosition.Distance(target.ServerPosition) < E.Range + target.BoundingRadius)
                        {
                            _willEHit = true;
                        }
                        else
                        {
                            _willEHit = false;
                        }
                    }
                }
                else
                {
                    var predE = Prediction.GetPrediction(target, .25f);
                    var vec   = Player.ServerPosition + Vector3.Normalize(predE.CastPosition - Player.ServerPosition) * W.Range;

                    if (IsWall(vec.To2D()))
                    {
                        return;
                    }

                    if ((!useQ || Q.IsReady()) && (!useE || E.IsReady()))
                    {
                        var pred = GetP2(vec, Q, target, true);

                        if (useQ && useE)
                        {
                            if ((menu.Item("W_Require_QE").GetValue <bool>() && source == "Harass") || source == "Coax")
                            {
                                if (vec.Distance(target.ServerPosition) < E.Range)
                                {
                                    W.Cast(vec);
                                    W.LastCastAttemptT = Environment.TickCount + 500;
                                }
                            }
                            else
                            {
                                W.Cast(vec);
                                W.LastCastAttemptT = Environment.TickCount + 500;
                            }
                        }
                        else if (useE && vec.Distance(target.ServerPosition) < E.Range + target.BoundingRadius)
                        {
                            W.Cast(vec);
                            W.LastCastAttemptT = Environment.TickCount + 500;
                        }
                        else if (useQ)
                        {
                            W.Cast(vec);
                            W.LastCastAttemptT = Environment.TickCount + 500;
                        }

                        _predWq   = useQ ? pred.UnitPosition : Vector3.Zero;
                        _willEHit = useE && vec.Distance(target.ServerPosition) < E.Range;
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private void Combo()
        {
            AIHeroClient target = DrawHelper.GetBetterTarget(W.Range, TargetSelector.DamageType.Physical);

            if (target == null)
            {
                return;
            }
            var data = Program.IncDamages.GetAllyData(player.NetworkId);

            if (config.Item("usewCC", true).GetValue <bool>() && W.IsReady() && data.AnyCC)
            {
                W.Cast(target.Position);
            }
            var closestPassive = GetClosestPassivePosition(target);

            if (closestPassive.IsValid() && config.Item("MoveToVitals", true).GetValue <bool>() &&
                Orbwalking.CanMove(300) && !Orbwalking.CanAttack() && !player.Spellbook.IsAutoAttacking &&
                Game.CursorPos.Distance(target.Position) < 350)
            {
                orbwalker.SetMovement(false);
                EloBuddy.Player.IssueOrder(
                    GameObjectOrder.MoveTo,
                    target.Position.Extend(closestPassive, Math.Max(player.BoundingRadius + target.BoundingRadius, 100)));
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, ComboDamage(target));
            }
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (config.Item("useq", true).GetValue <bool>() && Q.IsReady() && Orbwalking.CanMove(100) &&
                config.Item("useqMin", true).GetValue <Slider>().Value <= player.Distance(target) &&
                (closestPassive.IsValid() || (target.HealthPercent < 30)) && !player.Spellbook.IsAutoAttacking)
            {
                var pos = GetQpoint(target, closestPassive);
                if (pos.IsValid())
                {
                    Q.Cast(pos);
                }
                else if (target.HealthPercent < 30)
                {
                    if (
                        CheckQusage(
                            target.Position.Extend(
                                Prediction.GetPrediction(target, player.Distance(target) / 1600).UnitPosition, Qradius),
                            target))
                    {
                        Q.Cast(
                            target.Position.Extend(
                                Prediction.GetPrediction(target, player.Distance(target) / 1600).UnitPosition, Qradius));
                    }
                }
            }
            if (W.IsReady() && config.Item("usew", true).GetValue <bool>())
            {
                var killable  = (target.Distance(player) > 350f && W.GetDamage(target) > target.Health);
                var incAA     = data.ProjectileDamageTaken >= target.GetAutoAttackDamage(player) - 5;
                var dangerous = incAA && data.DamageTaken >= player.Health * 0.4f;
                if (killable || (incAA && !config.Item("usewDangerous", true).GetValue <bool>()) ||
                    (config.Item("usewDangerous", true).GetValue <bool>() && dangerous))
                {
                    W.CastIfHitchanceEquals(target, HitChance.Low);
                }
            }
            if (config.Item("useIgnite").GetValue <bool>() && hasIgnite && ComboDamage(target) > target.Health &&
                !Q.IsReady() &&
                (target.Distance(player) > Orbwalking.GetRealAutoAttackRange(target) || player.HealthPercent < 15))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
        }
Ejemplo n.º 5
0
        protected override void Drawing_OnDraw(EventArgs args)
        {
            if (menu.Item("Draw_Disabled", true).GetValue <bool>())
            {
                return;
            }

            xSLxOrbwalker.EnableDrawing();
            if (menu.Item("Draw_Q", true).GetValue <bool>())
            {
                if (Q.Level > 0)
                {
                    Render.Circle.DrawCircle(Player.Position, Q.Range, Q.IsReady() ? Color.Green : Color.Red);
                }
            }
            if (menu.Item("Draw_QE", true).GetValue <bool>())
            {
                if (Q.Level > 0 && E.Level > 0)
                {
                    Render.Circle.DrawCircle(Player.Position, _qe.Range, Q.IsReady() && E.IsReady() ? Color.Green : Color.Red);
                }
            }
            if (menu.Item("Draw_W", true).GetValue <bool>())
            {
                if (W.Level > 0)
                {
                    Render.Circle.DrawCircle(Player.Position, W.Range, W.IsReady() ? Color.Green : Color.Red);
                }
            }

            if (menu.Item("Draw_E", true).GetValue <bool>())
            {
                if (E.Level > 0)
                {
                    Render.Circle.DrawCircle(Player.Position, E.Range, E.IsReady() ? Color.Green : Color.Red);
                }
            }

            if (menu.Item("Draw_R", true).GetValue <bool>())
            {
                if (R.Level > 0)
                {
                    Render.Circle.DrawCircle(Player.Position, R.Range, R.IsReady() ? Color.Green : Color.Red);
                }
            }

            if (Get_Current_Orb() != null)
            {
                Render.Circle.DrawCircle(Get_Current_Orb().Position, W.Width, Color.Green);
            }

            //draw EQ
            if (menu.Item("Draw_QE_Line", true).GetValue <bool>())
            {
                var qeTarget = TargetSelector.GetTarget(_qe.Range, TargetSelector.DamageType.Magical);
                if (qeTarget == null || !Q.IsReady() || !E.IsReady())
                {
                    return;
                }

                var    from      = Prediction.GetPrediction(qeTarget, Q.Delay + E.Delay).UnitPosition;
                var    startPos  = Player.ServerPosition + Vector3.Normalize(from - Player.ServerPosition) * (E.Range - 100);
                double rangeLeft = 100 + (-0.6 * Player.Distance(startPos) + 950);
                var    endPos    = startPos + Vector3.Normalize(startPos - Player.ServerPosition) * (float)rangeLeft;

                _qe.From  = startPos;
                _qe.Delay = Q.Delay + E.Delay + Player.Distance(from) / E.Speed;

                var qePred     = _qe.GetPrediction(qeTarget);
                var projection = qePred.UnitPosition.To2D().ProjectOn(startPos.To2D(), endPos.To2D());

                if (!projection.IsOnSegment || !(projection.LinePoint.Distance(qePred.UnitPosition.To2D()) < _qe.Width))
                {
                    return;
                }

                if (qePred.Hitchance >= HitChance.Medium)
                {
                    Vector2 wtsPlayer = Drawing.WorldToScreen(Player.Position);
                    Vector2 wtsPred   = Drawing.WorldToScreen(endPos);
                    Render.Circle.DrawCircle(startPos, Q.Width / 2, Color.Aquamarine);
                    Render.Circle.DrawCircle(endPos, Q.Width / 2, Color.SpringGreen);
                    Drawing.DrawLine(wtsPlayer, wtsPred, 1, Color.LawnGreen);
                }
            }
            //end draw EQ--------------------------

            /*
             * if (getOrbCount() <= 0)
             *  return;
             * var target = TargetSelector.GetTarget(_qe.Range + 100, TargetSelector.DamageType.Magical);
             * if (target == null)
             *  return;
             *
             * foreach (var orb in getOrb().Where(x => Player.Distance(x) < E.Range && x != null))
             * {
             *  double rangeLeft = 100 + (-0.6 * Player.Distance(orb.ServerPosition) + 950);
             *  var startPos = orb.ServerPosition - Vector3.Normalize(orb.ServerPosition - Player.ServerPosition) * 100;
             *  var endPos = startPos + Vector3.Normalize(startPos - Player.ServerPosition) * (float)rangeLeft;
             *
             *  _qe.Delay = E.Delay + Player.Distance(orb)/E.Speed + target.Distance(orb)/_qe.Speed;
             *  _qe.From = startPos;
             *
             *  var targetPos = _qe.GetPrediction(target);
             *
             *  var projection = targetPos.UnitPosition.To2D().ProjectOn(startPos.To2D(), endPos.To2D());
             *
             *  if (!projection.IsOnSegment || targetPos.Hitchance < HitChance.Medium || !(projection.LinePoint.Distance(targetPos.UnitPosition.To2D()) < _qe.Width + target.BoundingRadius))
             *      return;
             *
             *  Vector2 wtsPlayer = Drawing.WorldToScreen(Player.Position);
             *  Vector2 wtsPred = Drawing.WorldToScreen(endPos);
             *  Render.Circle.DrawCircle(startPos, Q.Width / 2, Color.Aquamarine);
             *  Render.Circle.DrawCircle(endPos, Q.Width / 2, Color.SpringGreen);
             *  Drawing.DrawLine(wtsPlayer, wtsPred, 1, Color.LawnGreen);
             * }*/

            if (menu.Item("Draw_R_Killable", true).GetValue <bool>() && R.IsReady())
            {
                foreach (var wts in from unit in ObjectManager.Get <Obj_AI_Hero>().Where(x => x.IsValidTarget(2000) && !x.IsDead && x.IsEnemy).OrderByDescending(GetComboDamage)
                         let health = unit.Health + unit.HPRegenRate + 10
                                      where Get_Ult_Dmg(unit) > health
                                      select Drawing.WorldToScreen(unit.Position))
                {
                    Drawing.DrawText(wts[0] - 20, wts[1], Color.White, "KILL!!!");
                }
            }
        }
Ejemplo n.º 6
0
        private void Game_OnGameUpdate(EventArgs args)
        {
            orbwalker.SetAttack(true);
            Jungle.CastSmite(config.Item("useSmite").GetValue <KeyBind>().Active);

            Obj_AI_Hero target   = TargetSelector.GetTarget(1300, TargetSelector.DamageType.Magical, true);
            var         combodmg = 0f;

            if (target != null)
            {
                combodmg = ComboDamage(target);
            }
            switch (orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                Combo(combodmg);
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                Harass();
                break;

            case Orbwalking.OrbwalkingMode.LaneClear:
                Clear();
                break;

            case Orbwalking.OrbwalkingMode.LastHit:
                break;

            default:
                break;
            }
            if (config.Item("autoQ", true).GetValue <bool>())
            {
                if (Q.IsReady() && config.Item("useqH", true).GetValue <bool>() && savedQ != null)
                {
                    DetonateQ();
                }
            }
            if (savedQ != null && !SimpleQ)
            {
                var mob = Jungle.GetNearest(player.Position);
                if (mob != null && getQdamage(mob) > mob.Health)
                {
                    Q.Cast();
                }
            }
            if (config.Item("insec", true).GetValue <KeyBind>().Active)
            {
                if (target == null)
                {
                    player.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);
                    return;
                }
                if (savedQ != null)
                {
                    if (E.CanCast(target) &&
                        Prediction.GetPrediction(target, 0.2f).UnitPosition.Distance(savedQ.position) <
                        500 + QExplosionRange / 2)
                    {
                        E.CastIfHitchanceEquals(target, HitChance.High, config.Item("packets").GetValue <bool>());
                    }
                    if (savedQ != null && !SimpleQ /*&& target.Distance(qPos) > QExplosionRange*/ &&
                        target.Distance(player) < R.Range - 100 &&
                        target.Position.Distance(savedQ.position) < 550 + QExplosionRange / 2)
                    {
                        HandeR(target, savedQ.position, true);
                    }
                    DetonateQ();
                }
                Orbwalking.Orbwalk(target, Game.CursorPos, 90, 90);
            }
        }
Ejemplo n.º 7
0
 private float GetRealDistance(Obj_AI_Base target)
 {
     return(Player.ServerPosition.Distance(Prediction.GetPrediction(target, 0.05f).CastPosition) + Player.BoundingRadius + target.BoundingRadius);
 }
Ejemplo n.º 8
0
        public void Harass()
        {
            List <Obj_AI_Base> shadows = GetShadows();

            if (!shadows.Any() ||
                (!q.UseOnHarass && !e.UseOnHarass) ||
                (!q.IsReady() && !e.IsReady()))
            {
                return;
            }

            List <Obj_AI_Hero> blackList = zedMainMenu.GetBlockList(BlockListType.Harass);

            foreach (Obj_AI_Base objAiBase in shadows)
            {
                if (((q.UseOnHarass && !q.IsReady()) || !q.UseOnHarass) &&
                    ((e.UseOnHarass && !e.IsReady()) || !e.UseOnHarass))
                {
                    break;
                }

                if (q.UseOnHarass && q.IsReady())
                {
                    Obj_AI_Hero target = TargetSelector.GetTarget(
                        q.Range,
                        q.DamageType,
                        true,
                        blackList,
                        objAiBase.Position);

                    if (target != null)
                    {
                        PredictionInput predictionInput = new PredictionInput();
                        predictionInput.Range          = q.Range;
                        predictionInput.RangeCheckFrom = objAiBase.Position;
                        predictionInput.From           = objAiBase.Position;
                        predictionInput.Delay          = q.Delay;
                        predictionInput.Speed          = q.Speed;
                        predictionInput.Unit           = target;
                        predictionInput.Type           = SkillshotType.SkillshotLine;
                        predictionInput.Collision      = false;

                        PredictionOutput predictionOutput = Prediction.GetPrediction(predictionInput);

                        if (predictionOutput.Hitchance >= HitChance.High)
                        {
                            q.Cast(predictionOutput.CastPosition);
                        }
                    }
                }

                if (e.UseOnHarass && e.UseOnHarass)
                {
                    Obj_AI_Hero target = TargetSelector.GetTarget(e.Range, e.DamageType, true, blackList, objAiBase.Position);

                    if (target != null)
                    {
                        e.Cast();
                    }
                }
            }
        }
Ejemplo n.º 9
0
        public override void Game_OnGameUpdate(EventArgs args)
        {
            /*if (champ != null)
             * Drawing.DrawText(
             *      Drawing.WorldToScreen(champ.Position)[0] + 50,
             *      Drawing.WorldToScreen(champ.Position)[1] - 20, Color.Yellow, "" + textl);*/

            EvadeDetectedSkillshots.RemoveAll(skillshot => !skillshot.IsActive());
            Evader();

            if (Player.IsDashing() && ECast)
            {
                ECasting = true;
                ECast    = false;
            }

            if (GetValue <bool>("UseRC"))
            {
                AutoUlt();
            }

            var dashList =
                ObjectManager.Get <Obj_AI_Base>()
                .Where(o => o.IsValidTarget(E.Range) && IsDashable(o) &&
                       (o.Type == GameObjectType.obj_AI_Hero || o.Type == GameObjectType.obj_AI_Minion)).ToList();

            if (GetValue <bool>("UseQC") && (GetValue <KeyBind>("UseQHT").Active || ComboActive) && !GetValue <KeyBind>("Flee").Active)
            {
                if (YTarget.IsValidTarget(HasWhirlwind() ? Q2.Range : Q1.Range))
                {
                    if (HasWhirlwind() || YTarget.HasBuff("YasuoDashWrapper") || Orbwalker.InAutoAttackRange(YTarget))
                    {
                        AutoQ(YTarget);
                    }
                }
                else
                {
                    AutoQ(
                        HasWhirlwind()
                            ? TargetSelector.GetTarget(Q2.Range, TargetSelector.DamageType.Physical)
                            : TargetSelector.GetTarget(Q1.Range, TargetSelector.DamageType.Physical));
                }
            }

            var targetLoc = Game.CursorPos;

            if (GetValue <KeyBind>("Flee").Active)
            {
                CanMove = true;
                MoveTo(targetLoc, 100);
                DashToLoc(targetLoc, dashList, true);
            }

            if (LaneClearActive)
            {
                if (GetValue <StringList>("ELmode").SelectedIndex == 2)
                {
                    DashToLoc(targetLoc, dashList, true);
                }
                LaneClear();
            }

            if (ComboActive)
            {
                if (ECasting && ETar != null && ETar.IsValidTarget() && Q1.IsReady() && !HasWhirlwind())
                {
                    Q1.Cast(ETar);
                }
                YTarget = (TargetSelector.GetSelectedTarget().IsValidTarget() &&
                           TargetSelector.GetSelectedTarget().Distance(Game.CursorPos) <=
                           GetValue <Slider>("Cirsize").Value)
                    ? TargetSelector.GetSelectedTarget()
                    : TargetSelector.GetTarget(
                    GetValue <Slider>("Cirsize").Value, TargetSelector.DamageType.Physical, true, null,
                    Game.CursorPos);
                Orbwalker.ForceTarget(YTarget);
                Orbwalker.SetMovement(false);
                if (YTarget != null && YTarget.IsValidTarget())
                {
                    if (Orbwalker.GetTarget().IsValidTarget())
                    {
                        Orbwalker.SetAttack(Orbwalker.GetTarget().NetworkId == YTarget.NetworkId);
                    }
                    if (Orbwalking.CanMove(50))
                    {
                        if (!Orbwalker.InAutoAttackRange(YTarget))
                        {
                            DashToLoc(Prediction.GetPrediction(YTarget, 0.4f).UnitPosition, dashList, false);
                            var pLoc = Prediction.GetPrediction(YTarget, 0.1f, 175, 600).UnitPosition;
                            MoveTo(pLoc, Orbwalking.GetRealAutoAttackRange(YTarget) / 2);
                        }
                        else if (AttackReadiness > 0.3)
                        {
                            MoveByTarget(YTarget);
                        }
                    }
                }
                else
                {
                    CanMove = true;
                    Orbwalker.SetAttack(false);
                    MoveTo(targetLoc, 100);
                    DashToLoc(targetLoc, dashList, false);
                }
            }
            else
            {
                CanMove = true;
                Orbwalker.SetAttack(true);
                Orbwalker.SetMovement(true);
            }

            if (!Player.IsDashing() && ECasting && E.Instance.CooldownExpires - Game.Time > 0)
            {
                ECasting = false;
                ETar     = null;
            }
        }
Ejemplo n.º 10
0
        public static void UseFleeItems()
        {
            if (_menu == null || !_menu.Item(_menu.Name + ".enabled").GetValue <bool>())
            {
                return;
            }

            try
            {
                foreach (var item in
                         Items.Where(
                             i =>
                             i.Flags.HasFlag(ItemFlags.Flee) &&
                             _menu.Item(_menu.Name + "." + i.Name + ".flee").GetValue <bool>() && i.Item.IsOwned() &&
                             i.Item.IsReady() && i.Item.IsOwned() && i.Item.IsReady() &&
                             ObjectManager.Player.CountEnemiesInRange(i.Range) >=
                             _menu.Item(_menu.Name + "." + i.Name + ".min-enemies-range").GetValue <Slider>().Value&&
                             ObjectManager.Player.HealthPercent <=
                             _menu.Item(_menu.Name + "." + i.Name + ".player-health-below").GetValue <Slider>().Value&&
                             ObjectManager.Player.HealthPercent >=
                             _menu.Item(_menu.Name + "." + i.Name + ".player-health-above").GetValue <Slider>().Value))
                {
                    if (item.CastType != CastType.Self)
                    {
                        var lItem     = item;
                        var localItem = item;
                        foreach (var enemy in
                                 GameObjects.EnemyHeroes.Where(
                                     t =>
                                     t.IsValidTarget() && !Invulnerable.Check(t) &&
                                     t.HealthPercent <=
                                     _menu.Item(_menu.Name + "." + lItem.Name + ".target-health-below")
                                     .GetValue <Slider>()
                                     .Value&&
                                     t.HealthPercent >=
                                     _menu.Item(_menu.Name + "." + lItem.Name + ".target-health-above")
                                     .GetValue <Slider>()
                                     .Value)
                                 .OrderByDescending(
                                     t =>
                                     t.Position.Distance(ObjectManager.Player.Position, true) <
                                     Math.Pow(localItem.Range, 2)))
                        {
                            if (!Utils.IsImmobile(enemy) && !Utils.IsSlowed(enemy))
                            {
                                switch (localItem.CastType)
                                {
                                case CastType.Target:
                                    localItem.Item.Cast(enemy);
                                    break;

                                case CastType.Position:
                                    var prediction = Prediction.GetPrediction(
                                        enemy, localItem.Delay, localItem.Radius, localItem.Speed);
                                    if (prediction.Hitchance >= HitChance.Medium)
                                    {
                                        localItem.Item.Cast(prediction.CastPosition);
                                    }
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        if (ObjectManager.Player.CountEnemiesInRange(item.Range) >
                            _menu.Item(_menu.Name + "." + item.Name + ".min-enemies-range").GetValue <Slider>().Value)
                        {
                            item.Item.Cast();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Ejemplo n.º 11
0
        private void Combo()
        {
            Obj_AI_Hero target = DrawHelper.GetBetterTarget(1100, TargetSelector.DamageType.Physical, true);

            if (target == null || target.IsInvulnerable || target.MagicImmune)
            {
                return;
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, ComboDamage(target));
            }
            var  ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (config.Item("useIgnite", true).GetValue <bool>() && ignitedmg > target.Health && hasIgnite &&
                !CombatHelper.CheckCriticalBuffs(target) &&
                ((target.Distance(player) > Orbwalking.GetRealAutoAttackRange(target) &&
                  (!Q.IsReady() || Q.ManaCost < player.Mana)) || player.HealthPercent < 35))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (Q.CanCast(target))
            {
                if (config.Item("useqLimit", true).GetValue <bool>())
                {
                    if (player.CountEnemiesInRange(Q.Range) == 1 && config.Item("useq", true).GetValue <bool>() &&
                        (target.Distance(player) > Orbwalking.GetRealAutoAttackRange(target) ||
                         (Q.GetDamage(target) > target.Health) &&
                         (player.HealthPercent < 50 || player.CountAlliesInRange(900) > 0)))
                    {
                        if (Q.CastOnUnit(target))
                        {
                            HandleECombo();
                        }
                    }
                    if ((player.CountEnemiesInRange(Q.Range) > 1 && config.Item("useqSec", true).GetValue <bool>() &&
                         Q.GetDamage(target) > target.Health) || player.HealthPercent < 35f ||
                        target.Distance(player) > Orbwalking.GetRealAutoAttackRange(target))
                    {
                        if (Q.CastOnUnit(target))
                        {
                            HandleECombo();
                        }
                    }
                }
                else
                {
                    if (Q.CastOnUnit(target))
                    {
                        HandleECombo();
                    }
                }
            }
            if (R.IsReady() && config.Item("user", true).GetValue <bool>())
            {
                if (player.CountEnemiesInRange(Q.Range) >= config.Item("userMin", true).GetValue <Slider>().Value&&
                    Program.IncDamages.GetAllyData(player.NetworkId).DamageTaken > 40)
                {
                    R.Cast();
                }
                if (config.Item("userDmg", true).GetValue <bool>() &&
                    Program.IncDamages.GetAllyData(player.NetworkId).DamageTaken >= player.Health * 0.3f &&
                    player.Distance(target) < 450f)
                {
                    R.Cast();
                }
            }
            if (config.Item("useeAA", true).GetValue <bool>() && !Eactive &&
                Program.IncDamages.GetAllyData(player.NetworkId).AADamageTaken > target.GetAutoAttackDamage(player) - 10)
            {
                E.Cast();
            }
            if (Eactive)
            {
                if (E.IsReady() && target.IsValidTarget() && !target.MagicImmune &&
                    ((Prediction.GetPrediction(target, 0.1f).UnitPosition.Distance(player.Position) >
                      Orbwalking.GetRealAutoAttackRange(target) && target.Distance(player.Position) <= E.Range) ||
                     config.Item("useeStun", true).GetValue <bool>()))
                {
                    E.Cast();
                }
            }
            else
            {
                if (config.Item("useeStun", true).GetValue <bool>() &&
                    Prediction.GetPrediction(target, 0.1f).UnitPosition.Distance(player.Position) <
                    Orbwalking.GetRealAutoAttackRange(target) && target.Distance(player.Position) <= E.Range)
                {
                    E.Cast();
                }
            }
        }
Ejemplo n.º 12
0
        private static void LastHit()
        {
            if (MenuIni.SubMenu("LastHit").Item("LUse_Q").GetValue <bool>())
            {
                List <Obj_AI_Base> minions, minions2;

                minions2 = MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.Enemy);
                minions  = MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly);
                minions.RemoveAll(x => x.MaxHealth <= 5);
                minions.RemoveAll(x => x.Health > Damage.GetSpellDamage(Player, x, SpellSlot.Q));
                var i = new List <int>()
                {
                    -100, -70, 0, 70, 100
                };
                var j = new List <int>()
                {
                    -100, -70, 0, 70, 100
                };

                foreach (var minion in minions)
                {
                    foreach (int xi in i)
                    {
                        foreach (int yj in j)
                        {
                            int     cnt  = 0;
                            Vector3 temp = new Vector3(Prediction.GetPrediction(minion, 250f).UnitPosition.X + xi, Prediction.GetPrediction(minion, 250f).UnitPosition.Y + yj, Prediction.GetPrediction(minion, 250f).UnitPosition.Z);
                            foreach (var minion2 in minions2.Where(x => Vector3.Distance(temp, Prediction.GetPrediction(x, 250f).UnitPosition) < 200))
                            {
                                cnt++;
                            }

                            if (cnt == 1 && minion.Health < Damage.GetSpellDamage(Player, minion, SpellSlot.Q))
                            {
                                Q.Cast(temp);
                                break;
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 13
0
        private static void Laneclear()
        {
            if (!Orbwalking.CanMove(40))
            {
                return;
            }
            var t      = TargetSelector.GetTarget(_q1.Range, TargetSelector.DamageType.Physical);
            var minion = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, _q.Range).FirstOrDefault();

            if (minion == null || minion.Name.ToLower().Contains("ward"))
            {
                return;
            }
            var minionhitq  = _config.Item("minminions").GetValue <Slider>().Value;
            var minionhitw  = _config.Item("minminionsw").GetValue <Slider>().Value;
            var useQl       = _config.Item("UseQL").GetValue <bool>();
            var useWl       = _config.Item("UseWL").GetValue <bool>();
            var useQlP      = _config.Item("UseQLP").GetValue <bool>();
            var farmminions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, _q.Range, MinionTypes.All,
                                                       MinionTeam.NotAlly);
            var minionsq = farmminions.FindAll(qminion => minion.IsValidTarget(_q.Range));
            var minionq  = minionsq.Find(minionQ => minionQ.IsValidTarget());

            if (_q.IsReady() && useQl && !HavePassivee)
            {
                foreach (var minionssq in farmminions)
                {
                    var prediction = Prediction.GetPrediction(minionssq, _q.Delay, 10);

                    var collision = _q.GetCollision(_player.Position.To2D(),
                                                    new List <Vector2> {
                        prediction.UnitPosition.To2D()
                    });
                    foreach (var collisions in collision)
                    {
                        if (collision.Count() >= minionhitq)

                        {
                            if (collision.Last().Distance(_player) - collision[0].Distance(_player) < 600 &&
                                collision[0].Distance(_player) < 500)
                            {
                                _q.Cast(collisions);
                            }
                        }
                    }
                }
            }
            if (_q.IsReady() && useQlP && !HavePassivee)
            {
                if (_q.IsReady() && t.IsValidTarget(_q1.Range) && !HavePassivee)
                {
                    ExtendedQ();
                }
            }


            if (_w.IsReady() && useWl && !HavePassivee && !_q.IsReady())
            {
                if (_w.GetLineFarmLocation(farmminions).MinionsHit >= minionhitw)
                {
                    _w.Cast(minionq);
                }
            }
        }
Ejemplo n.º 14
0
        private async Task ExecuteAsync(CancellationToken token)
        {
            try
            {
                if (Config.ComboKeyItem)
                {
                    return;
                }

                var Hero = EntityManager <Hero> .Entities.Where(
                    x => !x.IsIllusion &&
                    x.IsAlive &&
                    x.IsVisible &&
                    x.IsValid &&
                    x.Team != Context.Owner.Team).ToList();

                foreach (var Target in Hero)
                {
                    var IsStun   = Target.Modifiers.FirstOrDefault(x => x.IsStunDebuff);
                    var IsDebuff = Target.Modifiers.FirstOrDefault(x => x.IsDebuff && x.Name == "modifier_rod_of_atos_debuff");
                    if (Config.Data.Active(Target, IsStun) && !Config.Data.CancelCombo(Target))
                    {
                        if (!Target.IsMagicImmune() && !Target.IsLinkensProtected() && !Config.Data.AntimageShield(Target))
                        {
                            var QueenofPainBlink = Target.GetAbilityById(AbilityId.queenofpain_blink);
                            var AntiMageBlink    = Target.GetAbilityById(AbilityId.antimage_blink);

                            // Hex
                            if (Main.Hex != null &&
                                Config.AutoItemsToggler.Value.IsEnabled(Main.Hex.Item.Name) &&
                                Main.Hex.CanBeCasted &&
                                Main.Hex.CanHit(Target) &&
                                (IsStun == null || IsStun.RemainingTime <= 0.3))
                            {
                                Main.Hex.UseAbility(Target);
                                await Await.Delay(Main.Hex.GetCastDelay(Target), token);
                            }

                            // Orchid
                            if (Main.Orchid != null &&
                                Config.AutoItemsToggler.Value.IsEnabled(Main.Orchid.Item.Name) &&
                                Main.Orchid.CanBeCasted &&
                                Main.Orchid.CanHit(Target))
                            {
                                Main.Orchid.UseAbility(Target);
                                await Await.Delay(Main.Orchid.GetCastDelay(Target), token);
                            }

                            // Bloodthorn
                            if (Main.Bloodthorn != null &&
                                Config.AutoItemsToggler.Value.IsEnabled(Main.Bloodthorn.Item.Name) &&
                                Main.Bloodthorn.CanBeCasted &&
                                Main.Bloodthorn.CanHit(Target))
                            {
                                Main.Bloodthorn.UseAbility(Target);
                                await Await.Delay(Main.Bloodthorn.GetCastDelay(Target), token);
                            }

                            // AncientSeal
                            if (Main.AncientSeal != null &&
                                Config.AutoAbilitiesToggler.Value.IsEnabled(Main.AncientSeal.Ability.Name) &&
                                Main.AncientSeal.CanBeCasted &&
                                Main.AncientSeal.CanHit(Target))
                            {
                                Main.AncientSeal.UseAbility(Target);
                                await Await.Delay(Main.AncientSeal.GetCastDelay(Target), token);
                            }

                            // MysticFlare
                            if (Main.MysticFlare != null &&
                                Config.AutoAbilitiesToggler.Value.IsEnabled(Main.MysticFlare.Ability.Name) &&
                                Main.MysticFlare.CanBeCasted &&
                                Main.MysticFlare.CanHit(Target))
                            {
                                var CheckHero = EntityManager <Hero> .Entities.Where(
                                    x => !x.IsIllusion &&
                                    x.IsAlive &&
                                    x.IsVisible &&
                                    x.IsValid &&
                                    x.Team != Context.Owner.Team &&
                                    x.Distance2D(Context.Owner) <= Main.MysticFlare.CastRange);

                                var UltimateScepter  = Context.Owner.HasAghanimsScepter();
                                var DubleMysticFlare = UltimateScepter && CheckHero.Count() == 1;

                                var Input =
                                    new PredictionInput(
                                        Context.Owner,
                                        Target,
                                        0,
                                        float.MaxValue,
                                        Main.MysticFlare.CastRange,
                                        DubleMysticFlare ? -250 : -100,
                                        PredictionSkillshotType.SkillshotCircle,
                                        true)
                                {
                                    CollisionTypes = CollisionTypes.None
                                };

                                var Output = Prediction.GetPrediction(Input);

                                Main.MysticFlare.UseAbility(Output.CastPosition);
                                await Await.Delay(Main.MysticFlare.GetCastDelay(Target), token);
                            }

                            // RodofAtos
                            if (Main.RodofAtos != null &&
                                Config.AutoItemsToggler.Value.IsEnabled(Main.RodofAtos.Item.Name) &&
                                Main.RodofAtos.CanBeCasted &&
                                Main.RodofAtos.CanHit(Target) &&
                                (IsStun == null || IsStun.RemainingTime <= 0.5) &&
                                (IsDebuff == null || IsDebuff.RemainingTime <= 0.5))
                            {
                                Main.RodofAtos.UseAbility(Target);
                                await Await.Delay(Main.RodofAtos.GetCastDelay(Target), token);
                            }

                            // ConcussiveShot
                            if (Main.ConcussiveShot != null &&
                                Config.AutoAbilitiesToggler.Value.IsEnabled(Main.ConcussiveShot.Ability.Name) &&
                                (!Config.WTargetItem ||
                                 (Target == Config.UpdateMode.WShow ||
                                  (Config.UpdateMode.WShow != null && Target.Distance2D(Config.UpdateMode.WShow) <= 250))) &&
                                Main.ConcussiveShot.CanBeCasted &&
                                Context.Owner.Distance2D(Target.Position) <= Config.WRadiusItem + 25)
                            {
                                Main.ConcussiveShot.UseAbility();
                                await Await.Delay(Main.ConcussiveShot.GetCastDelay(), token);
                            }

                            // ArcaneBolt
                            if (Main.ArcaneBolt != null &&
                                Config.AutoAbilitiesToggler.Value.IsEnabled(Main.ArcaneBolt.Ability.Name) &&
                                Main.ArcaneBolt.CanBeCasted &&
                                Main.ArcaneBolt.CanHit(Target))
                            {
                                Main.ArcaneBolt.UseAbility(Target);
                                await Await.Delay(Main.ArcaneBolt.GetCastDelay(Target), token);
                            }

                            // Veil
                            if (Main.Veil != null &&
                                Config.AutoItemsToggler.Value.IsEnabled(Main.Veil.Item.Name) &&
                                Main.Veil.CanBeCasted &&
                                Main.Veil.CanHit(Target))
                            {
                                Main.Veil.UseAbility(Target.Position);
                                await Await.Delay(Main.Veil.GetCastDelay(Target), token);
                            }

                            // Ethereal
                            if (Main.Ethereal != null &&
                                Config.AutoItemsToggler.Value.IsEnabled(Main.Ethereal.Item.Name) &&
                                Main.Ethereal.CanBeCasted &&
                                Main.Ethereal.CanHit(Target))
                            {
                                Main.Ethereal.UseAbility(Target);
                                await Await.Delay(Main.Ethereal.GetCastDelay(Target), token);
                            }

                            // Dagon
                            if (Main.Dagon != null &&
                                Config.AutoItemsToggler.Value.IsEnabled("item_dagon_5") &&
                                Main.Dagon.CanBeCasted &&
                                Main.Dagon.CanHit(Target) &&
                                (Main.AncientSeal == null || (Target.HasModifier("modifier_skywrath_mage_ancient_seal") && !Main.AncientSeal.CanBeCasted) ||
                                 !Config.AutoAbilitiesToggler.Value.IsEnabled(Main.AncientSeal.Ability.Name)) &&
                                (Main.Ethereal == null || (Target.IsEthereal() && !Main.Ethereal.CanBeCasted) ||
                                 !Config.AutoItemsToggler.Value.IsEnabled(Main.Ethereal.Item.Name)))
                            {
                                Main.Dagon.UseAbility(Target);
                                await Await.Delay(Main.Dagon.GetCastDelay(Target), token);
                            }
                        }
                        else
                        {
                            await Config.LinkenBreaker.Breaker(token, Target);
                        }
                    }
                }
            }
            catch (TaskCanceledException)
            {
                // canceled
            }
            catch (Exception e)
            {
                Main.Log.Error(e);
            }
        }
Ejemplo n.º 15
0
        private void LogicR()
        {
            foreach (var t in HeroManager.Enemies.Where(t => t.IsValidTarget() && BallPos.Distance(Prediction.GetPrediction(t, R.Delay).CastPosition) < R.Width && BallPos.Distance(t.ServerPosition) < R.Width))
            {
                if (Program.Combo && Config.Item("Ralways" + t.ChampionName, true).GetValue <bool>())
                {
                    R.Cast();
                }

                if (Config.Item("Rks", true).GetValue <bool>())
                {
                    var comboDmg = OktwCommon.GetKsDamage(t, R);

                    if (t.IsValidTarget(Q.Range))
                    {
                        comboDmg += Q.GetDamage(t);
                    }
                    if (W.IsReady())
                    {
                        comboDmg += W.GetDamage(t);
                    }
                    if (Orbwalker.InAutoAttackRange(t))
                    {
                        comboDmg += (float)Player.GetAutoAttackDamage(t) * 2;
                    }
                    if (t.Health < comboDmg)
                    {
                        R.Cast();
                    }
                    Program.debug("ks");
                }
                if (Config.Item("Rturrent", true).GetValue <bool>() && BallPos.UnderTurret(false) && !BallPos.UnderTurret(true))
                {
                    R.Cast();
                    Program.debug("Rturrent");
                }
                if (Config.Item("Rlifesaver", true).GetValue <bool>() && Player.Health < Player.CountEnemiesInRange(800) * Player.Level * 20 && Player.Distance(BallPos) > t.Distance(Player.Position))
                {
                    R.Cast();
                    Program.debug("ls");
                }
            }

            int countEnemies = CountEnemiesInRangeDeley(BallPos, R.Width, R.Delay);

            if (countEnemies >= Config.Item("rCount", true).GetValue <Slider>().Value&& BallPos.CountEnemiesInRange(R.Width) == countEnemies)
            {
                R.Cast();
            }
        }
Ejemplo n.º 16
0
        private void Game_OnGameUpdate(EventArgs args)
        {
            if (Program.Combo && Config.Item("AACombo", true).GetValue <bool>())
            {
                if (!E.IsReady())
                {
                    Orbwalking.Attack = true;
                }

                else
                {
                    Orbwalking.Attack = false;
                }
            }
            else
            {
                Orbwalking.Attack = true;
            }

            if (Marked.IsValidTarget())
            {
                if (Program.Combo)
                {
                    if (OktwCommon.GetPassiveTime(Marked, "ThreshQ") < 0.3)
                    {
                        Q.Cast();
                    }

                    if (W.IsReady() && Config.Item("autoW2", true).GetValue <bool>())
                    {
                        var allyW = Player;
                        foreach (var ally in Program.Allies.Where(ally => ally.IsValid && !ally.IsDead && Player.Distance(ally.ServerPosition) < W.Range + 500))
                        {
                            if (Marked.Distance(ally.ServerPosition) > 800 && Player.Distance(ally.ServerPosition) > 600)
                            {
                                CastW(Prediction.GetPrediction(ally, 1f).CastPosition);
                            }
                        }
                    }
                }
            }
            else
            {
                if (Program.LagFree(1) && Q.IsReady())
                {
                    LogicQ();
                }

                if (Program.LagFree(2) && E.IsReady() && Config.Item("autoE", true).GetValue <bool>())
                {
                    LogicE();
                }
            }

            if (Program.LagFree(3) && W.IsReady())
            {
                LogicW();
            }
            if (Program.LagFree(4) && R.IsReady())
            {
                LogicR();
            }
        }
Ejemplo n.º 17
0
 private static void Game_OnUpdate(EventArgs args)
 {
     if (BadaoMainVariables.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
     {
         return;
     }
     if (Utils.GameTimeTickCount - BadaoMissFortuneVariables.Rcount <= 500)
     {
         return;
     }
     if (ObjectManager.Player.IsChannelingImportantSpell())
     {
         return;
     }
     if (!BadaoMissFortuneHelper.CanAutoMana())
     {
         return;
     }
     foreach (Obj_AI_Hero heroX in HeroManager.Enemies.Where(x => x.BadaoIsValidTarget() &&
                                                             x.Position.To2D().Distance(ObjectManager.Player.Position.To2D())
                                                             <= BadaoMainVariables.Q.Range + 500))
     {
         if (heroX.BadaoIsValidTarget() && BadaoMissFortuneHelper.UseQ2Auto(heroX))
         {
             if (Orbwalking.CanMove(80))
             {
                 List <Obj_AI_Base> a = new List <Obj_AI_Base>();
                 if (BadaoMissFortuneVariables.TapTarget.BadaoIsValidTarget() &&
                     heroX.NetworkId == BadaoMissFortuneVariables.TapTarget.NetworkId)
                 {
                     foreach (Obj_AI_Hero hero in HeroManager.Enemies.Where(x => x.NetworkId != heroX.NetworkId &&
                                                                            x.BadaoIsValidTarget(BadaoMainVariables.Q.Range)))
                     {
                         var Qpred    = BadaoMainVariables.Q.GetPrediction(hero);
                         var PredHero = Prediction.GetPrediction(hero, 0.25f + ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D() /
                                                                                                                             1400 + Game.Ping / 1000));
                         var PredheroX = Prediction.GetPrediction(heroX, 0.25f +
                                                                  ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D()) / 1400 + Game.Ping / 1000);
                         Vector2 endpos = Geometry.Extend(ObjectManager.Player.Position.To2D(), PredHero.UnitPosition.To2D(),
                                                          ObjectManager.Player.Position.To2D().Distance(PredHero.UnitPosition.To2D()) + 500);
                         if (BadaoChecker.BadaoInTheCone(PredheroX.UnitPosition.To2D(), PredHero.UnitPosition.To2D(), endpos, 40) &&
                             BadaoChecker.BadaoInTheCone(heroX.Position.To2D(), PredHero.UnitPosition.To2D(), endpos - 100, 40 - 5))
                         {
                             a.Add(hero);
                         }
                     }
                     foreach (Obj_AI_Minion minion in MinionManager.GetMinions(BadaoMainVariables.Q.Range))
                     {
                         var Qpred      = BadaoMainVariables.Q.GetPrediction(minion);
                         var PredMinion = Prediction.GetPrediction(minion, 0.25f + ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D() /
                                                                                                                                 1400 + Game.Ping / 1000));
                         var PredheroX = Prediction.GetPrediction(heroX, 0.25f +
                                                                  ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D()) / 1400 + Game.Ping / 1000);
                         Vector2 endpos = Geometry.Extend(ObjectManager.Player.Position.To2D(), PredMinion.UnitPosition.To2D(),
                                                          ObjectManager.Player.Position.To2D().Distance(PredMinion.UnitPosition.To2D()) + 500);
                         if (BadaoChecker.BadaoInTheCone(PredheroX.UnitPosition.To2D(), PredMinion.UnitPosition.To2D(), endpos, 40) &&
                             BadaoChecker.BadaoInTheCone(heroX.Position.To2D(), PredMinion.UnitPosition.To2D(), endpos - 100, 40 - 5))
                         {
                             a.Add(minion);
                         }
                     }
                     var targetQ = a.OrderBy(x => (float)(180f - BadaoChecker.BadaoAngleBetween(heroX.Position.To2D(), Prediction.GetPrediction(x, 0.25f + ObjectManager.Player.Position.To2D().Distance(BadaoMainVariables.Q.GetPrediction(x).UnitPosition.To2D() /
                                                                                                                                                                                                         1400 + Game.Ping / 1000)).UnitPosition.To2D(), ObjectManager.Player.Position.To2D())) / 40f + Math.Abs(x.Position.To2D().Distance(heroX.Position.To2D()) - 300) / 100f).FirstOrDefault();
                     if (targetQ.BadaoIsValidTarget())
                     {
                         BadaoMainVariables.Q.Cast(targetQ);
                     }
                 }
                 else if (!BadaoMissFortuneVariables.TapTarget.IsValidTarget() ||
                          heroX.NetworkId != BadaoMissFortuneVariables.TapTarget.NetworkId)
                 {
                     //40
                     foreach (Obj_AI_Hero hero in HeroManager.Enemies.Where(x => x.NetworkId != heroX.NetworkId &&
                                                                            x.BadaoIsValidTarget(BadaoMainVariables.Q.Range)))
                     {
                         var Qpred    = BadaoMainVariables.Q.GetPrediction(hero);
                         var PredHero = Prediction.GetPrediction(hero, 0.25f + ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D() /
                                                                                                                             1400 + Game.Ping / 1000));
                         var PredheroX = Prediction.GetPrediction(heroX, 0.25f +
                                                                  ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D()) / 1400 + Game.Ping / 1000);
                         Vector2 endpos = Geometry.Extend(ObjectManager.Player.Position.To2D(), PredHero.UnitPosition.To2D(),
                                                          ObjectManager.Player.Position.To2D().Distance(PredHero.UnitPosition.To2D()) + 500);
                         if (BadaoChecker.BadaoInTheCone(PredheroX.UnitPosition.To2D(), PredHero.UnitPosition.To2D(), endpos, 40) &&
                             BadaoChecker.BadaoInTheCone(heroX.Position.To2D(), PredHero.UnitPosition.To2D(), endpos - 100, 40 - 5) &&
                             !MinionManager.GetMinions(BadaoMainVariables.Q.Range + 600).Any(x =>
                                                                                             BadaoChecker.BadaoInTheCone(Prediction.GetPrediction(x, 0.25f +
                                                                                                                                                  ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D() /
                                                                                                                                                                                                1400 + Game.Ping / 1000)).UnitPosition.To2D(),
                                                                                                                         PredHero.UnitPosition.To2D(), endpos, 40 + 5)))
                         {
                             BadaoMainVariables.Q.Cast(hero);
                             goto abc;
                         }
                     }
                     foreach (Obj_AI_Minion minion in MinionManager.GetMinions(BadaoMainVariables.Q.Range))
                     {
                         var Qpred      = BadaoMainVariables.Q.GetPrediction(minion);
                         var PredMinion = Prediction.GetPrediction(minion, 0.25f + ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D() /
                                                                                                                                 1400 + Game.Ping / 1000));
                         var PredheroX = Prediction.GetPrediction(heroX, 0.25f +
                                                                  ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D()) / 1400 + Game.Ping / 1000);
                         Vector2 endpos = Geometry.Extend(ObjectManager.Player.Position.To2D(), PredMinion.UnitPosition.To2D(),
                                                          ObjectManager.Player.Position.To2D().Distance(PredMinion.UnitPosition.To2D()) + 500);
                         if (BadaoChecker.BadaoInTheCone(PredheroX.UnitPosition.To2D(), PredMinion.UnitPosition.To2D(), endpos, 40) &&
                             BadaoChecker.BadaoInTheCone(heroX.Position.To2D(), PredMinion.UnitPosition.To2D(), endpos - 100, 40 - 5) &&
                             !MinionManager.GetMinions(BadaoMainVariables.Q.Range + 500).Any(x =>
                                                                                             x.NetworkId != minion.NetworkId &&
                                                                                             BadaoChecker.BadaoInTheCone(Prediction.GetPrediction(x, 0.25f +
                                                                                                                                                  ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D() /
                                                                                                                                                                                                1400 + Game.Ping / 1000)).UnitPosition.To2D(),
                                                                                                                         PredMinion.UnitPosition.To2D(), endpos, 40 + 5)))
                         {
                             BadaoMainVariables.Q.Cast(minion);
                             goto abc;
                         }
                     }
                     //20
                     foreach (Obj_AI_Hero hero in HeroManager.Enemies.Where(x => x.NetworkId != heroX.NetworkId &&
                                                                            x.BadaoIsValidTarget(BadaoMainVariables.Q.Range)))
                     {
                         var Qpred    = BadaoMainVariables.Q.GetPrediction(hero);
                         var PredHero = Prediction.GetPrediction(hero, 0.25f + ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D() /
                                                                                                                             1400 + Game.Ping / 1000));
                         var PredheroX = Prediction.GetPrediction(heroX, 0.25f +
                                                                  ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D()) / 1400 + Game.Ping / 1000);
                         Vector2 endpos = Geometry.Extend(ObjectManager.Player.Position.To2D(), PredHero.UnitPosition.To2D(),
                                                          ObjectManager.Player.Position.To2D().Distance(PredHero.UnitPosition.To2D()) + 500);
                         if (BadaoChecker.BadaoInTheCone(PredheroX.UnitPosition.To2D(), PredHero.UnitPosition.To2D(), endpos, 20) &&
                             BadaoChecker.BadaoInTheCone(heroX.Position.To2D(), PredHero.UnitPosition.To2D(), endpos - 100, 20 - 3) &&
                             !MinionManager.GetMinions(BadaoMainVariables.Q.Range + 600).Any(x =>
                                                                                             BadaoChecker.BadaoInTheCone(Prediction.GetPrediction(x, 0.25f +
                                                                                                                                                  ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D() /
                                                                                                                                                                                                1400 + Game.Ping / 1000)).UnitPosition.To2D(),
                                                                                                                         PredHero.UnitPosition.To2D(), endpos, 20 + 3)))
                         {
                             BadaoMainVariables.Q.Cast(hero);
                             goto abc;
                         }
                     }
                     foreach (Obj_AI_Minion minion in MinionManager.GetMinions(BadaoMainVariables.Q.Range))
                     {
                         var Qpred      = BadaoMainVariables.Q.GetPrediction(minion);
                         var PredMinion = Prediction.GetPrediction(minion, 0.25f + ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D() /
                                                                                                                                 1400 + Game.Ping / 1000));
                         var PredheroX = Prediction.GetPrediction(heroX, 0.25f +
                                                                  ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D()) / 1400 + Game.Ping / 1000);
                         Vector2 endpos = Geometry.Extend(ObjectManager.Player.Position.To2D(), PredMinion.UnitPosition.To2D(),
                                                          ObjectManager.Player.Position.To2D().Distance(PredMinion.UnitPosition.To2D()) + 500);
                         if (BadaoChecker.BadaoInTheCone(PredheroX.UnitPosition.To2D(), PredMinion.UnitPosition.To2D(), endpos, 20) &&
                             BadaoChecker.BadaoInTheCone(heroX.Position.To2D(), PredMinion.UnitPosition.To2D(), endpos - 100, 20 - 3) &&
                             !MinionManager.GetMinions(BadaoMainVariables.Q.Range + 500).Any(x =>
                                                                                             x.NetworkId != minion.NetworkId &&
                                                                                             BadaoChecker.BadaoInTheCone(Prediction.GetPrediction(x, 0.25f +
                                                                                                                                                  ObjectManager.Player.Position.To2D().Distance(Qpred.UnitPosition.To2D() /
                                                                                                                                                                                                1400 + Game.Ping / 1000)).UnitPosition.To2D(),
                                                                                                                         PredMinion.UnitPosition.To2D(), endpos, 20 + 3)))
                         {
                             BadaoMainVariables.Q.Cast(minion);
                         }
                     }
                     abc :;
                 }
             }
         }
     }
 }
Ejemplo n.º 18
0
        private void Game_OnUpdate(EventArgs args)
        {
            float time = System.Environment.TickCount;

            foreach (Positions enemyInfo in Enemies.Where(x => x.Player.IsVisible && !x.Player.IsDead && !player.IsDead)
                     )
            {
                enemyInfo.LastSeen = time;
                var prediction = Prediction.GetPrediction(enemyInfo.Player, 4);
                if (prediction != null)
                {
                    enemyInfo.predictedpos = prediction.UnitPosition;
                }
            }
            if (!configMenu.Item("UseR").GetValue <bool>() || !R.IsReady() || !enabled)
            {
                return;
            }
            foreach (Positions enemy in
                     Enemies.Where(
                         x =>
                         x.Player.IsValid <Obj_AI_Hero>() && !x.Player.IsDead &&
                         !configMenu.Item(x.Player.ChampionName + "DontUltRandomUlt").GetValue <bool>() &&
                         x.RecallData.Recall.Status == Packet.S2C.Teleport.Status.Start &&
                         x.RecallData.Recall.Type == Packet.S2C.Teleport.Type.Recall)
                     .OrderBy(x => x.RecallData.GetRecallTime()))
            {
                if (!checkdmg(enemy.Player))
                {
                    continue;
                }
                var dist = (Math.Abs(enemy.LastSeen - enemy.RecallData.RecallStartTime) / 1000 * enemy.Player.MoveSpeed) -
                           enemy.Player.MoveSpeed / 3;
                var     line = getpos(enemy, dist);
                Vector3 pos  = line;
                if (enemy.Player.IsVisible)
                {
                    pos = enemy.Player.Position;
                }
                else
                {
                    var trueDist = Math.Abs(enemy.LastSeen - enemy.RecallData.RecallStartTime) / 1000 *
                                   enemy.Player.MoveSpeed;

                    if (dist > 1500)
                    {
                        return;
                    }
                    pos =
                        CombatHelper.PointsAroundTheTarget(enemy.Player.Position, trueDist)
                        .Where(
                            p =>
                            !p.IsWall() && line.Distance(p) < dist &&
                            Environment.Map.GetPath(enemy.Player, p) < trueDist)
                        .OrderByDescending(p => NavMesh.IsWallOfGrass(p, 10))
                        .ThenBy(p => line.Distance(p))
                        .FirstOrDefault();
                }
                if (pos != null)
                {
                    kill(enemy, new Vector3(pos.X, pos.Y, 0));
                }
            }
        }
Ejemplo n.º 19
0
        private void Combo(float combodmg)
        {
            Obj_AI_Hero target = TargetSelector.GetTarget(1100, TargetSelector.DamageType.Magical, true);

            if (target == null || target.IsInvulnerable || target.MagicImmune)
            {
                return;
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, ComboDamage(target));
            }
            var  ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (config.Item("useIgnite", true).GetValue <bool>() &&
                ignitedmg > HealthPrediction.GetHealthPrediction(target, 700) && hasIgnite &&
                !CombatHelper.CheckCriticalBuffs(target) &&
                ((savedQ == null ||
                  (savedQ != null && target.Distance(savedQ.position) < QExplosionRange &&
                   getQdamage(target) > target.Health)) || useIgnite))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            var rqCombo = R.GetDamage(target) + getQdamage(target) + (hasIgnite ? ignitedmg : 0);

            if (Q.CanCast(target) && config.Item("useq", true).GetValue <bool>() && savedQ == null && SimpleQ)
            {
                if (Q.CastIfHitchanceEquals(target, HitChance.VeryHigh, config.Item("packets").GetValue <bool>()))
                {
                    return;
                }
            }
            if (Q.IsReady() && config.Item("useq", true).GetValue <bool>() && savedQ != null &&
                target.Distance(savedQ.position) < QExplosionRange)
            {
                DetonateQ();
            }
            if (config.Item("usee", true).GetValue <bool>())
            {
                if (E.CanCast(target))
                {
                    CastE(target, combodmg);
                }
            }
            if (W.IsReady() && (!SimpleQ || !Q.IsReady()) && config.Item("usew", true).GetValue <bool>() &&
                player.Distance(target) < 300 && Orbwalking.CanMove(100) &&
                target.Health > combodmg - getWdamage(target))
            {
                W.Cast(config.Item("packets").GetValue <bool>());
            }
            if (R.IsReady())
            {
                if (R.CastIfWillHit(
                        target, config.Item("Rmin", true).GetValue <Slider>().Value, config.Item("packets").GetValue <bool>()))
                {
                    return;
                }
                var logic = config.Item("user", true).GetValue <bool>();
                if (config.Item("rtoq", true).GetValue <bool>() && savedQ != null && !SimpleQ &&
                    (target.Distance(qPos) > QExplosionRange ||
                     (target.Health < rqCombo && target.Health > getQdamage(target))) &&
                    target.Distance(player) < R.Range - 100 &&
                    (target.Health < rqCombo || CheckRPushForAlly(target, rqCombo)) &&
                    target.Position.Distance(savedQ.position) < 550 + QExplosionRange / 2)
                {
                    var cast = Prediction.GetPrediction(target, 1000f).UnitPosition.Extend(savedQ.position, -200);
                    if (cast.Distance(player.Position) < R.Range)
                    {
                        //Console.WriteLine("R to Q");
                        if (target.Health < rqCombo && target.Health > rqCombo - ignitedmg &&
                            player.Distance(target) < 580)
                        {
                            useIgnite = true;
                        }

                        Utility.DelayAction.Add(400, () => useIgnite = false);
                        HandeR(target, savedQ.position, true);
                        return;
                    }
                }
                if (config.Item("rtoally", true).GetValue <bool>() && logic &&
                    target.Health - rqCombo < target.MaxHealth * 0.5f)
                {
                    var allies =
                        HeroManager.Allies.Where(
                            a =>
                            !a.IsDead && !a.IsMe && a.HealthPercent > 40 && a.Distance(target) < 700 &&
                            a.Distance(target) > 300).OrderByDescending(a => TargetSelector.GetPriority(a));
                    if (allies.Any())
                    {
                        foreach (var ally in allies)
                        {
                            var cast =
                                Prediction.GetPrediction(target, 1000f)
                                .UnitPosition.Extend(Prediction.GetPrediction(ally, 400f).UnitPosition, -200);
                            if (cast.CountEnemiesInRange(1000) <= cast.CountAlliesInRange(1000) &&
                                cast.Distance(player.Position) < R.Range &&
                                cast.Extend(target.Position, 500).Distance(ally.Position) <
                                target.Distance(ally.Position))
                            {
                                //Console.WriteLine("R to Ally: " + ally.Name);
                                HandeR(target, Prediction.GetPrediction(ally, 400f).UnitPosition, false);
                                return;
                            }
                        }
                    }
                    var turret =
                        ObjectManager.Get <Obj_AI_Turret>()
                        .OrderBy(t => t.Distance(target))
                        .FirstOrDefault(t => t.Distance(target) < 2000 && t.IsAlly && !t.IsDead);

                    if (config.Item("rtoturret", true).GetValue <bool>() && turret != null)
                    {
                        var pos = target.Position.Extend(turret.Position, -200);
                        if (target.Distance(turret) > pos.Extend(target.Position, 500).Distance(turret.Position))
                        {
                            //nothing
                        }
                        else if ((pos.CountEnemiesInRange(1000) < pos.CountAlliesInRange(1000) &&
                                  target.Health - rqCombo < target.MaxHealth * 0.4f) ||
                                 (ObjectManager.Get <Obj_AI_Turret>()
                                  .Count(t => t.Distance(pos) < 950 && t.IsAlly && t.IsValid && !t.IsDead) > 0 &&
                                  target.Health - combodmg < target.MaxHealth * 0.5f))
                        {
                            //Console.WriteLine("R to Turret");
                            HandeR(target, turret.Position, false);
                            return;
                        }
                    }
                }
                if (config.Item("rtokill", true).GetValue <bool>() && config.Item("user", true).GetValue <bool>() &&
                    R.GetDamage(target) > target.Health && !justE && !justQ &&
                    (savedQ == null ||
                     (savedQ != null && !qPos.IsValid() && target.Distance(savedQ.position) > QExplosionRange)) &&
                    (target.CountAlliesInRange(700) <= 1 || player.HealthPercent < 35))
                {
                    //Console.WriteLine("R to Kill");
                    var pred = R.GetPrediction(target, true);
                    if (pred.Hitchance >= HitChance.VeryHigh)
                    {
                        R.Cast(pred.CastPosition);
                    }
                    //R.CastIfHitchanceEquals(target, HitChance.VeryHigh, config.Item("packets").GetValue<bool>());
                    return;
                }
            }
        }
Ejemplo n.º 20
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            if (false)
            {
                return;
            }
            AIHeroClient targetf = DrawHelper.GetBetterTarget(1000, TargetSelector.DamageType.Magical);

            if (config.Item("useeflashforced", true).GetValue <KeyBind>().Active)
            {
                if (targetf == null)
                {
                    EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);
                }
                else
                {
                    var  bestpos  = CombatHelper.bestVectorToPoppyFlash2(targetf);
                    bool hasFlash = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerFlash")) ==
                                    SpellState.Ready;
                    if (E.IsReady() && hasFlash && !CheckWalls(player, targetf) && bestpos.IsValid())
                    {
                        player.Spellbook.CastSpell(player.GetSpellSlot("SummonerFlash"), bestpos);
                        EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);
                    }
                    else if (!hasFlash)
                    {
                        Combo();
                        Orbwalking.Orbwalk(targetf, Game.CursorPos, 90, 90);
                    }
                }
            }
            switch (orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                Combo();
                KsPassive();
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                Harass();
                KsPassive();
                break;

            case Orbwalking.OrbwalkingMode.LaneClear:
                Clear();
                KsPassive();
                break;

            case Orbwalking.OrbwalkingMode.LastHit:
                KsPassive();
                break;

            default:
                break;
            }
            if (!player.IsDead)
            {
                foreach (var dashingEnemy in
                         HeroManager.Enemies.Where(
                             e =>
                             e.IsValidTarget() && e.Distance(player) < 1600 &&
                             config.Item("useAutoW" + e.BaseSkinName, true).GetValue <Slider>().Value > 0)
                         .OrderByDescending(e => config.Item("useAutoW" + e.BaseSkinName, true).GetValue <Slider>().Value)
                         .ThenBy(e => e.Distance(player)))
                {
                    var nextpos = Prediction.GetPrediction(dashingEnemy, 0.1f).UnitPosition;
                    if (dashingEnemy.IsDashing() && !dashingEnemy.HasBuffOfType(BuffType.SpellShield) &&
                        !dashingEnemy.HasBuff("poppyepushenemy") && dashingEnemy.Distance(player) <= W.Range &&
                        (nextpos.Distance(player.Position) > W.Range || (player.Distance(dashingEnemy) < W.Range - 100)) &&
                        dashingEnemy.IsTargetable && !NotDash.Contains(dashingEnemy.ChampionName))
                    {
                        W.Cast();
                    }
                    if (
                        CombatHelper.DashDatas.Any(
                            d => d.ChampionName == dashingEnemy.ChampionName && d.IsReady(dashingEnemy)))
                    {
                        break;
                    }
                }
            }
        }
Ejemplo n.º 21
0
        private void moveGhost()
        {
            var ghost   = ObjectManager.Get <Obj_AI_Minion>().FirstOrDefault(m => m.HasBuff("yorickunholysymbiosis"));
            var Gtarget = TargetSelector.GetTarget(GhostRange, TargetSelector.DamageType.Magical);

            switch (config.Item("ghostTarget", true).GetValue <StringList>().SelectedIndex)
            {
            case 0:
                Gtarget = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Magical);
                break;

            case 1:
                Gtarget =
                    ObjectManager.Get <Obj_AI_Hero>()
                    .Where(i => i.IsEnemy && !i.IsDead && player.Distance(i) <= R.Range)
                    .OrderBy(i => i.Health)
                    .FirstOrDefault();
                break;

            case 2:
                Gtarget =
                    ObjectManager.Get <Obj_AI_Hero>()
                    .Where(i => i.IsEnemy && !i.IsDead && player.Distance(i) <= R.Range)
                    .OrderBy(i => player.Distance(i))
                    .FirstOrDefault();
                break;

            default:
                break;
            }
            if (ghost != null && Gtarget != null && Gtarget.IsValid && !ghost.IsWindingUp)
            {
                if (ghost.IsMelee)
                {
                    if (CanCloneAttack(ghost) || player.HealthPercent < 25)
                    {
                        R.CastOnUnit(Gtarget, config.Item("packets").GetValue <bool>());
                    }
                    else
                    {
                        var prediction = Prediction.GetPrediction(Gtarget, 2);
                        R.Cast(
                            Gtarget.Position.Extend(prediction.UnitPosition, Orbwalking.GetRealAutoAttackRange(Gtarget)),
                            config.Item("packets").GetValue <bool>());
                    }
                }
                else
                {
                    if (CanCloneAttack(ghost) || player.HealthPercent < 25)
                    {
                        R.CastOnUnit(Gtarget, config.Item("packets").GetValue <bool>());
                    }
                    else
                    {
                        var pred  = Prediction.GetPrediction(Gtarget, 0.5f);
                        var point =
                            CombatHelper.PointsAroundTheTargetOuterRing(pred.UnitPosition, Gtarget.AttackRange / 2, 15)
                            .Where(p => !p.IsWall())
                            .OrderBy(p => p.CountEnemiesInRange(500))
                            .ThenBy(p => p.Distance(player.Position))
                            .FirstOrDefault();

                        if (point.IsValid())
                        {
                            R.Cast(point, config.Item("packets").GetValue <bool>());
                        }
                    }
                }
                GhostDelay = true;
                Utility.DelayAction.Add(200, () => GhostDelay = false);
            }
        }
Ejemplo n.º 22
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (BadaoMainVariables.Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.Combo)
            {
                return;
            }
            if (BadaoPoppyHelper.UseRComboKillable())
            {
                if (!BadaoMainVariables.R.IsCharging)
                {
                    var killableTarget = HeroManager.Enemies.FirstOrDefault(x => x.BadaoIsValidTarget(500) &&
                                                                            BadaoMainVariables.R.GetDamage(x) >= x.Health);
                    if (killableTarget != null)
                    {
                        BadaoMainVariables.R.StartCharging();
                    }
                }
                else
                {
                    var killableTarget = HeroManager.Enemies.FirstOrDefault(x => x.BadaoIsValidTarget(500) &&
                                                                            BadaoMainVariables.R.GetDamage(x) >= x.Health);
                    if (killableTarget != null)
                    {
                        BadaoMainVariables.R.Cast(killableTarget.Position);
                    }
                }
            }
            if (BadaoMainVariables.E.IsReady() && Environment.TickCount - BadaoPoppyVariables.QCastTick >= 1250)
            {
                foreach (var hero in HeroManager.Enemies
                         .Where(
                             x => x.BadaoIsValidTarget(BadaoMainVariables.E.Range) &&
                             BadaoPoppyHelper.UseECombo(x)))
                {
                    var predPos = hero.Position.To2D(); //BadaoMainVariables.E.GetPrediction(hero).UnitPosition.To2D();
                    if (BadaoMath.GetFirstWallPoint(predPos, predPos.Extend(ObjectManager.Player.Position.To2D(), -300 - hero.BoundingRadius)) != null)
                    {
                        BadaoMainVariables.E.Cast(hero);
                        goto nextStep;
                    }
                }
            }
            if (BadaoPoppyHelper.UseEComboGap() && Environment.TickCount - BadaoPoppyVariables.QCastTick >= 1250)
            {
                var target = TargetSelector.GetTarget(BadaoMainVariables.E.Range, TargetSelector.DamageType.Physical);
                if (target.BadaoIsValidTarget() && !Orbwalking.InAutoAttackRange(target) &&
                    Prediction.GetPrediction(target, 0.5f).UnitPosition.Distance(ObjectManager.Player.Position)
                    > target.Distance(ObjectManager.Player.Position) + 20)
                {
                    BadaoMainVariables.E.Cast(target);
                }
            }

nextStep:
            if (BadaoPoppyHelper.UseQCombo())
            {
                var target = TargetSelector.GetTarget(BadaoMainVariables.Q.Range, TargetSelector.DamageType.Physical);
                if (target.BadaoIsValidTarget())
                {
                    if (BadaoMainVariables.Q.Cast(target) == Spell.CastStates.SuccessfullyCasted)
                    {
                        BadaoPoppyVariables.QCastTick = Environment.TickCount;
                    }
                }
            }
            if (BadaoPoppyHelper.UseWCombo())
            {
                var target = HeroManager.Enemies.OrderBy(i => i.Distance(ObjectManager.Player.Position))
                             .FirstOrDefault(x => x.BadaoIsValidTarget(600));
                if (target != null)
                {
                    BadaoMainVariables.W.Cast();
                }
            }
        }
Ejemplo n.º 23
0
 private void LogicW()
 {
     foreach (var ally in Program.Allies.Where(ally => ally.IsValid && !ally.IsDead && Player.Distance(Prediction.GetPrediction(ally, 1f).CastPosition) < W.Range + 300))
     {
         if (ally.CountEnemiesInRange(700) >= Config.Item("wCount").GetValue <Slider>().Value&& Config.Item("wCount").GetValue <Slider>().Value > 0)
         {
             W.Cast(Prediction.GetPrediction(ally, 1f).CastPosition);
         }
     }
 }
Ejemplo n.º 24
0
        private void Combo()
        {
            Obj_AI_Hero target = TargetSelector.GetTarget(1500, TargetSelector.DamageType.Physical, true);

            if (config.Item("user", true).GetValue <bool>() && R.IsReady())
            {
                var rTarget = TargetSelector.GetTarget(2500, TargetSelector.DamageType.Physical, true);
                if (!activatedR && !player.IsWindingUp)
                {
                    if (rTarget != null && !rTarget.IsInvulnerable && !rTarget.MagicImmune &&
                        rTarget.Distance(Game.CursorPos) < 300)
                    {
                        if (player.Distance(rTarget) + 100 > Environment.Map.GetPath(player, rTarget.Position) &&
                            (ComboDamage(rTarget) > rTarget.Health &&
                             !CombatHelper.IsCollidingWith(
                                 player, rTarget.Position.Extend(player.Position, player.BoundingRadius + 15),
                                 player.BoundingRadius,
                                 new[] { CollisionableObjects.Heroes, CollisionableObjects.Walls }) &&
                             (ComboDamage(rTarget) - R.GetDamage(rTarget) < rTarget.Health ||
                              rTarget.Distance(player) > 400 || player.HealthPercent < 25) &&
                             rTarget.CountAlliesInRange(2500) + 1 >= rTarget.CountEnemiesInRange(2500)))
                        {
                            R.Cast(target.Position);
                        }
                    }
                }
            }
            if (target == null || target.IsInvulnerable || target.MagicImmune)
            {
                return;
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, ComboDamage(target));
            }
            var data = Program.IncDamages.GetAllyData(player.NetworkId);

            if (!activatedW && W.IsReady() && config.Item("usew", true).GetValue <bool>())
            {
                if (data.DamageTaken > player.Health ||
                    (data.DamageTaken > getWShield() / 100 * config.Item("shieldDmg", true).GetValue <Slider>().Value) ||
                    (target.Distance(player) < W.Range && config.Item("usewir", true).GetValue <bool>()))
                {
                    W.Cast(config.Item("packets").GetValue <bool>());
                }
            }
            if (activatedW && config.Item("usew", true).GetValue <bool>() && W.IsReady() &&
                player.Distance(target) < W.Range &&
                (target.Health < W.GetDamage(target) ||
                 (W.IsInRange(target) && !W.IsInRange(Prediction.GetPrediction(target, 0.2f).UnitPosition))))
            {
                W.Cast(config.Item("packets").GetValue <bool>());
            }
            var  comboDmg  = ComboDamage(target);
            var  ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (config.Item("useIgnite", true).GetValue <bool>() &&
                ignitedmg > HealthPrediction.GetHealthPrediction(target, 700) && hasIgnite &&
                !CombatHelper.CheckCriticalBuffs(target))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (activatedP)
            {
                if (Q.IsReady() && player.Distance(target) > Orbwalking.GetRealAutoAttackRange(target))
                {
                    Q.Cast(config.Item("packets").GetValue <bool>());
                }
                return;
            }
            if (Q.IsCharging)
            {
                checkCastedQ(target);
                return;
            }
            if (activatedR)
            {
                return;
            }
            if (config.Item("usee", true).GetValue <bool>() && E.IsReady() && !player.IsWindingUp)
            {
                CastEHero(target);
                return;
            }
            if (config.Item("useq", true).GetValue <bool>() && !player.IsWindingUp)
            {
                castQ(target);
            }
            if (!activatedW && W.IsReady() && data.AnyCC)
            {
                W.Cast(config.Item("packets").GetValue <bool>());
            }

            if (config.Item("userCC", true).GetValue <bool>() && player.Distance(target) < Q.Range &&
                HeroManager.Enemies.FirstOrDefault(e => e.Distance(Game.CursorPos) < 300) != null && data.AnyCC)
            {
                R.Cast(Game.CursorPos, config.Item("packets").GetValue <bool>());
            }
        }
Ejemplo n.º 25
0
        private void Game_OnGameUpdate(EventArgs args)
        {
            orbwalker.SetAttack(true);
            orbwalker.SetMovement(true);
            Jungle.CastSmite(config.Item("useSmite").GetValue <KeyBind>().Active);
            switch (orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                Combo();
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                Harass();
                break;

            case Orbwalking.OrbwalkingMode.LaneClear:
                Clear();
                break;

            case Orbwalking.OrbwalkingMode.LastHit:
                Lasthit();
                break;

            default:
                break;
            }
            if (config.Item("AutoR", true).GetValue <bool>() && R.IsReady())
            {
                foreach (var enemy in
                         HeroManager.Enemies.Where(
                             e =>
                             ((e.UnderTurret(true) &&
                               e.HealthPercent < config.Item("Rhealt", true).GetValue <Slider>().Value * 0.75f) ||
                              (!e.UnderTurret(true) &&
                               e.HealthPercent < config.Item("Rhealt", true).GetValue <Slider>().Value)) &&
                             e.HealthPercent > config.Item("RhealtMin", true).GetValue <Slider>().Value&&
                             e.IsValidTarget() && e.Distance(player) > 1500))
                {
                    var pred = Program.IncDamages.GetEnemyData(enemy.NetworkId);
                    if (pred != null && pred.DamageTaken > 50 && pred.DamageTaken < enemy.Health &&
                        enemy.Health - pred.DamageTaken <
                        config.Item("Rhealt", true).GetValue <Slider>().Value / 100f * enemy.MaxHealth)
                    {
                        var ally = HeroManager.Allies.OrderBy(a => a.Health)
                                   .FirstOrDefault(a => enemy.Distance(a) < 700);
                        if (ally != null)
                        {
                            var pos = Prediction.GetPrediction(enemy, 0.75f);
                            if (pos.CastPosition.Distance(enemy.Position) < 450 && pos.Hitchance >= HitChance.VeryHigh)
                            {
                                if (enemy.IsMoving)
                                {
                                    R.Cast(enemy.Position.Extend(pos.CastPosition, 450));
                                }
                                else
                                {
                                    R.Cast(enemy.ServerPosition);
                                }
                            }
                        }
                    }
                }
            }
            if (config.Item("EQtoCursor", true).GetValue <KeyBind>().Active&& E.IsReady() && Q.IsReady())
            {
                orbwalker.SetMovement(false);
                if (player.IsMoving)
                {
                    player.IssueOrder(GameObjectOrder.Stop, player.Position);
                }
                var barrel =
                    GetBarrels()
                    .Where(
                        o =>
                        o.IsValid && !o.IsDead && o.Distance(player) < Q.Range &&
                        o.SkinName == "GangplankBarrel" && o.GetBuff("gangplankebarrellife").Caster.IsMe&&
                        KillableBarrel(o))
                    .OrderBy(o => o.Distance(Game.CursorPos))
                    .FirstOrDefault();
                if (barrel != null)
                {
                    var cp        = Game.CursorPos;
                    var cursorPos = barrel.Distance(cp) > BarrelConnectionRange
                        ? barrel.Position.Extend(cp, BarrelConnectionRange)
                        : cp;

                    var points =
                        CombatHelper.PointsAroundTheTarget(player.Position, E.Range - 200, 15, 6)
                        .Where(p => p.Distance(player.Position) < E.Range);
                    var cursorPos2 = cursorPos.Distance(cp) > BarrelConnectionRange
                        ? cursorPos.Extend(cp, BarrelConnectionRange)
                        : cp;

                    var middle      = GetMiddleBarrel(barrel, points, cursorPos);
                    var threeBarrel = cursorPos.Distance(cp) > BarrelExplosionRange && E.Instance.Ammo >= 2 &&
                                      Game.CursorPos.Distance(player.Position) < E.Range && middle.IsValid();
                    var firsDelay = threeBarrel ? 500 : 1;
                    if (cursorPos.IsValid() && cursorPos.Distance(player.Position) < E.Range)
                    {
                        E.Cast(threeBarrel ? middle : cursorPos);
                        Utility.DelayAction.Add(firsDelay, () => Q.CastOnUnit(barrel));
                        if (threeBarrel)
                        {
                            Utility.DelayAction.Add(801, () => E.Cast(middle.Extend(cp, BarrelConnectionRange)));
                        }
                    }
                }
            }
            if (config.Item("QbarrelCursor", true).GetValue <KeyBind>().Active&& Q.IsReady())
            {
                var meleeRangeBarrel =
                    GetBarrels()
                    .OrderBy(o => o.Distance(Game.CursorPos))
                    .FirstOrDefault(
                        o =>
                        o.Health > 1 && o.Distance(player) < Orbwalking.GetRealAutoAttackRange(o) &&
                        !KillableBarrel(o, true));
                if (meleeRangeBarrel != null && Orbwalking.CanAttack())
                {
                    orbwalker.SetAttack(false);
                    player.IssueOrder(GameObjectOrder.AttackUnit, meleeRangeBarrel);
                    return;
                }
                var barrel =
                    GetBarrels()
                    .Where(
                        o =>
                        o.IsValid && !o.IsDead && o.Distance(player) < Q.Range &&
                        o.SkinName == "GangplankBarrel" && o.GetBuff("gangplankebarrellife").Caster.IsMe&&
                        KillableBarrel(o))
                    .OrderBy(o => o.Distance(Game.CursorPos))
                    .FirstOrDefault();
                if (barrel != null)
                {
                    Q.CastOnUnit(barrel);
                }
            }

            if (config.Item("AutoQBarrel", true).GetValue <bool>() && Q.IsReady())
            {
                var barrel =
                    GetBarrels()
                    .FirstOrDefault(
                        o =>
                        o.IsValid && !o.IsDead && o.Distance(player) < Q.Range &&
                        o.SkinName == "GangplankBarrel" && o.GetBuff("gangplankebarrellife").Caster.IsMe&&
                        KillableBarrel(o) &&
                        (o.CountEnemiesInRange(BarrelExplosionRange - 50) > 0 ||
                         HeroManager.Enemies.Count(
                             e =>
                             e.IsValidTarget() &&
                             Prediction.GetPrediction(e, 0.1f).UnitPosition.Distance(o.Position) <
                             BarrelExplosionRange - 20) > 0));

                if (barrel != null)
                {
                    Q.Cast(barrel);
                }
            }
        }
Ejemplo n.º 26
0
        public static void CastLine(this Spell spell, Obj_AI_Base target, float alpha = 0f, float colmini = float.MaxValue, bool HeroOnly = false, float BombRadius = 0f)
        {
            if (spell.Type != SkillshotType.SkillshotLine)
            {
                return;
            }

            if (target == null)
            {
                return;
            }

            var pred      = Prediction.GetPrediction(target, spell.Delay, spell.Width / 2, spell.Speed);
            var collision = spell.GetCollision(ObjectManager.Player.ServerPosition.To2D(), new List <Vector2> {
                pred.CastPosition.To2D()
            });
            var minioncol  = collision.Count(x => (HeroOnly == false ? x.IsMinion : (x is AIHeroClient)));
            var EditedVec  = pred.UnitPosition.To2D() - Vector2.Normalize(pred.UnitPosition.To2D() - target.ServerPosition.To2D()) * (spell.Width * 2 / 5);
            var EditedVec2 = (pred.UnitPosition.To2D() + target.ServerPosition.To2D()) / 2;
            var collision2 = spell.GetCollision(ObjectManager.Player.ServerPosition.To2D(), new List <Vector2> {
                EditedVec
            });
            var minioncol2 = collision2.Count(x => (HeroOnly == false ? x.IsMinion : (x is AIHeroClient)));
            var collision3 = spell.GetCollision(ObjectManager.Player.ServerPosition.To2D(), new List <Vector2> {
                EditedVec2
            });
            var minioncol3 = collision3.Count(x => (HeroOnly == false ? x.IsMinion : (x is AIHeroClient)));

            if (pred.Hitchance >= HitChance.VeryHigh)
            {
                if (
                    !target.IsValidTarget(spell.Range -
                                          target.MoveSpeed *
                                          (spell.Delay +
                                           ObjectManager.Player.Distance(target.ServerPosition) / spell.Speed) + alpha) ||
                    !(minioncol2 <= colmini) || !(pred.UnitPosition.Distance(target.ServerPosition) > spell.Width))
                {
                    if (
                        target.IsValidTarget(spell.Range -
                                             target.MoveSpeed *
                                             (spell.Delay +
                                              ObjectManager.Player.Distance(target.ServerPosition) / spell.Speed) + alpha) &&
                        minioncol3 <= colmini && pred.UnitPosition.Distance(target.ServerPosition) > spell.Width / 2)
                    {
                        spell.Cast(EditedVec2);
                    }
                    else if (
                        target.IsValidTarget(spell.Range -
                                             target.MoveSpeed *
                                             (spell.Delay +
                                              ObjectManager.Player.Distance(target.ServerPosition) / spell.Speed) + alpha) &&
                        minioncol <= colmini)
                    {
                        spell.Cast(pred.CastPosition);
                    }
                    else if (false == spell.Collision && colmini < 1 && minioncol >= 1)
                    {
                        var FirstMinion =
                            collision.OrderBy(o => o.Distance(ObjectManager.Player.ServerPosition)).FirstOrDefault();

                        if (FirstMinion != null &&
                            FirstMinion.ServerPosition.Distance(pred.UnitPosition) <= BombRadius / 4)
                        {
                            spell.Cast(pred.CastPosition);
                        }
                    }
                }
                else
                {
                    spell.Cast(EditedVec);
                }
            }
        }
Ejemplo n.º 27
0
        private static void Game_OnUpdate(EventArgs args)
        {
            var soldierandtargetminion = new List <SoldierAndTargetMinion>();
            var minions = GameObjects.EnemyMinions.Where(x => x.IsValidTarget()).ToList();

            minions.AddRange(GameObjects.Jungle.Where(x => x.IsValidTarget()));
            var minionspredictedposition = new List <MinionPredictedPosition>();

            foreach (var x in minions)
            {
                minionspredictedposition
                .Add(new MinionPredictedPosition
                         (x, Prediction.GetPrediction(x, Player.AttackCastDelay + Game.Ping / 1000).UnitPosition));
            }
            var championpredictedposition = new List <ChampionPredictedPosition>();

            foreach (var x in HeroManager.Enemies.Where(x => x.IsValidTarget()))
            {
                championpredictedposition
                .Add(new ChampionPredictedPosition
                         (x, Prediction.GetPrediction(x, Player.AttackCastDelay + Game.Ping / 1000).UnitPosition));
            }
            enemies = new List <Obj_AI_Hero>();
            foreach (var hero in HeroManager.Enemies.Where(x => x.IsValidTarget() && !x.IsZombie))
            {
                if (soldier.Any(x => x.Position.Distance(hero.Position) <= 300 + hero.BoundingRadius && Player.Distance(x.Position) <= 925))
                {
                    enemies.Add(hero);
                }
            }
            soldierattackminions = new List <Obj_AI_Minion>();
            foreach (var minion in minions)
            {
                var Soldiers = soldier.Where
                                   (x => x.Position.Distance(minion.Position) <= 300 + minion.BoundingRadius && Player.Distance(x.Position) <= 925)
                               .ToList();
                if (Soldiers.Any())
                {
                    soldierattackminions.Add(minion);
                    soldierandtargetminion.Add(new SoldierAndTargetMinion(minion, Soldiers));
                }
            }
            autoattackminions = new List <Obj_AI_Minion>();
            foreach (var minion in minions.Where(x => x.IsValidTarget(Orbwalking.GetRealAutoAttackRange(x))))
            {
                if (!soldierattackminions.Any(x => x.NetworkId == minion.NetworkId))
                {
                    autoattackminions.Add(minion);
                }
            }
            splashautoattackchampions = new List <SplashAutoAttackChampion>();
            foreach (var mainminion in soldierandtargetminion)
            {
                var mainminionpredictedposition =
                    Prediction.GetPrediction(mainminion.Minion, Player.AttackCastDelay + Game.Ping / 1000).UnitPosition;
                List <Obj_AI_Hero> splashchampions = new List <Obj_AI_Hero>();
                foreach (var hero in championpredictedposition)
                {
                    foreach (var mainminionsoldier in mainminion.Soldier)
                    {
                        if (Geometry.Distance(hero.Position.To2D(), mainminionsoldier.Position.To2D(),
                                              mainminionsoldier.Position.To2D().Extend(mainminionpredictedposition.To2D(), 450), false)
                            <= hero.Hero.BoundingRadius + 50)
                        {
                            splashchampions.Add(hero.Hero);
                        }
                    }
                }
                if (splashchampions.Any())
                {
                    splashautoattackchampions.Add(new SplashAutoAttackChampion(mainminion.Minion, splashchampions));
                }
            }
            splashautoattackminions = new List <SplashAutoAttackMinion>();
            foreach (var mainminion in soldierandtargetminion)
            {
                var mainminionpredictedposition =
                    Prediction.GetPrediction(mainminion.Minion, Player.AttackCastDelay + Game.Ping / 1000).UnitPosition;
                List <Obj_AI_Minion> splashminions = new List <Obj_AI_Minion>();
                foreach (var minion in minionspredictedposition)
                {
                    foreach (var mainminionsoldier in mainminion.Soldier)
                    {
                        if (Geometry.Distance(minion.Position.To2D(), mainminionsoldier.Position.To2D(),
                                              mainminionsoldier.Position.To2D().Extend(mainminionpredictedposition.To2D(), 450), false)
                            <= minion.Minion.BoundingRadius + 50)
                        {
                            splashminions.Add(minion.Minion);
                            break;
                        }
                    }
                }
                splashautoattackminions.Add(new SplashAutoAttackMinion(mainminion.Minion, splashminions));
            }
        }
Ejemplo n.º 28
0
        public static void CastCircle(this Spell spell, Obj_AI_Base target)
        {
            if (spell.Type == SkillshotType.SkillshotCircle || spell.Type == SkillshotType.SkillshotCone)
            {
                if (target == null)
                {
                    return;
                }

                var pred     = Prediction.GetPrediction(target, spell.Delay, spell.Width / 2, spell.Speed);
                var castVec  = (pred.UnitPosition.To2D() + target.ServerPosition.To2D()) / 2;
                var castVec2 = ObjectManager.Player.ServerPosition.To2D() + Vector2.Normalize(pred.UnitPosition.To2D() - ObjectManager.Player.Position.To2D()) * (spell.Range);

                if (target.IsValidTarget(spell.Range))
                {
                    if (
                        !(target.MoveSpeed *
                          (Game.Ping / 2000 + spell.Delay +
                           ObjectManager.Player.ServerPosition.Distance(target.ServerPosition) / spell.Speed) <=
                          spell.Width * 1 / 2))
                    {
                        if (pred.Hitchance < HitChance.VeryHigh ||
                            !(pred.UnitPosition.Distance(target.ServerPosition) < Math.Max(spell.Width, 300f)))
                        {
                            return;
                        }

                        if (!(target.MoveSpeed *
                              (Game.Ping / 2000 + spell.Delay +
                               ObjectManager.Player.ServerPosition.Distance(target.ServerPosition) / spell.Speed) <=
                              spell.Width * 2 / 3) || !(castVec.Distance(pred.UnitPosition) <= spell.Width * 1 / 2) ||
                            !(castVec.Distance(ObjectManager.Player.ServerPosition) <= spell.Range))
                        {
                            if (castVec.Distance(pred.UnitPosition) > spell.Width * 1 / 2 &&
                                ObjectManager.Player.ServerPosition.Distance(pred.UnitPosition) <= spell.Range)
                            {
                                spell.Cast(pred.UnitPosition);
                            }
                            else
                            {
                                spell.Cast(pred.CastPosition);
                            }
                        }
                        else
                        {
                            spell.Cast(castVec);
                        }
                    }
                    else
                    {
                        spell.Cast(target.ServerPosition);
                    }
                }
                else if (target.IsValidTarget(spell.Range + spell.Width / 2))
                {
                    if (pred.Hitchance < HitChance.VeryHigh ||
                        !(ObjectManager.Player.ServerPosition.Distance(pred.UnitPosition) <=
                          spell.Range + spell.Width * 1 / 2) ||
                        !(pred.UnitPosition.Distance(target.ServerPosition) < Math.Max(spell.Width, 400f)))
                    {
                        return;
                    }

                    if (!(ObjectManager.Player.ServerPosition.Distance(pred.UnitPosition) <= spell.Range))
                    {
                        if (!(ObjectManager.Player.ServerPosition.Distance(pred.UnitPosition) <=
                              spell.Range + spell.Width * 1 / 2) || !(target.MoveSpeed *
                                                                      (Game.Ping / 2000 + spell.Delay +
                                                                       ObjectManager.Player.ServerPosition.Distance(
                                                                           target.ServerPosition) / spell.Speed) <=
                                                                      spell.Width / 2))
                        {
                            return;
                        }

                        if (ObjectManager.Player.Distance(castVec2) <= spell.Range)
                        {
                            spell.Cast(castVec2);
                        }
                    }
                    else
                    {
                        if (ObjectManager.Player.ServerPosition.Distance(pred.CastPosition) <= spell.Range)
                        {
                            spell.Cast(pred.CastPosition);
                        }
                    }
                }
            }
        }
        public static void UseComboItems(Obj_AI_Hero target, bool killSteal = false)
        {
            if (_menu == null || !_menu.Item(_menu.Name + ".enabled").GetValue <bool>())
            {
                return;
            }
            try
            {
                var distance = target == null ? 0 : target.Distance(ObjectManager.Player.Position, true);
                if (distance >= Math.Pow(MaxRange, 2))
                {
                    return;
                }

                foreach (var item in
                         Items.Where(
                             i =>
                             ((i.Flags & _itemFlags) != 0) &&
                             _menu.Item(_menu.Name + "." + i.Name + ".combo").GetValue <bool>() && i.Item.IsOwned() &&
                             i.Item.IsReady() && distance <= Math.Pow(i.Range, 2) &&
                             (killSteal ||
                              ObjectManager.Player.CountEnemiesInRange(i.Range) >=
                              _menu.Item(_menu.Name + "." + i.Name + ".min-enemies-range").GetValue <Slider>().Value&&
                              ObjectManager.Player.HealthPercent <=
                              _menu.Item(_menu.Name + "." + i.Name + ".player-health-below").GetValue <Slider>().Value&&
                              ObjectManager.Player.HealthPercent >=
                              _menu.Item(_menu.Name + "." + i.Name + ".player-health-above").GetValue <Slider>().Value&&
                              (target == null ||
                               target.HealthPercent <=
                               _menu.Item(_menu.Name + "." + i.Name + ".target-health-below").GetValue <Slider>().Value&&
                               target.HealthPercent >=
                               _menu.Item(_menu.Name + "." + i.Name + ".target-health-above").GetValue <Slider>().Value)))
                         )
                {
                    switch (item.CastType)
                    {
                    case CastType.Target:
                        item.Item.Cast(target);
                        break;

                    case CastType.Self:
                        item.Item.Cast(ObjectManager.Player);
                        break;

                    case CastType.None:
                        item.Item.Cast();
                        break;

                    case CastType.Position:
                        var prediction = Prediction.GetPrediction(target, item.Delay, item.Radius, item.Speed);
                        if (prediction.Hitchance >= HitChance.Medium)
                        {
                            item.Item.Cast(prediction.CastPosition);
                        }
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Ejemplo n.º 30
0
        // TODO rework the logic of combo, especially if already barrel manually placed
        private static void Combo()
        {
            var target = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical, true, HeroManager.Enemies.Where(e => e.IsInvulnerable));

            if (target == null)
            {
                return;
            }
            var ePrediction = Prediction.GetPrediction(target, 1f).CastPosition;
            var nbar        = NearestKeg(Player.ServerPosition.To2D());

            // ITEMS
            if (GetBool("bangplank.menu.item.youmuu") && HeroManager.Enemies != null && Items.HasItem(3142) && Items.CanUseItem(3142))
            {
                foreach (var e in HeroManager.Enemies)
                {
                    if (e.Distance(Player) <= Player.AttackRange + 50)
                    {
                        Items.UseItem(3142); //youmuu gb
                    }
                }
            }
            if (GetBool("bangplank.menu.item.hydra") && HeroManager.Enemies != null &&
                Items.HasItem(3074) && Items.CanUseItem(3074))
            {
                foreach (var e in HeroManager.Enemies)
                {
                    if (e.Distance(Player) <= 400)
                    {
                        Items.UseItem(3072); //ravenous hydra
                    }
                }
            }
            if (GetBool("bangplank.menu.item.tiamat") && HeroManager.Enemies != null &&
                Items.HasItem(3077) && Items.CanUseItem(3077))
            {
                foreach (var e in HeroManager.Enemies)
                {
                    if (e.Distance(Player) <= 400)
                    {
                        Items.UseItem(3077); //tiamat
                    }
                }
            }



            if (target == null)
            {
                return;
            }
            if ((E.Instance.Ammo == 0 || E.Level < 1) && Q.IsReady() && Q.IsInRange(target) && (LiveBarrels.Count == 0 || NearestKeg(Player.Position.To2D()).KegObj.Distance(Player) > Q.Range))
            {
                Q.CastOnUnit(target);
            }

            if (GetBool("bangplank.menu.misc.barrelmanager.edisabled") == false && R.Level == 0 && E.IsReady() && (LiveBarrels.Count == 0 || NearestKeg(Player.Position.To2D()).KegObj.Distance(Player) > E.Range)) // 2 keg
            {
                E.Cast(ePrediction);
            }
            if (R.Level == 1 && GetBool("bangplank.menu.misc.barrelmanager.edisabled") == false && E.IsReady()) // 3 Keg
            {
                if ((LiveBarrels.Count == 0 || nbar.KegObj.Distance(Player) > Q.Range) && E.Instance.Ammo >= 3)
                {
                    E.Cast(Player.ServerPosition);
                }
                if ((LiveBarrels.Count == 0 || nbar.KegObj.Distance(Player) > Q.Range) && E.Instance.Ammo < 3)
                {
                    foreach (var k in LiveBarrels)
                    {
                        if (k.KegObj.GetEnemiesInRange(ExplosionRange).Count >= 1 && Player.Distance(k.KegObj) < E.Range)
                        {
                            BarrelManager();
                            return;
                        }
                    }
                    E.Cast(ePrediction);
                }
            }
            if (R.Level == 2 && GetBool("bangplank.menu.misc.barrelmanager.edisabled") == false && E.IsReady()) // 4 Keg
            {
                if ((LiveBarrels.Count == 0 || nbar.KegObj.Distance(Player) > Q.Range) && E.Instance.Ammo >= 3)
                {
                    E.Cast(Player.ServerPosition);
                }
                if ((LiveBarrels.Count == 0 || nbar.KegObj.Distance(Player) > Q.Range) && E.Instance.Ammo < 3)
                {
                    foreach (var k in LiveBarrels)
                    {
                        if (k.KegObj.GetEnemiesInRange(ExplosionRange).Count >= 1 && Player.Distance(k.KegObj) < E.Range)
                        {
                            BarrelManager();
                            return;
                        }
                    }
                    E.Cast(ePrediction);
                }
            }
            if (R.Level == 3 && GetBool("bangplank.menu.misc.barrelmanager.edisabled") == false && E.IsReady()) // 5 Keg
            {
                if ((LiveBarrels.Count == 0 || nbar.KegObj.Distance(Player) > Q.Range) && E.Instance.Ammo >= 3 && Player.GetEnemiesInRange(E.Range).Count < 3)
                {
                    E.Cast(Player.ServerPosition);
                }
                if (((LiveBarrels.Count == 0 || nbar.KegObj.Distance(Player) > Q.Range) && E.Instance.Ammo < 3) || Player.GetEnemiesInRange(E.Range).Count >= 3)
                {
                    foreach (var k in LiveBarrels)
                    {
                        if (k.KegObj.GetEnemiesInRange(ExplosionRange).Count >= 1 && Player.Distance(k.KegObj) < E.Range)
                        {
                            BarrelManager();
                            return;
                        }
                    }
                    E.Cast(ePrediction);
                }
            }
            //Extend if possible and if the number of enemies is below 3
            if (Player.GetEnemiesInRange(E.Range).Count < 3 && GetBool("bangplank.menu.misc.barrelmanager.edisabled") == false)
            {
                if (Player.ServerPosition.Distance(nbar.KegObj.Position) < Q.Range && nbar.KegObj.Health < 3)
                {
                    if (target != null)
                    {
                        var prediction = Prediction.GetPrediction(target, 0.8f).CastPosition;
                        if (nbar.KegObj.Distance(prediction) < LinkRange)
                        {
                            E.Cast(prediction);
                            // if (Player.Level < 7 && nbar.KegObj.Health < 2)
                            // {
                            //    Q.Cast(nbar.KegObj);
                            // }
                            if (Player.Level < 13 && Player.Level >= 7 && nbar.KegObj.Health == 2)
                            {
                                LeagueSharp.Common.Utility.DelayAction.Add(580 - Game.Ping, () =>
                                {
                                    Q.Cast(nbar.KegObj);
                                }
                                                                           );
                            }

                            if (Player.Level >= 13 && nbar.KegObj.Health == 2)
                            {
                                LeagueSharp.Common.Utility.DelayAction.Add((int)(80 - Game.Ping), () =>
                                {
                                    Q.Cast(nbar.KegObj);
                                }
                                                                           );
                            }
                            if (nbar.KegObj.Health == 1)
                            {
                                Q.Cast(nbar.KegObj);
                            }
                        }
                    }
                }
            }

            if (GetBool("bangplank.menu.combo.r") && R.IsReady() && target.GetEnemiesInRange(600).Count + 1 > Getslider("bangplank.menu.combo.rmin") && target.HealthPercent < 30)
            {
                R.Cast(Prediction.GetPrediction(target, R.Delay).CastPosition);
            }
            BarrelManager();
        }