Esempio n. 1
0
        /// <summary>
        /// Specifies the current target when casting spell and sleeps for lag
        /// </summary>
        /// <param name="Spell"></param>
        /// <param name="reqs"></param>
        /// <returns></returns>
        public async Task <bool> Cast(int Spell, Color newColor, bool reqs = true)
        {
            if (!CurrentTarget.IsValidCombatUnit())
            {
                return(false);
            }
            if (!reqs)
            {
                //L.combatLog("Trying to cast: " + WoWSpell.FromId(Spell).Name + (String.IsNullOrEmpty(addLog) ? "" : " - " + addLog));
                return(false);
            }

            if (!SpellManager.CanCast(WoWSpell.FromId(Spell), CurrentTarget, false, false, false)) //Should we check for if out currentTarget is moving? *Second false
            {
                return(false);
            }
            if (!SpellManager.Cast(Spell, CurrentTarget))
            {
                return(false);
            }
            //lastSpellCast = Spell;
            combatLog("^" + WoWSpell.FromId(Spell).Name, newColor);
            await CommonCoroutines.SleepForLagDuration();

            return(true);
        }
Esempio n. 2
0
        public static async Task <bool> RotationSelector()
        {
            // we are playing manual, i am not alive, or I am mounted or on taxi, do not continue
            if (HK.manualOn || !Me.IsAlive || (Me.OnTaxi))
            {
                return(true);
            }

            // face taret, ensure melee, interrupt and taunt do not need to return as they are off of global cooldown.
            await C.FaceTarget(CurrentTarget);

            await C.EnsureMeleeRange(CurrentTarget);

            await InterruptTarget();

            if (await S.GCD(SB.Torment, C.CombatColor, !CurrentTarget.IsTargetingMeOrPet && VS.VengeanceAllowTaunt,
                            string.Format($"CT:{CurrentTarget.SafeName} not targeting me. Taunting!")))
            {
                return(true);
            }

            if (CurrentTarget.IsValidCombatUnit())
            {
                if (await ActiveMitigation())
                {
                    return(true);
                }

                if (await GapCloser())
                {
                    return(true);
                }

                if ((HK.VengeanceAoEOn || U.activeEnemies(Me.Location, 8f).Count() >= 3))
                {
                    if (await MultipleTarget())
                    {
                        return(true);
                    }
                }

                // default to single target if nothing else
                return(await SingleTarget());
            }
            return(false);
        }
Esempio n. 3
0
        public static async Task <bool> Pull()
        {
            if (CurrentTarget.IsValidCombatUnit())
            {
                await C.EnsureMeleeRange(CurrentTarget);

                await C.FaceTarget(CurrentTarget);

                if (await S.Cast(SB.ThrowGlaive, C.CombatColor, CurrentTarget.Distance <= 30, "Pull - GlaiveTimer: " + glaiveTossTimer.ElapsedMilliseconds + "ms"))
                {
                    glaiveTossTimer.Restart(); return(true);
                }

                // use to engage if you have the charges to do so
                if (await S.CastGround(SB.InfernalStrike, C.CombatColor,
                                       VS.VengeanceCombatInfernalStrikePull &&
                                       CurrentTarget.Distance <= infernalStrikeRange &&
                                       !CurrentTarget.IsWithinMeleeRangeOf(Me) &&
                                       !VS.VengeancePreferPullWithFelblade
                                       , "Pull"))
                {
                    return(true);
                }

                // need to change this to check to see if we want to pull with Fel Blade or Infernal Strike (or which we prefer)
                if (await S.Cast(SB.FelBlade, C.CombatColor, T.VengeanceFelblade &&
                                 !CurrentTarget.IsWithinMeleeRangeOf(Me) &&
                                 CurrentTarget.Distance <= 15, "Pull"))
                {
                    return(true);
                }

                // now use in case felblade was on cd, but don't check prefer
                if (await S.CastGround(SB.InfernalStrike, C.CombatColor,
                                       CurrentTarget.Distance <= infernalStrikeRange &&
                                       VS.VengeanceCombatInfernalStrikePull &&
                                       !CurrentTarget.IsWithinMeleeRangeOf(Me)
                                       , "Pull"))
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 4
0
        public static async Task <bool> InterruptTarget()
        {
            if (!M.VengeanceAllowInterrupt)
            {
                return(false);
            }
            // use consume magic at 20 yards first
            //WoWUnit interruptTarget = GetInterruptTarget(20f);
            //L.debugLog(string.Format($"Interrupt target 20yd: {CurrentTarget.SafeName}"));
            if (await S.GCD(SB.ConsumeMagic, C.DefensiveColor,
                            VS.VengeanceAllowInterruptConsumeMagic &&
                            CurrentTarget.IsValidCombatUnit() &&
                            CurrentTarget.ShouldInterrupt(VS.VengeanceInterruptMinimumTime, VS.VengeanceInterruptTimeLeft),
                            string.Format($"Interrupt: {CurrentTarget.SafeName}, casting: {CurrentTarget.CastingSpell?.Name}")
                            ))
            {
                return(true);
            }


            //interruptTarget = GetInterruptTarget(30f);
            //if (interruptTarget != null)
            //{
            //    L.debugLog(string.Format($"Interrupt target 30yd: {interruptTarget.SafeName} casting: {interruptTarget.CastingSpell?.Name}"));
            //    // now look for sigil of silence
            if (await S.CastGround(SB.SigilOfSilence, C.DefensiveColor, VS.VengeanceAllowInterruptSigilOfSilence &&
                                   CurrentTarget.ShouldInterrupt(VS.VengeanceInterruptMinimumTime, VS.VengeanceInterruptTimeLeft),
                                   string.Format($"Interrupt: {CurrentTarget.SafeName}, casting: {CurrentTarget.CastingSpell?.Name}")))
            {
                return(true);
            }

            // now look for sigil of misery
            if (await S.CastGround(SB.SigilOfMisery, C.DefensiveColor, VS.VengeanceAllowInterruptSigilOfMisery &&
                                   CurrentTarget.ShouldInterrupt(VS.VengeanceInterruptMinimumTime, VS.VengeanceInterruptTimeLeft),
                                   string.Format($"Interrupt: {CurrentTarget.SafeName}, casting: {CurrentTarget.CastingSpell?.Name}")))
            {
                return(true);
            }

            //}

            return(false);
        }
Esempio n. 5
0
        public static async Task <bool> CombatBuffing()
        {
            if (HK.manualOn || !Me.IsAlive || (!Me.GotTarget || !CurrentTarget.IsAlive) || (Me.OnTaxi))
            {
                return(true);
            }
            if (!Me.IsAutoAttacking && CurrentTarget.IsValidCombatUnit())
            {
                Lua.DoString("StartAttack()"); return(true);
            }
            //
            // use potion - Change "true" to configurable
            var potion = I.GetItemByName("Draenic Agility Potion");

            if (potion != null)
            {
                return(await I.UseItem(potion, true));
            }
            return(false);
        }