Пример #1
0
        public static Composite CreateMageFireInstancePullAndCombat()
        {
            return(new PrioritySelector(
                       Safers.EnsureTarget(),
                       Movement.CreateMoveToLosBehavior(),
                       Movement.CreateFaceTargetBehavior(),
                       Helpers.Common.CreateAutoAttack(true),
                       Spell.WaitForCast(true),

                       // Defensive stuff
                       new Decorator(
                           ret => StyxWoW.Me.ActiveAuras.ContainsKey("Ice Block"),
                           new ActionIdle()),
                       Spell.BuffSelf("Ice Block", ret => StyxWoW.Me.HealthPercent < 20 && !StyxWoW.Me.ActiveAuras.ContainsKey("Hypothermia")),

                       // Cooldowns
                       Spell.BuffSelf("Evocation", ret => StyxWoW.Me.ManaPercent < 30),
                       Spell.BuffSelf("Mirror Image"),
                       Spell.BuffSelf("Mage Ward", ret => StyxWoW.Me.HealthPercent <= 75),

                       Common.CreateUseManaGemBehavior(ret => StyxWoW.Me.ManaPercent < 80),
                       // AoE comes first
                       new Decorator(
                           ret => Unit.UnfriendlyUnitsNearTarget(10f).Count() >= 3,
                           new PrioritySelector(
                               Spell.Cast("Fire Blast",
                                          ret => StyxWoW.Me.ActiveAuras.ContainsKey("Impact") &&
                                          (StyxWoW.Me.CurrentTarget.HasMyAura("Combustion") || TalentManager.IsSelected(13))),
                               Spell.CastOnGround("Blast Wave",
                                                  ret => Clusters.GetBestUnitForCluster(Unit.NearbyUnitsInCombatWithMe, ClusterType.Radius, 8f).Location),
                               Spell.Cast("Dragon's Breath",
                                          ret => Clusters.GetClusterCount(StyxWoW.Me,
                                                                          Unit.NearbyUnitsInCombatWithMe,
                                                                          ClusterType.Cone, 15f) >= 3),
                               Spell.CastOnGround("Flamestrike",
                                                  ret => Clusters.GetBestUnitForCluster(Unit.NearbyUnitsInCombatWithMe, ClusterType.Radius, 8f).Location,
                                                  ret => !ObjectManager.GetObjectsOfType <WoWDynamicObject>().Any(o =>
                                                                                                                  o.CasterGuid == StyxWoW.Me.Guid && o.Spell.Name == "Flamestrike" &&
                                                                                                                  o.Location.Distance(
                                                                                                                      Clusters.GetBestUnitForCluster(Unit.NearbyUnitsInCombatWithMe, ClusterType.Radius, 8f).Location) < o.Radius))
                               )),

                       Spell.BuffSelf("Time Warp",
                                      ret => !StyxWoW.Me.GroupInfo.IsInRaid && StyxWoW.Me.CurrentTarget.HealthPercent > 20 && StyxWoW.Me.CurrentTarget.IsBoss() &&
                                      !StyxWoW.Me.HasAura("Temporal Displacement")),

                       // Rotation
                       Spell.Cast("Frostfire Bolt", ret => StyxWoW.Me.CurrentTarget.IsImmune(WoWSpellSchool.Fire)),
                       Spell.Cast("Living Bomb", ret => !StyxWoW.Me.CurrentTarget.HasAura("Living Bomb") || (StyxWoW.Me.CurrentTarget.HasAura("Living Bomb") && StyxWoW.Me.CurrentTarget.GetAuraTimeLeft("Living Bomb", true).TotalSeconds <= 2)),
                       Spell.Cast("Inferno Blast", ret => StyxWoW.Me.HasAura("Heating Up")),
                       Spell.Cast("Frost Bomb", ret => Unit.UnfriendlyUnitsNearTarget(10f).Count() >= 1),
                       Spell.Cast("Combustion", ret => StyxWoW.Me.CurrentTarget.HasMyAura("Ignite") && StyxWoW.Me.CurrentTarget.HasMyAura("Pyroblast")),

                       Spell.Cast("Pyroblast", ret => StyxWoW.Me.ActiveAuras.ContainsKey("Pyroblast!")),
                       Spell.Cast("Fireball", ret => !SpellManager.HasSpell("Scorch")),
                       Spell.Cast("Frostfire bolt", ret => !SpellManager.HasSpell("Fireball")),
                       Spell.Cast("Scorch"),
                       Movement.CreateMoveToTargetBehavior(true, 39f)
                       ));
        }
Пример #2
0
        public static Composite ArmsPvPCombat()
        {
            return(new PrioritySelector(
                       new Decorator(ret => !Me.Combat && Me.IsCasting,
                                     new ActionAlwaysSucceed()),
                       CreateChargeBehavior(),
                       Spell.Cast("Rallying Cry", ret => Me.HealthPercent <= 30),
                       new Throttle(1, 1,
                                    new Sequence(
                                        CreateInterruptSpellCast(on => BestInterrupt))),
                       Item.UsePotionAndHealthstone(40),
                       Spell.Cast("Victory Rush", ret => Me.HealthPercent <= 90 && Me.CachedHasAura("Victorious")),
                       ShatterBubbles(),
                       new Decorator(ret => /*Me.CurrentTarget.IsPlayer &&*/ !Me.CurrentTarget.IsStunned() && !Me.CurrentTarget.IsCrowdControlled() && (!Me.CurrentTarget.HasAuraWithEffectsing(WoWApplyAuraType.ModDecreaseSpeed) /*w|| !Me.CurrentTarget.CachedHasAura("Hamstring")*/),
                                     new PrioritySelector(
                                         Spell.Cast("Piercing Howl"),
                                         Spell.Cast("Hamstring"))),
                       DemoBanner(),
                       HeroicLeap(),
                       MockingBanner(),
                       new Decorator(ret => AdvancedAI.Movement,
                                     new PrioritySelector(
                                         DemoBannerAuto(),
                                         MockingBannerAuto())),
                       Spell.Cast("Intervene", on => BestBanner),
                       //Spell.CastOnGround("Demoralizing Banner", on => Me.Location, ret => Me.HealthPercent < 40),
                       Spell.Cast("Disarm", ret => Me.CurrentTarget.HasAnyAura(Disarm) && !Me.CurrentTarget.HasAnyAura(DontDisarm)),
                       Spell.Cast("Die by the Sword", ret => Me.HealthPercent <= 20 /*&& Me.CurrentTarget.IsMelee()*/),
                       new Decorator(ret => AdvancedAI.Burst && Me.CurrentTarget.IsWithinMeleeRange,
                                     new PrioritySelector(
                                         Spell.Cast("Recklessness"),
                                         Spell.Cast("Bloodbath"),
                                         Spell.Cast("Avatar", ret => Me.CachedHasAura("Recklessness")),
                                         Spell.Cast("Skull Banner", ret => Me.CachedHasAura("Recklessness")))),
                       new Action(ret => { Item.UseHands(); return RunStatus.Failure; }),
                       Spell.Cast("Intervene", on => BestInterveneTarget),
                       Spell.Cast("Charge", on => ChargeInt),
                       Spell.Cast("Heroic Strike", ret => (Me.CurrentTarget.CachedHasAura("Colossus Smash") && Me.CurrentRage >= 70) || Me.CurrentRage >= 95),
                       Spell.Cast("Sweeping Strikes", ret => Unit.UnfriendlyUnits(8).Count() >= 2 && AdvancedAI.Aoe),
                       Spell.Cast("Bladestorm", ret => Me.HasAura("Bloodbath") && Me.CurrentTarget.Distance <= 8),
                       //new Decorator(ret => Me.CurrentTarget != null && SpellManager.GlobalCooldown,
                       //    new ActionAlwaysSucceed()),

                       Spell.Cast("Mortal Strike"),
                       Spell.Cast("Dragon Roar", ret => !Me.CurrentTarget.CachedHasAura("Colossus Smash") && Me.CachedHasAura("Bloodbath") && Me.CurrentTarget.Distance <= 8),
                       Spell.Cast("Colossus Smash", ret => Me.HasAuraExpired("Colossus Smash", 1)),
                       Spell.Cast("Execute", ret => Me.CurrentTarget.CachedHasAura("Colossus Smash") || Me.CachedHasAura("Recklessness") || Me.CurrentRage >= 30),
                       Spell.Cast("Dragon Roar", ret => Me.CurrentTarget.Distance <= 8 && (!Me.CurrentTarget.CachedHasAura("Colossus Smash") && Me.CurrentTarget.HealthPercent < 20) || Me.CachedHasAura("Bloodbath")),
                       Spell.Cast("Thunder Clap", ret => Clusters.GetClusterCount(Me, Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 8f) >= 2 && Clusters.GetCluster(Me, Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 8).Any(u => !u.HasMyAura("Deep Wounds"))),
                       Spell.Cast("Slam", ret => (Me.CurrentTarget.CachedHasAura("Colossus Smash") || Me.CachedHasAura("Recklessness")) && Me.CurrentTarget.HealthPercent >= 20),
                       Spell.Cast("Overpower", ret => Me.CurrentTarget.HealthPercent >= 20 || Me.CachedHasAura("Sudden Execute")),
                       Spell.Cast("Execute", ret => !Me.CachedHasAura("Sudden Execute")),
                       Spell.Cast("Slam", ret => Me.CurrentRage >= 40 && Me.CurrentTarget.HealthPercent >= 20),
                       Spell.Cast("Battle Shout"),
                       Spell.Cast("Heroic Throw"),
                       Spell.Cast("Impending Victory", ret => Me.CurrentTarget.HealthPercent > 20 || Me.HealthPercent < 50),
                       new Decorator(ret => AdvancedAI.Movement,
                                     Movement.CreateMoveToMeleeBehavior(true)),
                       new ActionAlwaysSucceed()));
        }
Пример #3
0
 public static Composite CreateLowbieWarriorCombat()
 {
     return(new PrioritySelector(
                // Ensure Target
                Safers.EnsureTarget(),
                // LOS Check
                Movement.CreateMoveToLosBehavior(),
                // face target
                Movement.CreateFaceTargetBehavior(),
                // Auto Attack
                Common.CreateAutoAttack(false),
                Helpers.Common.CreateInterruptSpellCast(ret => StyxWoW.Me.CurrentTarget),
                // Heal
                Spell.Cast("Victory Rush"),
                //rend
                Spell.Buff("Rend"),
                // AOE
                new Decorator(
                    ret => Clusters.GetClusterCount(StyxWoW.Me, Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 6f) >= 2,
                    new PrioritySelector(
                        Spell.Cast("Victory Rush", ret => StyxWoW.Me.HealthPercent < 80),
                        Spell.Cast("Thunder Clap"),
                        Spell.Cast("Strike"))),
                // DPS
                Spell.Cast("Strike"),
                Spell.Cast("Thunder Clap", ret => StyxWoW.Me.RagePercent > 50),
                //move to melee
                Movement.CreateMoveToTargetBehavior(true, 5f)
                ));
 }
Пример #4
0
        public static WoWUnit GetBestChainHealTarget()
        {
            if (!Me.IsInGroup())
            {
                return(null);
            }

            if (!Spell.CanCastHack("Chain Heal", Me, skipWowCheck: true))
            {
                Logger.WriteDebug("GetBestChainHealTarget: CanCastHack says NO to Chain Heal");
                return(null);
            }

            WoWUnit target = Clusters.GetBestUnitForCluster(ChainHealPlayers, ClusterType.Chained, ChainHealHopDistance);
            int     count  = 0;

            if (target != null)
            {
                count = Clusters.GetClusterCount(target, ChainHealPlayers, ClusterType.Chained, ChainHealHopDistance);
                if (count < ShamanSettings.RestoHealSettings.MinChainHealCount)
                {
                    target = null;
                }
            }

            if (target != null)
            {
                Logger.WriteDebug("Chain Heal Target:  found {0} with {1} nearby under {2}%", target.SafeName(), count, ShamanSettings.RestoHealSettings.ChainHeal);
            }

            return(target);
        }
Пример #5
0
        public static Composite CreatePriestShadowInstancePullAndCombat()
        {
            return(new PrioritySelector(
                       Safers.EnsureTarget(),
                       Movement.CreateMoveToLosBehavior(),
                       Movement.CreateFaceTargetBehavior(),
                       Spell.WaitForCast(true),
                       Helpers.Common.CreateInterruptSpellCast(ret => StyxWoW.Me.CurrentTarget),
                       Spell.BuffSelf("Shadow Form"),

                       // use fade to drop aggro.
                       Spell.Cast("Fade", ret => (StyxWoW.Me.GroupInfo.IsInParty || StyxWoW.Me.GroupInfo.IsInRaid) && Targeting.GetAggroOnMeWithin(StyxWoW.Me.Location, 30) > 0),

                       // Shadow immune npcs.
                       Spell.Cast("Holy Fire", ctx => StyxWoW.Me.CurrentTarget.IsImmune(WoWSpellSchool.Shadow)),
                       //Spell.Cast("Smite", ctx => StyxWoW.Me.CurrentTarget.IsImmune(WoWSpellSchool.Shadow)),

                       // AoE Rotation
                       new PrioritySelector(
                           ret => Group.Tanks.FirstOrDefault(t =>
                                                             Clusters.GetClusterCount(t, Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 10f) >= 3),
                           new Decorator(
                               ret => ret != null,
                               Spell.Cast("Mind Sear", ret => (WoWUnit)ret))),

                       // In case of a guild raid
                       new Decorator(
                           ret => !Group.Tanks.Any() && Unit.UnfriendlyUnitsNearTarget(10f).Count() >= 3,
                           Spell.Cast("Mind Sear")),



                       // Single target boss rotation
                       new Decorator(
                           ret => StyxWoW.Me.CurrentTarget.IsBoss(),
                           new PrioritySelector(
                               Spell.Cast("Shadow Word: Death", ret => StyxWoW.Me.CurrentTarget.HealthPercent <= 20),
                               Spell.Cast("Mind Blast", ret => StyxWoW.Me.GetCurrentPower(WoWPowerType.ShadowOrbs) < 3),
                               Spell.Buff("Devouring Plague", true, ret => StyxWoW.Me.GetCurrentPower(WoWPowerType.ShadowOrbs) >= 3),
                               Spell.Buff("Shadow Word: Pain", true, ret => StyxWoW.Me.CurrentTarget.Elite),
                               Spell.Buff("Vampiric Touch", true, ret => StyxWoW.Me.CurrentTarget.Elite),
                               Spell.Cast("Mindbender"),
                               Spell.Cast("Power Infusion"),
                               Spell.Cast("Mind Blast"),
                               Spell.Cast("Shadowfiend", ret => StyxWoW.Me.ManaPercent <= SingularSettings.Instance.Priest.ShadowfiendMana && StyxWoW.Me.CurrentTarget.HealthPercent >= 60), // Mana check is for mana management. Don't mess with it
                               Spell.Cast("Mind Flay", ret => StyxWoW.Me.ManaPercent >= SingularSettings.Instance.Priest.MindFlayMana),
                               // Helpers.Common.CreateUseWand(ret => SingularSettings.Instance.Priest.UseWand), // we no longer have wands or shoot
                               Movement.CreateMoveToTargetBehavior(true, 35f)
                               )),

                       // Single target trash rotation
                       Spell.Cast("Mind Blast"),
                       Spell.Cast("Shadow Word: Death", ret => StyxWoW.Me.CurrentTarget.HealthPercent <= 20),
                       Spell.Cast("Mind Spike"),
                       Movement.CreateMoveToTargetBehavior(true, 35f)
                       ));
        }
Пример #6
0
 private static Composite CreateAoe()
 {
     return(new PrioritySelector(
                Spell.Cast("Shockwave", ret => Clusters.GetClusterCount(Me, Unit.NearbyUnfriendlyUnits, ClusterType.Cone, 9) >= 3),
                Spell.Cast("Bladestorm", ret => Me.CurrentTarget.Distance <= 8),
                Spell.Cast("Thunder Clap", ret => Me.CurrentTarget.Distance <= 8),
                Spell.Cast("Cleave", ret => (Me.CurrentRage > 85 || Me.CachedHasAura(122510) || Me.CachedHasAura(122016)) && Clusters.GetClusterCount(Me, Unit.NearbyUnfriendlyUnits, ClusterType.Cone, 5) >= 2)
                ));
 }
Пример #7
0
 private static Composite CreateGlacialAdvanceRotation()
 {
     return(new PrioritySelector(
                Spell.Cast("Howling Blast", ret => Me.CurrentTarget.GetAuraTimeLeft("Frost Fever").TotalSeconds < 1.8d),
                Spell.Cast("Remorseless Winter", ret => Spell.UseAOE && Unit.NearbyUnfriendlyUnits.Count(u => u.IsWithinMeleeRange) >= 2),
                Spell.Cast("Glacial Advance", ret => Spell.UseAOE && Clusters.GetConeClusterCount(20f, Unit.UnfriendlyUnits(15), 100f) > 1),
                Spell.Cast("Frostscythe", ret => Spell.UseAOE && Clusters.GetClusterCount(Me.CurrentTarget, Unit.NearbyUnfriendlyUnits, ClusterType.Cone, 8) >= 3),
                Spell.Cast("Obliterate", ret => (Common.RunicPowerDeficit >= 10 && (!Spell.UseAOE || !Unit.UnfriendlyUnitsNearTarget(8).Any())) || Me.HasActiveAura("Killing Machine")),
                Spell.Cast("Howling Blast", ret => Me.HasActiveAura("Rime")),
                Spell.Cast("Horn of Winter", ret => Me.CurrentRunes < 4 && Common.RunicPowerDeficit >= 20),
                Spell.Cast("Frost Strike"),
                Spell.Cast("Howling Blast")
                ));
 }
Пример #8
0
 private static Composite CreateLowLevelRotation()
 {
     return(new PrioritySelector(
                Spell.Cast("Howling Blast", ret => Me.CurrentTarget.GetAuraTimeLeft("Frost Fever").TotalSeconds < 1.8d),
                Spell.Cast("Remorseless Winter", ret => Spell.UseAOE && Unit.NearbyUnfriendlyUnits.Count(u => u.IsWithinMeleeRange) >= 2),
                Spell.Cast("Frostscythe", ret => Spell.UseAOE && Clusters.GetClusterCount(Me.CurrentTarget, Unit.NearbyUnfriendlyUnits, ClusterType.Cone, 8) >= 3),
                Spell.Cast("Howling Blast", ret => Me.HasActiveAura("Rime")),
                Spell.Cast("Obliterate", ret => Common.RunicPowerDeficit >= 10),
                Spell.Cast("Frost Strike", ret => Common.RunicPowerDeficit < 35),
                Spell.Cast("Horn of Winter", ret => Me.CurrentRunes < 4 && Common.RunicPowerDeficit >= 20),
                Spell.Cast("Frost Strike"),
                Spell.Cast("Howling Blast")
                ));
 }
Пример #9
0
        public static WoWUnit GetBestChiWaveTarget()
        {
            const int ChiWaveHopRange = 20;

            if (!Me.IsInGroup())
            {
                return(null);
            }

            if (!Spell.CanCastHack("Chi Wave", Me, skipWowCheck: true))
            {
                Logger.WriteDebug("GetBestChiWaveTarget: CanCastHack says NO to Chi Wave");
                return(null);
            }

            var targetInfo = HealerManager.Instance.TargetList
                             .Select(p => new { Unit = p, Count = Clusters.GetClusterCount(p, ChiWavePlayers, ClusterType.Chained, ChiWaveHopRange) })
                             .OrderByDescending(v => v.Count)
                             .ThenByDescending(v => Group.Tanks.Any(t => t.Guid == v.Unit.Guid))
                             .DefaultIfEmpty(null)
                             .FirstOrDefault();

            WoWUnit target = targetInfo?.Unit;
            int     count  = targetInfo?.Count ?? 0;

            // too few hops? then search any group member
            if (count < MonkSettings.MistHealSettings.CountChiWave)
            {
                target = Clusters.GetBestUnitForCluster(ChiWavePlayers, ClusterType.Chained, ChiWaveHopRange);
                if (target != null)
                {
                    count = Clusters.GetClusterCount(target, ChiWavePlayers, ClusterType.Chained, ChiWaveHopRange);
                    if (count < MonkSettings.MistHealSettings.CountChiWave)
                    {
                        target = null;
                    }
                }
            }

            if (target != null)
            {
                Logger.WriteDebug("Chi Wave Target:  found {0} with {1} nearby under {2}%", target.SafeName(), count, MonkSettings.MistHealSettings.ChiWave);
            }

            return(target);
        }
Пример #10
0
 public static Composite RetributionCombat()
 {
     return(new Throttle(
                new PrioritySelector(
                    //new Decorator(ret => AdvancedAI.PvPRot,
                    //    RetributionPaladinPvP.CreateRPPvPCombat),
                    new Throttle(1, 1,
                                 new Decorator(ret => Me.HasAura("Dire Fixation"),
                                               new PrioritySelector(
                                                   BossMechs.HorridonHeroic()))),
                    Common.CreateInterruptBehavior(),
                    Dispelling.CreateDispelBehavior(),
                    Spell.Cast("Inquisition",
                               ret =>
                               (!Me.HasAura("Inquisition") || Me.HasAuraExpired("Inquisition", 2)) &&
                               (Me.CurrentHolyPower >= 3 || Me.HasAura("Divine Purpose"))),
                    new Decorator(ret => Me.HasAura("Inquisition") && AdvancedAI.Burst,
                                  new PrioritySelector(
                                      Spell.Cast("Avenging Wrath", ret => Me.CurrentTarget.IsBoss),
                                      Spell.Cast("Holy Avenger", ret => Me.CurrentTarget.IsBoss),
                                      Spell.Cast("Guardian of Ancient Kings",
                                                 ret => Me.CurrentTarget.IsBoss),
                                      new Action(ret => { Item.UseHands(); return RunStatus.Failure; }),
                                      new Action(ret => { Item.UseTrinkets(); return RunStatus.Failure; }))),
                    Spell.Cast("Seal of Righteousness", ret => !Me.HasAura("Seal of Righteousness") && Clusters.GetClusterCount(Me, Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 8f) >= 8),
                    Spell.Cast("Seal of Truth", ret => !Me.HasAura("Seal of Truth") && Clusters.GetClusterCount(Me, Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 8f) < 8),
                    new Decorator(ret => Me.HasAura("Inquisition"),
                                  new PrioritySelector(
                                      Spell.Cast("Execution Sentence", ret => Me.CurrentTarget.IsBoss),
                                      Spell.Cast("Holy Prism"),
                                      Spell.CastOnGround("Light's Hammer", on => Me.CurrentTarget.Location, ret => Me.CurrentTarget.IsBoss),
                                      Spell.Cast("Divine Storm", ret => Clusters.GetClusterCount(Me, Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 8f) >= 2 &&
                                                 (Me.CurrentHolyPower == 5 || Me.HasAura("Divine Purpose"))),
                                      Spell.Cast("Templar's Verdict", ret => Me.CurrentHolyPower == 5 || Me.HasAura("Divine Purpose")))),
                    Spell.Cast("Hammer of Wrath", ret => Me.CurrentHolyPower <= 4),
                    Spell.Cast("Exorcism", ret => Me.CurrentHolyPower <= 4),
                    Spell.Cast("Hammer of the Righteous", ret => Me.CurrentHolyPower <= 4 && Clusters.GetClusterCount(Me, Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 8f) >= 2),
                    // Unit.NearbyUnfriendlyUnits.Count(u => u.DistanceSqr <= 8 * 8) >= 2),
                    Spell.Cast("Crusader Strike", ret => Me.CurrentHolyPower <= 4),
                    Spell.Cast("Judgment", on => SecTar, ret => Me.CurrentHolyPower <= 4 && Clusters.GetClusterCount(Me, Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 15f) >= 2 && Me.HasAura("Glyph of Double Jeopardy")),
                    Spell.Cast("Judgment", ret => Me.CurrentHolyPower <= 4),
                    Spell.Cast("Divine Storm", ret => Me.HasAura("Inquisition") && Clusters.GetClusterCount(Me, Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 8f) >= 2 &&
                               Me.GetAuraTimeLeft("Inquisition").TotalSeconds > 4),
                    Spell.Cast("Templar's Verdict", ret => Me.HasAura("Inquisition") && Me.GetAuraTimeLeft("Inquisition").TotalSeconds > 4))));
 }
Пример #11
0
        public static Composite CreateShadowPriestInstancePullAndCombat()
        {
            return(new PrioritySelector(
                       Safers.EnsureTarget(),
                       Movement.CreateMoveToLosBehavior(),
                       Movement.CreateFaceTargetBehavior(),
                       Spell.WaitForCast(true),
                       Helpers.Common.CreateInterruptSpellCast(ret => StyxWoW.Me.CurrentTarget),
                       Spell.BuffSelf("Shadow Form"),
                       // AoE Rotation
                       new PrioritySelector(
                           ret => Group.Tanks.FirstOrDefault(t =>
                                                             Clusters.GetClusterCount(t, Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 10f) >= 3),
                           new Decorator(
                               ret => ret != null,
                               Spell.Cast("Mind Sear", ret => (WoWUnit)ret))),

                       // In case of a guild raid
                       new Decorator(
                           ret => !Group.Tanks.Any() && Unit.UnfriendlyUnitsNearTarget(10f).Count() >= 3,
                           Spell.Cast("Mind Sear")),

                       // Single target boss rotation
                       new Decorator(
                           ret => StyxWoW.Me.CurrentTarget.IsBoss(),
                           new PrioritySelector(
                               Spell.Buff("Shadow Word: Pain", true),
                               Spell.Cast("Mind Blast", ret => StyxWoW.Me.HasAura("Shadow Orb")),
                               Spell.Buff("Vampiric Touch", true),
                               Spell.Buff("Devouring Plague", true),
                               Spell.Cast("Mind Blast"),
                               Spell.Cast("Shadow Word: Death", ret => StyxWoW.Me.CurrentTarget.HealthPercent <= 25),
                               Spell.BuffSelf("Archangel"),
                               Spell.Cast("Shadowfiend"),
                               Spell.Cast("Mind Flay"),
                               Movement.CreateMoveToTargetBehavior(true, 35f)
                               )),

                       // Single target trash rotation
                       Spell.Cast("Mind Blast", ret => StyxWoW.Me.HasAura("Mind Melt", 2)),
                       Spell.Cast("Shadow Word: Death", ret => StyxWoW.Me.CurrentTarget.HealthPercent <= 25),
                       Spell.Cast("Mind Spike"),
                       Movement.CreateMoveToTargetBehavior(true, 35f)
                       ));
        }
Пример #12
0
        private static Composite CreateArmsAoeCombat(SimpleIntDelegate aoeCount)
        {
            return(new PrioritySelector(
                       new Decorator(ret => Spell.UseAOE && aoeCount(ret) >= 3,
                                     new PrioritySelector(
                                         Spell.BuffSelf("Avatar", ret => WarriorSettings.AvatarOnCooldownAOE),
                                         Spell.Cast("Cleave"),
                                         Spell.Cast("Thunder Clap"),

                                         Spell.Cast("Bladestorm", ret => aoeCount(ret) >= 4),
                                         Spell.Cast("Shockwave", ret => Clusters.GetClusterCount(StyxWoW.Me, Unit.NearbyUnfriendlyUnits, ClusterType.Cone, 10f) >= 3),

                                         Spell.Cast("Whirlwind", ret => Me.CurrentTarget.SpellDistance() < Common.DistanceWindAndThunder(8)),
                                         Spell.Cast("Mortal Strike"),
                                         Spell.Cast("Colossus Smash", ret => !StyxWoW.Me.CurrentTarget.HasMyAura("Colossus Smash")),
                                         Spell.Cast("Overpower")
                                         )
                                     )
                       ));
        }
Пример #13
0
        private static Composite CreateArmsAoeCombat(SimpleIntDelegate aoeCount)
        {
            return(new PrioritySelector(
                       new Decorator(ret => aoeCount(ret) >= 3,
                                     new PrioritySelector(
                                         Spell.Cast("Thunder Clap"),

                                         Spell.Cast("Bladestorm", ret => aoeCount(ret) >= 4),
                                         Spell.Cast("Shockwave", ret => Clusters.GetClusterCount(StyxWoW.Me, Unit.NearbyUnfriendlyUnits, ClusterType.Cone, 10f) >= 3),
                                         Spell.Cast("Dragon Roar"),

                                         Spell.Cast("Whirlwind"),
                                         Spell.Cast("Mortal Strike"),
                                         Spell.Cast("Colossus Smash", ret => !StyxWoW.Me.CurrentTarget.HasMyAura("Colossus Smash")),
                                         Spell.Cast("Overpower")
                                         )
                                     ),

                       Spell.BuffSelf("Sweeping Strikes", ret => aoeCount(ret) == 2)
                       ));
        }
Пример #14
0
        private static WoWUnit GetBestChainHealTarget()
        {
            if (!Me.IsInGroup())
            {
                return(null);
            }

            if (!Spell.CanCastHack("Chain Heal", Me, skipWowCheck: true))
            {
                return(null);
            }

            // search players with Riptide first
            var targetInfo = ChainHealRiptidePlayers
                             .Select(p => new { Unit = p, Count = Clusters.GetClusterCount(p, ChainHealPlayers, ClusterType.Chained, ChainHealHopRange) })
                             .OrderByDescending(v => v.Count)
                             .ThenByDescending(v => Group.Tanks.Any(t => t.Guid == v.Unit.Guid))
                             .DefaultIfEmpty(null)
                             .FirstOrDefault();

            WoWUnit target = targetInfo == null ? null : targetInfo.Unit;
            int     count  = targetInfo == null ? 0 : targetInfo.Count;

            // too few hops? then search any group member
            if (count < 3)
            {
                target = Clusters.GetBestUnitForCluster(ChainHealPlayers, ClusterType.Chained, ChainHealHopRange);
                if (target != null)
                {
                    count = Clusters.GetClusterCount(target, ChainHealPlayers, ClusterType.Chained, ChainHealHopRange);
                    if (count < 3)
                    {
                        target = null;
                    }
                }
            }

            return(target);
        }
Пример #15
0
        public static Composite CreateLowbieWarriorCombat()
        {
            return(new PrioritySelector(
                       Helpers.Common.EnsureReadyToAttackFromMelee(),

                       Spell.WaitForCast(),

                       new Decorator(
                           ret => !Spell.IsGlobalCooldown(),
                           new PrioritySelector(

                               Movement.WaitForFacing(),
                               Movement.WaitForLineOfSpellSight(),

                               Helpers.Common.CreateInterruptBehavior(),

                               Common.CreateChargeBehavior(),

                               // Heal
                               Common.CreateVictoryRushBehavior(),

                               // AOE
                               new Decorator(
                                   ret => Clusters.GetClusterCount(StyxWoW.Me, Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 8f) >= 2,
                                   new PrioritySelector(
                                       Spell.Cast("Thunder Clap", req => Spell.UseAOE)
                                       )
                                   ),
                               // DPS
                               Spell.Cast("Slam"),
                               Spell.Cast("Execute"),
                               Spell.Cast("Thunder Clap", ret => Spell.UseAOE && StyxWoW.Me.RagePercent > 50 && StyxWoW.Me.CurrentTarget.SpellDistance() < Common.DistanceWindAndThunder(8))

                               )
                           )
                       ));
        }
Пример #16
0
        public static Composite CreateProtectionNormalCombat()
        {
            return(new PrioritySelector(
                       ctx => TankManager.Instance.FirstUnit ?? Me.CurrentTarget,
                       Safers.EnsureTarget(),
                       Movement.CreateMoveToLosBehavior(),
                       Movement.CreateFaceTargetBehavior(),
                       Helpers.Common.CreateAutoAttack(true),

                       Spell.WaitForCast(),

                       new Decorator(
                           ret => !Spell.IsGlobalCooldown(),

                           new PrioritySelector(

                               CreateDiagnosticOutputBehavior(),

                               Spell.Cast("Victory Rush"),

                               Spell.Cast("Execute",
                                          ret => SingularRoutine.CurrentWoWContext != WoWContext.Instances &&
                                          Me.CurrentRage > RageDump &&
                                          Me.CurrentTarget.HealthPercent < 20),

                               new Decorator(
                                   ret => SingularSettings.Instance.EnableTaunting && Me.IsInInstance,
                                   CreateTauntBehavior()
                                   ),

                               CreateProtectionInterrupt(),

                               // Multi-target?  get the debuff on them
                               new Decorator(
                                   ret => UseAOE,
                                   new PrioritySelector(
                                       Spell.Cast("Thunder Clap"),
                                       Spell.Cast("Bladestorm", ret => AoeCount >= 4),
                                       Spell.Cast("Shockwave", ret => Clusters.GetClusterCount(StyxWoW.Me, Unit.NearbyUnfriendlyUnits, ClusterType.Cone, 10f) >= 3),
                                       Spell.Cast("Dragon Roar", ret => Me.CurrentTarget.Distance <= 8 || Me.CurrentTarget.IsWithinMeleeRange)
                                       )
                                   ),

                               // Generate Rage
                               Spell.Cast("Shield Slam", ret => Me.CurrentRage < RageBuild),
                               Spell.Cast("Revenge", ret => Me.CurrentRage < RageBuild),
                               Spell.Cast("Devastate", ret => !((WoWUnit)ret).HasAura("Weakened Armor", 3) && Unit.NearbyGroupMembers.Any(m => m.Class == WoWClass.Druid)),
                               Spell.Cast("Thunder Clap", ret => ((WoWUnit)ret).Distance < 8f && !((WoWUnit)ret).ActiveAuras.ContainsKey("Weakened Blows")),

                               // Dump Rage - throttle Cleave and Heroic Strike since off GCD
                               new Throttle(
                                   new PrioritySelector(
                                       Spell.Cast("Cleave", ret => UseAOE && (Me.CurrentRage >= RageDump || HasUltimatum)),
                                       Spell.Cast("Heroic Strike", ret => Me.CurrentRage >= RageDump || HasUltimatum)
                                       )
                                   ),

                               // Filler
                               Spell.Cast("Devastate"),

                               //Charge
                               Common.CreateChargeBehavior(),

                               new Action(ret => {
                if (Me.GotTarget && Me.CurrentTarget.IsWithinMeleeRange && Me.IsSafelyFacing(Me.CurrentTarget))
                {
                    Logger.WriteDebug("--- we did nothing!");
                }
                return RunStatus.Failure;
            })
                               )
                           ),

                       Movement.CreateMoveToMeleeBehavior(true)
                       ));
        }
Пример #17
0
        private static Composite CreateProtectionDefensiveCombat()
        {
            return(new PrioritySelector(

                       CreateProtectionDiagnosticOutput(),

                       Common.CreateVictoryRushBehavior(),

                       new Decorator(
                           ret => SingularSettings.Instance.EnableTaunting && SingularRoutine.CurrentWoWContext == WoWContext.Instances,
                           CreateProtectionTauntBehavior()
                           ),

                       new Sequence(
                           new Decorator(
                               ret => Common.IsSlowNeeded(Me.CurrentTarget),
                               new PrioritySelector(
                                   Spell.Buff("Hamstring")
                                   )
                               ),
                           new Wait(TimeSpan.FromMilliseconds(500), until => !Common.IsSlowNeeded(Me.CurrentTarget), new ActionAlwaysSucceed())
                           ),

                       CreateProtectionInterrupt(),
                       Common.CreateSpellReflectBehavior(),

                       // special "in combat" pull logic for mobs not tagged and out of melee range
                       Common.CreateWarriorCombatPullMore(),

                       // Multi-target?  get the debuff on them
                       new Decorator(
                           ret => Unit.NearbyUnitsInCombatWithMeOrMyStuff.Count() > 1,
                           new PrioritySelector(
                               Spell.BuffSelf("Avatar", ret => WarriorSettings.AvatarOnCooldownAOE),
                               Spell.Cast("Thunder Clap", on => Unit.UnfriendlyUnits(Common.DistanceWindAndThunder(8)).FirstOrDefault()),
                               Spell.Cast("Shockwave", on => Unit.UnfriendlyUnits(8).FirstOrDefault(u => Me.IsSafelyFacing(u)), ret => Clusters.GetClusterCount(StyxWoW.Me, Unit.NearbyUnfriendlyUnits, ClusterType.Cone, 10f) >= 3))
                           ),

                       Spell.BuffSelf("Avatar", ret => WarriorSettings.AvatarOnCooldownSingleTarget),

                       Spell.HandleOffGCD(Spell.Cast("Focused Rage", ret => Me.HasAura(ULTIMATUM_PROC) || Me.RagePercent > 45 && Me.HasAura(FOCUSED_PROC) && !Me.HasAura("Focused Rage") || Me.RagePercent > 90)),
                       Spell.HandleOffGCD(Spell.Cast("Ignore Pain",
                                                     ret =>
                                                     Me.RagePercent > 70 && Me.HasAura(IGNORE_PROC) ||
                                                     (Me.RagePercent > 40 && Me.HasAura(IGNORE_PROC) && !Me.HasAura("Ignore Pain")) ||
                                                     (Me.RagePercent > 70 && !Me.HasAura("Ignore Pain")))
                                          ),
                       Spell.Cast("Shield Block", ret => Spell.GetCharges("Shield Block") > 1),

                       // Generate Rage
                       SingularRoutine.MoveBehaviorInlineToCombat(BehaviorType.Heal),
                       SingularRoutine.MoveBehaviorInlineToCombat(BehaviorType.CombatBuffs),

                       Movement.WaitForFacing(),
                       Movement.WaitForLineOfSpellSight(),

                       Spell.Cast("Shield Slam", ret => Me.CurrentRage < RageBuild && HasShieldInOffHand),
                       Spell.Cast("Revenge"),

                       // Artifact Weapon
                       new Decorator(
                           ret => WarriorSettings.UseArtifactOnlyInAoE && Clusters.GetConeClusterCount(90f, Unit.UnfriendlyUnits(12), 100f) > 1,
                           new PrioritySelector(
                               Spell.HandleOffGCD(Spell.BuffSelf("Battle Cry", req => true, 0, HasGcd.No)),
                               Spell.Cast("Neltharion's Fury", movement => false, target => Me.CurrentTarget, ret => WarriorSettings.UseDPSArtifactWeaponWhen != UseDPSArtifactWeaponWhen.None)
                               )
                           ),
                       Spell.HandleOffGCD(Spell.BuffSelf("Battle Cry", req => true, 0, HasGcd.No)),
                       Spell.Cast("Neltharion's Fury",
                                  movement => false,
                                  target => Me.CurrentTarget,
                                  ret => !WarriorSettings.UseArtifactOnlyInAoE && WarriorSettings.UseDPSArtifactWeaponWhen != UseDPSArtifactWeaponWhen.None && Clusters.GetConeClusterCount(90f, Unit.UnfriendlyUnits(12), 100f) >= 1
                                  ),

                       // Filler
                       Spell.Cast("Devastate"),

                       //Charge
                       Common.CreateChargeBehavior(),

                       Common.CreateAttackFlyingOrUnreachableMobs(),

                       new Action(ret =>
            {
                if (Me.GotTarget() && Me.CurrentTarget.IsWithinMeleeRange && Me.IsSafelyFacing(Me.CurrentTarget))
                {
                    Logger.WriteDebug("--- we did nothing!");
                }
                return RunStatus.Failure;
            })


                       ));
        }
Пример #18
0
        public static Composite CreateProtectionWarriorCombat()
        {
            _slows = new[] { "Hamstring", "Piercing Howl", "Crippling Poison", "Hand of Freedom", "Infected Wounds" };
            return(new PrioritySelector(
                       ctx => TankManager.Instance.FirstUnit ?? StyxWoW.Me.CurrentTarget,

                       Spell.BuffSelf("Defensive Stance"),

                       //Standard
                       Safers.EnsureTarget(),
                       Movement.CreateMoveToLosBehavior(),
                       Movement.CreateFaceTargetBehavior(),
                       Common.CreateAutoAttack(false),

                       //Free Heal
                       //Spell.Cast("Victory Rush", ret => StyxWoW.Me.CurrentTarget.Distance < 5),
                       new Decorator(ret => StyxWoW.Me.HealthPercent <= SingularSettings.Instance.Warrior.WarriorEnragedRegenerationHealth,
                                     new PrioritySelector(
                                         Spell.BuffSelf("Berserker Rage"),
                                         Spell.BuffSelf("Enraged Regeneration")
                                         )),

                       //Defensive Cooldowns
                       Spell.BuffSelf("Shield Block"),
                       Spell.BuffSelf("Battle Shout", ret => (SingularSettings.Instance.Warrior.UseWarriorShouts || SingularSettings.Instance.Warrior.UseWarriorT12) && !StyxWoW.Me.HasAnyAura("Horn of Winter", "Roar of Courage", "Strength of Earth Totem", "Battle Shout")),
                       Spell.BuffSelf("Shield Wall", ret => StyxWoW.Me.HealthPercent <= SingularSettings.Instance.Warrior.WarriorProtShieldWallHealth),
                       Spell.Buff("Demoralizing Shout", ret => SpellManager.CanCast("Demoralizing Shout") && !StyxWoW.Me.CurrentTarget.HasDemoralizing()),

                       //Close cap on target
                       Spell.Cast("Charge", ret => StyxWoW.Me.CurrentTarget.Distance.Between(8f, TalentManager.HasGlyph("Long Charge") ? 30f : 25f)),
                       Spell.Cast("Intercept", ret => StyxWoW.Me.CurrentTarget.Distance.Between(8f, 25f)),
                       Spell.CastOnGround(
                           "Heroic Leap", ret => StyxWoW.Me.CurrentTarget.Location,
                           ret => StyxWoW.Me.CurrentTarget.Distance > 10 && StyxWoW.Me.CurrentTarget.Distance <= 40),

                       //Interupt or reflect
                       Spell.Cast("Spell Reflection", ret => StyxWoW.Me.CurrentTarget.CurrentTarget == StyxWoW.Me && StyxWoW.Me.CurrentTarget.IsCasting),
                       Common.CreateInterruptSpellCast(ret => StyxWoW.Me.CurrentTarget),

                       //PVP
                       new Decorator(
                           ret => StyxWoW.Me.GotTarget && StyxWoW.Me.CurrentTarget.IsPlayer,
                           new PrioritySelector(
                               Spell.Cast("Victory Rush", ret => StyxWoW.Me.HealthPercent < 80),
                               Spell.Cast("Disarm", ctx => StyxWoW.Me.CurrentTarget.DistanceSqr < 36 &&
                                          (StyxWoW.Me.CurrentTarget.Class == WoWClass.Warrior || StyxWoW.Me.CurrentTarget.Class == WoWClass.Rogue ||
                                           StyxWoW.Me.CurrentTarget.Class == WoWClass.Paladin || StyxWoW.Me.CurrentTarget.Class == WoWClass.Hunter)),
                               Spell.Buff("Rend"),
                               Spell.Cast("Thunder Clap", ctx => StyxWoW.Me.CurrentTarget.DistanceSqr < 7 * 7 && StyxWoW.Me.CurrentTarget.Attackable),
                               Spell.Cast("Shockwave"),
                               Spell.Buff("Piercing Howl", ret => StyxWoW.Me.CurrentTarget.Distance < 10 && StyxWoW.Me.CurrentTarget.IsPlayer && !StyxWoW.Me.CurrentTarget.HasAnyAura(_slows)),
                               Spell.Cast("Cleave", ret => Clusters.GetClusterCount(StyxWoW.Me, Unit.NearbyUnfriendlyUnits, ClusterType.Cone, 10f) >= 2),
                               Spell.Cast("Concussion Blow"),
                               Spell.Cast("Shield Slam"),
                               Spell.Cast("Revenge"),
                               Spell.Cast("Devastate"),
                               Spell.Cast("Heroic Strike", ret => StyxWoW.Me.RagePercent >= 50)
                               )),

                       //Aoe tanking
                       new Decorator(
                           ret => Targeting.GetAggroOnMeWithin(StyxWoW.Me.Location, 15f) > 1,
                           new PrioritySelector(
                               Spell.Buff("Rend"),
                               Spell.Cast("Thunder Clap", ctx => StyxWoW.Me.GotTarget && StyxWoW.Me.CurrentTarget.DistanceSqr < 7 * 7 && StyxWoW.Me.CurrentTarget.Attackable),
                               Spell.Cast("Shockwave", ret => Clusters.GetClusterCount(StyxWoW.Me, Unit.NearbyUnfriendlyUnits, ClusterType.Cone, 10f) >= 2),
                               Spell.Cast("Cleave", ret => Clusters.GetClusterCount(StyxWoW.Me, Unit.NearbyUnfriendlyUnits, ClusterType.Cone, 10f) >= 2)
                               )),

                       //Taunts
                       //If more than 3 taunt, if needs to taunt
                       Spell.Cast(
                           "Challenging Shout", ret => TankManager.Instance.NeedToTaunt.First(),
                           ret => SingularSettings.Instance.EnableTaunting && TankManager.Instance.NeedToTaunt.Count(u => u.Distance <= 10) >= 3),
                       // If there's a unit that needs taunting, do it.
                       Spell.Cast("Taunt", ret => TankManager.Instance.NeedToTaunt.First(), ret => SingularSettings.Instance.EnableTaunting && TankManager.Instance.NeedToTaunt.FirstOrDefault() != null),

                       //Single Target
                       Spell.Cast("Victory Rush", ret => StyxWoW.Me.HealthPercent < 80),
                       Spell.Cast("Concussion Blow"),
                       Spell.Cast("Shield Slam"),
                       Spell.Cast("Revenge"),
                       Spell.Cast("Heroic Strike", ret => StyxWoW.Me.RagePercent >= 50),
                       Spell.Buff("Rend"),
                       // Tclap may not be a giant threat increase, but Blood and Thunder will refresh rend. Which all in all, is a good thing.
                       // Oh, and the attack speed debuff is win as well.
                       Spell.Cast("Thunder Clap", ctx => StyxWoW.Me.GotTarget && StyxWoW.Me.CurrentTarget.DistanceSqr < 7 * 7 && StyxWoW.Me.CurrentTarget.Attackable),
                       Spell.Cast("Shockwave"),
                       Spell.Cast("Devastate"),

                       Movement.CreateMoveToTargetBehavior(true, 4f)
                       ));
        }
Пример #19
0
        public static Composite CrusaderCombat()
        {
            return(new PrioritySelector(CtxChanger,
                                        Common.CreateUsePotion(),
                                        Common.CreateWaitWhileFearedStunnedFrozenOrBlind(),
                                        Common.CreateGetHealthGlobe(),
                                        Common.CreateUseHealthWell(),
                                        Common.CreateWaitForAttack(),

                                        #region Defensive

                                        new CastAtLocation(SNOPower.X1_Crusader_Judgment, ctx => ((CombatContext)ctx).TargetPosition,
                                                           ctx =>
                                                           (((CombatContext)ctx).CurrentTargetIsElite && ((CombatContext)ctx).TargetDistance <= 30) ||
                                                           Clusters.GetClusterCount(((CombatContext)ctx).CurrentTarget, ((CombatContext)ctx),
                                                                                    15f) >=
                                                           BelphegorSettings.Instance.Crusader.JudgmentAoECount),
                                        new CastOnUnit(SNOPower.X1_Crusader_ShieldGlare, ctx => ((CombatContext)ctx).TargetGuid,
                                                       ctx =>
                                                       Unit.IsEliteInRange(16f, ((CombatContext)ctx)) ||
                                                       Clusters.GetFacingCount(16f, 70f, ((CombatContext)ctx)) >=
                                                       BelphegorSettings.Instance.Crusader.ShieldGlareAoECount),
                                        new SelfCast(SNOPower.X1_Crusader_IronSkin,
                                                     ret => ZetaDia.Me.HitpointsCurrentPct <= BelphegorSettings.Instance.Crusader.IronSkinHpPct),
                                        new SelfCast(SNOPower.X1_Crusader_Consecration,
                                                     ret => ZetaDia.Me.HitpointsCurrentPct <= BelphegorSettings.Instance.Crusader.ConsecrationHpPct),

                                        #endregion

                                        #region Laws
                                        new SelfCast(SNOPower.X1_Crusader_LawsOfHope2,
                                                     ret => ZetaDia.Me.HitpointsCurrentPct <= BelphegorSettings.Instance.Crusader.LawsOfHopeHpPct),
                                        new SelfCast(SNOPower.X1_Crusader_LawsOfJustice2,
                                                     ctx =>
                                                     Unit.IsEliteInRange(16f, ((CombatContext)ctx)) ||
                                                     ZetaDia.Me.HitpointsCurrentPct <= BelphegorSettings.Instance.Crusader.LawsOfJusticeHpPct),
                                        new SelfCast(SNOPower.X1_Crusader_LawsOfValor2,
                                                     ctx =>
                                                     Unit.IsEliteInRange(16f, ((CombatContext)ctx)) ||
                                                     (Hotbar.HasRune(SNOPower.X1_Crusader_LawsOfValor2, 4) &&
                                                      ((CombatContext)ctx).TargetDistance <= 15f)),

                                        #endregion

                                        #region Conviction

                                        new SelfCast(SNOPower.X1_Crusader_AkaratsChampion,
                                                     ctx => Unit.IsEliteInRange(16f, ((CombatContext)ctx)) || ZetaDia.Me.HitpointsCurrentPct < 0.30),
                                        new CastOnUnit(SNOPower.X1_Crusader_Bombardment, ctx => ((CombatContext)ctx).TargetGuid,
                                                       ctx => ((CombatContext)ctx).CurrentTargetIsElite ||
                                                       Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx), 15f) >=
                                                       BelphegorSettings.Instance.Crusader.BombardmentAoECount),
                                        new CastOnUnit(SNOPower.X1_Crusader_FallingSword, ctx => ((CombatContext)ctx).TargetGuid,
                                                       ctx =>
                                                       ((CombatContext)ctx).CurrentTargetIsElite ||
                                                       Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx), 15f) >=
                                                       BelphegorSettings.Instance.Crusader.FallingSwordAoECount),
                                        new CastOnUnit(SNOPower.X1_Crusader_HeavensFury3, ctx => ((CombatContext)ctx).TargetGuid,
                                                       ctx =>
                                                       ((CombatContext)ctx).CurrentTargetIsElite ||
                                                       Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx), 15f) >=
                                                       BelphegorSettings.Instance.Crusader.HeavensFuryAoECount),

                                        #endregion

                                        #region Utility
                                        new SelfCast(SNOPower.X1_Crusader_Provoke,
                                                     ctx =>
                                                     ZetaDia.Me.CurrentPrimaryResource < 70 &&
                                                     (Clusters.GetClusterCount(((CombatContext)ctx).CurrentTarget, ((CombatContext)ctx),
                                                                               15f) >= 3 || Unit.IsEliteInRange(14f, ((CombatContext)ctx)))),
                                        new SelfCast(SNOPower.X1_Crusader_Condemn,
                                                     ctx =>
                                                     (((CombatContext)ctx).CurrentTargetIsElite && ((CombatContext)ctx).TargetDistance <= 15f) ||
                                                     Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx), 15f) >=
                                                     BelphegorSettings.Instance.Crusader.CondemnAoECount),
                                        new SelfCast(SNOPower.X1_Crusader_SteedCharge,
                                                     ctx =>
                                                     ((CombatContext)ctx).TargetDistance >= BelphegorSettings.Instance.Crusader.SteedChargeMinRange),
                                        new CastOnUnit(SNOPower.x1_Crusader_Phalanx3, ctx => ((CombatContext)ctx).TargetGuid,
                                                       ctx =>
                                                       Clusters.GetClusterCount(((CombatContext)ctx).CurrentTarget, ((CombatContext)ctx),
                                                                                15f) >= 3),

                                        #endregion

                                        #region Secondary
                                        //Secondary skills
                                        new SelfCast(SNOPower.X1_Crusader_BlessedHammer,
                                                     ctx =>
                                                     Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx), 18f) >=
                                                     BelphegorSettings.Instance.Crusader.BlessedHammerkAoECount),

                                        //If we have the 5th rune it no longer bounces
                                        new CastOnUnit(SNOPower.X1_Crusader_BlessedShield, ctx => ((CombatContext)ctx).TargetGuid,
                                                       ctx => Hotbar.HasRune(SNOPower.X1_Crusader_BlessedShield, 5) ||
                                                       Clusters.GetClusterCount(((CombatContext)ctx).CurrentTarget, ((CombatContext)ctx),
                                                                                14f) >= 3),
                                        new CastOnUnit(SNOPower.X1_Crusader_FistOfTheHeavens, ctx => ((CombatContext)ctx).TargetGuid),
                                        new CastOnUnit(SNOPower.X1_Crusader_ShieldBash2, ctx => ((CombatContext)ctx).TargetGuid),
                                        new CastOnUnit(SNOPower.X1_Crusader_SweepAttack, ctx => ((CombatContext)ctx).TargetGuid,
                                                       ctx => Unit.IsEliteInRange(18f, ((CombatContext)ctx)) ||
                                                       Clusters.GetFacingCount(18f, 100f, ((CombatContext)ctx)) >=
                                                       BelphegorSettings.Instance.Crusader.SweepAttackAoECount),

                                        #endregion

                                        #region Primary
                                        new CastOnUnit(SNOPower.X1_Crusader_Slash,
                                                       ctx => ((CombatContext)ctx).TargetGuid, null,
                                                       ctx => PrimarySpamTimer.Reset(),
                                                       keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger),
                                        new CastOnUnit(SNOPower.X1_Crusader_Smite,
                                                       ctx => ((CombatContext)ctx).TargetGuid, null,
                                                       ctx => PrimarySpamTimer.Reset(),
                                                       keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger),
                                        new CastOnUnit(SNOPower.X1_Crusader_Punish,
                                                       ctx => ((CombatContext)ctx).TargetGuid, null,
                                                       ctx => PrimarySpamTimer.Reset(),
                                                       keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger),
                                        new CastOnUnit(SNOPower.X1_Crusader_Justice,
                                                       ctx => ((CombatContext)ctx).TargetGuid, null,
                                                       ctx => PrimarySpamTimer.Reset(),
                                                       keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger)
                                        ));

            #endregion
        }
Пример #20
0
        public static Composite CreateHolyHealOnlyBehavior(bool selfOnly, bool moveInRange)
        {
            HealerManager.NeedHealTargeting = true;
            WoWUnit healTarget = null;

            return(new
                   PrioritySelector(
                       ret => healTarget = selfOnly ? StyxWoW.Me : HealerManager.Instance.FirstUnit,
                       new Decorator(
                           ret => healTarget != null && (moveInRange || healTarget.InLineOfSpellSight && healTarget.DistanceSqr < 40 * 40),
                           new PrioritySelector(
                               Spell.WaitForCast(),
                               new Decorator(
                                   ret => moveInRange,
                                   Movement.CreateMoveToLosBehavior(ret => healTarget)),
                               // use fade to drop aggro.
                               Spell.Cast("Fade", ret => (StyxWoW.Me.GroupInfo.IsInParty || StyxWoW.Me.GroupInfo.IsInRaid) && StyxWoW.Me.CurrentMap.IsInstance && Targeting.GetAggroOnMeWithin(StyxWoW.Me.Location, 30) > 0),

                               Spell.Cast("Mindbender", ret => StyxWoW.Me.ManaPercent <= 80 && StyxWoW.Me.GotTarget),
                               Spell.Cast("Shadowfiend", ret => StyxWoW.Me.ManaPercent <= 80 && StyxWoW.Me.GotTarget),

                               Spell.BuffSelf("Desperate Prayer", ret => StyxWoW.Me.GetPredictedHealthPercent() <= 50),
                               Spell.BuffSelf("Hymn of Hope", ret => StyxWoW.Me.ManaPercent <= 15 && (!SpellManager.HasSpell("Shadowfiend") || SpellManager.Spells["Shadowfiend"].Cooldown)),
                               Spell.BuffSelf("Divine Hymn", ret => Unit.NearbyFriendlyPlayers.Count(p => p.GetPredictedHealthPercent() <= SingularSettings.Instance.Priest.DivineHymnHealth) >= SingularSettings.Instance.Priest.DivineHymnCount),

                               Spell.BuffSelf("Chakra: Sanctuary"), // all 3 are avail with a cd in holy - add them to the UI manager for holy priest - default Sanctuary
                               Spell.Cast(
                                   "Prayer of Mending",
                                   ret => healTarget,
                                   ret => ret is WoWPlayer && Group.Tanks.Contains((WoWPlayer)ret) && !((WoWUnit)ret).HasMyAura("Prayer of Mending", 3) &&
                                   Group.Tanks.Where(t => t != healTarget).All(p => !p.HasMyAura("Prayer of Mending"))),
                               Spell.Heal(
                                   "Renew",
                                   ret => healTarget,
                                   ret => healTarget is WoWPlayer && Group.Tanks.Contains(healTarget) && !healTarget.HasMyAura("Renew")),
                               Spell.Heal("Prayer of Healing",
                                          ret => healTarget,
                                          ret => StyxWoW.Me.HasAura("Serendipity", 2) && Unit.NearbyFriendlyPlayers.Count(p => p.GetPredictedHealthPercent() <= SingularSettings.Instance.Priest.PrayerOfHealingSerendipityHealth) >= SingularSettings.Instance.Priest.PrayerOfHealingSerendipityCount),
                               Spell.Heal("Circle of Healing",
                                          ret => healTarget,
                                          ret => Unit.NearbyFriendlyPlayers.Count(p => p.GetPredictedHealthPercent() <= SingularSettings.Instance.Priest.CircleOfHealingHealth) >= SingularSettings.Instance.Priest.CircleOfHealingCount),
                               Spell.CastOnGround(
                                   "Holy Word: Sanctuary",
                                   ret => Clusters.GetBestUnitForCluster(Unit.NearbyFriendlyPlayers.Select(p => p.ToUnit()), ClusterType.Radius, 10f).Location,
                                   ret => Clusters.GetClusterCount(healTarget,
                                                                   Unit.NearbyFriendlyPlayers.Select(p => p.ToUnit()),
                                                                   ClusterType.Radius, 10f) >= 4),
                               Spell.Heal(
                                   "Holy Word: Serenity",
                                   ret => healTarget,
                                   ret => ret is WoWPlayer && Group.Tanks.Contains(healTarget)),

                               Spell.Buff("Guardian Spirit",
                                          ret => healTarget,
                                          ret => healTarget.GetPredictedHealthPercent() <= 10),

                               Spell.CastOnGround("Lightwell", ret => WoWMathHelper.CalculatePointFrom(StyxWoW.Me.Location, healTarget.Location, 5f)),

                               Spell.Cast("Power Infusion", ret => healTarget.GetPredictedHealthPercent() < 40 || StyxWoW.Me.ManaPercent <= 20),
                               Spell.Heal(
                                   "Flash Heal",
                                   ret => healTarget,
                                   ret => StyxWoW.Me.HasAura("Surge of Light") && healTarget.GetPredictedHealthPercent() <= 90),
                               Spell.Heal(
                                   "Flash Heal",
                                   ret => healTarget,
                                   ret => healTarget.GetPredictedHealthPercent() < SingularSettings.Instance.Priest.HolyFlashHeal),
                               Spell.Heal(
                                   "Greater Heal",
                                   ret => healTarget,
                                   ret => healTarget.GetPredictedHealthPercent() < SingularSettings.Instance.Priest.HolyGreaterHeal),
                               Spell.Heal(
                                   "Heal",
                                   ret => healTarget,
                                   ret => healTarget.GetPredictedHealthPercent() < SingularSettings.Instance.Priest.HolyHeal),
                               new Decorator(
                                   ret => StyxWoW.Me.Combat && StyxWoW.Me.GotTarget && Unit.NearbyFriendlyPlayers.Count(u => u.IsInMyPartyOrRaid) == 0,
                                   new PrioritySelector(
                                       Movement.CreateMoveToLosBehavior(),
                                       Movement.CreateFaceTargetBehavior(),
                                       Helpers.Common.CreateInterruptSpellCast(ret => StyxWoW.Me.CurrentTarget),
                                       Spell.Cast("Shadow Word: Death", ret => StyxWoW.Me.CurrentTarget.GetPredictedHealthPercent() <= 20),
                                       Spell.Buff("Shadow Word: Pain", true, ret => SpellManager.HasSpell("Power Word: Solace")),
                                       Spell.Cast("Holy Word: Chastise"),
                                       Spell.Cast("Mindbender"),
                                       Spell.Cast("Holy Fire"),
                                       Spell.Cast("Power Word: Solace"),
                                       Spell.Cast("Smite", ret => !SpellManager.HasSpell("Power Word: Solace")),
                                       Spell.Cast("Mind Spike", ret => !SpellManager.HasSpell("Power Word: Solace")),
                                       Movement.CreateMoveToTargetBehavior(true, 35f)
                                       )),
                               new Decorator(
                                   ret => moveInRange,
                                   Movement.CreateMoveToTargetBehavior(true, 35f, ret => healTarget))

                               // Divine Hymn
                               // Desperate Prayer
                               // Prayer of Mending
                               // Prayer of Healing
                               // Power Word: Barrier
                               // TODO: Add smite healing. Only if Atonement is talented. (Its useless otherwise)
                               ))));
        }
Пример #21
0
        public static Composite CreateFrostMageInstancePullAndCombat()
        {
            return(new PrioritySelector(
                       Safers.EnsureTarget(),
                       Movement.CreateMoveToLosBehavior(),
                       Movement.CreateFaceTargetBehavior(),
                       Helpers.Common.CreateAutoAttack(true),
                       Spell.WaitForCast(true),

                       // We want our pet alive !
                       new Decorator(
                           ret => !StyxWoW.Me.GotAlivePet && PetManager.PetTimer.IsFinished && SpellManager.CanCast("Summon Water Elemental"),
                           new Action(ret => PetManager.CallPet("Summon Water Elemental"))),

                       // Defensive stuff
                       new Decorator(
                           ret => StyxWoW.Me.ActiveAuras.ContainsKey("Ice Block"),
                           new ActionIdle()),
                       Spell.BuffSelf("Ice Block", ret => StyxWoW.Me.HealthPercent < 20 && !StyxWoW.Me.ActiveAuras.ContainsKey("Hypothermia")),

                       // Cooldowns
                       Spell.BuffSelf("Evocation", ret => StyxWoW.Me.ManaPercent < 30),
                       Spell.BuffSelf("Mirror Image"),
                       Spell.BuffSelf("Mage Ward", ret => StyxWoW.Me.HealthPercent <= 75),
                       Spell.BuffSelf("Icy Veins"),

                       Common.CreateUseManaGemBehavior(ret => StyxWoW.Me.ManaPercent < 80),
                       // AoE comes first
                       new Decorator(
                           ret => Unit.UnfriendlyUnitsNearTarget(10f).Count() >= 3,
                           new PrioritySelector(
                               Spell.CastOnGround("Flamestrike",
                                                  ret => Clusters.GetBestUnitForCluster(Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 8f).Location,
                                                  ret => !ObjectManager.GetObjectsOfType <WoWDynamicObject>().Any(o =>
                                                                                                                  o.CasterGuid == StyxWoW.Me.Guid && o.Spell.Name == "Flamestrike" &&
                                                                                                                  o.Location.Distance(
                                                                                                                      Clusters.GetBestUnitForCluster(Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 8f).Location) < o.Radius)),
                               Spell.Cast("Cone of Cold",
                                          ret => Clusters.GetClusterCount(StyxWoW.Me.CurrentTarget,
                                                                          Unit.NearbyUnfriendlyUnits,
                                                                          ClusterType.Cone, 15f) >= 3),
                               Spell.CastOnGround("Blizzard",
                                                  ret => StyxWoW.Me.CurrentTarget.Location),
                               Spell.Cast("Arcane Explosion",
                                          ret => Clusters.GetClusterCount(StyxWoW.Me,
                                                                          Unit.NearbyUnfriendlyUnits,
                                                                          ClusterType.Radius,
                                                                          10f) >= 3),
                               Movement.CreateMoveToTargetBehavior(true, 35f)
                               )),

                       Spell.BuffSelf("Time Warp",
                                      ret => !StyxWoW.Me.IsInRaid && StyxWoW.Me.CurrentTarget.HealthPercent > 20 && StyxWoW.Me.CurrentTarget.IsBoss() &&
                                      !StyxWoW.Me.HasAura("Temporal Displacement")),

                       // Rotation
                       Spell.Cast("Deep Freeze",
                                  ret => StyxWoW.Me.ActiveAuras.ContainsKey("Fingers of Frost") ||
                                  StyxWoW.Me.CurrentTarget.HasAura("Freeze") ||
                                  StyxWoW.Me.CurrentTarget.HasAura("Frost Nova")),
                       Spell.BuffSelf("Flame Orb"),
                       Pet.CreateCastPetActionOnLocation("Freeze"),
                       Spell.Cast("Arcane Missiles", ret => StyxWoW.Me.ActiveAuras.ContainsKey("Arcane Missiles!")),
                       new Decorator(
                           ret => StyxWoW.Me.ActiveAuras.ContainsKey("Brain Freeze"),
                           new PrioritySelector(
                               Spell.Cast("Frostfire Bolt"),
                               Spell.Cast("Fireball")
                               )),
                       Spell.Cast("Ice Lance",
                                  ret => StyxWoW.Me.ActiveAuras.ContainsKey("Fingers of Frost") ||
                                  StyxWoW.Me.CurrentTarget.HasAura("Freeze") ||
                                  StyxWoW.Me.CurrentTarget.HasAura("Frost Nova") ||
                                  StyxWoW.Me.IsMoving),
                       Spell.Cast("Frostbolt"),
                       Movement.CreateMoveToTargetBehavior(true, 35f)
                       ));
        }
Пример #22
0
        public static Composite CreateArmsCombat()
        {
            _slows = new[] { "Hamstring", "Piercing Howl", "Crippling Poison", "Hand of Freedom", "Infected Wounds" };
            return(new PrioritySelector(
                       //Ensure Target
                       Safers.EnsureTarget(),
                       //LOS check
                       Movement.CreateMoveToLosBehavior(),
                       // face target
                       Movement.CreateFaceTargetBehavior(),
                       // Auto Attack
                       Common.CreateAutoAttack(false),

                       // Dispel Bubbles
                       new Decorator(ret => StyxWoW.Me.CurrentTarget.IsPlayer && (StyxWoW.Me.CurrentTarget.ActiveAuras.ContainsKey("Ice Block") || StyxWoW.Me.CurrentTarget.ActiveAuras.ContainsKey("Hand of Protection") || StyxWoW.Me.CurrentTarget.ActiveAuras.ContainsKey("Divine Shield")) && SingularSettings.Instance.Warrior.UseWarriorBasicRotation == false,
                                     new PrioritySelector(
                                         Spell.WaitForCast(),
                                         Movement.CreateEnsureMovementStoppedBehavior(),
                                         Spell.Cast("Shattering Throw"),
                                         Movement.CreateMoveToTargetBehavior(true, 30f)
                                         )),

                       //Rocket belt!
                       new Decorator(ret => StyxWoW.Me.CurrentTarget.IsPlayer && StyxWoW.Me.CurrentTarget.Distance > 20,
                                     Item.UseEquippedItem((uint)WoWInventorySlot.Waist)),

                       // Hands
                       Item.UseEquippedItem((uint)WoWInventorySlot.Hands),

                       //Stance Dancing
                       //Pop over to Zerker
                       Spell.BuffSelf("Berserker Stance", ret => StyxWoW.Me.CurrentTarget.HasMyAura("Rend") && !StyxWoW.Me.ActiveAuras.ContainsKey("Taste for Blood") && StyxWoW.Me.RagePercent < 75 && StyxWoW.Me.CurrentTarget.IsBoss() && SingularSettings.Instance.Warrior.UseWarriorStanceDance),
                       //Keep in Battle Stance
                       Spell.BuffSelf("Battle Stance", ret => !StyxWoW.Me.CurrentTarget.HasMyAura("Rend") || ((StyxWoW.Me.ActiveAuras.ContainsKey("Overpower") || StyxWoW.Me.ActiveAuras.ContainsKey("Taste for Blood")) && SpellManager.Spells["Mortal Strike"].Cooldown) && StyxWoW.Me.RagePercent <= 75 && SingularSettings.Instance.Warrior.UseWarriorKeepStance),

                       Spell.Cast("Charge", ret => StyxWoW.Me.CurrentTarget.Distance >= 10 && StyxWoW.Me.CurrentTarget.Distance <= 25 && SingularSettings.Instance.Warrior.UseWarriorBasicRotation == false && SingularSettings.Instance.Warrior.UseWarriorCloser && PreventDoubleCharge),
                       //Heroic Leap
                       Spell.CastOnGround("Heroic Leap", ret => StyxWoW.Me.CurrentTarget.Location, ret => StyxWoW.Me.CurrentTarget.Distance > 9 && !StyxWoW.Me.CurrentTarget.HasAura("Charge Stun", 1) && SingularSettings.Instance.Warrior.UseWarriorBasicRotation == false && SingularSettings.Instance.Warrior.UseWarriorCloser && PreventDoubleCharge),

                       Movement.CreateMoveBehindTargetBehavior(),
                       //use it or lose it
                       Spell.Cast("Colossus Smash", ret => StyxWoW.Me.HasAura("Sudden Death", 1)),

                       // ranged slow
                       Spell.Buff("Piercing Howl", ret => StyxWoW.Me.CurrentTarget.Distance < 10 && StyxWoW.Me.CurrentTarget.IsPlayer && !StyxWoW.Me.CurrentTarget.HasAnyAura(_slows) && SingularSettings.Instance.Warrior.UseWarriorSlows && SingularSettings.Instance.Warrior.UseWarriorBasicRotation == false),
                       // Melee slow
                       Spell.Cast("Hamstring", ret => StyxWoW.Me.CurrentTarget.IsPlayer && !StyxWoW.Me.CurrentTarget.HasAnyAura(_slows) && SingularSettings.Instance.Warrior.UseWarriorSlows && SingularSettings.Instance.Warrior.UseWarriorBasicRotation == false),

                       //Mele Heal
                       Spell.Cast("Victory Rush", ret => StyxWoW.Me.HealthPercent < 80),

                       // AOE
                       new Decorator(ret => Clusters.GetClusterCount(StyxWoW.Me, Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 6f) >= 3 && SingularSettings.Instance.Warrior.UseWarriorAOE,
                                     new PrioritySelector(
                                         // recklessness gets to be used in any stance soon
                                         Spell.BuffSelf("Recklessness", ret => SingularSettings.Instance.Warrior.UseWarriorDpsCooldowns && SingularSettings.Instance.Warrior.UseWarriorBasicRotation == false),
                                         Spell.BuffSelf("Sweeping Strikes"),
                                         Spell.Cast("Bladestorm", ret => SingularSettings.Instance.Warrior.UseWarriorBladestorm && StyxWoW.Me.CurrentTarget.DistanceSqr < 36),
                                         Spell.Cast("Cleave"),
                                         Spell.Cast("Mortal Strike"))),

                       //Interupts
                       new Decorator(ret => StyxWoW.Me.CurrentTarget.IsCasting && SingularSettings.Instance.Warrior.UseWarriorInterupts,
                                     new PrioritySelector(
                                         Common.CreateInterruptSpellCast(ret => StyxWoW.Me.CurrentTarget),
                                         // Only pop TD on elites/players
                                         Spell.Cast("Throwdown", ret => (StyxWoW.Me.CurrentTarget.IsPlayer || StyxWoW.Me.CurrentTarget.Elite) && SingularSettings.Instance.Warrior.UseWarriorThrowdown),
                                         Spell.Buff("Intimidating Shout", ret => StyxWoW.Me.CurrentTarget.Distance < 8 && StyxWoW.Me.CurrentTarget.IsPlayer && StyxWoW.Me.CurrentTarget.IsCasting && SingularSettings.Instance.Warrior.UseWarriorBasicRotation == false))),

                       new Decorator(ret => StyxWoW.Me.CurrentTarget.IsBoss() && StyxWoW.Me.CurrentTarget.HealthPercent <= 25,
                                     new PrioritySelector(
                                         Spell.WaitForCast(),
                                         Movement.CreateEnsureMovementStoppedBehavior(),
                                         Spell.Cast("Shattering Throw"),
                                         Movement.CreateMoveToTargetBehavior(true, 30))),

                       // Use Engineering Gloves
                       Item.UseEquippedItem((uint)WoWInventorySlot.Hands),

                       //Execute under 20%
                       Spell.Cast("Execute", ret => StyxWoW.Me.CurrentTarget.HealthPercent < 20),

                       //Default Rotatiom
                       Spell.Buff("Rend"),
                       Spell.Cast("Colossus Smash"),
                       Spell.Cast("Mortal Strike"),
                       //Bladestorm after dots and MS if against player
                       Spell.Cast("Bladestorm", ret => StyxWoW.Me.CurrentTarget.IsPlayer && StyxWoW.Me.CurrentTarget.DistanceSqr < 36 && SingularSettings.Instance.Warrior.UseWarriorBladestorm),
                       Spell.Cast("Overpower"),
                       Spell.Cast("Slam", ret => StyxWoW.Me.RagePercent > 40 && SingularSettings.Instance.Warrior.UseWarriorSlamTalent),

                       Spell.Cast("Cleave", ret =>
                                  // Only even think about Cleave for more than 2 mobs. (We're probably best off using melee range)
                                  Clusters.GetClusterCount(StyxWoW.Me, Unit.NearbyUnfriendlyUnits, ClusterType.Cone, 6f) >= 2 &&
                                  // If we have Incite, Deadly Calm, or enough rage (pooling for CS if viable) we're good.
                                  (StyxWoW.Me.HasAura("Incite", 1) || CanUseRageDump() || StyxWoW.Me.ActiveAuras.ContainsKey("Deadly Calm"))),
                       Spell.Cast("Heroic Strike", ret =>
                                  // Only even think about HS for less than 2 mobs. (We're probably best off using melee range)
                                  Clusters.GetClusterCount(StyxWoW.Me, Unit.NearbyUnfriendlyUnits, ClusterType.Cone, 6f) < 2 &&
                                  // If we have Incite, Deadly Calm, or enough rage (pooling for CS if viable) we're good.
                                  (StyxWoW.Me.HasAura("Incite", 1) || CanUseRageDump() || StyxWoW.Me.ActiveAuras.ContainsKey("Deadly Calm"))),

                       //ensure were in melee
                       Movement.CreateMoveToMeleeBehavior(true)
                       ));
        }
Пример #23
0
        public static Composite CreateRestoShamanHealingOnlyBehavior(bool selfOnly, bool moveInRange)
        {
            HealerManager.NeedHealTargeting = true;
            PrioritizedBehaviorList behavs = new PrioritizedBehaviorList();

            behavs.AddBehavior(HealthToPriority(SingularSettings.Instance.Shaman.Heal.AncestralSwiftness),
                               "Unleash Elements",
                               "Unleash Elements",
                               Spell.Buff("Unleash Elements",
                                          ret => (WoWUnit)ret,
                                          ret => (Me.IsMoving || ((WoWUnit)ret).GetPredictedHealthPercent() < SingularSettings.Instance.Shaman.Heal.AncestralSwiftness) &&
                                          Common.IsImbuedForHealing(Me.Inventory.Equipped.MainHand)
                                          ));

            behavs.AddBehavior(HealthToPriority(SingularSettings.Instance.Shaman.Heal.AncestralSwiftness),
                               String.Format("Ancestral Swiftness @ {0}%", SingularSettings.Instance.Shaman.Heal.AncestralSwiftness),
                               "Ancestral Swiftness",
                               new Sequence(
                                   Spell.BuffSelf("Ancestral Swiftness", ret => ((WoWUnit)ret).GetPredictedHealthPercent() < SingularSettings.Instance.Shaman.Heal.AncestralSwiftness),
                                   Spell.Heal("Greater Healing Wave", ret => (WoWUnit)ret)
                                   ));

            behavs.AddBehavior(HealthToPriority(SingularSettings.Instance.Shaman.Heal.GreaterHealingWave), "Greater Healing Wave", "Greater Healing Wave",
                               Spell.Heal("Greater Healing Wave", ret => (WoWUnit)ret, ret => ((WoWUnit)ret).GetPredictedHealthPercent() < SingularSettings.Instance.Shaman.Heal.GreaterHealingWave));

            behavs.AddBehavior(HealthToPriority(SingularSettings.Instance.Shaman.Heal.HealingWave), "Healing Wave", "Healing Wave",
                               Spell.Heal("Healing Wave", ret => (WoWUnit)ret, ret => ((WoWUnit)ret).GetPredictedHealthPercent() < SingularSettings.Instance.Shaman.Heal.HealingWave));

            behavs.AddBehavior(HealthToPriority(SingularSettings.Instance.Shaman.Heal.HealingSurge), "Healing Surge", "Healing Surge",
                               Spell.Heal("Healing Surge", ret => (WoWUnit)ret, ret => ((WoWUnit)ret).GetPredictedHealthPercent() < SingularSettings.Instance.Shaman.Heal.HealingSurge));

            behavs.AddBehavior(HealthToPriority(SingularSettings.Instance.Shaman.Heal.ChainHeal), "Chain Heal", "Chain Heal",
                               new Decorator(
                                   ret => StyxWoW.Me.GroupInfo.IsInParty || StyxWoW.Me.GroupInfo.IsInRaid,
                                   new PrioritySelector(
                                       new PrioritySelector(
                                           context => Clusters.GetBestUnitForCluster(ChainHealPlayers, ClusterType.Chained, ChainHealHopRange),
                                           Spell.Heal(
                                               "Chain Heal", ret => (WoWPlayer)ret,
                                               ret => Clusters.GetClusterCount((WoWPlayer)ret, ChainHealPlayers, ClusterType.Chained, ChainHealHopRange) >= 3)
                                           )
                                       )
                                   )
                               );

            behavs.AddBehavior(HealthToPriority(SingularSettings.Instance.Shaman.Heal.HealingRain), "Healing Rain", "Healing Rain",
                               new Decorator(
                                   ret => StyxWoW.Me.GroupInfo.IsInParty || StyxWoW.Me.GroupInfo.IsInRaid,
                                   new PrioritySelector(
                                       context => Clusters.GetBestUnitForCluster(Unit.NearbyFriendlyPlayers.Cast <WoWUnit>(), ClusterType.Radius, 10f),
                                       Spell.CastOnGround(
                                           "Healing Rain",
                                           ret => ((WoWPlayer)ret).Location,
                                           ret => (StyxWoW.Me.GroupInfo.IsInRaid ? 3 : 2) < Clusters.GetClusterCount((WoWPlayer)ret, Unit.NearbyFriendlyPlayers.Cast <WoWUnit>(), ClusterType.Radius, 10f))
                                       )
                                   )
                               );

            behavs.AddBehavior(HealthToPriority(SingularSettings.Instance.Shaman.Heal.SpiritLinkTotem), "Spirit Link Totem", "Spirit Link Totem",
                               new Decorator(
                                   ret => StyxWoW.Me.GroupInfo.IsInParty || StyxWoW.Me.GroupInfo.IsInRaid,
                                   Spell.Cast(
                                       "Spirit Link Totem", ret => (WoWPlayer)ret,
                                       ret => Unit.NearbyFriendlyPlayers.Count(
                                           p => p.GetPredictedHealthPercent() < SingularSettings.Instance.Shaman.Heal.SpiritLinkTotem && p.Distance <= Totems.GetTotemRange(WoWTotem.SpiritLink)) >= (Me.GroupInfo.IsInRaid ? 3 : 2)
                                       )
                                   )
                               );

            behavs.AddBehavior(HealthToPriority(SingularSettings.Instance.Shaman.Heal.HealingTideTotemPercent), "Healing Tide Totem", "Healing Tide Totem",
                               new Decorator(
                                   ret => StyxWoW.Me.GroupInfo.IsInParty || StyxWoW.Me.GroupInfo.IsInRaid,
                                   Spell.Cast(
                                       "Healing Tide Totem",
                                       ret => Unit.NearbyFriendlyPlayers.Count(p => p.GetPredictedHealthPercent() < SingularSettings.Instance.Shaman.Heal.HealingTideTotemPercent && p.Distance <= Totems.GetTotemRange(WoWTotem.HealingTide)) >= (Me.GroupInfo.IsInRaid ? 3 : 2)
                                       )
                                   )
                               );

            behavs.AddBehavior(HealthToPriority(SingularSettings.Instance.Shaman.Heal.HealingStreamTotem), "Healing Stream Totem", "Healing Stream Totem",
                               new Decorator(
                                   ret => StyxWoW.Me.GroupInfo.IsInParty || StyxWoW.Me.GroupInfo.IsInRaid,
                                   Spell.Cast(
                                       "Healing Stream Totem",
                                       ret => Unit.NearbyFriendlyPlayers.Count(p => p.GetPredictedHealthPercent() < SingularSettings.Instance.Shaman.Heal.HealingStreamTotem && p.Distance <= Totems.GetTotemRange(WoWTotem.HealingTide)) >= (Me.GroupInfo.IsInRaid ? 3 : 2) &&
                                       !Totems.Exist(WoWTotemType.Water)
                                       )
                                   )
                               );

            behavs.AddBehavior(HealthToPriority(SingularSettings.Instance.Shaman.Heal.Ascendance), "Ascendance", "Ascendance",
                               new Decorator(
                                   ret => StyxWoW.Me.GroupInfo.IsInParty || StyxWoW.Me.GroupInfo.IsInRaid,
                                   Spell.BuffSelf(
                                       "Ascendance",
                                       ret => Unit.NearbyFriendlyPlayers.Count(p => p.GetPredictedHealthPercent() < SingularSettings.Instance.Shaman.Heal.Ascendance) >= (Me.GroupInfo.IsInRaid ? 3 : 2)
                                       )
                                   )
                               );


            behavs.OrderBehaviors();
            behavs.ListBehaviors();


            return(new PrioritySelector(
                       ctx => selfOnly ? StyxWoW.Me : HealerManager.Instance.FirstUnit,
//                ctx => selfOnly ? StyxWoW.Me : GetHealTarget(),

                       Spell.WaitForCast(),

                       new Decorator(
                           ret => Me.IsCasting,
                           new ActionAlwaysSucceed()),

                       new Decorator(
                           ret => ret != null && ((WoWUnit)ret).GetPredictedHealthPercent() <= SingularSettings.Instance.IgnoreHealTargetsAboveHealth,

                           new PrioritySelector(

                               new Sequence(
                                   new Decorator(
                                       ret => guidLastHealTarget != ((WoWUnit)ret).Guid,
                                       new Action(ret =>
            {
                guidLastHealTarget = ((WoWUnit)ret).Guid;
                Logger.WriteDebug(Color.LightGreen, "Heal Target - {0} {1:F1}% @ {2:F1} yds", ((WoWUnit)ret).SafeName(), ((WoWUnit)ret).GetPredictedHealthPercent(), ((WoWUnit)ret).Distance);
            })),
                                   new Action(ret => { return RunStatus.Failure; })
                                   ),

/*
 *                      new Sequence(
 *                          new Action(ret => Logger.WriteDebug(Color.LightGreen, "-- past spellcast")),
 *                          new Action(ret => { return RunStatus.Failure; })
 *                          ),
 */
                               new Decorator(
                                   ret => !SpellManager.GlobalCooldown,

                                   new PrioritySelector(

                                       /*
                                        *                          new Sequence(
                                        *                              new Action(ret => Logger.WriteDebug(Color.LightGreen, "-- past gcd")),
                                        *                              new Action(ret => { return RunStatus.Failure; })
                                        *                              ),
                                        */
                                       Totems.CreateTotemsBehavior(),

                                       Spell.Heal("Earth Shield",
                                                  ret => (WoWUnit)ret,
                                                  ret => ret is WoWPlayer && Group.Tanks.Contains((WoWPlayer)ret) && Group.Tanks.All(t => !t.HasMyAura("Earth Shield"))),

                                       // Just pop RT on CD. Plain and simple. Calling GetBestRiptideTarget will see if we can spread RTs (T12 2pc)
                                       Spell.Heal("Riptide",
                                                  ret => GetBestRiptideTarget((WoWPlayer)ret),
                                                  ret => !Me.HasAnyAura("Tidal Waves", "Ancestral Swiftness") &&
                                                  (((WoWPlayer)ret).GetPredictedHealthPercent() > 15 || Spell.GetSpellCooldown("Ancestral Swiftness").TotalMinutes > 0f) // use Ancestral Swiftness value to check
                                                  ),

                                       behavs.GenerateBehaviorTree(),

                                       Spell.Heal("Riptide",
                                                  ret => GetBestRiptideTarget((WoWPlayer)ret),
                                                  ret => !Me.HasAura("Ancestral Swiftness"))

    #if false
                                       ,
                                       new Sequence(
                                           new Action(ret => Logger.WriteDebug(Color.LightGreen, "No Action - stunned:{0} silenced:{1}"
                                                                               , Me.Stunned || Me.IsStunned()
                                                                               , Me.Silenced
                                                                               )),
                                           new Action(ret => { return RunStatus.Failure; })
                                           )
                                       ,

                                       new Decorator(
                                           ret => StyxWoW.Me.Combat && StyxWoW.Me.GotTarget && !Unit.NearbyFriendlyPlayers.Any(u => u.IsInMyPartyOrRaid),
                                           new PrioritySelector(
                                               Movement.CreateMoveToLosBehavior(),
                                               Movement.CreateFaceTargetBehavior(),
                                               Helpers.Common.CreateInterruptSpellCast(ret => StyxWoW.Me.CurrentTarget),

                                               Spell.Cast("Earth Shock"),
                                               Spell.Cast("Lightning Bolt"),
                                               Movement.CreateMoveToTargetBehavior(true, 35f)
                                               ))
    #endif
                                       )
                                   ),

                               new Decorator(
                                   ret => moveInRange,
                                   Movement.CreateMoveToRangeAndStopBehavior(ret => (WoWUnit)ret, ret => 38f))
                               )
                           )
                       ));
        }
Пример #24
0
        public static Composite CreateRestoShamanHealingOnlyBehavior(bool selfOnly, bool moveInRange)
        {
            HealerManager.NeedHealTargeting = true;
            return(new PrioritySelector(
                       ctx => selfOnly ? StyxWoW.Me : HealerManager.Instance.FirstUnit,
                       new Decorator(
                           ret => ret != null && (moveInRange || ((WoWUnit)ret).InLineOfSpellSight && ((WoWUnit)ret).DistanceSqr < 40 * 40),
                           new PrioritySelector(
                               Spell.WaitForCast(),
                               new Decorator(
                                   ret => moveInRange,
                                   Movement.CreateMoveToLosBehavior(ret => (WoWUnit)ret)),
                               Totems.CreateSetTotems(),
                               // Mana tide...
                               Spell.Cast("Mana Tide Totem", ret => StyxWoW.Me.ManaPercent < 80),
                               // Grounding...
                               Spell.Cast("Grounding Totem", ret => Unit.NearbyUnfriendlyUnits.Any(u => u.Distance < 40 && u.IsTargetingMeOrPet && u.IsCasting)),

                               // Just pop RT on CD. Plain and simple. Calling GetBestRiptideTarget will see if we can spread RTs (T12 2pc)
                               Spell.Heal("Riptide", ret => GetBestRiptideTarget((WoWPlayer)ret)),
                               // And deal with some edge PVP cases.

                               Spell.Heal("Earth Shield",
                                          ret => (WoWUnit)ret,
                                          ret => ret is WoWPlayer && Group.Tanks.Contains((WoWPlayer)ret) && Group.Tanks.All(t => !t.HasMyAura("Earth Shield"))),

                               // Pop NS if someone is in some trouble.
                               Spell.BuffSelf("Nature's Swiftness", ret => ((WoWUnit)ret).HealthPercent < 15),
                               Spell.Heal("Unleash Elements", ret => (WoWUnit)ret, ret => ((WoWUnit)ret).HealthPercent < 40),
                               // GHW is highest priority. It should be fairly low health %. (High-end healers will have this set to 70ish
                               Spell.Heal("Greater Healing Wave", ret => (WoWUnit)ret, ret => ((WoWUnit)ret).HealthPercent < 50),
                               // Most (if not all) will leave this at 90. Its lower prio, high HPM, low HPS
                               Spell.Heal("Healing Wave", ret => (WoWUnit)ret, ret => ((WoWUnit)ret).HealthPercent < 60),


                               // CH/HR only in parties/raids
                               new Decorator(
                                   ret => StyxWoW.Me.IsInParty || StyxWoW.Me.IsInRaid,
                                   new PrioritySelector(
                                       // This seems a bit tricky, but its really not. This is just how we cache a somewhat expensive lookup.
                                       // Set the context to the "best unit" for the cluster, so we don't have to do that check twice.
                                       // Then just use the context when passing the unit to throw the heal on, and the target of the heal from the cluster count.
                                       // Also ensure it will jump at least 3 times. (CH is pointless to cast if it won't jump 3 times!)
                                       new PrioritySelector(
                                           context => Clusters.GetBestUnitForCluster(ChainHealPlayers, ClusterType.Chained, 12f),
                                           Spell.Heal(
                                               "Chain Heal", ret => (WoWPlayer)ret,
                                               ret => Clusters.GetClusterCount((WoWPlayer)ret, ChainHealPlayers, ClusterType.Chained, 12f) > 2)),

                                       // Now we're going to do the same thing as above, but this time we're going to do it with healing rain.
                                       new PrioritySelector(
                                           context => Clusters.GetBestUnitForCluster(Unit.NearbyFriendlyPlayers.Cast <WoWUnit>(), ClusterType.Radius, 10f),
                                           Spell.CastOnGround(
                                               "Healing Rain", ret => ((WoWPlayer)ret).Location,
                                               ret =>
                                               Clusters.GetClusterCount((WoWPlayer)ret, Unit.NearbyFriendlyPlayers.Cast <WoWUnit>(), ClusterType.Radius, 10f) >
                                               // If we're in a raid, check for 4 players. If we're just in a party, check for 3.
                                               (StyxWoW.Me.IsInRaid ? 3 : 2))))),

                               new Decorator(
                                   ret => moveInRange,
                                   Movement.CreateMoveToTargetBehavior(true, 38f, ret => (WoWUnit)ret))

                               ))));
        }
Пример #25
0
 public static Composite WitchDoctorCombat()
 {
     return(new PrioritySelector(CtxChanger,
                                 new Decorator(
                                     ctx =>
                                     ctx is CombatContext &&
                                     ((CombatContext)ctx).CurrentTarget != null,
                                     new PrioritySelector(
                                         Common.CreateUsePotion(),
                                         Common.CreateWaitWhileFearedStunnedFrozenOrBlind(),
                                         Common.CreateGetHealthGlobe(),
                                         Common.CreateUseHealthWell(),
                                         Common.CreateWaitForAttack(),
                                         Kiting.CreateKitingBehavior(),
                                         // Make sure we are within range/line of sight of the unit.
                                         Movement.MoveTo(ctx => ((CombatContext)ctx).TargetPosition,
                                                         BelphegorSettings.Instance.WitchDoctor.MaximumRange),
                                         new SelfCast(SNOPower.Witchdoctor_SpiritWalk,
                                                      extra =>
                                                      ((CombatContext)extra).CurrentHealthPercentage <=
                                                      BelphegorSettings.Instance.WitchDoctor.SpiritWalkHp),
                                         new SelfCast(SNOPower.Witchdoctor_Sacrifice,
                                                      ctx => Minion.PetCount(((CombatContext)ctx), Pet.ZombieDogs) > 1 &&
                                                      ((CombatContext)ctx).CurrentHealthPercentage <=
                                                      BelphegorSettings.Instance.WitchDoctor.SacrificeHp),
                                         new SelfCast(SNOPower.Witchdoctor_Hex),
                                         new SelfCast(SNOPower.Witchdoctor_SoulHarvest,
                                                      ctx =>
                                                      Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx), 16f) >=
                                                      BelphegorSettings.Instance.WitchDoctor.SoulHarvestAoECount ||
                                                      (((CombatContext)ctx).CurrentTargetIsElite &&
                                                       ((CombatContext)ctx).TargetDistance < 16f)),
                                         new CastAtLocation(SNOPower.Witchdoctor_Piranhas, ctx => ((CombatContext)ctx).TargetPosition,
                                                            ctx =>
                                                            ((CombatContext)ctx).CurrentTargetIsElite ||
                                                            Clusters.GetClusterCount(((CombatContext)ctx).CurrentTarget, ((CombatContext)ctx), 10f) >=
                                                            BelphegorSettings.Instance.WitchDoctor.PiranhasAoECount),
                                         new SelfCast(SNOPower.Witchdoctor_BigBadVoodoo,
                                                      ctx =>
                                                      Clusters.GetClusterCount(
                                                          ((CombatContext)ctx).CurrentTarget,
                                                          ((CombatContext)ctx), 40f) >=
                                                      BelphegorSettings.Instance.WitchDoctor.BigBadVoodooAoECount ||
                                                      ((CombatContext)ctx).CurrentTargetIsElite),
                                         new SelfCast(SNOPower.Witchdoctor_FetishArmy,
                                                      ctx =>
                                                      Clusters.GetClusterCount(
                                                          ((CombatContext)ctx).CurrentTarget,
                                                          ((CombatContext)ctx), 40f) >=
                                                      BelphegorSettings.Instance.WitchDoctor.FetishArmyAoECount ||
                                                      ((CombatContext)ctx).CurrentTargetIsElite),
                                         new SelfCast(SNOPower.Witchdoctor_Horrify,
                                                      extra =>
                                                      Clusters.GetClusterCount(
                                                          ((CombatContext)extra).CurrentTarget,
                                                          ((CombatContext)extra), 40f) >=
                                                      BelphegorSettings.Instance.WitchDoctor.HorrifyAoECount),
                                         new CastOnUnit(SNOPower.Witchdoctor_MassConfusion,
                                                        ctx => ((CombatContext)ctx).TargetGuid,
                                                        extra =>
                                                        Clusters.GetClusterCount(
                                                            ((CombatContext)extra).CurrentTarget,
                                                            ((CombatContext)extra), 40f) >=
                                                        BelphegorSettings.Instance.WitchDoctor.
                                                        MassConfusionAoECount),
                                         new CastOnUnit(SNOPower.Witchdoctor_GraspOfTheDead,
                                                        ctx => ((CombatContext)ctx).TargetGuid),
                                         new CastAtLocation(SNOPower.Witchdoctor_AcidCloud,
                                                            ctx => ((CombatContext)ctx).TargetPosition,
                                                            ctx =>
                                                            AcidTimer.IsFinished &&
                                                            Clusters.GetClusterCount(
                                                                ((CombatContext)ctx).CurrentTarget,
                                                                ((CombatContext)ctx), 18f) >=
                                                            BelphegorSettings.Instance.WitchDoctor.
                                                            AcidCloudAoECount,
                                                            s => AcidTimer.Reset()),
                                         new CastAtLocation(SNOPower.Witchdoctor_Firebats,
                                                            ctx => ((CombatContext)ctx).TargetPosition,
                                                            extra =>
                                                            Clusters.GetClusterCount(
                                                                ((CombatContext)extra).CurrentTarget,
                                                                ((CombatContext)extra), 40f) >=
                                                            BelphegorSettings.Instance.WitchDoctor.
                                                            FirebatsAoECount),
                                         new CastAtLocation(SNOPower.Witchdoctor_WallOfZombies,
                                                            ctx => ((CombatContext)ctx).TargetPosition,
                                                            extra =>
                                                            Clusters.GetClusterCount(
                                                                ((CombatContext)extra).CurrentTarget,
                                                                ((CombatContext)extra), 40f) >=
                                                            BelphegorSettings.Instance.WitchDoctor.
                                                            WallOfZombiesAoECount),
                                         new CastOnUnit(SNOPower.Witchdoctor_Locust_Swarm,
                                                        ctx => ((CombatContext)ctx).TargetGuid,
                                                        ctx =>
                                                        LocustSwarmTimer.IsFinished &&
                                                        ((CombatContext)ctx).TargetDistance < 16 &&
                                                        ((CombatContext)ctx).CurrentTargetIsElite ||
                                                        Clusters.GetClusterCount(
                                                            ((CombatContext)ctx).CurrentTarget,
                                                            ((CombatContext)ctx), 20) >=
                                                        BelphegorSettings.Instance.WitchDoctor.
                                                        LocustSwarmAoECount,
                                                        s => LocustSwarmTimer.Reset()),
                                         new CastOnUnit(SNOPower.Witchdoctor_Haunt,
                                                        ctx => ((CombatContext)ctx).TargetGuid,
                                                        extra => HauntTimer.IsFinished, s => HauntTimer.Reset()),
                                         //Other spells
                                         new CastOnUnit(SNOPower.Witchdoctor_SpiritBarrage,
                                                        ctx => ((CombatContext)ctx).TargetGuid),
                                         new CastOnUnit(SNOPower.Witchdoctor_ZombieCharger,
                                                        ctx => ((CombatContext)ctx).TargetGuid),
                                         //Primary
                                         new CastAtLocation(SNOPower.Witchdoctor_PlagueOfToads,
                                                            ctx => ((CombatContext)ctx).TargetPosition),
                                         new CastAtLocation(SNOPower.Witchdoctor_CorpseSpider,
                                                            ctx => ((CombatContext)ctx).TargetPosition),
                                         new CastOnUnit(SNOPower.Witchdoctor_Firebomb,
                                                        ctx => ((CombatContext)ctx).TargetGuid),
                                         new CastOnUnit(SNOPower.Witchdoctor_PoisonDart,
                                                        ctx => ((CombatContext)ctx).TargetGuid)
                                         )
                                     ),
                                 new Action(ret => RunStatus.Success)
                                 ));
 }
Пример #26
0
        public static Composite BarbarianCombat()
        {
            return
                (new PrioritySelector(CtxChanger,
                                      new Decorator(ctx => ctx != null && ((CombatContext)ctx).CurrentTarget != null,
                                                    new PrioritySelector(

                                                        // Buff attack rate or get free!
                                                        new SelfCast(SNOPower.Barbarian_WrathOfTheBerserker, extra => ((CombatContext)extra).IsPlayerIncapacited
                                                                     ),

                                                        Common.CreateUsePotion(),
                                                        Common.CreateGetHealthGlobe(),
                                                        Common.CreateWaitWhileFearedStunnedFrozenOrBlind(),
                                                        Common.CreateWaitForAttack(),

                                                        // Defence low hp or many attackers.
                                                        new SelfCast(SNOPower.Barbarian_IgnorePain, require =>
                                                                     ((CombatContext)require).CurrentHealthPercentage <= BelphegorSettings.Instance.Barbarian.IgnorePainPct ||
                                                                     Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)require, ClusterType.Radius, 12f) >= 6
                                                                     ),

                                                        ThrowBarbBehavior(),
                                                        // Pull phase.
                                                        new Decorator(ctx =>
                                                                      ((CombatContext)ctx).TargetDistance > BelphegorSettings.Instance.Barbarian.MaximumRange && !((CombatContext)ctx).IsPlayerIncapacited,
                                                                      new PrioritySelector(
                                                                          new CastAtLocation(SNOPower.Barbarian_Leap, ctx => ((CombatContext)ctx).TargetPosition),
                                                                          new CastOnUnit(SNOPower.Barbarian_FuriousCharge, ctx => ((CombatContext)ctx).TargetGuid),
                                                                          new CastOnUnit(SNOPower.Barbarian_AncientSpear, ctx => ((CombatContext)ctx).TargetGuid)
                                                                          )
                                                                      ),

                                                        //Leap on cooldown, usefull for the increased armour buff
                                                        new CastAtLocation(SNOPower.Barbarian_Leap, ctx => ((CombatContext)ctx).TargetPosition,
                                                                           extra => BelphegorSettings.Instance.Barbarian.LeapOnCooldown &&
                                                                           !((CombatContext)extra).IsPlayerIncapacited
                                                                           ),

                                                        new SelfCast(SNOPower.Barbarian_Sprint,
                                                                     extra => SprintTimer.IsFinished &&
                                                                     !ZetaDia.Me.HasBuff(SNOPower.Barbarian_Sprint),
                                                                     s => SprintTimer.Reset()
                                                                     ),

                                                        new SelfCast(SNOPower.Barbarian_BattleRage, extra => !ZetaDia.Me.HasBuff(SNOPower.Barbarian_BattleRage)),
                                                        new SelfCast(SNOPower.Barbarian_Rend, ctx => RendTimer.Elapsed >=
                                                                     TimeSpan.FromSeconds(BelphegorSettings.Instance.Barbarian.RendTimer) &&
                                                                     ((CombatContext)ctx).TargetDistance <= BelphegorSettings.Instance.Barbarian.RendRange,
                                                                     s => RendTimer.Restart()
                                                                     ),

                                                        new CastAtLocation(SNOPower.Barbarian_Revenge,
                                                                           ctx => ((CombatContext)ctx).TargetPosition,
                                                                           ctx => ((CombatContext)ctx).TargetDistance < 16f
                                                                           ),

                                                        //Uses Dreadnought rune to heal
                                                        new CastOnUnit(SNOPower.Barbarian_FuriousCharge, ctx => ((CombatContext)ctx).TargetGuid,
                                                                       extra => BelphegorSettings.Instance.Barbarian.FuriousChargeDreadnought &&
                                                                       ((CombatContext)extra).CurrentHealthPercentage <= BelphegorSettings.Instance.Barbarian.FuriousChargeDreadnoughtHP
                                                                       ),


                                                        //Rage
                                                        new SelfCast(SNOPower.Barbarian_WrathOfTheBerserker,
                                                                     ctx => Unit.IsEliteInRange(16f) ||
                                                                     Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)ctx, ClusterType.Radius, 16f) >=
                                                                     BelphegorSettings.Instance.Barbarian.WotBAoeCount
                                                                     ),

                                                        new SelfCast(SNOPower.Barbarian_CallOfTheAncients,
                                                                     ctx => Unit.IsEliteInRange(16f) ||
                                                                     Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)ctx, ClusterType.Radius, 16f) >=
                                                                     BelphegorSettings.Instance.Barbarian.CotAAoeCount
                                                                     ),

                                                        new SelfCast(SNOPower.Barbarian_Earthquake,
                                                                     ctx => Unit.IsEliteInRange(16f) ||
                                                                     Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)ctx, ClusterType.Radius, 16f) >=
                                                                     BelphegorSettings.Instance.Barbarian.EarthquakeAoeCount
                                                                     ),

                                                        new SelfCast(SNOPower.Barbarian_GroundStomp,
                                                                     ctx => Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)ctx, ClusterType.Radius, 12f) >= 2 ||
                                                                     Unit.IsEliteInRange(18f)
                                                                     ),

                                                        new SelfCast(SNOPower.Barbarian_Overpower,
                                                                     ctx => Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)ctx, ClusterType.Radius, 16f) >=
                                                                     BelphegorSettings.Instance.Barbarian.OverpowerAoeCount ||
                                                                     Unit.IsEliteInRange(16f)
                                                                     ),

                                                        // Threatning shout.
                                                        new SelfCast(SNOPower.Barbarian_ThreateningShout,
                                                                     ctx => Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)ctx, ClusterType.Radius, 16f) >= 2 ||
                                                                     Unit.IsEliteInRange(16f)
                                                                     ),

                                                        // Fury spenders.
                                                        new CastOnUnit(SNOPower.Barbarian_HammerOfTheAncients,
                                                                       ctx => ((CombatContext)ctx).TargetGuid
                                                                       ),

                                                        new CastAtLocation(SNOPower.Barbarian_SeismicSlam,
                                                                           ctx => ((CombatContext)ctx).TargetPosition
                                                                           ),

                                                        new CastOnUnit(SNOPower.Barbarian_WeaponThrow,
                                                                       ctx => ((CombatContext)ctx).TargetGuid
                                                                       ),

                                                        new CastAtLocation(SNOPower.Barbarian_Whirlwind,
                                                                           ctx => ((CombatContext)ctx).WhirlWindTargetPosition,
                                                                           ctx => Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)ctx, ClusterType.Radius, BelphegorSettings.Instance.Barbarian.WhirlwindClusterRange) >=
                                                                           BelphegorSettings.Instance.Barbarian.WhirlwindAoeCount ||
                                                                           ((CombatContext)ctx).CurrentTarget.IsElite()
                                                                           ),

                                                        // Fury Generators
                                                        new CastOnUnit(SNOPower.Barbarian_Cleave,
                                                                       ctx => ((CombatContext)ctx).TargetGuid, null,
                                                                       ctx => PrimarySpamTimer.Reset(),
                                                                       keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger
                                                                       ),

                                                        new CastOnUnit(SNOPower.Barbarian_Bash,
                                                                       ctx => ((CombatContext)ctx).TargetGuid, null,
                                                                       ctx => PrimarySpamTimer.Reset(),
                                                                       keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger
                                                                       ),

                                                        new CastOnUnit(SNOPower.Barbarian_Frenzy,
                                                                       ctx => ((CombatContext)ctx).TargetGuid, null,
                                                                       ctx => PrimarySpamTimer.Reset(),
                                                                       keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger
                                                                       )

                                                        //new Action(ctx => ZetaDia.Me.UsePower(SNOPower.Weapon_Melee_Instant, ((DiaUnit)ctx).Position, ZetaDia.CurrentWorldDynamicId))
                                                        )
                                                    ),

                                      new Action(ret => RunStatus.Success)
                                      ));
        }
Пример #27
0
        public static Composite CreatePaladinRetributionNormalPullAndCombat()
        {
            return(new PrioritySelector(

                       Helpers.Common.EnsureReadyToAttackFromMelee(),

                       Spell.WaitForCastOrChannel(),

                       new Decorator(
                           ret => !Spell.IsGlobalCooldown() && Me.GotTarget(),
                           new PrioritySelector(
                               SingularRoutine.MoveBehaviorInlineToCombat(BehaviorType.Heal),
                               SingularRoutine.MoveBehaviorInlineToCombat(BehaviorType.CombatBuffs),

                               // aoe count
                               ActionAoeCount(),

                               CreateRetDiagnosticOutputBehavior(),

                               Helpers.Common.CreateInterruptBehavior(),

                               Movement.WaitForFacing(),
                               Movement.WaitForLineOfSpellSight(),

                               Common.CreatePaladinPullMore(),

                               //Survive!
                               Spell.BuffSelf("Word of Glory", req => Me.HealthPercent <= PaladinSettings.SelfWordOfGloryHealth && (SingularRoutine.CurrentWoWContext != WoWContext.Instances || !Me.GroupInfo.IsInParty)),
                               Spell.BuffSelf("Eye for an Eye", req => Me.HealthPercent <= PaladinSettings.EyeForAndEyeHealth),
                               Spell.BuffSelf("Shield of Vengeance", req => Me.HealthPercent <= PaladinSettings.ShieldOfVengeanceHealth),
                               Spell.Cast("Blessing of Freedom", on => Me, ret =>
                                          Me.HasAuraWithMechanic(WoWSpellMechanic.Rooted, WoWSpellMechanic.Slowed, WoWSpellMechanic.Snared) ||
                                          Me.HasAuraWithEffect(WoWApplyAuraType.ModRoot, WoWApplyAuraType.ModDecreaseSpeed) && !Me.HasAuraWithMechanic(WoWSpellMechanic.Dazed)
                                          ),

                               Spell.BuffSelf("Cleanse Toxins", ret => StyxWoW.Me.GetAllAuras().Any(a => a.Spell.DispelType == WoWDispelType.Disease || a.Spell.DispelType == WoWDispelType.Poison)),

                               //Changed: WoWContext.ALL (was not casting in dungeons) and added Player for BGs
                               Spell.Cast("Hammer of Justice", ret => PaladinSettings.StunMobsWhileSolo || Me.CurrentTarget.IsPlayer),
                               Spell.Cast(
                                   "War Stomp",
                                   req => PaladinSettings.StunMobsWhileSolo &&
                                   Me.Race == WoWRace.Tauren &&
                                   EventHandlers.TimeSinceAttackedByEnemyPlayer.TotalSeconds < 5 &&
                                   EventHandlers.AttackingEnemyPlayer != null &&
                                   EventHandlers.AttackingEnemyPlayer.SpellDistance() < 8
                                   ),

                               //7	Blow buffs seperatly.  No reason for stacking while grinding.
                               Spell.BuffSelf(
                                   "Holy Avenger",
                                   req => PaladinSettings.RetAvengAndGoatK &&
                                   Me.GotTarget() &&
                                   Me.CurrentTarget.IsWithinMeleeRange && !Me.CurrentTarget.IsTrivial() &&
                                   (_mobCount > 1 || Me.CurrentTarget.TimeToDeath() > 25) &&
                                   (!Me.HasAura("Avenging Wrath") && Spell.GetSpellCooldown("Avenging Wrath").TotalSeconds > 1)
                                   ),

                               Spell.BuffSelf(
                                   "Avenging Wrath",
                                   req => PaladinSettings.RetAvengAndGoatK &&
                                   Me.GotTarget() &&
                                   Me.CurrentTarget.IsWithinMeleeRange && !Me.CurrentTarget.IsTrivial() &&
                                   (_mobCount > 1 || Me.CurrentTarget.TimeToDeath() > 25) &&
                                   (!Me.HasAura("Holy Avenger") && Spell.GetSpellCooldown("Holy Avenger").TotalSeconds > 1)
                                   ),

                               Spell.Cast("Execution Sentence", ret => Me.CurrentTarget.TimeToDeath() > 15),
                               Spell.Cast("Holy Prism", on => Group.Tanks.FirstOrDefault(t => t.IsAlive && t.Distance < 40)),

                               // lowbie farming priority
                               new Decorator(
                                   ret => _mobCount > 1 && Spell.UseAOE && Me.CurrentTarget.IsTrivial(),
                                   new PrioritySelector(
                                       // Bobby53: Inq > 5HP DS > Exo > HotR > 3-4HP DS
                                       Spell.Cast("Divine Storm", ret => Me.CurrentHolyPower == 5 && Spell.UseAOE),
                                       Spell.Cast("Hammer of the Righteous"),
                                       Spell.Cast("Divine Storm", ret => Me.CurrentHolyPower >= 3 && Spell.UseAOE)
                                       )
                                   ),

                               Common.CreatePaladinBlindingLightBehavior(),

                               // Wake of Ashes notes:  UseDPSArtifactWeaponWhen.AtHighestDPSOpportunity would be good if the player has the Ashes to Ashes artifact trait and if the player needs Holy Power.

                               new Decorator(
                                   ret => _mobCount >= 3 && Spell.UseAOE && !Me.CurrentTarget.IsPlayer,
                                   new PrioritySelector(
                                       // was EJ: Inq > 5HP DS > LH > HoW > Exo > HotR > Judge > 3-4HP DS (> SS)
                                       // now EJ: Inq > 5HP DS > LH > HoW (> T16 Free DS) > HotR > Judge > Exo > 3-4HP DS (> SS)

                                       Spell.Cast("Wake of Ashes", ret =>
                                                  (PaladinSettings.UseDPSArtifactWeaponWhen == UseDPSArtifactWeaponWhen.OnCooldown ||
                                                   (PaladinSettings.UseDPSArtifactWeaponWhen == UseDPSArtifactWeaponWhen.AtHighestDPSOpportunity && Me.CurrentHolyPower <= 1)) &&
                                                  Clusters.GetConeClusterCount(90f, Unit.UnfriendlyUnits(10), 100f) > 1),

                                       Spell.Cast("Judgment", ret => Me.CurrentHolyPower >= 3),

                                       new Decorator(ret => Common.HasTalent(PaladinTalents.JusticarsVengeance),
                                                     new PrioritySelector(
                                                         Spell.Cast("Justicar's Vengeance", ret => Me.HealthPercent <= 50),
                                                         Spell.Cast("Divine Storm", ret => Spell.UseAOE && Me.HealthPercent > 50 && (Me.CurrentTarget.HasAura(J_DEBUFF) || Me.CurrentHolyPower == 5))
                                                         )
                                                     ),
                                       Spell.Cast("Divine Storm", ret => !Common.HasTalent(PaladinTalents.JusticarsVengeance) && Spell.UseAOE && (Me.CurrentTarget.HasAura(J_DEBUFF) || Me.CurrentHolyPower == 5)),

                                       Spell.Cast("Blade of Justice", ret => Me.CurrentHolyPower < 5),
                                       Spell.Cast("Consecration", req => Unit.UnfriendlyUnits(8).Any()),
                                       Spell.Cast("Holy Wrath", ret => Me.HealthPercent <= 55),
                                       Spell.CastOnGround("Light's Hammer", on => Me.CurrentTarget, ret => 2 <= Clusters.GetClusterCount(Me.CurrentTarget, Unit.NearbyUnfriendlyUnits, ClusterType.Radius, 10f)),
                                       Spell.Cast("Crusader Strike"), // Can be replaced by Zeal - casts both ways.
                                       Movement.CreateMoveToMeleeBehavior(true),
                                       new ActionAlwaysSucceed()
                                       )
                                   ),
                               //No need to specify Holy Power, bot will cast anyway if it can.

                               Spell.BuffSelf("Divine Steed", req => !Me.Mounted && Me.IsMoving && Me.CurrentTarget.SpellDistance().Between(20, 60)),
                               Spell.Cast("Hand of Hindrance", req => Me.CurrentTarget.SpellDistance().Between(3, 27) && Me.CurrentTarget.IsMovingAway()),
                               Spell.Cast("Wake of Ashes", ret => !PaladinSettings.UseArtifactOnlyInAoE &&
                                          ((PaladinSettings.UseDPSArtifactWeaponWhen != UseDPSArtifactWeaponWhen.None && PaladinSettings.UseDPSArtifactWeaponWhen != UseDPSArtifactWeaponWhen.AtHighestDPSOpportunity) ||
                                           (PaladinSettings.UseDPSArtifactWeaponWhen == UseDPSArtifactWeaponWhen.AtHighestDPSOpportunity && Me.CurrentHolyPower <= 1)) &&
                                          Clusters.GetConeClusterCount(90f, Unit.UnfriendlyUnits(10), 100f) >= 1),

                               Spell.Cast("Judgment", ret => Me.CurrentHolyPower >= 3 || Me.CurrentTarget.Distance > 20d),

                               new Decorator(ret => Common.HasTalent(PaladinTalents.JusticarsVengeance),
                                             new PrioritySelector(
                                                 Spell.Cast("Justicar's Vengeance", ret => Me.HasAura(DP_PROC) && Me.CurrentTarget.HasAura(J_DEBUFF) || Me.HealthPercent <= 50),
                                                 Spell.Cast("Templar's Verdict", ret => Me.HealthPercent > 50 && (Me.CurrentTarget.HasAura(J_DEBUFF) || Me.CurrentHolyPower == 5))
                                                 )
                                             ),
                               Spell.Cast("Templar's Verdict", ret => !Common.HasTalent(PaladinTalents.JusticarsVengeance) && (Me.CurrentTarget.HasAura(J_DEBUFF) || Me.CurrentHolyPower == 5)),

                               Spell.Cast("Blade of Justice", ret => Me.CurrentHolyPower < 5),
                               Spell.Cast("Execution Sentence", when => Me.CurrentTarget.TimeToDeath() > 8),
                               Spell.Cast("Crusader Strike") // Can be replaced by Zeal - casts both ways.
                               )
                           ),

                       // Move to melee is LAST. Period.
                       Movement.CreateMoveToMeleeBehavior(true)
                       ));
        }
Пример #28
0
 public static Composite DemonHunterCombat()
 {
     return
         (new PrioritySelector(CtxChanger,
                               new Decorator(
                                   ctx =>
                                   ctx is CombatContext &&
                                   ((CombatContext)ctx).CurrentTarget != null,
                                   new PrioritySelector(
                                       new SelfCast(SNOPower.DemonHunter_SmokeScreen,
                                                    extra => ((CombatContext)extra).IsPlayerIncapacited),
                                       Common.CreateUsePotion(),
                                       Common.CreateWaitWhileFearedStunnedFrozenOrBlind(),
                                       Common.CreateGetHealthGlobe(),
                                       Common.CreateUseHealthWell(),
                                       Kiting.CreateKitingBehavior(),
                                       Common.CreateWaitForAttack(),
                                       new SelfCast(SNOPower.DemonHunter_ShadowPower,
                                                    extra =>
                                                    ShadowPowerTimer.IsFinished &&
                                                    ((CombatContext)extra).CurrentHealthPercentage <
                                                    BelphegorSettings.Instance.DemonHunter.ShadowPowerHp,
                                                    s => ShadowPowerTimer.Reset()),
                                       new CastOnUnit(SNOPower.DemonHunter_MarkedForDeath,
                                                      ctx => ((CombatContext)ctx).TargetGuid,
                                                      ctx =>
                                                      ((CombatContext)ctx).CurrentTargetIsElite &&
                                                      MarkTimer.IsFinished,
                                                      s => MarkTimer.Reset()),
                                       new SelfCast(SNOPower.X1_DemonHunter_Vengeance,
                                                    ctx => ((CombatContext)ctx).CurrentTargetIsElite),
                                       new SelfCast(SNOPower.DemonHunter_Caltrops,
                                                    ctx =>
                                                    TrapTimer.IsFinished &&
                                                    (Minion.PetCount(((CombatContext)ctx), Pet.DH_Caltrops) < 3 &&
                                                     (Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx),
                                                                               16f) >=
                                                      BelphegorSettings.Instance.DemonHunter.CaltropsAoECount ||
                                                      Unit.IsEliteInRange(16f, ((CombatContext)ctx))) ||
                                                     (BelphegorSettings.Instance.DemonHunter.StandInCaltrops &&
                                                      Minion.GetMinions(((CombatContext)ctx), Pet.DH_Caltrops).Count(
                                                          c => c.Distance < 8f) < 1)),
                                                    s => TrapTimer.Reset()),
                                       new SelfCast(SNOPower.DemonHunter_SpikeTrap,
                                                    ctx =>
                                                    TrapTimer.IsFinished && Minion.PetCount(((CombatContext)ctx), Pet.DH_SpikeTrap) < 3 &&
                                                    Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx),
                                                                             16f) >=
                                                    BelphegorSettings.Instance.DemonHunter.SpikeTrapAoECount ||
                                                    Unit.IsEliteInRange(16f, ((CombatContext)ctx)),
                                                    s => TrapTimer.Reset()),
                                       // AOE
                                       new CastAtLocation(SNOPower.DemonHunter_RainOfVengeance,
                                                          ctx => ((CombatContext)ctx).TargetPosition,
                                                          ctx =>
                                                          Clusters.GetClusterCount(((CombatContext)ctx).CurrentTarget, ((CombatContext)ctx),
                                                                                   20f) >= 3 || ((CombatContext)ctx).CurrentTargetIsElite),
                                       new CastOnUnit(SNOPower.DemonHunter_Strafe,
                                                      ctx => ((CombatContext)ctx).TargetGuid,
                                                      req =>
                                                      Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)req),
                                                                               45f) >= 2
                                                      ),
                                       new CastAtLocation(SNOPower.DemonHunter_Multishot,
                                                          ctx => ((CombatContext)ctx).TargetPosition,
                                                          req =>
                                                          Clusters.GetClusterCount(
                                                              ((CombatContext)req).CurrentTarget,
                                                              ((CombatContext)req), 45f) >= 2
                                                          ),
                                       new CastOnUnit(SNOPower.DemonHunter_FanOfKnives,
                                                      ctx => ((CombatContext)ctx).TargetGuid,
                                                      ctx =>
                                                      ((CombatContext)ctx).CurrentTargetIsElite &&
                                                      ((CombatContext)ctx).TargetDistance < 20f ||
                                                      Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx),
                                                                               20f) >=
                                                      BelphegorSettings.Instance.DemonHunter.FanOfKnivesAoECount
                                                      ),
                                       new CastOnUnit(SNOPower.DemonHunter_ClusterArrow,
                                                      ctx => ((CombatContext)ctx).TargetGuid,
                                                      req =>
                                                      Clusters.GetClusterCount(
                                                          ((CombatContext)req).CurrentTarget,
                                                          ((CombatContext)req), 15f) >= 2 ||
                                                      ((CombatContext)req).CurrentTargetIsElite
                                                      ),
                                       new CastAtLocation(SNOPower.DemonHunter_Sentry,
                                                          ctx => ((CombatContext)ctx).TargetPosition,
                                                          ctx => !Minion.HasPet(((CombatContext)ctx), Pet.DH_Sentry) &&
                                                          Clusters.GetClusterCount(ZetaDia.Me,
                                                                                   ((CombatContext)ctx),
                                                                                   35f) >=
                                                          2 ||
                                                          ((CombatContext)ctx).CurrentTargetIsElite
                                                          ),
                                       new SelfCast(SNOPower.DemonHunter_Preparation,
                                                    extra => ZetaDia.Me.CurrentSecondaryResource <=
                                                    BelphegorSettings.Instance.DemonHunter.
                                                    PrperationDiscipline),
                                       // Singles
                                       new CastOnUnit(SNOPower.DemonHunter_Chakram,
                                                      ctx => ((CombatContext)ctx).TargetGuid),
                                       new CastOnUnit(SNOPower.X1_DemonHunter_EvasiveFire,
                                                      ctx => ((CombatContext)ctx).TargetGuid,
                                                      ctx =>
                                                      !BelphegorSettings.Instance.DemonHunter.
                                                      OnlyEvasiveFireWhenClose ||
                                                      ((CombatContext)ctx).TargetDistance <= 16f),
                                       new CastOnUnit(SNOPower.DemonHunter_Impale,
                                                      ctx => ((CombatContext)ctx).TargetGuid),
                                       new CastOnUnit(SNOPower.DemonHunter_RapidFire,
                                                      ctx => ((CombatContext)ctx).TargetGuid,
                                                      extra => ZetaDia.Me.CurrentPrimaryResource > 20),
                                       new CastOnUnit(SNOPower.DemonHunter_ElementalArrow,
                                                      ctx => ((CombatContext)ctx).TargetGuid),
                                       // Hatred Generators
                                       new CastOnUnit(SNOPower.DemonHunter_Bolas,
                                                      ctx => ((CombatContext)ctx).TargetGuid),
                                       new CastOnUnit(SNOPower.DemonHunter_Grenades,
                                                      ctx => ((CombatContext)ctx).TargetGuid),
                                       new CastOnUnit(SNOPower.DemonHunter_HungeringArrow,
                                                      ctx => ((CombatContext)ctx).TargetGuid),
                                       new CastOnUnit(SNOPower.X1_DemonHunter_EntanglingShot,
                                                      ctx => ((CombatContext)ctx).TargetGuid)
                                       )
                                   ),
                               new Action(ret => RunStatus.Success)
                               ));
 }
Пример #29
0
        public static Composite WizardCombat()
        {
            return
                (new PrioritySelector(CtxChanger,
                                      new Decorator(
                                          ctx =>
                                          ctx is CombatContext &&
                                          ((CombatContext)ctx).CurrentTarget != null,
                                          new PrioritySelector(
                                              new SelfCast(SNOPower.Wizard_DiamondSkin,
                                                           extra =>
                                                           ((CombatContext)extra).CurrentHealthPercentage <=
                                                           BelphegorSettings.Instance.Wizard.DiamondSkinHp ||
                                                           ((CombatContext)extra).IsPlayerIncapacited),
                                              Common.CreateUsePotion(),
                                              Common.CreateWaitWhileFearedStunnedFrozenOrBlind(),
                                              Common.CreateGetHealthGlobe(),
                                              Common.CreateWaitForAttack(),
                                              Kiting.CreateKitingBehavior(),
                                              //Movement.MoveTo(ctx => ((DiaUnit)ctx).Position, BelphegorSettings.Instance.Wizard.MaximumRange),

                                              new Decorator(ret => ZetaDia.Me.HasBuff(SNOPower.Wizard_Archon),
                                                            new PrioritySelector(
                                                                new SelfCast(SNOPower.Wizard_Archon_SlowTime,
                                                                             extra =>
                                                                             ((CombatContext)extra).
                                                                             CurrentHealthPercentage <= 0.4),
                                                                new SelfCast(SNOPower.Wizard_Archon_ArcaneBlast,
                                                                             ctx =>
                                                                             ((CombatContext)ctx).CurrentTarget.IsElite(
                                                                                 16f)
                                                                             ||
                                                                             Clusters.GetClusterCount(ZetaDia.Me,
                                                                                                      ((CombatContext)
                                                                                                       ctx),
                                                                                                      ClusterType.Radius,
                                                                                                      16f) >= 2),
                                                                new CastOnUnit(
                                                                    SNOPower.Wizard_Archon_DisintegrationWave,
                                                                    ctx => ((CombatContext)ctx).TargetGuid),
                                                                new CastOnUnit(SNOPower.Wizard_Archon_ArcaneStrike,
                                                                               ctx => ((CombatContext)ctx).TargetGuid)
                                                                )),
                                              // Low health stuff
                                              new SelfCast(SNOPower.Wizard_MirrorImage,
                                                           extra =>
                                                           ((CombatContext)extra).CurrentHealthPercentage <=
                                                           BelphegorSettings.Instance.Wizard.MirrorImageHp),
                                              new SelfCast(SNOPower.Wizard_SlowTime,
                                                           extra =>
                                                           ((CombatContext)extra).CurrentHealthPercentage <=
                                                           BelphegorSettings.Instance.Wizard.SlowTimeHp),
                                              // AoE spells.
                                              new SelfCast(SNOPower.Wizard_WaveOfForce,
                                                           ctx =>
                                                           Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx),
                                                                                    ClusterType.Radius, 12f) >= 2 ||
                                                           (((CombatContext)ctx).CurrentTarget.IsElite(16f))),
                                              new SelfCast(SNOPower.Wizard_FrostNova,
                                                           ctx =>
                                                           Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx),
                                                                                    ClusterType.Radius, 16f) >=
                                                           BelphegorSettings.Instance.Wizard.FrostNovaAoECount ||
                                                           (((CombatContext)ctx).CurrentTarget.IsElite(16f))),
                                              //Hydra
                                              new CastAtLocation(SNOPower.Wizard_Hydra,
                                                                 ctx => ((CombatContext)ctx).TargetPosition,
                                                                 ctx =>
                                                                 HydraTimer.IsFinished && !Minion.HasPet(Pet.Hydra)
                                                                 &&
                                                                 (((CombatContext)ctx).CurrentTarget.IsElite() ||
                                                                  Clusters.GetClusterCount(
                                                                      ((CombatContext)ctx).CurrentTarget,
                                                                      ((CombatContext)ctx), ClusterType.Radius, 12f) >=
                                                                  BelphegorSettings.Instance.Wizard.HydraAoECount),
                                                                 s => HydraTimer.Reset()),
                                              new SelfCast(SNOPower.Wizard_Archon,
                                                           ctx => ((CombatContext)ctx).CurrentTarget.IsElite() ||
                                                           Clusters.GetClusterCount(ZetaDia.Me,
                                                                                    ((CombatContext)ctx),
                                                                                    ClusterType.Radius, 60f) >=
                                                           BelphegorSettings.Instance.Wizard.ArchonAoECount),
                                              new CastOnUnit(SNOPower.Wizard_EnergyTwister,
                                                             ctx => ((CombatContext)ctx).TargetGuid,
                                                             ctx =>
                                                             Clusters.GetClusterCount(
                                                                 ((CombatContext)ctx).CurrentTarget,
                                                                 ((CombatContext)ctx), ClusterType.Radius, 20f) >=
                                                             BelphegorSettings.Instance.Wizard.EnergyTwisterAoECount),
                                              new CastAtLocation(SNOPower.Wizard_Meteor,
                                                                 ctx => ((CombatContext)ctx).TargetPosition,
                                                                 ctx =>
                                                                 MeteorTimer.IsFinished &&
                                                                 (((CombatContext)ctx).CurrentTarget.IsElite() ||
                                                                  Clusters.GetClusterCount(
                                                                      ((CombatContext)ctx).CurrentTarget,
                                                                      ((CombatContext)ctx), ClusterType.Radius, 16f) >=
                                                                  4),
                                                                 s => MeteorTimer.Reset()),
                                              new CastAtLocation(SNOPower.Wizard_Blizzard,
                                                                 ctx => ((CombatContext)ctx).TargetPosition,
                                                                 ctx =>
                                                                 BlizzardTimer.IsFinished &&
                                                                 Clusters.GetClusterCount(
                                                                     ((CombatContext)ctx).CurrentTarget,
                                                                     ((CombatContext)ctx), ClusterType.Radius, 16f) >= 4,
                                                                 s => BlizzardTimer.Reset()),
                                              new SelfCast(SNOPower.Wizard_ExplosiveBlast,
                                                           ctx =>
                                                           ExplosiveBlast.IsFinished &&
                                                           (((CombatContext)ctx).CurrentTarget.IsElite(16f) ||
                                                            Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx),
                                                                                     ClusterType.Radius, 16f) >=
                                                            BelphegorSettings.Instance.Wizard.ExplosiveBlastAoECount),
                                                           s => ExplosiveBlast.Reset()),
                                              // Arcane power spenders.
                                              new CastOnUnit(SNOPower.Wizard_ArcaneOrb,
                                                             ctx => ((CombatContext)ctx).TargetGuid),
                                              new CastOnUnit(SNOPower.Wizard_RayOfFrost,
                                                             ctx => ((CombatContext)ctx).TargetGuid),
                                              new CastOnUnit(SNOPower.Wizard_ArcaneTorrent,
                                                             ctx => ((CombatContext)ctx).TargetGuid),
                                              new CastOnUnit(SNOPower.Wizard_Disintegrate,
                                                             ctx => ((CombatContext)ctx).TargetGuid),
                                              // Signature spells.
                                              new CastOnUnit(SNOPower.Wizard_SpectralBlade,
                                                             ctx => ((CombatContext)ctx).TargetGuid),
                                              new CastOnUnit(SNOPower.Wizard_Electrocute,
                                                             ctx => ((CombatContext)ctx).TargetGuid),
                                              new CastOnUnit(SNOPower.Wizard_ShockPulse,
                                                             ctx => ((CombatContext)ctx).TargetGuid),
                                              new CastOnUnit(SNOPower.Wizard_MagicMissile,
                                                             ctx => ((CombatContext)ctx).TargetGuid)
                                              )),
                                      new Action(ret => RunStatus.Success)
                                      ));
        }
Пример #30
0
 public static Composite MonkCombat()
 {
     return
         (new PrioritySelector(CtxChanger,
                               new SelfCast(SNOPower.Monk_Serenity,
                                            extra =>
                                            ZetaDia.Me.HitpointsCurrentPct <=
                                            BelphegorSettings.Instance.Monk.SerenityHp ||
                                            ((CombatContext)extra).IsPlayerIncapacited),
                               Common.CreateUsePotion(),
                               Common.CreateWaitWhileFearedStunnedFrozenOrBlind(),
                               Common.CreateGetHealthGlobe(),
                               Common.CreateWaitForAttack(),
                               //Heals
                               new SelfCast(SNOPower.Monk_BreathOfHeaven,
                                            extra =>
                                            ((CombatContext)extra).CurrentHealthPercentage <=
                                            BelphegorSettings.Instance.Monk.BreathOfHeavenHp
                                            ||
                                            (!ZetaDia.Me.HasBuff(SNOPower.Monk_BreathOfHeaven) &&
                                             BelphegorSettings.Instance.Monk.BoHBlazingWrath)),
                               new SelfCast(SNOPower.Monk_InnerSanctuary,
                                            extra => ZetaDia.Me.HitpointsCurrentPct <= 0.4),
                               new Decorator(
                                   ctx =>
                                   ctx is CombatContext &&
                                   ((CombatContext)ctx).CurrentTarget != null,
                                   new PrioritySelector(
                                       //Mantra
                                       new Decorator(
                                           ret =>
                                           MantraTimer.IsFinished &&
                                           ZetaDia.Me.CurrentPrimaryResource >=
                                           BelphegorSettings.Instance.Monk.MantraSpirit &&
                                           (!BelphegorSettings.Instance.Monk.WaitForSweepingWind ||
                                            ZetaDia.Me.HasBuff(SNOPower.Monk_SweepingWind)),
                                           new PrioritySelector(
                                               new SelfCast(SNOPower.Monk_MantraOfEvasion,
                                                            extra =>
                                                            !ZetaDia.Me.HasBuff(SNOPower.Monk_MantraOfEvasion) ||
                                                            BelphegorSettings.Instance.Monk.SpamMantra,
                                                            s => MantraTimer.Reset()),
                                               new SelfCast(SNOPower.Monk_MantraOfConviction,
                                                            extra =>
                                                            !ZetaDia.Me.HasBuff(SNOPower.Monk_MantraOfConviction) ||
                                                            BelphegorSettings.Instance.Monk.SpamMantra,
                                                            s => MantraTimer.Reset()),
                                               new SelfCast(SNOPower.Monk_MantraOfHealing,
                                                            extra =>
                                                            !ZetaDia.Me.HasBuff(SNOPower.Monk_MantraOfHealing) ||
                                                            BelphegorSettings.Instance.Monk.SpamMantra,
                                                            s => MantraTimer.Reset()),
                                               new SelfCast(SNOPower.Monk_MantraOfRetribution,
                                                            extra =>
                                                            !ZetaDia.Me.HasBuff(SNOPower.Monk_MantraOfRetribution) ||
                                                            BelphegorSettings.Instance.Monk.SpamMantra,
                                                            s => MantraTimer.Reset())
                                               )),
                                       // Pull phase.
                                       new Decorator(
                                           ctx =>
                                           ((CombatContext)ctx).TargetDistance >
                                           BelphegorSettings.Instance.Monk.MaximumRange,
                                           new PrioritySelector(
                                               new CastOnUnit(SNOPower.Monk_DashingStrike,
                                                              ctx => ((CombatContext)ctx).TargetGuid),
                                               new CastOnUnit(SNOPower.Monk_FistsofThunder,
                                                              ctx => ((CombatContext)ctx).TargetGuid)
                                               //CommonBehaviors.MoveTo(ctx => ((DiaUnit)ctx).Position, "Moving towards unit")
                                               )),
                                       //Buffs
                                       new SelfCast(SNOPower.Monk_SweepingWind,
                                                    extra =>
                                                    !ZetaDia.Me.HasBuff(SNOPower.Monk_SweepingWind) &&
                                                    (Unit.IsEliteInRange(16f) ||
                                                     Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)extra),
                                                                              ClusterType.Radius, 16f) > 3)),
                                       //Focus Skills
                                       new SelfCast(SNOPower.Monk_CycloneStrike,
                                                    extra =>
                                                    Unit.IsEliteInRange(16f) ||
                                                    Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)extra),
                                                                             ClusterType.Radius, 20f) >=
                                                    BelphegorSettings.Instance.Monk.CycloneStrikeAoECount),
                                       new SelfCast(SNOPower.Monk_SevenSidedStrike,
                                                    extra =>
                                                    Unit.IsEliteInRange(16f) ||
                                                    Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)extra),
                                                                             ClusterType.Radius, 20f) >=
                                                    BelphegorSettings.Instance.Monk.SevenSidedStrikeAoECount),
                                       //Secondary
                                       new CastOnUnit(SNOPower.Monk_ExplodingPalm,
                                                      ctx => ((CombatContext)ctx).TargetGuid,
                                                      extra => ExplodingPalm.IsFinished,
                                                      s => ExplodingPalm.Reset()),
                                       new CastOnUnit(SNOPower.Monk_LashingTailKick,
                                                      ctx => ((CombatContext)ctx).TargetGuid,
                                                      ctx =>
                                                      (Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx),
                                                                                ClusterType.Radius, 16f) >=
                                                       BelphegorSettings.Instance.Monk.LashingTailKickAoECount ||
                                                       Unit.IsEliteInRange(16f)) &&
                                                      ZetaDia.Me.CurrentPrimaryResource >
                                                      BelphegorSettings.Instance.Monk.
                                                      LashingTailKickSpiritTreshold),
                                       new SelfCast(SNOPower.Monk_BlindingFlash,
                                                    ctx =>
                                                    Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx),
                                                                             ClusterType.Radius, 18f) >= 5 ||
                                                    Unit.IsEliteInRange(18f)),
                                       new CastOnUnit(SNOPower.Monk_WaveOfLight,
                                                      ctx => ((CombatContext)ctx).TargetGuid,
                                                      ctx => ((CombatContext)ctx).TargetDistance <= 16f),
                                       new CastOnUnit(SNOPower.Monk_TempestRush,
                                                      ctx => ((CombatContext)ctx).TargetGuid,
                                                      ctx => ZetaDia.Me.CurrentPrimaryResource > 15),
                                       // Primary Skills.
                                       new CastOnUnit(SNOPower.Monk_DeadlyReach,
                                                      ctx => ((CombatContext)ctx).TargetGuid, null,
                                                      ctx => PrimarySpamTimer.Reset(),
                                                      keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger),
                                       new CastOnUnit(SNOPower.Monk_CripplingWave,
                                                      ctx => ((CombatContext)ctx).TargetGuid, null,
                                                      ctx => PrimarySpamTimer.Reset(),
                                                      keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger),
                                       new CastOnUnit(SNOPower.Monk_WayOfTheHundredFists,
                                                      ctx => ((CombatContext)ctx).TargetGuid, null,
                                                      ctx => PrimarySpamTimer.Reset(),
                                                      keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger),
                                       new CastOnUnit(SNOPower.Monk_FistsofThunder,
                                                      ctx => ((CombatContext)ctx).TargetGuid, null,
                                                      ctx => PrimarySpamTimer.Reset(),
                                                      keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger)
                                       )
                                   ),
                               new Action(ret => RunStatus.Success)
                               ));
 }