Example #1
0
 private bool CastE(AIHeroClient target)
 {
     if (LissEMissile == null && !LissUtils.CanSecondE())
     {
         var pred = E.GetPrediction(target);
         if (pred.HitChance >= HitChance.High)
         {
             E.Cast(pred.CastPosition);
             return(true);
         }
     }
     return(SecondEChecker(target));
 }
Example #2
0
        public override void farm()
        {
            if (player.ManaPercent < 55)
            {
                return;
            }
            var minions =
                ObjectManager.Get <Obj_AI_Minion>()
                .Where(
                    m =>
                    m.IsValidTarget() &&
                    (Vector3.Distance(m.ServerPosition, player.ServerPosition) <= Q.Range ||
                     Vector3.Distance(m.ServerPosition, player.ServerPosition) <= W.Range ||
                     Vector3.Distance(m.ServerPosition, player.ServerPosition) <= E.Range));

            if (Q.IsReady())
            {
                var KillableMinionsQ = minions.Where(m => m.Health <player.GetSpellDamage(m, SpellSlot.Q) && Vector3.Distance(m.ServerPosition, player.ServerPosition)> player.AttackRange);
                if (KillableMinionsQ.Any())
                {
                    Q.Cast(KillableMinionsQ.FirstOrDefault().ServerPosition);
                }
            }
            if (W.IsReady())
            {
                var KillableMinionsW = minions.Where(m => m.Health < player.GetSpellDamage(m, SpellSlot.W) && Vector3.Distance(player.ServerPosition, m.ServerPosition) < W.Range);
                if (KillableMinionsW.Any())
                {
                    W.CastOnUnit(player);
                }
            }

            if (E.IsReady() && LissEMissile == null && !LissUtils.CanSecondE() && LissEMissile == null)
            {
                var KillableMinionsE = minions.Where(m => m.Health <player.GetSpellDamage(m, SpellSlot.E) && Vector3.Distance(m.ServerPosition, player.ServerPosition)> player.AttackRange);
                if (KillableMinionsE.Any())
                {
                    E.Cast(KillableMinionsE.FirstOrDefault().ServerPosition);
                }
            }
        }
Example #3
0
        //return asap to check the most amount of times
        bool SecondEChecker(Obj_AI_Hero target)
        {
            if (LissUtils.isHealthy() && LissEMissile != null && E.IsReady())
            {
                if (Vector2.Distance(MissilePosition, target.ServerPosition.To2D()) < Vector3.Distance(player.ServerPosition, target.ServerPosition) &&
                    !LissUtils.PointUnderEnemyTurret(MissilePosition) &&
                    Vector3.Distance(target.ServerPosition, LissEMissile.EndPosition) > Vector3.Distance(player.ServerPosition, target.ServerPosition))
                {
                    if (safeGap(LissEMissile.Position.To2D()))
                    {
                        E.Cast();
                        return(true);
                    }
                }
                var Enemiesatpoint  = LissEMissile.Position.GetEnemiesInRange(R.Range);
                var enemiesatpointR = Enemiesatpoint.Count;

                if ((enemiesatpointR >= 2 && SpellSlot.R.IsReady()) || (Enemiesatpoint.Any(e => IsKillableFromPoint(e, LissEMissile.Position) && Vector3.Distance(LissEMissile.Position, e.ServerPosition) < Vector3.Distance(player.ServerPosition, e.ServerPosition))))
                {
                    if (safeGap(LissEMissile.Position.To2D()))
                    {
                        E.Cast();
                        return(true);
                    }
                }
                var enemiesatpointW = LissEMissile.Position.CountEnemiesInRange(W.Range);
                if (enemiesatpointW >= 2 && SpellSlot.W.IsReady())
                {
                    if (safeGap(LissEMissile.Position.To2D()))
                    {
                        E.Cast();
                        return(true);
                    }
                }
            }
            return(false);
        }
Example #4
0
 //return asap to check the most amount of times
 bool SecondEChecker(AIHeroClient target)
 {
     if (LissUtils.isHealthy() && LissEMissile != null && E.IsReady())
     {
         if (Vector2.Distance(MissilePosition, target.ServerPosition.To2D()) < Vector3.Distance(player.ServerPosition, target.ServerPosition) &&
             !LissUtils.PointUnderEnemyTurret(MissilePosition) &&
             Vector3.Distance(target.ServerPosition, LissEMissile.EndPosition) > Vector3.Distance(player.ServerPosition, target.ServerPosition))
         {
             if (safeGap(LissEMissile.Position.To2D()))
             {
                 E.Cast();
                 return(true);
             }
         }
         var enemiesatpoint  = EntityManager.Heroes.Enemies.Where(x => !x.IsDead && x.IsInRange(ObjectManager.Player.ServerPosition, R.Range));
         var enemiesatpointR = enemiesatpoint.Count();
         if (enemiesatpointR >= 2 && R.IsReady() || enemiesatpoint.Any(e => IsKillableFromPoint(e, LissEMissile.Position) && Vector3.Distance(LissEMissile.Position, e.ServerPosition) < Vector3.Distance(player.ServerPosition, e.ServerPosition)))
         {
             if (safeGap(LissEMissile.Position.To2D()))
             {
                 E.Cast();
                 return(true);
             }
         }
         var enemiesatpointW = LissEMissile.Position.CountEnemiesInRange(W.Range);
         if (enemiesatpointW >= 2 && W.IsReady())
         {
             if (safeGap(LissEMissile.Position.To2D()))
             {
                 E.Cast();
                 return(true);
             }
         }
     }
     return(false);
 }
Example #5
0
        bool CastR(AIHeroClient currenttarget)
        {
            var check = EntityManager.Heroes.Enemies
                        .Where(
                h => h.IsValidTarget(R.Range) && h.CountEnemiesInRange(R.Range) >= 2 && h.HealthPercent > 22).ToList();

            if (player.CountEnemiesInRange(R.Range) >= 2)
            {
                check.Add(player);
            }

            if (check.Any())
            {
                if (check.Contains(player) && !LissUtils.isHealthy())
                {
                    R.CastOnUnit(player);
                    return(true);
                }
                var target = check.FirstOrDefault();//(TargetSelector.GetPriority
                if (target != null)
                {
                    R.Cast(target);
                    return(true);
                }
            }

            if (IsKillableFromPoint(currenttarget, player.ServerPosition) && player.Distance(currenttarget) < R.Range)
            {
                R.Cast(currenttarget);
                return(true);
            }


            if (LissUtils.PointUnderAllyTurret(currenttarget.ServerPosition))
            {
                R.Cast(currenttarget);
                return(true);
            }

            var dmgto = player.GetSpellDamage(currenttarget, SpellSlot.R);

            if (dmgto > currenttarget.Health && currenttarget.Health >= 0.40 * dmgto)
            {
                R.Cast(currenttarget);
                return(true);
            }

            var enemycount = 2;

            if (!LissUtils.isHealthy() && player.CountEnemiesInRange(R.Range - 100) >= enemycount)
            {
                R.CastOnUnit(player);
                return(true);
            }

            var possibilities = EntityManager.Heroes.Enemies.Where(h => (h.IsValidTarget() && Vector3.Distance(h.ServerPosition, player.ServerPosition) <= R.Range || (IsKillableFromPoint(h, player.ServerPosition) && h.IsValidTarget() && !h.IsInvulnerable))).ToList();

            var arranged = possibilities.OrderByDescending(h => h.CountEnemiesInRange(R.Range));


            var ultTarget = arranged.FirstOrDefault();

            if (ultTarget != null)
            {
                if (!LissUtils.isHealthy() &&
                    player.CountEnemiesInRange(R.Range) >
                    ultTarget.CountEnemiesInRange(R.Range) + 1)
                {
                    R.CastOnUnit(player);
                    return(true);
                }

                /*if (R.Cast(UltTarget) == Spell..SuccessfullyCasted)
                 *  return true;*/
            }
            return(false);
        }
Example #6
0
        public bool IsKillableFromPoint(AIHeroClient target, Vector3 Point, bool ExcludeE = false)
        {
            double totaldmgavailable = 0;

            if (Q.IsReady() && Vector3.Distance(Point, target.ServerPosition) < Q.Range + 35)
            {
                totaldmgavailable += player.GetSpellDamage(target, SpellSlot.Q);
            }
            if (W.IsReady() && Vector3.Distance(Point, target.ServerPosition) < W.Range + 35)
            {
                totaldmgavailable += player.GetSpellDamage(target, SpellSlot.W);
            }
            if (E.IsReady() && Vector3.Distance(Point, target.ServerPosition) < E.Range + 35 && !LissUtils.CanSecondE() && LissEMissile == null && !ExcludeE)
            {
                totaldmgavailable += player.GetSpellDamage(target, SpellSlot.E);
            }
            if (R.IsReady() && Vector3.Distance(Point, target.ServerPosition) < Q.Range + 35)
            {
                totaldmgavailable += player.GetSpellDamage(target, SpellSlot.R);
            }

            return(totaldmgavailable > target.Health);
        }