Example #1
0
 private void CheckHeals()
 {
     if (MyHero.HasBuff("Recall") || Utility.InShopRange() || Utility.InFountain())
     {
         return;
     }
     if (Menu.Item("Misc_useE_Friends").GetValue <bool>())
     {
         foreach (
             var friend in
             AllHerosFriend.Where(
                 hero =>
                 GetHealthPercent(hero) < Menu.Item("Misc_useE_Health").GetValue <Slider>().Value&&
                 hero.Distance(MyHero) < E.Range && hero.IsValid))
         {
             E.Cast();
         }
     }
     else
     {
         if (GetHealthPercent(MyHero) < Menu.Item("Misc_useE_Health").GetValue <Slider>().Value)
         {
             E.Cast();
         }
     }
 }
Example #2
0
 private Vector3 GetMovePosition(Obj_AI_Base target)
 {
     foreach (var tower in ObjectManager.Get <Obj_AI_Turret>().Where(tower => tower.IsAlly && tower.Health > 0 && tower.Distance(MyHero) < 1500))
     {
         return(V3E(target.Position, tower.Position, -50));
     }
     foreach (var friend in AllHerosFriend.Where(hero => !hero.IsMe && hero.Distance(MyHero) < 800 + hero.AttackRange && GetHealthPercent(hero) > 30))
     {
         return(V3E(target.Position, friend.Position, -50));
     }
     return(default(Vector3));
 }
Example #3
0
        private void SafeFriendLatern()
        {
            if (!W.IsReady())
            {
                return;
            }
            var bestcastposition = new Vector3(0f, 0f, 0f);

            foreach (
                var friend in
                AllHerosFriend
                .Where(
                    hero =>
                    hero.Distance(MyHero) <= W.Range - 200 && hero.Health / hero.MaxHealth * 100 <= 20 && !hero.IsDead))
            {
                foreach (var enemy in AllHerosEnemy)
                {
                    if (friend == null)
                    {
                        continue;
                    }
                    var       center = ObjectManager.Player.Position;
                    const int points = 36;
                    var       radius = W.Range;

                    const double slice = 2 * Math.PI / points;
                    for (var i = 0; i < points; i++)
                    {
                        var angle = slice * i;
                        var newX  = (int)(center.X + radius * Math.Cos(angle));
                        var newY  = (int)(center.Y + radius * Math.Sin(angle));
                        var p     = new Vector3(newX, newY, 0);
                        if (p.Distance(friend.Position) <= bestcastposition.Distance(friend.Position))
                        {
                            bestcastposition = p;
                        }
                    }
                    if (friend.Distance(ObjectManager.Player) <= W.Range)
                    {
                        W.Cast(W.GetPrediction(friend).CastPosition, UsePackets());
                        return;
                    }
                }
                if (bestcastposition.Distance(new Vector3(0f, 0f, 0f)) >= 100)
                {
                    W.Cast(bestcastposition, UsePackets());
                }
            }
        }
Example #4
0
        private void EngageFriendLatern()
        {
            if (!W.IsReady())
            {
                return;
            }
            var bestcastposition = new Vector3(0f, 0f, 0f);

            foreach (var friend in AllHerosFriend.Where(hero => !hero.IsMe && hero.Distance(MyHero) <= W.Range + 300 && hero.Distance(MyHero) <= W.Range - 300 && hero.Health / hero.MaxHealth * 100 >= 20 && EnemysinRange(150)))
            {
                var       center = MyHero.Position;
                const int points = 36;
                var       radius = W.Range;

                const double slice = 2 * Math.PI / points;
                for (var i = 0; i < points; i++)
                {
                    var angle = slice * i;
                    var newX  = (int)(center.X + radius * Math.Cos(angle));
                    var newY  = (int)(center.Y + radius * Math.Sin(angle));
                    var p     = new Vector3(newX, newY, 0);
                    if (p.Distance(friend.Position) <= bestcastposition.Distance(friend.Position))
                    {
                        bestcastposition = friend.Position;
                    }
                }
                if (!(friend.Distance(MyHero) <= W.Range))
                {
                    continue;
                }
                W.Cast(bestcastposition, UsePackets());
                return;
            }
            if (bestcastposition.Distance(new Vector3(0f, 0f, 0f)) >= 100)
            {
                W.Cast(bestcastposition, UsePackets());
            }
        }
Example #5
0
        private bool ShouldUlt()
        {
            if (EnemysinRange(500))
            {
                return(true);
            }
            var mousePos         = Game.CursorPos;
            var enemiesNearMouse = AllHerosEnemy.Where(x => x.Distance(MyHero) < R.Range && x.Distance(mousePos) < 650);
            var objAiHeroes      = enemiesNearMouse as Obj_AI_Hero[] ?? enemiesNearMouse.ToArray();

            if (!objAiHeroes.Any())
            {
                return(false);
            }
            if (IsRActive())
            {
                return(true);
            }
            var enoughMana = MyHero.Mana > MyHero.Spellbook.GetSpell(SpellSlot.Q).ManaCost + MyHero.Spellbook.GetSpell(SpellSlot.E).ManaCost + MyHero.Spellbook.GetSpell(SpellSlot.R).ManaCost;

            if (Menu.Item("Combo_useR_onUseActivate").GetValue <bool>() || !(Q.IsReady() && E.IsReady()) || !enoughMana)
            {
                return(false);
            }
            var friendsNearMouse = AllHerosFriend.Where(x => x.IsMe || x.Distance(mousePos) < 650);

            if (objAiHeroes.Count() == 1)
            {
                var enemy      = objAiHeroes.FirstOrDefault();
                var underTower = Utility.UnderTurret(enemy);
                return(enemy != null && GetComboDamage(enemy) / enemy.Health >= (underTower ? 1.25f : 1));
            }
            var lowHealthEnemies = objAiHeroes.Count(x => x.Health / x.MaxHealth <= 0.1);
            var totalEnemyHealth = objAiHeroes.Sum(x => x.Health);

            return(friendsNearMouse.Count() - (objAiHeroes.Count() - lowHealthEnemies) >= -1 || MyHero.Health / totalEnemyHealth >= 0.8);
        }
Example #6
0
 private void Cast_QW_Combo()
 {
     if (_qonDelay)
     {
         if (!Q.IsReady())
         {
             _qonDelay = false;
         }
         return;
     }
     if (_moveOrder)
     {
         if (Environment.TickCount - _movetimer > 2000)
         {
             xSLxOrbwalker.CustomOrbwalkMode = false;
             xSLxOrbwalker.SetAttack(true);
             _moveOrder = false;
             return;
         }
         var reached = Runto(GetMovePosition(SimpleTs.GetTarget(Q.Range, SimpleTs.DamageType.Magical)));
         if (reached)
         {
             W.Cast(SimpleTs.GetTarget(Q.Range, SimpleTs.DamageType.Magical), UsePackets());
             return;
         }
     }
     else
     {
         xSLxOrbwalker.CustomOrbwalkMode = false;
         xSLxOrbwalker.SetAttack(true);
     }
     if (Q.IsReady() && W.IsReady())
     {
         var enoughMana = MyHero.Mana > MyHero.Spellbook.GetSpell(SpellSlot.Q).ManaCost + MyHero.Spellbook.GetSpell(SpellSlot.W).ManaCost;
         if (enoughMana)
         {
             var target = SimpleTs.GetTarget(W.Range, SimpleTs.DamageType.Magical);
             if (target.IsValidTarget(Q.Range))
             {
                 Q.Cast();
                 _moveOrder = true;
                 _movetimer = Environment.TickCount;
                 return;
             }
             if (target.IsValidTarget(W.Range))
             {
                 W.Cast(target, UsePackets());
                 //var jumpTime = Math.Max(1, 1000 * MyHero.Distance(target) / 2500) ;
                 var jumpTime = Math.Max(0, MyHero.Distance(target) - 500) * 10 / 25 + 25;
                 Utility.DelayAction.Add((int)jumpTime, () => Q.Cast());
                 _qonDelay = true;
                 return;
             }
         }
     }
     if (W.IsReady() && !Q.IsReady())
     {
         var target = SimpleTs.GetTarget(W.Range, SimpleTs.DamageType.Magical);
         foreach (var friend in AllHerosFriend.Where(hero => !hero.IsMe && xSLxOrbwalker.GetAutoAttackRange(target, hero) > hero.Distance(target) && GetHealthPercent(hero) < GetHealthPercent(target) && GetHealthPercent(hero) < 20))
         {
             W.Cast(target, UsePackets());
         }
     }
     if (Q.IsReady() && !W.IsReady())
     {
         var target = SimpleTs.GetTarget(Q.Range * 2, SimpleTs.DamageType.Magical);
         Q.Cast();
     }
 }