Esempio n. 1
0
 private static bool UseHeal()
 {
     if (Spell2 == null || !Spell2.CanBeCasted() || !Utils.SleepCheck(Spell2.StoredName()) || MyHero.Mana - Spell4.ManaCost <= Spell2.ManaCost)
     {
         return(false);
     }
     Spell2.UseAbility(MyHero);
     Utils.Sleep(500 + Game.Ping, Spell2.StoredName());
     return(true);
 }
Esempio n. 2
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);
                }
            }
        }