示例#1
0
        public override void Execute()
        {
            var itarget = TargetSelector.GetTarget(1000, DamageType.Physical);

            Items.UseItems(itarget);

            if (Settings.UseRk && R.IsReady() && E.IsReady() && Q.IsReady())
            {
                var target = TargetSelector.GetTarget(R.Range, DamageType.Physical);
                if (target != null && Damages.RDamage(target) + Damages.QDamage(target) + Damages.EDamage(target) + Damages.FaaDamage(target) > target.Health)
                {
                    R.Cast(target);
                }
            }

            var qtarget = TargetSelector.GetTarget(E.Range, DamageType.Physical);

            if (Settings.UseE && E.IsReady() &&
                (qtarget.IsValidTarget(Q.Range) && Q.IsReady()))
            {
                var vec        = qtarget.ServerPosition - ObjectManager.Player.Position;
                var castBehind = E.GetPrediction(qtarget).CastPosition + Vector3.Normalize(vec) * 100;
                E.Cast(castBehind);
            }

            if (Settings.UseQ && Q.IsReady() && qtarget.IsValidTarget(200, true, SpellManager.Epos) && SpellManager.Epos != default(Vector3))
            {
                Q.Cast(SpellManager.Epos);
            }

            if (Settings.UseW)
            {
                var target = TargetSelector.GetTarget(W.Range, DamageType.Physical);
                if (W.IsReady() && target != null)
                {
                    W.Cast();
                }
            }

            if (Settings.UseQ && Q.IsReady() && !E.IsReady())
            {
                var wtarget = TargetSelector.GetTarget(W.Range, DamageType.Physical);
                var prede   = Q.GetPrediction(wtarget);
                if (prede.HitChance >= HitChance.High)
                {
                    if (wtarget != null)
                    {
                        Q.Cast(prede.CastPosition);
                    }
                }
            }
            if (Settings.UseRi && R.IsReady())
            {
                var target = TargetSelector.GetTarget(R.Range, DamageType.Physical);
                if (R.IsReady() && target != null)
                {
                    R.Cast(target);
                }
            }
        }
示例#2
0
        public static void Init()
        {
            var Minions = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, Player.Instance.Position, Annie.Q.Range);

            foreach (var Minion in Minions)
            {
                if (Annie.Q.IsReady() && AnnieMenu.CheckBox(AnnieMenu.Lasthit, "Q"))
                {
                    if (Minion.IsValidTarget(Annie.Q.Range))
                    {
                        if (Minion.Health - Damages.QDamage(Minion) <= 0)
                        {
                            if (AnnieMenu.CheckBox(AnnieMenu.Laneclear, "Exception"))
                            {
                                if (!Annie.HasStun())
                                {
                                    Annie.Q.Cast(Minion);
                                }
                            }
                            else
                            {
                                Annie.Q.Cast(Minion);
                            }
                        }
                    }
                }
            }
        }
示例#3
0
        public static void Init()
        {
            var Minions = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, Player.Instance.Position, Elise.Q.Range);

            foreach (var Minion in Minions)
            {
                if (Elise.CheckForm())
                {
                    if (Elise.Q.IsReady() && EliseMenu.CheckBox(EliseMenu.Lasthit, "Q"))
                    {
                        if (Minion.Health - Damages.QDamage(Minion) <= 0)
                        {
                            Elise.Q.Cast(Minion);
                        }
                    }
                }
                else
                {
                    if (Elise.Q2.IsReady() && EliseMenu.CheckBox(EliseMenu.Lasthit, "Q2"))
                    {
                        if (Minion.Health - Damages.Q2Damage(Minion) <= 0)
                        {
                            Elise.Q2.Cast(Minion);
                        }
                    }
                }
            }
        }
示例#4
0
文件: Combo.cs 项目: lolscripts/Aka-s
        public override void Execute()
        {
            if (Settings.UseR)
            {
                var etarget = TargetSelector.GetTarget(R.Range, DamageType.Physical);
                if (Damages.RDamage(etarget) + Damages.QDamage(etarget) + Damages.EDamage(etarget) + Damages.WDamage(etarget) > etarget.Health)
                {
                    R.Cast();
                }
            }



            if (Settings.UseE)
            {
                var etarget     = TargetSelector.GetTarget(E.Range, DamageType.Magical);
                var eprediction = E.GetPrediction(etarget);
                if (eprediction.HitChance >= HitChance.High)
                {
                    if (E.IsReady() && etarget != null && !ObjectManager.Player.HasBuff("SionR"))
                    {
                        E.Cast(eprediction.CastPosition);
                    }
                }
            }
            if (Settings.UseW)
            {
                var target = TargetSelector.GetTarget(W.Range, DamageType.Physical);
                if (W.IsReady() && target != null && !ObjectManager.Player.HasBuff("SionR"))
                {
                    W.Cast();
                }
            }

            if (Settings.UseQ)
            {
                var target      = TargetSelector.GetTarget(Q.Range, DamageType.Physical);
                var eprediction = Q.GetPrediction(target);
                if (eprediction.HitChance >= HitChance.High && !ObjectManager.Player.HasBuff("SionR"))
                {
                    if (Q.IsReady() && target != null && Player.Instance.IsFacing(target))
                    {
                        Q.Cast(eprediction.CastPosition);
                    }
                }
            }

            if (activatedP)
            {
                var target = TargetSelector.GetTarget(2000, DamageType.Physical);
                if (Q.IsReady() && Player.Instance.Position.Distance(target) > target.GetAutoAttackRange())
                {
                    Q.Cast(target);
                }
            }
        }
示例#5
0
        public override void Execute()
        {
            if (Player.Instance.IsDead)
            {
                return;
            }

            var enemies =
                EntityManager.Heroes.Enemies.Where(
                    e => e.IsEnemy && e.IsVisible && !e.IsDead && !e.IsZombie && !e.IsInvulnerable && e.Health > 0)
                .ToList();

            foreach (var enemy in enemies)
            {
                if (Settings.KSQ && SpellManager.Q.IsReady() && Damages.QDamage(enemy) > enemy.Health &&
                    SpellManager.Q.IsInRange(enemy))
                {
                    if (enemy.HasBuffOfType(BuffType.SpellImmunity) || enemy.HasBuffOfType(BuffType.SpellShield))
                    {
                        continue;
                    }
                    var pred = Q.GetPrediction(enemy);
                    if (pred.HitChance >= HitChance.High)
                    {
                        Q.Cast(pred.CastPosition);
                        break;
                    }
                }

                if (Settings.KSE && SpellManager.E.IsReady() && Damages.EDamage(enemy) > enemy.Health &&
                    SpellManager.E.IsInRange(enemy))
                {
                    if (enemy.HasBuffOfType(BuffType.SpellImmunity) || enemy.HasBuffOfType(BuffType.SpellShield))
                    {
                        continue;
                    }
                    var pred = E.GetPrediction(enemy);
                    if (pred.HitChance >= HitChance.High)
                    {
                        E.Cast(pred.CastPosition);
                        break;
                    }
                }
                if (Settings.KSR && SpellManager.R.IsReady() && Damages.RDamage(enemy) > enemy.Health &&
                    SpellManager.R.IsInRange(enemy))
                {
                    if (enemy.HasBuffOfType(BuffType.SpellImmunity) || enemy.HasBuffOfType(BuffType.SpellShield))
                    {
                        continue;
                    }
                    R.Cast(enemy);
                    break;
                }
            }
        }
示例#6
0
 public override void Execute()
 {
     if (Settings.UseQ && Q.IsReady() && PlayerMana >= SettingsMana.MinQMana)
     {
         var target =
             EntityManager.MinionsAndMonsters.CombinedAttackable.Where(e => e.IsValidTarget(Q.Range))
             .OrderBy(e => e.Health).FirstOrDefault(e => e.Health <= Damages.QDamage(e));
         if (target != null)
         {
             Q.Cast(target);
             Debug.WriteChat("Casting Q in LastHit on {0}", target.BaseSkinName);
         }
     }
 }
示例#7
0
        public static void Init()
        {
            var Minions = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, Player.Instance.Position, Pantheon.Q.Range);

            foreach (var Minion in Minions)
            {
                if (Pantheon.Q.IsReady() && PantheonMenu.CheckBox(PantheonMenu.Lasthit, "Q"))
                {
                    if (Minion.IsValidTarget(Pantheon.Q.Range))
                    {
                        if (Minion.Health - Damages.QDamage(Minion) <= 0)
                        {
                            Pantheon.Q.Cast(Minion);
                        }
                    }
                }
            }
        }
示例#8
0
        public override void Execute()
        {
            if (Player.Instance.IsDead)
            {
                return;
            }

            var enemies =
                EntityManager.Heroes.Enemies.Where(
                    e => e.IsEnemy && e.IsVisible && !e.IsDead && !e.IsZombie && !e.IsInvulnerable && e.Health > 0)
                .ToList();

            foreach (var enemy in enemies)
            {
                if (Settings.KSQ && SpellManager.Q.IsReady() && Damages.QDamage(enemy) > enemy.Health &&
                    SpellManager.Q.IsInRange(enemy))
                {
                    if (enemy.HasBuffOfType(BuffType.SpellImmunity) || enemy.HasBuffOfType(BuffType.SpellShield))
                    {
                        continue;
                    }
                    if (Settings.KSQ)
                    {
                        Q.Cast();
                        break;
                    }
                }

                if (Settings.KSW && SpellManager.W.IsReady() && Damages.WDamage(enemy) > enemy.Health &&
                    SpellManager.W.IsInRange(enemy))
                {
                    if (enemy.HasBuffOfType(BuffType.SpellImmunity) || enemy.HasBuffOfType(BuffType.SpellShield))
                    {
                        continue;
                    }
                    if (Settings.KSW)
                    {
                        W.Cast();
                        break;
                    }
                }
                if (Settings.KSR && R.IsReady())
                {
                    if (enemy.IsValidTarget(R.Range) && !enemy.IsZombie && !enemy.IsInvulnerable && !enemy.IsDead)
                    {
                        int passiveCounter = enemy.GetBuffCount("dariushemo") <= 0
                            ? 0
                            : enemy.GetBuffCount("dariushemo");
                        if (!enemy.HasBuffOfType(BuffType.Invulnerability) && !enemy.HasBuffOfType(BuffType.SpellShield))
                        {
                            if (Damages.RDamage(enemy, passiveCounter) >= enemy.Health + Damages.PassiveDmg(enemy, 1))
                            {
                                if (!enemy.HasBuffOfType(BuffType.Invulnerability) &&
                                    !enemy.HasBuffOfType(BuffType.SpellShield))
                                {
                                    R.Cast(enemy);
                                }
                            }
                        }
                    }
                }
                if (Config.Modes.Harass.UseQ && Player.Instance.ManaPercent > Config.Modes.Harass.Mana &&
                    Q.IsReady())
                {
                    var target = TargetSelector.GetTarget(Q.Range, DamageType.Physical);
                    if (target != null)
                    {
                        Q.Cast();
                    }
                }
                if (Config.Modes.Harass.UseE && Player.Instance.ManaPercent > Config.Modes.Harass.Mana &&
                    E.IsReady())
                {
                    var target      = TargetSelector.GetTarget(E.Range, DamageType.Physical);
                    var eprediction = E.GetPrediction(target);
                    if (eprediction.HitChance >= HitChance.High)
                    {
                        if (E.IsReady() && target != null)
                        {
                            E.Cast(eprediction.CastPosition);
                        }
                    }
                }
            }
        }
示例#9
0
        public override void Execute()
        {
            // KillSteal
            if (Settings.KsQ || Settings.KsE || (Settings.KsIgnite && HasIgnite))
            {
                var enemies = EntityManager.Heroes.Enemies.Where(e => e.IsValidTarget(1500.0f));
                if (Settings.KsQ && Q.IsReady())
                {
                    var target = enemies.FirstOrDefault(e => Q.IsInRange(e) && e.Health < Damages.QDamage(e));
                    if (target != null)
                    {
                        if (Orbwalker.AzirSoldiers.Count > 0)
                        {
                            foreach (var soldier in Orbwalker.AzirSoldiers) // Q KS
                            {
                                var pred = Prediction.Position.PredictLinearMissile(target, Q.Range, Q.Width,
                                                                                    Q.CastDelay, Q.Speed, Int32.MaxValue, soldier.Position, true);
                                if (pred.HitChance >= SettingsPrediction.MinQHCKillSteal)
                                {
                                    Q.Cast(pred.CastPosition.Extend(pred.UnitPosition, 115.0f).To3D());
                                    Debug.WriteChat("Casting Q in KS on {0}, who has {1}HP.", target.ChampionName, target.Health.ToString());
                                    break;
                                }
                            }
                        }
                        else if (Orbwalker.AzirSoldiers.Count == 0 && W.IsReady() && PlayerManaExact >= 110) // WQ KS
                        {
                            var wCastPos = _PlayerPos.Extend(target, W.Range).To3D();
                            var pred     = Prediction.Position.PredictLinearMissile(target, Q.Range, Q.Width,
                                                                                    Q.CastDelay, Q.Speed, Int32.MaxValue, wCastPos, true);
                            if (pred.HitChance >= SettingsPrediction.MinQHCKillSteal)
                            {
                                W.Cast(wCastPos);
                                Q.Cast(pred.CastPosition.Extend(pred.UnitPosition, 115.0f).To3D());
                                Debug.WriteChat("Casting WQ in KS on {0}, who has {1}HP.", target.ChampionName, target.Health.ToString());
                            }
                        }
                    }
                }
                else if (Settings.KsE && E.IsReady())
                {
                    var target = enemies.FirstOrDefault(e => E.IsInRange(e) && e.Health < Damages.EDamage(e));
                    if (target != null)
                    {
                        if (Orbwalker.AzirSoldiers.Count > 0)
                        {
                            foreach (var soldier in Orbwalker.AzirSoldiers) // E KS
                            {
                                if (target.Position.Between(_PlayerPos, soldier.Position))
                                {
                                    E.Cast();
                                    Debug.WriteChat("Casting E in KS on {0}, who has {1}HP.", target.ChampionName, target.Health.ToString());
                                    break;
                                }
                            }
                        }
                        else if (Orbwalker.AzirSoldiers.Count == 0 && W.IsReady() && _PlayerPos.Distance(target) <= W.Range - 50 && PlayerManaExact >= 100) // WE KS
                        {
                            var wCastPos = _PlayerPos.Extend(target, W.Range).To3D();
                            W.Cast(wCastPos);
                            E.Cast();
                            Debug.WriteChat("Casting WE in KS on {0}, who has {1}HP.", target.ChampionName, target.Health.ToString());
                        }
                    }
                }
                else if (Settings.KsIgnite && HasIgnite && Ignite.IsReady())
                {
                    var target = enemies.FirstOrDefault(e => Ignite.IsInRange(e) && e.Health < Damages.IgniteDmg(e));
                    if (target != null)
                    {
                        Ignite.Cast(target);
                        Debug.WriteChat("Casting Ignite in KS on {0}, who has {1}HP.", target.ChampionName, target.Health.ToString());
                    }
                }
            }

            // DashToCursor
            if (Settings.QWEToCursor)
            {
                var cursorPos        = Game.CursorPos;
                var distanceToPlayer = cursorPos.Distance(_PlayerPos);
                if (E.IsReady() && distanceToPlayer > Orbwalker.HoldRadius)
                {
                    var soldier =
                        Orbwalker.ValidAzirSoldiers.FirstOrDefault(s => s.Distance(cursorPos) <= 150 && s.Distance(_PlayerPos) < E.Range);
                    if (soldier != null)
                    {
                        E.Cast();
                        Debug.WriteChat("Dashing to existing soldier.");
                    }
                    else if (PlayerManaExact >= 100 && _PlayerPos.Distance(cursorPos) < W.Range && W.IsReady())
                    {
                        W.Cast(cursorPos);
                        E.Cast();
                        Debug.WriteChat("Using WE to dash to location");
                    }
                    else if (PlayerManaExact >= 170 && _PlayerPos.Distance(cursorPos) < Q.Range - 100 && W.IsReady() && Q.IsReady())
                    {
                        W.Cast(_PlayerPos.Extend(cursorPos, W.Range).To3D());
                        Core.DelayAction(() => {
                            E.Cast();
                        }, 200);
                        Q.Cast(cursorPos);
                        Debug.WriteChat("Using QWE to dash to location");
                    }
                    else
                    {
                        Orbwalker.MoveTo(cursorPos);
                    }
                }
                else
                {
                    Orbwalker.MoveTo(cursorPos);
                }
            }

            // Potion manager
            if (Settings.Potion && !Player.Instance.IsInShopRange() && Player.Instance.HealthPercent <= Settings.potionMinHP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemCrystalFlaskJungle") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask")))
            {
                if (Item.HasItem(HealthPotion.Id) && Item.CanUseItem(HealthPotion.Id))
                {
                    Debug.WriteChat("Using HealthPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    HealthPotion.Cast();
                    return;
                }
                if (Item.HasItem(HuntersPotion.Id) && Item.CanUseItem(HuntersPotion.Id))
                {
                    Debug.WriteChat("Using HuntersPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    HealthPotion.Cast();
                    return;
                }
                if (Item.HasItem(TotalBiscuit.Id) && Item.CanUseItem(TotalBiscuit.Id))
                {
                    Debug.WriteChat("Using TotalBiscuitOfRejuvenation because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    TotalBiscuit.Cast();
                    return;
                }
                if (Item.HasItem(RefillablePotion.Id) && Item.CanUseItem(RefillablePotion.Id))
                {
                    Debug.WriteChat("Using RefillablePotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    RefillablePotion.Cast();
                    return;
                }
                if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id))
                {
                    Debug.WriteChat("Using CorruptingPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    CorruptingPotion.Cast();
                    return;
                }
            }
            if (Player.Instance.ManaPercent <= Settings.potionMinMP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask")))
            {
                if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id))
                {
                    Debug.WriteChat("Using HealthPotion because below {0}% MP - have {1}% MP", String.Format("{0}", Settings.potionMinMP), String.Format("{0:##.##}", Player.Instance.ManaPercent));
                    CorruptingPotion.Cast();
                }
            }
        }
 public override void Execute()
 {
     if (Settings.UseQ && Q.IsReady() && PlayerHealth >= SettingsHealth.MinQHealth)
     {
         var minion =
             EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, _PlayerPos, Q.Range)
             .FirstOrDefault(e => e.IsValidTarget(SettingsCombo.MaxQDistance) && e.Distance(_Player) > _Player.GetAutoAttackRange() && e.Health < Damages.QDamage(e) && Q.GetPrediction(e).HitChance >= HitChance.Medium);
         if (minion != null)
         {
             var pred = Q.GetPrediction(minion);
             if (pred.HitChance >= SettingsPrediction.MinQHCLastHit)
             {
                 Q.Cast(pred.CastPosition);
                 Debug.WriteChat("Casting Q in LastHit");
             }
         }
     }
 }
示例#11
0
        public override void Execute()
        {
            // KillSteal
            var enemies = EntityManager.Heroes.Enemies.Where(e => e.IsEnemy && e.IsVisible && !e.IsDead && !e.IsZombie && !e.IsInvulnerable && e.Health > 0).ToList();

            if (!isUlting())
            {
                foreach (var enemy in enemies)
                {
                    if (Settings.KsQ && SpellManager.Q.IsReady() && Damages.QDamage(enemy) > enemy.Health &&
                        SpellManager.Q.IsInRange(enemy))
                    {
                        if (enemy.HasBuffOfType(BuffType.SpellImmunity) || enemy.HasBuffOfType(BuffType.SpellShield))
                        {
                            continue;
                        }
                        var pred = Q.GetPrediction(enemy);
                        if (pred.HitChance >= SettingsPrediction.MinQHCKillSteal)
                        {
                            Debug.WriteChat("Casting Q in KillSteal on {0}, who has {1} HP", enemy.ChampionName,
                                            "" + enemy.Health);
                            Q.Cast(pred.CastPosition);
                            break;
                        }
                    }

                    if (Settings.KsE && SpellManager.E.IsReady() && Damages.EDamage(enemy) > enemy.Health &&
                        SpellManager.E.IsInRange(enemy))
                    {
                        if (enemy.HasBuffOfType(BuffType.SpellImmunity) || enemy.HasBuffOfType(BuffType.SpellShield))
                        {
                            continue;
                        }
                        var pred = E.GetPrediction(enemy);
                        if (pred.HitChance >= SettingsPrediction.MinEHCKillSteal)
                        {
                            Debug.WriteChat("Casting E in KillSteal on {0}, who has {1} HP", enemy.ChampionName,
                                            "" + enemy.Health);
                            E.Cast(pred.CastPosition);
                            break;
                        }
                    }

                    if (SpellManager.Ignite != null && Settings.KsIgnite && SpellManager.Ignite.IsReady() &&
                        Damages.IgniteDmg(enemy) > enemy.Health && SpellManager.Ignite.IsInRange(enemy))
                    {
                        Debug.WriteChat("Casting Ignite in KillSteal on {0}, who has {1} HP", enemy.ChampionName,
                                        "" + enemy.Health);
                        SpellManager.Ignite.Cast(enemy);
                        break;
                    }

                    if (Settings.KsR && SpellManager.R.IsReady() && Damages.RDamage(enemy) > enemy.Health &&
                        SpellManager.R.IsInRange(enemy))
                    {
                        if (enemy.HasBuffOfType(BuffType.SpellImmunity) || enemy.HasBuffOfType(BuffType.SpellShield))
                        {
                            continue;
                        }
                        Debug.WriteChat("Casting R in KillSteal on {0}, who has {1} HP", enemy.ChampionName,
                                        "" + enemy.Health);
                        R.Cast();
                        break;
                    }
                }
            }

            // Automatic ult usage
            if (Settings.AutoR && R.IsReady() && !Player.Instance.IsRecalling())
            {
                var ultableEnemies = enemies.Where(e => R.IsInRange(e)).ToList();
                if (ultableEnemies.Count() >= Settings.AutoRMinEnemies && Player.Instance.HealthPercent >= Settings.AutoRMinHP)
                {
                    if (W.IsReady() && Player.Instance.Mana >= 160)
                    {
                        W.Cast(Player.Instance);
                    }
                    Debug.WriteChat("AutoCasting R, Enemies in range: {0}", "" + "" + ultableEnemies.Count());
                    R.Cast();
                    return;
                }
            }

            // Potion manager
            if (Settings.Potion && !Player.Instance.IsInShopRange() && Player.Instance.HealthPercent <= Settings.potionMinHP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemCrystalFlaskJungle") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask")))
            {
                if (Item.HasItem(HealthPotion.Id) && Item.CanUseItem(HealthPotion.Id))
                {
                    Debug.WriteChat("Using HealthPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    HealthPotion.Cast();
                    return;
                }
                if (Item.HasItem(HuntersPotion.Id) && Item.CanUseItem(HuntersPotion.Id))
                {
                    Debug.WriteChat("Using HuntersPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    HuntersPotion.Cast();
                    return;
                }
                if (Item.HasItem(TotalBiscuit.Id) && Item.CanUseItem(TotalBiscuit.Id))
                {
                    Debug.WriteChat("Using TotalBiscuitOfRejuvenation because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    TotalBiscuit.Cast();
                    return;
                }
                if (Item.HasItem(RefillablePotion.Id) && Item.CanUseItem(RefillablePotion.Id))
                {
                    Debug.WriteChat("Using RefillablePotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    RefillablePotion.Cast();
                    return;
                }
                if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id))
                {
                    Debug.WriteChat("Using CorruptingPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    CorruptingPotion.Cast();
                    return;
                }
            }
            if (Settings.Potion && !Player.Instance.IsInShopRange() && Player.Instance.ManaPercent <= Settings.potionMinMP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask")))
            {
                if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id))
                {
                    Debug.WriteChat("Using CorruptingPotion because below {0}% MP - have {1}% MP", String.Format("{0}", Settings.potionMinMP), String.Format("{0:##.##}", Player.Instance.ManaPercent));
                    CorruptingPotion.Cast();
                }
                if (Item.HasItem(HuntersPotion.Id) && Item.CanUseItem(HuntersPotion.Id))
                {
                    Debug.WriteChat("Using HuntersPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    HuntersPotion.Cast();
                    return;
                }
            }
        }
示例#12
0
        public override void Execute()
        {
            skinChanger();

            if (Player.Instance.IsDead)
            {
                return;
            }

            var enemies =
                EntityManager.Heroes.Enemies.Where(
                    e => e.IsEnemy && e.IsVisible && !e.IsDead && !e.IsZombie && !e.IsInvulnerable && e.Health > 0)
                .ToList();

            foreach (var enemy in enemies)
            {
                if (Settings.KSQ && SpellManager.Q.IsReady() && Damages.QDamage(enemy) > enemy.Health &&
                    SpellManager.Q.IsInRange(enemy))
                {
                    if (enemy.HasBuffOfType(BuffType.SpellImmunity) || enemy.HasBuffOfType(BuffType.SpellShield))
                    {
                        continue;
                    }
                    if (Settings.KSQ)
                    {
                        Q.Cast(enemy.Position);
                        break;
                    }
                }

                if (Settings.KSW && SpellManager.W.IsReady() && Damages.WDamage(enemy) > enemy.Health &&
                    SpellManager.W.IsInRange(enemy))
                {
                    if (enemy.HasBuffOfType(BuffType.SpellImmunity) || enemy.HasBuffOfType(BuffType.SpellShield))
                    {
                        continue;
                    }
                    if (Settings.KSW)
                    {
                        W.Cast(enemy.Position);
                        break;
                    }
                }
                if (Settings.KSE && SpellManager.E.IsReady() && ObjectManager.Player.GetSpellDamage(enemy, SpellSlot.E) > enemy.Health &&
                    SpellManager.E.IsInRange(enemy))
                {
                    if (enemy.HasBuffOfType(BuffType.SpellImmunity) || enemy.HasBuffOfType(BuffType.SpellShield))
                    {
                        continue;
                    }
                    if (Settings.KSE)
                    {
                        E.Cast(enemy);
                        break;
                    }
                }
                if (Settings.KSR && SpellManager.R.IsReady() && Damages.RDamage(enemy) > enemy.Health &&
                    SpellManager.R.IsInRange(enemy))
                {
                    if (enemy.HasBuffOfType(BuffType.SpellImmunity) || enemy.HasBuffOfType(BuffType.SpellShield))
                    {
                        continue;
                    }
                    if (Settings.KSR)
                    {
                        R.Cast(enemy);
                        break;
                    }
                }

                if (!Settings.CloneOrbwalk)
                {
                    return;
                }
                if (!hasClone())
                {
                    return;
                }
                var target = TargetSelector.GetTarget(E.Range, DamageType.Physical);

                if (target != null)
                {
                    Core.DelayAction(() => R.Cast(target), 500);
                }
                else
                {
                    Core.DelayAction(() => R.Cast(Game.CursorPos), 500);
                }
            }
        }
示例#13
0
        public override void Execute()
        {
            // KillSteal
            if (Settings.KsQ || (Settings.KsSmite && SpellManager.HasChillingSmite()) || (Settings.KsIgnite && HasIgnite) && Environment.TickCount - lastKSTime > 500)
            {
                var enemies = EntityManager.Heroes.Enemies.Where(e => e.IsValidTarget(600));
                if (Settings.KsQ && Q.IsReady() && PlayerMana >= SettingsMana.MinQMana)
                {
                    var target = enemies.FirstOrDefault(e => Q.IsInRange(e) && e.TotalShieldHealth() < Damages.QDamage(e) && !e.HasBuffOfType(BuffType.SpellImmunity) && !e.HasBuffOfType(BuffType.SpellShield));
                    if (target != null)
                    {
                        lastKSTime = Environment.TickCount;
                        Q.Cast(target);
                        Debug.Write("Casting Q in KS on {0} who has {1}HP.", target.ChampionName, target.Health.ToString());
                        return;
                    }
                }
                if (Settings.KsIgnite && HasIgnite && Ignite.IsReady())
                {
                    var target = enemies.FirstOrDefault(e => W.IsInRange(e) && e.TotalShieldHealth() < Damages.IgniteDmg(e));
                    if (target != null)
                    {
                        lastKSTime = Environment.TickCount;
                        Ignite.Cast(target);
                        Debug.Write("Casting Ignite in KS on {0} who has {1}HP.", target.ChampionName, target.Health.ToString());
                        return;
                    }
                }
                if (Settings.KsSmite && SpellManager.HasChillingSmite() && Smite.IsReady())
                {
                    var target = enemies.FirstOrDefault(e => W.IsInRange(e) && e.TotalShieldHealth() < Damages.SmiteDmgHero(e));
                    if (target != null)
                    {
                        lastKSTime = Environment.TickCount;
                        Ignite.Cast(target);
                        Debug.Write("Casting Smite in KS on {0} who has {1}HP.", target.ChampionName, target.Health.ToString());
                        return;
                    }
                }
            }
            // Auto Q Harass
            if (SettingsHarass.UseAutoQ && Q.IsReady() && PlayerMana >= SettingsHarass.MinAutoQMana && !_Player.IsRecalling() && !PlayerIsUnderEnemyTurret() /* Don't harass under enemy turrets */ && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) /* Don't Harass in Combo, it can mess it up */)
            {
                var enemies = EntityManager.Heroes.Enemies.Where(
                    e => e.IsValidTarget(Q.Range)).OrderBy(e => _Player.Distance(e));
                foreach (var enemy in enemies)
                {
                    if (
                        VodkaWarwick.Config.ModesMenu.MenuModes["blacklist" + enemy.ChampionName].Cast <CheckBox>()
                        .CurrentValue)
                    {
                        continue;
                    }
                    Q.Cast(enemy);
                    Debug.WriteChat("Casting Q in Auto Harass, Target: {0}", enemy.ChampionName);
                    break;
                }
            }

            // Potion manager
            if (Settings.Potion && !Player.Instance.IsInShopRange() && Player.Instance.HealthPercent <= Settings.potionMinHP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemCrystalFlaskJungle") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask")))
            {
                if (Item.HasItem(HealthPotion.Id) && Item.CanUseItem(HealthPotion.Id))
                {
                    Debug.WriteChat("Using HealthPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    HealthPotion.Cast();
                    return;
                }
                if (Item.HasItem(HuntersPotion.Id) && Item.CanUseItem(HuntersPotion.Id))
                {
                    Debug.WriteChat("Using HuntersPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    HuntersPotion.Cast();
                    return;
                }
                if (Item.HasItem(TotalBiscuit.Id) && Item.CanUseItem(TotalBiscuit.Id))
                {
                    Debug.WriteChat("Using TotalBiscuitOfRejuvenation because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    TotalBiscuit.Cast();
                    return;
                }
                if (Item.HasItem(RefillablePotion.Id) && Item.CanUseItem(RefillablePotion.Id))
                {
                    Debug.WriteChat("Using RefillablePotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    RefillablePotion.Cast();
                    return;
                }
                if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id))
                {
                    Debug.WriteChat("Using CorruptingPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    CorruptingPotion.Cast();
                    return;
                }
            }
            if (Settings.Potion && !Player.Instance.IsInShopRange() && Player.Instance.ManaPercent <= Settings.potionMinMP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask")))
            {
                if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id))
                {
                    Debug.WriteChat("Using CorruptingPotion because below {0}% MP - have {1}% MP", String.Format("{0}", Settings.potionMinMP), String.Format("{0:##.##}", Player.Instance.ManaPercent));
                    CorruptingPotion.Cast();
                }
                if (Item.HasItem(HuntersPotion.Id) && Item.CanUseItem(HuntersPotion.Id))
                {
                    Debug.WriteChat("Using HuntersPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    HuntersPotion.Cast();
                    return;
                }
            }
        }
示例#14
0
        public override void Execute()
        {
            foreach (
                var enemy in
                EntityManager.Heroes.Enemies.Where(
                    e => e.IsValidTarget()))
            {
                if (Settings.KsQ && SpellManager.Q.IsReady() && Damages.QDamage(enemy) > enemy.Health &&
                    SpellManager.Q.IsInRange(enemy))
                {
                    if (enemy.HasBuffOfType(BuffType.SpellImmunity) || enemy.HasBuffOfType(BuffType.SpellShield))
                    {
                        continue;
                    }
                    var pred = Q.GetPrediction(enemy);
                    if (pred.HitChance >= SettingsPrediction.MinQHCKillSteal)
                    {
                        Debug.WriteChat("Casting Q in KillSteal on {0}, who has {1} HP", enemy.ChampionName,
                                        "" + enemy.Health);
                        Q.Cast(pred.CastPosition);
                        break;
                    }
                }

                if (Settings.KsW && SpellManager.W.IsReady() && Damages.WDamage(enemy) > enemy.Health &&
                    SpellManager.W.IsInRange(enemy))
                {
                    if (enemy.HasBuffOfType(BuffType.SpellImmunity) || enemy.HasBuffOfType(BuffType.SpellShield))
                    {
                        continue;
                    }
                    Debug.WriteChat("Casting W in KillSteal on {0}, who has {1} HP", enemy.ChampionName,
                                    "" + enemy.Health);
                    W.Cast(enemy);
                    break;
                }

                if (SpellManager.Ignite != null && Settings.KsIgnite && SpellManager.Ignite.IsReady() &&
                    Damages.IgniteDmg(enemy) > enemy.Health && SpellManager.Ignite.IsInRange(enemy))
                {
                    Debug.WriteChat("Casting Ignite in KillSteal on {0}, who has {1} HP", enemy.ChampionName, "" + enemy.Health);
                    SpellManager.Ignite.Cast(enemy);
                    break;
                }
            }

            // Automatic ult usage
            if (Settings.AutoR && R.IsReady() && !Player.Instance.IsRecalling() && !Player.Instance.IsInShopRange())
            {
                var woundedAround =
                    EntityManager.Heroes.Allies.Count(a => !a.IsDead && !a.IsRecalling() && R.IsInRange(a) && a.HealthPercent <= Settings.AutoRMinHP);
                var enemiesAround = EntityManager.Heroes.Enemies.Count(e => e.IsValid() && !e.IsRecalling() && e.Distance(Player.Instance.Position) < 1600);
                if (woundedAround > 0 && enemiesAround >= Settings.AutoRMinEnemies)
                {
                    Debug.WriteChat("AutoCasting R, Wounded allies: {0}, Enemies near in 1600 range: {1}", "" + woundedAround, "" + enemiesAround);
                    R.Cast();
                }
            }

            // Potion manager
            if (Settings.Potion && !Player.Instance.IsInShopRange())
            {
                if (Player.Instance.HealthPercent <= Settings.potionMinHP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask")))
                {
                    if (Item.HasItem(HealthPotion.Id) && Item.CanUseItem(HealthPotion.Id))
                    {
                        Debug.WriteChat("Using HealthPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                        HealthPotion.Cast();
                        return;
                    }
                    if (Item.HasItem(TotalBiscuit.Id) && Item.CanUseItem(TotalBiscuit.Id))
                    {
                        Debug.WriteChat("Using TotalBiscuitOfRejuvenation because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                        TotalBiscuit.Cast();
                        return;
                    }
                    if (Item.HasItem(RefillablePotion.Id) && Item.CanUseItem(RefillablePotion.Id))
                    {
                        Debug.WriteChat("Using RefillablePotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                        RefillablePotion.Cast();
                        return;
                    }
                    if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id))
                    {
                        Debug.WriteChat("Using CorruptingPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                        CorruptingPotion.Cast();
                        return;
                    }
                }
                if (Player.Instance.ManaPercent <= Settings.potionMinMP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask")))
                {
                    if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id))
                    {
                        Debug.WriteChat("Using HealthPotion because below {0}% MP - have {1}% MP", String.Format("{0}", Settings.potionMinMP), String.Format("{0:##.##}", Player.Instance.ManaPercent));
                        CorruptingPotion.Cast();
                        return;
                    }
                }
            }
        }
示例#15
0
 public override void Execute()
 {
     if (Settings.UseQ && Q.IsReady() && PlayerMana >= SettingsMana.MinQMana)
     {
         var minion = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, Player.Instance.Position, Q.Range).FirstOrDefault(m => m.IsValidTarget() && m.Distance(Player.Instance) > 300 && m.Health <= Damages.QDamage(m) && Q.GetPrediction(m).HitChance >= SettingsPrediction.MinQHCLastHit);
         if (minion != null)
         {
             lastQCast = Environment.TickCount;
             Debug.WriteChat("Casting Q in Last Hit, Target: {0}, Distance: {1}, Target HP: {2}", minion.Name, "" + minion.Distance(Player.Instance), "" + minion.Health);
             Q.Cast(minion);
             return;
         }
     }
     if (Settings.UseE && E.IsReady() && PlayerMana >= SettingsMana.MinEMana)
     {
         var minion = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, Player.Instance.Position, E.Range).FirstOrDefault(m => m.IsValidTarget() && m.Distance(Player.Instance) > 300 && m.Health <= Damages.QDamage(m) && E.GetPrediction(m).HitChance >= SettingsPrediction.MinEHCLastHit);
         if (minion != null)
         {
             if (Environment.TickCount - lastQCast < 1500)
             {
                 return;
             }
             Debug.WriteChat("Casting E in Last Hit, Target: {0}, Distance: {1}, Target HP: {2}", minion.Name, "" + minion.Distance(Player.Instance), "" + minion.Health);
             E.Cast(minion);
             return;
         }
     }
 }
示例#16
0
        public override void Execute()
        {
            // Auto-toggle W off
            if (Settings.AutoWOff && WActive)
            {
                if (PlayerHealth < SettingsHealth.MinWHealth)
                {
                    Debug.WriteChat("Health below {0}%, turning W off", "" + SettingsHealth.MinWHealth);
                    W.Cast();
                }
                else
                {
                    var enemy =
                        EntityManager.Heroes.Enemies.FirstOrDefault(
                            e => !e.IsDead && e.Health > 0 && e.IsVisible && e.Distance(_PlayerPos) < 600);
                    var minion = EntityManager.MinionsAndMonsters.CombinedAttackable.FirstOrDefault(
                        e => !e.IsDead && e.Health > 0 && e.IsVisible && e.Distance(_PlayerPos) < 600);
                    if (enemy == null && minion == null)
                    {
                        Debug.WriteChat("No enemies around - turning W off.");
                        W.Cast();
                    }
                }
            }

            // Auto Q Harass
            if (SettingsHarass.AutoQ && Q.IsReady() && PlayerHealth >= SettingsHarass.MinAutoQHealth && !_Player.IsRecalling() && !PlayerIsUnderEnemyTurret() /* Don't harass under enemy turrets */ && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) /* Don't Harass in Combo, it can mess it up */)
            {
                var enemies = EntityManager.Heroes.Enemies.Where(
                    e => e.IsValidTarget(SettingsCombo.MaxQDistance)).OrderBy(e => _Player.Distance(e));
                foreach (var enemy in enemies)
                {
                    if (
                        DrMundo.Config.ModesMenu.MenuModes["blacklist" + enemy.ChampionName].Cast <CheckBox>()
                        .CurrentValue)
                    {
                        continue;
                    }
                    var pred = Q.GetPrediction(enemy);
                    if (pred.HitChance >= SettingsPrediction.MinQHCAutoHarass)
                    {
                        Q.Cast(pred.CastPosition);
                        Debug.WriteChat("Casting Q in Auto Harass, Target: {0}, HitChance: {1}", enemy.ChampionName, pred.HitChance.ToString());
                        break;
                    }
                }
            }

            // KillSteal
            if (Settings.KsQ && Q.IsReady())
            {
                var enemies =
                    EntityManager.Heroes.Enemies.Where(
                        e => e.IsValidTarget(Q.Range) && e.TotalShieldHealth() < Damages.QDamage(e));
                foreach (var enemy in enemies)
                {
                    if (!enemy.HasBuffOfType(BuffType.SpellImmunity) && !enemy.HasBuffOfType(BuffType.SpellShield))
                    {
                        var pred = Q.GetPrediction(enemy);
                        if (pred.HitChance >= SettingsPrediction.MinQHCKillSteal)
                        {
                            Q.Cast(enemy);
                            Debug.WriteChat("Casting Q in KS on {0}, Enemy HP: {1}", "" + enemy.ChampionName,
                                            "" + enemy.Health);
                            break;
                        }
                    }
                }
            }
            if (Settings.KsIgnite && HasIgnite && Ignite.IsReady())
            {
                var enemy =
                    EntityManager.Heroes.Enemies.FirstOrDefault(
                        e => e.IsValidTarget(Ignite.Range) && e.TotalShieldHealth() < Damages.IgniteDmg(e));
                if (enemy != null)
                {
                    Ignite.Cast(enemy);
                    Debug.WriteChat("Casting Ignite in KS on {0}, Enemy HP: {1}", "" + enemy.ChampionName, "" + enemy.Health);
                }
            }

            // Automatic ult usage
            if (Settings.AutoR && R.IsReady() && !Player.Instance.IsRecalling() && !Player.Instance.IsInShopRange())
            {
                var enemiesAround = EntityManager.Heroes.Enemies.Count(e => e.Distance(Player.Instance) < 1500 && e.IsValidTarget());
                if (enemiesAround >= Settings.AutoRMinEnemies && Player.Instance.HealthPercent <= Settings.AutoRMinHP)
                {
                    R.Cast();
                    Debug.WriteChat("AutoCasting R, Enemies around: {0}, Current HP: {1}", "" + enemiesAround, "" + ((int)PlayerHealth));
                }
            }

            // Potion manager
            if (Settings.Potion && !Player.Instance.IsInShopRange() && Player.Instance.HealthPercent <= Settings.potionMinHP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemCrystalFlaskJungle") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask")))
            {
                if (Item.HasItem(HealthPotion.Id) && Item.CanUseItem(HealthPotion.Id))
                {
                    Debug.WriteChat("Using HealthPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    HealthPotion.Cast();
                    return;
                }
                if (Item.HasItem(HuntersPotion.Id) && Item.CanUseItem(HuntersPotion.Id))
                {
                    Debug.WriteChat("Using HuntersPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    HealthPotion.Cast();
                    return;
                }
                if (Item.HasItem(TotalBiscuit.Id) && Item.CanUseItem(TotalBiscuit.Id))
                {
                    Debug.WriteChat("Using TotalBiscuitOfRejuvenation because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    TotalBiscuit.Cast();
                    return;
                }
                if (Item.HasItem(RefillablePotion.Id) && Item.CanUseItem(RefillablePotion.Id))
                {
                    Debug.WriteChat("Using RefillablePotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    RefillablePotion.Cast();
                    return;
                }
                if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id))
                {
                    Debug.WriteChat("Using CorruptingPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
                    CorruptingPotion.Cast();
                    return;
                }
            }
        }
示例#17
0
 public override void Execute()
 {
     // KillSteal
     if (Environment.TickCount - lastKSTime > 500 && ((Settings.KsQW && Q.IsReady()) || (Settings.KsIgnite && HasIgnite)))
     {
         var enemies = EntityManager.Heroes.Enemies.Where(e => e.IsValidTarget(Q.Range - 50));
         if (Settings.KsQW && Q.IsReady() && W.IsReady() && PlayerMana >= 95)
         {
             var target = enemies.FirstOrDefault(e => Q.IsInRange(e) && e.TotalShieldHealth() < (Damages.QDamage(e) + Damages.WDamage(e)) && !e.HasBuffOfType(BuffType.SpellImmunity) && !e.HasBuffOfType(BuffType.SpellShield));
             if (target != null)
             {
                 lastKSTime = Environment.TickCount;
                 bool wcast = false;
                 if (target.TotalShieldHealth() > Damages.QDamage(target))
                 {
                     W.Cast();
                     Orbwalker.ResetAutoAttack();
                     wcast = true;
                 }
                 Q.Cast(target);
                 Debug.Write("Casting Q{0} in KS on {1} who has {2}HP.", (wcast ? "+W" : ""), target.ChampionName, target.Health.ToString());
                 return;
             }
         }
         if (Settings.KsIgnite && HasIgnite && Ignite.IsReady())
         {
             var target = enemies.FirstOrDefault(e => W.IsInRange(e) && e.TotalShieldHealth() < Damages.IgniteDmg(e));
             if (target != null)
             {
                 lastKSTime = Environment.TickCount;
                 Ignite.Cast(target);
                 Debug.Write("Casting Ignite in KS on {0} who has {1}HP.", target.ChampionName, target.Health.ToString());
                 return;
             }
         }
     }
     // Auto E stun
     if (Player.Instance.HasBuff("JaxCounterStrike") && E.IsReady())
     {
         var countenemies = EntityManager.Heroes.Enemies.Count(e => e.IsValidTarget(E.Range));
         if (countenemies >= SettingsCombo.MinEStunEnemies)
         {
             E.Cast();
             Debug.WriteChat("Casting E early to stun " + countenemies + " enemies.");
         }
     }
     // Potion manager
     if (Settings.Potion && !Player.Instance.IsInShopRange() && Player.Instance.HealthPercent <= Settings.potionMinHP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemCrystalFlaskJungle") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask")))
     {
         if (Item.HasItem(HealthPotion.Id) && Item.CanUseItem(HealthPotion.Id))
         {
             Debug.WriteChat("Using HealthPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
             HealthPotion.Cast();
             return;
         }
         if (Item.HasItem(HuntersPotion.Id) && Item.CanUseItem(HuntersPotion.Id))
         {
             Debug.WriteChat("Using HuntersPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
             HuntersPotion.Cast();
             return;
         }
         if (Item.HasItem(TotalBiscuit.Id) && Item.CanUseItem(TotalBiscuit.Id))
         {
             Debug.WriteChat("Using TotalBiscuitOfRejuvenation because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
             TotalBiscuit.Cast();
             return;
         }
         if (Item.HasItem(RefillablePotion.Id) && Item.CanUseItem(RefillablePotion.Id))
         {
             Debug.WriteChat("Using RefillablePotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
             RefillablePotion.Cast();
             return;
         }
         if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id))
         {
             Debug.WriteChat("Using CorruptingPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
             CorruptingPotion.Cast();
             return;
         }
     }
     if (Settings.Potion && !Player.Instance.IsInShopRange() && Player.Instance.ManaPercent <= Settings.potionMinMP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask")))
     {
         if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id))
         {
             Debug.WriteChat("Using CorruptingPotion because below {0}% MP - have {1}% MP", String.Format("{0}", Settings.potionMinMP), String.Format("{0:##.##}", Player.Instance.ManaPercent));
             CorruptingPotion.Cast();
         }
         if (Item.HasItem(HuntersPotion.Id) && Item.CanUseItem(HuntersPotion.Id))
         {
             Debug.WriteChat("Using HuntersPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent));
             HuntersPotion.Cast();
             return;
         }
     }
 }