/// <summary>
        ///     Called on process spell cast;
        /// </summary>
        /// <param name="args">The <see cref="AIBaseClientCastEventArgs" /> instance containing the event data.</param>
        public void OnProcessSpellCast(AIBaseClientCastEventArgs args)
        {
            /*
             * if (args.Caster.IsMe())
             * {
             * switch (args.Slot)
             * {
             *              case SpellSlot.E:
             *                      LastECastTime = Game.TickCount;
             *                      break;
             * }
             * }*/

            var target = args.Target as AIHeroClient;

            if (target == null ||
                !Extensions.GetAllyHeroesTargetsInRange(SpellClass.E.Range).Contains(target))
            {
                return;
            }

            if (SpellClass.E.Ready &&
                Bools.ShouldShieldAgainstSender(args.Caster) &&
                MenuClass.E["protect"].Enabled &&
                MenuClass.E["protectwhitelist"][target.CharName.ToLower()].Enabled &&
                target.HPPercent() <= MenuClass.E["protectwhitelist"][target.CharName.ToLower()].Value)
            {
                SpellClass.E.CastOnUnit(target);
            }
        }
Exemple #2
0
        public static void OnFinishCast(AIBaseClientCastEventArgs args)
        {
            if (!args.Caster.IsMe())
            {
                return;
            }

            if (!BurstKey.Enabled || BurstMode.Value != 0)
            {
                return;
            }

            if (BurstTarget == null)
            {
                return;
            }


            switch (args.Slot)
            {
            case SpellSlot.R:
                Q.Cast(BurstTarget);
                break;

            case SpellSlot.Q:
                W.Cast(BurstTarget);
                BurstTarget = null;
                break;
            }
        }
 /// <summary>
 ///     Called on do-cast.
 /// </summary>
 /// <param name="args">The <see cref="AIBaseClientCastEventArgs" /> instance containing the event data.</param>
 private static void OnProcessBasicAttack(AIBaseClientCastEventArgs args)
 {
     if (args.Caster is AIHeroClient)
     {
         Logging.Log("Autoattack Name: " + args.SpellData.Name);
     }
 }
Exemple #4
0
 /// <summary>
 ///     Called while processing spellcast operations.
 /// </summary>
 /// <param name="args">The <see cref="AIBaseClientCastEventArgs" /> instance containing the event data.</param>
 public void OnProcessSpellCast(AIBaseClientCastEventArgs args)
 {
     if (args.Caster.IsMe())
     {
         switch (args.Slot)
         {
         case SpellSlot.E:
             LastCastedETime = Game.ClockTime;
             break;
         }
     }
 }
Exemple #5
0
        /// <summary>
        ///     Called while processing spellcast operations.
        /// </summary>
        /// <param name="args">The <see cref="AIBaseClientCastEventArgs" /> instance containing the event data.</param>
        public void OnProcessSpellCast(AIBaseClientCastEventArgs args)
        {
            if (args.Caster.IsMe())
            {
                switch (args.Slot)
                {
                case SpellSlot.Q:
                case SpellSlot.W:
                case SpellSlot.E:
                    if (UtilityClass.Player.HasBuff("AhriTumble") &&
                        MenuClass.Spells["r"]["customization"]["onlyrfirst"].As <MenuBool>().Enabled)
                    {
                        break;
                    }

                    if (!UtilityClass.Player.HasBuff("AhriTumble") &&
                        MenuClass.Spells["r"]["customization"]["onlyrstarted"].As <MenuBool>().Enabled)
                    {
                        break;
                    }

                    if (SpellClass.R.Ready &&
                        MenuClass.Spells["r"]["combo"].As <MenuBool>().Enabled)
                    {
                        const float rRadius    = 500f;
                        var         heroTarget = Extensions.GetBestEnemyHeroTargetInRange(SpellClass.R.Range + rRadius);
                        if (heroTarget == null ||
                            Invulnerable.Check(heroTarget, DamageType.Magical) ||
                            !MenuClass.Spells["r"]["whitelist"][heroTarget.CharName.ToLower()].As <MenuBool>().Enabled)
                        {
                            break;
                        }

                        var position = UtilityClass.Player.Position.Extend(Hud.CursorPositionUnclipped, SpellClass.R.Range);
                        if (heroTarget.IsValidTarget(rRadius, false, false, position))
                        {
                            DelayAction.Queue(() => SpellClass.R.Cast(position), 200 + EnetClient.Ping);
                        }
                    }
                    break;

                case SpellSlot.R:
                    if (SpellClass.W.Ready &&
                        MenuClass.Spells["w"]["combo"].As <MenuBool>().Enabled)
                    {
                        SpellClass.W.Cast();
                    }
                    break;
                }
            }
        }
Exemple #6
0
        /// <summary>
        ///     Handles the <see cref="E:ProcessSpell" /> event.
        /// </summary>
        /// <param name="args">The <see cref="AIBaseClientCastEventArgs" /> instance containing the event data.</param>
        public void OnProcessSpellCast(AIBaseClientCastEventArgs args)
        {
            if (args.Caster.IsMe())
            {
                switch (args.SpellData.Name)
                {
                case "JhinR":
                    UltimateShotsCount = 0;
                    End = args.EndPosition;
                    break;

                case "JhinRShot":
                    UltimateShotsCount++;
                    break;
                }
            }
        }
        /// <summary>
        ///     Called on process spellcast.
        /// </summary>
        /// <param name="args">The <see cref="AIBaseClientCastEventArgs" /> instance containing the event data.</param>
        private static void OnProcessSpellCast(AIBaseClientCastEventArgs args)
        {
            if (args.Caster.IsMe())
            {
                var spellData = args.SpellData;

                Logging.Log("----------------------------------------------");
                Logging.Log("Name: " + spellData.Name);
                Logging.Log("Width: " + spellData.LineWidth);
                Logging.Log("CastRange: " + spellData.CastRange);
                Logging.Log("CastRadius: " + spellData.CastRadius);
                Logging.Log("CastRangeDisplayOverride: " + spellData.CastRangeDisplayOverride);
                Logging.Log("CastRadiusSecondary: " + spellData.CastRadiusSecondary);
                Logging.Log("MissileSpeed: " + spellData.MissileSpeed);
                Logging.Log("----------------------------------------------");
            }
        }
Exemple #8
0
        /// <summary>
        ///     Called after processing spellcast operations.
        /// </summary>
        /// <param name="args">The <see cref="AIBaseClientCastEventArgs" /> instance containing the event data.</param>
        public void OnFinishCast(AIBaseClientCastEventArgs args)
        {
            if (args.Caster.IsMe())
            {
                switch (args.Slot)
                {
                case SpellSlot.W when MenuClass.Root["pattern"].Value != 1:
                    SpellClass.E.Cast(args.EndPosition);
                    break;

                /// <summary>
                ///     Automatically Mount on R Logic.
                /// </summary>
                case SpellSlot.R:
                    if (SpellClass.R.Ready &&
                        MenuClass.R["mountr"].Enabled)
                    {
                        DelayAction.Queue(() => { SpellClass.R.CastOnUnit(UtilityClass.Player); }, 500);
                    }
                    break;
                }
            }
        }
Exemple #9
0
        public static void OnProcessCast(AIBaseClientCastEventArgs args)
        {
            if (!args.Caster.IsMe())
            {
                return;
            }

            switch (args.SpellData.Name)
            {
            case "XerathLocusOfPower2":
                RCharge.CastT         = 0;
                RCharge.Index         = 0;
                RCharge.Position      = new Vector3();
                RCharge.TapKeyPressed = false;
                break;

            case "XerathLocusPulse":
                RCharge.CastT = Game.TickCount;
                RCharge.Index++;
                RCharge.Position      = args.EndPosition;
                RCharge.TapKeyPressed = false;
                break;
            }
        }
Exemple #10
0
        /// <summary>
        ///     Called on do-cast.
        /// </summary>
        /// <param name="args">The <see cref="AIBaseClientCastEventArgs" /> instance containing the event data.</param>
        public void OnProcessSpellCast(AIBaseClientCastEventArgs args)
        {
            if (args.Caster.IsMe())
            {
                /// <summary>
                ///     Initializes the orbwalkingmodes.
                /// </summary>
                switch (Orbwalker.Mode)
                {
                case OrbwalkingMode.Combo:
                    switch (args.SpellData.Name)
                    {
                    //case "CaitlynEntrapment":
                    case "CaitlynEntrapmentMissile":
                        if (SpellClass.W.Ready &&
                            MenuClass.W["triplecombo"].Enabled)
                        {
                            var bestTarget = ObjectCache.EnemyHeroes
                                             .Where(t => !Invulnerable.Check(t) && t.IsValidTarget(SpellClass.W.Range))
                                             .MinBy(o => o.Distance(args.EndPosition));
                            if (bestTarget != null &&
                                CanTrap(bestTarget))
                            {
                                SpellClass.W.Cast(UtilityClass.Player.Position.Extend(bestTarget.Position,
                                                                                      UtilityClass.Player.Distance(bestTarget) + bestTarget.BoundingRadius));
                                //UpdateEnemyTrapTime(bestTarget.NetworkID);
                            }
                        }

                        break;
                    }

                    break;
                }
            }
        }
Exemple #11
0
        private static void OnProcessSpellCast(AIBaseClientCastEventArgs args)
        {
            var heroSender = args.Caster as AIHeroClient;

            if (heroSender == null ||
                !heroSender.IsValidTarget(isAllyAllowed: true))
            {
                return;
            }

            var argsName = args.SpellData.Name.ToLower();

            if (!Spells.Any(x => x.SpellName.ToLower().Equals(argsName)))
            {
                return;
            }

            if (!Gapclosers.ContainsKey(heroSender.NetworkID))
            {
                //GameConsole.Print($"Gapclosers Add: {heroSender.NetworkID}");
                Gapclosers.Add(heroSender.NetworkID, new GapcloserArgs());
            }

            var unit = Gapclosers[heroSender.NetworkID];

            unit.Unit          = heroSender;
            unit.Slot          = args.Slot;
            unit.Target        = args.Target;
            unit.Type          = args.Target != null ? Type.Targeted : Type.SkillShot;
            unit.SpellName     = args.SpellData.Name;
            unit.StartPosition = args.StartPosition;

            if (Spells.Any(e => e.SpellName == argsName))
            {
                var spell = Spells.FirstOrDefault(e => e.SpellName == argsName);
                if (spell.IsReversedDash)
                {
                    unit.EndPosition = unit.Unit.Position.Extend(args.EndPosition, -spell.Range);
                }
                else if (Math.Abs(spell.Range) > 0)
                {
                    unit.EndPosition = unit.Unit.Position.Extend(args.EndPosition, spell.Range);
                }
                else
                {
                    unit.EndPosition = args.EndPosition;
                }
            }
            else
            {
                unit.EndPosition = args.EndPosition;
            }

            if (unit.EndPosition.IsWall())
            {
                for (var i = 25; i < args.StartPosition.Distance(unit.EndPosition); i += 25)
                {
                    var nextEndPos = args.StartPosition.Extend(unit.EndPosition, i * 2);
                    if (nextEndPos.IsWall())
                    {
                        unit.EndPosition = args.StartPosition.Extend(unit.EndPosition, i);
                    }
                }
            }

            unit.StartTick = Game.TickCount;
        }
        /// <summary>
        ///     Called on process autoattack.
        /// </summary>
        /// <param name="args">The <see cref="AIBaseClientCastEventArgs" /> instance containing the event data.</param>
        public void OnProcessBasicAttack(AIBaseClientCastEventArgs args)
        {
            if (UtilityClass.PlayerData.TotalAbilityDamage() >= GetMinimumApForApMode())
            {
                return;
            }

            var sender     = args.Caster as AIHeroClient;
            var unitTarget = args.Target;

            if (unitTarget == null || sender == null || !sender.IsAlly() || sender.IsMe())
            {
                return;
            }

            var buffMenu = MenuClass.W["buff"];

            if (buffMenu == null ||
                !buffMenu["allywhitelist"][sender.CharName.ToLower()].Enabled)
            {
                return;
            }

            /// <summary>
            ///     The Ally W Logic.
            /// </summary>
            if (SpellClass.W.Ready &&
                sender.IsValidTarget(SpellClass.W.Range, true) &&
                UtilityClass.Player.MPPercent()
                > ManaManager.GetNeededMana(SpellClass.W.Slot, buffMenu["logical"]) &&
                buffMenu["logical"].Enabled)
            {
                var orbWhiteList = buffMenu["orbwhitelist"];
                switch (Orbwalker.Mode)
                {
                case OrbwalkingMode.Combo:
                    if (!(unitTarget is AIHeroClient) ||
                        !orbWhiteList["combo"].Enabled)
                    {
                        return;
                    }
                    break;

                case OrbwalkingMode.Harass:
                    if (!(unitTarget is AIHeroClient) ||
                        !orbWhiteList["harass"].Enabled)
                    {
                        return;
                    }
                    break;

                case OrbwalkingMode.LaneClear:
                    var minionTarget = unitTarget as AIMinionClient;
                    if (minionTarget == null ||
                        !unitTarget.IsStructure() &&
                        !minionTarget.IsLegendaryJungleMinion() ||
                        !orbWhiteList["laneclear"].Enabled)
                    {
                        return;
                    }
                    break;

                default:
                    return;
                }

                SpellClass.W.Cast(sender);
            }
        }