예제 #1
0
        private static void ComboInAction(Hero target)
        {
            if (!Spell4.CanBeCasted() || Spell4.Level == 0 || !Utils.SleepCheck(Spell2.StoredName()))
            {
                return;
            }

            var neededMana = MyHero.Mana - Spell4.ManaCost;

            var allitems = MyHero.Inventory.Items.Where(x => x.CanBeCasted() && x.ManaCost <= neededMana);

            var isInvise = MyHero.IsInvisible();

            var inventory =
                allitems.Where(x => Utils.SleepCheck(x.Name + MyHero.Handle)).ToList();
            var underLink = target.IsLinkensProtected();
            var distance  = MyHero.Distance2D(target) - MyHero.HullRadius - target.HullRadius;

            if (underLink)
            {
                var linkerItems = inventory.Where(x => x.CanHit(target) && ItemsLinker.Keys.Contains(x.Name)).OrderByDescending(y => ItemsLinker[y.StoredName()]);
                foreach (var item in linkerItems)
                {
                    item.UseAbility(target);
                    Utils.Sleep(250, item.Name + MyHero.Handle);
                }
                if (linkerItems.Any(x => Utils.SleepCheck(x.Name + MyHero.Handle)))
                {
                    return;
                }
            }
            var items =
                inventory.Where(
                    x =>
                    Items.Keys.Contains(x.Name) &&
                    ((x.CastRange == 0 && distance <= 800) ||
                     x.CastRange >= distance)).OrderByDescending(y => Items[y.StoredName()]);

            if (Dagger != null && Dagger.CanBeCasted() && !isInvise && Utils.SleepCheck("dagger") && distance <= 1200 && distance > 150)
            {
                if (UseHeal())
                {
                    return;
                }
                var point = new Vector3(
                    (float)(target.Position.X - 20 * Math.Cos(MyHero.FindAngleBetween(target.Position, true))),
                    (float)(target.Position.Y - 20 * Math.Sin(MyHero.FindAngleBetween(target.Position, true))),
                    0);
                Dagger.UseAbility(point);
                Utils.Sleep(500, "dagger");
            }
            else if (Utils.SleepCheck("attack_cd"))
            {
                Utils.Sleep(500, "attack_cd");
                MyHero.Attack(target);
            }
            if (Bkb != null && Menu.Item("enabledAbilities").GetValue <AbilityToggler>().IsEnabled(Bkb.StoredName()) &&
                Bkb.CanBeCasted() && Utils.SleepCheck(Bkb.StoredName()) && Spell4.CanHit(target))
            {
                Bkb.UseAbility();
                Utils.Sleep(500, Bkb.StoredName());
            }
            foreach (var item in items)
            {
                if (item.StoredName() == "item_armlet")
                {
                    if (!MyHero.HasModifier("modifier_item_armlet_unholy_strength"))
                    {
                        item.ToggleAbility();
                        Utils.Sleep(500, item.Name + MyHero.Handle);
                    }
                    continue;
                }
                if (item.IsAbilityBehavior(AbilityBehavior.NoTarget))
                {
                    item.UseAbility();
                }
                if (item.IsAbilityBehavior(AbilityBehavior.UnitTarget))
                {
                    if (item.TargetTeamType == TargetTeamType.Enemy || item.TargetTeamType == TargetTeamType.All)
                    {
                        item.UseAbility(target);
                    }
                    else
                    {
                        item.UseAbility(MyHero);
                    }
                }
                Utils.Sleep(500, item.Name + MyHero.Handle);
            }
            if (isInvise && Utils.SleepCheck("attack_cd_2"))
            {
                MyHero.Attack(target);
                Utils.Sleep(500 + Game.Ping, "attack_cd_2");
            }
            else if (Utils.SleepCheck("ult"))
            {
                if (distance <= 200 /*Spell4.CanHit(target)*/)
                {
                    UseHeal();
                    //if (items.Any(x => Utils.SleepCheck(x.Name + MyHero.Handle))) return;
                    Utils.Sleep(100 + Game.Ping, "ult");
                    Spell4.UseAbility(target);
                }
            }
        }
예제 #2
0
        }         // OnClose

        public void Combo()
        {
            if (!Menu.Item("enabled").IsActive() || Game.IsChatOpen || Time.Enabled)
            {
                return;
            }
            Me = ObjectManager.LocalHero;

            Q = Me.Spellbook.SpellQ;
            W = Me.Spellbook.SpellW;
            R = Me.Spellbook.SpellR;

            Leans    = Me.FindItem("item_aether_lens");
            Urn      = Me.FindItem("item_urn_of_shadows");
            Dagon    = Me.Inventory.Items.FirstOrDefault(x => x.Name.Contains("item_dagon"));
            Ethereal = Me.FindItem("item_ethereal_blade");
            Shiva    = Me.FindItem("item_shivas_guard");
            Glimmer  = Me.FindItem("item_glimmer_cape");
            Vail     = Me.FindItem("item_veil_of_discord");
            Orchid   = Me.FindItem("item_orchid") ?? Me.FindItem("item_bloodthorn");
            Abyssal  = Me.FindItem("item_abyssal_blade");
            Atos     = Me.FindItem("item_rod_of_atos");
            Bkb      = Me.FindItem("item_black_king_bar");
            Mail     = Me.FindItem("item_blade_mail");
            Lotus    = Me.FindItem("item_lotus_orb");
            Active   = Game.IsKeyDown(Menu.Item("Combo Key").GetValue <KeyBind>().Key);
            var v = ObjectManager.GetEntities <Hero>().Where(x => x.Team != Me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && !x.IsMagicImmune()).ToList();

            if (Active && Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(W.Name))
            {
                if (Me.HasModifier("modifier_pudge_rot") && v.Count(x => x.Distance2D(Me) <= W.GetCastRange() + Me.HullRadius) == 0)
                {
                    W.ToggleAbility();
                    Time.Start();
                }
                else if (!Me.HasModifier("modifier_pudge_rot") && v.Count(x => x.Distance2D(Me) <= W.GetCastRange() + Me.HullRadius) > 0)
                {
                    W.ToggleAbility();
                    Time.Start();
                }
            }

            E = Toolset.ClosestToMouse(Me);
            if (E == null || !Me.IsAlive)
            {
                return;
            }
            Sheep = E.ClassId == ClassId.CDOTA_Unit_Hero_Tidehunter ? null : Me.FindItem("item_sheepstick");
            if (R.IsInAbilityPhase || R.IsChanneling || Me.IsChanneling())
            {
                return;
            }
            if (Active)
            {
                MinRangeHook = E.HullRadius + 27;
                CastRange    = Leans != null ? (Q.CastRange + 200 + E.HullRadius) : (Q.CastRange + E.HullRadius);
                EMoveSpeed   = E.HasModifier("modifier_spirit_breaker_charge_of_darkness") ? 550 + ((int)E.Spellbook.Spell1.Level * 50) : E.MovementSpeed;

                Vector2 vector = new Vector2((float)Math.Cos(E.RotationRad) * EMoveSpeed, (float)Math.Sin(E.RotationRad) * EMoveSpeed);
                Vector3 start  = new Vector3((float)((0.3 + (Game.Ping / 1000)) * Math.Cos(E.RotationRad) * EMoveSpeed + E.Position.X),
                                             (float)((0.3 + (Game.Ping / 1000)) * Math.Sin(E.RotationRad) * EMoveSpeed + E.NetworkPosition.Y), E.NetworkPosition.Z);
                Vector3 specialPosition = new Vector3((float)(MinRangeHook * Math.Cos(E.RotationRad) + E.NetworkPosition.X),
                                                      (float)(MinRangeHook * Math.Sin(E.RotationRad) + E.NetworkPosition.Y),
                                                      E.NetworkPosition.Z);
                HookPosition = Interception(start, vector, Me.Position, 1600);
                if (
                    Atos != null && Atos.CanBeCasted() && Me.CanCast() && !E.IsMagicImmune() && !E.HasModifier("modifier_spirit_breaker_charge_of_darkness") &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(Atos.Name) && Me.Distance2D(E) <= 1500 && Utils.SleepCheck("a")
                    )
                {
                    Atos.UseAbility(E);
                    Utils.Sleep(250, "a");
                }
                else if (Q.CanBeCasted() && Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(Q.Name))
                {
                    if (E.NetworkActivity == NetworkActivity.Move || E.HasModifier("modifier_spirit_breaker_charge_of_darkness"))
                    {
                        for (double i = 0.03; i <= 0.135; i += 0.03)
                        {
                            Vector3 estimated = new Vector3((float)(i * Math.Cos(E.RotationRad) * EMoveSpeed + HookPosition.X),
                                                            (float)(i * Math.Sin(E.RotationRad) * EMoveSpeed + HookPosition.Y), E.NetworkPosition.Z);
                            if (GetTimeToTurn(estimated) <= i)
                            {
                                HookPosition = estimated;
                                TimeTurn     = i;
                                break;
                            }
                        }
                        CastPos = (HookPosition - Me.Position) * ((Q.GetCastRange() + Me.HullRadius) / HookPosition.Distance2D(Me.Position)) + Me.Position;
                        if (Me.Position.Distance2D(HookPosition) < CastRange)
                        {
                            Q.UseAbility(CastPos); Time.Interval = 150 + TimeTurn * 1000;
                            Time.Start();
                        }
                    }
                    else
                    {
                        CastPos = (specialPosition - Me.Position) * ((Q.GetCastRange() + Me.HullRadius) / specialPosition.Distance2D(Me.Position)) + Me.Position;
                        if (Me.Position.Distance2D(E.NetworkPosition) < CastRange)
                        {
                            Q.UseAbility(CastPos);
                            Time.Start();
                        }
                    }
                }
                else
                {
                    if (R.IsInAbilityPhase || R.IsChanneling)
                    {
                        return;
                    }
                    uint countElse = 0;
                    countElse += 1;
                    if (Vail != null && Vail.CanBeCasted() && Me.Distance2D(E) <= 1100 && Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(Vail.Name) && Utils.SleepCheck("vail"))
                    {
                        Vail.UseAbility(E.Position);
                        Utils.Sleep(130, "vail");
                    }
                    else
                    {
                        countElse += 1;
                    }
                    if (Orchid != null && Orchid.CanBeCasted() && Me.Distance2D(E) <= 900 && Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(Orchid.Name) && Utils.SleepCheck("orchid"))
                    {
                        Orchid.UseAbility(E);
                        Utils.Sleep(100, "orchid");
                    }
                    else
                    {
                        countElse += 1;
                    }
                    if (Shiva != null && Shiva.CanBeCasted() && Me.Distance2D(E) <= 600 && Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(Shiva.Name) && !E.IsMagicImmune() && Utils.SleepCheck("Shiva"))
                    {
                        Shiva.UseAbility();
                        Utils.Sleep(100, "Shiva");
                    }
                    else
                    {
                        countElse += 1;
                    }
                    if (Ethereal != null && Ethereal.CanBeCasted() && Me.Distance2D(E) <= 700 && Me.Distance2D(E) <= 400 && Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(Ethereal.Name) && Utils.SleepCheck("ethereal"))
                    {
                        Ethereal.UseAbility(E);
                        Utils.Sleep(100, "ethereal");
                    }
                    else
                    {
                        countElse += 1;
                    }
                    if (Dagon != null && Dagon.CanBeCasted() && Me.Distance2D(E) <= Dagon.GetCastRange() && Utils.SleepCheck("dagon"))
                    {
                        Dagon.UseAbility(E);
                        Utils.Sleep(100, "dagon");
                    }
                    else
                    {
                        countElse += 1;
                    }
                    if (Urn != null && Urn.CanBeCasted() && Urn.CurrentCharges > 0 && Me.Distance2D(E) <= 400 && Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(Urn.Name) && Utils.SleepCheck("urn"))
                    {
                        Urn.UseAbility(E);
                        Utils.Sleep(240, "urn");
                    }
                    else
                    {
                        countElse += 1;
                    }
                    if (Glimmer != null && Glimmer.CanBeCasted() && Me.Distance2D(E) <= 300 && Utils.SleepCheck("glimmer"))
                    {
                        Glimmer.UseAbility(Me);
                        Utils.Sleep(200, "glimmer");
                    }
                    else
                    {
                        countElse += 1;
                    }
                    if (Mail != null && Mail.CanBeCasted() && v.Count(x => x.Distance2D(Me) <= 650) >=
                        (Menu.Item("Heel").GetValue <Slider>().Value) &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(Mail.Name) &&
                        Utils.SleepCheck("mail"))
                    {
                        Mail.UseAbility();
                        Console.WriteLine(countElse.ToString());
                        Utils.Sleep(100, "mail");
                    }
                    else
                    {
                        countElse += 1;
                    }
                    if (Bkb != null && Bkb.CanBeCasted() && v.Count(x => x.Distance2D(Me) <= 650) >=
                        (Menu.Item("Heel").GetValue <Slider>().Value) &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(Bkb.Name) &&
                        Utils.SleepCheck("bkb"))
                    {
                        Bkb.UseAbility();
                        Utils.Sleep(100, "bkb");
                    }

                    else
                    {
                        countElse += 1;
                    }
                    if (Lotus != null && Lotus.CanBeCasted() && v.Count(x => x.Distance2D(Me) <= 650) >= 2 &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(Lotus.Name) &&
                        Utils.SleepCheck("lotus"))
                    {
                        Lotus.UseAbility(Me);
                        Utils.Sleep(100, "lotus");
                    }
                    else
                    {
                        countElse += 1;
                    }
                    if (countElse == 11 && R != null && R.CanBeCasted() && Me.Distance2D(E) <= R.GetCastRange() + 150 && (!Urn.CanBeCasted() || Urn.CurrentCharges <= 0) && Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(R.Name) &&
                        Utils.SleepCheck("R")
                        )
                    {
                        R.UseAbility(E);
                        Utils.Sleep(150, "R");
                    }
                    else
                    {
                        countElse += 1;
                    }
                    if (Abyssal != null && !R.CanBeCasted() && Abyssal.CanBeCasted() && !E.IsStunned() && !E.IsHexed() &&
                        Me.Distance2D(E) <= 300 && Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(Abyssal.Name) && Utils.SleepCheck("abyssal"))
                    {
                        Abyssal.UseAbility(E);
                        Utils.Sleep(200, "abyssal");
                    }
                    else
                    {
                        countElse += 1;
                    }
                    if (Sheep != null && !R.CanBeCasted() && Sheep.CanBeCasted() && !E.IsStunned() && !E.IsHexed() &&
                        Me.Distance2D(E) <= 900 && Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(Sheep.Name) && Utils.SleepCheck("sheep"))
                    {
                        Sheep.UseAbility(E);
                        Utils.Sleep(200, "sheep");
                    }
                    else
                    {
                        countElse += 1;
                    }
                    if (countElse == 14 && Me.Distance2D(E) <= 300 && Mail != null &&
                        Mail.CanBeCasted() && (E.NetworkActivity == NetworkActivity.Attack || E.Spellbook.Spells.All(x => x.IsInAbilityPhase)) &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(Mail.Name) &&
                        Utils.SleepCheck("mail"))
                    {
                        Mail.UseAbility();
                        Utils.Sleep(100, "mail");
                    }
                    else
                    {
                        countElse += 1;
                    }
                    if (countElse == 15 && Lotus != null && Lotus.CanBeCasted() && Me.Distance2D(E) <= 600 &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(Lotus.Name) &&
                        Utils.SleepCheck("lotus"))
                    {
                        Lotus.UseAbility(Me);
                        Utils.Sleep(100, "lotus");
                    }
                    if ((R == null || !R.CanBeCasted() || !Q.CanBeCasted() && Me.Distance2D(E) >= R.GetCastRange() + Me.HullRadius && !E.HasModifier("pudge_meat_hook")) && !E.IsAttackImmune())
                    {
                        if (Menu.Item("orbwalk").GetValue <bool>() && Me.Distance2D(E) <= 1900)
                        {
                            Orbwalking.Orbwalk(E, 0, 1600, true, true);
                        }
                    }
                }
            }
        }