Ejemplo n.º 1
0
        public static void updateArmaPlay()
        {
            try
            {
                if (!haveSeenMinion)
                {
                    haveSeenMinion =
                        ObjectManager.Get <Obj_AI_Minion>().Any(min => min.IsTargetable && min.IsHPBarRendered && 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))
                {
                    buyItems();
                }

                if (champ != null)
                {
                    champ.alwaysCheck();
                }

                setRambo();

                if (player.IsDead || player.IsChannelingImportantSpell())
                {
                    return;
                }

                var fightLevel = MapControl.fightLevel();
                MapControl.updateReaches();

                var closestEnemy = EloBuddy.SDK.EntityManager.Heroes.Enemies.Where(ene => !ene.IsDead && ene.IsTargetable && ene.IsHPBarRendered && !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 (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 = EloBuddy.SDK.EntityManager.Heroes.Allies.OrderBy(al => toNex.Position.Distance(al.Position, true)).FirstOrDefault();

                var lookRange = player.AttackRange + ((player.IsMelee) ? 260 : 155);
                var easyKill  =
                    EloBuddy.SDK.EntityManager.Heroes.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) && ene.IsHPBarRendered);

                if (easyKill != null && easyKill.IsValidTarget())
                {
                    Aggresivity.addAgresiveMove(new AgresiveMove(45, 1500, true));
                    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(), 632).To3D(), true);
                }

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

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

                if (towerAttackedMe)
                {
                    DeathWalker.CustomOrbwalkMode = false;
                    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 =
                        EloBuddy.SDK.EntityManager.Turrets.Enemies.Where(
                            obj => obj.IsValidTarget(700) && !obj.IsDead && !obj.IsInvulnerable && obj.IsTargetable)
                        .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 && safeMeleeEnem.IsValidTarget())
                        {
                            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 (!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 (sector.containsEnemy && !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);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 2
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() && player.ChampionName != "Varus"))
            {
                champ?.castingImportantSpell();
                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() || needRecall && lastRecall + 1000 > DeathWalker.now)
                {
                    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;
                    }
                }
                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 < 280 || 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(), 632).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 (balance < 70 && 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(), 3000, true, true));
                    DeathWalker.deathWalk(fightOn.Position.Extend(player.Position, player.AttackRange * 0.6f), 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(), 333).To3D(), false);
                    }
                }
            }



            /*foreach (var ally in MapControl.ally_champions)
             * {
             *  if (ally.hero.Distance(player) < 800 && MapControl.myControler != null)
             *      MapControl.myControler.useNonSkillshots(ally.hero);
             * }*/
        }