internal static Composite CreateFadeBehavior() { if (!PriestSettings.UseFade) { return(new ActionAlwaysFail()); } if (SingularRoutine.CurrentWoWContext == WoWContext.Instances) { return(Spell.BuffSelf("Fade", req => Targeting.GetAggroOnMeWithin(StyxWoW.Me.Location, 30) > 0)); } return(Spell.BuffSelf("Fade", req => { if (Targeting.Instance.TargetList.Any(p => p.IsPlayer && p.GotAlivePet && p.Pet.CurrentTargetGuid == Me.Guid)) { return true; } return false; })); }
public static Composite CreateDiscHealOnlyBehavior(bool selfOnly, bool moveInRange) { HealerManager.NeedHealTargeting = true; return(new PrioritySelector( ret => 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)), // Ensure we're in range of the unit to heal, and it's in LOS. //CreateMoveToAndFace(35f, ret => (WoWUnit)ret), //Spell.Buff("Renew", ret => HealTargeting.Instance.TargetList.FirstOrDefault(u => !u.HasAura("Renew") && u.HealthPercent < 90) != null, ret => HealTargeting.Instance.TargetList.FirstOrDefault(u => !u.HasAura("Renew") && u.HealthPercent < 90)), // 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.Heal("Desperate Prayer", ret => StyxWoW.Me, ret => StyxWoW.Me.HealthPercent < 30), Spell.Buff( "Power Word: Shield", ret => (WoWUnit)ret, ret => !((WoWUnit)ret).HasAura("Weakened Soul") && ((WoWUnit)ret).Combat && ((WoWUnit)ret).HealthPercent < SingularSettings.Instance.Priest.PowerWordShield), new Decorator( ret => Unit.NearbyFriendlyPlayers.Count(p => !p.IsDead && p.HealthPercent < SingularSettings.Instance.Priest.PrayerOfHealing) > SingularSettings.Instance.Priest.PrayerOfHealingCount && (SpellManager.CanCast("Prayer of Healing") || SpellManager.CanCast("Divine Hymn")), new Sequence( Spell.Cast("Power Infusion", ret => ((WoWUnit)ret).HealthPercent < 40 || StyxWoW.Me.ManaPercent <= 20), Spell.Cast("Archangel"), // This will skip over DH if we can't cast it. // If we can, the sequence fails, since PoH can't be cast (as we're still casting at this point) new DecoratorContinue( ret => SpellManager.CanCast("Divine Hymn"), Spell.Heal("Divine Hymn")), Spell.Heal("Prayer of Healing"))), Spell.Heal( "Pain Suppression", ret => (WoWUnit)ret, ret => ((WoWUnit)ret).HealthPercent < SingularSettings.Instance.Priest.PainSuppression), Spell.Heal( "Penance", ret => (WoWUnit)ret, ret => ((WoWUnit)ret).HealthPercent < SingularSettings.Instance.Priest.Penance), Spell.Heal("Desperate Prayer", ret => StyxWoW.Me, ret => StyxWoW.Me.HealthPercent < 30), Spell.Heal( "Flash Heal", ret => (WoWUnit)ret, ret => ((WoWUnit)ret).HealthPercent < SingularSettings.Instance.Priest.FlashHeal), Spell.Heal( "Binding Heal", ret => (WoWUnit)ret, ret => (WoWUnit)ret != StyxWoW.Me && ((WoWUnit)ret).HealthPercent < SingularSettings.Instance.Priest.BindingHealThem && StyxWoW.Me.HealthPercent < SingularSettings.Instance.Priest.BindingHealMe), Spell.Heal( "Greater Heal", ret => (WoWUnit)ret, ret => ((WoWUnit)ret).HealthPercent < SingularSettings.Instance.Priest.GreaterHeal), Spell.Heal( "Heal", ret => (WoWUnit)ret, ret => ((WoWUnit)ret).HealthPercent < SingularSettings.Instance.Priest.Heal), Spell.Heal( "Renew", ret => (WoWUnit)ret, ret => !((WoWUnit)ret).HasMyAura("Renew") && ((WoWUnit)ret).HealthPercent < SingularSettings.Instance.Priest.Renew), Spell.Heal( "Prayer of Mending", ret => (WoWUnit)ret, ret => !((WoWUnit)ret).HasMyAura("Prayer of Mending") && ((WoWUnit)ret).HealthPercent < 90), 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("Mindbender"), Spell.Cast("Shadowfiend", ret => StyxWoW.Me.ManaPercent < 50), //Spell.Cast("Archangel", ret => StyxWoW.Me.HasAura("Evangelism", 5)), Spell.Cast("Shadow Word: Death", ret => StyxWoW.Me.CurrentTarget.HealthPercent <= 20), Spell.Buff("Shadow Word: Pain", true), Spell.Cast("Penance"), Spell.Cast("Holy Fire"), Spell.Cast("Smite", ret => !SpellManager.HasSpell("Power Word: Solace")), Spell.Cast("Smite", ret => (StyxWoW.Me.ManaPercent >= 10 && SpellManager.HasSpell("Power Word: Solace"))), Spell.Cast("Power Word: Solace", ret => StyxWoW.Me.ManaPercent < 10), //Spell.Cast("Mind Spike", ret => !SpellManager.HasSpell("Power Word: Solace")), Movement.CreateMoveToTargetBehavior(true, 35f) )), new Decorator( ret => moveInRange, Movement.CreateMoveToTargetBehavior(true, 35f, ret => (WoWUnit)ret)) // Divine Hymn // Desperate Prayer // Prayer of Mending // Prayer of Healing // Power Word: Barrier // TODO: Add smite healing. Atonement is now specced as all discs. (Its useless otherwise) )))); }
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) )))); }
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) )); }
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) )); }