private void LogicW()
        {
            var t = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Magical);

            if (t.IsValidTarget())
            {
                var wDmg = GetWdmg(t);
                if (wDmg > t.Health - OktwCommon.GetIncomingDamage(t))
                {
                    Entry.OKTWCast_SebbyLib(W, t, false);
                }

                if (Player.CountEnemiesInRange(400) > 1 || Player.CountEnemiesInRange(250) > 0)
                {
                    return;
                }

                if (t.HasBuff("jhinespotteddebuff") || !Config.Item("Wstun", true).GetValue <bool>())   // 일단 W는 스턴 목적으로만 동작함.
                {
                    if (Player.Distance(t) < Config.Item("MaxRangeW", true).GetValue <Slider>().Value)
                    {
                        if ((Orbwalker.ActiveMode == LeagueSharp.Common.Orbwalking.OrbwalkingMode.Combo) && Player.Mana > RMANA + WMANA)
                        {
                            // 콤보모드에 모두 통합시킴. 우선 CC 가능 타겟 / AOE / 그래도 없으면 일반 타겟
                            if (W.IsReady() && Config.Item("autoWcc", true).GetValue <bool>())
                            {
                                foreach (var enemy in Enemies.Where(enemy => enemy.IsValidTarget(W.Range) && (!OktwCommon.CanMove(enemy) || enemy.HasBuff("jhinespotteddebuff"))))
                                {
                                    W.Cast(enemy);
                                }
                            }

                            if (W.IsReady() && Config.Item("Waoe", true).GetValue <bool>())
                            {
                                W.CastIfWillHit(t, 2);
                            }

                            if (W.IsReady() && !Player.IsWindingUp)
                            {
                                Entry.OKTWCast_SebbyLib(W, t, false);
                            }
                        }
                    }
                }
            }
        }
        private void Game_OnUpdate(EventArgs args)
        {
            if (Player.IsRecalling())
            {
                return;
            }

            if (Config[Player.CharacterName]["RConfig"].GetValue <MenuKeyBind>("useR").Active&& R.IsReady())
            {
                var t = TargetSelector.GetTarget(R.Range);
                if (t.IsValidTarget())
                {
                    R.CastOnUnit(t);
                }
            }

            if (LagFree(0))
            {
                SetMana();
                R.Range = (500 * R.Level) + 1500;
            }

            var orbT = Orbwalker.GetTarget() as AIHeroClient;

            if (orbT != null && orbT.Health - OktwCommon.GetIncomingDamage(orbT) < Player.GetAutoAttackDamage(orbT) * 2)
            {
                return;
            }

            if (LagFree(1) && E.IsReady() && Orbwalker.CanMove(40, false))
            {
                LogicE();
            }
            if (LagFree(2) && W.IsReady() && Orbwalker.CanMove(40, false))
            {
                LogicW();
            }
            if (LagFree(3) && Q.IsReady() && Orbwalker.CanMove(40, false) && Config[Player.CharacterName]["QConfig"].GetValue <MenuBool>("autoQ2").Enabled)
            {
                LogicQ();
            }
            if (LagFree(4) && R.IsReady() && Config[Player.CharacterName]["RConfig"].GetValue <MenuBool>("autoR").Enabled&& !Player.IsUnderEnemyTurret() && Game.Time - QCastTime > 1)
            {
                LogicR();
            }
        }
Example #3
0
        private static void LogicQ()
        {
            var t = TargetSelector.GetTarget(Q.Range, DamageType.Magical);

            if (t.IsValidTarget())
            {
                missileManager.Target = t;
                if (EMissile == null || !EMissile.IsValid)
                {
                    if (Program.Combo && Player.Mana > RMANA + QMANA)
                    {
                        Program.CastSpell(Q, t);
                    }
                    else if (Program.Farm && Player.Mana > RMANA + WMANA + QMANA + QMANA &&
                             getCheckBoxItem(QMenu, "harrasQ") && getCheckBoxItem(harassMenu, "harras" + t.ChampionName) &&
                             OktwCommon.CanHarras())
                    {
                        Program.CastSpell(Q, t);
                    }
                    else if (Q.GetDamage(t) * 2 + OktwCommon.GetEchoLudenDamage(t) >
                             t.Health - OktwCommon.GetIncomingDamage(t))
                    {
                        Q.Cast(t, true);
                    }
                }
                if (!Program.None && Player.Mana > RMANA + WMANA)
                {
                    foreach (
                        var enemy in
                        Program.Enemies.Where(enemy => enemy.IsValidTarget(Q.Range) && !OktwCommon.CanMove(enemy)))
                    {
                        Q.Cast(enemy, true);
                    }
                }
            }
            else if (Program.LaneClear && Player.ManaPercent > getSliderItem(FarmMenu, "Mana") &&
                     getCheckBoxItem(FarmMenu, "farmQ") && Player.Mana > RMANA + QMANA)
            {
                var minionList   = Cache.GetMinions(Player.ServerPosition, Q.Range);
                var farmPosition = Q.GetLineFarmLocation(minionList, Q.Width);
                if (farmPosition.MinionsHit > getSliderItem(FarmMenu, "LCminions"))
                {
                    Q.Cast(farmPosition.Position);
                }
            }
        }
Example #4
0
        private void LogicW()
        {
            foreach (var ally in Program.Allies.Where(ally => ally.IsValid && !ally.IsDead && Config.Item("damage" + ally.ChampionName, true).GetValue <bool>() && Player.ServerPosition.Distance(ally.ServerPosition) < W.Range))
            {
                double dmg = OktwCommon.GetIncomingDamage(ally);

                if (dmg == 0)
                {
                    continue;
                }

                int    sensitivity  = 20;
                int    nearEnemys   = ally.CountEnemiesInRange(900);
                double HpPercentage = (dmg * 100) / ally.Health;
                double shieldValue  = 65 + W.Level * 25 + 0.35 * Player.FlatMagicDamageMod;

                if (Config.Item("HardCC" + ally.ChampionName, true).GetValue <bool>() && nearEnemys > 0 && HardCC(ally))
                {
                    W.CastOnUnit(ally);
                }
                else if (Config.Item("Poison" + ally.ChampionName, true).GetValue <bool>() && ally.HasBuffOfType(BuffType.Poison))
                {
                    W.Cast(W.GetPrediction(ally).CastPosition);
                }

                nearEnemys = (nearEnemys == 0) ? 1 : nearEnemys;

                if (dmg > shieldValue)
                {
                    W.Cast(W.GetPrediction(ally).CastPosition);
                }
                else if (dmg > 100 + Player.Level * sensitivity)
                {
                    W.Cast(W.GetPrediction(ally).CastPosition);
                }
                else if (ally.Health - dmg < nearEnemys * ally.Level * sensitivity)
                {
                    W.Cast(W.GetPrediction(ally).CastPosition);
                }
                else if (HpPercentage >= Config.Item("Wdmg", true).GetValue <Slider>().Value)
                {
                    W.Cast(W.GetPrediction(ally).CastPosition);
                }
            }
        }
Example #5
0
        private void LogicW()
        {
            foreach (var ally in Program.Allies.Where(ally => ally.IsValid && !ally.IsDead && Player.Distance(ally) < W.Range))
            {
                int nearEnemys = ally.CountEnemiesInRange(900);

                if (nearEnemys >= Config.Item("wCount", true).GetValue <Slider>().Value&& Config.Item("wCount", true).GetValue <Slider>().Value > 0)
                {
                    CastW(W.GetPrediction(ally).CastPosition);
                }

                if (Config.Item("autoW", true).GetValue <bool>())
                {
                    double dmg = OktwCommon.GetIncomingDamage(ally);
                    if (dmg == 0)
                    {
                        continue;
                    }

                    int sensitivity = 20;

                    double HpPercentage = (dmg * 100) / ally.Health;
                    double shieldValue  = 20 + (Player.Level * 20) + (0.4 * Player.FlatMagicDamageMod);

                    nearEnemys = (nearEnemys == 0) ? 1 : nearEnemys;

                    if (dmg > shieldValue && Config.Item("autoW3", true).GetValue <bool>())
                    {
                        W.Cast(W.GetPrediction(ally).CastPosition);
                    }
                    else if (dmg > 100 + Player.Level * sensitivity)
                    {
                        W.Cast(W.GetPrediction(ally).CastPosition);
                    }
                    else if (ally.Health - dmg < nearEnemys * ally.Level * sensitivity)
                    {
                        W.Cast(W.GetPrediction(ally).CastPosition);
                    }
                    else if (HpPercentage >= Config.Item("Wdmg", true).GetValue <Slider>().Value)
                    {
                        W.Cast(W.GetPrediction(ally).CastPosition);
                    }
                }
            }
        }
 private void SurvivalLogic()
 {
     if (E.IsReady() && Player.HealthPercent < 50 && Config.Item("Edead", true).GetValue <bool>())
     {
         double dmg = OktwCommon.GetIncomingDamage(Player, 0.5F);
         if (dmg > 0)
         {
             if (Player.Health - dmg < Player.CountEnemiesInRange(700) * Player.Level * 5)
             {
                 CastE();
             }
             else if (Player.Health - dmg < Player.Level * 5)
             {
                 CastE();
             }
         }
     }
 }
Example #7
0
        private void LogicR()
        {
            foreach (var ally in HeroManager.Allies.Where(ally => ally.IsValid && !ally.IsDead && ally.HealthPercent < 70 && Player.ServerPosition.Distance(ally.ServerPosition) < R.Range && Config.Item("Rally" + ally.ChampionName).GetValue <bool>()))
            {
                double dmg    = OktwCommon.GetIncomingDamage(ally, 0.75f);
                var    enemys = ally.CountEnemiesInRange(800);

                if (dmg == 0 && enemys == 0)
                {
                    continue;
                }

                if (ally.Health - dmg < ally.Level * 20)
                {
                    R.CastOnUnit(ally);
                }
            }
        }
Example #8
0
        private static void Combo()
        {
            // If target's champion target him, if it's not target surrounding enemy [creep, etc]
            var target = Orbwalker.GetTarget() as Obj_AI_Hero;

            if (target == null)
            {
                target = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
            }

            if ((target != null) && target.IsValidTarget())
            {
                if ((Menu.Item("ComboUseQ").GetValue <bool>() &&
                     target.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null)) && Q.IsReady() &&
                     (Player.Mana > Q.Instance.ManaCost + R.Instance.ManaCost)) ||
                    (target.Health < 5 * Player.GetAutoAttackDamage(Player)))
                {
                    Q.Cast();
                }
                if (Menu.Item("ComboUseW").GetValue <bool>() && W.IsReady() &&
                    (Player.Mana > W.Instance.ManaCost + R.Instance.ManaCost) && target.IsValidTarget(W.Range))
                {
                    SebbySpell(W, target);
                }
                DontREnemyNearAlly();
                foreach (
                    var ulttarget in
                    HeroManager.Enemies.Where(ulttarget => target.IsValidTarget(2000) && OktwCommon.ValidUlt(ulttarget))
                    )
                {
                    if (Menu.Item("ComboUseR").GetValue <bool>() && target.IsValidTarget(W.Range) &&
                        (target.Health <
                         W.GetDamage(target) + R.GetDamage(target) + 3 * Player.GetAutoAttackDamage(target) +
                         OktwCommon.GetIncomingDamage(target)) && !target.HasBuff("rebirth"))
                    {
                        SebbySpell(R, target);
                        if (Q.IsReady())
                        {
                            Q.Cast();
                        }
                    }
                }
            }
        }
Example #9
0
        private static void KSAshe()
        {
            if (Menu.Item("KillSteal").GetValue <bool>())
            {
                var target = Orbwalker.GetTarget() as Obj_AI_Hero;

                if (target.IsValidTarget(W.Range) &&
                    (target.Health < W.GetDamage(target) + R.GetDamage(target) + OktwCommon.GetIncomingDamage(target)))
                {
                    DontREnemyNearAlly();
                    if (!target.CanMove || target.IsStunned)
                    {
                        W.Cast(target.Position);
                    }
                    if (!OktwCommon.IsSpellHeroCollision(target, R))
                    {
                        SebbySpell(R, target);
                    }
                }
                if (target.IsValidTarget(W.Range) &&
                    (target.Health < W.GetDamage(target) + OktwCommon.GetIncomingDamage(target)))
                {
                    if (target.CanMove)
                    {
                        SebbySpell(W, target);
                    }
                    else
                    {
                        W.Cast(target.Position);
                    }
                }
                if (target.IsValidTarget(1600) &&
                    (target.Health < R.GetDamage(target) + OktwCommon.GetIncomingDamage(target)))
                {
                    DontREnemyNearAlly();
                    if (!OktwCommon.IsSpellHeroCollision(target, R))
                    {
                        SebbySpell(R, target);
                    }
                }
                // More to be Added
            }
        }
Example #10
0
        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsEnemy)
            {
                return;
            }

            if (Config.Item("spell" + args.SData.Name.ToLower()) != null && !Config.Item("spell" + args.SData.Name.ToLower()).GetValue <bool>())
            {
                return;
            }

            if (E.IsReady() && Config.Item("autoE", true).GetValue <bool>() && OktwCommon.CanHitSkillShot(Player, args))
            {
                E.Cast(sender.Position);
            }

            if (W.IsReady() && args.SData.MissileSpeed > 0)
            {
                foreach (var ally in HeroManager.Allies.Where(ally => ally.IsValid && Player.Distance(ally.ServerPosition) < W.Range && Config.Item("Eon" + ally.ChampionName).GetValue <bool>()))
                {
                    if (OktwCommon.CanHitSkillShot(ally, args) || OktwCommon.GetIncomingDamage(ally, 1) > ally.Health * Config.Item("Edmg", true).GetValue <Slider>().Value * 0.01)
                    {
                        if (E.IsReady())
                        {
                            Utility.DelayAction.Add(200, () => E.Cast(sender.Position));
                        }

                        if (Player.HealthPercent < 20 && !ally.IsMe)
                        {
                            continue;
                        }
                        if (Player.HealthPercent < 50 && !ally.IsMe && ally.UnderTurret(true))
                        {
                            continue;
                        }

                        W.Cast(ally);
                    }
                }
            }
        }
Example #11
0
        private void Combo()
        {
            // If target's champion target him, if it's not target surrounding enemy [creep, etc]
            var target = Orbwalker.GetTarget() as AIHeroClient;

            if (target == null)
            {
                target = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
            }

            if ((target != null) && target.IsValidTarget())
            {
                if ((Config.UseQ.GetValue <bool>() && Q.IsReady() &&
                     (Player.Mana > Q.Instance.SData.Mana + R.Instance.SData.Mana)) ||
                    (target.Health < 5 * Player.GetAutoAttackDamage(Player)))
                {
                    Q.Cast();
                }
                if (Config.UseW.GetValue <bool>() && W.IsReady() &&
                    (Player.Mana > W.Instance.SData.Mana + R.Instance.SData.Mana) && target.IsValidTarget(W.Range))
                {
                    SpellCast.SebbySpellMain(W, target);
                }
                foreach (
                    var ulttarget in
                    HeroManager.Enemies.Where(ulttarget => target.IsValidTarget(2000) && OktwCommon.ValidUlt(ulttarget))
                    )
                {
                    if (Config.UseR.GetValue <bool>() && target.IsValidTarget(W.Range) &&
                        (target.Health <
                         W.GetDamage(target) + R.GetDamage(target) + 3 * Player.GetAutoAttackDamage(target) +
                         OktwCommon.GetIncomingDamage(target)) && !target.HasBuff("rebirth"))
                    {
                        SpellCast.SebbySpellMain(R, target);
                        if (Q.IsReady())
                        {
                            Q.Cast();
                        }
                    }
                }
            }
        }
Example #12
0
        private void LogicR()
        {
            foreach (var ally in Program.Allies.Where(ally => ally.IsValid && !ally.IsDead && ally.HealthPercent < 50 && Player.ServerPosition.Distance(ally.ServerPosition) < R.Range && Config.Item("Rally" + ally.ChampionName).GetValue <bool>()))
            {
                int    sensitivity = 20;
                double dmg         = OktwCommon.GetIncomingDamage(ally);
                int    nearEnemys  = ally.CountEnemiesInRange(900);

                nearEnemys = (nearEnemys == 0) ? 1 : nearEnemys;

                if (dmg > 100 + Player.Level * sensitivity)
                {
                    R.Cast(ally);
                }
                else if (ally.Health - dmg < nearEnemys * ally.Level * sensitivity)
                {
                    R.Cast(ally);
                }
            }
        }
Example #13
0
        private static void LogicR()
        {
            foreach (var ally in Program.Allies.Where(ally => ally.IsValid && !ally.IsDead && ally.HealthPercent < 70 && Player.ServerPosition.LSDistance(ally.ServerPosition) < R.Range && getCheckBoxItem(rMenu, "Rally" + ally.ChampionName)))
            {
                double dmg    = OktwCommon.GetIncomingDamage(ally, 1);
                var    enemys = ally.CountEnemiesInRange(800);

                if (dmg == 0 && enemys == 0)
                {
                    continue;
                }

                enemys = (enemys == 0) ? 1 : enemys;

                if (ally.Health - dmg < enemys * ally.Level * 20)
                {
                    R.CastOnUnit(ally);
                }
            }
        }
Example #14
0
        /// <summary>
        ///     AutoIgnite for AIO
        /// </summary>
        public void Ignite()
        {
            if ((ObjectManager.Player.Spellbook.CanUseSpell(SummonerDot.Slot) == SpellState.Ready) &&
                Config.UseIgnite.GetValue <bool>())
            {
                foreach (var enemy in HeroManager.Enemies.Where(enemy => enemy.IsValidTarget(600))) // Ignite Range
                {
                    var ignitedamage = ObjectManager.Player.GetSummonerSpellDamage(enemy, Damage.SummonerSpell.Ignite);
                    var hpprediction = enemy.Health - OktwCommon.GetIncomingDamage(enemy); //OKTW LIB

                    if ((hpprediction <= 2 * ignitedamage) && OktwCommon.ValidUlt(enemy))
                    {
                        if (enemy.Health > ObjectManager.Player.Health)
                        {
                            ObjectManager.Player.Spellbook.CastSpell(SummonerDot.Slot, enemy);
                        }
                    }
                }
            }
        }
Example #15
0
        private void KSAshe()
        {
            if (Config.KillSteal.GetValue <bool>())
            {
                var target = Orbwalker.GetTarget() as AIHeroClient;

                if (target.IsValidTarget(W.Range) &&
                    (target.Health < W.GetDamage(target) + R.GetDamage(target) + OktwCommon.GetIncomingDamage(target)))
                {
                    if (!OktwCommon.IsSpellHeroCollision(target, R))
                    {
                        SpellCast.SebbySpellMain(R, target);
                    }
                    if (!target.CanMove || target.IsStunned)
                    {
                        SpellCast.SebbySpellMain(W, target);
                    }
                }
                if (target.IsValidTarget(1600) &&
                    (target.Health < R.GetDamage(target) + OktwCommon.GetIncomingDamage(target)))
                {
                    if (!OktwCommon.IsSpellHeroCollision(target, R))
                    {
                        SpellCast.SebbySpellMain(R, target);
                    }
                }
                if (target.IsValidTarget(W.Range) &&
                    (target.Health < W.GetDamage(target) + OktwCommon.GetIncomingDamage(target)))
                {
                    if (target.CanMove)
                    {
                        SpellCast.SebbySpellMain(W, target);
                    }
                    else
                    {
                        SpellCast.SebbySpellMain(W, target);
                    }
                }
                // More to be Added
            }
        }
Example #16
0
        private void LogicW()
        {
            if (Player.Mana > RMANA + WMANA)
            {
                double dmg          = OktwCommon.GetIncomingDamage(Player);
                double shieldValue  = 20 + W.Level * 40 + 0.08 * Player.MaxMana + 0.8 * Player.FlatMagicDamageMod;
                double HpPercentage = (dmg * 100) / Player.Health;

                if (dmg > shieldValue)
                {
                    W.Cast();
                }
                else if (HpPercentage >= Config.Item("Wdmg", true).GetValue <Slider>().Value)
                {
                    W.Cast();
                }
                else if (Player.Health - dmg < Player.Level * 10)
                {
                    W.Cast();
                }
            }
        }
Example #17
0
        public void Orbwalker_AfterAttack(AttackableUnit unit, AttackableUnit target)
        {
            if (W.IsReady() && !Program.None && target.IsValidTarget())
            {
                var t = target as AIHeroClient;
                if (t != null)
                {
                    if (Player.GetAutoAttackDamage(t) * 3 > t.Health - OktwCommon.GetIncomingDamage(t))
                    {
                        W.Cast();
                    }
                    if (Program.Combo && Player.Mana > RMANA + WMANA)
                    {
                        W.Cast();
                    }
                    else if (Config.Item("harassW", true).GetValue <bool>() && !Player.UnderTurret(true) && Player.Mana > RMANA + WMANA + QMANA && Config.Item("Harass" + t.ChampionName).GetValue <bool>())
                    {
                        W.Cast();
                    }
                }
                else
                {
                    var t2 = TargetSelector.GetTarget(900, TargetSelector.DamageType.Physical);
                    if (t2.IsValidTarget() && Config.Item("harassW", true).GetValue <bool>() && Config.Item("Harass" + t2.ChampionName).GetValue <bool>() && !Player.UnderTurret(true) && Player.Mana > RMANA + WMANA + QMANA && t2.Distance(target.Position) < 500)
                    {
                        W.Cast();
                    }

                    if (target is Obj_AI_Minion && FarmSpells && Config.Item("farmW", true).GetValue <bool>() && FarmSpells && !Player.UnderTurret(true))
                    {
                        var minions = Cache.GetMinions(target.Position, 500);
                        if (minions.Count >= FarmMinions)
                        {
                            W.Cast();
                        }
                    }
                }
            }
        }
Example #18
0
        private void Ignitee()
        {
            if (CanUse(Ignite) && Config["activator"]["summoner"].GetValue <MenuBool>("Ignite").Value)
            {
                foreach (var enemy in GameObjects.EnemyHeroes.Where(e => e.IsValidTarget(600)))
                {
                    var pred   = enemy.Health - OktwCommon.GetIncomingDamage(enemy);
                    var IgnDmg = IgniteDmg();

                    if (pred <= 2 * IgnDmg && OktwCommon.ValidUlt(enemy))
                    {
                        if (pred <= IgnDmg && enemy.CountAllyHeroesInRange(450) < 2)
                        {
                            var enemyPred = Movement.GetPrediction(enemy, 0.1f).CastPosition;
                            if (Player.Position.Distance(enemyPred) > 500 || NavMesh.IsWallOfGrass(enemyPred, 0))
                            {
                                Player.Spellbook.CastSpell(Ignite, enemy);
                            }
                        }

                        if (enemy.PercentLifeStealMod > 0.1)
                        {
                            Player.Spellbook.CastSpell(Ignite, enemy);
                        }

                        if (enemy.HasBuff("RegenerationPotion") || enemy.HasBuff("Item2010") ||
                            enemy.HasBuff("ItemCrystalFlask") || enemy.HasBuff("ItemCrystalFlaskJungle") || enemy.HasBuff("ItemDarkCrystalFlask"))
                        {
                            Player.Spellbook.CastSpell(Ignite, enemy);
                        }

                        if (enemy.Health > Player.Health)
                        {
                            Player.Spellbook.CastSpell(Ignite, enemy);
                        }
                    }
                }
            }
        }
Example #19
0
        private void LogicR()
        {
            if (Config.Item("autoR", true).GetValue <bool>())
            {
                R.Range = Config.Item("MaxRangeR", true).GetValue <Slider>().Value;
                var minHpCombo = Config.Item("minHpSpecial", true).GetValue <Slider>().Value;
                foreach (var target in HeroManager.Enemies.Where(target => target.IsValidTarget(R.Range) && OktwCommon.ValidUlt(target)))
                {
                    double predictedHealth = target.Health - OktwCommon.GetIncomingDamage(target);
                    double Rdmg            = R.GetDamage(target);

                    if (Rdmg > predictedHealth)
                    {
                        var incom = OktwCommon.GetIncomingDamage(Player);
                        if (incom > 0 && Player.Health - incom * Player.CountEnemiesInRange(500) < Player.Level * 12)
                        {
                            R.Cast(target, true, true);
                        }
                    }

                    Rdmg = Rdmg * 0.66;

                    if (Rdmg > predictedHealth && target.CountAlliesInRange(500) == 0 && Player.Distance(target) > Config.Item("MinRangeR", true).GetValue <Slider>().Value)
                    {
                        Program.CastSpell(R, target);
                    }

                    if (Program.Combo && target.HealthPercent < minHpCombo)
                    {
                        R.CastIfWillHit(target, Config.Item("Raoe", true).GetValue <Slider>().Value, true);

                        if (Config.Item("Rcc", true).GetValue <bool>() && !OktwCommon.CanMove(target))
                        {
                            R.Cast(target, true, true);
                        }
                    }
                }
            }
        }
Example #20
0
        private void LogicR()
        {
            var t = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Magical);

            if (t.IsValidTarget())
            {
                var poutput = R.GetPrediction(t, true);

                var aoeCount = poutput.AoeTargetsHitCount;

                aoeCount = (aoeCount == 0) ? 1 : aoeCount;

                if (MainMenu.Item("rCount", true).GetValue <Slider>().Value > 0 && MainMenu.Item("rCount", true).GetValue <Slider>().Value <= aoeCount)
                {
                    R.Cast(poutput.CastPosition);
                }

                if (t.Health < R.GetDamage(t) &&
                    OktwCommon.ValidUlt(t) && poutput.Hitchance >= HitChance.Medium)
                {
                    R.Cast(poutput.CastPosition);
                }

                if (Player.HealthPercent < 60)
                {
                    double dmg    = OktwCommon.GetIncomingDamage(Player, 1);
                    var    enemys = Player.CountEnemiesInRange(700);
                    if (dmg > 0 && (Player.Health - dmg) < (enemys * Player.Level * 15))
                    {
                        R.Cast(poutput.CastPosition);
                    }
                    else if ((Player.Health - dmg) < (Player.Level * 10) && dmg > 0)
                    {
                        R.Cast(poutput.CastPosition);
                    }
                }
            }
        }
Example #21
0
    private void PotionManagement()
    {
        if (Player.Health - OktwCommon.GetIncomingDamage(Player) + 250 > Player.MaxHealth)
        {
            return;
        }

        if (Player.HealthPercent > 50 && Player.CountEnemiesInRange(700) == 0)
        {
            return;
        }

        if (Player.HasBuff("RegenerationPotion") || Player.HasBuff("ItemMiniRegenPotion") || Player.HasBuff("ItemCrystalFlaskJungle") || Player.HasBuff("ItemDarkCrystalFlask") || Player.HasBuff("ItemCrystalFlask"))
        {
            return;
        }

        if (Potion.IsReady())
        {
            Potion.Cast();
        }
        else if (Biscuit.IsReady())
        {
            Biscuit.Cast();
        }
        else if (Hunter.IsReady())
        {
            Hunter.Cast();
        }
        else if (Corrupting.IsReady())
        {
            Corrupting.Cast();
        }
        else if (Refillable.IsReady())
        {
            Refillable.Cast();
        }
    }
Example #22
0
        private void LogicR()
        {
            if (Player.UnderTurret(true) && Config.Item("Rturrent", true).GetValue <bool>())
            {
                return;
            }

            if (Config.Item("autoR", true).GetValue <bool>() && Player.CountEnemiesInRange(800) == 0 && Game.Time - OverKill > 0.6)
            {
                R.Range = Config.Item("MaxRangeR", true).GetValue <Slider>().Value;
                foreach (var target in HeroManager.Enemies.Where(target => target.IsValidTarget(R.Range) && OktwCommon.ValidUlt(target)))
                {
                    double predictedHealth = target.Health - OktwCommon.GetIncomingDamage(target);

                    if (Config.Item("Rcc", true).GetValue <bool>() && target.IsValidTarget(Q.Range + E.Range) && target.Health < Player.MaxHealth && !OktwCommon.CanMove(target))
                    {
                        R.Cast(target, true, true);
                    }

                    double Rdmg = R.GetDamage(target);

                    if (Rdmg > predictedHealth)
                    {
                        Rdmg = getRdmg(target);
                    }

                    if (Rdmg > predictedHealth && target.CountAlliesInRange(500) == 0 && Player.Distance(target) > Config.Item("MinRangeR", true).GetValue <Slider>().Value)
                    {
                        Program.CastSpell(R, target);
                        Program.debug("R normal");
                    }
                    if (Program.Combo && Player.CountEnemiesInRange(1200) == 0)
                    {
                        R.CastIfWillHit(target, Config.Item("Raoe", true).GetValue <Slider>().Value, true);
                    }
                }
            }
        }
Example #23
0
        private void SurvivalLogic()
        {
            if (E.IsReady() && Player.HealthPercent < 50 && Config.Item("Edead", true).GetValue <bool>())
            {
                double dmg = OktwCommon.GetIncomingDamage(Player, 0.5F);
                if (dmg > 0)
                {
                    if (Player.Health - dmg < Player.CountEnemiesInRange(700) * Player.Level * 5)
                    {
                        CastE();
                    }
                    else if (Player.Health - dmg < Player.Level * 5)
                    {
                        CastE();
                    }
                }
            }

            if (R.IsReady())
            {
                if (R.IsReady() && AllyR != null && AllyR.IsVisible && AllyR.HealthPercent < 50 && AllyR.Distance(Player.Position) < R.Range)
                {
                    double dmg = OktwCommon.GetIncomingDamage(AllyR, 1);
                    if (dmg > 0)
                    {
                        if (AllyR.Health - dmg < AllyR.CountEnemiesInRange(700) * AllyR.Level * 10)
                        {
                            R.Cast();
                        }
                        else if (AllyR.Health - dmg < AllyR.Level * 10)
                        {
                            R.Cast();
                        }
                    }
                }
            }
        }
Example #24
0
    private void Ignite()
    {
        if (CanUse(ignite) && MainMenu.Item("Ignite").GetValue <bool>())
        {
            foreach (var enemy in HeroManager.Enemies.Where(enemy => enemy.IsValidTarget(600)))
            {
                var pred = enemy.Health - OktwCommon.GetIncomingDamage(enemy);

                var IgnDmg = Player.GetSummonerSpellDamage(enemy, Damage.SummonerSpell.Ignite);

                if (pred <= 2 * IgnDmg && OktwCommon.ValidUlt(enemy))
                {
                    if (pred <= IgnDmg && enemy.CountAlliesInRange(450) < 2)
                    {
                        var enemyPred = Prediction.GetPrediction(enemy, 0.1f).CastPosition;
                        if (Player.ServerPosition.Distance(enemyPred) > 500 || NavMesh.IsWallOfGrass(enemyPred, 0))
                        {
                            Player.Spellbook.CastSpell(ignite, enemy);
                        }
                    }

                    //if (enemy.PercentLifeStealMod > 10)
                    //    Player.Spellbook.CastSpell(ignite, enemy);

                    if (enemy.HasBuff("RegenerationPotion") || enemy.HasBuff("ItemMiniRegenPotion") || enemy.HasBuff("ItemCrystalFlask"))
                    {
                        Player.Spellbook.CastSpell(ignite, enemy);
                    }

                    if (enemy.Health > Player.Health)
                    {
                        Player.Spellbook.CastSpell(ignite, enemy);
                    }
                }
            }
        }
    }
Example #25
0
        private void LogicQ()
        {
            var hpPred = Player.Health - OktwCommon.GetIncomingDamage(Player) > Player.MaxHealth * 0.3;

            foreach (var t in HeroManager.Enemies.Where(enemy => enemy.IsValidTarget(Q.Range)).OrderBy(enemy => enemy.Health))
            {
                if (OktwCommon.GetKsDamage(t, Q) + Player.GetAutoAttackDamage(t) > t.Health)
                {
                    Q.Cast(t);
                }

                if (!Config.Item("qUseOn" + t.ChampionName).GetValue <bool>() && hpPred)
                {
                    continue;
                }

                if (Config.Item("QafterAA", true).GetValue <bool>())
                {
                    continue;
                }

                if (Program.Harass && OktwCommon.CanHarras() && Config.Item("Harass" + t.ChampionName).GetValue <bool>() && Player.Mana > RMANA + WMANA + QMANA)
                {
                    Q.Cast(t);
                }

                if (t.IsMelee && t.IsFacing(Player) && t.ServerPosition.Distance(Player.ServerPosition) > 300)
                {
                    continue;
                }

                if (Program.Combo)
                {
                    Q.Cast(t);
                }
            }
        }
Example #26
0
        private static void LogicR()
        {
            var rEnemy = getSliderItem(rMenu, "Renemy");

            double dmg    = OktwCommon.GetIncomingDamage(Player, 1);
            var    enemys = Player.CountEnemiesInRange(900);

            if (dmg == 0 && enemys == 0)
            {
                return;
            }

            if (Player.CountEnemiesInRange(500) < rEnemy)
            {
                if (Player.Health - dmg < enemys * Player.Level * 15)
                {
                    R.Cast(Player);
                }
                else if (Player.Health - dmg < Player.Level * 15)
                {
                    R.Cast(Player);
                }
            }
        }
Example #27
0
        private void LogicR()
        {
            var rEnemy = Config.Item("Renemy", true).GetValue <Slider>().Value;

            double dmg    = OktwCommon.GetIncomingDamage(Player, 1);
            var    enemys = Player.CountEnemiesInRange(900);

            if (dmg == 0 && enemys == 0)
            {
                return;
            }

            if (Player.CountEnemiesInRange(500) < rEnemy)
            {
                if (Player.Health - dmg < enemys * Player.Level * 15)
                {
                    R.Cast(Player);
                }
                else if (Player.Health - dmg < Player.Level * 15)
                {
                    R.Cast(Player);
                }
            }
        }
Example #28
0
        private void KillStealCheck()
        {
            if (Config.Item("EnableKS").GetValue <bool>())
            {
                var target = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Magical);
                if ((target == null) || !target.IsValidTarget())
                {
                    return;
                }

                if (Config.Item("KSQ").GetValue <bool>() && Player.IsFacing(target) && target.IsValidTarget(Q.Range) &&
                    Q.Instance.IsReady() &&
                    (target.Health < OktwCommon.GetKsDamage(target, Q)))
                {
                    Q.Cast();
                }
                if (Config.Item("KSE").GetValue <bool>() && target.IsValidTarget(E.Range) && E.Instance.IsReady() &&
                    (target.Health < OktwCommon.GetKsDamage(target, E)))
                {
                    SebbySpell(E, target);
                }
                if (Config.Item("KSItems").GetValue <bool>())
                {
                    if (GLP800.IsReady() && target.IsValidTarget(GLP800.Range) &&
                        (target.Health < OktwCommon.GetIncomingDamage(target) + (100 + Player.TotalMagicalDamage) * 100))
                    {
                        GLP800.Cast(target.ServerPosition);
                    }
                    if (Protobelt.IsReady() && target.IsValidTarget(Protobelt.Range) &&
                        (target.Health < OktwCommon.GetIncomingDamage(target) + (75 + Player.TotalMagicalDamage) * 100))
                    {
                        Protobelt.Cast(target.ServerPosition);
                    }
                }
            }
        }
Example #29
0
        private void RUsage()
        {
            // Massive Thanks to Sebby for the time saved instead of writing it from scratch, instead I 'stole' it from him :feelsbadman:
            var bounceRange = 430;
            var t2          = TargetSelector.GetTarget(R.Range + bounceRange, TargetSelector.DamageType.Magical);

            if (t2.IsValidTarget(R.Range) &&
                (t2.CountEnemiesInRange(bounceRange) >= Config.NearbyREnemies.GetValue <Slider>().Value) &&
                (Config.NearbyREnemies.GetValue <Slider>().Value > 0))
            {
                R.Cast(t2);
            }

            if (t2.IsValidTarget() && OktwCommon.ValidUlt(t2))
            {
                if ((t2.CountAlliesInRange(550) == 0) || (Player.HealthPercent < 50) ||
                    (t2.CountEnemiesInRange(bounceRange) > 1))
                {
                    var prepos = R.GetPrediction(t2).CastPosition;
                    var dmgR   = R.GetDamage(t2);

                    if (t2.Health < dmgR * 3)
                    {
                        var totalDmg    = dmgR;
                        var minionCount = CountMinionsInRange(bounceRange, prepos);

                        if (t2.IsValidTarget(R.Range))
                        {
                            if (prepos.CountEnemiesInRange(bounceRange) > 1)
                            {
                                if (minionCount > 2)
                                {
                                    totalDmg = dmgR * 2;
                                }
                                else
                                {
                                    totalDmg = dmgR * 3;
                                }
                            }
                            else if (minionCount > 0)
                            {
                                totalDmg = dmgR * 2;
                            }

                            if (W.IsReady())
                            {
                                totalDmg += W.GetDamage(t2);
                            }

                            if (E.IsReady())
                            {
                                totalDmg += E.GetDamage(t2);
                            }

                            if (Q.IsReady())
                            {
                                totalDmg += Q.GetDamage(t2);
                            }

                            totalDmg += BonusDmg(t2);
                            totalDmg += OktwCommon.GetEchoLudenDamage(t2);

                            // Hex
                            if (Items.HasItem(3155, t2))
                            {
                                totalDmg = totalDmg - 250;
                            }

                            // MoM
                            if (Items.HasItem(3156, t2))
                            {
                                totalDmg = totalDmg - 300;
                            }

                            if ((totalDmg > t2.Health - OktwCommon.GetIncomingDamage(t2)) &&
                                (Player.GetAutoAttackDamage(t2) * 2 < t2.Health))
                            {
                                R.CastOnUnit(t2);
                            }
                        }
                        else if (t2.Health - OktwCommon.GetIncomingDamage(t2) < dmgR * 2 + BonusDmg(t2))
                        {
                            if (Player.CountEnemiesInRange(R.Range) > 0)
                            {
                                foreach (
                                    var t in
                                    HeroManager.Enemies.Where(
                                        enemy => enemy.IsValidTarget(R.Range) && (enemy.Distance(prepos) < bounceRange))
                                    )
                                {
                                    R.CastOnUnit(t);
                                }
                            }
                            else
                            {
                                var minions = Cache.GetMinions(Player.Position, R.Range);
                                foreach (
                                    var minion in
                                    minions.Where(
                                        minion =>
                                        minion.IsValidTarget(R.Range) && (minion.Distance(prepos) < bounceRange))
                                    )
                                {
                                    R.CastOnUnit(minion);
                                }
                            }
                        }
                    }
                }
            }
        }
Example #30
0
        private static void QLogic()
        {
            #region Q逻辑
            //Q消耗
            if (Config.Item("消耗Q兵").GetValue <bool>() && Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed)
            {
                var ms = MinionManager.GetMinions(Q.Range);
                if (ms != null && ms.Count > 0)
                {
                    var t = ms.Find(m => Q.GetDmg(m) > m.Health && m.CountEnemiesInRange(200) > 0);
                    if (t != null)
                    {
                        Q.Cast(t);
                    }
                }
            }

            if (Config.Item("清兵Q").GetValue <bool>() && Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear)
            {
                var ms = MinionManager.GetMinions(Q.Range);
                if (ms != null && ms.Count >= 3)
                {
                    var t = ms.Find(m => Q.GetDmg(m) > m.Health);
                    if (t != null)
                    {
                        Q.Cast(t);
                    }
                }
            }

            if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
            {
                var target = Orbwalker.GetTarget() as Obj_AI_Hero;
                if (target != null && target.IsValid && !Orbwalking.CanAttack() && !Player.IsWindingUp && target.Health < Q.GetDmg(target) + W.GetDmg(target))
                {
                    Q.Cast(target);
                }
            }

            //Q抢人头
            foreach (var enemy in HeroManager.Enemies.Where(e => e.IsValidTarget(Q.Range) && Q.GetDmg(e) + OktwCommon.GetIncomingDamage(e) > e.Health))
            {
                Q.Cast(enemy);
            }

            #endregion
        }