Example #1
0
        /// <summary>
        /// checks for chained cascade targets.  this is expensive as the theoretical linked distance is 200 yds
        /// if all 4 hops occur and mobs are in straight line.  regardless, this ability can easily aggro the
        /// entire countryside while questing, so we will be conservative in our assessment of whether it can
        /// be used or not while still maximizing the number of mobs hit based upon the initial targets proximity
        /// to linked mobs
        /// </summary>
        /// <returns></returns>
        public static bool UseDivineStar()
        {
            if (!Spell.CanCastHack("Divine Star", Me.CurrentTarget, skipWowCheck: true))
            {
                return(false);
            }

            Vector3        endPoint = Me.Location.RayCast(Me.RenderFacing, 26);
            List <WoWUnit> hitByDS  = Clusters.GetPathToPointCluster(endPoint, Unit.UnfriendlyUnits(26), 4).ToList();

            if (hitByDS == null || !hitByDS.Any())
            {
                Logger.WriteDiagnostic("UseDivineStar:  0 mobs would be hit");
                return(false);
            }

            WoWUnit avoid = hitByDS.FirstOrDefault(u => u.IsAvoidMob());

            if (avoid != null)
            {
                Logger.WriteDiagnostic(
                    "UseDivineStar: skipping to avoid hitting {0} - aggr:{1} cc:{2} avdmob:{3}",
                    avoid.SafeName(),
                    (avoid.Aggro || avoid.PetAggro).ToYN(),
                    avoid.IsCrowdControlled().ToYN(),
                    avoid.IsAvoidMob().ToYN()
                    );
                return(false);
            }

            return(false);
        }
Example #2
0
/*
 *      public static Sequence CreateHealingSphereBehavior( int sphereBelowHealth)
 *      {
 *          // healing sphere keeps spell on cursor for up to 3 casts... need to stop targeting after 1
 *          return new Sequence(
 *              Spell.CastOnGround("Healing Sphere",
 *                  on => Me,
 *                  ret => Me.HealthPercent < sphereBelowHealth
 *                      && (Me.PowerType != WoWPowerType.Mana)
 *                      && !Common.AnySpheres(SphereType.Healing, 1f),
 *                  false),
 *              new WaitContinue( TimeSpan.FromMilliseconds(500), ret => Spell.GetPendingCursorSpell != null, new ActionAlwaysSucceed()),
 *              new Action(ret => Lua.DoString("SpellStopTargeting()")),
 *              new WaitContinue(
 *                  TimeSpan.FromMilliseconds(750),
 *                  ret => Me.Combat || (Spell.GetSpellCooldown("Healing Sphere") == TimeSpan.Zero && !Common.AnySpheres(SphereType.Healing, 1f)),
 *                  new ActionAlwaysSucceed()
 *                  )
 *              );
 *      }
 */

        public static Composite CreateChiBurstBehavior()
        {
            if (!HasTalent(MonkTalents.ChiBurst))
            {
                return(new ActionAlwaysFail());
            }

            if (TalentManager.CurrentSpec == WoWSpec.MonkMistweaver && SingularRoutine.CurrentWoWContext != WoWContext.Normal)
            {
                return(new Decorator(
                           req => Me.GotTarget() && !Spell.IsSpellOnCooldown("Chi Burst") && !Me.CurrentTarget.IsBoss() &&
                           3 <= Clusters.GetPathToPointCluster(Me.Location.RayCast(Me.RenderFacing, 40f), HealerManager.Instance.TargetList.Where(m => Me.IsSafelyFacing(m, 25)), 5f).Count(),
                           Spell.Cast("Chi Burst",
                                      mov => true,
                                      ctx => Me,
                                      ret => Me.HealthPercent < MonkSettings.ChiWavePct,
                                      cancel => false
                                      )
                           ));
            }

            return(new Decorator(
                       req => Me.GotTarget() && !Spell.IsSpellOnCooldown("Chi Burst") && !Me.CurrentTarget.IsBoss() &&
                       3 <= Clusters.GetPathToPointCluster(Me.Location.RayCast(Me.RenderFacing, 40f), Unit.NearbyUnfriendlyUnits.Where(m => Me.IsSafelyFacing(m, 25)), 5f).Count(),
                       Spell.Cast("Chi Burst",
                                  mov => true,
                                  ctx => Me,
                                  ret => Me.HealthPercent < MonkSettings.ChiWavePct,
                                  cancel => false
                                  )
                       ));
        }