Exemplo n.º 1
0
        private static void QLastHit(Obj_AI_Base minion)
        {
            bool castQ = ((getKeyBindItem(waveClear, "waveUseQLH")) || getCheckBoxItem(waveClear, "waveUseQ") && Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear));

            if (castQ)
            {
                var distance   = LeagueSharp.Common.Geometry.LSDistance(player, minion);
                var t          = 250 + (int)distance / 2;
                var predHealth = HealthPrediction.GetHealthPrediction(minion, t, 0);
                Console.WriteLine(" Distance: " + distance + " timer : " + t + " health: " + predHealth);
                if (predHealth > 0 && Q.IsKillable(minion))
                {
                    Q.Cast(minion);
                }
            }
        }
Exemplo n.º 2
0
        private static void LastHit()
        {
            if (!getCheckBoxItem(lastHitMenu, "Q") || !Q.IsReady())
            {
                return;
            }
            var obj =
                GetMinions(Q.Range, MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.MaxHealth)
                .FirstOrDefault(i => Q.IsKillable(i));

            if (obj == null)
            {
                return;
            }
            Q.Cast(obj, getCheckBoxItem(miscMenu, "Packet"));
        }
Exemplo n.º 3
0
        public static void slayMaderDuker(Obj_AI_Base target)
        {
            try
            {
                if (target == null)
                {
                    return;
                }
                if (MasterSharp.getCheckBoxItem(MasterSharp.comboMenu, "useSmite"))
                {
                    useSmiteOnTarget(target);
                }

                if (target.Distance(player) < 500)
                {
                    sumItems.cast(SummonerItems.ItemIds.Ghostblade);
                }
                if (target.Distance(player) < 300)
                {
                    sumItems.cast(SummonerItems.ItemIds.Hydra);
                }
                if (target.Distance(player) < 300)
                {
                    sumItems.cast(SummonerItems.ItemIds.Tiamat);
                }
                if (target.Distance(player) < 300)
                {
                    sumItems.cast(SummonerItems.ItemIds.Cutlass, target);
                }
                if (target.Distance(player) < 500 && player.Health / player.MaxHealth * 100 < 85)
                {
                    sumItems.cast(SummonerItems.ItemIds.BotRK, target);
                }

                if (MasterSharp.getCheckBoxItem(MasterSharp.comboMenu, "useQ") &&
                    (Orbwalker.CanMove || Q.IsKillable(target)))
                {
                    useQSmart(target);
                }
                if (MasterSharp.getCheckBoxItem(MasterSharp.comboMenu, "useE"))
                {
                    useESmart(target);
                }
                if (MasterSharp.getCheckBoxItem(MasterSharp.comboMenu, "useR"))
                {
                    useRSmart(target);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
Exemplo n.º 4
0
        public static void OnFarm()
        {
            if (Q.IsReady() && Q.IsActive() && Player.ManaPercent >= getSliderItem(qMenu, "FarmQMana"))
            {
                var killable =
                    MinionManager.GetMinions(Q.Range, MinionTypes.All, MinionTeam.NotAlly)
                    .FirstOrDefault(m => Q.IsKillable(m));

                if (killable.IsValidTarget() && killable.Health > Player.GetAutoAttackDamage(killable, true) &&
                    Q.CastOnUnit(killable))
                {
                    return;
                }
            }

            if (!Q.IsReady() && W.IsReady() && !W.IsFirstW() && getCheckBoxItem(wMenu, "WBackFarm") && W.Cast())
            {
                return;
            }

            var wReady = W.IsReady() && W.IsActive() && W.IsFirstW();
            var rReady = R.IsReady() && R.IsActive() && R.GetSpellSlot() == SpellSlot.W && R.IsFirstW();

            if (!wReady && !rReady)
            {
                return;
            }

            var min     = getSliderItem(wMenu, "FarmWMinions");
            var minions = MinionManager.GetMinions(W.Range, MinionTypes.All, MinionTeam.NotAlly);

            if (minions.Count < min)
            {
                return;
            }

            var pos = W.GetCircularFarmLocation(minions);

            if (pos.MinionsHit < min)
            {
                return;
            }

            if (wReady && W.Cast(pos.Position))
            {
                return;
            }

            if (rReady && R.Cast(pos.Position))
            {
            }
        }
Exemplo n.º 5
0
 private static void KillSteal()
 {
     if (ksIgnite && Ignite.IsReady())
     {
         var target = TargetSelector.GetTarget(600, DamageType.True);
         if (target != null)
         {
             CastIgnite(target);
             return;
         }
     }
     if (ksSmite &&
         (Helper.CurrentSmiteType == Helper.SmiteType.Blue || Helper.CurrentSmiteType == Helper.SmiteType.Red))
     {
         var target = TargetSelector.GetTarget(760, DamageType.True);
         if (target != null)
         {
             CastSmite(target);
             return;
         }
     }
     if (ksQ && Q.IsReady())
     {
         var target = Q.GetTarget(Q.Width / 2);
         if (target != null && Q.IsKillable(target))
         {
             Q2.Cast(target);
             return;
         }
     }
     if (ksE && E.IsReady())
     {
         var target = E.GetTarget();
         if (target != null && E.IsKillable(target))
         {
             E.Cast(target);
         }
     }
 }
Exemplo n.º 6
0
        public static void useRSmart()
        {
            var obj = (from enemy in HeroManager.Enemies.Where(i => R.IsInRange(i) && CanCastR(i))
                       let sub = enemy.GetEnemiesInRange(RWidth).Where(CanCastR).ToList()
                                 where
                                 (sub.Count > 1 && R.IsKillable(enemy)) ||
                                 sub.Any(i => i.HealthPercent < YasuoSharp.smartR["useRHP"].Cast <Slider>().CurrentValue) ||
                                 sub.Count >= YasuoSharp.smartR["useRHit"].Cast <Slider>().CurrentValue
                                 orderby sub.Count descending
                                 select enemy).ToList();

            if (obj.Any())
            {
                var target = !YasuoSharp.smartR["useRHitTime"].Cast <CheckBox>().CurrentValue ? obj.FirstOrDefault() : obj.Where(i => TimeLeftR(i) * 1000 < 150 + Game.Ping * 2).MinOrDefault(TimeLeftR);
                if (target != null && R.CastOnUnit(target))
                {
                    return;
                }
            }

            /*
             * float timeToLand = float.MaxValue;
             * List<AIHeroClient> enemInAir = getKockUpEnemies(ref timeToLand);
             * foreach (AIHeroClient enem in enemInAir)
             * {
             *  int aroundAir = 0;
             *  foreach (AIHeroClient enem2 in enemInAir)
             *  {
             *      if (Vector3.DistanceSquared(enem.ServerPosition, enem2.ServerPosition) < 400 * 400)
             *          aroundAir++;
             *  }
             *  if (aroundAir >= YasuoSharp.smartR["useRHit"].Cast<Slider>().CurrentValue && timeToLand < 0.4f)
             *      R.Cast(enem);
             * }
             */
        }
Exemplo n.º 7
0
        public static void OnFarm()
        {
            if (!getKeyBindItem(farmMenu, "FarmEnabled"))
            {
                return;
            }

            var minions = MinionManager.GetMinions(E.Range);

            if (getCheckBoxItem(farmMenu, "WFarm") && W.IsReady())
            {
                var wKillableMinions = minions.Count(m => m.IsValidTarget(W.Range) && W.IsKillable(m));
                if (wKillableMinions < getSliderItem(farmMenu, "WMinionsHit"))
                {
                    if (getCheckBoxItem(farmMenu, "EFarm") && E.IsReady()) // e->w
                    {
                        foreach (var target in from target in Utility.GetETargets()
                                 let killableMinions =
                                     MinionManager.GetMinions(target.ServerPosition, W.Range + E.Range)
                                     .Count(m => W.IsKillable(m))
                                     where killableMinions >= getSliderItem(farmMenu, "EMinionsHit")
                                     select target)
                        {
                            CastWAfterE = true;
                            if (E.CastOnUnit(target))
                            {
                                return;
                            }
                        }
                    }
                }
                else if (W.Cast())
                {
                    return;
                }
            }

            if (!getCheckBoxItem(farmMenu, "QFarm") || !Q.IsReady())
            {
                return;
            }

            var qKillableMinion = minions.FirstOrDefault(m => m.IsValidTarget(Q.Range) && Q.IsKillable(m));
            var qMinion         = minions.Where(m => m.IsValidTarget(Q.Range)).MinOrDefault(m => m.Health);

            if (qKillableMinion == null)
            {
                if (getCheckBoxItem(farmMenu, "QLastHit") || qMinion == null)
                {
                    return;
                }

                Q.CastOnUnit(qMinion);
                return;
            }

            Q.CastOnUnit(qKillableMinion);
        }
Exemplo n.º 8
0
        public override void Game_OnGameUpdate(EventArgs args)
        {
            if (Orbwalker.CanMove && (ComboActive || HarassActive))
            {
                var useW = ComboActive ? Program.combo["UseWC"].Cast <CheckBox>().CurrentValue : Program.harass["UseWH"].Cast <CheckBox>().CurrentValue;
                var useE = ComboActive ? Program.combo["UseEC"].Cast <CheckBox>().CurrentValue : Program.harass["UseEH"].Cast <CheckBox>().CurrentValue;

                var t = TargetSelector.GetTarget(E.Range, DamageType.Physical);
                if (!t.LSIsValidTarget() || t.HasKindredUltiBuff())
                {
                    return;
                }

                if (useW)
                {
                    if (W.IsReady() && t.LSIsValidTarget(W.Range))
                    {
                        W.Cast(t, false, true);
                    }
                }

                if (useE && E.IsReady() && t.GetBuffCount("TwitchDeadlyVenom") == 6)
                {
                    E.Cast();
                }

                if (ObjectManager.Get <AIHeroClient>().Find(e1 => e1.LSIsValidTarget(E.Range) && E.IsKillable(e1)) != null)
                {
                    E.Cast();
                }
            }

            if (Program.misc["UseEM"].Cast <CheckBox>().CurrentValue&& E.IsReady())
            {
                foreach (
                    var hero in
                    ObjectManager.Get <AIHeroClient>()
                    .Where(
                        hero =>
                        hero.LSIsValidTarget(E.Range) &&
                        (ObjectManager.Player.LSGetSpellDamage(hero, SpellSlot.E) - 10 > hero.Health)))
                {
                    E.Cast();
                }
            }
        }
Exemplo n.º 9
0
        private static bool CastSequence(string mode = null)
        {
            mode = string.IsNullOrEmpty(mode) ? Orbwalker.ActiveMode.ToString() : mode;

            foreach (var spell in Spells.Where(s => Player.Spellbook.GetSpell(s.Slot).IsReady()))
            {
                if (mode != "KS" && !Menu.Item(spell.Slot + mode, true).IsActive())
                {
                    continue;
                }

                if (!Player.Spellbook.GetSpell(spell.Slot).Name.ToLower().Equals(spell.SpellName.ToLower()))
                {
                    continue;
                }

                var s = new Spell(spell.Slot, spell.Range);
                var collision = spell.CollisionObjects.Length > 1;
                var type = spell.SpellType.GetSkillshotType();

                s.SetSkillshot(spell.Delay, spell.Width, spell.MissileSpeed, collision, type);
                var targ = s.GetTarget();

                if (!targ.IsValidTarget())
                {
                    continue;
                }

                if ((mode != "KS" || s.IsKillable(targ)) && s.Cast(targ).IsCasted())
                {
                    return true;
                }
            }

            return false;
        }
Exemplo n.º 10
0
 public static bool IsCastable(this Spell spell, Obj_AI_Base target, bool ks = false, bool checkKillable = true)
 {
     return(spell.CanCast(target) && spell.IsActive(ks) && (!checkKillable || spell.IsKillable(target)));
 }