예제 #1
0
        public static Composite CreateMistweaverCombatBehaviorBattlegrounds()
        {
            return(new Decorator(
                       ret => !Unit.NearbyGroupMembers.Any(m => m.IsAlive && !m.IsMe),

                       new PrioritySelector(

                           CreateMistWeaverDiagnosticOutputBehavior(on => MyHealTarget),

                           CancelSoothingMistAsNeeded(),

                           HealerManager.CreateMeleeHealerMovementBehavior(),

                           new Decorator(
                               req => HealerManager.AllowHealerDPS(),

                               new PrioritySelector(

                                   CreateMistweaverMoveToEnemyTarget(),

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

                                           new Decorator(
                                               req => Me.GotTarget() && Me.CurrentTarget.IsWithinMeleeRange,
                                               Helpers.Common.CreateAutoAttack()
                                               ),

                                           Helpers.Common.CreateInterruptBehavior(),

                                           Spell.Cast("Paralysis",
                                                      onu => Unit.NearbyUnfriendlyUnits
                                                      .FirstOrDefault(u => u.IsCasting && u.Distance.Between(9, 20) && Me.IsSafelyFacing(u))),

                                           Spell.Cast("Leg Sweep", ret => Spell.UseAOE && SingularRoutine.CurrentWoWContext == WoWContext.Normal && Me.CurrentTarget.IsWithinMeleeRange),

                                           Spell.Cast(SpinningCraneKick, ret => Spell.UseAOE && Unit.NearbyUnfriendlyUnits.Count(u => u.Distance <= 8) >= MonkSettings.SpinningCraneKickCnt),

                                           Spell.Cast("Rising Sun Kick"),
                                           Spell.Cast("Blackout Kick", req => Me.GetAuraStacks("Teachings of the Monastery") >= 3),
                                           Spell.Cast("Tiger Palm")
                                           )
                                       ),

                                   Spell.Cast("Roll", ret => MovementManager.IsClassMovementAllowed && !MonkSettings.DisableRoll && Me.CurrentTarget.Distance > minDistRollAllowed)
                                   )
                               ),

                           new Decorator(
                               ret => Unit.NearbyGroupMembers.Any(m => m.IsAlive && !m.IsMe),
                               new PrioritySelector(
                                   CreateMistweaverMonkHealing(selfOnly: false),
                                   Helpers.Common.CreateInterruptBehavior()
                                   )
                               )
                           )
                       ));
        }
예제 #2
0
        public static Composite CreateRestoShamanCombatBehaviorBattlegrounds()
        {
            return(new PrioritySelector(

                       Spell.WaitForCastOrChannel(),

                       CreateRestoDiagnosticOutputBehavior(on => HealerManager.Instance.FirstUnit),

                       new Decorator(
                           ret => !Spell.IsGlobalCooldown() && HealerManager.Instance.TargetList.Any(t => !t.IsMe && t.IsAlive),
                           new PrioritySelector(
                               HealerManager.CreateStayNearTankBehavior(),
                               CreateRestoShamanHealingOnlyBehavior(selfOnly: false)
                               )
                           ),

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

                               Helpers.Common.EnsureReadyToAttackFromMediumRange(),

                               Spell.WaitForCastOrChannel(),

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

                                       Helpers.Common.CreateInterruptBehavior(),
                                       Totems.CreateTotemsBehavior(),

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

                                       Dispelling.CreatePurgeEnemyBehavior("Purge"),

                                       Common.CastElementalBlast(),
                                       Spell.Buff("Flame Shock", 3, on => Me.CurrentTarget, req => true),
                                       Spell.Cast("Lava Burst"),
                                       Spell.Cast("Frost Shock"),
                                       Spell.Cast("Chain Lightning", ret => Spell.UseAOE && Unit.UnfriendlyUnitsNearTarget(10f).Count() >= 2 && !Unit.UnfriendlyUnitsNearTarget(12f).Any(u => u.IsCrowdControlled())),
                                       Spell.Cast("Lightning Bolt")
                                       )
                                   )
                               )
                           )
                       ));
        }
예제 #3
0
        public static Composite CreateRestoDruidCombat()
        {
            return(new PrioritySelector(
                       HealerManager.CreateStayNearTankBehavior(),
                       new Decorator(
                           req => HealerManager.AllowHealerDPS(),
                           new PrioritySelector(
                               Helpers.Common.EnsureReadyToAttackFromLongRange(),
                               Spell.WaitForCastOrChannel(),
                               new Decorator(
                                   req => !Spell.IsGlobalCooldown(),
                                   new PrioritySelector(
                                       Helpers.Common.CreateInterruptBehavior(),

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

                                       Common.CastForm(ShapeshiftForm.Moonkin, req => Common.HasTalent(DruidTalents.BalanceAffinity) && Me.Shapeshift != ShapeshiftForm.Moonkin && !Utilities.EventHandlers.IsShapeshiftSuppressed),

                                       Spell.Cast("Moonfire", on => Unit.NearbyUnitsInCombatWithUsOrOurStuff.FirstOrDefault(u => u.GetAuraTimeLeft("Moonfire").TotalSeconds < 1.8 && u.TimeToDeath(int.MaxValue) > 4)),
                                       Spell.Cast("Sunfire", on => Unit.NearbyUnitsInCombatWithUsOrOurStuff.FirstOrDefault(u => u.GetAuraTimeLeft("Sunfire").TotalSeconds < 1.8 && u.TimeToDeath(int.MaxValue) > 4)),
                                       Spell.Cast(
                                           "Starsurge",
                                           on => Unit.UnitsInCombatWithUsOrOurStuff(40).Where(u => !u.IsCrowdControlled() && u.InLineOfSpellSight).OrderByDescending(u => (uint)u.HealthPercent).FirstOrDefault(),
                                           req => true,
                                           cancel => HealerManager.CancelHealerDPS()
                                           ),
                                       Spell.Cast(
                                           "Lunar Strike",
                                           on => Unit.UnitsInCombatWithUsOrOurStuff(40).Where(u => !u.IsCrowdControlled() && u.InLineOfSpellSight).OrderByDescending(u => (uint)u.HealthPercent).FirstOrDefault(),
                                           req => true,
                                           cancel => HealerManager.CancelHealerDPS()
                                           ),
                                       Spell.Cast(
                                           "Solar Wrath",
                                           on => Unit.UnitsInCombatWithUsOrOurStuff(40).Where(u => !u.IsCrowdControlled() && u.InLineOfSpellSight).OrderByDescending(u => (uint)u.HealthPercent).FirstOrDefault(),
                                           req => true,
                                           cancel => HealerManager.CancelHealerDPS()
                                           )
                                       )
                                   )
                               )
                           )
                       ));
        }
예제 #4
0
        public static Composite CreateHolyCombat()
        {
            return(new PrioritySelector(
                       new Decorator(
                           ret => HealerManager.AllowHealerDPS(),
                           new PrioritySelector(
                               Helpers.Common.EnsureReadyToAttackFromMediumRange(),
                               Spell.WaitForCastOrChannel(),

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

                                       Helpers.Common.CreateInterruptBehavior(),

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

                                       Dispelling.CreatePurgeEnemyBehavior("Dispel Magic"),
                                       Spell.Buff("Shadow Word: Pain", true),
                                       Spell.Buff("Holy Word: Chastise"),
                                       Spell.Buff("Shadow Word: Pain", true, on =>
            {
                WoWUnit unit = Unit.NearbyUnfriendlyUnits
                               .FirstOrDefault(
                    u => (u.TaggedByMe || u.Aggro) &&
                    u.Guid != Me.CurrentTargetGuid &&
                    u.IsTargetingMeOrPet &&
                    !u.HasMyAura("Shadow Word: Pain") &&
                    !u.IsCrowdControlled()
                    );
                return unit;
            }),
                                       Common.CreateHolyFireBehavior(),
                                       Spell.Cast("Smite", mov => true, on => Me.CurrentTarget, req => true, cancel => HealerManager.CancelHealerDPS())
                                       )
                                   )
                               )
                           )
                       ));
        }
예제 #5
0
        public static Composite CreateRestoShamanCombatBehaviorInstances()
        {
#if OLD_APPROACH
            return(new PrioritySelector(

                       ctx => HealerManager.Instance.TargetList.Any(t => !t.IsMe && t.IsAlive),

                       Safers.EnsureTarget(),
                       Movement.CreateFaceTargetBehavior(),

                       Spell.WaitForCastOrChannel(),

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

                               CreateRestoDiagnosticOutputBehavior(on => Me.CurrentTarget),

                               new Decorator(
                                   ret => (bool)ret,
                                   new PrioritySelector(
                                       HealerManager.CreateStayNearTankBehavior(),
                                       CreateRestoShamanHealingOnlyBehavior(selfOnly: false),
                                       Helpers.Common.CreateInterruptBehavior(),
                                       Dispelling.CreatePurgeEnemyBehavior("Purge"),
                                       Totems.CreateTotemsBehavior(),
                                       Spell.Cast("Lightning Bolt", ret => TalentManager.HasGlyph("Telluric Currents"))
                                       )
                                   ),

                               new Decorator(
                                   ret => !((bool)ret),
                                   new PrioritySelector(
                                       CreateRestoDiagnosticOutputBehavior(on => HealerManager.Instance.FirstUnit),
                                       Spell.Cast("Elemental Blast"),
                                       Spell.Buff("Flame Shock", true, on => Me.CurrentTarget, req => true, 3),
                                       Spell.Cast("Lava Burst"),
                                       Spell.Cast("Frost Shock"),
                                       Spell.Cast("Chain Lightning", ret => Spell.UseAOE && Unit.UnfriendlyUnitsNearTarget(10f).Count() >= 2 && !Unit.UnfriendlyUnitsNearTarget(12f).Any(u => u.IsCrowdControlled())),
                                       Spell.Cast("Lightning Bolt")
                                       )
                                   )

                               )
                           )
                       ));
#else
            return(new PrioritySelector(

                       Spell.WaitForCastOrChannel(),
                       CreateRestoDiagnosticOutputBehavior(on => HealerManager.FindLowestHealthTarget()),

                       HealerManager.CreateStayNearTankBehavior(),

                       new Decorator(
                           ret => Me.Combat && HealerManager.AllowHealerDPS(),
                           new PrioritySelector(

                               Helpers.Common.EnsureReadyToAttackFromMediumRange(),
                               Movement.CreateFaceTargetBehavior(),
                               Spell.WaitForCastOrChannel(),

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

                                       Totems.CreateTotemsBehavior(),

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

                                       Common.CastElementalBlast(cancel: c => HealerManager.CancelHealerDPS()),
                                       Spell.Buff("Flame Shock", 3, on => Me.CurrentTarget, req => true),
                                       Spell.Cast("Lava Burst", on => Me.CurrentTarget, req => true, cancel => HealerManager.CancelHealerDPS()),
                                       Spell.Cast("Frost Shock"),
                                       Spell.Cast("Chain Lightning", on => Me.CurrentTarget, req => Spell.UseAOE && Unit.UnfriendlyUnitsNearTarget(10f).Count() >= 2 && !Unit.UnfriendlyUnitsNearTarget(12f).Any(u => u.IsCrowdControlled()), cancel => HealerManager.CancelHealerDPS()),
                                       Spell.Cast("Lightning Bolt", on => Me.CurrentTarget, req => true, cancel => HealerManager.CancelHealerDPS())
                                       )
                                   )
                               )
                           ),

                       new Decorator(
                           ret => Unit.NearbyGroupMembers.Any(m => m.IsAlive && !m.IsMe),
                           new PrioritySelector(
                               CreateRestoShamanHealingOnlyBehavior(selfOnly: false),
                               Helpers.Common.CreateInterruptBehavior(),
                               Dispelling.CreatePurgeEnemyBehavior("Purge"),
                               Totems.CreateTotemsBehavior(),
                               new Decorator(
                                   req => TalentManager.HasGlyph("Telluric Currents"),
                                   new PrioritySelector(
                                       Safers.EnsureTarget(),
                                       Movement.CreateFaceTargetBehavior(),
                                       Spell.Cast("Lightning Bolt",
                                                  mov => true,
                                                  on => Unit.NearbyUnitsInCombatWithUsOrOurStuff
                                                  .Where(u => u.IsAlive && u.SpellDistance() < 40 && Me.IsSafelyFacing(u))
                                                  .OrderByDescending(u => u.HealthPercent)
                                                  .FirstOrDefault(),
                                                  req => !HealerManager.Instance.TargetList.Any(h => h.IsAlive && h.SpellDistance() < 40 && h.HealthPercent < ShamanSettings.RestoHealSettings.TelluricHealthCast),
                                                  cancel => HealerManager.Instance.TargetList.Any(h => h.IsAlive && h.SpellDistance() < 40 && h.HealthPercent < ShamanSettings.RestoHealSettings.TelluricHealthCancel)
                                                  )
                                       )
                                   )
                               )
                           )
                       ));
#endif
        }
예제 #6
0
        public static Composite CreateMistweaverCombatBehaviorInstances()
        {
            return(new PrioritySelector(

                       CancelSoothingMistAsNeeded(),
                       CreateMistWeaverDiagnosticOutputBehavior(on => MyHealTarget),

                       new Decorator(
                           req => true,
                           new PrioritySelector(
                               // HealerManager.CreateMeleeHealerMovementBehavior( Common.CreateMonkCloseDistanceBehavior( min => 30, on => (WoWUnit) on)),
                               HealerManager.CreateStayNearTankBehavior(Common.CreateMonkCloseDistanceBehavior(min => 30, on => (WoWUnit)on)),

                               /*
                                *                  new Decorator(
                                *                      unit => MovementManager.IsClassMovementAllowed
                                *                          && !MonkSettings.DisableRoll
                                *                          && (unit as WoWUnit).SpellDistance() > 10
                                *                          && Me.IsSafelyFacing(unit as WoWUnit, 5f),
                                *                      Spell.Cast("Roll")
                                *                      )
                                *                  ),
                                */
                               new Decorator(
                                   ret => Me.Combat && HealerManager.AllowHealerDPS(),
                                   new PrioritySelector(

                                       CreateMistweaverMoveToEnemyTarget(),
                                       new Decorator(
                                           req => Me.GotTarget() && Me.CurrentTarget.IsAlive,
                                           Movement.CreateFaceTargetBehavior()
                                           ),

                                       Spell.WaitForCastOrChannel(),

                                       #region Spinning Crane Kick progress handler

                                       new Decorator(
                                           req => Me.HasActiveAura("Spinning Crane Kick"), // don't wait for Rushing Jade Wind since we can cast
                                           new PrioritySelector(
                                               new Action(r =>
            {
                Logger.WriteFile(SpinningCraneKick + ": in progress with {0} ms left", (long)Me.GetAuraTimeLeft(SpinningCraneKick).TotalMilliseconds);
                return RunStatus.Failure;
            }),
                                               new Decorator(
                                                   req =>
            {
                if (Me.GetAuraTimeLeft(SpinningCraneKick).TotalMilliseconds < 333)
                {
                    return false;
                }

                int countFriendly = Unit.NearbyGroupMembersAndPets.Count(u => u.SpellDistance() <= 8);
                if (countFriendly >= 3)
                {
                    return false;
                }

                if (HealerManager.CancelHealerDPS())
                {
                    Logger.Write(LogColor.Cancel, "/cancel {0} since only {1} friendly targets hit and cannot DPS", SpinningCraneKick, countFriendly);
                    return true;
                }

                int countEnemy = Unit.NearbyUnfriendlyUnits.Count(u => u.SpellDistance() <= 8);
                if ((countFriendly + countEnemy) < 3)
                {
                    Logger.Write(LogColor.Cancel, "/cancel {0} since only {1} friendly and {2} enemy targets hit", SpinningCraneKick, countFriendly, countEnemy);
                    return true;
                }
                return false;
            },
                                                   new Sequence(
                                                       new Action(r => Me.CancelAura(SpinningCraneKick)),
                                                       new Wait(1, until => !Me.HasActiveAura(SpinningCraneKick), new ActionAlwaysFail())
                                                       )
                                                   ),

                                               // dont go past here if SCK active
                                               new ActionAlwaysSucceed()
                                               )
                                           ),
                                       #endregion

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

                                               new Decorator(
                                                   req => Me.GotTarget() && Me.CurrentTarget.IsWithinMeleeRange,
                                                   Helpers.Common.CreateAutoAttack()
                                                   ),

                                               Helpers.Common.CreateInterruptBehavior(),

                                               Spell.Cast("Leg Sweep", ret => Spell.UseAOE && SingularRoutine.CurrentWoWContext == WoWContext.Normal && Me.CurrentTarget.IsWithinMeleeRange),

                                               Spell.Cast(
                                                   SpinningCraneKick,
                                                   ret => Spell.UseAOE && HealerManager.AllowHealerDPS() && Unit.NearbyUnfriendlyUnits.Count(u => u.SpellDistance() <= 8) >= MonkSettings.SpinningCraneKickCnt
                                                   ),

                                               Spell.Cast("Rising Sun Kick"),
                                               Spell.Cast("Blackout Kick", req => Me.GetAuraStacks("Teachings of the Monastery") >= 3),
                                               Spell.Cast("Tiger Palm")
                                               )
                                           ),

                                       Spell.Cast("Roll",
                                                  req => MovementManager.IsClassMovementAllowed &&
                                                  !MonkSettings.DisableRoll &&
                                                  Me.CurrentTarget.Distance > minDistRollAllowed
                                                  )
                                       )
                                   )
                               )
                           ),

                       new Decorator(
                           ret => !Spell.IsGlobalCooldown() && Unit.NearbyGroupMembers.Any(m => m.IsAlive && !m.IsMe),
                           new PrioritySelector(
                               CreateMistweaverMonkHealing(selfOnly: false),
                               new Decorator(
                                   req => true,
                                   Helpers.Common.CreateInterruptBehavior()
                                   )
                               )
                           ),

                       Spell.WaitForCastOrChannel()
                       ));
        }