Esempio n. 1
0
            public override void useSpell()
            {
                if (!spell.IsReady() || lastCast + 700 > DeathWalker.now)
                {
                    return;
                }
                lastCast = DeathWalker.now;

                if (spell.Instance.Name.ToLower().Equals("snowballfollowupcast"))
                {
                    if (snowed != null)
                    {
                        if (MapControl.safeGap(snowed))
                        {
                            spell.Cast();
                            Aggresivity.addAgresiveMove(new AgresiveMove(100, 2500, true));
                        }
                    }
                }
                else
                {
                    var tar = ARAMTargetSelector.getBestTarget(spell.Range);
                    if (tar != null)
                    {
                        spell.Cast(tar);
                        snowed = tar;
                    }
                }
            }
Esempio n. 2
0
        private static void onDraw(EventArgs args)
        {
            try
            {
                if (!Debug["debugDraw"].Cast <CheckBox>().CurrentValue)
                {
                    return;
                }
                Drawing.DrawText(100, 100, Color.Red, "2bal: " + ARAMSimulator.balance + " fear: " + MapControl.fearDistance);

                foreach (var hel in ObjectManager.Get <Obj_AI_Minion>().Where(r => r.IsValid && !r.IsDead && r.Name.ToLower().Contains("blobdrop")))
                {
                    var spos = Drawing.WorldToScreen(hel.Position);
                    Drawing.DrawText(spos.X, spos.Y, Color.Brown, " : " + hel.Name);
                    Drawing.DrawText(spos.X, spos.Y + 25, Color.Brown, hel.IsDead + " : " + hel.Type + " : " + hel.IsValid + " : " + hel.CharacterState);
                }

                var tar = ARAMTargetSelector.getBestTarget(5100);
                if (tar != null)
                {
                    Drawing.DrawCircle(tar.Position, 150, Color.Violet);
                }

                foreach (var sec in ARAMSimulator.sectors)
                {
                    sec.draw();
                }


                foreach (var ene in MapControl.enemy_champions)
                {
                    var spos = Drawing.WorldToScreen(ene.hero.Position);
                    Drawing.DrawCircle(ene.hero.Position, ene.reach, Color.Green);

                    Drawing.DrawText(spos.X, spos.Y, Color.LimeGreen, "Gold: " + ene.hero.Gold);
                }

                foreach (var ene in MapControl.enemy_champions)
                {
                    Drawing.DrawCircle(ene.hero.Position, ene.reach, Color.Violet);
                }
                return;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
        }
Esempio n. 3
0
            public override void useSpell()
            {
                if (!spell.IsReady())
                {
                    return;
                }
                var tar = ARAMTargetSelector.getBestTarget(300);

                if (tar != null)
                {
                    if (tar.HealthPercent > 20)
                    {
                        spell.Cast(tar);
                    }
                }
            }
Esempio n. 4
0
        private static Obj_AI_Base GetBestHeroTarget()
        {
            Obj_AI_Hero killableEnemy = null;
            var         hitsToKill    = double.MaxValue;

            foreach (var enemy in AllEnemys.Where(hero => !hero.IsDead && !hero.IsInvulnerable && hero.IsValidTarget() && !hero.IsZombie && InAutoAttackRange(hero)))
            {
                var killHits = CountKillhits(enemy);
                if (killableEnemy != null && !(killHits < hitsToKill))
                {
                    continue;
                }
                killableEnemy = enemy;
                hitsToKill    = killHits;
            }
            return(hitsToKill < 4 ? killableEnemy : ARAMTargetSelector.getBestTarget(GetAutoAttackRange() + 100));
        }
Esempio n. 5
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);
            }
        }
Esempio n. 6
0
 public static void setRambo()
 {
     ramboMode = false;
     if (player.IsZombie && (player.ChampionName == "Sion" || player.ChampionName == "KogMaw") || ARAMTargetSelector.IsInvulnerable(player))
     {
         ramboMode = true;
     }
 }
Esempio n. 7
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));
 }
Esempio n. 8
0
 public void useSpells()
 {
     if (lastSpellUse + 277 > DeathWalker.now)
     {
         return;
     }
     lastSpellUse = DeathWalker.now;
     foreach (var spell in spells)
     {
         if (!spell.Value.IsReady() || spell.Value.ManaCost > hero.Mana)
         {
             continue;
         }
         var movementSpells = new List <SpellTags> {
             SpellTags.Dash, SpellTags.Blink, SpellTags.Teleport
         };
         var supportSpells = new List <SpellTags> {
             SpellTags.Shield, SpellTags.Heal, SpellTags.DamageAmplifier,
             SpellTags.SpellShield, SpellTags.RemoveCrowdControl,
         };
         if (spell.Value.IsSkillshot)
         {
             if (spell.Key.SpellTags != null && spell.Key.SpellTags.Any(movementSpells.Contains))
             {
                 if (hero.HealthPercent < 25 && hero.CountEnemiesInRange(600) > 0)
                 {
                     Console.WriteLine("Cast esacpe location: " + spell.Key.Slot);
                     spell.Value.Cast(hero.Position.Extend(ARAMSimulator.fromNex.Position, 1235));
                     return;
                 }
                 else
                 {
                     var bTarg = ARAMTargetSelector.getBestTarget(spell.Value.Range, true);
                     if (bTarg != null && safeGap(hero.Position.Extend(bTarg.Position, spell.Key.Range).To2D()))
                     {
                         if (spell.Value.CastIfHitchanceEquals(bTarg, HitChance.VeryHigh))
                         {
                             Console.WriteLine("Cast attack location gap: " + spell.Key.Slot);
                             return;
                         }
                     }
                 }
             }
             else
             {
                 var bTarg = ARAMTargetSelector.getBestTarget(spell.Value.Range, true);
                 if (bTarg != null)
                 {
                     if (spell.Value.CastIfHitchanceEquals(bTarg, HitChance.VeryHigh))
                     {
                         Console.WriteLine("Cast attack location gap: " + spell.Key.Slot);
                         return;
                     }
                 }
             }
         }
         else
         {
             float range = (spell.Value.Range != 0) ? spell.Value.Range : 500;
             if (spell.Key.CastType.Contains(CastType.Self) || spell.Key.CastType.Contains(CastType.Activate))
             {
                 var bTarg = ARAMTargetSelector.getBestTarget(range, true);
                 if (bTarg != null)
                 {
                     Console.WriteLine("Cast self: " + spell.Key.Slot);
                     spell.Value.Cast();
                     return;
                 }
             }
             else if (spell.Key.CastType.Contains(CastType.AllyChampions) && spell.Key.SpellTags != null && spell.Key.SpellTags.Any(supportSpells.Contains))
             {
                 var bTarg = ARAMTargetSelector.getBestTargetAly(range, false);
                 if (bTarg != null)
                 {
                     Console.WriteLine("Cast ally: " + spell.Key.Slot);
                     spell.Value.CastOnUnit(bTarg);
                     return;
                 }
             }
             else if (spell.Key.CastType.Contains(CastType.EnemyChampions))
             {
                 var bTarg = ARAMTargetSelector.getBestTarget(range, true);
                 if (bTarg != null)
                 {
                     if (!(spell.Key.SpellTags != null && spell.Key.SpellTags.Any(movementSpells.Contains)) || safeGap(bTarg))
                     {
                         Console.WriteLine("Cast enemy: " + spell.Key.Slot);
                         spell.Value.CastOnUnit(bTarg);
                         return;
                     }
                 }
             }
         }
     }
 }
Esempio n. 9
0
 public void useSpellsOnMinions()
 {
     if (lastMinionSpellUse + 277 > DeathWalker.now)
     {
         return;
     }
     lastMinionSpellUse = DeathWalker.now;
     if (hero.MaxMana > 300 && hero.ManaPercent < 78)
     {
         return;
     }
     foreach (var spell in spells)
     {
         if (spell.Value.Slot == SpellSlot.R || spell.Value.Instance.Cooldown > 10 || !spell.Value.IsReady() || spell.Value.ManaCost > hero.Mana || spell.Key.SpellTags == null || !spell.Key.SpellTags.Contains(SpellTags.Damage))
         {
             continue;
         }
         var minions = MinionManager.GetMinions((spell.Value.Range != 0) ? spell.Value.Range : 500);
         foreach (var minion in minions)
         {
             if (minion.Health > spell.Value.GetDamage(minion))
             {
                 continue;
             }
             var movementSpells = new List <SpellTags> {
                 SpellTags.Dash, SpellTags.Blink, SpellTags.Teleport
             };
             if (spell.Value.IsSkillshot)
             {
                 if (!(spell.Key.SpellTags != null && spell.Key.SpellTags.Any(movementSpells.Contains)) || safeGap(minion))
                 {
                     Console.WriteLine("Cast farm location: " + spell.Key.Slot);
                     spell.Value.Cast(minion.Position);
                     return;
                 }
             }
             else
             {
                 float range = (spell.Value.Range != 0) ? spell.Value.Range : 500;
                 if (spell.Key.CastType.Contains(CastType.Self))
                 {
                     var bTarg = ARAMTargetSelector.getBestTarget(range, true);
                     if (bTarg != null)
                     {
                         Console.WriteLine("Cast farm self: " + spell.Key.Slot);
                         spell.Value.Cast();
                         return;
                     }
                 }
                 else if (spell.Key.CastType.Contains(CastType.EnemyMinions))
                 {
                     if (minion != null)
                     {
                         if (!(spell.Key.SpellTags != null && spell.Key.SpellTags.Any(movementSpells.Contains)) || safeGap(minion))
                         {
                             Console.WriteLine("Cast farm target: " + spell.Key.Slot);
                             spell.Value.CastOnUnit(minion);
                             return;
                         }
                     }
                 }
             }
         }
     }
 }
Esempio n. 10
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);
             * }*/
        }
Esempio n. 11
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).SkinName != "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.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;
                    }
                }
            }
        }
Esempio n. 12
0
            public void useSpellsOnMinions()
            {
                if (lastMinionSpellUse + 277 > DeathWalker.now)
                {
                    return;
                }
                lastMinionSpellUse = DeathWalker.now;
                if (hero.MaxMana > 300 && hero.ManaPercent < 78)
                {
                    return;
                }
                if (hero.MaxMana > 199 && hero.MaxMana < 201 && hero.ManaPercent < 95)
                {
                    return;
                }
                foreach (var spell in spells)
                {
                    if (spell.Value.Slot == SpellSlot.R || spell.Value.Instance.Cooldown > 10 || !spell.Value.IsReady() || spell.Value.ManaCost > hero.Mana || spell.Key.SpellTags == null || !spell.Key.SpellTags.Contains(SpellTags.Damage) ||
                        (isTransformChampion() && sBook.GetSpell(spell.Key.Slot).Name.ToLower() != spell.Key.SpellName.ToLower()))
                    {
                        continue;
                    }
                    //Farm spell
                    if (spell.Value.IsSkillshot && !spell.Value.Collision && spell.Value.GetDamage(hero) > 5)
                    {
                        var farmMinions  = MinionManager.GetMinions((spell.Value.Range != 0) ? spell.Value.Range : 300);
                        var farmLocation = (spell.Value.Type == SkillshotType.SkillshotCircle)?spell.Value.GetCircularFarmLocation(farmMinions): spell.Value.GetLineFarmLocation(farmMinions);
                        if (farmLocation.MinionsHit > 2)
                        {
                            spell.Value.Cast(farmLocation.Position);
                            return;
                        }
                        //dont waste for single kills
                        return;
                    }

                    //if line
                    var minions = MinionManager.GetMinions((spell.Value.Range != 0) ? spell.Value.Range : 500);
                    foreach (var minion in minions)
                    {
                        if (minion.Health > spell.Value.GetDamage(minion))
                        {
                            continue;
                        }
                        var movementSpells = new List <SpellTags> {
                            SpellTags.Dash, SpellTags.Blink, SpellTags.Teleport
                        };
                        if (spell.Value.IsSkillshot)
                        {
                            if (!(spell.Key.SpellTags != null && spell.Key.SpellTags.Any(movementSpells.Contains)) || safeGap(minion))
                            {
                                Console.WriteLine("Cast farm location: " + spell.Key.Slot);
                                spell.Value.Cast(minion.Position);
                                return;
                            }
                        }
                        else
                        {
                            float range = (spell.Value.Range != 0) ? spell.Value.Range : 500;
                            if (spell.Key.CastType.Contains(CastType.Self))
                            {
                                var bTarg = ARAMTargetSelector.getBestTarget(range, true);
                                if (bTarg != null)
                                {
                                    Console.WriteLine("Cast farm self: " + spell.Key.Slot);
                                    spell.Value.Cast();
                                    return;
                                }
                            }
                            else if (spell.Key.CastType.Contains(CastType.EnemyMinions))
                            {
                                if (minion != null)
                                {
                                    if (!(spell.Key.SpellTags != null && spell.Key.SpellTags.Any(movementSpells.Contains)) || safeGap(minion))
                                    {
                                        Console.WriteLine("Cast farm target: " + spell.Key.Slot);
                                        spell.Value.CastOnUnit(minion);
                                        return;
                                    }
                                }
                            }
                        }
                    }
                }
            }
Esempio n. 13
0
            public void useSpells()
            {
                try
                {
                    if (lastSpellUse + 277 > DeathWalker.now)
                    {
                        return;
                    }
                    lastSpellUse = DeathWalker.now;
                    foreach (var spell in spells)
                    {
                        if (!spell.Value.IsReady() || spell.Value.ManaCost > hero.Mana || (isTransformChampion() && sBook.GetSpell(spell.Key.Slot).Name != spell.Key.SpellName))
                        {
                            continue;
                        }

                        if (ObjectManager.Player.Hero == Champion.Corki && spell.Key.Slot == SpellSlot.R)
                        {
                            Console.WriteLine("RIP");
                            continue;
                        }

                        var movementSpells = new List <SpellTags> {
                            SpellTags.Dash, SpellTags.Blink, SpellTags.Teleport
                        };
                        var supportSpells = new List <SpellTags> {
                            SpellTags.Shield, SpellTags.Heal, SpellTags.DamageAmplifier,
                            SpellTags.SpellShield, SpellTags.RemoveCrowdControl,
                        };

                        if (spell.Key.SpellTags.Contains(SpellTags.Transformation))
                        {
                            var transformPoints = spells.Count(s => !s.Value.IsReady() || spell.Value.ManaCost > hero.Mana);
                            if (transformPoints >= 3)
                            {
                                Console.WriteLine("Cast transfrom self: " + spell.Key.Slot);
                                spell.Value.Cast();
                            }
                            return;
                        }

                        if (spell.Value.IsSkillshot)
                        {
                            if (spell.Key.SpellTags != null && spell.Key.SpellTags.Any(movementSpells.Contains))
                            {
                                if (hero.HealthPercent < 25 && hero.CountEnemiesInRange(600) > 0)
                                {
                                    Console.WriteLine("Cast esacpe location: " + spell.Key.Slot);
                                    ObjectManager.Player.Spellbook.CastSpell(spell.Key.Slot, hero.Position.Extend(ARAMSimulator.fromNex.Position, 1235));
                                    return;
                                }
                                else
                                {
                                    var bTarg = ARAMTargetSelector.getBestTarget(spell.Value.Range, true);
                                    if (bTarg != null && safeGap(hero.Position.Extend(bTarg.Position, spell.Key.Range).To2D()))
                                    {
                                        if (spell.Value.CastIfHitchanceEquals(bTarg, HitChance.VeryHigh))
                                        {
                                            Console.WriteLine("Cast attack location gap: " + spell.Key.Slot);
                                            return;
                                        }
                                    }
                                }
                            }
                            else
                            {
                                var bTarg = ARAMTargetSelector.getBestTarget(spell.Value.Range, true);
                                if (bTarg != null)
                                {
                                    if (spell.Value.CastIfHitchanceEquals(bTarg, HitChance.VeryHigh))
                                    {
                                        Console.WriteLine("Cast attack location gap: " + spell.Key.Slot);
                                        return;
                                    }
                                }
                            }
                        }
                        else
                        {
                            if (spell.Key.CastType.Contains(CastType.Self) || spell.Key.CastType.Contains(CastType.Activate))
                            {
                                if (ObjectManager.Player.ChampionName.ToLower().Contains("sivir") && spell.Key.Slot == SpellSlot.E)
                                {
                                    continue;
                                }
                                var bTarg = ARAMTargetSelector.getBestTarget(spell.Value.Range, true);
                                if (bTarg != null)
                                {
                                    Console.WriteLine("Cast self: " + spell.Key.Slot);
                                    ObjectManager.Player.Spellbook.CastSpell(spell.Key.Slot);
                                    return;
                                }
                            }
                            else if (spell.Key.CastType.Contains(CastType.AllyChampions) && spell.Key.SpellTags != null && spell.Key.SpellTags.Any(supportSpells.Contains))
                            {
                                var bTarg = ARAMTargetSelector.getBestTargetAly(spell.Value.Range, false);
                                if (bTarg != null && bTarg.IsAlly && bTarg.IsValid <AIHeroClient>())
                                {
                                    Console.WriteLine("Cast ally: " + spell.Key.Slot);
                                    ObjectManager.Player.Spellbook.CastSpell(spell.Key.Slot, bTarg);
                                    return;
                                }
                            }
                            else if (spell.Key.CastType.Contains(CastType.EnemyChampions))
                            {
                                var bTarg = ARAMTargetSelector.getBestTarget(spell.Value.Range, true);
                                if (bTarg != null)
                                {
                                    if (!(spell.Key.SpellTags != null && spell.Key.SpellTags.Any(movementSpells.Contains)) || safeGap(bTarg))
                                    {
                                        Console.WriteLine("Cast enemy: " + spell.Key.Slot);
                                        ObjectManager.Player.Spellbook.CastSpell(spell.Key.Slot, bTarg);
                                        return;
                                    }
                                }
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }