Beispiel #1
0
        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));
            }
        }
Beispiel #2
0
        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))
                        {
                            _qDelay =
                                (int)
                                (((hero.ServerPosition.Distance(Player.ServerPosition) *
                                   (hero.IsFacing(Player) ? 0.9f : 1.1f) / Orbwalking.GetMyProjectileSpeed() +
                                   ObjectManager.Player.AttackCastDelay) * 1000f + Game.Ping / 2f) * 0.8f);
                            _wTarget        = hero;
                            _wTargetEndTime = Game.Time + (Game.Ping / 2000f) + 3f;

                            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));
            }
        }