Ejemplo n.º 1
0
        private static void FlashCombo()
        {
            Obj_AI_Hero target = TargetSelector.GetTarget(EFlash.Range, TargetSelector.DamageType.Magical);

            if (target != null && E.IsReady() && E.ManaCost < player.Mana &&
                player.Distance(target.Position) < EFlash.Range && player.Distance(target.Position) > 480 &&
                !((getPosToEflash(target.Position)).IsWall()))
            {
                var pred          = EFlash.GetPrediction(target);
                var poly          = CombatHelper.GetPolyFromVector(getPosToEflash(target.Position), pred.UnitPosition, E.Width);
                var enemiesBehind =
                    HeroManager.Enemies.Count(
                        e =>
                        e.NetworkId != target.NetworkId && e.IsValidTarget(E.Range) &&
                        (poly.IsInside(E.GetPrediction(e).UnitPosition) || poly.IsInside(e.Position)) &&
                        e.Position.Distance(player.Position) > player.Distance(pred.UnitPosition));
                if (pred.Hitchance >= HitChance.High)
                {
                    Utility.DelayAction.Add(
                        30, () =>
                    {
                        if (enemiesBehind > 0)
                        {
                            E.Cast(
                                player.ServerPosition.Extend(pred.CastPosition, E.Range),
                                config.Item("packets").GetValue <bool>());
                        }
                        else
                        {
                            E.Cast(
                                player.ServerPosition.Extend(
                                    pred.CastPosition,
                                    player.Distance(pred.CastPosition) + Orbwalking.GetRealAutoAttackRange(target)),
                                config.Item("packets").GetValue <bool>());
                        }
                    });
                    player.Spellbook.CastSpell(player.GetSpellSlot("SummonerFlash"), getPosToEflash(target.Position));
                }
            }
            ItemHandler.UseItems(target, config);
            Orbwalking.MoveTo(Game.CursorPos);
        }
Ejemplo n.º 2
0
        private static void FlashCombo()
        {
            var target = TargetSelector.GetTarget(EFlash.Range, DamageType.Magical);

            if (target != null && E.IsReady() && E.ManaCost < player.Mana &&
                player.LSDistance(target.Position) < EFlash.Range && player.LSDistance(target.Position) > 480 &&
                !getPosToEflash(target.Position).IsWall())
            {
                var pred          = EFlash.GetPrediction(target);
                var poly          = CombatHelper.GetPolyFromVector(getPosToEflash(target.Position), pred.UnitPosition, E.Width);
                var enemiesBehind =
                    HeroManager.Enemies.Count(
                        e =>
                        e.NetworkId != target.NetworkId && e.LSIsValidTarget(E.Range) &&
                        (poly.IsInside(E.GetPrediction(e).UnitPosition) || poly.IsInside(e.Position)) &&
                        e.Position.LSDistance(player.Position) > player.LSDistance(pred.UnitPosition));
                if (pred.HitChance >= EloBuddy.SDK.Enumerations.HitChance.High)
                {
                    Utility.DelayAction.Add(
                        30, () =>
                    {
                        if (enemiesBehind > 0)
                        {
                            E.Cast(
                                player.ServerPosition.LSExtend(pred.CastPosition, E.Range),
                                getCheckBoxItem(config, "packets"));
                        }
                        else
                        {
                            E.Cast(
                                player.ServerPosition.LSExtend(
                                    pred.CastPosition,
                                    player.LSDistance(pred.CastPosition) + Orbwalking.GetRealAutoAttackRange(target)),
                                getCheckBoxItem(config, "packets"));
                        }
                    });
                    player.Spellbook.CastSpell(player.GetSpellSlot("SummonerFlash"), getPosToEflash(target.Position));
                }
            }
            Orbwalker.MoveTo(Game.CursorPos);
        }
Ejemplo n.º 3
0
        //Returns if the skillshot is about to hit the unit in the next time seconds.
        public bool IsAboutToHit(int time, Obj_AI_Base unit, Obj_AI_Base caster)
        {
            if (SkillshotData.Type == SkillShotType.SkillshotMissileLine)
            {
                var missilePos       = GetMissilePosition(0);
                var missilePosAfterT = GetMissilePosition(time);

                /*
                 *
                 *
                 * var collision = false;
                 * foreach (var prob in
                 *  ObjectManager.Get<Obj_AI_Base>()
                 *      .Where(
                 *          o =>
                 *              o.Health > 5 && o.NetworkId != unit.NetworkId && !o.IsDead && o.Team == unit.Team &&
                 *              o.IsValidTarget(caster.Distance(unit), false, missilePos.To3D2()) &&
                 *              CheckUnitCollision(o) != CollisionObjectTypes.Null &&
                 *              SkillshotData.CollisionObjects.Any(c => c == CheckUnitCollision(o))))
                 * {
                 *  var mp = prob.ServerPosition.To2D().ProjectOn(missilePos, unit.ServerPosition.To2D());
                 *  if (mp.IsOnSegment && mp.SegmentPoint.Distance(unit.ServerPosition) < SkillshotData.Radius)
                 *  {
                 *      collision = true;
                 *      break;
                 *  }
                 * }*/
                PredictionInput input = new PredictionInput
                {
                    Collision        = true,
                    Aoe              = false,
                    Delay            = missilePos.Distance(StartPosition) < 1 ? SkillshotData.Delay : 0,
                    From             = missilePos.To3D2(),
                    Radius           = SkillshotData.Radius,
                    Range            = missilePos.Distance(missilePosAfterT),
                    Speed            = SkillshotData.MissileSpeed,
                    Type             = SkillshotType.SkillshotLine,
                    Unit             = unit,
                    CollisionObjects = GetColisionObj()
                };
                var collisions =
                    LeagueSharp.Common.Collision.GetCollision(
                        new List <Vector3>()
                {
                    StartPosition.To3D2(), missilePosAfterT.To3D2()
                }, input);

                var projection = unit.ServerPosition.To2D().ProjectOn(missilePos, missilePosAfterT);
                var pred       = Prediction.GetPrediction(input);
                var poly       = CombatHelper.GetPolyFromVector(
                    missilePos.To3D2(), missilePosAfterT.To3D2(), SkillshotData.Radius);
                if (((projection.IsOnSegment &&
                      projection.SegmentPoint.Distance(unit.ServerPosition) < SkillshotData.Radius) ||
                     poly.IsInside(pred.UnitPosition)) && collisions.Count(c => c.NetworkId != unit.NetworkId) == 0)
                {
                    return(true);
                }

                return(false);
            }

            if (!IsSafe(unit.ServerPosition.To2D()))
            {
                var timeToExplode = SkillshotData.ExtraDuration + SkillshotData.Delay +
                                    (int)((1000 * StartPosition.Distance(EndPosition)) / SkillshotData.MissileSpeed) -
                                    (System.Environment.TickCount - StartTick);
                if (timeToExplode <= time)
                {
                    return(true);
                }
            }

            return(false);
        }