Example #1
0
 public static AIHeroClient getSafeMeleeTarget(float range = 750)
 {
     return(getBestTarget(range, true, new Vector3(), EloBuddy.SDK.EntityManager.Heroes.Enemies.Where(ene => ene != null && MapControl.safeGap(ene)).ToList()));
 }
Example #2
0
        public void update()
        {
            enemyChampIn       = null;
            enemyTowerIn       = null;
            containsAlly       = false;
            containsAllyMinion = false;
            containsEnemy      = false;
            dangerPolig        = false;
            containsAllyChamp  = false;
            containsEnemyChamp = false;
            enem = null;
            int dangLVL = 0;

            foreach (var obj in ObjectManager.Get <AttackableUnit>())
            {
                if (obj.IsDead || obj.Health == 0 || !obj.IsValid || !obj.IsVisible || obj.IsInvulnerable || obj.IsMe)
                {
                    continue;
                }

                if ((!containsAlly || !containsAllyMinion) && obj.IsAlly && !obj.IsDead)
                {
                    if (polig.pointInside(obj.Position.To2D()))
                    {
                        containsAlly = true;
                        if (obj is Obj_AI_Minion)
                        {
                            containsAllyMinion = true;
                        }
                    }
                }

                if (!containsEnemy && obj.IsEnemy && obj is Obj_AI_Minion && !MapControl.fightIsClose() && !ARAMTargetSelector.IsInvulnerable(ObjectManager.Player) && !Aggresivity.getIgnoreMinions())
                {
                    if (!obj.IsDead && ((Obj_AI_Minion)obj).BaseSkinName != "GangplankBarrel" && obj.Health > 0 && obj.IsValidTarget() && polig.pointInside(obj.Position.To2D()))
                    {
                        containsEnemy = true;
                        enem          = obj;
                    }
                }
                if (containsEnemy && containsAlly)
                {
                    break;
                }
            }

            foreach (var en_chemp in MapControl.enemy_champions)
            {
                en_chemp.getReach();
                //Console.WriteLine(en_chemp.reach);
                if (!en_chemp.hero.IsDead && (en_chemp.hero.IsVisible || ARAMSimulator.deepestAlly.IsMe || NavMesh.GetCollisionFlags(en_chemp.hero.Position) == CollisionFlags.Grass) && (sectorInside(en_chemp.hero.Position.To2D(), en_chemp.hero.AttackRange + 120) ||
                                                                                                                                                                                          sectorInside(en_chemp.hero.Position.To2D(), en_chemp.reach)))
                {
                    dangLVL++;
                    containsEnemyChamp = true;
                    if (enemyChampIn == null || (enemyChampIn.Health > en_chemp.hero.Health && !enemyChampIn.IsZombie && !ARAMTargetSelector.IsInvulnerable(enemyChampIn)))
                    {
                        enemyChampIn = en_chemp.hero;
                    }
                }
            }

            foreach (var al_chemp in MapControl.ally_champions)
            {
                if (al_chemp != null && al_chemp.hero.IsValidTarget() && !al_chemp.hero.IsDead && polig.pointInside(al_chemp.hero.Position.To2D()))
                {
                    dangLVL--;
                    containsAllyChamp = true;
                }
            }
            if (dangLVL > 0)
            {
                dangerPolig = true;
            }

            foreach (var turret in ObjectManager.Get <Obj_AI_Turret>())
            {
                if (turret.IsEnemy && !turret.IsDead && turret.IsValid && sectorInside(turret.Position.To2D(), 1050))
                {
                    if (polig.pointInside(turret.Position.To2D()))
                    {
                        enemyTowerIn = turret;
                        dangerPolig  = true;
                        break;
                    }

                    if (!towerContainsAlly(turret))
                    {
                        dangerPolig = true;
                        break;
                    }
                }
            }
        }
Example #3
0
 public static bool safeGap(Vector2 position)
 {
     return(myControler.hero.HealthPercent < 13 || (!Sector.inTowerRange(position) &&
                                                    (MapControl.balanceAroundPointAdvanced(position, 500) > 0)) || position.Distance(ARAMSimulator.fromNex.Position, true) < myControler.hero.Position.Distance(ARAMSimulator.fromNex.Position, true));
 }
Example #4
0
 public static bool safeGap(Obj_AI_Base target)
 {
     return(safeGap(target.Position.To2D()) || MapControl.fightIsOn(target) || (!ARAMTargetSelector.IsInvulnerable(target) && target.Health < myControler.canDoDmgTo(target, true) / 2));
 }
Example #5
0
        public static void updateArmaPlay()
        {
            if (!haveSeenMinion)
            {
                haveSeenMinion =
                    ObjectManager.Get <Obj_AI_Minion>().Any(min => min.IsTargetable && min.IsAlly && min.Health > 50) ||
                    ARAMDetFull.gameStart + 44 * 1000 < ARAMDetFull.now;
            }
            if (!haveSeenMinion)
            {
                return;
            }
            try
            {
                AutoLevelChamp.LevelUpOff();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            if ((player.InShop() || player.IsDead) /* && nextItem != null && nextItem.goldReach <= player.Gold*/)
            {
                buyItems();
            }
            if (champ != null)
            {
                champ.alwaysCheck();
            }

            setRambo();
            if (player.IsDead || player.IsChannelingImportantSpell())
            {
                return;
            }
            var fightLevel = MapControl.fightLevel();

            MapControl.updateReaches();

            var closestEnemy = HeroManager.Enemies.Where(ene => !ene.IsDead && ene.IsTargetable && !ARAMTargetSelector.IsInvulnerable(ene)).OrderBy(ene => player.Position.Distance(ene.Position, true)).FirstOrDefault();

            if (closestEnemy != null && ramboMode)
            {
                DeathWalker.deathWalk(closestEnemy.Position, true);
                return;
            }

            if (fightLevel != 0)
            {
                Aggresivity.addAgresiveMove(new AgresiveMove(40 * fightLevel, 2000, true, true));
            }

            agrobalance = Aggresivity.getAgroBalance();

            balance  = (ARAMTargetSelector.IsInvulnerable(player) || player.IsZombie) ? 250 : MapControl.balanceAroundPointAdvanced(player.Position.To2D(), 250 - agrobalance * 5) + agrobalance;
            inDanger = balance < 0;

            if (Game.MapId == GameMapId.SummonersRift)
            {
                if (player.IsRecalling())
                {
                    return;
                }
                if (player.InFountain() && player.HealthPercent < 90)
                {
                    player.IssueOrder(GameObjectOrder.Stop, player);
                    return;
                }
                if (player.HealthPercent > 85 && (player.MaxMana < 450 || player.ManaPercent > 85))
                {
                    needRecall = false;
                }
                if ((((player.HealthPercent < 32 || (player.MaxMana > 450 && player.ManaPercent < 5)) && player.CountEnemiesInRange(1000) == 0) || needRecall) && balance > 5)
                {
                    if (lastRecall + 9000 < DeathWalker.now)
                    {
                        needRecall = true;
                        var recall = new Spell(SpellSlot.Recall);
                        recall.Cast();
                        lastRecall = DeathWalker.now;
                        return;
                    }
                }
                else if (needRecall)
                {
                    player.IssueOrder(GameObjectOrder.MoveTo, fromNex.Position.Randomize(534, 1005));
                    return;
                }
            }

            if (champ != null)
            {
                try
                {
                    if (player.GetEnemiesInRange(ARAMSimulator.farmRange).Count(ene => !ene.IsDead && !ene.IsZombie) != 0)
                    {
                        champ.killSteal();
                    }
                    else
                    {
                        champ.farm();
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
            }

            if (!Sector.inTowerRange(player.Position.To2D()) || towerAttackedAlly || player.HealthPercent < 25)
            {
                try
                {
                    ItemHandler.useItems();
                    sSpells.useSumoners();
                    if (champ != null)
                    {
                        champ.useSpells();
                    }
                    else
                    {
                        MapControl.myControler.useSpells();
                        if (player.MaxMana < 350 || player.ManaPercent > 50)
                        {
                            MapControl.myControler.useSpellsOnMinions();
                        }
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
            }

            deepestAlly = HeroManager.Allies.OrderBy(al => toNex.Position.Distance(al.Position, true)).FirstOrDefault();
            var lookRange = player.AttackRange + ((player.IsMelee) ? 260 : 155);
            var easyKill  =
                HeroManager.Enemies.FirstOrDefault(ene => ene != null && !ene.IsZombie && !ene.IsDead && ene.Distance(player, true) < lookRange * lookRange &&
                                                   !ARAMTargetSelector.IsInvulnerable(ene) && ene.Health / 1.5 < player.GetAutoAttackDamage(ene));

            if (easyKill != null)
            {
                Aggresivity.addAgresiveMove(new AgresiveMove(45, 1500, true));
                //Console.WriteLine("go get easy");
                DeathWalker.deathWalk(easyKill.Position.To2D().Extend(player.Position.To2D(), player.AttackRange * 0.7f).To3D(), true);
            }


            if (balance < 0)
            {
                DeathWalker.deathWalk(player.Position.To2D().Extend(fromNex.Position.To2D(), 600).To3D(), true);
            }

            if ((!player.IsMelee || fightLevel < 2) && HeroManager.Enemies.Any(h => !h.IsDead) && moveToRelicIfForHeal())
            {
                return;
            }

            if (!player.UnderTurret(true))
            {
                towerAttackedMe   = false;
                towerAttackedAlly = false;
            }

            if (towerAttackedMe)
            {
                DeathWalker.CustomOrbwalkMode = false;
                // Game.PrintChat("ouch tower!");
                DeathWalker.deathWalk(player.Position.To2D().Extend(fromNex.Position.To2D(), 600).To3D(), true);
                return;
            }

            awayTo = eAwayFromTo();
            if (awayTo.IsValid() && awayTo.X != 0)
            {
                DeathWalker.CustomOrbwalkMode = false;
                if (champ != null)
                {
                    champ.kiteBack(awayTo);
                }
                DeathWalker.deathWalk(awayTo.To3D(), true);
                return;
            }
            else
            {
                var closestObj =
                    DeathWalker.EnemyObjectives.Where(
                        obj => obj.IsValidTarget(700) && !obj.IsDead && !obj.IsInvulnerable)
                    .OrderBy(obj => obj.Position.Distance(player.Position, true)).FirstOrDefault();
                if (closestObj != null && (!(closestObj is Obj_AI_Turret) || Sector.towerContainsAlly((Obj_AI_Turret)closestObj)))
                {
                    DeathWalker.deathWalk(
                        closestObj.Position.Extend(player.Position, player.AttackRange * 0.6f), true);
                    return;
                }

                if (player.IsMelee)
                {
                    var safeMeleeEnem = ARAMTargetSelector.getSafeMeleeTarget();
                    if (safeMeleeEnem != null)
                    {
                        DeathWalker.deathWalk(
                            safeMeleeEnem.Position.Extend(safeMeleeEnem.Direction, player.AttackRange * 0.3f), true);
                        return;
                    }
                }
                var fightOn = MapControl.fightIsOn();
                if (fightOn != null && MapControl.balanceAroundPointAdvanced(fightOn.Position.To2D(), 280, 450) > (-130) && fightOn.Distance(player, true) < 2500 * 2500 && (!player.IsMelee() || !Sector.inTowerRange(fightOn.Position.To2D())))
                {
                    Aggresivity.addAgresiveMove(new AgresiveMove(40 * MapControl.fightLevel(), 2000, true, true));
                    DeathWalker.deathWalk(fightOn.Position.Extend(player.Position, player.AttackRange * 0.8f), true);
                }
                else
                {/*
                  * if (player.HealthPercent < 69 && moveToRelicIfForHeal())
                  * {
                  *     return;
                  * }*/
                    if (!inDanger)
                    {
                        Sector orbSector  = null;
                        Sector prevSector = null;
                        foreach (var sector in sectors)
                        {
                            sector.update();
                            int sectorCheck = 1150 - MapControl.fearDistance;
                            if (sector.containsEnemyChamp && sector.enemyChampIn.Distance(player, true) < sectorCheck * sectorCheck)
                            {
                                orbSector = sector;
                                break;
                            }
                            if (sector.dangerPolig)
                            {
                                break;
                            }
                            //  if (!player.IsMelee)
                            // {
                            if (sector.containsEnemy && !sector.containsAlly)
                            {
                                break;
                            }
                            // }
                            // else
                            //  {
                            //     if (prevSector != null && sector.containsEnemy && !prevSector.containsAlly  && !sector.containsAlly)
                            //         break;
                            //  }
                            orbSector = sector;
                            if (sector.containsEnemy && sector.containsAlly)
                            {
                                break;
                            }
                            prevSector = sector;
                        }
                        if (orbSector == null)
                        {
                            return;
                        }
                        DeathWalker.deathWalk(orbSector.getRandomPointIn().To3D(), false, true);
                    }
                    else
                    {
                        DeathWalker.deathWalk(player.Position.To2D().Extend(fromNex.Position.To2D(), 600).To3D(), false);
                    }
                }
            }



            /*foreach (var ally in MapControl.ally_champions)
             * {
             *  if (ally.hero.Distance(player) < 800 && MapControl.myControler != null)
             *      MapControl.myControler.useNonSkillshots(ally.hero);
             * }*/
        }
Example #6
0
 public static Obj_AI_Hero getSafeMeleeTarget(float range = 750)
 {
     return(getBestTarget(range, true, new Vector3(), HeroManager.Enemies.Where(ene => ene != null && MapControl.safeGap(ene)).ToList()));
 }