Example #1
0
 private static void OnUpdate(EventArgs args)
 {
     if (Zhonya.IsOwned())
     {
         UseItem1(Zhonya);
     }
     if (Seraph.IsOwned())
     {
         UseItem2(Seraph);
     }
 }
Example #2
0
 private static void OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
 {
     if (args.Target.NetworkId != Player.NetworkId || Orbwalk.CurrentMode != Orbwalker.Mode.Combo)
     {
         return;
     }
     if (GetValue <bool>("Combo", "Seraph") && Seraph.IsReady() &&
         Player.HealthPercent < GetValue <Slider>("Combo", "SeraphHpU").Value)
     {
         Seraph.Cast();
     }
 }
Example #3
0
        private static void SeraphUsage()
        {
            var incomingdmg = OktwCommon.GetIncomingDamage(Player, 1);

            if (Seraph.IsReady() && Menu.Item("UseSeraph").GetValue <bool>())
            {
                var shieldint = Player.Mana * 0.2 + 150;
                if ((incomingdmg > Player.Health) && (incomingdmg < Player.Health + shieldint))
                {
                    Seraph.Cast();
                }
            }
        }
Example #4
0
        public static void Defensive2()
        {
            //Zhonyas
            if (ActiveMenu["Zhonyas2"].Cast <CheckBox>().CurrentValue)
            {
                if (Player.Instance.IsDead)
                {
                    return;
                }

                if (Zhonyas.IsOwned() && Zhonyas.IsReady())
                {
                    if (Player.Instance.HealthPercent <= ActiveMenu["Item.ZyHp2"].Cast <Slider>().CurrentValue)
                    {
                        Zhonyas.Cast();
                    }
                }
            }
            //Seraph
            if (ActiveMenu["Seraph2"].Cast <CheckBox>().CurrentValue)
            {
                if (Player.Instance.IsDead)
                {
                    return;
                }

                if (Seraph.IsOwned() && Seraph.IsReady())
                {
                    if (Player.Instance.HealthPercent <= ActiveMenu["Item.SeraphHp2"].Cast <Slider>().CurrentValue)
                    {
                        Seraph.Cast();
                    }
                }
            }
            //Solari
            if (ActiveMenu["Solari2"].Cast <CheckBox>().CurrentValue)
            {
                if (Player.Instance.IsDead)
                {
                    return;
                }

                if (Solari.IsOwned() && Solari.IsReady())
                {
                    if (Player.Instance.HealthPercent <= ActiveMenu["Item.SolariHp2"].Cast <Slider>().CurrentValue)
                    {
                        Solari.Cast();
                    }
                }
            }
        }
        /// <summary>
        ///     Defensive Item Usage - Seraph
        /// </summary>
        public void SeraphUsage()
        {
            var incomingdmg = OktwCommon.GetIncomingDamage(ObjectManager.Player, 1);

            if (Seraph.IsReady() && Config.UseSeraph.GetValue <bool>())
            {
                var shieldint = ObjectManager.Player.Mana * 0.2 + 150;
                if ((incomingdmg > ObjectManager.Player.Health) &&
                    (incomingdmg < ObjectManager.Player.Health + shieldint))
                {
                    Seraph.Cast();
                }
            }
        }
Example #6
0
        private void Survival()
        {
            if (Player.HealthPercent < 60 && (Seraph.IsReady() || Zhonya.IsReady() || CanUse(barrier)))
            {
                var dmg    = OktwCommon.GetIncomingDamage(Player, 1);
                var enemys = Player.CountEnemiesInRange(800);
                if (dmg > 0 || enemys > 0)
                {
                    if (CanUse(barrier) && getCheckBoxItem("Barrier"))
                    {
                        var value = 95 + Player.Level * 20;
                        if (dmg > value && Player.HealthPercent < 50)
                        {
                            Player.Spellbook.CastSpell(barrier, Player);
                        }
                        else if (Player.Health - dmg < enemys * Player.Level * 20)
                        {
                            Player.Spellbook.CastSpell(barrier, Player);
                        }
                        else if (Player.Health - dmg < Player.Level * 10)
                        {
                            Seraph.Cast();
                        }
                    }

                    if (Seraph.IsReady() && getCheckBoxItem("Seraph"))
                    {
                        var value = Player.Mana * 0.2 + 150;
                        if (dmg > value && Player.HealthPercent < 50)
                        {
                            Seraph.Cast();
                        }
                        else if (Player.Health - dmg < enemys * Player.Level * 20)
                        {
                            Seraph.Cast();
                        }
                        else if (Player.Health - dmg < Player.Level * 10)
                        {
                            Seraph.Cast();
                        }
                    }

                    if (Zhonya.IsReady() && getCheckBoxItem("Zhonya"))
                    {
                        if (dmg > Player.Level * 35)
                        {
                            Zhonya.Cast();
                        }
                        else if (Player.Health - dmg < enemys * Player.Level * 20)
                        {
                            Zhonya.Cast();
                        }
                        else if (Player.Health - dmg < Player.Level * 10)
                        {
                            Zhonya.Cast();
                        }
                    }
                }
            }


            if (!Solari.IsReady() && !FaceOfTheMountain.IsReady() && !CanUse(heal))
            {
                return;
            }

            foreach (
                var ally in
                Program.Allies.Where(
                    ally =>
                    ally.IsValid && !ally.IsDead && ally.HealthPercent < 50 &&
                    Player.Distance(ally.ServerPosition) < 700))
            {
                var dmg    = OktwCommon.GetIncomingDamage(ally, 1);
                var enemys = ally.CountEnemiesInRange(700);
                if (dmg == 0 && enemys == 0)
                {
                    continue;
                }

                if (CanUse(heal) && getCheckBoxItem("Heal"))
                {
                    if (!getCheckBoxItem("AllyHeal") && !ally.IsMe)
                    {
                        return;
                    }

                    if (ally.Health - dmg < enemys * ally.Level * 15)
                    {
                        Player.Spellbook.CastSpell(heal, ally);
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        Player.Spellbook.CastSpell(heal, ally);
                    }
                }

                if (getCheckBoxItem("Solari") && Solari.IsReady() && Player.Distance(ally.ServerPosition) < Solari.Range)
                {
                    var value = 75 + 15 * Player.Level;
                    if (dmg > value && Player.HealthPercent < 50)
                    {
                        Solari.Cast();
                    }
                    else if (ally.Health - dmg < enemys * ally.Level * 15)
                    {
                        Solari.Cast();
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        Solari.Cast();
                    }
                }

                if (getCheckBoxItem("FaceOfTheMountain") && FaceOfTheMountain.IsReady() &&
                    Player.Distance(ally.ServerPosition) < FaceOfTheMountain.Range)
                {
                    var value = 0.1 * Player.MaxHealth;
                    if (dmg > value && Player.HealthPercent < 50)
                    {
                        FaceOfTheMountain.Cast(ally);
                    }
                    else if (ally.Health - dmg < enemys * ally.Level * 15)
                    {
                        FaceOfTheMountain.Cast(ally);
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        FaceOfTheMountain.Cast(ally);
                    }
                }
            }
        }
Example #7
0
        private void Survival()
        {
            if (Player.HealthPercent < 60 && (Seraph.IsReady || ZhonyaReady() || CanUse(Barrier)))
            {
                var dmg    = OktwCommon.GetIncomingDamage(Player, 1);
                var enemys = Player.CountEnemyHeroesInRange(800);
                if (dmg > 0 || enemys > 0)
                {
                    if (CanUse(Barrier) && Config["activator"]["summoner"].GetValue <MenuBool>("Barrier").Value)
                    {
                        var value = 95 + Player.Level * 20;
                        if (dmg > value && Player.HealthPercent < 50)
                        {
                            Player.Spellbook.CastSpell(Barrier, Player);
                        }
                        else if (Player.Health - dmg < enemys * Player.Level * 20)
                        {
                            Player.Spellbook.CastSpell(Barrier, Player);
                        }
                        else if (Player.Health - dmg < Player.Level * 10)
                        {
                            Player.Spellbook.CastSpell(Barrier, Player);
                        }
                    }

                    if (Seraph.IsReady && Config["activator"]["defensives"].GetValue <MenuBool>("Seraph").Value)
                    {
                        var value = 150 + Player.Mana * 0.15;
                        if (dmg > value && Player.HealthPercent < 50)
                        {
                            Seraph.Cast();
                        }
                        else if (Player.Health - dmg < enemys * Player.Level * 20)
                        {
                            Seraph.Cast();
                        }
                        else if (Player.Health - dmg < Player.Level * 10)
                        {
                            Seraph.Cast();
                        }
                    }

                    if (ZhonyaReady() && Config["activator"]["defensives"]["zhonya"].GetValue <MenuBool>("Zhonya").Value)
                    {
                        if (dmg > Player.Level * 35)
                        {
                            ZhonyaTryCast();
                        }
                        else if (Player.Health - dmg < enemys * Player.Level * 20)
                        {
                            ZhonyaTryCast();
                        }
                        else if (Player.Health - dmg < Player.Level * 10)
                        {
                            ZhonyaTryCast();
                        }
                    }
                }
            }

            if (!Solari.IsReady && !CanUse(Heal))
            {
                return;
            }

            foreach (var ally in GameObjects.AllyHeroes.Where(a => a.IsValidTarget(700, false) && a.HealthPercent < 50))
            {
                var dmg    = OktwCommon.GetIncomingDamage(ally, 1);
                var enemys = ally.CountEnemyHeroesInRange(700);
                if (dmg == 0 && enemys == 0)
                {
                    continue;
                }

                if (CanUse(Heal) && Config["activator"]["summoner"]["heal"].GetValue <MenuBool>("Heal").Value)
                {
                    if (!Config["activator"]["summoner"]["heal"].GetValue <MenuBool>("AllyHeal").Value&& !ally.IsMe)
                    {
                        return;
                    }

                    if (ally.Health - dmg < enemys * ally.Level * 15)
                    {
                        Player.Spellbook.CastSpell(Heal, ally);
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        Player.Spellbook.CastSpell(Heal, ally);
                    }
                }

                if (Config["activator"]["defensives"].GetValue <MenuBool>("Solari").Value&& Solari.IsReady && Player.Distance(ally.Position) < Solari.Range)
                {
                    var value = 30 + 15 * Player.Level + 0.2 * Player.BonusHealth;
                    if (dmg > value && Player.HealthPercent < 50)
                    {
                        Solari.Cast();
                    }
                    else if (ally.Health - dmg < enemys * ally.Level * 15)
                    {
                        Solari.Cast();
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        Solari.Cast();
                    }
                }
            }
        }
Example #8
0
        public static void Execute()
        {
            if (Player.Instance.IsInShopRange() || Player.Instance.CountAlliesInRange(Misc.RangeEnemy) < Misc.EnemyCount ||
                Activator.lastUsed >= Environment.TickCount)
            {
                return;
            }

            #region Self

            if (Zhonyas.IsReady() && Zhonyas.IsOwned() && Player.Instance.InDanger(Settings.ZhonyasMyHp) &&
                Settings.Zhonyas)
            {
                Zhonyas.Cast();
                Activator.lastUsed = Environment.TickCount + 1500;
            }

            if (Seraph.IsReady() && Seraph.IsOwned() && Player.Instance.InDanger(Settings.MYHPSeraph) &&
                Settings.UseSeraph)
            {
                Seraph.Cast();
                Activator.lastUsed = Environment.TickCount + 1500;
            }

            if (Talisman.IsReady() && Player.Instance.CountAlliesInRange(450) >= 2 && Talisman.IsOwned() &&
                Player.Instance.InDanger(30))
            {
                Talisman.Cast();
                Activator.lastUsed = Environment.TickCount + 1500;
            }

            if (Randuin.IsReady() && Player.Instance.CountEnemiesInRange(Randuin.Range) >= 2 && Randuin.IsOwned() &&
                Player.Instance.InDanger(30))
            {
                Randuin.Cast();
                Activator.lastUsed = Environment.TickCount + 500;
            }
            //Allies
            if (FaceOfTheMountain.IsReady() && FaceOfTheMountain.IsOwned())
            {
                var allyFace = EntityManager.Heroes.Allies.FirstOrDefault(a => a.InDanger(Settings.AllyHPFaceOfTheMountain));
                if (allyFace != null)
                {
                    FaceOfTheMountain.Cast(allyFace);
                    Activator.lastUsed = Environment.TickCount + 500;
                }
            }

            if (Mikael.IsReady() && Player.Instance.HasCCs() && Mikael.IsOwned())
            {
                var allyMikael = EntityManager.Heroes.Allies.FirstOrDefault(a => a.InDanger(Settings.AllyHPMikaelHeal));
                if (allyMikael != null)
                {
                    Mikael.Cast(allyMikael);
                    Activator.lastUsed = Environment.TickCount + 500;
                }
            }

            if (Solari.IsReady() && Solari.IsOwned())
            {
                var allySolari = EntityManager.Heroes.Allies.FirstOrDefault(a => a.InDanger(Settings.AllyHealthSolari));
                if (allySolari != null)
                {
                    Solari.Cast();
                    Activator.lastUsed = Environment.TickCount + 1500;
                }
            }

            if (Ohm.IsReady() && Ohm.IsOwned())
            {
                var turret   = EntityManager.Turrets.Enemies.FirstOrDefault(t => t.IsAttackingPlayer);
                var allyFace = EntityManager.Heroes.Allies.FirstOrDefault(a => a.InDanger(Settings.OhmHealth));
                if (allyFace != null && turret != null)
                {
                    Ohm.Cast(turret);
                    Activator.lastUsed = Environment.TickCount + 500;
                }
            }

            //CC

            if (DerbishBlade.IsReady() && DerbishBlade.IsOwned() && Settings.DerbishBlade && Player.Instance.HasCCs())
            {
                Core.DelayAction(() => DerbishBlade.Cast(), Settings.CleanseDelay);
                Activator.lastUsed = Environment.TickCount + 1500;
            }

            if (Mercurial.IsReady() && Mercurial.IsOwned() && Settings.Mercurial && Player.Instance.HasCCs())
            {
                Core.DelayAction(() => Mercurial.Cast(), Settings.CleanseDelay);
                Activator.lastUsed = Environment.TickCount + 1500;
            }

            if (QuickSilver.IsReady() && QuickSilver.IsOwned() && Settings.QuickSilver && Player.Instance.HasCCs())
            {
                Core.DelayAction(() => QuickSilver.Cast(), Settings.CleanseDelay);
                Activator.lastUsed = Environment.TickCount + 1500;
            }

            var ally = EntityManager.Heroes.Allies.FirstOrDefault(a => a.IsValidTarget(Mikael.Range));
            if (ally == null)
            {
                return;
            }
            if (!ally.HasCCs())
            {
                return;
            }

            if (Mikael.IsReady() && Mikael.IsOwned() && Settings.MikaelCleanse)
            {
                Core.DelayAction(() => Mikael.Cast(ally), Settings.CleanseDelay);
                Activator.lastUsed = Environment.TickCount + 1500;
            }

            #endregion Self
        }
Example #9
0
        protected override void Volatile_ProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsEnemy)
            {
                return;
            }

            if (!Solari.IsReady() && !FaceOfTheMountain.IsReady() && !Seraph.IsReady() && !Zhonya.IsReady() &&
                !CanUse(_barrier) && !CanUse(_heal) && !CanUse(_exhaust))
            {
                return;
            }

            if (sender.Distance(Player.Position) > 1600)
            {
                return;
            }

            foreach (
                var ally in
                EntityManager.Heroes.Allies.Where(
                    ally =>
                    ally.IsValid && !ally.IsDead && ally.HealthPercent < 51 &&
                    Player.Distance(ally.ServerPosition) < 700))
            {
                double dmg = 0;
                if (args.Target != null && args.Target.NetworkId == ally.NetworkId)
                {
                    dmg = dmg + ((AIHeroClient)sender).GetSpellDamage(ally, args.Slot);
                }
                else
                {
                    var castArea = ally.Distance(args.End) * (args.End - ally.ServerPosition).Normalized() +
                                   ally.ServerPosition;
                    if (castArea.Distance(ally.ServerPosition) < ally.BoundingRadius / 2)
                    {
                        dmg = dmg + ((AIHeroClient)sender).GetSpellDamage(ally, args.Slot);
                    }
                    else
                    {
                        continue;
                    }
                }

                if (CanUse(_exhaust) && SummonersMenu["exhaust"].Cast <CheckBox>().CurrentValue)
                {
                    if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 40)
                    {
                        TryCast(() => Player.Spellbook.CastSpell(_exhaust, sender));
                    }
                }

                if (CanUse(_heal) && SummonersMenu["heal"].Cast <CheckBox>().CurrentValue)
                {
                    if (SummonersMenu["healteam"].Cast <CheckBox>().CurrentValue&& !ally.IsMe)
                    {
                        return;
                    }

                    if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 10)
                    {
                        TryCast(() => Player.Spellbook.CastSpell(_heal, ally));
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        TryCast(() => Player.Spellbook.CastSpell(_heal, ally));
                    }
                }

                if (DefensivesMenu["lotis"].Cast <CheckBox>().CurrentValue&& Solari.IsReady() &&
                    Player.Distance(ally.ServerPosition) < Solari.Range)
                {
                    var value = 75 + (15 * Player.Level);
                    if (dmg > value && Player.HealthPercent < 50)
                    {
                        Solari.Cast();
                    }
                    else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 15)
                    {
                        Solari.Cast();
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        Solari.Cast();
                    }
                }

                if (DefensivesMenu["fotm"].Cast <CheckBox>().CurrentValue&& FaceOfTheMountain.IsReady() &&
                    Player.Distance(ally.ServerPosition) < FaceOfTheMountain.Range)
                {
                    var value = 0.1 * Player.MaxHealth;
                    if (dmg > value && Player.HealthPercent < 50)
                    {
                        TryCast(() => FaceOfTheMountain.Cast(ally));
                    }
                    else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 15)
                    {
                        TryCast(() => FaceOfTheMountain.Cast(ally));
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        TryCast(() => FaceOfTheMountain.Cast(ally));
                    }
                }

                if (!ally.IsMe)
                {
                    continue;
                }

                if (CanUse(_barrier) && SummonersMenu["barrier"].Cast <CheckBox>().CurrentValue)
                {
                    var value = 95 + Player.Level * 20;
                    if (dmg > value && Player.HealthPercent < 50)
                    {
                        TryCast(() => Player.Spellbook.CastSpell(_barrier, Player));
                    }
                    else if (Player.Health - dmg < Player.CountEnemiesInRange(700) * Player.Level * 15)
                    {
                        TryCast(() => Player.Spellbook.CastSpell(_barrier, Player));
                    }
                    else if (ally.Health - dmg < ally.Level * 15)
                    {
                        TryCast(() => Seraph.Cast());
                    }
                }

                if (Seraph.IsReady() && DefensivesMenu["se"].Cast <CheckBox>().CurrentValue)
                {
                    var value = Player.Mana * 0.2 + 150;
                    if (dmg > value && Player.HealthPercent < 50)
                    {
                        TryCast(() => Seraph.Cast());
                    }
                    else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 15)
                    {
                        TryCast(() => Seraph.Cast());
                    }
                    else if (ally.Health - dmg < ally.Level * 15)
                    {
                        TryCast(() => Seraph.Cast());
                    }
                }

                if (Zhonya.IsReady() && DefensivesMenu["zh"].Cast <CheckBox>().CurrentValue)
                {
                    if (dmg > Player.Level * 30)
                    {
                        TryCast(() => Zhonya.Cast());
                    }
                    else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 15)
                    {
                        TryCast(() => Zhonya.Cast());
                    }
                    else if (ally.Health - dmg < ally.Level * 15)
                    {
                        TryCast(() => Zhonya.Cast());
                    }
                }
            }
        }
Example #10
0
    private void Survival()
    {
        if (Player.HealthPercent < 60 && (Seraph.IsReady() || Zhonya.IsReady()))
        {
            double dmg    = OktwCommon.GetIncomingDamage(Player, 1);
            var    enemys = Player.CountEnemiesInRange(800);
            if (dmg > 0 || enemys > 0)
            {
                if (Seraph.IsReady() && MainMenu.Item("Seraph").GetValue <bool>())
                {
                    var value = Player.Mana * 0.2 + 150;
                    if (dmg > value && Player.HealthPercent < 50)
                    {
                        Seraph.Cast();
                    }
                    else if (Player.Health - dmg < enemys * Player.Level * 20)
                    {
                        Seraph.Cast();
                    }
                    else if (Player.Health - dmg < Player.Level * 10)
                    {
                        Seraph.Cast();
                    }
                }

                if (Zhonya.IsReady() && MainMenu.Item("Zhonya").GetValue <bool>())
                {
                    if (dmg > Player.Level * 35)
                    {
                        ZhonyaTryCast();
                    }
                    else if (Player.Health - dmg < enemys * Player.Level * 20)
                    {
                        ZhonyaTryCast();
                    }
                    else if (Player.Health - dmg < Player.Level * 10)
                    {
                        ZhonyaTryCast();
                    }
                }
            }
        }


        if (!Solari.IsReady() && !FaceOfTheMountain.IsReady())
        {
            return;
        }

        foreach (var ally in HeroManager.Allies.Where(ally => ally.IsValid && !ally.IsDead && ally.HealthPercent < 50 && Player.Distance(ally.ServerPosition) < 700))
        {
            double dmg = OktwCommon.GetIncomingDamage(ally);

            if (dmg == 0)
            {
                continue;
            }

            if (MainMenu.Item("Solari").GetValue <bool>() && Solari.IsReady() && Player.Distance(ally.ServerPosition) < Solari.Range)
            {
                var value = 75 + (15 * Player.Level);
                if (dmg > value && Player.HealthPercent < 50)
                {
                    Solari.Cast();
                }
                else if (ally.Health - dmg < ally.Level * 10)
                {
                    Solari.Cast();
                }
                else if (ally.Health - dmg < ally.Level * 10)
                {
                    Solari.Cast();
                }
            }

            if (MainMenu.Item("FaceOfTheMountain").GetValue <bool>() && FaceOfTheMountain.IsReady() && Player.Distance(ally.ServerPosition) < FaceOfTheMountain.Range)
            {
                var value = 0.1 * Player.MaxHealth;
                if (dmg > value && Player.HealthPercent < 50)
                {
                    FaceOfTheMountain.Cast(ally);
                }
                else if (ally.Health - dmg < ally.Level * 10)
                {
                    FaceOfTheMountain.Cast(ally);
                }
                else if (ally.Health - dmg < ally.Level * 10)
                {
                    FaceOfTheMountain.Cast(ally);
                }
            }
        }
    }
Example #11
0
        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsEnemy)
            {
                return;
            }

            if (!Solari.IsReady() && !FaceOfTheMountain.IsReady() && !Seraph.IsReady() && !Zhonya.IsReady() && !CanUse(barrier) && !CanUse(heal) && !CanUse(exhaust))
            {
                return;
            }

            if (sender.Distance(Player.Position) > 1600)
            {
                return;
            }

            foreach (var ally in Program.Allies.Where(ally => ally.IsValid && !ally.IsDead && ally.HealthPercent < 51 && Player.Distance(ally.ServerPosition) < 700))
            {
                double dmg = 0;
                if (args.Target != null && args.Target.NetworkId == ally.NetworkId)
                {
                    dmg = dmg + sender.GetSpellDamage(ally, args.SData.Name);
                }
                else
                {
                    var castArea = ally.Distance(args.End) * (args.End - ally.ServerPosition).Normalized() + ally.ServerPosition;
                    if (castArea.Distance(ally.ServerPosition) < ally.BoundingRadius / 2)
                    {
                        dmg = dmg + sender.GetSpellDamage(ally, args.SData.Name);
                    }
                    else
                    {
                        continue;
                    }
                }

                if (CanUse(exhaust) && Config.Item("Exhaust").GetValue <bool>())
                {
                    if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 40)
                    {
                        TryCast(() => Player.Spellbook.CastSpell(exhaust, sender));
                    }
                }

                if (CanUse(heal) && Config.Item("Heal").GetValue <bool>())
                {
                    if (!Config.Item("AllyHeal").GetValue <bool>() && !ally.IsMe)
                    {
                        return;
                    }

                    if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 10)
                    {
                        TryCast(() => Player.Spellbook.CastSpell(heal, ally));
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        TryCast(() => Player.Spellbook.CastSpell(heal, ally));
                    }
                }

                if (Config.Item("Solari").GetValue <bool>() && Solari.IsReady() && Player.Distance(ally.ServerPosition) < Solari.Range)
                {
                    var value = 75 + (15 * Player.Level);
                    if (dmg > value && Player.HealthPercent < 50)
                    {
                        Solari.Cast();
                    }
                    else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 15)
                    {
                        Solari.Cast();
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        Solari.Cast();
                    }
                }

                if (Config.Item("FaceOfTheMountain").GetValue <bool>() && FaceOfTheMountain.IsReady() && Player.Distance(ally.ServerPosition) < FaceOfTheMountain.Range)
                {
                    var value = 0.1 * Player.MaxHealth;
                    if (dmg > value && Player.HealthPercent < 50)
                    {
                        TryCast(() => FaceOfTheMountain.Cast(ally));
                    }
                    else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 15)
                    {
                        TryCast(() => FaceOfTheMountain.Cast(ally));
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        TryCast(() => FaceOfTheMountain.Cast(ally));
                    }
                }

                if (!ally.IsMe)
                {
                    continue;
                }

                if (CanUse(barrier) && Config.Item("Barrier").GetValue <bool>())
                {
                    var value = 95 + Player.Level * 20;
                    if (dmg > value && Player.HealthPercent < 50)
                    {
                        TryCast(() => Player.Spellbook.CastSpell(barrier, Player));
                    }
                    else if (Player.Health - dmg < Player.CountEnemiesInRange(700) * Player.Level * 15)
                    {
                        TryCast(() => Player.Spellbook.CastSpell(barrier, Player));
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        TryCast(() => Seraph.Cast());
                    }
                }

                if (Seraph.IsReady() && Config.Item("Seraph").GetValue <bool>())
                {
                    var value = Player.Mana * 0.2 + 150;
                    if (dmg > value && Player.HealthPercent < 50)
                    {
                        TryCast(() => Seraph.Cast());
                    }
                    else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 10)
                    {
                        TryCast(() => Seraph.Cast());
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        TryCast(() => Seraph.Cast());
                    }
                }

                if (Zhonya.IsReady() && Config.Item("Zhonya").GetValue <bool>())
                {
                    if (dmg > Player.Level * 30)
                    {
                        TryCast(() => Zhonya.Cast());
                    }
                    else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 10)
                    {
                        TryCast(() => Zhonya.Cast());
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        TryCast(() => Zhonya.Cast());
                    }
                }
            }
        }
Example #12
0
        private void Survival()
        {
            if (Redemption.IsReady() && Config.Item("Redemption").GetValue <bool>())
            {
                var target = HeroManager.Enemies.FirstOrDefault(x => x.IsValidTarget(5000) && x.Position.CountAlliesInRange(600) > 0);
                if (target != null)
                {
                    var ally = HeroManager.Allies.FirstOrDefault(x => x.IsValid && !x.IsDead && x.Position.Distance(target.Position) < 400);
                    if (ally != null && ally.Health - OktwCommon.GetIncomingDamage(ally) < ally.MaxHealth * 0.5)
                    {
                        if (target.CountAlliesInRange(600) > 1 || ally.CountEnemiesInRange(600) > 1)
                        {
                            var predInput = new SebbyLib.Prediction.PredictionInput
                            {
                                Aoe       = true,
                                Collision = false,
                                Speed     = float.MaxValue,
                                Delay     = 0.5f,
                                Range     = 5500,
                                From      = Player.ServerPosition,
                                Radius    = 500,
                                Unit      = target,
                                Type      = SebbyLib.Prediction.SkillshotType.SkillshotCircle
                            };
                            var pos = SebbyLib.Prediction.Prediction.GetPrediction(predInput);
                            Redemption.Cast(pos.CastPosition);
                        }
                    }
                }
            }


            if (Player.HealthPercent < 60 && (Seraph.IsReady() || Zhonya.IsReady() || CanUse(barrier)))
            {
                double dmg    = OktwCommon.GetIncomingDamage(Player);
                var    enemys = Player.CountEnemiesInRange(800);
                if (dmg > 0 || enemys > 0)
                {
                    if (CanUse(barrier) && Config.Item("Barrier").GetValue <bool>())
                    {
                        var value = 95 + Player.Level * 20;
                        if (dmg > value && Player.HealthPercent < 50)
                        {
                            ObjectManager.Player.Spellbook.CastSpell(barrier, Player);
                        }
                        else if (Player.Health - dmg < enemys * Player.Level * 20)
                        {
                            ObjectManager.Player.Spellbook.CastSpell(barrier, Player);
                        }
                        else if (Player.Health - dmg < Player.Level * 10)
                        {
                            ObjectManager.Player.Spellbook.CastSpell(barrier, Player);
                        }
                    }

                    if (Seraph.IsReady() && Config.Item("Seraph").GetValue <bool>())
                    {
                        var value = Player.Mana * 0.2 + 150;
                        if (dmg > value && Player.HealthPercent < 50)
                        {
                            Seraph.Cast();
                        }
                        else if (Player.Health - dmg < enemys * Player.Level * 20)
                        {
                            Seraph.Cast();
                        }
                        else if (Player.Health - dmg < Player.Level * 10)
                        {
                            Seraph.Cast();
                        }
                    }

                    if (Zhonya.IsReady() && Config.Item("Zhonya").GetValue <bool>())
                    {
                        if (dmg > Player.Level * 35)
                        {
                            ZhonyaTryCast();
                        }
                        else if (Player.Health - dmg < enemys * Player.Level * 20)
                        {
                            ZhonyaTryCast();
                        }
                        else if (Player.Health - dmg < Player.Level * 10)
                        {
                            ZhonyaTryCast();
                        }
                    }
                }
            }


            if (!Solari.IsReady() && !FaceOfTheMountain.IsReady() && !CanUse(heal))
            {
                return;
            }

            foreach (var ally in HeroManager.Allies.Where(ally => ally.IsValid && !ally.IsDead && ally.HealthPercent < 50 && Player.Distance(ally.ServerPosition) < 700))
            {
                double dmg = OktwCommon.GetIncomingDamage(ally);

                if (dmg == 0)
                {
                    continue;
                }

                if (CanUse(heal) && Config.Item("Heal").GetValue <bool>())
                {
                    if (!Config.Item("AllyHeal").GetValue <bool>() && !ally.IsMe)
                    {
                        return;
                    }

                    if (ally.Health - dmg < ally.Level * 10)
                    {
                        ObjectManager.Player.Spellbook.CastSpell(heal, ally);
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        ObjectManager.Player.Spellbook.CastSpell(heal, ally);
                    }
                }

                if (Config.Item("Solari").GetValue <bool>() && Solari.IsReady() && Player.Distance(ally.ServerPosition) < Solari.Range)
                {
                    var value = 75 + (15 * Player.Level);
                    if (dmg > value && Player.HealthPercent < 50)
                    {
                        Solari.Cast();
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        Solari.Cast();
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        Solari.Cast();
                    }
                }

                if (Config.Item("FaceOfTheMountain").GetValue <bool>() && FaceOfTheMountain.IsReady() && Player.Distance(ally.ServerPosition) < FaceOfTheMountain.Range)
                {
                    var value = 0.1 * Player.MaxHealth;
                    if (dmg > value && Player.HealthPercent < 50)
                    {
                        FaceOfTheMountain.Cast(ally);
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        FaceOfTheMountain.Cast(ally);
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
                    {
                        FaceOfTheMountain.Cast(ally);
                    }
                }
            }
        }
Example #13
0
        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsEnemy || !sender.IsValidTarget(1500))
            {
                return;
            }

            foreach (var ally in Program.Allies.Where(ally => ally.IsValid && !ally.IsDead))
            {
                double dmg = 0;
                if (args.Target != null && args.Target.NetworkId == ally.NetworkId)
                {
                    dmg = dmg + sender.GetSpellDamage(ally, args.SData.Name);
                }
                else if (Player.Distance(args.End) <= 300f)
                {
                    if (!OktwCommon.CanMove(ally) || ally.Distance(sender.Position) < 300f)
                    {
                        dmg = dmg + sender.GetSpellDamage(ally, args.SData.Name);
                    }
                    else if (Player.Distance(args.End) < 100f)
                    {
                        dmg = dmg + sender.GetSpellDamage(ally, args.SData.Name);
                    }
                }

                if (Config.Item("FaceOfTheMountain").GetValue <bool>() && Player.Distance(ally.ServerPosition) < FaceOfTheMountain.Range)
                {
                    if (FaceOfTheMountain.IsReady())
                    {
                        if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 10)
                        {
                            FaceOfTheMountain.Cast(ally);
                        }
                        else if (ally.Health - dmg < ally.Level * 10)
                        {
                            FaceOfTheMountain.Cast(ally);
                        }
                    }
                }

                if (Config.Item("Seraph").GetValue <bool>())
                {
                    if (Seraph.IsReady() && ally.IsMe)
                    {
                        var value = Player.Level * 20;
                        if (dmg > value && Player.Health < Player.MaxHealth * 0.5)
                        {
                            Seraph.Cast();
                        }
                        else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 10)
                        {
                            Seraph.Cast();
                        }
                        else if (ally.Health - dmg < ally.Level * 10)
                        {
                            Seraph.Cast();
                        }
                    }
                }

                if (Config.Item("Zhonya").GetValue <bool>())
                {
                    if (Zhonya.IsReady() && ally.IsMe)
                    {
                        var value = 95 + Player.Level * 20;
                        if (dmg > value && Player.Health < Player.MaxHealth * 0.5)
                        {
                            Zhonya.Cast();
                        }
                        else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 10)
                        {
                            Zhonya.Cast();
                        }
                        else if (ally.Health - dmg < ally.Level * 10)
                        {
                            Zhonya.Cast();
                        }
                    }
                }
            }
        }
Example #14
0
        public static void Defensive()
        {
            //Zhonyas
            if (ActiveMenu["Zhonyas"].Cast <CheckBox>().CurrentValue)
            {
                if (Player.Instance.IsDead)
                {
                    return;
                }

                if ((Player.Instance.CountEnemiesInRange(700) >= 1) && Zhonyas.IsOwned() && Zhonyas.IsReady())
                {
                    if (Player.Instance.HealthPercent <= ActiveMenu["Item.ZyHp"].Cast <Slider>().CurrentValue)
                    {
                        Zhonyas.Cast();
                    }
                }
            }
            //Seraph
            if (ActiveMenu["Seraph"].Cast <CheckBox>().CurrentValue)
            {
                if (Player.Instance.IsDead)
                {
                    return;
                }

                if ((Player.Instance.CountEnemiesInRange(650) >= 1) && Seraph.IsOwned() && Seraph.IsReady())
                {
                    if (Player.Instance.HealthPercent <= ActiveMenu["Item.SeraphHp"].Cast <Slider>().CurrentValue)
                    {
                        Seraph.Cast();
                    }
                }
            }
            //Solari
            if (ActiveMenu["Solari"].Cast <CheckBox>().CurrentValue)
            {
                if (Player.Instance.IsDead)
                {
                    return;
                }

                if ((Player.Instance.CountEnemiesInRange(600) >= 1) && Solari.IsOwned() && Solari.IsReady())
                {
                    if (Player.Instance.HealthPercent <= ActiveMenu["Item.SolariHp"].Cast <Slider>().CurrentValue)
                    {
                        Solari.Cast();
                    }
                }
            }
            //Face
            var Ally =
                EntityManager.Heroes.Allies.Where(
                    a => a.HealthPercent <= ActiveMenu["Item.FaceHP"].Cast <Slider>().CurrentValue)
                .FirstOrDefault(a => a.IsValidTarget(Face.Range));

            if (ActiveMenu["Face"].Cast <CheckBox>().CurrentValue)
            {
                if (Player.Instance.IsDead)
                {
                    return;
                }

                if (Face.IsOwned() && Face.IsReady() && Ally.IsValid)
                {
                    Face.Cast(Ally);
                }
            }
        }