Beispiel #1
0
        Obj_AI_Base GetAllyAsWard()
        {
            List <Obj_AI_Base> allyJumps = new List <Obj_AI_Base>();

            if (!SelectionHandler.LastTargetValid || !SelectionHandler.LastAllyPosValid)
            {
                return(null);
            }

            #region setVars
            var target  = SelectionHandler.GetTarget;
            var allyPos = SelectionHandler.GetAllyPos;

            var wardPlacePos = WardJumpPosition.GetWardJumpPosition(allyPos);
            #endregion setVars

            foreach (var allyobj in ObjectManager.Get <Obj_AI_Base>().Where(x =>
                                                                            x.IsValid && x.IsAlly && !x.IsMe && (x is AIHeroClient || x is Obj_AI_Minion)))
            {
                if (allyobj.Distance(wardPlacePos) <= 80)
                {
                    allyJumps.Add(allyobj);
                }
            }

            Obj_AI_Base obj = allyJumps.Any() ? allyJumps.OrderBy(x => x.Distance(wardPlacePos)).First() : null;
            return(obj);
        }
Beispiel #2
0
        private void DrawingOnOnDraw(EventArgs args)
        {
            if (SelectionHandler.LastAllyPosValid)
            {
                new Circle(new ColorBGRA(new Vector4(255, 255, 255, 1)), 100, 2).Draw(SelectionHandler.GetAllyPos.To3D());
            }

            if (!SelectionHandler.LastTargetValid || !SelectionHandler.LastAllyPosValid)
            {
                if (LeeSinMenu.insecMenu["_insecKey"].Cast <KeyBind>().CurrentValue)
                {
                    DrawFailInfo();
                }
                return;
            }

            bool couldInsec = SelectionHandler.LastTargetValid && SelectionHandler.LastAllyPosValid && HasResourcesToInsec();

            if (couldInsec)
            {
                var startpos = SelectionHandler.GetTarget.Position.To2D();
                var endpos   = SelectionHandler.GetAllyPos;

                Vector2[] arrows =
                {
                    endpos + (startpos - endpos).Normalized().Rotated(45 * (float)Math.PI / 180) *
                    TargetSelector.SelectedTarget.BoundingRadius,
                    endpos + (startpos - endpos).Normalized().Rotated(-45 * (float)Math.PI / 180) *
                    TargetSelector.SelectedTarget.BoundingRadius
                };
                var white = Color.FromArgb(255, 255, 255, 255);

                Drawing.DrawLine(startpos.To3D().WorldToScreen(), endpos.To3D().WorldToScreen(), 5, white);
                Drawing.DrawLine(endpos.To3D().WorldToScreen(), arrows[0].To3D().WorldToScreen(), 5, white);
                Drawing.DrawLine(endpos.To3D().WorldToScreen(), arrows[1].To3D().WorldToScreen(), 5, white);
            }
            else if (LeeSinMenu.insecMenu["_insecKey"].Cast <KeyBind>().CurrentValue)
            {
                DrawFailInfo();
            }

            bool dashDebug = LeeSinMenu.insecMenu["dashDebug"].Cast <KeyBind>().CurrentValue;

            if (dashDebug && SelectionHandler.LastAllyPosValid)
            {
                new Circle(new ColorBGRA(new Vector4(0, 0, 1, 1)), 70, 4).Draw(
                    WardJumpPosition.GetWardJumpPosition(SelectionHandler.GetAllyPos).To3D());
            }
        }
Beispiel #3
0
        private void CheckInsec()
        {
            if (!me.Spellbook.GetSpell(SpellSlot.Q).Name.Contains("One"))
            {
                SpellManager.Q2.Cast();
            }

            #region setVars
            var target = TargetSelector.SelectedTarget;


            var canFlash    = SpellManager.FlashReady;
            var canWardJump = SpellManager.CanCastW1 && me.Mana >= minEnegeryFirstActivation &&
                              WardManager.CanCastWard;
            var  canQ         = SpellManager.CanCastQ1 && me.Mana >= minEnergy;
            var  wardPlacePos = WardJumpPosition.GetWardJumpPosition(SelectionHandler.GetAllyPos);
            bool dontUseFlash = LeeSinMenu.insecExtensionsMenu["dontFlash"].Cast <CheckBox>().CurrentValue;
            #endregion setVars

            /*normal q cast on enemy*/
            var qPred = SpellManager.Q1.GetPrediction(target);
            if (qPred.HitChance >= HitChance.High && canQ)
            {
                SpellManager.Q1.Cast(qPred.CastPosition);
            }


            bool useFlashCorrection = LeeSinMenu.insecExtensionsMenu["useFlashCorrection"].Cast <CheckBox>().CurrentValue;
            int  correctionDist     = LeeSinMenu.insecExtensionsMenu["flashCorrectionDistance"].Cast <Slider>().CurrentValue;
            if (decidedWardKick && Player.Instance.Distance(LastWardJumpInsecPosition) <= 100 && Player.Instance.Distance(wardPlacePos) > correctionDist &&
                useFlashCorrection)
            {
                decidedWardKick = false;
            }


            /*try insec if possible*/
            if (CanMoonSec(target))
            {
                return;
            }
            if (moonSecActive)
            {
                return;
            }

            if (CanWardKick(wardPlacePos, target))
            {
                return;
            }
            if (CanFlashKick(wardPlacePos, target))
            {
                return;
            }
            if (CanWardFlashKick(wardPlacePos))
            {
                return;
            }


            if (canQ)
            {
                #region searchMinion

                var minList = new List <Obj_AI_Minion>();
                foreach (
                    var minion in
                    EntityManager.MinionsAndMonsters.Combined.Where(
                        x => !x.IsAlly && SpellManager.Q1.GetPrediction(x).CollisionObjects.Length == 0))
                {
                    var qflyTime = me.Distance(minion) / SpellManager.Q1.Speed * 1000 + SpellManager.Q1.CastDelay * 2 +
                                   100;
                    var alive = Prediction.Health.GetPrediction(minion, (int)Math.Ceiling(qflyTime)) >
                                me.GetSpellDamage(minion, SpellSlot.Q) * 2;
                    if (alive && minion.Distance(me) <= SpellManager.Q1.Range)
                    {
                        minList.Add(minion);
                    }
                }

                #endregion

                var targetMinion = minList.OrderBy(x => x.Distance(target)).FirstOrDefault();
                if (targetMinion != null && targetMinion.IsValid)
                {
                    if (targetMinion.Distance(wardPlacePos) <= WardManager.WardRange && canWardJump)
                    {
                        SpellManager.Q1.Cast(targetMinion.Position);
                    }

                    if (targetMinion.Distance(wardPlacePos) <= SpellManager.Flash.Range && canFlash && !dontUseFlash)
                    {
                        SpellManager.Q1.Cast(targetMinion.Position);
                    }
                    /*q minion + wardjump + flash*/
                    if (targetMinion.Distance(wardPlacePos) > SpellManager.Flash.Range &&
                        targetMinion.Distance(wardPlacePos) > WardManager.WardRange && canWardJump && canFlash && !dontUseFlash &&
                        targetMinion.Distance(wardPlacePos) <= SpellManager.Flash.Range + WardManager.WardRange)
                    {
                        SpellManager.Q1.Cast(targetMinion.Position);
                    }
                }
            }
        }