Esempio n. 1
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (!TickLimiter.CanTick("ModulesLimiter"))
            {
                return;
            }

            switch (Orbwalker.ActiveMode)
            {
            case OrbwalkerMode.Orbwalk:
                var condemnTarget = GetCondemnTarget(ObjectManager.Player.ServerPosition);
                if (spells[SpellSlot.E].IsEnabledAndReady(OrbwalkerMode.Orbwalk) && condemnTarget.IsValidTarget())
                {
                    CastCondemn(condemnTarget);
                }
                break;

            case OrbwalkerMode.Hybrid:
                var condemnTarget_Harass = GetCondemnTarget(ObjectManager.Player.ServerPosition);
                if (spells[SpellSlot.E].IsEnabledAndReady(OrbwalkerMode.Hybrid) && condemnTarget_Harass.IsValidTarget())
                {
                    CastCondemn(condemnTarget_Harass);
                }
                break;
            }

            Orbwalker.Attack   = !VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.general"]["disableaa"].GetValue <MenuBool>().Value;
            Orbwalker.Movement = !VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.general"]["disablemovement"].GetValue <MenuBool>().Value;

            foreach (var Module in VhrModules.Where(module => module.ShouldBeLoaded() && module.ShouldRun()))
            {
                Module.Run();
            }
        }
Esempio n. 2
0
        /// <summary>
        ///     The update function
        /// </summary>
        /// <param name="args">
        ///     The Arguments
        /// </param>
        private void OnUpdate(EventArgs args)
        {
            if (!TickLimiter.CanTick("ModulesLimiter"))
            {
                return;
            }

            switch (Orbwalker.ActiveMode)
            {
            case OrbwalkerMode.Orbwalk:
                this.OnCombo();
                break;

            case OrbwalkerMode.Hybrid:
                this.OnHarass();
                break;

            case OrbwalkerMode.LaneClear:
                this.OnLaneclear();
                break;
            }

            if (this.Menu["com.kalista.flee"]["fleeActive"].GetValue <MenuKeyBind>().Active)
            {
                this.OnFlee();
            }

            this.UpdateFunctions();

            foreach (var module in Modules.Where(x => x.ShouldRun()))
            {
                module.Run();
            }
        }
Esempio n. 3
0
        public static Obj_AI_Hero GetCondemnTarget(Vector3 FromPosition)
        {
            if (TickLimiter.CanTick("CondemnLimiter"))
            {
                if (ObjectManager.Player.IsWindingUp)
                {
                    return(null);
                }

                switch (VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.condemn"]["condemnmethod"].GetValue <MenuList <string> >().Index)
                {
                case 0:
                    ////VHR SDK Condemn Method
                    if (!VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.general"]["lightweight"].GetValue <MenuBool>().Value)
                    {
                        #region VHR SDK Method (Non LW Method)
                        var HeroList =
                            GameObjects.EnemyHeroes.Where(
                                h =>
                                h.IsValidTarget(spells[SpellSlot.E].Range) &&
                                !h.HasBuffOfType(BuffType.SpellShield) &&
                                !h.HasBuffOfType(BuffType.SpellImmunity));
                        var NumberOfChecks =
                            VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.condemn"]["predictionNumber"].GetValue <MenuSlider>().Value;
                        var MinChecksPercent =
                            (VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.condemn"]["accuracy"].GetValue <MenuSlider>().Value);
                        var PushDistance =
                            VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.condemn"]["pushdistance"].GetValue <MenuSlider>().Value;
                        var NextPrediction =
                            (VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.condemn"]["nextprediction"].GetValue <MenuSlider>().Value);
                        var interval         = NextPrediction / NumberOfChecks;
                        var currentInterval  = interval;
                        var LastUnitPosition = Vector3.Zero;

                        foreach (var Hero in HeroList)
                        {
                            if (!TargetPassesCondemnExtraChecks(Hero))
                            {
                                continue;
                            }

                            var PredictionsList = new List <Vector3>();

                            PredictionsList.Add(Hero.ServerPosition);

                            for (var i = 0; i < NumberOfChecks; i++)
                            {
                                var Prediction   = Movement.GetPrediction(Hero, currentInterval);
                                var UnitPosition = Prediction.UnitPosition;
                                if (UnitPosition.DistanceSquared(LastUnitPosition) >=
                                    (Hero.BoundingRadius / 2f) * (Hero.BoundingRadius / 2f))
                                {
                                    PredictionsList.Add(UnitPosition);
                                    LastUnitPosition = UnitPosition;
                                    currentInterval += interval;
                                }
                            }

                            var ExtendedList = new List <Vector3>();

                            foreach (var position in PredictionsList)
                            {
                                ExtendedList.Add(position.Extend(FromPosition, -PushDistance / 4f));
                                ExtendedList.Add(position.Extend(FromPosition, -PushDistance / 2f));
                                ExtendedList.Add(position.Extend(FromPosition, -(PushDistance * 0.75f)));
                                ExtendedList.Add(position.Extend(FromPosition, -PushDistance));
                            }

                            var WallListCount = ExtendedList.Count(h => h.IsWall() || IsJ4Flag(h, Hero));
                            //Console.WriteLine("Actual Preds: {0} Walllist count: {1} TotalList: {2} Percent: {3}", PredictionsList.Count, WallListCount, ExtendedList.Count, ((float)WallListCount / (float)ExtendedList.Count));

                            if (((float)WallListCount / (float)ExtendedList.Count) >= MinChecksPercent / 100f)
                            {
                                return(Hero);
                            }
                        }

                        #endregion
                    }
                    else
                    {
                        #region VHR SDK Method (LW Method)
                        //// ReSharper disable once LoopCanBePartlyConvertedToQuery
                        foreach (
                            var target in
                            GameObjects.EnemyHeroes.Where(h => h.IsValidTarget(spells[SpellSlot.E].Range)))
                        {
                            var PushDistance =
                                VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.condemn"]["pushdistance"].GetValue <MenuSlider>().Value;
                            var FinalPosition            = target.ServerPosition.Extend(FromPosition, -PushDistance);
                            var AlternativeFinalPosition = target.ServerPosition.Extend(FromPosition, -(PushDistance / 2f));
                            if (FinalPosition.IsWall() || AlternativeFinalPosition.IsWall())
                            {
                                return(target);
                            }
                        }
                        #endregion
                    }

                    break;

                case 1:
                    ////Marksman/Gosu

                    #region Marksman/Gosu Method
                    //// ReSharper disable once LoopCanBePartlyConvertedToQuery
                    foreach (
                        var target in
                        GameObjects.EnemyHeroes.Where(h => h.IsValidTarget(spells[SpellSlot.E].Range)))
                    {
                        var PushDistance =
                            VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.condemn"]["pushdistance"].GetValue <MenuSlider>().Value;
                        var FinalPosition            = target.ServerPosition.Extend(FromPosition, -PushDistance);
                        var AlternativeFinalPosition = target.ServerPosition.Extend(FromPosition, -(PushDistance / 2f));
                        if (FinalPosition.IsWall() || AlternativeFinalPosition.IsWall() || (IsJ4Flag(FinalPosition, target) || IsJ4Flag(AlternativeFinalPosition, target)))
                        {
                            return(target);
                        }
                    }
                    #endregion

                    break;
                }
            }
            return(null);
        }