예제 #1
0
        private bool IsCondemnable(EloBuddy.AIHeroClient hero)
        {
            if (!hero.LSIsValidTarget(550f) || hero.HasBuffOfType(EloBuddy.BuffType.SpellShield) ||
                hero.HasBuffOfType(EloBuddy.BuffType.SpellImmunity) || hero.IsDashing()) return false;

            //values for pred calc pP = player position; p = enemy position; pD = push distance
            var pP = EloBuddy.ObjectManager.Player.ServerPosition;
            var p = hero.ServerPosition;
            var pD = EPushDistanceSlider;
            var mode = EModeStringList;

            if (mode == 1 && (IsCollisionable(p.LSExtend(pP, -pD)) || IsCollisionable(p.LSExtend(pP, -pD / 2f)) ||
                                         IsCollisionable(p.LSExtend(pP, -pD / 3f))))
            {
                if (!hero.CanMove)
                    return true;

                var enemiesCount = EloBuddy.ObjectManager.Player.CountEnemyHeroesInRange(1200);
                if (enemiesCount > 1 && enemiesCount <= 3)
                {
                    var prediction = E.GetPrediction(hero);
                    for (var i = 15; i < pD; i += 75)
                    {
                        if (i > pD)
                        {
                            var lastPosFlags = EloBuddy.NavMesh.GetCollisionFlags(
                            prediction.UnitPosition.ToVector2()
                                .Extend(
                                    pP.ToVector2(),
                                    -pD)
                                .ToVector3());
                            if (lastPosFlags.HasFlag(EloBuddy.CollisionFlags.Wall) || lastPosFlags.HasFlag(EloBuddy.CollisionFlags.Building))
                            {
                                return true;
                            }
                            return false;
                        }
                        var posFlags = EloBuddy.NavMesh.GetCollisionFlags(
                            prediction.UnitPosition.ToVector2()
                                .Extend(
                                    pP.ToVector2(),
                                    -i)
                                .ToVector3());
                        if (posFlags.HasFlag(EloBuddy.CollisionFlags.Wall) || posFlags.HasFlag(EloBuddy.CollisionFlags.Building))
                        {
                            return true;
                        }
                    }
                    return false;
                }
                else
                {
                    var hitchance = EHitchanceSlider;
                    var angle = 0.20 * hitchance;
                    const float travelDistance = 0.5f;
                    var alpha = new Vector2((float)(p.X + travelDistance * Math.Cos(Math.PI / 180 * angle)),
                        (float)(p.X + travelDistance * Math.Sin(Math.PI / 180 * angle)));
                    var beta = new Vector2((float)(p.X - travelDistance * Math.Cos(Math.PI / 180 * angle)),
                        (float)(p.X - travelDistance * Math.Sin(Math.PI / 180 * angle)));

                    for (var i = 15; i < pD; i += 100)
                    {
                        if (i > pD) return false;
                        if (IsCollisionable(pP.ToVector2().Extend(alpha,
                            i)
                            .ToVector3()) && IsCollisionable(pP.ToVector2().Extend(beta, i).ToVector3())) return true;
                    }
                    return false;
                }
            }

            if (mode == 2 &&
                (IsCollisionable(p.LSExtend(pP, -pD)) || IsCollisionable(p.LSExtend(pP, -pD / 2f)) ||
                 IsCollisionable(p.LSExtend(pP, -pD / 3f))))
            {
                if (!hero.CanMove ||
                    (hero.Spellbook.IsAutoAttacking))
                    return true;

                var hitchance = EHitchanceSlider;
                var angle = 0.20 * hitchance;
                const float travelDistance = 0.5f;
                var alpha = new Vector2((float)(p.X + travelDistance * Math.Cos(Math.PI / 180 * angle)),
                    (float)(p.X + travelDistance * Math.Sin(Math.PI / 180 * angle)));
                var beta = new Vector2((float)(p.X - travelDistance * Math.Cos(Math.PI / 180 * angle)),
                    (float)(p.X - travelDistance * Math.Sin(Math.PI / 180 * angle)));

                for (var i = 15; i < pD; i += 100)
                {
                    if (i > pD)
                    {
                        return IsCollisionable(alpha.Extend(pP.ToVector2(),
                            -pD)
                            .ToVector3()) && IsCollisionable(beta.Extend(pP.ToVector2(), -pD).ToVector3());
                    }
                    if (IsCollisionable(alpha.Extend(pP.ToVector2(),
                        -i)
                        .ToVector3()) && IsCollisionable(beta.Extend(pP.ToVector2(), -i).ToVector3())) return true;
                }
                return false;
            }

            if (mode == 9)
            {
                if (!hero.CanMove ||
                    (hero.Spellbook.IsAutoAttacking))
                    return true;

                var hitchance = EHitchanceSlider;
                var angle = 0.20 * hitchance;
                const float travelDistance = 0.5f;
                var alpha = new Vector2((float)(p.X + travelDistance * Math.Cos(Math.PI / 180 * angle)),
                    (float)(p.X + travelDistance * Math.Sin(Math.PI / 180 * angle)));
                var beta = new Vector2((float)(p.X - travelDistance * Math.Cos(Math.PI / 180 * angle)),
                    (float)(p.X - travelDistance * Math.Sin(Math.PI / 180 * angle)));

                for (var i = 15; i < pD; i += 100)
                {
                    if (IsCollisionable(pP.ToVector2().Extend(alpha,
                        i)
                        .ToVector3()) || IsCollisionable(pP.ToVector2().Extend(beta, i).ToVector3())) return true;
                }
                return false;
            }

            if (mode == 3)
            {
                var prediction = E.GetPrediction(hero);
                return EloBuddy.NavMesh.GetCollisionFlags(
                    prediction.UnitPosition.ToVector2()
                        .Extend(
                            pP.ToVector2(),
                            -pD)
                        .ToVector3()).HasFlag(EloBuddy.CollisionFlags.Wall) ||
                       EloBuddy.NavMesh.GetCollisionFlags(
                           prediction.UnitPosition.ToVector2()
                               .Extend(
                                   pP.ToVector2(),
                                   -pD / 2f)
                               .ToVector3()).HasFlag(EloBuddy.CollisionFlags.Wall);
            }

            if (mode == 4)
            {
                var prediction = E.GetPrediction(hero);
                for (var i = 15; i < pD; i += 100)
                {
                    if (i > pD) return false;
                    var posCF = EloBuddy.NavMesh.GetCollisionFlags(
                        prediction.UnitPosition.ToVector2()
                            .Extend(
                                pP.ToVector2(),
                                -i)
                            .ToVector3());
                    if (posCF.HasFlag(EloBuddy.CollisionFlags.Wall) || posCF.HasFlag(EloBuddy.CollisionFlags.Building))
                    {
                        return true;
                    }
                }
                return false;
            }

            if (mode == 5)
            {
                var prediction = E.GetPrediction(hero);
                for (var i = 15; i < pD; i += 75)
                {
                    var posCF = EloBuddy.NavMesh.GetCollisionFlags(
                        prediction.UnitPosition.ToVector2()
                            .Extend(
                                pP.ToVector2(),
                                -i)
                            .ToVector3());
                    if (posCF.HasFlag(EloBuddy.CollisionFlags.Wall) || posCF.HasFlag(EloBuddy.CollisionFlags.Building))
                    {
                        return true;
                    }
                }
                return false;
            }

            if (mode == 6)
            {
                var prediction = E.GetPrediction(hero);
                for (var i = 15; i < pD; i += (int)hero.BoundingRadius) //:frosty:
                {
                    var posCF = EloBuddy.NavMesh.GetCollisionFlags(
                        prediction.UnitPosition.ToVector2()
                            .Extend(
                                pP.ToVector2(),
                                -i)
                            .ToVector3());
                    if (posCF.HasFlag(EloBuddy.CollisionFlags.Wall) || posCF.HasFlag(EloBuddy.CollisionFlags.Building))
                    {
                        return true;
                    }
                }
                return false;
            }

            if (mode == 7)
            {
                var prediction = E.GetPrediction(hero);
                for (var i = 15; i < pD; i += 75)
                {
                    var posCF = EloBuddy.NavMesh.GetCollisionFlags(
                        prediction.UnitPosition.ToVector2()
                            .Extend(
                                pP.ToVector2(),
                                -i)
                            .ToVector3());
                    if (posCF.HasFlag(EloBuddy.CollisionFlags.Wall) || posCF.HasFlag(EloBuddy.CollisionFlags.Building))
                    {
                        return true;
                    }
                }
                return false;
            }

            if (mode == 8 &&
                (IsCollisionable(p.LSExtend(pP, -pD)) || IsCollisionable(p.LSExtend(pP, -pD / 2f)) ||
                 IsCollisionable(p.LSExtend(pP, -pD / 3f))))
            {
                return true;
            }

            return false;
        }
예제 #2
0
 private bool IsInvulnerable(EloBuddy.AIHeroClient target)
 {
     return target.HasBuffOfType(EloBuddy.BuffType.SpellShield) || target.HasBuffOfType(EloBuddy.BuffType.SpellImmunity);
 }
예제 #3
0
 private void NormalMode(EkkoCore core, EloBuddy.AIHeroClient target, bool useQ, bool useE, bool useW)
 {
     if (useQ && (core.Player.Distance(target) > core.spells.E.Range || core.Player.Distance(target) <= 100 && (core.spells.E.IsReady()) && useE))
     {
         var predQ = core.spells.Q.GetPrediction(target);
         if (predQ.HitChance >= HitChance.High)
         {
             core.spells.Q.Cast(predQ.CastPosition);
         }
     }
     if (useE && core.Player.Distance(target) > core.spells.E.Range * 2)
     {
         this.CastE(target, core, useQ);
     }
     if (useW && core.spells.W.IsInRange(target) && (target.HasBuffOfType(BuffType.Slow) || target.HasBuffOfType(BuffType.Stun)))
     {
         core.spells.W.Cast(target.Position);
     }
 }