コード例 #1
0
 private void OnOrbwalkingBeforeAttack(Orbwalking.BeforeAttackEventArgs args)
 {
     try
     {
         if (args.Unit.IsMe)
         {
             if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
             {
                 var enemy = args.Target as Obj_AI_Hero;
                 if (enemy != null)
                 {
                     ItemManager.Muramana(enemy, true);
                 }
             }
             else
             {
                 ItemManager.Muramana(null, false);
             }
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
コード例 #2
0
        private void OnOrbwalkingBeforeAttack(Orbwalking.BeforeAttackEventArgs args)
        {
            try
            {
                var t = args.Target as Obj_AI_Hero;
                if (t != null &&
                    (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo ||
                     Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed))
                {
                    args.Process =
                        Menu.Item(
                            Menu.Name + "." +
                            (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo ? "combo" : "harass") + ".aa")
                        .GetValue <bool>();
                    if (!args.Process)
                    {
                        var poison = GetPoisonBuffEndTime(t);
                        args.Process = (!Q.IsReady() || Q.Instance.ManaCost > Player.Mana) &&
                                       ((!E.IsReady() && Game.Time - _lastECast > 3) ||
                                        E.Instance.ManaCost > Player.Mana || poison <= 0 || poison < E.ArrivalTime(t));
                    }
                }
                if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear)
                {
                    args.Process = Menu.Item(Menu.Name + ".lane-clear.aa").GetValue <bool>();
                    if (!args.Process)
                    {
                        var m = args.Target as Obj_AI_Minion;
                        if (m != null && (_lastEEndTime < Game.Time || E.IsReady()) ||
                            (GetPoisonBuffEndTime(m) < E.ArrivalTime(m) || E.Instance.ManaCost > Player.Mana) ||
                            !ResourceManager.Check("lane-clear"))
                        {
                            args.Process = true;
                        }
                    }
                }

                if ((Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit))
                {
                    var m = args.Target as Obj_AI_Minion;
                    if (m != null && E.IsReady() && E.CanCast(m) && E.Instance.ManaCost < Player.Mana)
                    {
                        var useE       = Menu.Item(Menu.Name + ".lasthit.e").GetValue <bool>();
                        var useEPoison = Menu.Item(Menu.Name + ".lasthit.e-poison").GetValue <bool>();
                        if ((useE || useEPoison && GetPoisonBuffEndTime(m) > E.ArrivalTime(m)) &&
                            ResourceManager.Check("lasthit"))
                        {
                            args.Process = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
コード例 #3
0
        /// <summary>
        /// Before attack event
        /// </summary>
        /// <param name="args"></param>
        private void Orbwalking_BeforeAttack(Orbwalking.BeforeAttackEventArgs args)
        {
            try
            {
                if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear)
                {
                    var fishbones = FishbonesLaneClearLogic(args);
                    if (fishbones == null)
                    {
                        return;
                    }

                    args.Target = fishbones.Item2;
                }
                else if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo ||
                         Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed)
                {
                    var target = args.Target as Obj_AI_Base;
                    if (target == null)
                    {
                        return;
                    }

                    var fishbones = FishbonesComboHarassLogic(target);
                    if (fishbones == null)
                    {
                        return;
                    }

                    args.Target = fishbones.Item2;
                }
                else if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit)
                {
                    var fishbones = IsUsingFishbones();
                    if (fishbones)
                    {
                        var target = args.Target as Obj_AI_Base;
                        if (target == null)
                        {
                            return;
                        }

                        if (Player.Distance(target) <= GetRealAutoAttackRange(MinigunRange, target))
                        {
                            Q.Cast();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
コード例 #4
0
        /// <summary>
        /// Should we use fish bones aoe in lane clear
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        private Tuple <int, Obj_AI_Base> FishbonesLaneClearLogic(Orbwalking.BeforeAttackEventArgs args)
        {
            var useQ = Menu.Item(Menu.Name + ".lane-clear.q").GetValue <bool>() && Q.IsReady();

            if (!useQ)
            {
                return(null);
            }

            if (!ResourceManager.Check("lane-clear-q"))
            {
                return(null);
            }

            // If target is a hero don't change anything
            var target = args.Target as Obj_AI_Hero;

            if (target != null)
            {
                return(null);
            }

            var usingFishBones = IsUsingFishbones();

            var bestMinion = BestFishBonesMinion();

            if (bestMinion == null)
            {
                if (usingFishBones)
                {
                    Q.Cast();
                }
                return(null);
            }

            var fishBonesMinimum = Menu.Item(Menu.Name + ".lane-clear.q-min").GetValue <Slider>().Value;

            if (bestMinion.Item1 < fishBonesMinimum)
            {
                if (usingFishBones)
                {
                    Q.Cast();
                }
                return(null);
            }

            if (!usingFishBones)
            {
                Q.Cast();
            }

            return(bestMinion);
        }
コード例 #5
0
        private void OnOrbwalkingBeforeAttack(Orbwalking.BeforeAttackEventArgs args)
        {
            try
            {
                var t = args.Target as Obj_AI_Hero;
                if (t != null &&
                    (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo ||
                     Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed))
                {
                    args.Process = Q.Instance.ManaCost > Player.Mana && W.Instance.ManaCost > Player.Mana &&
                                   (E.Instance.ManaCost > Player.Mana || GetPoisonBuffEndTime(t) < E.ArrivalTime(t)) ||
                                   !Q.IsReady() && !E.IsReady();
                }
                if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear)
                {
                    args.Process = Menu.Item(Menu.Name + ".lane-clear.aa").GetValue <bool>();
                    if (args.Process == false)
                    {
                        var m = args.Target as Obj_AI_Minion;
                        if (m != null && (_lastEEndTime < Game.Time || E.IsReady()) ||
                            (GetPoisonBuffEndTime(m) < E.ArrivalTime(m) || E.Instance.ManaCost > Player.Mana) ||
                            !ManaManager.Check("lane-clear"))
                        {
                            args.Process = true;
                        }
                    }
                }

                if ((Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit))
                {
                    var m = args.Target as Obj_AI_Minion;
                    if (m != null && E.CanCast(m))
                    {
                        if (E.Instance.ManaCost < Player.Mana)
                        {
                            args.Process = Menu.Item(Menu.Name + ".lasthit.e").GetValue <bool>() ||
                                           (Menu.Item(Menu.Name + ".lasthit.e-poison").GetValue <bool>() &&
                                            GetPoisonBuffEndTime(m) > E.ArrivalTime(m)) && ManaManager.Check("lasthit");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
コード例 #6
0
ファイル: TwistedFate.cs プロジェクト: jayblah/Lizzaran
        private void OnOrbwalkingBeforeAttack(Orbwalking.BeforeAttackEventArgs args)
        {
            try
            {
                var hero = args.Target as Obj_AI_Hero;
                if (hero != null)
                {
                    args.Process = Cards.Status != SelectStatus.Selecting && !Cards.ShouldWait;
                    if (args.Process)
                    {
                        if (Cards.Has(CardColor.Gold))
                        {
                            _wTarget        = hero;
                            _wTargetEndTime = Game.Time + 5f;

                            var target = TargetSelector.GetTarget(W, false);
                            if (target != null && !target.NetworkId.Equals(hero.NetworkId))
                            {
                                Orbwalker.ForceTarget(target);
                                args.Process = false;
                            }
                        }
                    }
                }
                else
                {
                    if (Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.Flee &&
                        Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.None)
                    {
                        if (Cards.Has(CardColor.Gold) || Cards.Has(CardColor.Blue))
                        {
                            var targets = TargetSelector.GetTargets(
                                Orbwalking.GetRealAutoAttackRange(null) * 1.25f, DamageType.Magical);
                            if (targets != null)
                            {
                                var target = targets.FirstOrDefault(Orbwalking.InAutoAttackRange);
                                if (target != null)
                                {
                                    Orbwalker.ForceTarget(target);
                                    args.Process = false;
                                }
                            }
                        }
                    }
                }
                if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear ||
                    Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit)
                {
                    if (Cards.Has(CardColor.Red))
                    {
                        var target = Orbwalker.ForcedTarget();
                        if (target != null && target.NetworkId != args.Target.NetworkId)
                        {
                            args.Process = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
コード例 #7
0
ファイル: Viktor.cs プロジェクト: 4859aa/LeagueSharp-Dev
 private void OnOrbwalkingBeforeAttack(Orbwalking.BeforeAttackEventArgs args)
 {
     try
     {
         if (HasQBuff())
         {
             if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
             {
                 if ((_rObject == null || !_rObject.IsValid) && R.IsReady() && UltimateManager.Combo() &&
                     R.Instance.Name.Equals("ViktorChaosStorm", StringComparison.OrdinalIgnoreCase) &&
                     GameObjects.EnemyHeroes.Any(Orbwalking.InAutoAttackRange) &&
                     (RLogicDuel(true, Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady(), true) ||
                      GameObjects.EnemyHeroes.Where(e => e.IsValidTarget(R.Range + R.Width))
                      .Any(
                          e =>
                          RLogic(
                              e, Menu.Item(Menu.Name + ".ultimate.combo.min").GetValue <Slider>().Value,
                              Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                              Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady(), true))))
                 {
                     args.Process = false;
                     return;
                 }
             }
             if (!(args.Target is Obj_AI_Hero))
             {
                 var targets = TargetSelector.GetTargets(Player.AttackRange + Player.BoundingRadius * 3f);
                 if (targets != null && targets.Any())
                 {
                     var hero = targets.FirstOrDefault(Orbwalking.InAutoAttackRange);
                     if (hero != null)
                     {
                         Orbwalker.ForceTarget(hero);
                         args.Process = false;
                     }
                     else if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed)
                     {
                         if (
                             targets.Any(
                                 t =>
                                 t.Distance(Player) <
                                 (Player.BoundingRadius + t.BoundingRadius + Player.AttackRange) *
                                 (IsSpellUpgraded(Q) ? 1.4f : 1.2f)))
                         {
                             args.Process = false;
                         }
                     }
                 }
             }
         }
         else
         {
             if ((args.Target is Obj_AI_Hero) &&
                 (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo ||
                  Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed) &&
                 (Q.IsReady() && Player.Mana >= Q.Instance.ManaCost ||
                  E.IsReady() && Player.Mana >= E.Instance.ManaCost))
             {
                 args.Process = false;
             }
         }
         if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit ||
             Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear)
         {
             var minion = args.Target as Obj_AI_Minion;
             if (minion != null &&
                 HealthPrediction.LaneClearHealthPrediction(
                     minion, (int)(Player.AttackDelay * 1000), Game.Ping / 2) <
                 Player.GetAutoAttackDamage(minion))
             {
                 _lastBeforeFarmTarget = minion;
             }
             if (_lastQKillableTarget != null && _lastQKillableTarget.NetworkId == args.Target.NetworkId)
             {
                 args.Process = false;
             }
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
コード例 #8
0
        private void OnOrbwalkingBeforeAttack(Orbwalking.BeforeAttackEventArgs args)
        {
            try
            {
                if (!args.Unit.IsMe)
                {
                    return;
                }
                var hero = args.Target as Obj_AI_Hero;
                if (hero != null)
                {
                    args.Process = Cards.Status != SelectStatus.Selecting && !Cards.ShouldWait;
                    if (args.Process)
                    {
                        if (Cards.Has(CardColor.Gold))
                        {
                            _wTarget        = hero;
                            _wTargetEndTime = Game.Time + 5f;

                            var target = TargetSelector.GetTarget(W, false);
                            if (target != null && !target.NetworkId.Equals(hero.NetworkId))
                            {
                                Orbwalker.ForceTarget(target);
                                args.Process = false;
                            }
                        }
                    }
                }
                else
                {
                    if (Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.Flee &&
                        Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.None)
                    {
                        if (Cards.Has(CardColor.Gold) || Cards.Has(CardColor.Blue))
                        {
                            var targets = TargetSelector.GetTargets(
                                Orbwalking.GetRealAutoAttackRange(null) * 1.25f, DamageType.Magical);
                            if (targets != null)
                            {
                                var target = targets.FirstOrDefault(Orbwalking.InAutoAttackRange);
                                if (target != null)
                                {
                                    Orbwalker.ForceTarget(target);
                                    args.Process = false;
                                }
                            }
                        }
                    }
                }
                if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear ||
                    Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit)
                {
                    if (Cards.Has(CardColor.Red))
                    {
                        var bestMinion = BestRedMinion();
                        var buff       = ObjectManager.Player.GetBuff("redcardpreattack");
                        if (bestMinion != null && bestMinion.NetworkId != args.Target.NetworkId &&
                            (buff == null || buff.EndTime - Game.Time > 0.15f))
                        {
                            Orbwalker.ForceTarget(bestMinion);
                            args.Process = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }