Exemplo n.º 1
0
        public static void Game_OnUpdate(EventArgs args)
        {
            if (!OnUpdateChecks.CanUpdate())
            {
                return;
            }
            MyHeroInfo.UpdatePosition();
            ManageAutoAttack.UpdateAutoAttack();
            var enemyHeroes = EnemyHeroes.UsableHeroes;
            var allyHeroes  = AllyHeroes.UsableHeroes;

            GankDamage.UpdateDamage(enemyHeroes, allyHeroes);
            if (!Me.IsAlive ||
                (Me.IsInvisible() && !Me.IsVisibleToEnemies && Me.ClassID != ClassID.CDOTA_Unit_Hero_Riki &&
                 (Me.Modifiers.All(x => x.Name != "modifier_templar_assassin_meld") ||
                  !Orbwalking.CanCancelAnimation())) || Me.IsChanneling())
            {
                return;
            }
            if (Utils.SleepCheck("cancelorder"))
            {
                if (lastOrderPosition != Vector3.Zero)
                {
                    var ctarget = TargetSelector.ClosestToMouse(Me, 150);
                    if (ctarget != null)
                    {
                        Me.Attack(ctarget);
                    }
                    else
                    {
                        Me.Attack(lastOrderPosition);
                    }
                    lastOrderPosition = Vector3.Zero;
                }
            }
            else
            {
                lastOrderPosition = Game.MousePosition;
            }
            var meModifiers = Me.Modifiers.ToList();
            var ping        = Game.Ping;

            if (LaunchSnowball(meModifiers))
            {
                return;
            }
            if (MyAbilities.DeffensiveAbilities.Any() && Utils.SleepCheck("casting"))
            {
                if (allyHeroes.Any(allyHero => FullCombo.DeffensiveAutoUsage(allyHero, Me, enemyHeroes, ping)))
                {
                    return;
                }
            }

            if (!MyAbilities.OffensiveAbilities.Any())
            {
                if (Game.IsChatOpen)
                {
                    return;
                }
                if (Game.IsKeyDown(MainMenu.ComboKeysMenu.Item("abilityKey1").GetValue <KeyBind>().Key))
                {
                    if (Utils.SleepCheck("UpdateTarget"))
                    {
                        target = TargetSelector.ClosestToMouse(Me, 2000);
                        Utils.Sleep(250, "UpdateTarget");
                    }
                    if (target != null && !target.IsValid)
                    {
                        target = null;
                    }
                    if (Utils.SleepCheck("GlobalCasting"))
                    {
                        Orbwalking.Orbwalk(target, attackmodifiers: true);
                    }
                }
            }

            if (Utils.SleepCheck("casting"))
            {
                if (FullCombo.KillSteal(enemyHeroes, ping, Me))
                {
                    return;
                }
            }
            var meMissingHp = Me.MaximumHealth - Me.Health;
            var meMana      = Me.Mana;

            if (
                enemyHeroes.Any(
                    enemyHero => FullCombo.AutoUsage(enemyHero, enemyHeroes, meMissingHp, meModifiers, ping, Me, meMana)))
            {
                return;
            }
            if (Game.IsChatOpen)
            {
                return;
            }
            if (Game.IsKeyDown(MainMenu.ComboKeysMenu.Item("abilityKey1").GetValue <KeyBind>().Key))
            {
                if (Utils.SleepCheck("UpdateTarget"))
                {
                    target = TargetSelector.ClosestToMouse(Me, 2000);
                    Utils.Sleep(250, "UpdateTarget");
                }
                if (target != null && !target.IsValid)
                {
                    target = null;
                }
                var selectedCombo = MainMenu.ComboKeysMenu.Item("abilityComboType").GetValue <StringList>().SelectedIndex;
                if (target != null && Utils.SleepCheck("Orbwalk.Attack"))
                {
                    FullCombo.Execute(
                        target,
                        enemyHeroes,
                        ping,
                        selectedCombo == 2,
                        selectedCombo == 1,
                        Me,
                        meModifiers,
                        meMana);
                }
                if (Me.ClassID == ClassID.CDOTA_Unit_Hero_TemplarAssassin && target != null && target.IsVisible)
                {
                    var meld = Me.Spellbook.SpellW;
                    if (meld.ManaCost <= meMana && meld.Cooldown >= 0 && meld.Cooldown < UnitDatabase.GetAttackRate(Me) &&
                        target.Health > Dictionaries.HitDamageDictionary[target.Handle] * 2)
                    {
                        if (!Utils.SleepCheck("Ability.Move"))
                        {
                            return;
                        }
                        Me.Move(Game.MousePosition);
                        Utils.Sleep(100, "Ability.Move");
                        return;
                    }
                }
                if (Utils.SleepCheck("GlobalCasting"))
                {
                    Orbwalking.Orbwalk(target, attackmodifiers: true);
                }
            }
        }
Exemplo n.º 2
0
        public static void Game_OnUpdate(EventArgs args)
        {
            if (!OnUpdateChecks.CanUpdate())
            {
                return;
            }

            MyHeroInfo.UpdatePosition();
            var enemyHeroes = EnemyHeroes.UsableHeroes;
            var allyHeroes  = AllyHeroes.UsableHeroes;

            GankDamage.UpdateDamage(enemyHeroes, allyHeroes);
            if (!Me.IsAlive || Me.IsChanneling() || Me.HasModifier("modifier_spirit_breaker_charge_of_darkness") ||
                (MyAbilities.ChargeOfDarkness != null && MyAbilities.ChargeOfDarkness.IsValid &&
                 MyAbilities.ChargeOfDarkness.IsInAbilityPhase) || !Utils.SleepCheck("Ability#.Sleep"))
            {
                return;
            }

            var keyDown = Game.IsKeyDown(MainMenu.ComboKeysMenu.Item("abilityKey1").GetValue <KeyBind>().Key);

            if (Utils.SleepCheck("cancelorder") || !keyDown)
            {
                if (lastOrderPosition != Vector3.Zero && lastActivity == NetworkActivity.Move)
                {
                    var ctarget = TargetSelector.ClosestToMouse(Me, 150);
                    if (ctarget != null && ctarget.IsValid)
                    {
                        Me.Attack(ctarget);
                    }
                    else
                    {
                        Me.Move(lastOrderPosition);
                    }

                    lastOrderPosition = Vector3.Zero;
                }
            }
            else
            {
                lastActivity      = Me.NetworkActivity;
                lastOrderPosition = Game.MousePosition;
            }

            var ping = Game.Ping;

            var invisible = Me.IsInvisible() && Me.ClassID != ClassID.CDOTA_Unit_Hero_Riki &&
                            (!Me.HasModifier("modifier_templar_assassin_meld") || !Orbwalking.CanCancelAnimation());

            if (!invisible && MainMenu.Menu.Item("Ability#.EnableAutoUsage").GetValue <bool>() &&
                MyAbilities.DefensiveAbilities.Any() && Utils.SleepCheck("casting"))
            {
                if (Utils.SleepCheck("Orbwalk.Attack") &&
                    allyHeroes.Any(allyHero => FullCombo.DeffensiveAutoUsage(allyHero, Me, enemyHeroes, ping)))
                {
                    return;
                }
            }

            var targetLock =
                MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.TargetLock").GetValue <StringList>().SelectedIndex;

            if (!keyDown)
            {
                target = null;
            }

            if (Game.IsChatOpen)
            {
                return;
            }

            var meMissingHp = Me.MaximumHealth - Me.Health;
            var meMana      = Me.Mana;

            ManageAutoAttack.UpdateAutoAttack();

            if (keyDown)
            {
                if (Utils.SleepCheck("UpdateTarget") &&
                    (target == null || !target.IsValid || !target.IsAlive || !target.IsVisible ||
                     (target.IsVisible && targetLock <= 1)))
                {
                    var mode =
                        MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.Target").GetValue <StringList>().SelectedIndex;
                    target = mode == 0
                                 ? TargetSelector.ClosestToMouse(Me, 2000)
                                 : EnemyHeroes.UsableHeroes.Where(x => x.Distance2D(Me) < 2000)
                             .MaxOrDefault(x => x.GetDoableDamage());
                    Utils.Sleep(250, "UpdateTarget");
                }

                var selectedCombo = MainMenu.ComboKeysMenu.Item("abilityComboType").GetValue <StringList>().SelectedIndex;
                var combo         = false;
                if (!invisible && target != null && Orbwalking.CanCancelAnimation() && Utils.SleepCheck("Orbwalk.Attack"))
                {
                    combo = FullCombo.Execute(
                        target,
                        enemyHeroes,
                        ping,
                        selectedCombo == 2,
                        selectedCombo == 1,
                        Me,
                        meMana,
                        selectedCombo == 3);
                }

                if (!combo &&
                    (target == null ||
                     (target.Distance2D(MyHeroInfo.Position) > 500 && Me.HasModifier("modifier_pudge_rot") &&
                      !target.HasModifier("modifier_pudge_meat_hook"))) &&
                    AllyHeroes.AbilityDictionary.ContainsKey(Me.StoredName()))
                {
                    foreach (var ability in AllyHeroes.AbilityDictionary[Me.StoredName()].Where(x => x.IsToggled))
                    {
                        var handle = ability.Handle.ToString();
                        if (!Utils.SleepCheck(handle))
                        {
                            continue;
                        }

                        ability.ToggleAbility();
                        Utils.Sleep(500 + Game.Ping, handle);
                        return;
                    }
                }

                if (Me.ClassID == ClassID.CDOTA_Unit_Hero_TemplarAssassin && target != null && target.IsVisible)
                {
                    var meld = Me.Spellbook.SpellW;
                    if (meld.ManaCost <= meMana && meld.Cooldown >= 0 && meld.Cooldown < UnitDatabase.GetAttackRate(Me) &&
                        target.Health > Dictionaries.HitDamageDictionary[target.Handle] * 2)
                    {
                        if (!Utils.SleepCheck("Ability.Move"))
                        {
                            return;
                        }

                        Me.Move(Game.MousePosition);
                        Utils.Sleep(100, "Ability.Move");
                        return;
                    }
                }

                if (combo || !Utils.SleepCheck("GlobalCasting") ||
                    (!(Game.MousePosition.Distance2D(Me)
                       > MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.NoMoveRange").GetValue <Slider>().Value) &&
                     (target == null || !(Me.Distance2D(target) <= MyHeroInfo.AttackRange() + 100))))
                {
                    return;
                }

                MoveMode(target);
            }

            if (!invisible && MainMenu.Menu.Item("Ability#.EnableAutoKillSteal").GetValue <bool>() &&
                Utils.SleepCheck("casting"))
            {
                Variables.Killsteal.FindTarget(enemyHeroes, Me);
                if (Variables.Killsteal.TryKillsteal(Me, ping, enemyHeroes))
                {
                    return;
                }
            }

            if (!invisible && MainMenu.Menu.Item("Ability#.EnableAutoUsage").GetValue <bool>() &&
                Utils.SleepCheck("Orbwalk.Attack") &&
                enemyHeroes.Any(
                    enemyHero => Variables.AutoUsage.Try(enemyHero, enemyHeroes, meMissingHp, ping, Me, meMana)))
            {
                return;
            }
        }
Exemplo n.º 3
0
        public static void Game_OnUpdate(EventArgs args)
        {
            if (!OnUpdateChecks.CanUpdate())
            {
                return;
            }

            MyHeroInfo.UpdatePosition();
            ManageAutoAttack.UpdateAutoAttack();
            var enemyHeroes = EnemyHeroes.UsableHeroes;
            var allyHeroes  = AllyHeroes.UsableHeroes;

            GankDamage.UpdateDamage(enemyHeroes, allyHeroes);
            if (!Me.IsAlive ||
                (Me.IsInvisible() && !Me.IsVisibleToEnemies && Me.ClassID != ClassID.CDOTA_Unit_Hero_Riki &&
                 (!Me.HasModifier("modifier_templar_assassin_meld") ||
                  !Orbwalking.CanCancelAnimation())) || Me.IsChanneling())
            {
                return;
            }

            if (Utils.SleepCheck("cancelorder"))
            {
                if (lastOrderPosition != Vector3.Zero && lastActivity == NetworkActivity.Move)
                {
                    var ctarget = TargetSelector.ClosestToMouse(Me, 150);
                    if (ctarget != null && ctarget.IsValid)
                    {
                        Me.Attack(ctarget);
                    }
                    else
                    {
                        Me.Move(lastOrderPosition);
                    }

                    lastOrderPosition = Vector3.Zero;
                }
            }
            else
            {
                lastActivity      = Me.NetworkActivity;
                lastOrderPosition = Game.MousePosition;
            }

            var ping = Game.Ping;

            if (MyAbilities.DeffensiveAbilities.Any() && Utils.SleepCheck("casting"))
            {
                if (Utils.SleepCheck("Orbwalk.Attack") &&
                    allyHeroes.Any(allyHero => FullCombo.DeffensiveAutoUsage(allyHero, Me, enemyHeroes, ping)))
                {
                    return;
                }
            }

            var targetLock =
                MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.TargetLock").GetValue <StringList>().SelectedIndex;

            var keyDown = Game.IsKeyDown(MainMenu.ComboKeysMenu.Item("abilityKey1").GetValue <KeyBind>().Key);

            if (!keyDown)
            {
                target = null;
            }

            if (!MyAbilities.OffensiveAbilities.Any())
            {
                if (Game.IsChatOpen)
                {
                    return;
                }

                if (keyDown)
                {
                    if (Utils.SleepCheck("UpdateTarget") &&
                        (target == null || !target.IsValid || !target.IsAlive || (!target.IsVisible && targetLock == 0)))
                    {
                        var mode =
                            MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.Target").GetValue <StringList>().SelectedIndex;
                        target = mode == 0
                                     ? TargetSelector.ClosestToMouse(Me, 2000)
                                     : EnemyHeroes.UsableHeroes.Where(x => x.Distance2D(Me) < 2000)
                                 .MaxOrDefault(x => x.GetDoableDamage());
                        Utils.Sleep(250, "UpdateTarget");
                    }

                    if (target != null && !target.IsValid)
                    {
                        target = null;
                    }

                    if (Utils.SleepCheck("GlobalCasting") &&
                        (Game.MousePosition.Distance2D(Me)
                         > MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.NoMoveRange").GetValue <Slider>().Value ||
                         (target != null &&
                          Me.Distance2D(target)
                          <= MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.NoMoveRange").GetValue <Slider>().Value)))
                    {
                        var mode =
                            MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.Mode").GetValue <StringList>().SelectedIndex;
                        switch (mode)
                        {
                        case 0:

                            Orbwalking.Orbwalk(target, attackmodifiers: true);
                            break;

                        case 1:
                            if (!Utils.SleepCheck("Ability.Move"))
                            {
                                return;
                            }

                            Me.Move(Game.MousePosition);
                            Utils.Sleep(100, "Ability.Move");
                            break;

                        case 2:
                            if (!Utils.SleepCheck("Ability.Move") || target == null)
                            {
                                return;
                            }

                            Me.Attack(target);
                            Utils.Sleep(100, "Ability.Move");
                            break;

                        case 3:
                            return;
                        }
                    }
                }
            }

            var meMissingHp = Me.MaximumHealth - Me.Health;
            var meMana      = Me.Mana;

            if (Utils.SleepCheck("Orbwalk.Attack") &&
                enemyHeroes.Any(
                    enemyHero => FullCombo.AutoUsage(enemyHero, enemyHeroes, meMissingHp, ping, Me, meMana)))
            {
                return;
            }

            if (Utils.SleepCheck("casting"))
            {
                if (FullCombo.KillSteal(enemyHeroes, ping, Me))
                {
                    return;
                }
            }

            if (Game.IsChatOpen)
            {
                return;
            }

            if (keyDown)
            {
                if (Utils.SleepCheck("UpdateTarget") &&
                    (target == null || !target.IsValid || !target.IsAlive || (!target.IsVisible && targetLock == 0)))
                {
                    var mode =
                        MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.Target").GetValue <StringList>().SelectedIndex;
                    target = mode == 0
                                 ? TargetSelector.ClosestToMouse(Me, 2000)
                                 : EnemyHeroes.UsableHeroes.Where(x => x.Distance2D(Me) < 2000)
                             .MaxOrDefault(x => x.GetDoableDamage());
                    Utils.Sleep(250, "UpdateTarget");
                }

                var selectedCombo = MainMenu.ComboKeysMenu.Item("abilityComboType").GetValue <StringList>().SelectedIndex;
                if (target != null && Utils.SleepCheck("Orbwalk.Attack"))
                {
                    var combo = FullCombo.Execute(
                        target,
                        enemyHeroes,
                        ping,
                        selectedCombo == 2,
                        selectedCombo == 1,
                        Me,
                        meMana);
                }

                if (Me.ClassID == ClassID.CDOTA_Unit_Hero_TemplarAssassin && target != null && target.IsVisible)
                {
                    var meld = Me.Spellbook.SpellW;
                    if (meld.ManaCost <= meMana && meld.Cooldown >= 0 && meld.Cooldown < UnitDatabase.GetAttackRate(Me) &&
                        target.Health > Dictionaries.HitDamageDictionary[target.Handle] * 2)
                    {
                        if (!Utils.SleepCheck("Ability.Move"))
                        {
                            return;
                        }

                        Me.Move(Game.MousePosition);
                        Utils.Sleep(100, "Ability.Move");
                        return;
                    }
                }

                if (Utils.SleepCheck("GlobalCasting") &&
                    (Game.MousePosition.Distance2D(Me)
                     > MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.NoMoveRange").GetValue <Slider>().Value ||
                     (target != null &&
                      Me.Distance2D(target)
                      <= MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.NoMoveRange").GetValue <Slider>().Value)))
                {
                    var mode = MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.Mode").GetValue <StringList>().SelectedIndex;
                    switch (mode)
                    {
                    case 0:

                        Orbwalking.Orbwalk(target, attackmodifiers: true);
                        break;

                    case 1:
                        if (!Utils.SleepCheck("Ability.Move"))
                        {
                            return;
                        }

                        Me.Move(Game.MousePosition);
                        Utils.Sleep(100, "Ability.Move");
                        break;

                    case 2:
                        if (!Utils.SleepCheck("Ability.Move") || target == null)
                        {
                            return;
                        }

                        Me.Attack(target);
                        Utils.Sleep(100, "Ability.Move");
                        break;

                    case 3:
                        return;
                    }
                }
            }
        }