Esempio n. 1
0
        private static void Drawing_OnEndScene(EventArgs args)
        {
            Drawing.DrawText(
                Drawing.Width * 0.01f,
                Drawing.Height * 0.025f,
                System.Drawing.Color.White,
                "AllyTeamTotal: " + (int)Misc.TeamTotal(Player.Instance.ServerPosition) + " | EnemyTeamTotal: "
                + (int)Misc.TeamTotal(Player.Instance.ServerPosition, true) + " | MoveTo: " + Moveto + " | ActiveMode: " + Orbwalker.ActiveModesFlags
                + " | Alone: " + Brain.Alone() + " | AttackObject: " + ModesManager.AttackObject + " | LastTurretAttack: "
                + (Core.GameTickCount - Brain.LastTurretAttack) + " | SafeToDive: " + Misc.SafeToDive);

            Drawing.DrawText(
                Game.CursorPos.WorldToScreen().X + 50,
                Game.CursorPos.WorldToScreen().Y,
                System.Drawing.Color.Goldenrod,
                (Misc.TeamTotal(Game.CursorPos) - Misc.TeamTotal(Game.CursorPos, true)).ToString(),
                5);

            foreach (var hr in ObjectsManager.HealthRelics.Where(h => h.IsValid))
            {
                Circle.Draw(Color.White, hr.BoundingRadius * 2, hr.Position);
            }

            foreach (var trap in ObjectsManager.EnemyTraps)
            {
                Circle.Draw(Color.White, trap.BoundingRadius * 3, trap.Position);
            }

            if (Pathing.Position != null && Pathing.Position != Vector3.Zero)
            {
                Circle.Draw(Color.White, 100, Pathing.Position);
            }

            foreach (var spell in ModesManager.Spelllist)
            {
                Circle.Draw(Color.Chartreuse, spell.Range, Player.Instance);
            }
        }
Esempio n. 2
0
        /// <summary>
        ///     Picking best Position to move to.
        /// </summary>
        public static void BestPosition()
        {
            if (ObjectsManager.ClosestAlly != null && ObjectsManager.ClosestAlly.Distance(Player.Instance) > 2500)
            {
                Teleport.Cast();
            }

            if (TeamFight)
            {
                LastTeamFight = Core.GameTickCount;
            }

            // If player is Zombie moves follow nearest Enemy.
            if (Player.Instance.IsZombie())
            {
                if (ObjectsManager.NearestEnemy != null)
                {
                    Program.Moveto = "NearestEnemy";
                    Position       = ObjectsManager.NearestEnemy.PredictPosition();
                    return;
                }
                if (ObjectsManager.NearestEnemyMinion != null)
                {
                    Program.Moveto = "NearestEnemyMinion";
                    Position       = ObjectsManager.NearestEnemyMinion.PredictPosition();
                    return;
                }
            }

            // Hunting Bard chimes kappa.
            if (Player.Instance.Hero == Champion.Bard && ObjectsManager.BardChime != null && ObjectsManager.BardChime.Distance(Player.Instance) <= 600)
            {
                Program.Moveto = "BardChime";
                Position       = ObjectsManager.BardChime.Position.Random();
                return;
            }

            // Moves to HealthRelic if the bot needs heal.
            if ((Player.Instance.HealthPercent <= HealthRelicHP || (Player.Instance.ManaPercent <= HealthRelicMP && !Player.Instance.IsNoManaHero())) && ObjectsManager.HealthRelic != null &&
                ((DontStealHR && !EntityManager.Heroes.Allies.Any(a => Player.Instance.Health > a.Health && a.Path.LastOrDefault().IsInRange(ObjectsManager.HealthRelic, ObjectsManager.HealthRelic.BoundingRadius + a.BoundingRadius) && !a.IsMe && a.IsValidTarget() && !a.IsDead)) || !DontStealHR))
            {
                var formana = Player.Instance.ManaPercent < HealthRelicMP && !Player.Instance.IsNoManaHero();
                var rect    = new Geometry.Polygon.Rectangle(Player.Instance.ServerPosition, ObjectsManager.HealthRelic.Position, 375);
                if (ObjectsManager.EnemyTurret != null)
                {
                    var Circle = new Geometry.Polygon.Circle(ObjectsManager.EnemyTurret.ServerPosition, ObjectsManager.EnemyTurret.GetAutoAttackRange());
                    if ((!Circle.Points.Any(p => rect.IsInside(p)) || Circle.Points.Any(p => rect.IsInside(p)) && SafeToDive) && !EntityManager.Heroes.Enemies.Any(e => rect.IsInside(e.PredictPosition()) && e.IsValidTarget() && !e.IsDead))
                    {
                        if (ObjectsManager.HealthRelic.Name.Contains("Bard"))
                        {
                            if (!formana)
                            {
                                Program.Moveto = "BardShrine";
                                Position       = ObjectsManager.HealthRelic.Position;
                                return;
                            }
                        }
                        else
                        {
                            Program.Moveto = "HealthRelic";
                            Position       = ObjectsManager.HealthRelic.Position;
                            return;
                        }
                    }
                }
                else
                {
                    if (!EntityManager.Heroes.Enemies.Any(e => rect.IsInside(e.PredictPosition()) && e.IsValidTarget() && !e.IsDead))
                    {
                        if (ObjectsManager.HealthRelic.Name.Contains("Bard"))
                        {
                            if (!formana)
                            {
                                Program.Moveto = "BardShrine2";
                                Position       = ObjectsManager.HealthRelic.Position;
                                return;
                            }
                        }
                        else
                        {
                            Program.Moveto = "HealthRelic2";
                            Position       = ObjectsManager.HealthRelic.Position;
                            return;
                        }
                    }
                }
            }

            // Pick Thresh Lantern
            if (Player.Instance.HealthPercent <= 50 && ObjectsManager.ThreshLantern != null && ObjectsManager.ThreshLantern.Distance(Player.Instance) <= 800)
            {
                if (Player.Instance.Distance(ObjectsManager.ThreshLantern) > 300)
                {
                    Program.Moveto = "ThreshLantern";
                    Position       = ObjectsManager.ThreshLantern.Position.Random();
                }
                else
                {
                    Player.UseObject(ObjectsManager.ThreshLantern);
                }
                return;
            }

            if (ObjectsManager.DravenAxe != null)
            {
                Program.Moveto = "DravenAxe";
                Position       = ObjectsManager.DravenAxe.Position;
                return;
            }

            // Moves to the Farthest Ally if the bot has Autsim
            if (Brain.Alone() && ObjectsManager.FarthestAllyToFollow != null && Player.Instance.Distance(ObjectsManager.AllySpawn) <= 3000)
            {
                Program.Moveto = "FarthestAllyToFollow";
                Position       = ObjectsManager.FarthestAllyToFollow.PredictPosition().Random();
                return;
            }

            // Stays Under tower if the bot health under 10%.
            if ((ModesManager.Flee || (Player.Instance.HealthPercent < 10 && Player.Instance.CountAlliesInRange(3000) < 3)) && EntityManager.Heroes.Enemies.Count(e => !e.IsDead && e.IsValidTarget(SafeValue + 200)) > 0)
            {
                if (ObjectsManager.SafeAllyTurret != null)
                {
                    Program.Moveto = "SafeAllyTurret";
                    Position       = ObjectsManager.SafeAllyTurret.PredictPosition().Random().Extend(ObjectsManager.AllySpawn.Position.Random(), 400).To3D();
                    return;
                }
                if (ObjectsManager.AllySpawn != null)
                {
                    Program.Moveto = "AllySpawn";
                    Position       = ObjectsManager.AllySpawn.Position.Random();
                    return;
                }
            }

            // Moves to AllySpawn if the bot is diving and it's not safe to dive.
            if (((Player.Instance.UnderEnemyTurret() && !SafeToDive) || Core.GameTickCount - Brain.LastTurretAttack < 2000) && ObjectsManager.AllySpawn != null)
            {
                Program.Moveto = "AllySpawn2";
                Position       = ObjectsManager.AllySpawn.Position.Random();
                return;
            }

            if (Player.Instance.IsMelee)
            {
                MeleeLogic();
            }
            else
            {
                RangedLogic();
            }
        }
Esempio n. 3
0
        private static void Drawing_OnEndScene(EventArgs args)
        {
            try
            {
                if (CrashAIODetected)
                {
                    return;
                }

                if (!Loaded)
                {
                    text.TextValue = $"AramBuddy Starting in: {(int)((Timer*1000 + TimeToStart - Game.Time*1000)/1000) + 1}";
                    text.Position  = new Vector2(Drawing.Width * 0.3f, Drawing.Height * 0.2f);
                    text.Draw();
                    return;
                }

                if (Orbwalker.DisableMovement && !MainCore.Logics.Casting.SpecialChamps.IsCastingImportantSpell)
                {
                    text.TextValue = "YOUR ORBWALKER IS DISABLED\nTHE BOT WILL NOT WORK\nMAKE SURE TO UNTICK\nDISABLE MOVING TO MOUSE";
                    text.Position  = new Vector2(Drawing.Width * 0.3f, Drawing.Height * 0.2f);
                    text.Draw();
                }

                if (!EnableDebug)
                {
                    return;
                }

                var AllyTeamTotal         = " | AllyTeamTotal: " + (int)Misc.TeamTotal(Player.Instance.PredictPosition());
                var EnemyTeamTotal        = " | EnemyTeamTotal: " + (int)Misc.TeamTotal(Player.Instance.PredictPosition(), true);
                var MoveTo                = " | MoveTo: " + Moveto;
                var ActiveMode            = " | ActiveMode: " + ModesManager.CurrentMode;
                var Alone                 = " | Alone: " + Brain.Alone();
                var AttackObject          = " | AttackObject: " + ModesManager.AttackObject;
                var LastTurretAttack      = " | LastTurretAttack: " + (Core.GameTickCount - Brain.LastTurretAttack);
                var SafeToDive            = " | SafeToDive: " + Misc.SafeToDive;
                var castingimportantspell = " | IsCastingImportantSpell: " + MainCore.Logics.Casting.SpecialChamps.IsCastingImportantSpell;
                var lagging               = " | Lagging: " + Brain.Lagging;
                var normalbing            = " | NormalPing: " + Brain.NormalPing;
                var SafeToAttack          = " | SafeToAttack: " + Misc.SafeToAttack;
                var IsSafe                = /*" | IsSafe: " + (Player.Instance.IsSafe() && Pathing.Position.IsSafe())*/ "";
                var LastTeamFight         = " | LastTeamFight: " + (int)(Core.GameTickCount - Brain.LastTeamFight);
                var MovementCommands      = " | Movement Commands Issued: " + MoveToCommands;
                var nextitem              = " | Next Item: " + AutoShop.Sequences.Buy.CurrentItemIndex + " - " + AutoShop.Sequences.Buy.NextItem + " | Value: " + AutoShop.Sequences.Buy.NextItemValue;
                var fullbuild             = " | FullBuild: " + AutoShop.Sequences.Buy.FullBuild;

                Drawing.DrawText(Drawing.Width * 0.2f, Drawing.Height * 0.025f, System.Drawing.Color.White,
                                 AllyTeamTotal + EnemyTeamTotal + "\n"
                                 + ActiveMode + Alone + AttackObject + "\n"
                                 + SafeToDive + SafeToAttack + IsSafe + "\n"
                                 + castingimportantspell + lagging + normalbing + "\n"
                                 + LastTurretAttack + LastTeamFight + "\n"
                                 + MovementCommands + MoveTo + "\n"
                                 + nextitem + fullbuild + "\n");

                Drawing.DrawText(
                    Game.CursorPos.WorldToScreen().X + 50,
                    Game.CursorPos.WorldToScreen().Y,
                    System.Drawing.Color.Goldenrod,
                    (Misc.TeamTotal(Game.CursorPos) - Misc.TeamTotal(Game.CursorPos, true)).ToString(CultureInfo.CurrentCulture) + "\n"
                    /*+ "KDA: " + Player.Instance.KDA() +" [" + Player.Instance.ChampionsKilled + ", " + Player.Instance.Assists + ", " + Player.Instance.Deaths + "]"*/,
                    5);

                foreach (var hr in ObjectsManager.HealthRelics.Where(h => h.IsValid && !h.IsDead))
                {
                    Circle.Draw(Color.GreenYellow, hr.BoundingRadius + Player.Instance.BoundingRadius, hr.Position);
                }

                if (Pathing.Position != null && Pathing.Position != Vector3.Zero && Pathing.Position.IsValid())
                {
                    Circle.Draw(Color.White, 100, Pathing.Position);
                }

                if (!DisableSpellsCasting && ModesManager.Spelllist != null)
                {
                    foreach (var spell in ModesManager.Spelllist.Where(s => s != null))
                    {
                        Circle.Draw(spell.IsReady() ? Color.Chartreuse : Color.OrangeRed, (spell as Spell.Chargeable)?.MaximumRange ?? spell.Range, Player.Instance);
                    }
                }

                if (PickBardChimes)
                {
                    foreach (var chime in ObjectsManager.BardChimes.Where(c => Player.Instance.Hero == Champion.Bard && c.IsValid && !c.IsDead))
                    {
                        Circle.Draw(Color.Goldenrod, chime.BoundingRadius + Player.Instance.BoundingRadius, chime.Position);
                    }
                }

                if (EnableEvade)
                {
                    foreach (var trap in ObjectsManager.EnemyTraps)
                    {
                        Circle.Draw(Color.OrangeRed, trap.Trap.BoundingRadius * 3, trap.Trap.Position);
                    }

                    /*
                     * foreach (var p in KappaEvade.dangerPolygons)
                     * {
                     *  p.Draw(System.Drawing.Color.AliceBlue, 2);
                     * }*/
                }

                if (Player.Instance.Hero == Champion.Zac)
                {
                    ObjectsManager.ZacPassives.ForEach(p => Circle.Draw(Color.AliceBlue, 100, p));
                }
            }
            catch (Exception ex)
            {
                Logger.Send("Program Error At Drawing_OnEndScene", ex, Logger.LogLevel.Error);
            }
        }
Esempio n. 4
0
        /// <summary>
        ///     Picking best Position to move to.
        /// </summary>
        public static void BestPosition()
        {
            if (EnableTeleport && ObjectsManager.ClosestAlly != null)
            {
                Program.Moveto = "Teleporting";
                Teleport.Cast();
            }

            // If player is Zombie moves follow nearest Enemy.
            if (Player.Instance.IsZombie())
            {
                var ZombieTarget = TargetSelector.GetTarget(1000, DamageType.True);
                if (ZombieTarget != null)
                {
                    Program.Moveto = "ZombieTarget";
                    Position       = ZombieTarget.PredictPosition();
                    return;
                }
                if (ObjectsManager.NearestEnemy != null)
                {
                    Program.Moveto = "NearestEnemy";
                    Position       = ObjectsManager.NearestEnemy.PredictPosition();
                    return;
                }
                if (ObjectsManager.NearestEnemyMinion != null)
                {
                    Program.Moveto = "NearestEnemyMinion";
                    Position       = ObjectsManager.NearestEnemyMinion.PredictPosition();
                    return;
                }
            }

            // Feeding Poros
            if (ObjectsManager.ClosesetPoro != null)
            {
                var porosnax = new Item(2052);
                if (porosnax != null && porosnax.IsOwned(Player.Instance) && porosnax.IsReady())
                {
                    porosnax.Cast(ObjectsManager.ClosesetPoro);
                    Logger.Send("Feeding ClosesetPoro");
                }
            }

            // Hunting Bard chimes kappa.
            if (PickBardChimes && ObjectsManager.BardChime != null)
            {
                Program.Moveto = "BardChime";
                Position       = ObjectsManager.BardChime.Position.Random();
                return;
            }

            // Moves to HealthRelic if the bot needs heal.
            if ((Player.Instance.PredictHealthPercent() <= HealthRelicHP || (Player.Instance.ManaPercent <= HealthRelicMP && !Player.Instance.IsNoManaHero())) && ObjectsManager.HealthRelic != null &&
                ((DontStealHR && !EntityManager.Heroes.Allies
                  .Any(a => Player.Instance.PredictHealth() > a.PredictHealth() && a.Path.LastOrDefault().IsInRange(ObjectsManager.HealthRelic, ObjectsManager.HealthRelic.BoundingRadius + a.BoundingRadius) &&
                       !a.IsMe && a.IsValidTarget())) || !DontStealHR))
            {
                var formana = Player.Instance.ManaPercent < HealthRelicMP && !Player.Instance.IsNoManaHero();
                var rect    = new Geometry.Polygon.Rectangle(Player.Instance.ServerPosition, ObjectsManager.HealthRelic.Position, 375);
                if (ObjectsManager.EnemyTurret != null)
                {
                    var Circle = new Geometry.Polygon.Circle(ObjectsManager.EnemyTurret.ServerPosition, ObjectsManager.EnemyTurret.GetAutoAttackRange());
                    if ((!Circle.Points.Any(p => rect.IsInside(p)) || Circle.Points.Any(p => rect.IsInside(p)) && SafeToDive) && !EntityManager.Heroes.Enemies.Any(e => rect.IsInside(e.PredictPosition()) && e.IsValid && !e.IsDead))
                    {
                        if (ObjectsManager.HealthRelic.Name.Contains("Bard"))
                        {
                            if (!formana)
                            {
                                Program.Moveto = "BardShrine";
                                Position       = ObjectsManager.HealthRelic.Position;
                                return;
                            }
                        }
                        else
                        {
                            Program.Moveto = "HealthRelic";
                            Position       = ObjectsManager.HealthRelic.Position;
                            return;
                        }
                    }
                }
                else
                {
                    if (!EntityManager.Heroes.Enemies.Any(e => rect.IsInside(e.PredictPosition()) && e.IsValid && !e.IsDead))
                    {
                        if (ObjectsManager.HealthRelic.Name.Contains("Bard"))
                        {
                            if (!formana)
                            {
                                Program.Moveto = "BardShrine2";
                                Position       = ObjectsManager.HealthRelic.Position;
                                return;
                            }
                        }
                        else
                        {
                            Program.Moveto = "HealthRelic2";
                            Position       = ObjectsManager.HealthRelic.Position;
                            return;
                        }
                    }
                }
            }

            // Pick Thresh Lantern
            if (ObjectsManager.ThreshLantern != null)
            {
                if (Player.Instance.Distance(ObjectsManager.ThreshLantern) > 300)
                {
                    Program.Moveto = "ThreshLantern";
                    Position       = ObjectsManager.ThreshLantern.Position.Random();
                }
                else
                {
                    Program.Moveto = "ThreshLantern";
                    Player.UseObject(ObjectsManager.ThreshLantern);
                }
                return;
            }

            if (PickDravenAxe && ObjectsManager.DravenAxe != null)
            {
                Program.Moveto = "DravenAxe";
                Position       = ObjectsManager.DravenAxe.Position;
                return;
            }

            if (PickZacBlops && ObjectsManager.ZacBlop != null)
            {
                Program.Moveto = "ZacBlop";
                Position       = ObjectsManager.ZacBlop.Position;
                return;
            }

            /* fix core pls not working :pepe:
             * if (PickCorkiBomb && ObjectsManager.CorkiBomb != null)
             * {
             *  Program.Moveto = "CorkiBomb";
             *  if (Player.Instance.IsInRange(ObjectsManager.CorkiBomb, 300))
             *  {
             *      Program.Moveto = "UsingCorkiBomb";
             *      Player.UseObject(ObjectsManager.CorkiBomb);
             *  }
             *  Position = ObjectsManager.CorkiBomb.Position;
             *  return;
             * }*/

            // Moves to the Farthest Ally if the bot has Autsim
            if (Brain.Alone() && ObjectsManager.FarthestAllyToFollow != null && Player.Instance.Distance(ObjectsManager.AllySpawn) <= 3000)
            {
                Program.Moveto = "FarthestAllyToFollow";
                Position       = ObjectsManager.FarthestAllyToFollow.PredictPosition().Random();
                return;
            }

            // Stays Under tower if the bot health under 10%.
            if ((ModesManager.CurrentMode == ModesManager.Modes.Flee || (Player.Instance.PredictHealthPercent() < 10 && Player.Instance.CountAllyHeros(SafeValue + 2000) < 3)) &&
                EntityManager.Heroes.Enemies.Count(e => e.IsValid && !e.IsDead && e.IsInRange(Player.Instance, SafeValue + 200)) > 0)
            {
                if (ObjectsManager.SafeAllyTurret != null)
                {
                    Program.Moveto = "SafeAllyTurretFlee";
                    Position       = ObjectsManager.SafeAllyTurret.PredictPosition().Random().Extend(ObjectsManager.AllySpawn.Position.Random(), 400).To3D();
                    return;
                }
                if (ObjectsManager.AllySpawn != null)
                {
                    Program.Moveto = "AllySpawnFlee";
                    Position       = ObjectsManager.AllySpawn.Position.Random();
                    return;
                }
            }

            // Moves to AllySpawn if the bot is diving and it's not safe to dive.
            if (((Player.Instance.UnderEnemyTurret() && !SafeToDive) || Core.GameTickCount - Brain.LastTurretAttack < 2000) && ObjectsManager.AllySpawn != null)
            {
                Program.Moveto = "AllySpawn2";
                Position       = ObjectsManager.AllySpawn.Position.Random();
                return;
            }

            if (Player.Instance.GetAutoAttackRange() < 425)
            {
                MeleeLogic();
            }
            else
            {
                RangedLogic();
            }
        }
Esempio n. 5
0
        private static void Drawing_OnEndScene(EventArgs args)
        {
            try
            {
                if (Orbwalker.DisableMovement)
                {
                    text.TextValue = "YOUR ORBWALKER IS DISABLED";
                    text.Position  = new Vector2(Drawing.Width * 0.3f, Drawing.Height * 0.2f);
                    text.Draw();
                    text.TextValue = "THE BOT WILL NOT WORK";
                    text.Position  = new Vector2(Drawing.Width * 0.3f, Drawing.Height * 0.25f);
                    text.Draw();
                    text.TextValue = "MAKE SURE TO UNTICK";
                    text.Position  = new Vector2(Drawing.Width * 0.3f, Drawing.Height * 0.3f);
                    text.Draw();
                    text.TextValue = "DISABLE MOVING TO MOUSE";
                    text.Position  = new Vector2(Drawing.Width * 0.3f, Drawing.Height * 0.35f);
                    text.Draw();
                }

                if (!EnableDebug)
                {
                    return;
                }
                var AllyTeamTotal    = " | AllyTeamTotal: " + (int)Misc.TeamTotal(Player.Instance.PredictPosition());
                var EnemyTeamTotal   = " | EnemyTeamTotal: " + (int)Misc.TeamTotal(Player.Instance.PredictPosition(), true);
                var MoveTo           = " | MoveTo: " + Moveto;
                var ActiveMode       = " | ActiveMode: " + Orbwalker.ActiveModesFlags;
                var Alone            = " | Alone: " + Brain.Alone();
                var AttackObject     = " | AttackObject: " + ModesManager.AttackObject;
                var LastTurretAttack = " | LastTurretAttack: " + (Core.GameTickCount - Brain.LastTurretAttack);
                var SafeToDive       = " | SafeToDive: " + Misc.SafeToDive;
                var LastTeamFight    = " | LastTeamFight: " + (int)(Core.GameTickCount - Pathing.LastTeamFight);
                var MovementCommands = " | Movement Commands Issued: " + MoveToCommands;
                var nextitem         = " | Next Item: " + AutoShop.Sequences.Buy.NextItem + " | Value: " + AutoShop.Sequences.Buy.NextItemValue;

                Drawing.DrawText(Drawing.Width * 0.2f, Drawing.Height * 0.025f, System.Drawing.Color.White, AllyTeamTotal + EnemyTeamTotal);

                Drawing.DrawText(Drawing.Width * 0.2f, Drawing.Height * 0.04f, System.Drawing.Color.White, ActiveMode + Alone + AttackObject + SafeToDive);
                Drawing.DrawText(Drawing.Width * 0.2f, Drawing.Height * 0.055f, System.Drawing.Color.White, LastTurretAttack + LastTeamFight);

                Drawing.DrawText(Drawing.Width * 0.2f, Drawing.Height * 0.07f, System.Drawing.Color.White, MovementCommands + MoveTo);

                Drawing.DrawText(Drawing.Width * 0.2f, Drawing.Height * 0.085f, System.Drawing.Color.White, nextitem);

                Drawing.DrawText(
                    Game.CursorPos.WorldToScreen().X + 50,
                    Game.CursorPos.WorldToScreen().Y,
                    System.Drawing.Color.Goldenrod,
                    (Misc.TeamTotal(Game.CursorPos) - Misc.TeamTotal(Game.CursorPos, true)).ToString(CultureInfo.CurrentCulture),
                    5);

                foreach (var hr in ObjectsManager.HealthRelics.Where(h => h.IsValid && !h.IsDead))
                {
                    Circle.Draw(Color.White, hr.BoundingRadius * 2, hr.Position);
                }

                foreach (var trap in ObjectsManager.EnemyTraps)
                {
                    Circle.Draw(Color.White, trap.Trap.BoundingRadius * 2, trap.Trap.Position);
                }

                if (Pathing.Position != null && Pathing.Position != Vector3.Zero && Pathing.Position.IsValid())
                {
                    Circle.Draw(Color.White, 100, Pathing.Position);
                }

                foreach (var spell in ModesManager.Spelllist.Where(s => s != null))
                {
                    Circle.Draw(Color.Chartreuse, spell.Range, Player.Instance);
                }

                foreach (var chime in ObjectsManager.BardChimes.Where(c => Player.Instance.Hero == Champion.Bard && c.IsValid && !c.IsDead))
                {
                    Circle.Draw(Color.White, chime.BoundingRadius * 2, chime.Position);
                }
            }
            catch (Exception ex)
            {
                Logger.Send("Program Error At Drawing_OnEndScene", ex, Logger.LogLevel.Error);
            }
        }
Esempio n. 6
0
        /// <summary>
        ///     Picking best Position to move to.
        /// </summary>
        public static Vector3 BestPosition()
        {
            if (EnableTeleport && ObjectsManager.ClosestAlly != null)
            {
                Program.Moveto = "Teleporting";
                Teleport.Cast();
            }

            // If player is Zombie moves follow nearest Enemy.
            if (Player.Instance.IsZombie())
            {
                var ZombieTarget = TargetSelector.GetTarget(1000, DamageType.Mixed);
                if (ZombieTarget != null)
                {
                    Program.Moveto = "ZombieTarget";
                    Position       = ZombieTarget.PredictPosition();
                    return(Position);
                }
                if (ObjectsManager.NearestEnemy != null)
                {
                    Program.Moveto = "NearestEnemy";
                    Position       = ObjectsManager.NearestEnemy.PredictPosition();
                    return(Position);
                }
                if (ObjectsManager.NearestEnemyMinion != null)
                {
                    Program.Moveto = "NearestEnemyMinion";
                    Position       = ObjectsManager.NearestEnemyMinion.PredictPosition();
                    return(Position);
                }
            }

            // Feeding Poros
            var poro = ObjectsManager.ClosesetPoro;

            if (poro != null)
            {
                var porosnax = new Item(2052);
                if (porosnax != null && porosnax.IsOwned(Player.Instance) && porosnax.IsReady())
                {
                    porosnax.Cast(poro);
                    Logger.Send("Feeding ClosesetPoro");
                }
            }

            // Moves to HealthRelic if the bot needs heal.
            var needHR      = Player.Instance.PredictHealthPercent() <= HealthRelicHP || Player.Instance.ManaPercent <= HealthRelicMP && !Player.Instance.IsNoManaHero();
            var healthRelic = ObjectsManager.HealthRelic;

            if (needHR && healthRelic != null)
            {
                var allyneedHR = EntityManager.Heroes.Allies.Any(a => !a.IsMe && Player.Instance.PredictHealth() > a.PredictHealth() &&
                                                                 a.Path.LastOrDefault(p => p.IsInRange(healthRelic, a.BoundingRadius + healthRelic.BoundingRadius)) != null);

                if (!allyneedHR && DontStealHR || !DontStealHR)
                {
                    var safeHR = Player.Instance.SafePath(healthRelic) || Player.Instance.Distance(healthRelic) <= 200;
                    if (safeHR)
                    {
                        var formana = Player.Instance.ManaPercent <= HealthRelicMP && !Player.Instance.IsNoManaHero();
                        if (healthRelic.Name.Contains("Bard") && !formana)
                        {
                            Program.Moveto = "BardShrine";
                            Position       = healthRelic.Position.Random(MyHero.Instance.BoundingRadius);
                            return(Position);
                        }
                        Program.Moveto = "HealthRelic";
                        Position       = healthRelic.Position.Random(MyHero.Instance.BoundingRadius);
                        return(Position);
                    }
                }
            }

            // Hunting Bard chimes kappa.
            var BardChime = ObjectsManager.BardChime;

            if (PickBardChimes && BardChime != null)
            {
                Program.Moveto = "BardChime";
                Position       = BardChime.Position.Random(MyHero.Instance.BoundingRadius);
                return(Position);
            }

            // Pick Thresh Lantern
            var ThreshLantern = ObjectsManager.ThreshLantern;

            if (ThreshLantern != null)
            {
                if (Player.Instance.Distance(ThreshLantern) > 300)
                {
                    Program.Moveto = "ThreshLantern";
                    Position       = ThreshLantern.Position.Random();
                }
                else
                {
                    Program.Moveto = "ThreshLantern";
                    Player.UseObject(ThreshLantern);
                }
                return(Position);
            }

            if (PickDravenAxe && ObjectsManager.DravenAxe != null)
            {
                Program.Moveto = "DravenAxe";
                Position       = ObjectsManager.DravenAxe.Position;
                return(Position);
            }

            if (PickOlafAxe && ObjectsManager.OlafAxe != null)
            {
                Program.Moveto = "OlafAxe";
                Position       = ObjectsManager.OlafAxe.Position;
                return(Position);
            }

            if (PickZacBlops && ObjectsManager.ZacBlop != null)
            {
                Program.Moveto = "ZacBlop";
                Position       = ObjectsManager.ZacBlop.Position;
                return(Position);
            }

            /* fix core pls not working :pepe:
             * if (PickCorkiBomb && ObjectsManager.CorkiBomb != null)
             * {
             *  Program.Moveto = "CorkiBomb";
             *  if (Player.Instance.IsInRange(ObjectsManager.CorkiBomb, 300))
             *  {
             *      Program.Moveto = "UsingCorkiBomb";
             *      Player.UseObject(ObjectsManager.CorkiBomb);
             *  }
             *  Position = ObjectsManager.CorkiBomb.Position;
             *  return;
             * }*/

            // Moves to the Farthest Ally if the bot has Autsim
            if (Brain.Alone() && ObjectsManager.FarthestAllyToFollow != null && Player.Instance.Distance(ObjectsManager.AllySpawn) <= 3000)
            {
                Program.Moveto = "FarthestAllyToFollow";
                Position       = ObjectsManager.FarthestAllyToFollow.PredictPosition().Random();
                return(Position);
            }

            // Stays Under tower if the bot health under 10%.
            if ((ModesManager.CurrentMode == ModesManager.Modes.Flee || (Player.Instance.PredictHealthPercent() < 10 && Player.Instance.CountAllyHeros(SafeValue + 2000) < 3)) &&
                EntityManager.Heroes.Enemies.Count(e => e.IsValid && !e.IsDead && e.IsInRange(Player.Instance, SafeValue + 200)) > 0)
            {
                if (ObjectsManager.SafeAllyTurret != null)
                {
                    Program.Moveto = "SafeAllyTurretFlee";
                    Position       = ObjectsManager.SafeAllyTurret.PredictPosition().Random().Extend(ObjectsManager.AllySpawn.Position.Random(), 400).To3D();
                    return(Position);
                }
                if (ObjectsManager.AllySpawn != null)
                {
                    Program.Moveto = "AllySpawnFlee";
                    Position       = ObjectsManager.AllySpawn.Position.Random();
                    return(Position);
                }
            }

            // Moves to AllySpawn if the bot is diving and it's not safe to dive.
            if (((Player.Instance.UnderEnemyTurret() && !SafeToDive) || MyHero.TurretAttackingMe) && ObjectsManager.AllySpawn != null)
            {
                Program.Moveto = "AllySpawn2";
                Position       = ObjectsManager.AllySpawn.Position.Random();
                return(Position);
            }

            return(Position = Player.Instance.GetAutoAttackRange() < 425 ? MeleeLogic() : RangedLogic());
        }