Ejemplo n.º 1
0
        private static void Combo()
        {
            Obj_AI_Hero target = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Magical);

            if (target == null)
            {
                return;
            }
            if (config.Item("selected").GetValue <bool>())
            {
                target = CombatHelper.SetTarget(target, TargetSelector.GetSelectedTarget());
                orbwalker.ForceTarget(target);
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, ComboDamage(target));
            }
            bool hasFlash = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerFlash")) == SpellState.Ready;

            if (config.Item("usew").GetValue <bool>() && player.Distance(target.Position) < R.Range && W.IsReady())
            {
                W.Cast(config.Item("packets").GetValue <bool>());
            }

            if (config.Item("usee").GetValue <bool>() && E.IsReady())
            {
                if (config.Item("useewall").GetValue <bool>())
                {
                    var   bestpos = CombatHelper.bestVectorToPoppyFlash2(target);
                    float damage  =
                        (float)
                        (ComboDamage(target) +
                         Damage.CalcDamage(
                             player, target, Damage.DamageType.Magical,
                             (eSecond[E.Level - 1] + 0.8f * player.FlatMagicDamageMod)) +
                         (player.GetAutoAttackDamage(target) * 4));
                    float damageno = (float)(ComboDamage(target) + (player.GetAutoAttackDamage(target) * 4));
                    if (config.Item("useeflash").GetValue <bool>() && hasFlash && !CheckWalls(player, target) &&
                        damage > target.Health && target.Health > damageno &&
                        CombatHelper.bestVectorToPoppyFlash(target).IsValid())
                    {
                        player.Spellbook.CastSpell(player.GetSpellSlot("SummonerFlash"), bestpos);
                        Utility.DelayAction.Add(
                            100, () => E.CastOnUnit(target, config.Item("packets").GetValue <bool>()));
                    }
                    if (E.CanCast(target) &&
                        (CheckWalls(player, target) ||
                         target.Health < E.GetDamage(target) + player.GetAutoAttackDamage(target, true)))
                    {
                        E.CastOnUnit(target, config.Item("packets").GetValue <bool>());
                    }
                    if (E.CanCast(target) && Q.IsReady() && Q.Instance.ManaCost + E.Instance.ManaCost > player.Mana &&
                        target.Health <
                        E.GetDamage(target) + Q.GetDamage(target) + player.GetAutoAttackDamage(target, true))
                    {
                        Q.Cast(config.Item("packets").GetValue <bool>());
                        E.CastOnUnit(target, config.Item("packets").GetValue <bool>());
                    }
                }
                else
                {
                    if (E.CanCast(target))
                    {
                        E.CastOnUnit(target, config.Item("packets").GetValue <bool>());
                    }
                }
            }
            if (config.Item("user").GetValue <bool>())
            {
                if (R.IsReady() && player.Distance(target.Position) < E.Range &&
                    ComboDamage(target) + player.GetAutoAttackDamage(target) * 5 < target.Health &&
                    (ComboDamage(target) + player.GetAutoAttackDamage(target) * 3) * ultMod[R.Level - 1] > target.Health)
                {
                    R.CastOnUnit(target, config.Item("packets").GetValue <bool>());
                }
            }
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;
            var  ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);

            if (config.Item("useIgnite").GetValue <bool>() && ignitedmg > target.Health && hasIgnite &&
                !E.CanCast(target) && !Q.CanCast(target))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (config.Item("userindanger").GetValue <Slider>().Value < player.CountEnemiesInRange(R.Range))
            {
                if (config.Item("userOnweakest").GetValue <bool>())
                {
                    var tmpTarg =
                        ObjectManager.Get <Obj_AI_Hero>()
                        .Where(
                            i => i.IsEnemy && i.IsDead && player.Distance(i) < R.Range && i.Health > i.MaxHealth / 2)
                        .OrderBy(i => CombatHelper.GetChampDmgToMe(i))
                        .FirstOrDefault();
                    if (tmpTarg != null)
                    {
                        target = tmpTarg;
                    }
                }
                R.CastOnUnit(target, config.Item("packets").GetValue <bool>());
            }
        }