Пример #1
0
        public static void Execute(EventArgs args)
        {
            if (!E.IsEnabledAndReady(Variables.Orbwalker.ActiveMode))
            {
                return;
            }


            var CondemnTarget = GetCondemnTarget(ObjectManager.Player.ServerPosition);

            if (CondemnTarget.IsValidTarget())
            {
                var AAForE = MenuExtensions.GetItemValue <Slider>("dz191.vhr.misc.condemn.noeaa").Value;

                if (Math.Ceiling(CondemnTarget.Health / ObjectManager.Player.GetAutoAttackDamage(CondemnTarget, true)) < AAForE)
                {
                    return;
                }

                var targetPosition = CondemnTarget.ServerPosition;
                var myPosition     = ObjectManager.Player.ServerPosition;
                if (WindWall.CollidesWithWall(myPosition, targetPosition))
                {
                    return;
                }

                E.CastOnUnit(CondemnTarget);
                TrinketBush(CondemnTarget.ServerPosition.Extend(ObjectManager.Player.ServerPosition, -450f));
            }
            return;
        }
Пример #2
0
        public void OnUpdate(EventArgs args)
        {
            if (SDK.Tracker.DetectedSkillshots == null || SDK.Tracker.DetectedSkillshots.Count == 0)
            {
                return;
            }

            //var endPos = missile.EndPosition;

            //if (missile.StartPosition.Distance(endPos) < missile.SData.CastRange)
            //{
            //    endPos = missile.StartPosition.Extend(missile.EndPosition, missile.SData.CastRange);
            //}

            //var time = 1000 * missile.Position.Distance(endPos) / missile.SData.MissileSpeed - Game.Ping / 2 + missile.SData.CastFrame / 30f;

            foreach (var skillshot in SDK.Tracker.DetectedSkillshots)
            {
                //TODO: Does not work because SDK is missing too much. Solution: Pull Request or finding an alternative way of doing this

                foreach (var ally in HeroManager.Allies)
                {
                    var endPos = skillshot.EndPosition;

                    if (skillshot.StartPosition.Distance(endPos) < skillshot.SData.Range)
                    {
                        endPos = skillshot.StartPosition.Extend(skillshot.EndPosition, skillshot.SData.Range);
                    }

                    int time = (int)(1000 * skillshot.MissilePosition(false).Distance(endPos) / skillshot.SData.MissileSpeed - Game.Ping / 2);

                    if (skillshot.IsAboutToHit(ally, time))
                    {
                        var gapClosePath = this.Provider.GetPath(ally.ServerPosition);

                        if (gapClosePath != null && gapClosePath.PathCost < time)
                        {
                            //Chat.Print("Can gapclose in time to protect ally");
                        }

                        this.WindWall = new WindWall(skillshot.StartPosition, skillshot.SData.Range, skillshot.SData.Radius);

                        if (this.WindWall != null && this.WindWall.AlliesInside.Contains(ally))
                        {
                            this.Execute(this.WindWall.CastPosition);
                        }
                    }
                }
            }
        }
Пример #3
0
        public static void Execute(EventArgs args)
        {
            if (!E.IsEnabledAndReady(Variables.Orbwalker.ActiveMode))
            {
                return;
            }

            /**
             * var CondemnTarget = GetCondemnTarget(ObjectManager.Player.ServerPosition);
             * if (CondemnTarget.IsValidTarget())
             * {
             * // var AAForE = MenuExtensions.GetItemValue<Slider>("dz191.vhr.misc.condemn.noeaa").Value;
             *
             * // if (CondemnTarget.Health / ObjectManager.Player.GetAutoAttackDamage(CondemnTarget, true) < AAForE)
             * // {
             * //     return;
             * // }
             *  var targetPosition = CondemnTarget.ServerPosition;
             *  var myPosition = ObjectManager.Player.ServerPosition;
             *  if (WindWall.CollidesWithWall(myPosition, targetPosition))
             *  {
             *      return;
             *  }
             *
             *  E.CastOnUnit(CondemnTarget);
             * }*/

            var pushDistance = MenuExtensions.GetItemValue <Slider>("dz191.vhr.misc.condemn.pushdistance").Value - 25;

            if (pushDistance >= 410)
            {
                var PushEx = pushDistance;
                pushDistance -= (10 + (PushEx - 410) / 2);
            }
            foreach (var target in HeroManager.Enemies.Where(en => en.IsValidTarget(E.Range) && !en.IsDashing()))
            {
                //Yasuo Windwall check
                if (WindWall.CollidesWithWall(ObjectManager.Player.ServerPosition, target.ServerPosition))
                {
                    continue;
                }

                if (MenuExtensions.GetItemValue <bool>("dz191.vhr.misc.condemn.onlystuncurrent") && Variables.Orbwalker.GetTarget() != null &&
                    !target.NetworkId.Equals(Variables.Orbwalker.GetTarget().NetworkId))
                {
                    continue;
                }

                if (target.Health + 10 <=
                    ObjectManager.Player.GetAutoAttackDamage(target) *
                    MenuExtensions.GetItemValue <Slider>("dz191.vhr.misc.condemn.noeaa").Value)
                {
                    continue;
                }
                var Prediction  = Variables.spells[SpellSlot.E].GetPrediction(target);
                var endPosition = Prediction.UnitPosition.Extend(ObjectManager.Player.ServerPosition, -pushDistance);

                if (Prediction.Hitchance >= HitChance.VeryHigh)
                {
                    if (endPosition.IsWall())
                    {
                        var condemnRectangle = new VHRPolygon(VHRPolygon.Rectangle(target.ServerPosition.To2D(), endPosition.To2D(), target.BoundingRadius));

                        if (condemnRectangle.Points
                            .Count(point => NavMesh.GetCollisionFlags(point.X, point.Y).HasFlag(CollisionFlags.Wall)) >= condemnRectangle.Points.Count() * (20 / 100f))
                        {
                            E.CastOnUnit(target);
                            TrinketBush(target.ServerPosition.Extend(ObjectManager.Player.ServerPosition, -450f));
                        }
                    }
                    else
                    {
                        //It's not a wall.
                        var step = pushDistance / 5f;
                        for (float i = 0; i < pushDistance; i += step)
                        {
                            var endPositionEx = Prediction.UnitPosition.Extend(ObjectManager.Player.ServerPosition, -i);
                            if (endPositionEx.IsWall())
                            {
                                var condemnRectangle = new VHRPolygon(VHRPolygon.Rectangle(target.ServerPosition.To2D(), endPosition.To2D(), target.BoundingRadius));

                                if (condemnRectangle.Points
                                    .Count(point => NavMesh.GetCollisionFlags(point.X, point.Y).HasFlag(CollisionFlags.Wall)) >= condemnRectangle.Points.Count() * (20 / 100f))
                                {
                                    E.CastOnUnit(target);
                                    TrinketBush(target.ServerPosition.Extend(ObjectManager.Player.ServerPosition, -450f));
                                }
                                return;
                            }
                        }
                    }
                }
            }
        }