コード例 #1
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() && Summoner.Items.Extensions.HasCCs(Player.Instance) && 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
        }
コード例 #2
0
        private void Survival()
        {
            if (Player.HealthPercent < 60 && (Seraph.IsReady() || Zhonya.IsReady() || CanUse(barrier)))
            {
                double dmg    = OktwCommon.GetIncomingDamage(Player, 1);
                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)
                        {
                            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() && 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, 1);
                var    enemys = ally.CountEnemiesInRange(700);
                if (dmg == 0 && enemys == 0)
                {
                    continue;
                }

                if (CanUse(heal) && Config.Item("Heal").GetValue <bool>())
                {
                    if (!Config.Item("AllyHeal").GetValue <bool>() && !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.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 < enemys * 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)
                    {
                        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);
                    }
                }
            }
        }
コード例 #3
0
ファイル: Activator.cs プロジェクト: Bloodimir/Projects
        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());
                    }
                }
            }
        }