예제 #1
0
 private void Clear()
 {
     if (player.IsWindingUp)
     {
         return;
     }
     if (config.Item("useqLC", true).GetValue <bool>() && Q.IsReady() && !player.IsDashing())
     {
         var minis = MinionManager.GetMinions(player.AttackRange + 50, MinionTypes.All, MinionTeam.NotAlly);
         if (Environment.Minion.countMinionsInrange(player.Position, Q.Range) >=
             config.Item("minimumMini", true).GetValue <Slider>().Value&&
             minis.Count(m => m.Health - Q.GetDamage(m) < 50 && m.Health - Q.GetDamage(m) > 0) == 0 &&
             (!Environment.Minion.KillableMinion(player.AttackRange) || !Orbwalking.CanAttack()))
         {
             Q.Cast();
             return;
         }
     }
     if (config.Item("useeLC", true).GetValue <bool>() && E.IsReady())
     {
         var minionsForE = MinionManager.GetMinions(
             ObjectManager.Player.ServerPosition, E.Range, MinionTypes.All, MinionTeam.NotAlly);
         MinionManager.FarmLocation bestPosition = E.GetLineFarmLocation(minionsForE);
         if (bestPosition.Position.IsValid() &&
             !player.Position.Extend(bestPosition.Position.To3D(), E.Range).UnderTurret(true) &&
             !bestPosition.Position.IsWall())
         {
             if (bestPosition.MinionsHit >= 2)
             {
                 E.Cast(bestPosition.Position);
             }
         }
     }
 }
예제 #2
0
        private void Clear()
        {
            float perc = config.Item("minmana", true).GetValue <Slider>().Value / 100f;

            if (player.Mana < player.MaxMana * perc)
            {
                return;
            }
            if (Q.IsReady() && config.Item("useqLC", true).GetValue <bool>())
            {
                var minions =
                    MinionManager.GetMinions(Q.Range, MinionTypes.All, MinionTeam.NotAlly)
                    .Where(
                        m =>
                        Q.CanCast(m) &&
                        (Q.GetDamage(m) > m.Health || m.Health > player.GetAutoAttackDamage(m) * 5))
                    .OrderByDescending(m => Q.GetDamage(m) > m.Health)
                    .ThenBy(m => m.Distance(player));
                foreach (var mini in minions)
                {
                    if (!Orbwalking.CanAttack() && mini.Distance(player) <= Orbwalking.GetRealAutoAttackRange(mini))
                    {
                        Q.CastOnUnit(mini);
                        return;
                    }
                    if (Orbwalking.CanMove(100) && !player.IsWindingUp &&
                        mini.Distance(player) > Orbwalking.GetRealAutoAttackRange(mini))
                    {
                        Q.CastOnUnit(mini);
                        return;
                    }
                }
            }
        }
예제 #3
0
        private void Clear()
        {
            float perc = config.Item("minmana", true).GetValue <Slider>().Value / 100f;

            if (player.Mana < player.MaxMana * perc)
            {
                return;
            }
            var Qminis     = MinionManager.GetMinions(Q.Range, MinionTypes.All, MinionTeam.NotAlly);
            var jungleMobQ = Qminis.Where(m => m.MaxHealth > 900).OrderByDescending(m => m.MaxHealth).FirstOrDefault();

            if (config.Item("useqLC", true).GetValue <bool>() && Q.IsReady() &&
                (Qminis.Count >= config.Item("qMinHit", true).GetValue <Slider>().Value || jungleMobQ != null ||
                 (Qminis.Count(m => m.Health < Q.GetDamage(m)) > 0 && !Orbwalking.CanAttack())))
            {
                Q.Cast();
            }
            if (config.Item("usewLC", true).GetValue <bool>() && W.IsReady() &&
                (MinionManager.GetMinions(W.Range, MinionTypes.All, MinionTeam.NotAlly).Count >=
                 config.Item("wMinHit", true).GetValue <Slider>().Value || jungleMobQ != null) &&
                Program.IncDamages.GetAllyData(player.NetworkId).DamageTaken > 50 && player.HealthPercent < 98)
            {
                W.Cast();
            }
        }
예제 #4
0
        private void AfterAttack(AttackableUnit unit, AttackableUnit targetO)
        {
            if (!(targetO is Obj_AI_Hero))
            {
                return;
            }
            Obj_AI_Hero    targ             = (Obj_AI_Hero)targetO;
            List <Vector3> passivePositions = GetPassivePositions(targetO);
            bool           rapid            = player.GetAutoAttackDamage(targ) * 3 + ComboDamage(targ) > targ.Health ||
                                              (player.Health < targ.Health && player.Health < player.MaxHealth / 2);

            if (unit.IsMe && E.IsReady() && orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo &&
                (config.Item("usee", true).GetValue <bool>() ||
                 (unit.IsMe && config.Item("RapidAttack", true).GetValue <KeyBind>().Active || rapid)) &&
                !Orbwalking.CanAttack())
            {
                E.Cast(config.Item("packets").GetValue <bool>());
            }
            if (unit.IsMe && orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo && Q.IsReady() &&
                (config.Item("RapidAttack", true).GetValue <KeyBind>().Active || rapid) && !Orbwalking.CanAttack() &&
                passivePositions.Any())
            {
                var passive = GetClosestPassivePosition(targ);
                var pos     = GetQpoint(targ, passive);
                if (pos.IsValid())
                {
                    Q.Cast(pos, config.Item("packets").GetValue <bool>());
                }
                else
                {
                    var pos2 = GetQpoint(targ, Prediction.GetPrediction(targ, 2).UnitPosition);
                    if (pos2.IsValid())
                    {
                        Q.Cast(pos2, config.Item("packets").GetValue <bool>());
                    }
                }
            }
            if (unit.IsMe)
            {
                var         pos    = GetClosestPassivePosition(targetO);
                Obj_AI_Hero target = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
                if (orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo && targetO.NetworkId == target.NetworkId &&
                    R.IsReady() && R.CanCast(target) &&
                    HealthPrediction.GetHealthPrediction(target, 1000) > player.GetAutoAttackDamage(target) &&
                    ComboDamage(target) + player.GetAutoAttackDamage(target) * 5 > target.Health &&
                    ((config.Item("userally", true).GetValue <Slider>().Value <=
                      HeroManager.Allies.Count(
                          a => a.IsValid && !a.IsDead && a.Distance(target) < 600 && a.HealthPercent < 90) &&
                      config.Item("usertf", true).GetValue <bool>()) ||
                     (player.HealthPercent < 75 && config.Item("user", true).GetValue <bool>())))
                {
                    R.CastOnUnit(target, config.Item("packets").GetValue <bool>());
                }
            }
        }
예제 #5
0
        private void LastHitQ()
        {
            if (!Q.IsReady())
            {
                return;
            }
            if (config.Item("useqLC", true).GetValue <bool>() || config.Item("useqLH", true).GetValue <bool>())
            {
                var minions =
                    MinionManager.GetMinions(Q.Range, MinionTypes.All, MinionTeam.NotAlly)
                    .Where(
                        m =>
                        m.Health > 5 &&
                        m.Health <
                        (orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.LastHit
                                    ? Q.GetDamage(m)
                                    : Q.GetDamage(m) * config.Item("qLHDamage", true).GetValue <Slider>().Value / 100) &&
                        Q.CanCast(m) &&
                        HealthPrediction.GetHealthPrediction(m, (int)(m.Distance(player) / Q.Speed * 1000)) > 0);
                if (minions != null && LastAttackedminiMinion != null)
                {
                    foreach (var minion in
                             minions.Where(
                                 m =>
                                 m.NetworkId != LastAttackedminiMinion.NetworkId ||
                                 (m.NetworkId == LastAttackedminiMinion.NetworkId &&
                                  Utils.GameTimeTickCount - LastAttackedminiMinionTime > 700)))
                    {
                        if (minion.Team == GameObjectTeam.Neutral && minion.CountAlliesInRange(500) > 0 &&
                            minion.NetworkId != LastAttackedminiMinion.NetworkId)
                        {
                            continue;
                        }

                        if (minion.Distance(player) <= player.AttackRange && !Orbwalking.CanAttack() &&
                            Orbwalking.CanMove(100))
                        {
                            if (Q.Cast(minion).IsCasted())
                            {
                                Orbwalking.Orbwalker.AddToBlackList(minion.NetworkId);
                            }
                        }
                        else if (minion.Distance(player) > player.AttackRange)
                        {
                            if (Q.Cast(minion).IsCasted())
                            {
                                Orbwalking.Orbwalker.AddToBlackList(minion.NetworkId);
                            }
                        }
                    }
                }
            }
        }
예제 #6
0
        private void Combo()
        {
            Obj_AI_Hero target = TargetSelector.GetTarget(1000, TargetSelector.DamageType.Physical, true);

            if (target == null || target.IsInvulnerable || target.MagicImmune)
            {
                return;
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, ComboDamage(target));
            }
            var  data      = Program.IncDamages.GetAllyData(player.NetworkId);
            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) &&
                (target.Distance(player) > Orbwalking.GetRealAutoAttackRange(target) + 25 || player.HealthPercent < 30) &&
                !justE)
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (Q.CanCast(target) && config.Item("useq", true).GetValue <bool>() &&
                (data.IsAboutToDie || player.HealthPercent < 20 && data.AnyCC) && !R.IsReady() &&
                (!player.HasBuff("UndyingRage") || CombatHelper.GetBuffTime(player.GetBuff("UndyingRage")) < 0.4f) &&
                !justR)
            {
                Q.Cast(config.Item("packets").GetValue <bool>());
            }

            if (E.IsReady() && config.Item("usee", true).GetValue <bool>() && !player.IsWindingUp &&
                Orbwalking.CanMove(100))
            {
                if (!config.Item("useeLimited", true).GetValue <bool>() ||
                    Orbwalking.GetRealAutoAttackRange(target) + 25 < player.Distance(target))
                {
                    CastEtarget(target);
                }
            }
            if (config.Item("usew", true).GetValue <bool>() && W.IsReady() && !Orbwalking.CanAttack() &&
                Orbwalking.CanMove(100))
            {
                W.Cast();
            }
            if (config.Item("user", true).GetValue <bool>() && R.IsReady() && data.IsAboutToDie)
            {
                R.Cast(config.Item("packets").GetValue <bool>());
            }
        }
예제 #7
0
 public static void castHydra(AIHeroClient target)
 {
     if (target != null && player.Distance(target) < hydra.Range)
     {
         if (Items.HasItem(tiamat.Id) && Items.CanUseItem(tiamat.Id) && !Orbwalking.CanAttack())
         {
             Items.UseItem(tiamat.Id);
         }
         if (Items.HasItem(hydra.Id) && Items.CanUseItem(hydra.Id) && !Orbwalking.CanAttack())
         {
             Items.UseItem(hydra.Id);
         }
     }
 }
예제 #8
0
        private void Combo()
        {
            Obj_AI_Hero target = DrawHelper.GetBetterTarget(1500, TargetSelector.DamageType.Physical);

            if (target == null)
            {
                return;
            }
            var combodmg = ComboDamage(target);

            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, combodmg);
            }
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;
            var  wPred     = W.GetPrediction(target);

            if (config.Item("usew", true).GetValue <bool>() && W.CanCast(target) &&
                (wPred.Hitchance >= HitChance.High || target.HasBuffOfType(BuffType.Slow)) &&
                (!config.Item("usee", true).GetValue <bool>() || (!E.IsReady() && !justE)))
            {
                W.Cast(wPred.CastPosition);
            }
            if (config.Item("usee", true).GetValue <bool>() && E.IsReady())
            {
                CastE(target);
            }
            if (config.Item("user", true).GetValue <bool>() && R.IsReady() && R.CanCast(target) &&
                target.HealthPercent < config.Item("userHp", true).GetValue <Slider>().Value&&
                ((!Orbwalking.CanAttack() && Orbwalking.CanMove(100)) ||
                 !config.Item("useronlyMelee", true).GetValue <bool>()))
            {
                R.CastOnUnit(target);
            }
            if (config.Item("useIgnite").GetValue <bool>() && combodmg > target.Health && hasIgnite)
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (Q.IsReady() && config.Item("useq2", true).GetValue <bool>() && CanQ2)
            {
                Q.Cast();
            }
        }
예제 #9
0
        private static void AfterAttack(AttackableUnit unit, AttackableUnit target)
        {
            if (CanQ2)
            {
                return;
            }
            var nearestMob = Jungle.GetNearest(player.Position);

            if (unit.IsMe && Q.IsReady() &&
                (((orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo && config.Item("useq", true).GetValue <bool>() &&
                   !Orbwalking.CanAttack()) ||
                  (orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed &&
                   config.Item("useqH", true).GetValue <bool>())) && target is Obj_AI_Hero) ||
                (config.Item("useqLC", true).GetValue <bool>() && nearestMob != null &&
                 nearestMob.Distance(player.Position) < player.AttackRange + 30))
            {
                Q.Cast();
                Orbwalking.ResetAutoAttackTimer();
                //player.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);
            }
        }
예제 #10
0
        private void Clear()
        {
            float perc = config.Item("minmana", true).GetValue <Slider>().Value / 100f;

            if (player.Mana < player.MaxMana * perc || player.IsWindingUp)
            {
                return;
            }
            if (config.Item("useqLC", true).GetValue <bool>() && Q.IsReady() && !Orbwalking.CanAttack())
            {
                Q.Cast();
            }
            if (config.Item("usewLC", true).GetValue <bool>() && W.IsReady())
            {
                var minis = MinionManager.GetMinions(
                    ObjectManager.Player.ServerPosition, 600, MinionTypes.All, MinionTeam.NotAlly);
                MinionManager.FarmLocation bestPositionE = W.GetCircularFarmLocation(minis, 600);
                if (bestPositionE.MinionsHit >= config.Item("wMinHit", true).GetValue <Slider>().Value ||
                    minis.Any(m => m.MaxHealth > 1500))
                {
                    W.Cast(bestPositionE.Position);
                }
            }
        }
예제 #11
0
파일: Garen.cs 프로젝트: wx8829110/WUYANZZZ
        private void Combo()
        {
            Obj_AI_Hero target = TargetSelector.GetTarget(700, TargetSelector.DamageType.Physical);

            if (target == null)
            {
                return;
            }
            var combodamage = ComboDamage(target);

            if (config.Item("useItems").GetValue <bool>() && !GarenQ)
            {
                ItemHandler.UseItems(target, config, combodamage);
            }
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;
            var  ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);

            if (config.Item("useIgnite").GetValue <bool>() && hasIgnite &&
                ((R.IsReady() && ignitedmg + R.GetDamage(target) > target.Health) || ignitedmg > target.Health) &&
                (target.Distance(player) > E.Range || player.HealthPercent < 20))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (config.Item("useq", true).GetValue <bool>() && Q.IsReady() &&
                player.Distance(target) > player.AttackRange && !GarenE && !GarenQ &&
                player.Distance(target) > Orbwalking.GetRealAutoAttackRange(target) &&
                CombatHelper.IsPossibleToReachHim(target, 0.30f, new float[5] {
                1.5f, 2f, 2.5f, 3f, 3.5f
            }[Q.Level - 1]))
            {
                Q.Cast();
            }
            if (config.Item("useq", true).GetValue <bool>() && Q.IsReady() && !GarenQ &&
                (!GarenE || (Q.IsReady() && Damage.GetSpellDamage(player, target, SpellSlot.Q) > target.Health)))
            {
                if (GarenE)
                {
                    E.Cast();
                }
                Q.Cast();
                player.IssueOrder(GameObjectOrder.AutoAttack, target);
            }
            if (config.Item("usee", true).GetValue <bool>() && E.IsReady() && !Q.IsReady() && !GarenQ && !GarenE &&
                !Orbwalking.CanAttack() && !player.IsWindingUp && player.CountEnemiesInRange(E.Range) > 0)
            {
                E.Cast();
            }
            var targHP = target.Health + 20 - CombatHelper.IgniteDamage(target);
            var rLogic = config.Item("user", true).GetValue <bool>() && R.IsReady() && target.IsValidTarget() &&
                         (!config.Item("ult" + target.SkinName, true).GetValue <bool>() ||
                          player.CountEnemiesInRange(1500) == 1) && getRDamage(target) > targHP && targHP > 0;

            if (rLogic && target.Distance(player) < R.Range)
            {
                if (!(GarenE && target.Health < getEDamage(target, true) && target.Distance(player) < E.Range))
                {
                    if (GarenE)
                    {
                        E.Cast();
                    }
                    else
                    {
                        R.Cast(target);
                    }
                }
            }
            var data = Program.IncDamages.GetAllyData(player.NetworkId);

            if (config.Item("usew", true).GetValue <bool>() && W.IsReady() && target.IsFacing(player) &&
                data.DamageTaken > 40)
            {
                W.Cast();
            }
            bool hasFlash = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerFlash")) == SpellState.Ready;

            if (config.Item("useFlash", true).GetValue <bool>() && hasFlash && rLogic &&
                target.Distance(player) < R.Range + 425 && target.Distance(player) > R.Range + 250 && !Q.IsReady() &&
                !CombatHelper.IsFacing(target, player.Position) && !GarenQ)
            {
                if (target.Distance(player) < R.Range + 300 && player.MoveSpeed > target.MoveSpeed)
                {
                    return;
                }
                if (GarenE)
                {
                    E.Cast();
                }
                else if (!player.Position.Extend(target.Position, 425f).IsWall())
                {
                }
                {
                    player.Spellbook.CastSpell(
                        player.GetSpellSlot("SummonerFlash"), player.Position.Extend(target.Position, 425f));
                }
            }
        }
예제 #12
0
        private static void Harass()
        {
            Obj_AI_Hero target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);
            float       perc   = config.Item("minmanaH", true).GetValue <Slider>().Value / 100f;

            if (player.Mana < player.MaxMana * perc || target == null)
            {
                return;
            }
            if (config.Item("useqH", true).GetValue <bool>() && Q.IsReady() && Q.CanCast(target) &&
                Orbwalking.CanMove(100) && target.Distance(player) < Q.Range &&
                (player.Distance(target) > Orbwalking.GetRealAutoAttackRange(target) || !Orbwalking.CanAttack()))
            {
                Q.CastIfHitchanceEquals(target, HitChance.High);
            }
        }
예제 #13
0
        private static void Combo()
        {
            Obj_AI_Hero target = TargetSelector.GetTarget(1000, TargetSelector.DamageType.Magical);

            if (target == null)
            {
                return;
            }
            var cmbdmg = ComboDamage(target);

            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, ComboDamage(target));
            }
            bool hasFlash = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerFlash")) == SpellState.Ready;

            if (config.Item("usee", true).GetValue <bool>() && E.IsReady())
            {
                if (config.Item("useewall", true).GetValue <bool>())
                {
                    var   bestpos = CombatHelper.bestVectorToPoppyFlash2(target);
                    float damage  =
                        (float)
                        (ComboDamage(target) +
                         Damage.CalcDamage(
                             player, target, Damage.DamageType.Magical,
                             (eSecond[E.Level - 1] + 0.8f * player.FlatMagicDamageMod)) +
                         (player.GetAutoAttackDamage(target) * 4));
                    float damageno = (float)(ComboDamage(target) + (player.GetAutoAttackDamage(target) * 4));
                    if (config.Item("useeflash", true).GetValue <bool>() && hasFlash && !CheckWalls(player, target) &&
                        damage > target.Health && target.Health > damageno &&
                        CombatHelper.bestVectorToPoppyFlash(target).IsValid())
                    {
                        player.Spellbook.CastSpell(player.GetSpellSlot("SummonerFlash"), bestpos);
                        Utility.DelayAction.Add(
                            100, () => E.CastOnUnit(target));
                    }
                    if (E.CanCast(target) &&
                        (CheckWalls(player, target) ||
                         target.Health < E.GetDamage(target) + player.GetAutoAttackDamage(target, true)))
                    {
                        E.CastOnUnit(target);
                    }
                    if (E.CanCast(target) && Q.IsReady() && Q.Instance.ManaCost + E.Instance.ManaCost > player.Mana &&
                        target.Health <
                        E.GetDamage(target) + Q.GetDamage(target) + player.GetAutoAttackDamage(target, true))
                    {
                        E.CastOnUnit(target);
                    }
                }
                else
                {
                    if (E.CanCast(target))
                    {
                        E.CastOnUnit(target);
                    }
                }
            }
            if (config.Item("useq", true).GetValue <bool>() && Q.IsReady() && Q.CanCast(target) &&
                Orbwalking.CanMove(100) && target.Distance(player) < Q.Range &&
                (player.Distance(target) > Orbwalking.GetRealAutoAttackRange(target) || !Orbwalking.CanAttack()))
            {
                Q.CastIfHitchanceEquals(target, HitChance.High);
            }

            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready &&
                             config.Item("useIgnite").GetValue <bool>();
            var ignitedmg = hasIgnite ? (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite) : 0f;

            if (ignitedmg > target.Health && hasIgnite && !E.CanCast(target) && !Q.CanCast(target) &&
                (player.Distance(target) > Q.Range || player.HealthPercent < 30))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (config.Item("userindanger", true).GetValue <bool>() && R.IsReady() &&
                ((player.CountEnemiesInRange(800) >= 2 &&
                  player.CountEnemiesInRange(800) > player.CountAlliesInRange(1500) + 1 && player.HealthPercent < 60) ||
                 (player.Health < target.Health && player.HealthPercent < 40 &&
                  player.CountAlliesInRange(1000) + 1 < player.CountEnemiesInRange(1000))))
            {
                var targ =
                    HeroManager.Enemies.Where(
                        e =>
                        e.IsValidTarget() && R.CanCast(e) &&
                        (player.HealthPercent < 60 || e.CountEnemiesInRange(300) > 2) &&
                        HeroManager.Enemies.Count(h => h.Distance(e) < 400 && e.HealthPercent < 35) == 0 &&
                        R.GetPrediction(e).CastPosition.Distance(player.Position) < R.ChargedMaxRange)
                    .OrderByDescending(e => R.GetPrediction(e).CastPosition.CountEnemiesInRange(400))
                    .ThenByDescending(e => e.Distance(target))
                    .FirstOrDefault();
                if (R.Range > 1300 && targ == null)
                {
                    targ =
                        HeroManager.Enemies.Where(
                            e =>
                            e.IsValidTarget() && R.CanCast(e) &&
                            R.GetPrediction(e).CastPosition.Distance(player.Position) < R.ChargedMaxRange)
                        .OrderByDescending(e => R.GetPrediction(e).CastPosition.CountEnemiesInRange(400))
                        .ThenByDescending(e => e.Distance(target))
                        .FirstOrDefault();
                }
                if (!R.IsCharging && targ != null)
                {
                    R.StartCharging();
                }
                if (R.IsCharging && targ != null && R.CanCast(targ) && R.Range > 1000 && R.Range > targ.Distance(player))
                {
                    R.CastIfHitchanceEquals(targ, HitChance.Medium);
                }
                if (R.IsCharging && targ != null && R.Range < 1000)
                {
                    return;
                }
            }
            if (config.Item("user", true).GetValue <bool>() && R.IsReady() && player.Distance(target) < 1400 &&
                !target.UnderTurret(true))
            {
                var cond = ((Rdmg(target) < target.Health && ignitedmg + Rdmg(target) > target.Health &&
                             player.Distance(target) < 600) ||
                            (target.Distance(player) > E.Range && Rdmg(target) > target.Health &&
                             target.Distance(player) < 1100));
                if (!R.IsCharging && cond && !Q.IsReady() && player.HealthPercent < 40)
                {
                    R.StartCharging();
                    if (hasIgnite && cmbdmg > target.Health && cmbdmg - Rdmg(target) < target.Health)
                    {
                        if (!target.HasBuff("summonerdot"))
                        {
                            player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
                        }
                    }
                }
                if (R.IsCharging && R.CanCast(target) && R.Range > target.Distance(player) && cond)
                {
                    R.CastIfHitchanceEquals(target, HitChance.High);
                }
            }
        }
예제 #14
0
        private void Clear()
        {
            var target = Jungle.GetNearest(player.Position, GetTargetRange());

            if (config.Item("useqLC", true).GetValue <bool>() && Q.IsReady() && !E.IsCharging)
            {
                if (target != null && Q.CanCast(target))
                {
                    Q.Cast(target.Position, config.Item("packets").GetValue <bool>());
                }
                else
                {
                    MinionManager.FarmLocation bestPositionQ =
                        Q.GetLineFarmLocation(MinionManager.GetMinions(Q.Range, MinionTypes.All, MinionTeam.NotAlly));
                    if (bestPositionQ.MinionsHit >= config.Item("qMinHit", true).GetValue <Slider>().Value)
                    {
                        Q.Cast(bestPositionQ.Position, config.Item("packets").GetValue <bool>());
                    }
                }
            }
            if (config.Item("usewLC", true).GetValue <bool>() && W.IsReady() && !E.IsCharging)
            {
                if (target != null && target.Distance(player) < W.Range)
                {
                    W.Cast(config.Item("packets").GetValue <bool>());
                }
                else
                {
                    if (Environment.Minion.countMinionsInrange(player.Position, W.Range) >=
                        config.Item("wMinHit", true).GetValue <Slider>().Value)
                    {
                        W.Cast(config.Item("packets").GetValue <bool>());
                    }
                }
            }
            if (config.Item("collectBlobs", true).GetValue <bool>() && !E.IsCharging)
            {
                var blob =
                    ObjectManager.Get <Obj_AI_Base>()
                    .Where(
                        o =>
                        !o.IsDead && o.IsValid && o.Name == "BlobDrop" && o.Team == player.Team &&
                        o.Distance(player) < Orbwalking.GetRealAutoAttackRange(player))
                    .OrderBy(o => o.Distance(player))
                    .FirstOrDefault();
                if (blob != null && Orbwalking.CanMove(300) && !Orbwalking.CanAttack() && !player.IsWindingUp)
                {
                    orbwalker.SetMovement(false);
                    player.IssueOrder(GameObjectOrder.MoveTo, blob.Position);
                }
            }
            if (config.Item("useeLC", true).GetValue <bool>() && E.IsReady())
            {
                if (target != null && target.IsValidTarget())
                {
                    CastE(target);
                }
                else
                {
                    MinionManager.FarmLocation bestPositionE =
                        E.GetCircularFarmLocation(
                            MinionManager.GetMinions(eRanges[E.Level - 1], MinionTypes.All, MinionTeam.NotAlly));
                    var castPos = Vector3.Zero;
                    if (bestPositionE.MinionsHit < config.Item("eMinHit", true).GetValue <Slider>().Value&&
                        farmPos.IsValid())
                    {
                        castPos = farmPos;
                    }
                    if (bestPositionE.MinionsHit >= config.Item("eMinHit", true).GetValue <Slider>().Value)
                    {
                        castPos = bestPositionE.Position.To3D();
                    }
                    if (castPos.IsValid())
                    {
                        farmPos = bestPositionE.Position.To3D();
                        Utility.DelayAction.Add(5000, () => { farmPos = Vector3.Zero; });
                        CastE(castPos);
                    }
                }
            }
        }
예제 #15
0
        private void Game_OnGameUpdate(EventArgs args)
        {
            orbwalker.SetAttack(true);
            orbwalker.SetMovement(true);
            Jungle.CastSmite(config.Item("useSmite").GetValue <KeyBind>().Active);
            switch (orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                Combo();
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                Harass();
                break;

            case Orbwalking.OrbwalkingMode.LaneClear:
                Clear();
                break;

            case Orbwalking.OrbwalkingMode.LastHit:
                Lasthit();
                break;

            default:
                break;
            }
            if (config.Item("AutoR", true).GetValue <bool>() && R.IsReady())
            {
                foreach (var enemy in
                         HeroManager.Enemies.Where(
                             e =>
                             ((e.UnderTurret(true) &&
                               e.HealthPercent < config.Item("Rhealt", true).GetValue <Slider>().Value * 0.75f) ||
                              (!e.UnderTurret(true) &&
                               e.HealthPercent < config.Item("Rhealt", true).GetValue <Slider>().Value)) &&
                             e.HealthPercent > config.Item("RhealtMin", true).GetValue <Slider>().Value&&
                             e.IsValidTarget() && e.Distance(player) > 1500))
                {
                    var pred = Program.IncDamages.GetEnemyData(enemy.NetworkId);
                    if (pred != null && pred.DamageTaken > 50 && pred.DamageTaken < enemy.Health &&
                        enemy.Health - pred.DamageTaken <
                        config.Item("Rhealt", true).GetValue <Slider>().Value / 100f * enemy.MaxHealth)
                    {
                        var ally = HeroManager.Allies.OrderBy(a => a.Health)
                                   .FirstOrDefault(a => enemy.Distance(a) < 700);
                        if (ally != null)
                        {
                            var pos = Prediction.GetPrediction(enemy, 0.75f);
                            if (pos.CastPosition.Distance(enemy.Position) < 450 && pos.Hitchance >= HitChance.VeryHigh)
                            {
                                if (enemy.IsMoving)
                                {
                                    R.Cast(enemy.Position.Extend(pos.CastPosition, 450));
                                }
                                else
                                {
                                    R.Cast(enemy.ServerPosition);
                                }
                            }
                        }
                    }
                }
            }
            if (config.Item("EQtoCursor", true).GetValue <KeyBind>().Active&& E.IsReady() && Q.IsReady())
            {
                orbwalker.SetMovement(false);
                if (player.IsMoving)
                {
                    player.IssueOrder(GameObjectOrder.Stop, player.Position);
                }
                var barrel =
                    GetBarrels()
                    .Where(
                        o =>
                        o.IsValid && !o.IsDead && o.Distance(player) < Q.Range &&
                        o.SkinName == "GangplankBarrel" && o.GetBuff("gangplankebarrellife").Caster.IsMe&&
                        KillableBarrel(o))
                    .OrderBy(o => o.Distance(Game.CursorPos))
                    .FirstOrDefault();
                if (barrel != null)
                {
                    var cp        = Game.CursorPos;
                    var cursorPos = barrel.Distance(cp) > BarrelConnectionRange
                        ? barrel.Position.Extend(cp, BarrelConnectionRange)
                        : cp;

                    var points =
                        CombatHelper.PointsAroundTheTarget(player.Position, E.Range - 200, 15, 6)
                        .Where(p => p.Distance(player.Position) < E.Range);
                    var cursorPos2 = cursorPos.Distance(cp) > BarrelConnectionRange
                        ? cursorPos.Extend(cp, BarrelConnectionRange)
                        : cp;

                    var middle      = GetMiddleBarrel(barrel, points, cursorPos);
                    var threeBarrel = cursorPos.Distance(cp) > BarrelExplosionRange && E.Instance.Ammo >= 2 &&
                                      Game.CursorPos.Distance(player.Position) < E.Range && middle.IsValid();
                    var firsDelay = threeBarrel ? 500 : 1;
                    if (cursorPos.IsValid() && cursorPos.Distance(player.Position) < E.Range)
                    {
                        E.Cast(threeBarrel ? middle : cursorPos);
                        Utility.DelayAction.Add(firsDelay, () => Q.CastOnUnit(barrel));
                        if (threeBarrel)
                        {
                            Utility.DelayAction.Add(801, () => E.Cast(middle.Extend(cp, BarrelConnectionRange)));
                        }
                    }
                }
            }
            if (config.Item("QbarrelCursor", true).GetValue <KeyBind>().Active&& Q.IsReady())
            {
                var meleeRangeBarrel =
                    GetBarrels()
                    .OrderBy(o => o.Distance(Game.CursorPos))
                    .FirstOrDefault(
                        o =>
                        o.Health > 1 && o.Distance(player) < Orbwalking.GetRealAutoAttackRange(o) &&
                        !KillableBarrel(o, true));
                if (meleeRangeBarrel != null && Orbwalking.CanAttack())
                {
                    orbwalker.SetAttack(false);
                    player.IssueOrder(GameObjectOrder.AttackUnit, meleeRangeBarrel);
                    return;
                }
                var barrel =
                    GetBarrels()
                    .Where(
                        o =>
                        o.IsValid && !o.IsDead && o.Distance(player) < Q.Range &&
                        o.SkinName == "GangplankBarrel" && o.GetBuff("gangplankebarrellife").Caster.IsMe&&
                        KillableBarrel(o))
                    .OrderBy(o => o.Distance(Game.CursorPos))
                    .FirstOrDefault();
                if (barrel != null)
                {
                    Q.CastOnUnit(barrel);
                }
            }

            if (config.Item("AutoQBarrel", true).GetValue <bool>() && Q.IsReady())
            {
                var barrel =
                    GetBarrels()
                    .FirstOrDefault(
                        o =>
                        o.IsValid && !o.IsDead && o.Distance(player) < Q.Range &&
                        o.SkinName == "GangplankBarrel" && o.GetBuff("gangplankebarrellife").Caster.IsMe&&
                        KillableBarrel(o) &&
                        (o.CountEnemiesInRange(BarrelExplosionRange - 50) > 0 ||
                         HeroManager.Enemies.Count(
                             e =>
                             e.IsValidTarget() &&
                             Prediction.GetPrediction(e, 0.1f).UnitPosition.Distance(o.Position) <
                             BarrelExplosionRange - 20) > 0));

                if (barrel != null)
                {
                    Q.Cast(barrel);
                }
            }
        }
예제 #16
0
 private void handeQ(Obj_AI_Hero target, HitChance hitChance)
 {
     if (player.Distance(target) <= Orbwalking.GetRealAutoAttackRange(target) && !Orbwalking.CanAttack() &&
         Orbwalking.CanMove(100) && target.GetBuffCount("TahmKenchPDebuffCounter") != 2)
     {
         Q.CastIfHitchanceEquals(target, hitChance, config.Item("packets").GetValue <bool>());
     }
     else if (player.Distance(target) > Orbwalking.GetRealAutoAttackRange(target))
     {
         Q.CastIfHitchanceEquals(target, hitChance, config.Item("packets").GetValue <bool>());
     }
 }
예제 #17
0
        private void LastHitQ()
        {
            var targetQ =
                MinionManager.GetMinions(Q.Range)
                .Where(m => m.Health > 5 &&
                       m.IsEnemy && m.Health < Q.GetDamage(m) && Q.CanCast(m) &&
                       HealthPrediction.GetHealthPrediction(m, (int)((player.Distance(m) / Q.Speed * 1000) + Q.Delay)) > 0);

            if (targetQ.Any() && LastAttackedminiMinion != null)
            {
                foreach (var target in
                         targetQ.Where(
                             m =>
                             m.NetworkId != LastAttackedminiMinion.NetworkId ||
                             (m.NetworkId == LastAttackedminiMinion.NetworkId &&
                              Utils.GameTimeTickCount - LastAttackedminiMinionTime > 700)))
                {
                    if (target.Distance(player) < Orbwalking.GetRealAutoAttackRange(target) && !Orbwalking.CanAttack() &&
                        Orbwalking.CanMove(100))
                    {
                        Q.Cast(target, config.Item("packets").GetValue <bool>());
                    }
                    else if (target.Distance(player) > Orbwalking.GetRealAutoAttackRange(target))
                    {
                        Q.Cast(target, config.Item("packets").GetValue <bool>());
                    }
                }
            }
        }
예제 #18
0
        private void Combo()
        {
            Obj_AI_Hero target = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);

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

            if (config.Item("usewCC", true).GetValue <bool>() && W.IsReady() && data.AnyCC)
            {
                W.Cast(target.Position, config.Item("packets").GetValue <bool>());
            }
            var closestPassive = GetClosestPassivePosition(target);

            if (closestPassive.IsValid() && config.Item("MoveToVitals", true).GetValue <bool>() &&
                Orbwalking.CanMove(300) && !Orbwalking.CanAttack() && !player.IsWindingUp &&
                Game.CursorPos.Distance(target.Position) < 350)
            {
                orbwalker.SetMovement(false);
                player.IssueOrder(
                    GameObjectOrder.MoveTo,
                    target.Position.Extend(closestPassive, Math.Max(player.BoundingRadius + target.BoundingRadius, 100)));
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, ComboDamage(target));
            }
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (config.Item("useq", true).GetValue <bool>() && Q.IsReady() && Orbwalking.CanMove(100) &&
                config.Item("useqMin", true).GetValue <Slider>().Value <= player.Distance(target) &&
                (closestPassive.IsValid() || (target.HealthPercent < 30)) && !player.IsWindingUp)
            {
                var pos = GetQpoint(target, closestPassive);
                if (pos.IsValid())
                {
                    Q.Cast(pos, config.Item("packets").GetValue <bool>());
                }
                else if (target.HealthPercent < 30)
                {
                    if (
                        CheckQusage(
                            target.Position.Extend(
                                Prediction.GetPrediction(target, player.Distance(target) / 1600).UnitPosition, Qradius),
                            target))
                    {
                        Q.Cast(
                            target.Position.Extend(
                                Prediction.GetPrediction(target, player.Distance(target) / 1600).UnitPosition, Qradius),
                            config.Item("packets").GetValue <bool>());
                    }
                }
            }
            if (W.IsReady() && config.Item("usew", true).GetValue <bool>())
            {
                var killable  = (target.Distance(player) > 350f && W.GetDamage(target) > target.Health);
                var incAA     = data.ProjectileDamageTaken >= target.GetAutoAttackDamage(player) - 5;
                var dangerous = incAA && data.DamageTaken >= player.Health * 0.4f;
                if (killable || (incAA && !config.Item("usewDangerous", true).GetValue <bool>()) ||
                    (config.Item("usewDangerous", true).GetValue <bool>() && dangerous))
                {
                    W.CastIfHitchanceEquals(target, HitChance.Low, config.Item("packets").GetValue <bool>());
                }
            }
            if (config.Item("useIgnite").GetValue <bool>() && hasIgnite && ComboDamage(target) > target.Health &&
                !Q.IsReady() &&
                (target.Distance(player) > Orbwalking.GetRealAutoAttackRange(target) || player.HealthPercent < 15))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
        }
예제 #19
0
        private void Combo()
        {
            var target = TargetSelector.GetTarget(
                E.Range, TargetSelector.DamageType.Physical, true, HeroManager.Enemies.Where(h => h.IsInvulnerable));

            if (target == null)
            {
                return;
            }
            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 > target.Health - Program.IncDamages.GetEnemyData(target.NetworkId).DamageTaken&& hasIgnite &&
                !CombatHelper.CheckCriticalBuffs(target) && !Q.IsReady() && !justQ)
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (config.Item("usew", true).GetValue <Slider>().Value > player.HealthPercent &&
                player.CountEnemiesInRange(500) > 0)
            {
                W.Cast();
            }
            if (R.IsReady() && config.Item("user", true).GetValue <bool>())
            {
                var Rtarget =
                    HeroManager.Enemies.FirstOrDefault(e => e.HealthPercent < 50 && e.CountAlliesInRange(660) > 0);
                if (Rtarget != null)
                {
                    R.CastIfWillHit(Rtarget, config.Item("Rmin", true).GetValue <Slider>().Value);
                }
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, ComboDamage(target), config.Item("AutoW", true).GetValue <bool>());
            }
            var dontQ   = false;
            var barrels =
                GetBarrels()
                .Where(
                    o =>
                    o.IsValid && !o.IsDead && o.Distance(player) < 1600 && o.SkinName == "GangplankBarrel" &&
                    o.GetBuff("gangplankebarrellife").Caster.IsMe)
                .ToList();

            if (config.Item("useq", true).GetValue <bool>() && Q.IsReady() && config.Item("usee", true).GetValue <bool>() &&
                E.IsReady() && Orbwalking.CanMove(100) && !justE)
            {
                var pred = Prediction.GetPrediction(target, 0.5f);
                if (pred.Hitchance >= HitChance.High)
                {
                    var Qbarrels = GetBarrels().Where(o => o.Distance(player) < Q.Range && KillableBarrel(o));
                    foreach (var Qbarrel in Qbarrels.OrderByDescending(b => b.Distance(target) < BarrelExplosionRange))
                    {
                        var targPred = Prediction.GetPrediction(target, GetQTime(Qbarrel));
                        if (Qbarrel.Distance(targPred.UnitPosition) < BarrelExplosionRange)
                        {
                            if (config.Item("useeAOE", true).GetValue <bool>() && barrels.Count < 2)
                            {
                                var enemies =
                                    HeroManager.Enemies.Where(
                                        e => e.Distance(player) < 1600 && e.Distance(Qbarrel) > BarrelExplosionRange)
                                    .Select(e => Prediction.GetPrediction(e, 05f));
                                var pos =
                                    GetBarrelPoints(Qbarrel.Position)
                                    .Where(p => p.Distance(Qbarrel.Position) < BarrelConnectionRange)
                                    .OrderByDescending(
                                        p => enemies.Count(e => e.UnitPosition.Distance(p) < BarrelExplosionRange))
                                    .ThenBy(p => p.Distance(target.Position))
                                    .FirstOrDefault();
                                if (pos.IsValid() && pos.CountEnemiesInRange(BarrelExplosionRange) > 0 &&
                                    enemies.Count(e => e.UnitPosition.Distance(pos) < BarrelExplosionRange) > 0)
                                {
                                    dontQ = true;
                                    E.Cast(pos);
                                }
                            }
                            break;
                        }
                        var point =
                            GetBarrelPoints(Qbarrel.Position)
                            .Where(
                                p =>
                                p.IsValid() && !p.IsWall() && p.Distance(player.Position) < E.Range &&
                                target.Distance(p) < BarrelExplosionRange &&
                                p.Distance(targPred.UnitPosition) < BarrelExplosionRange &&
                                Qbarrel.Distance(p) < BarrelConnectionRange &&
                                savedBarrels.Count(b => b.barrel.Position.Distance(p) < BarrelExplosionRange) <
                                1)
                            .OrderBy(p => p.Distance(pred.UnitPosition))
                            .FirstOrDefault();
                        if (point.IsValid())
                        {
                            dontQ = true;
                            E.Cast(point);
                            Utility.DelayAction.Add(1, () => Q.CastOnUnit(Qbarrel));
                            return;
                        }
                    }
                }
            }
            var meleeRangeBarrel =
                barrels.FirstOrDefault(
                    b =>
                    (b.Health < 2 || (b.Health == 2 && !KillableBarrel(b, true) && Q.IsReady() && !justQ)) &&
                    KillableBarrel(b, true) && b.Distance(player) < Orbwalking.GetRealAutoAttackRange(b));
            var secondb =
                barrels.Where(
                    b =>
                    b.Distance(meleeRangeBarrel) < BarrelConnectionRange &&
                    HeroManager.Enemies.Count(
                        o =>
                        o.IsValidTarget() && o.Distance(b) < BarrelExplosionRange &&
                        b.Distance(Prediction.GetPrediction(o, 500).UnitPosition) < BarrelExplosionRange) > 0);

            if (meleeRangeBarrel != null &&
                ((HeroManager.Enemies.Count(
                      o =>
                      o.IsValidTarget() && o.Distance(meleeRangeBarrel) < BarrelExplosionRange &&
                      meleeRangeBarrel.Distance(Prediction.GetPrediction(o, 500).UnitPosition) < BarrelExplosionRange) >
                  0) || secondb != null) && !Q.IsReady() && !justQ && Orbwalking.CanAttack())
            {
                orbwalker.SetAttack(false);
                player.IssueOrder(GameObjectOrder.AttackUnit, meleeRangeBarrel);
            }
            if (Q.IsReady())
            {
                if (barrels.Any())
                {
                    var detoneateTargetBarrels = barrels.Where(b => b.Distance(player) < Q.Range);
                    if (config.Item("detoneateTarget", true).GetValue <bool>())
                    {
                        if (detoneateTargetBarrels.Any())
                        {
                            foreach (var detoneateTargetBarrel in detoneateTargetBarrels)
                            {
                                if (!KillableBarrel(detoneateTargetBarrel))
                                {
                                    continue;
                                }
                                if (
                                    detoneateTargetBarrel.Distance(
                                        Prediction.GetPrediction(target, GetQTime(detoneateTargetBarrel)).UnitPosition) <
                                    BarrelExplosionRange &&
                                    target.Distance(detoneateTargetBarrel.Position) < BarrelExplosionRange)
                                {
                                    dontQ = true;
                                    Q.CastOnUnit(detoneateTargetBarrel, config.Item("packets").GetValue <bool>());
                                    return;
                                }
                                var detoneateTargetBarrelSeconds =
                                    barrels.Where(b => b.Distance(detoneateTargetBarrel) < BarrelConnectionRange);
                                if (detoneateTargetBarrelSeconds.Any())
                                {
                                    foreach (var detoneateTargetBarrelSecond in detoneateTargetBarrelSeconds)
                                    {
                                        if (
                                            detoneateTargetBarrelSecond.Distance(
                                                Prediction.GetPrediction(
                                                    target, GetQTime(detoneateTargetBarrel) + 0.15f).UnitPosition) <
                                            BarrelExplosionRange &&
                                            target.Distance(detoneateTargetBarrelSecond.Position) < BarrelExplosionRange)
                                        {
                                            dontQ = true;
                                            Q.CastOnUnit(detoneateTargetBarrel, config.Item("packets").GetValue <bool>());
                                            return;
                                        }
                                    }
                                }
                            }
                        }

                        if (config.Item("detoneateTargets", true).GetValue <Slider>().Value > 1)
                        {
                            var enemies =
                                HeroManager.Enemies.Where(e => e.IsValidTarget() && e.Distance(player) < 600)
                                .Select(e => Prediction.GetPrediction(e, 0.25f));
                            var enemies2 =
                                HeroManager.Enemies.Where(e => e.IsValidTarget() && e.Distance(player) < 600)
                                .Select(e => Prediction.GetPrediction(e, 0.35f));
                            if (detoneateTargetBarrels.Any())
                            {
                                foreach (var detoneateTargetBarrel in detoneateTargetBarrels)
                                {
                                    if (!KillableBarrel(detoneateTargetBarrel))
                                    {
                                        continue;
                                    }
                                    var enemyCount =
                                        enemies.Count(
                                            e =>
                                            e.UnitPosition.Distance(detoneateTargetBarrel.Position) <
                                            BarrelExplosionRange);
                                    if (enemyCount >= config.Item("detoneateTargets", true).GetValue <Slider>().Value&&
                                        detoneateTargetBarrel.CountEnemiesInRange(BarrelExplosionRange) >=
                                        config.Item("detoneateTargets", true).GetValue <Slider>().Value)
                                    {
                                        dontQ = true;
                                        Q.CastOnUnit(detoneateTargetBarrel, config.Item("packets").GetValue <bool>());
                                        return;
                                    }
                                    var detoneateTargetBarrelSeconds =
                                        barrels.Where(b => b.Distance(detoneateTargetBarrel) < BarrelConnectionRange);
                                    if (detoneateTargetBarrelSeconds.Any())
                                    {
                                        foreach (var detoneateTargetBarrelSecond in detoneateTargetBarrelSeconds)
                                        {
                                            if (enemyCount +
                                                enemies2.Count(
                                                    e =>
                                                    e.UnitPosition.Distance(detoneateTargetBarrelSecond.Position) <
                                                    BarrelExplosionRange) >=
                                                config.Item("detoneateTargets", true).GetValue <Slider>().Value&&
                                                detoneateTargetBarrelSecond.CountEnemiesInRange(BarrelExplosionRange) >=
                                                config.Item("detoneateTargets", true).GetValue <Slider>().Value)
                                            {
                                                dontQ = true;
                                                Q.CastOnUnit(
                                                    detoneateTargetBarrel, config.Item("packets").GetValue <bool>());
                                                return;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                if (config.Item("useeAlways", true).GetValue <bool>() && E.IsReady() && player.Distance(target) < E.Range &&
                    !justE && target.Health > Q.GetDamage(target) + player.GetAutoAttackDamage(target) &&
                    Orbwalking.CanMove(100) && config.Item("eStacksC", true).GetValue <Slider>().Value < E.Instance.Ammo)
                {
                    CastE(target, barrels);
                }
                var Qbarrels = GetBarrels().FirstOrDefault(o => o.Distance(player) < Q.Range);
                if (Qbarrels != null && E.Instance.Ammo > 0 && Q.IsReady() && config.Item("usee", true).GetValue <bool>() &&
                    target.Health > Q.GetDamage(target))
                {
                    dontQ = true;
                }
                if (config.Item("useq", true).GetValue <bool>() && Q.CanCast(target) && Orbwalking.CanMove(100) && !justE &&
                    !dontQ)
                {
                    CastQonHero(target, barrels);
                }
            }
        }
예제 #20
0
        private void Combo()
        {
            Obj_AI_Hero target = null;

            if (E.IsCharging)
            {
                target = DrawHelper.GetBetterTarget(
                    GetTargetRange(), TargetSelector.DamageType.Magical, true,
                    HeroManager.Enemies.Where(
                        h => h.IsInvulnerable && CombatHelper.GetAngle(player, target.Position) > 50));
            }
            else
            {
                target = DrawHelper.GetBetterTarget(
                    GetTargetRange(), TargetSelector.DamageType.Magical, true,
                    HeroManager.Enemies.Where(h => h.IsInvulnerable));
            }
            if (target == null)
            {
                return;
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config);
            }
            if (config.Item("usew", true).GetValue <bool>() && W.CanCast(target) && !E.IsCharging)
            {
                W.Cast();
            }
            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 > target.Health && hasIgnite &&
                !CombatHelper.CheckCriticalBuffs(target) && !Q.CanCast(target))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }

            if (rActive)
            {
                orbwalker.SetAttack(false);
                Orbwalking.Attack = false;
                return;
            }

            if (config.Item("usee", true).GetValue <bool>() && E.IsReady() && player.CanMove)
            {
                CastE(target);
            }
            if (config.Item("useq", true).GetValue <bool>() && Q.CanCast(target) && target.IsValidTarget() &&
                !E.IsCharging)
            {
                Q.CastIfHitchanceEquals(target, HitChance.Medium);
            }

            if (R.IsReady() && config.Item("user", true).GetValue <bool>() &&
                config.Item("Rmin", true).GetValue <Slider>().Value <= player.CountEnemiesInRange(R.Range) &&
                !target.HasBuffOfType(BuffType.Knockback) && !target.HasBuffOfType(BuffType.Knockup) &&
                !target.HasBuffOfType(BuffType.Stun))
            {
                R.Cast();
            }
            if (config.Item("collectBlobsC", true).GetValue <bool>() && !E.IsCharging)
            {
                var blob =
                    ObjectManager.Get <Obj_AI_Base>()
                    .Where(
                        o =>
                        !o.IsDead && o.IsValid && o.Name == "BlobDrop" && o.Team == player.Team &&
                        o.Distance(player) < Orbwalking.GetRealAutoAttackRange(player))
                    .OrderBy(o => o.Distance(player))
                    .FirstOrDefault();
                if (blob != null && Orbwalking.CanMove(300) && !Orbwalking.CanAttack() && !player.IsWindingUp)
                {
                    orbwalker.SetMovement(false);
                    Orbwalking.Move = false;
                    player.IssueOrder(GameObjectOrder.MoveTo, blob.Position);
                }
            }
        }
예제 #21
0
 private void LastHitQ(bool auto = false)
 {
     if (!Q.IsReady())
     {
         return;
     }
     if (auto && player.ManaPercent < config.Item("autoQmana", true).GetValue <Slider>().Value)
     {
         return;
     }
     if (config.Item("useqLC", true).GetValue <bool>() || config.Item("useqLH", true).GetValue <bool>() || auto)
     {
         var minions =
             MinionManager.GetMinions(Q.Range, MinionTypes.All, MinionTeam.NotAlly)
             .Where(
                 m =>
                 m.IsValidTarget() && m.Health > 5 && m.Distance(player) < Q.Range &&
                 m.Health <
                 Q.GetDamage(m) * config.Item("qLHDamage", true).GetValue <Slider>().Value / 100);
         var objAiBases = from minion in minions
                          let pred =
             Q.GetCollision(
                 player.Position.To2D(),
                 new List <Vector2>()
         {
             player.Position.Extend(minion.Position, Q.Range).To2D()
         }, 70f)
             orderby pred.Count descending
             select minion;
         if (objAiBases.Any())
         {
             Obj_AI_Base target = null;
             foreach (var minion in
                      objAiBases.Where(
                          minion =>
                          HealthPrediction.GetHealthPrediction(
                              minion, (int)(minion.Distance(player) / Q.Speed * 1000 + 500f)) > 0))
             {
                 var collision =
                     Q.GetCollision(
                         player.Position.To2D(),
                         new List <Vector2>()
                 {
                     player.Position.Extend(minion.Position, Q.Range).To2D()
                 }, 70f)
                     .OrderBy(c => c.Distance(player))
                     .ToList();
                 if (collision.Count <= 2 || collision[0].NetworkId == minion.NetworkId ||
                     collision[1].NetworkId == minion.NetworkId)
                 {
                     if (collision.Count == 1)
                     {
                         Q.Cast(minion, config.Item("packets").GetValue <bool>());
                     }
                     else
                     {
                         var other = collision.FirstOrDefault(c => c.NetworkId != minion.NetworkId);
                         if (other != null &&
                             (player.GetAutoAttackDamage(other) * 2 > other.Health - Q.GetDamage(other)) &&
                             Q.GetDamage(other) < other.Health)
                         {
                             qMiniForWait = other;
                             qMiniTarget  = minion;
                             if (Orbwalking.CanAttack() &&
                                 other.Distance(player) < Orbwalking.GetRealAutoAttackRange(other))
                             {
                                 player.IssueOrder(GameObjectOrder.AutoAttack, other);
                             }
                         }
                         else
                         {
                             Q.Cast(minion, config.Item("packets").GetValue <bool>());
                         }
                     }
                 }
             }
         }
     }
 }
예제 #22
0
 private void handeQ(Obj_AI_Hero target, HitChance hitChance)
 {
     if (player.Distance(target) <= Orbwalking.GetRealAutoAttackRange(target) && !Orbwalking.CanAttack() &&
         Orbwalking.CanMove(100) && target.GetBuffCount("TahmKenchPDebuffCounter") != 2)
     {
         if (Program.IsSPrediction)
         {
             Q.SPredictionCast(target, hitChance);
         }
         else
         {
             Q.CastIfHitchanceEquals(target, hitChance);
         }
     }
     else if (player.Distance(target) > Orbwalking.GetRealAutoAttackRange(target))
     {
         if (Program.IsSPrediction)
         {
             Q.SPredictionCast(target, hitChance);
         }
         else
         {
             Q.CastIfHitchanceEquals(target, hitChance);
         }
     }
 }