Exemple #1
0
        static void DangerDetector(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {
                var ally = args.Target as AIHeroClient;
                if (sender is AIHeroClient && sender.Team != Player.Team && ally != null && ally.IsAlly &&
                    (!Misc.Active("Misc.Nohealshop") || !ally.InShop()))
                {
                    if (!(ally.HealthPercent >= Misc.GetSlider("Healing.MinHP")) || Player.HealthPercent <= Misc.GetSlider("Healing.MinHPME"))
                    {
                        return;
                    }
                    if (Misc.Active("Healing.UseW"))
                    {
                        if (Spells[SpellSlot.W].IsReady() && !ally.IsMe && Misc.Active("w" + ally.ChampionName) && !ally.IsZombie &&
                            ally.Distance(Player) <= Spells[SpellSlot.W].Range)
                        {
                            var damage   = sender.GetSpellDamage(ally, args.SData.Name);
                            var afterdmg = ((ally.Health - damage) / (ally.MaxHealth)) * 100f;
                            if (ally.HealthPercent < Misc.GetSlider("wpct" + ally.ChampionName) ||
                                Misc.Active("wcheckdmgafter") && afterdmg < Misc.GetSlider("wpct" + ally.ChampionName))
                            {
                                if (Misc.Active("wonlyadc") &&
                                    (ally.NetworkId == myADC.NetworkId || myADC.HealthPercent <= Misc.GetSlider("wpct" + myADC.ChampionName)))
                                {
                                    if (myADC.Distance(Player) <= Spells[SpellSlot.W].Range)
                                    {
                                        Spells[SpellSlot.W].CastOnUnit(myADC);
                                    }
                                }
                                else if (!Misc.Active("wonlyadc"))
                                {
                                    Spells[SpellSlot.W].CastOnUnit(ally);
                                }
                            }
                        }
                    }
                    if (Misc.Active("Healing.UseR") && Misc.Active("r" + ally.ChampionName) && !ally.IsZombie)
                    {
                        var damage   = sender.GetSpellDamage(ally, args.SData.Name);
                        var afterdmg = ((ally.Health - damage) / (ally.MaxHealth)) * 100f;
                        if (ally.HealthPercent < Misc.GetSlider("rpct" + ally.ChampionName) ||
                            (Misc.Active("rcheckdmgafter") && afterdmg < Misc.GetSlider("rpct" + ally.ChampionName)))
                        {
                            var otherallies =
                                HeroManager.Allies.Where(
                                    x =>
                                    x != ally && Misc.Active("r" + x.ChampionName) && Misc.GetSlider("rpct" + x.ChampionName) > x.HealthPercent);

                            var count = otherallies.Count() + 1;

                            if (count >= Misc.GetSlider("minallies"))
                            {
                                if (Misc.Active("ultonlyadc") &&
                                    (ally.NetworkId == myADC.NetworkId || myADC.HealthPercent <= Misc.GetSlider("rpct" + myADC.ChampionName)))
                                {
                                    Spells[SpellSlot.R].Cast();
                                }

                                else if (!Misc.Active("ultonlyadc"))
                                {
                                    Spells[SpellSlot.R].Cast();
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemple #2
0
        private static void Killsteal()
        {
            if (!Misc.Active("Killsteal"))
            {
                return;
            }

            var targets = HeroManager.Enemies.Where(x => x.IsValidTarget() && !x.IsInvulnerable & !x.IsZombie);

            if (Spells[SpellSlot.Q].IsReady() && Misc.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);
                        if (pred != null && pred.Hitchance >= Misc.GetHitChance("Hitchance.Q"))
                        {
                            Spells[SpellSlot.Q].Cast(pred.CastPosition);
                            return;
                        }
                    }
                }

                if (Spells[SpellSlot.E].IsReady() && Misc.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)
                        {
                            var prede = Spells[SpellSlot.E].GetPrediction(etarget);
                            if (prede.Hitchance >= Misc.GetHitChance("Hitchance.E"))
                            {
                                Spells[SpellSlot.E].Cast(prede.CastPosition);
                            }
                        }
                    }
                }

                if (Spells[SpellSlot.E].IsReady() && Misc.Active("Killsteal.UseE") && Spells[SpellSlot.Q].IsReady() &&
                    Misc.Active("Killsteal.UseQ"))
                {
                    Obj_AI_Hero eqtarget =
                        targets.Where(x => x.Distance(Player.Position) < Spells[SpellSlot.E].Range && x.Distance(Player.Position) < Spells[SpellSlot.Q].Range && x.Health < Player.GetSpellDamage(x, SpellSlot.E) + Player.GetSpellDamage(x, SpellSlot.Q))
                        .MinOrDefault(x => x.Health);
                    if (eqtarget != null)
                    {
                        var prede = Spells[SpellSlot.E].GetPrediction(eqtarget);
                        var predq = Spells[SpellSlot.Q].GetPrediction(eqtarget);
                        if (prede.Hitchance >= HitChance.Medium && predq.Hitchance >= HitChance.Medium)
                        {
                            Spells[SpellSlot.E].Cast(prede.CastPosition);
                            Spells[SpellSlot.Q].Cast(predq.CastPosition);
                        }
                    }
                }

                if (Spells[IgniteSlot].IsReady() && Misc.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);
                    }
                }
            }
        }
Exemple #3
0
        private static void UltAdvanced()
        {
            List <Obj_AI_Hero> alliesinneed = HeroManager.Allies.Where(
                hero =>
                !hero.IsDead && !hero.IsZombie && (!Misc.Active("Misc.Nohealshop") || !hero.InShop()) && hero.Distance(Player) <= Spells[SpellSlot.W].Range && Misc.Active("r" + hero.ChampionName) &&
                hero.HealthPercent <= Misc.GetSlider("rpct" + hero.ChampionName) && hero.HealthPercent >= Misc.GetSlider("Healing.MinHP"))
                                              .ToList();

            var indanger = alliesinneed.Count(x => x.CountEnemiesInRange(600) > 0);

            if (alliesinneed.Count >= Misc.GetSlider("minallies") && indanger >= 1)
            {
                if (Misc.Active("ultonlyadc") && alliesinneed.Any(x => x.NetworkId == myADC.NetworkId))
                {
                    Spells[SpellSlot.R].Cast();
                }

                else if (!Misc.Active("ultonlyadc"))
                {
                    Spells[SpellSlot.R].Cast();
                }
            }
        }
Exemple #4
0
 static void Harass(Obj_AI_Hero target)
 {
     if (SorakaMenu.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
     {
         return;
     }
     if (Spells[SpellSlot.Q].IsReady() && Misc.Active("Harass.UseQ") && Player.ManaPercent > Misc.GetSlider("Harass.Mana") && target.Distance(Player) < Spells[SpellSlot.Q].Range)
     {
         var pred = Spells[SpellSlot.Q].GetPrediction(target, true);
         if (pred.Hitchance >= Misc.GetHitChance("Hitchance.Q"))
         {
             Spells[SpellSlot.Q].Cast(pred.CastPosition);
         }
     }
     if (Spells[SpellSlot.E].IsReady() && Misc.Active("Harass.UseE") && target.Distance(Player) < Spells[SpellSlot.E].Range)
     {
         var pred = Spells[SpellSlot.E].GetPrediction(target, true);
         if (pred.Hitchance >= Misc.GetHitChance("Hitchance.E"))
         {
             Spells[SpellSlot.E].Cast(pred.CastPosition);
         }
     }
 }
Exemple #5
0
        private static void UseW()
        {
            if (Player.HealthPercent <= Misc.GetSlider("Healing.MinHPME") || Misc.Active("onlywincdmg"))
            {
                return;
            }

            if (Spells[SpellSlot.W].IsReady())
            {
                var alliesinneed =
                    HeroManager.Allies.Where(
                        hero => !hero.IsMe && !hero.IsDead && (!Misc.Active("Misc.Nohealshop") || !hero.InShop()) && !hero.IsZombie && hero.Distance(Player) <= Spells[SpellSlot.W].Range &&
                        Misc.Active("w" + hero.ChampionName) &&
                        hero.HealthPercent <= Misc.GetSlider("wpct" + hero.ChampionName) && hero.HealthPercent >= Misc.GetSlider("Healing.MinHP"))
                    .ToList();

                if (Misc.Active("wonlyadc") && alliesinneed.Any(x => x.NetworkId == myADC.NetworkId))
                {
                    Spells[SpellSlot.W].CastOnUnit(myADC);
                }

                else if (!Misc.Active("wonlyadc"))
                {
                    Obj_AI_Hero allytoheal = null;

                    allytoheal = SorakaMenu.PriorityType() == SorakaMenu.HealPriority.PriorityList ? alliesinneed.MaxOrDefault(h => h.GetSetPriority()) : alliesinneed.MinOrDefault(x => x.HealthPercent);

                    if (allytoheal != null)
                    {
                        Spells[SpellSlot.W].CastOnUnit(allytoheal);
                    }
                }
            }
        }