Exemple #1
0
 public static void DrawRect()
 {
     if (GetBool("activatebubba", typeof(KeyBind)))
     {
         var getresults = BubbaKush.GetPositions(Player, 600, (byte)GetValue("enemiescount"),
                                                 HeroManager.Enemies.Where(x => x.Distance(Player) < 1200).ToList());
         if (getresults.Count > 1)
         {
             var ward        = Items.GetWardSlot();
             var getposition = BubbaKush.SelectBest(getresults, Player);
             Render.Circle.DrawCircle(getposition, 100, Color.Red, 3, true);
             var heros =
                 HeroManager.Enemies.Where(x => x.Distance(Player) < 400).OrderBy(x => x.Distance(Player));
             if (LeeSin.HasFlash() && R.IsReady())
             {
                 if (Player.Distance(getposition) < 400 && Player.Distance(getposition) < R.Range &&
                     heros.FirstOrDefault() != null)
                 {
                     R.Cast(heros.FirstOrDefault());
                     Lastthingy = Environment.TickCount;
                 }
             }
             if (Player.Distance(getposition) < 30 && heros.FirstOrDefault() != null && R.IsReady())
             {
                 R.Cast(heros.FirstOrDefault());
             }
         }
     }
 }
        public static void GetPosition()
        {
            var heros = HeroManager.Enemies.FirstOrDefault(x => x.IsValidTarget(1100));
            {
                if (heros != null)
                {
                    OnLoad.PredictionRnormal.From = LeeSin.R.GetPrediction(heros).UnitPosition;
                    foreach (
                        var x in
                        HeroManager.Enemies.Where(
                            y => y.NetworkId != heros.NetworkId && y.IsValidTarget(LeeSin.R.Range)))
                    {
                        OnLoad.PredictionRnormal.Unit = x;
                        var poutput2 = SebbyLib.Prediction.Prediction.GetPrediction(OnLoad.PredictionRnormal);
                        var castPos  = poutput2.CastPosition;
                        var ext      = castPos.Extend(OnLoad.PredictionRnormal.From,
                                                      castPos.Distance(OnLoad.PredictionRnormal.From) + 200);

                        Render.Circle.DrawCircle(ext, 100, Color.Aqua);
                        if (Helper.Player.Distance(ext) < LeeSin.R.Range && LeeSin.HasFlash())
                        {
                            //WardManager.WardJump.WardJumped(ext, true);
                            if (LeeSin.R.Cast(x) == Spell.CastStates.SuccessfullyCasted)
                            {
                                LeeSin.LastBubba = Environment.TickCount;
                            }
                            if (Environment.TickCount - LeeSin.LastBubba < 1000)
                            {
                                Helper.Player.Spellbook.CastSpell(Helper.Player.GetSpellSlot("SummonerFlash"), ext);
                            }
                        }
                    }
                }
            }
        }
Exemple #3
0
        public static void WardJump(
            Vector3 pos,
            bool m2M = true,
            bool maxRange = false,
            bool reqinMaxRange = false,
            bool minions = true,
            bool champions = true)
        {
            if (Misc.WStage != WCastStage.First)
            {
                return;
            }

            var basePos = ObjectManager.Player.Position.To2D();
            var newPos = pos.To2D() - ObjectManager.Player.Position.To2D();

            if (JumpPos == new Vector2())
            {
                if (reqinMaxRange)
                {
                    JumpPos = pos.To2D();
                }
                else if (maxRange || (ObjectManager.Player.Distance(pos) > 590))
                {
                    JumpPos = basePos + newPos.Normalized() * 590;
                }
                else
                {
                    JumpPos = basePos + newPos.Normalized() * ObjectManager.Player.Distance(pos);
                }
            }
            if ((JumpPos != new Vector2()) && reCheckWard)
            {
                reCheckWard = false;
                LeagueSharp.Common.Utility.DelayAction.Add(
                    20,
                    () =>
                        {
                            if (JumpPos != new Vector2())
                            {
                                JumpPos = new Vector2();
                                reCheckWard = true;
                            }
                        });
            }
            if (m2M)
            {
                Misc.Orbwalk(pos);
            }
            if (!LeeSin.spells[LeeSin.Spells.W].IsReady() || (Misc.WStage != WCastStage.First)
                || (reqinMaxRange && (ObjectManager.Player.Distance(pos) >LeeSin.spells[LeeSin.Spells.W].Range)))
            {
                return;
            }

            if (minions || champions)
            {
                if (champions)
                {
                    var wardJumpableChampion =
                        ObjectManager.Get<AIHeroClient>()
                            .Where(
                                x =>
                                    x.IsAlly && (x.Distance(ObjectManager.Player) < LeeSin.spells[LeeSin.Spells.W].Range)
                                    && (x.Distance(pos) < 200) && !x.IsMe)
                            .OrderByDescending(i => i.Distance(ObjectManager.Player))
                            .ToList()
                            .FirstOrDefault();

                    if ((wardJumpableChampion != null) && (Misc.WStage == WCastStage.First))
                    {
                        if ((500 >= Utils.TickCount - Wcasttime) || (Misc.WStage != WCastStage.First))
                        {
                            return;
                        }

                        LeeSin.CastW(wardJumpableChampion);
                        return;
                    }
                }
                if (minions)
                {
                    var wardJumpableMinion =
                        ObjectManager.Get<Obj_AI_Minion>()
                            .Where(
                                m =>
                                    m.IsAlly && (m.Distance(ObjectManager.Player) < LeeSin.spells[LeeSin.Spells.W].Range)
                                    && (m.Distance(pos) < 200) && !m.Name.ToLower().Contains("ward"))
                            .OrderByDescending(i => i.Distance(ObjectManager.Player))
                            .ToList()
                            .FirstOrDefault();

                    if ((wardJumpableMinion != null) && (Misc.WStage == WCastStage.First))
                    {
                        if ((500 >= Utils.TickCount - Wcasttime) || (Misc.WStage != WCastStage.First))
                        {
                            return;
                        }

                        LeeSin.CastW(wardJumpableMinion);
                        return;
                    }
                }
            }

            var isWard = false;

            var wardObject =
                ObjectManager.Get<Obj_AI_Base>()
                    .Where(o => o.IsAlly && o.Name.ToLower().Contains("ward") && (o.Distance(JumpPos) < 200))
                    .ToList()
                    .FirstOrDefault();

            if (wardObject != null)
            {
                isWard = true;
                if ((500 >= Utils.TickCount - Wcasttime) || (Misc.WStage != WCastStage.First))
                {
                    return;
                }

                LeeSin.CastW(wardObject);
            }

            if (!isWard && castWardAgain)
            {
                var ward = FindBestWardItem();
                if (ward == null)
                {
                    return;
                }

                if (LeeSin.spells[LeeSin.Spells.W].IsReady() && Misc.IsWOne && (LastWard + 400 < Utils.TickCount))
                {
                    ObjectManager.Player.Spellbook.CastSpell(ward.SpellSlot, JumpPos.To3D());
                    lastWardPos = JumpPos.To3D();
                    LastWard = Utils.TickCount;
                }
            }
        }
Exemple #4
0
        private static void GameEvents_GameStart()
        {
            if (Valid.All(x => Global.Player.ChampionName != x))
            {
                return;
            }

            SummonerSpells.Init();
            GameObjects.Init();
            Global.Init();
            GetRandom.Init();

            switch (Global.Player.ChampionName)
            {
            case "Ezreal":
                Ezreal.Init();
                break;

            case "Azir":
                Azir.Init();
                break;

            case "Irelia":
                Irelia.Init();
                break;

            case "Jax":
                Jax.Init();
                break;

            case "Jinx":
                var jinx = new Jinx();
                jinx.Init();
                break;

            case "Kayn":
                Kayn.Init();
                break;

            case "LeeSin":
                var lee = new LeeSin();
                lee.Init();
                break;

            case "Rengar":
                Rengar.Init();
                break;

            case "Riven":
                Riven.Init();
                break;

            case "Tristana":
                var tristana = new Tristana();
                tristana.Init();
                break;

            case "Yasuo":
                Yasuo.Init();
                break;

            case "Zed":
                Zed.Init();
                break;
            }
        }
Exemple #5
0
        public static void InsecCombo(AIHeroClient target)
        {
            if (target == null)
            {
                return;
            }

            if (ObjectManager.Player.Distance(GetInsecPos(target)) < 200)
            {
                insecComboStep = InsecComboStepSelect.Pressr;
            }
            else if ((insecComboStep == InsecComboStepSelect.None) &&
                     (GetInsecPos(target).Distance(ObjectManager.Player.Position) < 600))
            {
                insecComboStep = InsecComboStepSelect.Wgapclose;
            }
            else if ((insecComboStep == InsecComboStepSelect.None) &&
                     (target.Distance(ObjectManager.Player) < LeeSin.spells[LeeSin.Spells.Q].Range))
            {
                insecComboStep = InsecComboStepSelect.Qgapclose;
            }

            switch (insecComboStep)
            {
            case InsecComboStepSelect.Qgapclose:
                if (Misc.IsQOne)
                {
                    var pred1 = LeeSin.spells[LeeSin.Spells.Q].GetPrediction(target);
                    if (pred1.Hitchance >= HitChance.High)
                    {
                        LeeSin.CastQ(target, Misc.GetMenuItem("ElLeeSin.Smite.Q"));
                    }

                    if (!Misc.GetMenuItem("checkOthers2"))
                    {
                        return;
                    }

                    var insectObjects =
                        HeroManager.Enemies.Where(
                            x =>
                            x.IsValidTarget(LeeSin.spells[LeeSin.Spells.Q].Range) && !x.Compare(target) &&
                            (LeeSin.spells[LeeSin.Spells.Q].GetHealthPrediction(x)
                             > LeeSin.spells[LeeSin.Spells.Q].GetDamage(x)) &&
                            (x.Distance(target) < target.DistanceToPlayer()) && (x.Distance(target) < 750))
                        .Concat(
                            MinionManager.GetMinions(
                                ObjectManager.Player.ServerPosition,
                                LeeSin.spells[LeeSin.Spells.Q].Range,
                                MinionTypes.All,
                                MinionTeam.NotAlly))
                        .Where(
                            m =>
                            m.IsValidTarget(LeeSin.spells[LeeSin.Spells.Q].Range) &&
                            LeeSin.spells[LeeSin.Spells.Q].GetHealthPrediction(m)
                            > LeeSin.spells[LeeSin.Spells.Q].GetDamage(m) && m.Distance(target) < 400f)
                        .OrderBy(i => i.Distance(target))
                        .FirstOrDefault();

                    if (insectObjects == null)
                    {
                        return;
                    }

                    LeeSin.spells[LeeSin.Spells.Q].Cast(insectObjects);
                }

                if (!target.HasQBuff() && Misc.IsQOne)
                {
                    LeeSin.CastQ(target, Misc.GetMenuItem("ElLeeSin.Smite.Q"));
                }
                else if (target.HasQBuff())
                {
                    LeeSin.spells[LeeSin.Spells.Q].Cast();
                    insecComboStep = InsecComboStepSelect.Wgapclose;
                }
                else
                {
                    if (LeeSin.spells[LeeSin.Spells.Q].Instance.Name.Equals(
                            "blindmonkqtwo",
                            StringComparison.InvariantCultureIgnoreCase) &&
                        (Misc.ReturnQBuff()?.Distance(target) <= 600))
                    {
                        LeeSin.spells[LeeSin.Spells.Q].Cast();
                    }
                }
                break;

            case InsecComboStepSelect.Wgapclose:

                if (ObjectManager.Player.Distance(target) < WardRange)
                {
                    Wardmanager.WardJump(GetInsecPos(target), false, true, true);

                    if ((Wardmanager.FindBestWardItem() == null) && LeeSin.spells[LeeSin.Spells.R].IsReady() &&
                        Misc.GetMenuItem("ElLeeSin.Flash.Insec") &&
                        (ObjectManager.Player.Spellbook.CanUseSpell(LeeSin.flashSlot) == SpellState.Ready))
                    {
                        if (((GetInsecPos(target).Distance(ObjectManager.Player.Position) < FlashRange) &&
                             (Wardmanager.LastWard + 1000 < Environment.TickCount)) || !LeeSin.spells[LeeSin.Spells.W].IsReady())
                        {
                            ObjectManager.Player.Spellbook.CastSpell(LeeSin.flashSlot, GetInsecPos(target));
                        }
                    }
                }
                else if (ObjectManager.Player.Distance(target) < Misc.WardFlashRange)
                {
                    Wardmanager.WardJump(target.Position);

                    if (LeeSin.spells[LeeSin.Spells.R].IsReady() && Misc.GetMenuItem("ElLeeSin.Flash.Insec") &&
                        (ObjectManager.Player.Spellbook.CanUseSpell(LeeSin.flashSlot) == SpellState.Ready))
                    {
                        if (ObjectManager.Player.Distance(target) < FlashRange - 25)
                        {
                            if ((Wardmanager.FindBestWardItem() == null) || (Wardmanager.LastWard + 1000 < Environment.TickCount))
                            {
                                ObjectManager.Player.Spellbook.CastSpell(LeeSin.flashSlot, GetInsecPos(target));
                            }
                        }
                    }
                }
                break;

            case InsecComboStepSelect.Pressr:
                LeeSin.spells[LeeSin.Spells.R].CastOnUnit(target);
                break;
            }
        }