Пример #1
0
        private static void AutoKick()
        {
            if (getSliderItem(miscMenu, "LeeSin_AutoKick") == 0 || getKeyBindItem(miscMenu, "LeeSin_InsecKick"))
            {
                return;
            }

            var target =
                HeroManager.Enemies.Where(x => x.LSDistance(Player) < 375 && !x.IsDead && x.LSIsValidTarget(375))
                .OrderBy(x => x.LSDistance(Player)).FirstOrDefault();

            if (target == null)
            {
                return;
            }

            var ultPoly = new LeagueSharp.Common.Geometry.Polygon.Rectangle(Player.ServerPosition,
                                                                            Player.ServerPosition.LSExtend(target.Position, 1100),
                                                                            target.BoundingRadius + 10);

            var count =
                HeroManager.Enemies.Where(x => x.LSDistance(Player) < 1100 && x.LSIsValidTarget(1100))
                .Count(h => h.NetworkId != target.NetworkId && ultPoly.IsInside(h.ServerPosition));

            if (count >= getSliderItem(miscMenu, "LeeSin_AutoKick") && _R.IsReady())
            {
                _R.Cast(target);
            }
        }
Пример #2
0
        private void Cast_Q(Obj_AI_Hero forceTarget = null)
        {
            if (!Q.IsReady() || !PassiveCheck())
            {
                return;
            }

            var target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);

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

            if (target != null && target.IsValidTarget(Q.Range))
            {
                if (Q.Cast(target) == Spell.CastStates.SuccessfullyCasted)
                {
                    Q.LastCastAttemptT = Utils.TickCount;
                    return;
                }
            }

            target = TargetSelector.GetTarget(QExtend.Range, TargetSelector.DamageType.Physical);

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

            if (target == null || !menu.Item("UseQExtendCombo", true).GetValue <bool>())
            {
                return;
            }

            var pred       = QExtend.GetPrediction(target, true);
            var collisions = MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly);

            if (!collisions.Any() || (!target.IsMoving && menu.Item("MovementCheck", true).GetValue <bool>()))
            {
                return;
            }

            foreach (var minion in collisions)
            {
                var poly = new Geometry.Polygon.Rectangle(Player.ServerPosition, Player.ServerPosition.Extend(minion.ServerPosition, QExtend.Range), QExtend.Width);

                if (poly.IsInside(pred.UnitPosition))
                {
                    if (Q.Cast(minion) == Spell.CastStates.SuccessfullyCasted)
                    {
                        Q.LastCastAttemptT = Utils.TickCount;
                        return;
                    }
                }
            }
        }
Пример #3
0
        private void Combo()
        {
            var itemTarget = TargetSelector.GetTarget(750, TargetSelector.DamageType.Physical);

            if (itemTarget != null)
            {
                var dmg = GetComboDamage(itemTarget);

                ItemManager.Target = itemTarget;

                if (dmg > itemTarget.Health - 50)
                {
                    ItemManager.KillableTarget = true;
                }

                ItemManager.UseTargetted = true;
            }

            if (Menu.Item("UseQExtendCombo", true).GetValue <bool>() && Q.IsReady())
            {
                var target = TargetSelector.GetTarget(QExtend.Range, TargetSelector.DamageType.Physical);

                if (!target.IsValidTarget(Q.Range) && target.IsValidTarget(QExtend.Range))
                {
                    var pred       = QExtend.GetPrediction(target, true);
                    var collisions = MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly);

                    if (!collisions.Any() || (!target.IsMoving && Menu.Item("MovementCheck", true).GetValue <bool>()))
                    {
                        return;
                    }

                    foreach (var minion in collisions)
                    {
                        var poly = new Geometry.Polygon.Rectangle(Player.ServerPosition, Player.ServerPosition.Extend(minion.ServerPosition, QExtend.Range), QExtend.Width);

                        if (poly.IsInside(pred.UnitPosition))
                        {
                            Q.Cast(minion);
                        }
                    }
                }
            }

            if (Menu.Item("UseRCombo", true).GetValue <bool>() && R.IsReady())
            {
                var target = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Physical);

                if (target.IsValidTarget(R.Range) && !target.IsZombie && !target.IsDead &&
                    R.GetDamage(target) * GetShots() > target.Health &&
                    target.Distance(Player) > Orbwalking.GetAttackRange(Player) + 150)
                {
                    R.Cast(target);
                }
            }
        }
Пример #4
0
 private static void OnProcessSpell(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     try
     {
         if (args.Target is Obj_AI_Minion || !(sender is AIHeroClient))
         {
             return;
         }
         if (getCheckBoxItem(miscMenu, "Janna_AutoE"))
         {
             if (sender.IsEnemy)
             {
                 var StartPos  = args.Start;
                 var EndPos    = args.End;
                 var NonTRange = new LeagueSharp.Common.Geometry.Polygon.Rectangle(StartPos, EndPos, sender.BoundingRadius + 30);
                 var Target    = HeroManager.Allies.FirstOrDefault(f => f.Position.LSDistance(Player.Position) <= _E.Range && NonTRange.IsInside(f.Position));
                 if (Target == Player && getCheckBoxItem(miscMenu, "Janna_AutoE1"))
                 {
                     return;
                 }
                 if (Target != null)
                 {
                     _E.CastOnUnit(Target, true);
                     return;
                 }
                 if (args.Target != null && args.Target.Position.LSDistance(Player.Position) <= _E.Range && args.Target is AIHeroClient)
                 {
                     var ShieldTarget = HeroManager.Allies.FirstOrDefault(f => f.Position.LSDistance(args.Target.Position) <= 10);
                     _E.CastOnUnit(ShieldTarget, true);
                     return;
                 }
             }
             if (sender.IsAlly && args.Target is AIHeroClient)
             {
                 if (sender.Position.LSDistance(Player.Position) <= _E.Range && args.Target != null && args.SData.Name.ToLower().Contains("attack"))
                 {
                     _E.CastOnUnit(sender, true);
                     return;
                 }
             }
         }
     }
     catch (Exception)
     {
         if (NowTime() > ErrorTime)
         {
             Chat.Print(ChampName + " in FreshBooster isn't Load. Error Code 08");
             ErrorTime = TickCount(10000);
         }
     }
 }
Пример #5
0
        private static void CastR(Obj_AI_Base target)
        {
            if (!spells[Spells.R].IsReady() || !target.LSIsValidTarget(spells[Spells.R].Range) ||
                !getCheckBoxItem(cMenu, "ElLux.Combo.R") || target.IsZombie || target.IsDead)
            {
                return;
            }


            if (getCheckBoxItem(cMenu, "ElLux.Combo.R.AOE"))
            {
                const float LuxRDistance = 3340;
                const float LuxRWidth    = 70;
                var         minREnemies  = getSliderItem(cMenu, "ElLux.Combo.R.Count")
                ;
                foreach (var enemy in HeroManager.Enemies)
                {
                    var startPos = enemy.ServerPosition;
                    var endPos   = Player.ServerPosition.LSExtend(
                        startPos,
                        Player.Distance(enemy) + LuxRDistance);

                    var rectangle = new LeagueSharp.Common.Geometry.Polygon.Rectangle(startPos, endPos, LuxRWidth);
                    if (HeroManager.Enemies.Count(x => rectangle.IsInside(x)) >= minREnemies)
                    {
                        spells[Spells.R].Cast(enemy);
                    }
                }
            }

            if (getCheckBoxItem(cMenu, "ElLux.Combo.R.Rooted"))
            {
                if (target.HasBuff("LuxLightBindingMis"))
                {
                    var prediction = spells[Spells.Q].GetPrediction(target);
                    if (prediction.Hitchance >= HitChance.High)
                    {
                        spells[Spells.R].Cast(prediction.CastPosition);
                    }
                }
            }

            if (spells[Spells.R].GetDamage(target) > GetHealth(target) && getCheckBoxItem(cMenu, "ElLux.Combo.R.Kill"))
            {
                var prediction = spells[Spells.R].GetPrediction(target);
                if (prediction.Hitchance >= HitChance.High)
                {
                    spells[Spells.R].Cast(prediction.CastPosition);
                }
            }
        }
Пример #6
0
        private void Cast_QE(string source, Obj_AI_Base target = null)
        {
            var qeTarget = TargetSelector.GetTarget(_qe.Range, TargetSelector.DamageType.Magical);

            if (qeTarget == null || !Q.IsReady() || !E.IsReady())
            {
                return;
            }

            var qTarget = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Magical);

            if (qTarget.IsValidTarget(E.Range))
            {
                var pred = Q.GetPrediction(qTarget);

                if (pred.Hitchance >= HitChanceManager.GetQEHitChance(source))
                {
                    Q.Cast(pred.CastPosition);
                    W.LastCastAttemptT   = Utils.TickCount + 500;
                    _qe.LastCastAttemptT = Utils.TickCount;
                }
            }
            else
            {
                var    startPos  = Player.ServerPosition.To2D().Extend(qeTarget.ServerPosition.To2D(), Q.Range).To3D();
                double rangeLeft = 100 + (-0.6 * Player.Distance(startPos) + 950);
                var    endPos    = startPos + Vector3.Normalize(startPos - Player.ServerPosition) * (float)rangeLeft;

                _qe.From  = startPos;
                _qe.Delay = E.Delay + Q.Range / E.Speed;

                var qePred = _qe.GetPrediction(qeTarget);

                var poly = new Geometry.Polygon.Rectangle(startPos, endPos, _qe.Width);

                if (!poly.IsInside(qePred.UnitPosition))
                {
                    return;
                }

                poly.Draw(Color.LawnGreen);

                if (qePred.Hitchance >= HitChanceManager.GetQEHitChance(source))
                {
                    Q.Cast(startPos);
                    W.LastCastAttemptT   = Utils.TickCount + 500;
                    _qe.LastCastAttemptT = Utils.TickCount;
                }
            }
        }
Пример #7
0
        private static rUtility Find_R_BestPos(Obj_AI_Base target)
        {
            rUtility result  = new rUtility(new Vector3(), 0);
            Vector3  bestPos = new Vector3();
            int      unitHit = 1;
            int      maxHit  = 1;

            foreach (var unit in HeroManager.Enemies)
            {
                if (unit.NetworkId != target.NetworkId && unit.IsValidTarget())
                {
                    var pred = LeagueSharp.Common.Prediction.GetPrediction(unit, 300);
                    if (target.Position.Distance(pred.UnitPosition) < 900)
                    {
                        Vector3 startPos = target.Position;
                        Vector3 endPos   = pred.UnitPosition;
                        endPos = startPos + (endPos - startPos).Normalized() * 900;
                        var zone = new LeagueSharp.Common.Geometry.Polygon.Rectangle(startPos, endPos, target.BoundingRadius - 5);

                        foreach (var unit2 in HeroManager.Enemies)
                        {
                            if (unit2.NetworkId != target.NetworkId && unit2.NetworkId != unit.NetworkId && unit2.IsValidTarget())
                            {
                                pred = LeagueSharp.Common.Prediction.GetPrediction(unit2, 300);
                                if (zone.IsInside(pred.UnitPosition))
                                {
                                    unitHit++;
                                    if (unitHit > maxHit)
                                    {
                                        maxHit     = unitHit;
                                        bestPos    = target.Position + (target.Position - unit2.Position).Normalized() * 250;
                                        result.pos = bestPos;
                                        result.hit = maxHit;
                                    }
                                }
                            }
                        }
                        if (maxHit == 1)
                        {
                            maxHit     = 2;
                            bestPos    = target.Position + (target.Position - unit.Position).Normalized() * 250;
                            result.pos = bestPos;
                            result.hit = maxHit;
                        }
                    }
                }
            }

            return(result);
        }
Пример #8
0
        private static void BardQ(AIHeroClient Target, bool Type, bool Draw = false)
        {
            // Type 0: no sturn / 1: only sturn
            // If Draw is true, return draw

            /* return
             * target1, target2, type
             */
            Range1 = new LeagueSharp.Common.Geometry.Polygon.Rectangle(Player.Position, Player.Position.LSExtend(Target.Position, _Q.Range), _Q.Width);
            Range2 = null;
            if (Draw)
            {
                Range1.Draw(Color.Red);
            }
            cnt          = 0;
            BardQTarget1 = Player;
            BardQTarget2 = Player;
            foreach (var item in ObjectManager.Get <Obj_AI_Base>().OrderBy(f => f.Distance(f.Position)))
            {
                if (item.Distance(Player.Position) < _Q.Range)
                {
                    if (item is AIHeroClient || item is Obj_AI_Minion)
                    {
                        if (item.IsEnemy && !item.IsDead)
                        {
                            if (cnt == 2)
                            {
                                break;
                            }
                            if (cnt == 0 && Range1.IsInside(item.Position))
                            {
                                BardQTarget1 = item;
                                Range2       = new LeagueSharp.Common.Geometry.Polygon.Rectangle(Player.Position.Extend(BardQTarget1.Position, Player.Distance(BardQTarget1.Position)),
                                                                                                 Player.Position.Extend(BardQTarget1.Position, Player.Distance(BardQTarget1.Position) + 450), _Q.Width);
                                if (Draw)
                                {
                                    Range2.Draw(Color.Yellow);
                                }
                                cnt++;
                            }
                            if (cnt == 1 && Range2.IsInside(item.Position))
                            {
                                BardQTarget2 = item;
                                cnt++;
                            }
                        }
                    }
                }
            }
        }
Пример #9
0
        private void SmartKs()
        {
            if (!Menu.Item("smartKS", true).GetValue <bool>())
            {
                return;
            }

            foreach (var target in ObjectManager.Get <Obj_AI_Hero>().Where(x => x.IsValidTarget(QExtend.Range) && !x.IsDead && !x.HasBuffOfType(BuffType.Invulnerability)))
            {
                if (Q.IsKillable(target) && Player.Distance(target.Position) < QExtend.Range && Q.IsReady())
                {
                    if (target.IsValidTarget(Q.Range))
                    {
                        Q.Cast(target);
                    }
                    else
                    {
                        var pred       = QExtend.GetPrediction(target, true);
                        var collisions = MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly);

                        if (!collisions.Any() || (!target.IsMoving && Menu.Item("MovementCheck", true).GetValue <bool>()))
                        {
                            return;
                        }

                        foreach (var minion in collisions)
                        {
                            var poly = new Geometry.Polygon.Rectangle(Player.ServerPosition, Player.ServerPosition.Extend(minion.ServerPosition, QExtend.Range), QExtend.Width);

                            if (poly.IsInside(pred.UnitPosition))
                            {
                                if (Q.Cast(minion) == Spell.CastStates.SuccessfullyCasted)
                                {
                                    Q.LastCastAttemptT = Utils.TickCount;
                                    return;
                                }
                            }
                        }
                    }
                }

                if (W.IsKillable(target) && Player.Distance(target.Position) < W.Range && W.IsReady())
                {
                    W.Cast(target);
                }
            }
        }
Пример #10
0
        private void Harass()
        {
            if (!ManaManager.HasMana("Harass"))
            {
                return;
            }

            if (Menu.Item("UseQHarass", true).GetValue <bool>() && Q.IsReady())
            {
                var target = TargetSelector.GetTarget(QExtend.Range, TargetSelector.DamageType.Physical);

                if (target != null)
                {
                    if (target.IsValidTarget(Q.Range))
                    {
                        Q.Cast(target);
                    }
                    else if (target.IsValidTarget(QExtend.Range) && Menu.Item("UseQExtendHarass", true).GetValue <bool>())
                    {
                        var pred       = QExtend.GetPrediction(target, true);
                        var collisions = MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly);

                        if (!collisions.Any() || (!target.IsMoving && Menu.Item("MovementCheck", true).GetValue <bool>()))
                        {
                            return;
                        }

                        foreach (var minion in collisions)
                        {
                            var poly = new Geometry.Polygon.Rectangle(Player.ServerPosition, Player.ServerPosition.Extend(minion.ServerPosition, QExtend.Range), QExtend.Width);

                            if (poly.IsInside(pred.UnitPosition))
                            {
                                Q.Cast(minion);
                            }
                        }
                    }
                }
            }

            if (Menu.Item("UseWHarass", true).GetValue <bool>() && W.IsReady())
            {
                SpellCastManager.CastBasicSkillShot(W, W.Range, TargetSelector.DamageType.Magical, HitChance.VeryHigh);
            }
        }
Пример #11
0
 private static void AutoUseQ()
 {
     if (Q.IsReady() && AutoQ && Player.ManaPercent > MinMana)
     {
         var extarget = TargetSelector.GetTarget(Q1.Range, DamageType.Physical);
         var Minions  = MinionManager.GetMinions(Q.Range);
         foreach (var Minion in Minions)
         {
             var QHit  = new Geometry.Polygon.Rectangle(Player.Position, Player.Position.LSExtend(Minion.Position, Q1.Range), Q1.Width);
             var QPred = Q1.GetPrediction(extarget);
             if (!QHit.IsOutside(QPred.UnitPosition.LSTo2D()) && QPred.Hitchance == HitChance.High)
             {
                 Q.Cast(Minion);
                 break;
             }
         }
     }
 }
Пример #12
0
        public static void CastSingleLine(Spell spell, Spell spell2, bool wallCheck, float extraPrerange = 1)
        {
            if (!spell.IsReady() || Utils.TickCount - _lastCast < 0)
            {
                return;
            }

            //-------------------------------Single---------------------------
            var target = TargetSelector.GetTarget(spell.Range + spell2.Range, TargetSelector.DamageType.Magical);

            if (target == null)
            {
                return;
            }

            var vector1 = Player.ServerPosition + Vector3.Normalize(target.ServerPosition - Player.ServerPosition) * (spell.Range * extraPrerange);

            spell2.UpdateSourcePosition(vector1, vector1);

            var pred = Prediction.GetPrediction(target, spell.Delay);

            Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(vector1, vector1.Extend(pred.CastPosition, spell2.Range), spell.Width);

            if (Player.ServerPosition.Distance(target.ServerPosition) < spell.Range)
            {
                var vector2 = pred.CastPosition.Extend(target.ServerPosition, spell2.Range * .3f);
                Geometry.Polygon.Rectangle rec2 = new Geometry.Polygon.Rectangle(vector2, vector2.Extend(pred.CastPosition, spell2.Range), spell.Width);

                if ((!rec2.Points.Exists(Util.IsWall) || !wallCheck) && pred.Hitchance >= HitChance.Medium && target.IsMoving)
                {
                    spell2.UpdateSourcePosition(vector2, vector2);
                    CastLineSpell(vector2, vector2.Extend(pred.CastPosition, spell2.Range));
                    _lastCast = Utils.TickCount + 500;
                }
            }
            else if (!rec1.Points.Exists(Util.IsWall) || !wallCheck)
            {
                //wall check
                if (pred.Hitchance >= HitChance.High)
                {
                    CastLineSpell(vector1, pred.CastPosition);
                }
            }
        }
Пример #13
0
        private void CastQ(string source)
        {
            if (!Q.IsReady())
            {
                return;
            }

            var target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);

            if (target != null && target.IsValidTarget(Q.Range))
            {
                SpellCastManager.CastBasicSkillShot(Q, Q.Range, TargetSelector.DamageType.Magical, HitChanceManager.GetQHitChance(source));
            }

            target = TargetSelector.GetTarget(QExtend.Range, TargetSelector.DamageType.Physical);

            if (target == null)
            {
                return;
            }

            var pred       = QExtend.GetPrediction(target, true);
            var collisions = MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly);

            if (!collisions.Any())
            {
                return;
            }

            foreach (var minion in collisions)
            {
                var poly = new Geometry.Polygon.Rectangle(Player.ServerPosition, Player.ServerPosition.Extend(minion.ServerPosition, QExtend.Range), QExtend.Width);

                if (poly.IsInside(pred.UnitPosition))
                {
                    if (Q.Cast(minion) == Spell.CastStates.SuccessfullyCasted)
                    {
                        Q.LastCastAttemptT = Utils.TickCount;
                        return;
                    }
                }
            }
        }
Пример #14
0
 void Drawing_OnEndScene(EventArgs args)
 {
     if (_skillshot != null && Game.Time - drawTime <= 2)
     {
         _skillshot.Draw(Color.Blue, 2);
     }
     if (_skillshotAoe != null && Game.Time - drawTime <= 2)
     {
         _skillshotAoe.Draw(Color.Blue, 2);
     }
     if (Game.Time - drawTime > 2)
     {
         _skillshot    = null;
         _skillshotAoe = null;
     }
     if (Config.SubMenu("AutoCombo").Item("Draw").GetValue <bool>())
     {
         Render.Circle.DrawCircle(Player.Position, Config.SubMenu("AutoCombo").Item("Range").GetValue <Slider>().Value, Color.Red);
     }
 }
Пример #15
0
        private static void OnDoCastDelayedLC(GameObjectProcessSpellCastEventArgs args)
        {
            AAPassive = false;
            if (args.Target is Obj_AI_Minion && args.Target.IsValid)
            {
                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear) && Player.ManaPercent > LMinMana)
                {
                    var Minions = MinionManager.GetMinions(Orbwalking.GetRealAutoAttackRange(Player), MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.Health);
                    if (Minions[0].IsValid && Minions.Count != 0)
                    {
                        if (!LT)
                        {
                            return;
                        }

                        if (E.IsReady() && !AAPassive && LE)
                        {
                            E.Cast(Player.Position.LSExtend(Game.CursorPos, 70));
                        }
                        if (Q.IsReady() && (!E.IsReady() || (E.IsReady() && !LE)) && LQ != 0 && !AAPassive)
                        {
                            var QMinions  = MinionManager.GetMinions(Q.Range);
                            var exminions = MinionManager.GetMinions(Q1.Range);
                            foreach (var Minion in QMinions)
                            {
                                var QHit = new Geometry.Polygon.Rectangle(Player.Position, Player.Position.LSExtend(Minion.Position, Q1.Range), Q1.Width);
                                if (exminions.Count(x => !QHit.IsOutside(x.Position.LSTo2D())) >= LQ)
                                {
                                    Q.Cast(Minion);
                                    break;
                                }
                            }
                        }
                        if ((!E.IsReady() || (E.IsReady() && !LE)) && (!Q.IsReady() || (Q.IsReady() && LQ == 0)) && LW && W.IsReady() && !AAPassive)
                        {
                            W.Cast(Minions[0].Position);
                        }
                    }
                }
            }
        }
Пример #16
0
        private static void Harass()
        {
            if (Player.ManaPercent < HMinMana)
            {
                return;
            }

            if (Q.IsReady() && HEXQ)
            {
                var target  = TargetSelector.GetTarget(Q1.Range, DamageType.Physical);
                var Minions = MinionManager.GetMinions(Q.Range);
                foreach (var Minion in Minions)
                {
                    var QHit  = new Geometry.Polygon.Rectangle(Player.Position, Player.Position.LSExtend(Minion.Position, Q1.Range), Q1.Width);
                    var QPred = Q1.GetPrediction(target);
                    if (!QHit.IsOutside(QPred.UnitPosition.LSTo2D()) && QPred.HitChance == EloBuddy.SDK.Enumerations.HitChance.High)
                    {
                        Q.Cast(Minion);
                        break;
                    }
                }
            }
        }
Пример #17
0
        private static void LaneClear()
        {
            if (Player.ManaPercent < LMinMana)
            {
                return;
            }

            if (Q.IsReady() && LHQ)
            {
                var extarget = TargetSelector.GetTarget(Q1.Range, TargetSelector.DamageType.Physical);
                var Minions  = MinionManager.GetMinions(Q.Range);
                foreach (var Minion in Minions)
                {
                    var QHit  = new LeagueSharp.Common.Geometry.Polygon.Rectangle(Player.Position, Player.Position.Extend(Minion.Position, Q1.Range).To3DWorld(), Q1.Width);
                    var QPred = Q1.GetPrediction(extarget);
                    if (!QHit.IsOutside(QPred.UnitPosition.To2D()) && QPred.Hitchance == HitChance.High)
                    {
                        Q.Cast(Minion);
                        break;
                    }
                }
            }
        }
Пример #18
0
        private static void Game_OnUpdate(EventArgs args)
        {
            switch (Program.insecmode)
            {
            case 0:
                var hero = HeroManager.Allies.Where(x => !x.IsMe && !x.IsDead)
                           .OrderByDescending(x => x.LSDistance(Player.Position)).LastOrDefault();
                if (hero != null)
                {
                    InsecPoint = hero.Position;
                }
                break;

            case 1:
                var turret = GameObjects.AllyTurrets.OrderByDescending(x => x.LSDistance(Player.Position)).LastOrDefault();
                if (turret != null)
                {
                    InsecPoint = turret.Position;
                }
                break;

            case 2:
                InsecPoint = Game.CursorPos;
                break;

            case 3:
                InsecPoint = LastLeftClick;
                break;
            }
            if (!Program.insec)
            {
                return;
            }
            if (Orbwalker.CanMove)
            {
                Orbwalker.MoveTo(Game.CursorPos);
            }
            if (!InsecPoint.IsValid())
            {
                return;
            }
            var target = TargetSelector.SelectedTarget;

            if (!target.LSIsValidTarget() || target.IsZombie)
            {
                return;
            }
            if (!Program._r2.IsReady())
            {
                return;
            }
            //case 1
            Vector2 start1 = Player.Position.LSTo2D().LSExtend(InsecPoint.LSTo2D(), -300);
            Vector2 end1   = start1.LSExtend(Player.Position.LSTo2D(), 750);
            float   width1 = Program._r.Level == 3 ? 125 * 6 / 2 :
                             Program._r.Level == 2 ? 125 * 5 / 2 :
                             125 * 4 / 2;
            var Rect1      = new LeagueSharp.Common.Geometry.Polygon.Rectangle(start1, end1, width1 - 100);
            var Predicted1 = LeagueSharp.Common.Prediction.GetPrediction(target, Game.Ping / 1000f + 0.25f).UnitPosition;

            if (Rect1.IsInside(target.Position) && Rect1.IsInside(Predicted1))
            {
                Program._r2.Cast(InsecPoint);
                return;
            }
            if (Environment.TickCount - LastJump < 1500)
            {
                return;
            }
            if (!Program._e.IsReady())
            {
                return;
            }
            //case 2
            var sold2 = Soldiers.soldier
                        .Where(x => Player.LSDistance(x.Position) <= 1100)
                        .OrderBy(x => x.Position.LSDistance(target.Position)).FirstOrDefault();

            if (sold2 != null)
            {
                if (!Program._q2.IsReady())
                {
                    var     time       = Player.Position.LSDistance(sold2.Position) / 1700f;
                    var     predicted2 = LeagueSharp.Common.Prediction.GetPrediction(target, time).UnitPosition;
                    Vector2 start2     = sold2.Position.LSTo2D().LSExtend(InsecPoint.LSTo2D(), -300);
                    Vector2 end2       = start2.LSExtend(InsecPoint.LSTo2D(), 750);
                    float   width2     = Program._r.Level == 3 ? 125 * 6 / 2 :
                                         Program._r.Level == 2 ? 125 * 5 / 2 :
                                         125 * 4 / 2;
                    var Rect2 = new LeagueSharp.Common.Geometry.Polygon.Rectangle(start2, end2, width2 - 100);
                    if (Rect2.IsInside(target.Position) && Rect2.IsInside(predicted2))
                    {
                        Program._e.Cast(sold2.Position);
                        LastJump = Environment.TickCount;
                        return;
                    }
                }
                if (Program._q2.IsReady() && target.LSDistance(sold2.Position) <= 875 - 100)
                {
                    var     time       = (Player.LSDistance(sold2.Position) + sold2.Position.LSDistance(target.Position)) / 1700f;
                    var     predicted2 = LeagueSharp.Common.Prediction.GetPrediction(target, time).UnitPosition;
                    Vector2 start2     = target.Position.LSTo2D().LSExtend(InsecPoint.LSTo2D(), -300);
                    Vector2 end2       = start2.LSExtend(InsecPoint.LSTo2D(), 750);
                    float   width2     = Program._r.Level == 3 ? 125 * 6 / 2 :
                                         Program._r.Level == 2 ? 125 * 5 / 2 :
                                         125 * 4 / 2;
                    var Rect2 = new LeagueSharp.Common.Geometry.Polygon.Rectangle(start2, end2, width2 - 100);
                    if (Rect2.IsInside(target.Position) && Rect2.IsInside(predicted2))
                    {
                        var timetime = sold2.Position.LSDistance(Player.Position) * 1000 / 1700;
                        Program._e.Cast(sold2.Position);
                        LeagueSharp.Common.Utility.DelayAction.Add((int)timetime - 150 - Program.EQdelay, () => Program._q2.Cast(target.Position));
                        LastJump = Environment.TickCount;
                        return;
                    }
                }
            }
            if (Program._w.IsReady())
            {
                var posWs = GeoAndExten.GetWsPosition(target.Position.LSTo2D()).Where(x => x != null);
                foreach (var posW in posWs)
                {
                    if (!Program._q2.IsReady())
                    {
                        var     time       = Player.Position.LSTo2D().LSDistance((Vector2)posW) / 1700f + 0.3f;
                        var     predicted2 = LeagueSharp.Common.Prediction.GetPrediction(target, time).UnitPosition;
                        Vector2 start2     = ((Vector2)posW).LSExtend(InsecPoint.LSTo2D(), -300);
                        Vector2 end2       = start2.LSExtend(InsecPoint.LSTo2D(), 750);
                        float   width2     = Program._r.Level == 3 ? 125 * 6 / 2 :
                                             Program._r.Level == 2 ? 125 * 5 / 2 :
                                             125 * 4 / 2;
                        var Rect2 = new LeagueSharp.Common.Geometry.Polygon.Rectangle(start2, end2, width2 - 100);
                        if (Rect2.IsInside(target.Position) && Rect2.IsInside(predicted2))
                        {
                            var timetime = ((Vector2)posW).LSDistance(Player.Position) * 1000 / 1700;
                            Program._w.Cast(Player.Position.LSTo2D().LSExtend((Vector2)posW, Program._w.Range));
                            LeagueSharp.Common.Utility.DelayAction.Add(0, () => Program._e.Cast((Vector2)posW));
                            LeagueSharp.Common.Utility.DelayAction.Add((int)timetime + 300 - 150 - Program.EQdelay, () => Program._q2.Cast(target.Position));
                            LastJump = Environment.TickCount;
                            return;
                        }
                    }
                    if (Program._q2.IsReady() && target.LSDistance((Vector2)posW) <= 875 - 100)
                    {
                        var     time       = (Player.LSDistance((Vector2)posW) + ((Vector2)posW).LSDistance(target.Position)) / 1700f + 0.3f;
                        var     predicted2 = LeagueSharp.Common.Prediction.GetPrediction(target, time).UnitPosition;
                        Vector2 start2     = target.Position.LSTo2D().LSExtend(InsecPoint.LSTo2D(), -300);
                        Vector2 end2       = start2.LSExtend(InsecPoint.LSTo2D(), 750);
                        float   width2     = Program._r.Level == 3 ? 125 * 6 / 2 :
                                             Program._r.Level == 2 ? 125 * 5 / 2 :
                                             125 * 4 / 2;
                        var Rect2 = new LeagueSharp.Common.Geometry.Polygon.Rectangle(start2, end2, width2 - 100);
                        if (Rect2.IsInside(target.Position) && Rect2.IsInside(predicted2))
                        {
                            var timetime = ((Vector2)posW).LSDistance(Player.Position) * 1000 / 1700;
                            Program._w.Cast(Player.Position.LSTo2D().LSExtend((Vector2)posW, Program._w.Range));
                            LeagueSharp.Common.Utility.DelayAction.Add(0, () => Program._e.Cast((Vector2)posW));
                            LeagueSharp.Common.Utility.DelayAction.Add((int)timetime + 300 - 150 - Program.EQdelay, () => Program._q2.Cast(target.Position));
                            LastJump = Environment.TickCount;
                            return;
                        }
                    }
                }
            }
        }
Пример #19
0
        /// <summary>
        ///     Called when the game updates
        /// </summary>
        /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
        private static void OnUpdate(EventArgs args)
        {
            try
            {
                if (Player.IsDead)
                {
                    return;
                }

                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                {
                    OnCombo();
                }

                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
                {
                    OnHarass();
                }

                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear))
                {
                    OnLaneclear();
                    OnJungleclear();
                }

                if (getCheckBoxItem(ksMenu, "Killsteal.Active"))
                {
                    OnKillsteal();
                }

                if (getCheckBoxItem(ksMenu, "Ignite"))
                {
                    HandleIgnite();
                }

                if (getCheckBoxItem(miscMenu, "Misc.Auto.W"))
                {
                    if (HasPassive() && Player.GetEnemiesInRange(2000f).Count == 0)
                    {
                        W.Cast();
                    }
                }

                if (getCheckBoxItem(comboMenu, "Combo.R.Multiple"))
                {
                    float RDistance   = 1420;
                    float RWidth      = 120;
                    var   minREnemies = getSliderItem(comboMenu, "Combo.R.Count");
                    foreach (var enemy in HeroManager.Enemies)
                    {
                        var startPos  = enemy.ServerPosition;
                        var endPos    = Player.ServerPosition.LSExtend(startPos, Player.LSDistance(enemy) + RDistance);
                        var rectangle = new Geometry.Polygon.Rectangle(startPos, endPos, RWidth);

                        if (HeroManager.Enemies.Count(x => rectangle.IsInside(x)) >= minREnemies)
                        {
                            R.Cast(enemy);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Пример #20
0
        private static void AutoKick()
        {
            if (getSliderItem(miscMenu, "LeeSin_AutoKick") == 0 || getKeyBindItem(miscMenu, "LeeSin_InsecKick")) return;

            var target =
                HeroManager.Enemies.Where(x => x.LSDistance(Player) < 375 && !x.IsDead && x.LSIsValidTarget(375))
                    .OrderBy(x => x.LSDistance(Player)).FirstOrDefault();
            if (target == null) return;

            var ultPoly = new LeagueSharp.Common.Geometry.Polygon.Rectangle(Player.ServerPosition,
                Player.ServerPosition.LSExtend(target.Position, 1100),
                target.BoundingRadius + 10);

            var count =
                HeroManager.Enemies.Where(x => x.LSDistance(Player) < 1100 && x.LSIsValidTarget(1100))
                    .Count(h => h.NetworkId != target.NetworkId && ultPoly.IsInside(h.ServerPosition));

            if (count >= getSliderItem(miscMenu, "LeeSin_AutoKick") && _R.IsReady())
            {
                _R.Cast(target);
            }
        }
Пример #21
0
        private void Cast_QE(string source, Obj_AI_Base target = null)
        {
            var qeTarget = TargetSelector.GetTarget(_qe.Range, TargetSelector.DamageType.Magical);
            if (qeTarget == null || !Q.IsReady() || !E.IsReady())
                return;

            var qTarget = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Magical);
            if (qTarget.IsValidTarget(E.Range))
            {
                var pred = Q.GetPrediction(qTarget);

                if (pred.Hitchance >= HitChanceManager.GetQEHitChance(source))
                {
                    Q.Cast(pred.CastPosition);
                    W.LastCastAttemptT = Utils.TickCount + 500;
                    _qe.LastCastAttemptT = Utils.TickCount;
                }
            }
            else
            {
                var startPos = Player.ServerPosition.To2D().Extend(qeTarget.ServerPosition.To2D(), Q.Range).To3D();
                double rangeLeft = 100 + (-0.6*Player.Distance(startPos) + 950);
                var endPos = startPos + Vector3.Normalize(startPos - Player.ServerPosition)*(float) rangeLeft;

                _qe.From = startPos;
                _qe.Delay = E.Delay + Q.Range / E.Speed;

                var qePred = _qe.GetPrediction(qeTarget);

                var poly = new Geometry.Polygon.Rectangle(startPos, endPos, _qe.Width);

                if (!poly.IsInside(qePred.UnitPosition))
                    return;

                poly.Draw(Color.LawnGreen);

                if (qePred.Hitchance >= HitChanceManager.GetQEHitChance(source))
                {
                    Q.Cast(startPos);
                    W.LastCastAttemptT = Utils.TickCount + 500;
                    _qe.LastCastAttemptT = Utils.TickCount;
                }
            }
        }
Пример #22
0
        protected override void Drawing_OnDraw(EventArgs args)
        {
            if (menu.Item("Draw_Disabled", true).GetValue<bool>())
                return;

            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 qTarget = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Magical);
                if (qTarget.IsValidTarget(E.Range))
                {
                    var pred = Q.GetPrediction(qTarget);

                    if (pred.Hitchance >= HitChanceManager.GetQEHitChance("Combo"))
                    {
                        var poly = new Geometry.Polygon.Rectangle(pred.CastPosition, Player.ServerPosition.Extend(pred.CastPosition, _qe.Range), _qe.Width);
                        poly.Draw(Color.LawnGreen);
                        var line = new Geometry.Polygon.Line(Player.Position, Player.ServerPosition.Extend(pred.CastPosition, _qe.Range));
                        line.Draw(Color.LawnGreen);
                        Render.Circle.DrawCircle(pred.CastPosition, Q.Width / 2, Color.Aquamarine);
                        Render.Circle.DrawCircle(Player.ServerPosition.Extend(pred.CastPosition, _qe.Range), Q.Width / 2, Color.SpringGreen);
                    }
                }
                else
                {
                    var startPos = Player.ServerPosition.To2D().Extend(qeTarget.ServerPosition.To2D(), Q.Range).To3D();
                    double rangeLeft = 100 + (-0.6 * Player.Distance(startPos) + 950);
                    var endPos = startPos + Vector3.Normalize(startPos - Player.ServerPosition) * (float)rangeLeft;

                    _qe.From = startPos;
                    _qe.Delay = E.Delay + Q.Range / E.Speed;

                    var qePred = _qe.GetPrediction(qeTarget);

                    var poly = new Geometry.Polygon.Rectangle(startPos, endPos, _qe.Width);

                    if (!poly.IsInside(qePred.UnitPosition))
                        return;

                    if (qePred.Hitchance >= HitChanceManager.GetQEHitChance("Combo"))
                    {
                        poly.Draw(Color.LawnGreen);
                        var line = new Geometry.Polygon.Line(Player.Position, endPos);
                        line.Draw(Color.LawnGreen);
                        Render.Circle.DrawCircle(startPos, Q.Width/2, Color.Aquamarine);
                        Render.Circle.DrawCircle(endPos, Q.Width/2, Color.SpringGreen);
                    }
                }
            }

            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!!!");
                }
            }
        }
Пример #23
0
        private void Cast_Q(Obj_AI_Hero forceTarget = null)
        {
            if (!Q.IsReady() || !PassiveCheck())
                return;

            var target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);

            if (forceTarget != null)
                target = forceTarget;

            if (target != null && target.IsValidTarget(Q.Range))
            {
                if (Q.Cast(target) == Spell.CastStates.SuccessfullyCasted)
                {
                    Q.LastCastAttemptT = Utils.TickCount;
                    return;
                }
            }

            target = TargetSelector.GetTarget(QExtend.Range, TargetSelector.DamageType.Physical);

            if (forceTarget != null)
                target = forceTarget;

            if (target == null || !menu.Item("UseQExtendCombo", true).GetValue<bool>())
                return;

            var pred = QExtend.GetPrediction(target, true);
            var collisions = MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly);

            if (!collisions.Any() || (!target.IsMoving && menu.Item("MovementCheck", true).GetValue<bool>()))
                return;

            foreach (var minion in collisions)
            {
                var poly = new Geometry.Polygon.Rectangle(Player.ServerPosition, Player.ServerPosition.Extend(minion.ServerPosition, QExtend.Range), QExtend.Width);

                if (poly.IsInside(pred.UnitPosition))
                {
                    if (Q.Cast(minion) == Spell.CastStates.SuccessfullyCasted)
                    {
                        Q.LastCastAttemptT = Utils.TickCount;
                        return;
                    }
                }
            }
        }
Пример #24
0
        public static void DrawBestLine(Spell spell, Spell spell2, int midPointRange, float extraPrerange = 1, bool wallCheck = true)
        {
            //---------------------------------MEC----------------------------
            int maxHit = 0;
            Vector3 start = Vector3.Zero;
            Vector3 end = Vector3.Zero;

            //loop one
            foreach (var target in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range)))
            {
                //loop 2
                var target1 = target;
                var target2 = target;
                foreach (var enemy in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target1.NetworkId
                    && x.Distance(target1.Position) < spell2.Range - 100).OrderByDescending(x => x.Distance(target2.Position)))
                {
                    int hit = 2;

                    var targetPred = Prediction.GetPrediction(target, spell.Delay);
                    var enemyPred = Prediction.GetPrediction(enemy, spell.Delay);

                    var midpoint = (enemyPred.CastPosition + targetPred.CastPosition) / 2;

                    var startpos = midpoint + Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange;
                    var endPos = midpoint - Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange;

                    Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(startpos, endPos, spell.Width);

                    if (!rec1.Points.Exists(Util.IsWall) && Player.CountEnemiesInRange(spell.Range + spell2.Range) > 2)
                    {
                        //loop 3
                        var target3 = target;
                        var enemy1 = enemy;
                        foreach (var enemy2 in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target3.NetworkId && x.NetworkId != enemy1.NetworkId && x.Distance(target3.Position) < spell2.Range))
                        {
                            var enemy2Pred = Prediction.GetPrediction(enemy2, spell.Delay);
                            Object[] obj = Util.VectorPointProjectionOnLineSegment(startpos.To2D(), endPos.To2D(), enemy2Pred.CastPosition.To2D());
                            var isOnseg = (bool)obj[2];
                            var pointLine = (Vector2)obj[1];

                            if (pointLine.Distance(enemy2Pred.CastPosition.To2D()) < spell.Width && isOnseg)
                            {
                                hit++;
                            }
                        }
                    }

                    if (hit > maxHit && hit > 1 && !rec1.Points.Exists(Util.IsWall))
                    {
                        maxHit = hit;
                        start = startpos;
                        end = endPos;
                    }
                }
            }

            if (maxHit >= 2)
            {
                Vector2 wts = Drawing.WorldToScreen(Player.Position);
                Drawing.DrawText(wts[0], wts[1], Color.Wheat, "Hit: " + maxHit);

                Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(start, end, spell.Width);
                rec1.Draw(Color.Blue, 4);
            }
            else {

                //-------------------------------Single---------------------------
                var target = TargetSelector.GetTarget(spell.Range + spell2.Range, TargetSelector.DamageType.Magical);

                if (target == null)
                    return;

                var vector1 = Player.ServerPosition + Vector3.Normalize(target.ServerPosition - Player.ServerPosition) * (spell.Range * extraPrerange);

                var pred = Prediction.GetPrediction(target, spell.Delay);
                Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(vector1, vector1.Extend(pred.CastPosition, spell2.Range), spell.Width);

                if (Player.ServerPosition.Distance(target.ServerPosition) < spell.Range)
                {
                    vector1 = pred.CastPosition.Extend(target.ServerPosition, spell2.Range * .3f);
                    Geometry.Polygon.Rectangle rec2 = new Geometry.Polygon.Rectangle(vector1, vector1.Extend(pred.CastPosition, spell2.Range), spell.Width);

                    if ((!rec2.Points.Exists(Util.IsWall) || !wallCheck) && pred.Hitchance >= HitChance.Medium && target.IsMoving)
                    {
                        Vector2 wts = Drawing.WorldToScreen(Player.Position);
                        Drawing.DrawText(wts[0], wts[1], Color.Wheat, "Hit: " + 1);

                        rec2.Draw(Color.Blue, 4);
                    }

                }
                else if (!rec1.Points.Exists(Util.IsWall) || !wallCheck)
                   {
                    //wall check
                    if (pred.Hitchance >= HitChance.High)
                    {
                        Vector2 wts = Drawing.WorldToScreen(Player.Position);
                        Drawing.DrawText(wts[0], wts[1], Color.Wheat, "Hit: " + 1);

                        rec1.Draw(Color.Blue, 4);
                    }
                }
            }
        }
Пример #25
0
        public static void DrawBestLine(Spell spell, Spell spell2, int midPointRange, float extraPrerange = 1, bool wallCheck = true)
        {
            //---------------------------------MEC----------------------------
            int     maxHit = 0;
            Vector3 start  = Vector3.Zero;
            Vector3 end    = Vector3.Zero;

            //loop one
            foreach (var target in ObjectManager.Get <Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range)))
            {
                //loop 2
                var target1 = target;
                var target2 = target;
                foreach (var enemy in ObjectManager.Get <Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target1.NetworkId &&
                                                                              x.Distance(target1.Position) < spell2.Range - 100).OrderByDescending(x => x.Distance(target2.Position)))
                {
                    int hit = 2;

                    var targetPred = Prediction.GetPrediction(target, spell.Delay);
                    var enemyPred  = Prediction.GetPrediction(enemy, spell.Delay);

                    var midpoint = (enemyPred.CastPosition + targetPred.CastPosition) / 2;

                    var startpos = midpoint + Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange;
                    var endPos   = midpoint - Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange;

                    Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(startpos, endPos, spell.Width);

                    if (!rec1.Points.Exists(Util.IsWall) && Player.CountEnemiesInRange(spell.Range + spell2.Range) > 2)
                    {
                        //loop 3
                        var target3 = target;
                        var enemy1  = enemy;
                        foreach (var enemy2 in ObjectManager.Get <Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target3.NetworkId && x.NetworkId != enemy1.NetworkId && x.Distance(target3.Position) < spell2.Range))
                        {
                            var      enemy2Pred = Prediction.GetPrediction(enemy2, spell.Delay);
                            Object[] obj        = Util.VectorPointProjectionOnLineSegment(startpos.To2D(), endPos.To2D(), enemy2Pred.CastPosition.To2D());
                            var      isOnseg    = (bool)obj[2];
                            var      pointLine  = (Vector2)obj[1];

                            if (pointLine.Distance(enemy2Pred.CastPosition.To2D()) < spell.Width && isOnseg)
                            {
                                hit++;
                            }
                        }
                    }

                    if (hit > maxHit && hit > 1 && !rec1.Points.Exists(Util.IsWall))
                    {
                        maxHit = hit;
                        start  = startpos;
                        end    = endPos;
                    }
                }
            }

            if (maxHit >= 2)
            {
                Vector2 wts = Drawing.WorldToScreen(Player.Position);
                Drawing.DrawText(wts[0], wts[1], Color.Wheat, "Hit: " + maxHit);

                Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(start, end, spell.Width);
                rec1.Draw(Color.Blue, 4);
            }
            else
            {
                //-------------------------------Single---------------------------
                var target = TargetSelector.GetTarget(spell.Range + spell2.Range, TargetSelector.DamageType.Magical);

                if (target == null)
                {
                    return;
                }

                var vector1 = Player.ServerPosition + Vector3.Normalize(target.ServerPosition - Player.ServerPosition) * (spell.Range * extraPrerange);

                var pred = Prediction.GetPrediction(target, spell.Delay);
                Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(vector1, vector1.Extend(pred.CastPosition, spell2.Range), spell.Width);

                if (Player.ServerPosition.Distance(target.ServerPosition) < spell.Range)
                {
                    vector1 = pred.CastPosition.Extend(target.ServerPosition, spell2.Range * .3f);
                    Geometry.Polygon.Rectangle rec2 = new Geometry.Polygon.Rectangle(vector1, vector1.Extend(pred.CastPosition, spell2.Range), spell.Width);

                    if ((!rec2.Points.Exists(Util.IsWall) || !wallCheck) && pred.Hitchance >= HitChance.Medium && target.IsMoving)
                    {
                        Vector2 wts = Drawing.WorldToScreen(Player.Position);
                        Drawing.DrawText(wts[0], wts[1], Color.Wheat, "Hit: " + 1);

                        rec2.Draw(Color.Blue, 4);
                    }
                }
                else if (!rec1.Points.Exists(Util.IsWall) || !wallCheck)
                {
                    //wall check
                    if (pred.Hitchance >= HitChance.High)
                    {
                        Vector2 wts = Drawing.WorldToScreen(Player.Position);
                        Drawing.DrawText(wts[0], wts[1], Color.Wheat, "Hit: " + 1);

                        rec1.Draw(Color.Blue, 4);
                    }
                }
            }
        }
Пример #26
0
        public static void CastBestLine(bool forceUlt, Spell spell, Spell spell2, int midPointRange, Menu menu, float extraPrerange = 1, bool wallCheck = true)
        {
            if (!spell.IsReady())
            {
                return;
            }

            int     maxHit = 0;
            Vector3 start  = Vector3.Zero;
            Vector3 end    = Vector3.Zero;

            //loop one
            foreach (var target in ObjectManager.Get <Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range)))
            {
                //loop 2
                var target1 = target;
                var target2 = target;
                foreach (var enemy in ObjectManager.Get <Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target1.NetworkId &&
                                                                              x.Distance(target1.Position) < spell2.Range - 100).OrderByDescending(x => x.Distance(target2.Position)))
                {
                    int hit = 2;

                    var targetPred = Prediction.GetPrediction(target, spell.Delay);
                    var enemyPred  = Prediction.GetPrediction(enemy, spell.Delay);

                    var midpoint = (enemyPred.CastPosition + targetPred.CastPosition) / 2;

                    var startpos = midpoint + Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange;
                    var endPos   = midpoint - Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange;

                    Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(startpos, endPos, spell.Width);

                    if (!rec1.Points.Exists(Util.IsWall) && Player.CountEnemiesInRange(spell.Range + spell2.Range) > 2)
                    {
                        //loop 3
                        var target3 = target;
                        var enemy1  = enemy;
                        foreach (var enemy2 in ObjectManager.Get <Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target3.NetworkId && x.NetworkId != enemy1.NetworkId && x.Distance(target3.Position) < 1000))
                        {
                            var      enemy2Pred = Prediction.GetPrediction(enemy2, spell.Delay);
                            Object[] obj        = Util.VectorPointProjectionOnLineSegment(startpos.To2D(), endPos.To2D(), enemy2Pred.CastPosition.To2D());
                            var      isOnseg    = (bool)obj[2];
                            var      pointLine  = (Vector2)obj[1];

                            if (pointLine.Distance(enemy2Pred.CastPosition.To2D()) < spell.Width && isOnseg)
                            {
                                hit++;
                            }
                        }
                    }

                    if (hit > maxHit && hit > 1 && !rec1.Points.Exists(Util.IsWall))
                    {
                        maxHit = hit;
                        start  = startpos;
                        end    = endPos;
                    }
                }
            }

            if (start != Vector3.Zero && end != Vector3.Zero && spell.IsReady())
            {
                spell2.UpdateSourcePosition(start, start);
                if (forceUlt)
                {
                    CastLineSpell(start, end);
                }
                if (menu.Item("ComboActive", true).GetValue <KeyBind>().Active&& maxHit >= menu.Item("Line_If_Enemy_Count_Combo", true).GetValue <Slider>().Value)
                {
                    CastLineSpell(start, end);
                }
                if (maxHit >= menu.Item("Line_If_Enemy_Count", true).GetValue <Slider>().Value)
                {
                    CastLineSpell(start, end);
                }
            }

            //check if only one target
            if (forceUlt)
            {
                CastSingleLine(spell, spell2, wallCheck, extraPrerange);
            }
        }
Пример #27
0
        private static void Drawing_OnDraw_ShowEnemyMinionsUnderAllyTurret(EventArgs args)
        {
            return;
            var myTurret = ObjectManager.Get<Obj_AI_Turret>().Find(t => t.IsAlly && !t.IsDead && t.Distance(ObjectManager.Player.Position) < 1500);
            if (myTurret == null)
            {
                return;
            }
            Render.Circle.DrawCircle(myTurret.Position, 850, Color.Black);

            var enemy = HeroManager.Enemies.Find(t => !t.IsDead && t.Distance(myTurret) < 3000);
            if (enemy == null)
            {
                return;
            }
            var tt = enemy.ServerPosition.Extend(myTurret.Position, +550);
            var startpos = enemy.Position;
            var endpos = tt;

            var x = new LeagueSharp.Common.Geometry.Polygon.Rectangle(startpos, endpos, 145);
            x.Draw(Color.Blue, 3);

            var otherEnemyObjects = ObjectManager.Get<Obj_AI_Base>().Where(o => o.IsEnemy && !o.IsDead && o.Distance(myTurret) < 900 && o.NetworkId != enemy.NetworkId && o.Health < myTurret.TotalAttackDamage * 2);

            if (otherEnemyObjects.Count() < 2 && tt.Distance(myTurret.Position) < 1550)
            {
                Insec();
                if (ObjectManager.Player.Position.Distance(InsecJumpPosition) < enemy.Position.Distance(InsecJumpPosition))
                {
                    R.CastOnUnit(enemy);
                }

                if (ObjectManager.Player.Position.Distance(InsecJumpPosition) < 200)
                {
                    R.CastOnUnit(enemy);
                }
            }

            /*
            {
                Render.Circle.DrawCircle(otherEnemyObjects.Position, otherEnemyObjects.BoundingRadius, Color.Aqua);
            }
            foreach (var enemies in ObjectManager.Get<Obj_AI_Base>().Where(o => o.IsEnemy && !o.IsDead))
            {
                
            }
           */
        

            //var insecKickWaveDistance = 650;
            //if (enemy)
            //var myTurret = ObjectManager.Get<Obj_AI_Turret>().Find(t => t.IsAlly && !t.IsDead && t.Distance(ObjectManager.Player.Position) < 950);
            //var closesturretEnemy = HeroManager.Enemies.Find(t => !t.IsDead && t.Distance(enemy.Position) > 950);
            //if (closesturretEnemy != null)
            //{
            //    Render.Circle.DrawCircle(closesturretEnemy.Position, 150f, Color.Black);
            //}


            //foreach (var turret in ObjectManager.Get<Obj_AI_Turret>())
            //{
                
            //}
        }
Пример #28
0
        private static void OnDoCastDelayedLC(GameObjectProcessSpellCastEventArgs args)
        {
            AAPassive = false;
            if (args.Target is Obj_AI_Minion && args.Target.IsValid)
            {
                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear) && Player.ManaPercent > LMinMana)
                {
                    var Minions = MinionManager.GetMinions(Orbwalking.GetRealAutoAttackRange(Player), MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.Health);
                    if (Minions[0].IsValid && Minions.Count != 0)
                    {
                        if (!LT) return;

                        if (E.IsReady() && !AAPassive && LE) E.Cast(Player.Position.LSExtend(Game.CursorPos, 70));
                        if (Q.IsReady() && (!E.IsReady() || (E.IsReady() && !LE)) && LQ != 0 && !AAPassive)
                        {
                            var QMinions = MinionManager.GetMinions(Q.Range);
                            var exminions = MinionManager.GetMinions(Q1.Range);
                            foreach (var Minion in QMinions)
                            {
                                var QHit = new Geometry.Polygon.Rectangle(Player.Position, Player.Position.LSExtend(Minion.Position, Q1.Range), Q1.Width);
                                if (exminions.Count(x => !QHit.IsOutside(x.Position.LSTo2D())) >= LQ)
                                {
                                    Q.Cast(Minion);
                                    break;
                                }
                            }
                        }
                        if ((!E.IsReady() || (E.IsReady() && !LE)) && (!Q.IsReady() || (Q.IsReady() && LQ == 0)) && LW && W.IsReady() && !AAPassive) W.Cast(Minions[0].Position);
                    }
                }
            }
        }
Пример #29
0
        private static void LaneClear()
        {
            if (Player.ManaPercent < LMinMana) return;

            if (Q.IsReady() && LHQ)
            {
                var extarget = TargetSelector.GetTarget(Q1.Range, DamageType.Physical);
                var Minions = MinionManager.GetMinions(Q.Range);
                foreach (var Minion in Minions)
                {
                    var QHit = new Geometry.Polygon.Rectangle(Player.Position, Player.Position.LSExtend(Minion.Position, Q1.Range), Q1.Width);
                    var QPred = Q1.GetPrediction(extarget);
                    if (!QHit.IsOutside(QPred.UnitPosition.LSTo2D()) && QPred.HitChance == EloBuddy.SDK.Enumerations.HitChance.High)
                    {
                        Q.Cast(Minion);
                        break;
                    }
                }
            }
        }
Пример #30
0
        private static void CastR(Obj_AI_Base target)
        {
            if (!spells[Spells.R].IsReady() || !target.LSIsValidTarget(spells[Spells.R].Range)
                || !getCheckBoxItem(cMenu, "ElLux.Combo.R") || target.IsZombie || target.IsDead)
            {
                return;
            }

            if (getCheckBoxItem(cMenu, "ElLux.Combo.R.AOE"))
            {
                const float LuxRDistance = 3340;
                const float LuxRWidth = 70;
                var minREnemies = getSliderItem(cMenu, "ElLux.Combo.R.Count")
            ;
                foreach (var enemy in HeroManager.Enemies)
                {
                    var startPos = enemy.ServerPosition;
                    var endPos = Player.ServerPosition.LSExtend(
                        startPos,
                        Player.Distance(enemy) + LuxRDistance);

                    var rectangle = new LeagueSharp.Common.Geometry.Polygon.Rectangle(startPos, endPos, LuxRWidth);
                    if (HeroManager.Enemies.Count(x => rectangle.IsInside(x)) >= minREnemies)
                    {
                        spells[Spells.R].Cast(enemy);
                    }
                }
            }

            if (getCheckBoxItem(cMenu, "ElLux.Combo.R.Rooted"))
            {
                if (target.HasBuff("LuxLightBindingMis"))
                {
                    var prediction = spells[Spells.Q].GetPrediction(target);
                    if (prediction.HitChance >= EloBuddy.SDK.Enumerations.HitChance.High)
                    {
                        spells[Spells.R].Cast(prediction.CastPosition);
                    }
                }
            }

            if (spells[Spells.R].GetDamage(target) > GetHealth(target) && getCheckBoxItem(cMenu, "ElLux.Combo.R.Kill"))
            {
                var prediction = spells[Spells.R].GetPrediction(target);
                if (prediction.HitChance >= EloBuddy.SDK.Enumerations.HitChance.High)
                {
                    spells[Spells.R].Cast(prediction.CastPosition);
                }
            }
        }
Пример #31
0
        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            PredictionInput input = null;

            if (sender.IsMe || sender.IsEnemy || !(sender is Obj_AI_Hero))
            {
                return;
            }
            if (!Spells.Contains(args.SData.Name) || Config.SubMenu("AutoCombo_Spells").Item(args.SData.Name).GetValue <bool>() == false)
            {
                return;
            }
            var targetable = false;
            var line       = false;
            var aoe        = false;

            drawTime = Game.Time;

            var result = SpellDatabase.GetByName(args.SData.Name);

            if (result != null)
            {
                switch (result.Type)
                {
                case SkillShotType.SkillshotLine:
                    _skillshot = new Geometry.Polygon.Rectangle(sender.Position, sender.Position.Extend(args.End, result.Range), result.Radius);
                    line       = true;
                    break;

                case SkillShotType.SkillshotMissileLine:
                    _skillshot = new Geometry.Polygon.Rectangle(sender.Position, sender.Position.Extend(args.End, result.Range), result.Radius);
                    line       = true;
                    break;

                case SkillShotType.SkillshotCircle:
                    _skillshotAoe = new Geometry.Polygon.Circle(args.End, result.Radius);
                    aoe           = true;
                    break;

                case SkillShotType.SkillshotRing:
                    _skillshotAoe = new Geometry.Polygon.Circle(args.End, result.Radius);
                    aoe           = true;
                    break;
                }
            }

            foreach (
                var enemy in
                ObjectManager.Get <Obj_AI_Hero>()
                .Where(enemy => enemy.IsEnemy && enemy.Distance(Player) <= Config.SubMenu("AutoCombo").Item("Range").GetValue <Slider>().Value))
            {
                if (!aoe && !line && args.Target.Position == enemy.Position)
                {
                    targetable = true;
                }
                if (!aoe && !line && !targetable)
                {
                    continue;
                }
                //Game.PrintChat(sender.BaseSkinName + " Ultimate Damage is : " + Allydamage.CalculatedDamage);
                //Game.PrintChat("My Ultimate Damage is : " + Mydamage.CalculatedDamage);
                //Game.PrintChat("Total damage is : " + (Allydamage.CalculatedDamage + Mydamage.CalculatedDamage));

                if (Config.Item("Killable").GetValue <bool>())
                {
                    Allydamage = sender.GetDamageSpell(enemy, args.SData.Name);
                    Mydamage   = Player.GetDamageSpell(enemy, SpellSlot.R);

                    if ((Allydamage.CalculatedDamage + Mydamage.CalculatedDamage) < enemy.Health &&
                        Allydamage.CalculatedDamage > enemy.Health)
                    {
                        return;
                    }
                }

                if (line)
                {
                    input = new PredictionInput
                    {
                        Unit      = enemy,
                        Type      = SkillshotType.SkillshotLine,
                        Speed     = result.MissileSpeed,
                        From      = sender.Position,
                        Delay     = result.Delay,
                        Aoe       = false,
                        Radius    = result.Radius,
                        Range     = result.Range,
                        Collision = false
                    };
                }
                else
                {
                    if (aoe)
                    {
                        input = new PredictionInput
                        {
                            Unit      = enemy,
                            Type      = SkillshotType.SkillshotCircle,
                            Speed     = result.MissileSpeed,
                            From      = sender.Position,
                            Delay     = result.Delay,
                            Aoe       = true,
                            Radius    = result.Radius,
                            Range     = result.Range,
                            Collision = false
                        };
                    }
                }
                if (!targetable)
                {
                    var output = Prediction.GetPrediction(input);
                    var unit   = output.CastPosition;
                    if (line)
                    {
                        if (!_skillshot.IsInside(unit) && !_skillshot.IsInside(enemy))
                        {
                            continue;
                        }
                    }
                    else
                    {
                        if (!_skillshotAoe.IsInside(unit) && !_skillshotAoe.IsInside(enemy))
                        {
                            continue;
                        }
                    }
                }

                R.Cast(enemy.Position);
                if (enemy.Distance(Player.Position) <= Config.SubMenu("AutoCombo").Item("Range").GetValue <Slider>().Value)
                {
                    R.Cast(enemy);
                    R.CastOnUnit(enemy);
                }
            }
        }
Пример #32
0
        public static void Game_OnGameLoad()
        {
            if (Player.ChampionName != "Fizz") return;
            Q = new Spell(SpellSlot.Q, 550);
            W = new Spell(SpellSlot.W, Orbwalking.GetRealAutoAttackRange(Player));
            E = new Spell(SpellSlot.E, 400);
            R = new Spell(SpellSlot.R, 1300);
            F = new Spell(Player.GetSpellSlot("summonerflash"), 425);
            D = new Spell(Player.GetSpellSlot("summonerignite"), 600);
            I = new Spell(Player.GetSpellSlot("summonersmite"), 500);

            E.SetSkillshot(0.25f, 330, float.MaxValue, false, SkillshotType.SkillshotCircle);
            R.SetSkillshot(0.25f, 80, 1300, true, SkillshotType.SkillshotLine);

            RRectangle = new Geometry.Polygon.Rectangle(Player.Position, Player.Position, 300);

            Menu = MainMenu.AddMenu(Player.ChampionName, Player.ChampionName);

            //Combo Menu
            comboMenu = Menu.AddSubMenu("Combo", "Combo");
            comboMenu.Add("ComboMode",
                new ComboBox("Combo mode", 0, "R to gapclose", "R in dash range", "R after dash", "R on dash"));
            comboMenu.Add("HitChancewR", new ComboBox("R hitchance", 2, "Medium", "High", "Very High"));
            comboMenu.Add("targetMinHPforR", new Slider("Minimum enemy HP(in %) to use R", 35));
            comboMenu.Add("useZhonya", new CheckBox("Use Zhonya in combo (Recommended for lategame)"));
            comboMenu.Add("useQcombo", new CheckBox("Use Q in combo"));
            comboMenu.Add("useWcombo", new CheckBox("Use W in combo"));
            comboMenu.Add("useEcombo", new CheckBox("Use E in combo"));
            comboMenu.Add("UseEOnlyAfterAA", new CheckBox("Use E only after an autoattack", false));
            comboMenu.Add("useRcombo", new CheckBox("Use R in combo"));

            //Harass Menu
            harassMenu = Menu.AddSubMenu("Harass", "Harass");
            harassMenu.Add("harassEMode",
                new ComboBox("E mode", 0, "E to mouse position", "E to hit the enemy", "E to comeback",
                    "E twice to comeback"));
            harassMenu.Add("useharassQ", new CheckBox("Use Q to harass"));
            harassMenu.Add("useharassW", new CheckBox("Use W to harass"));
            harassMenu.Add("useharassE", new CheckBox("Use E to harass"));
            harassMenu.Add("harassmana", new Slider("Minimum mana to harass in %"));
            harassMenu.Add("useEWQ", new CheckBox("Harass with EE(W)Q Combo", false));

            //LaneClear Menu
            laneClearMenu = Menu.AddSubMenu("Laneclear", "Laneclear");
            laneClearMenu.Add("laneclearQ", new CheckBox("Use Q to laneclear", false));
            laneClearMenu.Add("laneclearW", new CheckBox("Use W to laneclear", false));
            laneClearMenu.Add("laneclearE", new CheckBox("Use E to laneclear", false));
            laneClearMenu.Add("lanemana", new Slider("Minimum mana to farm in %"));

            //JungleClear Menu
            jungleClearMenu = Menu.AddSubMenu("Jungleclear", "Jungleclear");
            jungleClearMenu.Add("jungleclearQ", new CheckBox("Use Q to jungleclear", false));
            jungleClearMenu.Add("jungleclearW", new CheckBox("Use W to jungleclear", false));
            jungleClearMenu.Add("jungleclearE", new CheckBox("Use E to jungleclear", false));
            jungleClearMenu.Add("junglemana", new Slider("Minimum mana to jungleclear in %"));

            //CustomCombo Menu
            customComboMenu = Menu.AddSubMenu("Custom Combo's (require a selected target!)", "CustomCombo");
            customComboMenu.AddGroupLabel("How to use CustomCombo's :");
            customComboMenu.AddGroupLabel("1) Make sure every spells used in the combo are up.");
            customComboMenu.AddGroupLabel("2) Select your Target.");
            customComboMenu.AddGroupLabel("3) Press combo key until every spells are used.");
            customComboMenu.AddGroupLabel("4) Press space key afterwards for ideal follow up.");
            customComboMenu.Add("lateGameZhonyaCombo",
                new KeyBind("EE to gapclose RWQ zhonya", false, KeyBind.BindTypes.HoldActive, 'G'));
            customComboMenu.Add("lateGameZhonyaComboZhonya", new CheckBox("Use Zhonya with EE to gapclose RWQ"));
            customComboMenu.Add("QminionREWCombo",
                new KeyBind("Q laneminion/camp/champion to gapclose REW", false, KeyBind.BindTypes.HoldActive, 'H'));
            customComboMenu.Add("EFlashCombo",
                new KeyBind("E Flash on target RWQ zhonya", false, KeyBind.BindTypes.HoldActive, 'J'));
            customComboMenu.Add("EFlashComboZhonya", new CheckBox("Use Zhonya with E Flash on target RWQ"));
            customComboMenu.Add("Flee",
                new KeyBind("Flee Key (Flee does not require a target)", false, KeyBind.BindTypes.HoldActive, 'Q'));
            customComboMenu.Add("manualR", new KeyBind("Auto cast R key", false, KeyBind.BindTypes.HoldActive, 'K'));
            customComboMenu.Add("manualRHitchance",
                new ComboBox("Auto cast R hitchance", 2, "Medium", "High", "Very High"));

            //Drawings Menu
            drawingsMenu = Menu.AddSubMenu("Drawings", "Drawings");
            drawingsMenu.Add("drawComboDamage", new CheckBox("Draw the predicted damage on target", false));
            drawingsMenu.Add("drawQ", new CheckBox("Draw Q range", false));
            drawingsMenu.Add("drawE", new CheckBox("Draw E range", false));
            drawingsMenu.Add("drawEMax", new CheckBox("Draw E maximum range", false));
            drawingsMenu.Add("drawRr", new CheckBox("Draw R range", false));
            drawingsMenu.Add("drawMinionQCombo",
                new CheckBox("Draw QminionREWCombo helper (Selected Target Only)", false));
            drawingsMenu.Add("drawR", new CheckBox("Draw R prediction (Selected Target Only)", false));
            drawingsMenu.Add("drawRHitChance",
                new CheckBox("Draw Hitchance status text of R (Selected Target Only)", false));
            drawingsMenu.Add("drawRHitChanceX",
                new Slider("X screen position of the Hitchance status text", 450, 0, 2000));
            drawingsMenu.Add("drawRHitChanceY",
                new Slider("Y screen position of the Hitchance status text", 200, 0, 2000));

            hydra = new Items.Item(3074, 185);
            tiamat = new Items.Item(3077, 185);
            cutlass = new Items.Item(3144, 450);
            botrk = new Items.Item(3153, 450);
            hextech = new Items.Item(3146, 700);
            zhonya = new Items.Item(3157);
            Random = new Random();
            harassQCastedPosition = Player.Position;

            Obj_AI_Base.OnSpellCast += Obj_AI_Base_OnSpellCast;
            Game.OnUpdate += OnUpdate;
            Drawing.OnDraw += OnDraw;
        }
Пример #33
0
        private void CastQ(string source)
        {
            if (!Q.IsReady())
                return;

            var target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);

            if (target != null && target.IsValidTarget(Q.Range))
            {
                SpellCastManager.CastBasicSkillShot(Q, Q.Range, TargetSelector.DamageType.Magical, HitChanceManager.GetQHitChance(source));
            }

            target = TargetSelector.GetTarget(QExtend.Range, TargetSelector.DamageType.Physical);

            if (target == null)
                return;

            var pred = QExtend.GetPrediction(target, true);
            var collisions = MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly);

            if (!collisions.Any())
                return;

            foreach (var minion in collisions)
            {
                var poly = new Geometry.Polygon.Rectangle(Player.ServerPosition, Player.ServerPosition.Extend(minion.ServerPosition, QExtend.Range), QExtend.Width);

                if (poly.IsInside(pred.UnitPosition))
                {
                    if (Q.Cast(minion) == Spell.CastStates.SuccessfullyCasted)
                    {
                        Q.LastCastAttemptT = Utils.TickCount;
                        return;
                    }
                }
            }
        }
Пример #34
0
        private static void OnProcessSpell(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {

                if (args.Target is Obj_AI_Minion || !(sender is AIHeroClient))
                    return;
                if (getCheckBoxItem(miscMenu, "Janna_AutoE"))
                {
                    if (sender.IsEnemy)
                    {
                        var StartPos = args.Start;
                        var EndPos = args.End;
                        var NonTRange = new LeagueSharp.Common.Geometry.Polygon.Rectangle(StartPos, EndPos, sender.BoundingRadius + 30);
                        var Target = HeroManager.Allies.FirstOrDefault(f => f.Position.LSDistance(Player.Position) <= _E.Range && NonTRange.IsInside(f.Position));
                        if (Target == Player && getCheckBoxItem(miscMenu, "Janna_AutoE1")) return;
                        if (Target != null)
                        {
                            _E.CastOnUnit(Target, true);
                            return;
                        }
                        if (args.Target != null && args.Target.Position.LSDistance(Player.Position) <= _E.Range && args.Target is AIHeroClient)
                        {
                            var ShieldTarget = HeroManager.Allies.FirstOrDefault(f => f.Position.LSDistance(args.Target.Position) <= 10);
                            _E.CastOnUnit(ShieldTarget, true);
                            return;
                        }
                    }
                    if (sender.IsAlly && args.Target is AIHeroClient)
                    {
                        if (sender.Position.LSDistance(Player.Position) <= _E.Range && args.Target != null && args.SData.Name.ToLower().Contains("attack"))
                        {
                            _E.CastOnUnit(sender, true);
                            return;
                        }
                    }
                }
            }
            catch (Exception)
            {
                if (NowTime() > ErrorTime)
                {
                    Chat.Print(ChampName + " in FreshBooster isn't Load. Error Code 08");
                    ErrorTime = TickCount(10000);
                }
            }

        }
Пример #35
0
        protected override void Drawing_OnDraw(EventArgs args)
        {
            if (Menu.Item("Draw_Disabled", true).GetValue <bool>())
            {
                return;
            }

            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, SpellManager.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);
            }

            if (Menu.Item("Draw_QE_Line", true).GetValue <bool>())
            {
                var qeTarget = TargetSelector.GetTarget(SpellManager.QE.Range, TargetSelector.DamageType.Magical);

                if (qeTarget == null || !Q.IsReady() || !E.IsReady())
                {
                    return;
                }

                var qTarget = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Magical);

                if (qTarget.IsValidTarget(E.Range))
                {
                    var pred = Q.GetPrediction(qTarget);

                    if (pred.Hitchance >= HitChance.VeryHigh)
                    {
                        var poly = new Geometry.Polygon.Rectangle(pred.CastPosition, Player.ServerPosition.Extend(pred.CastPosition, SpellManager.QE.Range), SpellManager.QE.Width);
                        poly.Draw(Color.LawnGreen);

                        var line = new Geometry.Polygon.Line(Player.Position, Player.ServerPosition.Extend(pred.CastPosition, SpellManager.QE.Range));
                        line.Draw(Color.LawnGreen);

                        Render.Circle.DrawCircle(pred.CastPosition, Q.Width / 2, Color.Aquamarine);
                        Render.Circle.DrawCircle(Player.ServerPosition.Extend(pred.CastPosition, SpellManager.QE.Range), Q.Width / 2, Color.SpringGreen);
                    }
                }
                else
                {
                    var startPos  = Player.ServerPosition.To2D().Extend(qeTarget.ServerPosition.To2D(), Q.Range).To3D();
                    var rangeLeft = 100 + (-0.6 * Player.Distance(startPos) + 950);
                    var endPos    = startPos + Vector3.Normalize(startPos - Player.ServerPosition) * (float)rangeLeft;

                    SpellManager.QE.From  = startPos;
                    SpellManager.QE.Delay = E.Delay + Q.Range / E.Speed;

                    var qePred = SpellManager.QE.GetPrediction(qeTarget);
                    var poly   = new Geometry.Polygon.Rectangle(startPos, endPos, SpellManager.QE.Width);

                    if (!poly.IsInside(qePred.UnitPosition))
                    {
                        return;
                    }

                    if (qePred.Hitchance >= HitChance.VeryHigh)
                    {
                        poly.Draw(Color.LawnGreen);

                        var line = new Geometry.Polygon.Line(Player.Position, endPos);
                        line.Draw(Color.LawnGreen);

                        Render.Circle.DrawCircle(startPos, Q.Width / 2, Color.Aquamarine);
                        Render.Circle.DrawCircle(endPos, Q.Width / 2, Color.SpringGreen);
                    }
                }
            }

            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!!!");
                }
            }
        }
Пример #36
0
        private static void OnSpells(EventArgs args)
        {
            if (Player.IsDead) return;
            if (ultPoly != null)
            {
                ultPoly.UpdatePolygon();
                ultPoly.Draw(Color.Red);
            }

                if (RCombo != null) Render.Circle.DrawCircle((Vector3) RCombo, 100, Color.Red, 5, true);

            if (!GetBool("spellsdraw", typeof (bool))) return;
            if (!GetBool("ovdrawings", typeof (bool))) return;
            if (GetBool("qrange", typeof (bool)) && Q.Level > 0)
            {
                var color = Q.IsReady() ? Color.DodgerBlue : Color.Red;
                Render.Circle.DrawCircle(Player.Position, Q.Range, color);
            }

            if (GetBool("wrange", typeof (bool)) && W.Level > 0)
            {
                var colorw = W.IsReady() ? Color.BlueViolet : Color.Red;
                Render.Circle.DrawCircle(Player.Position, W.Range, colorw);
            }

            if (GetBool("erange", typeof (bool)) && E.Level > 0)
            {
                var colore = E.IsReady() ? Color.Plum : Color.Red;
                Render.Circle.DrawCircle(Player.Position, E.Range, colore);
            }

            if (GetBool("rrange", typeof (bool)) && R.Level > 0)
            {
                var colorr = R.IsReady() ? Color.LawnGreen : Color.Red;
                Render.Circle.DrawCircle(Player.Position, R.Range, colorr);
            }
            var target =
                HeroManager.Enemies.Where(x => x.Distance(Player) < R.Range && !x.IsDead && x.IsValidTarget(R.Range))
                    .OrderBy(x => x.Distance(Player)).FirstOrDefault();
            if (target == null || Player.IsDead)
            {
                ultPoly = null;
                ultPolyExpectedPos = null;
                return;
            }

            ultPoly = new Geometry.Polygon.Rectangle(Player.ServerPosition,
                Player.ServerPosition.Extend(target.Position, 1100),
                target.BoundingRadius + 20);

            var counts =
                HeroManager.Enemies.Where(x => x.Distance(Player) < 1200 && x.IsValidTarget(1200))
                    .Count(h => h.NetworkId != target.NetworkId && ultPoly.IsInside(h.ServerPosition));

            Drawing.DrawText(Drawing.WorldToScreen(Player.Position).X, Drawing.WorldToScreen(Player.Position).Y,
                Color.Magenta, "Ult Will Hit " + counts);
        }
Пример #37
0
 private static void Game_OnUpdate(EventArgs args)
 {
     switch (Program.insecmode)
     {
         case 0:
             var hero = HeroManager.Allies.Where(x => !x.IsMe && !x.IsDead)
                 .OrderByDescending(x => x.LSDistance(Player.Position)).LastOrDefault();
             if (hero != null)
                 InsecPoint = hero.Position;
             break;
         case 1:
             var turret = GameObjects.AllyTurrets.OrderByDescending(x => x.LSDistance(Player.Position)).LastOrDefault();
             if (turret != null)
                 InsecPoint = turret.Position;
             break;
         case 2:
             InsecPoint = Game.CursorPos;
             break;
         case 3:
             InsecPoint = LastLeftClick;
             break;
     }
     if (!Program.insec)
         return;
     if (Orbwalker.CanMove)
     {
         Orbwalker.MoveTo(Game.CursorPos);
     }
     if (!InsecPoint.IsValid())
         return;
     var target = TargetSelector.SelectedTarget;
     if (!target.LSIsValidTarget() || target.IsZombie)
         return;
     if (!Program._r2.IsReady())
         return;
     //case 1
     Vector2 start1 = Player.Position.LSTo2D().LSExtend(InsecPoint.LSTo2D(), -300);
     Vector2 end1 = start1.LSExtend(Player.Position.LSTo2D(), 750);
     float width1 = Program._r.Level == 3 ? 125 * 6 / 2 :
                 Program._r.Level == 2 ? 125 * 5 / 2 :
                 125 * 4 / 2;
     var Rect1 = new LeagueSharp.Common.Geometry.Polygon.Rectangle(start1, end1, width1 - 100);
     var Predicted1 = LeagueSharp.Common.Prediction.GetPrediction(target, Game.Ping / 1000f + 0.25f).UnitPosition;
     if (Rect1.IsInside(target.Position) && Rect1.IsInside(Predicted1))
     {
         Program._r2.Cast(InsecPoint);
         return;
     }
     if (Environment.TickCount - LastJump < 1500)
         return;
     if (!Program._e.IsReady())
         return;
     //case 2
     var sold2 = Soldiers.soldier
             .Where(x => Player.LSDistance(x.Position) <= 1100)
             .OrderBy(x => x.Position.LSDistance(target.Position)).FirstOrDefault();
     if (sold2 != null)
     {
         if (!Program._q2.IsReady())
         {
             var time = Player.Position.LSDistance(sold2.Position) / 1700f;
             var predicted2 = LeagueSharp.Common.Prediction.GetPrediction(target, time).UnitPosition;
             Vector2 start2 = sold2.Position.LSTo2D().LSExtend(InsecPoint.LSTo2D(), -300);
             Vector2 end2 = start2.LSExtend(InsecPoint.LSTo2D(), 750);
             float width2 = Program._r.Level == 3 ? 125 * 6 / 2 :
                         Program._r.Level == 2 ? 125 * 5 / 2 :
                         125 * 4 / 2;
             var Rect2 = new LeagueSharp.Common.Geometry.Polygon.Rectangle(start2, end2, width2 - 100);
             if (Rect2.IsInside(target.Position) && Rect2.IsInside(predicted2))
             {
                 Program._e.Cast(sold2.Position);
                 LastJump = Environment.TickCount;
                 return;
             }
         }
         if (Program._q2.IsReady() && target.LSDistance(sold2.Position) <= 875 - 100)
         {
             var time = (Player.LSDistance(sold2.Position) + sold2.Position.LSDistance(target.Position)) / 1700f;
             var predicted2 = LeagueSharp.Common.Prediction.GetPrediction(target, time).UnitPosition;
             Vector2 start2 = target.Position.LSTo2D().LSExtend(InsecPoint.LSTo2D(), -300);
             Vector2 end2 = start2.LSExtend(InsecPoint.LSTo2D(), 750);
             float width2 = Program._r.Level == 3 ? 125 * 6 / 2 :
                         Program._r.Level == 2 ? 125 * 5 / 2 :
                         125 * 4 / 2;
             var Rect2 = new LeagueSharp.Common.Geometry.Polygon.Rectangle(start2, end2, width2 - 100);
             if (Rect2.IsInside(target.Position) && Rect2.IsInside(predicted2))
             {
                 var timetime = sold2.Position.LSDistance(Player.Position) * 1000 / 1700;
                 Program._e.Cast(sold2.Position);
                 LeagueSharp.Common.Utility.DelayAction.Add((int)timetime - 150 - Program.EQdelay, () => Program._q2.Cast(target.Position));
                 LastJump = Environment.TickCount;
                 return;
             }
         }
     }
     if(Program._w.IsReady())
     {
         var posWs = GeoAndExten.GetWsPosition(target.Position.LSTo2D()).Where(x => x != null);
         foreach (var posW in posWs)
         {
             if (!Program._q2.IsReady())
             {
                 var time = Player.Position.LSTo2D().LSDistance((Vector2)posW) / 1700f + 0.3f;
                 var predicted2 = LeagueSharp.Common.Prediction.GetPrediction(target, time).UnitPosition;
                 Vector2 start2 = ((Vector2)posW).LSExtend(InsecPoint.LSTo2D(), -300);
                 Vector2 end2 = start2.LSExtend(InsecPoint.LSTo2D(), 750);
                 float width2 = Program._r.Level == 3 ? 125 * 6 / 2 :
                             Program._r.Level == 2 ? 125 * 5 / 2 :
                             125 * 4 / 2;
                 var Rect2 = new LeagueSharp.Common.Geometry.Polygon.Rectangle(start2, end2, width2 - 100);
                 if (Rect2.IsInside(target.Position) && Rect2.IsInside(predicted2))
                 {
                     var timetime = ((Vector2)posW).LSDistance(Player.Position) * 1000 / 1700;
                     Program._w.Cast(Player.Position.LSTo2D().LSExtend((Vector2)posW, Program._w.Range));
                     LeagueSharp.Common.Utility.DelayAction.Add(0, () => Program._e.Cast((Vector2)posW));
                     LeagueSharp.Common.Utility.DelayAction.Add((int)timetime + 300 - 150 - Program.EQdelay, () => Program._q2.Cast(target.Position));
                     LastJump = Environment.TickCount;
                     return;
                 }
             }
             if (Program._q2.IsReady() && target.LSDistance((Vector2)posW) <= 875 - 100)
             {
                 var time = (Player.LSDistance((Vector2)posW) + ((Vector2)posW).LSDistance(target.Position)) / 1700f + 0.3f;
                 var predicted2 = LeagueSharp.Common.Prediction.GetPrediction(target, time).UnitPosition;
                 Vector2 start2 = target.Position.LSTo2D().LSExtend(InsecPoint.LSTo2D(), -300);
                 Vector2 end2 = start2.LSExtend(InsecPoint.LSTo2D(), 750);
                 float width2 = Program._r.Level == 3 ? 125 * 6 / 2 :
                             Program._r.Level == 2 ? 125 * 5 / 2 :
                             125 * 4 / 2;
                 var Rect2 = new LeagueSharp.Common.Geometry.Polygon.Rectangle(start2, end2, width2 - 100);
                 if (Rect2.IsInside(target.Position) && Rect2.IsInside(predicted2))
                 {
                     var timetime = ((Vector2)posW).LSDistance(Player.Position) * 1000 / 1700;
                     Program._w.Cast(Player.Position.LSTo2D().LSExtend((Vector2)posW, Program._w.Range));
                     LeagueSharp.Common.Utility.DelayAction.Add(0, () => Program._e.Cast((Vector2)posW));
                     LeagueSharp.Common.Utility.DelayAction.Add((int)timetime + 300 - 150 - Program.EQdelay, () => Program._q2.Cast(target.Position));
                     LastJump = Environment.TickCount;
                     return;
                 }
             }
         }
     }
 }
Пример #38
0
        private static void AutoUlt()
        {
            // Hoes code below
            var target =
                HeroManager.Enemies.Where(x => x.Distance(Player) < R.Range && !x.IsDead && x.IsValidTarget(R.Range))
                    .OrderBy(x => x.Distance(Player)).FirstOrDefault();
            if (target == null || Player.IsDead)
            {
                ultPoly = null;
                ultPolyExpectedPos = null;
                return;
            }

            ultPoly = new Geometry.Polygon.Rectangle(Player.ServerPosition,
                Player.ServerPosition.Extend(target.Position, 1100),
                target.BoundingRadius + 10);

            var counts =
                HeroManager.Enemies.Where(x => x.Distance(Player) < 1100 && x.IsValidTarget(1100))
                    .Count(h => h.NetworkId != target.NetworkId && ultPoly.IsInside(h.ServerPosition));

            if (counts >= GetValue("autoron") && R.IsReady())
            {
                R.Cast(target);
            }

            //// HyunMi code here
            //var enemies = Playerpos.GetEnemiesInRange(2800);
            //byte minEnemHitConstraint = (byte)Config.Item("xeminhit").GetValue<Slider>().Value;

            //if (enemies.Count < minEnemHitConstraint) return;

            //bool xeallowFlash = Config.Item("xeflash").GetValue<bool>();
            //bool allowWard = Config.Item("xeward").GetValue<bool>();

            //bool canUseWard = false, canUseFlash = false;
            //if (FlashSlot.IsReady() && FlashSlot != SpellSlot.Unknown && xeallowFlash)
            //{
            //    canUseFlash = true;
            //}

            ////TODO: check if player has a ward and w is ready if so canUseWard == true only if AllowWard = true
        }
Пример #39
0
        /// <summary>
        ///     Called when the game updates
        /// </summary>
        /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
        private static void OnUpdate(EventArgs args)
        {
            try
            {
                if (Player.IsDead)
                {
                    return;
                }

                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                {
                    OnCombo();
                }

                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
                {
                    OnHarass();
                }

                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) ||
                    Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear))
                {
                    OnLaneclear();
                    OnJungleclear();
                }

                if (getCheckBoxItem(ksMenu, "Killsteal.Active"))
                {
                    OnKillsteal();
                }

                if (getCheckBoxItem(ksMenu, "Ignite"))
                {
                    HandleIgnite();
                }

                if (getCheckBoxItem(miscMenu, "Misc.Auto.W"))
                {
                    if (HasPassive() && Player.GetEnemiesInRange(2000f).Count == 0)
                    {
                        W.Cast();
                    }
                }

                if (getCheckBoxItem(comboMenu, "Combo.R.Multiple"))
                {
                    float RDistance = 1420;
                    float RWidth = 120;
                    var minREnemies = getSliderItem(comboMenu, "Combo.R.Count");
                    foreach (var enemy in HeroManager.Enemies)
                    {
                        var startPos = enemy.ServerPosition;
                        var endPos = Player.ServerPosition.LSExtend(startPos, Player.Distance(enemy) + RDistance);
                        var rectangle = new Geometry.Polygon.Rectangle(startPos, endPos, RWidth);

                        if (HeroManager.Enemies.Count(x => rectangle.IsInside(x)) >= minREnemies)
                        {
                            R.Cast(enemy);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Пример #40
0
        private static void Combo()
        {
            #region R combos

            var unit =
                HeroManager.Enemies.Where(x => x.Distance(Player) < 500 && !x.IsDead && x.IsValidTarget(500) && x.Health < R.GetDamage(x) + 50)
                    .OrderBy(x => x.Distance(Player)).FirstOrDefault();
            if (unit != null)
            {
                foreach (
                    var targets in
                        HeroManager.Enemies.Where(
                            x =>
                                !x.IsDead && x.IsValidTarget() && x.IsVisible && x.Distance(unit) < 1000 && x.Distance(unit) > 300 &&
                                x.NetworkId != unit.NetworkId && x.Health < R.GetDamage(x)))
                {
                    var prediction = Prediction.GetPrediction(targets, 0.1f);

                    var pos = prediction.UnitPosition.Extend(unit.ServerPosition,
                        prediction.UnitPosition.Distance(unit.ServerPosition) + 250);

                    RCombo = pos;

                    var slot = Items.GetWardSlot();
                    if (unit.Distance(Player) > 500)
                    {
                        RCombo = null;
                    }

                    if (W.IsReady() && R.IsReady() && Player.ServerPosition.Distance(unit.ServerPosition) < 500
                        && slot != null)
                    {
                        if (!_processw &&
                            Player.GetSpell(SpellSlot.W).Name == "BlindMonkWOne")
                        {
                            Player.Spellbook.CastSpell(slot.SpellSlot, pos);
                            _lastwarr = Environment.TickCount;
                        }
                        if (Player.GetSpell(SpellSlot.W).Name == "blindmonkwtwo")
                        {
                            _lastwards = Environment.TickCount;
                        }
                    }
                }

                if (Player.IsDead)
                {
                    ultPoly = null;
                    ultPolyExpectedPos = null;
                    return;
                }

                ultPoly = new Geometry.Polygon.Rectangle(Player.ServerPosition,
                    Player.ServerPosition.Extend(unit.Position, 1100),
                    unit.BoundingRadius + 30);

                var counts =
                    HeroManager.Enemies.Where(x => x.Distance(Player) < 1100 && x.IsValidTarget(1100) && x.Health < R.GetDamage(x))
                        .Count(h => h.NetworkId != unit.NetworkId && ultPoly.IsInside(h.ServerPosition));

                if (counts >= 1 && R.IsReady() && created && R.IsReady())
                {
                    R.Cast(unit);
                }
            }

            #endregion

            #region Regular combo

            var target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);
            if (!target.IsValidTarget())
                return;

            var useq = GetBool("useq", typeof (bool));
            var usee = GetBool("usee", typeof (bool));
            var user = GetBool("user", typeof (bool));
            var usew = GetBool("wardjumpcombo", typeof (bool));
            var smite = GetBool("usessmite", typeof (bool));
            if (GetStringValue("hydrati") == 0 || GetStringValue("hydrati") == 2)
            {
                if (target.IsValidTarget(400) && (ItemReady(Tiamat) || ItemReady(Hydra)) &&
                    (HasItem(Tiamat) || HasItem(Hydra)))
                {
                    SelfCast(HasItem(Hydra) ? Hydra : Tiamat);
                }
            }

            if (GetBool("youm", typeof (bool)) && HasItem(Youm) && ItemReady(Youm) &&
                target.Distance(Player) < Q.Range - 300)
            {
                SelfCast(Youm);
            }

            if (GetBool("omen", typeof (bool)) && HasItem(Omen) && ItemReady(Omen) &&
                Player.CountAlliesInRange(400) >= GetValue("minrand"))
            {
                SelfCast(Omen);
            }
            if (usew)
            {
                if (Environment.TickCount - _lastqc > 300 && Environment.TickCount - _laste > 300 &&
                    Environment.TickCount - lastwcombo > 300)
                {
                    if (W.IsReady() && target.Distance(Player) <= Player.AttackRange &&
                        Player.Spellbook.GetSpell(SpellSlot.W).Name == "BlindMonkWOne")
                    {
                        W.Cast(Player);
                        lastwcombo = Environment.TickCount;
                    }

                    if (W.IsReady() && target.Distance(Player) <= Player.AttackRange &&
                        Player.Spellbook.GetSpell(SpellSlot.W).Name == "blindmonkwtwo" && !HasPassive())
                    {
                        W.Cast();
                    }
                }
            }

            if (useq)
            {
                if (Environment.TickCount - _lastqc > 300 && Environment.TickCount - _laste > 300 &&
                    Environment.TickCount - lastwcombo > 300)
                {
                    var qpred = Q.GetPrediction(target);
                    if (Q.IsReady() && Player.Spellbook.GetSpell(SpellSlot.Q).Name == "BlindMonkQOne" &&
                        (qpred.Hitchance >= HitChance.Medium || qpred.Hitchance == HitChance.Immobile ||
                         qpred.Hitchance == HitChance.Dashing))
                    {
                        Q.Cast(qpred.CastPosition);
                        _lastqc = Environment.TickCount;
                    }

                    if (Player.Spellbook.GetSpell(SpellSlot.Q).Name == "blindmonkqtwo" && Q.IsReady() &&
                        GetBool("useq2", typeof (bool)))
                    {
                        Utility.DelayAction.Add(GetValue("secondqdelay"), () => Q.Cast());
                        _lastqc = Environment.TickCount;
                    }
                }
            }

            if (usee)
            {
                if (Environment.TickCount - _lastqc > 300 && Environment.TickCount - _laste > 300 &&
                    Environment.TickCount - lastwcombo > 300)
                {
                    if (target.Distance(Player) <= E.Range &&
                        Player.GetSpell(SpellSlot.E).Name == "BlindMonkEOne")
                    {
                        E.Cast();
                        _laste = Environment.TickCount;
                    }
                    if ((Player.Distance(target) >
                         Player.AttackRange + Player.BoundingRadius + target.BoundingRadius + 100 ||
                         Environment.TickCount - _laste > 2700) && Player.GetSpell(SpellSlot.E).Name == "blindmonketwo")
                    {
                        E.Cast();
                        _laste = Environment.TickCount;
                    }
                }
            }

            if (user && target.IsValidTarget(R.Range) && R.IsReady())
            {
                if (Q.IsReady() &&
                    target.Health <= R.GetDamage(target) + GetQDamage(target) + Player.GetAutoAttackDamage(target) &&
                    Q.IsReady()
                    && target.Health > GetQDamage(target))
                {
                    R.Cast(target);
                }

                if (target.Health <= R.GetDamage(target) + Q.GetDamage(target) && Q.IsReady() && Player.Mana > 30)
                {
                    R.Cast(target);
                }
            }

            if (Smite.IsReady() && target.Distance(Player) < 500 && smite)
            {
                Player.Spellbook.CastSpell(Smite, target);
            }

            #endregion
        }
Пример #41
0
        private static void OnProcessSpell(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {
                if (!(sender is AIHeroClient) || Player.LSIsRecalling())
                    return;
                // Auto W
                if (getCheckBoxItem(Misc, "Braum_AutoW") && _W.IsReady())
                {
                    if (!(sender is AIHeroClient) || !sender.IsEnemy)
                        return;
                    if (args.Target != null)
                        if (args.SData.Name.ToLower().Contains("attack") && args.Target.Position.LSDistance(Player.Position) < _W.Range)
                            if (args.Target.IsAlly && args.Target is AIHeroClient)
                            {
                                if (args.Target.IsMe && Player.HealthPercent < 20)
                                {
                                    _W.CastOnUnit((Obj_AI_Base)args.Target, true);
                                }
                                else
                                {
                                    _W.CastOnUnit((Obj_AI_Base)args.Target, true);
                                }
                            }
                }
                // Auto E
                if (getCheckBoxItem(Misc, "Braum_AutoE") && _E.IsReady())
                {
                    if (!(sender is AIHeroClient) || !sender.IsEnemy || !PortAIO.OrbwalkerManager.CanAttack())
                        return;
                    var enemyskill = new LeagueSharp.Common.Geometry.Polygon.Rectangle(args.Start, args.End, args.SData.BounceRadius + 20);
                    var myteam = HeroManager.Allies.Where(f => f.LSDistance(Player.Position) < 200);
                    var count = myteam.Count(f => enemyskill.IsInside(f.Position));
                    if (args.Target != null && args.Target.Position.LSDistance(Player.Position) < 200)
                    {
                        if (args.Target.Name == Player.Name && Player.HealthPercent < 20)
                        {
                            _E.Cast(sender.Position, true);
                        }
                        else if (args.Target.Position.LSDistance(Player.Position) < 200 && args.Target is AIHeroClient)
                        {
                            if (_W.IsReady() && args.Target.Position.LSDistance(Player.Position) < _W.Range)
                                _W.CastOnUnit((Obj_AI_Base)args.Target, true);
                            _E.Cast(sender.Position, true);
                        }
                    }
                    else if (args.Target == null)
                    {
                        if (Player.HealthPercent < 20 && count == 1)
                        {
                            _E.Cast(sender.Position, true);
                        }
                        else if (count >= 2)
                        {
                            _E.Cast(sender.Position, true);
                        }
                    }
                }
            }
            catch (Exception)
            {
                if (NowTime() > ErrorTime)
                {
                    Chat.Print(ChampName + " in FreshBooster isn't Load. Error Code 08");
                    ErrorTime = TickCount(10000);
                }
            }

        }
Пример #42
0
 private static void AutoUseQ()
 {
     if (Q.IsReady() && AutoQ && Player.ManaPercent > MinMana)
     {
         var extarget = TargetSelector.GetTarget(Q1.Range, DamageType.Physical);
         var Minions = MinionManager.GetMinions(Q.Range);
         foreach (var Minion in Minions)
         {
             var QHit = new Geometry.Polygon.Rectangle(Player.Position, Player.Position.LSExtend(Minion.Position, Q1.Range), Q1.Width);
             var QPred = Q1.GetPrediction(extarget);
             if (!QHit.IsOutside(QPred.UnitPosition.LSTo2D()) && QPred.Hitchance == HitChance.High)
             {
                 Q.Cast(Minion);
                 break;
             }
         }
     }
 }
Пример #43
0
        public static void CastSingleLine(Spell spell, Spell spell2, bool wallCheck, float extraPrerange = 1)
        {
            if (!spell.IsReady() || Utils.TickCount - _lastCast < 0)
                return;

            //-------------------------------Single---------------------------
            var target = TargetSelector.GetTarget(spell.Range + spell2.Range, TargetSelector.DamageType.Magical);

            if (target == null)
                return;

            var vector1 = Player.ServerPosition + Vector3.Normalize(target.ServerPosition - Player.ServerPosition) * (spell.Range * extraPrerange);

            spell2.UpdateSourcePosition(vector1, vector1);

            var pred = Prediction.GetPrediction(target, spell.Delay);
            Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(vector1, vector1.Extend(pred.CastPosition, spell2.Range), spell.Width);

            if (Player.ServerPosition.Distance(target.ServerPosition) < spell.Range)
            {
                var vector2 = pred.CastPosition.Extend(target.ServerPosition, spell2.Range*.3f);
                Geometry.Polygon.Rectangle rec2 = new Geometry.Polygon.Rectangle(vector2, vector2.Extend(pred.CastPosition, spell2.Range), spell.Width);

                if ((!rec2.Points.Exists(Util.IsWall) || !wallCheck) && pred.Hitchance >= HitChance.Medium && target.IsMoving)
                {
                    spell2.UpdateSourcePosition(vector2, vector2);
                    CastLineSpell(vector2, vector2.Extend(pred.CastPosition, spell2.Range));
                    _lastCast = Utils.TickCount + 500;
                }

            }
            else if (!rec1.Points.Exists(Util.IsWall) || !wallCheck)
            {
                //wall check
                if (pred.Hitchance >= HitChance.High)
                {
                    CastLineSpell(vector1, pred.CastPosition);
                }
            }
        }
Пример #44
0
 private static void BardQ(AIHeroClient Target, bool Type, bool Draw = false)
 {
     // Type 0: no sturn / 1: only sturn
     // If Draw is true, return draw
     /* return
     target1, target2, type
     */
     Range1 = new LeagueSharp.Common.Geometry.Polygon.Rectangle(Player.Position, Player.Position.LSExtend(Target.Position, _Q.Range), _Q.Width);
     Range2 = null;
     if (Draw)
         Range1.Draw(Color.Red);
     cnt = 0;
     BardQTarget1 = Player;
     BardQTarget2 = Player;
     foreach (var item in ObjectManager.Get<Obj_AI_Base>().OrderBy(f => f.LSDistance(f.Position)))
     {
         if (item.LSDistance(Player.Position) < _Q.Range)
             if (item is AIHeroClient || item is Obj_AI_Minion)
                 if (item.IsEnemy && !item.IsDead)
                 {
                     if (cnt == 2)
                         break;
                     if (cnt == 0 && Range1.IsInside(item.Position))
                     {
                         BardQTarget1 = item;
                         Range2 = new LeagueSharp.Common.Geometry.Polygon.Rectangle(Player.Position.LSExtend(BardQTarget1.Position, Player.LSDistance(BardQTarget1.Position)),
                             Player.Position.LSExtend(BardQTarget1.Position, Player.LSDistance(BardQTarget1.Position) + 450), _Q.Width);
                         if (Draw)
                             Range2.Draw(Color.Yellow);
                         cnt++;
                     }
                     if (cnt == 1 && Range2.IsInside(item.Position))
                     {
                         BardQTarget2 = item;
                         cnt++;
                     }
                 }
     }
 }
Пример #45
0
        public static void CastBestLine(bool forceUlt, Spell spell, Spell spell2, int midPointRange, Menu menu, float extraPrerange = 1, bool wallCheck = true)
        {
            if (!spell.IsReady())
                return;

            int maxHit = 0;
            Vector3 start = Vector3.Zero;
            Vector3 end = Vector3.Zero;

            //loop one
            foreach (var target in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range)))
            {
               //loop 2
                var target1 = target;
                var target2 = target;
                foreach (var enemy in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target1.NetworkId
                    && x.Distance(target1.Position) < spell2.Range - 100).OrderByDescending(x => x.Distance(target2.Position)))
                {
                    int hit = 2;

                    var targetPred = Prediction.GetPrediction(target, spell.Delay);
                    var enemyPred = Prediction.GetPrediction(enemy, spell.Delay);

                    var midpoint = (enemyPred.CastPosition + targetPred.CastPosition) / 2;

                    var startpos = midpoint + Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange;
                    var endPos = midpoint - Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange;

                    Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(startpos, endPos, spell.Width);

                    if (!rec1.Points.Exists(Util.IsWall) && Player.CountEnemiesInRange(spell.Range + spell2.Range) > 2)
                    {
                        //loop 3
                        var target3 = target;
                        var enemy1 = enemy;
                        foreach (var enemy2 in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target3.NetworkId && x.NetworkId != enemy1.NetworkId && x.Distance(target3.Position) < 1000))
                        {
                            var enemy2Pred = Prediction.GetPrediction(enemy2, spell.Delay);
                            Object[] obj = Util.VectorPointProjectionOnLineSegment(startpos.To2D(), endPos.To2D(), enemy2Pred.CastPosition.To2D());
                            var isOnseg = (bool)obj[2];
                            var pointLine = (Vector2)obj[1];

                            if (pointLine.Distance(enemy2Pred.CastPosition.To2D()) < spell.Width && isOnseg)
                            {
                                hit++;
                            }
                        }
                    }

                    if (hit > maxHit && hit > 1 && !rec1.Points.Exists(Util.IsWall))
                    {
                        maxHit = hit;
                        start = startpos;
                        end = endPos;
                    }
                }
            }

            if (start != Vector3.Zero && end != Vector3.Zero && spell.IsReady())
            {
                spell2.UpdateSourcePosition(start, start);
                if (forceUlt)
                    CastLineSpell(start, end);
                if (menu.Item("ComboActive", true).GetValue<KeyBind>().Active && maxHit >= menu.Item("Line_If_Enemy_Count_Combo", true).GetValue<Slider>().Value)
                    CastLineSpell(start, end);
                if (maxHit >= menu.Item("Line_If_Enemy_Count", true).GetValue<Slider>().Value)
                    CastLineSpell(start, end);
            }

            //check if only one target
            if (forceUlt)
            {
                CastSingleLine(spell, spell2, wallCheck, extraPrerange);
            }
        }
Пример #46
0
 private static void OnProcessSpell(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     try
     {
         if (!(sender is AIHeroClient) || Player.LSIsRecalling())
         {
             return;
         }
         // Auto W
         if (getCheckBoxItem(Misc, "Braum_AutoW") && _W.IsReady())
         {
             if (!(sender is AIHeroClient) || !sender.IsEnemy)
             {
                 return;
             }
             if (args.Target != null)
             {
                 if (args.SData.Name.ToLower().Contains("attack") && args.Target.Position.LSDistance(Player.Position) < _W.Range)
                 {
                     if (args.Target.IsAlly && args.Target is AIHeroClient)
                     {
                         if (args.Target.IsMe && Player.HealthPercent < 20)
                         {
                             _W.CastOnUnit((Obj_AI_Base)args.Target, true);
                         }
                         else
                         {
                             _W.CastOnUnit((Obj_AI_Base)args.Target, true);
                         }
                     }
                 }
             }
         }
         // Auto E
         if (getCheckBoxItem(Misc, "Braum_AutoE") && _E.IsReady())
         {
             if (!(sender is AIHeroClient) || !sender.IsEnemy || !Orbwalker.CanAutoAttack)
             {
                 return;
             }
             var enemyskill = new LeagueSharp.Common.Geometry.Polygon.Rectangle(args.Start, args.End, args.SData.BounceRadius + 20);
             var myteam     = HeroManager.Allies.Where(f => f.LSDistance(Player.Position) < 200);
             var count      = myteam.Count(f => enemyskill.IsInside(f.Position));
             if (args.Target != null && args.Target.Position.LSDistance(Player.Position) < 200)
             {
                 if (args.Target.Name == Player.Name && Player.HealthPercent < 20)
                 {
                     _E.Cast(sender.Position, true);
                 }
                 else if (args.Target.Position.LSDistance(Player.Position) < 200 && args.Target is AIHeroClient)
                 {
                     if (_W.IsReady() && args.Target.Position.LSDistance(Player.Position) < _W.Range)
                     {
                         _W.CastOnUnit((Obj_AI_Base)args.Target, true);
                     }
                     _E.Cast(sender.Position, true);
                 }
             }
             else if (args.Target == null)
             {
                 if (Player.HealthPercent < 20 && count == 1)
                 {
                     _E.Cast(sender.Position, true);
                 }
                 else if (count >= 2)
                 {
                     _E.Cast(sender.Position, true);
                 }
             }
         }
     }
     catch (Exception)
     {
         if (NowTime() > ErrorTime)
         {
             Chat.Print(ChampName + " in FreshBooster isn't Load. Error Code 08");
             ErrorTime = TickCount(10000);
         }
     }
 }