Exemplo n.º 1
0
        public static Composite CreateStayAwayFromFrozenTargetsBehavior()
        {
            return(new PrioritySelector(
                       ctx => Unit.NearbyUnfriendlyUnits.
                       Where(u => (u.HasAura("Frost Nova") || u.HasAura("Freeze")) &&
                             u.Distance < Spell.MeleeRange).
                       OrderBy(u => u.DistanceSqr).FirstOrDefault(),
                       new Decorator(
                           ret => ret != null && !SingularSettings.Instance.DisableAllMovement,
                           new PrioritySelector(
                               Spell.BuffSelf("Blink"),
                               new Action(ret =>
            {
                WoWPoint moveTo =
                    WoWMathHelper.CalculatePointBehind(
                        ((WoWUnit)ret).Location,
                        ((WoWUnit)ret).Rotation,
                        -(Spell.MeleeRange + 5f));

                if (Navigator.CanNavigateFully(StyxWoW.Me.Location, moveTo))
                {
                    Logger.Write("Getting away from frozen target");
                    Navigator.MoveTo(moveTo);
                    return RunStatus.Success;
                }

                return RunStatus.Failure;
            })))));
        }
Exemplo n.º 2
0
 public Composite CreateFeralCatPull()
 {
     return(new PrioritySelector(
                // Make sure we're in cat form first, period.
                new Decorator(
                    ret => Me.Shapeshift != WantedDruidForm,
                    CreateSpellCast("Cat Form")),
                CreateEnsureTarget(),
                CreateSpellBuffOnSelf("Dash", ret => Me.IsMoving && Me.HasAura("Prowl")),
                CreateSpellBuffOnSelf("Prowl"),
                new PrioritySelector(
                    ret => WoWMathHelper.CalculatePointBehind(Me.CurrentTarget.Location, Me.CurrentTarget.Rotation, 1f),
                    new Decorator(
                        ret => ((WoWPoint)ret).Distance2D(Me.Location) > 3f && Navigator.CanNavigateFully(Me.Location, ((WoWPoint)ret)),
                        new Action(ret => Navigator.MoveTo(((WoWPoint)ret)))),
                    CreateMoveToAndFace()),
                new Decorator(
                    ret => Me.HasAura("Prowl"),
                    new PrioritySelector(
                        CreateSpellCast("Pounce"),
                        CreateSpellCast("Ravage", ret => Me.CurrentTarget.MeIsSafelyBehind))),
                CreateSpellCast("Mangle (Cat)"),
                CreateAutoAttack(true)
                ));
 }
Exemplo n.º 3
0
        public static async Task FaceAwayFromTarget()
        {
            //Core.SafeArea sa = new Core.SafeArea();
            //sa.MinScanDistance = 25;
            //sa.MaxScanDistance = sa.MinScanDistance;
            //sa.RaysToCheck = 36;
            //sa.LineOfSightMob = CurrentTarget;
            //sa.CheckLineOfSightToSafeLocation = true;
            //sa.CheckSpellLineOfSightToMob = false;
            //sa.DirectPathOnly = true;

            //safeSpot = sa.FindLocation();
            //if (safeSpot != Vector3.Zero)
            //{
            //    origSpot = new Vector3(Me.Location.X, Me.Location.Y, Me.Location.Z);
            //    needFacing = Styx.Helpers.WoWMathHelper.CalculateNeededFacing(safeSpot, origSpot);
            //    needFacing = WoWMathHelper.NormalizeRadian(needFacing);
            //    float rotation = WoWMathHelper.NormalizeRadian(Math.Abs(needFacing - Me.RenderFacing));
            //}

            //Me.SetFacing(needFacing);
            //await Coroutine.Sleep(500);
            Me.SetFacing(WoWMathHelper.CalculatePointBehind(Me.Location, 36, 5f));
            await Coroutine.Yield();
        }
Exemplo n.º 4
0
 private void WalkAway()
 {
     if (Me.CurrentTarget != null)
     {
         WoWMovement.ClickToMove(WoWMathHelper.CalculatePointBehind(Me.Location, Me.RotationDegrees, 10));
         Log("Waliking away.");
         float rotation = Me.RotationDegrees + 180;
         Me.SetFacing(WoWMathHelper.DegreesToRadians(rotation));
         Thread.Sleep(250);
         WoWMovement.Move(WoWMovement.MovementDirection.Forward);
         Thread.Sleep(1500);
         WoWMovement.MoveStop(WoWMovement.MovementDirection.Forward);
         Me.CurrentTarget.Face();
     }
 }
Exemplo n.º 5
0
 public Composite CreateCombatRoguePull()
 {
     return(new PrioritySelector(
                CreateEnsureTarget(),
                CreateSpellBuffOnSelf("Sprint", ret => Me.IsMoving && Me.HasAura("Stealth")),
                CreateSpellBuffOnSelf("Stealth"),
                new PrioritySelector(
                    ret => WoWMathHelper.CalculatePointBehind(Me.CurrentTarget.Location, Me.CurrentTarget.Rotation, 1f),
                    new Decorator(
                        ret => ((WoWPoint)ret).Distance2D(Me.Location) > 3f && Navigator.CanNavigateFully(Me.Location, ((WoWPoint)ret)),
                        new Action(ret => Navigator.MoveTo(((WoWPoint)ret)))),
                    CreateMoveToAndFace()),
                CreateSpellCast("Cheap Shot"),
                CreateSpellCast("Sinister Strike"),
                CreateAutoAttack(true)
                ));
 }
Exemplo n.º 6
0
        public static void MoveBehind(WoWUnit Unit)
        {
            // Movement Checks
            if (GlueEnabled && Unit.Distance < 10)
            {
                return;
            }
            if (!ClassSettings._Instance.GeneralMovement)
            {
                return;
            }


            WoWPoint BehindLocation = WoWMathHelper.CalculatePointBehind(Unit.Location, Unit.Rotation, 2.3f);

            Navigator.MoveTo(BehindLocation);
        }
Exemplo n.º 7
0
        public static bool ClearBehindMe(this WoWPlayer p, string strRange)
        {
            float    range = float.Parse(strRange);
            WoWPoint pt    = WoWMathHelper.CalculatePointBehind(p.Location, p.Rotation, -range);

            if (!Navigator.CanNavigateFully(StyxWoW.Me.Location, pt))
            {
                return(false);
            }
            List <WoWUnit> list = (from u in ObjectManager.GetObjectsOfType <WoWUnit>(false, false)
                                   where u.Location.DistanceSqr(pt) < range * range
                                   where u.IsDead == false
                                   where u.IsHostile == true
                                   select u).ToList();

            if (list.Count > 0)
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 8
0
        Composite HeroicLeap()
        {
            return(new Decorator(ret => StyxWoW.Me.CurrentTarget.HasAura("Colossus Smash") && SpellManager.CanCast("Heroic Leap"),
                                 new Action(ret =>
            {
                var tpos = StyxWoW.Me.CurrentTarget.Location;
                var trot = StyxWoW.Me.CurrentTarget.Rotation;
                var leapRight = WoWMathHelper.CalculatePointAtSide(tpos, trot, 5, true);
                var leapLeft = WoWMathHelper.CalculatePointAtSide(tpos, trot, 5, true);


                var myPos = StyxWoW.Me.Location;


                var leftDist = leapLeft.Distance(myPos);
                var rightDist = leapRight.Distance(myPos);


                var leapPos = WoWMathHelper.CalculatePointBehind(tpos, trot, 8);


                if (leftDist > rightDist && leftDist <= 40 && leftDist >= 8)
                {
                    leapPos = leapLeft;
                }
                else if (rightDist > leftDist && rightDist <= 40 && rightDist >= 8)
                {
                    leapPos = leapLeft;
                }


                SpellManager.Cast("Heroic Leap");
                SpellManager.ClickRemoteLocation(leapPos);
                StyxWoW.Me.CurrentTarget.Face();
            })));
        }
Exemplo n.º 9
0
        public static Composite CreateBeastMasterHunterPvPPullAndCombat()
        {
            return(new PrioritySelector(
                       Common.CreateHunterCallPetBehavior(true),

                       Safers.EnsureTarget(),
                       Spell.BuffSelf("Disengage",
                                      ret =>
                                      SingularSettings.Instance.IsCombatRoutineMovementAllowed() &&
                                      SingularSettings.Instance.Hunter.UseDisengage &&
                                      StyxWoW.Me.CurrentTarget.Distance < Spell.MeleeRange + 3f && Navigator.CanNavigateFully(StyxWoW.Me.Location, WoWMathHelper.CalculatePointBehind(StyxWoW.Me.Location, StyxWoW.Me.Rotation, 30))),
                       //Common.CreateHunterBackPedal(),
                       Movement.CreateMoveToLosBehavior(),
                       Movement.CreateFaceTargetBehavior(),
                       new Decorator(
                           ret => StyxWoW.Me.CurrentTarget.Distance < 35f,
                           Movement.CreateEnsureMovementStoppedBehavior()),

                       Spell.WaitForCast(true),
                       Helpers.Common.CreateInterruptSpellCast(ret => StyxWoW.Me.CurrentTarget),

                       Spell.BuffSelf("Aspect of the Fox", ret => StyxWoW.Me.IsMoving),
                       Spell.BuffSelf("Aspect of the Hawk",
                                      ret => !StyxWoW.Me.IsMoving &&
                                      !StyxWoW.Me.HasAura("Aspect of the Iron Hawk") &&
                                      !StyxWoW.Me.HasAura("Aspect of the Hawk")),

                       Helpers.Common.CreateAutoAttack(true),

                       Common.CreateHunterTrapOnAddBehavior("Explosive Trap"),

                       Spell.Cast("Tranquilizing Shot", ctx => StyxWoW.Me.CurrentTarget.HasAura("Enraged")),
                       Spell.Buff("Concussive Shot",
                                  ret =>
                                  StyxWoW.Me.CurrentTarget.CurrentTargetGuid == StyxWoW.Me.Guid &&
                                  StyxWoW.Me.CurrentTarget.Distance > Spell.MeleeRange),
                       Spell.Buff("Hunter's Mark", ctx => !StyxWoW.Me.CurrentTarget.HasAura("Hunter's Mark")),

                       // Defensive Stuff

                       Spell.Cast(
                           "Intimidation", ret => StyxWoW.Me.CurrentTarget.IsAlive && StyxWoW.Me.GotAlivePet &&
                           (StyxWoW.Me.CurrentTarget.CurrentTarget == null ||
                            StyxWoW.Me.CurrentTarget.CurrentTarget == StyxWoW.Me)),

                       Spell.Cast("Mend Pet",
                                  ret => StyxWoW.Me.GotAlivePet && !StyxWoW.Me.Pet.HasAura("Mend Pet") &&
                                  (StyxWoW.Me.Pet.HealthPercent < SingularSettings.Instance.Hunter.MendPetPercent ||
                                   (StyxWoW.Me.Pet.HappinessPercent < 90 && TalentManager.HasGlyph("Mend Pet")))),

                       Common.CreateHunterTrapBehavior("Snake Trap", false),
                       Common.CreateHunterTrapBehavior("Immolation Trap", false),
                       new Action(ctx =>
            {
                var firstOrDefault = StyxWoW.Me.CarriedItems.FirstOrDefault(ret => ret.Entry == 76089);
                if (firstOrDefault != null)
                {
                    firstOrDefault.UseContainerItem();
                }
            }),

                       Spell.BuffSelf("Deterrence", ctx => StyxWoW.Me.HealthPercent < 30),

                       // Rotation

                       Spell.BuffSelf("Focus Fire", ctx => StyxWoW.Me.HasAura("Frenzy")),

                       Spell.Buff("Serpent Sting", ctx => !StyxWoW.Me.CurrentTarget.HasAura("Serpent Sting")),
                       Spell.Cast("Fervor", ctx => StyxWoW.Me.FocusPercent <= 65 && StyxWoW.Me.HasAura("Frenzy") && StyxWoW.Me.Auras["Frenzy"].StackCount >= 5),
                       Spell.BuffSelf("Bestial Wrath", ctx => StyxWoW.Me.FocusPercent > 60 && !StyxWoW.Me.HasAura("The Beast Within")),
                       Spell.Cast("Multi-Shot", ctx => Unit.NearbyUnfriendlyUnits.Count(u => u.IsTargetingMeOrPet) > 2),
                       Spell.Cast("Steady Shot", ctx => Unit.NearbyUnfriendlyUnits.Count(u => u.IsTargetingMeOrPet) > 2),
                       Spell.CastOnGround("Binding Shot", ret => StyxWoW.Me.CurrentTarget.Location),
                       Spell.CastOnGround("Flare", ret => StyxWoW.Me.Location),
                       Spell.Cast("Stampede"),
                       Spell.Cast("Rapid Fire"),
                       Spell.Cast("Kill Shot", ctx => StyxWoW.Me.CurrentTarget.HealthPercent < 20),
                       Spell.Cast("Kill Command", ctx => StyxWoW.Me.GotAlivePet && StyxWoW.Me.Pet.Location.Distance(StyxWoW.Me.CurrentTarget.Location) < Spell.MeleeRange),
                       Spell.Buff("A Murder of Crows"),
                       Spell.Cast("Glaive Toss"),
                       Spell.Buff("Lynx Rush", ctx => StyxWoW.Me.GotAlivePet && StyxWoW.Me.Pet.Location.Distance(StyxWoW.Me.CurrentTarget.Location) < 10),
                       Spell.Cast("Dire Beast", ctx => StyxWoW.Me.FocusPercent <= 90),
                       Spell.Cast("Barrage"),
                       Spell.Cast("Powershot"),
                       Spell.Cast("Blink Strike", ctx => StyxWoW.Me.GotAlivePet),
                       Spell.Cast("Readiness", ctx => StyxWoW.Me.HasAura("Rapid Fire")),
                       Spell.Cast("Arcane Shot", ctx => StyxWoW.Me.HasAura("Thrill of the Hunt")),
                       Spell.Cast("Arcane Shot", ret => StyxWoW.Me.FocusPercent > 60 || StyxWoW.Me.HasAura("The Beast Within")),
                       Spell.Cast("Steady Shot"),


                       Movement.CreateMoveToTargetBehavior(true, 35f)
                       ));
        }
Exemplo n.º 10
0
        public static void MoveBehind(WoWUnit Unit)
        {
            WoWPoint BehindLocation = WoWMathHelper.CalculatePointBehind(Unit.Location, Unit.Rotation, 2.3f);

            Navigator.MoveTo(BehindLocation);
        }