Esempio n. 1
0
        public static void UseQe(Obj_AI_Base target)
        {
            if (!Q.IsReady() || !E.IsReady() || target == null)
            {
                return;
            }
            var sPos = Prediction.GetPrediction(target, Q.Delay + E.Delay).UnitPosition;

            if (ObjectManager.Player.Distance(sPos, true) > Math.Pow(E.Range, 2))
            {
                var orb = ObjectManager.Player.ServerPosition + Vector3.Normalize(sPos - ObjectManager.Player.ServerPosition) * E.Range;
                Qe.Delay = Q.Delay + E.Delay + ObjectManager.Player.Distance(orb) / E.Speed;
                var pos = Qe.GetPrediction(target);
                if (pos.Hitchance >= HitChance.High)
                {
                    UseQe2(target, orb);
                }
            }
            else
            {
                Q.Width = 40f;
                var pos = Q.GetPrediction(target, true);
                Q.Width = 125f;
                if (pos.Hitchance >= HitChance.VeryHigh)
                {
                    UseQe2(target, pos.UnitPosition);
                }
            }
        }
Esempio n. 2
0
        private static void AutoUlt()
        {
            var comboR = getSliderItem(comboMenu, "comboR");

            if (comboR > 0 && _spellR.IsReady())
            {
                var enemiesHit   = 0;
                var killableHits = 0;

                foreach (var enemy in Helper.EnemyTeam.Where(x => x.LSIsValidTarget(_spellR.Range)))
                {
                    var prediction = Prediction.GetPrediction(enemy, _spellR.Delay);

                    if (prediction != null &&
                        prediction.UnitPosition.LSDistance(ObjectManager.Player.ServerPosition) <= _spellR.Range)
                    {
                        enemiesHit++;

                        if (ObjectManager.Player.LSGetSpellDamage(enemy, SpellSlot.W) >= enemy.Health)
                        {
                            killableHits++;
                        }
                    }
                }

                if (enemiesHit >= comboR ||
                    (killableHits >= 1 && ObjectManager.Player.Health / ObjectManager.Player.MaxHealth <= 0.1))
                {
                    CastR();
                }
            }
        }
Esempio n. 3
0
        private static void HandleW()
        {
            if (ObjectManager.Player.LSIsRecalling() || ObjectManager.Player.InShop() || !spells[SpellSlot.W].IsReady())
            {
                return;
            }

            if (ObjectManager.Player.HealthPercent <= getSliderItem(miscMenu, "dz191.bard.wtarget.healthpercent"))
            {
                var castPosition = ObjectManager.Player.ServerPosition.LSExtend(Game.CursorPos, 65);
                spells[SpellSlot.W].Cast(castPosition);
                return;
            }

            var LowHealthAlly =
                HeroManager.Allies.Where(
                    ally =>
                    ally.LSIsValidTarget(spells[SpellSlot.W].Range) &&
                    ally.HealthPercent <= getSliderItem(miscMenu, "dz191.bard.wtarget.healthpercent") &&
                    getCheckBoxItem(miscMenu, string.Format("dz191.bard.wtarget.{0}", ally.NetworkId)))
                .OrderBy(ally => ally.Health)
                .FirstOrDefault();

            if (LowHealthAlly != null)
            {
                var movementPrediction = Prediction.GetPrediction(LowHealthAlly, 0.25f);
                spells[SpellSlot.W].Cast(movementPrediction.UnitPosition);
            }
        }
Esempio n. 4
0
        public List <Vector3> getPositions()
        {
            var list      = new List <Vector3>();
            var predEnemy = Prediction.GetPrediction(Enemy, ObjectManager.Player.Distance(Enemy) / 1600).UnitPosition;

            foreach (var passive in passives)
            {
                switch (passive.Type)
                {
                case PassiveType.NE:
                    list.Add(new Vector2(predEnemy.X, predEnemy.Y + 100).To3D());
                    break;

                case PassiveType.NW:
                    list.Add(new Vector2(predEnemy.X + 100, predEnemy.Y).To3D());
                    break;

                case PassiveType.SW:
                    list.Add(new Vector2(predEnemy.X, predEnemy.Y - 100).To3D());
                    break;

                case PassiveType.SE:
                    list.Add(new Vector2(predEnemy.X - 100, predEnemy.Y).To3D());
                    break;
                }
            }
            return(list);
        }
Esempio n. 5
0
 private static List <AIHeroClient> GetRTarget(Vector3 pos)
 {
     return
         (HeroManager.Enemies.Where(
              i => i.IsValidTarget() && pos.LSDistance(Prediction.GetPrediction(i, 0.25f).UnitPosition) < RWidth)
          .ToList());
 }
Esempio n. 6
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);
            }
        }
Esempio n. 7
0
        private void checkCastedQ(Obj_AI_Base target)
        {
            if ((justQ && target.LSDistance(player) > Q.Range) || !target.LSIsValidTarget() || target == null)
            {
                return;
            }
            var poly   = GetPoly(lastQPos);
            var heroes = HeroManager.Enemies.Where(e => poly.IsInside(e.Position) && e.LSIsValidTarget());

            if (heroes == null)
            {
                return;
            }
            var objAiHeroes = heroes as IList <AIHeroClient> ?? heroes.ToList();

            if (objAiHeroes.Any())
            {
                var escaping = objAiHeroes.Count(h => poly.IsOutside(Prediction.GetPrediction(h, 0.2f).UnitPosition.LSTo2D()));
                var data     = IncDamages.GetAllyData(player.NetworkId);
                if ((escaping > 0 && (objAiHeroes.Count() == 1 || (objAiHeroes.Count() >= 2 && System.Environment.TickCount - qStart > 1000))) || data.DamageTaken > player.Health || IncDamages.GetAllyData(player.NetworkId).AnyCC ||
                    IncDamages.GetEnemyData(target.NetworkId).DamageTaken > target.Health)
                {
                    Q.Cast(target, true);
                }
            }
        }
Esempio n. 8
0
        private static void Combo(AIHeroClient targ = null, bool force = false)
        {
            if (Q.LastCastedDelay(Delay) || R.LastCastedDelay(Delay))
            {
                //return;
            }

            if (!force && CastSecondW())
            {
                return;
            }

            var target = targ ?? TargetSelector.GetTarget(EFirst && E.IsReady() ? E.Range : W.Range + WRadius - 10, DamageType.Magical);

            if (!target.LSIsValidTarget())
            {
                //Console.WriteLine("BAD TARG");
                return;
            }

            if (CastEFirst(target))
            {
                Console.WriteLine("Combo: Cast E FIRST");
                return;
            }

            if (Q.CanCast(target) && Q.IsActive(force) && Q.CastOnUnit(target))
            {
                Console.WriteLine("Combo: Cast Q");
                return;
            }

            SpellManager.UpdateUltimate();
            if (R.CanCast(target) && R.IsActive(force) && R.GetSpellSlot() == SpellSlot.Q && R.CastOnUnit(target))
            {
                Console.WriteLine("Combo: Cast R(Q)");
                return;
            }

            if (W.IsReady() && target.LSIsValidTarget(W.Range + WRadius - 10) && W.IsActive(force) && W.IsFirstW())
            {
                if (!force ||
                    (target.CountEnemiesInRange(300) <= getSliderItem(ksMenu, "KSEnemies") &&
                     Player.HealthPercent >= getSliderItem(ksMenu, "KSHealth")))
                {
                    var pos = Prediction.GetPrediction(target, W.Delay, W.Range + WRadius, W.Speed);
                    if (pos.CastPosition.LSDistance(target.ServerPosition) < WRadius)
                    {
                        W.Cast(target);
                        Console.WriteLine("Combo: Cast W");
                        return;
                    }
                }
            }

            if (E.CanCast(target) && E.IsActive(force) && target.DistanceToPlayer() > 50 && E.Cast(target).IsCasted())
            {
                Console.WriteLine("Combo: Cast E");
            }
        }
Esempio n. 9
0
        private void HandleW(AIHeroClient target)
        {
            var turret =
                ObjectManager.Get <Obj_AI_Turret>()
                .OrderByDescending(t => t.LSDistance(target))
                .FirstOrDefault(t => t.IsEnemy && t.LSDistance(target) < 3000 && !t.IsDead);

            if (turret != null)
            {
                CastW(target, target.Position, turret.Position);
            }
            else
            {
                if (target.IsMoving)
                {
                    var pred = Prediction.GetPrediction(target, 2);
                    if (pred.Hitchance >= HitChance.VeryHigh)
                    {
                        CastW(target, target.Position, pred.UnitPosition);
                    }
                }
                else
                {
                    W.Cast(player.Position.LSExtend(target.Position, W.Range - player.LSDistance(target)));
                }
            }
        }
Esempio n. 10
0
        private void DetonateQ()
        {
            if (SimpleQ)
            {
                return;
            }
            var targethero =
                HeroManager.Enemies.Where(e => e.Distance(savedQ.position) < QExplosionRange && e.IsValidTarget())
                .OrderByDescending(e => e.Distance(savedQ.position))
                .FirstOrDefault();

            if (targethero == null)
            {
                return;
            }
            if (savedQ.deltaT() < 2000 &&
                Prediction.GetPrediction(targethero, 0.1f).UnitPosition.Distance(savedQ.position) < QExplosionRange &&
                HeroManager.Enemies.Count(
                    h => h.Distance(savedQ.position) < QExplosionRange && h.IsValidTarget() && h.Health < getQdamage(h)) ==
                0)
            {
                //waiting
            }
            else
            {
                Q.Cast();
            }
        }
Esempio n. 11
0
        private static void ECast(AIHeroClient enemy)
        {
            var range = Orbwalking.GetRealAutoAttackRange(enemy);
            var path  = Geometry.CircleCircleIntersection(ObjectManager.Player.ServerPosition.LSTo2D(),
                                                          Prediction.GetPrediction(enemy, 0.25f).UnitPosition.LSTo2D(), LucianSpells.E.Range, range);

            if (path.Count() > 0)
            {
                var epos = path.MinOrDefault(x => x.LSDistance(Game.CursorPos));
                if (epos.To3D().UnderTurret(true) || epos.To3D().LSIsWall())
                {
                    return;
                }

                if (epos.To3D().CountEnemiesInRange(LucianSpells.E.Range - 100) > 0)
                {
                    return;
                }
                LucianSpells.E.Cast(epos);
            }
            if (path.Count() == 0)
            {
                var epos = ObjectManager.Player.ServerPosition.LSExtend(enemy.ServerPosition, -LucianSpells.E.Range);
                if (epos.UnderTurret(true) || epos.LSIsWall())
                {
                    return;
                }

                // no intersection or target to close
                LucianSpells.E.Cast(ObjectManager.Player.ServerPosition.LSExtend(enemy.ServerPosition,
                                                                                 -LucianSpells.E.Range));
            }
        }
Esempio n. 12
0
        private static void BeforeAttack(AttackableUnit target, Orbwalker.PreAttackArgs args)
        {
            try
            {
                if (!MenuInit.getCheckBoxItem(MenuInit.comboMenu, "Combo.Use.QQ"))
                {
                    return;
                }

                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) && !HasPassive &&
                    spells[Spells.Q].IsReady() &&
                    !(MenuInit.getBoxItem(MenuInit.comboMenu, "Combo.Prio") == 0 ||
                      MenuInit.getBoxItem(MenuInit.comboMenu, "Combo.Prio") == 1 && Ferocity == 5))
                {
                    var x = Prediction.GetPrediction(args.Target as Obj_AI_Base, Player.AttackCastDelay * 1000);
                    if (Player.Position.LSTo2D().LSDistance(x.UnitPosition.LSTo2D())
                        >= Player.BoundingRadius + Player.AttackRange + args.Target.BoundingRadius)
                    {
                        args.Process = false;
                        spells[Spells.Q].Cast();
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Esempio n. 13
0
        private static void LogicR()
        {
            foreach (
                var t in
                Program.Enemies.Where(
                    t =>
                    t.IsValidTarget() &&
                    BallPos.Distance(Prediction.GetPrediction(t, R.Delay).CastPosition) < R.Width &&
                    BallPos.Distance(t.ServerPosition) < R.Width))
            {
                if (Program.Combo && getCheckBoxItem(rMenu, "Ralways" + t.NetworkId))
                {
                    R.Cast();
                }

                if (getCheckBoxItem(rMenu, "Rks"))
                {
                    var comboDmg = OktwCommon.GetKsDamage(t, R);

                    if (t.IsValidTarget(Q.Range))
                    {
                        comboDmg += Q.GetDamage(t);
                    }
                    if (W.IsReady())
                    {
                        comboDmg += W.GetDamage(t);
                    }
                    if (Player.IsInAutoAttackRange(t))
                    {
                        comboDmg += Player.GetAutoAttackDamage(t) * 2;
                    }
                    if (t.Health < comboDmg)
                    {
                        R.Cast();
                    }
                    Program.debug("ks");
                }
                if (getCheckBoxItem(rMenu, "Rturrent") && BallPos.UnderTurret(false) && !BallPos.UnderTurret(true))
                {
                    R.Cast();
                    Program.debug("Rturrent");
                }
                if (getCheckBoxItem(rMenu, "Rlifesaver") &&
                    Player.Health < Player.CountEnemiesInRange(800) * Player.Level * 20 &&
                    Player.Distance(BallPos) > t.Distance(Player.Position))
                {
                    R.Cast();
                    Program.debug("ls");
                }
            }

            var countEnemies = CountEnemiesInRangeDeley(BallPos, R.Width, R.Delay);

            if (countEnemies >= getSliderItem(rMenu, "rCount") && BallPos.CountEnemiesInRange(R.Width) == countEnemies)
            {
                R.Cast();
            }
        }
Esempio n. 14
0
        private void Combo()
        {
            var target = TargetSelector.GetTarget(1700, DamageType.Magical);

            if (target == null || target.IsInvulnerable || target.MagicImmune)
            {
                return;
            }
            var edmg      = getEdamage(target);
            var qdmg      = getQdamage(target);
            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) &&
                (!ActiveQ ||
                 !(CombatHelper.IsFacing(player, target.Position, 30) && target.Distance(player) < Q.Range)))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (Q.CanCast(target) && getCheckBoxItem(menuC, "useq") && Qhit(target.Position) &&
                (preventSilence(Q) ||
                 (target.Health < PassiveDmg(target) * 2 || qdmg > target.Health) &&
                 target.Distance(player) < Orbwalking.GetRealAutoAttackRange(target)))
            {
                Q.Cast(target.Position);
            }
            if (getCheckBoxItem(menuC, "usee") && E.CanCast(target) &&
                (((preventSilence(E) ||
                   (target.Health < PassiveDmg(target) * 2 &&
                    target.Distance(player) < Orbwalking.GetRealAutoAttackRange(target))) &&
                  (!ActiveE ||
                   Environment.TickCount - lastE > getSliderItem(menuC, "eDelay"))) ||
                 edmg > target.Health))
            {
                E.CastIfHitchanceEquals(target, HitChance.High, getCheckBoxItem(config, "packets"));
            }
            if (W.IsReady() && getCheckBoxItem(menuC, "wSpeed") && ActiveQ && preventSilence(W) &&
                target.Distance(player) < Q.Range &&
                Prediction.GetPrediction(target, 0.2f).UnitPosition.Distance(player.Position) > Q.Range)
            {
                W.Cast();
            }
            var canR = ComboDamage(target) > target.Health && qdmg < target.Health && target.Distance(player) < Q.Range &&
                       !Silenced;

            if (R.IsReady() &&
                ((target.Health <
                  getRdamage() * (target.CountAlliesInRange(600) > 0 && target.HealthPercent > 15 ? 5 : 3) &&
                  target.Distance(player) > Q.Range) ||
                 (target.Distance(player) < Q.Range && target.Health < getRdamage() * 3 + edmg &&
                  target.Health > qdmg) ||
                 player.CountEnemiesInRange(R.Range) >= getSliderItem(menuC, "Rmin")))
            {
                HandleR(target, canR);
            }
        }
Esempio n. 15
0
        private void Combo(AIHeroClient target)
        {
            if (target == null)
            {
                return;
            }
            var cmbDmg = ComboDamage(target);
            var dist   = (float)(Q.Range + player.MoveSpeed * 2.5);

            if (ShacoClone && !GhostDelay && getCheckBoxItem(menuC, "useClone") &&
                !getCheckBoxItem(menuM, "autoMoveClone"))
            {
                moveClone();
            }
            if (getCheckBoxItem(menuC, "WaitForStealth") && ShacoStealth && cmbDmg < target.Health)
            {
                return;
            }
            if (getCheckBoxItem(menuC, "useq") && Q.IsReady() &&
                Game.CursorPos.LSDistance(target.Position) < 250 && target.LSDistance(player) < dist &&
                (target.LSDistance(player) >= getSliderItem(menuC, "useqMin") ||
                 (cmbDmg > target.Health && player.CountEnemiesInRange(2000) == 1)))
            {
                if (target.LSDistance(player) < Q.Range)
                {
                    Q.Cast(Prediction.GetPrediction(target, 0.5f).UnitPosition, getCheckBoxItem(config, "packets"));
                }
                else
                {
                    if (!CheckWalls(target) || Helpers.Environment.Map.GetPath(player, target.Position) < dist)
                    {
                        Q.Cast(
                            player.Position.LSExtend(target.Position, Q.Range), getCheckBoxItem(config, "packets"));
                    }
                }
            }
            var hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (getCheckBoxItem(menuC, "usew") && W.IsReady() && !target.UnderTurret(true) &&
                target.Health > cmbDmg && player.LSDistance(target) < W.Range)
            {
                HandleW(target);
            }
            if (getCheckBoxItem(menuC, "usee") && E.CanCast(target))
            {
                E.CastOnUnit(target, getCheckBoxItem(config, "packets"));
            }
            if (getCheckBoxItem(menuC, "user") && R.IsReady() && !ShacoClone && target.HealthPercent < 75 &&
                cmbDmg < target.Health && target.HealthPercent > cmbDmg && target.HealthPercent > 25)
            {
                R.Cast(getCheckBoxItem(config, "packets"));
            }
            if (getCheckBoxItem(menuC, "useIgnite") &&
                player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite) > target.Health && hasIgnite)
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
        }
Esempio n. 16
0
        internal static int CountEnemiesInRangeAfterTime(Vector3 pos, float range, float delay, bool nowToo)
        {
            var enemies = from h in HeroManager.Enemies
                          let pred = Prediction.GetPrediction(h, delay)
                                     where pred.UnitPosition.LSDistance(pos) < range
                                     select h;

            return(nowToo ? enemies.Count(h => h.LSDistance(pos) < range) : enemies.Count());
        }
Esempio n. 17
0
        private static void CastEtarget(AIHeroClient target)
        {
            var ePred = Prediction.GetPrediction(target, 1);
            var pos   = target.Position.LSExtend(ePred.CastPosition, BarrelExplosionRange);

            if (pos.LSDistance(ePos) > 400 && !justE)
            {
                E.Cast(pos, getCheckBoxItem(config, "packets"));
            }
        }
Esempio n. 18
0
        private static void AfterAttack(AttackableUnit targetA, EventArgs args)
        {
            var targetO = targetA;

            if (!(targetO is AIHeroClient))
            {
                return;
            }

            var targ             = (AIHeroClient)targetO;
            var passivePositions = GetPassivePositions(targetO);
            var rapid            = player.GetAutoAttackDamage(targ) * 3 + ComboDamage(targ) > targ.Health ||
                                   (player.Health < targ.Health && player.Health < player.MaxHealth / 2);

            if (E.IsReady() && Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) &&
                (getCheckBoxItem(comboMenu, "usee") || getKeyBindItem(comboMenu, "RapidAttack") || rapid) &&
                !Orbwalker.CanAutoAttack)
            {
                E.Cast(getCheckBoxItem(config, "packets"));
            }
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) && Q.IsReady() &&
                (getKeyBindItem(comboMenu, "RapidAttack") || rapid) && !Orbwalker.CanAutoAttack &&
                passivePositions.Any())
            {
                var passive = GetClosestPassivePosition(targ);
                var pos     = GetQpoint(targ, passive);
                if (pos.IsValid())
                {
                    Q.Cast(pos, getCheckBoxItem(config, "packets"));
                }
                else
                {
                    var pos2 = GetQpoint(targ, Prediction.GetPrediction(targ, 2).UnitPosition);
                    if (pos2.IsValid())
                    {
                        Q.Cast(pos2, getCheckBoxItem(config, "packets"));
                    }
                }
            }
            //var pos = GetClosestPassivePosition(targetO);
            var target = TargetSelector.GetTarget(W.Range, DamageType.Physical);

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.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 &&
                ((getSliderItem(comboMenu, "userally") <=
                  HeroManager.Allies.Count(
                      a => a.IsValid && !a.IsDead && a.LSDistance(target) < 600 && a.HealthPercent < 90) &&
                  getCheckBoxItem(comboMenu, "usertf")) ||
                 (player.HealthPercent < 75 && getCheckBoxItem(comboMenu, "user"))))
            {
                R.CastOnUnit(target, getCheckBoxItem(config, "packets"));
            }
        }
Esempio n. 19
0
        private void moveClone()
        {
            var Gtarget = TargetSelector.GetTarget(2200, DamageType.Physical);

            switch (getBoxItem(menuM, "ghostTarget"))
            {
            case 0:
                Gtarget = TargetSelector.GetTarget(GhostRange, DamageType.Physical);
                break;

            case 1:
                Gtarget =
                    ObjectManager.Get <AIHeroClient>()
                    .Where(i => i.IsEnemy && !i.IsDead && player.LSDistance(i) <= GhostRange)
                    .OrderBy(i => i.Health)
                    .FirstOrDefault();
                break;

            case 2:
                Gtarget =
                    ObjectManager.Get <AIHeroClient>()
                    .Where(i => i.IsEnemy && !i.IsDead && player.LSDistance(i) <= GhostRange)
                    .OrderBy(i => player.LSDistance(i))
                    .FirstOrDefault();
                break;

            default:
                break;
            }
            var clone = ObjectManager.Get <Obj_AI_Minion>().FirstOrDefault(m => m.Name == player.Name && !m.IsMe);

            if (clone != null && Gtarget != null && Gtarget.IsValid)
            {
                if (clone.CanMove)
                {
                    Player.IssueOrder(GameObjectOrder.MovePet, Gtarget);
                }

                if (clone.LSDistance(Gtarget) < 130 && (CanCloneAttack(clone) || clone.CanAttack))
                {
                    Player.IssueOrder(GameObjectOrder.AutoAttackPet, Gtarget);
                }

                if (player.HealthPercent > 25)
                {
                    var prediction = Prediction.GetPrediction(Gtarget, 2);
                    R.Cast(Gtarget.Position.LSExtend(prediction.UnitPosition, Orbwalking.GetRealAutoAttackRange(Gtarget)), getCheckBoxItem(config, "packets"));
                }

                GhostDelay = true;
                Utility.DelayAction.Add(200, () => GhostDelay = false);
            }
        }
Esempio n. 20
0
        private void castQ(AIHeroClient target)
        {
            if (target == null && Q.IsCharging)
            {
                ObjectManager.Player.Spellbook.CastSpell(SpellSlot.Q);
            }
            if (Q.IsCharging)
            {
                var qTarget = TargetSelector.GetTarget(!Q.IsCharging ? Q.ChargedMaxRange / 2 : Q.ChargedMaxRange, DamageType.Physical);
                if (qTarget == null)
                {
                    return;
                }
                if (qTarget == null && Q.IsCharging)
                {
                    ObjectManager.Player.Spellbook.CastSpell(SpellSlot.Q);
                }
                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);
            }
            else if (Q.CanCast(target) && !Orbwalker.IsAutoAttacking && target != null)
            {
                var qPred  = Prediction.GetPrediction(target, 0.3f);
                var qPred2 = Prediction.GetPrediction(target, 0.6f);
                var poly   = GetPoly(qPred.UnitPosition);
                if (qPred2.Hitchance >= HitChance.High && poly.IsInside(qPred2.UnitPosition.LSTo2D()) && poly.IsInside(target.ServerPosition))
                {
                    Q.StartCharging(qPred.CastPosition);
                }
            }
        }
Esempio n. 21
0
        private static void LogicQ()
        {
            var t  = TargetSelector.GetTarget(Q.Range, DamageType.Physical);
            var t1 = TargetSelector.GetTarget(Q1.Range, DamageType.Physical);

            if (t.IsValidTarget(Q.Range))
            {
                if (OktwCommon.GetKsDamage(t, Q) + AaDamage(t) > t.Health)
                {
                    Q.Cast(t);
                }
                else if (Program.Combo && Player.Mana > RMANA + QMANA)
                {
                    Q.Cast(t);
                }
                else if (Program.Farm && getCheckBoxItem(harassMenu, "harras" + t.ChampionName) && Player.Mana > RMANA + QMANA + EMANA + WMANA)
                {
                    Q.Cast(t);
                }
            }
            else if ((Program.Farm || Program.Combo) && getCheckBoxItem(qMenu, "harasQ") && t1.IsValidTarget(Q1.Range) && getCheckBoxItem(harassMenu, "harras" + t1.ChampionName) && Player.LSDistance(t1.ServerPosition) > Q.Range + 100)
            {
                if (Program.Combo && Player.Mana < RMANA + QMANA)
                {
                    return;
                }
                if (Program.Farm && Player.Mana < RMANA + QMANA + EMANA + WMANA)
                {
                    return;
                }
                if (!OktwCommon.CanHarras())
                {
                    return;
                }
                var prepos = Prediction.GetPrediction(t1, Q1.Delay);
                if ((int)prepos.Hitchance < 5)
                {
                    return;
                }
                var distance = Player.LSDistance(prepos.CastPosition);
                var minions  = Cache.GetMinions(Player.ServerPosition, Q.Range);

                foreach (var minion in minions.Where(minion => minion.LSIsValidTarget(Q.Range)))
                {
                    if (prepos.CastPosition.LSDistance(Player.Position.LSExtend(minion.Position, distance)) < 25)
                    {
                        Q.Cast(minion);
                        return;
                    }
                }
            }
        }
Esempio n. 22
0
        private static void CastQ(AIHeroClient target)
        {
            var distance = Vector3.Distance(BallPos, target.ServerPosition);


            if (E.IsReady() && Player.Mana > RMANA + QMANA + WMANA + EMANA &&
                distance > Player.Distance(target.ServerPosition) + 300)
            {
                E.CastOnUnit(Player);
                return;
            }

            if (Program.getSliderItem("PredictionMODE") == 1)
            {
                var predInput2 = new PredictionInput
                {
                    Aoe       = true,
                    Collision = Q.Collision,
                    Speed     = Q.Speed,
                    Delay     = Q.Delay,
                    Range     = float.MaxValue,
                    From      = BallPos,
                    Radius    = Q.Width,
                    Unit      = target,
                    Type      = SebbyLib.Prediction.SkillshotType.SkillshotCircle
                };
                var prepos5 = SebbyLib.Prediction.Prediction.GetPrediction(predInput2);

                if ((int)prepos5.Hitchance > 5 - Program.getSliderItem("HitChance"))
                {
                    if (prepos5.CastPosition.Distance(prepos5.CastPosition) < Q.Range)
                    {
                        Q.Cast(prepos5.CastPosition);
                    }
                }
            }
            else
            {
                var delay  = distance / Q.Speed + Q.Delay;
                var prepos = Prediction.GetPrediction(target, delay, Q.Width);

                if ((int)prepos.Hitchance > 5 - Program.getSliderItem("HitChance"))
                {
                    if (Q.IsInRange(target))
                    {
                        Q.Cast(target);
                    }
                }
            }
        }
Esempio n. 23
0
        public static Vector3 GetQpoint(AIHeroClient target, Vector3 passive)
        {
            var ponts     = new List <Vector3>();
            var predEnemy = Prediction.GetPrediction(target, ObjectManager.Player.Distance(target) / 1600).UnitPosition;

            for (var i = 2; i < 8; i++)
            {
                ponts.Add(predEnemy.To2D().Extend(passive.To2D(), i * 25).To3D());
            }

            return
                (ponts.Where(p => CheckQusage(p, target))
                 .OrderByDescending(p => p.Distance(target.Position))
                 .FirstOrDefault());
        }
Esempio n. 24
0
        private static void Clear()
        {
            if (ObjectManager.Player.ManaPercent < getSliderItem(clearMenu, "lucian.clear.mana"))
            {
                return;
            }
            if (LucianSpells.Q.IsReady() && getCheckBoxItem(clearMenu, "lucian.q.clear") &&
                ObjectManager.Player.Buffs.Any(buff => buff.Name != "lucianpassivebuff"))
            {
                foreach (
                    var minion in
                    MinionManager.GetMinions(ObjectManager.Player.ServerPosition, LucianSpells.Q.Range,
                                             MinionTypes.All,
                                             MinionTeam.NotAlly))
                {
                    var prediction = Prediction.GetPrediction(minion, LucianSpells.Q.Delay,
                                                              ObjectManager.Player.Spellbook.GetSpell(SpellSlot.Q).SData.CastRadius);

                    var collision = LucianSpells.Q.GetCollision(ObjectManager.Player.Position.To2D(),
                                                                new List <Vector2> {
                        prediction.UnitPosition.To2D()
                    });

                    foreach (var cs in collision)
                    {
                        if (collision.Count >= getSliderItem(clearMenu, "lucian.q.minion.hit.count"))
                        {
                            if (collision.Last().Distance(ObjectManager.Player) -
                                collision[0].Distance(ObjectManager.Player) <= 600 &&
                                collision[0].Distance(ObjectManager.Player) <= 500)
                            {
                                LucianSpells.Q.Cast(cs);
                            }
                        }
                    }
                }
            }
            if (LucianSpells.W.IsReady() && getCheckBoxItem(clearMenu, "lucian.w.clear") &&
                ObjectManager.Player.Buffs.Any(buff => buff.Name != "lucianpassivebuff"))
            {
                if (LucianSpells.W.GetCircularFarmLocation(MinionManager.GetMinions(ObjectManager.Player.Position, LucianSpells.Q.Range, MinionTypes.All, MinionTeam.NotAlly)).MinionsHit >= getSliderItem(clearMenu, "lucian.w.minion.hit.count"))
                {
                    LucianSpells.W.Cast(
                        LucianSpells.W.GetCircularFarmLocation(MinionManager.GetMinions(ObjectManager.Player.Position,
                                                                                        LucianSpells.Q.Range, MinionTypes.All, MinionTeam.NotAlly)).Position);
                }
            }
        }
Esempio n. 25
0
 public static void CastSafePosition(Spell spell, AIHeroClient hero)
 {
     if (
         Geometry.CircleCircleIntersection(ObjectManager.Player.ServerPosition.To2D(),
                                           Prediction.GetPrediction(hero, 0f, hero.AttackRange).UnitPosition.To2D(), spell.Range,
                                           Orbwalking.GetRealAutoAttackRange(hero)).Count() > 0)
     {
         spell.Cast(
             Geometry.CircleCircleIntersection(ObjectManager.Player.ServerPosition.To2D(),
                                               Prediction.GetPrediction(hero, 0f, hero.AttackRange).UnitPosition.To2D(), spell.Range,
                                               Orbwalking.GetRealAutoAttackRange(hero)).MinOrDefault(i => i.Distance(Game.CursorPos)));
     }
     else
     {
         spell.Cast(ObjectManager.Player.ServerPosition.Extend(hero.ServerPosition, -spell.Range));
     }
 }
Esempio n. 26
0
 private void castQ(AIHeroClient target)
 {
     if (Q.IsCharging)
     {
         checkCastedQ(target);
     }
     else if (Q.CanCast(target) && !Orbwalker.IsAutoAttacking)
     {
         var qPred  = Prediction.GetPrediction(target, 0.3f);
         var qPred2 = Prediction.GetPrediction(target, 0.6f);
         var poly   = GetPoly(qPred.UnitPosition);
         if (qPred2.Hitchance >= HitChance.High && poly.IsInside(qPred2.UnitPosition.To2D()) &&
             poly.IsInside(target.ServerPosition))
         {
             Q.StartCharging(qPred.CastPosition);
         }
     }
 }
Esempio n. 27
0
        public static void walljump()
        {
            var x = Player.Position.LSExtend(Game.CursorPos, 100);
            var y = Player.Position.LSExtend(Game.CursorPos, 30);

            if (!x.LSIsWall() && !y.LSIsWall())
            {
                EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, x);
            }
            if (x.LSIsWall() && !y.LSIsWall())
            {
                EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, y);
            }
            if (Prediction.GetPrediction(Player, 500).UnitPosition.LSDistance(Player.Position) <= 10)
            {
                Q.Cast(Game.CursorPos);
            }
        }
Esempio n. 28
0
 private void OnInterruptableTarget(Obj_AI_Hero target, Interrupter2.InterruptableTargetEventArgs args)
 {
     if (E.CanCast(target) && config.Item("useEint", true).GetValue <bool>())
     {
         if (Program.IsSPrediction)
         {
             if (E.SPredictionCast(target, HitChance.High))
             {
                 return;
             }
         }
         else
         {
             if (E.CastIfHitchanceEquals(target, HitChance.High))
             {
                 return;
             }
         }
     }
     if (R.CanCast(target) && config.Item("useRint", true).GetValue <bool>())
     {
         if (savedQ != null && !SimpleQ && !target.IsMoving && target.Distance(qPos) > QExplosionRange &&
             target.Distance(player) < R.Range - 100 &&
             target.Position.Distance(savedQ.position) < 550 + QExplosionRange / 2 &&
             !target.HasBuffOfType(BuffType.Knockback))
         {
             var cast = Prediction.GetPrediction(target, 1000f).UnitPosition.Extend(savedQ.position, -100);
             R.Cast(cast);
         }
         else if (target.Distance(player) < R.Range - 100)
         {
             if (player.CountEnemiesInRange(2000) <= player.CountAlliesInRange(2000))
             {
                 var cast = target.Position.Extend(player.Position, -100);
                 R.Cast(cast);
             }
             else
             {
                 var cast = target.Position.Extend(player.Position, 100);
                 R.Cast(cast);
             }
         }
     }
 }
Esempio n. 29
0
        private void CastE(Obj_AI_Base target)
        {
            if (target.LSDistance(player) > eRanges[E.Level - 1])
            {
                return;
            }
            var eFlyPred  = E.GetPrediction(target);
            var enemyPred = Prediction.GetPrediction(
                target, eChannelTimes[E.Level - 1] + target.LSDistance(player) / E.Speed / 1000);

            if (E.IsCharging)
            {
                if (!eFlyPred.CastPosition.IsValid() || eFlyPred.CastPosition.IsWall())
                {
                    return;
                }
                if (eFlyPred.CastPosition.LSDistance(player.Position) < E.Range)
                {
                    E.CastIfHitchanceEquals(target, HitChance.High, getCheckBoxItem(config, "packets"));
                }
                else if (eFlyPred.UnitPosition.LSDistance(player.Position) < E.Range && target.LSDistance(player) < 500f)
                {
                    E.CastIfHitchanceEquals(target, HitChance.Medium, getCheckBoxItem(config, "packets"));
                }
                else if ((eFlyPred.CastPosition.LSDistance(player.Position) < E.Range &&
                          eRanges[E.Level - 1] - eFlyPred.CastPosition.LSDistance(player.Position) < 200) ||
                         (CombatHelper.GetAngle(player, eFlyPred.CastPosition) > 35))
                {
                    E.CastIfHitchanceEquals(target, HitChance.Medium, getCheckBoxItem(config, "packets"));
                }
                else if (eFlyPred.CastPosition.LSDistance(player.Position) < E.Range && zacETime != 0 &&
                         Environment.TickCount - zacETime > 2500)
                {
                    E.CastIfHitchanceEquals(target, HitChance.Medium, getCheckBoxItem(config, "packets"));
                }
            }
            else if (enemyPred.UnitPosition.LSDistance(player.Position) < eRanges[E.Level - 1] &&
                     getSliderItem(menuC, "Emin") < target.LSDistance(player.Position))
            {
                E.SetCharged("ZacE", "ZacE", 300, eRanges[E.Level - 1], eChannelTimes[E.Level - 1]);
                E.StartCharging(eFlyPred.UnitPosition);
            }
        }
Esempio n. 30
0
        private Vector3 GetVectorE(AIHeroClient target)
        {
            var pos  = Vector3.Zero;
            var pred = Prediction.GetPrediction(target, 0.28f);

            if (!target.IsMoving)
            {
                return(pos);
            }
            var distW  = E.Width / 2 + target.BoundingRadius;
            var points = CombatHelper.PointsAroundTheTarget(pred.UnitPosition, distW);
            var walls  =
                points.Where(p => p.IsWall() && player.Distance(target) > target.BoundingRadius)
                .OrderBy(p => p.Distance(pred.UnitPosition));
            var wall = walls.FirstOrDefault();

            if (wall.IsValid() && wall.Distance(target.Position) < 350 &&
                walls.Any(w => w.Distance(target.Position) < distW))
            {
                pos = wall.Extend(pred.UnitPosition, (target.BoundingRadius + distW));
            }
            if (config.Item("useeWall", true).GetValue <bool>())
            {
                return(pos);
            }
            if (pred.Hitchance < HitChance.Medium || target.Distance(player) < Orbwalking.GetRealAutoAttackRange(target))
            {
                return(pos);
            }
            if (pred.UnitPosition.Distance(player.Position) > player.Distance(target))
            {
                var dist    = target.BoundingRadius + E.Width;
                var predPos = pred.UnitPosition;
                if (target.Distance(predPos) < dist)
                {
                    predPos = target.Position.Extend(predPos, dist);
                }
                pos = predPos.Extend(target.Position, -dist);
            }
            return(pos);
        }