예제 #1
0
        public static Obj_AI_Turret GetMostCloseTower(this Obj_AI_Base target)
        {
            Obj_AI_Turret tur = null;

            if (target.IsDead)
            {
                return(null);
            }

            foreach (var turret in ObjectManager.Get <Obj_AI_Turret>().Where(t =>
                                                                             t.IsValid && !t.IsDead && t.Health > 1f && t.IsVisible && t.Distance(target) < 1000))
            {
                if (turret != null)
                {
                    if (tur == null)
                    {
                        tur = turret;
                    }
                    else if (tur != null && tur.Distance(target) > turret.Distance(target))
                    {
                        tur = turret;
                    }
                }
            }
            return(tur);
        }
예제 #2
0
        private void castR(Obj_AI_Hero target)
        {
            if (target == null || !target.IsValidTarget(R.Width))
            {
                return;
            }

            Obj_AI_Turret closestTower =
                ObjectManager.Get <Obj_AI_Turret>()
                .Where(tur => tur.IsAlly)
                .OrderBy(tur => tur.Distance(player.Position))
                .First();
            Obj_AI_Hero allyHero =
                ObjectManager.Get <Obj_AI_Hero>().Where(hero => hero.IsAlly).OrderBy(
                    hero => hero.Distance(player.Position)).First();

            if (player.GetSpellDamage(target, SpellSlot.R) - 10 > target.Health && menu.Item("alwaysR").GetValue <bool>())
            {
                R.Cast(target, true);
            }

            switch (menu.Item("throwPos").GetValue <StringList>().SelectedIndex)
            {
            case 0:     // wall
                foreach (
                    Obj_AI_Hero collisionTarget in
                    ObjectManager.Get <Obj_AI_Hero>().Where(hero => hero.IsValidTarget(R.Width)))
                {
                    CastRToCollision(collisionTarget);
                }
                break;

            case 1:     // mouse
                if (R.IsReady())
                {
                    R.Cast(Game.CursorPos.To2D(), true);
                }
                break;

            case 2:     // closest tower
                //TODO: check if will land under turret
                if (closestTower.Distance(target) <= 800 && R.IsReady())
                {
                    R.Cast(closestTower.Position, true);
                }
                break;

            case 3:     // closest ally
                if (allyHero.IsValid && R.IsReady())
                {
                    R.Cast(allyHero.Position, true);
                }
                break;
            }
        }
예제 #3
0
        public void SetAttack()
        {
            AttackableUnit orbTarget = orb.GetTarget();

            if (orbTarget != null)
            {
                if (orbTarget is Obj_AI_Hero)
                {
                    if (!Player.UnderTurret(true))
                    {
                        SetOrbWalk(orbTarget);
                    }
                }
                else if (orbTarget is Obj_AI_Minion)
                {
                    status = "Follow";
                    if (orbTarget.Health <= Player.GetAutoAttackDamage(Player, true))
                    {
                        orb.SetAttack(true);
                        Player.IssueOrder(GameObjectOrder.AttackUnit, orbTarget);
                    }
                }
            }
            else
            {
                status = "Follow";
            }

            lstTurrets = ObjectHandler.Get <Obj_AI_Turret>().Enemies.ToList().FindAll(t => !t.IsDead);
            turret     = lstTurrets.OrderBy(t => t.Distance(Player)).ToList().Count > 0 ? lstTurrets.OrderBy(t => t.Distance(Player)).ToList()[0] : null;

            if (turret != null)
            {
                if (turret.Distance(Player) <= Player.AttackRange)
                {
                    orb.SetAttack(true);
                }
            }
        }
예제 #4
0
        // -------------------------------------------------------------------------------------------------------------------------------------------------------------
        // Flee Mode

        public static void Flee()
        {
            Random Delay = new Random();
            bool   Port;
            IEnumerable <Obj_AI_Turret> Türme = EntityManager.Turrets.Allies.OrderBy(x => x.Distance(SpellOption.Spieler.Position));
            Obj_AI_Turret EntfernterTurm      = null;

            foreach (var Item in Türme)
            {
                if (EntfernterTurm == null)
                {
                    EntfernterTurm = Item;
                }

                if (Item.Distance(SpellOption.Spieler.Position) <= SpellOption.R.Range && Item.Distance(SpellOption.Spieler.Position) > EntfernterTurm.Distance(SpellOption.Spieler.Position) && Item.IsAlive() &&
                    Item.Distance(SpellOption.Spawnpunkt) <= EntfernterTurm.Distance(SpellOption.Spawnpunkt))
                {
                    EntfernterTurm = Item;
                }
            }

            SpellOption.R.IsInRange(EntfernterTurm);

            if (EntfernterTurm.Distance(SpellOption.Spieler.Position) > SpellOption.R.Range || SpellOption.Spieler.Distance(EntfernterTurm) <= EntfernterTurm.AttackRange)
            {
                Port = false;
            }
            else
            {
                Port = true;
            }

            // Port Tower
            if (Port == true)
            {
                if (SpellOption.R.IsReady())
                {
                    SpellOption.R.Cast(EntfernterTurm.Position);
                }

                if (SpellOption.Hourglas.IsOwned() && SpellOption.Hourglas.IsReady() && Menü.Flee["Zhonyas"].Cast <CheckBox>().CurrentValue&& SpellOption.R.IsOnCooldown)
                {
                    Core.DelayAction(() => SpellOption.Hourglas.Cast(), Delay.Next(SpellOption.MinDelay, SpellOption.MaxDelay));
                }
                else if (SpellOption.Seraphen.IsOwned() && SpellOption.Seraphen.IsReady() && Menü.Flee["Seraphen"].Cast <CheckBox>().CurrentValue)
                {
                    Core.DelayAction(() => SpellOption.Seraphen.Cast(), Delay.Next(SpellOption.MinDelay, SpellOption.MaxDelay));
                }
            }

            // Get Shield
            if (SpellOption.R.IsOnCooldown)
            {
                var target = TargetSelector.GetTarget(SpellOption.E.Range, DamageType.Magical);

                if (target != null)
                {
                    var QPred = SpellOption.Q.GetPrediction(target);

                    if (SpellOption.Seraphen.IsOwned() && SpellOption.Seraphen.IsReady() && Menü.Flee["Seraphen"].Cast <CheckBox>().CurrentValue)
                    {
                        Core.DelayAction(() => SpellOption.Seraphen.Cast(), Delay.Next(SpellOption.MinDelay, SpellOption.MaxDelay));
                    }


                    if (target.IsValidTarget(SpellOption.E.Range) && SpellOption.E.IsReady() && SpellOption.Spieler.Mana >= SpellOption.E.ManaCost)
                    {
                        Core.DelayAction(() => SpellOption.E.Cast(target), Delay.Next(SpellOption.MinDelay, SpellOption.MaxDelay));
                    }

                    if (target.IsValidTarget(SpellOption.Q.Range) && SpellOption.Q.IsReady() && QPred.HitChance >= SpellOption.Chance && SpellOption.Spieler.Mana >= SpellOption.Q.ManaCost && SpellOption.Spieler.HasBuff("RyzeQIconFullCharge"))
                    {
                        Core.DelayAction(() => SpellOption.Q.Cast(target), Delay.Next(SpellOption.MinDelay, SpellOption.MaxDelay));
                    }
                }
            }

            // Port Position in Direction of the Base
            if (Port == false)
            {
                Vector3 Punkt = GetPosition();

                if (SpellOption.R.IsReady())
                {
                    SpellOption.R.Cast(Punkt);
                }

                if (SpellOption.Hourglas.IsOwned() && SpellOption.Hourglas.IsReady() && Menü.Flee["Zhonyas"].Cast <CheckBox>().CurrentValue&& SpellOption.R.IsOnCooldown)
                {
                    Core.DelayAction(() => SpellOption.Hourglas.Cast(), Delay.Next(SpellOption.MinDelay, SpellOption.MaxDelay));
                }
                else if (SpellOption.Seraphen.IsOwned() && SpellOption.Seraphen.IsReady() && Menü.Flee["Seraphen"].Cast <CheckBox>().CurrentValue)
                {
                    Core.DelayAction(() => SpellOption.Seraphen.Cast(), Delay.Next(SpellOption.MinDelay, SpellOption.MaxDelay));
                }
            }
        }
예제 #5
0
        public void SetAttack()
        {
            AttackableUnit orbTarget = orb.GetTarget();

            if (orbTarget != null)
            {
                if (orbTarget is Obj_AI_Hero)
                {
                    if (!Player.UnderTurret(true))
                    {
                        SetOrbWalk(orbTarget);
                    }
                }
                else if (orbTarget is Obj_AI_Minion)
                {
                    status = "Follow";
                    if (orbTarget.Health <= Player.GetAutoAttackDamage(Player, true))
                    {
                        orb.SetAttack(true);
                        Player.IssueOrder(GameObjectOrder.AttackUnit, orbTarget);
                    }
                }
            }
            else
                status = "Follow";

            lstTurrets = ObjectHandler.Get<Obj_AI_Turret>().Enemies.ToList().FindAll(t => !t.IsDead);
            turret = lstTurrets.OrderBy(t => t.Distance(Player)).ToList().Count > 0 ? lstTurrets.OrderBy(t => t.Distance(Player)).ToList()[0] : null;

            if (turret != null)
            {

                if (turret.Distance(Player) <= Player.AttackRange)
                {
                    orb.SetAttack(true);
                }

            }
        }
예제 #6
0
        public static bool DangerousTurret(Obj_AI_Turret turret)
        {
            if (!Config.Param <bool>("ylm.towerdive.enabled"))
            {
                return(true);
            }
            var units = ObjectManager.Get <Obj_AI_Base>().Where(o => (o.IsAlly && (o.IsChampion() || o.IsMinion)) && turret.Distance(o, true) <= 900 * 900);

            return(units.Count() >= Config.Param <Slider>("ylm.towerdive.minAllies").Value);
        }
예제 #7
0
        private static Lanes GetLane(Obj_AI_Turret turret)
        {
            if ((turret.Distance(Point1) <= 1500 || turret.Distance(Point2) <= 1500 || turret.Distance(Point3) <= 1500 ||
                 turret.Distance(Point4) <= 1500 || turret.Distance(Point5) <= 1500 || turret.Distance(Point6) <= 1500 ||
                 turret.Distance(Point7) <= 1500 || turret.Distance(Point8) <= 1500 || turret.Distance(Point9) <= 1500 ||
                 turret.Distance(Point10) <= 1500 || turret.Distance(Point11) <= 1500 || turret.Distance(Point12) <= 1500 ||
                 turret.Distance(Point13) <= 1500 || turret.Distance(Point14) <= 1500 || turret.Distance(Point15) <= 1500 ||
                 turret.Distance(Point16) <= 1500 || turret.Distance(Point17) <= 1500 || turret.Distance(Point18) <= 1500 ||
                 turret.Distance(Point19) <= 1500 || turret.Distance(Point20) <= 1500 || turret.Distance(Point21) <= 1500 ||
                 turret.Distance(Point22) <= 1500 || turret.Distance(Point23) <= 1500 || turret.Distance(Point24) <= 1500 ||
                 turret.Distance(Point25) <= 1500))
            {
                return(Lanes.Bot);
            }

            if ((turret.Distance(Pointtop1) <= 1500 || turret.Distance(Pointtop2) <= 1500 || turret.Distance(Pointtop3) <= 1500 ||
                 turret.Distance(Pointtop4) <= 1500 || turret.Distance(Pointtop5) <= 1500 || turret.Distance(Pointtop6) <= 1500 ||
                 turret.Distance(Pointtop7) <= 1500 || turret.Distance(Pointtop8) <= 1500 || turret.Distance(Pointtop9) <= 1500 ||
                 turret.Distance(Pointtop10) <= 1500 || turret.Distance(Pointtop11) <= 1500))
            {
                return(Lanes.Top);
            }

            if (turret.Distance(Pointmid1) <= 800 || turret.Distance(Pointmid2) <= 800 || turret.Distance(Pointmid3) <= 800 ||
                turret.Distance(Pointmid4) <= 800 || turret.Distance(Pointmid5) <= 800 || turret.Distance(Pointmid6) <= 800 ||
                turret.Distance(Pointmid7) <= 800 || turret.Distance(Pointmid8) <= 800 || turret.Distance(Pointmid9) <= 800 ||
                turret.Distance(Pointmid10) <= 800)
            {
                return(Lanes.Mid);
            }
            return(Lanes.Unknown);
        }
예제 #8
0
        private static Lanes GetLane(Obj_AI_Turret turret)
        {
            if ((turret.Distance(Point1) <= 1500 || turret.Distance(Point2) <= 1500 || turret.Distance(Point3) <= 1500 ||
                 turret.Distance(Point4) <= 1500 || turret.Distance(Point5) <= 1500 || turret.Distance(Point6) <= 1500 ||
                 turret.Distance(Point7) <= 1500 || turret.Distance(Point8) <= 1500 || turret.Distance(Point9) <= 1500 ||
                 turret.Distance(Point10) <= 1500 || turret.Distance(Point11) <= 1500 || turret.Distance(Point12) <= 1500 ||
                 turret.Distance(Point13) <= 1500 || turret.Distance(Point14) <= 1500 || turret.Distance(Point15) <= 1500 ||
                 turret.Distance(Point16) <= 1500 || turret.Distance(Point17) <= 1500 || turret.Distance(Point18) <= 1500 ||
                 turret.Distance(Point19) <= 1500 || turret.Distance(Point20) <= 1500 || turret.Distance(Point21) <= 1500 ||
                 turret.Distance(Point22) <= 1500 || turret.Distance(Point23) <= 1500 || turret.Distance(Point24) <= 1500 ||
                 turret.Distance(Point25) <= 1500))
            {
                return Lanes.Bot;
            }

            if ((turret.Distance(Pointtop1) <= 1500 || turret.Distance(Pointtop2) <= 1500 || turret.Distance(Pointtop3) <= 1500 ||
                 turret.Distance(Pointtop4) <= 1500 || turret.Distance(Pointtop5) <= 1500 || turret.Distance(Pointtop6) <= 1500 ||
                 turret.Distance(Pointtop7) <= 1500 || turret.Distance(Pointtop8) <= 1500 || turret.Distance(Pointtop9) <= 1500 ||
                 turret.Distance(Pointtop10) <= 1500 || turret.Distance(Pointtop11) <= 1500))
            {
                return Lanes.Top;
            }

            if (turret.Distance(Pointmid1) <= 800 || turret.Distance(Pointmid2) <= 800 || turret.Distance(Pointmid3) <= 800 ||
                turret.Distance(Pointmid4) <= 800 || turret.Distance(Pointmid5) <= 800 || turret.Distance(Pointmid6) <= 800 ||
                turret.Distance(Pointmid7) <= 800 || turret.Distance(Pointmid8) <= 800 || turret.Distance(Pointmid9) <= 800 ||
                turret.Distance(Pointmid10) <= 800)
            {
                return Lanes.Mid;
            }
            return Lanes.Unknown;
        }
예제 #9
0
        public static bool DangerousTurret(Obj_AI_Turret turret)
        {
            if (!Config.towerDiveMenu["ylm.towerdive.enabled"].Cast <CheckBox>().CurrentValue)
            {
                return(true);
            }
            var units = ObjectManager.Get <Obj_AI_Base>().Where(o => (o.IsAlly && (o is AIHeroClient || o.IsMinion)) && turret.Distance(o, true) <= 900 * 900);

            return(units.Count() >= Config.towerDiveMenu["ylm.towerdive.minAllies"].Cast <Slider>().CurrentValue);
        }