private void kill(Positions positions, Vector3 pos)
 {
     if (R.IsReady() && Extensions.Distance(pos, positions.Player.Position) < 1200 &&
         ObjectManager.Get <AIHeroClient>()
         .Count(
             o =>
             o.IsAlly &&
             Extensions.Distance(o, pos) < getSliderItem(menu, "Alliesrange")) <
         1)
     {
         if (checkdmg(positions.Player, pos) && UltTime(pos) < positions.RecallData.GetRecallTime() &&
             !isColliding(pos))
         {
             if (player.ChampionName == "Xerath")
             {
                 xerathUlt(positions, pos);
             }
             R.Cast(pos);
             if (player.ChampionName == "Draven" && getCheckBoxItem(menu, "CallBack"))
             {
                 Utility.DelayAction.Add((int)(UltTime(pos) - 300), () => R.Cast());
             }
         }
     }
 }
 private void xerathUlt(Positions positions, Vector3 pos = default(Vector3))
 {
     if (pos != Vector3.Zero)
     {
         xerathUltActivated = true;
         xerathUltTarget    = positions.Player;
         Utility.DelayAction.Add(5000, () => xerathUltActivated = false);
         R.Cast(pos);
     }
     else
     {
         if (positions.Player.IsVisible)
         {
             xerathUltActivated = true;
             xerathUltTarget    = positions.Player;
             Utility.DelayAction.Add(5000, () => xerathUltActivated = false);
             R.Cast(positions.Player);
         }
         else
         {
             xerathUltActivated = true;
             xerathUltTarget    = positions.Player;
             Utility.DelayAction.Add(5000, () => xerathUltActivated = false);
             R.Cast(
                 Extensions.Extend(positions.Player.Position, positions.predictedpos,
                                   (float)(positions.Player.MoveSpeed * 0.3)));
         }
     }
 }
        private Vector3 getpos(Positions enemy, float dist)
        {
            var time = (enemy.LastSeen - enemy.RecallData.RecallStartTime) / 1000;
            var line = enemy.Player.Position.LSExtend(enemy.predictedpos, dist);

            if (Extensions.Distance(enemy.Player.Position, enemy.predictedpos) < dist && (time < 2 || Extensions.Distance(enemy.Player.Position, enemy.predictedpos) > Extensions.Distance(enemy.Player.Position, line) * 0.70f))
            {
                line = enemy.predictedpos;
            }
            return(line);
        }
        public static float GetPath(AIHeroClient hero, Vector3 b)
        {
            var path = hero.GetPath(b);

            Vector3[] lastPoint = { path[0] };
            var       distance  = 0f;

            foreach (var point in path.Where(point => !point.Equals(lastPoint[0])))
            {
                distance    += Extensions.Distance(lastPoint[0], point);
                lastPoint[0] = point;
            }
            return(distance);
        }
 private bool CheckShieldTower(Vector3 pos)
 {
     if (Game.MapId != GameMapId.SummonersRift)
     {
         return(false);
     }
     if (player.Team == GameObjectTeam.Chaos)
     {
         return(ShielderTurretsOrder.Any(s => Extensions.Distance(s, pos) < 1150f));
     }
     if (player.Team == GameObjectTeam.Order)
     {
         return(ShielderTurretsChaos.Any(s => Extensions.Distance(s, pos) < 1150f));
     }
     return(false);
 }
        private float UltTime(Vector3 pos)
        {
            var dist = Extensions.Distance(player.ServerPosition, pos);

            if (player.ChampionName == "Ezreal")
            {
                return(dist / 2000 * 1000 + 1000);
            }
            //Beaving's calculations
            if (player.ChampionName == "Jinx" && dist > 1350)
            {
                const float accelerationrate = 0.3f;

                var acceldifference = dist - 1350f;

                if (acceldifference > 150f)
                {
                    acceldifference = 150f;
                }

                var difference = dist - 1500f;
                return(dist /
                       ((1350f * 1700f + acceldifference * (1700f + accelerationrate * acceldifference) +
                         difference * 1700f) / dist) * 1000 + 250);
            }
            if (player.ChampionName == "Ashe")
            {
                return(dist / 1600 * 1000 + 250);
            }
            if (player.ChampionName == "Draven")
            {
                return(dist / 2000 * 1000 + 400);
            }
            if (player.ChampionName == "Ziggs")
            {
                return(dist / 1750f * 1000 + 1000);
            }
            if (player.ChampionName == "Lux")
            {
                return(500f);
            }
            if (player.ChampionName == "Xerath")
            {
                return(500f);
            }
            return(0);
        }
        public static Vector3 GetPointAfterTimeFromPath(AIHeroClient hero, Vector3 b, float timeInSec)
        {
            var path = hero.GetPath(b);

            Vector3[] lastPoint = { path[0] };
            var       distance  = 0f;
            var       maxDist   = hero.MoveSpeed * timeInSec;

            foreach (var point in path.Where(point => !point.Equals(lastPoint[0])))
            {
                if (distance > maxDist)
                {
                    break;
                }
                distance    += Extensions.Distance(lastPoint[0], point);
                lastPoint[0] = point;
            }
            return(lastPoint[0]);
        }
Exemple #8
0
        /// <summary>
        /// Returns the actual path of a unit.
        /// </summary>
        /// <param name="unit"> The unit.</param>
        public static Vector3[] GetRealPath(Obj_AI_Base unit)
        {
            const int tolerance = 50;
            var       path      = unit.Path.ToList();

            for (var i = path.Count - 1; i > 0; i--)
            {
                var start = path[i].To2D();
                var end   = path[i - 1].To2D();

                if (unit.ServerPosition.Distance(start, end, true) <= Extension.Pow(tolerance))
                {
                    path.RemoveRange(0, i);
                    break;
                }
            }

            return(new[] { unit.Position }.Concat(path).ToArray());
        }
        private void Game_OnUpdate(EventArgs args)
        {
            float time = Environment.TickCount;

            foreach (var enemyInfo in
                     Enemies.Where(x => x.Player.IsVisible && !x.Player.IsDead && Extensions.IsValidTarget(x.Player)))
            {
                enemyInfo.LastSeen = time;
                var prediction = Prediction.GetPrediction(enemyInfo.Player, 10);
                if (prediction != null)
                {
                    enemyInfo.predictedpos = prediction.UnitPosition;
                }
            }
            if (xerathUltActivated && R.IsReady() && !getKeyBindItem(menu, "ComboBlock") &&
                player.HasBuff("xerathrshots"))
            {
                var enemy = Enemies.FirstOrDefault(x => x.Player.NetworkId == xerathUltTarget.NetworkId && !x.Player.IsDead);
                if (enemy != null)
                {
                    R.Cast(enemy.Player.Position);
                }
                else
                {
                    var target =
                        HeroManager.Enemies.Where(
                            h => Extensions.Distance(player, h) < xerathUltRange[R.Level - 1] && h.IsVisible)
                        .OrderBy(h => h.Health)
                        .FirstOrDefault();
                    if (target != null)
                    {
                        R.Cast(target);
                    }
                }
            }
            if (!SupportedChamps() || !getCheckBoxItem(menu, "UseR") || !R.IsReady() || !enabled ||
                getKeyBindItem(menu, "ComboBlock"))
            {
                return;
            }
            if (Extensions.CountEnemiesInRange(player, getSliderItem(menu, "EnemiesAroundYou")) >=
                1)
            {
                return;
            }
            if (!getCheckBoxItem(menu, "OnlyCombo") &&
                (getKeyBindItem(menu, "OrbBlock1") ||
                 getKeyBindItem(menu, "OrbBlock2") ||
                 getKeyBindItem(menu, "OrbBlock3")))
            {
                return;
            }
            if (player.ChampionName == "Draven" && player.Spellbook.GetSpell(SpellSlot.R).Name != "DravenRCast")
            {
                return;
            }
            var HitChance = getSliderItem(menu, "Hitchance");

            foreach (var enemy in
                     Enemies.Where(
                         x =>
                         x.Player.IsValid <AIHeroClient>() && !x.Player.IsDead &&
                         !getCheckBoxItem(menu, x.Player.ChampionName + "DontUltRandomUlt") &&
                         x.RecallData.Recall.Status == Packet.S2C.Teleport.Status.Start &&
                         x.RecallData.Recall.Type == Packet.S2C.Teleport.Type.Recall)
                     .OrderBy(x => x.RecallData.GetRecallTime()))
            {
                if (CheckBuffs(enemy.Player) || CheckBaseUlt(enemy.RecallData.GetRecallCountdown()) ||
                    !(Environment.TickCount - enemy.RecallData.RecallStartTime >
                      getSliderItem(menu, "waitBeforeUlt")))
                {
                    continue;
                }
                var dist = Math.Abs(enemy.LastSeen - enemy.RecallData.RecallStartTime) / 1000 * enemy.Player.MoveSpeed -
                           enemy.Player.MoveSpeed / 3;
                var trueDist = Math.Abs(enemy.LastSeen - enemy.RecallData.RecallStartTime) / 1000 *
                               enemy.Player.MoveSpeed;
                var line = getpos(enemy, dist);
                switch (HitChance)
                {
                case 1:
                    break;

                case 2:
                    if (trueDist > 1000 && !enemy.Player.IsVisible)
                    {
                        continue;
                    }
                    break;

                case 3:
                    if (trueDist > 850 && !enemy.Player.IsVisible)
                    {
                        continue;
                    }
                    break;

                case 4:
                    if (trueDist > 700 && !enemy.Player.IsVisible)
                    {
                        continue;
                    }
                    break;

                case 5:
                    if (trueDist > 500 && !enemy.Player.IsVisible)
                    {
                        continue;
                    }
                    break;
                }
                Vector3 pos;
                if (enemy.Player.IsVisible)
                {
                    pos = enemy.Player.Position;
                }
                else if (Extensions.Distance(line, enemy.Player.Position) < dist &&
                         (enemy.predictedpos.UnderTurret(true) ||
                          NavMesh.GetCollisionFlags(enemy.predictedpos).HasFlag(CollisionFlags.Grass)))
                {
                    pos = enemy.predictedpos;
                }
                {
                    if (dist > 1500)
                    {
                        continue;
                    }
                    pos =
                        PointsAroundTheTarget(enemy.Player.Position, trueDist)
                        .Where(
                            p =>
                            !Extensions.IsWall(p) && Extensions.Distance(line, p) < dist / 1.2f &&
                            GetPath(enemy.Player, p) < trueDist)
                        .OrderByDescending(p => NavMesh.GetCollisionFlags(p).HasFlag(CollisionFlags.Grass))
                        .ThenBy(p => Extensions.Distance(line, p))
                        .FirstOrDefault();
                }
                if (pos != null)
                {
                    if (player.ChampionName == "Ziggs" && Extensions.Distance(player, pos) > 5000f)
                    {
                        continue;
                    }
                    if (player.ChampionName == "Lux" && Extensions.Distance(player, pos) > 3000f)
                    {
                        continue;
                    }
                    if (player.ChampionName == "Xerath" &&
                        Extensions.Distance(player, pos) > xerathUltRange[R.Level - 1] - 500)
                    {
                        continue;
                    }
                    kill(enemy, new Vector3(pos.X, pos.Y, 0));
                }
            }
        }
Exemple #10
0
        private void Drawing_OnDraw(EventArgs args)
        {
            if (!getCheckBoxItem(menu, "RandomUltDrawings") || !enabled || getKeyBindItem(menu, "ComboBlock"))
            {
                return;
            }
            foreach (var enemy in
                     Enemies.Where(
                         x =>
                         x.Player.IsValid <AIHeroClient>() && !x.Player.IsDead &&
                         x.RecallData.Recall.Status == Packet.S2C.Teleport.Status.Start &&
                         x.RecallData.Recall.Type == Packet.S2C.Teleport.Type.Recall)
                     .OrderBy(x => x.RecallData.GetRecallTime()))
            {
                var trueDist = Math.Abs(enemy.LastSeen - enemy.RecallData.RecallStartTime) / 1000 *
                               enemy.Player.MoveSpeed;
                var dist = Math.Abs(enemy.LastSeen - enemy.RecallData.RecallStartTime) / 1000 * enemy.Player.MoveSpeed -
                           enemy.Player.MoveSpeed / 3;
                if (dist > 1500)
                {
                    continue;
                }

                if (dist < 50)
                {
                    dist = 50;
                }
                var     line = getpos(enemy, trueDist);
                Vector3 pos;
                if (enemy.Player.IsVisible)
                {
                    pos = enemy.Player.Position;
                }
                else if (Extensions.Distance(line, enemy.Player.Position) < dist &&
                         (enemy.predictedpos.UnderTurret(true) ||
                          NavMesh.GetCollisionFlags(enemy.predictedpos).HasFlag(CollisionFlags.Grass)))
                {
                    pos = enemy.predictedpos;
                }
                else
                {
                    pos =
                        PointsAroundTheTarget(enemy.Player.Position, trueDist)
                        .Where(
                            p =>
                            !Extensions.IsWall(p) && Extensions.Distance(line, p) < dist / 1.5f &&
                            GetPath(enemy.Player, p) < trueDist)
                        .OrderByDescending(p => NavMesh.GetCollisionFlags(p).HasFlag(CollisionFlags.Grass))
                        .ThenBy(p => Extensions.Distance(line, p))
                        .FirstOrDefault();
                }
                if (pos != null)
                {
                    Render.Circle.DrawCircle(pos, 50, Color.Red, 8);
                }
                if (!enemy.Player.IsVisible)
                {
                    if (pos != null)
                    {
                        Drawing.DrawCircle(line, dist / 1.5f, Color.LawnGreen);
                    }
                }
            }
            if (SupportedChamps() && getCheckBoxItem(menu, "drawNotification") && R.IsReady() &&
                !player.IsDead)
            {
                var possibleTargets =
                    Enemies.Where(
                        x =>
                        !x.Player.IsDead && checkdmg(x.Player, x.Player.Position) &&
                        (Environment.TickCount - x.LastSeen < 4000) && x.Player.CountAlliesInRange(1000) < 1 &&
                        UltTime(x.Player.Position) <
                        9500 - getSliderItem(menu, "waitBeforeUlt"));
                if (possibleTargets.Any() && player.IsHPBarRendered)
                {
                    Drawing.DrawText(
                        player.HPBarPosition.X + 8, player.HPBarPosition.Y - 30, Color.Red, "Possible Randomult");
                }
            }
        }