Beispiel #1
0
        private static void OnGameLoad(EventArgs args)
        {
            try
            {
                player          = ObjectManager.Player;
                SPredictionMenu = SPrediction.Prediction.Initialize();

                /* SPredictionMenu.Item("PREDICTONLIST")
                 *  .SetValue(new StringList(new[] { "SPrediction", "Common Predicion" }, 1));*/
                //set default to common prediction
                var type = Type.GetType("UnderratedAIO.Champions." + player.ChampionName);
                if (type != null)
                {
                    Helpers.DynamicInitializer.NewInstance(type);
                }
                else
                {
                    var common = Type.GetType("UnderratedAIO.Champions." + "Other");
                    if (common != null)
                    {
                        Helpers.DynamicInitializer.NewInstance(common);
                    }
                }
                IncDamages = new IncomingDamage();
            }
            catch (Exception e)
            {
                Console.WriteLine("Failed To load: " + e);
            }
        }
Beispiel #2
0
        public static void Execute()
        {
            if (W.IsReady())
            {
                var incomingDamage = IncomingDamage.GetIncomingDamage(Player.Instance);

                if ((incomingDamage / Player.Instance.TotalHealthWithShields() * 100 >= Settings.Misc.MinDamage) ||
                    (incomingDamage > Player.Instance.Health))
                {
                    W.Cast();
                }
            }

            if (Settings.Misc.EnableKillsteal && !Player.Instance.IsRecalling())
            {
                foreach (
                    var target in StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero,
                                                                   x =>
                                                                   x.IsValidTargetCached() && IsInQRange(x) && !x.HasUndyingBuffA() &&
                                                                   (x.TotalHealthWithShields() < Player.Instance.GetSpellDamageCached(x, SpellSlot.Q))))
                {
                    if (HasEDebuff(target))
                    {
                        Player.Instance.Spellbook.CastSpell(SpellSlot.Q, target.Position);
                        return;
                    }

                    var qPrediction = Q.GetPrediction(target);

                    if (qPrediction.HitChance != HitChance.High)
                    {
                        continue;
                    }

                    Q.Cast(qPrediction.CastPosition);
                    return;
                }
            }

            if (Settings.Misc.AutoHarass && HasAnyOrbwalkerFlags)
            {
                Combo.ELogics();
            }

            if (!Settings.Misc.AutoHarass || !Settings.Combo.UseQ || !HasAnyOrbwalkerFlags ||
                Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) ||
                Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
            {
                return;
            }

            foreach (
                var corrosiveDebufTarget in
                CorrosiveDebufTargets.Where(
                    unit => (unit.Type == GameObjectType.AIHeroClient) && unit.IsValidTargetCached(1300)))
            {
                Player.Instance.Spellbook.CastSpell(SpellSlot.Q, corrosiveDebufTarget.Position);
                return;
            }
        }
        public static void Execute()
        {
            if (Settings.Misc.EnableKillsteal && !Player.Instance.IsRecalling())
            {
                foreach (
                    var qPrediction in
                    EntityManager.Heroes.Enemies.Where(
                        x => x.IsValidTarget(Q.Range) && !x.HasUndyingBuffA() && x.TotalHealthWithShields() < Player.Instance.GetSpellDamage(x, SpellSlot.Q))
                    .Select(source => Q.GetPrediction(source))
                    .Where(qPrediction => qPrediction.HitChance == HitChance.High))
                {
                    Q.Cast(qPrediction.CastPosition);
                    return;
                }
            }
            if (!W.IsReady())
            {
                return;
            }

            var incomingDamage = IncomingDamage.GetIncomingDamage(Player.Instance);

            if (!(incomingDamage / Player.Instance.TotalHealthWithShields() * 100 > Settings.Misc.MinDamage) &&
                !(incomingDamage > Player.Instance.Health))
            {
                return;
            }

            Console.WriteLine("casting W too much incoming damage...");
            W.Cast();
        }
        public static void Execute()
        {
            if (R.IsReady() && Settings.Combo.UseR && EntityManager.Heroes.Enemies.Any(x => x.IsValidTarget(R.Range) && x.HealthPercent < 50))
            {
                foreach (var target in EntityManager.Heroes.Enemies.Where(x => x.IsValidTarget(R.Range)).OrderBy(TargetSelector.GetPriority))
                {
                    var incomingDamage = IncomingDamage.GetIncomingDamage(target);

                    var damage = (incomingDamage + Damage.GetEPhysicalDamage(target) +
                                  Damage.GetRDamage(target)) - 25;

                    if (target.Hero == Champion.Blitzcrank && !target.HasBuff("BlitzcrankManaBarrierCD") && !target.HasBuff("ManaBarrier"))
                    {
                        damage -= target.Mana / 2;
                    }

                    if (target.Distance(Player.Instance) < Player.Instance.GetAutoAttackRange() &&
                        target.TotalHealthWithShields() > Player.Instance.GetAutoAttackDamage(target, true) * 2 && target.TotalHealthWithShields() < damage)
                    {
                        R.Cast(target);
                        Console.WriteLine("[DEBUG] Casting R on : {0} to killsteal ! v 1", target.Hero);
                    }
                }
            }
        }
Beispiel #5
0
 public Nocturne()
 {
     IncDamages = new IncomingDamage();
     InitNocturne();
     InitMenu();
     Drawing.OnDraw += Game_OnDraw;
     Game.OnUpdate  += Game_OnGameUpdate;
     Obj_AI_Base.OnProcessSpellCast += AIHeroClient_OnProcessSpellCast;
 }
Beispiel #6
0
 public Shaco()
 {
     IncDamages = new IncomingDamage();
     InitShaco();
     InitMenu();
     Game.OnUpdate  += Game_OnGameUpdate;
     Drawing.OnDraw += Game_OnDraw;
     Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast;
 }
Beispiel #7
0
 public TahmKench()
 {
     IncDamages = new IncomingDamage();
     InitTahmKench();
     InitMenu();
     Drawing.OnDraw += Game_OnDraw;
     Game.OnUpdate  += Game_OnGameUpdate;
     Obj_AI_Base.OnProcessSpellCast += Game_ProcessSpell;
     AntiGapcloser.OnEnemyGapcloser += OnEnemyGapcloser;
 }
Beispiel #8
0
 public Yorick()
 {
     IncDamages = new IncomingDamage();
     InitYorick();
     InitMenu();
     Game.OnUpdate                  += Game_OnGameUpdate;
     Orbwalker.OnPostAttack         += AfterAttack;
     Orbwalker.OnPreAttack          += beforeAttack;
     Drawing.OnDraw                 += Game_OnDraw;
     Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast;
 }
Beispiel #9
0
 public Rumble()
 {
     IncDamages = new IncomingDamage();
     InitRumble();
     InitMenu();
     Drawing.OnDraw += Game_OnDraw;
     Game.OnUpdate  += Game_OnGameUpdate;
     Obj_AI_Base.OnProcessSpellCast += Game_ProcessSpell;
     CustomEvents.Unit.OnDash       += Unit_OnDash;
     AntiGapcloser.OnEnemyGapcloser += OnEnemyGapcloser;
 }
Beispiel #10
0
 public Sion()
 {
     IncDamages = new IncomingDamage();
     InitSion();
     InitMenu();
     Drawing.OnDraw += Game_OnDraw;
     Game.OnUpdate  += Game_OnGameUpdate;
     Obj_AI_Base.OnProcessSpellCast += Game_ProcessSpell;
     AntiGapcloser.OnEnemyGapcloser += OnEnemyGapcloser;
     Game.OnProcessPacket           += Game_OnProcessPacket;
     Game.OnWndProc += Game_OnWndProc;
 }
Beispiel #11
0
 public Shen()
 {
     IncDamages = new IncomingDamage();
     InitShen();
     InitMenu();
     Game.OnUpdate  += Game_OnGameUpdate;
     Drawing.OnDraw += Game_OnDraw;
     AntiGapcloser.OnEnemyGapcloser     += OnEnemyGapcloser;
     Interrupter2.OnInterruptableTarget += OnPossibleToInterrupt;
     AttackableUnit.OnDamage            += Obj_AI_Base_OnDamage;
     Obj_AI_Base.OnProcessSpellCast     += Game_ProcessSpell;
 }
Beispiel #12
0
 public static void OnLoad()
 {
     IncDamages = new IncomingDamage();
     InitRenekton();
     InitMenu();
     Chat.Print("<font color='#9933FF'>Soresu </font><font color='#FFFFFF'>- Renekton</font>");
     Game.OnUpdate                            += Game_OnGameUpdate;
     Orbwalker.OnPreAttack                    += beforeAttack;
     Orbwalker.OnPostAttack                   += afterAttack;
     Obj_AI_Base.OnProcessSpellCast           += Obj_AI_Base_OnProcessSpellCast;
     Drawing.OnDraw                           += Game_OnDraw;
     Utility.HpBarDamageIndicator.DamageToUnit = ComboDamage;
 }
Beispiel #13
0
 public static void OnLoad()
 {
     IncDamages = new IncomingDamage();
     InitOlaf();
     InitMenu();
     Chat.Print("<font color='#9933FF'>Soresu </font><font color='#FFFFFF'>- Olaf</font>");
     Game.OnUpdate  += Game_OnUpdate;
     Drawing.OnDraw += Drawing_OnDraw;
     Obj_AI_Base.OnProcessSpellCast           += Obj_AI_Base_OnProcessSpellCast;
     Obj_AI_Base.OnDelete                     += Obj_AI_Base_OnDelete;
     Obj_AI_Base.OnCreate                     += Obj_AI_Base_OnCreate;
     Utility.HpBarDamageIndicator.DamageToUnit = ComboDamage;
     Console.WriteLine(Game.IP);
 }
        private static void OnLoadingComplete(EventArgs args)
        {
            if (Player.Instance.ChampionName != ChampName)
            {
                return;
            }

            Config.Initialize();
            SpellManager.Initialize();
            ModeManager.Initialize();

            Drawing.OnDraw                 += OnDraw;
            Drawing.OnEndScene             += Drawing_OnEndScene;
            Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast;
            Game.OnTick += Game_OnTick;
            HPBarIndicator.Initalize();
            PermaShow.Initalize();
            Orbwalker.OnPreAttack += Orbwalker_OnPreAttack;

            foreach (var enemy in EntityManager.Heroes.Enemies)
            {
                if (enemy.Hero == Champion.Rengar)
                {
                    GameObject.OnCreate += GameObject_OnCreate;
                }
            }

            InfoText    = new Text[3];
            InfoText[0] = new Text("", new Font("calibri", 18, FontStyle.Regular));

            var ignite = Player.Spells.FirstOrDefault(s => s.Name.ToLower().Contains("summonerdot"));

            if (ignite != null)
            {
                Ignite = new Spell.Targeted(ignite.Slot, 600);
            }

            if (Config.MiscMenu.SkinHackEnabled)
            {
                Player.SetSkin(Player.Instance.BaseSkinName, Config.MiscMenu.SkinId);
            }

            Rabadon = new Item(3089);
            Seraph  = new Item(3040);

            TearStack.Initializer();
            IncomingDamage.Initializer();

            Helpers.PrintInfoMessage("Addon loaded !");
        }
Beispiel #15
0
        public static void Execute()
        {
            if (Q.IsReady() && Settings.Harass.UseQ && !IsPreAttack && (Player.Instance.ManaPercent >= Settings.Harass.MinManaQ))
            {
                var target = TargetSelector.GetTarget(Q.Range, DamageType.Physical);

                if (target != null && !target.HasUndyingBuffA() && !target.HasSpellShield())
                {
                    var qPrediction = Q.GetPrediction(target);

                    if ((qPrediction.HitChance >= HitChance.Medium) &&
                        (target.TotalHealthWithShields() <
                         Player.Instance.GetAutoAttackDamageCached(target, true) * 2 +
                         Player.Instance.GetSpellDamageCached(target, SpellSlot.Q)))
                    {
                        Q.Cast(qPrediction.CastPosition);
                    }
                    else if ((qPrediction.HitChancePercent >= 65) &&
                             (Player.Instance.Mana - 60 > (R.IsReady() ? 100 : 0)))
                    {
                        Q.Cast(qPrediction.CastPosition);
                    }
                }
            }

            if (!W.IsReady() || !Settings.Harass.UseW || !IsPostAttack || Player.Instance.ManaPercent < Settings.Harass.MinManaQ)
            {
                return;
            }

            {
                var target = TargetSelector.GetTarget(Player.Instance.GetAutoAttackRange(), DamageType.Physical);

                if (target != null && (target.TotalHealthWithShields() - IncomingDamage.GetIncomingDamage(target) <
                                       Player.Instance.GetAutoAttackDamageCached(target, true) * 2))
                {
                    Misc.PrintDebugMessage($"Casting W on {target.Hero} variant 1");
                    W.Cast();
                }
                else if (target != null && Player.Instance.IsInRangeCached(target, Player.Instance.GetAutoAttackRange() - 50))
                {
                    Misc.PrintDebugMessage($"Casting W on {target.Hero} variant 2");
                    W.Cast();
                }
            }
        }
Beispiel #16
0
        public static void Execute()
        {
            if (Q.IsReady() && Settings.Harass.UseQ && Player.Instance.ManaPercent >= Settings.Harass.MinManaQ)
            {
                var target = TargetSelector.GetTarget(Q.Range, DamageType.Physical);

                if (target != null && !target.HasUndyingBuffA() && !target.HasSpellShield())
                {
                    var qPrediction = Q.GetPrediction(target);

                    if (qPrediction.HitChance >= HitChance.Medium && target.TotalHealthWithShields() < Player.Instance.GetAutoAttackDamage(target, true) * 2 + Player.Instance.GetSpellDamage(target, SpellSlot.Q))
                    {
                        Console.WriteLine("[DEBUG] Casting Q on {0} variant 1", target.Hero);
                        Q.Cast(qPrediction.CastPosition);
                    }
                    else if (qPrediction.HitChance >= HitChance.High && Player.Instance.Mana - 60 > 100 && Player.Instance.IsInRange(target, Player.Instance.GetAutoAttackRange()))
                    {
                        Console.WriteLine("[DEBUG] Casting Q on {0} variant 2", target.Hero);
                        Q.Cast(qPrediction.CastPosition);
                    }
                }
            }

            if (!W.IsReady() || !Settings.Harass.UseW || !IsPostAttack || Player.Instance.ManaPercent < Settings.Harass.MinManaQ)
            {
                return;
            }

            {
                var target = TargetSelector.GetTarget(Player.Instance.GetAutoAttackRange(), DamageType.Physical);

                if (target != null &&
                    target.Health - IncomingDamage.GetIncomingDamage(target) <
                    Player.Instance.GetAutoAttackDamage(target, true))
                {
                    Console.WriteLine("[DEBUG] Casting W on {0} variant 1", target.Hero);
                    W.Cast();
                }
                else if (target != null && target.Distance(Player.Instance) < Player.Instance.GetAutoAttackRange() - 100)
                {
                    Console.WriteLine("[DEBUG] Casting W on {0} variant 2", target.Hero);
                    W.Cast();
                }
            }
        }
Beispiel #17
0
        public static void Execute()
        {
            if (R.IsReady())
            {
                var enemy = EntityManager.Heroes.Enemies.Where(
                    x => x.IsValidTarget(R.Range) && (x.TotalHealthWithShields() - IncomingDamage.GetIncomingDamage(x) < Damage.GetRDamage(x)))
                            .OrderBy(TargetSelector.GetPriority).ThenByDescending(x => R.GetPrediction(x).HitChancePercent).FirstOrDefault();

                if (enemy != null)
                {
                    var rPrediction = R.GetPrediction(enemy);

                    if (((HasKogMawRBuff && (GetKogMawRBuff.Count <= Settings.Combo.RAllowedStacks + 1)) || !HasKogMawRBuff) && rPrediction.HitChancePercent >= Settings.Combo.RHitChancePercent)
                    {
                        R.Cast(rPrediction.CastPosition);
                    }
                }
            }
        }
Beispiel #18
0
        public static void Execute()
        {
            if (R.IsReady() && Settings.Combo.UseR && EntityManager.Heroes.Enemies.Any(x => x.IsValidTarget(Settings.Combo.RMaximumRange) && x.HealthPercent < 50 && !x.HasSpellShield() && !x.HasUndyingBuffA()))
            {
                foreach (var target in EntityManager.Heroes.Enemies.Where(x => x.IsValidTarget(Settings.Combo.RMaximumRange)).OrderBy(TargetSelector.GetPriority))
                {
                    var incomingDamage = IncomingDamage.GetIncomingDamage(target);

                    var damage = incomingDamage + Player.Instance.GetSpellDamage(target, SpellSlot.R) - 25;

                    if (target.Hero == Champion.Blitzcrank && !target.HasBuff("BlitzcrankManaBarrierCD") && !target.HasBuff("ManaBarrier"))
                    {
                        damage -= target.Mana / 2;
                    }

                    if (target.Distance(Player.Instance) > Player.Instance.GetAutoAttackRange() + 200 &&
                        target.TotalHealthWithShields(true) < damage)
                    {
                        var rPrediction = R.GetPrediction(target);

                        if (rPrediction.HitChance >= HitChance.High || rPrediction.HitChance >= HitChance.Collision)
                        {
                            if (rPrediction.HitChance == HitChance.Collision)
                            {
                                var polygon = new Geometry.Polygon.Rectangle(Player.Instance.Position,
                                                                             rPrediction.CastPosition, 120);

                                if (!EntityManager.Heroes.Enemies.Any(x => polygon.IsInside(x)))
                                {
                                    Console.WriteLine("[DEBUG] Casting R on : {0} to killsteal ! v 1", target.Hero);
                                    R.Cast(rPrediction.CastPosition);
                                }
                            }
                            else
                            {
                                Console.WriteLine("[DEBUG] Casting R on : {0} to killsteal ! v 1", target.Hero);
                                R.Cast(rPrediction.CastPosition);
                            }
                        }
                    }
                }
            }
        }
Beispiel #19
0
        private static void Orbwalker_OnPostAttack(AttackableUnit target, EventArgs args)
        {
            IsPostAttack = true;

            if (!(target is AIHeroClient) || !Settings.Misc.EKs || !target.IsValidTarget(E.Range))
            {
                return;
            }

            var enemy = (AIHeroClient)target;

            if (HasSilverDebuff(enemy) && GetSilverDebuff(enemy).Count == 1)
            {
                Core.DelayAction(() =>
                {
                    if (Damage.IsKillableFromSilverEAndAuto(enemy) && enemy.Health > IncomingDamage.GetIncomingDamage(enemy))
                    {
                        Console.WriteLine("[DEBUG] casting e to ks");
                        E.Cast(enemy);
                    }
                }, 40 + Game.Ping / 2);
            }
        }
Beispiel #20
0
 private static void OnGameLoad(EventArgs args)
 {
     try
     {
         var type = Type.GetType("UnderratedAIO.Champions." + player.ChampionName);
         if (type != null)
         {
             Helpers.DynamicInitializer.NewInstance(type);
         }
         else
         {
             var common = Type.GetType("UnderratedAIO.Champions." + "Other");
             if (common != null)
             {
                 Helpers.DynamicInitializer.NewInstance(common);
             }
         }
         IncDamages = new IncomingDamage();
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
     }
 }
Beispiel #21
0
        public static void Execute()
        {
            if (Q.IsReady() && IsPreAttack && Settings.Combo.UseQ)
            {
                var target = TargetSelector.GetTarget(Player.Instance.GetAutoAttackRange(), DamageType.Physical);

                if (target != null)
                {
                    if (EntityManager.Heroes.Enemies.Any(x => x.IsValidTarget(Player.Instance.GetAutoAttackRange() - 50)))
                    {
                        Q.Cast();
                    }
                }
            }

            if (W.IsReady() && Settings.Combo.UseW && Player.Instance.Mana - 50 > 100)
            {
                var target = TargetSelector.GetTarget(W.Range, DamageType.Physical);

                if (target != null)
                {
                    var wPrediction = GetWPrediction(target);

                    if (wPrediction != null && wPrediction.HitChance >= HitChance.High)
                    {
                        W.Cast(wPrediction.CastPosition);
                    }
                }
            }

            if (E.IsReady() && Settings.Combo.UseE)
            {
                foreach (var source in EntityManager.Heroes.Enemies.Where(x => x.IsUserInvisibleFor(500)))
                {
                    var data = source.GetVisibilityTrackerData();

                    if (data.LastHealthPercent < 25 && data.LastPosition.Distance(Player.Instance) < 1000)
                    {
                        E.Cast(data.LastPath);
                    }
                }
            }

            if (R.IsReady() && Settings.Combo.UseR)
            {
                var target = TargetSelector.GetTarget(Settings.Combo.RMaximumRange, DamageType.Physical);

                if (target != null && !target.IsUnderTurret() && !target.HasSpellShield() && !target.HasUndyingBuffA() && target.Distance(Player.Instance) > Settings.Combo.RMinimumRange && target.Health - IncomingDamage.GetIncomingDamage(target) > 100)
                {
                    var damage = 0f;

                    if (Player.Instance.Mana > 200 && target.IsValidTarget(W.Range))
                    {
                        damage = Player.Instance.GetSpellDamage(target, SpellSlot.R) +
                                 Player.Instance.GetSpellDamage(target, SpellSlot.W) +
                                 Player.Instance.GetAutoAttackDamage(target) * 4;
                    }
                    else if (Player.Instance.Mana > 150 && target.IsValidTarget(W.Range))
                    {
                        damage = Player.Instance.GetSpellDamage(target, SpellSlot.R) +
                                 Player.Instance.GetAutoAttackDamage(target) * 4;
                    }

                    var rPrediction = R.GetPrediction(target);

                    if (damage > target.TotalHealthWithShields() && (rPrediction.HitChance >= HitChance.High))
                    {
                        R.Cast(rPrediction.CastPosition);
                    }
                }
            }
        }
Beispiel #22
0
        public static void Execute()
        {
            if (Settings.Misc.EnableKillsteal)
            {
                var enemies =
                    StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero,
                                                     x => x.IsValidTarget(Q.Range) && (x.HealthPercent < 20) && !x.HasUndyingBuffA() &&
                                                     !x.HasSpellShield()).ToList();

                if (enemies.Any() && !IsPreAttack)
                {
                    if (Q.IsReady())
                    {
                        foreach (var enemy in enemies.Where(x => x.TotalHealthWithShields() < Player.Instance.GetSpellDamageCached(x, SpellSlot.Q)))
                        {
                            Q.CastMinimumHitchance(enemy, 65);
                            return;
                        }
                    }
                    else if (W.IsReady())
                    {
                        foreach (var enemy in enemies.Where(x => x.TotalHealthWithShields(true) < Player.Instance.GetSpellDamageCached(x, SpellSlot.W)))
                        {
                            W.CastMinimumHitchance(enemy, 65);
                            return;
                        }
                    }
                }
            }

            if (Q.IsReady() && !Player.Instance.IsRecalling() && !IsPreAttack && Settings.Misc.KeepPassiveStacks && (GetPassiveBuffAmount >= 4) && (GetPassiveBuff.EndTime - Game.Time < 1.5f) && (GetPassiveBuff.EndTime - Game.Time > 0.3f) && (Player.Instance.ManaPercent > 25) && !StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero).Any(x => x.IsValidTargetCached(Q.Range)))
            {
                foreach (var minion in StaticCacheProvider.GetMinions(CachedEntityType.CombinedAttackableMinions, x => x.IsValidTarget(Q.Range)))
                {
                    Q.Cast(minion);
                    return;
                }
            }

            if (W.IsReady() && !IsPreAttack && !Player.Instance.IsRecalling() && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) && Settings.Harass.UseW && (Player.Instance.ManaPercent >= Settings.Harass.MinManaQ))
            {
                foreach (var target in StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero, x =>
                                                                        Settings.Harass.IsAutoHarassEnabledFor(x) && x.IsValidTargetCached(W.Range) &&
                                                                        !x.HasUndyingBuffA() && !x.HasSpellShield()).OrderByDescending(x => Player.Instance.GetSpellDamageCached(x, SpellSlot.W)))
                {
                    W.CastMinimumHitchance(target, 75);
                    return;
                }
            }

            if (Q.IsReady() && !IsPreAttack && Settings.Harass.UseQ && (Player.Instance.ManaPercent >= Settings.Harass.MinManaQ) &&
                !Player.Instance.HasSheenBuff() && (Player.Instance.CountEnemiesInRange(Player.Instance.GetAutoAttackRange()) == 0))
            {
                var immobileEnemies = StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero,
                                                                       x => Settings.Harass.IsAutoHarassEnabledFor(x) && x.IsValidTargetCached(Q.Range) && !x.HasUndyingBuffA() &&
                                                                       !x.HasSpellShield() && (x.GetMovementBlockedDebuffDuration() > 0.3f)).ToList();

                if (immobileEnemies.Any() && !IsPreAttack)
                {
                    foreach (
                        var qPrediction in
                        from immobileEnemy in immobileEnemies.OrderByDescending(
                            x => Player.Instance.GetSpellDamageCached(x, SpellSlot.Q))
                        where (immobileEnemy.GetMovementBlockedDebuffDuration() > Player.Instance.Distance(immobileEnemy) / Q.Speed + 0.25f) &&
                        !Player.Instance.HasSheenBuff()
                        select Q.GetPrediction(immobileEnemy)
                        into qPrediction
                        where qPrediction.HitChancePercent > 60
                        select qPrediction)
                    {
                        Q.Cast(qPrediction.CastPosition);
                        return;
                    }
                }

                else if (!Player.Instance.IsRecalling() && !IsPreAttack && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                {
                    foreach (var target in StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero, x =>
                                                                            Settings.Harass.IsAutoHarassEnabledFor(x) && x.IsValidTargetCached(Q.Range) &&
                                                                            !x.HasUndyingBuffA() && !x.HasSpellShield()).OrderByDescending(x => Player.Instance.GetSpellDamageCached(x, SpellSlot.Q)))
                    {
                        Q.CastMinimumHitchance(target, 75);
                        return;
                    }
                }
            }

            if (!R.IsReady() || !Settings.Combo.UseR)
            {
                return;
            }

            if (Player.Instance.CountEnemyHeroesInRangeWithPrediction(
                    (int)(Player.Instance.GetAutoAttackRange() + 100), R.CastDelay) == 0)
            {
                var rKillable = StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero,
                                                                 x =>
                                                                 x.IsValidTarget(Settings.Misc.MaxRRangeKillsteal) && !x.HasUndyingBuffA() && !x.HasSpellShield())
                                .ToList();

                foreach (var rPrediction in
                         from targ in rKillable
                         let health = targ.TotalHealthWithShields(true) - IncomingDamage.GetIncomingDamage(targ)
                                      where health < Damage.GetRDamage(targ)
                                      select R.GetPrediction(targ)
                                      into rPrediction
                                      where rPrediction.HitChancePercent >= 65
                                      select rPrediction)
                {
                    R.Cast(rPrediction.CastPosition);
                }
            }

            var t = TargetSelector.GetTarget(2500, DamageType.Physical);

            if (t == null || !Settings.Combo.RKeybind)
            {
                return;
            }

            var rPrediciton = R.GetPrediction(t);

            if (rPrediciton.HitChancePercent >= 65)
            {
                R.Cast(rPrediciton.CastPosition);
            }
        }
Beispiel #23
0
        public static void Execute()
        {
            if (Settings.Combo.JumpOnMinions && Orbwalker.CanAutoAttack)
            {
                var target = TargetSelector.GetTarget(1500, DamageType.Physical);

                if (target != null && !Player.Instance.IsInAutoAttackRange(target))
                {
                    Orbwalker.ForcedTarget =
                        EntityManager.MinionsAndMonsters.CombinedAttackable.FirstOrDefault(
                            unit => Player.Instance.IsInRange(unit, Player.Instance.GetAutoAttackRange()));
                }
            }

            if (E.IsReady() && Settings.Combo.UseE)
            {
                var enemiesWithRendBuff =
                    EntityManager.Heroes.Enemies.Count(
                        unit => unit.IsValid && unit.IsValidTarget(E.Range) && unit.HasRendBuff());

                if (enemiesWithRendBuff == 0)
                {
                    return;
                }

                if (Settings.Combo.UseEToSlow)
                {
                    var count =
                        EntityManager.MinionsAndMonsters.CombinedAttackable.Count(
                            unit => unit.IsValid && unit.IsValidTarget(E.Range) && unit.IsTargetKillableByRend());

                    if (count >= Settings.Combo.UseEToSlowMinMinions)
                    {
                        Console.WriteLine("[DEBUG] Casting E to slow.");
                        E.Cast();
                    }
                }

                if (Settings.Combo.UseEBeforeEnemyLeavesRange && enemiesWithRendBuff == 1)
                {
                    var enemyUnit =
                        EntityManager.Heroes.Enemies.Find(unit => !unit.IsDead && unit.IsValid && unit.IsValidTarget(E.Range) && unit.HasRendBuff());

                    if (enemyUnit != null && enemyUnit.CanCastEOnUnit() && enemyUnit.Distance(Player.Instance) > E.Range - 100)
                    {
                        var percentDamage = enemyUnit.GetRendDamageOnTarget() / enemyUnit.TotalHealthWithShields() * 100;
                        if (percentDamage >= Settings.Combo.MinDamagePercToUseEBeforeEnemyLeavesRange)
                        {
                            E.Cast();
                            Console.WriteLine("[DEBUG] Casting E cause it will deal " + percentDamage + " percent of enemy hp.");
                        }
                    }
                }

                if (Settings.Combo.UseEBeforeDeath && Player.Instance.HealthPercent < 5 && IncomingDamage.GetIncomingDamage(Player.Instance) > Player.Instance.Health)
                {
                    E.Cast();
                    Console.WriteLine("[DEBUG] Casting E before death.");
                }
            }
        }
Beispiel #24
0
        public static void Execute()
        {
            if (Q.IsReady() && IsPreAttack && Settings.Combo.UseQ)
            {
                if (StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero)
                    .Any(x => x.IsValidTarget(Player.Instance.GetAutoAttackRange() - 50)))
                {
                    Q.Cast();
                }
            }

            if ((WTarget != null) && W.IsReady() && Settings.Combo.DoubleWKeybind)
            {
                var target =
                    StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero)
                    .FirstOrDefault(x => x.NetworkId == WTarget.NetworkId);

                if (target != null)
                {
                    var wPrediction = W.GetPrediction(target);

                    if (wPrediction.HitChance >= HitChance.Medium)
                    {
                        WTarget = null;

                        W.Cast(wPrediction.CastPosition);
                    }
                }
                else
                {
                    WTarget = null;
                }
            }

            if (W.IsReady() && IsCatingW)
            {
                W.Cast(
                    Player.Instance.Position.Extend(WStartPos,
                                                    WStartPos.DistanceCached(Player.Instance) > 850
                            ? 850
                            : WStartPos.DistanceCached(Player.Instance)).To3D());
                IsCatingW = false;
            }

            if (W.IsReady() && Settings.Combo.UseW && R.IsReady() && Settings.Combo.UseR &&
                (Player.Instance.Mana - 160 > 90) && (Player.Instance.HealthPercent > 25))
            {
                var target = TargetSelector.GetTarget(900, DamageType.Physical);

                if ((target != null) && (target.CountEnemiesInRangeCached(500) == 1) &&
                    (target.DistanceCached(Player.Instance) > R.Range))
                {
                    var damage = IncomingDamage.GetIncomingDamage(target) + Damage.GetRDamage(target) +
                                 Damage.GetEPhysicalDamage(target);

                    if (HasExplosiveChargeBuff(target) && (target.Health < damage))
                    {
                        var wPrediction = W.GetPrediction(target);

                        if (wPrediction.HitChance >= HitChance.Medium)
                        {
                            IsCatingW = true;
                            Core.DelayAction(() => IsCatingW = false, 2000);
                            WStartPos = Player.Instance.Position;

                            W.Cast(wPrediction.CastPosition);
                        }
                    }
                }
            }

            if (E.IsReady() && IsPreAttack && Settings.Combo.UseE)
            {
                var possibleTargets = StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero,
                                                                       x => x.IsValidTargetCached(E.Range + 200) && Settings.Combo.IsEnabledFor(x));

                var target  = TargetSelector.GetTarget(possibleTargets, DamageType.Physical);
                var target2 = TargetSelector.GetTarget(E.Range, DamageType.Physical);

                if ((target2 != null) && Settings.Combo.IsEnabledFor(target) &&
                    (target2.TotalHealthWithShields() <
                     Damage.GetEPhysicalDamage(target2, 2) + Player.Instance.GetAutoAttackDamageCached(target2)))
                {
                    E.Cast(target2);
                }
                else if ((target != null) && Settings.Combo.IsEnabledFor(target) && target.IsValidTargetCached(E.Range) &&
                         Player.Instance.IsInRangeCached(target, Player.Instance.GetAutoAttackRange() - 50))
                {
                    E.Cast(target);
                }
            }

            if (!R.IsReady() || !Settings.Combo.UseR || !Settings.Combo.UseRVsMelees ||
                (Player.Instance.HealthPercent > 25) || !StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero)
                .Any(x => x.IsMelee && x.IsValidTarget(500) && (x.HealthPercent > 50)))
            {
                return;
            }

            foreach (
                var enemy in
                StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero,
                                                 x =>
                                                 x.IsMelee && x.IsMovingTowards(Player.Instance, 500) && x.IsValidTarget(500) &&
                                                 (x.HealthPercent > 50))
                .OrderByDescending(TargetSelector.GetPriority)
                .ThenBy(x => x.DistanceCached(Player.Instance)))
            {
                R.Cast(enemy);
            }
        }
Beispiel #25
0
        private static void HandleSummoners()
        {
            if (Summoners == null)
            {
                return;
            }

            if (Summoners.Any(x => x.Value?.Item1 == Summoner.Heal) &&
                MenuManager.MenuValues["Activator.SummonersMenu.UseHeal"] &&
                (IncomingDamage.GetIncomingDamage(Player.Instance) >
                 Player.Instance.TotalHealthWithShields() - 100 * Player.Instance.CountEnemiesInRangeCached(900)))
            {
                var heal = Player.Instance.Spellbook.GetSpell(Summoners.First(x => x.Value?.Item1 == Summoner.Heal).Key);

                if (heal.IsReady)
                {
                    Player.Instance.Spellbook.CastSpell(heal.Slot);
                    return;
                }
            }

            if (Summoners.Any(x => x.Value?.Item1 == Summoner.Barrier) &&
                MenuManager.MenuValues["Activator.SummonersMenu.UseBarrier"] &&
                (IncomingDamage.GetIncomingDamage(Player.Instance) >
                 Player.Instance.TotalHealthWithShields() - 100 * Player.Instance.CountEnemiesInRangeCached(900)))
            {
                var barrier =
                    Player.Instance.Spellbook.GetSpell(Summoners.First(x => x.Value?.Item1 == Summoner.Barrier).Key);

                if (barrier.IsReady)
                {
                    Player.Instance.Spellbook.CastSpell(barrier.Slot);
                    return;
                }
            }

            if (Summoners.Any(x => x.Value?.Item1 == Summoner.Ignite) &&
                MenuManager.MenuValues["Activator.SummonersMenu.UseIgnite"] &&
                StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero).Any(x => x.IsValidTargetCached(620)))
            {
                var ignite =
                    Player.Instance.Spellbook.GetSpell(Summoners.First(x => x.Value?.Item1 == Summoner.Ignite).Key);

                if (ignite.IsReady)
                {
                    foreach (
                        var target in
                        StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero,
                                                         x =>
                                                         x.IsValidTargetCached(620) &&
                                                         Player.Instance.GetSummonerSpellDamage(x, DamageLibrary.SummonerSpells.Ignite) >
                                                         x.TotalHealthWithShields() && !x.HasUndyingBuffA()))
                    {
                        Player.Instance.Spellbook.CastSpell(ignite.Slot, target);
                        break;
                    }
                }
            }

            if (Summoners.Any(x => x.Value != null && x.Value.Item1.HasFlag(Summoner.Smite)) && MenuManager.MenuValues["Activator.SummonersMenu.UseSmite"])
            {
                var smiteSlot =
                    Summoners.Where(x => x.Value != null && x.Value.Item1.HasFlag(Summoner.Smite)).Select(x => x.Key).FirstOrDefault();

                if (smiteSlot == SpellSlot.Unknown)
                {
                    return;
                }

                var smite = Player.Instance.Spellbook.GetSpell(smiteSlot);

                if (smite == null)
                {
                    return;
                }

                if (smite.IsReady)
                {
                    if (StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero).Any(x => x.IsValidTargetCached(520)) &&
                        MenuManager.MenuValues["Activator.SummonersMenu.UseSmiteInCombo"] && Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        if (Summoners.Any(x => (x.Value != null && x.Value.Item1.HasFlag(Summoner.ChillingSmite)) || (x.Value != null && x.Value.Item1.HasFlag(Summoner.ChallengingSmite))))
                        {
                            var target = TargetSelector.GetTarget(520, DamageType.Physical);
                            if (target != null)
                            {
                                Player.Instance.Spellbook.CastSpell(smite.Slot, target);
                                return;
                            }
                        }
                    }

                    if (StaticCacheProvider.GetMinions(CachedEntityType.CombinedAttackableMinions).Any(x => x.IsValidTargetCached(520)))
                    {
                        var bigMonster = StaticCacheProvider.GetMinions(CachedEntityType.CombinedAttackableMinions)
                                         .FirstOrDefault(
                            x => BigMonstersNames.Any(m => m.Contains(x.BaseSkinName)));

                        var buff = StaticCacheProvider.GetMinions(CachedEntityType.CombinedAttackableMinions)
                                   .FirstOrDefault(
                            x => BuffsNames.Any(m => m.Contains(x.BaseSkinName)));

                        var epicMonster = StaticCacheProvider.GetMinions(CachedEntityType.CombinedAttackableMinions)
                                          .FirstOrDefault(
                            x => EpicMonstersNames.Any(m => m.Contains(x.BaseSkinName)));

                        if (bigMonster != null && MenuManager.MenuValues["Activator.SummonersMenu.SmiteBigMonsters"] &&
                            Player.Instance.GetSummonerSpellDamage(bigMonster, DamageLibrary.SummonerSpells.Smite) >
                            bigMonster.Health)
                        {
                            Player.Instance.Spellbook.CastSpell(smite.Slot, bigMonster);
                        }
                        else if (buff != null && MenuManager.MenuValues["Activator.SummonersMenu.SmiteBuffs"] &&
                                 Player.Instance.GetSummonerSpellDamage(buff, DamageLibrary.SummonerSpells.Smite) >
                                 buff.Health)
                        {
                            Player.Instance.Spellbook.CastSpell(smite.Slot, buff);
                        }
                        else if (epicMonster != null && MenuManager.MenuValues["Activator.SummonersMenu.SmiteEpicMonsters"] &&
                                 Player.Instance.GetSummonerSpellDamage(epicMonster, DamageLibrary.SummonerSpells.Smite) >
                                 epicMonster.Health)
                        {
                            Player.Instance.Spellbook.CastSpell(smite.Slot, epicMonster);
                        }
                    }
                }
            }
        }
Beispiel #26
0
        public static void Execute()
        {
            if (R.IsReady() && Settings.Combo.UseR && Settings.Combo.RifTargetOutOfRange && !E.IsReady() && (Player.Instance.Spellbook.GetSpell(SpellSlot.E).CooldownExpires - Game.Time > 2))
            {
                var enemy = StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero).FirstOrDefault(x =>
                                                                                                        !x.IsDead && x.IsValidTargetCached(850) &&
                                                                                                        (x.DistanceCached(Player.Instance) > Player.Instance.GetAutoAttackRange()) &&
                                                                                                        (x.Health <
                                                                                                         Player.Instance.CalculateDamageOnUnit(x, DamageType.Physical,
                                                                                                                                               Player.Instance.TotalAttackDamage + Damage.RBonusAd[R.Level], false, true) * 2));

                if ((enemy != null) && enemy.IsValidTargetCached(750) && (enemy.Health > Damage.GetPassiveDamage(enemy)) &&
                    Orbwalker.CanAutoAttack &&
                    (enemy.Health + Player.Instance.CalculateDamageOnUnit(enemy, DamageType.Physical,
                                                                          Player.Instance.TotalAttackDamage + Damage.RBonusAd[R.Level], false, true) >
                     IncomingDamage.GetIncomingDamage(enemy)))
                {
                    Misc.PrintInfoMessage("Casting R to kill <font color=\"#ff1493\">" + enemy.Hero + "</font>.");
                    R.Cast();
                }
            }

            if (W.IsReady() && Settings.Combo.UseW && !(Settings.Combo.BlockWIfRIsActive && IsCastingR))
            {
                var target = TargetSelector.GetTarget(W.Range, DamageType.Physical, Player.Instance.Position);

                if (target != null)
                {
                    var prediction = W.GetPrediction(target);
                    if (prediction.HitChancePercent > 50)
                    {
                        W.Cast(prediction.CastPosition);
                    }
                }
            }

            if (E.IsReady() && Settings.Combo.UseE)
            {
                if (Settings.Combo.EMode == 0) // percentage
                {
                    var enemyUnit = StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero).ToList().Find(unit => !unit.IsDead && unit.IsValidTargetCached(E.Range) && HasDeadlyVenomBuff(unit));

                    if ((enemyUnit != null) && Damage.CanCastEOnUnit(enemyUnit))
                    {
                        var percentDamage = Damage.GetEDamage(enemyUnit) / enemyUnit.TotalHealthWithShields() * 100;
                        if (percentDamage >= Settings.Combo.EAt)
                        {
                            E.Cast();
                            Misc.PrintDebugMessage($"Casting E cause it will deal {percentDamage} percent of enemy hp.");
                        }
                    }
                }
                if (Settings.Combo.EMode == 1) // at stacks
                {
                    if (StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero,
                                                         unit => !unit.IsZombie && unit.IsValidTargetCached(E.Range) && HasDeadlyVenomBuff(unit) &&
                                                         (Damage.CountEStacks(unit) >= Settings.Combo.EAt)).Any())
                    {
                        E.Cast();
                    }
                }
            }
        }
Beispiel #27
0
        public static void Execute()
        {
            if (Settings.Combo.JumpOnMinions && Orbwalker.CanAutoAttack)
            {
                var target = TargetSelector.GetTarget(1500, DamageType.Physical);

                if (target != null && !Player.Instance.IsInAutoAttackRange(target))
                {
                    var minion =
                        StaticCacheProvider.GetMinions(CachedEntityType.CombinedAttackableMinions,
                                                       unit => Player.Instance.IsInRangeCached(unit, Player.Instance.GetAutoAttackRange()))
                        .FirstOrDefault();

                    if (minion != null)
                    {
                        Orbwalker.ForcedTarget = minion;
                    }
                }
            }

            if (E.IsReady() && Settings.Combo.UseE)
            {
                var enemiesWithRendBuff =
                    StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero,
                                                     unit => unit.IsValid && unit.IsValidTargetCached(E.Range) && Damage.HasRendBuff(unit)).Count();

                if (enemiesWithRendBuff == 0)
                {
                    return;
                }

                if (Settings.Combo.UseEToSlow)
                {
                    var count =
                        StaticCacheProvider.GetMinions(CachedEntityType.CombinedAttackableMinions,
                                                       unit => unit.IsValid && unit.IsValidTargetCached(E.Range) && Damage.IsTargetKillableByRend(unit) && (Prediction.Health.GetPrediction(unit, 250) > 15)).Count();

                    if (count >= Settings.Combo.UseEToSlowMinMinions)
                    {
                        Misc.PrintDebugMessage("Casting E to slow.");
                        E.Cast();
                    }
                }

                if (Settings.Combo.UseEBeforeEnemyLeavesRange && enemiesWithRendBuff == 1)
                {
                    var enemyUnit = StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero).ToList().Find(unit => !unit.IsDead && unit.IsValid && unit.IsValidTargetCached(E.Range) && Damage.HasRendBuff(unit));

                    if (enemyUnit != null && Damage.CanCastEOnUnit(enemyUnit) && enemyUnit.DistanceCached(Player.Instance) > E.Range - 100)
                    {
                        var percentDamage = Damage.GetRendDamageOnTarget(enemyUnit) / enemyUnit.TotalHealthWithShields() * 100;

                        if (percentDamage >= Settings.Combo.MinDamagePercToUseEBeforeEnemyLeavesRange)
                        {
                            E.Cast();
                            Misc.PrintDebugMessage($"Casting E cause it will deal {percentDamage} percent of enemy hp.");
                        }
                    }
                }

                if (Settings.Combo.UseEBeforeDeath && Player.Instance.HealthPercent < 5 && IncomingDamage.GetIncomingDamage(Player.Instance) > Player.Instance.Health)
                {
                    E.Cast();
                    Misc.PrintDebugMessage("Casting E before death.");
                }
            }

            if (!Q.IsReady() || !Settings.Combo.UseQ || (Player.Instance.Mana - (50 + 5 * (Q.Level - 1)) < 45))
            {
                return;
            }

            var possibleTargets =
                StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero, x => x.IsValidTargetCached(Q.Range) && !x.HasSpellShield() && !x.HasUndyingBuffA());

            var hero = TargetSelector.GetTarget(possibleTargets, DamageType.Physical);

            if (hero == null || Player.Instance.IsDashing())
            {
                return;
            }

            Q.CastMinimumHitchance(hero, 60);
        }
Beispiel #28
0
        public static void Execute()
        {
            if (R.IsReady() && Settings.Combo.UseR && StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero, x => x.IsValidTargetCached(Settings.Combo.RMaximumRange) && (x.HealthPercent < 50) && !x.HasSpellShield() && !x.HasUndyingBuffA()).Any())
            {
                foreach (var target in StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero, x => x.IsValidTargetCached(Settings.Combo.RMaximumRange)).OrderBy(TargetSelector.GetPriority))
                {
                    var incomingDamage = IncomingDamage.GetIncomingDamage(target);

                    if (incomingDamage > target.TotalHealthWithShields())
                    {
                        return;
                    }

                    var damage = incomingDamage + Player.Instance.GetSpellDamageCached(target, SpellSlot.R) - 10;

                    if (target.Hero == Champion.Blitzcrank && !target.HasBuff("BlitzcrankManaBarrierCD") && !target.HasBuff("ManaBarrier"))
                    {
                        damage -= target.Mana / 2;
                    }

                    if (target.TotalHealthWithShields(true) < Player.Instance.GetAutoAttackDamageCached(target, true) * 2 && Player.Instance.IsInAutoAttackRange(target))
                    {
                        continue;
                    }

                    if (target.TotalHealthWithShields(true) > damage)
                    {
                        continue;
                    }

                    var rPrediction = Prediction.Manager.GetPrediction(new Prediction.Manager.PredictionInput
                    {
                        CollisionTypes = new HashSet <CollisionType> {
                            Prediction.Manager.PredictionSelected == "ICPrediction" ? CollisionType.AiHeroClient : CollisionType.ObjAiMinion
                        },
                        Delay          = .25f,
                        From           = Player.Instance.Position,
                        Radius         = 130,
                        Range          = Settings.Combo.RMaximumRange,
                        RangeCheckFrom = Player.Instance.Position,
                        Speed          = R.Speed,
                        Target         = target,
                        Type           = SkillShotType.Linear
                    });

                    if (rPrediction.HitChance < HitChance.High)
                    {
                        continue;
                    }

                    Misc.PrintDebugMessage($"Casting R on : {target.Hero} to killsteal ! v 1");
                    R.Cast(rPrediction.CastPosition);
                    break;
                }
            }

            if (!W.IsReady() || !Settings.Combo.UseW)
            {
                return;
            }

            foreach (
                var wPrediction in
                StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero,
                                                 x =>
                                                 x.IsValidTargetCached(W.Range) && !x.HasUndyingBuffA() && !x.HasSpellShield() &&
                                                 x.TotalHealthWithShields() < Player.Instance.GetSpellDamageCached(x, SpellSlot.W))
                .Select(GetWPrediction)
                .Where(wPrediction => wPrediction != null && wPrediction.HitChance >= HitChance.Medium))
            {
                W.Cast(wPrediction.CastPosition);
                break;
            }
        }
Beispiel #29
0
        public static void Execute()
        {
            if (!IsPreAttack && Q.IsReady() && Settings.Harass.AutoHarass)
            {
                foreach (var immobileEnemy in StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero, x =>
                {
                    if (!x.IsValidTargetCached(Q.Range) || !x.IsImmobile())
                    {
                        return(false);
                    }

                    var immobileDuration = x.GetMovementBlockedDebuffDuration();
                    var eta = x.DistanceCached(Player.Instance) / Q.Speed + .25f;

                    return(immobileDuration > eta);
                })
                         .OrderByDescending(TargetSelector.GetPriority)
                         .Select(x => Q.GetPrediction(x))
                         .OrderByDescending(x => x.HitChancePercent))
                {
                    Q.Cast(immobileEnemy.CastPosition);
                    break;
                }
            }

            if (IsPreAttack || !Q.IsReady() || !Settings.Combo.UseQ)
            {
                return;
            }

            foreach (var qPrediction in StaticCacheProvider.GetChampions(CachedEntityType.EnemyHero,
                                                                         x =>
                                                                         x.IsValidTargetCached(Q.Range) &&
                                                                         (x.TotalHealthWithShields() - IncomingDamage.GetIncomingDamage(x) <
                                                                          Player.Instance.GetSpellDamageCached(x, SpellSlot.Q)))
                     .Select(target => Q.GetPrediction(target))
                     .Where(qPrediction => qPrediction.HitChancePercent >= 60))
            {
                Q.Cast(qPrediction.CastPosition);
                break;
            }
        }
        public static void Execute()
        {
            if (W.IsReady() && Settings.Misc.WKillsteal && Player.Instance.Mana - 90 > 100 &&
                !Player.Instance.Position.IsVectorUnderEnemyTower())
            {
                if (EntityManager.Heroes.Enemies.Any(
                        x =>
                        x.IsValidTarget(W.Range) && !x.HasSpellShield() && !x.HasUndyingBuffA() &&
                        x.Distance(Player.Instance) > Settings.Combo.WMinDistanceToTarget))
                {
                    foreach (
                        var enemy in
                        EntityManager.Heroes.Enemies.Where(
                            x =>
                            x.IsValidTarget(W.Range) && !x.HasSpellShield() && !x.HasUndyingBuffA() &&
                            x.Distance(Player.Instance) > Settings.Combo.WMinDistanceToTarget))
                    {
                        var health      = enemy.TotalHealthWithShields() - IncomingDamage.GetIncomingDamage(enemy);
                        var wDamage     = Player.Instance.GetSpellDamage(enemy, SpellSlot.W);
                        var wPrediction = W.GetPrediction(enemy);

                        if (health < wDamage && wPrediction.HitChance == HitChance.High)
                        {
                            W.Cast(wPrediction.CastPosition);
                            return;
                        }

                        if (!(health < wDamage + Damage.GetRDamage(enemy)) || !R.IsReady() ||
                            !(R.GetPrediction(enemy).HitChancePercent > 70) || !(wPrediction.HitChancePercent > 65))
                        {
                            continue;
                        }

                        W.Cast(wPrediction.CastPosition);
                        return;
                    }
                }
                if (Settings.Harass.UseW && Player.Instance.ManaPercent >= Settings.Harass.MinManaW && !IsPreAttack)
                {
                    foreach (var wPrediction in EntityManager.Heroes.Enemies.Where(
                                 x =>
                                 x.IsValidTarget(W.Range) && Settings.Harass.IsWHarassEnabledFor(x) &&
                                 x.Distance(Player.Instance) > GetRealRocketLauncherRange())
                             .Where(enemy => enemy.IsValidTarget(W.Range))
                             .Select(enemy => W.GetPrediction(enemy))
                             .Where(wPrediction => wPrediction.HitChancePercent > 70))
                    {
                        W.Cast(wPrediction.CastPosition);
                        return;
                    }
                }
            }
            if (R.IsReady() && Settings.Combo.UseR)
            {
                var target = TargetSelector.GetTarget(Settings.Combo.RRangeKeybind, DamageType.Physical);

                if (target == null || !Settings.Combo.RKeybind)
                {
                    return;
                }

                var rPrediciton = R.GetPrediction(target);
                if (rPrediciton.HitChance == HitChance.High)
                {
                    R.Cast(rPrediciton.CastPosition);
                }
            }


            if (!E.IsReady() || !Settings.Combo.AutoE || !(Player.Instance.Mana - 50 > 100))
            {
                return;
            }

            foreach (
                var enemy in
                EntityManager.Heroes.Enemies.Where(
                    x =>
                    x.IsValidTarget(E.Range) &&
                    (x.GetMovementBlockedDebuffDuration() > 0.7f ||
                     x.Buffs.Any(
                         m =>
                         m.Name.ToLowerInvariant() == "zhonyasringshield" ||
                         m.Name.ToLowerInvariant() == "bardrstasis"))))
            {
                if (enemy.Buffs.Any(m => m.Name.ToLowerInvariant() == "zhonyasringshield" ||
                                    m.Name.ToLowerInvariant() == "bardrstasis"))
                {
                    var buffTime = enemy.Buffs.FirstOrDefault(m => m.Name.ToLowerInvariant() == "zhonyasringshield" ||
                                                              m.Name.ToLowerInvariant() == "bardrstasis");
                    if (buffTime != null && buffTime.EndTime - Game.Time < 1 && buffTime.EndTime - Game.Time > 0.3 && enemy.IsValidTarget(E.Range))
                    {
                        E.Cast(enemy.ServerPosition);
                    }
                }
                else if (enemy.IsValidTarget(E.Range))
                {
                    E.Cast(enemy.ServerPosition);
                }
                Console.WriteLine("Name : {0} | Duration : {1}", enemy.Hero,
                                  enemy.GetMovementBlockedDebuffDuration());
            }
        }