예제 #1
0
        public static bool InCatchRadius(Axe a)
        {
            var mode = Program.Config.Item("catchRadiusMode").GetValue <StringList>().SelectedIndex;

            switch (mode)
            {
            case 1:
                var b =
                    new Geometry.Sector(
                        Player.Position.To2D(), Game.CursorPos.To2D() - Player.Position.To2D(),
                        Program.Config.Item("sectorAngle").GetValue <Slider>().Value *(float)Math.PI / 180,
                        Program.Config.Item("catchRadius").GetValue <Slider>().Value).ToPolygon()
                    .IsOutside(a.AxeObj.Position.Extend(Game.CursorPos, 30).To2D());
                return(!b);

            default:
                return(a.AxeObj.Position.Distance(Game.CursorPos) <
                       Program.Config.Item("catchRadius").GetValue <Slider>().Value);
            }
        }
예제 #2
0
        public static bool InCatchRadius(Axe a)
        {
            var mode   = Program.Config.Item("catchRadiusMode").GetValue <StringList>().SelectedIndex;
            var target = TargetSelector.GetTarget(1000, TargetSelector.DamageType.Physical);

            switch (mode)
            {
            case 1:
                if (!target.IsValidTarget())
                {
                    break;
                }
                return(a.AxeObj.Position.Distance(target.Position) <
                       Program.Config.Item("catchRadius").GetValue <Slider>().Value);

            default:
                return(a.AxeObj.Position.Distance(Game.CursorPos) <
                       Program.Config.Item("catchRadius").GetValue <Slider>().Value);
            }
            return(a.AxeObj.Position.Distance(Game.CursorPos) <
                   Program.Config.Item("catchRadius").GetValue <Slider>().Value);
        }
예제 #3
0
        public static bool CanMakeIt(int time)
        {
            var axeMinValue = int.MaxValue;
            Axe selectedAxe = null;

            foreach (var axe in AxeSpots.Where(a => a.AxeObj.IsValid))
            {
                if (axeMinValue > axe.EndTick)
                {
                    axeMinValue = axe.EndTick;
                    selectedAxe = axe;
                }
            }

            if (selectedAxe == null)
            {
                return(true);
            }

            return(time +
                   ((Player.Distance(selectedAxe.AxeObj.Position.Extend(Game.CursorPos, 100)) / Player.MoveSpeed) * 1000) +
                   Environment.TickCount < selectedAxe.EndTick);
        }
예제 #4
0
        public static void CatchAxes()
        {
            Orbwalker.SetAttack(false);
            Orbwalker.SetMovement(false);
            var axeMinValue = int.MaxValue;
            Axe selectedAxe = null;

            foreach (var axe in AxeSpots.Where(a => a.AxeObj.IsValid))
            {
                if (axeMinValue > axe.EndTick)
                {
                    axeMinValue = axe.EndTick;
                    selectedAxe = axe;
                }
            }

            var turret =
                ObjectManager.Get <Obj_Turret>()
                .FirstOrDefault(t => t.IsEnemy && t.Position.Distance(Player.Position) < 2000 && t.Health > 0);

            for (var i = 0; i < AxeSpots.Count; i++)
            {
                if (AxeSpots[i].EndTick < Environment.TickCount ||
                    (Program.Config.Item("ignoreTowerReticle").GetValue <bool>() &&
                     (turret != null && AxeSpots[i].AxeObj.Position.Distance(turret.Position) < 1000)))
                {
                    AxeSpots.RemoveAt(i);
                    return;
                }
            }

            if (GetTarget() != null && GetTarget().IsValidTarget())
            {
                Orbwalker.ForceTarget(GetTarget() as Obj_AI_Base);
            }

            else if (selectedAxe != null && Player.Distance(selectedAxe.AxeObj.Position) < 100 &&
                     InCatchRadius(selectedAxe))
            {
                Orbwalker.ForceTarget(null);
                Player.IssueOrder(GameObjectOrder.MoveTo, selectedAxe.AxeObj.Position.Extend(Game.CursorPos, 95));
                return;

/*
 *               if (AxeSpots.Count == 2 && Program.Config.Item("useWCatch").GetValue<bool>() && Program._spells[Spells.W].IsReady() && !CanMakeIt((int) (((selectedAxe.EndTick / 1000) - (Environment.TickCount / 1000)) * Player.MoveSpeed)) &&
 *                  (selectedAxe.AxeObj.Position.Distance(Player.Position) <
 *                   ((selectedAxe.EndTick / 1000 - Environment.TickCount / 1000) *
 *                    (Player.MoveSpeed *
 *                     new[] { 1.40f, 1.45f, 1.50f, 1.55f, 1.60f }[Program._spells[Spells.W].Level - 1]))))
 *              {
 *                  Program._spells[Spells.W].Cast();
 *                  Player.IssueOrder(GameObjectOrder.MoveTo, selectedAxe.AxeObj.Position.Extend(Game.CursorPos, 95));
 *                  return;
 *              }
 */
            }


            if (Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.None)
            {
                if (selectedAxe == null || AxeSpots.Count == 0 || Player.Distance(selectedAxe.AxeObj.Position) <= 100 ||
                    GetTarget().IsValid <Obj_AI_Hero>() &&
                    Player.GetAutoAttackDamage(GetTarget() as Obj_AI_Base) * 2 > GetTarget().Health ||
                    !Program.Config.Item("catching").GetValue <KeyBind>().Active || !InCatchRadius(selectedAxe))
                {
                    Orbwalker.SetOrbwalkingPoint(Game.CursorPos);
                    Orbwalker.SetAttack(true);
                    if (selectedAxe != null && Player.Distance(selectedAxe.AxeObj.Position) < 100)
                    {
                        return;
                    }
                    Orbwalker.SetMovement(true);
                    return;
                }
                if ((Player.AttackDelay +
                     ((Player.Distance(selectedAxe.AxeObj.Position.Extend(Game.CursorPos, 100)) / Player.MoveSpeed) *
                      1000) + Environment.TickCount < selectedAxe.EndTick &&
                     GetTarget().IsValidTarget(Orbwalking.GetRealAutoAttackRange(Player)) && CanAa ||
                     Player.Distance(selectedAxe.AxeObj.Position) <= 100))
                {
                    Orbwalker.SetOrbwalkingPoint(Game.CursorPos);
                    Orbwalker.SetAttack(true);
                    if (Player.Distance(selectedAxe.AxeObj.Position) < 100)
                    {
                        return;
                    }
                    Orbwalker.SetMovement(true);
                    return;
                }
            }

            if (selectedAxe == null)
            {
                return;
            }

            if (Player.Distance(selectedAxe.AxeObj.Position) < 100 || !InCatchRadius(selectedAxe))
            {
                return;
            }


            Orbwalker.SetMovement(true);
            Player.IssueOrder(GameObjectOrder.MoveTo, selectedAxe.AxeObj.Position.Extend(Game.CursorPos, 95));

/*
 *          if (AxeSpots.Count == 2 && Program.Config.Item("useWCatch").GetValue<bool>() &&
 *              Program._spells[Spells.W].IsReady() &&
 *              selectedAxe.AxeObj.Position.Distance(Player.Position) >
 *              ((selectedAxe.EndTick / 1000 - Environment.TickCount / 1000) * (Player.MoveSpeed)) &&
 *              (selectedAxe.AxeObj.Position.Distance(Player.Position) <
 *               ((selectedAxe.EndTick / 1000 - Environment.TickCount / 1000) *
 *                (Player.MoveSpeed * new[] { 1.40f, 1.45f, 1.50f, 1.55f, 1.60f }[Program._spells[Spells.W].Level - 1]))))
 *          {
 *              Program._spells[Spells.W].Cast();
 *              Orbwalker.SetMovement(true);
 *              Player.IssueOrder(GameObjectOrder.MoveTo, selectedAxe.AxeObj.Position.Extend(Game.CursorPos, 95));
 *              return;
 *          }
 */
        }
예제 #5
0
 public static bool InCatchRadius(Axe a)
 {
     var mode = Program.Config.Item("catchRadiusMode").GetValue<StringList>().SelectedIndex;
     switch (mode)
     {
         case 1:
             var b = new Geometry.Sector(Player.Position.To2D(), Game.CursorPos.To2D() - Player.Position.To2D(), Program.Config.Item("sectorAngle").GetValue<Slider>().Value * (float)Math.PI / 180, Program.Config.Item("catchRadius").GetValue<Slider>().Value).ToPolygon()
                 .IsOutside(a.AxeObj.Position.Extend(Game.CursorPos, 30).To2D());
             return !b;
         default:
             return a.AxeObj.Position.Distance(Game.CursorPos) <
                    Program.Config.Item("catchRadius").GetValue<Slider>().Value;
     }
 }