Exemplo n.º 1
0
 public RacialsTrollBerserkingAbility()
     : base(WoWSpell.FromId(SpellBook.RacialTrollBerserking), false, true)
 {
     base.Category = AbilityCategory.Buff;
     base.Conditions.Add(new BooleanCondition(SettingsManager.Instance.UseTrollRacial));
     base.Conditions.Add(new IsRaceCondition(WoWRace.Troll));
 }
Exemplo n.º 2
0
        public static async Task <bool> CastGroundOnMe(int Spell, System.Windows.Media.Color newColor, bool reqs = true, string addLog = "")
        {
            foreach (var item in GroundSpellBlacklist)
            {
                if (item.SpellId == Spell && item.IsBlacklisted())
                {
                    return(false);
                }
            }
            if (!reqs)
            {
                return(false);
            }
            //L.combatLog("Trying to cast: " + WoWSpell.FromId(Spell).Name + (String.IsNullOrEmpty(addLog) ? "" : " - " + addLog));
            if (!SpellManager.CanCast(WoWSpell.FromId(Spell)))
            {
                return(false);
            }

            if (await GCD(Spell, newColor, true, "CastGround") &&
                !await Coroutine.Wait(1000, () => Me.CurrentPendingCursorSpell != null))
            {
                AddSpellToBlacklist(Spell);
                L.diagnosticsLog("No Cursor Detected");
                return(false);
            }
            lastSpellCast = Spell;
            if (SpellManager.ClickRemoteLocation(Me.Location) == false)
            {
                AddSpellToBlacklist(Spell);
            }
            await CommonCoroutines.SleepForLagDuration();

            return(true);
        }
Exemplo n.º 3
0
        private static void CastDeathgate()
        {
            if (s_Me.IsCasting || s_Me.IsChanneling || s_Me.IsMoving)
            {
                return;
            }

            var deathGateRemainingCooldown = WoWSpell.FromId(DeathgateId).CooldownTimeLeft.Seconds;

            if (!WoWSpell.FromId(DeathgateId).Cooldown)
            {
                if (!SpellManager.CanCast(DeathgateId))
                {
                    return;
                }

                SpellManager.Cast(DeathgateId);
            }
            else
            {
                if (deathGateRemainingCooldown > 0 && deathGateRemainingCooldown < 45)
                {
                    QBCLog.Info("Waiting for Death Gate to get off cooldown. {0} seconds remaining.", deathGateRemainingCooldown);
                }
            }
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
        public static bool Cast2(int Spell, System.Windows.Media.Color newColor, bool reqs = true, string addLog = "", bool sleep = true)
        {
            //if (Spell == Helpers.Spell_Book.Glide)
            //{
            //    L.debugLog("Glide: " + reqs.ToString());
            //}

            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;
            L.combatLog("^" + WoWSpell.FromId(Spell).Name + (String.IsNullOrEmpty(addLog) || !GeneralSettings.Instance.GeneralDebug ? "" : " - " + addLog), newColor);

            return(true);
        }
Exemplo n.º 6
0
        public static async Task <bool> CastOnGround(int spell, WoWUnit unit, bool reqs)
        {
            var sp    = WoWSpell.FromId(spell);
            var sname = sp != null ? sp.Name : "#" + spell;

            if (!reqs || !SpellManager.CanCast(spell) || unit == null)
            {
                return(false);
            }

            var onLocation = unit.Location;

            if (!SpellManager.Cast(spell))
            {
                return(false);
            }

            if (!await Coroutine.Wait(1000, () => StyxWoW.Me.CurrentPendingCursorSpell != null))
            {
                Logging.Write(Colors.DarkRed, "Cursor Spell Didn't happen");
                return(false);
            }

            SpellManager.ClickRemoteLocation(onLocation);
            Log.WritetoFile(LogLevel.Diagnostic, String.Format("Casting {0}", sname));
            await CommonCoroutines.SleepForLagDuration();

            return(true);
        }
Exemplo n.º 7
0
 public override async Task <bool> CastOnTarget(WoWUnit target)
 {
     Conditions.Clear();
     if (MustWaitForGlobalCooldown)
     {
         Conditions.Add(new IsOffGlobalCooldownCondition());
     }
     if (MustWaitForSpellCooldown)
     {
         Conditions.Add(new SpellIsNotOnCooldownCondition(Spell));
     }
     Conditions.Add(new BooleanCondition(SettingsManager.Instance.UseShadowReflection));
     Conditions.Add(new BooleanCondition(target != null));
     Conditions.Add(new InMeeleRangeCondition(target));
     Conditions.Add(new ConditionSwitchTester(
                        new BooleanCondition(Me.Specialization == Styx.WoWSpec.RogueSubtlety),
                        new ConditionAndList(
                            new CoolDownLeftMaxCondition(WoWSpell.FromId(SpellBook.AuraShadowDance), System.TimeSpan.FromSeconds(1)),
                            new TargetAuraUpCondition(Me, WoWSpell.FromId(SpellBook.CastSliceNDice))), // <-- If in Subtlety Specc
                        new ConditionSwitchTester(
                            new BooleanCondition(Me.Specialization == Styx.WoWSpec.RogueAssassination),
                            new TargetAuraUpCondition(target, WoWSpell.FromId(SpellBook.CastRupture)) // <-- If in AssaSpecc
                            )                                                                         // Add Combat here
                        ));
     Conditions.Add(new ConditionSwitchTester(
                        new BooleanCondition(SettingsManager.Instance.ShadowReflectionOnlyOnBoss),
                        new OnlyOnBossCondition()));
     return(await base.CastOnTarget(target));
 }
Exemplo n.º 8
0
 public RacialsBloodElfAbility()
     : base(WoWSpell.FromId(SpellBook.RacialBloodElfArcaneTorrent), false, true)
 {
     base.Category = AbilityCategory.Buff;
     base.Conditions.Add(new BooleanCondition(SettingsManager.Instance.UseBloodElfRacial));
     base.Conditions.Add(new IsRaceCondition(WoWRace.BloodElf));
 }
Exemplo n.º 9
0
        public CatFormAbility()
            : base(WoWSpell.FromId(SpellBook.CatForm))
        {
            Category = AbilityCategory.Buff;

            RequiredConditions.Add(new MeIsNotInCatFormCondition());
        }
Exemplo n.º 10
0
        public override async Task <bool> CastOnTarget(WoWUnit target)
        {
            Conditions.Clear();
            if (MustWaitForGlobalCooldown)
            {
                Conditions.Add(new IsOffGlobalCooldownCondition());
            }
            if (MustWaitForSpellCooldown)
            {
                Conditions.Add(new SpellIsNotOnCooldownCondition(Spell));
            }
            Conditions.Add(new BooleanCondition(target != null));
            Conditions.Add(new InMeeleRangeCondition(target));
            Conditions.Add(new BooleanCondition(Me.AuraStacks(SpellBook.AuraAnticipation) <= 1));
            Conditions.Add(new ConditionSwitchTester(
                               new BooleanCondition(SettingsManager.Instance.OffensiveVanishOnlyOnBoss),
                               new OnlyOnBossCondition()));
            Conditions.Add(new BooleanCondition(SettingsManager.Instance.UseVanish));
            //  t18 bonus! add if you got t18
            Conditions.Add(new ConditionSwitchTester(
                               new BooleanCondition(SettingsManager.Instance.T184PEnabled),
                               new ConditionAndList(
                                   new TargetNotAuraUpCondition(Me, WoWSpell.FromId(SpellBook.AuraDeathlyShadows)),
                                   new ConditionOrList(
                                       new CoolDownLeftMaxCondition(WoWSpell.FromId(SpellBook.AuraShadowDance), System.TimeSpan.FromSeconds(1)),
                                       new CoolDownLeftMinCondition(WoWSpell.FromId(SpellBook.AuraShadowDance), System.TimeSpan.FromSeconds(7)))),
                               new ConditionAndList(
                                   new ImNotStealthedCondition(),
                                   new TargetNotAuraUpCondition(target, WoWSpell.FromId(SpellBook.AuraFindWeakness)))));

            return(await base.CastOnTarget(target));
        }
Exemplo n.º 11
0
        public HealingTouchMyAllyAbility()
            : base(WoWSpell.FromId(SpellBook.HealingTouch))
        {
            Category = AbilityCategory.Heal;

            RequiredConditions.Add(new TargetDoesNotHaveAuraCondition(TargetType.Me, SpellBook.Prowl));
        }
Exemplo n.º 12
0
 private static async Task <bool> UseRacialToClearLoC()
 {
     if (Main.Debug)
     {
         Log.Diagnostics("In UseRacialToClearLoc() call");
     }
     if (!_locDelay.IsRunning)
     {
         _locDelay.Start();
         return(false);
     }
     if (_locDelay.ElapsedMilliseconds > SettingsManager.Instance.LoCDelay)
     {
         if (WoWSpell.FromId(SpellBook.RacialHumanEveryManForHimself).CooldownTimeLeft.TotalMilliseconds == 0)
         {
             if (await Abilities.Cast <Shared.Racials.RacialHumanAbility>(Me))
             {
                 _locDelay.Reset();
                 return(true);
             }
         }
         else
         {
             Log.Diagnostics("Human Racial is on Cooldown.");
         }
         return(true);
     }
     return(true);
 }
Exemplo n.º 13
0
 public Premed()
     : base(WoWSpell.FromId(SpellBook.CastPremed), true, true)
 {
     Category = AbilityCategory.Combat;
     Conditions.Add(new BooleanCondition(Me.ComboPoints <= 4));
     Conditions.Add(new ImStealthedCondition());
 }
Exemplo n.º 14
0
        public RebirthAbility()
            : base(WoWSpell.FromId(SpellBook.Rebirth), true, true)
        {
            Category = AbilityCategory.Heal;

            RequiredConditions.Add(new TargetDoesNotHaveAuraCondition(TargetType.Me, SpellBook.Prowl));
        }
Exemplo n.º 15
0
        public static void Pulse()
        {
            // Loop threw each of our
            foreach (KeyValuePair <String, WoWAura> entry in StyxWoW.Me.ActiveAuras)
            {
                // Create our spell that is on us so we can use it
                WoWSpell Spell = WoWSpell.FromId(entry.Value.SpellId);

                // Anything Blacklisted contine;
                if (lIgnore.Contains(Spell.Name))
                {
                    continue;
                }

                // if theres something we need to trinket, lets do it
                if (lTrinket.Contains(Spell.Mechanic) || lBlacklist.Contains(Spell.Name))
                {
                    if (entry.Value.TimeLeft.Seconds >= 3)
                    {
                        Log.WriteDebug("Trinketing - Name: {0}  Timeleft: {1}", Spell.Name, entry.Value.TimeLeft);
                        UseTrinket();
                    }
                }
            }
        }
Exemplo n.º 16
0
        private void update()
        {
            var spellId   = spellid_input.Value;
            var spellname = spellname_txt.Text;

            CurrentEclipse_lbl.Text   = StyxWoW.Me.CurrentEclipse.ToString(CultureInfo.InvariantCulture);
            ChanneledSpellID_lbl.Text = StyxWoW.Me.ChanneledCastingSpellId.ToString(CultureInfo.InvariantCulture);

            WoWSpell spell;

            SpellManager.Spells.TryGetValue(spellname, out spell);
            // Fishing for KeyNotFoundException's yay!
            if (spell != null)
            {
                spellId = spell.Id;
            }

            WoWSpell test = WoWSpell.FromId((int)spellId);

            // populate values
            if (test != null)
            {
                spellid_lbl.Text              = test.Id.ToString(CultureInfo.InvariantCulture);
                smHasSpell_lbl.Text           = SpellManager.HasSpell(test).ToString(CultureInfo.InvariantCulture);
                smCanCast_lbl.Text            = SpellManager.CanCast(test).ToString(CultureInfo.InvariantCulture);
                spellname_lbl.Text            = test.Name;
                spellCancast_lbl.Text         = test.CanCast.ToString(CultureInfo.InvariantCulture);
                smIsValid_lbl.Text            = test.IsValid.ToString(CultureInfo.InvariantCulture);
                smCooldownTimeLeftid_lbl.Text = test.CooldownTimeLeft.ToString();
                smCooldownid_lbl.Text         = test.Cooldown.ToString(CultureInfo.InvariantCulture);
                smCooldownTimeLeft_lbl.Text   = SpellManager.Spells[spellname].CooldownTimeLeft.ToString();
            }
        }
Exemplo n.º 17
0
        public static async Task <bool> CoCast(int spell, WoWUnit unit, bool reqs, bool cancel)
        {
            var sp    = WoWSpell.FromId(spell);
            var sname = sp != null ? sp.Name : "#" + spell;

            if (unit == null || !reqs || !SpellManager.CanCast(spell, unit, true))
            {
                return(false);
            }

            if (!SpellManager.Cast(spell, unit))
            {
                return(false);
            }

            if (!await Coroutine.Wait(GetSpellCastTime(sname), () => cancel) && GetSpellCastTime(sname).TotalSeconds > 0)
            {
                SpellManager.StopCasting();
                Log.WriteLog("Canceling " + sname + ".");
                return(false);
            }

            await CommonCoroutines.SleepForLagDuration();

            return(true);
        }
Exemplo n.º 18
0
        public override void OnStart()
        {
            var skillLine = (SkillLine)TradeSkillId;

            if (!Enum.GetValues(typeof(SkillLine)).Cast <SkillLine>().Contains(skillLine))
            {
                QBCLog.ProfileError("TradeSkillId {0} is not a valid tradeskill Id.", TradeSkillId);
            }

            // special case for Runeforging since it's not considered a profession.
            _recipeSpell = skillLine == SkillLine.Runeforging
                ? WoWSpell.FromId(TradeSkillItemId)
                : GetRecipeSpell(TradeSkillItemId);

            if (_recipeSpell == null || !_recipeSpell.IsValid)
            {
                QBCLog.ProfileError("TradeSkillItemId {0} is not a valid Item or Spell Id.", TradeSkillId);
            }
            // This reports problems, and stops BT processing if there was a problem with attributes...
            // We had to defer this action, as the 'profile line number' is not available during the element's
            // constructor call.
            OnStart_HandleAttributeProblem();

            // If the quest is complete, this behavior is already done...
            // So we don't want to falsely inform the user of things that will be skipped.
            if (!IsDone)
            {
                this.UpdateGoalText(QuestId);
            }
        }
Exemplo n.º 19
0
 public ForceOfNatureAbility()
     : base(WoWSpell.FromId(SpellBook.ForceOfNature), true, true)
 {
     RequiredConditions.Add(new MeHasAttackableTargetCondition());
     RequiredConditions.Add(new TargetDoesNotHaveAuraCondition(TargetType.Me, SpellBook.Prowl));
     RequiredConditions.Add(new MyTargetDistanceCondition(0, 10));
 }
Exemplo n.º 20
0
 public StealthAbility() : base(WoWSpell.FromId(SpellBook.CastStealth), true, true)
 {
     base.Category = AbilityCategory.Buff;
     base.Conditions.Add(new TargetNotAuraUpCondition(Me, WoWSpell.FromId(SpellBook.AuraStealth)));
     base.Conditions.Add(new ImNotStealthedCondition());
     base.Conditions.Add(new BooleanCondition(SettingsManager.Instance.AlwaysStealth));
 }
Exemplo n.º 21
0
 public RacialOrcBloodFuryAbility()
     : base(WoWSpell.FromId(SpellBook.RacialOrcBloodFury), false, true)
 {
     base.Category = AbilityCategory.Buff;
     base.Conditions.Add(new BooleanCondition(SettingsManager.Instance.UseOrcRacial));
     base.Conditions.Add(new IsRaceCondition(WoWRace.Orc));
 }
Exemplo n.º 22
0
        public SavageRoarAbility()
            : base(WoWSpell.FromId(SpellBook.SavageRoar))
        {
            Category = AbilityCategory.Buff;

            RequiredConditions.Add(new MeIsInCatFormCondition());
        }
Exemplo n.º 23
0
 public WarStompAbility()
     : base(WoWSpell.FromId(SpellBook.TaurenRacialWarStomp), true, true)
 {
     RequiredConditions.Add(new MeHasAttackableTargetCondition());
     RequiredConditions.Add(new MeIsFacingTargetCondition());
     RequiredConditions.Add(new TargetDoesNotHaveAuraCondition(TargetType.Me, SpellBook.Prowl));
 }
Exemplo n.º 24
0
        static public Composite Cast(int spellId, CanRunDecoratorDelegate cond, WoWUnitDelegate target)
        {
            return(new Decorator(ret => target != null && cond(ret) && CanCast(spellId),
                                 new Action(ret =>
            {
                SpellManager.Cast(spellId, target(ret));
                Logging.Write(LogLevel.Diagnostic, Colors.White, "" + WoWSpell.FromId(spellId).Name);
                string temp;
                if (target(ret).IsPlayer)
                {
                    temp = "Casting " + WoWSpell.FromId(spellId).Name + " on Player at " +
                           Math.Round(target(ret).HealthPercent, 0) + " with " + Helpers.Rogue.me.ComboPoints + "CP and " +
                           Rogue.mCurrentEnergy + " energy";
                }
                else
                {
                    temp = "Casting " + WoWSpell.FromId(spellId).Name + " on " + target(ret).Name + " at " +
                           Math.Round(target(ret).HealthPercent, 0) + " with " + Helpers.Rogue.me.ComboPoints + "CP and " +
                           Rogue.mCurrentEnergy + " energy";
                }

                Logging.Write(LogLevel.Normal, temp);
            }
                                            )
                                 ));
        }
Exemplo n.º 25
0
        /// <summary>
        /// Does not specify a target when casting a spell and sleeps for lag
        /// </summary>
        /// <param name="Spell">The spell you wish to cast.</param>
        /// <param name="reqs">The requirements to cast the spell.</param>
        /// <returns></returns>
        public static async Task <bool> GCD(int Spell, System.Windows.Media.Color newColor, bool reqs = true, string addLog = "", bool sleep = true)
        {
            if (!reqs)
            {
                //L.combatLog("Trying to cast: " + WoWSpell.FromId(Spell).Name + (String.IsNullOrEmpty(addLog) ? "" : " - " + addLog));
                return(false);
            }
            //if (SpellManager.GlobalCooldown || !SpellManager.CanCast(Spell))
            //    return false;
            if (OnCooldown(Spell))
            {
                return(false);
            }
            if (!SpellManager.Cast(Spell))
            {
                return(false);
            }
            lastSpellCast = Spell;
            L.combatLog("*" + WoWSpell.FromId(Spell).Name + (String.IsNullOrEmpty(addLog) || !GeneralSettings.Instance.GeneralDebug ? "" : " - " + addLog), newColor);
            if (sleep)
            {
                await CommonCoroutines.SleepForLagDuration();
            }
            else
            {
                await Coroutine.Yield();
            }

            return(true);
        }
Exemplo n.º 26
0
        /// <summary>Returns a summoned pet</summary>
        /// <param name="nameID">the id of the spell</param>
        /// <param name="cond">The conditions that must be true</param>
        /// <param name="label">A descriptive label for the clients GUI logging output</param>
        /// <returns>The cast pet summon spell.</returns>
        public static Composite CastPetSummonSpell(int nameID, CanRunDecoratorDelegate cond, string label)
        {
            WoWSpell summonPet = WoWSpell.FromId(nameID);

            if (summonPet.CastTime > 0)
            {
                Spell.KnownChanneledSpells.Add(summonPet.Name);
            }

            return(new Decorator(
                       delegate(object a)
            {
                if (!cond(a))
                {
                    return false;
                }

                if (!Spell.CanCast(summonPet.ToString()))
                {
                    return false;
                }

                return true;
            },
                       new Decorator(ret => !Me.GotAlivePet && PetTimer.IsFinished,
                                     new Sequence(
                                         new Action(a => CLULogger.Log(" {0}", label)),
                                         new Action(a => SpellManager.Cast(summonPet)),
                                         Spell.CreateWaitForLagDuration(),
                                         new Wait(5, a => Me.GotAlivePet || !Me.IsCasting,
                                                  new PrioritySelector(
                                                      new Decorator(a => StyxWoW.Me.IsCasting, new Action(ret => SpellManager.StopCasting())),
                                                      new ActionAlwaysSucceed()))))));
        }
Exemplo n.º 27
0
 public WrathAbility()
     : base(WoWSpell.FromId(SpellBook.Wrath))
 {
     Conditions.Add(new MeHasAttackableTargetCondition());
     Conditions.Add(new MeIsFacingTargetCondition());
     Conditions.Add(new MyTargetDistanceCondition(0, 38));
 }
Exemplo n.º 28
0
 public override async Task <bool> CastOnTarget(WoWUnit target)
 {
     Conditions.Clear();
     if (MustWaitForGlobalCooldown)
     {
         Conditions.Add(new IsOffGlobalCooldownCondition());
     }
     if (MustWaitForSpellCooldown)
     {
         Conditions.Add(new SpellIsNotOnCooldownCondition(Spell));
     }
     Conditions.Add(new BooleanCondition(target != null));
     Conditions.Add(new InMeeleRangeCondition(target));
     Conditions.Add(Energy);
     Conditions.Add(new ConditionOrList(
                        new TargetIsInHealthRangeCondition(target, 0, 35),
                        new ConditionAndList(
                            new TargetAuraUpCondition(Me, WoWSpell.FromId(SpellBook.AuraBlindside)),
                            new ConditionOrList(
                                new TargetAuraUpCondition(Me, WoWSpell.FromId(SpellBook.CastEnvenom)),
                                new AuraMaxRemaningTimeCondition(TimeSpan.FromSeconds(1), WoWSpell.FromId(SpellBook.AuraBlindside), Me))
                            )));
     Conditions.Add(new ConditionSwitchTester(
                        new BooleanCondition(SettingsManager.Instance.T184PEnabled),
                        new WillNotCapComboPointsCondition(3),
                        new WillNotCapComboPointsCondition(1)));
     return(await base.CastOnTarget(target));
 }
Exemplo n.º 29
0
        public CatFormPowerShiftAbility()
            : base(WoWSpell.FromId(SpellBook.CatForm))
        {
            Category = AbilityCategory.Buff;

            // No conditions.
        }
Exemplo n.º 30
0
 public DeathFromAboveAbility() : base(WoWSpell.FromId(SpellBook.CastDeathFromAbove), true, true)
 {
     Category = AbilityCategory.Combat;
     _energy  = new EnergyRangeCondition(50);
     base.Conditions.Add(_energy);
     base.Conditions.Add(new ComboPointCondition(5));
 }