Exemple #1
0
        static void Harass(AIHeroClient target)
        {
            if (Spells[SpellSlot.Q].IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.Harass, "Harass.UseQ"))
            {
                //Spells[SpellSlot.Q].SPredictionCast(target, CassioUtils.GetHitChance("Hitchance.Q"));

                var pred = Spells[SpellSlot.Q].GetPrediction(target, true);
                if (pred.Hitchance >= CassioUtils.QChance())
                {
                    Spells[SpellSlot.Q].Cast(pred.CastPosition);
                }
            }
            if (Spells[SpellSlot.W].IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.Harass, "Harass.UseW"))
            {
                //Spells[SpellSlot.W].SPredictionCast(target, CassioUtils.GetHitChance("Hitchance.W"));

                var pred = Spells[SpellSlot.W].GetPrediction(target, true);
                if (pred.Hitchance >= CassioUtils.WChance())
                {
                    Spells[SpellSlot.W].Cast(pred.CastPosition);
                }
            }
            if (Spells[SpellSlot.E].IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.Harass, "Harass.UseE"))
            {
                if (target.isPoisoned())
                {
                    if ((Utils.GameTimeTickCount - laste) > edelay)
                    {
                        Spells[SpellSlot.E].Cast(target);
                        laste = Utils.GameTimeTickCount;
                    }
                }
            }
        }
 static void Harass(Obj_AI_Hero target)
 {
     if (Spells[SpellSlot.Q].IsReady() && CassioUtils.Active("Harass.UseQ"))
     {
         var pred = Spells[SpellSlot.Q].GetPrediction(target, true);
         if (pred.Hitchance >= CassioUtils.GetHitChance("Hitchance.Q"))
         {
             Spells[SpellSlot.Q].Cast(pred.CastPosition);
         }
     }
     if (Spells[SpellSlot.W].IsReady() && CassioUtils.Active("Harass.UseW"))
     {
         var pred = Spells[SpellSlot.W].GetPrediction(target, true);
         if (pred.Hitchance >= CassioUtils.GetHitChance("Hitchance.W"))
         {
             Spells[SpellSlot.W].Cast(pred.CastPosition);
         }
     }
     if (Spells[SpellSlot.E].IsReady() && CassioUtils.Active("Harass.UseE"))
     {
         if (target.isPoisoned())
         {
             if ((Utils.GameTimeTickCount - laste) > edelay)
             {
                 Spells[SpellSlot.E].Cast(target);
                 laste = Utils.GameTimeTickCount;
             }
         }
     }
 }
        static void OnDraw(EventArgs args)
        {
            if (Player.IsDead || CassioUtils.Active("Drawing.Disable"))
            {
                return;
            }
            foreach (var x in Killable)
            {
                var pos = Drawing.WorldToScreen(x.ServerPosition);
                Drawing.DrawText(pos.X, pos.Y, System.Drawing.Color.Azure, "Killable");
            }


            if (CassioUtils.Active("Drawing.DrawQ"))
            {
                Render.Circle.DrawCircle(Player.Position, Spells[SpellSlot.Q].Range, System.Drawing.Color.White);
            }
            if (CassioUtils.Active("Drawing.DrawW"))
            {
                Render.Circle.DrawCircle(Player.Position, Spells[SpellSlot.Q].Range, System.Drawing.Color.Green);
            }
            if (CassioUtils.Active("Drawing.DrawE"))
            {
                Render.Circle.DrawCircle(Player.Position, Spells[SpellSlot.E].Range, System.Drawing.Color.RoyalBlue);
            }
            if (CassioUtils.Active("Drawing.DrawR"))
            {
                Render.Circle.DrawCircle(Player.Position, Spells[SpellSlot.R].Range, System.Drawing.Color.Red);
            }
        }
Exemple #4
0
 private static void BeforeAuto(AttackableUnit target, Orbwalker.PreAttackArgs args)
 {
     if (!CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.Useauto") && Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
     {
         args.Process = false;
         return;
     }
     if (CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.Disableautoifspellsready") && Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
     {
         if (SpellSlot.Q.IsReady() || SpellSlot.W.IsReady() || SpellSlot.E.IsReady() || SpellSlot.R.IsReady())
         {
             args.Process = false;
             return;
         }
     }
     if (!CassioUtils.getCheckBoxItem(CassiopeiaMenu.Waveclear, "Waveclear.Useauto") && Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
     {
         args.Process = false;
         return;
     }
     if (!CassioUtils.getCheckBoxItem(CassiopeiaMenu.Farm, "Farm.Useauto") && (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LastHit)))
     {
         args.Process = false;
         return;
     }
 }
 private static void BeforeAuto(Orbwalking.BeforeAttackEventArgs args)
 {
     if (!CassioUtils.Active("Combo.Useauto") && CassiopeiaMenu.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
     {
         args.Process = false;
         return;
     }
     if (CassioUtils.Active("Combo.Disableautoifspellsready") && CassiopeiaMenu.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
     {
         if (SpellSlot.Q.IsReady() || SpellSlot.W.IsReady() || SpellSlot.E.IsReady() || SpellSlot.R.IsReady())
         {
             args.Process = false;
             return;
         }
     }
     if (!CassioUtils.Active("Waveclear.Useauto") && CassiopeiaMenu.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear)
     {
         args.Process = false;
         return;
     }
     if (!CassioUtils.Active("Farm.Useauto") && (CassiopeiaMenu.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed || CassiopeiaMenu.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit))
     {
         args.Process = false;
         return;
     }
 }
Exemple #6
0
        private static void Combo(AIHeroClient target)
        {
            if (Spells[SpellSlot.Q].IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.UseQ"))
            {
                //Spells[SpellSlot.Q].SPredictionCast(target, CassioUtils.GetHitChance("Hitchance.Q"));

                var pred = Spells[SpellSlot.Q].GetPrediction(target, true);
                if (pred.Hitchance >= CassioUtils.QChance())
                {
                    Spells[SpellSlot.Q].Cast(pred.CastPosition);
                }
            }
            if (Spells[SpellSlot.W].IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.UseW"))
            {
                //Spells[SpellSlot.W].SPredictionCast(target, CassioUtils.GetHitChance("Hitchance.W"));

                var pred = Spells[SpellSlot.W].GetPrediction(target, true);
                if (pred.Hitchance > CassioUtils.WChance())
                {
                    Spells[SpellSlot.W].Cast(pred.CastPosition);
                }
            }
            if (Spells[SpellSlot.E].IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.UseE"))
            {
                if (CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.useepoison") && target.isPoisoned())
                {
                    if ((Utils.GameTimeTickCount - laste) > edelay)
                    {
                        Spells[SpellSlot.E].Cast(target);
                        laste = Utils.GameTimeTickCount;
                    }
                }
                else if (!CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.useepoison"))
                {
                    if ((Utils.GameTimeTickCount - laste) > edelay)
                    {
                        Spells[SpellSlot.E].Cast(target);
                        laste = Utils.GameTimeTickCount;
                    }
                }
            }

            /*
             * if (SpellSlot.R.IsReady() && CassioUtils.Active("Combo.UseR"))
             * {
             *      var pred = Spells[SpellSlot.R].GetPrediction(target, true);
             *      var enemshit = pred.CastPosition.GetEnemiesInRange(Spells[SpellSlot.R].Width);
             *      var counthit = enemshit.Count;
             *      var hitfacing = enemshit.Count(x => x.IsFacing(Player));
             *      var anymovingtome = enemshit.Any(x => x.isMovingToMe());
             *      if (hitfacing >= CassioUtils.GetSlider("Combo.Rcount") && pred.Hitchance >= CassioUtils.GetHitChance("Hitchance.R") && anymovingtome || CassioUtils.Active("Combo.UseRNF") && counthit >= CassioUtils.GetSlider("Combo.Rcountnf") && pred.Hitchance >= CassioUtils.GetHitChance("Hitchance.R"))
             *      {
             *           Spells[SpellSlot.R].Cast(pred.CastPosition);
             *      }
             *  }
             * */
        }
 static void OnInterruptableTarget(Obj_AI_Hero sender, Interrupter2.InterruptableTargetEventArgs args)
 {
     if (Player.IsDead)
     {
         return;
     }
     if (sender.IsValidTarget())
     {
         if (CassioUtils.Active("Interrupter.UseR") && Vector3.Distance(sender.ServerPosition, Player.ServerPosition) <= Spells[SpellSlot.R].Range && sender.IsFacing(Player))
         {
             var pred = Spells[SpellSlot.R].GetPrediction(sender);
             if (pred.Hitchance >= HitChance.VeryHigh && sender.IsFacing(Player))
             {
                 Spells[SpellSlot.R].Cast(pred.CastPosition);
             }
         }
     }
 }
        private static void OnUpdate(EventArgs args)
        {
            if (Player.IsDead || Player.recalling())
            {
                return;
            }


            edelay = CassioUtils.GetSlider("Combo.edelay");

            Killsteal();

            target = TargetSelector.GetTarget(Spells[SpellSlot.Q].Range, TargetSelector.DamageType.Magical, true, CassiopeiaMenu.BlackList);
            if (target != null && CassioUtils.ActiveKeyBind("Keys.HarassT") && Player.ManaPercent >= CassioUtils.GetSlider("Harass.Mana") && !target.IsInvulnerable && !target.IsZombie)
            {
                Harass(target);
            }

            var Orbwalkmode = CassiopeiaMenu.Orbwalker.ActiveMode;

            switch (Orbwalkmode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                if (target != null && !target.IsInvulnerable && !target.IsZombie)
                {
                    Combo(target);
                }
                break;

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

            case Orbwalking.OrbwalkingMode.Mixed:
                MixedModeLogic(target, true);
                break;

            case Orbwalking.OrbwalkingMode.LastHit:
                MixedModeLogic(target, false);
                break;
            }
        }
Exemple #9
0
        static void OnInterruptableTarget(AIHeroClient sender, Interrupter2.InterruptableTargetEventArgs args)
        {
            if (Player.IsDead)
            {
                return;
            }
            if (sender.LSIsValidTarget())
            {
                if (CassioUtils.getCheckBoxItem(CassiopeiaMenu.Interrupter, "Interrupter.UseR") && Vector3.Distance(sender.ServerPosition, Player.ServerPosition) <= Spells[SpellSlot.R].Range && sender.LSIsFacing(Player))
                {
                    //Spells[SpellSlot.R].SPredictionCast(sender, CassioUtils.GetHitChance("Hitchance.R"));

                    var pred = Spells[SpellSlot.R].GetPrediction(sender);
                    if (pred.Hitchance >= HitChance.VeryHigh && sender.LSIsFacing(Player))
                    {
                        Spells[SpellSlot.R].Cast(pred.CastPosition);
                    }
                }
            }
        }
        static void OnGapClose(ActiveGapcloser args)
        {
            if (Player.IsDead || Player.recalling())
            {
                return;
            }
            var sender = args.Sender;

            if (CassioUtils.Active("Interrupter.AntiGapClose") && sender.IsValidTarget())
            {
                if (CassioUtils.Active("Interrupter.AG.UseR") && Vector3.Distance(args.End, Player.ServerPosition) <= Spells[SpellSlot.R].Range && sender.IsFacing(Player))
                {
                    var pred = Spells[SpellSlot.R].GetPrediction(sender);
                    if (pred.Hitchance >= HitChance.VeryHigh && sender.IsFacing(Player))
                    {
                        Spells[SpellSlot.R].Cast(pred.CastPosition);
                    }
                }
            }
        }
Exemple #11
0
        static void OnGapClose(ActiveGapcloser args)
        {
            if (Player.IsDead || Player.recalling())
            {
                return;
            }
            var sender = args.Sender;

            if (CassioUtils.getCheckBoxItem(CassiopeiaMenu.Interrupter, "Interrupter.AntiGapClose") && sender.LSIsValidTarget())
            {
                if (CassioUtils.getCheckBoxItem(CassiopeiaMenu.Interrupter, "Interrupter.AG.UseR") && Vector3.Distance(args.End, Player.ServerPosition) <= Spells[SpellSlot.R].Range && sender.LSIsFacing(Player))
                {
                    //Spells[SpellSlot.R].SPredictionCast(sender, CassioUtils.GetHitChance("Hitchance.R"));

                    var pred = Spells[SpellSlot.R].GetPrediction(sender);
                    if (pred.HitChance >= EloBuddy.SDK.Enumerations.HitChance.High && sender.LSIsFacing(Player))
                    {
                        Spells[SpellSlot.R].Cast(pred.CastPosition);
                    }
                }
            }
        }
Exemple #12
0
        private static void OnUpdate(EventArgs args)
        {
            if (Player.IsDead || Player.recalling())
            {
                return;
            }


            edelay = CassioUtils.getSliderItem(CassiopeiaMenu.Combo, "Combo.edelay");

            Killsteal();

            target = TargetSelector.GetTarget(Spells[SpellSlot.Q].Range, DamageType.Magical);
            if (target != null && CassioUtils.getKeyBindItem(CassiopeiaMenu.Harass, "Keys.HarassT") && Player.ManaPercent >= CassioUtils.getSliderItem(CassiopeiaMenu.Harass, "Harass.Mana") && !target.IsInvulnerable && !target.IsZombie)
            {
                Harass(target);
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                if (target != null && !target.IsInvulnerable && !target.IsZombie)
                {
                    Combo(target);
                }
            }
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
            {
                MixedModeLogic(target, true);
            }
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
            {
                WaveClear();
            }
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LastHit))
            {
                MixedModeLogic(target, false);
            }
        }
        public static bool canKill(this Obj_AI_Hero target)
        {
            double totaldmgavailable = 0;

            if (SpellSlot.Q.IsReady() && CassioUtils.Active("Combo.UseQ"))
            {
                totaldmgavailable += Player.GetSpellDamage(target, SpellSlot.Q);
            }
            if (SpellSlot.E.IsReady() && CassioUtils.Active("Combo.UseE"))
            {
                totaldmgavailable += Player.GetSpellDamage(target, SpellSlot.E);
            }
            if (SpellSlot.R.IsReady() && CassioUtils.Active("Combo.UseR"))
            {
                totaldmgavailable += Player.GetSpellDamage(target, SpellSlot.R);
            }

            if (Spells[IgniteSlot].IsReady() && CassioUtils.Active("Killsteal.UseIgnite"))
            {
                totaldmgavailable += Player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            }
            return(totaldmgavailable > target.Health);
        }
Exemple #14
0
        public static bool canKill(this AIHeroClient target)
        {
            double totaldmgavailable = 0;

            if (SpellSlot.Q.IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.UseQ"))
            {
                totaldmgavailable += Player.LSGetSpellDamage(target, SpellSlot.Q);
            }
            if (SpellSlot.E.IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.UseE"))
            {
                totaldmgavailable += Player.LSGetSpellDamage(target, SpellSlot.E);
            }
            if (SpellSlot.R.IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.UseR"))
            {
                totaldmgavailable += Player.LSGetSpellDamage(target, SpellSlot.R);
            }

            if (Spells[IgniteSlot].IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.KillSteal, "Killsteal.UseIgnite"))
            {
                totaldmgavailable += Player.GetSummonerSpellDamage(target, LeagueSharp.Common.Damage.SummonerSpell.Ignite);
            }
            return(totaldmgavailable > target.Health);
        }
Exemple #15
0
        static void AutoSpells(EventArgs args)
        {
            if (Player.IsDead || Player.recalling())
            {
                return;
            }
            if (SpellSlot.E.IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.UseE") && (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) || CassioUtils.getCheckBoxItem(CassiopeiaMenu.misc, "Misc.autoe")))
            {
                AIHeroClient etarg;
                etarg = target;
                if (etarg == null)
                {
                    etarg = HeroManager.Enemies.FirstOrDefault(h => h.LSIsValidTarget(Spells[SpellSlot.E].Range) && h.isPoisoned() && !h.IsInvulnerable && !h.IsZombie);
                }
                if (etarg != null && CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.useepoison") && etarg.isPoisoned())
                {
                    if ((Utils.GameTimeTickCount - laste) > edelay)
                    {
                        Spells[SpellSlot.E].Cast(etarg);
                        laste = Utils.GameTimeTickCount;
                    }
                }
                else if (!CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.useepoison"))
                {
                    if ((Utils.GameTimeTickCount - laste) > edelay)
                    {
                        Spells[SpellSlot.E].Cast(target);
                        laste = Utils.GameTimeTickCount;
                    }
                }
            }



            if (SpellSlot.R.IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.UseR") &&
                Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                var     targets            = HeroManager.Enemies.Where(x => x.LSIsValidTarget(Spells[SpellSlot.R].Range) && !x.IsZombie).OrderBy(x => x.Health);
                Vector3 bestpositionfacing = new Vector3(0, 0, 0);
                Vector3 bestpositionnf     = new Vector3(0, 0, 0);
                int     mosthitfacing      = 0;
                int     mosthitnf          = 0;
                foreach (var targ in targets)
                {
                    var pred = Spells[SpellSlot.R].GetPrediction(targ, true);
                    if (pred.HitChance >= CassioUtils.RChance())
                    {
                        int enemhitpred    = 0;
                        int enemfacingpred = 0;
                        foreach (var hero in targets)
                        {
                            if (Spells[SpellSlot.R].WillHit(hero, pred.CastPosition, 0, CassioUtils.RChance()))
                            {
                                enemhitpred++;
                                if (hero.IsFacing(Player))
                                {
                                    enemfacingpred++;
                                }
                            }
                        }

                        if (enemfacingpred > mosthitfacing)
                        {
                            mosthitfacing      = enemfacingpred;
                            bestpositionfacing = pred.CastPosition;
                        }

                        if (enemhitpred > mosthitnf)
                        {
                            mosthitnf      = enemhitpred;
                            bestpositionnf = pred.CastPosition;
                        }
                    }
                }

                if (mosthitfacing >= CassioUtils.getSliderItem(CassiopeiaMenu.Combo, "Combo.Rcount"))
                {
                    Spells[SpellSlot.R].Cast(bestpositionfacing);
                    return;
                }
                if (mosthitnf >= CassioUtils.getSliderItem(CassiopeiaMenu.Combo, "Combo.Rcountnf") && CassioUtils.getCheckBoxItem(CassiopeiaMenu.Combo, "Combo.UseRNF"))
                {
                    Spells[SpellSlot.R].Cast(bestpositionnf);
                    return;
                }

                var easycheck = HeroManager.Enemies.FirstOrDefault(x =>
                                                                   !x.IsInvulnerable && !x.IsZombie && x.LSIsValidTarget(Spells[SpellSlot.R].Range) &&
                                                                   x.LSIsFacing(Player) && x.isImmobile());

                if (easycheck != null)
                {
                    Spells[SpellSlot.R].Cast(easycheck.ServerPosition);
                    return;
                }
            }
        }
Exemple #16
0
        static void Killsteal()
        {
            if (!CassioUtils.getCheckBoxItem(CassiopeiaMenu.KillSteal, "Killsteal"))
            {
                return;
            }
            var targets = HeroManager.Enemies.Where(x => x.LSIsValidTarget() && !x.IsInvulnerable & !x.IsZombie);

            if (SpellSlot.Q.IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.KillSteal, "Killsteal.UseQ"))
            {
                AIHeroClient qtarget =
                    targets.Where(x => x.LSDistance(Player.Position) < Spells[SpellSlot.Q].Range)
                    .MinOrDefault(x => x.Health);
                if (qtarget != null)
                {
                    var qdmg = Player.LSGetSpellDamage(qtarget, SpellSlot.Q);
                    if (qtarget.Health < qdmg)
                    {
                        //Spells[SpellSlot.Q].SPredictionCast(target,       CassioUtils.GetHitChance("Hitchance.Q"));
                        //return;

                        var pred = Spells[SpellSlot.Q].GetPrediction(qtarget);
                        if (pred != null && pred.Hitchance >= HitChance.Medium)
                        {
                            Spells[SpellSlot.W].Cast(pred.CastPosition);
                            return;
                        }
                    }
                }
            }

            if (SpellSlot.W.IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.KillSteal, "Killsteal.UseW"))
            {
                AIHeroClient wtarget =
                    targets.Where(x => x.LSDistance(Player.Position) < Spells[SpellSlot.W].Range)
                    .MinOrDefault(x => x.Health);
                if (wtarget != null)
                {
                    var wdmg = Player.LSGetSpellDamage(wtarget, SpellSlot.W);
                    if (wtarget.Health < wdmg)
                    {
                        //Spells[SpellSlot.W].SPredictionCast(target, CassioUtils.GetHitChance("Hitchance.W"));

                        var pred = Spells[SpellSlot.W].GetPrediction(wtarget);
                        if (pred != null && pred.Hitchance >= HitChance.Medium)
                        {
                            Spells[SpellSlot.W].Cast(pred.CastPosition);
                            return;
                        }
                    }
                }
            }
            if (SpellSlot.E.IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.KillSteal, "Killsteal.UseE"))
            {
                AIHeroClient etarget =
                    targets.Where(x => x.LSDistance(Player.Position) < Spells[SpellSlot.E].Range)
                    .MinOrDefault(x => x.Health);
                if (etarget != null)
                {
                    var edmg = Player.LSGetSpellDamage(etarget, SpellSlot.E);
                    if (etarget.Health < edmg)
                    {
                        if ((Utils.GameTimeTickCount - laste) > edelay)
                        {
                            Spells[SpellSlot.E].Cast(etarget);
                            laste = Utils.GameTimeTickCount;
                        }
                    }
                }
            }

            if (SpellSlot.R.IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.KillSteal, "Killsteal.UseR"))
            {
                var targ = HeroManager.Enemies.FirstOrDefault(x => x.LSIsValidTarget() && Vector3.Distance(Player.ServerPosition, x.ServerPosition) < Spells[SpellSlot.R].Range - 200 && x.Health < Player.LSGetSpellDamage(x, SpellSlot.R) && !x.IsZombie && !x.IsInvulnerable);

                if (targ != null)
                {
                    //Spells[SpellSlot.R].SPredictionCast(target, CassioUtils.GetHitChance("Hitchance.R"));

                    var pred = Spells[SpellSlot.R].GetPrediction(targ);
                    if (pred.Hitchance >= CassioUtils.RChance())
                    {
                        Spells[SpellSlot.R].Cast(pred.CastPosition);
                    }
                }
            }

            if (Spells[IgniteSlot].IsReady() && CassioUtils.getCheckBoxItem(CassiopeiaMenu.KillSteal, "Killsteal.UseIgnite"))
            {
                var targ =
                    HeroManager.Enemies.FirstOrDefault(x => x.LSIsValidTarget() &&
                                                       Vector3.Distance(Player.ServerPosition, x.ServerPosition) < Spells[IgniteSlot].Range && x.Health < (Player.GetSummonerSpellDamage(x, LeagueSharp.Common.Damage.SummonerSpell.Ignite)));
                if (targ != null)
                {
                    Spells[IgniteSlot].Cast(targ);
                }
            }
        }
        static void Killsteal()
        {
            if (!CassioUtils.Active("Killsteal"))
            {
                return;
            }
            var targets = HeroManager.Enemies.Where(x => x.IsValidTarget() && !x.IsInvulnerable & !x.IsZombie);

            if (SpellSlot.Q.IsReady() && CassioUtils.Active("Killsteal.UseQ"))
            {
                Obj_AI_Hero qtarget =
                    targets.Where(x => x.Distance(Player.Position) < Spells[SpellSlot.Q].Range)
                    .MinOrDefault(x => x.Health);
                if (qtarget != null)
                {
                    var qdmg = Player.GetSpellDamage(qtarget, SpellSlot.Q);
                    if (qtarget.Health < qdmg)
                    {
                        var pred = Spells[SpellSlot.Q].GetPrediction(qtarget, false);
                        if (pred != null && pred.Hitchance >= HitChance.Medium)
                        {
                            Spells[SpellSlot.Q].Cast(pred.CastPosition);
                            return;
                        }
                    }
                }
            }

            if (SpellSlot.W.IsReady() && CassioUtils.Active("Killsteal.UseW"))
            {
                Obj_AI_Hero wtarget =
                    targets.Where(x => x.Distance(Player.Position) < Spells[SpellSlot.W].Range)
                    .MinOrDefault(x => x.Health);
                if (wtarget != null)
                {
                    var wdmg = Player.GetSpellDamage(wtarget, SpellSlot.W);
                    if (wtarget.Health < wdmg)
                    {
                        var pred = Spells[SpellSlot.Q].GetPrediction(wtarget, false);
                        if (pred != null && pred.Hitchance >= HitChance.Medium)
                        {
                            Spells[SpellSlot.W].Cast(pred.CastPosition);
                            return;
                        }
                    }
                }
            }
            if (SpellSlot.E.IsReady() && CassioUtils.Active("Killsteal.UseE"))
            {
                Obj_AI_Hero etarget =
                    targets.Where(x => x.Distance(Player.Position) < Spells[SpellSlot.E].Range)
                    .MinOrDefault(x => x.Health);
                if (etarget != null)
                {
                    var edmg = Player.GetSpellDamage(etarget, SpellSlot.E);
                    if (etarget.Health < edmg)
                    {
                        if ((Utils.GameTimeTickCount - laste) > edelay)
                        {
                            Spells[SpellSlot.E].Cast(etarget);
                            laste = Utils.GameTimeTickCount;
                        }
                    }
                }
            }



            if (SpellSlot.R.IsReady() && CassioUtils.Active("Killsteal.UseR"))
            {
                var targ = HeroManager.Enemies.FirstOrDefault(x => x.IsValidTarget() && Vector3.Distance(Player.ServerPosition, x.ServerPosition) < Spells[SpellSlot.R].Range - 200 && x.Health < Player.GetSpellDamage(x, SpellSlot.R) && !x.IsZombie && !x.IsInvulnerable);

                if (targ != null)
                {
                    var pred = Spells[SpellSlot.R].GetPrediction(targ, true);
                    if (pred.Hitchance >= CassioUtils.GetHitChance("Hitchance.R"))
                    {
                        Spells[SpellSlot.R].Cast(pred.CastPosition);
                    }
                }
            }

            if (Spells[IgniteSlot].IsReady() && CassioUtils.Active("Killsteal.UseIgnite"))
            {
                var targ =
                    HeroManager.Enemies.FirstOrDefault(x => x.IsValidTarget() &&
                                                       Vector3.Distance(Player.ServerPosition, x.ServerPosition) < Spells[IgniteSlot].Range && x.Health < (Player.GetSummonerSpellDamage(x, Damage.SummonerSpell.Ignite)));
                if (targ != null)
                {
                    Spells[IgniteSlot].Cast(targ);
                }
            }
        }
        static void MixedModeLogic(Obj_AI_Hero target, bool isMixed)
        {
            if (isMixed && CassioUtils.Active("Harass.InMixed") && Player.ManaPercent > CassioUtils.GetSlider("Harass.Mana"))
            {
                if (target != null && !target.IsInvulnerable && !target.IsZombie)
                {
                    Harass(target);
                }
            }

            if (!CassioUtils.Active("Farm.Enable") || Player.ManaPercent < CassioUtils.GetSlider("Farm.Mana"))
            {
                return;
            }

            var Minions =
                ObjectManager.Get <Obj_AI_Minion>()
                .Where(
                    m =>
                    m.IsValidTarget() &&
                    (Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells[SpellSlot.Q].Range));

            if (!Minions.Any())
            {
                return;
            }
            if (SpellSlot.Q.IsReady() && CassioUtils.Active("Farm.UseQ"))
            {
                var KillableMinionsQ = Minions.Where(m => m.Health < Player.GetSpellDamage(m, SpellSlot.Q));
                if (KillableMinionsQ.Any())
                {
                    Spells[SpellSlot.Q].Cast(KillableMinionsQ.FirstOrDefault().ServerPosition);
                }
            }
            if (SpellSlot.W.IsReady() && CassioUtils.Active("Farm.UseW"))
            {
                var KillableMinionsW = Minions.Where(m => m.Health < Player.GetSpellDamage(m, SpellSlot.W));
                if (KillableMinionsW.Any())
                {
                    Spells[SpellSlot.W].Cast(KillableMinionsW.FirstOrDefault().ServerPosition);
                }
            }
            if (SpellSlot.E.IsReady() && CassioUtils.Active("Farm.UseE"))
            {
                var KillableMinionE = Minions.FirstOrDefault(m => m.Health < Player.GetSpellDamage(m, SpellSlot.E));
                if (KillableMinionE != null)
                {
                    if (CassioUtils.Active("Farm.useepoison"))
                    {
                        if (KillableMinionE.isPoisoned())
                        {
                            Spells[SpellSlot.E].Cast(KillableMinionE);
                        }
                    }
                    else
                    {
                        Spells[SpellSlot.E].Cast(KillableMinionE);
                    }
                }
            }
        }
        private static void WaveClear()
        {
            var Minions =
                ObjectManager.Get <Obj_AI_Minion>()
                .Where(
                    m =>
                    (m.IsValidTarget()) &&
                    (Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells[SpellSlot.R].Range));

            if (SpellSlot.Q.IsReady() && CassioUtils.Active("Waveclear.UseQ"))
            {
                var qminions =
                    Minions.Where(
                        m =>
                        Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells[SpellSlot.Q].Range);
                MinionManager.FarmLocation QLocation =
                    MinionManager.GetBestCircularFarmLocation(
                        qminions.Select(m => m.ServerPosition.To2D()).ToList(), Spells[SpellSlot.Q].Width,
                        Spells[SpellSlot.Q].Range);
                if (QLocation.MinionsHit >= 1)
                {
                    Spells[SpellSlot.Q].Cast(QLocation.Position);
                }
            }


            if (SpellSlot.W.IsReady() && CassioUtils.Active("Waveclear.UseW"))
            {
                var wminions = Minions.Where(m =>
                                             Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells[SpellSlot.W].Range);
                MinionManager.FarmLocation WLocation =
                    MinionManager.GetBestCircularFarmLocation(
                        wminions.Select(m => m.ServerPosition.To2D()).ToList(), Spells[SpellSlot.W].Width,
                        Spells[SpellSlot.W].Range);
                if (WLocation.MinionsHit >= 1)
                {
                    Spells[SpellSlot.W].Cast(WLocation.Position);
                }
            }

            if (SpellSlot.E.IsReady() && CassioUtils.Active("Waveclear.UseE"))
            {
                Obj_AI_Minion KillableMinionE = null;
                var           eminions        = Minions.Where(m =>
                                                              Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells[SpellSlot.E].Range);
                if (CassioUtils.Active("Waveclear.useekillable"))
                {
                    KillableMinionE = eminions.FirstOrDefault(m => m.Health < Player.GetSpellDamage(m, SpellSlot.E));
                }
                else
                {
                    KillableMinionE = eminions.OrderBy(x => x.Health).FirstOrDefault();
                }

                if (KillableMinionE != null)
                {
                    if (CassioUtils.Active("Waveclear.useepoison"))
                    {
                        if (KillableMinionE.isPoisoned())
                        {
                            Spells[SpellSlot.E].Cast(KillableMinionE);
                        }
                    }
                    else
                    {
                        Spells[SpellSlot.E].Cast(KillableMinionE);
                    }
                }
            }

            if (SpellSlot.R.IsReady() && CassioUtils.Active("Waveclear.UseR"))
            {
                MinionManager.FarmLocation RLocation =
                    MinionManager.GetBestLineFarmLocation(
                        Minions.Select(m => m.ServerPosition.To2D()).ToList(), Spells[SpellSlot.R].Width,
                        Spells[SpellSlot.R].Range);
                if (RLocation.MinionsHit > CassioUtils.GetSlider("Waveclear.Rcount"))
                {
                    Spells[SpellSlot.R].Cast(RLocation.Position);
                    DontMove = true;
                    Utility.DelayAction.Add(200, () => DontMove = false);
                }
            }
        }
        static void AutoSpells(EventArgs args)
        {
            if (Player.IsDead || Player.recalling())
            {
                return;
            }
            if (SpellSlot.E.IsReady() && CassioUtils.Active("Combo.UseE") && (CassiopeiaMenu.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo || CassioUtils.Active("Misc.autoe")))
            {
                Obj_AI_Hero etarg;
                etarg = target;
                if (etarg == null)
                {
                    etarg = HeroManager.Enemies.FirstOrDefault(h => h.IsValidTarget(Spells[SpellSlot.E].Range) && h.isPoisoned() && !h.IsInvulnerable && !h.IsZombie);
                }
                if (etarg != null && CassioUtils.Active("Combo.useepoison") && etarg.isPoisoned())
                {
                    if ((Utils.GameTimeTickCount - laste) > edelay)
                    {
                        Spells[SpellSlot.E].Cast(etarg);
                        laste = Utils.GameTimeTickCount;
                    }
                }
                else if (!CassioUtils.Active("Combo.useepoison"))
                {
                    if ((Utils.GameTimeTickCount - laste) > edelay)
                    {
                        Spells[SpellSlot.E].Cast(target);
                        laste = Utils.GameTimeTickCount;
                    }
                }
            }



            if (SpellSlot.R.IsReady() && CassioUtils.Active("Combo.UseR") &&
                CassiopeiaMenu.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
            {
                var targets = HeroManager.Enemies.Where(x => x.IsValidTarget(Spells[SpellSlot.R].Range) && !x.IsZombie).OrderBy(x => x.Health);
                foreach (var targ in targets)
                {
                    var pred = Spells[SpellSlot.R].GetPrediction(targ);
                    if (pred.Hitchance >= CassioUtils.GetHitChance("Hitchance.R"))
                    {
                        int enemhitpred    = 0;
                        int enemfacingpred = 0;
                        foreach (var hero in targets)
                        {
                            if (Spells[SpellSlot.R].WillHit(hero, pred.CastPosition, 0, CassioUtils.GetHitChance("Hitchance.R")))
                            {
                                enemhitpred++;
                                if (hero.IsFacing(Player))
                                {
                                    enemfacingpred++;
                                }
                            }
                        }

                        if (enemfacingpred >= CassioUtils.GetSlider("Combo.Rcount"))
                        {
                            Spells[SpellSlot.R].Cast(pred.CastPosition);
                            return;
                        }
                        if (enemhitpred >= CassioUtils.GetSlider("Combo.Rcountnf") && CassioUtils.Active("Combo.UseRNF"))
                        {
                            Spells[SpellSlot.R].Cast(pred.CastPosition);
                            return;
                        }
                    }
                }

                var easycheck = HeroManager.Enemies.FirstOrDefault(x =>
                                                                   !x.IsInvulnerable && !x.IsZombie && x.IsValidTarget(Spells[SpellSlot.R].Range) &&
                                                                   x.IsFacing(Player) && x.isImmobile());

                if (easycheck != null)
                {
                    Spells[SpellSlot.R].Cast(easycheck.ServerPosition);
                    return;
                }
            }


            /* © ® ™ Work on patented algorithms in the future! XD © ® ™ */

            /*
             * if (SpellSlot.R.IsReady() && CassioUtils.Active("Combo.UseR") && CassiopeiaMenu.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
             * {
             *  var easycheck =
             *      HeroManager.Enemies.FirstOrDefault(
             *          x =>
             *              !x.IsInvulnerable && !x.IsZombie && x.IsValidTarget(Spells[SpellSlot.R].Range) &&
             *              x.IsFacing(Player) && x.isImmobile() && (Player.HealthPercent <= 20 || x.HealthPercent > 30));
             *
             *  if (easycheck != null)
             *  {
             *      Spells[SpellSlot.R].Cast(easycheck.ServerPosition);
             *      DontMove = true;
             *      Utility.DelayAction.Add(50, () => DontMove = false);
             *      return;
             *  }
             *  var targs = HeroManager.Enemies.Where(h => h.IsValidTarget(Spells[SpellSlot.R].Range));
             *  Dictionary<Vector3, double> Hitatpos = new Dictionary<Vector3, double>();
             *  Dictionary<Vector3, double> Hitatposfacing = new Dictionary<Vector3, double>();
             *  foreach (var t in targs)
             *  {
             *      var pred = Spells[SpellSlot.R].GetPrediction(t, false);
             *      var enemshit = pred.CastPosition.GetEnemiesInRange(Spells[SpellSlot.R].Width).Where(x=> x.Distance(Player) <= Spells[SpellSlot.R].Range);
             *      var counthit = enemshit.Count();
             *      var hitfacing = enemshit.Count(x => x.IsFacing(Player) && !x.IsDashing() && !x.IsZombie && !x.IsInvulnerable);
             *      var anymovingtome = enemshit.Any(x => x.isMovingToMe() || x.IsFacing(Player));
             *
             *      if (pred.Hitchance >= CassioUtils.GetHitChance("Hitchance.R") && anymovingtome)
             *      {
             *           Hitatposfacing.Add(pred.CastPosition, hitfacing);
             *      }
             *      if (CassioUtils.Active("Combo.UseRNF") && pred.Hitchance >= CassioUtils.GetHitChance("Hitchance.R"))
             *      {
             *          Hitatpos.Add(pred.CastPosition, counthit);
             *      }
             *  }
             *  if (Hitatposfacing.Any())
             *  {
             *      var bestpos = Hitatposfacing.Find(pos => pos.Value.Equals(Hitatposfacing.Values.Max())).Key;
             *      if (bestpos.IsValid() && bestpos.CountEnemiesInRange(Spells[SpellSlot.R].Width) >= CassioUtils.GetSlider("Combo.Rcount"))
             *      {
             *          Spells[SpellSlot.R].Cast(bestpos);
             *          DontMove = true;
             *          Utility.DelayAction.Add(50, () => DontMove = false);
             *      }
             *  }
             *  else if (Hitatpos.Any() && CassioUtils.Active("Combo.UseRNF") &&
             *           CassioUtils.GetSlider("Combo.Rcountnf") >= Hitatpos.Values.Max())
             *  {
             *      var bestposnf = Hitatpos.Find(pos => pos.Value.Equals(Hitatpos.Values.Max())).Key;
             *      if (bestposnf.IsValid() && bestposnf.CountEnemiesInRange(Spells[SpellSlot.R].Width) >= CassioUtils.GetSlider("Combo.Rcountnf"))
             *      {
             *          Spells[SpellSlot.R].Cast(bestposnf);
             *          DontMove = true;
             *          Utility.DelayAction.Add(50, () => DontMove = false);
             *      }
             *  }
             *
             * }
             */
        }