示例#1
0
        public override void Game_OnGameUpdate(EventArgs args)
        {
            if (ObjectManager.Player.IsDead)
            {
                xAttackLeft = 0;
                return;
            }

            if (Game.Time > xPassiveUsedTime + 3 && xAttackLeft == 1)
            {
                xAttackLeft = 0;
            }

            if (Config.Item("Passive" + Id).GetValue <bool>() && xAttackLeft > 0)
            {
                return;
            }

            Obj_AI_Hero t;

            if (Q.IsReady() && GetValue <KeyBind>("UseQTH").Active&& ToggleActive)
            {
                if (ObjectManager.Player.HasBuff("Recall"))
                {
                    return;
                }

                t = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);
                if (t != null)
                {
                    Q.CastOnUnit(t);
                }
            }


            if (Q.IsReady() && GetValue <KeyBind>("UseQExtendedTH").Active&& ToggleActive)
            {
                if (ObjectManager.Player.HasBuff("Recall"))
                {
                    return;
                }

                t = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);
                if (t.IsValidTarget() && QMinion(t).IsValidTarget())
                {
                    if (ObjectManager.Player.Distance(t) > Q.Range)
                    {
                        Q.CastOnUnit(QMinion(t));
                    }
                }
            }


            if ((!ComboActive && !HarassActive))
            {
                return;
            }

            var useQExtended = GetValue <StringList>("UseQExtendedC").SelectedIndex;

            if (useQExtended != 0)
            {
                switch (useQExtended)
                {
                case 1:
                {
                    t = TargetSelector.GetTarget(Q2.Range, TargetSelector.DamageType.Physical);
                    var tx = QMinion(t);
                    if (tx.IsValidTarget())
                    {
                        if (!Orbwalking.InAutoAttackRange(t))
                        {
                            Q.CastOnUnit(tx);
                        }
                    }
                    break;
                }

                case 2:
                {
                    var enemy = HeroManager.Enemies.Find(e => e.IsValidTarget(Q2.Range) && !e.IsZombie);
                    if (enemy != null)
                    {
                        var tx = QMinion(enemy);
                        if (tx.IsValidTarget())
                        {
                            Q.CastOnUnit(tx);
                        }
                    }
                    break;
                }
                }
            }

            // Auto turn off Ghostblade Item if Ultimate active
            if (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.R).Level > 0)
            {
                Config.Item("GHOSTBLADE")
                .SetValue(ObjectManager.Player.Spellbook.GetSpell(SpellSlot.R).Name == "LucianR");
            }

            //if (useQExtended && Q.IsReady())
            //{
            //    var t = TargetSelector.GetTarget(Q2.Range, TargetSelector.DamageType.Physical);
            //    if (t.IsValidTarget() && QMinion.IsValidTarget())
            //    {
            //        if (!Orbwalking.InAutoAttackRange(t))
            //            Q.CastOnUnit(QMinion);
            //    }
            //}

            t = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
            if (!t.IsValidTarget())
            {
                return;
            }

            var useQ = GetValue <bool>("UseQC");

            if (useQ && Q.IsReady())
            {
                if (t.IsValidTarget(Q.Range))
                {
                    Q.CastOnUnit(t);
                    Orbwalking.ResetAutoAttackTimer();
                }
            }

            var useW = GetValue <bool>("UseWC");

            if (useW && W.IsReady())
            {
                if (t.IsValidTarget(W.Range))
                {
                    W.Cast(t);
                    Orbwalking.ResetAutoAttackTimer();
                }
            }

            var useE = GetValue <StringList>("UseEC").SelectedIndex;

            if (useE != 0 && E.IsReady())
            {
                if (t.Distance(ObjectManager.Player.Position) > Orbwalking.GetRealAutoAttackRange(null) && t.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + E.Range - 50) && E.IsPositionSafe(t.Position.To2D()))
                {
                    E.Cast(t.Position);
                    Orbwalking.ResetAutoAttackTimer();
                }
                else if (Q.IsPositionSafe(Game.CursorPos.To2D()))
                {
                    E.Cast(Game.CursorPos);
                    Orbwalking.ResetAutoAttackTimer();
                }
                Orbwalker.ForceTarget(t);

                //if (t.IsValidTarget(Q.Range))
                //{
                //    E.Cast(Game.CursorPos);
                //}
            }
        }
示例#2
0
        public override void GameOnUpdate(EventArgs args)
        {
            if (!ComboActive)
            {
                var t = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);

                if (!t.IsValidTarget() || !W.IsReady())
                {
                    return;
                }

                if (Program.Config.Item("UseWTH").GetValue <KeyBind>().Active)
                {
                    if (ObjectManager.Player.HasBuff("Recall"))
                    {
                        return;
                    }
                    W.Cast(t);
                }

                if (t.HasBuffOfType(BuffType.Stun) || t.HasBuffOfType(BuffType.Snare) || t.HasBuffOfType(BuffType.Charm) ||
                    t.HasBuffOfType(BuffType.Fear) || t.HasBuffOfType(BuffType.Taunt) ||
                    t.HasBuff("zhonyasringshield") || t.HasBuff("Recall"))
                {
                    W.Cast(t.Position);
                }
            }

            /* [ Combo ] */
            if (ComboActive)
            {
                var useW = Config.Item("UseWC" + Id).GetValue <bool>();

                var t = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);

                if (Program.Config.SubMenu("Combo").Item("UseRC").GetValue <bool>() && R.IsReady() &&
                    t.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 300) && AsheQ >= 2 &&
                    t.Health > R.GetDamage(t) + ObjectManager.Player.TotalAttackDamage * 4)
                {
                    R.Cast(t);
                }

                if (Q.IsReady() && AsheQCastReady)
                {
                    if (t.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 90))
                    {
                        Q.Cast();
                    }
                }

                if (useW && W.IsReady() && t.IsValidTarget())
                {
                    W.Cast(t);
                }

                var useR = Program.Config.SubMenu("Combo").Item("UseRC").GetValue <bool>();
                if (useR && R.IsReady())
                {
                    var minRRange = Program.Config.SubMenu("Combo").Item("UseRCMinRange").GetValue <Slider>().Value;
                    var maxRRange = Program.Config.SubMenu("Combo").Item("UseRCMaxRange").GetValue <Slider>().Value;

                    t = TargetSelector.GetTarget(maxRRange, TargetSelector.DamageType.Physical);
                    if (!t.IsValidTarget())
                    {
                        return;
                    }

                    var aaDamage = Orbwalking.InAutoAttackRange(t)
                                       ? ObjectManager.Player.GetAutoAttackDamage(t, true)
                                       : 0;

                    if (t.Health > aaDamage && t.Health <= ObjectManager.Player.GetSpellDamage(t, SpellSlot.R) &&
                        ObjectManager.Player.Distance(t) >= minRRange)
                    {
                        R.Cast(t);
                    }
                }
            }

            //Harass
            if (HarassActive)
            {
                var target = TargetSelector.GetTarget(1200, TargetSelector.DamageType.Physical);
                if (target == null)
                {
                    return;
                }

                if (Config.Item("UseWH" + Id).GetValue <bool>() && W.IsReady())
                {
                    W.Cast(target);
                }
            }

            //Manual cast R
            if (Config.Item("RManualCast" + Id).GetValue <KeyBind>().Active)
            {
                var rTarget = TargetSelector.GetTarget(2000, TargetSelector.DamageType.Physical);
                R.Cast(rTarget);
            }
        }