Ejemplo n.º 1
0
        public void LaneClear()
        {
            if (ObjectManager.Player.ManaPercent < LaneClearMinMana || !LaneClearToggle)
            {
                return;
            }

            if (LaneClearUseQ)
            {
                var minion = MinionManager.GetMinions(Spells[Q].Range).Where(p => p.IsSiegeMinion() || p.CharData.BaseSkinName.Contains("Siege")).FirstOrDefault();
                if (minion != null)
                {
                    if ((minion.CharData.BaseSkinName.Contains("Siege") && Spells[Q].IsKillable(minion)) || minion.IsSiegeMinion())
                    {
                        Spells[Q].CastOnUnit(minion);
                    }
                }
            }

            if (LaneClearUseE)
            {
                var fromPosition = GetLaneClearLaserStart();
                if (fromPosition.IsValid())
                {
                    var farmLocation = GetBestLaserFarmLocation(fromPosition, MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(fromPosition.To3D(), 700), 0, 80, 1200f, fromPosition.To3D(), 700, false, SkillshotType.SkillshotLine), 80, 700);

                    if (farmLocation.MinionsHit >= LaneClearUseEMin)
                    {
                        Spells[E].Cast(fromPosition, farmLocation.Position);
                    }
                }
            }
        }
Ejemplo n.º 2
0
Archivo: Karma.cs Proyecto: betw01/detu
        public static List <Vector2> entitiesAroundTarget(Obj_AI_Hero target)
        {
            List <Obj_AI_Base> minionsAround = MinionManager.GetMinions(target.ServerPosition, 450, MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.None);
            List <Vector2>     entities      = MinionManager.GetMinionsPredictedPositions(minionsAround, 0.5f, 90f, 1800f, Player.ServerPosition, 250, true, SkillshotType.SkillshotLine, target.ServerPosition);

            return(entities);
        }
Ejemplo n.º 3
0
        public static void Farm()
        {
            Obj_AI_Minion minion = ObjectManager.Get <Obj_AI_Minion>().Where(x => x.IsEnemy && x.IsValidTarget(E.Range)).OrderBy(x => x.Health).FirstOrDefault();

            MinionManager.FarmLocation QFarmLocation =
                Q.GetCircularFarmLocation(
                    MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(Q.Range),
                                                               Q.Delay, Q.Width, Q.Speed,
                                                               Player.Position, Q.Range,
                                                               false, SkillshotType.SkillshotLine), Q.Width);
            MinionManager.FarmLocation WFarmLocation =
                W.GetCircularFarmLocation(MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(W.Range),
                                                                                     W.Delay, W.Width, W.Speed,
                                                                                     Player.Position, W.Range,
                                                                                     false, SkillshotType.SkillshotLine), Q.Width);
            if (E.IsReady() && Config.Item("farme").GetValue <bool>())
            {
                E.CastOnUnit(minion);
            }
            if (Q.IsReady() && Config.Item("farmq").GetValue <bool>())
            {
                Q.Cast(QFarmLocation.Position);
            }
            if (W.IsReady() && Config.Item("farmw").GetValue <bool>())
            {
                W.Cast(WFarmLocation.Position);
            }
        }
Ejemplo n.º 4
0
        public static void IceShardCast(bool minions, bool groupfocusMinions)
        {
            if (!IceShard.IsReady())
            {
                return;
            }

            if (minions)
            {
                if (groupfocusMinions)
                {
                    MinionManager.FarmLocation farmLocation =
                        IceShard.GetLineFarmLocation(
                            MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(IceShard.Range),
                                                                       IceShard.Delay, IceShard.Width, IceShard.Speed,
                                                                       Program.Player.Position, IceShard.Range,
                                                                       false, SkillshotType.SkillshotLine), IceShard.Width);
                    if (farmLocation.MinionsHit != 0)
                    {
                        IceShard.Cast(farmLocation.Position);
                    }
                }
                else
                {
                    Obj_AI_Base targetMinion =
                        MinionManager.GetMinions(IceShard.Range)
                        .Where(minion => minion.Health < IceShard.GetDamage(minion))
                        .OrderByDescending(minion => minion.Health)
                        .Last();
                    IceShard.Cast(
                        IceShard.GetPrediction(targetMinion, false, IceShard.Range,
                                               new[] { CollisionableObjects.YasuoWall }).CastPosition);
                }
            }
        }
Ejemplo n.º 5
0
        private void DoLaneClear()
        {
            if (!ManaManager())
            {
                return;
            }
            Obj_AI_Minion minion = ObjectManager.Get <Obj_AI_Minion>().Where(x => x.IsEnemy && x.IsValidTarget(E.Range)).OrderBy(x => x.Health).FirstOrDefault();

            MinionManager.FarmLocation QFarmLocation =
                Q.GetCircularFarmLocation(
                    MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(Q.Range),
                                                               Q.Delay, Q.Width, Q.Speed,
                                                               Player.Position, Q.Range,
                                                               false, SkillshotType.SkillshotLine), Q.Width);
            MinionManager.FarmLocation WFarmLocation =
                W.GetCircularFarmLocation(MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(W.Range),
                                                                                     W.Delay, W.Width, W.Speed,
                                                                                     Player.Position, W.Range,
                                                                                     false, SkillshotType.SkillshotLine), Q.Width);
            if (E.IsReady() && Menu.Item("themp.laneclear.E").GetValue <bool>())
            {
                E.CastOnUnit(minion);
            }
            if (Q.IsReady() && Menu.Item("themp.laneclear.Q").GetValue <bool>())
            {
                Q.Cast(QFarmLocation.Position);
            }
            if (W.IsReady() && Menu.Item("themp.laneclear.W").GetValue <bool>())
            {
                W.Cast(WFarmLocation.Position);
            }
        }
Ejemplo n.º 6
0
        private void DoLaneClear()
        {
            if (ManaManager())
            {
                var            minions         = MinionManager.GetMinions(E.Range, MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.Health);
                List <Vector2> MinionPositions = MinionManager.GetMinionsPredictedPositions(minions,
                                                                                            W.Delay,
                                                                                            W.Width,
                                                                                            W.Speed,
                                                                                            Player.Position,
                                                                                            W.Range,
                                                                                            true,
                                                                                            SkillshotType.SkillshotCircle);
                MinionManager.FarmLocation FarmLocation = Q.GetLineFarmLocation(MinionPositions);
                if (FarmLocation.MinionsHit >= 3 &&
                    W.IsReady() &&
                    Menu.Item("themp.laneclear.w").GetValue <bool>())
                {
                    W.Cast(FarmLocation.Position);
                }

                if (Q.IsReady() &&
                    Menu.Item("themp.laneclear.q").GetValue <bool>() &&
                    minions[0].Health < Q.GetDamage(minions[0]) &&
                    Q.IsInRange(minions[0]))
                {
                    useQonTarg(minions[0], QhitChance.medium);
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        ///     Get Line Farm Location
        /// </summary>
        /// <param name="minionPositions">Minions</param>
        /// <param name="overrideWidth">Override Width</param>
        /// <returns>Farm Location. <seealso cref="MinionManager.FarmLocation" /></returns>
        public MinionManager.FarmLocation GetLineFarmLocation(List <Obj_AI_Base> minionPositions,
                                                              float overrideWidth = -1)
        {
            var positions = MinionManager.GetMinionsPredictedPositions(
                minionPositions, Delay, Width, Speed, From, Range, false, SkillshotType.SkillshotLine);

            return(GetLineFarmLocation(positions, overrideWidth >= 0 ? overrideWidth : Width));
        }
Ejemplo n.º 8
0
        /*
         * private static void Jungleclear()
         * {
         *  var jungle = MinionManager.GetMinions(Player.Position, Q.ChargedMaxRange, MinionTypes.All,
         *      MinionTeam.Neutral, MinionOrderTypes.MaxHealth);
         *  if (jungle[0] == null)
         *      return;
         *
         *  var useq = Config.Item("jungleMenu.useq").GetValue<bool>();
         *  var mana = Config.Item("jungleMenu.minmana").GetValue<Slider>().Value;
         *  var usew = Config.Item("jungleMenu.usew").GetValue<bool>();
         *
         *  if (Player.ManaPercent <= mana)
         *      return;
         *
         *
         *  if (usew && jungle[0].IsValidTarget())
         *  {
         *      if (!Q.IsCharging)
         *      {
         *          W.Cast(jungle[0]);
         *      }
         *  }
         *
         *
         *  if (useq && jungle[0].IsValidTarget())
         *  {
         *      if (!Q.IsCharging)
         *          Q.Cast(jungle[0].Position);
         *
         *      else
         *      {
         *          Q.Cast(jungle[0]);
         *      }
         *  }
         * }
         */

        private static void Laneclear()
        {
            var mana = Config.Item("laneMenu.minmana").GetValue <Slider>().Value;

            if (Player.ManaPercent <= mana && !Q.IsCharging)
            {
                return;
            }

            var minion = MinionManager.GetMinions(Player.Position, Q.ChargedMaxRange, MinionTypes.All, MinionTeam.Enemy,
                                                  MinionOrderTypes.MaxHealth).FirstOrDefault();

            if (minion == null)
            {
                return;
            }

            var useq    = Config.Item("laneMenu.useq").GetValue <bool>();
            var useqhit = Config.Item("laneMenu.useqhit").GetValue <Slider>().Value;
            var usew    = Config.Item("laneMenu.usew").GetValue <bool>();
            var usewhit = Config.Item("laneMenu.usewhit").GetValue <Slider>().Value;
            var minions = MinionManager.GetMinions(Player.Position, W.Range, MinionTypes.All, MinionTeam.Enemy,
                                                   MinionOrderTypes.MaxHealth);

            var wfarm = W.GetCircularFarmLocation(minions, Q.Width);

            var qLine = Q.GetLineFarmLocation(
                MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(Q.ChargedMaxRange),
                                                           Q.Delay, Q.Width, Q.Speed,
                                                           Player.Position, Q.ChargedMaxRange,
                                                           false, SkillshotType.SkillshotLine), Q.Width);


            foreach (var min in minions)
            {
                if (useq)
                {
                    if (!Q.IsCharging && qLine.MinionsHit >= useqhit)
                    {
                        Q.StartCharging();
                    }

                    else if (qLine.MinionsHit >= useqhit)
                    {
                        Q.Cast(qLine.Position);
                    }
                }

                if (usew && !Q.IsCharging && W.IsReady())
                {
                    if (wfarm.MinionsHit >= usewhit)
                    {
                        W.Cast(wfarm.Position);
                    }
                }
            }
        }
Ejemplo n.º 9
0
        private static bool PredictCastMinionEJungle(Vector2 fromPosition, int requiredHitNumber = 1)
        {
            var farmLocation = GetBestLaserFarmLocation(fromPosition, MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(fromPosition.To3D(), lengthE, MinionTypes.All, MinionTeam.Neutral), E.Delay, E.Width, speedE, fromPosition.To3D(), lengthE, false, SkillshotType.SkillshotLine), E.Width, lengthE);

            if (farmLocation.MinionsHit >= requiredHitNumber)
            {
                CastE(fromPosition, farmLocation.Position);
                return(true);
            }

            return(false);
        }
Ejemplo n.º 10
0
        private bool PredictCastMinionE(Vector2 fromPosition, int requiredHitNumber = 1)
        {
            var farmLocation = MinionManager.GetBestLineFarmLocation(MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(fromPosition.To3D(), lengthE), E.Delay, E.Width, speedE, fromPosition.To3D(), lengthE, false, SkillshotType.SkillshotLine), E.Width, lengthE);

            if (farmLocation.MinionsHit >= requiredHitNumber)
            {
                CastE(fromPosition, farmLocation.Position);
                return(true);
            }

            return(false);
        }
Ejemplo n.º 11
0
        private static bool PredictCastMinionE(Vector2 fromPosition, int requiredHitNumber = 1)
        {
            var farmLocation = GetBestLaserFarmLocation(fromPosition, MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(fromPosition.To3D(), lengthE), E.Delay, E.Width, speedE, fromPosition.To3D(), lengthE, false, SkillshotType.SkillshotLine), E.Width, lengthE);

            if (farmLocation.MinionsHit >= requiredHitNumber)
            {
                Player.CastSpell(SpellSlot.E, fromPosition.To3D(), farmLocation.Position.To3D());
                return(true);
            }

            return(false);
        }
Ejemplo n.º 12
0
        private static void LaneClear()
        {
            #region laneclear

            var qSpell  = getCheckBoxItem(clearMenu, "UseQl");
            var wSpell  = getCheckBoxItem(clearMenu, "UseWl");
            var qlSpell = getSliderItem(clearMenu, "UseQlslider");
            var wlSpell = getSliderItem(clearMenu, "UseWlslider");

            var minions = MinionManager.GetMinions(GnarSpells.QMini.Range, MinionTypes.All, MinionTeam.Enemy,
                                                   MinionOrderTypes.MaxHealth);
            if (minions == null)
            {
                return;
            }

            var QFarmLocation =
                GnarSpells.QMini.GetLineFarmLocation(
                    MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(GnarSpells.QMini.Range),
                                                               GnarSpells.QMini.Delay, GnarSpells.QMini.Width, GnarSpells.QMini.Speed,
                                                               Player.Position, GnarSpells.QMini.Range,
                                                               false, SkillshotType.SkillshotLine), GnarSpells.QMini.Width);

            var WFarmLocation =
                GnarSpells.WMega.GetLineFarmLocation(
                    MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(GnarSpells.WMega.Range),
                                                               GnarSpells.WMega.Delay, GnarSpells.WMega.Width, GnarSpells.WMega.Speed,
                                                               Player.Position, GnarSpells.WMega.Range,
                                                               false, SkillshotType.SkillshotLine), GnarSpells.WMega.Width);

            if (Player.IsMiniGnar())
            {
                if (qSpell && GnarSpells.QMini.IsReady() && QFarmLocation.MinionsHit > qlSpell)
                {
                    GnarSpells.QMini.Cast(QFarmLocation.Position);
                }
            }
            if (Player.IsMegaGnar())
            {
                if (wSpell && GnarSpells.WMega.IsReady() && WFarmLocation.MinionsHit > wlSpell)
                {
                    GnarSpells.WMega.Cast(WFarmLocation.Position);
                }
                if (qSpell && GnarSpells.QMega.IsReady())
                {
                    GnarSpells.QMega.Cast(minions[0]);
                }
            }

            #endregion
        }
Ejemplo n.º 13
0
        private static void LaneClear()
        {
            var minions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly);

            if (Q.IsReady() && Config.Item("UseQFarm").GetValue <bool>())
            {
                var minionPs = MinionManager.GetMinionsPredictedPositions(minions, 0.25f, 60f, 1600f, ObjectManager.Player.ServerPosition, 1200f, false, SkillshotType.SkillshotLine);
                var farm     = Q.GetLineFarmLocation(minionPs);
                if (farm.MinionsHit >= Config.Item("useQHit").GetValue <Slider>().Value)
                {
                    Q.Cast(farm.Position, true);
                }
            }
        }
Ejemplo n.º 14
0
            internal static void EMinion()
            {
                if (!e.IsReady() || MinionManager.GetMinions(e.Range).Count.Equals(0))
                {
                    return;
                }

                List <Vector2> minionPos = MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(e.Range), e.Delay, e.Width, e.Speed, Player.ServerPosition,
                                                                                      e.Range, false, e.Type);

                MinionManager.FarmLocation castPos = MinionManager.GetBestCircularFarmLocation(minionPos, e.Width, e.Range);
                if (castPos.MinionsHit != 0)
                {
                    e.Cast(castPos.Position);
                }
            }
Ejemplo n.º 15
0
        public void farmQ()
        {
            if (player.ManaPercent < 35 || !Q.IsReady())
            {
                return;
            }

            var mins      = MinionManager.GetMinions(Q.Range).Where(min => min.Health < Q.GetDamage(min)).ToList();
            var positions = MinionManager.GetMinionsPredictedPositions(mins, Q.Delay, Q.Width, Q.Speed, Q.From, Q.Range, true, SkillshotType.SkillshotLine);


            var minsQ = MinionManager.GetBestLineFarmLocation(positions, Q.Width, Q.Range);

            if (minsQ.MinionsHit != 0)
            {
                Q.Cast(minsQ.Position);
            }
        }
Ejemplo n.º 16
0
        private static void Laneclear()
        {
            var mana    = Player.ManaPercent > Config.ViktorConfig.Item("apollo.viktor.laneclear.mana").GetValue <Slider>().Value;
            var useE    = Config.ViktorConfig.Item("apollo.viktor.laneclear.e.bool").GetValue <bool>();
            var minhitE = Config.ViktorConfig.Item("apollo.viktor.laneclear.e.hit").GetValue <Slider>().Value;

            if (!mana)
            {
                return;
            }

            if (useE && Spell[SpellSlot.E].IsReady())
            {
                var dic  = new Dictionary <MinionManager.FarmLocation, Obj_AI_Base>();
                var list = new List <MinionManager.FarmLocation>();
                foreach (var minion in MinionManager.GetMinions(Player.ServerPosition, Spells.ECastRange))
                {
                    var farmLocation =
                        MinionManager.GetBestLineFarmLocation(
                            MinionManager.GetMinionsPredictedPositions(
                                MinionManager.GetMinions(minion.ServerPosition, Spell[SpellSlot.E].Range),
                                Spell[SpellSlot.E].Delay, Spell[SpellSlot.E].Width, Spell[SpellSlot.E].Speed,
                                minion.ServerPosition, Spell[SpellSlot.E].Range, false, SkillshotType.SkillshotLine),
                            Spell[SpellSlot.E].Width, Spell[SpellSlot.E].Range);

                    if (farmLocation.MinionsHit >= minhitE)
                    {
                        dic.Add(farmLocation, minion);
                        list.Add(farmLocation);
                    }
                }

                if (list.Any())
                {
                    var farmloc = list.OrderBy(h => h.MinionsHit).FirstOrDefault();
                    var minion  = dic[farmloc];
                    Spell[SpellSlot.E].Cast(minion.ServerPosition, farmloc.Position.To3D());
                }

                dic.Clear();
                list.Clear();
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Lane Clear
        /// </summary>
        private static void LaneClear()
        {
            var minion =
                MinionManager.GetMinions(Player.Position, Q.Range, MinionTypes.All, MinionTeam.Enemy,
                                         MinionOrderTypes.MaxHealth).FirstOrDefault();
            var minionw =
                MinionManager.GetMinions(Player.Position, W.Range, MinionTypes.All, MinionTeam.Enemy,
                                         MinionOrderTypes.MaxHealth);

            if (minion == null)
            {
                return;
            }
            var useq       = Config.Item("laneMenu.useq").GetValue <bool>();
            var usew       = Config.Item("laneMenu.usew").GetValue <bool>();
            var qslider    = Config.Item("laneMenu.minminions").GetValue <Slider>().Value;
            var manaslider = Config.Item("laneMenu.manaslider").GetValue <Slider>().Value;

            if (Player.ManaPercent < manaslider)
            {
                return;
            }

            var qline = Q.GetLineFarmLocation(
                MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(Q.Range),
                                                           Q.Delay, Q.Width, Q.Speed,
                                                           Player.Position, Q.Range,
                                                           false, SkillshotType.SkillshotLine), Q.Width);

            if (Q.IsReady() && useq)
            {
                if (qline.MinionsHit >= qslider)
                {
                    Q.Cast(qline.Position);
                }
            }

            if (W.IsReady() && usew && minionw.Count() >= 2)
            {
                W.Cast();
            }
        }
Ejemplo n.º 18
0
        private void LaneClear()
        {
            MinionManager.FarmLocation farmLocation =
                R.GetLineFarmLocation(
                    MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(R.Range),
                                                               R.Delay, R.Width, R.Speed,
                                                               Player.Position, R.Range,
                                                               false, SkillshotType.SkillshotLine), R.Width);
            var target     = TargetSelector.GetTarget(1200, TargetSelector.DamageType.Physical);
            var minionforq = ObjectManager.Get <Obj_AI_Minion>().Where(minion => minion.IsEnemy && minion.Health < Q.GetDamage(minion) && minion.IsValidTarget(Q.Range)).OrderBy(minion => minion.Distance(Player.Position)).FirstOrDefault();


            if (Q.IsReady() && GetBool("laneClearQ") && manaManager() && minionforq != null)
            {
                Q.Cast(minionforq);
            }
            if (R.IsReady() && GetBool("laneClearR") && manaManager() && farmLocation.MinionsHit >= 20)
            {
                R.Cast(farmLocation.Position);
            }
        }
Ejemplo n.º 19
0
        public static MinionManager.FarmLocation?GetFarmLocation(this Spell spell, MinionTeam team = MinionTeam.Enemy, List <Obj_AI_Base> targets = null)
        {
            // Get minions if not set
            if (targets == null)
            {
                targets = MinionManager.GetMinions(spell.Range, MinionTypes.All, team, MinionOrderTypes.MaxHealth);
            }
            // Validate
            if (!spell.IsSkillshot || targets.Count == 0)
            {
                return(null);
            }
            // Predict minion positions
            var positions = MinionManager.GetMinionsPredictedPositions(targets, spell.Delay, spell.Width, spell.Speed, spell.From, spell.Range, spell.Collision, spell.Type);
            // Get best location to shoot for those positions
            var farmLocation = MinionManager.GetBestLineFarmLocation(positions, spell.Width, spell.Range);

            if (farmLocation.MinionsHit == 0)
            {
                return(null);
            }
            return(farmLocation);
        }
Ejemplo n.º 20
0
        public static void GlacialPathCast(bool minions, bool groupfocusMinions)
        {
            if (!GlacialPath.IsReady())
            {
                return;
            }

            if (minions)
            {
                if (groupfocusMinions)
                {
                    MinionManager.FarmLocation farmLocation = GlacialPath.GetLineFarmLocation(
                        MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(GlacialPath.Range),
                                                                   GlacialPath.Delay, GlacialPath.Width, GlacialPath.Speed, Program.Player.Position,
                                                                   GlacialPath.Range,
                                                                   false, SkillshotType.SkillshotLine), GlacialPath.Width);
                    if (farmLocation.MinionsHit >= 3)
                    {
                        GlacialPath.Cast(farmLocation.Position);
                    }
                }
                else
                {
                    MinionManager.FarmLocation farmLocation = GlacialPath.GetLineFarmLocation(
                        MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(GlacialPath.Range),
                                                                   GlacialPath.Delay, GlacialPath.Width, GlacialPath.Speed, Program.Player.Position,
                                                                   GlacialPath.Range,
                                                                   false, SkillshotType.SkillshotLine), GlacialPath.Width);
                    if (farmLocation.MinionsHit > 0)
                    {
                        GlacialPath.Cast(farmLocation.Position);
                    }
                }
            }
            //
        }
Ejemplo n.º 21
0
        internal static void AtoB(this Spell spell, Obj_AI_Base T, float Drag = 700f) //Coded By RL244 AtoB Drag 기본값 700f는 빅토르를 위한 것임.
        {
            if (T != null)
            {
                var TH = T as AIHeroClient;
                var TM = T as Obj_AI_Minion;
                if (TH != null)
                {
                    var             TH2      = HeroManager.Enemies.Where(x => x != TH && Func.CanHit(spell, x, Drag)).FirstOrDefault();
                    var             THdelay  = (Player.Distance(TH.ServerPosition) > spell.Range ? (Player.Distance(TH.ServerPosition) - spell.Range) / spell.Speed : 100f / spell.Speed);
                    var             pred     = Prediction.GetPrediction(TH, THdelay + spell.Delay);
                    var             TH2delay = (TH2 != null ? (Player.Distance(TH.ServerPosition) > spell.Range ? (Player.Distance(TH2.ServerPosition) - spell.Range) / spell.Speed : TH2.ServerPosition.Distance(TH.ServerPosition) / spell.Speed) : 0f);
                    var             TH2pred  = (TH2 != null ? Prediction.GetPrediction(TH2, TH2delay + spell.Delay) : null);
                    SharpDX.Vector2 castVec  = (pred.UnitPosition.To2D() + TH.ServerPosition.To2D()) / 2;
                    SharpDX.Vector2 castVec2 = Player.ServerPosition.To2D() +
                                               SharpDX.Vector2.Normalize(pred.UnitPosition.To2D() - Player.Position.To2D()) * (spell.Range);
                    SharpDX.Vector2 castVec3 = TH.ServerPosition.To2D() -
                                               SharpDX.Vector2.Normalize(pred.UnitPosition.To2D() - Player.Position.To2D()) * (100f);
                    SharpDX.Vector2 EditedVec = pred.UnitPosition.To2D() -
                                                SharpDX.Vector2.Normalize(pred.UnitPosition.To2D() - TH.ServerPosition.To2D()) * (spell.Width * 2 / 5);
                    SharpDX.Vector2 EditedCV2Vec = Player.ServerPosition.To2D() +
                                                   SharpDX.Vector2.Normalize(EditedVec - Player.Position.To2D()) * (spell.Range);

                    if (pred.Hitchance >= MenuProvider.Champion.Misc.SelectedHitchance)
                    {
                        if (TH.Distance(Player.ServerPosition) >= spell.Range)
                        {
                            if (Func.CanHit(spell, TH, Drag) && (pred.UnitPosition.Distance(TH.ServerPosition) <= spell.Width / 2 || TH.MoveSpeed * THdelay <= spell.Width / 2)) //if(Func.CanHit(spell,TH,Drag) && TH2 != null && TH2pred.Hitchance >= MenuProvider.Champion.Misc.SelectedHitchance)//별로 좋은 생각이 더 안나고 피곤해서 걍관둠.
                            {
                                spell.Cast(EditedCV2Vec, TH.ServerPosition.To2D());                                                                                              //별로 좋은 생각이 더 안나고 피곤해서 걍관둠.
                            }
                            else if (Func.CanHit(spell, TH, Drag) && pred.UnitPosition.Distance(TH.ServerPosition) < 350)
                            {
                                if (pred.UnitPosition.Distance(Player.ServerPosition) > spell.Range)
                                {
                                    spell.Cast(castVec2, EditedVec);//pred.UnitPosition.To2D());
                                }
                            }
                        }
                        else
                        {
                            if (TH2 == null || !Func.CanHit(spell, TH2, Drag))
                            {
                                if (castVec3.Distance(Player.ServerPosition) < TH.ServerPosition.Distance(Player.ServerPosition))
                                {
                                    spell.Cast(castVec3, TH.ServerPosition.To2D());
                                }
                                else
                                {
                                    spell.Cast(TH.ServerPosition.To2D(), castVec3);
                                }
                            }
                            else if (TH2 != null && Func.CanHit(spell, TH2, Drag) && TH2pred.Hitchance >= MenuProvider.Champion.Misc.SelectedHitchance)
                            {
                                SharpDX.Vector2 castVec4 = TH.ServerPosition.To2D() -
                                                           SharpDX.Vector2.Normalize(TH2pred.UnitPosition.To2D() - TH.ServerPosition.To2D()) * (80f);
                                if (castVec4.Distance(Player.ServerPosition) < TH2pred.UnitPosition.Distance(Player.ServerPosition))
                                {
                                    spell.Cast(castVec4, TH2pred.UnitPosition.To2D());
                                }
                                else
                                {
                                    spell.Cast(TH2pred.UnitPosition.To2D(), castVec4);
                                }
                            }
                        }
                    }
                }
                if (TM != null)
                {
                    var Minions = ObjectManager.Get <Obj_AI_Minion>().Where(m => m.IsValidTarget(spell.Range + Drag) && m.Team != ObjectManager.Player.Team).Cast <Obj_AI_Base>().ToList();
                    if (Minions.Count > 0)
                    { //으....
                        //MinionManager.GetMinions(spell.Range+Drag, MinionTypes.All, MinionTeam.NotAlly);
                        var FM  = Minions.OrderBy(o => o.Distance(Player.ServerPosition)).FirstOrDefault().ServerPosition;
                        var FFM = Minions.OrderBy(o => o.Distance(Player.ServerPosition)).Reverse().FirstOrDefault().ServerPosition;
                        var P   = MinionManager.GetMinionsPredictedPositions(Minions, spell.Delay, spell.Width, spell.Speed, FM, Drag, true, SkillshotType.SkillshotLine);
                        var PP  = MinionManager.GetBestLineFarmLocation(P, spell.Width, spell.Range + Drag);
                        if (FM != null && FM.Distance(Player.ServerPosition) <= spell.Range) // && PP.MinionsHit >= Math.Min(Minions.Count,6))
                                                                                             //spell.Cast(FM.To2D(),PP.Position);
                        {
                            spell.Cast(FM.To2D(), FFM.To2D());
                        }
                    }
                }
            }
            if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear)
            {
                var Minions = ObjectManager.Get <Obj_AI_Minion>().Where(m => m.IsValidTarget(spell.Range + Drag) && m.Team != ObjectManager.Player.Team).Cast <Obj_AI_Base>().ToList();
                if (Minions.Count > 0)
                {
                    //MinionManager.GetMinions(spell.Range+Drag, MinionTypes.All, MinionTeam.NotAlly);
                    var FM  = Minions.OrderBy(o => o.Distance(Player.ServerPosition)).FirstOrDefault().ServerPosition;
                    var FFM = Minions.OrderBy(o => o.Distance(Player.ServerPosition)).Reverse().FirstOrDefault().ServerPosition;
                    var P   = MinionManager.GetMinionsPredictedPositions(Minions, spell.Delay, spell.Width, spell.Speed, FM, Drag, true, SkillshotType.SkillshotLine);
                    var PP  = MinionManager.GetBestLineFarmLocation(P, spell.Width, spell.Range + Drag);
                    if (FM != null && FM.Distance(Player.ServerPosition) <= spell.Range)// && PP.MinionsHit >= Math.Min(Minions.Count,6))
                    //spell.Cast(FM.To2D(),PP.Position);
                    {
                        spell.Cast(FM.To2D(), FFM.To2D());
                    }
                }
            }
        }
Ejemplo n.º 22
0
        public static void LaneClear()
        {
            if (Z.Item("misc.manamenagertm").GetValue <bool>() &&
                Z.Item("misc.manamenagertm.slider").GetValue <Slider>().Value > Player.ManaPercent)
            {
                return;
            }

            var minionCount = MinionManager.GetMinions(Player.Position, Q.Range, MinionTypes.All, MinionTeam.NotAlly);

            var jungleMinion = ObjectManager.Get <Obj_AI_Minion>().Where(x => x.Team == GameObjectTeam.Neutral &&
                                                                         !x.IsDead
                                                                         &&
                                                                         x.Distance(ObjectManager.Player.Position) <=
                                                                         Q.Range)
                               .OrderBy(x => x.MaxHealth)
                               .FirstOrDefault();

            if (jungleMinion != null)
            {
                return;
            }

            MinionManager.FarmLocation QFarmLocation =
                Q.GetCircularFarmLocation(
                    MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(Q.Range),
                                                               Q.Delay, Q.Width, Q.Speed,
                                                               Player.Position, Q.Range,
                                                               false, SkillshotType.SkillshotCircle), Q.Width);

            MinionManager.FarmLocation WFarmLocation =
                W.GetCircularFarmLocation
                    (MinionManager.GetMinionsPredictedPositions(MinionManager.GetMinions(W.Range),
                                                                W.Delay, W.Width, W.Speed,
                                                                Player.Position, W.Range,
                                                                false, SkillshotType.SkillshotCircle), W.Width);

            foreach (var minion in minionCount)
            {
                if (minion == null)
                {
                    return;
                }

                if (Z.Item("laneclear.q").GetValue <bool>() &&
                    Q.IsReady() &&
                    Player.Mana >= Q.Instance.ManaCost + 2 * E.Instance.ManaCost)
                {
                    Q.Cast(QFarmLocation.Position);
                }

                var whit =
                    ObjectManager.Get <Obj_AI_Minion>()
                    .Where(x => x.Distance(WFarmLocation.Position) <= W.Width && !x.IsDead && x.IsEnemy);
                if (Z.Item("laneclear.w").GetValue <bool>() && W.IsReady() &&
                    whit.Count() >= Z.Item("laneclear.w.restriction").GetValue <Slider>().Value)
                {
                    W.Cast(WFarmLocation.Position);
                }

                var emin =
                    ObjectManager.Get <Obj_AI_Minion>()
                    .Where(x => !x.IsDead && x.IsEnemy && E.IsInRange(x))
                    .OrderBy(x => x.Health)
                    .FirstOrDefault();

                if (Z.Item("laneclear.e").GetValue <bool>() && E.IsReady())
                {
                    if ((emin.HasBuffOfType(BuffType.Poison) &&
                         !Z.Item("laneclear.e.lasthit").GetValue <bool>())

                        || (!emin.HasBuffOfType(BuffType.Poison) &&
                            !Z.Item("laneclear.e.restriction").GetValue <bool>())

                        || (emin.HasBuffOfType(BuffType.Poison) &&
                            Z.Item("laneclear.e.lasthit").GetValue <bool>() &&
                            emin.Health <= E.GetDamage(emin)))
                    {
                        E.CastOnUnit(emin);
                    }
                }
            }
        }