예제 #1
0
        public static async Task <bool> Rotation()
        {
            if (Me.IsCasting || Me.IsChanneling || Me.IsFlying || Me.OnTaxi)
            {
                return(false);
            }

            if (BotManager.Current.IsRoutineBased() && Me.Mounted)
            {
                return(false);
            }

            if (BotManager.Current.IsRoutineBased() && !Me.Combat)
            {
                return(false);
            }

            if (!Chains.TriggerInAction)
            {
                //Chains.Check();

                if (Me.Specialization == WoWSpec.DruidFeral && SnareManager.BearFormBlockedTimer.IsRunning &&
                    Me.Shapeshift == ShapeshiftForm.Bear)
                {
                    if (!await Abilities.Cast <CatFormPowerShiftAbility>(Me))
                    {
                        return(false);
                    }
                    Log.Gui("Switching to Cat Form after Bear Form Powershift.");
                    return(true);
                }

                // Clear loss of control if we can //
                if (await ItemManager.ClearLossOfControlWithTrinkets())
                {
                    return(true);
                }

                // Don't go any further if we have total loss of control //
                if (Me.HasTotalLossOfControl())
                {
                    return(false);
                }

                // Clear Roots and Snares if we can //
                if (Me.Specialization != WoWSpec.DruidGuardian) // Will add Guardian Clears at a later time.
                {
                    if (await SnareManager.CheckAndClear())
                    {
                        return(true);
                    }
                }

                // Use eligible items //
                if (await ItemManager.UseEligibleItems(MyState.InCombat))
                {
                    return(true);
                }

                // Check on my minions //
                if (!BotManager.Current.IsRoutineBased())
                {
                    if (await Units.CheckForMyMinionsBeingAttacked())
                    {
                        return(false);
                    }
                }

                // Check for dead party members (ignore if in a BG or Arena) //
                if (Me.Specialization != WoWSpec.DruidGuardian) // Will add Guardian Battle Rez at a later time.
                {
                    if (!Me.GroupInfo.IsInBattlegroundParty && !Me.IsInArena)
                    {
                        if (await Units.CheckAndResurrectDeadAllies())
                        {
                            return(true);
                        }
                    }
                }

                // Check for allies that need to be healed //
                if (Me.Specialization != WoWSpec.DruidGuardian)
                {
                    if (await Units.CheckForAlliesNeedHealing())
                    {
                        return(true);
                    }
                }

                // Movement //
                if (SettingsManager.Instance.AllowMovement)
                {
                    await MovementHelper.MoveToMyCurrentTarget();
                }
                if (SettingsManager.Instance.AllowTargetFacing)
                {
                    await MovementHelper.FaceMyCurrentTarget();
                }

                // Clear Dead Target - useful in some situations for the questing bot //
                if (!BotManager.Current.IsRoutineBased())
                {
                    if (await MovementHelper.ClearMyDeadTarget())
                    {
                        return(true);
                    }
                }

                // Soothe an Enraged Target //
                if (await Units.SootheEnragedTarget(MyCurrentTarget))
                {
                    return(true);
                }

                if (Me.Specialization == WoWSpec.DruidGuardian)
                {
                    return(await GuardianCombatRotation());
                }
                return(await FeralCombatRotation());
            }
            // The normal rotation is paused because an ability chain has been triggered.
            return(await Chains.TriggeredRotation());
        }