Пример #1
0
        public void OnDraw()
        {
            if (!menuManager.IsEnabled)
            {
                return;
            }

            if (!targetLocked)
            {
                target = TargetSelector.ClosestToMouse(hero, 600);
            }

            if (target == null || xMark.CastRange < hero.Distance2D(target) && !targetLocked || !hero.IsAlive ||
                target.IsLinkensProtected() || target.IsMagicImmune())
            {
                if (targetParticle != null)
                {
                    targetParticle.Dispose();
                    targetParticle = null;
                }
                target = null;
                return;
            }

            if (targetParticle == null)
            {
                targetParticle = new ParticleEffect(@"particles\ui_mouseactions\range_finder_tower_aoe.vpcf", target);
            }

            targetParticle.SetControlPoint(2, hero.Position);
            targetParticle.SetControlPoint(6, new Vector3(1, 0, 0));
            targetParticle.SetControlPoint(7, target.Position);
        }
Пример #2
0
        public static bool TargetFinder()
        {
            if (Core.Target != null && Core.Target.IsValid && Core.Target.IsAlive)
            {
                return(true);
            }
            var mousePos = Game.MousePosition;

            Core.Target = TargetSelector.ClosestToMouse(Core.MainHero.Hero, 500);
            var tempTarget =
                EntityManager <Unit> .Entities.FirstOrDefault(
                    x =>
                    (x.NetworkName == "CDOTA_Unit_SpiritBear" || x.Name == "npc_dota_phoenix_sun") && x.IsAlive &&
                    x.Team == Core.MainHero.Hero.GetEnemyTeam() && x.Distance2D(mousePos) <= 500);

            if (Core.Target != null && tempTarget != null)
            {
                if (Core.Target.Distance2D(mousePos) > tempTarget.Distance2D(mousePos))
                {
                    Core.Target = tempTarget;
                }
            }
            else if (Core.Target == null && tempTarget != null)
            {
                Core.Target = tempTarget;
            }
            if (Core.Target == null)
            {
                return(false);
            }
            Printer.Both($"[TargetFinder] new target: {Core.Target.Name} | {Core.Target.Handle}");
            return(true);
        }
Пример #3
0
        private static void DRangerUpdate(EventArgs args)
        {
            if (Game.IsInGame && !Game.IsPaused && !Game.IsWatchingGame)
            {
                gameLoad = true;
                meLulz   = ObjectMgr.LocalHero;
            }
            else
            {
                gameLoad = false;
                rangesAA = null;
                rangesW  = null;
            }

            if (!gameLoad || !IsDRanger())
            {
                return;
            }

            theQ = meLulz.Spellbook.SpellQ;
            theW = meLulz.Spellbook.SpellW;
            theE = meLulz.Spellbook.SpellE;

            _target = isAABest ? TargetSelector.BestAutoAttackTarget(meLulz) : TargetSelector.ClosestToMouse(meLulz);

            Combo();

            //Console.WriteLine("Q Spell name is: " + theQ.Name);
        }
Пример #4
0
        public void OnDraw()
        {
            if (!menuManager.IsEnabled)
            {
                return;
            }

            if (!target.Locked)
            {
                target.NewTarget(TargetSelector.ClosestToMouse(hero, 600));
            }

            if (!target.IsValid() || hero.Distance2D(target.GetPosition()) > 1400 && !target.Locked || !hero.IsAlive)
            {
                if (targetParticle != null)
                {
                    targetParticle.Dispose();
                    targetParticle = null;
                }
                return;
            }

            if (targetParticle == null)
            {
                targetParticle = new ParticleEffect(
                    @"particles\ui_mouseactions\range_finder_tower_aoe.vpcf",
                    target.GetPosition(true));
            }

            targetParticle.SetControlPoint(2, heroPosition = hero.Position);
            targetParticle.SetControlPoint(6, new Vector3(1, 0, 0));
            targetParticle.SetControlPoint(7, target.GetPosition(true));
        }
Пример #5
0
 public static async Task TargetFinder(CancellationToken cancellationToken)
 {
     while (Core.Target == null || !Core.Target.IsValid || !Core.Target.IsAlive)
     {
         Core.Target = TargetSelector.ClosestToMouse(Core.MainHero.Hero, 500);
         Printer.Both($"[TargetFinder] new target: {Core.Target.Name} | {Core.Target.Handle}");
         await Task.Delay(100, cancellationToken);
     }
 }
Пример #6
0
        public Unit GetTarget()
        {
            var target = TargetSelector.ClosestToMouse(Owner, 500);

            if (target != null && (Owner.IsValidOrbwalkingTarget(target) || UnitExtensions.HasModifier(Owner, "modifier_item_hurricane_pike_range")))
            {
                return(target);
            }
            return(null);
        }
        private async Task ExecuteAsync(CancellationToken arg)
        {
            while (true)
            {
                while (_target == null || !_target.IsValid)
                {
                    _target = TargetSelector.ClosestToMouse(_me);
                    await Task.Delay(10, arg);
                }
                var shadowBlade = _me.GetItemById(AbilityId.item_invis_sword) ?? _me.GetItemById(AbilityId.item_silver_edge);
                if (shadowBlade != null && _ultimate.CanBeCasted())
                {
                    if (shadowBlade.CanBeCasted())
                    {
                        shadowBlade.UseAbility();
                        await Task.Delay(100, arg);
                    }
                }
                else
                {
                    return;
                }

                var distance = _target.Distance2D(_me);
                if (distance > 35 || _target.IsMoving)
                {
                    if (_ultimate.IsInAbilityPhase)
                    {
                        _me.Stop();
                    }
                    _me.Move(_target.NetworkPosition);
                    await Task.Delay(35, arg);
                }
                else
                {
                    if (!_target.IsMoving)
                    {
                        _me.Move(_target.NetworkPosition);
                        await Task.Delay(150, arg);
                    }
                    if (_ultimate.CanBeCasted())
                    {
                        _ultimate.UseAbility();
                        await Task.Delay(350, arg);

                        if (!_me.IsInRange(_target, MenuManager.InvisRange))
                        {
                            _me.Stop();
                            await Task.Delay(25, arg);
                        }
                    }
                }
                await Task.Delay(1, arg);
            }
        }
Пример #8
0
 private static async Task <Hero> FindTarget(CancellationToken token)
 {
     while (_target == null || !_target.IsValid || !_target.IsAlive)
     {
         _target = TargetSelector.ClosestToMouse(Me);
         if (_target != null && _target.IsValid && _target.IsAlive)
         {
             return(_target);
         }
         await Task.Delay(250, token);
     }
     return(null);
 }
Пример #9
0
 public static bool TargetFinder()
 {
     if (Core.Target != null && Core.Target.IsValid && Core.Target.IsAlive)
     {
         return(true);
     }
     Core.Target = TargetSelector.ClosestToMouse(Core.MainHero.Hero, 500);
     if (Core.Target == null)
     {
         return(false);
     }
     Printer.Both($"[TargetFinder] new target: {Core.Target.Name} | {Core.Target.Handle}");
     return(true);
 }
Пример #10
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);
            }
        }
Пример #11
0
        public virtual void AttackTarget(Hero target = null, bool follow = false)
        {
            if (target == null)
            {
                if (GlobalTarget == null || !GlobalTarget.IsValid)
                {
                    GlobalTarget = TargetSelector.ClosestToMouse(Me);
                }
            }
            if (_orb == null)
            {
                _orb = new Orbwalker(Me);
            }
            var tempTarget = (GlobalTarget != null && GlobalTarget.IsValid) || target == null ? GlobalTarget : target;

            _orb.OrbwalkOn(tempTarget, followTarget: MenuManager.GetComboBehavior == 0 || target == null);
        }
Пример #12
0
        public virtual void DoCombo(Hero target = null)
        {
            if (target == null)
            {
                if (GlobalTarget == null || !GlobalTarget.IsValid)
                {
                    GlobalTarget = TargetSelector.ClosestToMouse(Me);
                }
            }
            if (Me.IsChanneling() || Me.Spellbook().Spells.Any(x => x.IsInAbilityPhase))
            {
                return;
            }
            var tempTarget = (GlobalTarget != null && GlobalTarget.IsValid) || target == null ? GlobalTarget : target;

            AttackTarget(tempTarget, target == null);
            UseItems(tempTarget);
            UseAbilities(tempTarget);
        }
Пример #13
0
        public void OnDraw()
        {
            if (!menuManager.IsEnabled)
            {
                return;
            }

            if (!target.Locked)
            {
                target.NewTarget(TargetSelector.ClosestToMouse(hero, 600));
            }

            if (!target.IsValid() || hero.Distance2D(target.GetPosition()) > 1400 && !target.Locked || !hero.IsAlive)
            {
                if (targetParticle != null)
                {
                    targetParticle.Dispose();
                    targetParticle = null;
                }
                return;
            }

            //if (debug == null)
            //{
            //    debug = new ParticleEffect(
            //        @"materials\ensage_ui\particles\drag_selected_ring_mod.vpcf",
            //        target.GetPosition());
            //    debug.SetControlPoint(1, new Vector3(0, 255, 0));
            //    debug.SetControlPoint(2, new Vector3(50, 255, 0));
            //}
            //debug.SetControlPoint(0, TimberPrediction.PredictedXYZ(target, 700));

            if (targetParticle == null)
            {
                targetParticle = new ParticleEffect(
                    @"particles\ui_mouseactions\range_finder_tower_aoe.vpcf",
                    target.GetPosition(true));
            }

            targetParticle.SetControlPoint(2, hero.Position);
            targetParticle.SetControlPoint(6, new Vector3(1, 0, 0));
            targetParticle.SetControlPoint(7, target.GetPosition(true));
        }
Пример #14
0
 public Hero GetTarget(bool otherChecks = true)
 {
     if (_globalTarget != null && _globalTarget.IsAlive)
     {
         if (otherChecks)
         {
             if (!Owner.IsValidOrbwalkingTarget(_globalTarget) &&
                 !UnitExtensions.HasModifier(Owner, "modifier_item_hurricane_pike_range"))
             {
                 return(null);
             }
         }
         return(_globalTarget);
     }
     _globalTarget = TargetSelector.ClosestToMouse(Owner);
     if (_globalTarget != null &&
         (!otherChecks || Owner.IsValidOrbwalkingTarget(_globalTarget) ||
          UnitExtensions.HasModifier(Owner, "modifier_item_hurricane_pike_range")))
     {
         return(_globalTarget);
     }
     return(null);
 }
Пример #15
0
        protected override async Task Execute(CancellationToken token)
        {
            if (!this.IsComboReady)
            {
                return;
            }

            if (InvokerMenu.IsPrepareKeyPressed || !this.IsInvoked)
            {
                await this.PrepareCombo();

                return;
            }

            if (!this.IsReady)
            {
                return;
            }

            this.Target = TargetSelector.ClosestToMouse(this.Me);
            if (this.Target == null)
            {
                return;
            }



            foreach (var comboAbility in this.AbilitySequence)
            {
                await comboAbility.ExecuteAsync(this.Target, token);
            }

            await Await.Delay(250, token);

            this.executed = true;
        }
Пример #16
0
        private void OnEvadePathUpdate(EventArgs args)
        {
            if (Utils.SleepCheck("unitcleanup"))
            {
                Utils.Sleep(1000 * 10, "unitcleanup");
                Dictionary <Unit, ObstacleUnit> updatedList = new Dictionary <Unit, ObstacleUnit>();
                foreach (var unit in obstacleUnits)
                {
                    if (unit.Key.IsValid && unit.Key.Health > 0)
                    {
                        updatedList.Add(unit.Key, unit.Value);
                    }
                    else
                    {
                        pathfinding.RemoveObstacle(unit.Value.ID);
                    }
                }
                obstacleUnits = updatedList;
            }

            if (Game.IsPaused)
            {
                return;
            }

            if ((autoEvade || evadePressed || orbwalkerPressed || evadeMovePressed) && Utils.SleepCheck("evadeupdate"))
            {
                Utils.Sleep(125, "evadeupdate");

                pathfinding.UpdateNavMesh();

                obstaclesIDs          = pathfinding.GetIntersectingObstacleIDs(myHero.Position, myHero.HullRadius).ToList();
                obstaclesPredictedIDs = pathfinding.GetIntersectingObstacleIDs(myHero.BasePredict(350), myHero.HullRadius).ToList();

                if (orbwalkerPressed || evadeMovePressed)
                {
                    movePosition    = Game.MousePosition;
                    isPositionKnown = true;
                }

                bool           tried     = false;
                bool           completed = false;
                List <Vector3> path      = null;
                // test if we're currently on an obstacle
                if (obstaclesIDs.Any())
                {
                    tried        = true;
                    movePosition = GetValidMovePosition(movePosition);

                    float turnRate = myHero.GetTurnRate();

                    List <IObstacle> myList = new List <IObstacle>();
                    if (obstacles.Any())
                    {
                        myList = myList.Concat(obstacles.Where(x => obstaclesIDs.Any(y => y == x.ID))).ToList();
                    }
                    if (obstacleParticles.Any())
                    {
                        myList = myList.Concat(obstacleParticles.Where(x => obstaclesIDs.Any(y => y == x.ID))).ToList();
                    }

                    float timeLeft = TimeLeftFromObstacles(myList);

                    Debugging.WriteLine("Using obstacle algo with time: {0} and distance: {1} and posDiff: {2}", timeLeft, myHero.MovementSpeed * timeLeft / 1000.0f, (movePosition - myHero.Position).Length());

                    path = pathfinding.CalculatePathFromObstacle(
                        myHero.Position,
                        movePosition,
                        myHero.RotationRad,
                        myHero.MovementSpeed,
                        turnRate,
                        timeLeft,
                        true,
                        out completed).ToList();

                    if (Program.Menu.IsDebugDrawPathEnabled)
                    {
                        debugPath = pathfinding.CalculatePathFromObstacle(
                            myHero.Position,
                            movePosition,
                            myHero.RotationRad,
                            myHero.MovementSpeed,
                            turnRate,
                            timeLeft,
                            true,
                            out completed).ToList();
                    }

                    if (completed)
                    {
                        float maxDistance = (movePosition - myHero.Position).Length() * 4;
                        var   toTarget    = pathfinding.CalculateLongPath(
                            path.Last(),
                            movePosition,
                            maxDistance,
                            true,
                            out completed).ToList();

                        if (completed && toTarget.Any())
                        {
                            path = path.Concat(toTarget).ToList();
                        }
                    }
                }
                else if (obstaclesPredictedIDs.Any())
                {
                    tried        = true;
                    movePosition = GetValidMovePosition(movePosition);
                    float maxDistance = (movePosition - myHero.Position).Length() * 4;
                    Debugging.WriteLine("Using normal algo with distance: {0}", maxDistance);
                    path = pathfinding.CalculateLongPath(
                        myHero.Position,
                        movePosition,
                        maxDistance,
                        true,
                        out completed).ToList();
                    if (Program.Menu.IsDebugDrawPathEnabled)
                    {
                        debugPath = pathfinding.CalculateLongPath(
                            myHero.Position,
                            movePosition,
                            maxDistance,
                            false,
                            out completed).ToList();
                    }
                }
                else
                {
                    forcePath = null;
                    debugPath = null;
                }
                if (tried)
                {
                    // if we tried to find a path...
                    if (completed && path.Any())
                    {
                        forcePath         = path;
                        notMovedYetToPath = true;

                        // test if we guessed a position to go
                        if (!isPositionKnown)
                        {
                            pathingMoved = true;
                        }
                    }
                    else
                    {
                        // maybe we are at the spawn and enemy exactly tried to attack there

                        if (!obstaclesIDs.Any())
                        {
                            myHero.Stop();
                            Debugging.WriteLine("stopping to be safe");
                        }
                        else
                        {
                            Debugging.WriteLine("can't run ! panic!! -> use spells");
                        }
                    }
                }
            }

            if (notMovedYetToPath && forcePath != null && forcePath.Any())
            {
                myHero.Move(forcePath[0]);
                for (int i = 1; i < Math.Min(forcePath.Count, 32); ++i)
                {
                    myHero.Move(forcePath[i], true);
                }
                myHero.Move(movePosition, true);
                notMovedYetToPath = false;
            }
            else if (pathingMoved && forcePath == null)
            {
                debugPath    = null;
                pathingMoved = false;
                myHero.Stop();
                Debugging.WriteLine("STOP {0} - {1}", forcePath != null, notMovedYetToPath);
            }
            if ((evadeMovePressed || orbwalkerPressed) && (forcePath == null || !pathingMoved))
            {
                var target = evadeMovePressed ? null : TargetSelector.ClosestToMouse(ObjectManager.LocalHero);
                if (target != null)
                {
                    orbwalker.OrbwalkOn(target);
                }
                else
                {
                    myHero.Move(Game.MousePosition);
                }
            }
        }
Пример #17
0
        protected override async Task Execute(CancellationToken token)
        {
            var prioritizeEvade = ZaioMenu.ShouldRespectEvader;

            if (!ZaioMenu.ShouldLockTarget || Target == null || !Target.IsAlive)
            {
                //Log.Debug($"Find new target");
                // todo: more select0rs
                var oldTarget = Target;
                switch (ZaioMenu.TargetSelectorMode)
                {
                case TargetSelectorMode.NearestToMouse:
                    Target = TargetSelector.ClosestToMouse(MyHero);
                    break;

                case TargetSelectorMode.BestAutoAttackTarget:
                    Target = TargetSelector.BestAutoAttackTarget(MyHero);
                    break;

                case TargetSelectorMode.HighestHealth:
                    Target = TargetSelector.HighestHealthPointsTarget(MyHero, 1000);
                    break;
                }


                if (prioritizeEvade && !Utils.SleepCheck("Evader.Avoiding"))
                {
                    Log.Debug($"abort because evade2");
                    return;
                }

                if (oldTarget != Target)
                {
                    NewTargetAcquired?.Invoke(this, new EntityEventArgs(Target));
                }

                if (Target == null)
                {
                    switch (ZaioMenu.NoTargetMode)
                    {
                    case NoTargetMode.Move:
                        MyHero.Move(Game.MousePosition);
                        break;

                    case NoTargetMode.AttackMove:
                        if (!MyHero.IsAttacking())
                        {
                            MyHero.Attack(Game.MousePosition);
                        }
                        break;
                    }
                    await Await.Delay(125, token);

                    return;
                }
            }

            if (prioritizeEvade && !Utils.SleepCheck("Evader.Avoiding"))
            {
                Log.Debug($"abort because evade3");
                return;
            }


            try
            {
                await ExecuteComboAsync(Target, token);

                await Await.Delay(1, token);
            }
            finally
            {
                _executed = true;
            }
        }
Пример #18
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);
                }
            }
        }
Пример #19
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;
            }
        }
Пример #20
0
        private void OnOnIngameUpdate(EventArgs args)
        {
            Mode = OrbwalkingMode.Idle;
            if (Game.IsPaused || Game.IsChatOpen)
            {
                return;
            }
            if (Members.Menu.Item("Combo.key").GetValue <KeyBind>().Active)
            {
                Mode = OrbwalkingMode.Combo;
            }
            else if (Mode == OrbwalkingMode.Idle)
            {
                EffectManager.Remove("attackTarget" + Owner.Handle);
                return;
            }
            if (TurnEndTime > Game.RawGameTime)
            {
                return;
            }
            var target     = GetTarget();
            var tempTarget = TargetSelector.ClosestToMouse(Owner);

            if (tempTarget != null)
            {
                var blink   = Owner.GetItemById(AbilityId.item_blink);
                var tempPos = new Vector3();
                if (blink != null && blink.CanBeCasted() && blink.CanHit(tempTarget, ref tempPos) && !_sleeper.Sleeping(blink))
                {
                    blink.UseAbility(tempPos);
                    _sleeper.Sleep(300, blink);
                }
                if (!UnitExtensions.HasModifier(tempTarget, "modifier_templar_assassin_trap_slow"))
                {
                    var trap           = UnitExtensions.GetAbilityById(ObjectManager.LocalHero, AbilityId.templar_assassin_psionic_trap);
                    var trapNearTarget =
                        EntityManager <Unit> .Entities.FirstOrDefault(
                            x =>
                            x.IsValid && x.Name == "npc_dota_templar_assassin_psionic_trap" &&
                            Ensage.SDK.Extensions.EntityExtensions.Distance2D(tempTarget, x.Position) <= 400);

                    if (trapNearTarget != null)
                    {
                        if (!_sleeper.Sleeping(trap + "activate"))
                        {
                            var activator = trapNearTarget.Spellbook.Spell1;
                            if (activator.CanBeCasted())
                            {
                                activator.UseAbility();
                            }
                            _sleeper.Sleep(300, trap + "activate");
                        }
                    }
                    else if (trap.CanBeCasted())
                    {
                        if (!_sleeper.Sleeping(trap + "place"))
                        {
                            trap.UseAbility(tempTarget.Position);
                            _sleeper.Sleep(300, trap + "place");
                        }
                    }
                }
            }
            if ((target == null || !CanAttack(target)) && CanMove())
            {
                if (Move(Game.MousePosition))
                {
                    return;
                }
            }

            if (target != null && CanAttack(target))
            {
                LastTarget = target;
                var refraction = UnitExtensions.GetAbilityById(ObjectManager.LocalHero, AbilityId.templar_assassin_refraction);
                if (refraction.CanBeCasted() && !_sleeper.Sleeping(refraction))
                {
                    refraction.UseAbility();
                    _sleeper.Sleep(300, refraction);
                }
                var meld = UnitExtensions.GetAbilityById(ObjectManager.LocalHero, AbilityId.templar_assassin_meld);
                if (meld.CanBeCasted() && !_sleeper.Sleeping(meld))
                {
                    meld.UseAbility();
                    _sleeper.Sleep(300, meld);
                }
                Attack(target);
            }
            if (LastTarget != null && LastTarget.IsValid && LastTarget.IsAlive)
            {
                EffectManager.DrawRange(LastTarget, "attackTarget" + Owner.Handle, 60, Color.Red);
            }
            else
            {
                EffectManager.Remove("attackTarget" + Owner.Handle);
            }
        }
Пример #21
0
        public static void Update(EventArgs args)
        {
            if (!CanUpdate())
            {
                return;
            }

            //var tempSummonlist = Var.Summons;
            //if (MenuVar.LastHitEnable)
            //{
            //    if (Var.Summons.Count > 0 && Var.Summons.Any(x => !x.Key.IsAlive))
            //    {
            //        //foreach (var summon in Var.Summons.Where(x => !x.Key.IsAlive))
            //        //{
            //        //    tempSummonlist.Remove(summon.Key);
            //        //}
            //        //Var.Summons.Clear();
            //        //Var.Summons = tempSummonlist;
            //    }
            //}

            EnemyHeroes.Update();
            AllyHeroes.Update();
            Couriers.Update();

            if (MenuVar.Maphack || MenuVar.DodgeEnable)
            {
                Methods.ShowMeMore.Maphack();
            }

            MenuVar.TestEffectMenu = MainMenu.Menu.Item("effects");

            MenuVar.CameraDistance = MainMenu.MenuSettings.Item("cameradistance");

            if (!Utils.SleepCheck("Update.sleep"))
            {
                return;
            }
            Utils.Sleep(500, "Update.sleep");

            if (MenuVar.ShowRoshanTimer)
            {
                Methods.ShowMeMore.Roshan();
            }

            #region Runes

            Runes.Update();

            #endregion Runes

            if (MenuVar.LastHitEnable && MenuVar.SummonsEnable || MenuVar.StackKey)
            {
                Common.UpdateAttackableSummons();
            }

            #region Menu

            MainMenu.Update();

            #endregion Menu

            #region Hero

            Var.Q = Var.Me.Spellbook.SpellQ;
            Var.W = Var.Me.Spellbook.SpellW;
            Var.E = Var.Me.Spellbook.SpellE;
            Var.R = Var.Me.Spellbook.SpellR;

            double apoint = Var.Me.ClassID == ClassID.CDOTA_Unit_Hero_ArcWarden
                ? 0.3
                : UnitDatabase.Units.Find(x => x.UnitName == Var.Me.Name).AttackPoint;
            Var.HeroAPoint = apoint / (1 + Var.Me.AttacksPerSecond * Var.Me.BaseAttackTime / 100) * 1000;

            #endregion Hero

            #region Autoattack

            if (Var.AutoAttackMode != MenuVar.AutoAttackMode)
            {
                switch (MenuVar.AutoAttackMode)
                {
                case 0:
                    Var.AutoAttackMode = 0;
                    Common.Autoattack(Var.AutoAttackMode);
                    break;

                case 1:
                    Var.AutoAttackMode = 1;
                    Common.Autoattack(Var.AutoAttackMode);
                    break;

                case 2:
                    Var.AutoAttackMode = 2;
                    Common.Autoattack(Var.AutoAttackMode);
                    break;
                }
            }

            #endregion Autoattack

            #region Target

            if (Var.Target != null && !Var.Target.IsVisible && !Orbwalking.AttackOnCooldown(Var.Target))
            {
                Var.Target = TargetSelector.ClosestToMouse(Var.Me);
            }
            else if (Var.Target == null || !Orbwalking.AttackOnCooldown(Var.Target))
            {
                var bestAa = Var.Me.BestAATarget();
                if (bestAa != null)
                {
                    Var.Target = Var.Me.BestAATarget();
                }
            }

            #endregion Target

            #region Towers

            if (!Towers.TowerLoad)
            {
                Buildings.GetBuildings();
                Towers.TowerLoad = true;
            }
            //else
            //{
            //    Towers.Load();
            //}

            #endregion Towers
        }
Пример #22
0
        public void RunScript()
        {
            _me = ObjectManager.LocalHero;
            if (!MainMenu.CcMenu.Item("controll").IsActive() || !Game.IsInGame || _me == null || Game.IsPaused ||
                Game.IsChatOpen)
            {
                return;
            }


            var holdKey       = MainMenu.CcMenu.Item("Press Key").GetValue <KeyBind>().Active;
            var toggleKey     = MainMenu.CcMenu.Item("Toogle Key").GetValue <KeyBind>().Active;
            var lockTargetKey = MainMenu.CcMenu.Item("Lock target Key").GetValue <KeyBind>().Active;

            var targetMode = MainMenu.CcMenu.Item("Target mode").GetValue <StringList>().SelectedIndex;

            var targetFindSource = MainMenu.CcMenu.Item("Target find source").GetValue <StringList>().SelectedIndex;
            var targetFindRange  = MainMenu.CcMenu.Item("Target find range").GetValue <Slider>().Value;
            var units            = ObjectManager.GetEntities <Unit>().Where(creep =>
                                                                            (creep.ClassId == ClassId.CDOTA_BaseNPC_Creep_Neutral ||
                                                                             creep.ClassId == ClassId.CDOTA_BaseNPC_Additive ||
                                                                             creep.ClassId == ClassId.CDOTA_BaseNPC_Tusk_Sigil ||
                                                                             creep.ClassId == ClassId.CDOTA_BaseNPC_Invoker_Forged_Spirit ||
                                                                             creep.ClassId == ClassId.CDOTA_BaseNPC_Warlock_Golem ||
                                                                             creep.ClassId == ClassId.CDOTA_BaseNPC_Creep ||
                                                                             creep.ClassId == ClassId.CDOTA_Unit_VisageFamiliar ||
                                                                             creep.ClassId == ClassId.CDOTA_Unit_Brewmaster_PrimalEarth ||
                                                                             creep.ClassId == ClassId.CDOTA_Unit_Brewmaster_PrimalStorm ||
                                                                             creep.ClassId == ClassId.CDOTA_Unit_Brewmaster_PrimalFire ||
                                                                             creep.ClassId == ClassId.CDOTA_NPC_WitchDoctor_Ward ||
                                                                             creep.ClassId == ClassId.CDOTA_Unit_Hero_Beastmaster_Boar ||
                                                                             creep.ClassId == ClassId.CDOTA_Unit_SpiritBear ||
                                                                             creep.ClassId == ClassId.CDOTA_BaseNPC_Venomancer_PlagueWard ||
                                                                             creep.ClassId == ClassId.CDOTA_BaseNPC_ShadowShaman_SerpentWard ||
                                                                             creep.ClassId == ClassId.CDOTA_Unit_Broodmother_Spiderling ||
                                                                             creep.ClassId == ClassId.CDOTA_Unit_Elder_Titan_AncestralSpirit ||
                                                                             creep.IsIllusion
                                                                            ) &&
                                                                            creep.IsAlive &&
                                                                            creep.Team == _me.Team &&
                                                                            creep.IsControllable).ToList();

            if (lockTargetKey)
            {
                _targetLock = TargetSelector.ClosestToMouse(_me, targetFindRange);
            }

            if (_targetLock != null)
            {
                if (_targetLock.IsAlive)
                {
                    _e = _targetLock;
                }
                else
                {
                    switch (targetMode)
                    {
                    case 0:
                        switch (targetFindSource)
                        {
                        case 0:
                            var enemyHero0 = ObjectManager.GetEntities <Hero>().Where(enemy => enemy.Team == _me.GetEnemyTeam() && enemy.IsAlive && !enemy.IsIllusion && enemy.Distance2D(Game.MousePosition) <= targetFindRange).ToList();
                            _e = enemyHero0.MinOrDefault(x => x.Distance2D(_me.Position));
                            break;

                        case 1:
                            _e = TargetSelector.ClosestToMouse(_me, 5000);
                            break;
                        }
                        break;

                    case 1:
                        switch (targetFindSource)
                        {
                        case 0:
                            var enemyHero0 = ObjectManager.GetEntities <Hero>().Where(enemy => enemy.Team == _me.GetEnemyTeam() && enemy.IsAlive && !enemy.IsIllusion && enemy.Distance2D(Game.MousePosition) <= targetFindRange).ToList();
                            _e = enemyHero0.MinOrDefault(x => x.Health);
                            break;

                        case 1:
                            var enemyHero1 = ObjectManager.GetEntities <Hero>().Where(enemy => enemy.Team == _me.GetEnemyTeam() && enemy.IsAlive && !enemy.IsIllusion && enemy.Distance2D(_me.Position) <= targetFindRange).ToList();
                            _e = enemyHero1.MinOrDefault(x => x.Health);
                            break;
                        }
                        break;
                    }
                }
            }
            else
            {
                switch (targetMode)
                {
                case 0:
                    _e = TargetSelector.ClosestToMouse(_me, 5000);
                    break;

                case 1:
                    var enemyHero = ObjectManager.GetEntities <Hero>().Where(enemy => enemy.Team == _me.GetEnemyTeam() && enemy.IsAlive && !enemy.IsIllusion && enemy.Distance2D(Game.MousePosition) <= targetFindRange).ToList();
                    _e = enemyHero.MinOrDefault(x => x.Health);
                    break;
                }
            }
            if (Utils.SleepCheck("delay"))
            {
                if (_me.IsAlive)
                {
                    var count = units.Count();
                    if (count <= 0)
                    {
                        return;
                    }
                    for (int i = 0; i < count; ++i)
                    {
                        var v = ObjectManager.GetEntities <Hero>()
                                .Where(x => x.Team == _me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion).ToList();
                        if (units[i].Name == "npc_dota_juggernaut_healing_ward")

                        {
                            if (_me.Position.Distance2D(units[i].Position) > 5 && Utils.SleepCheck(units[i].Handle.ToString()))
                            {
                                units[i].Move(_me.Position);
                                Utils.Sleep(50, units[i].Handle.ToString());
                            }
                        }
                        else if (units[i].Name == "npc_dota_neutral_ogre_magi")
                        {
                            for (var z = 0; z < v.Count(); ++z)
                            {
                                var armor = units[i].Spellbook.SpellQ;

                                if ((!v[z].HasModifier("modifier_ogre_magi_frost_armor") || !_me.HasModifier("modifier_ogre_magi_frost_armor")) && armor.CanBeCasted() && units[i].Position.Distance2D(v[z]) <= 900 &&
                                    Utils.SleepCheck(units[i].Handle.ToString()))
                                {
                                    armor.UseAbility(v[z]);
                                    Utils.Sleep(400, units[i].Handle.ToString());
                                }
                            }
                        }
                        else if (units[i].Name == "npc_dota_neutral_forest_troll_high_priest")
                        {
                            if (units[i].Spellbook.SpellQ.CanBeCasted())
                            {
                                for (var z = 0; z < v.Count(); ++z)
                                {
                                    if (units[i].Position.Distance2D(v[z]) <= 900 &&
                                        Utils.SleepCheck(units[i].Handle + "high_priest"))
                                    {
                                        units[i].Spellbook.SpellQ.UseAbility(v[z]);
                                        Utils.Sleep(350, units[i].Handle + "high_priest");
                                    }
                                }
                            }
                        }


                        if (_e == null)
                        {
                            return;
                        }

                        if (_e.IsAlive && !_e.IsInvul() && (holdKey || toggleKey))
                        {
                            //spell
                            var checkStun  = _e.HasModifier("modifier_centaur_hoof_stomp");
                            var checkSetka = _e.HasModifier("modifier_dark_troll_warlord_ensnare");
                            if (units[i].Name == "npc_dota_neutral_dark_troll_warlord")
                            {
                                if (_e.Position.Distance2D(units[i].Position) < 550 && (!checkSetka || !checkStun || !_e.IsHexed() || !_e.IsStunned()) && units[i].Spellbook.SpellQ.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle + "warlord"))
                                {
                                    units[i].Spellbook.SpellQ.UseAbility(_e);
                                    Utils.Sleep(450, units[i].Handle + "warlord");
                                }
                            }
                            else if (units[i].Name == "npc_dota_neutral_big_thunder_lizard")
                            {
                                if (_e.Position.Distance2D(units[i].Position) < 250 && units[i].Spellbook.SpellQ.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle + "lizard"))
                                {
                                    units[i].Spellbook.SpellQ.UseAbility();
                                    Utils.Sleep(450, units[i].Handle + "lizard");
                                }
                                if (_e.Position.Distance2D(units[i].Position) < 550 && units[i].Spellbook.SpellW.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle + "lizard"))
                                {
                                    units[i].Spellbook.SpellW.UseAbility();
                                    Utils.Sleep(450, units[i].Handle + "lizard");
                                }
                            }
                            else if (units[i].Name == "npc_dota_neutral_centaur_khan")
                            {
                                if (_e.Position.Distance2D(units[i].Position) < 200 && (!checkSetka || !checkStun || !_e.IsHexed() || !_e.IsStunned()) && units[i].Spellbook.SpellQ.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle + "centaur"))
                                {
                                    units[i].Spellbook.SpellQ.UseAbility();
                                    Utils.Sleep(450, units[i].Handle + "centaur");
                                }
                            }
                            else if (units[i].Name == "npc_dota_neutral_satyr_hellcaller")
                            {
                                if (_e.Position.Distance2D(units[i].Position) < 850 && units[i].Spellbook.SpellQ.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle + "satyr"))
                                {
                                    units[i].Spellbook.SpellQ.UseAbility(_e);
                                    Utils.Sleep(350, units[i].Handle + "satyr");
                                }
                            }
                            else if (units[i].Name == "npc_dota_neutral_satyr_trickster")
                            {
                                if (_e.Position.Distance2D(units[i].Position) < 850 && units[i].Spellbook.SpellQ.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle + "satyr_trickster"))
                                {
                                    units[i].Spellbook.SpellQ.UseAbility(_e);
                                    Utils.Sleep(350, units[i].Handle + "satyr_trickster");
                                }
                            }
                            else if (units[i].Name == "npc_dota_neutral_satyr_soulstealer")
                            {
                                if (_e.Position.Distance2D(units[i].Position) < 850 && units[i].Spellbook.SpellQ.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle + "satyrsoulstealer"))
                                {
                                    units[i].Spellbook.SpellQ.UseAbility(_e);
                                    Utils.Sleep(350, units[i].Handle + "satyrsoulstealer");
                                }
                            }
                            else if (units[i].Name == "npc_dota_neutral_black_dragon")
                            {
                                if (_e.Position.Distance2D(units[i].Position) < 700 && units[i].Spellbook.SpellQ.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle + "dragonspawn"))
                                {
                                    units[i].Spellbook.SpellQ.UseAbility(_e.Predict(600));
                                    Utils.Sleep(350, units[i].Handle + "dragonspawn");
                                }
                            }
                            else if (units[i].Name == "npc_dota_neutral_big_thunder_lizard")
                            {
                                if (_e.Position.Distance2D(units[i].Position) < 200 && units[i].Spellbook.SpellQ.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle + "lizard"))
                                {
                                    units[i].Spellbook.SpellQ.UseAbility();
                                    Utils.Sleep(350, units[i].Handle + "lizard");
                                }

                                for (var z = 0; z < v.Count(); z++)
                                {
                                    if (units[i].Spellbook.SpellW.CanBeCasted() && units[i].Position.Distance2D(v[z]) <= 900)
                                    {
                                        if (_e.Position.Distance2D(v[z]) < v[z].AttackRange + 150 &&
                                            Utils.SleepCheck(units[i].Handle + "lizard"))
                                        {
                                            units[i].Spellbook.SpellW.UseAbility(v[z]);
                                            Utils.Sleep(350, units[i].Handle + "lizard");
                                        }
                                    }
                                }
                            }
                            else if (units[i].Name == "npc_dota_neutral_mud_golem")
                            {
                                if (_e.Position.Distance2D(units[i].Position) < 850 && (!checkSetka || !checkStun || !_e.IsHexed() || !_e.IsStunned()) &&
                                    units[i].Spellbook.SpellQ.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle + "golem"))
                                {
                                    units[i].Spellbook.SpellQ.UseAbility(_e);
                                    Utils.Sleep(350, units[i].Handle + "golem");
                                }
                            }
                            else if (units[i].Name == "npc_dota_neutral_polar_furbolg_ursa_warrior")
                            {
                                if (_e.Position.Distance2D(units[i].Position) < 240 && units[i].Spellbook.SpellQ.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle + "ursa"))
                                {
                                    units[i].Spellbook.SpellQ.UseAbility();
                                    Utils.Sleep(350, units[i].Handle + "ursa");
                                }
                            }
                            else if (units[i].Name == "npc_dota_neutral_harpy_storm")
                            {
                                if (_e.Position.Distance2D(units[i].Position) < 900 && units[i].Spellbook.SpellQ.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle + "harpy"))
                                {
                                    units[i].Spellbook.SpellQ.UseAbility(_e);
                                    Utils.Sleep(350, units[i].Handle + "harpy");
                                }
                            }
                            else if (units[i].ClassId == ClassId.CDOTA_BaseNPC_Tusk_Sigil)
                            {
                                if (_e.Position.Distance2D(units[i].Position) < 1550 &&
                                    Utils.SleepCheck(units[i].Handle.ToString()))
                                {
                                    units[i].Move(_e.Predict(1500));
                                    Utils.Sleep(700, units[i].Handle.ToString());
                                }
                            }
                            else if (units[i].ClassId == ClassId.CDOTA_BaseNPC_Creep)
                            {
                                if (units[i].Name == "npc_dota_necronomicon_archer")
                                {
                                    if (_e.Position.Distance2D(units[i].Position) <= 700 && units[i].Spellbook.SpellQ.CanBeCasted() &&
                                        Utils.SleepCheck(units[i].Handle.ToString()))

                                    {
                                        units[i].Spellbook.SpellQ.UseAbility(_e);
                                        Utils.Sleep(300, units[i].Handle.ToString());
                                    }
                                }
                            }
                            else if (units[i].ClassId == ClassId.CDOTA_Unit_VisageFamiliar)
                            {
                                var damageModif = units[i].Modifiers.FirstOrDefault(x => x.Name == "modifier_visage_summon_familiars_damage_charge");

                                if (_e.Position.Distance2D(units[i].Position) < 1550 && units[i].Health < 6 && units[i].Spellbook.Spell1.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle.ToString()))
                                {
                                    units[i].Spellbook.Spell1.UseAbility();
                                    Utils.Sleep(200, units[i].Handle.ToString());
                                }

                                if (_e.Position.Distance2D(units[i].Position) < 340 && ((damageModif.StackCount < 1) && !_e.IsStunned()) && units[i].Spellbook.Spell1.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle.ToString()))
                                {
                                    units[i].Spellbook.Spell1.UseAbility();
                                    Utils.Sleep(350, units[i].Handle.ToString());
                                }
                            }
                            else if (units[i].ClassId == ClassId.CDOTA_Unit_Brewmaster_PrimalEarth)
                            {
                                if (_e.Position.Distance2D(units[i].Position) < 1300 &&
                                    units[i].Spellbook.SpellQ.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle.ToString()))
                                {
                                    units[i].Spellbook.SpellQ.UseAbility(_e);
                                    Utils.Sleep(400, units[i].Handle.ToString());
                                }
                                if (_e.Position.Distance2D(units[i].Position) < 340 &&
                                    units[i].Spellbook.SpellR.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle.ToString()))
                                {
                                    units[i].Spellbook.SpellR.UseAbility();
                                    Utils.Sleep(400, units[i].Handle.ToString());
                                }
                            }
                            else if (units[i].ClassId == ClassId.CDOTA_Unit_Brewmaster_PrimalStorm)
                            {
                                if (_e.Position.Distance2D(units[i].Position) < 700 &&
                                    units[i].Spellbook.SpellQ.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle.ToString()))
                                {
                                    units[i].Spellbook.SpellQ.UseAbility(_e.Position);
                                    Utils.Sleep(400, units[i].Handle.ToString());
                                }
                                if (_e.Position.Distance2D(units[i].Position) < 900 &&
                                    units[i].Spellbook.SpellE.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle.ToString()))
                                {
                                    units[i].Spellbook.SpellE.UseAbility();
                                    Utils.Sleep(400, units[i].Handle.ToString());
                                }
                                if (_e.Position.Distance2D(units[i].Position) < 850 &&
                                    units[i].Spellbook.SpellR.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle.ToString()))
                                {
                                    units[i].Spellbook.SpellR.UseAbility(_e);
                                    Utils.Sleep(400, units[i].Handle.ToString());
                                }
                            }
                            else if (units[i].ClassId == ClassId.CDOTA_Unit_SpiritBear)
                            {
                                if ((!_me.AghanimState() && _me.Position.Distance2D(units[i]) <= 1200) || _me.AghanimState())
                                {
                                    _abyssal = units[i].FindItem("item_abyssal_blade");

                                    _mjollnir = units[i].FindItem("item_mjollnir");

                                    _boots = units[i].FindItem("item_phase_boots");

                                    _midas = units[i].FindItem("item_hand_of_midas");

                                    _mom = units[i].FindItem("item_mask_of_madness");

                                    _medall = units[i].FindItem("item_medallion_of_courage") ?? units[i].FindItem("item_solar_crest");


                                    if (_boots != null && _e.Position.Distance2D(units[i].Position) < 1550 && _boots.CanBeCasted() &&
                                        Utils.SleepCheck(units[i].Handle.ToString()))
                                    {
                                        _boots.UseAbility();
                                        Utils.Sleep(350, units[i].Handle.ToString());
                                    }
                                    if (_mjollnir != null && _e.Position.Distance2D(units[i].Position) < 525 && _mjollnir.CanBeCasted() &&
                                        Utils.SleepCheck(units[i].Handle.ToString()))
                                    {
                                        _mjollnir.UseAbility(units[i]);
                                        Utils.Sleep(350, units[i].Handle.ToString());
                                    }
                                    if (_medall != null && _e.Position.Distance2D(units[i].Position) < 525 && _medall.CanBeCasted() &&
                                        Utils.SleepCheck(units[i].Handle.ToString()))
                                    {
                                        _medall.UseAbility(_e);
                                        Utils.Sleep(350, units[i].Handle.ToString());
                                    }

                                    if (_mom != null && _e.Position.Distance2D(units[i].Position) < 525 && _mom.CanBeCasted() &&
                                        Utils.SleepCheck(units[i].Handle.ToString()))
                                    {
                                        _mom.UseAbility();
                                        Utils.Sleep(350, units[i].Handle.ToString());
                                    }
                                    if (_abyssal != null && _e.Position.Distance2D(units[i].Position) < 500 && _abyssal.CanBeCasted() &&
                                        Utils.SleepCheck(units[i].Handle.ToString()))
                                    {
                                        _abyssal.UseAbility(_e);
                                        Utils.Sleep(350, units[i].Handle.ToString());
                                    }
                                    if (_midas != null)
                                    {
                                        var neutrals = ObjectManager.GetEntities <Creep>().Where(creep => (creep.ClassId == ClassId.CDOTA_BaseNPC_Creep_Lane || creep.ClassId == ClassId.CDOTA_BaseNPC_Creep_Siege || creep.ClassId == ClassId.CDOTA_BaseNPC_Creep_Neutral || creep.ClassId == ClassId.CDOTA_BaseNPC_Invoker_Forged_Spirit || creep.ClassId == ClassId.CDOTA_BaseNPC_Creep) &&
                                                                                                 creep.IsAlive && creep.IsVisible && creep.IsSpawned && creep.Distance2D(units[i]) <= 700 && creep.Team != _me.Team).OrderBy(x => x.Health).LastOrDefault();

                                        if (_midas.CanBeCasted() && Utils.SleepCheck(neutrals.Handle.ToString()))
                                        {
                                            _midas.UseAbility(neutrals);
                                            Utils.Sleep(350, neutrals.Handle.ToString());
                                        }
                                    }
                                }
                            }
                            else if (units[i].ClassId == ClassId.CDOTA_BaseNPC_Additive)
                            {
                                if (units[i].Name == "npc_dota_templar_assassin_psionic_trap")
                                {
                                    if (_e.Position.Distance2D(units[i].Position) < 250 &&
                                        units[i].Spellbook.Spell1.CanBeCasted() &&
                                        _e.Distance2D(Game.MousePosition) <= 1000 &&
                                        Utils.SleepCheck(units[i].Handle.ToString()))
                                    {
                                        units[i].Spellbook.Spell1.UseAbility();
                                        Utils.Sleep(250, units[i].Handle.ToString());
                                    }
                                }
                            }
                            if (units[i].Distance2D(_e) <= units[i].AttackRange + 100 && !_e.IsAttackImmune() &&
                                !units[i].IsAttacking() && units[i].CanAttack() && Utils.SleepCheck(units[i].Handle + "Attack")
                                )
                            {
                                units[i].Attack(_e);
                                Utils.Sleep(250, units[i].Handle + "Attack");
                            }
                            else if (!units[i].CanAttack() && !units[i].IsAttacking() &&
                                     units[i].CanMove() && units[i].Distance2D(_e) <= 4000 && Utils.SleepCheck(units[i].Handle + "Move")
                                     )
                            {
                                units[i].Move(_e.Predict(300));
                                Utils.Sleep(350, units[i].Handle + "Move");
                            }
                            else if (units[i].Distance2D(_e) >= units[i].GetAttackRange() && !units[i].IsAttacking() &&
                                     units[i].CanMove() && units[i].Distance2D(_e) <= 4000 && Utils.SleepCheck(units[i].Handle + "MoveAttack")
                                     )
                            {
                                units[i].Move(_e.Predict(300));
                                Utils.Sleep(350, units[i].Handle + "MoveAttack");
                            }
                        }
                        Utils.Sleep(500, "delay");
                    }
                }
            }
        }
Пример #23
0
        public static void OnUpdate(EventArgs args)
        {
            return;

            if (!MenuManager.EulComboIsActive)
            {
                _target = null;
                return;
            }

            if (Game.IsPaused)
            {
                return;
            }

            if (!Ultimate.CanBeCasted())
            {
                return;
            }

            if (_target == null || !_target.IsValid || !_target.IsAlive)
            {
                _target = TargetSelector.ClosestToMouse(Me);
                return;
            }
            if (_target.IsLinkensProtected() || _target.HasModifier("modifier_item_lotus_orb_active"))
            {
                return;
            }
            if (_eul == null || !_eul.IsValid)
            {
                _eul = Me.GetItemById(ItemId.item_cyclone);
            }
            if (_veil == null || !_veil.IsValid)
            {
                _veil = Me.GetItemById(ItemId.item_veil_of_discord);
            }
            if (_bkb == null || !_bkb.IsValid)
            {
                _bkb = Me.GetItemById(ItemId.item_black_king_bar);
            }
            if (_blink == null || !_blink.IsValid)
            {
                _blink = Me.GetItemById(ItemId.item_blink);
            }
            if (_eb == null || !_eb.IsValid)
            {
                _eb = Me.GetItemById(ItemId.item_ethereal_blade);
            }

            var distance = _target.NetworkPosition.Distance2D(Me.NetworkPosition);

            if (_eul != null && _eul.CanBeCasted() && !EulSleeper.Sleeping)
            {
                if (_eb != null && _eb.CanBeCasted() && !ExtSleeper.Sleeping(_eb) && _eb.CanHit(_target))
                {
                    _eb.UseAbility(_target);
                    ExtSleeper.Sleep(1000, _eb + "caster");
                    ExtSleeper.Sleep(500, _eb);
                }
                if (_eb != null)
                {
                    if (ExtSleeper.Sleeping(_eb + "caster") &&
                        !_target.HasModifier("modifier_item_ethereal_blade_ethereal"))
                    {
                        return;
                    }
                }
                if (_veil != null && _veil.CanBeCasted() && !ExtSleeper.Sleeping(_veil) && _veil.CanHit(_target))
                {
                    _veil.UseAbility(_target.Position);
                    ExtSleeper.Sleep(500, _veil);
                }
                if (distance >= 1200)
                {
                    if (MoveSleeper.Sleeping)
                    {
                        return;
                    }
                    MoveSleeper.Sleep(250);
                    Me.Move(_target.Position);
                    return;
                }
                EulSleeper.Sleep(250);
                _eul.UseAbility(_target);
                return;
            }
            var modifier = _target.FindModifier("modifier_eul_cyclone");
            var ping     = Game.Ping / 1000;

            if (Ultimate.IsInAbilityPhase)
            {
                return;
            }
            if (modifier == null)
            {
                return;
            }
            if (_bkb != null && _bkb.CanBeCasted() && !ExtSleeper.Sleeping(_bkb) && MenuManager.BkbIsEulCombo)
            {
                _bkb.UseAbility();
                ExtSleeper.Sleep(500, _bkb);
            }
            if (modifier.RemainingTime - ping < 1.1)
            {
                return;
            }
            if (_blink != null && _blink.CanBeCasted() && !BlinkSleeper.Sleeping)
            {
                BlinkSleeper.Sleep(250);
                _blink.UseAbility(_target.NetworkPosition);
            }
            else
            {
                var extraTime = MenuManager.EulExtraTime / 1000;
                if (distance >= 60)
                {
                    if (MoveSleeper.Sleeping)
                    {
                        return;
                    }
                    MoveSleeper.Sleep(250);
                    Me.Move(_target.NetworkPosition);
                }
                else if (modifier.RemainingTime - ping -
                         extraTime <= 1.67 && !UltimateSleeper.Sleeping)
                {
                    UltimateSleeper.Sleep(250);
                    Ultimate.UseAbility();
                }
            }
        }
Пример #24
0
        private static async Task Action(CancellationToken cancellationToken)
        {
            if (_globalTarget == null || !_globalTarget.IsValid || !_globalTarget.IsAlive)
            {
                _globalTarget = TargetSelector.ClosestToMouse(Members.MyHero);
                return;
            }
            if (_targetEffect == null || !_targetEffect.IsValid)
            {
                _targetEffect = new ParticleEffect("materials/ensage_ui/particles/target.vpcf", Members.MyHero);
                _targetEffect.SetControlPoint(2, Members.MyHero.Position);
                _targetEffect.SetControlPoint(5, new Vector3(0, 155, 255));
                _targetEffect.SetControlPoint(6, new Vector3(255));
                _targetEffect.SetControlPoint(7, _globalTarget.Position);
            }
            var     target = _globalTarget;
            Ability ult;
            var     notInInvis = !Members.MyHero.IsInvisible() &&
                                 !Members.MyHero.HasModifiers(new[]
                                                              { "modifier_item_invisibility_edge_windwalk", "modifier_item_silver_edge_windwalk" }) &&
                                 !ComboSleeper.Sleeping("invisAction");

            if (notInInvis)
            {
                if (Members.MyHero.FindItem("item_blink", true) != null)
                {
                    await UseBlink(target, cancellationToken);
                }
                else if (Members.MyHero.FindItem("item_invis_sword", true) != null ||
                         Members.MyHero.FindItem("item_silver_edge", true) != null)
                {
                    await UseInvis(target, cancellationToken);
                }
                //await UseAbility(new Ability(), Target, cancellationToken);

                var inventory =
                    Members.MyHero.Inventory.Items.Where(
                        x =>
                        /*x.CanBeCasted() &&*/
                        !(x.TargetTeamType == TargetTeamType.Enemy || x.TargetTeamType == TargetTeamType.All ||
                          x.TargetTeamType == TargetTeamType.Custom) ||
                        x.CanHit(target) || x.IsAbilityBehavior(AbilityBehavior.UnitTarget))
                    .Where(x => x.CanBeCasted());
                var enumerable = inventory as Item[] ?? inventory.ToArray();

                var linkerBreakers =
                    enumerable.Where(
                        x =>
                        Helper.IsItemEnable(x, false) && target.IsLinkensProtected() && !ComboSleeper.Sleeping(x));

                foreach (var item in linkerBreakers)
                {
                    await UseItem(item, target, cancellationToken);
                }
                var itemInCombo =
                    enumerable.Where(
                        x => Helper.IsItemEnable(x) && !target.IsLinkensProtected() && !ComboSleeper.Sleeping(x));
                foreach (var item in itemInCombo)
                {
                    await UseItem(item, target, cancellationToken);
                }

                ult = Members.MyHero.FindSpell(Members.AbilityList[2]);
                if (ult.CanBeCasted() && !target.IsLinkensProtected())
                {
                    if (true)//(ult.CanHit(target))
                    {
                        ult.UseAbility(target);

                        await Task.Delay(350, cancellationToken);
                    }
                }
            }
            ult = Members.MyHero.FindSpell(Members.AbilityList[2]);
            if (!ult.CanBeCasted() || !notInInvis)
            {
                if (OrbEnable && (!target.IsStunned() || !OrbInStun))
                {
                    try
                    {
                        Orbwalking.Orbwalk(target, followTarget: OrbFollow);
                    }
                    catch
                    {
                        // ignored
                    }
                }
                else if (Utils.SleepCheck("attack_rate"))
                {
                    if (!Members.MyHero.IsAttacking())
                    {
                        Members.MyHero.Attack(target);
                        Utils.Sleep(125, "attack_rate");
                    }
                }
            }
        }
Пример #25
0
 /// <summary>
 ///     The closest to mouse target.
 /// </summary>
 /// <param name="source">
 ///     The source.
 /// </param>
 /// <param name="range">
 ///     The range.
 /// </param>
 /// <returns>
 ///     The <see cref="Hero" />.
 /// </returns>
 public static Hero ClosestToMouseTarget(this Unit source, float range = 1000)
 {
     return(TargetSelector.ClosestToMouse(source, range));
 }
Пример #26
0
        private static void Action(EventArgs args)
        {
            Q = me.Spellbook.SpellQ;
            W = me.Spellbook.SpellW;
            E = me.Spellbook.SpellE;
            R = me.Spellbook.SpellR;
            // Item
            ethereal = me.FindItem("item_ethereal_blade");
            cyclone  = me.FindItem("item_cyclone");
            force    = me.FindItem("item_force_staff");
            urn      = me.FindItem("item_urn_of_shadows");
            glimmer  = me.FindItem("item_glimmer_cape");
            bkb      = me.FindItem("item_black_king_bar");
            mail     = me.FindItem("item_blade_mail");
            lotus    = me.FindItem("item_lotus_orb");
            vail     = me.FindItem("item_veil_of_discord");
            cheese   = me.FindItem("item_cheese");
            ghost    = me.FindItem("item_ghost");
            orchid   = me.FindItem("item_orchid") ?? me.FindItem("item_bloodthorn");
            atos     = me.FindItem("item_rod_of_atos");
            soul     = me.FindItem("item_soul_ring");
            arcane   = me.FindItem("item_arcane_boots");
            blink    = me.FindItem("item_blink");
            shiva    = me.FindItem("item_shivas_guard");
            shadB    = me.FindItem("item_silver_edge") ?? me.FindItem("item_invis_sword");
            dagon    = me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon"));
            travel   = me.FindItem("item_travel_boots") ?? me.FindItem("item_travel_boots_2") ?? me.FindItem("item_tpscroll");
            e        = TargetSelector.ClosestToMouse(me, 5000);
            enemies  = ObjectManager.GetEntities <Hero>()
                       .Where(x => x.IsAlive && x.Team != me.Team && !x.IsIllusion && x.Distance2D(me) <= 4000 &&
                              (!x.HasModifier("modifier_abaddon_borrowed_time") ||
                               !x.HasModifier("modifier_item_blade_mail_reflect")))
                       .ToList();
            if (e == null)
            {
                return;
            }
            if (e.HasModifier("modifier_abaddon_borrowed_time") ||
                e.HasModifier("modifier_item_blade_mail_reflect"))
            {
                e = GetClosestToTarget(enemies, e) ?? null;
                if (Utils.SleepCheck("spam"))
                {
                    Utils.Sleep(5000, "spam");
                }
            }
            if (e == null && Effect != null)
            {
                Effect.Dispose();
                Effect = null;
            }
            if (e == null || !e.IsValid || !e.IsAlive)
            {
                return;
            }
            if (Effect == null || !Effect.IsValid)
            {
                Effect = new ParticleEffect(@"particles\ui_mouseactions\range_finder_tower_aoe.vpcf", e);
                Effect.SetControlPoint(2, new Vector3(me.Position.X, me.Position.Y, me.Position.Z));
                Effect.SetControlPoint(6, new Vector3(1, 0, 0));
                Effect.SetControlPoint(7, new Vector3(e.Position.X, e.Position.Y, e.Position.Z));
            }
            else
            {
                Effect.SetControlPoint(2, new Vector3(me.Position.X, me.Position.Y, me.Position.Z));
                Effect.SetControlPoint(6, new Vector3(1, 0, 0));
                Effect.SetControlPoint(7, new Vector3(e.Position.X, e.Position.Y, e.Position.Z));
            }
            Active = Game.IsKeyDown(Menu.Item("keyBind").GetValue <KeyBind>().Key);
            var debuff = (e.HasModifiers(new[]
            {
                "modifier_storm_spirit_electric_vortex_pull",
                "modifier_sheepstick_debuff",
                "modifier_rod_of_atos_debuff"
            }, false) || e.IsStunned() || e.IsHexed() || e.IsRooted());

            if (me.IsAlive)
            {
                AutoAbilities();
            }

            /*if (Menu.Item("AutoUsage").IsActive())
             * {
             *  // AutoSpells();
             * }*/
            var inUltBall  = me.HasModifier("modifier_storm_spirit_ball_lightning");
            var inOverload = me.HasModifier("modifier_storm_spirit_overload");
            var lotusBuff  = e.HasModifier("modifier_item_lotus_orb_active");
            var inVortex   = e.HasModifier("modifier_storm_spirit_electric_vortex_pull");

            var startManaCost = R.GetAbilityData("ball_lightning_initial_mana_base") +
                                me.MaximumMana / 100 * R.GetAbilityData("ball_lightning_initial_mana_percentage");
            var costPerUnit = (12 + me.MaximumMana * 0.007) / 100.0;
            var distance    = me.Distance2D(e);
            var rManacost   = startManaCost + costPerUnit * Math.Floor(distance / 100) * 100;

            if (Active && Utils.SleepCheck("combosleep") && me.IsAlive)
            {
                Utils.Sleep(250, "combosleep");

                /*try
                 * {*/
                //spell
                sheep = e.ClassId == ClassId.CDOTA_Unit_Hero_Tidehunter ? null : me.FindItem("item_sheepstick");

                //var noBlade = e.HasModifier("modifier_item_blade_mail_reflect");

                if (!lotusBuff)
                {
                    if (e.IsLinkensProtected())
                    {
                        linken(e);
                    }
                    if (
                        // cheese
                        cheese != null &&
                        cheese.CanBeCasted() &&
                        (me.Health <= me.MaximumHealth * 0.3 ||
                         me.Mana <= me.MaximumMana * 0.2) &&
                        distance <= 700 &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(cheese.Name)
                        )
                    {
                        cheese.UseAbility();
                    }
                    if ( // SoulRing Item
                        soul != null &&
                        soul.CanBeCasted() &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(soul.Name) &&
                        me.CanCast() &&
                        me.Health >= me.MaximumHealth * 0.4 &&
                        me.Mana <= me.MaximumMana * 0.2
                        )
                    {
                        soul.UseAbility();
                    }
                    if ( // Arcane Boots Item
                        arcane != null &&
                        arcane.CanBeCasted() &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(arcane.Name) &&
                        me.CanCast() &&
                        me.Mana <= me.MaximumMana * 0.4
                        )
                    {
                        arcane.UseAbility();
                    }

                    uint elsecount = 0;
                    elsecount += 1;
                    if (elsecount == 1 &&
                        R != null &&
                        R.CanBeCasted() &&
                        !R.IsChanneling &&
                        !R.IsInAbilityPhase &&
                        me.Mana >= rManacost &&
                        !inUltBall &&
                        distance >= me.GetAttackRange() &&
                        !e.IsMagicImmune() &&
                        Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(R.Name)
                        )
                    {
                        if (e.NetworkActivity == NetworkActivity.Move)
                        {
                            R.CastSkillShot(e);
                        }
                        else
                        {
                            R.UseAbility(e.Position);
                        }
                    }
                    else
                    {
                        elsecount += 1;
                    }
                    if (vail != null &&
                        vail.CanBeCasted() &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(vail.Name) &&
                        me.CanCast() &&
                        !e.IsMagicImmune()
                        )
                    {
                        vail.UseAbility(e.Position);
                    }
                    if (orchid != null &&
                        orchid.CanBeCasted() &&
                        me.CanCast() &&
                        !e.IsLinkensProtected() &&
                        !e.IsMagicImmune() &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled("item_bloodthorn")
                        )
                    {
                        orchid.UseAbility(e);
                    }
                    if (elsecount == 2 &&
                        me.CanAttack() &&
                        inOverload &&
                        distance <= me.GetAttackRange() &&
                        !e.IsAttackImmune()
                        )
                    {
                        me.Attack(e);
                    }
                    else
                    {
                        elsecount += 1;
                    }
                    if (elsecount == 3 &&
                        dagon != null &&
                        dagon.CanBeCasted() &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled("item_dagon") &&
                        me.CanCast() &&
                        (ethereal == null ||
                         e.HasModifier("modifier_item_ethereal_blade_slow") ||
                         ethereal.Cooldown < 17) &&
                        !e.IsLinkensProtected() &&
                        !e.IsMagicImmune()
                        )
                    {
                        dagon.UseAbility(e);
                    }
                    else
                    {
                        elsecount += 1;
                    }
                    if (elsecount == 4 &&
                        sheep != null &&
                        sheep.CanBeCasted() &&
                        me.CanCast() &&
                        !debuff &&
                        !e.IsLinkensProtected() &&
                        !e.IsMagicImmune() &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(sheep.Name)
                        )
                    {
                        sheep.UseAbility(e);
                    }
                    else
                    {
                        elsecount += 1;
                    }
                    if (elsecount == 5 &&
                        urn != null && urn.CanBeCasted() && urn.CurrentCharges > 0 &&
                        distance <= urn.GetCastRange() &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(urn.Name)
                        )
                    {
                        urn.UseAbility(e);
                    }
                    else
                    {
                        elsecount += 1;
                    }
                    if (elsecount == 6 &&
                        bkb != null &&
                        bkb.CanBeCasted() &&
                        enemies.Count(x => x.Distance2D(me) <= 700) >=
                        Menu.Item("Heel").GetValue <Slider>().Value &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(bkb.Name)
                        )
                    {
                        bkb.UseAbility();
                    }
                    else
                    {
                        elsecount += 1;
                    }
                    if (elsecount == 7 &&
                        lotus != null &&
                        lotus.CanBeCasted() &&
                        enemies.Count(x => x.Distance2D(me) <= 700) >= 1 &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(lotus.Name)
                        )
                    {
                        lotus.UseAbility(me);
                    }
                    else
                    {
                        elsecount += 1;
                    }
                    if (elsecount == 8 &&
                        ethereal != null &&
                        ethereal.CanBeCasted() &&
                        me.CanCast() &&
                        !e.IsLinkensProtected() &&
                        !e.IsMagicImmune() &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(ethereal.Name)
                        )
                    {
                        if (Menu.Item("debuff").GetValue <bool>())
                        {
                            var speed = ethereal.GetAbilityData("projectile_speed");
                            var time  = e.Distance2D(me) / speed;
                            Utils.Sleep((int)(time * 1000.0f + Game.Ping) + 30, "combosleep");
                            ethereal.UseAbility(e);
                        }
                        else
                        {
                            ethereal.UseAbility(e);
                            Utils.Sleep(130, "combosleep");
                        }
                    }
                    else
                    {
                        elsecount += 1;
                    }
                    if (elsecount == 9 &&
                        W != null &&
                        W.CanBeCasted() &&
                        !inOverload &&
                        !debuff &&
                        !me.IsAttacking() &&
                        me.CanCast() &&
                        !e.IsMagicImmune() &&
                        Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(W.Name)
                        )
                    {
                        W.UseAbility(e);
                    }
                    else
                    {
                        elsecount += 1;
                    }
                    if (elsecount == 10 &&
                        Q != null &&
                        Q.CanBeCasted() &&
                        !inOverload &&
                        distance <= Q.GetAbilityData("static_remnant_radius") + me.HullRadius &&
                        Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(Q.Name) &&
                        me.CanCast() &&
                        !e.IsMagicImmune()
                        )
                    {
                        Q.UseAbility();
                    }
                    else
                    {
                        elsecount += 1;
                    }
                    if (elsecount == 11 &&
                        atos != null &&
                        atos.CanBeCasted() &&
                        me.CanCast() &&
                        !debuff &&
                        !e.IsLinkensProtected() &&
                        !e.IsMagicImmune() &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(atos.Name)
                        )
                    {
                        atos.UseAbility(e);
                    }
                    else
                    {
                        elsecount += 1;
                    }
                    if (elsecount == 12 &&
                        shiva != null &&
                        shiva.CanBeCasted() &&
                        me.CanCast() &&
                        !e.IsMagicImmune() &&
                        Menu.Item("Items").GetValue <AbilityToggler>().IsEnabled(shiva.Name) &&
                        distance <= 600
                        )
                    {
                        shiva.UseAbility();
                    }
                    else
                    {
                        elsecount += 1;
                    }
                    if (elsecount == 13 &&
                        R != null &&
                        R.CanBeCasted() &&
                        !inUltBall &&
                        !R.IsInAbilityPhase &&
                        !R.IsChanneling &&
                        !me.IsChanneling() &&
                        (Menu.Item("AutoOverload").GetValue <bool>() && inVortex || !inVortex) &&
                        !inOverload &&
                        distance <= me.AttackRange &&
                        !e.IsMagicImmune() &&
                        Menu.Item("Skills").GetValue <AbilityToggler>().IsEnabled(R.Name)
                        )
                    {
                        R.UseAbility(me.Position);
                    }
                }
                if (Menu.Item("orbwalk").GetValue <bool>())
                {
                    var modifInv = me.IsInvisible();
                    var range    = modifInv
                        ? distance <= me.GetAttackRange() / 100 * Menu.Item("range").GetValue <Slider>().Value
                        : distance >= me.GetAttackRange() / 100 * Menu.Item("range").GetValue <Slider>().Value;

                    if (!e.IsAttackImmune() && range)
                    {
                        Orbwalking.Orbwalk(e, 10, 1600, false, true);
                    }
                    else if (!e.IsAttackImmune() && distance <= me.GetAttackRange() / 100 * Menu.Item("range").GetValue <Slider>().Value&& !e.IsAttackImmune())
                    {
                        Orbwalking.Orbwalk(e, 10, 1600, false, false);
                    }
                }

                /*}
                 * catch (Exception ex)
                 * {
                 *  var st = new System.Diagnostics.StackTrace(ex, true);
                 *  var line = st.GetFrame(0).GetFileLineNumber();
                 *
                 *  Console.WriteLine("Combo exception at line: " + line);
                 * }*/
            }
        }
Пример #27
0
        private static async Task Action(CancellationToken cancellationToken)
        {
            if (_globalTarget == null || !_globalTarget.IsValid || !_globalTarget.IsAlive)
            {
                _globalTarget = TargetSelector.ClosestToMouse(Members.MyHero);
                return;
            }
            var target = _globalTarget;

            if (!Members.MyHero.IsInvisible() &&
                !Members.MyHero.HasModifiers(new[]
                                             { "modifier_item_invisibility_edge_windwalk", "modifier_item_silver_edge_windwalk" }) &&
                !ComboSleeper.Sleeping("invisAction"))
            {
                if (Members.MyHero.FindItem("item_blink", true) != null)
                {
                    await UseBlink(target, cancellationToken);
                }
                else if (Members.MyHero.FindItem("item_invis_sword", true) != null ||
                         Members.MyHero.FindItem("item_silver_edge", true) != null)
                {
                    await UseInvis(target, cancellationToken);
                }
                //await UseAbility(new Ability(), Target, cancellationToken);

                var inventory =
                    Members.MyHero.Inventory.Items.Where(
                        x =>
                        x.CanBeCasted() &&
                        !(x.TargetTeamType == TargetTeamType.Enemy || x.TargetTeamType == TargetTeamType.All ||
                          x.TargetTeamType == TargetTeamType.Custom) ||
                        x.CanHit(target));
                var enumerable = inventory as Item[] ?? inventory.ToArray();

                var linkerBreakers =
                    enumerable.Where(
                        x =>
                        Helper.IsItemEnable(x, false) && target.IsLinkensProtected() && !ComboSleeper.Sleeping(x));

                foreach (var item in linkerBreakers)
                {
                    await UseItem(item, target, cancellationToken);
                }
                var itemInCombo =
                    enumerable.Where(
                        x => Helper.IsItemEnable(x) && !target.IsLinkensProtected() && !ComboSleeper.Sleeping(x));
                foreach (var item in itemInCombo)
                {
                    await UseItem(item, target, cancellationToken);
                }

                var ult = Members.MyHero.FindSpell(Members.AbilityList[2]);
                if (ult.CanBeCasted() && !target.IsLinkensProtected())
                {
                    if (ult.CanHit(target))
                    {
                        ult.UseAbility(target);
                        await Task.Delay(300, cancellationToken);
                    }
                }
            }
            if (OrbEnable && (!target.IsStunned() || !OrbInStun))
            {
                Orbwalking.Orbwalk(target, followTarget: OrbFollow);
            }
            else if (Utils.SleepCheck("attack_rate"))
            {
                if (!Members.MyHero.IsAttacking())
                {
                    Members.MyHero.Attack(target);
                    Utils.Sleep(125, "attack_rate");
                }
            }
        }
Пример #28
0
        public static void Game_OnUpdate(EventArgs args)
        {
            /*Console.WriteLine(new string('-', Console.BufferWidth));
             * foreach (var data in Me.Spellbook.Spell4.AbilitySpecialData)
             * {
             *  Log.Debug($"{data.Name} -> {data.Value} -> {data.Count}");
             * }*/
            if (!MenuManager.IsEnable)
            {
                Target = null;
                return;
            }

            if (Target == null || !Target.IsValid)
            {
                Target = TargetSelector.ClosestToMouse(Me, 150);
            }
            if (Target == null || !Target.IsValid || !Target.IsAlive || Me.IsStunned() || !Me.IsAlive)
            {
                return;
            }

            var zip = Me.GetAbilityById(AbilityId.storm_spirit_ball_lightning);

            if (zip == null || zip.Level == 0)
            {
                return;
            }
            var inUltimate = Me.HasModifier("modifier_storm_spirit_ball_lightning") || zip.IsInAbilityPhase;
            var inPassve   = Me.HasModifier("modifier_storm_spirit_overload");
            var zipLevel   = zip.Level;
            var distance   = Me.Distance2D(Target);

            var travelSpeed   = zip.GetAbilityData("ball_lightning_move_speed", zipLevel - 1);
            var damage        = zip.GetAbilityData("#AbilityDamage", zipLevel - 1) / 100f;
            var damageRadius  = zip.GetAbilityData("ball_lightning_aoe", zipLevel - 1);//50 + 75 * zipLevel;
            var startManaCost = zip.GetAbilityData("ball_lightning_initial_mana_base") +
                                Me.MaximumMana / 100 * zip.GetAbilityData("ball_lightning_initial_mana_percentage");
            var costPerUnit = (12 + Me.MaximumMana * 0.007) / 100.0;

            var totalCost = (int)(startManaCost + costPerUnit * (int)Math.Floor((decimal)distance / 100) * 100);

            var travelTime = distance / travelSpeed;

            var enemyHealth = Target.Health;

            _remainingMana = Me.Mana - totalCost + (Me.ManaRegeneration * (travelTime + 1));

            var hpPerc = Me.Health / (float)Me.MaximumHealth;
            var mpPerc = Me.Mana / Me.MaximumMana;

            if (Utils.SleepCheck("mana_items"))
            {
                var soulring = Me.GetItemById(ItemId.item_soul_ring);
                if (soulring != null && soulring.CanBeCasted() && hpPerc >= .1 && mpPerc <= .7)
                {
                    soulring.UseAbility();
                    Utils.Sleep(200, "mana_items");
                }
                var stick = Me.GetItemById(ItemId.item_magic_stick) ?? Me.GetItemById(ItemId.item_magic_wand);
                if (stick != null && stick.CanBeCasted() && stick.CurrentCharges != 0 && (mpPerc <= .5 || hpPerc <= .5))
                {
                    stick.UseAbility();
                    Utils.Sleep(200, "mana_items");
                }
            }

            #region Ultimate and Attack

            if (!inUltimate && Utils.SleepCheck("castUlt"))
            {
                if (inPassve && distance < Me.AttackRange)
                {
                    /*if (MenuManager.Orbwalker)
                     * {
                     *  Helper.Orbwalk(Me, Target);
                     * }
                     * else */if (Utils.SleepCheck("Attacking") && !Me.IsAttacking())
                    {
                        Me.Attack(Target);
                        Utils.Sleep(Me.AttackSpeedValue, "Attacking");
                        Helper.Print("flush passive");
                    }
                }
                else if (_remainingMana > 0 && Utils.SleepCheck("Attacking"))
                {
                    if (distance >= MenuManager.MinRange)
                    {
                        if (distance >= damageRadius)
                        {
                            zip.UseAbility(Prediction.SkillShotXYZ(Me, Target, (float)zip.FindCastPoint(),
                                                                   travelSpeed,
                                                                   damageRadius)); //TODO mb more accurate

                            /*if (MenuManager.Orbwalker)
                             * {
                             *  Helper.Orbwalk(Me, Target);
                             * }
                             * else*/
                            Me.Attack(Target, true);
                            Helper.Print("[attack][ult] out of range");
                        }
                        else
                        {
                            var remnant = Me.GetAbilityById(AbilityId.ember_spirit_fire_remnant);
                            if (!remnant.CanBeCasted())
                            {
                                zip.UseAbility(Me.Position);
                            }

                            /*if (MenuManager.Orbwalker)
                             * {
                             *  Helper.Orbwalk(Me, Target);
                             * }
                             * else*/
                            Me.Attack(Target, true);
                            Helper.Print("[attack][ult] in range range");
                        }
                        Utils.Sleep(MenuManager.UltRate, "castUlt");
                    }
                    else /*if (Utils.SleepCheck("Attacking"))*/
                    {
                        /*if (MenuManager.Orbwalker)
                         * {
                         *  Helper.Orbwalk(Me, Target);
                         * }
                         * else*/
                        {
                            Me.Attack(Target);
                            Utils.Sleep(750, "Attacking");
                            Helper.Print("[attack] just ->" + Utils.SleepCheck("Attacking"));
                        }
                    }
                }
                else
                {
                    Helper.Orbwalk(Me, Target);
                    Helper.Print("[orbwalking] without mana");
                }
            }

            #endregion

            _totalDamage = (int)(damage * distance);
            _totalDamage = (int)Target.DamageTaken(_totalDamage, DamageType.Magical, Me);

            if (enemyHealth < _totalDamage)
            {
                return;                             //Target ll die only from ultimate
            }
            #region items

            if (Utils.SleepCheck("items"))
            {
                var eul = Me.GetItemById(ItemId.item_cyclone);
                if (eul != null && eul.CanBeCasted() && Target.IsLinkensProtected())
                {
                    eul.UseAbility(Target);
                    Utils.Sleep(250, "items");
                }
                var hex    = Me.GetItemById(ItemId.item_sheepstick);
                var orchid = Me.GetItemById(ItemId.item_orchid) ?? Me.GetItemById(ItemId.item_bloodthorn);
                if (hex != null && hex.CanBeCasted(Target) && !Target.IsHexed() && !Target.IsStunned() && !Target.IsLinkensProtected())
                {
                    hex.UseAbility(Target);
                    Utils.Sleep(250, "items");
                }
                if (orchid != null && orchid.CanBeCasted(Target) && !Target.IsHexed() && !Target.IsSilenced() &&
                    !Target.IsStunned() && !Target.IsLinkensProtected())
                {
                    orchid.UseAbility(Target);
                    Utils.Sleep(250, "items");
                }
                var shiva = Me.GetItemById(ItemId.item_shivas_guard);
                if (shiva != null && shiva.CanBeCasted() && distance <= 900)
                {
                    shiva.UseAbility();
                    Utils.Sleep(250, "items");
                }
                var lotus = Me.GetItemById(ItemId.item_lotus_orb);
                if (lotus != null && lotus.CanBeCasted() && distance <= 500 && !inUltimate)
                {
                    lotus.UseAbility(Me);
                    Utils.Sleep(250, "items");
                }
                var dagon = Me.GetDagon();
                if (dagon != null && dagon.CanBeCasted(Target) && distance <= dagon.CastRange)
                {
                    dagon.UseAbility(Target);
                    Utils.Sleep(250, "items");
                }
            }

            #endregion

            #region Spells

            if (Utils.SleepCheck("spells"))
            {
                var remnant = Me.GetAbilityById(AbilityId.storm_spirit_static_remnant);
                var vortex  = Me.GetAbilityById(AbilityId.storm_spirit_electric_vortex);
                if (remnant != null && remnant.CanBeCasted() && !inPassve && !inUltimate)
                {
                    remnant.UseAbility();
                    Utils.Sleep(250, "spells");
                }
                else if (vortex != null && vortex.CanBeCasted(Target) && vortex.CanHit(Target) && !Target.IsHexed() &&
                         !Target.IsStunned())
                {
                    vortex.UseAbility(Target);
                    Utils.Sleep(250, "spells");
                }
            }

            #endregion
        }
        public static void OnCalc(EventArgs args)
        {
            if (_rangeEfeectMaster == null)
            {
                _rangeEfeectMaster = new LineHelpers();
            }
            if (_debugLines == null)
            {
                _debugLines = new DebugLines();
            }

            var tempTarget = TargetSelector.ClosestToMouse(Members.MyHero);

            if ((tempTarget == null && Target != null) || (tempTarget != null && Target != null && !tempTarget.Equals(Target)))
            {
                if (Target != null)
                {
                    var i = 0;
                    while (_debugLines.Dispose(Target))
                    {
                        Printer.Print($"[Dispose]# {++i}");
                    }
                }
                if (_targetRange != null)
                {
                    _targetRange.Dispose();
                    _targetRange = null;
                }
            }
            Target = tempTarget;
            if (Target == null)
            {
                return;
            }
            if (_targetRange == null)
            {
                if (DrawRange)
                {
                    _targetRange =
                        Target.AddParticleEffect("materials/ensage_ui/particles/range_display_mod.vpcf");
                    _targetRange.SetControlPoint(1, new Vector3(575, 255, 0));
                    _targetRange.SetControlPoint(2, new Vector3(75, 75, 75));
                }
            }
            var trees = ObjectManager.GetEntities <Entity>()
                        .Where(x => x.Name == "ent_dota_tree" && x.IsAlive && x.IsValid && x.Distance2D(Target.Position) < 575 && x.IsAlive).ToList();

            var units = ObjectManager.GetEntities <Unit>()
                        .Where(
                x =>
                !Target.Equals(x) && x.Distance2D(Target.Position) < 575 && x.IsAlive &&
                x.Team == Members.MyHero.GetEnemyTeam() && x.IsVisible).ToList();

            //trees.AddRange(units);
            var list = new List <Vector3>();

            foreach (var entity in trees)
            {
                var angle = (float)Math.Max(
                    Math.Abs(Members.MyHero.FindAngleBetween(entity.Position, true) -
                             Members.MyHero.FindAngleBetween(Target.Position, true)) - .21, 0);
                _rangeEfeectMaster.DrawEffect(entity, "materials/ensage_ui/particles/line.vpcf", angle == 0);
                _debugLines.DrawEffect(entity, "materials/ensage_ui/particles/line.vpcf", angle == 0);

                var ang = Target.FindAngleBetween(entity.Position, true);
                for (var i = 1; i < 16; i++)
                {
                    var tempPos = Target.Position -
                                  new Vector3((float)(i * 50 * Math.Cos(ang)), (float)(i * 50 * Math.Sin(ang)), 0);
                    if (NavMesh.GetCellFlags(tempPos) == NavMeshCellFlags.Walkable)
                    {
                        list.Add(tempPos);
                    }
                }
            }

            foreach (var entity in units)
            {
                var angle = (float)Math.Max(
                    Math.Abs(Members.MyHero.FindAngleBetween(entity.Position, true) -
                             Members.MyHero.FindAngleBetween(Target.Position, true)) - .21, 0);
                _rangeEfeectMaster.DrawEffect(entity, "materials/ensage_ui/particles/line.vpcf", angle == 0);
                _debugLines.DrawEffect(entity, "materials/ensage_ui/particles/line.vpcf", angle == 0);
                var ang = Target.FindAngleBetween(entity.Position, true);
                for (var i = 1; i < 16; i++)
                {
                    var tempPos = Target.Position -
                                  new Vector3((float)(i * 50 * Math.Cos(ang)), (float)(i * 50 * Math.Sin(ang)), 0);
                    if (NavMesh.GetCellFlags(tempPos) == NavMeshCellFlags.Walkable)
                    {
                        list.Add(tempPos);
                    }
                }
            }
            Members.BestPoinits = list;
        }
Пример #30
0
        public static void Updater(EventArgs args)
        {
            if (!MenuManager.IsEnable)
            {
                return;
            }
            if (MainHero == null)
            {
                return;
            }
            if (MenuManager.AllComboKey && MenuManager.LockTarget)
            {
                if (_globalTarget == null || !_globalTarget.IsValid)
                {
                    _globalTarget = TargetSelector.ClosestToMouse(Members.MainHero);
                }
            }

            if (MainHero.IsAlive)
            {
                if (MenuManager.AutoBalance)
                {
                    MainHero.Morph();
                }
                if (MenuManager.SafeTp)
                {
                    MainHero.SafeTp();
                }
                if (MenuManager.HeroComboKey && !MenuManager.AllComboKey)
                {
                    var target = TargetSelector.ClosestToMouse(Members.MainHero);
                    if (target != null)
                    {
                        MainHero.DoCombo(target);
                    }
                }
                if (MenuManager.AllComboKey)
                {
                    if (MenuManager.LockTarget)
                    {
                        MainHero.DoCombo(_globalTarget);
                    }
                }
            }
            if (Replicate != null && Replicate.IsValid && Replicate.IsAlive)
            {
                if (MenuManager.ReplicateComboKey && !MenuManager.AllComboKey)
                {
                    Replicate.AttackTarget();
                }
                if (MenuManager.AllComboKey)
                {
                    Replicate.AttackTarget(_globalTarget);
                }
            }
            if (Hybrid != null && Hybrid.IsValid && Hybrid.IsAlive)
            {
                if (MenuManager.HybridComboKey && !MenuManager.AllComboKey)
                {
                    Hybrid.DoCombo();
                }
                if (MenuManager.AllComboKey)
                {
                    Hybrid.DoCombo(_globalTarget);
                }
            }
        }