Exemple #1
0
 /// <summary>
 /// Determines if a target is in auto attack range.
 /// </summary>
 /// <param name="target">The target.</param>
 /// <returns><c>true</c> if a target is in auto attack range, <c>false</c> otherwise.</returns>
 public virtual bool InAutoAttackRange(AttackableUnit target)
 {
     return(Orbwalking.InAutoAttackRange(target));
 }
Exemple #2
0
        private static void OnDoCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            var spellName = args.SData.Name;

            if (!sender.IsMe || !Orbwalking.IsAutoAttack(spellName))
            {
                return;
            }
            if (args.Target is Obj_AI_Minion)
            {
                Lane.LaneLogic();
            }
            var @base = args.Target as Obj_AI_Turret;

            if (@base != null)
            {
                if (@base.IsValid && args.Target != null && Spells._q.IsReady() && MenuConfig.LaneQ &&
                    Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear))
                {
                    Spells._q.Cast(@base);
                }
            }

            var hero = args.Target as AIHeroClient;

            if (hero == null)
            {
                return;
            }
            var target = hero;

            if (Spells._r.IsReady() && Spells._r.Instance.Name == IsSecondR)
            {
                if (target.Health < Dmg.Rdame(target, target.Health) + Player.GetAutoAttackDamage(target) &&
                    target.Health > Player.GetAutoAttackDamage(target))
                {
                    Spells._r.Cast(target.Position);
                }
            }
            if (Spells._w.IsReady())
            {
                if (target.Health < Spells._w.GetDamage(target) + Player.GetAutoAttackDamage(target) &&
                    target.Health > Player.GetAutoAttackDamage(target))
                {
                    Spells._w.Cast();
                }
            }
            if (Spells._q.IsReady())
            {
                if (target.Health < Spells._q.GetDamage(target) + Player.GetAutoAttackDamage(target) &&
                    target.Health > Player.GetAutoAttackDamage(target))
                {
                    Spells._q.Cast(target);
                }
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                if (HasTitan())
                {
                    CastTitan();
                    return;
                }
                if (Spells._e.IsReady())
                {
                    Spells._e.Cast(target.Position);
                }


                if (Spells._w.IsReady() && Logic.InWRange(target))
                {
                    Spells._w.Cast();
                }

                if (Spells._q.IsReady())
                {
                    Logic.ForceItem();
                    LeagueSharp.Common.Utility.DelayAction.Add(0, () => Logic.ForceCastQ(target));
                }
            }


            if (MenuConfig.fastHar && Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
            {
                if (HasTitan())
                {
                    CastTitan();
                    return;
                }
                if (Spells._w.IsReady() && Logic.InWRange(target))
                {
                    Logic.ForceItem();
                    LeagueSharp.Common.Utility.DelayAction.Add(1, Logic.ForceW);
                    LeagueSharp.Common.Utility.DelayAction.Add(2, () => Logic.ForceCastQ(target));
                }
                else if (Spells._q.IsReady())
                {
                    Logic.ForceItem();
                    LeagueSharp.Common.Utility.DelayAction.Add(1, () => Logic.ForceCastQ(target));
                }
                else if (Spells._e.IsReady() && !Orbwalking.InAutoAttackRange(target) && !Logic.InWRange(target))
                {
                    Spells._e.Cast(target.Position);
                }
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
            {
                if (HasTitan())
                {
                    CastTitan();
                    return;
                }
                if (_qstack == 2 && Spells._q.IsReady())
                {
                    Logic.ForceItem();
                    LeagueSharp.Common.Utility.DelayAction.Add(1, () => Logic.ForceCastQ(target));
                }
            }

            if (!MenuConfig.burst)
            {
                if (HasTitan())
                {
                    CastTitan();
                    return;
                }
                if (Spells._w.IsReady())
                {
                    Spells._w.Cast(target.Position);
                }
                if (Spells._r.IsReady() && Spells._r.Instance.Name == IsSecondR)
                {
                    Logic.ForceItem();
                    LeagueSharp.Common.Utility.DelayAction.Add(1, Logic.ForceR2);
                }
                else if (Spells._q.IsReady())
                {
                    Logic.ForceItem();
                    LeagueSharp.Common.Utility.DelayAction.Add(1, () => Logic.ForceCastQ(target));
                }
            }
        }