Exemplo n.º 1
0
        public override void Execute()
        {
            // Kill Steal
            foreach (var enemy in EntityManager.Heroes.Enemies.Where(e => e.IsValidTarget(SpellManager.HasIgnite() ? SpellManager.Ignite.Range : SpellManager.R.Range)))
            {
                if (Settings.KsR && SpellManager.R.IsReady() && SpellManager.R.IsInRange(enemy) && Damages.RDamage(enemy) > enemy.TotalShieldHealth())
                {
                    if (enemy.HasBuffOfType(BuffType.SpellImmunity))
                    {
                        continue;
                    }
                    SpellManager.R.Cast(enemy);
                    break;
                }

                if (Settings.KsIgnite && SpellManager.HasIgnite() && SpellManager.Ignite.IsReady() &&
                    Damages.IgniteDmg(enemy) > enemy.Health && SpellManager.Ignite.IsInRange(enemy))
                {
                    SpellManager.Ignite.Cast(enemy);
                    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;
                }
            }
        }
Exemplo n.º 2
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;
                }
            }
        }
Exemplo n.º 3
0
        public override void Execute()
        {
            // KillSteal
            if ((Settings.KsR || Settings.KsE || Settings.KsW || (Settings.KsIgnite && HasIgnite)) && Environment.TickCount - lastKSTime > 1000)
            {
                var enemies = EntityManager.Heroes.Enemies.Where(e => e.IsValidTarget(600));
                if (Settings.KsR && R.IsReady() && PlayerMana >= SettingsMana.MinRMana)
                {
                    var target = enemies.FirstOrDefault(e => R.IsInRange(e) && e.TotalShieldHealth() < Damages.RDamage(e) && !e.HasBuffOfType(BuffType.SpellImmunity) && !e.HasBuffOfType(BuffType.SpellShield));
                    if (target != null)
                    {
                        lastKSTime = Environment.TickCount;
                        R.Cast(target);
                        Debug.Write("Casting R in KS on {0} who has {1}HP.", target.ChampionName, target.Health.ToString());
                        return;
                    }
                }
                if (Settings.KsE && E.IsReady() && PlayerMana >= SettingsMana.MinEMana)
                {
                    var target = enemies.FirstOrDefault(e => E.IsInRange(e) && e.Health < Damages.EDamage(e) && !e.HasBuffOfType(BuffType.SpellImmunity) && !e.HasBuffOfType(BuffType.SpellShield));
                    if (target != null)
                    {
                        lastKSTime = Environment.TickCount;
                        E.Cast(target);
                        Debug.Write("Casting E in KS on {0} who has {1}HP.", target.ChampionName, target.Health.ToString());
                        return;
                    }
                }
                if (Settings.KsW && W.IsReady() && PlayerMana >= SettingsMana.MinWMana)
                {
                    var target = enemies.FirstOrDefault(e => W.IsInRange(e) && e.Health < Damages.WDamage(e) && !e.HasBuffOfType(BuffType.SpellImmunity) && !e.HasBuffOfType(BuffType.SpellShield));
                    if (target != null)
                    {
                        var pred = W.GetPrediction(target);
                        if (pred.HitChance >= SettingsPrediction.MinWHCKillSteal)
                        {
                            lastKSTime = Environment.TickCount;
                            W.Cast(pred.CastPosition);
                            Debug.Write("Casting W 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.Health < 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;
                    }
                }
            }
            // Dash To Cursor
            if (Settings.WToCursor)
            {
                var cursorPos = Game.CursorPos;
                if (W.IsReady())
                {
                    if (cursorPos.Distance(_PlayerPos) < 200)
                    {
                        return;
                    }
                    if (cursorPos.Distance(_PlayerPos) <= W.Range)
                    {
                        W.Cast(cursorPos);
                    }
                    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();
                }
            }
        }
Exemplo n.º 4
0
        public override void Execute()
        {
            // KillSteal
            if (Settings.KsE && E.IsReady())
            {
                var enemy = EntityManager.Heroes.Enemies.FirstOrDefault(e => !e.IsDead && e.Health > 0 && E.IsInRange(e) && e.IsVisible && !e.IsZombie && !e.IsInvulnerable && e.TotalShieldHealth() < Damages.EDamage(e));
                if (enemy != null)
                {
                    if (!enemy.HasBuffOfType(BuffType.SpellImmunity) && !enemy.HasBuffOfType(BuffType.SpellShield))
                    {
                        Debug.WriteChat("Casting E in KS on {0}, Enemy HP: {1}", "" + enemy.ChampionName, "" + enemy.Health);
                        E.Cast(enemy);
                        return;
                    }
                }
            }
            if (Settings.KsR && R.IsReady())
            {
                var enemy =
                    EntityManager.Heroes.Enemies.FirstOrDefault(
                        e =>
                        !e.IsDead && e.Health > 0 && R.IsInRange(e) && e.IsVisible && !e.IsZombie &&
                        !e.IsInvulnerable && e.TotalShieldHealth() < Damages.RDamage(e));
                if (enemy != null)
                {
                    if (!enemy.HasBuffOfType(BuffType.SpellImmunity) && !enemy.HasBuffOfType(BuffType.SpellShield))
                    {
                        Debug.WriteChat("Casting R in KS on {0}, Enemy HP: {1}", "" + enemy.ChampionName, "" + enemy.Health);
                        R.Cast();
                        return;
                    }
                }
            }
            if (Settings.KsIgnite && HasIgnite && Ignite.IsReady())
            {
                var enemy =
                    EntityManager.Heroes.Enemies.FirstOrDefault(
                        e =>
                        !e.IsDead && e.Health > 0 && Ignite.IsInRange(e) && e.IsVisible && !e.IsZombie &&
                        !e.IsInvulnerable && e.TotalShieldHealth() < Damages.IgniteDmg(e));
                if (enemy != null)
                {
                    Debug.WriteChat("Casting Ignite in KS on {0}, Enemy HP: {1}", "" + enemy.ChampionName, "" + enemy.Health);
                    Ignite.Cast(enemy);
                    return;
                }
            }


            // Automatic ult usage
            if (Settings.AutoR && R.IsReady() && !Player.Instance.IsRecalling())
            {
                var ultableEnemies = EntityManager.Heroes.Enemies.Where(e => R.IsInRange(e) && !e.IsDead && !e.IsZombie && !e.IsInvulnerable).ToList();
                if (ultableEnemies.Count() >= Settings.AutoRMinEnemies && Player.Instance.HealthPercent >= Settings.AutoRMinHP)
                {
                    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));
                    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;
                }
            }
        }
Exemplo n.º 5
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();
                }
            }
        }
Exemplo n.º 6
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;
                }
            }
        }
Exemplo n.º 7
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;
                }
            }
        }
Exemplo n.º 8
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;
                    }
                }
            }
        }
Exemplo n.º 9
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;
         }
     }
 }