Exemple #1
0
        private static void WardJump(AIHeroClient target)
        {
            var pred = SpellManager.W1.GetPrediction(target);

            if (WardManager.CanWardJump && pred.HitChancePercent >= 30f)
            {
                var gapclosepos = pred.CastPosition + (pred.CastPosition - ExpectedEndPosition).Normalized() * DistanceBetween;
                if (Extensions.Distance(gapclosepos, Util.myHero, true) <= Math.Pow(WardManager.WardRange, 2) && Extensions.Distance(gapclosepos, target, true) <= Math.Pow(SpellManager.R.Range, 2) && Extensions.Distance(gapclosepos, target, true) < Extensions.Distance(gapclosepos, ExpectedEndPosition, true))
                {
                    if (Orbwalker.CanMove)
                    {
                        LastGapcloseAttempt = Game.Time;
                        Orbwalker.MoveTo(gapclosepos + (gapclosepos - ExpectedEndPosition).Normalized() * (DistanceBetween + Util.myHero.BoundingRadius / 2));
                    }
                    AllySelected                = null;
                    PositionSelected            = EndPosition;
                    LastSetPositionTime         = Game.Time;
                    TargetSelector.ForcedTarget = target;
                    var obj = Champion.GetBestObjectNearTo(gapclosepos);
                    if (obj != null && Extensions.Distance(obj, target, true) < Extensions.Distance(obj, ExpectedEndPosition, true))
                    {
                        SpellManager.CastW1(obj);
                    }
                    else
                    {
                        WardManager.CastWardTo(gapclosepos);
                    }
                }
            }
        }
Exemple #2
0
 public static void Execute()
 {
     if (SpellManager.CanCastW1)
     {
         var obj = Champion.GetBestObjectNearTo(Util.MousePos);
         if (obj != null && Menu.GetCheckBoxValue("W"))
         {
             SpellManager.CastW1(obj);
         }
         else if (Menu.GetCheckBoxValue("WardJump"))
         {
             if (WardManager.CanCastWard)
             {
                 WardManager.CastWardTo(Util.MousePos);
             }
         }
     }
 }