Exemplo n.º 1
0
        /// <summary>
        ///     Called when an enemy gapcloser is casted on the player.
        /// </summary>
        /// <param name="gapcloser">The gapcloser.</param>
        private void OnEnemyGapcloser(AIHeroClient sender, Gapcloser.GapcloserEventArgs gapcloser)
        {
            var antigapcloserEnabled =
                MenuGenerator.MiscMenu["TDVaynemiscmiscellaneousantigapcloser"].Cast <CheckBox>().CurrentValue;
            var endPosition = gapcloser.End;

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

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

            if (ShouldBeRepelled)
            {
                Core.DelayAction(() => { Variables.E.Cast(gapcloser.Sender); },
                                 MenuGenerator.MiscMenu["TDVaynemiscmiscellaneousdelay"].Cast <Slider>().CurrentValue);
            }
            else
            {
                //Use Q
                var extendedPosition = ObjectManager.Player.ServerPosition.Extend(endPosition, -300f);
                if (!extendedPosition.IsUnderTurret() &&
                    !(extendedPosition.CountEnemiesInRange(400f) >= 2 && extendedPosition.CountAlliesInRange(400f) < 3))
                {
                    Core.DelayAction(() => { Player.CastSpell(SpellSlot.Q, extendedPosition.To3D()); },
                                     MenuGenerator.MiscMenu["TDVaynemiscmiscellaneousdelay"].Cast <Slider>().CurrentValue);
                }
            }
        }
Exemplo n.º 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);
                    });
                }
            }
        }