private void TryDashing()
        {
            bool isDashActive = IsAnyBuffExists(Buffs.Dash);

            int mpp    = Host.me.mpp;
            int minMpp = (settings.FightAggroMobs)
                ? 50 : 20;


            bool isDashReady = !InCombat() && !isDashActive && !IsAnyBuffExists(Buffs.Freerunner)

                               && mpp > minMpp &&
                               !Host.me.isGlobalCooldown;


            if (isDashReady && !memory.IsLocked("Dashing"))
            {
                Host.UseSkill(Skills.Dash);
                memory.Lock("Dashing", Utils.RandomNum(4000, 6000), 4);
            }

            else if (isDashActive && mpp <= (minMpp - 10))
            {
                CancelAnyBuffs(Buffs.Dash);
            }
        }
Beispiel #2
0
        public void UseNextSkill(bool isManual = false)
        {
            var name     = GetNextSkill();
            var isLoaded = Routine.IsLoaded(name);

            // Weapon effects
            if (IsEquipSkill(name))
            {
                if (CanUseEquipSkill(name) && ConditionsMeets(name) && (GetEquipSkill(name)?.UseItem() ?? false))
                {
                    Utils.Delay(new int[] { 450, 650 }, new int[] { 550, 850 }, token);
                }

                PushNext(isLoaded);

                return;
            }


            var skill = Host.getSkill(name);

            if (!CanCastSkill(skill, isLoaded))
            {
                Routine.PushNext();

                return;
            }

            if (!ConditionsMeets(name))
            {
                PushNext(isLoaded);

                return;
            }


            var isBoosts = Routine.IsCombatBuff(name);


            bool          isCombo = false;
            List <string> combo   = null;

            if (!isLoaded && !isBoosts && Routine.IsCombo(name))
            {
                combo   = Routine.GetCombo(name);
                isCombo = (combo != null && !combo.Any(s => (Host.getSkill(s) == null) || (Host.skillCooldown(s) > 0)));
            }


            if (UseSkill(skill, isBoosts, (!isBoosts && !isManual)))
            {
                if (isLoaded)
                {
                    Routine.QueueTake();
                }
                else if (isCombo)
                {
                    Routine.LoadCombo(name);
                }


                Utils.Delay(new int[] { 50, 100 }, new int[] { 100, 150 }, new int[] { 150, 200 }, token);
            }
            else
            {
                if (!memory.IsLocked(name))
                {
                    memory.Lock(name, Utils.Rand(1, 3), Utils.Rand(12, 24), true);

                    return;
                }
                else if (isLoaded)
                {
                    Routine.QueueTake();
                }
            }


            if (!isLoaded)
            {
                Routine.PushNext();
            }
        }