Exemplo n.º 1
0
 public override void Execute()
 {
     // Items
     if (Settings.UseItems)
     {
         var enemy = TargetSelector.GetTarget(BOTRK.Range, DamageType.Physical);
         if (enemy != null)
         {
             if (CanUseItem(ItemId.Bilgewater_Cutlass))
             {
                 Cutlass.Cast(enemy);
                 Debug.WriteChat("Using Bilgewater Cutlass on {0}", enemy.ChampionName);
             }
             else if (CanUseItem(ItemId.Blade_of_the_Ruined_King) &&
                      enemy.HealthPercent <= Settings.MaxBOTRKHPEnemy && PlayerHealth <= Settings.MaxBOTRKHPPlayer)
             {
                 BOTRK.Cast(enemy);
                 Debug.WriteChat("Using BOTRK on {0}", enemy.ChampionName);
             }
         }
     }
     // Skills
     if (Settings.UseR && R.IsReady() && PlayerMana >= SettingsMana.MinRMana)
     {
         var target = TargetSelector.GetTarget(R.Range, DamageType.Magical);
         if (target != null)
         {
             if (!target.HasBuffOfType(BuffType.SpellImmunity) && !target.HasBuffOfType(BuffType.SpellShield))
             {
                 var targetHealth = target.TotalShieldHealth();
                 if (target.HasBuff("TristanaEChargeSound"))
                 {
                     targetHealth -= Damages.EDamage(target);
                 }
                 if (targetHealth < Damages.RDamage(target))
                 {
                     R.Cast(target);
                     Debug.WriteChat("Casting R in Combo to finish {0}, calculated HP to cast R: {1}, current HP: {2}.", target.ChampionName, targetHealth.ToString(), target.Health.ToString());
                     return;
                 }
             }
         }
     }
     if (Settings.UseW && W.IsReady() && PlayerMana >= SettingsMana.MinWMana)
     {
         var target = TargetSelector.GetTarget(W.Range, DamageType.Magical);
         if (target != null)
         {
             if (!target.HasBuffOfType(BuffType.SpellImmunity) && !target.HasBuffOfType(BuffType.SpellShield))
             {
                 var pred = W.GetPrediction(target);
                 if (pred.HitChance >= SettingsPrediction.MinWHCCombo)
                 {
                     W.Cast(pred.CastPosition);
                     Debug.WriteChat("Casting W in Combo on {0}", target.ChampionName);
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
        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);
                }
            }
        }
Exemplo n.º 3
0
        public override void Execute()
        {
            // Skills
            if (Settings.UseR && R.IsReady() && PlayerMana >= SettingsMana.MinRManaC)
            {
                var target = TargetSelector.GetTarget(R.Range, DamageType.Magical);
                if (target != null)
                {
                    if (!target.HasBuffOfType(BuffType.SpellImmunity) && !target.HasBuffOfType(BuffType.SpellShield))
                    {
                        var targetHealth = target.TotalShieldHealth();
                        if (target.HasBuff("TristanaEChargeSound"))
                        {
                            targetHealth -= Damages.EDamage(target);
                        }
                        if (targetHealth < Damages.RDamage(target))
                        {
                            R.Cast(target);
                            return;
                        }
                    }
                }
            }
            if (Settings.UseW && W.IsReady() && PlayerMana >= SettingsMana.MinWManaC)
            {
                var target = TargetSelector.GetTarget(W.Range, DamageType.Magical);

                if (target != null)
                {
                    if (!Settings.WTurret && Extensions.CountEnemiesInRange(target, 200) <= 2)
                    {
                        if (!target.HasBuffOfType(BuffType.SpellImmunity) && !target.HasBuffOfType(BuffType.SpellShield) &&
                            !target.IsUnderTurret())
                        {
                            var pred = W.GetPrediction(target);
                            if (pred.HitChance >= SettingsPrediction.MinWHCCombo)
                            {
                                W.Cast(pred.CastPosition);
                            }
                        }
                    }
                    else
                    {
                        if (!target.HasBuffOfType(BuffType.SpellImmunity) && !target.HasBuffOfType(BuffType.SpellShield))
                        {
                            var pred = W.GetPrediction(target);
                            if (pred.HitChance >= SettingsPrediction.MinWHCCombo)
                            {
                                W.Cast(pred.CastPosition);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 4
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;
                }
            }
        }
Exemplo n.º 5
0
        public override void Execute()
        {
            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(Q.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);
                Q.Cast(castBehind);
            }


            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);
                }
            }
        }
Exemplo n.º 6
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.º 7
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.º 8
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.º 9
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;
                }
            }
        }