Exemple #1
0
        private static double GetEDamage(AIBaseClient target)
        {
            if (HitECount(target) == 0)
            {
                return(0);
            }
            var eDMG = GetEDMG(target, HitECount(target));

            return(MyExtraManager.GetRealDamage(eDMG, target));
        }
Exemple #2
0
        private static void OnUpdate()
        {
            if (ObjectManager.GetLocalPlayer().IsDead)
            {
                return;
            }

            if (ObjectManager.GetLocalPlayer().HasBuffOfType(BuffType.SpellImmunity) ||
                ObjectManager.GetLocalPlayer().HasBuffOfType(BuffType.SpellShield))
            {
                return;
            }

            if (!MyLogic.W.IsReady(300) && (Wall == null || !MyLogic.E.IsReady(200)))
            {
                return;
            }

            foreach (var target in DetectedTargets.Where(i => ObjectManager.GetLocalPlayer().Distance(i.Obj.Position) < 700))
            {
                if (MyLogic.E.Ready && Menu["Brian.EvadeTargetMenu.EvadeTargetE"].Enabled && Wall != null &&
                    Game.TickCount - MyLogic.lastWTime > 1000 &&
                    !GoThroughWall(ObjectManager.GetLocalPlayer().ServerPosition.To2D(), target.Obj.Position.To2D()) &&
                    MyLogic.W.IsInRange(target.Obj, 250))
                {
                    var obj = new List <Obj_AI_Base>();

                    obj.AddRange(
                        GameObjects.EnemyMinions.Where(
                            x => x.IsValidTarget(MyLogic.E.Range) && (x.IsMinion() || x.IsMob())));
                    obj.AddRange(GameObjects.EnemyHeroes.Where(i => i.IsValidTarget(MyLogic.E.Range)));

                    if (
                        obj.Where(
                            i =>
                            MyExtraManager.CanCastE(i) &&
                            i.ServerPosition.IsSafePosition() &&
                            MyExtraManager.PosAfterE(i).IsSafePosition() &&
                            (!MyExtraManager.UnderTower(MyExtraManager.PosAfterE(i)) ||
                             Menu["Brian.EvadeTargetMenu.EvadeTargetETower"].Enabled) &&
                            GoThroughWall(ObjectManager.GetLocalPlayer().ServerPosition.To2D(), MyExtraManager.PosAfterE(i).To2D()))
                        .OrderBy(i => MyExtraManager.PosAfterE(i).Distance(Game.CursorPos))
                        .Any(i => MyLogic.E.CastOnUnit(i)))
                    {
                        return;
                    }
                }

                if (MyLogic.W.Ready && Menu["Brian.EvadeTargetMenu.EvadeTargetW"].Enabled && MyLogic.W.IsInRange(target.Obj, 500) &&
                    MyLogic.W.Cast(ObjectManager.GetLocalPlayer().ServerPosition.Extend(target.Start, 100)))
                {
                    return;
                }
            }
        }
Exemple #3
0
        //private static void OnGapcloser(AIHeroClient target, GapcloserArgs Args)
        //{
        //    if (target != null && target.IsValidTarget(E.Range))
        //    {
        //        switch (Args.Type)
        //        {
        //            case SpellType.Melee:
        //                {
        //                    if (target.IsValidTarget(target.AttackRange + target.BoundingRadius + 100) &&
        //                        MiscOption.GetBool("Q", "QMelee").Enabled && Q.IsReady())
        //                    {
        //                        Q.Cast(Me.PreviousPosition.Extend(target.PreviousPosition, -Q.Range));
        //                    }
        //                }
        //                break;
        //            case SpellType.SkillShot:
        //                {
        //                    if (MiscOption.GetBool("E", "AntiGapcloserE").Enabled && E.IsReady() && target.IsValidTarget(250) && !Args.HaveShield)
        //                    {
        //                        E.CastOnUnit(target);
        //                    }
        //                }
        //                break;
        //            case SpellType.Dash:
        //            case SpellType.Targeted:
        //                {
        //                    if (MiscOption.GetBool("E", "AntiGapcloserE").Enabled && E.IsReady() && target.IsValidTarget(E.Range) && !Args.HaveShield)
        //                    {
        //                        E.CastOnUnit(target);
        //                    }
        //                }
        //                break;
        //        }
        //    }
        //}

        private static Vector3 GetDashQPos()
        {
            var firstQPos = Me.PreviousPosition.Extend(Game.CursorPosRaw, Q.Range);
            var allPoint  = MyExtraManager.GetCirclePoints(Q.Range).ToList();

            foreach (var point in allPoint)
            {
                var mousecount = firstQPos.CountEnemyHeroesInRange(300);
                var count      = point.CountEnemyHeroesInRange(300);

                if (!HaveEnemiesInRange(point))
                {
                    continue;
                }

                if (mousecount == count)
                {
                    if (point.DistanceToCursor() < firstQPos.DistanceToCursor())
                    {
                        firstQPos = point;
                    }
                }

                if (count < mousecount)
                {
                    firstQPos = point;
                }
            }

            if (MiscOption.GetList("Q", "QTurret").Index == 0 || MiscOption.GetList("Q", "QTurret").Index == 2)
            {
                if (firstQPos.IsUnderEnemyTurret())
                {
                    return(Vector3.Zero);
                }
            }

            if (MiscOption.GetBool("Q", "QCheck").Enabled)
            {
                if (Me.CountEnemyHeroesInRange(Q.Range + Me.BoundingRadius - 30) <
                    firstQPos.CountEnemyHeroesInRange(Q.Range * 2 - Me.BoundingRadius))
                {
                    return(Vector3.Zero);
                }

                if (firstQPos.CountEnemyHeroesInRange(Q.Range * 2 - Me.BoundingRadius) > 3)
                {
                    return(Vector3.Zero);
                }
            }

            return(HaveEnemiesInRange(firstQPos) ? firstQPos : Vector3.Zero);
        }
Exemple #4
0
        private static void TryToEvade(List <Skillshot> HitBy, Vector2 Pos)
        {
            var dangerLevel = 0;

            foreach (var skillshot in HitBy)
            {
                dangerLevel = Math.Max(dangerLevel, skillshot.GetSlider("DangerLevel"));
            }

            foreach (var evadeSpell in EvadeSpellDatabase.Spells)
            {
                if (evadeSpell.Enabled && evadeSpell.DangerLevel <= dangerLevel && evadeSpell.IsReady())
                {
                    if (evadeSpell.Slot == SpellSlot.E)
                    {
                        var dodgeList =
                            GetEvadeTargets(evadeSpell)
                            .Where(
                                x =>
                                IsSafe(MyExtraManager.PosAfterE(x).To2D()).IsSafe&&
                                (!MyExtraManager.UnderTower(MyExtraManager.PosAfterE(x)) ||
                                 EvadeSpellMenu["ETower"].Enabled)).ToArray();

                        if (dodgeList.Any())
                        {
                            var dodgeTarget =
                                dodgeList.Where(x => !x.HasBuff("YasuoDashWrapper"))
                                .MinOrDefault(i => MyExtraManager.PosAfterE(i).Distance(Pos.To3D()));

                            if (dodgeTarget != null && dodgeTarget.DistanceToPlayer() <= MyLogic.E.Range &&
                                MyExtraManager.CanCastE(dodgeTarget))
                            {
                                MyLogic.E.CastOnUnit(dodgeTarget);
                            }
                        }
                    }

                    if (evadeSpell.Slot == SpellSlot.W)
                    {
                        var skillShotList =
                            HitBy.Where(
                                x => x.SpellData.CollisionObjects.Contains(CollisionObjectTypes.YasuoWall)).ToArray();

                        if (skillShotList.Any())
                        {
                            var willHitList =
                                skillShotList.Where(
                                    x =>
                                    x.IsAboutToHit(
                                        150 + evadeSpell.Delay,
                                        ObjectManager.GetLocalPlayer())).ToArray();

                            if (willHitList.Any())
                            {
                                if (
                                    willHitList.OrderByDescending(
                                        x => dangerLevel)
                                    .Any(
                                        x =>
                                        MyLogic.W.Cast(
                                            ObjectManager.GetLocalPlayer().ServerPosition.Extend(x.Start.To3D(),
                                                                                                 300))))
                                {
                                    return;
                                }
                            }
                        }
                    }
                }
            }
        }