Пример #1
0
        /// <summary>
        /// Called when an enemy gapcloser is casted on the player.
        /// </summary>
        /// <param name="gapcloser">The gapcloser.</param>
        private void OnEnemyGapcloser(ActiveGapcloser gapcloser)
        {
            var antigapcloserEnabled = MenuExtensions.GetItemValue <bool>("solo.vayne.misc.miscellaneous.antigapcloser");
            var endPosition          = gapcloser.End;

            if (!antigapcloserEnabled || !Variables.spells[SpellSlot.E].IsReady() || !gapcloser.Sender.IsValidTarget() ||
                ObjectManager.Player.Distance(endPosition) > 400)
            {
                return;
            }

            //Smart
            var ShouldBeRepelled = CustomAntiGapcloser.SpellShouldBeRepelledOnSmartMode(gapcloser.SData.Name);

            if (ShouldBeRepelled)
            {
                LeagueSharp.Common.Utility.DelayAction.Add(MenuExtensions.GetItemValue <Slider>("solo.vayne.misc.miscellaneous.delay").Value,
                                                           () =>
                {
                    Variables.spells[SpellSlot.E].Cast(gapcloser.Sender);
                });
            }
            else
            {
                //Use Q
                var extendedPosition = ObjectManager.Player.ServerPosition.Extend(endPosition, -300f);
                if (!extendedPosition.UnderTurret(true) &&
                    !(extendedPosition.CountEnemiesInRange(400f) >= 2 && extendedPosition.CountAlliesInRange(400f) < 3))
                {
                    LeagueSharp.Common.Utility.DelayAction.Add(MenuExtensions.GetItemValue <Slider>("solo.vayne.misc.miscellaneous.delay").Value,
                                                               () =>
                    {
                        Variables.spells[SpellSlot.Q].Cast(extendedPosition);
                    });
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Called when an enemy gapcloser is casted on the player.
        /// </summary>
        /// <param name="gapcloser">The gapcloser.</param>
        private void OnEnemyGapcloser(ActiveGapcloser gapcloser)
        {
            var antigapcloserEnabled = MenuExtensions.GetItemValue<bool>("solo.vayne.misc.miscellaneous.antigapcloser");
            var endPosition = gapcloser.End;

            if (!antigapcloserEnabled || !Variables.spells[SpellSlot.E].IsReady() || !gapcloser.Sender.IsValidTarget() ||
                ObjectManager.Player.Distance(endPosition) > 400)
            {
                return;
            }

            //Smart
            var ShouldBeRepelled = CustomAntiGapcloser.SpellShouldBeRepelledOnSmartMode(gapcloser.SData.Name);

            if (ShouldBeRepelled)
            {
                LeagueSharp.Common.Utility.DelayAction.Add(MenuExtensions.GetItemValue<Slider>("solo.vayne.misc.miscellaneous.delay").Value,
                    () =>
                    {
                            Variables.spells[SpellSlot.E].Cast(gapcloser.Sender);
                    });
            }
            else
            {
                //Use Q
                var extendedPosition = ObjectManager.Player.ServerPosition.Extend(endPosition, -300f);
                if (!extendedPosition.UnderTurret(true) &&
                    !(extendedPosition.CountEnemiesInRange(400f) >= 2 && extendedPosition.CountAlliesInRange(400f) < 3))
                {
                    LeagueSharp.Common.Utility.DelayAction.Add(MenuExtensions.GetItemValue<Slider>("solo.vayne.misc.miscellaneous.delay").Value,
                    () =>
                    {
                            Variables.spells[SpellSlot.Q].Cast(extendedPosition);
                    });
                }
            }
        }