Ejemplo n.º 1
0
 private static void DrawLastPosition()
 {
     foreach (var hero in Members.EnemyHeroes.Where(x => x.IsAlive && !x.IsVisible))
     {
         if (Members.Menu.Item("lastPosition.Enable.Minimap").GetValue <bool>())
         {
             var size = new Vector2(Members.Menu.Item("lastPosition.Minimap.X").GetValue <Slider>().Value,
                                    Members.Menu.Item("lastPosition.Minimap.X").GetValue <Slider>().Value);
             if (Members.Menu.Item("lastPosition.Enable.Prediction").GetValue <bool>())
             {
                 if (Members.PredictionTimes.ContainsKey(hero.StoredName()))
                 {
                     Drawing.DrawRect(Helper.WorldToMinimap(Prediction.InFront(hero,
                                                                               hero.MovementSpeed * (Game.GameTime - Members.PredictionTimes[hero.StoredName()]))) +
                                      new Vector2(-size.X / 2, -size.Y / 2), size,
                                      Helper.GetHeroTextureMinimap(hero.StoredName()));
                 }
             }
             else
             {
                 Drawing.DrawRect(Helper.WorldToMinimap(hero.Position) + new Vector2(-size.X / 2, -size.Y / 2), size,
                                  Helper.GetHeroTextureMinimap(hero.StoredName()));
             }
         }
         if (Members.Menu.Item("lastPosition.Enable.Map").GetValue <bool>())
         {
             Vector2 newPos;
             if (Drawing.WorldToScreen(hero.Position, out newPos))
             {
                 var size = new Vector2(Members.Menu.Item("lastPosition.Map.X").GetValue <Slider>().Value,
                                        Members.Menu.Item("lastPosition.Map.X").GetValue <Slider>().Value);
                 if (Members.Menu.Item("lastPosition.Enable.Prediction").GetValue <bool>())
                 {
                     if (Members.PredictionTimes.ContainsKey(hero.StoredName()))
                     {
                         Drawing.DrawRect(
                             Drawing.WorldToScreen(Prediction.InFront(hero,
                                                                      hero.MovementSpeed * (Game.GameTime - Members.PredictionTimes[hero.StoredName()]))) +
                             new Vector2(-size.X / 2, (float)(-size.Y * 2.5)),
                             size,
                             Textures.GetHeroTexture(hero.StoredName()));
                     }
                 }
                 else
                 {
                     Drawing.DrawRect(newPos + new Vector2(-size.X / 2, -size.Y * 2), size,
                                      Textures.GetHeroTexture(hero.StoredName()));
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        private static void Game_OnUpdate(System.EventArgs args)
        {
            var player = ObjectManager.LocalPlayer;

            if (!Game.IsInGame || player == null || player.Team == Team.Observer || Game.IsChatOpen)
            {
                return;
            }

            var me = ObjectManager.LocalHero;

            if (me == null || !me.IsAlive)
            {
                return;
            }

            // instantly cancel attack
            if (_isAttacking)
            {
                _isAttacking = false;
                me.Move(_facingDirection);
                me.Hold(true);
            }

            var creeps = ObjectManager.GetEntities <Creep>().ToList();

            if (Utils.SleepCheck("attackSleep"))
            {
                Unit target = null;

                // aggro
                if (Game.IsKeyDown((AggroKeyItem.GetValue <KeyBind>().Key)))
                {
                    target = GetHeroes(me).FirstOrDefault(x => x.Team != me.Team);
                }

                // unaggro
                if (Game.IsKeyDown((UnaggroKeyItem.GetValue <KeyBind>().Key)))
                {
                    target = GetHeroes(me).FirstOrDefault(x => x.Team == me.Team);
                }

                if (target != null)
                {
                    me.Attack(target);
                    _facingDirection = Prediction.InFront(me, 25);
                    _isAttacking     = true;
                    Utils.Sleep(Game.Ping + AttackCooldown.GetValue <Slider>().Value, "attackSleep");
                }
            }
        }
Ejemplo n.º 3
0
        public async Task UseAbilities(UnitBase unitBase)
        {
            if (unitBase.Hero.IsInvisible() || unitBase.Hero.Modifiers.Any(x => x.Name.Contains("windwalk")))
            {
                return;
            }
            var flux          = unitBase.Flux;
            var magneticField = unitBase.MagneticField;
            var spark         = unitBase.Spark;

            if (!_multiSleeper.Sleeping(flux) && unitBase.AbilityChecker.IsAbilityEnabled(flux.GetAbilityId()) && flux.CanBeCasted() && flux.CanHit(Core.Target))
            {
                if (Core.Target.IsLinkensProtected() || !MenuManager.SmartFlux || !EntityManager <Unit> .Entities.Any(
                        x =>
                        !x.Equals(Core.Target) && x.Team == Core.Target.Team && x.Name != "npc_dota_thinker" && x.IsAlive && x.IsVisible &&
                        Ensage.SDK.Extensions.EntityExtensions.Distance2D(x, Core.Target) <= 225))
                {
                    flux.UseAbility(Core.Target);
                    Printer.Both("Flux usages " + flux.GetAbilityDelay());
                    _multiSleeper.Sleep(500, flux);
                    await Task.Delay(flux.GetAbilityDelay(), Core.ComboToken.Token);
                }
            }
            var distance = unitBase.Hero.Distance2D(Core.Target);

            if (!_multiSleeper.Sleeping(magneticField) && magneticField != null && unitBase.AbilityChecker.IsAbilityEnabled(magneticField.GetAbilityId()) && magneticField.CanBeCasted() &&
                !unitBase.Hero.HasModifier("modifier_arc_warden_magnetic_field") && distance <= 600 && Core.Target.IsVisible)
            {
                if (!MenuManager.MagneticField && Core.Target.IsMelee)
                {
                    magneticField.UseAbility(Prediction.InFront(unitBase.Hero, -250));
                }
                else
                {
                    magneticField.UseAbility(Prediction.InFront(unitBase.Hero, 250));
                }
                _multiSleeper.Sleep(500, magneticField);
                Printer.Both("MagneticField usages");
                await Task.Delay(magneticField.GetAbilityDelay(), Core.ComboToken.Token);
            }
            if (!_multiSleeper.Sleeping(spark) && spark != null && unitBase.AbilityChecker.IsAbilityEnabled(spark.GetAbilityId()) && spark.CanBeCasted() && !Prediction.IsTurning(Core.Target) && unitBase.Hero.IsVisibleToEnemies)
            {
                var delay       = spark.GetAbilityDelay();
                var predVector3 = Prediction.PredictedXYZ(Core.Target, 2000 + delay);
                spark.UseAbility(predVector3);
                _multiSleeper.Sleep(500, spark);
                Printer.Both("spark usages");
                await Task.Delay(spark.GetAbilityDelay(), Core.ComboToken.Token);
            }
        }
Ejemplo n.º 4
0
        public Vector3 GetPosition(bool forDrawing = false)
        {
            if (Hero == null)
            {
                return(new Vector3());
            }

            if (IsVsisible)
            {
                MovementSpeed = Hero.MovementSpeed;
                lastVisible   = Game.RawGameTime;
                return(forDrawing ? Hero.Position : Hero.NetworkPosition);
            }

            return(TimberPrediction.IsIdle(Hero) ? Position : Prediction.InFront(Hero, MovementSpeed * GetInvisTime()));
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     The execute.
        /// </summary>
        /// <param name="hero">
        ///     The hero.
        /// </param>
        /// <returns>
        ///     The <see cref="bool" />.
        /// </returns>
        public bool Execute(Hero hero)
        {
            if (!Variables.Damage.GetSuicideDamage().ContainsKey(hero.Handle))
            {
                return(false);
            }

            if (!Utils.SleepCheck(hero.ClassID + "Techies.AutoDetonate"))
            {
                return(false);
            }

            if (!(Variables.Damage.GetSuicideDamage()[hero.Handle] >= hero.Health))
            {
                return(false);
            }

            var pos = hero.NetworkPosition;

            if (hero.NetworkActivity == NetworkActivity.Move)
            {
                pos = Prediction.InFront(
                    hero,
                    (float)(((Game.Ping / 1000) + Variables.Techies.GetTurnTime(hero)) * hero.MovementSpeed));
            }

            if (pos.Distance2D(Variables.Techies) < hero.Distance2D(Variables.Techies))
            {
                pos = Prediction.InFront(hero, Game.Ping / 1000);
            }

            if (
                !(pos.Distance2D(Variables.Techies)
                  < this.SuicideRadius + hero.HullRadius + Variables.Techies.HullRadius))
            {
                return(false);
            }

            if (Variables.Techies.Distance2D(pos) > 100)
            {
                pos = Variables.Techies.Position.Extend(pos, 99);
            }

            Variables.SuicideAbility.UseAbility(pos);
            Utils.Sleep(500, "Techies.Suicide");
            return(true);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// with custom delay
        /// </summary>
        /// <param name="ability"></param>
        /// <param name="target"></param>
        /// <param name="customDelay"></param>
        /// <returns></returns>
        public static bool CanHit(this Ability ability, Hero target, float customDelay)
        {
            var aId = ability.GetAbilityId();

            if (aId >= AbilityId.nevermore_shadowraze1 && aId <= AbilityId.nevermore_shadowraze3)
            {
                var radius      = ability.GetRadius();
                var range       = ability.GetCastRange();
                var predFontPos = Prediction.InFront(Core.Me, range);
                var pred        = Prediction.PredictedXYZ(target, customDelay);
                //var inRange = (usePrediction ? pred.Distance2D(predFontPos) : target.Distance2D(predFontPos)) <= radius + target.HullRadius;
                var inRange = pred.Distance2D(predFontPos) <= radius + target.HullRadius;

                return(inRange);
            }
            return(AbilityExtensions.CanHit(ability, target));
        }
Ejemplo n.º 7
0
        private static void CastAbility(Ability ability, float range)
        {
            if (ability == null || !ability.CanBeCasted() || ability.IsInAbilityPhase ||
                !target.IsValidTarget(range, true, me.NetworkPosition) ||
                !Menu.Item("abilities").GetValue <AbilityToggler>().IsEnabled(ability.Name))
            {
                return;
            }

            if (target.Distance2D(me.Position) > 500)
            {
                if (target.UnitState.HasFlag(UnitState.Hexed))
                {
                    if (!target.IsMagicImmune())
                    {
                        ability.UseAbility(Prediction.InFront(target, target.MovementSpeed - 100));
                    }
                    else
                    {
                        ward.UseAbility(Prediction.InFront(target, target.MovementSpeed - 100));
                    }
                }
                else
                {
                    if (!target.IsMagicImmune())
                    {
                        ability.UseAbility(Prediction.InFront(target, target.MovementSpeed - 100));
                    }
                    else
                    {
                        ward.UseAbility(Prediction.InFront(target, target.MovementSpeed - 100));
                    }
                }
            }
            else
            {
                if (!target.IsMagicImmune())
                {
                    ability.UseAbility(target.NetworkPosition);
                }
                else
                {
                    ward.UseAbility(target.NetworkPosition);
                }
            }
        }
Ejemplo n.º 8
0
        public static void OnUpdate(EventArgs args)
        {
            //Printer.Print($"{Orbwalker.CanCancelAttack()} {Orbwalker.CanAttack()}");
            if (!MenuManager.ComboIsActive)
            {
                // ReSharper disable once RedundantCheckBeforeAssignment
                if (Target != null)
                {
                    Target = null;
                }
                return;
            }
            if (Target == null || !Target.IsValid || !Target.IsAlive)
            {
                Target = TargetSelector.ClosestToMouse(Me);
                return;
            }

            if (MenuManager.UseRazeInCombo && Target.IsValidRazeTarget() && !Me.IsInvisible() &&
                (!Orbwalker.CanAttack() || Me.GetAttackRange() <= Me.Distance2D(Target)))
            {
                var r = Razes.OrderBy(x => Target.Distance2D(Prediction.InFront(Me, x.GetCastRange())));
                foreach (var ability in r)
                {
                    var razeStatus = Helper.RazeAimCasterTemp(ability, Target);
                    //var razeStatus = Helper.RazeCaster(ability, Target);
                    if (razeStatus)
                    {
                        break;
                    }
                }

                /*if (!Helper.RazeCaster(RazeLow, Target))
                 *  if (!Helper.RazeCaster(RazeNormal, Target))
                 *      Helper.RazeCaster(RazeHigh, Target);*/
            }
            if (!Target.HasModifier("modifier_abaddon_borrowed_time") && Me.CanAttack())
            {
                Orbwalker.OrbwalkOn(Target, followTarget: MenuManager.OrbWalkType);
            }
            else if (!MoveSleeper.Sleeping)
            {
                MoveSleeper.Sleep(250);
                Me.Move(MenuManager.OrbWalkType ? Target.Position : Game.MousePosition);
            }
        }
Ejemplo n.º 9
0
        public static void useItem(Hero me, Hero target, float distance)
        {
            if (Utils.SleepCheck("items"))
            {
                var items =
                    me.Inventory.Items.Where(
                        x =>
                        Items.Contains(x.Name) && x.CanBeCasted() && Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(x.Name) &&
                        (x.CastRange == 0 || x.CastRange >= distance) && Utils.SleepCheck(x.Name)).ToList();
                foreach (var item in items)
                {
                    switch (item.ClassID)
                    {
                    case ClassID.CDOTA_Item_BlinkDagger:
                        var p    = Prediction.InFront(target, 100);
                        var dist = me.Distance2D(p);
                        if (dist <= 1150 && dist >= 400)
                        {
                            item.UseAbility(p);
                            Utils.Sleep(200, item.Name);
                        }
                        break;

                    default:
                        if (item.IsAbilityBehavior(AbilityBehavior.UnitTarget))
                        {
                            if (!target.IsStunned() && !target.IsHexed())
                            {
                                item.UseAbility(target);
                            }
                            item.UseAbility(me);
                        }
                        else
                        {
                            item.UseAbility();
                        }
                        Utils.Sleep(200, item.Name);
                        break;
                    }
                }
            }
        }
Ejemplo n.º 10
0
        private static void UseBlink()
        {
            if (!useBlink.GetValue <bool>() || Blink == null || !Blink.CanBeCasted() ||
                Target.Distance2D(Me.Position) < 600 || !Utils.SleepCheck("blink"))
            {
                return;
            }
            PredictXyz = Target.NetworkActivity == NetworkActivity.Move
                ? Prediction.InFront(Target,
                                     (float)(Target.MovementSpeed * (Game.Ping / 1000 + 0.3 + Target.GetTurnTime(Target))))
                : Target.Position;

            if (Me.Position.Distance2D(PredictXyz) > 1200)
            {
                PredictXyz = (PredictXyz - Me.Position) * 1200 / PredictXyz.Distance2D(Me.Position) + Me.Position;
            }

            Blink.UseAbility(PredictXyz);
            Utils.Sleep(500, "blink");
        }
Ejemplo n.º 11
0
        private static void UseBlink()
        {
            if (!useBlink.GetValue <bool>() || blink == null || !blink.CanBeCasted() ||
                target.Distance2D(me.Position) < 600 || !Utils.SleepCheck("blink"))
            {
                return;
            }
            predictXYZ = target.NetworkActivity == NetworkActivity.Move
                ? Prediction.InFront(target,
                                     (float)(target.MovementSpeed * (Game.Ping / 1000 + 0.3 + target.GetTurnTime(target))))
                : target.Position;

            if (me.Position.Distance2D(predictXYZ) > 1200)
            {
                predictXYZ = (predictXYZ - me.Position) * 1200 / predictXYZ.Distance2D(me.Position) + me.Position;
            }

            blink.UseAbility(predictXYZ);
            Utils.Sleep(500, "blink");
        }
Ejemplo n.º 12
0
        public static void OnUpdate(EventArgs args)
        {
            if (!MenuManager.IsEnableForceStaff || Updater.Sleeping || !MenuManager.IsEnable)
            {
                return;
            }
            Updater.Sleep(1);
            var forceStuff = Core.Me.GetItemById(AbilityId.item_force_staff);

            if (forceStuff != null && ItemExtensions.CanBeCasted(forceStuff))
            {
                foreach (var hero in Heroes.GetByTeam(Core.EnemyTeam))
                {
                    if (Core.HeroSleeper.Sleeping(hero) || !hero.IsAlive || !hero.IsVisible ||
                        !hero.CanDie(MenuManager.CheckForAegis) || Prediction.IsTurning(hero) ||
                        !AbilityExtensions.CanHit(forceStuff, hero))
                    {
                        continue;
                    }
                    var heroPos    = Prediction.InFront(hero, 600);
                    var heroHealth = hero.Health + hero.HealthRegeneration;
                    var reduction  = Core.RemoteMine.GetDamageReduction(hero);
                    foreach (var element in Core.Bombs)
                    {
                        if (element.IsRemoteMine && element.Active)
                        {
                            if (element.CanHit(heroPos, hero))
                            {
                                heroHealth -= DamageHelpers.GetSpellDamage(element.Damage, 0, reduction);
                                if (heroHealth <= 0)
                                {
                                    forceStuff.UseAbility(hero);
                                    Core.HeroSleeper.Sleep(250, hero);
                                    Updater.Sleep(250);
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 13
0
        public async Task UseAbilities(UnitBase unitBase)
        {
            var flux          = unitBase.Flux;
            var magneticField = unitBase.MagneticField;
            var spark         = unitBase.Spark;

            if (!_multiSleeper.Sleeping(flux) && unitBase.AbilityChecker.IsAbilityEnabled(flux.GetAbilityId()) && flux.CanBeCasted() && flux.CanHit(Core.Target))
            {
                flux.UseAbility(Core.Target);
                Printer.Both("Flux usages " + flux.GetAbilityDelay());
                _multiSleeper.Sleep(500, flux);
                await Task.Delay(flux.GetAbilityDelay(), Core.ComboToken.Token);
            }
            var distance = unitBase.Hero.Distance2D(Core.Target);

            if (!_multiSleeper.Sleeping(magneticField) && magneticField != null && unitBase.AbilityChecker.IsAbilityEnabled(magneticField.GetAbilityId()) && magneticField.CanBeCasted() &&
                !unitBase.Hero.HasModifier("modifier_arc_warden_magnetic_field") && distance <= 600 && Core.Target.IsVisible)
            {
                if (!MenuManager.MagneticField && Core.Target.IsMelee)
                {
                    magneticField.UseAbility(Prediction.InFront(unitBase.Hero, -250));
                }
                else
                {
                    magneticField.UseAbility(Prediction.InFront(unitBase.Hero, 250));
                }
                _multiSleeper.Sleep(500, magneticField);
                Printer.Both("MagneticField usages");
                await Task.Delay(magneticField.GetAbilityDelay(), Core.ComboToken.Token);
            }
            if (!_multiSleeper.Sleeping(spark) && spark != null && unitBase.AbilityChecker.IsAbilityEnabled(spark.GetAbilityId()) && spark.CanBeCasted() && !Prediction.IsTurning(Core.Target) && unitBase.Hero.IsVisibleToEnemies)
            {
                var delay       = spark.GetAbilityDelay();
                var predVector3 = Prediction.PredictedXYZ(Core.Target, 2000 + delay);
                spark.UseAbility(predVector3);
                _multiSleeper.Sleep(500, spark);
                Printer.Both("spark usages");
                await Task.Delay(spark.GetAbilityDelay(), Core.ComboToken.Token);
            }
        }
Ejemplo n.º 14
0
        private static void GetPrediction()
        {
            switch (predictionType.GetValue <StringList>().SelectedIndex)
            {
            case 0:
                if (target.UnitState.HasFlag(UnitState.Hexed))
                {
                    mysticflare.UseAbility(Prediction.InFront(target, 87));
                    break;
                }
                mysticflare.UseAbility(Prediction.InFront(target, 100));
                break;

            case 1:
                if (target.UnitState.HasFlag(UnitState.Hexed))
                {
                    mysticflare.UseAbility(Prediction.PredictedXYZ(target, 210 / target.MovementSpeed * 1000));
                    break;
                }
                mysticflare.UseAbility(Prediction.PredictedXYZ(target, 230 / target.MovementSpeed * 1000));
                break;
            }
        }
Ejemplo n.º 15
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (!loaded)
            {
                me = ObjectMgr.LocalHero;
                if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Techies)
                {
                    return;
                }
                loaded        = true;
                remoteMines   = me.Spellbook.SpellR;
                suicideAttack = me.Spellbook.SpellE;
                landMines     = me.Spellbook.SpellQ;
                forceStaff    = null;
                //enemyHeroes = null;
                players          = null;
                remoteMinesDb    = new Dictionary <Unit, float>();
                heroTopPanel     = new Dictionary <ClassID, double[]>();
                landMinesHeroDmg = new Dictionary <ClassID, double>();
                suicideHeroDmg   = new Dictionary <ClassID, float>();
                enabledHeroes    = new Dictionary <ClassID, bool>();
                var screenSize = new Vector2(Drawing.Width, Drawing.Height);
                monitor = screenSize.X / 1280;
                if (me.AghanimState())
                {
                    var firstOrDefault = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "damage_scepter");
                    if (firstOrDefault != null)
                    {
                        remoteMinesDmg = firstOrDefault.GetValue(remoteMines.Level - 1);
                    }
                }
                else
                {
                    var firstOrDefault = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "damage");
                    if (firstOrDefault != null)
                    {
                        remoteMinesDmg = firstOrDefault.GetValue(remoteMines.Level - 1);
                    }
                }
                foreach (var bomb in
                         ObjectMgr.GetEntities <Unit>()
                         .Where(
                             x =>
                             x.ClassID == ClassID.CDOTA_NPC_TechiesMines && x.Spellbook.Spell1 != null &&
                             x.Spellbook.Spell1.IsValid && x.Spellbook.Spell1.CanBeCasted() && x.IsAlive)
                         .Where(bomb => !remoteMinesDb.ContainsKey(bomb)))
                {
                    remoteMinesDb.Add(bomb, remoteMinesDmg);
                    if (bomb.Health < bomb.Health / 2)
                    {
                        bomb.Spellbook.SpellQ.UseAbility();
                    }
                }
                //enemyHeroes =
                //    ObjectMgr.GetEntities<Hero>()
                //        .Where(x => x != null && x.IsValid && x.Team == me.GetEnemyTeam() && !x.IsIllusion);
                players =
                    ObjectMgr.GetEntities <Player>()
                    .Where(x => x != null && x.Hero != null && x.Hero.Team == me.GetEnemyTeam());
                Game.PrintMessage(
                    "<font face='Tahoma'><font color='#993311'>#TECHIES</font> by MOON<font color='#ff9900'>ES</font> loaded!</font> ",
                    MessageType.LogMessage);
            }
            if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Techies)
            {
                loaded = false;
                return;
            }

            if (Game.IsPaused)
            {
                return;
            }

            if (forceStaff == null && Menu.Item("useForceStaff").GetValue <bool>()
                )
            {
                forceStaff = me.Inventory.Items.FirstOrDefault(x => x.ClassID == ClassID.CDOTA_Item_ForceStaff);
            }
            var detonate = ObjectMgr.GetEntities <Unit>()
                           .Where(x => x.ClassID == ClassID.CDOTA_NPC_TechiesMines && x.Spellbook.Spell1 != null && x.Spellbook.Spell1.IsValid && x.Spellbook.Spell1.CanBeCasted() && x.Health <= (x.MaximumHealth * 0.6) && x.IsAlive).FirstOrDefault();

            if (detonate != null && Utils.SleepCheck(detonate.Handle.ToString()))
            {
                detonate.Spellbook.SpellQ.UseAbility();
                Utils.Sleep(400, detonate.Handle.ToString());
            }

            var suicideLevel = suicideAttack.Level;

            if (suicideAttackLevel != suicideLevel)
            {
                var firstOrDefault = suicideAttack.AbilityData.FirstOrDefault(x => x.Name == "damage");
                if (firstOrDefault != null)
                {
                    suicideAttackDmg = firstOrDefault.GetValue(suicideLevel - 1);
                }
                var abilityData = suicideAttack.AbilityData.FirstOrDefault(x => x.Name == "small_radius");
                if (abilityData != null)
                {
                    suicideAttackRadius = abilityData.Value;
                }
                suicideAttackLevel = suicideLevel;
            }

            var bombLevel = remoteMines.Level;

            if (remoteMinesLevel != bombLevel)
            {
                if (me.AghanimState())
                {
                    var firstOrDefault = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "damage_scepter");
                    if (firstOrDefault != null)
                    {
                        remoteMinesDmg = firstOrDefault.GetValue(bombLevel - 1);
                    }
                }
                else
                {
                    var firstOrDefault = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "damage");
                    if (firstOrDefault != null)
                    {
                        remoteMinesDmg = firstOrDefault.GetValue(bombLevel - 1);
                    }
                }
                var abilityData = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "radius");
                if (abilityData != null)
                {
                    remoteMinesRadius = abilityData.Value + 20;
                }
                remoteMinesLevel = bombLevel;
            }

            var landMineslvl = landMines.Level;

            if (landMinesLevel != landMineslvl)
            {
                var firstOrDefault = landMines.AbilityData.FirstOrDefault(x => x.Name == "damage");
                if (firstOrDefault != null)
                {
                    landMinesDmg = firstOrDefault.GetValue(landMineslvl - 1);
                }
                landMinesLevel = landMineslvl;
            }

            if (!aghanims && me.AghanimState())
            {
                var firstOrDefault = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "damage_scepter");
                if (firstOrDefault != null)
                {
                    remoteMinesDmg = firstOrDefault.GetValue(bombLevel - 1);
                }
                aghanims = true;
            }
            var bombs =
                remoteMinesDb.Where(
                    x =>
                    x.Key != null && x.Key.IsValid && x.Key.Spellbook.Spell1 != null &&
                    x.Key.Spellbook.Spell1.CanBeCasted() && x.Key.IsAlive);
            var bombsArray = bombs as KeyValuePair <Unit, float>[] ?? bombs.ToArray();
            var eHeroes    =
                ObjectMgr.GetEntities <Hero>()
                .Where(
                    x =>
                    x != null && x.IsValid && !x.IsIllusion && x.Team == me.GetEnemyTeam() && x.IsAlive &&
                    x.IsVisible && !x.IsMagicImmune() &&
                    x.Modifiers.All(y => y.Name != "modifier_abaddon_borrowed_time") &&
                    x.Modifiers.All(y => y.Name != "modifier_dazzle_shallow_grave") &&
                    x.Modifiers.All(y => y.Name != "modifier_templar_assassin_refraction_absorb")

                    && Utils.SleepCheck(x.ClassID.ToString()));

            try
            {
                foreach (var hero in
                         eHeroes)
                {
                    bool enabled;
                    if (!enabledHeroes.TryGetValue(hero.ClassID, out enabled) || !enabled)
                    {
                        continue;
                    }
                    var heroDistance = me.Distance2D(hero);
                    if (Menu.Item("autoDetonate").GetValue <bool>())
                    {
                        var nearbyBombs = bombsArray.Any(x => x.Key.Distance2D(hero) <= remoteMinesRadius + 500);
                        if (nearbyBombs)
                        {
                            CheckBombDamageAndDetonate(hero, bombsArray);
                        }
                    }
                    //Game.PrintMessage((float)me.Health / me.MaximumHealth + " " + (float)Menu.Item("HPTreshold").GetValue<Slider>().Value / 100, MessageType.ChatMessage);
                    var zHeroes =
                        ObjectMgr.GetEntities <Hero>()
                        .Where(
                            x =>
                            x != null && x.IsValid && !x.IsIllusion && x.Team == me.GetEnemyTeam() && x.IsAlive &&
                            x.IsVisible && !x.IsMagicImmune() &&
                            x.Modifiers.All(y => y.Name != "modifier_abaddon_borrowed_time") &&
                            x.Modifiers.All(y => y.Name != "modifier_dazzle_shallow_grave") &&
                            x.Modifiers.All(y => y.Name != "modifier_templar_assassin_refraction_absorb"));
                    foreach (var z in zHeroes)
                    {
                        if (Menu.Item("autoSuicide").GetValue <bool>() && suicideAttack.CanBeCasted() &&
                            (float)me.Health / me.MaximumHealth
                            <= (float)Menu.Item("HPTreshold").GetValue <Slider>().Value / 100 && heroDistance < 400 &&
                            suicideAttackLevel > 0 && me.IsAlive &&
                            z.Modifiers.All(y => y.Name != "modifier_dazzle_shallow_grave"))
                        {
                            SuicideKillSteal(hero);
                        }
                    }
                    if (forceStaff == null || !Menu.Item("useForceStaff").GetValue <bool>() ||
                        !(heroDistance <= forceStaff.CastRange) || !Utils.SleepCheck("forcestaff") ||
                        bombsArray.Any(x => x.Key.Distance2D(hero) <= remoteMinesRadius) ||
                        Prediction.IsTurning(hero) || !forceStaff.CanBeCasted())
                    {
                        continue;
                    }

                    double rotSpeed;
                    if (!Prediction.RotSpeedDictionary.TryGetValue(hero.Handle, out rotSpeed) ||
                        (rotSpeed > 0 && Menu.Item("checkRotating").GetValue <bool>()))
                    {
                        continue;
                    }
                    if (Prediction.StraightTime(hero) / 1000 < Menu.Item("straightTime").GetValue <Slider>().Value)
                    {
                        continue;
                    }
                    var turnTime      = me.GetTurnTime(hero);
                    var forcePosition = hero.Position;
                    if (hero.NetworkActivity == NetworkActivity.Move)
                    {
                        forcePosition = Prediction.InFront(
                            hero,
                            (float)((turnTime + Game.Ping / 1000) * hero.MovementSpeed));
                    }
                    forcePosition +=
                        VectorExtensions.FromPolarCoordinates(1f, (float)(hero.NetworkRotationRad + rotSpeed))
                        .ToVector3() * 600;
                    var possibleBombs = bombsArray.Any(x => x.Key.Distance2D(forcePosition) <= (remoteMinesRadius - 75));
                    if (!possibleBombs)
                    {
                        continue;
                    }
                    var dmg = CheckBombDamage(hero, forcePosition, bombsArray);
                    if (!(dmg >= hero.Health) && hero.Modifiers.All(y => y.Name != "modifier_dazzle_shallow_grave" && y.Name != "modifier_templar_assassin_refraction_absorb"))
                    {
                        continue;
                    }
                    forceStaff.UseAbility(hero);
                    Utils.Sleep(250, "forcestaff");
                }
            }
            catch (Exception)
            {
                //aa
            }

            if (!Menu.Item("autoDetonateCreeps").GetValue <bool>())
            {
                return;
            }
            var creeps =
                ObjectMgr.GetEntities <Creep>()
                .Where(
                    x =>
                    (x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane || x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege) &&
                    x.IsAlive && x.IsVisible && x.IsSpawned && x.Team == me.GetEnemyTeam());
            var enumerable = creeps as Creep[] ?? creeps.ToArray();

            foreach (var data in (from creep in enumerable
                                  let nearbyBombs =
                                      bombsArray.Any(x => x.Key.Distance2D(creep) <= remoteMinesRadius + 500)
                                      where nearbyBombs
                                      let detonatableBombs = FindDetonatableBombs(creep, creep.Position, bombsArray)
                                                             where detonatableBombs != null
                                                             let nearbyCreeps =
                                          enumerable.Count(
                                              x =>
                                              x.Distance2D(creep) <= remoteMinesRadius &&
                                              CheckBombDamage(x, x.Position, bombsArray) >= x.Health)
                                          where nearbyCreeps > 3
                                          select detonatableBombs).SelectMany(
                         detonatableBombs =>
                         detonatableBombs.Where(data => Utils.SleepCheck(data.Value.Handle.ToString()))))
            {
                data.Value.UseAbility();
                Utils.Sleep(250, data.Value.Handle.ToString());
            }
        }
Ejemplo n.º 16
0
        public static void Game_OnUpdate(EventArgs args)
        {
            me = ObjectManager.LocalHero;

            if (!Game.IsInGame || me.ClassID != ClassID.CDOTA_Unit_Hero_Pugna || me == null)
            {
                return;
            }
            if (!menu.Item("enabled").IsActive())
            {
                return;
            }
            target = me.ClosestToMouseTarget(2000);
            if (target == null)
            {
                return;
            }

            //spell
            Q = me.Spellbook.SpellQ;

            W = me.Spellbook.SpellW;

            E = me.Spellbook.SpellE;

            R = me.Spellbook.SpellR;

            // Item
            ethereal = me.FindItem("item_ethereal_blade");

            sheep = target.ClassID == ClassID.CDOTA_Unit_Hero_Tidehunter ? null : me.FindItem("item_sheepstick");

            vail = me.FindItem("item_veil_of_discord");

            cheese = me.FindItem("item_cheese");

            ghost = me.FindItem("item_ghost");

            orchid = me.FindItem("item_orchid");

            atos = me.FindItem("item_rod_of_atos");

            soulring = me.FindItem("item_soul_ring");

            arcane = me.FindItem("item_arcane_boots");

            blink = me.FindItem("item_blink");

            shiva = me.FindItem("item_shivas_guard");

            dagon = me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon"));
            //var ModifRod = target.Modifiers.Any(y => y.Name == "modifier_rod_of_atos_debuff");
            var stoneModif = target.Modifiers.Any(y => y.Name == "modifier_medusa_stone_gaze_stone");

            Active = Game.IsKeyDown(menu.Item("keyBind").GetValue <KeyBind>().Key);

            if (Active && me.IsAlive && target.IsAlive && Utils.SleepCheck("Active"))
            {
                var noBlade = target.Modifiers.Any(y => y.Name == "modifier_item_blade_mail_reflect");

                if (stoneModif)
                {
                    return;
                }
                if (R.IsInAbilityPhase || me.Modifiers.Any(y => y.Name == "modifier_pugna_life_drain"))
                {
                    return;
                }
                if (target.IsVisible && me.Distance2D(target) <= 2300 && !noBlade)
                {
                    if ((!me.IsChanneling() && !me.AghanimState()) || (me.AghanimState() && menu.Item("agh").IsActive()))
                    {
                        if ( // atos Blade
                            atos != null &&
                            atos.CanBeCasted() &&
                            me.CanCast() &&
                            !target.IsLinkensProtected() &&
                            !target.IsMagicImmune() &&
                            Utils.SleepCheck("atos") &&
                            me.Distance2D(target) <= 2000
                            )
                        {
                            atos.UseAbility(target);
                            Utils.Sleep(250, "atos");
                        } // atos Item end
                        float   angle = me.FindAngleBetween(target.Position, true);
                        Vector3 pos   = new Vector3((float)(target.Position.X - 350 * Math.Cos(angle)), (float)(target.Position.Y - 350 * Math.Sin(angle)), 0);
                        if (
                            blink != null &&
                            Q.CanBeCasted() &&
                            me.CanCast() &&
                            blink.CanBeCasted() &&
                            me.Distance2D(target) >= 590 &&
                            me.Distance2D(pos) <= 1190 &&
                            Utils.SleepCheck("blink")
                            )
                        {
                            blink.UseAbility(pos);
                            Utils.Sleep(250, "blink");
                        }
                        if (
                            W != null &&
                            W.CanBeCasted() &&
                            (Q.CanBeCasted() ||
                             R.CanBeCasted()) &&
                            me.CanCast() &&
                            menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(W.Name) &&
                            me.Distance2D(target) < 1400 &&
                            Utils.SleepCheck("W")
                            )
                        {
                            W.UseAbility(target);
                            Utils.Sleep(200, "W");
                        }

                        if (!W.CanBeCasted() || W == null || !menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(W.Name))
                        {
                            if (
                                Q != null &&
                                Q.CanBeCasted() &&
                                me.CanCast() &&
                                menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(Q.Name) &&
                                me.Distance2D(target) < 1400 &&
                                Utils.SleepCheck("Q")
                                )
                            {
                                Q.UseAbility(target.Position);
                                Utils.Sleep(200, "Q");
                            }
                            if (                             // orchid
                                orchid != null &&
                                orchid.CanBeCasted() &&
                                me.CanCast() &&
                                !target.IsLinkensProtected() &&
                                !target.IsMagicImmune() &&
                                Utils.SleepCheck("orchid") &&
                                me.Distance2D(target) <= 1400

                                )
                            {
                                orchid.UseAbility(target);
                                Utils.Sleep(250, "orchid");
                            }                             // orchid Item end
                            if (!orchid.CanBeCasted() || orchid == null)
                            {
                                if (                                 // vail
                                    vail != null &&
                                    vail.CanBeCasted() &&
                                    me.CanCast() &&
                                    target.Modifiers.Any(y => y.Name != "modifier_item_veil_of_discord_debuff") &&
                                    !target.IsMagicImmune() &&
                                    Utils.SleepCheck("vail") &&
                                    me.Distance2D(target) <= 1500
                                    )
                                {
                                    vail.UseAbility(target.Position);
                                    Utils.Sleep(250, "vail");
                                }                                 // orchid Item end
                                if (!vail.CanBeCasted() || vail == null)
                                {
                                    if (                                    // ethereal
                                        ethereal != null &&
                                        ethereal.CanBeCasted() &&
                                        me.CanCast() &&
                                        !target.IsLinkensProtected() &&
                                        !target.IsMagicImmune() &&
                                        Utils.SleepCheck("ethereal")
                                        )
                                    {
                                        ethereal.UseAbility(target);
                                        Utils.Sleep(200, "ethereal");
                                    }                                     // ethereal Item end
                                    if (!ethereal.CanBeCasted() || ethereal == null)
                                    {
                                        if (                                        // SoulRing Item
                                            soulring != null &&
                                            soulring.CanBeCasted() &&
                                            me.CanCast() &&
                                            me.Health >= (me.MaximumHealth * 0.3) &&
                                            me.Mana <= R.ManaCost
                                            )
                                        {
                                            soulring.UseAbility();
                                        }                                         // SoulRing Item end

                                        if (                                      // Arcane Boots Item
                                            arcane != null &&
                                            arcane.CanBeCasted() &&
                                            me.CanCast() &&
                                            me.Mana <= R.ManaCost
                                            )
                                        {
                                            arcane.UseAbility();
                                        }                                         // Arcane Boots Item end

                                        if (                                      //Ghost
                                            ghost != null &&
                                            ghost.CanBeCasted() &&
                                            me.CanCast() &&
                                            ((me.Position.Distance2D(target) < 300 &&
                                              me.Health <= (me.MaximumHealth * 0.7)) ||
                                             me.Health <= (me.MaximumHealth * 0.3)) &&
                                            Utils.SleepCheck("Ghost"))
                                        {
                                            ghost.UseAbility();
                                            Utils.Sleep(250, "Ghost");
                                        }


                                        if (                                        // Shiva Item
                                            shiva != null &&
                                            shiva.CanBeCasted() &&
                                            me.CanCast() &&
                                            !target.IsMagicImmune() &&
                                            Utils.SleepCheck("shiva") &&
                                            me.Distance2D(target) <= 600
                                            )

                                        {
                                            shiva.UseAbility();
                                            Utils.Sleep(250, "shiva");
                                        }                                         // Shiva Item end


                                        if (                                         // sheep
                                            sheep != null &&
                                            sheep.CanBeCasted() &&
                                            me.CanCast() &&
                                            !target.IsLinkensProtected() &&
                                            !target.IsMagicImmune() &&
                                            Utils.SleepCheck("sheep") &&
                                            me.Distance2D(target) <= 1400

                                            )
                                        {
                                            sheep.UseAbility(target);
                                            Utils.Sleep(250, "sheep");
                                        }                                         // sheep Item end

                                        if (                                      // Dagon
                                            me.CanCast() &&
                                            dagon != null &&
                                            (ethereal == null ||
                                             (target.Modifiers.Any(y => y.Name == "modifier_item_ethereal_blade_slow") ||
                                              ethereal.Cooldown < 17)) &&
                                            !target.IsLinkensProtected() &&
                                            dagon.CanBeCasted() &&
                                            !target.IsMagicImmune()

                                            && Utils.SleepCheck("dagon")
                                            )
                                        {
                                            dagon.UseAbility(target);
                                            Utils.Sleep(200, "dagon");
                                        }                                         // Dagon Item end

                                        if (
                                            // cheese
                                            cheese != null &&
                                            cheese.CanBeCasted() &&
                                            Utils.SleepCheck("cheese") &&
                                            me.Health <= (me.MaximumHealth * 0.3) &&
                                            me.Distance2D(target) <= 700)
                                        {
                                            cheese.UseAbility();
                                            Utils.Sleep(200, "cheese");
                                        }                                         // cheese Item end
                                        var v = ObjectManager.GetEntities <Hero>()
                                                .Where(x => x.Team != me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && x.Distance2D(me) <= 1200).ToList();
                                        if (E != null && E.CanBeCasted() && (v.Count(x => x.Distance2D(me) <= 1200) >=
                                                                             (menu.Item("Heel").GetValue <Slider>().Value)) &&
                                            menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(E.Name) && Utils.SleepCheck("E"))
                                        {
                                            E.UseAbility(Prediction.InFront(me, 70));
                                            Utils.Sleep(100, "E");
                                        }
                                    }
                                }
                            }
                        }
                        if (
                            (R != null &&
                             R.CanBeCasted() &&
                             menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(R.Name) &&
                             !me.IsChanneling() &&
                             me.Modifiers.All(y => y.Name != "modifier_pugna_life_drain") &&
                             (!Q.CanBeCasted() || Q == null || !menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(Q.Name)) &&
                             (!W.CanBeCasted() || W == null || !menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(W.Name)) &&
                             (!atos.CanBeCasted() || atos == null) &&
                             (!orchid.CanBeCasted() || orchid == null) &&
                             (!sheep.CanBeCasted() || sheep == null) &&
                             (!dagon.CanBeCasted() || dagon == null) &&
                             (!ethereal.CanBeCasted() || ethereal == null) &&
                             (!cheese.CanBeCasted() || cheese == null) &&
                             me.Position.Distance2D(target) < 1000
                            ) &&
                            Utils.SleepCheck("R"))
                        {
                            R.UseAbility(target);
                            Utils.Sleep(200, "R");
                        }
                    }
                }
                Utils.Sleep(50, "Active");
            }
        }
Ejemplo n.º 17
0
        public void Combo()
        {
            if (Menu.Item("enabled").IsActive() && Utils.SleepCheck("combo"))
            {
                e = Toolset.ClosestToMouse(me);
                if (e == null)
                {
                    return;
                }
                Q      = me.Spellbook.SpellQ;
                W      = me.Spellbook.SpellW;
                R      = me.Spellbook.SpellR;
                Active = Game.IsKeyDown(Menu.Item("keyBind").GetValue <KeyBind>().Key);

                Shiva = me.FindItem("item_shivas_guard");
                pike  = me.FindItem("item_hurricane_pike");
                var dragon = me.FindItem("item_dragon_lance");

                ethereal = me.FindItem("item_ethereal_blade");
                mom      = me.FindItem("item_mask_of_madness");
                urn      = me.FindItem("item_urn_of_shadows");
                dagon    = me.Inventory.Items.FirstOrDefault(
                    item => item.Name.Contains("item_dagon"));
                halberd  = me.FindItem("item_heavens_halberd");
                mjollnir = me.FindItem("item_mjollnir");
                orchid   = me.FindItem("item_orchid") ?? me.FindItem("item_bloodthorn");
                abyssal  = me.FindItem("item_abyssal_blade");
                mail     = me.FindItem("item_blade_mail");
                manta    = me.FindItem("item_manta");
                bkb      = me.FindItem("item_black_king_bar");
                satanic  = me.FindItem("item_satanic");
                blink    = me.FindItem("item_blink");
                medall   = me.FindItem("item_medallion_of_courage") ?? me.FindItem("item_solar_crest");
                sheep    = e.ClassID == ClassID.CDOTA_Unit_Hero_Tidehunter ? null : me.FindItem("item_sheepstick");
                cheese   = me.FindItem("item_cheese");
                stick    = me.FindItem("item_magic_stick") ?? me.FindItem("item_magic_wand");
                phase    = me.FindItem("item_phase_boots");

                var Meld    = me.Modifiers.ToList().Exists(y => y.Name == "modifier_templar_assassin_meld");
                var pikeMod = me.Modifiers.ToList().Exists(y => y.Name == "modifier_item_hurricane_pike_range");
                Toolset.Range();
                var stoneModif = e.Modifiers.Any(y => y.Name == "modifier_medusa_stone_gaze_stone");
                var v          =
                    ObjectManager.GetEntities <Hero>()
                    .Where(x => x.Team != me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && !x.IsMagicImmune())
                    .ToList();

                var pike_range = me.Modifiers.FirstOrDefault(y => y.Name == "modifier_item_hurricane_pike_range");
                if (pike_range != null)
                {
                    if (
                        Q != null &&
                        Q.CanBeCasted() &&
                        !Meld &&
                        Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(Q.Name) &&
                        Utils.SleepCheck("Q")
                        )
                    {
                        Q.UseAbility();
                        Utils.Sleep(200, "Q");
                    }
                    if (
                        W != null &&
                        Q != null &&
                        pike_range.StackCount <= 3 &&
                        !Q.CanBeCasted() &&
                        W.CanBeCasted() &&
                        Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(W.Name) &&
                        Utils.SleepCheck("W")
                        )
                    {
                        W.UseAbility();
                        me.Attack(e);
                        Utils.Sleep(200, "W");
                    }
                    if (Menu.Item("orbwalk").GetValue <bool>())
                    {
                        Orbwalking.Orbwalk(e, 0, 7000, true, true);
                    }
                }
                if (pike_range != null && pike_range.StackCount > 0)
                {
                    return;
                }
                if (pikeMod)
                {
                    return;
                }
                if (Active)
                {
                    if (Meld)
                    {
                        if (Menu.Item("orbwalk").GetValue <bool>() && me.Distance2D(e) <= 1900)
                        {
                            Orbwalking.Orbwalk(e, 0, 1600, true, true);
                        }
                    }
                }

                if (Meld)
                {
                    return;
                }

                if (Active && me.Distance2D(e) <= 1400 && e != null && e.IsAlive && !me.IsInvisible())
                {
                    if (R != null &&
                        (pike == null ||
                         !pike.CanBeCasted()) &&
                        me.Distance2D(e) >= Toolset.AttackRange + 5 &&
                        R.CanBeCasted() &&
                        !Meld &&
                        Utils.SleepCheck("R") &&
                        !e.Modifiers.ToList().Exists(x => x.Name == "modifier_templar_assassin_trap_slow") &&
                        Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(R.Name))
                    {
                        R.UseAbility(Prediction.InFront(e, 140));
                        Utils.Sleep(150, "R");
                    }
                    if (
                        Q != null && Q.CanBeCasted() &&
                        me.Distance2D(e) <= Toolset.AttackRange + 300 &&
                        !Meld &&
                        Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(Q.Name) &&
                        Utils.SleepCheck("Q")
                        )
                    {
                        Q.UseAbility();
                        Utils.Sleep(200, "Q");
                    }
                    float   angle = me.FindAngleBetween(e.Position, true);
                    Vector3 pos   = new Vector3((float)(e.Position.X + 100 * Math.Cos(angle)), (float)(e.Position.Y + 100 * Math.Sin(angle)), 0);
                    if (
                        blink != null &&
                        me.CanCast() &&
                        blink.CanBeCasted() &&
                        me.Distance2D(e) >= Toolset.AttackRange &&
                        me.Distance2D(pos) <= 1190 &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(blink.Name) &&
                        Utils.SleepCheck("blink")
                        )
                    {
                        blink.UseAbility(pos);
                        Utils.Sleep(250, "blink");
                    }
                    if (
                        W != null && W.CanBeCasted() && me.Distance2D(e) <= Toolset.AttackRange - 10 &&
                        Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(W.Name) &&
                        Utils.SleepCheck("W")
                        )
                    {
                        W.UseAbility();
                        me.Attack(e);
                        Utils.Sleep(200, "W");
                    }
                    if (                     // MOM
                        mom != null &&
                        mom.CanBeCasted() &&
                        me.CanCast() &&
                        !Meld &&
                        Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(mom.Name) &&
                        Utils.SleepCheck("mom") &&
                        me.Distance2D(e) <= 700
                        )
                    {
                        mom.UseAbility();
                        Utils.Sleep(250, "mom");
                    }
                    if (                     // Hellbard
                        halberd != null &&
                        halberd.CanBeCasted() &&
                        me.CanCast() &&
                        !e.IsMagicImmune() &&
                        (e.NetworkActivity == NetworkActivity.Attack ||
                         e.NetworkActivity == NetworkActivity.Crit ||
                         e.NetworkActivity == NetworkActivity.Attack2) &&
                        Utils.SleepCheck("halberd") &&
                        me.Distance2D(e) <= 700 &&
                        !Meld &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(halberd.Name)
                        )
                    {
                        halberd.UseAbility(e);
                        Utils.Sleep(250, "halberd");
                    }
                    if (                     // Mjollnir
                        mjollnir != null &&
                        mjollnir.CanBeCasted() &&
                        me.CanCast() &&
                        !Meld &&
                        !e.IsMagicImmune() &&
                        Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(mjollnir.Name) &&
                        Utils.SleepCheck("mjollnir") &&
                        me.Distance2D(e) <= 900
                        )
                    {
                        mjollnir.UseAbility(me);
                        Utils.Sleep(250, "mjollnir");
                    }                     // Mjollnir Item end
                    if (
                        // cheese
                        cheese != null &&
                        cheese.CanBeCasted() &&
                        !Meld &&
                        me.Health <= (me.MaximumHealth * 0.3) &&
                        me.Distance2D(e) <= 700 &&
                        Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(cheese.Name) &&
                        Utils.SleepCheck("cheese")
                        )
                    {
                        cheese.UseAbility();
                        Utils.Sleep(200, "cheese");
                    }                     // cheese Item end
                    if (                  // Medall
                        medall != null &&
                        medall.CanBeCasted() &&
                        !Meld &&
                        Utils.SleepCheck("Medall") &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(medall.Name) &&
                        me.Distance2D(e) <= 700
                        )
                    {
                        medall.UseAbility(e);
                        Utils.Sleep(250, "Medall");
                    }                     // Medall Item end

                    if (                  // sheep
                        sheep != null &&
                        sheep.CanBeCasted() &&
                        me.CanCast() &&
                        !e.IsLinkensProtected() &&
                        !e.IsMagicImmune() &&
                        !Meld &&
                        me.Distance2D(e) <= 1400 &&
                        !stoneModif &&
                        Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(sheep.Name) &&
                        Utils.SleepCheck("sheep")
                        )
                    {
                        sheep.UseAbility(e);
                        Utils.Sleep(250, "sheep");
                    }                     // sheep Item end
                    if (                  // Abyssal Blade
                        abyssal != null &&
                        abyssal.CanBeCasted() &&
                        me.CanCast() &&
                        !Meld &&
                        !e.IsStunned() &&
                        !e.IsHexed() &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(abyssal.Name) &&
                        Utils.SleepCheck("abyssal") &&
                        me.Distance2D(e) <= 400
                        )
                    {
                        abyssal.UseAbility(e);
                        Utils.Sleep(250, "abyssal");
                    }                     // Abyssal Item end
                    if (orchid != null &&
                        orchid.CanBeCasted() &&
                        !Meld &&
                        me.Distance2D(e) <= 600 &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(orchid.Name) &&
                        Utils.SleepCheck("orchid"))
                    {
                        orchid.UseAbility(e);
                        Utils.Sleep(100, "orchid");
                    }

                    if (Shiva != null &&
                        Shiva.CanBeCasted() &&
                        me.Distance2D(e) <= 600 &&
                        !Meld &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(Shiva.Name) &&
                        !e.IsMagicImmune() && Utils.SleepCheck("Shiva"))
                    {
                        Shiva.UseAbility();
                        Utils.Sleep(100, "Shiva");
                    }
                    if (                     // ethereal
                        ethereal != null &&
                        ethereal.CanBeCasted() &&
                        me.CanCast() &&
                        !Meld &&
                        !e.IsLinkensProtected() &&
                        !e.IsMagicImmune() &&
                        !stoneModif &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(ethereal.Name) &&
                        Utils.SleepCheck("ethereal")
                        )
                    {
                        ethereal.UseAbility(e);
                        Utils.Sleep(200, "ethereal");
                    }                     // ethereal Item end


                    if (                     // Dagon
                        me.CanCast() &&
                        dagon != null &&
                        (ethereal == null ||
                         (e.Modifiers.Any(y => y.Name == "modifier_item_ethereal_blade_slow") ||
                          ethereal.Cooldown < 17)) &&
                        !e.IsLinkensProtected() &&
                        dagon.CanBeCasted() &&
                        !Meld &&
                        !e.IsMagicImmune() &&
                        !stoneModif &&
                        Utils.SleepCheck("dagon")
                        )
                    {
                        dagon.UseAbility(e);
                        Utils.Sleep(200, "dagon");
                    }                     // Dagon Item end
                    if (phase != null &&
                        phase.CanBeCasted() &&
                        !Meld &&
                        Utils.SleepCheck("phase") &&
                        Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(phase.Name) &&
                        !blink.CanBeCasted() &&
                        me.Distance2D(e) >= me.AttackRange + 20)
                    {
                        phase.UseAbility();
                        Utils.Sleep(200, "phase");
                    }
                    if (urn != null &&
                        urn.CanBeCasted() &&
                        urn.CurrentCharges > 0 &&
                        me.Distance2D(e) <= 400 &&
                        !Meld &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(urn.Name) &&
                        Utils.SleepCheck("urn"))
                    {
                        urn.UseAbility(e);
                        Utils.Sleep(240, "urn");
                    }
                    if (
                        stick != null &&
                        stick.CanBeCasted() &&
                        stick.CurrentCharges != 0 &&
                        me.Distance2D(e) <= 700 &&
                        !Meld &&
                        (me.Health <= (me.MaximumHealth * 0.5) ||
                         me.Mana <= (me.MaximumMana * 0.5)) &&
                        Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(stick.Name))
                    {
                        stick.UseAbility();
                        Utils.Sleep(200, "mana_items");
                    }
                    if (manta != null &&
                        manta.CanBeCasted() &&
                        !Meld &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(manta.Name) &&
                        me.Distance2D(e) <= Toolset.AttackRange &&
                        Utils.SleepCheck("manta"))
                    {
                        manta.UseAbility();
                        Utils.Sleep(100, "manta");
                    }
                    if (                     // Satanic
                        satanic != null &&
                        me.Health <= (me.MaximumHealth * 0.3) &&
                        satanic.CanBeCasted() &&
                        !Meld &&
                        me.Distance2D(e) <= me.AttackRange + 50 &&
                        Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(satanic.Name) &&
                        Utils.SleepCheck("satanic")
                        )
                    {
                        satanic.UseAbility();
                        Utils.Sleep(240, "satanic");
                    }                     // Satanic Item end
                    if (mail != null &&
                        mail.CanBeCasted() &&
                        (v.Count(x => x.Distance2D(me) <= 650)
                         >= (Menu.Item("Heelm").GetValue <Slider>().Value)) &&
                        !Meld &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(mail.Name) &&
                        Utils.SleepCheck("mail"))
                    {
                        mail.UseAbility();
                        Utils.Sleep(100, "mail");
                    }
                    if (bkb != null &&
                        bkb.CanBeCasted() &&
                        !Meld &&
                        (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");
                    }

                    if (Active && me.Distance2D(e) <= 1400 && e != null && e.IsAlive)
                    {
                        if (Menu.Item("orbwalk").GetValue <bool>() && me.Distance2D(e) <= 1900)
                        {
                            Orbwalking.Orbwalk(e, 0, 1600, true, true);
                        }
                    }
                    if (pike != null &&
                        pike.CanBeCasted() &&
                        me.IsAttacking() &&
                        Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(pike.Name) &&
                        (e.Health <= (e.MaximumHealth / 100 * Menu.Item("piKe").GetValue <Slider>().Value) ||
                         me.Health <= (me.MaximumHealth / 100 * Menu.Item("piKeMe").GetValue <Slider>().Value)) &&
                        (W == null ||
                         !W.CanBeCasted()) &&
                        !Meld &&
                        me.Distance2D(e) <= 450 &&
                        Utils.SleepCheck("pike"))
                    {
                        pike.UseAbility(e);
                        if (((pike != null && pike.CanBeCasted()) || IsCasted(pike)) && R.CanBeCasted() && !me.Modifiers.ToList().Exists(y => y.Name == "modifier_templar_assassin_meld") && me.Distance2D(e.NetworkPosition) <= 400 && me.CanCast() && !me.IsSilenced() && !me.IsHexed())
                        {
                            var a1 = me.Position.ToVector2().FindAngleBetween(e.Position.ToVector2(), true);
                            var p1 = new Vector3(
                                (e.Position.X + 520 * (float)Math.Cos(a1)),
                                (e.Position.Y + 520 * (float)Math.Sin(a1)),
                                100);
                            R.UseAbility(p1);
                        }
                        Utils.Sleep(100, "pike");
                    }
                    var traps = ObjectManager.GetEntities <Unit>().Where(x => x.Name == "npc_dota_templar_assassin_psionic_trap" && x.Team == me.Team &&
                                                                         x.Distance2D(me) <= 1700 && x.IsAlive && x.IsValid).ToList();
                    foreach (var q in traps)
                    {
                        if (!HurPikeActived() && e.NetworkPosition.Distance2D(q.Position) < 390 && q.Spellbook.SpellQ.CanBeCasted() && Utils.SleepCheck("traps") && !e.Modifiers.ToList().Exists(x => x.Name == "modifier_templar_assassin_trap_slow"))
                        {
                            q.Spellbook.SpellQ.UseAbility();
                            Utils.Sleep(150, "traps");
                        }
                    }
                }
                Utils.Sleep(50, "combo");
            }
        }
Ejemplo n.º 18
0
        private void Others(EventArgs args)
        {
            CastQ    = Game.IsKeyDown(Menu.Item("qKey").GetValue <KeyBind>().Key);
            CastW    = Game.IsKeyDown(Menu.Item("wKey").GetValue <KeyBind>().Key);
            CastE    = Game.IsKeyDown(Menu.Item("eKey").GetValue <KeyBind>().Key);
            _autoUlt = Menu.Item("oneult").IsActive();
            if (!Menu.Item("enabled").IsActive())
            {
                return;
            }

            if (E == null)
            {
                return;
            }

            _d = Me.Spellbook.SpellD;
            _q = Me.Spellbook.SpellQ;
            _e = Me.Spellbook.SpellE;
            _w = Me.Spellbook.SpellW;
            _r = Me.Spellbook.SpellR;


            var magnetizemod = E.Modifiers.Where(y => y.Name == "modifier_earth_spirit_magnetize").DefaultIfEmpty(null).FirstOrDefault();

            if (_autoUlt && magnetizemod != null && magnetizemod.RemainingTime <= 0.2 + Game.Ping && Me.Distance2D(E) <= _d.GetCastRange() && Utils.SleepCheck("Rem"))
            {
                _d.UseAbility(E.Position);
                Utils.Sleep(1000, "Rem");
            }
            var remnant = ObjectManager.GetEntities <Unit>().Where(x => x.ClassId == ClassId.CDOTA_Unit_Earth_Spirit_Stone && x.Team == Me.Team &&
                                                                   x.Distance2D(Me) <= 1700 && x.IsAlive && x.IsValid).ToList();
            var remnantCount = remnant.Count;

            if (CastQ && Me.Distance2D(E) <= 1400 && E != null && E.IsAlive && !Me.IsInvisible())
            {
                _wmod = Me.HasModifier("modifier_earth_spirit_rolling_boulder_caster");
                if (remnant.Count(x => x.Distance2D(Me) <= 1200) == 0)
                {
                    if (
                        _d.CanBeCasted() &&
                        _q.CanBeCasted() &&
                        !_wmod &&
                        ((_blink == null ||
                          !_blink.CanBeCasted() ||
                          !Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_blink.Name)) ||
                         (_blink != null && Me.Distance2D(E) <= 450 && _blink.CanBeCasted()))
                        )
                    {
                        if (Me.Distance2D(E) <= _e.GetCastRange() - 50 &&
                            Utils.SleepCheck("Rem"))
                        {
                            _d.UseAbility(Prediction.InFront(Me, 50));
                            Utils.Sleep(600, "Rem");
                        }
                    }
                }
                if (remnant.Count(x => x.Distance2D(Me) <= 1200) >= 1)
                {
                    for (int i = 0; i < remnantCount; ++i)
                    {
                        var r = remnant[i];
                        if (
                            _d != null && _d.CanBeCasted() &&
                            ((_q != null && _q.CanBeCasted()) ||
                             (_w != null && _w.CanBeCasted())) &&
                            !_wmod &&
                            Me.Distance2D(r) >= 350 &&
                            ((_blink == null ||
                              !_blink.CanBeCasted() ||
                              !Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_blink.Name)) ||
                             (_blink != null && Me.Distance2D(E) <= 450 && _blink.CanBeCasted()))
                            )
                        {
                            if (Me.Distance2D(E) <= _e.GetCastRange() - 50 &&
                                Utils.SleepCheck("Rem"))
                            {
                                _d.UseAbility(Prediction.InFront(Me, 50));
                                Utils.Sleep(600, "Rem");
                            }
                        }
                        if (
                            Me.Distance2D(r) >= 200 &&
                            Me.Distance2D(r) <= 350 &&
                            _q.CanBeCasted() &&
                            Utils.SleepCheck("RemMove"))
                        {
                            Me.Move(r.Position);
                            Utils.Sleep(300, "RemMove");
                        }
                        if (//Q Skill
                            r != null &&
                            _q != null &&
                            _q.CanBeCasted() &&
                            Me.CanCast() &&
                            Me.Distance2D(E) <= _e.GetCastRange() - 50 &&
                            r.Distance2D(Me) <= 210 &&
                            Utils.SleepCheck(r.Handle + "remnantQ")
                            )
                        {
                            _q.CastSkillShot(E);
                            Utils.Sleep(250, r.Handle + "remnantQ");
                        }
                    }
                }
            }
            if (CastW)
            {
                _wmod = Me.HasModifier("modifier_earth_spirit_rolling_boulder_caster");
                Task.Delay(350).ContinueWith(_ =>
                {
                    if (remnant.Count(x => x.Distance2D(Me) <= 1200) == 0)
                    {
                        if (
                            _d.CanBeCasted() &&
                            _wmod &&
                            Me.Distance2D(E) >= 600 &&
                            Utils.SleepCheck("nextAction")
                            )
                        {
                            _d.UseAbility(Prediction.InFront(Me, 170));
                            Utils.Sleep(1800 + _d.FindCastPoint(), "nextAction");
                        }
                    }
                });
                if (//W Skill
                    _w != null &&
                    _w.CanBeCasted() &&
                    Game.MousePosition.Distance2D(E) <= 500 &&
                    Me.Distance2D(E) <= _w.GetCastRange() - 200 &&
                    Utils.SleepCheck(Me.Handle + "remnantW")
                    )
                {
                    _w.CastSkillShot(E);
                    Utils.Sleep(250, Me.Handle + "remnantW");
                }
                else if (//W Skill
                    _w != null &&
                    _w.CanBeCasted() &&
                    Game.MousePosition.Distance2D(E) >= 500 &&
                    Utils.SleepCheck(Me.Handle + "remnantW")
                    )
                {
                    _w.UseAbility(Game.MousePosition);
                    Utils.Sleep(250, Me.Handle + "remnantW");
                }
                if (remnant.Count(x => x.Distance2D(Me) <= 1200) >= 1)
                {
                    for (var i = 0; i < remnantCount; ++i)
                    {
                        var i1 = i;
                        Task.Delay(350).ContinueWith(_ =>
                        {
                            var r = remnant[i1];
                            if (r != null && Me.Distance2D(r) >= 200)
                            {
                                if (
                                    _d.CanBeCasted() &&
                                    _wmod &&
                                    Me.Distance2D(E) >= 600

                                    && Utils.SleepCheck("nextAction")
                                    )
                                {
                                    _d.UseAbility(Prediction.InFront(Me, 170));
                                    Utils.Sleep(1800 + _d.FindCastPoint(), "nextAction");
                                }
                            }
                        });
                    }
                }
            }
            if (CastE && Me.Distance2D(E) <= 1400 && E != null && E.IsAlive && !Me.IsInvisible())
            {
                if (remnant.Count(x => x.Distance2D(Me) <= 1200) == 0)
                {
                    if (
                        _d.CanBeCasted() &&
                        _e.CanBeCasted()
                        )
                    {
                        if (Me.Distance2D(E) <= _e.GetCastRange() - 50 &&
                            Utils.SleepCheck("Rem"))
                        {
                            _d?.UseAbility(E.Position);
                            Utils.Sleep(1000, "Rem");
                        }
                    }
                }
                if (remnant.Count(x => x.Distance2D(Me) <= 1200) >= 1)
                {
                    for (int i = 0; i < remnantCount; ++i)
                    {
                        var r = remnant[i];

                        if (r.Distance2D(E) >= 300)
                        {
                            if (
                                _d.CanBeCasted() &&
                                (_e != null && _e.CanBeCasted()) &&
                                !r.HasModifier("modifier_earth_spirit_boulder_smash") &&
                                !r.HasModifier("modifier_earth_spirit_geomagnetic_grip")
                                )
                            {
                                if (Me.Distance2D(E) <= _e.GetCastRange() - 50 &&
                                    Utils.SleepCheck("Rem"))
                                {
                                    _d.UseAbility(E.Position);
                                    Utils.Sleep(1000, "Rem");
                                }
                            }
                        }
                        if (r != null &&
                            _e != null &&
                            _e.CanBeCasted() &&
                            Me.CanCast() &&
                            Me.Distance2D(r) < _e.GetCastRange() &&
                            Me.Distance2D(E) <= _e.GetCastRange()
                            )
                        {
                            if (//E Skill
                                E.Distance2D(r) <= 200 &&
                                Utils.SleepCheck(r.Handle + "remnantE")
                                )
                            {
                                _e.UseAbility(r.Position);
                                Utils.Sleep(220, r.Handle + "remnantE");
                            }
                            if (//E Skill
                                Me.Distance2D(E) <= 200 &&
                                E.Distance2D(r) > 0 &&
                                Me.Distance2D(r) >= E.Distance2D(r) &&
                                Utils.SleepCheck(r.Handle + "remnantE")
                                )
                            {
                                _e.UseAbility(r.Position);
                                Utils.Sleep(220, r.Handle + "remnantE");
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 19
0
        public void Combo()
        {
            Active   = Game.IsKeyDown(Menu.Item("keyBind").GetValue <KeyBind>().Key);
            CastQ    = Game.IsKeyDown(Menu.Item("qKey").GetValue <KeyBind>().Key);
            CastW    = Game.IsKeyDown(Menu.Item("wKey").GetValue <KeyBind>().Key);
            CastE    = Game.IsKeyDown(Menu.Item("eKey").GetValue <KeyBind>().Key);
            _autoUlt = Menu.Item("oneult").IsActive();
            if (!Menu.Item("enabled").IsActive())
            {
                return;
            }
            E = Toolset.ClosestToMouse(Me);
            if (E == null)
            {
                return;
            }

            _q = Me.FindSpell("earth_spirit_boulder_smash");
            _e = Me.FindSpell("earth_spirit_geomagnetic_grip");
            _w = Me.FindSpell("earth_spirit_rolling_boulder");
            Me.FindSpell("earth_spirit_petrify");
            _r = Me.FindSpell("earth_spirit_magnetize");
            _d = Me.FindSpell("earth_spirit_stone_caller");

            _wmod = Me.HasModifier("modifier_earth_spirit_rolling_boulder_caster");

            _ethereal = Me.FindItem("item_ethereal_blade");
            _urn      = Me.FindItem("item_urn_of_shadows");
            _dagon    =
                Me.Inventory.Items.FirstOrDefault(
                    item =>
                    item.Name.Contains("item_dagon"));
            _halberd = Me.FindItem("item_heavens_halberd");
            _orchid  = Me.FindItem("item_orchid") ?? Me.FindItem("item_bloodthorn");
            _abyssal = Me.FindItem("item_abyssal_blade");
            _mail    = Me.FindItem("item_blade_mail");
            _bkb     = Me.FindItem("item_black_king_bar");
            _blink   = Me.FindItem("item_blink");
            _medall  = Me.FindItem("item_medallion_of_courage") ?? Me.FindItem("item_solar_crest");
            _sheep   = E.ClassId == ClassId.CDOTA_Unit_Hero_Tidehunter ? null : Me.FindItem("item_sheepstick");
            _vail    = Me.FindItem("item_veil_of_discord");
            _cheese  = Me.FindItem("item_cheese");
            _ghost   = Me.FindItem("item_ghost");
            _atos    = Me.FindItem("item_rod_of_atos");
            _soul    = Me.FindItem("item_soul_ring");
            _arcane  = Me.FindItem("item_arcane_boots");
            _stick   = Me.FindItem("item_magic_stick") ?? Me.FindItem("item_magic_wand");
            _shiva   = Me.FindItem("item_shivas_guard");
            var stoneModif = E.Modifiers.Any(y => y.Name == "modifier_medusa_stone_gaze_stone");
            var charge     = Me.Modifiers.FirstOrDefault(y => y.Name == "modifier_earth_spirit_stone_caller_charge_counter");

            var remnant      = ObjectManager.GetEntities <Unit>().Where(x => x.ClassId == ClassId.CDOTA_Unit_Earth_Spirit_Stone && x.Team == Me.Team && x.IsValid).ToList();
            var remnantCount = remnant.Count;


            if (Active && Me.Distance2D(E) <= 1300 && E.IsAlive && !Me.IsInvisible() && Utils.SleepCheck("Combo"))
            {
                if (
                    _blink != null &&
                    Me.CanCast() &&
                    _blink.CanBeCasted() &&
                    remnant.Count(x => x.Distance2D(Me) >= 350) == 0 &&
                    Me.Distance2D(E) >= 450 &&
                    Me.Distance2D(E) <= 1150 &&
                    !_wmod &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_blink.Name) &&
                    Utils.SleepCheck("blink")
                    )
                {
                    _blink.UseAbility(E.Position);
                    Utils.Sleep(250, "blink");
                }

                if (remnant.Count(x => x.Distance2D(Me) <= 1200) == 0)
                {
                    if (
                        _d.CanBeCasted() &&
                        _q != null &&
                        _q.CanBeCasted() &&
                        !_wmod &&
                        ((_blink == null ||
                          !_blink.CanBeCasted() ||
                          !Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_blink.Name)) ||
                         (_blink != null && _blink.CanBeCasted() && Me.Distance2D(E) <= 450)) &&
                        Me.Distance2D(E) <= _e.GetCastRange() - 50 &&
                        Utils.SleepCheck("Rem")
                        )
                    {
                        _d.UseAbility(Prediction.InFront(Me, 50));
                        Utils.Sleep(500, "Rem");
                    }
                    if (
                        _d.CanBeCasted() &&
                        _q != null &&
                        !_q.CanBeCasted() &&
                        _e.CanBeCasted() &&
                        Me.Distance2D(E) <= _e.GetCastRange() &&
                        !_wmod &&
                        ((_blink == null ||
                          !_blink.CanBeCasted() ||
                          !Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_blink.Name)) ||
                         (_blink != null && _blink.CanBeCasted() && Me.Distance2D(E) <= 450)) &&
                        Utils.SleepCheck("Rem")
                        )
                    {
                        _d.UseAbility(Prediction.InFront(E, 0));
                        Utils.Sleep(500, "Rem");
                    }
                }
                if (//Q Skill
                    _w != null &&
                    (!_q.CanBeCasted() ||
                     _q == null) &&
                    !_e.CanBeCasted() &&
                    _w.CanBeCasted() &&
                    Me.Distance2D(E) <= _e.GetCastRange() - 50 &&
                    Me.CanCast() &&
                    Utils.SleepCheck(Me.Handle + "remnantW")
                    )
                {
                    _w.CastSkillShot(E);
                    Utils.Sleep(250, Me.Handle + "remnantW");
                }
                if (remnant.Count(x => x.Distance2D(Me) <= 1200) >= 1)
                {
                    for (int i = 0; i < remnantCount; ++i)
                    {
                        var r = remnant[i];
                        if (
                            _d != null && _d.CanBeCasted() &&
                            ((_q != null && _q.CanBeCasted()) ||
                             (_w != null && _w.CanBeCasted())) &&
                            !_wmod &&
                            remnant.Count(x => x.Distance2D(Me) <= 350) == 0 &&
                            ((_blink == null ||
                              !_blink.CanBeCasted() ||
                              !Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_blink.Name)) ||
                             (_blink != null && Me.Distance2D(E) <= 350 && _blink.CanBeCasted()))
                            )
                        {
                            if (Me.Distance2D(E) <= _e.GetCastRange() - 50 &&
                                Utils.SleepCheck("Rem"))
                            {
                                _d.UseAbility(Prediction.InFront(Me, 50));
                                Utils.Sleep(600, "Rem");
                            }
                        }
                        if (
                            Me.Distance2D(r) >= 210 &&
                            remnant.Count(x => x.Distance2D(Me) <= 350) >= 1 &&
                            _q.CanBeCasted() &&
                            Utils.SleepCheck("RemMove"))
                        {
                            Me.Move(r.Position);
                            Utils.Sleep(250, "RemMove");
                        }
                        if (//Q Skill
                            _q != null &&
                            _q.CanBeCasted() &&
                            Me.CanCast() &&
                            Me.Distance2D(E) <= _e.GetCastRange() - 50 &&
                            Me.Distance2D(r) <= 210 &&
                            Utils.SleepCheck(r.Handle + "remnantQ")
                            )
                        {
                            _q.CastSkillShot(E);
                            Utils.Sleep(250, r.Handle + "remnantQ");
                        }
                        else
                        if (//W Skill
                            _w != null &&
                            _w.CanBeCasted() &&
                            !_q.CanBeCasted() &&
                            Me.Distance2D(E) <= _e.GetCastRange() &&
                            Utils.SleepCheck(Me.Handle + "remnantW")
                            )
                        {
                            _w.CastSkillShot(E);
                            Utils.Sleep(250, Me.Handle + "remnantW");
                        }
                        if (r != null &&
                            _e != null &&
                            _e.CanBeCasted() &&
                            Me.CanCast() &&
                            Me.Distance2D(r) < _e.GetCastRange() &&
                            Me.Distance2D(E) <= _e.GetCastRange()
                            )
                        {
                            if (//E Skill
                                E.Distance2D(r) <= 200 &&
                                Utils.SleepCheck(r.Handle + "remnantE")
                                )
                            {
                                _e.UseAbility(r.Position);
                                Utils.Sleep(220, r.Handle + "remnantE");
                            }
                            if (//E Skill
                                Me.Distance2D(E) <= 200 &&
                                E.Distance2D(r) > 0 &&
                                Me.Distance2D(r) >= E.Distance2D(r) &&
                                Utils.SleepCheck(r.Handle + "remnantE")
                                )
                            {
                                _e.UseAbility(r.Position);
                                Utils.Sleep(220, r.Handle + "remnantE");
                            }
                        }
                    }
                }


                if (//W Skill
                    _w != null &&
                    charge.StackCount == 0 &&
                    _w.CanBeCasted() &&
                    Me.Distance2D(E) <= 800 &&
                    Me.CanCast() &&
                    Utils.SleepCheck(Me.Handle + "remnantW")
                    )
                {
                    _w.CastSkillShot(E);
                    Utils.Sleep(250, Me.Handle + "remnantW");
                }
                if ( // Hellbard
                    _halberd != null &&
                    _halberd.CanBeCasted() &&
                    Me.CanCast() &&
                    !E.IsMagicImmune() &&
                    (E.NetworkActivity == NetworkActivity.Attack ||
                     E.NetworkActivity == NetworkActivity.Crit ||
                     E.NetworkActivity == NetworkActivity.Attack2) &&
                    Utils.SleepCheck("halberd") &&
                    Me.Distance2D(E) <= 700 &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_halberd.Name)
                    )
                {
                    _halberd.UseAbility(E);
                    Utils.Sleep(250, "halberd");
                }
                if ( //Ghost
                    _ghost != null &&
                    _ghost.CanBeCasted() &&
                    Me.CanCast() &&
                    ((Me.Position.Distance2D(E) < 300 &&
                      Me.Health <= (Me.MaximumHealth * 0.7)) ||
                     Me.Health <= (Me.MaximumHealth * 0.3)) &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_ghost.Name) &&
                    Utils.SleepCheck("Ghost"))
                {
                    _ghost.UseAbility();
                    Utils.Sleep(250, "Ghost");
                }
                if ( // Arcane Boots Item
                    _arcane != null &&
                    Me.Mana <= _w.ManaCost &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_arcane.Name) &&
                    _arcane.CanBeCasted() &&
                    Utils.SleepCheck("arcane")
                    )
                {
                    _arcane.UseAbility();
                    Utils.Sleep(250, "arcane");
                } // Arcane Boots Item end
                if (
                    // cheese
                    _cheese != null &&
                    _cheese.CanBeCasted() &&
                    Me.Health <= (Me.MaximumHealth * 0.3) &&
                    Me.Distance2D(E) <= 700 &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_cheese.Name) &&
                    Utils.SleepCheck("cheese")
                    )
                {
                    _cheese.UseAbility();
                    Utils.Sleep(200, "cheese");
                } // cheese Item end
                if ( // Medall
                    _medall != null &&
                    _medall.CanBeCasted() &&
                    Utils.SleepCheck("Medall") &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_medall.Name) &&
                    Me.Distance2D(E) <= 700
                    )
                {
                    _medall.UseAbility(E);
                    Utils.Sleep(250, "Medall");
                } // Medall Item end

                if ( //R Skill
                    _r != null &&
                    _r.CanBeCasted() &&
                    Me.CanCast() &&
                    Me.Distance2D(E) <= 200 &&
                    Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(_r.Name) &&
                    Utils.SleepCheck("R")
                    )
                {
                    _r.UseAbility();
                    Utils.Sleep(200, "R");
                } // R Skill end
                if ( // sheep
                    _sheep != null &&
                    _sheep.CanBeCasted() &&
                    Me.CanCast() &&
                    !E.IsLinkensProtected() &&
                    !E.IsMagicImmune() &&
                    Me.Distance2D(E) <= 1400 &&
                    !stoneModif &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_sheep.Name) &&
                    Utils.SleepCheck("sheep")
                    )
                {
                    _sheep.UseAbility(E);
                    Utils.Sleep(250, "sheep");
                } // sheep Item end
                if ( // Abyssal Blade
                    _abyssal != null &&
                    _abyssal.CanBeCasted() &&
                    Me.CanCast() &&
                    !E.IsStunned() &&
                    !E.IsHexed() &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_abyssal.Name) &&
                    Utils.SleepCheck("abyssal") &&
                    Me.Distance2D(E) <= 400
                    )
                {
                    _abyssal.UseAbility(E);
                    Utils.Sleep(250, "abyssal");
                } // Abyssal Item end
                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");
                }

                if (_shiva != null && _shiva.CanBeCasted() && Me.Distance2D(E) <= 600 &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_shiva.Name) &&
                    !E.IsMagicImmune() && Utils.SleepCheck("Shiva"))
                {
                    _shiva.UseAbility();
                    Utils.Sleep(100, "Shiva");
                }
                if ( // ethereal
                    _ethereal != null &&
                    _ethereal.CanBeCasted() &&
                    Me.CanCast() &&
                    !E.IsLinkensProtected() &&
                    !E.IsMagicImmune() &&
                    !stoneModif &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_ethereal.Name) &&
                    Utils.SleepCheck("ethereal")
                    )
                {
                    _ethereal.UseAbility(E);
                    Utils.Sleep(200, "ethereal");
                } // ethereal Item end

                if ( // SoulRing Item
                    _soul != null &&
                    _soul.CanBeCasted() &&
                    Me.CanCast() &&
                    Me.Health >= (Me.MaximumHealth * 0.5) &&
                    Me.Mana <= _r.ManaCost &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_soul.Name)
                    )
                {
                    _soul.UseAbility();
                } // SoulRing Item end
                if (// Dagon
                    Me.CanCast() &&
                    _dagon != null &&
                    (_ethereal == null ||
                     (E.HasModifier("modifier_item_ethereal_blade_slow") ||
                      _ethereal.Cooldown < 17)) &&
                    !E.IsLinkensProtected() &&
                    _dagon.CanBeCasted() &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled("item_dagon") &&
                    !E.IsMagicImmune() &&
                    Utils.SleepCheck("dagon")
                    )
                {
                    _dagon.UseAbility(E);
                    Utils.Sleep(200, "dagon");
                } // Dagon Item end
                if ( // atos Blade
                    _atos != null &&
                    _atos.CanBeCasted() &&
                    Me.CanCast() &&
                    !E.IsLinkensProtected() &&
                    !E.IsMagicImmune() &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_atos.Name) &&
                    Me.Distance2D(E) <= 2000 &&
                    Utils.SleepCheck("atos")
                    )
                {
                    _atos.UseAbility(E);

                    Utils.Sleep(250, "atos");
                } // atos Item end
                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");
                }
                if ( // vail
                    _vail != null &&
                    _vail.CanBeCasted() &&
                    Me.CanCast() &&
                    !E.IsMagicImmune() &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_vail.Name) &&
                    Me.Distance2D(E) <= 1500 &&
                    Utils.SleepCheck("vail")
                    )
                {
                    _vail.UseAbility(E.Position);
                    Utils.Sleep(250, "vail");
                } // orchid Item end
                if (
                    _stick != null &&
                    _stick.CanBeCasted() &&
                    _stick.CurrentCharges != 0 &&
                    Me.Distance2D(E) <= 700 &&
                    (Me.Health <= (Me.MaximumHealth * 0.5) ||
                     Me.Mana <= (Me.MaximumMana * 0.5)) &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_stick.Name))
                {
                    _stick.UseAbility();
                    Utils.Sleep(200, "mana_items");
                }

                var v =
                    ObjectManager.GetEntities <Hero>()
                    .Where(x => x.Team != Me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && x.Distance2D(Me) <= 700)
                    .ToList();
                if (_mail != null && _mail.CanBeCasted() && (v.Count(x => x.Distance2D(Me) <= 650) >=
                                                             (Menu.Item("Heelm").GetValue <Slider>().Value)) &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_mail.Name) && Utils.SleepCheck("mail"))
                {
                    _mail.UseAbility();
                    Utils.Sleep(100, "mail");
                }
                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");
                }
                Utils.Sleep(50, "Combo");
            }
        }
Ejemplo n.º 20
0
        /// <summary>
        ///     The orbwalk.
        /// </summary>
        /// <param name="target">
        ///     The target.
        /// </param>
        /// <param name="movePosition">
        ///     The move Position.
        /// </param>
        /// <param name="bonusWindupMs">
        ///     The bonus windup ms.
        /// </param>
        /// <param name="bonusRange">
        ///     The bonus range.
        /// </param>
        /// <param name="attackmodifiers">
        ///     The attackmodifiers.
        /// </param>
        /// <param name="followTarget">
        ///     The follow target.
        /// </param>
        public void OrbwalkOn(
            Unit target,
            Vector3 movePosition,
            float bonusWindupMs  = 0,
            float bonusRange     = 0,
            bool attackmodifiers = true,
            bool followTarget    = false)
        {
            if (this.Unit == null || !this.Unit.IsValid)
            {
                return;
            }

            var targetHull = 0f;

            if (target != null)
            {
                targetHull = target.HullRadius;
            }

            float distance = 0;

            if (target != null)
            {
                var pos = Prediction.InFront(
                    this.Unit,
                    (float)(Game.Ping / 1000 + this.Unit.GetTurnTime(target.Position) * this.Unit.MovementSpeed));
                distance = pos.Distance2D(target) - this.Unit.Distance2D(target);
            }

            var isValid      = target != null && target.IsValid && target.IsAlive && target.IsVisible;
            var isAttackable = target != null && target.IsValid && !target.IsInvul() && !target.IsAttackImmune() &&
                               !target.HasModifiers(
                new[] { "modifier_ghost_state", "modifier_item_ethereal_blade_slow" },
                false) &&
                               target.Distance2D(this.Unit)
                               <= this.Unit.GetAttackRange() + this.Unit.HullRadius + 50 + targetHull + bonusRange
                               + Math.Max(distance, 0);

            if ((isValid && isAttackable) ||
                (!isAttackable && target != null && target.IsValid && this.Unit.IsAttacking() &&
                 this.Unit.GetTurnTime(target.Position) < 0.1))
            {
                var canAttack = !this.IsAttackOnCoolDown(target, bonusWindupMs) && this.Unit.CanAttack();
                if (canAttack && !this.attackSleeper.Sleeping && (!this.hero || Utils.SleepCheck("Orbwalk.Attack")))
                {
                    this.attacker.Attack(target, attackmodifiers);
                    this.AttackOrder();
                    this.attackSleeper.Sleep(
                        (float)
                        (UnitDatabase.GetAttackPoint(this.Unit) * 1000 + this.Unit.GetTurnTime(target) * 1000
                         + Game.Ping + 100));
                    this.moveSleeper.Sleep(
                        (float)
                        (UnitDatabase.GetAttackPoint(this.Unit) * 1000 + this.Unit.GetTurnTime(target) * 1000 + 50));
                    if (!this.hero)
                    {
                        return;
                    }

                    Utils.Sleep(
                        UnitDatabase.GetAttackPoint(this.Unit) * 1000 + this.Unit.GetTurnTime(target) * 1000 + Game.Ping
                        + 100,
                        "Orbwalk.Attack");
                    Utils.Sleep(
                        UnitDatabase.GetAttackPoint(this.Unit) * 1000 + this.Unit.GetTurnTime(target) * 1000 + 50,
                        "Orbwalk.Move");
                    return;
                }

                if (canAttack && !this.attackSleeper2.Sleeping)
                {
                    this.attacker.Attack(target, attackmodifiers);
                    this.AttackOrder();
                    this.attackSleeper2.Sleep(100);
                    return;
                }
            }

            var userdelay = this.setUserDelayManually ? this.UserDelay : UserDelay;
            var canCancel = (this.CanCancelAttack(userdelay) && this.IsAttackOnCoolDown(target, bonusWindupMs)) ||
                            ((!isValid || !isAttackable) &&
                             (!this.Unit.IsAttacking() || this.CanCancelAttack(userdelay)));

            if (!canCancel || this.moveSleeper.Sleeping || this.attackSleeper.Sleeping ||
                (this.hero && (!Utils.SleepCheck("Orbwalk.Move") || !Utils.SleepCheck("Orbwalk.Attack"))))
            {
                return;
            }

            if (followTarget && target != null)
            {
                var pos = target.NetworkActivity == NetworkActivity.Move
                              ? target.Predict(Game.Ping + 100)
                              : target.Position;
                this.Unit.Move(pos);
                this.customMovePosition = true;
                this.lastMovePosition   = pos;
            }
            else
            {
                this.Unit.Move(movePosition);
                if (movePosition != Game.MousePosition)
                {
                    this.customMovePosition = true;
                    this.lastMovePosition   = movePosition;
                }
                else
                {
                    this.customMovePosition = false;
                }
            }

            this.moveSleeper.Sleep(100);
        }
Ejemplo n.º 21
0
 /// <summary>
 ///     The predicted position.
 /// </summary>
 /// <param name="unit">
 ///     The unit.
 /// </param>
 /// <param name="bonusDelay">
 ///     The bonus delay.
 /// </param>
 /// <returns>
 ///     The <see cref="Vector3" />.
 /// </returns>
 public static Vector3 PredictedPosition(this Unit unit, double bonusDelay = 0)
 {
     return(unit.NetworkActivity == NetworkActivity.Move
                ? Prediction.InFront(unit, (float)(unit.MovementSpeed * ((Game.Ping / 1000) + bonusDelay)))
                : unit.Position);
 }
Ejemplo n.º 22
0
        public static void Game_OnUpdate(EventArgs args)
        {
            me = ObjectManager.LocalHero;


            if (!Game.IsInGame || me.ClassID != ClassID.CDOTA_Unit_Hero_EarthSpirit || Game.IsWatchingGame)
            {
                return;
            }

            Active  = Game.IsKeyDown(menu.Item("keyBind").GetValue <KeyBind>().Key);
            qKey    = Game.IsKeyDown(menu.Item("qKey").GetValue <KeyBind>().Key);
            wKey    = Game.IsKeyDown(menu.Item("wKey").GetValue <KeyBind>().Key);
            eKey    = Game.IsKeyDown(menu.Item("eKey").GetValue <KeyBind>().Key);
            AutoUlt = menu.Item("oneult").IsActive();
            if (!menu.Item("enabled").IsActive())
            {
                return;
            }

            e = me.ClosestToMouseTarget(1300);
            if (e == null)
            {
                return;
            }

            /*D = me.FindSpell("earth_spirit_stone_caller");
             *          Q = me.FindSpell("earth_spirit_boulder_smash");
             *          E = me.FindSpell("earth_spirit_geomagnetic_grip");
             *          W = me.FindSpell("earth_spirit_rolling_boulder");
             *          F = me.FindSpell("earth_spirit_petrify");
             *          R = me.FindSpell("earth_spirit_magnetize");*/
            D = me.Spellbook.SpellD;
            Q = me.Spellbook.SpellQ;
            E = me.Spellbook.SpellE;
            W = me.Spellbook.SpellW;
            F = me.Spellbook.SpellF;
            R = me.Spellbook.SpellR;


            var remnant = ObjectManager.GetEntities <Unit>().Where(x => x.ClassID == ClassID.CDOTA_Unit_Earth_Spirit_Stone && x.Team == me.Team &&
                                                                   x.Distance2D(me) <= 1300 && x.IsValid).ToList();
            var remnantCount = remnant.Count;


            if (Active && me.Distance2D(e) <= 1300 && e.IsAlive && !me.IsInvisible() && Utils.SleepCheck("Combo"))
            {
                if (remnantCount <= 0)
                {
                    if (
                        D.CanBeCasted() &&
                        Q != null &&
                        Q.CanBeCasted() &&
                        !Wmod &&
                        ((blink == null ||
                          !blink.CanBeCasted() ||
                          !menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(blink.Name)) ||
                         (blink != null && blink.CanBeCasted() && me.Distance2D(e) <= 450))
                        )
                    {
                        if (me.Distance2D(e) <= E.CastRange - 50 &&
                            Utils.SleepCheck("Rem"))
                        {
                            if (me.NetworkActivity == NetworkActivity.Move)
                            {
                                me.Stop();
                            }
                            else
                            {
                                D.UseAbility(Prediction.InFront(me, 100));
                            }
                            Utils.Sleep(600, "Rem");
                        }
                    }
                    else if (
                        D.CanBeCasted() &&
                        Q != null &&
                        !Q.CanBeCasted() &&
                        E.CanBeCasted() &&
                        !Wmod &&
                        ((blink == null ||
                          !blink.CanBeCasted() ||
                          !menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(blink.Name)) ||
                         (blink != null && blink.CanBeCasted() && me.Distance2D(e) <= 450))
                        )
                    {
                        if (me.Distance2D(e) <= E.CastRange - 50 &&
                            Utils.SleepCheck("Rem"))
                        {
                            if (me.NetworkActivity == NetworkActivity.Move)
                            {
                                me.Stop();
                            }
                            else
                            {
                                D.UseAbility(Prediction.InFront(e, 0));
                            }
                            Utils.Sleep(600, "Rem");
                        }
                    }
                }
                for (int i = 0; i < remnantCount; ++i)
                {
                    var r = remnant[i];

                    if (remnantCount >= 1)
                    {
                        if (
                            D != null && D.CanBeCasted() &&
                            ((Q != null && Q.CanBeCasted()) ||
                             (W != null && W.CanBeCasted())) &&
                            !Wmod &&
                            me.Distance2D(r) >= 350 &&
                            ((blink == null ||
                              !blink.CanBeCasted() ||
                              !menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(blink.Name)) ||
                             (blink != null && me.Distance2D(e) <= 350 && blink.CanBeCasted()))
                            )
                        {
                            if (me.Distance2D(e) <= E.CastRange - 50 &&
                                Utils.SleepCheck("Rem"))
                            {
                                if (me.NetworkActivity == NetworkActivity.Move)
                                {
                                    me.Stop();
                                }
                                else
                                {
                                    D.UseAbility(Prediction.InFront(me, 100));
                                }
                                Utils.Sleep(600, "Rem");
                            }
                        }
                        if (
                            me.Distance2D(r) >= 1500 &&
                            me.Distance2D(r) <= 350 &&
                            Q.CanBeCasted() &&
                            Utils.SleepCheck("RemMove"))
                        {
                            me.Move(r.Position);
                            Utils.Sleep(250, "RemMove");
                        }
                        if (//Q Skill
                            W != null &&
                            (!Q.CanBeCasted() ||
                             Q == null) &&
                            !E.CanBeCasted() &&
                            W.CanBeCasted() &&
                            me.Distance2D(e) <= E.CastRange - 50 &&
                            me.CanCast() &&
                            Utils.SleepCheck(me.Handle + "remnantW")
                            )
                        {
                            W.CastSkillShot(e);
                            Utils.Sleep(250, me.Handle + "remnantW");
                        }
                        if (//Q Skill
                            Q != null &&
                            Q.CanBeCasted() &&
                            me.CanCast() &&
                            me.Distance2D(e) <= E.CastRange - 50 &&
                            me.Distance2D(r) <= 210 &&
                            Utils.SleepCheck(r.Handle + "remnantQ")
                            )
                        {
                            Q.CastSkillShot(e);
                            Utils.Sleep(250, r.Handle + "remnantQ");
                        }
                        else
                        if (//W Skill
                            W != null &&
                            W.CanBeCasted() &&
                            !Q.CanBeCasted() &&
                            me.Distance2D(e) <= E.CastRange &&
                            Utils.SleepCheck(me.Handle + "remnantW")
                            )
                        {
                            W.CastSkillShot(e);
                            Utils.Sleep(250, me.Handle + "remnantW");
                        }
                        if (r != null &&
                            E != null &&
                            E.CanBeCasted() &&
                            me.CanCast() &&
                            me.Distance2D(r) < E.CastRange &&
                            me.Distance2D(e) <= E.CastRange
                            )
                        {
                            if (//E Skill
                                e.Distance2D(r) <= 200 &&
                                Utils.SleepCheck(r.Handle + "remnantE")
                                )
                            {
                                E.UseAbility(r.Position);
                                Utils.Sleep(220, r.Handle + "remnantE");
                            }
                            if (//E Skill
                                me.Distance2D(e) <= 200 &&
                                e.Distance2D(r) > 0 &&
                                me.Distance2D(r) >= e.Distance2D(r) &&
                                Utils.SleepCheck(r.Handle + "remnantE")
                                )
                            {
                                E.UseAbility(r.Position);
                                Utils.Sleep(220, r.Handle + "remnantE");
                            }
                        }
                        if (
                            blink != null &&
                            r != null &&
                            me.CanCast() &&
                            blink.CanBeCasted() &&
                            me.Distance2D(e) >= 450 &&
                            me.Distance2D(e) <= 1150 &&
                            r.Distance2D(me) >= 300 &&
                            !Wmod &&
                            menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(blink.Name) &&
                            Utils.SleepCheck("blink")
                            )
                        {
                            blink.UseAbility(e.Position);
                            Utils.Sleep(250, "blink");
                        }
                    }
                }
                Utils.Sleep(50, "Combo");
            }
        }
Ejemplo n.º 23
0
        private static void CheckBombDamageAndDetonate(
            Unit hero,
            Vector3 pos,
            IEnumerable <KeyValuePair <Unit, float> > bombs)
        {
            if (!Utils.SleepCheck(hero.ClassID.ToString()))
            {
                return;
            }
            if (hero.Modifiers.Any(y => y.Name == "modifier_abaddon_borrowed_time"))
            {
                return;
            }
            var pos1          = pos;
            var turning       = !Prediction.IsTurning(hero);
            var possibleBombs =
                bombs.Where(
                    x =>
                    x.Key.Distance2D(pos1) <= remoteMinesRadius && x.Key.Distance2D(hero.Position) <= remoteMinesRadius &&
                    ((remoteMinesRadius - x.Key.Distance2D(pos1)) / hero.MovementSpeed > (Game.Ping / 1000) ||
                     hero.NetworkActivity == NetworkActivity.Idle) &&
                    (!turning || x.Key.Distance2D(hero) < remoteMinesRadius - 20 ||
                     x.Key.Distance2D(pos1) - 10 < x.Key.Distance2D(hero)));
            var detonatableBombs = new Dictionary <Unit, Ability>();
            var dmg = 0f;

            foreach (var bomb in possibleBombs)
            {
                if (dmg > 0)
                {
                    var takenDmg = hero.DamageTaken(dmg, DamageType.Magical, me);
                    if (takenDmg >= hero.Health)
                    {
                        break;
                    }
                }
                detonatableBombs[bomb.Key] = bomb.Key.Spellbook.Spell1;
                dmg += bomb.Value;
            }
            dmg = hero.DamageTaken(dmg, DamageType.Magical, me);
            if (dmg < hero.Health)
            {
                return;
            }
            if (hero.NetworkActivity == NetworkActivity.Move)
            {
                pos = Prediction.InFront(hero, ((Game.Ping / 1000) * hero.MovementSpeed));
                var stop = false;
                foreach (var mine in
                         detonatableBombs.Where(data => Utils.SleepCheck(data.Value.Handle.ToString()))
                         .Select(data => data.Key)
                         .Where(
                             mine =>
                             mine.Distance2D(pos) > remoteMinesRadius ||
                             ((remoteMinesRadius - mine.Distance2D(pos)) / hero.MovementSpeed
                              < (Game.Ping / 1000 + detonatableBombs.Count * 0.002) &&
                              hero.NetworkActivity != NetworkActivity.Idle)))
                {
                    stop = true;
                }
                if (stop)
                {
                    return;
                }
            }
            foreach (var data in detonatableBombs.Where(data => Utils.SleepCheck(data.Value.Handle.ToString())))
            {
                data.Value.UseAbility();
                Utils.Sleep(250, data.Value.Handle.ToString());
            }
            Utils.Sleep(1000, hero.ClassID.ToString());
        }
Ejemplo n.º 24
0
        public void Combo()
        {
            me = ObjectManager.LocalHero;

            if (!Menu.Item("enabled").IsActive())
            {
                return;
            }
            Active = Game.IsKeyDown(Menu.Item("keyBind").GetValue <KeyBind>().Key);
            e      = Toolset.ClosestToMouse(me);
            if (e == null)
            {
                return;
            }

            Q        = me.Spellbook.SpellQ;
            W        = me.Spellbook.SpellW;
            R        = me.Spellbook.SpellR;
            Shiva    = me.FindItem("item_shivas_guard");
            mom      = me.FindItem("item_mask_of_madness");
            diff     = me.FindItem("item_diffusal_blade") ?? me.FindItem("item_diffusal_blade_2");
            urn      = me.FindItem("item_urn_of_shadows");
            dagon    = me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon"));
            mjollnir = me.FindItem("item_mjollnir");
            orchid   = me.FindItem("item_orchid") ?? me.FindItem("item_bloodthorn");
            abyssal  = me.FindItem("item_abyssal_blade");
            mail     = me.FindItem("item_blade_mail");
            bkb      = me.FindItem("item_black_king_bar");
            satanic  = me.FindItem("item_satanic");
            blink    = me.FindItem("item_blink");
            medall   = me.FindItem("item_medallion_of_courage") ?? me.FindItem("item_solar_crest");

            var stoneModif = e.HasModifier("modifier_medusa_stone_gaze_stone");

            var v =
                ObjectManager.GetEntities <Hero>()
                .Where(x => x.Team != me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && !x.IsMagicImmune())
                .ToList();

            if (R.IsInAbilityPhase || me.HasModifier("modifier_riki_tricks_of_the_trade_phase"))
            {
                return;
            }
            if (Active && e.IsAlive)
            {
                if (Menu.Item("orbwalk").GetValue <bool>() && me.Distance2D(e) <= 1900)
                {
                    Orbwalking.Orbwalk(e, 0, 1600, true, true);
                }
            }
            if (Active && me.Distance2D(e) <= 1400 && e.IsAlive && (!me.IsInvisible() || me.IsVisibleToEnemies || e.Health <= (e.MaximumHealth * 0.7)))
            {
                if (stoneModif)
                {
                    return;
                }
                if (
                    Q != null &&
                    Q.CanBeCasted() &&
                    me.Distance2D(e) <= 300 &&
                    Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(Q.Name) &&
                    Utils.SleepCheck("Q")
                    )
                {
                    Q.UseAbility(Prediction.InFront(e, 80));
                    Utils.Sleep(200, "Q");
                }
                if (
                    W != null && W.CanBeCasted() &&
                    me.Distance2D(e) <= W.GetCastRange() &&
                    Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(W.Name) &&
                    Utils.SleepCheck("W")
                    )
                {
                    W.UseAbility(e);
                    Utils.Sleep(200, "W");
                }
                if (
                    blink != null &&
                    me.CanCast() &&
                    blink.CanBeCasted() &&
                    me.Distance2D(e) < 1180 &&
                    me.Distance2D(e) > 300 &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(blink.Name) &&
                    Utils.SleepCheck("blink")
                    )
                {
                    blink.UseAbility(e.Position);
                    Utils.Sleep(250, "blink");
                }

                if (         // Abyssal Blade
                    abyssal != null &&
                    abyssal.CanBeCasted() &&
                    me.CanCast() &&
                    !e.IsStunned() &&
                    !e.IsHexed() &&
                    Utils.SleepCheck("abyssal") &&
                    me.Distance2D(e) <= 400
                    )
                {
                    abyssal.UseAbility(e);
                    Utils.Sleep(250, "abyssal");
                }                 // Abyssal Item end
                if (diff != null &&
                    diff.CanBeCasted() &&
                    diff.CurrentCharges > 0 &&
                    me.Distance2D(e) <= 400 &&
                    !e.HasModifier("modifier_item_diffusal_blade_slow") &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(diff.Name) &&
                    Utils.SleepCheck("diff"))
                {
                    diff.UseAbility(e);
                    Utils.Sleep(4000, "diff");
                }
                if (                 // Mjollnir
                    mjollnir != null &&
                    mjollnir.CanBeCasted() &&
                    me.CanCast() &&
                    !e.IsMagicImmune() &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(mjollnir.Name) &&
                    Utils.SleepCheck("mjollnir") &&
                    me.Distance2D(e) <= 900
                    )
                {
                    mjollnir.UseAbility(me);
                    Utils.Sleep(250, "mjollnir");
                }         // Mjollnir Item end
                if (      // Medall
                    medall != null &&
                    medall.CanBeCasted() &&
                    Utils.SleepCheck("Medall") &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(medall.Name) &&
                    me.Distance2D(e) <= 700
                    )
                {
                    medall.UseAbility(e);
                    Utils.Sleep(250, "Medall");
                }         // Medall Item end

                if (      // MOM
                    mom != null &&
                    mom.CanBeCasted() &&
                    me.CanCast() &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(mom.Name) &&
                    Utils.SleepCheck("mom") &&
                    me.Distance2D(e) <= 700
                    )
                {
                    mom.UseAbility();
                    Utils.Sleep(250, "mom");
                }
                if (orchid != null && orchid.CanBeCasted() && me.Distance2D(e) <= 300 &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(orchid.Name) && Utils.SleepCheck("orchid"))
                {
                    orchid.UseAbility(e);
                    Utils.Sleep(100, "orchid");
                }

                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");
                }

                if (         // Dagon
                    me.CanCast() &&
                    dagon != null &&
                    !e.IsLinkensProtected() &&
                    dagon.CanBeCasted() &&
                    !e.IsMagicImmune() &&
                    !stoneModif &&
                    Utils.SleepCheck("dagon")
                    )
                {
                    dagon.UseAbility(e);
                    Utils.Sleep(200, "dagon");
                }         // Dagon Item end


                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");
                }
                if (         // Satanic
                    satanic != null &&
                    me.Health <= (me.MaximumHealth * 0.3) &&
                    satanic.CanBeCasted() &&
                    me.Distance2D(e) <= me.AttackRange + 50 &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(satanic.Name) &&
                    Utils.SleepCheck("satanic")
                    )
                {
                    satanic.UseAbility();
                    Utils.Sleep(240, "satanic");
                }         // Satanic Item end
                if (mail != null && mail.CanBeCasted() &&
                    ((v.Count(x => x.Distance2D(me) <= 650) >= (Menu.Item("Heelm").GetValue <Slider>().Value)) ||
                     me.HasModifier("modifier_skywrath_mystic_flare_aura_effect")) &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(mail.Name) && Utils.SleepCheck("mail"))
                {
                    mail.UseAbility();
                    Utils.Sleep(100, "mail");
                }
                if (bkb != null && bkb.CanBeCasted() && ((v.Count(x => x.Distance2D(me) <= 650) >=
                                                          (Menu.Item("Heel").GetValue <Slider>().Value)) ||
                                                         me.HasModifier("modifier_skywrath_mystic_flare_aura_effect")) &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(bkb.Name) && Utils.SleepCheck("bkb"))
                {
                    bkb.UseAbility();
                    Utils.Sleep(100, "bkb");
                }
                if (R != null && R.CanBeCasted() &&
                    (v.Count(x => x.Distance2D(me) <= 500)
                     >= (Menu.Item("Ult").GetValue <Slider>().Value)) &&
                    Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(R.Name) &&
                    Utils.SleepCheck("R"))
                {
                    R.UseAbility();
                    Utils.Sleep(100, "R");
                }
            }
        }
Ejemplo n.º 25
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (!loaded)
            {
                me = ObjectMgr.LocalHero;
                if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Techies)
                {
                    return;
                }
                loaded        = true;
                remoteMines   = me.Spellbook.SpellR;
                suicideAttack = me.Spellbook.SpellE;
                landMines     = me.Spellbook.SpellQ;
                forceStaff    = null;
                //enemyHeroes = null;
                players          = null;
                remoteMinesDb    = new Dictionary <Unit, float>();
                heroTopPanel     = new Dictionary <ClassID, double[]>();
                landMinesHeroDmg = new Dictionary <ClassID, double>();
                suicideHeroDmg   = new Dictionary <ClassID, float>();
                enabledHeroes    = new Dictionary <ClassID, bool>();
                var screenSize = new Vector2(Drawing.Width, Drawing.Height);
                monitor = screenSize.X / 1280;
                if (me.AghanimState())
                {
                    var firstOrDefault = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "damage_scepter");
                    if (firstOrDefault != null)
                    {
                        remoteMinesDmg = firstOrDefault.GetValue(remoteMines.Level - 1);
                    }
                }
                else
                {
                    var firstOrDefault = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "damage");
                    if (firstOrDefault != null)
                    {
                        remoteMinesDmg = firstOrDefault.GetValue(remoteMines.Level - 1);
                    }
                }
                foreach (var bomb in
                         ObjectMgr.GetEntities <Unit>()
                         .Where(
                             x =>
                             x.ClassID == ClassID.CDOTA_NPC_TechiesMines && x.Spellbook.Spell1 != null &&
                             x.Spellbook.Spell1.IsValid && x.Spellbook.Spell1.CanBeCasted() && x.IsAlive)
                         .Where(bomb => !remoteMinesDb.ContainsKey(bomb)))
                {
                    remoteMinesDb.Add(bomb, remoteMinesDmg);
                }
                //enemyHeroes =
                //    ObjectMgr.GetEntities<Hero>()
                //        .Where(x => x != null && x.IsValid && x.Team == me.GetEnemyTeam() && !x.IsIllusion);
                players =
                    ObjectMgr.GetEntities <Player>()
                    .Where(x => x != null && x.Hero != null && x.Hero.Team == me.GetEnemyTeam());
                Console.WriteLine("#Techies: Loaded!");
            }
            if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Techies)
            {
                loaded = false;
                Console.WriteLine("#Techies: Unloaded!");
                return;
            }

            if (Game.IsPaused)
            {
                return;
            }

            if (forceStaff == null)
            {
                forceStaff = me.Inventory.Items.FirstOrDefault(x => x.ClassID == ClassID.CDOTA_Item_ForceStaff);
            }

            var suicideLevel = suicideAttack.Level;

            if (suicideAttackLevel != suicideLevel)
            {
                var firstOrDefault = suicideAttack.AbilityData.FirstOrDefault(x => x.Name == "damage");
                if (firstOrDefault != null)
                {
                    suicideAttackDmg = firstOrDefault.GetValue(suicideLevel - 1);
                }
                var abilityData = suicideAttack.AbilityData.FirstOrDefault(x => x.Name == "small_radius");
                if (abilityData != null)
                {
                    suicideAttackRadius = abilityData.Value;
                }
                suicideAttackLevel = suicideLevel;
            }

            var bombLevel = remoteMines.Level;

            if (remoteMinesLevel != bombLevel)
            {
                if (me.AghanimState())
                {
                    var firstOrDefault = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "damage_scepter");
                    if (firstOrDefault != null)
                    {
                        remoteMinesDmg = firstOrDefault.GetValue(bombLevel - 1);
                    }
                }
                else
                {
                    var firstOrDefault = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "damage");
                    if (firstOrDefault != null)
                    {
                        remoteMinesDmg = firstOrDefault.GetValue(bombLevel - 1);
                    }
                }
                var abilityData = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "radius");
                if (abilityData != null)
                {
                    remoteMinesRadius = abilityData.Value + 20;
                }
                remoteMinesLevel = bombLevel;
            }

            var landMineslvl = landMines.Level;

            if (landMinesLevel != landMineslvl)
            {
                var firstOrDefault = landMines.AbilityData.FirstOrDefault(x => x.Name == "damage");
                if (firstOrDefault != null)
                {
                    landMinesDmg = firstOrDefault.GetValue(landMineslvl - 1);
                }
                landMinesLevel = landMineslvl;
            }

            if (!aghanims && me.AghanimState())
            {
                var firstOrDefault = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "damage_scepter");
                if (firstOrDefault != null)
                {
                    remoteMinesDmg = firstOrDefault.GetValue(bombLevel - 1);
                }
                aghanims = true;
            }

            var bombs =
                remoteMinesDb.Where(
                    x =>
                    x.Key != null && x.Key.IsValid && x.Key.Spellbook.Spell1 != null &&
                    x.Key.Spellbook.Spell1.CanBeCasted() && x.Key.IsAlive);
            var bombsArray = bombs as KeyValuePair <Unit, float>[] ?? bombs.ToArray();
            var eHeroes    =
                ObjectMgr.GetEntities <Hero>()
                .Where(
                    x =>
                    x != null && x.IsValid && !x.IsIllusion && x.Team == me.GetEnemyTeam() && x.IsAlive &&
                    x.IsVisible && !x.IsMagicImmune() &&
                    x.Modifiers.All(y => y.Name != "modifier_abaddon_borrowed_time") &&
                    Utils.SleepCheck(x.ClassID.ToString()));

            try
            {
                foreach (var hero in
                         eHeroes)
                {
                    bool enabled;
                    if (!enabledHeroes.TryGetValue(hero.ClassID, out enabled) || !enabled)
                    {
                        continue;
                    }
                    var heroDistance = me.Distance2D(hero);
                    var nearbyBombs  = bombsArray.Any(x => x.Key.Distance2D(hero) <= remoteMinesRadius + 500);
                    if (nearbyBombs)
                    {
                        CheckBombDamageAndDetonate(hero, bombsArray);
                    }
                    if (heroDistance < 400 && suicideAttackLevel > 0 && me.IsAlive && (Case == 2 || Case == 3))
                    {
                        SuicideKillSteal(hero);
                    }
                    if (forceStaff == null || !(heroDistance <= forceStaff.CastRange) || !Utils.SleepCheck("forcestaff") ||
                        bombsArray.Any(x => x.Key.Distance2D(hero) <= remoteMinesRadius) ||
                        Prediction.IsTurning(hero) || !forceStaff.CanBeCasted())
                    {
                        continue;
                    }

                    var data =
                        Prediction.TrackTable.ToArray()
                        .FirstOrDefault(
                            unitData => unitData.UnitName == hero.Name || unitData.UnitClassID == hero.ClassID);
                    if (data == null)
                    {
                        continue;
                    }
                    var turnTime      = me.GetTurnTime(hero);
                    var forcePosition = hero.Position;
                    if (hero.NetworkActivity == NetworkActivity.Move)
                    {
                        forcePosition = Prediction.InFront(
                            hero,
                            (float)((turnTime + Game.Ping / 1000) * hero.MovementSpeed));
                    }
                    forcePosition +=
                        VectorExtensions.FromPolarCoordinates(1f, hero.NetworkRotationRad + data.RotSpeed).ToVector3()
                        * 600;
                    var possibleBombs = bombsArray.Any(x => x.Key.Distance2D(forcePosition) <= (remoteMinesRadius - 75));
                    if (!possibleBombs)
                    {
                        continue;
                    }
                    var dmg = CheckBombDamage(hero, forcePosition, bombsArray);
                    if (!(dmg >= hero.Health))
                    {
                        continue;
                    }
                    forceStaff.UseAbility(hero);
                    Utils.Sleep(250, "forcestaff");
                }
            }
            catch (Exception)
            {
                //aa
            }
            if (!(Case == 2 || Case == 4))
            {
                return;
            }
            var creeps =
                ObjectMgr.GetEntities <Creep>()
                .Where(
                    x =>
                    (x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane || x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege) &&
                    x.IsAlive && x.IsVisible && x.IsSpawned && x.Team == me.GetEnemyTeam());

            var enumerable = creeps as Creep[] ?? creeps.ToArray();

            foreach (var data in (from creep in enumerable
                                  let nearbyBombs =
                                      bombsArray.Any(x => x.Key.Distance2D(creep) <= remoteMinesRadius + 500)
                                      where nearbyBombs
                                      let detonatableBombs = FindDetonatableBombs(creep, creep.Position, bombsArray)
                                                             where detonatableBombs != null
                                                             let nearbyCreeps =
                                          enumerable.Count(
                                              x =>
                                              x.Distance2D(creep) <= remoteMinesRadius &&
                                              CheckBombDamage(x, x.Position, bombsArray) >= x.Health)
                                          where nearbyCreeps > 3
                                          select detonatableBombs).SelectMany(
                         detonatableBombs =>
                         detonatableBombs.Where(data => Utils.SleepCheck(data.Value.Handle.ToString()))))
            {
                data.Value.UseAbility();
                Utils.Sleep(250, data.Value.Handle.ToString());
            }
        }
Ejemplo n.º 26
0
        public void Combo()
        {
            Active = Game.IsKeyDown(Menu.Item("keyBind").GetValue <KeyBind>().Key);

            if (Menu.Item("keyW").GetValue <KeyBind>().Active)
            {
                var HealingWard = ObjectManager.GetEntities <Unit>().Where(x => (x.ClassId == ClassId.CDOTA_BaseNPC_Additive) &&
                                                                           x.IsAlive && x.IsControllable && x.Team == me.Team).ToList();
                if (HealingWard.Count >= 1)
                {
                    for (int i = 0; i < HealingWard.Count(); ++i)
                    {
                        if (me.Position.Distance2D(HealingWard[i].Position) > 5 && Utils.SleepCheck(HealingWard[i].Handle.ToString()))
                        {
                            HealingWard[i].Move(me.Predict(310));
                            Utils.Sleep(50, HealingWard[i].Handle.ToString());
                        }
                    }
                }
            }
            Q = me.Spellbook.SpellQ;
            W = me.Spellbook.SpellW;
            R = me.Spellbook.SpellR;

            mom      = me.FindItem("item_mask_of_madness");
            urn      = me.FindItem("item_urn_of_shadows");
            dagon    = me.Inventory.Items.FirstOrDefault(x => x.Name.Contains("item_dagon"));
            ethereal = me.FindItem("item_ethereal_blade");
            halberd  = me.FindItem("item_heavens_halberd");
            mjollnir = me.FindItem("item_mjollnir");
            orchid   = me.FindItem("item_orchid") ?? me.FindItem("item_bloodthorn");
            abyssal  = me.FindItem("item_abyssal_blade");
            mail     = me.FindItem("item_blade_mail");
            bkb      = me.FindItem("item_black_king_bar");
            satanic  = me.FindItem("item_satanic");
            medall   = me.FindItem("item_medallion_of_courage") ?? me.FindItem("item_solar_crest");
            Shiva    = me.FindItem("item_shivas_guard");
            manta    = me.FindItem("item_manta");
            var v =
                ObjectManager.GetEntities <Hero>()
                .Where(x => x.Team != me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && !x.IsMagicImmune())
                .ToList();

            e = Toolset.ClosestToMouse(me);

            if (e == null)
            {
                return;
            }
            if (Active && me.Distance2D(e) <= 1400 && me.HasModifier("modifier_juggernaut_blade_fury") && Utils.SleepCheck("move"))
            {
                me.Move(Prediction.InFront(e, 170));
                Utils.Sleep(150, "move");
            }
            if (Active && me.Distance2D(e) <= 1400)
            {
                if (Menu.Item("orbwalk").GetValue <bool>() && !me.HasModifier("modifier_juggernaut_blade_fury"))
                {
                    Orbwalking.Orbwalk(e, 0, 1600, true, true);
                }
                if (                 // MOM
                    mom != null &&
                    mom.CanBeCasted() &&
                    me.CanCast() &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(mom.Name) &&
                    Utils.SleepCheck("mom") &&
                    me.Distance2D(e) <= 700
                    )
                {
                    mom.UseAbility();
                    Utils.Sleep(250, "mom");
                }
                if (                 // Mjollnir
                    mjollnir != null &&
                    mjollnir.CanBeCasted() &&
                    me.CanCast() &&
                    !e.IsMagicImmune() &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(mjollnir.Name) &&
                    Utils.SleepCheck("mjollnir") &&
                    me.Distance2D(e) <= 900
                    )
                {
                    mjollnir.UseAbility(me);
                    Utils.Sleep(250, "mjollnir");
                }                 // Mjollnir Item end
                if ((manta != null &&
                     Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(manta.Name)) &&
                    manta.CanBeCasted() && me.IsSilenced() && Utils.SleepCheck("manta"))
                {
                    manta.UseAbility();
                    Utils.Sleep(400, "manta");
                }
                if ((manta != null && Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(manta.Name)) &&
                    manta.CanBeCasted() && (e.Position.Distance2D(me.Position) <= me.GetAttackRange() + me.HullRadius) &&
                    Utils.SleepCheck("manta"))
                {
                    manta.UseAbility();
                    Utils.Sleep(150, "manta");
                }
                if (                 // Medall
                    medall != null &&
                    medall.CanBeCasted() &&
                    Utils.SleepCheck("Medall") &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(medall.Name) &&
                    me.Distance2D(e) <= 700
                    )
                {
                    medall.UseAbility(e);
                    Utils.Sleep(250, "Medall");
                }                 // Medall Item end
                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");
                }

                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");
                }

                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");
                }

                if (dagon != null &&
                    dagon.CanBeCasted() &&
                    me.Distance2D(e) <= 500 &&
                    Utils.SleepCheck("dagon"))
                {
                    dagon.UseAbility(e);
                    Utils.Sleep(100, "dagon");
                }
                if (                 // Abyssal Blade
                    abyssal != null &&
                    abyssal.CanBeCasted() &&
                    me.CanCast() &&
                    !e.IsStunned() &&
                    !e.IsHexed() &&
                    Utils.SleepCheck("abyssal") &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(abyssal.Name) &&
                    me.Distance2D(e) <= 400
                    )
                {
                    abyssal.UseAbility(e);
                    Utils.Sleep(250, "abyssal");
                }                 // Abyssal Item end
                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");
                }
                if (R != null && R.CanBeCasted() && me.Distance2D(e) <= 600 && Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(R.Name))
                {
                    var creep = ObjectManager.GetEntities <Creep>().Where(x => x.IsAlive && x.Team != me.Team && x.IsSpawned).ToList();

                    for (int i = 0; i < creep.Count(); i++)
                    {
                        if (creep.Count(x => x.Distance2D(me) <= Menu.Item("Heel").GetValue <Slider>().Value) <=
                            (Menu.Item("Healh").GetValue <Slider>().Value) &&
                            Utils.SleepCheck("R")
                            )
                        {
                            R.UseAbility(e);
                            Utils.Sleep(200, "R");
                        }
                    }
                    if (creep == null)
                    {
                        if (
                            Utils.SleepCheck("R")
                            )
                        {
                            R.UseAbility(e);
                            Utils.Sleep(200, "R");
                        }
                    }
                }
                if (
                    W != null && W.CanBeCasted() && me.Distance2D(e) <= e.AttackRange + e.HullRadius + 24 &&
                    me.Health <= (me.MaximumHealth * 0.4) &&
                    Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(W.Name) &&
                    Utils.SleepCheck("W")
                    )
                {
                    W.UseAbility(me.Position);
                    Utils.Sleep(200, "W");
                }
                if (                 // Hellbard
                    halberd != null &&
                    halberd.CanBeCasted() &&
                    me.CanCast() &&
                    !e.IsMagicImmune() &&
                    (e.NetworkActivity == NetworkActivity.Attack ||
                     e.NetworkActivity == NetworkActivity.Crit ||
                     e.NetworkActivity == NetworkActivity.Attack2) &&
                    Utils.SleepCheck("halberd") &&
                    me.Distance2D(e) <= 700 &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(halberd.Name)
                    )
                {
                    halberd.UseAbility(e);
                    Utils.Sleep(250, "halberd");
                }
                if (                 // Satanic
                    satanic != null &&
                    me.Health <= (me.MaximumHealth * 0.3) &&
                    satanic.CanBeCasted() &&
                    me.Distance2D(e) <= me.AttackRange + 50 &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(satanic.Name) &&
                    Utils.SleepCheck("satanic")
                    )
                {
                    satanic.UseAbility();
                    Utils.Sleep(240, "satanic");
                }                 // Satanic Item end
                if (mail != null && mail.CanBeCasted() && (v.Count(x => x.Distance2D(me) <= 650) >=
                                                           (Menu.Item("Heelm").GetValue <Slider>().Value)) &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(mail.Name) && Utils.SleepCheck("mail"))
                {
                    mail.UseAbility();
                    Utils.Sleep(100, "mail");
                }
                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");
                }
            }
        }
Ejemplo n.º 27
0
        public static void Others(EventArgs args)
        {
            if (!Game.IsInGame || me.ClassID != ClassID.CDOTA_Unit_Hero_EarthSpirit || Game.IsWatchingGame)
            {
                return;
            }

            qKey    = Game.IsKeyDown(menu.Item("qKey").GetValue <KeyBind>().Key);
            wKey    = Game.IsKeyDown(menu.Item("wKey").GetValue <KeyBind>().Key);
            eKey    = Game.IsKeyDown(menu.Item("eKey").GetValue <KeyBind>().Key);
            AutoUlt = menu.Item("oneult").IsActive();
            if (!menu.Item("enabled").IsActive())
            {
                return;
            }

            if (e == null)
            {
                return;
            }

            D = me.Spellbook.SpellD;
            Q = me.Spellbook.SpellQ;
            E = me.Spellbook.SpellE;
            W = me.Spellbook.SpellW;
            F = me.Spellbook.SpellF;
            R = me.Spellbook.SpellR;


            var magnetizemod = e.Modifiers.Where(y => y.Name == "modifier_earth_spirit_magnetize").DefaultIfEmpty(null).FirstOrDefault();

            if (AutoUlt && magnetizemod != null && magnetizemod.RemainingTime <= 0.2 + Game.Ping && me.Distance2D(e) <= D.CastRange && Utils.SleepCheck("Rem"))
            {
                D.UseAbility(e.Position);
                Utils.Sleep(1000, "Rem");
            }
            var remnant = ObjectManager.GetEntities <Unit>().Where(x => x.ClassID == ClassID.CDOTA_Unit_Earth_Spirit_Stone && x.Team == me.Team &&
                                                                   x.Distance2D(me) <= 1700 && x.IsAlive && x.IsValid).ToList();
            var remnantCount = remnant.Count;

            if (Active && me.Distance2D(e) <= 1400 && e.IsAlive && !me.IsInvisible() && Utils.SleepCheck("Combo"))
            {
                Wmod = me.HasModifier("modifier_earth_spirit_rolling_boulder_caster");


                ethereal = me.FindItem("item_ethereal_blade");
                mom      = me.FindItem("item_mask_of_madness");
                urn      = me.FindItem("item_urn_of_shadows");
                dagon    =
                    me.Inventory.Items.FirstOrDefault(
                        item =>
                        item.Name.Contains("item_dagon"));
                halberd  = me.FindItem("item_heavens_halberd");
                mjollnir = me.FindItem("item_mjollnir");
                orchid   = me.FindItem("item_orchid") ?? me.FindItem("item_bloodthorn");
                abyssal  = me.FindItem("item_abyssal_blade");
                mail     = me.FindItem("item_blade_mail");
                bkb      = me.FindItem("item_black_king_bar");
                satanic  = me.FindItem("item_satanic");
                blink    = me.FindItem("item_blink");
                medall   = me.FindItem("item_medallion_of_courage") ?? me.FindItem("item_solar_crest");
                sheep    = e.ClassID == ClassID.CDOTA_Unit_Hero_Tidehunter ? null : me.FindItem("item_sheepstick");
                vail     = me.FindItem("item_veil_of_discord");
                cheese   = me.FindItem("item_cheese");
                ghost    = me.FindItem("item_ghost");
                atos     = me.FindItem("item_rod_of_atos");
                soulring = me.FindItem("item_soul_ring");
                arcane   = me.FindItem("item_arcane_boots");
                stick    = me.FindItem("item_magic_stick") ?? me.FindItem("item_magic_wand");
                Shiva    = me.FindItem("item_shivas_guard");
                var stoneModif = e.Modifiers.Any(y => y.Name == "modifier_medusa_stone_gaze_stone");
                var charge     = me.Modifiers.FirstOrDefault(y => y.Name == "modifier_earth_spirit_stone_caller_charge_counter");

                if (//W Skill
                    W != null &&
                    charge.StackCount == 0 &&
                    W.CanBeCasted() &&
                    me.Distance2D(e) <= 800 &&
                    me.CanCast() &&
                    Utils.SleepCheck(me.Handle + "remnantW")
                    )
                {
                    W.CastSkillShot(e);
                    Utils.Sleep(250, me.Handle + "remnantW");
                }
                if ( // MOM
                    mom != null &&
                    mom.CanBeCasted() &&
                    me.CanCast() &&
                    menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(mom.Name) &&
                    Utils.SleepCheck("mom") &&
                    me.Distance2D(e) <= 700
                    )
                {
                    mom.UseAbility();
                    Utils.Sleep(250, "mom");
                }

                if ( // Hellbard
                    halberd != null &&
                    halberd.CanBeCasted() &&
                    me.CanCast() &&
                    !e.IsMagicImmune() &&
                    (e.NetworkActivity == NetworkActivity.Attack ||
                     e.NetworkActivity == NetworkActivity.Crit ||
                     e.NetworkActivity == NetworkActivity.Attack2) &&
                    Utils.SleepCheck("halberd") &&
                    me.Distance2D(e) <= 700 &&
                    menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(halberd.Name)
                    )
                {
                    halberd.UseAbility(e);
                    Utils.Sleep(250, "halberd");
                }
                if ( //Ghost
                    ghost != null &&
                    ghost.CanBeCasted() &&
                    me.CanCast() &&
                    ((me.Position.Distance2D(e) < 300 &&
                      me.Health <= (me.MaximumHealth * 0.7)) ||
                     me.Health <= (me.MaximumHealth * 0.3)) &&
                    menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(ghost.Name) &&
                    Utils.SleepCheck("Ghost"))
                {
                    ghost.UseAbility();
                    Utils.Sleep(250, "Ghost");
                }
                if ( // Arcane Boots Item
                    arcane != null &&
                    me.Mana <= W.ManaCost &&
                    menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(arcane.Name) &&
                    arcane.CanBeCasted() &&
                    Utils.SleepCheck("arcane")
                    )
                {
                    arcane.UseAbility();
                    Utils.Sleep(250, "arcane");
                } // Arcane Boots Item end
                if ( // Mjollnir
                    mjollnir != null &&
                    mjollnir.CanBeCasted() &&
                    me.CanCast() &&
                    !e.IsMagicImmune() &&
                    menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(mjollnir.Name) &&
                    Utils.SleepCheck("mjollnir") &&
                    me.Distance2D(e) <= 900
                    )
                {
                    mjollnir.UseAbility(me);
                    Utils.Sleep(250, "mjollnir");
                } // Mjollnir Item end
                if (
                    // cheese
                    cheese != null &&
                    cheese.CanBeCasted() &&
                    me.Health <= (me.MaximumHealth * 0.3) &&
                    me.Distance2D(e) <= 700 &&
                    menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(cheese.Name) &&
                    Utils.SleepCheck("cheese")
                    )
                {
                    cheese.UseAbility();
                    Utils.Sleep(200, "cheese");
                } // cheese Item end
                if ( // Medall
                    medall != null &&
                    medall.CanBeCasted() &&
                    Utils.SleepCheck("Medall") &&
                    menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(medall.Name) &&
                    me.Distance2D(e) <= 700
                    )
                {
                    medall.UseAbility(e);
                    Utils.Sleep(250, "Medall");
                } // Medall Item end

                if ( //R Skill
                    R != null &&
                    R.CanBeCasted() &&
                    me.CanCast() &&
                    me.Distance2D(e) <= 200 &&
                    menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(R.Name) &&
                    Utils.SleepCheck("R")
                    )
                {
                    R.UseAbility();
                    Utils.Sleep(200, "R");
                } // R Skill end
                if ( // sheep
                    sheep != null &&
                    sheep.CanBeCasted() &&
                    me.CanCast() &&
                    !e.IsLinkensProtected() &&
                    !e.IsMagicImmune() &&
                    me.Distance2D(e) <= 1400 &&
                    !stoneModif &&
                    menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(sheep.Name) &&
                    Utils.SleepCheck("sheep")
                    )
                {
                    sheep.UseAbility(e);
                    Utils.Sleep(250, "sheep");
                } // sheep Item end
                if ( // Abyssal Blade
                    abyssal != null &&
                    abyssal.CanBeCasted() &&
                    me.CanCast() &&
                    !e.IsStunned() &&
                    !e.IsHexed() &&
                    menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(abyssal.Name) &&
                    Utils.SleepCheck("abyssal") &&
                    me.Distance2D(e) <= 400
                    )
                {
                    abyssal.UseAbility(e);
                    Utils.Sleep(250, "abyssal");
                } // Abyssal Item end
                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");
                }

                if (Shiva != null && Shiva.CanBeCasted() && me.Distance2D(e) <= 600 &&
                    menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(Shiva.Name) &&
                    !e.IsMagicImmune() && Utils.SleepCheck("Shiva"))
                {
                    Shiva.UseAbility();
                    Utils.Sleep(100, "Shiva");
                }
                if ( // ethereal
                    ethereal != null &&
                    ethereal.CanBeCasted() &&
                    me.CanCast() &&
                    !e.IsLinkensProtected() &&
                    !e.IsMagicImmune() &&
                    !stoneModif &&
                    menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(ethereal.Name) &&
                    Utils.SleepCheck("ethereal")
                    )
                {
                    ethereal.UseAbility(e);
                    Utils.Sleep(200, "ethereal");
                } // ethereal Item end

                if (
                    blink != null &&
                    me.CanCast() &&
                    blink.CanBeCasted() &&
                    me.Distance2D(e) >= 450 &&
                    me.Distance2D(e) <= 1150 &&
                    remnant.Count == 0 &&
                    menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(blink.Name) &&
                    Utils.SleepCheck("blink")
                    )
                {
                    blink.UseAbility(e.Position);
                    Utils.Sleep(250, "blink");
                }

                if ( // SoulRing Item
                    soulring != null &&
                    soulring.CanBeCasted() &&
                    me.CanCast() &&
                    me.Health >= (me.MaximumHealth * 0.5) &&
                    me.Mana <= R.ManaCost &&
                    menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(soulring.Name)
                    )
                {
                    soulring.UseAbility();
                } // SoulRing Item end
                if ( // Dagon
                    me.CanCast() &&
                    dagon != null &&
                    (ethereal == null ||
                     (e.Modifiers.Any(y => y.Name == "modifier_item_ethereal_blade_slow") ||
                      ethereal.Cooldown < 17)) &&
                    !e.IsLinkensProtected() &&
                    dagon.CanBeCasted() &&
                    !e.IsMagicImmune() &&
                    !stoneModif &&
                    Utils.SleepCheck("dagon")
                    )
                {
                    dagon.UseAbility(e);
                    Utils.Sleep(200, "dagon");
                } // Dagon Item end
                if ( // atos Blade
                    atos != null &&
                    atos.CanBeCasted() &&
                    me.CanCast() &&
                    !e.IsLinkensProtected() &&
                    !e.IsMagicImmune() &&
                    menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(atos.Name) &&
                    me.Distance2D(e) <= 2000 &&
                    Utils.SleepCheck("atos")
                    )
                {
                    atos.UseAbility(e);

                    Utils.Sleep(250, "atos");
                } // atos Item end
                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");
                }
                if ( // vail
                    vail != null &&
                    vail.CanBeCasted() &&
                    me.CanCast() &&
                    !e.IsMagicImmune() &&
                    menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(vail.Name) &&
                    me.Distance2D(e) <= 1500 &&
                    Utils.SleepCheck("vail")
                    )
                {
                    vail.UseAbility(e.Position);
                    Utils.Sleep(250, "vail");
                } // orchid Item end
                if (
                    stick != null &&
                    stick.CanBeCasted() &&
                    stick.CurrentCharges != 0 &&
                    me.Distance2D(e) <= 700 &&
                    (me.Health <= (me.MaximumHealth * 0.5) ||
                     me.Mana <= (me.MaximumMana * 0.5)) &&
                    menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(stick.Name))
                {
                    stick.UseAbility();
                    Utils.Sleep(200, "mana_items");
                }
                if ( // Satanic
                    satanic != null &&
                    me.Health <= (me.MaximumHealth * 0.3) &&
                    satanic.CanBeCasted() &&
                    me.Distance2D(e) <= me.AttackRange + 50 &&
                    menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(satanic.Name) &&
                    Utils.SleepCheck("satanic")
                    )
                {
                    satanic.UseAbility();
                    Utils.Sleep(240, "satanic");
                } // Satanic Item end

                var v =
                    ObjectManager.GetEntities <Hero>()
                    .Where(x => x.Team != me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && x.Distance2D(me) <= 700)
                    .ToList();
                if (mail != null && mail.CanBeCasted() && (v.Count(x => x.Distance2D(me) <= 650) >=
                                                           (menu.Item("Heelm").GetValue <Slider>().Value)) &&
                    menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(mail.Name) && Utils.SleepCheck("mail"))
                {
                    mail.UseAbility();
                    Utils.Sleep(100, "mail");
                }
                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");
                }

                Utils.Sleep(50, "Combo");
            }
            if (qKey && me.Distance2D(e) <= 1400 && e != null && e.IsAlive && !me.IsInvisible())
            {
                Wmod = me.HasModifier("modifier_earth_spirit_rolling_boulder_caster");
                if (remnant.Count == 0)
                {
                    if (
                        D.CanBeCasted() &&
                        Q.CanBeCasted() &&
                        !Wmod &&
                        ((blink == null ||
                          !blink.CanBeCasted() ||
                          !menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(blink.Name)) ||
                         (blink != null && me.Distance2D(e) <= 450 && blink.CanBeCasted()))
                        )
                    {
                        if (me.Distance2D(e) <= E.CastRange - 50 &&
                            Utils.SleepCheck("Rem"))
                        {
                            if (me.NetworkActivity == NetworkActivity.Move)
                            {
                                me.Stop();
                            }
                            else
                            {
                                D.UseAbility(Prediction.InFront(me, 100));
                            }
                            Utils.Sleep(600, "Rem");
                        }
                    }
                }
                if (remnantCount >= 1)
                {
                    for (int i = 0; i < remnantCount; ++i)
                    {
                        var r = remnant[i];


                        if (
                            D != null && D.CanBeCasted() &&
                            ((Q != null && Q.CanBeCasted()) ||
                             (W != null && W.CanBeCasted())) &&
                            !Wmod &&
                            me.Distance2D(r) >= 350 &&
                            ((blink == null ||
                              !blink.CanBeCasted() ||
                              !menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(blink.Name)) ||
                             (blink != null && me.Distance2D(e) <= 450 && blink.CanBeCasted()))
                            )
                        {
                            if (me.Distance2D(e) <= E.CastRange - 50 &&
                                Utils.SleepCheck("Rem"))
                            {
                                if (me.NetworkActivity == NetworkActivity.Move)
                                {
                                    me.Stop();
                                }
                                else
                                {
                                    D.UseAbility(Prediction.InFront(me, 100));
                                }
                                Utils.Sleep(600, "Rem");
                            }
                        }
                        if (
                            me.Distance2D(r) >= 200 &&
                            me.Distance2D(r) <= 350 &&
                            Q.CanBeCasted() &&
                            Utils.SleepCheck("RemMove"))
                        {
                            me.Move(r.Position);
                            Utils.Sleep(300, "RemMove");
                        }
                        if (//Q Skill
                            r != null &&
                            Q != null &&
                            Q.CanBeCasted() &&
                            me.CanCast() &&
                            me.Distance2D(e) <= E.CastRange - 50 &&
                            r.Distance2D(me) <= 210 &&
                            Utils.SleepCheck(r.Handle + "remnantQ")
                            )
                        {
                            Q.CastSkillShot(e);
                            Utils.Sleep(250, r.Handle + "remnantQ");
                        }
                    }
                }
            }
            if (wKey)
            {
                Wmod = me.HasModifier("modifier_earth_spirit_rolling_boulder_caster");
                Task.Delay(350).ContinueWith(_ =>
                {
                    if (remnant.Count == 0)
                    {
                        if (
                            D.CanBeCasted() &&
                            Wmod &&
                            me.Distance2D(e) >= 600 &&
                            Utils.SleepCheck("nextAction")
                            )
                        {
                            D.UseAbility(Prediction.InFront(me, 170));
                            Utils.Sleep(1800 + D.FindCastPoint(), "nextAction");
                        }
                    }
                });
                if (remnantCount >= 1)
                {
                    for (var i = 0; i < remnantCount; ++i)
                    {
                        if (//W Skill
                            W != null &&
                            W.CanBeCasted() &&
                            Game.MousePosition.Distance2D(e) <= 500 &&
                            me.Distance2D(e) <= W.CastRange - 200 &&
                            Utils.SleepCheck(me.Handle + "remnantW")
                            )
                        {
                            W.CastSkillShot(e);
                            Utils.Sleep(250, me.Handle + "remnantW");
                        }
                        else if (//W Skill
                            W != null &&
                            W.CanBeCasted() &&
                            Game.MousePosition.Distance2D(e) >= 500 &&
                            Utils.SleepCheck(me.Handle + "remnantW")
                            )
                        {
                            W.UseAbility(Game.MousePosition);
                            Utils.Sleep(250, me.Handle + "remnantW");
                        }

                        Task.Delay(350).ContinueWith(_ =>
                        {
                            var r = remnant[i];
                            if (r != null && me.Distance2D(r) >= 200)
                            {
                                if (
                                    D.CanBeCasted() &&
                                    Wmod &&
                                    me.Distance2D(e) >= 600

                                    && Utils.SleepCheck("nextAction")
                                    )
                                {
                                    D.UseAbility(Prediction.InFront(me, 170));
                                    Utils.Sleep(1800 + D.FindCastPoint(), "nextAction");
                                }
                            }
                        });
                    }
                }
            }
            if (eKey && me.Distance2D(e) <= 1400 && e != null && e.IsAlive && !me.IsInvisible())
            {
                if (remnant.Count == 0)
                {
                    if (
                        D.CanBeCasted() &&
                        E.CanBeCasted()
                        )
                    {
                        if (me.Distance2D(e) <= E.CastRange - 50 &&
                            Utils.SleepCheck("Rem"))
                        {
                            if (me.NetworkActivity == NetworkActivity.Move)
                            {
                                me.Stop();
                            }
                            else
                            {
                                D.UseAbility(e.Position);
                            }
                            Utils.Sleep(1000, "Rem");
                        }
                    }
                }
                if (remnantCount >= 1)
                {
                    for (int i = 0; i < remnantCount; ++i)
                    {
                        var r = remnant[i];

                        if (r.Distance2D(e) >= 300)
                        {
                            if (
                                D.CanBeCasted() &&
                                (E != null && E.CanBeCasted()) &&
                                !r.HasModifier("modifier_earth_spirit_boulder_smash") &&
                                !r.HasModifier("modifier_earth_spirit_geomagnetic_grip")
                                )
                            {
                                if (me.Distance2D(e) <= E.CastRange - 50 &&
                                    Utils.SleepCheck("Rem"))
                                {
                                    if (me.NetworkActivity == NetworkActivity.Move)
                                    {
                                        me.Stop();
                                    }
                                    else
                                    {
                                        D.UseAbility(e.Position);
                                    }
                                    Utils.Sleep(1000, "Rem");
                                }
                            }
                        }
                        if (r != null &&
                            E != null &&
                            E.CanBeCasted() &&
                            me.CanCast() &&
                            me.Distance2D(r) < E.CastRange &&
                            me.Distance2D(e) <= E.CastRange
                            )
                        {
                            if (//E Skill
                                e.Distance2D(r) <= 200 &&
                                Utils.SleepCheck(r.Handle + "remnantE")
                                )
                            {
                                E.UseAbility(r.Position);
                                Utils.Sleep(220, r.Handle + "remnantE");
                            }
                            if (//E Skill
                                me.Distance2D(e) <= 200 &&
                                e.Distance2D(r) > 0 &&
                                me.Distance2D(r) >= e.Distance2D(r) &&
                                Utils.SleepCheck(r.Handle + "remnantE")
                                )
                            {
                                E.UseAbility(r.Position);
                                Utils.Sleep(220, r.Handle + "remnantE");
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 28
0
        /// <summary>
        ///     The orbwalk.
        /// </summary>
        /// <param name="target">
        ///     The target.
        /// </param>
        /// <param name="movePosition">
        ///     The move Position.
        /// </param>
        /// <param name="bonusWindupMs">
        ///     The bonus windup ms.
        /// </param>
        /// <param name="bonusRange">
        ///     The bonus range.
        /// </param>
        /// <param name="attackmodifiers">
        ///     The attackmodifiers.
        /// </param>
        /// <param name="followTarget">
        ///     The follow target.
        /// </param>
        public void OrbwalkOn(
            Unit target,
            Vector3 movePosition,
            float bonusWindupMs  = 0,
            float bonusRange     = 0,
            bool attackmodifiers = true,
            bool followTarget    = false)
        {
            if (Unit == null || !Unit.IsValid)
            {
                return;
            }

            var targetHull = 0f;

            if (target != null)
            {
                targetHull = target.HullRadius;
            }

            float distance = 0;

            if (target != null)
            {
                var pos = Prediction.InFront(
                    Unit,
                    (float)((Game.Ping / 1000) + (Unit.GetTurnTime(target.Position) * Unit.MovementSpeed)));
                distance = pos.Distance2D(target) - Unit.Distance2D(target);
            }

            var isValid = target != null && target.IsValid && target.IsAlive && target.IsVisible && !target.IsInvul() &&
                          !target.HasModifiers(
                new[] { "modifier_ghost_state", "modifier_item_ethereal_blade_slow" },
                false) &&
                          target.Distance2D(Unit)
                          <= Unit.GetAttackRange() + Unit.HullRadius + 50 + targetHull + bonusRange
                          + Math.Max(distance, 0);

            if (isValid || (target != null && Unit.IsAttacking() && Unit.GetTurnTime(target.Position) < 0.1))
            {
                var canAttack = CanAttack(target, bonusWindupMs) && !target.IsAttackImmune() && !target.IsInvul() &&
                                Unit.CanAttack();
                if (canAttack && !attackSleeper.Sleeping && (!hero || Utils.SleepCheck("Orbwalk.Attack")))
                {
                    attacker.Attack(target, attackmodifiers);
                    attackSleeper.Sleep(
                        (float)
                        ((UnitDatabase.GetAttackPoint(Unit) * 1000) + (Unit.GetTurnTime(target) * 1000)
                         + Game.Ping + 100));
                    moveSleeper.Sleep(
                        (float)
                        ((UnitDatabase.GetAttackPoint(Unit) * 1000) + (Unit.GetTurnTime(target) * 1000) + 50));
                    if (!hero)
                    {
                        return;
                    }

                    Utils.Sleep(
                        (UnitDatabase.GetAttackPoint(Unit) * 1000) + (Unit.GetTurnTime(target) * 1000)
                        + Game.Ping + 100,
                        "Orbwalk.Attack");
                    Utils.Sleep(
                        (UnitDatabase.GetAttackPoint(Unit) * 1000) + (Unit.GetTurnTime(target) * 1000) + 50,
                        "Orbwalk.Move");
                    return;
                }

                if (canAttack && !attackSleeper2.Sleeping)
                {
                    attacker.Attack(target, attackmodifiers);
                    attackSleeper2.Sleep(100);
                    return;
                }
            }

            var canCancel = (CanCancelAttack() && !CanAttack(target, bonusWindupMs)) ||
                            (!isValid && !Unit.IsAttacking() && CanCancelAttack());

            if (!canCancel || moveSleeper.Sleeping || attackSleeper.Sleeping ||
                (hero && (!Utils.SleepCheck("Orbwalk.Move") || !Utils.SleepCheck("Orbwalk.Attack"))))
            {
                return;
            }

            if (followTarget)
            {
                Unit.Follow(target);
            }
            else
            {
                Unit.Move(movePosition);
            }

            moveSleeper.Sleep(100);
        }
Ejemplo n.º 29
0
        public void Combo()
        {
            if (!Menu.Item("enabled").IsActive())
            {
                return;
            }

            E = Toolset.ClosestToMouse(Me);
            if (E == null)
            {
                return;
            }
            _w     = Me.Spellbook.SpellW;
            _r     = Me.Spellbook.SpellR;
            Active = Game.IsKeyDown(Menu.Item("keyBind").GetValue <KeyBind>().Key);

            _shiva    = Me.FindItem("item_shivas_guard");
            _ethereal = Me.FindItem("item_ethereal_blade");
            _mom      = Me.FindItem("item_mask_of_madness");
            _urn      = Me.FindItem("item_urn_of_shadows");
            _manta    = Me.FindItem("item_manta");
            _dagon    = Me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon"));
            _halberd  = Me.FindItem("item_heavens_halberd");
            _mjollnir = Me.FindItem("item_mjollnir");
            _orchid   = Me.FindItem("item_orchid") ?? Me.FindItem("item_bloodthorn");
            _abyssal  = Me.FindItem("item_abyssal_blade");
            _mail     = Me.FindItem("item_blade_mail");
            _bkb      = Me.FindItem("item_black_king_bar");
            _satanic  = Me.FindItem("item_satanic");
            _blink    = Me.FindItem("item_blink");
            _medall   = Me.FindItem("item_medallion_of_courage") ?? Me.FindItem("item_solar_crest");
            _sheep    = E.ClassId == ClassId.CDOTA_Unit_Hero_Tidehunter ? null : Me.FindItem("item_sheepstick");
            _cheese   = Me.FindItem("item_cheese");
            _soul     = Me.FindItem("item_soul_ring");
            _stick    = Me.FindItem("item_magic_stick") ?? Me.FindItem("item_magic_wand");
            _phase    = Me.FindItem("item_phase_boots");
            var v =
                ObjectManager.GetEntities <Hero>()
                .Where(x => x.Team != Me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && !x.IsMagicImmune())
                .ToList();

            var stoneModif = E.Modifiers.Any(y => y.Name == "modifier_medusa_stone_gaze_stone");

            if (Active && Me.Distance2D(E) <= 1400 && E != null && E.IsAlive)
            {
                if (Menu.Item("orbwalk").GetValue <bool>() && Me.Distance2D(E) <= 1900)
                {
                    Orbwalking.Orbwalk(E, 0, 1600, true, true);
                }
            }
            if (Active && Me.Distance2D(E) <= 1400 && E != null && E.IsAlive && !Me.IsInvisible())
            {
                if (
                    _w != null &&
                    _w.CanBeCasted() &&
                    Me.Distance2D(E) <= _w.GetCastRange() - 100 &&
                    Me.Distance2D(E) >= Me.AttackRange + 200 &&
                    Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(_w.Name) &&
                    Utils.SleepCheck("_w")
                    )
                {
                    _w.UseAbility(Prediction.InFront(E, 230));
                    Utils.Sleep(200, "_w");
                }

                if ((_manta != null &&
                     Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_manta.Name)) &&
                    _manta.CanBeCasted() && Me.IsSilenced() && Utils.SleepCheck("_manta"))
                {
                    _manta.UseAbility();
                    Utils.Sleep(400, "_manta");
                }
                if ((_manta != null && Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_manta.Name)) &&
                    _manta.CanBeCasted() && (E.Position.Distance2D(Me.Position) <= Me.GetAttackRange() + Me.HullRadius) &&
                    Utils.SleepCheck("_manta"))
                {
                    _manta.UseAbility();
                    Utils.Sleep(150, "_manta");
                }
                if (                 // MOM
                    _mom != null &&
                    _mom.CanBeCasted() &&
                    Me.CanCast() &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_mom.Name) &&
                    Utils.SleepCheck("_mom") &&
                    Me.Distance2D(E) <= 700
                    )
                {
                    _mom.UseAbility();
                    Utils.Sleep(250, "_mom");
                }
                if ( // Hellbard
                    _halberd != null &&
                    _halberd.CanBeCasted() &&
                    Me.CanCast() &&
                    !E.IsMagicImmune() &&
                    (E.NetworkActivity == NetworkActivity.Attack ||
                     E.NetworkActivity == NetworkActivity.Crit ||
                     E.NetworkActivity == NetworkActivity.Attack2) &&
                    Utils.SleepCheck("_halberd") &&
                    Me.Distance2D(E) <= 700 &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_halberd.Name)
                    )
                {
                    _halberd.UseAbility(E);
                    Utils.Sleep(250, "_halberd");
                }
                if ( // Mjollnir
                    _mjollnir != null &&
                    _mjollnir.CanBeCasted() &&
                    Me.CanCast() &&
                    !E.IsMagicImmune() &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_mjollnir.Name) &&
                    Utils.SleepCheck("_mjollnir") &&
                    Me.Distance2D(E) <= 900
                    )
                {
                    _mjollnir.UseAbility(Me);
                    Utils.Sleep(250, "_mjollnir");
                } // Mjollnir Item end
                if (
                    // _cheese
                    _cheese != null &&
                    _cheese.CanBeCasted() &&
                    Me.Health <= (Me.MaximumHealth * 0.3) &&
                    Me.Distance2D(E) <= 700 &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_cheese.Name) &&
                    Utils.SleepCheck("_cheese")
                    )
                {
                    _cheese.UseAbility();
                    Utils.Sleep(200, "_cheese");
                } // _cheese Item end
                if ( // Medall
                    _medall != null &&
                    _medall.CanBeCasted() &&
                    Utils.SleepCheck("Medall") &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_medall.Name) &&
                    Me.Distance2D(E) <= 700
                    )
                {
                    _medall.UseAbility(E);
                    Utils.Sleep(250, "Medall");
                } // Medall Item end

                if ( // _sheep
                    _sheep != null &&
                    _sheep.CanBeCasted() &&
                    Me.CanCast() &&
                    !E.IsLinkensProtected() &&
                    !E.IsMagicImmune() &&
                    Me.Distance2D(E) <= 1400 &&
                    !stoneModif &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_sheep.Name) &&
                    Utils.SleepCheck("_sheep")
                    )
                {
                    _sheep.UseAbility(E);
                    Utils.Sleep(250, "_sheep");
                } // _sheep Item end
                if ( // Abyssal Blade
                    _abyssal != null &&
                    _abyssal.CanBeCasted() &&
                    Me.CanCast() &&
                    !E.IsStunned() &&
                    !E.IsHexed() &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_abyssal.Name) &&
                    Utils.SleepCheck("_abyssal") &&
                    Me.Distance2D(E) <= 400
                    )
                {
                    _abyssal.UseAbility(E);
                    Utils.Sleep(250, "_abyssal");
                } // Abyssal Item end
                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");
                }

                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");
                }
                if ( // _ethereal
                    _ethereal != null &&
                    _ethereal.CanBeCasted() &&
                    Me.CanCast() &&
                    !E.IsLinkensProtected() &&
                    !E.IsMagicImmune() &&
                    !stoneModif &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_ethereal.Name) &&
                    Utils.SleepCheck("_ethereal")
                    )
                {
                    _ethereal.UseAbility(E);
                    Utils.Sleep(200, "_ethereal");
                } // _ethereal Item end
                if (
                    _blink != null &&
                    Me.CanCast() &&
                    _blink.CanBeCasted() &&
                    Me.Distance2D(E) >= 450 &&
                    Me.Distance2D(E) <= 1150 &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_blink.Name) &&
                    Utils.SleepCheck("_blink")
                    )
                {
                    _blink.UseAbility(E.Position);
                    Utils.Sleep(250, "_blink");
                }

                if ( // SoulRing Item
                    _soul != null &&
                    _soul.CanBeCasted() &&
                    Me.CanCast() &&
                    Me.Health >= (Me.MaximumHealth * 0.5) &&
                    Me.Mana <= _r.ManaCost &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_soul.Name)
                    )
                {
                    _soul.UseAbility();
                } // SoulRing Item end
                if ( // Dagon
                    Me.CanCast() &&
                    _dagon != null &&
                    (_ethereal == null ||
                     (E.Modifiers.Any(y => y.Name == "modifier_item_ethereal_blade_slow") ||
                      _ethereal.Cooldown < 17)) &&
                    !E.IsLinkensProtected() &&
                    _dagon.CanBeCasted() &&
                    !E.IsMagicImmune() &&
                    !stoneModif &&
                    Utils.SleepCheck("_dagon")
                    )
                {
                    _dagon.UseAbility(E);
                    Utils.Sleep(200, "_dagon");
                } // Dagon Item end
                if (_phase != null &&
                    _phase.CanBeCasted() &&
                    Utils.SleepCheck("_phase") &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_phase.Name) &&
                    !_blink.CanBeCasted() &&
                    Me.Distance2D(E) >= Me.AttackRange + 20)
                {
                    _phase.UseAbility();
                    Utils.Sleep(200, "_phase");
                }
                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");
                }
                if (
                    _stick != null &&
                    _stick.CanBeCasted() &&
                    _stick.CurrentCharges != 0 &&
                    Me.Distance2D(E) <= 700 &&
                    (Me.Health <= (Me.MaximumHealth * 0.5) ||
                     Me.Mana <= (Me.MaximumMana * 0.5)) &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_stick.Name))
                {
                    _stick.UseAbility();
                    Utils.Sleep(200, "mana_items");
                }
                if ( // Satanic
                    _satanic != null &&
                    Me.Health <= (Me.MaximumHealth * 0.3) &&
                    _satanic.CanBeCasted() &&
                    Me.Distance2D(E) <= Me.AttackRange + 50 &&
                    Menu.Item("Item").GetValue <AbilityToggler>().IsEnabled(_satanic.Name) &&
                    Utils.SleepCheck("_satanic")
                    )
                {
                    _satanic.UseAbility();
                    Utils.Sleep(240, "_satanic");
                } // Satanic Item end
                if (_mail != null && _mail.CanBeCasted() && (v.Count(x => x.Distance2D(Me) <= 650) >=
                                                             (Menu.Item("Heelm").GetValue <Slider>().Value)) &&
                    Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(_mail.Name) && Utils.SleepCheck("_mail"))
                {
                    _mail.UseAbility();
                    Utils.Sleep(100, "_mail");
                }
                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");
                }
            }
            if (Menu.Item("autoUlt").GetValue <bool>() && Me.IsAlive)
            {
                double[] penitence = { 0, 1.15, 1.2, 1.25, 1.3 };
                double[] souls     = { 0, 1.2, 1.3, 1.4, 1.5 };

                _r = Me.Spellbook.SpellR;
                var ultLvl = _r.Level;
                var enemy  =
                    ObjectManager.GetEntities <Hero>()
                    .Where(x => x.Team != Me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion)
                    .ToList();
                if (enemy.Count == 0)
                {
                    return;
                }
                foreach (var z in enemy)
                {
                    if (!z.IsVisible || !z.IsAlive)
                    {
                        continue;
                    }
                    var manna  = (z.MaximumMana - z.Mana);
                    var damage = Math.Floor((manna * _ult[ultLvl]) * (1 - z.MagicDamageResist));

                    var lens = Me.HasModifier("modifier_item_aether_lens");

                    if (z.NetworkName == "CDOTA_Unit_Hero_Spectre" && z.Spellbook.Spell3.Level > 0)
                    {
                        damage =
                            Math.Floor((manna * _ult[ultLvl]) *
                                       (1 - (0.10 + z.Spellbook.Spell3.Level * 0.04)) * (1 - z.MagicDamageResist));
                    }
                    if (z.NetworkName == "CDOTA_Unit_Hero_SkeletonKing" &&
                        z.Spellbook.SpellR.CanBeCasted())
                    {
                        damage = 0;
                    }
                    if (lens)
                    {
                        damage = damage * 1.08;
                    }
                    if (z.HasModifier("modifier_kunkka_ghost_ship_damage_absorb"))
                    {
                        damage = damage * 0.5;
                    }
                    if (z.HasModifier("modifier_item_mask_of_madness_berserk"))
                    {
                        damage = damage * 1.3;
                    }

                    if (z.HasModifier("modifier_chen_penitence"))
                    {
                        damage = damage *
                                 penitence[
                            ObjectManager.GetEntities <Hero>()
                            .FirstOrDefault(
                                x => x.Team == Me.Team && x.ClassId == ClassId.CDOTA_Unit_Hero_Chen)
                            .Spellbook.Spell1.Level];
                    }

                    if (z.HasModifier("modifier_shadow_demon_soul_catcher"))
                    {
                        damage = damage *
                                 souls[
                            ObjectManager.GetEntities <Hero>()
                            .FirstOrDefault(
                                x => x.Team == Me.Team && x.ClassId == ClassId.CDOTA_Unit_Hero_Shadow_Demon)
                            .Spellbook.Spell2.Level];
                    }

                    if (_r != null && _r.CanBeCasted() &&
                        !z.HasModifier("modifier_tusk_snowball_movement") &&
                        !z.HasModifier("modifier_snowball_movement_friendly") &&
                        !z.HasModifier("modifier_templar_assassin_refraction_absorb") &&
                        !z.HasModifier("modifier_ember_spirit_flame_guard") &&
                        !z.HasModifier("modifier_ember_spirit_sleight_of_fist_caster_invulnerability") &&
                        !z.HasModifier("modifier_obsidian_destroyer_astral_imprisonment_prison") &&
                        !z.HasModifier("modifier_puck_phase_shift") &&
                        !z.HasModifier("modifier_eul_cyclone") &&
                        !z.HasModifier("modifier_dazzle_shallow_grave") &&
                        !z.HasModifier("modifier_shadow_demon_disruption") &&
                        !z.HasModifier("modifier_necrolyte_reapers_scythe") &&
                        !z.HasModifier("modifier_medusa_stone_gaze_stone") &&
                        !z.HasModifier("modifier_storm_spirit_ball_lightning") &&
                        !z.HasModifier("modifier_ember_spirit_fire_remnant") &&
                        !z.HasModifier("modifier_nyx_assassin_spiked_carapace") &&
                        !z.HasModifier("modifier_phantom_lancer_doppelwalk_phase") &&
                        !z.FindSpell("abaddon_borrowed_time").CanBeCasted() &&
                        !z.HasModifier("modifier_abaddon_borrowed_time_damage_redirect") &&
                        Me.Distance2D(z) <= _r.GetCastRange() + 50 &&
                        !z.IsMagicImmune() &&
                        enemy.Count(x => (x.Health - damage) <= 0 && x.Distance2D(z) <= 500)
                        >= Menu.Item("ulti").GetValue <Slider>().Value &&
                        enemy.Count(x => x.Distance2D(z) <= 500)
                        >= Menu.Item("ulti").GetValue <Slider>().Value &&
                        damage >= Menu.Item("minDMG").GetValue <Slider>().Value &&
                        Utils.SleepCheck(z.Handle.ToString()))
                    {
                        _r.UseAbility(z);
                        Utils.Sleep(150, z.Handle.ToString());
                        return;
                    }
                }
            }
        } // Combo
Ejemplo n.º 30
0
        public static void Game_OnUpdate(EventArgs args)
        {
            if (!IsEnable)
            {
                return;
            }
            if (_combos == null)
            {
                _combos = new MultiSleeper();
            }
            var smash           = Abilities.FindAbility("earth_spirit_boulder_smash");
            var geomagneticGrip = Abilities.FindAbility("earth_spirit_geomagnetic_grip");
            var magnetize       = Abilities.FindAbility("earth_spirit_magnetize");
            var rollingBoulder  = Abilities.FindAbility("earth_spirit_rolling_boulder");
            var stoneCaller     = Abilities.FindAbility("earth_spirit_stone_caller");
            var petrify         = Abilities.FindAbility("earth_spirit_petrify");

            if (Combo1)
            {
                if (smash.CanBeCasted() && !_combos.Sleeping(smash))
                {
                    var remnant = Helper.FindRemnant();
                    if (stoneCaller.CanBeCasted() && remnant == null)
                    {
                        stoneCaller.UseAbility(Prediction.InFront(Members.MyHero, 75));
                    }
                    //stoneCaller.UseAbility(Members.MyHero.Position);
                    smash.UseAbility(Game.MousePosition);
                    _combos.Sleep(500, smash);
                }
            }
            else if (Combo2)
            {
                if (rollingBoulder.CanBeCasted() && !_combos.Sleeping(rollingBoulder))
                {
                    var myPos    = Members.MyHero.Position;
                    var mousePos = Game.MousePosition;

                    var angle = Members.MyHero.FindAngleBetween(mousePos, true);
                    var point = new Vector3(
                        (float)
                        (myPos.X +
                         75 *
                         Math.Cos(angle)),
                        (float)
                        (myPos.Y +
                         75 *
                         Math.Sin(angle)),
                        0);
                    var remnant = Helper.FindRemnant(range: 100);
                    if (stoneCaller.CanBeCasted() && remnant == null)
                    {
                        stoneCaller.UseAbility(point);
                    }
                    rollingBoulder.UseAbility(Game.MousePosition);
                    _combos.Sleep(500, rollingBoulder);
                }
            }
            else if (Combo3)
            {
                var myPos       = Members.MyHero.Position;
                var mousePos    = Game.MousePosition;
                var distance    = myPos.Distance2D(mousePos);
                var myInventory = Members.MyHero.Inventory.Items.ToList();
                var extraRange  = myInventory.Any(x => x.StoredName() == "item_aether_lens") ? 200 : 0;
                if (geomagneticGrip.CanBeCasted() && !_combos.Sleeping(geomagneticGrip) &&
                    distance <= 1100 + extraRange)
                {
                    var remnant = Helper.FindRemnant(mousePos);
                    if (stoneCaller.CanBeCasted() && remnant == null)
                    {
                        stoneCaller.UseAbility(mousePos);
                        geomagneticGrip.UseAbility(mousePos);
                    }
                    else
                    {
                        geomagneticGrip.UseAbility(remnant.NetworkPosition);
                    }

                    _combos.Sleep(500, geomagneticGrip);
                }
            }
            if (Combo4)
            {
                var myPos       = Members.MyHero.Position;
                var mousePos    = Game.MousePosition;
                var distance    = myPos.Distance2D(mousePos);
                var myInventory = Members.MyHero.Inventory.Items.ToList();
                var extraRange  = myInventory.Any(x => x.StoredName() == "item_aether_lens") ? 200 : 0;

                /*Printer.Print(
                 *  $"{rollingBoulder.CanBeCasted()}/{geomagneticGrip.CanBeCasted()}/{!_combos.Sleeping(stoneCaller)}/{distance <= 1000 + extraRange}");*/
                if (rollingBoulder.CanBeCasted() && geomagneticGrip.CanBeCasted() && !_combos.Sleeping(stoneCaller) &&
                    distance <= 11000 + extraRange)
                {
                    var remnant = Helper.FindRemnant(mousePos);
                    if (remnant != null)
                    {
                        geomagneticGrip.UseAbility(remnant.NetworkPosition);
                        rollingBoulder.UseAbility(mousePos);
                        _combos.Sleep(500, stoneCaller);
                    }
                }
            }
        }