示例#1
0
        private void BeforeAttack(Orbwalking.BeforeAttackEventArgs Args)
        {
            if (Menu.Item("Forcus", true).GetValue <bool>())
            {
                if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo ||
                    Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed)
                {
                    foreach (var enemy in HeroManager.Enemies.Where(x => !x.IsDead && !x.IsZombie && HavePassive(x)))
                    {
                        TargetSelector.SetTarget(enemy);
                        return;
                    }
                }
                else if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear)
                {
                    var all = MinionManager.GetMinions(Me.Position, Orbwalking.GetRealAutoAttackRange(Me),
                                                       MinionTypes.All, MinionTeam.NotAlly).Where(HavePassive);

                    if (all.Any())
                    {
                        Orbwalker.ForceTarget(all.FirstOrDefault());
                    }
                }
            }
        }
示例#2
0
        /// <summary>
        /// Called when the module is executed.
        /// </summary>
        public void OnExecute()
        {
            var currentTarget = TargetSelector.GetTarget(Orbwalking.GetRealAutoAttackRange(null) + 260f, TargetSelector.DamageType.Physical);

            if (currentTarget.IsValidTarget())
            {
                if (currentTarget.ServerPosition.Distance(ObjectManager.Player.ServerPosition) <=
                    Orbwalking.GetRealAutoAttackRange(null))
                {
                    return;
                }

                if (HealthPrediction.GetHealthPrediction(currentTarget, (int)(250 + Game.Ping / 2f + 125f)) <
                    ObjectManager.Player.GetAutoAttackDamage(currentTarget) +
                    Variables.spells[SpellSlot.Q].GetDamage(currentTarget) &&
                    HealthPrediction.GetHealthPrediction(currentTarget, (int)(250 + Game.Ping / 2f + 125f)) > 0)
                {
                    var extendedPosition = ObjectManager.Player.ServerPosition.Extend(
                        currentTarget.ServerPosition, 300f);
                    if (extendedPosition.IsSafe() && !extendedPosition.UnderTurret(true))
                    {
                        Orbwalking.ResetAutoAttackTimer();
                        Variables.spells[SpellSlot.Q].Cast(extendedPosition);
                        TargetSelector.SetTarget(currentTarget);
                    }
                }
            }
        }
示例#3
0
        private void BeforeAttack(Orbwalking.BeforeAttackEventArgs Args)
        {
            if (Menu.Item("Forcustarget", true).GetValue <bool>())
            {
                if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo || Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed)
                {
                    foreach (var enemy in HeroManager.Enemies.Where(enemy => Orbwalking.InAutoAttackRange(enemy) && enemy.HasBuff("TristanaEChargeSound")))
                    {
                        TargetSelector.SetTarget(enemy);
                        return;
                    }
                }
            }

            if (Args.Unit.IsMe && Orbwalking.InAutoAttackRange(Args.Target))
            {
                switch (Orbwalker.ActiveMode)
                {
                case Orbwalking.OrbwalkingMode.Combo:
                {
                    if (Menu.Item("ComboQ", true).GetValue <bool>() && Q.IsReady())
                    {
                        if (Menu.Item("ComboQOnlyPassive", true).GetValue <bool>())
                        {
                            var Target = Args.Target.Type == GameObjectType.obj_AI_Hero ? (Obj_AI_Hero)Args.Target : null;

                            if (Target != null &&
                                (Target.HasBuff("TristanaEChargeSound") || Target.HasBuff("TristanaECharge")))
                            {
                                Q.Cast();
                            }
                        }
                        else
                        {
                            Q.Cast();
                        }
                    }
                    break;
                }

                case Orbwalking.OrbwalkingMode.LaneClear:
                {
                    if (Menu.Item("JungleClearQ", true).GetValue <bool>() &&
                        Me.ManaPercent >= Menu.Item("JungleClearMana", true).GetValue <Slider>().Value)
                    {
                        var minion =
                            MinionManager.GetMinions(Orbwalking.GetRealAutoAttackRange(ObjectManager.Player),
                                                     MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth);

                        if (minion.Any(x => x.NetworkId == Args.Target.NetworkId))
                        {
                            Q.Cast();
                        }
                    }

                    break;
                }
                }
            }
        }
示例#4
0
        public void OnExecute()
        {
            var target = HeroManager.Enemies.Find(en => en.IsValidTarget(ObjectManager.Player.AttackRange + 65f + 65f) && en.Has2WStacks());

            if (target != null)
            {
                TargetSelector.SetTarget(target);
                Variables.Orbwalker.ForceTarget(target);
            }

            if (Game.Time < 25 * 60 * 1000)
            {
                var ADC =
                    HeroManager.Enemies.Where(m => TargetSelector.GetPriority(m) > 4 && m.IsValidTarget()).OrderBy(m => m.TotalAttackDamage).FirstOrDefault();

                if (ADC != null && Orbwalking.InAutoAttackRange(ADC))
                {
                    TargetSelector.SetTarget(target);
                    Variables.Orbwalker.ForceTarget(target);
                }
                else
                {
                    TargetSelector.SetTarget(null);
                    Variables.Orbwalker.ForceTarget(Variables.Orbwalker.GetTarget() as Obj_AI_Base);
                }
            }
        }
示例#5
0
        /*
         * private static void Interrupter_OnPosibleToInterrupt(Obj_AI_Base t, InterruptableSpell args)
         * {
         *  if (!Config.Item("InterruptSpells").GetValue<KeyBind>().Active)
         *      return;
         *
         *  if (ObjectManager.Player.ChampionName != "Caitlyn" || ObjectManager.Player.ChampionName != "Jinx")
         *      return;
         *
         *  Spell xSpellSlot = null;
         *
         *  if (ObjectManager.Player.ChampionName == "Caitlyn")
         *  {
         *      xSpellSlot = new Spell(SpellSlot.W);
         *      xSpellSlot.Range = 800f;
         *  }
         *
         *  if (ObjectManager.Player.ChampionName == "Jinx")
         *  {
         *      xSpellSlot = new Spell(SpellSlot.E);
         *      xSpellSlot.Range = 900f;
         *  }
         *  if (xSpellSlot == null)
         *      return;
         *
         *  if (ObjectManager.Player.Distance(t) < xSpellSlot.Range)
         *      xSpellSlot.Cast(t);
         * }
         */
        private static void Game_OnWndProc(WndEventArgs args)
        {
            if (args.Msg != 0x201)
            {
                return;
            }

            foreach (var objAiHero in from hero in ObjectManager.Get <Obj_AI_Hero>()
                     where hero.IsValidTarget()
                     select hero
                     into h
                     orderby h.Distance(Game.CursorPos) descending
                     select h
                     into enemy
                     where enemy.Distance(Game.CursorPos) < 150f
                     select enemy)
            {
                if (objAiHero != null && objAiHero != xSelectedTarget)
                {
                    xSelectedTarget = objAiHero;
                    TargetSelector.SetTarget(objAiHero);
                    Utils.PrintMessage(string.Format("{0} selected.", objAiHero.BaseSkinName));
                }
            }
        }
示例#6
0
        internal static void ExecuteComboLogic(GameObjectProcessSpellCastEventArgs args)
        {
            if (args.Target is Obj_AI_Hero)
            {
                var qReady    = Variables.spells[SpellSlot.Q].IsEnabledAndReady();
                var wReady    = Variables.spells[SpellSlot.W].IsEnabledAndReady();
                var eReady    = Variables.spells[SpellSlot.E].IsEnabledAndReady();
                var target_ex = args.Target as Obj_AI_Hero;

                if (qReady)
                {
                    ExtendedQ();
                }

                if (qReady && (target_ex.Distance(ObjectManager.Player) < Variables.spells[SpellSlot.Q].Range - 65f + 0.25f * target_ex.MoveSpeed) && !LucianHooks.HasPassive)
                {
                    Variables.spells[SpellSlot.Q].CastOnUnit(target_ex);
                    LeagueSharp.Common.Utility.DelayAction.Add((int)(250 + Game.Ping / 2f + ObjectManager.Player.AttackCastDelay + 560f),
                                                               () =>
                    {
                        ExecuteComboLogic(args);
                    });
                    TargetSelector.SetTarget(args.Target as Obj_AI_Hero);
                }

                if (wReady &&
                    !qReady &&
                    target_ex.IsValidTarget(Variables.spells[SpellSlot.W].Range) &&
                    !LucianHooks.HasPassive)
                {
                    Variables.spells[SpellSlot.W].Cast(Variables.spells[SpellSlot.W].GetPrediction(target_ex).CastPosition);
                    LeagueSharp.Common.Utility.DelayAction.Add((int)(250 + Game.Ping / 2f + ObjectManager.Player.AttackCastDelay + 560f), () =>
                    {
                        ExecuteComboLogic(args);
                    });
                    TargetSelector.SetTarget(args.Target as Obj_AI_Hero);
                }

                if (eReady &&
                    target_ex.IsValidTarget(Variables.spells[SpellSlot.Q].Range + 300f + 65) &&
                    !LucianHooks.HasPassive &&
                    !ObjectManager.Player.IsWindingUp)
                {
                    var eProvider    = new EPositionProvider();;
                    var eEndPosition = eProvider.GetEPosition();
                    if (eEndPosition != Vector3.Zero && eEndPosition.Distance(target_ex.ServerPosition) < Orbwalking.GetRealAutoAttackRange(target_ex))
                    {
                        Variables.spells[SpellSlot.E].Cast(eEndPosition);
                        LeagueSharp.Common.Utility.DelayAction.Add((int)(250 + Game.Ping / 2f + ObjectManager.Player.AttackCastDelay + 560f),
                                                                   () =>
                        {
                            Orbwalking.ResetAutoAttackTimer();
                            ExecuteComboLogic(args);
                        });
                        TargetSelector.SetTarget(args.Target as Obj_AI_Hero);
                    }
                }
            }
        }
示例#7
0
        public override void GameOnUpdate(EventArgs args)
        {
            if (R.IsReady())
            {
                var x = 0d;
                if (ObjectManager.Player.HealthPercent < 20 && ObjectManager.Player.CountEnemiesInRange(500) > 0)
                {
                    x = HeroManager.Enemies.Where(e => e.IsValidTarget(1000))
                        .Aggregate(0, (current, enemy) => (int)(current + enemy.Health));
                }
                if (ObjectManager.Player.Health < x)
                {
                    R.Cast(ObjectManager.Player.Position);
                }
            }

            Obj_AI_Hero t = null;

            if (KindredECharge != null)
            {
                t = KindredECharge;
                TargetSelector.SetTarget(KindredECharge);
            }
            else
            {
                t = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);
            }


            if (!t.IsValidTarget())
            {
                return;
            }

            if (ComboActive && !t.HasKindredUltiBuff())
            {
                if (t.IsValidTarget(Q.Range + Orbwalking.GetRealAutoAttackRange(null) + 65) && !t.HasKindredUltiBuff())
                {
                    if (GetValue <bool>("Combo.Q.Use"))
                    {
                        Q.Cast(Game.CursorPos);
                        //var x = CommonUtils.GetDashPosition(E, t, 400);
                        //Q.Cast(x);
                    }

                    if (GetValue <bool>("Combo.E.Use") && E.IsReady() && t.IsValidTarget(E.Range))
                    {
                        E.CastOnUnit(t);
                    }

                    if (GetValue <bool>("Combo.W.Use") && W.IsReady() && t.IsValidTarget(W.Range / 2))
                    {
                        W.Cast(t.Position);
                    }
                }
            }
        }
        public void CanPushDateModel()
        {
            var data = new DateTime(1975, 07, 28);

            Elt.DataContext = data;
            TargetSelector.SetTarget(Elt, target.Object);
            FireMethod(nameof(ITarget.HasDataContext));
            target.Verify(i => i.HasDataContext(data), Times.Once);
        }
示例#9
0
        public void OnExecute()
        {
            var target = HeroManager.Enemies.Find(en => en.IsValidTarget(ObjectManager.Player.AttackRange + 65f + 65f) && en.Has2WStacks());

            if (target != null)
            {
                TargetSelector.SetTarget(target);
            }
        }
示例#10
0
        public void Run()
        {
            var target = HeroManager.Enemies.Find(enemy => enemy.IsValidTarget(ObjectManager.Player.AttackRange + 65f + 65f) &&
                                                  VayneUtility.Has2WStacks(enemy));

            if (target != null)
            {
                TargetSelector.SetTarget(target);
            }
        }
示例#11
0
        // Interrupt Event, test
        private static void Interrupter2_OnInterruptableTarget(AIHeroClient sender,
                                                               Interrupter2.InterruptableTargetEventArgs args)
        {
            if (!Config.Item("Interrupt-Enemies").GetValue <bool>() || !sender.IsValidTarget(200) ||
                args.DangerLevel != Interrupter2.DangerLevel.High || !E.IsReady())
            {
                return;
            }

            E.Cast();
            TargetSelector.SetTarget(sender);
        }
示例#12
0
        private static void Orbwalking_BeforeAttack(Orbwalking.BeforeAttackEventArgs args)
        {
            if (Menu.Item("nightmoon.e.forcetarget").GetValue <bool>())
            {
                if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo || Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed)
                {
                    foreach (var enemy in HeroManager.Enemies.Where(enemy => enemy.HasBuff("TristanaEChargeSound")))
                    {
                        TargetSelector.SetTarget(enemy);
                        return;
                    }
                }
            }

            if (args.Unit.IsMe && Orbwalking.InAutoAttackRange(args.Target))
            {
                switch (Orbwalker.ActiveMode)
                {
                case Orbwalking.OrbwalkingMode.Combo:
                {
                    if (Menu.Item("nightmoon.q.onlye").GetValue <bool>() && CanCastQ())
                    {
                        Obj_AI_Hero Target = args.Target.Type == GameObjectType.obj_AI_Hero ? (Obj_AI_Hero)args.Target : null;

                        if (Target != null && (Target.HasBuff("TristanaEChargeSound") || Target.HasBuff("TristanaECharge")))
                        {
                            Q.Cast();
                        }
                    }
                    else if (!Menu.Item("nightmoon.q.onlye").GetValue <bool>() && CanCastQ())
                    {
                        Q.Cast();
                    }
                    break;
                }

                case Orbwalking.OrbwalkingMode.LaneClear:
                {
                    if (Menu.Item("nightmoon.q.jc").GetValue <bool>())
                    {
                        if (MinionManager.GetMinions(Orbwalking.GetRealAutoAttackRange(ObjectManager.Player), MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth).Any(x => x.NetworkId == args.Target.NetworkId) && CanCastQ())
                        {
                            Q.Cast();
                        }
                    }
                    break;
                }
                }
            }
        }
    public void RemoveHealth(int amount, Transform attacker, bool slowdown = false)
    {
        if (IsInvulnerable) return;

        if (attacker == transform) return;
		if (IsDead)
            return;

        if (_targetSelector != null) _targetSelector.SetTarget(attacker.gameObject);

		CurrentHealth -= amount;

        // TODO: Correct Knockback.
        if (_rigidbody != null && attacker != null)
        {
            var knockbackDirection = (transform.position - attacker.position);
            knockbackDirection.y = 0;
            knockbackDirection.Normalize();
            _rigidbody.MovePosition(transform.position + knockbackDirection);
        }


        if (CurrentHealth <= 0)
        {
            StartCoroutine(PlayDestruction(attacker));
        }

        if (Data.InvulnerabilityTime > 0.0)
        {
            StartCoroutine(SetInvulnerable());
        }

		if (!IsDead && OnHitAudio != null && _audio != null)
		{
			_audio.PlayOneShot(OnHitAudio);
		}
		else if (IsDead && OnDieAudio != null && _audio != null)
		{
			_audio.PlayOneShot(OnDieAudio);
		}


        if( slowdown )
        {
            StartCoroutine(Slowdown());
        }
    }
示例#14
0
        private static void Combo()
        {
            var qTarget =
                HeroManager.Enemies.Find(x => x.HasBuff("ZileanQEnemyBomb") && x.IsValidTarget(spells[Spells.Q].Range));
            var target = qTarget ?? TargetSelector.GetTarget(spells[Spells.Q].Range, TargetSelector.DamageType.Magical);

            if (!target.IsValidTarget())
            {
                return;
            }

            TargetSelector.SetTarget(target);
            Orbwalker.ForceTarget(target);

            if (MenuCheck("ElZilean.Combo.E") && spells[Spells.E].IsReady() &&
                target.IsValidTarget(spells[Spells.E].Range))
            {
                spells[Spells.E].Cast(target);
            }

            var zileanQEnemyBomb =
                HeroManager.Enemies.Find(x => x.HasBuff("ZileanQEnemyBomb") && x.IsValidTarget(spells[Spells.Q].Range));

            if (MenuCheck("ElZilean.Combo.Q") && spells[Spells.Q].IsReady() &&
                target.IsValidTarget(spells[Spells.Q].Range))
            {
                var pred = spells[Spells.Q].GetPrediction(target);
                if (pred.Hitchance >= HitChance.High)
                {
                    spells[Spells.Q].Cast(pred.UnitPosition);
                }
            }

            if (MenuCheck("ElZilean.Combo.W") && zileanQEnemyBomb != null)
            {
                Utility.DelayAction.Add(100, () => { spells[Spells.W].Cast(); });
            }

            if (MenuCheck("ElZilean.Combo.Ignite") && target.IsValidTarget(600f) &&
                IgniteDamage(target) >= target.Health)
            {
                Player.Spellbook.CastSpell(ignite, target);
            }
        }
示例#15
0
        private static void Game_OnUpdate(EventArgs args)
        {
            PlayerRange = Player.AttackRange + 65;
            TargetRange = PlayerRange + 200;

            if (Player.IsDead || !Orbwalking.CanMove(100))
            {
                return;
            }

            if (Root.Item("useflee").GetValue <KeyBind>().Active)
            {
                Orbwalking.Orbwalk(null, Game.CursorPos);
            }

            Secure(Root.Item("autor").GetValue <bool>());

            Combo(Root.Item("useqcombo").GetValue <bool>(), Root.Item("useecombo").GetValue <bool>(),
                  Root.Item("usercombo").GetValue <bool>());

            if (Root.Item("useskin").GetValue <bool>())
            {
                //Player.SetSkin(Player.CharData.BaseSkinName, Root.Item("skinid").GetValue<Slider>().Value);
            }

            if (Root.Item("efocus").GetValue <bool>())
            {
                var ET =
                    HeroManager.Enemies.FirstOrDefault(
                        x => x.HasBuff("tristanaechargesound") || x.HasBuff("tristanaecharge"));

                if (ET.IsValidTarget() && !ET.IsZombie)
                {
                    if (Root.Item("usecombo").GetValue <KeyBind>().Active)
                    {
                        if (Orbwalking.InAutoAttackRange(ET))
                        {
                            TargetSelector.SetTarget(ET);
                            Orbwalker.ForceTarget(ET);
                        }
                    }
                }
            }
        }
示例#16
0
        /// <summary>
        ///     The game on update callback.
        /// </summary>
        /// <param name="args">
        ///     The args.
        /// </param>
        private void Game_OnUpdate(EventArgs args)
        {
            if (ObjectManager.Player.IsDead || MenuGUI.IsChatOpen)
            {
                return;
            }

            if (MyMenu.RootMenu.Item("forceqalways").IsActive())
            {
                var target = HeroManager.Enemies.Find(x => x.IsValidTarget(ObjectManager.Player.AttackRange + 150) &&
                                                      Misc.GetWStacks(x) > 0 && !x.IsDead && x.IsVisible);

                if (target != null)
                {
                    TargetSelector.SetTarget(target);
                }
            }

            this.spells.Where(spell => IsSpellActive(spell.SpellSlot, Orbwalking.OrbwalkingMode.Combo))
            .ToList()
            .ForEach(spell => spell.OnCombo());

            this.spells.Where(spell => IsSpellActive(spell.SpellSlot, Orbwalking.OrbwalkingMode.Mixed))
            .ToList()
            .ForEach(spell => spell.OnMixed());

            this.spells.Where(spell => IsSpellActive(spell.SpellSlot, Orbwalking.OrbwalkingMode.LaneClear))
            .ToList()
            .ForEach(spell => spell.OnLaneClear());

            this.spells.Where(spell => IsSpellActive(spell.SpellSlot, Orbwalking.OrbwalkingMode.LaneClear))
            .ToList()
            .ForEach(spell => spell.OnJungleClear());

            this.spells.Where(spell => IsSpellActive(spell.SpellSlot, Orbwalking.OrbwalkingMode.LastHit))
            .ToList()
            .ForEach(spell => spell.OnLastHit());

            this.spells.ToList().ForEach(spell => spell.OnUpdate());

            this.Killsteal();
        }
示例#17
0
        private static void Game_OnWndProc(WndEventArgs args)
        {
            if (args.Msg != 0x201)
            {
                return;
            }

            foreach (var objAiHero in (from hero in ObjectManager.Get <Obj_AI_Hero>()
                                       where hero.IsValidTarget()
                                       select hero
                                       into h
                                       orderby h.Distance(Game.CursorPos) descending
                                       select h
                                       into enemy
                                       where enemy.Distance(Game.CursorPos) < 150f
                                       select enemy).Where(objAiHero => objAiHero != null && objAiHero != xSelectedTarget))
            {
                xSelectedTarget = objAiHero;
                TargetSelector.SetTarget(objAiHero);
            }
        }
示例#18
0
        public void OnExecute()
        {
            var currentTarget = TargetSelector.GetTarget(Orbwalking.GetRealAutoAttackRange(null) + 240f, TargetSelector.DamageType.Physical);

            if (!currentTarget.IsValidTarget() || currentTarget.ServerPosition.Distance(ObjectManager.Player.ServerPosition) <=
                Orbwalking.GetRealAutoAttackRange(null))
            {
                return;
            }

            if (HealthPrediction.GetHealthPrediction(currentTarget, (int)(280f)) <
                ObjectManager.Player.GetAutoAttackDamage(currentTarget) +
                Variables.spells[SpellSlot.Q].GetDamage(currentTarget) &&
                HealthPrediction.GetHealthPrediction(currentTarget, (int)(280f)) > 0)
            {
                var extendedPosition = ObjectManager.Player.ServerPosition.Extend(
                    currentTarget.ServerPosition, 300f);
                if (extendedPosition.IsGoodEndPosition())
                {
                    Variables.spells[SpellSlot.Q].Cast(extendedPosition);
                    TargetSelector.SetTarget(currentTarget);
                }
            }
        }
示例#19
0
        public override void Game_OnGameUpdate(EventArgs args)
        {
            if ((!ComboActive && !HarassActive) || !Orbwalking.CanMove(100))
            {
                if (GetValue <bool>("FocusW"))
                {
                    var silverBuffMarkedEnemy = VayneData.GetSilverBuffMarkedEnemy;
                    if (silverBuffMarkedEnemy != null)
                    {
                        TargetSelector.SetTarget(silverBuffMarkedEnemy);
                    }
                    else
                    {
                        var attackRange = Orbwalking.GetRealAutoAttackRange(ObjectManager.Player);
                        TargetSelector.SetTarget(
                            TargetSelector.GetTarget(attackRange, TargetSelector.DamageType.Physical));
                    }
                }

                var useE = GetValue <bool>("UseE" + (ComboActive ? "C" : "H"));

                if (Q.IsReady() && GetValue <bool>("CompleteSilverBuff"))
                {
                    if (VayneData.GetSilverBuffMarkedEnemy != null && VayneData.GetSilverBuffMarkedCount == 2)
                    {
                        Q.Cast(Game.CursorPos);
                    }
                }

                if (E.IsReady() && useE)
                {
                    foreach (var hero in
                             from hero in ObjectManager.Get <Obj_AI_Hero>().Where(hero => hero.IsValidTarget(550f))
                             let prediction = E.GetPrediction(hero)
                                              where
                                              NavMesh.GetCollisionFlags(
                                 prediction.UnitPosition.To2D()
                                 .Extend(
                                     ObjectManager.Player.ServerPosition.To2D(),
                                     -GetValue <Slider>("PushDistance").Value)
                                 .To3D()).HasFlag(CollisionFlags.Wall) ||
                                              NavMesh.GetCollisionFlags(
                                 prediction.UnitPosition.To2D()
                                 .Extend(
                                     ObjectManager.Player.ServerPosition.To2D(),
                                     -(GetValue <Slider>("PushDistance").Value / 2))
                                 .To3D()).HasFlag(CollisionFlags.Wall)
                                              select hero)
                    {
                        E.Cast(hero);
                    }
                }
            }

            if (LaneClearActive)
            {
                var useQ = GetValue <bool>("UseQL");

                if (Q.IsReady() && useQ)
                {
                    var vMinions = MinionManager.GetMinions(ObjectManager.Player.Position, Q.Range);
                    foreach (var minions in
                             vMinions.Where(
                                 minions => minions.Health < ObjectManager.Player.GetSpellDamage(minions, SpellSlot.Q)))
                    {
                        Q.Cast(minions);
                    }
                }
            }
        }
示例#20
0
        private static void Game_OnUpdate(EventArgs args)
        {
            var hp = _config.Item("autoheal").GetValue <Slider>().Value;

            if ((ObjectManager.Player.Mana == 5) && ((ObjectManager.Player.Health / ObjectManager.Player.MaxHealth) * 100 <= hp))
            {
                _w.Cast();
            }
            ComboModeSwitch();
            OrbModeSwitch();
            var searchtarget = TargetSelector.GetTarget(1500, TargetSelector.DamageType.Physical);
            var closetarget  = TargetSelector.GetTarget(350, TargetSelector.DamageType.Physical);
            var orbmod       = _config.SubMenu("Combo").Item("orbmode").GetValue <StringList>().SelectedIndex;

            if (TargetSelector.GetPriority(searchtarget) == 2.5f)
            {
                if (searchtarget.IsValidTarget(1500) && (ObjectManager.Player.HasBuff("rengarpassivebuff") || ObjectManager.Player.HasBuff("rengarbushspeedbuff") || ObjectManager.Player.HasBuff("rengarr")))
                {
                    TargetSelector.SetTarget(searchtarget);
                    _config.Item("ForceFocusSelected").SetValue(true);
                }
            }
            if (_config.Item("ForceFocusSelected").GetValue <bool>() && !ObjectManager.Player.HasBuff("rengarpassivebuff") && !ObjectManager.Player.HasBuff("rengarbushspeedbuff") && !ObjectManager.Player.HasBuff("rengarr"))
            {
                _config.Item("ForceFocusSelected").SetValue(false);
            }
            if (_orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
            {
                if (searchtarget.IsValidTarget(500))
                {
                    Items.UseItem(3144, searchtarget);
                    Items.UseItem(3146, searchtarget);
                    Items.UseItem(3153, searchtarget);
                }
                if (closetarget.IsValidTarget(350))
                {
                    Items.UseItem(3074);
                    Items.UseItem(3077);
                    Items.UseItem(3143);
                }
                if (ObjectManager.Player.Mana <= 4)
                {
                    if (searchtarget.IsValidTarget(1000) && (ObjectManager.Player.HasBuff("rengarpassivebuff") || ObjectManager.Player.HasBuff("rengarbushspeedbuff") || ObjectManager.Player.HasBuff("rengarr")))
                    {
                        _q.Cast();
                    }
                    if (searchtarget.IsValidTarget(800) && (ObjectManager.Player.HasBuff("rengarpassivebuff") || ObjectManager.Player.HasBuff("rengarbushspeedbuff") || ObjectManager.Player.HasBuff("rengarr")))
                    {
                        Items.UseItem(3142);
                    }
                    if (searchtarget.IsValidTarget(1000) && !ObjectManager.Player.HasBuff("rengarpassivebuff") && !ObjectManager.Player.HasBuff("rengarbushspeedbuff") && !ObjectManager.Player.HasBuff("rengarr"))
                    {
                        _e.Cast(searchtarget);
                        if (orbmod == 0)
                        {
                            if ((_q.IsReady() || _w.IsReady() || _e.IsReady()) && closetarget.Distance(ObjectManager.Player) < Orbwalking.GetRealAutoAttackRange(ObjectManager.Player) + 100)
                            {
                                ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, closetarget);
                            }
                        }
                        if (orbmod == 1)
                        {
                            if (closetarget.Distance(ObjectManager.Player) < Orbwalking.GetRealAutoAttackRange(ObjectManager.Player) + 100)
                            {
                                ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, closetarget);
                            }
                        }
                    }
                    if (closetarget.IsValidTarget(_q.Range))
                    {
                        _q.Cast(closetarget);
                    }
                    if (closetarget.IsValidTarget(350))
                    {
                        _e.Cast(closetarget);
                        _w.Cast(closetarget);
                        if (orbmod == 0)
                        {
                            if ((_q.IsReady() || _w.IsReady() || _e.IsReady()) && closetarget.Distance(ObjectManager.Player) < Orbwalking.GetRealAutoAttackRange(ObjectManager.Player) + 100)
                            {
                                ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, closetarget);
                            }
                        }
                        if (orbmod == 1)
                        {
                            if (closetarget.Distance(ObjectManager.Player) < Orbwalking.GetRealAutoAttackRange(ObjectManager.Player) + 100)
                            {
                                ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, closetarget);
                            }
                        }
                    }
                }
                if (ObjectManager.Player.Mana == 5)
                {
                    var comboMode = _config.SubMenu("Combo").Item("ComboMode").GetValue <StringList>().SelectedIndex;
                    var einq      = _config.Item("eq").GetValue <bool>();
                    switch (comboMode)
                    {
                    case 0:
                    {
                        if ((ObjectManager.Player.Health / ObjectManager.Player.MaxHealth) * 100 <= hp)
                        {
                            _w.Cast();
                        }
                        if (searchtarget.IsValidTarget(1000) && (ObjectManager.Player.HasBuff("rengarpassivebuff") || ObjectManager.Player.HasBuff("rengarbushspeedbuff") || ObjectManager.Player.HasBuff("rengarr")) && (ObjectManager.Player.Health / ObjectManager.Player.MaxHealth) * 100 > hp)
                        {
                            _q.Cast();
                        }
                        if (searchtarget.IsValidTarget(800) && (ObjectManager.Player.HasBuff("rengarpassivebuff") || ObjectManager.Player.HasBuff("rengarbushspeedbuff") || ObjectManager.Player.HasBuff("rengarr")))
                        {
                            Items.UseItem(3142);
                        }
                        if (closetarget.IsValidTarget(_q.Range) && (ObjectManager.Player.Health / ObjectManager.Player.MaxHealth) * 100 > hp)
                        {
                            _q.Cast(closetarget);
                        }
                        if (einq && searchtarget.Distance(ObjectManager.Player.Position) > 250 && searchtarget.Distance(ObjectManager.Player.Position) < 1000 && !ObjectManager.Player.HasBuff("rengarpassivebuff") && !ObjectManager.Player.HasBuff("rengarbushspeedbuff") && !ObjectManager.Player.HasBuff("rengarr") && (ObjectManager.Player.Health / ObjectManager.Player.MaxHealth) * 100 > hp)
                        {
                            _e.Cast(searchtarget);
                        }
                        if (orbmod == 0)
                        {
                            if ((_q.IsReady() || _w.IsReady() || _e.IsReady()) && closetarget.Distance(ObjectManager.Player) < Orbwalking.GetRealAutoAttackRange(ObjectManager.Player) + 100)
                            {
                                ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, closetarget);
                            }
                        }
                        if (orbmod == 1)
                        {
                            if (closetarget.Distance(ObjectManager.Player) < Orbwalking.GetRealAutoAttackRange(ObjectManager.Player) + 100)
                            {
                                ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, closetarget);
                            }
                        }
                    }
                    break;

                    case 1:
                    {
                        if ((ObjectManager.Player.Health / ObjectManager.Player.MaxHealth) * 100 <= hp)
                        {
                            _w.Cast();
                        }
                        if (searchtarget.IsValidTarget(800) && (ObjectManager.Player.HasBuff("rengarpassivebuff") || ObjectManager.Player.HasBuff("rengarbushspeedbuff") || ObjectManager.Player.HasBuff("rengarr")))
                        {
                            Items.UseItem(3142);
                        }
                        if (searchtarget.IsValidTarget(1000) && !ObjectManager.Player.HasBuff("rengarpassivebuff") && !ObjectManager.Player.HasBuff("rengarbushspeedbuff") && !ObjectManager.Player.HasBuff("rengarr") && (ObjectManager.Player.Health / ObjectManager.Player.MaxHealth) * 100 > hp)
                        {
                            _e.Cast(searchtarget);
                        }
                        if (closetarget.IsValidTarget(350) && (ObjectManager.Player.Health / ObjectManager.Player.MaxHealth) * 100 > hp)
                        {
                            _e.Cast(closetarget);
                        }
                        if (orbmod == 0)
                        {
                            if ((_q.IsReady() || _w.IsReady() || _e.IsReady()) && closetarget.Distance(ObjectManager.Player) < Orbwalking.GetRealAutoAttackRange(ObjectManager.Player) + 100)
                            {
                                ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, closetarget);
                            }
                        }
                        if (orbmod == 1)
                        {
                            if (closetarget.Distance(ObjectManager.Player) < Orbwalking.GetRealAutoAttackRange(ObjectManager.Player) + 100)
                            {
                                ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, closetarget);
                            }
                        }
                    }
                    break;
                    }
                }
            }
        }
示例#21
0
 /// <summary>
 /// Called when the module is executed.
 /// </summary>
 public void OnExecute()
 {
     TargetSelector.SetTarget(HeroManager.Enemies.FirstOrDefault(
                                  m => m.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 200) && m.Has2WStacks()));
 }
示例#22
0
        /// <summary>
        ///     Called when the game updates
        /// </summary>
        /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
        private static void OnUpdate(EventArgs args)
        {
            try
            {
                if (Player.IsDead)
                {
                    return;
                }

                switch (Orbwalker.ActiveMode)
                {
                case Orbwalking.OrbwalkingMode.Combo:
                    OnCombo();
                    break;

                case Orbwalking.OrbwalkingMode.Mixed:
                    OnHarass();
                    break;

                case Orbwalking.OrbwalkingMode.LaneClear:
                    OnLaneclear();
                    break;
                }

                if (Menu.Item("Q.Automatically").GetValue <StringList>().SelectedIndex == 1 || (Menu.Item("Q.Automatically").GetValue <StringList>().SelectedIndex == 2 && ComboModeActive))
                {
                    if (Menu.Item("Prediction.type").GetValue <StringList>().SelectedIndex == 1)
                    {
                        var target = Q.GetTarget();
                        var pred   = CPrediction.Circle(Q, target, HitChance.VeryHigh, true);
                        if (pred.TotalHits >= 2 && Q.IsReady())
                        {
                            Q.Cast(pred.CastPosition);
                            LeagueSharp.Common.Utility.DelayAction.Add(600, () => W.Cast());
                        }
                    }
                    else if (Menu.Item("Prediction.type").GetValue <StringList>().SelectedIndex == 2)
                    {
                        var target = Q.GetTarget();


                        var predictionInput = new SebbyLib.Prediction.PredictionInput
                        {
                            Aoe    = false, Collision = false, Speed = int.MaxValue, Delay = 0.7f,
                            Range  = 900f - 100f, From = Player.ServerPosition,
                            Radius = 140f - 25f, Unit = target,
                            Type   = SebbyLib.Prediction.SkillshotType.SkillshotCircle
                        };

                        var predictionOutput = SebbyLib.Prediction.Prediction.GetPrediction(predictionInput);
                        if (predictionOutput.Hitchance == (SebbyLib.Prediction.HitChance)(6) &&
                            predictionOutput.AoeTargetsHitCount >= 2)
                        {
                            Q.Cast(predictionOutput.CastPosition);
                            LeagueSharp.Common.Utility.DelayAction.Add(600, () => W.Cast());
                        }
                    }
                    else
                    {
                        var target = Q.GetTarget();
                        var pred   = Q.GetPrediction(target);
                        if (pred.AoeTargetsHitCount >= 2 && Q.IsReady())
                        {
                            Q.Cast(pred.CastPosition);
                            LeagueSharp.Common.Utility.DelayAction.Add(600, () => W.Cast());
                        }
                    }
                }

                if (IsActive("ElZilean.Combo.Focus.Bomb"))
                {
                    var passiveTarget = HeroManager.Enemies.FirstOrDefault(x => x.IsValidTarget() && x.HasBuff("ZileanQEnemyBomb"));
                    if (passiveTarget != null)
                    {
                        if (passiveTarget.IsValidTarget(Q.Range + 100))
                        {
                            TargetSelector.SetTarget(passiveTarget);
                            Orbwalker.ForceTarget(passiveTarget);
                        }
                    }
                }

                if (IsActive("ElZilean.Ignite"))
                {
                    HandleIgnite();
                }

                if (Menu.Item("ElZilean.DoubleBombMouse").GetValue <KeyBind>().Active)
                {
                    MouseCombo();
                }

                if (Menu.Item("ElZilean.Flee.Key").GetValue <KeyBind>().Active)
                {
                    OnFlee();
                }

                if (IsActive("ElZilean.E.Slow"))
                {
                    foreach (var slowedAlly in
                             HeroManager.Allies.Where(x => x.HasBuffOfType(BuffType.Slow) && x.IsValidTarget(Q.Range, false))
                             )
                    {
                        if (E.IsReady() && E.IsInRange(slowedAlly))
                        {
                            E.CastOnUnit(slowedAlly);
                        }
                    }
                }

                if (IsActive("ElZilean.Q.Stun"))
                {
                    var target =
                        HeroManager.Enemies.FirstOrDefault(
                            h =>
                            h.IsValidTarget(Q.Range) && h.HasBuffOfType(BuffType.Slow) ||
                            h.HasBuffOfType(BuffType.Knockup) || h.HasBuffOfType(BuffType.Charm) ||
                            h.HasBuffOfType(BuffType.Stun));

                    if (target != null)
                    {
                        if (Q.IsReady() && target.IsValidTarget(Q.Range))
                        {
                            QCast(target);
                            LeagueSharp.Common.Utility.DelayAction.Add(100, () => W.Cast());
                        }
                    }
                }

                foreach (var ally in HeroManager.Allies.Where(a => a.IsValidTarget(R.Range, false)))
                {
                    if (!Menu.Item($"R{ally.ChampionName}").IsActive() || ally.IsRecalling() || ally.IsInvulnerable ||
                        !ally.IsValidTarget(R.Range, false))
                    {
                        return;
                    }

                    var enemies     = ally.CountEnemiesInRange(750f);
                    var totalDamage = IncomingDamageManager.GetDamage(ally) * 1.1f;
                    if (ally.HealthPercent <= Menu.Item("min-health").GetValue <Slider>().Value&& !ally.IsDead &&
                        enemies >= 1 && ally.IsValidTarget(R.Range, false))
                    {
                        if ((int)(totalDamage / ally.Health) > Menu.Item("min-damage").GetValue <Slider>().Value ||
                            ally.HealthPercent < Menu.Item("min-health").GetValue <Slider>().Value)
                        {
                            if (ally.Buffs.Any(b => b.DisplayName == "judicatorintervention" || b.DisplayName == "undyingrage" || b.DisplayName == "kindredrnodeathbuff" || b.DisplayName == "zhonyasringshield" || b.DisplayName == "willrevive"))
                            {
                                return;
                            }

                            R.Cast(ally);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
示例#23
0
        public override void Game_OnGameUpdate(EventArgs args)
        {
            Orbwalker.SetAttack(Game.Time > rqTumbleBuffEndOfTime);

            if (JungleClearActive)
            {
                ExecJungleClear();
            }

            if ((ComboActive || HarassActive))
            {
                if (GetValue <bool>("FocusW"))
                {
                    var silverBuffMarkedEnemy = VayneData.GetSilverBuffMarkedEnemy;
                    if (silverBuffMarkedEnemy != null)
                    {
                        TargetSelector.SetTarget(silverBuffMarkedEnemy);
                    }
                    else
                    {
                        var attackRange = Orbwalking.GetRealAutoAttackRange(ObjectManager.Player);
                        TargetSelector.SetTarget(
                            TargetSelector.GetTarget(attackRange, TargetSelector.DamageType.Physical));
                    }
                }

                var useQ = GetValue <StringList>("Combo.UseQ").SelectedIndex;
                var t    = TargetSelector.GetTarget(Q.Range + Orbwalking.GetRealAutoAttackRange(null),
                                                    TargetSelector.DamageType.Physical);
                if (Q.IsReady() && t.IsValidTarget() && useQ != 0)
                {
                    switch (useQ)
                    {
                    case 1:
                    {
                        Q.Cast(Game.CursorPos);
                        break;
                    }

                    case 2:
                    {
                        var silverEnemy = VayneData.GetSilverBuffMarkedEnemy;
                        if (silverEnemy != null && t.ChampionName == silverEnemy.ChampionName &&
                            VayneData.GetSilverBuffMarkedCount == 2)
                        {
                            Q.Cast(Game.CursorPos);
                            Orbwalker.ForceTarget(t);
                        }
                        break;
                    }

                    case 3:
                    {
                        if (t.Distance(ObjectManager.Player.Position) > Orbwalking.GetRealAutoAttackRange(null) && Q.IsPositionSafe(t.Position.To2D()))
                        {
                            Q.Cast(t.Position);
                        }
                        else if (Q.IsPositionSafe(Game.CursorPos.To2D()))
                        {
                            Q.Cast(Game.CursorPos);
                        }
                        Orbwalker.ForceTarget(t);
                        break;
                    }
                    }
                }

                var useE = GetValue <StringList>("UseEC").SelectedIndex;
                if (E.IsReady() && useE != 0)
                {
                    t = TargetSelector.GetTarget(E.Range + Q.Range, TargetSelector.DamageType.Physical);
                    if (useE == 1)
                    {
                        if (t.IsValidTarget())
                        {
                            CastE(t);
                        }
                    }
                    else
                    {
                        foreach (var e in HeroManager.Enemies.Where(e => e.IsValidTarget(E.Range) && !e.IsZombie))
                        {
                            CastE(e);
                        }
                    }

                    /*
                     * foreach (var hero in
                     *  from hero in ObjectManager.Get<Obj_AI_Hero>().Where(hero => hero.IsValidTarget(550f))
                     *  let prediction = E.GetPrediction(hero)
                     *  where
                     *      NavMesh.GetCollisionFlags(
                     *          prediction.UnitPosition.To2D()
                     *              .Extend(
                     *                  ObjectManager.Player.ServerPosition.To2D(),
                     *                  -GetValue<Slider>("PushDistance").Value)
                     *              .To3D()).HasFlag(CollisionFlags.Wall) ||
                     *      NavMesh.GetCollisionFlags(
                     *          prediction.UnitPosition.To2D()
                     *              .Extend(
                     *                  ObjectManager.Player.ServerPosition.To2D(),
                     *                  -(GetValue<Slider>("PushDistance").Value/2))
                     *              .To3D()).HasFlag(CollisionFlags.Wall)
                     *  select hero)
                     * {
                     *  E.Cast(hero);
                     * }
                     */
                }
            }

            if (LaneClearActive)
            {
                var useQ = GetValue <bool>("UseQL");

                if (Q.IsReady() && useQ)
                {
                    var vMinions = MinionManager.GetMinions(ObjectManager.Player.Position, Q.Range);
                    foreach (var minions in
                             vMinions.Where(
                                 minions => minions.Health < ObjectManager.Player.GetSpellDamage(minions, SpellSlot.Q)))
                    {
                        Q.Cast(minions);
                    }
                }
            }
        }
示例#24
0
        public override void Game_OnGameUpdate(EventArgs args)
        {
            if ((!ComboActive && !HarassActive) || !DeathWalker.canMove())
            {
                if (GetValue <bool>("FocusW"))
                {
                    var silverBuffMarkedEnemy = VayneData.GetSilverBuffMarkedEnemy;
                    if (silverBuffMarkedEnemy != null)
                    {
                        TargetSelector.SetTarget(silverBuffMarkedEnemy);
                    }
                    else
                    {
                        var attackRange = DeathWalker.getRealAutoAttackRange(ObjectManager.Player);
                        TargetSelector.SetTarget(
                            TargetSelector.GetTarget(attackRange, TargetSelector.DamageType.Physical));
                    }
                }

                var useE = GetValue <bool>("UseE" + (ComboActive ? "C" : "H"));

                if (Q.IsReady() && GetValue <bool>("CompleteSilverBuff"))
                {
                    if (VayneData.GetSilverBuffMarkedEnemy != null && VayneData.GetSilverBuffMarkedCount == 2)
                    {
                        Q.Cast(Game.CursorPos);
                    }
                }

                if (E.IsReady() && useE)
                {
                    var t = TargetSelector.GetTarget(E.Range + Q.Range, TargetSelector.DamageType.Physical);
                    if (t != null)
                    {
                        for (var i = 1; i < 8; i++)
                        {
                            var targetBehind = t.Position
                                               + Vector3.Normalize(t.ServerPosition - ObjectManager.Player.Position) * i
                                               * 50;
                            if (targetBehind.IsWall() && t.IsValidTarget(E.Range))
                            {
                                E.CastOnUnit(t);
                                return;
                            }
                        }
                    }

                    /*
                     * foreach (var hero in
                     *  from hero in ObjectManager.Get<Obj_AI_Hero>().Where(hero => hero.IsValidTarget(550f))
                     *  let prediction = E.GetPrediction(hero)
                     *  where
                     *      NavMesh.GetCollisionFlags(
                     *          prediction.UnitPosition.To2D()
                     *              .Extend(
                     *                  ObjectManager.Player.ServerPosition.To2D(),
                     *                  -GetValue<Slider>("PushDistance").Value)
                     *              .To3D()).HasFlag(CollisionFlags.Wall) ||
                     *      NavMesh.GetCollisionFlags(
                     *          prediction.UnitPosition.To2D()
                     *              .Extend(
                     *                  ObjectManager.Player.ServerPosition.To2D(),
                     *                  -(GetValue<Slider>("PushDistance").Value/2))
                     *              .To3D()).HasFlag(CollisionFlags.Wall)
                     *  select hero)
                     * {
                     *  E.Cast(hero);
                     * }
                     */
                }
            }

            if (LaneClearActive)
            {
                var useQ = GetValue <bool>("UseQL");

                if (Q.IsReady() && useQ)
                {
                    var vMinions = MinionManager.GetMinions(ObjectManager.Player.Position, Q.Range);
                    foreach (var minions in
                             vMinions.Where(
                                 minions => minions.Health < ObjectManager.Player.GetSpellDamage(minions, SpellSlot.Q)))
                    {
                        Q.Cast(minions);
                    }
                }
            }
        }
示例#25
0
        public override void Game_OnGameUpdate(EventArgs args)
        {
            if (ObjectManager.Player.IsDead)
            {
                return;
            }
            if (!Orbwalking.CanMove(100))
            {
                return;
            }

            var getEMarkedEnemy = TristanaData.GetEMarkedEnemy;

            if (getEMarkedEnemy != null)
            {
                TargetSelector.SetTarget(getEMarkedEnemy);
            }
            else
            {
                var attackRange = Orbwalking.GetRealAutoAttackRange(Player);
                TargetSelector.SetTarget(TargetSelector.GetTarget(attackRange, TargetSelector.DamageType.Physical));
            }

            Q.Range = 600 + 5 * (Player.Level - 1);
            E.Range = 630 + 7 * (Player.Level - 1);
            R.Range = 630 + 7 * (Player.Level - 1);

            if (!Player.HasBuff("Recall") && GetValue <KeyBind>("UseETH").Active&& ToggleActive && E.IsReady())
            {
                var t = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);

                if (t.LSIsValidTarget(E.Range))
                {
                    if (Program.Config.Item("DontEToggleHarass" + t.ChampionName) != null &&
                        Program.Config.Item("DontEToggleHarass" + t.ChampionName).GetValue <bool>() == false)
                    {
                        E.CastOnUnit(t);
                    }
                }
            }

            var useW   = W.IsReady() && GetValue <bool>("UseWC");
            var useWc  = W.IsReady() && GetValue <bool>("UseWCS");
            var useWks = W.IsReady() && GetValue <bool>("UseWKs");
            var useE   = E.IsReady() && GetValue <bool>("UseEC");
            var useR   = R.IsReady() && GetValue <bool>("UseRM") && R.IsReady();

            if (ComboActive)
            {
                Obj_AI_Hero t;
                if (TristanaData.GetEMarkedEnemy != null)
                {
                    t = TristanaData.GetEMarkedEnemy;
                    TargetSelector.SetTarget(TristanaData.GetEMarkedEnemy);
                }
                else
                {
                    t = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
                }

                if (useE && E.IsReady())
                {
                    if (E.IsReady() && t.LSIsValidTarget(E.Range))
                    {
                        E.CastOnUnit(t);
                    }
                }

                if (useW)
                {
                    t = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
                    if (t.LSIsValidTarget())
                    {
                        W.Cast(t);
                    }
                }

                /*
                 * else if (useWks)
                 * {
                 *  t = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
                 *  if (t.LSIsValidTarget() && t.Health < TristanaData.GetWDamage)
                 *      W.Cast(t);
                 * }
                 * else if (useWc)
                 * {
                 *  t = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
                 *  if (t.LSIsValidTarget() && TristanaData.GetEMarkedCount == 4)
                 *      W.Cast(t);
                 * }
                 */
            }

            if (ComboActive)
            {
                if (useR)
                {
                    var t = TargetSelector.GetTarget(R.Range - 10, TargetSelector.DamageType.Physical);

                    if (!t.LSIsValidTarget())
                    {
                        return;
                    }

                    if (Player.GetSpellDamage(t, SpellSlot.R) - 30 < t.Health ||
                        t.Health < Player.GetAutoAttackDamage(t, true))
                    {
                        return;
                    }

                    R.CastOnUnit(t);
                }
            }
        }
示例#26
0
        public override void Game_OnGameUpdate(EventArgs args)
        {
            if (!Orbwalking.CanMove(100))
            {
                return;
            }

            var getEMarkedEnemy = TristanaData.GetEMarkedEnemy;

            if (getEMarkedEnemy != null)
            {
                TargetSelector.SetTarget(getEMarkedEnemy);
            }
            else
            {
                var attackRange = Orbwalking.GetRealAutoAttackRange(Player);
                TargetSelector.SetTarget(TargetSelector.GetTarget(attackRange, TargetSelector.DamageType.Physical));
            }

            Q.Range = 600 + 5 * (Player.Level - 1);
            E.Range = 630 + 7 * (Player.Level - 1);
            R.Range = 630 + 7 * (Player.Level - 1);

            if (GetValue <KeyBind>("UseETH").Active)
            {
                if (Player.HasBuff("Recall"))
                {
                    return;
                }
                var t = TristanaData.GetTarget(E.Range);
                if (t.IsValidTarget() && E.IsReady() && canUseE(t))
                {
                    E.CastOnUnit(t);
                }
            }

            var useW   = W.IsReady() && GetValue <bool>("UseWC");
            var useWc  = W.IsReady() && GetValue <bool>("UseWCS");
            var useWks = W.IsReady() && GetValue <bool>("UseWKs");
            var useE   = E.IsReady() && GetValue <bool>("UseE" + (ComboActive ? "C" : "H"));
            var useR   = R.IsReady() && GetValue <bool>("UseRM") && R.IsReady();

            if (ComboActive || HarassActive)
            {
                Obj_AI_Hero t;
                if (TristanaData.GetEMarkedEnemy != null)
                {
                    t = TristanaData.GetEMarkedEnemy;
                    TargetSelector.SetTarget(TristanaData.GetEMarkedEnemy);
                }
                else
                {
                    t = TristanaData.GetTarget(W.Range);
                }

                if (useE && canUseE(t))
                {
                    if (E.IsReady() && t.IsValidTarget(E.Range))
                    {
                        E.CastOnUnit(t);
                    }
                }

                if (useW)
                {
                    t = TristanaData.GetTarget(W.Range);
                    if (t.IsValidTarget())
                    {
                        W.Cast(t);
                    }
                }
                else if (useWks)
                {
                    t = TristanaData.GetTarget(W.Range);
                    if (t.IsValidTarget() && t.Health < TristanaData.GetWDamage)
                    {
                        W.Cast(t);
                    }
                }
                else if (useWc)
                {
                    t = TristanaData.GetTarget(W.Range);
                    if (t.IsValidTarget() && TristanaData.GetEMarkedCount == 4)
                    {
                        W.Cast(t);
                    }
                }
            }

            if (ComboActive)
            {
                if (useR)
                {
                    var t = TristanaData.GetTarget(R.Range - 20);

                    if (!t.IsValidTarget())
                    {
                        return;
                    }

                    if (Player.GetSpellDamage(t, SpellSlot.R) - 30 < t.Health ||
                        t.Health < Player.GetAutoAttackDamage(t, true))
                    {
                        return;
                    }

                    R.CastOnUnit(t);
                }
            }
        }
示例#27
0
        private void BeforeAttack(Orbwalking.BeforeAttackEventArgs Args)
        {
            if (!(Args.Target is Obj_AI_Hero))
            {
                return;
            }

            var target = (Obj_AI_Hero)Args.Target;

            if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
            {
                var ForcusTarget =
                    HeroManager.Enemies.FirstOrDefault(
                        x =>
                        x.IsValidTarget(Orbwalking.GetRealAutoAttackRange(Me)) &&
                        x.HasBuff("VayneSilveredDebuff") && x.GetBuffCount("VayneSilveredDebuff") == 2);

                if (Menu.Item("Forcus", true).GetValue <bool>() && CheckTarget(ForcusTarget))
                {
                    TargetSelector.SetTarget(ForcusTarget);
                }

                if (Menu.Item("ComboQ", true).GetValue <bool>() && Q.IsReady())
                {
                    if (CheckTarget(target) && target.IsValidTarget(800f))
                    {
                        var AfterQPosition = Me.ServerPosition + (Game.CursorPos - Me.ServerPosition).Normalized() * 250;
                        var Distance       = target.ServerPosition.Distance(AfterQPosition);

                        if (Menu.Item("ComboQTurret", true).GetValue <bool>() && AfterQPosition.UnderTurret(true))
                        {
                            return;
                        }

                        if (Menu.Item("ComboQCheck", true).GetValue <bool>() && AfterQPosition.CountEnemiesInRange(300) >= 3)
                        {
                            return;
                        }

                        if (target.DistanceToPlayer() >= 600 && Distance <= 600)
                        {
                            Q.Cast(Game.CursorPos);
                        }
                    }
                }
            }
            else if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed)
            {
                var ForcusTarget =
                    HeroManager.Enemies.FirstOrDefault(
                        x =>
                        x.IsValidTarget(Orbwalking.GetRealAutoAttackRange(Me)) &&
                        x.HasBuff("VayneSilveredDebuff") && x.GetBuffCount("VayneSilveredDebuff") == 2);

                if (Menu.Item("Forcus", true).GetValue <bool>() && CheckTarget(ForcusTarget))
                {
                    Orbwalker.ForceTarget(ForcusTarget);
                }

                if (Menu.Item("HarassQ", true).GetValue <bool>() && Q.IsReady())
                {
                    if (CheckTarget(target) && target.IsValidTarget(800))
                    {
                        var AfterQPosition = Me.ServerPosition + (Game.CursorPos - Me.ServerPosition).Normalized() * 250;
                        var Distance       = target.ServerPosition.Distance(AfterQPosition);

                        if (Menu.Item("HarassQTurret", true).GetValue <bool>() && AfterQPosition.UnderTurret(true))
                        {
                            return;
                        }

                        if (Menu.Item("HarassQCheck", true).GetValue <bool>() && AfterQPosition.CountEnemiesInRange(300) >= 2)
                        {
                            return;
                        }

                        if (Menu.Item("HarassQ2Passive", true).GetValue <bool>() && target.HasBuff("VayneSilveredDebuff") &&
                            target.GetBuffCount("VayneSilveredDebuff") == 2)
                        {
                            if (target.DistanceToPlayer() >= 600 && Distance <= 600)
                            {
                                Q.Cast(Game.CursorPos);
                            }
                        }
                        else if (!Menu.Item("HarassQ2Passive", true).GetValue <bool>())
                        {
                            if (target.DistanceToPlayer() >= 600 && Distance <= 600)
                            {
                                Q.Cast(Game.CursorPos);
                            }
                        }
                    }
                }
            }
        }
示例#28
0
        private static void CustomOrbwalker_BeforeAttack(Orbwalking.BeforeAttackEventArgs args)
        {
            _target = args.Target.Type == GameObjectType.AIHeroClient ? (AIHeroClient)args.Target : null;

            if (Menu.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
            {
                if (_target != null && E.IsReady() && Menu.Config.Item(_target.ChampionName + "e").GetValue <bool>() &&
                    _target.Distance(Player) >= Player.AttackRange)
                {
                    args.Process = false;
                }


                if (_target != null && Q.IsReady() && Menu.Config.Item(_target.ChampionName + "q").GetValue <bool>())
                {
                    if (Menu.Config.Item("q.onlye").GetValue <bool>() && !_target.HasBuff("tristanaechargesound"))
                    {
                        return;
                    }

                    Q.Cast();
                }
            }
            else if (Menu.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed)
            {
                if (_target != null && E.IsReady() && Menu.Config.Item(_target.ChampionName + "e.harass").GetValue <bool>() &&
                    _target.Distance(Player) >= Player.AttackRange)
                {
                    args.Process = false;
                }


                if (_target != null && Q.IsReady() && Menu.Config.Item(_target.ChampionName + "q.harass").GetValue <bool>())
                {
                    if (Menu.Config.Item("q.onlye").GetValue <bool>() && !_target.HasBuff("tristanaechargesound"))
                    {
                        return;
                    }

                    Q.Cast();
                }
            }

            if (Menu.Config.Item("e.force.target").GetValue <bool>() &&
                Menu.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo ||
                Menu.Config.Item("e.force.target.harass").GetValue <bool>() &&
                Menu.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed)
            {
                foreach (var enemy in HeroManager.Enemies.Where(enemy => enemy.HasBuff("tristanaechargesound")))
                {
                    TargetSelector.SetTarget(enemy);
                    return;
                }
                TargetSelector.SetTarget(TargetSelector.GetTarget(Orbwalking.GetRealAutoAttackRange(Player),
                                                                  TargetSelector.DamageType.Physical));
            }

            if (Menu.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear)
            {
                if (!Menu.Config.Item("e.focusminion").IsActive())
                {
                    return;
                }

                var eminion =
                    MinionManager
                    .GetMinions(Orbwalking.GetRealAutoAttackRange(Player))
                    .FirstOrDefault(m => m.HasBuff("tristanaecharge") || m.HasBuff("tristanaechargesound"));

                if (eminion == null)
                {
                    return;
                }
                Menu.Orbwalker.ForceTarget(eminion);
            }
        }
示例#29
0
        public override void Game_OnGameUpdate(EventArgs args)
        {
            var getEMarkedEnemy = TristanaData.GetEMarkedEnemy;
            if (getEMarkedEnemy != null)
            {
                if (TargetSelector.GetSelectedTarget() == null)
                    Orbwalker.ForceTarget(getEMarkedEnemy);
                TargetSelector.SetTarget(getEMarkedEnemy);
            }
            else
            {
                var attackRange = Orbwalking.GetRealAutoAttackRange(Player);
                TargetSelector.SetTarget(TargetSelector.GetTarget(attackRange, TargetSelector.DamageType.Physical));
            }

            Q.Range = Player.AttackRange + (Player.BoundingRadius * 2);
            E.Range = Player.AttackRange + (Player.BoundingRadius * 2);
            R.Range = Player.AttackRange + (Player.BoundingRadius * 2);

            var useW = W.IsReady() && GetValue<bool>("UseWC");
            var useWc = W.IsReady() && GetValue<bool>("UseWCS");
            var useR = R.IsReady() && GetValue<bool>("UseRC");
            var useRB = R.IsReady() && GetValue<bool>("UseRB");

            if (useRB && Player.HealthPercentage() < 40)
            {
                var enemy =
                    HeroManager.Enemies.OrderBy(target => target.TotalAttackDamage)
                        .LastOrDefault(targ => Player.Distance(targ) <= 275 && targ.IsMelee());
                if(enemy != null && enemy.IsValidTarget())
                {
                    R.CastOnUnit(enemy);
                }
            }

            if (ComboActive)
            {
                Obj_AI_Hero t;
                if (TristanaData.GetEMarkedEnemy != null)
                {
                    TargetSelector.SetTarget(TristanaData.GetEMarkedEnemy);
                }

                if (useW)
                {
                    t = TristanaData.GetTarget(W.Range);
                    if (t.IsValidTarget() && t.Health < TristanaData.GetWDamage)
                        W.Cast(t);
                }


                if (useWc)
                {
                    t = TristanaData.GetTarget(W.Range);
                    if (t.IsValidTarget() && TristanaData.GetEMarkedCount == 4)
                        W.Cast(t);
                }

                if (useR)
                {
                    var tar = TristanaData.GetTarget(R.Range);

                    if (!tar.IsValidTarget())
                        return;

                    if (Player.GetSpellDamage(tar, SpellSlot.R) - 30 > tar.Health &&
                        tar.Health > Player.GetAutoAttackDamage(tar, true))
                    {
                        R.CastOnUnit(tar);
                    }
                }
            }
        }
示例#30
0
        /// <summary>
        ///     Combo logic
        /// </summary>
        private static void OnCombo()
        {
            var target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);

            if (target == null)
            {
                return;
            }

            if (IsActive("ElZilean.Combo.Q"))
            {
                QCast(target);
            }

            // Check if target has a bomb
            var isBombed = HeroManager.Enemies.Find(x => x.HasBuff("ZileanQEnemyBomb") && x.IsValidTarget(Q.Range));

            if (!isBombed.IsValidTarget())
            {
                return;
            }

            if (isBombed != null && isBombed.IsValidTarget(Q.Range))
            {
                if (Q.Instance.CooldownExpires - Game.Time < 3)
                {
                    return;
                }

                TargetSelector.SetTarget(isBombed);
                Orbwalker.ForceTarget(isBombed);

                if (IsActive("ElZilean.Combo.W"))
                {
                    W.Cast();
                }
            }

            if (IsActive("ElZilean.Combo.W") && IsActive("ElZilean.Combo.W2") && W.IsReady() && !Q.IsReady())
            {
                if (HeroManager.Enemies.Any(x => x.Health > Q.GetDamage(x) && x.IsValidTarget(Q.Range)))
                {
                    return;
                }

                W.Cast();
            }

            if (IsActive("ElZilean.Combo.E") && E.IsReady())
            {
                if (Player.GetEnemiesInRange(E.Range).Any())
                {
                    var closestEnemy =
                        Player.GetEnemiesInRange(E.Range)
                        .OrderByDescending(h => (h.PhysicalDamageDealtPlayer + h.MagicDamageDealtPlayer))
                        .FirstOrDefault();

                    if (closestEnemy == null || closestEnemy.HasBuffOfType(BuffType.Stun))
                    {
                        return;
                    }

                    E.Cast(closestEnemy);
                }
            }

            if (IsActive("ElZilean.Ignite") && isBombed != null)
            {
                if (Player.GetSpellSlot("summonerdot") == SpellSlot.Unknown)
                {
                    return;
                }

                if (Q.GetDamage(isBombed) + IgniteSpell.GetDamage(isBombed) > isBombed.Health)
                {
                    if (isBombed.IsValidTarget(Q.Range))
                    {
                        Player.Spellbook.CastSpell(IgniteSpell.Slot, isBombed);
                    }
                }
            }
        }