예제 #1
0
        private void CastEHero(AIHeroClient target)
        {
            if (E.CanCast(target))
            {
                E.CastIfHitchanceEquals(target, HitChance.High);
                return;
            }
            var pred = Prediction.GetPrediction(
                target, player.ServerPosition.LSDistance(target.ServerPosition) / E.Speed * 1000);

            if (pred.UnitPosition.LSDistance(player.Position) > 1400 || pred.Hitchance < HitChance.High)
            {
                return;
            }
            var collision = E.GetCollision(player.Position.LSTo2D(), new List <Vector2> {
                pred.CastPosition.LSTo2D()
            });

            if (collision.Any(c => c.LSDistance(player) < E.Range) &&
                !CombatHelper.IsCollidingWith(
                    player, pred.CastPosition.LSExtend(player.Position, W.Width + 15), E.Width,
                    new[] { CollisionableObjects.Heroes, CollisionableObjects.Walls }))
            {
                E.Cast(pred.CastPosition);
            }
        }
예제 #2
0
        private void Combo()
        {
            Obj_AI_Hero target = TargetSelector.GetTarget(1500, TargetSelector.DamageType.Physical, true);

            if (config.Item("user", true).GetValue <bool>() && R.IsReady())
            {
                var rTarget = TargetSelector.GetTarget(2500, TargetSelector.DamageType.Physical, true);
                if (!activatedR && !player.IsWindingUp)
                {
                    if (rTarget != null && !rTarget.IsInvulnerable && !rTarget.MagicImmune &&
                        rTarget.Distance(Game.CursorPos) < 300)
                    {
                        if (player.Distance(rTarget) + 100 > Environment.Map.GetPath(player, rTarget.Position) &&
                            (ComboDamage(rTarget) > rTarget.Health &&
                             !CombatHelper.IsCollidingWith(
                                 player, rTarget.Position.Extend(player.Position, player.BoundingRadius + 15),
                                 player.BoundingRadius,
                                 new[] { CollisionableObjects.Heroes, CollisionableObjects.Walls }) &&
                             (ComboDamage(rTarget) - R.GetDamage(rTarget) < rTarget.Health ||
                              rTarget.Distance(player) > 400 || player.HealthPercent < 25) &&
                             rTarget.CountAlliesInRange(2500) + 1 >= rTarget.CountEnemiesInRange(2500)))
                        {
                            R.Cast(target.Position);
                        }
                    }
                }
            }
            if (target == null || target.IsInvulnerable || target.MagicImmune)
            {
                return;
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, ComboDamage(target));
            }
            if (!activatedW && W.IsReady() && config.Item("usew", true).GetValue <bool>())
            {
                if ((DamageTaken > getWShield() / 100 * config.Item("shieldDmg", true).GetValue <Slider>().Value) ||
                    (target.Distance(player) < W.Range && config.Item("usewir", true).GetValue <bool>()))
                {
                    W.Cast(config.Item("packets").GetValue <bool>());
                }
            }
            if (activatedW && config.Item("usew", true).GetValue <bool>() && W.IsReady() &&
                player.Distance(target) < W.Range &&
                (target.Health < W.GetDamage(target) ||
                 (W.IsInRange(target) && !W.IsInRange(Prediction.GetPrediction(target, 0.2f).UnitPosition))))
            {
                W.Cast(config.Item("packets").GetValue <bool>());
            }
            var  comboDmg  = ComboDamage(target);
            var  ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (config.Item("useIgnite", true).GetValue <bool>() &&
                ignitedmg > HealthPrediction.GetHealthPrediction(target, 700) && hasIgnite &&
                !CombatHelper.CheckCriticalBuffs(target))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (activatedP)
            {
                if (Q.IsReady() && player.Distance(target) > Orbwalking.GetRealAutoAttackRange(target))
                {
                    Q.Cast(config.Item("packets").GetValue <bool>());
                }
                return;
            }
            if (Q.IsCharging)
            {
                checkCastedQ(target);
                return;
            }
            if (activatedR)
            {
                return;
            }
            if (config.Item("usee", true).GetValue <bool>() && E.IsReady() && !player.IsWindingUp)
            {
                CastEHero(target);
                return;
            }
            if (config.Item("useq", true).GetValue <bool>() && !player.IsWindingUp)
            {
                castQ(target);
            }
        }
예제 #3
0
        private void Combo()
        {
            if (getCheckBoxItem(menuC, "user") && R.IsReady())
            {
                var rTarget = TargetSelector.GetTarget(2500, DamageType.Physical);
                if (rTarget == null)
                {
                    return;
                }
                if (!activatedR && !Orbwalker.IsAutoAttacking)
                {
                    if (rTarget != null && !rTarget.IsInvulnerable && !rTarget.MagicImmune && rTarget.LSDistance(Game.CursorPos) < 300)
                    {
                        if (player.LSDistance(rTarget) + 100 > Environment.Map.GetPath(player, rTarget.Position) && ComboDamage(rTarget) > rTarget.Health && !CombatHelper.IsCollidingWith(player, rTarget.Position.LSExtend(player.Position, player.BoundingRadius + 15), player.BoundingRadius, new[] { CollisionableObjects.Heroes, CollisionableObjects.Walls }) && (ComboDamage(rTarget) - R.GetDamage(rTarget) < rTarget.Health || rTarget.LSDistance(player) > 400 || player.HealthPercent < 25) && rTarget.CountAlliesInRange(2500) + 1 >= rTarget.CountEnemiesInRange(2500))
                        {
                            R.Cast(rTarget.Position);
                        }
                    }
                }
            }

            var target = TargetSelector.GetTarget(1500, DamageType.Physical);

            if (target == null || target.IsInvulnerable || target.MagicImmune)
            {
                return;
            }
            var data = IncDamages.GetAllyData(player.NetworkId);

            if (!activatedW && W.IsReady() && getCheckBoxItem(menuC, "usew"))
            {
                if (data.DamageTaken > player.Health ||
                    (data.DamageTaken > getWShield() / 100 * getSliderItem(menuC, "shieldDmg")) ||
                    (target.LSDistance(player) < W.Range && getCheckBoxItem(menuC, "usewir")))
                {
                    W.Cast(getCheckBoxItem(config, "packets"));
                }
            }
            if (activatedW && getCheckBoxItem(menuC, "usew") && W.IsReady() &&
                player.LSDistance(target) < W.Range &&
                (target.Health < W.GetDamage(target) ||
                 (W.IsInRange(target) && !W.IsInRange(Prediction.GetPrediction(target, 0.2f).UnitPosition))))
            {
                W.Cast(getCheckBoxItem(config, "packets"));
            }

            var ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            var hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (getCheckBoxItem(menuC, "useIgnite") &&
                ignitedmg > HealthPrediction.GetHealthPrediction(target, 700) && hasIgnite &&
                !CombatHelper.CheckCriticalBuffs(target))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (activatedP)
            {
                if (Q.IsReady() && player.LSDistance(target) > Orbwalking.GetRealAutoAttackRange(target))
                {
                    Q.Cast(getCheckBoxItem(config, "packets"));
                }
                return;
            }

            var qTarget = TargetSelector.GetTarget(!Q.IsCharging ? Q.ChargedMaxRange / 2 : Q.ChargedMaxRange, DamageType.Physical);

            if (qTarget == null && Q.IsCharging)
            {
                ObjectManager.Player.Spellbook.CastSpell(SpellSlot.Q);
            }
            if (Q.IsCharging)
            {
                var start     = ObjectManager.Player.ServerPosition.LSTo2D();
                var end       = start.LSExtend(QCastPos, Q.Range);
                var direction = (end - start).Normalized();
                var normal    = direction.Perpendicular();

                var points = new List <Vector2>();
                var hitBox = qTarget.BoundingRadius;
                points.Add(start + normal * (Q.Width + hitBox));
                points.Add(start - normal * (Q.Width + hitBox));
                points.Add(end + Q.ChargedMaxRange * direction - normal * (Q.Width + hitBox));
                points.Add(end + Q.ChargedMaxRange * direction + normal * (Q.Width + hitBox));

                for (var i = 0; i <= points.Count - 1; i++)
                {
                    var A = points[i];
                    var B = points[i == points.Count - 1 ? 0 : i + 1];

                    if (qTarget.ServerPosition.LSTo2D().LSDistance(A, B, true, true) < 50 * 50)
                    {
                        Q.Cast(qTarget, true);
                    }
                }
                checkCastedQ(target);
                return;
            }
            if (activatedR)
            {
                return;
            }
            if (getCheckBoxItem(menuC, "usee") && E.IsReady() && !Orbwalker.IsAutoAttacking)
            {
                CastEHero(target);
                return;
            }
            if (getCheckBoxItem(menuC, "useq") && !Orbwalker.IsAutoAttacking)
            {
                castQ(target);
            }
            if (!activatedW && W.IsReady() && data.AnyCC)
            {
                W.Cast(getCheckBoxItem(config, "packets"));
            }

            if (getCheckBoxItem(menuC, "userCC") && player.LSDistance(target) < Q.Range &&
                HeroManager.Enemies.FirstOrDefault(e => e.LSDistance(Game.CursorPos) < 300) != null && data.AnyCC)
            {
                R.Cast(Game.CursorPos, getCheckBoxItem(config, "packets"));
            }
        }
예제 #4
0
파일: Sion.cs 프로젝트: riwalry1/AIO
        private void Combo()
        {
            if (activatedR)
            {
                return;
            }
            AIHeroClient target = TargetSelector.GetTarget(1500, DamageType.Physical);

            if (getCheckBoxItem(menuC, "user") && R.IsReady())
            {
                var rTarget = TargetSelector.GetTarget(2500, DamageType.Physical);
                if (!activatedR)
                {
                    if (rTarget != null && !rTarget.IsInvulnerable && !rTarget.MagicImmune &&
                        rTarget.LSDistance(Game.CursorPos) < 300)
                    {
                        if (player.LSDistance(rTarget) + 100 > Environment.Map.GetPath(player, rTarget.Position) &&
                            (ComboDamage(rTarget) > rTarget.Health &&
                             !CombatHelper.IsCollidingWith(
                                 player, rTarget.Position.LSExtend(player.Position, player.BoundingRadius + 15),
                                 player.BoundingRadius,
                                 new[] { CollisionableObjects.Heroes, CollisionableObjects.Walls }) &&
                             (ComboDamage(rTarget) - R.GetDamage(rTarget) < rTarget.Health ||
                              rTarget.LSDistance(player) > 400 || player.HealthPercent < 25) &&
                             rTarget.CountAlliesInRange(2500) + 1 >= rTarget.LSCountEnemiesInRange(2500)))
                        {
                            R.Cast(target.Position);
                        }
                    }
                }
            }

            if (target == null || target.IsInvulnerable || target.MagicImmune)
            {
                return;
            }

            var data = Program.IncDamages.GetAllyData(player.NetworkId);

            if (!activatedW && W.IsReady() && getCheckBoxItem(menuC, "usew") && W.IsInRange(target))
            {
                if (data.DamageTaken > player.Health || (data.DamageTaken > getWShield() / 100 * getSliderItem(menuC, "shieldDmg")) || (target.LSDistance(player) < W.Range && getCheckBoxItem(menuC, "usewir")))
                {
                    W.Cast(getCheckBoxItem(config, "packets"));
                }
            }

            if (activatedW && getCheckBoxItem(menuC, "usew") && W.IsReady() && player.LSDistance(target) < W.Range && (target.Health < W.GetDamage(target) || (W.IsInRange(target) && !W.IsInRange(Prediction.GetPrediction(target, 0.2f).UnitPosition))))
            {
                W.Cast(getCheckBoxItem(config, "packets"));
            }

            if (activatedP)
            {
                if (Q.IsReady() && player.Distance(target) > Orbwalking.GetRealAutoAttackRange(target))
                {
                    Q.Cast(getCheckBoxItem(config, "packets"));
                }
                return;
            }
            if (Q.IsCharging)
            {
                checkCastedQ(target);
                return;
            }
            if (activatedR)
            {
                return;
            }
            if (getCheckBoxItem(menuC, "usee") && E.IsReady() && !ObjectManager.Player.Spellbook.IsAutoAttacking)
            {
                CastEHero(target);
                return;
            }
            if (getCheckBoxItem(menuC, "useq") && !ObjectManager.Player.Spellbook.IsAutoAttacking)
            {
                castQ(target);
            }
            if (!activatedW && W.IsReady() && data.AnyCC)
            {
                W.Cast(getCheckBoxItem(config, "packets"));
            }

            if (getCheckBoxItem(menuC, "userCC") && player.Distance(target) < Q.Range &&
                HeroManager.Enemies.FirstOrDefault(e => e.Distance(Game.CursorPos) < 300) != null && data.AnyCC)
            {
                R.Cast(Game.CursorPos, getCheckBoxItem(config, "packets"));
            }

            var ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            var hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (getCheckBoxItem(menuC, "useIgnite") && ignitedmg > HealthPrediction.GetHealthPrediction(target, 700) && hasIgnite && !CombatHelper.CheckCriticalBuffs(target))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
        }