Пример #1
0
        private static void UseTrinket()
        {
            // Check First Trinket
            if (StyxWoW.Me.Inventory.Equipped.Trinket1 != null && (StyxWoW.Me.Inventory.Equipped.Trinket1.Name.Contains("Medallion of ") || StyxWoW.Me.Inventory.Equipped.Trinket1.Name.Contains("Inherited Insignia")))
            {
                // Check if its off cooldown
                if (StyxWoW.Me.Inventory.Equipped.Trinket1.Cooldown <= 0)
                {
                    StyxWoW.Me.Inventory.Equipped.Trinket1.Use();
                    Log.Write("->Trinket: Used");
                    StyxWoW.SleepForLagDuration();
                    return;
                }
            }

            // Check Second Trinket
            if (StyxWoW.Me.Inventory.Equipped.Trinket2 != null && (StyxWoW.Me.Inventory.Equipped.Trinket2.Name.Contains("Medallion of ") || StyxWoW.Me.Inventory.Equipped.Trinket2.Name.Contains("Inherited Insignia")))
            {
                // Check if its off cooldown
                if (StyxWoW.Me.Inventory.Equipped.Trinket2.Cooldown <= 0)
                {
                    StyxWoW.Me.Inventory.Equipped.Trinket2.Use();
                    Log.Write("->Trinket: Used");
                    StyxWoW.SleepForLagDuration();
                    return;
                }
            }
        }
Пример #2
0
        public override void Initialize()
        {
            if (!Styx.StyxWoW.IsInGame)
            {
                return;
            }
            if (Me.Class != WoWClass.Rogue)
            {
                return;
            }

            // Temp Looting Fix
            BotEvents.Player.OnMobKilled += e =>
            {
                WoWMovement.MoveStop();
                StyxWoW.SleepForLagDuration();
            };

            // Temp Skinning Fix
            BotEvents.Player.OnMobLooted += e =>
            {
                WoWMovement.MoveStop();
                StyxWoW.SleepForLagDuration();
            };

            slog("Indexing Talent Trees");
            Talents = new TalentManager();
            slog("Calculating Talent Trees");
            TalentSpec = Talents.GetSpec();
            slog("Determined " + TalentSpec + " as your spec.");
            _specRefresh.Reset();
            slog("v" + wRogueVersion + " By wired420 Loaded");
            slog("Checking for Updates");
            Update();
        }
Пример #3
0
        private void Bandaging()
        {
            WoWItem bandage = HaveItemCheck(BandageIds);

            if (!Equals(null, bandage) && addsList.Count < 2)
            {
                slog("Bandaging.");
                Lua.DoString("UseItemByName(\"" + bandage.Entry + "\")");
                StyxWoW.SleepForLagDuration();
                Lua.DoString("TargetUnit(\"" + player + "\")");
                uint a = 0;
                while (a < 81)
                {
                    if (addsList[0].HasAura("Gouge") || addsList[0].HasAura("Blind"))
                    {
                        StyxWoW.SleepForLagDuration();
                        ++a;
                    }
                    else
                    {
                        addsList[0].Target();
                        WoWMovement.Face();
                        Lua.DoString("StartAttack()");
                        a = 81;
                    }
                }
            }
            else
            {
                slog("No bandages in backpack.");
            }
        }
Пример #4
0
 private static void flyTo(WoWPoint loc)
 {
     while (_me.Location.Distance(loc) > 2)
     {
         if (Flightor.MountHelper.CanMount && !Flightor.MountHelper.Mounted)
         {
             Flightor.MountHelper.MountUp();
             StyxWoW.SleepForLagDuration();
             Thread.Sleep(1000);
             while (_me.IsCasting)
             {
                 Thread.Sleep(150);
             }
         }
         Flightor.MoveTo(loc);
     }
     Styx.Logic.Pathing.Navigator.FindHeight(loc.X, loc.Y, out _height);
     while (Math.Abs(_me.Location.Z - _height) > 1)
     {
         WoWMovement.Move(WoWMovement.MovementDirection.Descend);
         Thread.Sleep(100);
     }
     Flightor.MountHelper.Dismount();
     while (_me.Location.Distance2D(loc) > 1)
     {
         Navigator.MoveTo(loc);
     }
 }
Пример #5
0
        public static void WaitForStop()
        {
            // excessive attempt to make sure HB doesn't have any cached movement
#if DO_CRAZY_EXCESSIVE_STOP_EVERY_MOVEMENT
            WoWMovement.MoveStop(WoWMovement.MovementDirection.AutoRun);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.Backwards);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.ClickToMove);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.Descend);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.Forward);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.ForwardBackMovement);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.JumpAscend);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.PitchDown);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.PitchUp);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.StrafeLeft);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.StrafeRight);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.TurnLeft);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.TurnRight);
#endif
            WoWMovement.MoveStop(WoWMovement.MovementDirection.All);
            WoWMovement.MoveStop();
            Navigator.PlayerMover.MoveStop();

            do
            {
                StyxWoW.SleepForLagDuration();
            } while (IsGameStable() && Me.CurrentHealth > 1 && Me.IsMoving);
        }
        public void Invisibility()
        {
            string numberofMobs;

            if (UseInvis)
            {
                List <WoWUnit> AddList = ObjectManager.GetObjectsOfType <WoWUnit>(false).FindAll(unit =>
                                                                                                 unit.Guid != Me.Guid &&
                                                                                                 unit.Aggro &&
                                                                                                 !unit.IsFriendly &&
                                                                                                 !unit.IsTotem);

                if (AddList.Count >= InvisAdds && Me.HealthPercent <= InvisHP && SpellManager.CanCast("Invisibility"))
                {
                    numberofMobs = AddList.Count.ToString();
                    Log(string.Format("Have {0} mobs, and am about to die!", numberofMobs));
                    Log("Casting Invisibilty to exit combat.", null);
                    if (Me.GotAlivePet)
                    {
                        Lua.DoString(string.Format("RunMacroText(\"{0}\")", "/PetAbandon()"));
                    }
                    if (Me.IsCasting)
                    {
                        SpellManager.StopCasting(); StyxWoW.SleepForLagDuration();
                    }
                    SpellManager.Cast("Invisibility");
                    Me.ClearTarget();
                    AddList = null;
                    Styx.Logic.POI.BotPoi.Clear("MageHelper exiting combat to save a life.");
                }
            }
        }
Пример #7
0
            private static bool HealingRain(WoWUnit healTarget)
            {
                if (!SpellManager.HasSpell("Healing Rain"))
                {
                    return(false);
                }

                if (_me.ManaPercent < cfg.EmergencyManaPercent && !_me.Auras.ContainsKey("Clearcasting"))
                {
                    return(false);
                }

                if (!WillHealingRainCover(healTarget, 4))
                {
                    return(false);
                }

                if (Safe_CastSpell("Healing Rain", SpellRange.Check, SpellWait.Complete))
                {
                    if (!LegacySpellManager.ClickRemoteLocation(healTarget.Location))
                    {
                        Dlog("^Ranged AoE Click FAILED:  cancelling Healing Rain");
                        SpellManager.StopCasting();
                    }
                    else
                    {
                        Dlog("^Ranged AoE Click successful:  LET IT RAIN!!!");
                        StyxWoW.SleepForLagDuration();
                        return(true);
                    }
                }

                return(false);
            }
Пример #8
0
        protected override Composite CreateBehavior()
        {
            return(_root ?? (_root =
                                 new PrioritySelector(

                                     new Decorator(ret => Counter >= NumOfTimes,
                                                   new Action(ret => _isBehaviorDone = true)),

                                     new Decorator(
                                         ret => Location != WoWPoint.Empty && Location.Distance(StyxWoW.Me.Location) > 2,
                                         new Sequence(
                                             new Action(ret => TreeRoot.StatusText = "Moving to location"),
                                             new Action(ret => Navigator.MoveTo(Location)))),

                                     new Decorator(
                                         ret => StyxWoW.Me.IsMoving,
                                         new Action(ret =>
            {
                Navigator.PlayerMover.MoveStop();
                StyxWoW.SleepForLagDuration();
            })),

                                     new Decorator(
                                         ret => Item != null && Item.Cooldown == 0,
                                         new Action(ret =>
            {
                TreeRoot.StatusText = "Using item - Count: " + Counter;

                Item.UseContainerItem();

                StyxWoW.SleepForLagDuration();
                Counter++;
                Thread.Sleep(WaitTime);
            })))));
        }
Пример #9
0
        public static void WaitForStop()
        {
            // excessive attempt to make sure HB doesn't have any cached movement
            WoWMovement.MoveStop(WoWMovement.MovementDirection.AutoRun);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.Backwards);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.ClickToMove);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.Descend);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.Forward);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.ForwardBackMovement);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.JumpAscend);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.PitchDown);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.PitchUp);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.StrafeLeft);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.StrafeRight);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.TurnLeft);
            WoWMovement.MoveStop(WoWMovement.MovementDirection.TurnRight);

            WoWMovement.MoveStop(WoWMovement.MovementDirection.All);
            WoWMovement.MoveStop();

            do
            {
                StyxWoW.SleepForLagDuration();
            } while (IsGameStable() && Me.CurrentHealth > 1 && Me.IsMoving);
        }
Пример #10
0
 private void HandleMS(object sender, LuaEventArgs args)
 {
     if ((args.Args[0].ToString() == "Hey!  A little help over here!" ||
          args.Args[0].ToString() == "Umm... I think I might need a hand here..." ||
          args.Args[0].ToString() == "If we don't slow down soon, I might pass out." ||
          args.Args[0].ToString() == "Ugh... maybe if you could lightly slap me on the cheek...") && !Me.Dead && Me.QuestLog.GetQuestById(24735) != null && !Me.QuestLog.GetQuestById(24735).IsCompleted&& q24735mob.Count > 0)
     {
         Log("Slap 'da bitch!");
         while (Me.Location.Distance(q24735mob[0].Location) > 5)
         {
             Navigator.MoveTo(q24735mob[0].Location);
         }
         WoWMovement.MoveStop();
         q24735mob[0].Interact();
         StyxWoW.SleepForLagDuration();
     }
     if (args.Args[0].ToString() == "Squire!  Please stand next to me as I request the blessing of this Light-blessed spirit." && !Me.Dead && Me.QuestLog.GetQuestById(24706) != null && !Me.QuestLog.GetQuestById(24706).IsCompleted)
     {
         Log("Let the idiot get his blessing");
         Lua.DoString("PetStopAttack()");
         SpellManager.StopCasting();
         Me.ClearTarget();
         if (!SpellManager.Spells["Freezing Trap"].Cooldown)
         {
             SpellManager.Cast("Freezing Trap");
         }
         Thread.Sleep(10000);
     }
 }
Пример #11
0
 /// <summary>
 ///   Creates a composite to use potions and healthstone.
 /// </summary>
 /// <param name = "healthPercent">Healthpercent to use health potions and healthstone</param>
 /// <param name = "manaPercent">Manapercent to use mana potions</param>
 /// <returns></returns>
 public static Composite CreateUsePotionAndHealthstone(double healthPercent, double manaPercent)
 {
     return(new PrioritySelector(
                new Decorator(
                    ret => StyxWoW.Me.HealthPercent < healthPercent,
                    new PrioritySelector(
                        ctx => FindFirstUsableItemBySpell("Healthstone", "Healing Potion"),
                        new Decorator(
                            ret => ret != null,
                            new Sequence(
                                new Action(ret => Logger.Write(String.Format("Using {0}", ((WoWItem)ret).Name))),
                                new Action(ret => ((WoWItem)ret).UseContainerItem()),
                                new Action(ret => StyxWoW.SleepForLagDuration())))
                        )),
                new Decorator(
                    ret => StyxWoW.Me.ManaPercent < manaPercent,
                    new PrioritySelector(
                        ctx => FindFirstUsableItemBySpell("Restore Mana"),
                        new Decorator(
                            ret => ret != null,
                            new Sequence(
                                new Action(ret => Logger.Write(String.Format("Using {0}", ((WoWItem)ret).Name))),
                                new Action(ret => ((WoWItem)ret).UseContainerItem()),
                                new Action(ret => StyxWoW.SleepForLagDuration())))))
                ));
 }
Пример #12
0
 public Composite CreateHunterBuffs()
 {
     WantedPet = "1";
     return(new PrioritySelector(
                new Decorator(
                    ctx => Me.CastingSpell != null && Me.CastingSpell.Name == "Revive " + WantedPet && Me.GotAlivePet,
                    new Action(ctx => SpellManager.StopCasting())),
                CreateWaitForCast(),
                CreateSpellBuffOnSelf("Aspect of the Hawk"),
                CreateSpellBuffOnSelf("Track Hidden"),
                //new ActionLogMessage(false, "Checking for pet"),
                new Decorator(
                    ret => !Me.GotAlivePet,
                    new Sequence(
                        new Action(ret => PetManager.CallPet(WantedPet)),
                        new Action(ret => Thread.Sleep(1000)),
                        new DecoratorContinue(
                            ret => !Me.GotAlivePet && SpellManager.CanCast("Revive Pet"),
                            new Sequence(
                                new Action(ret => SpellManager.Cast("Revive Pet")),
                                new Action(ret => StyxWoW.SleepForLagDuration()),
                                new WaitContinue(
                                    11,
                                    ret => !Me.IsCasting,
                                    new ActionAlwaysSucceed()))))),
                CreateSpellCast(
                    "Mend Pet",
                    ret =>
                    (Me.Pet.HealthPercent < 70 || (Me.Pet.HappinessPercent < 90 && TalentManager.HasGlyph("Mend Pet"))) && !Me.Pet.HasAura("Mend Pet"))
                ));
 }
Пример #13
0
            private void MoveToHealTarget(WoWUnit unit, double distRange)
            {
                if (!IsUnitInRange(unit, distRange))
                {
                    Slog("MoveToHealTarget:  moving to Heal Target {0} who is {1:F1} yds away", Safe_UnitName(unit), unit.Distance);
                    if (_me.IsCasting)
                    {
                        WaitForCurrentSpell(null);
                    }

                    MoveToUnit(unit);
                    while (!IsGameUnstable() && _me.IsAlive && _me.IsMoving && unit.IsAlive && !IsUnitInRange(unit, distRange) && unit.Distance < 100)
                    {
                        // while running, if someone else needs a heal throw a riptide on them
                        if (SpellManager.HasSpell("Riptide") && SpellManager.CanCast("Riptide"))
                        {
                            WoWPlayer otherTarget = ChooseNextHealTarget(unit, (double)hsm.NeedHeal);
                            if (otherTarget != null)
                            {
                                Slog("MoveToHealTarget:  healing {0} while moving to heal target {1}", Safe_UnitName(otherTarget), Safe_UnitName(unit));
                                Safe_CastSpell(otherTarget, "Riptide", SpellRange.Check, SpellWait.NoWait);
                                StyxWoW.SleepForLagDuration();
                            }
                        }
                    }

                    if (_me.IsMoving)
                    {
                        Safe_StopMoving();
                    }

                    Dlog("MoveToHealTarget: stopping now that Heal Target is {0} yds away", unit.Distance);
                }
            }
        private void ApplyPoisons()
        {
            WoWItem instantPoison   = HaveItemCheck(PoisonInstantEntryIds);
            WoWItem deadlyPoison    = HaveItemCheck(PoisonDeadlyEntryIds);
            WoWItem woundPoison     = HaveItemCheck(PoisonWoundEntryIds);
            WoWItem cripplingPoison = HaveItemCheck(PoisonCripplingEntryIds);

            if (Me.Mounted)
            {
                Mount.Dismount();
            }
            WoWMovement.MoveStop();
            bool needPoisonMainhand, needPoisonOffhand;

            if (IsWeaponEnhanceNeeded(out needPoisonMainhand, out needPoisonOffhand))
            {
                if (needPoisonOffhand && !Equals(null, offHandPoison))
                {
                    slog("Applying poison to offhand weapon: " + Me.Inventory.Equipped.OffHand.Name);
                    Lua.DoString("UseItemByName(\"" + offHandPoison.Entry + "\")");
                    StyxWoW.SleepForLagDuration();
                    Lua.DoString("UseInventoryItem(17)");
                    Thread.Sleep(3100);
                }
                if (needPoisonMainhand && !Equals(null, mainHandPoison))
                {
                    slog("Applying poison to main hand weapon: " + Me.Inventory.Equipped.MainHand.Name);
                    Lua.DoString("UseItemByName(\"" + mainHandPoison.Entry + "\")");
                    StyxWoW.SleepForLagDuration();
                    Lua.DoString("UseInventoryItem(16)");
                    Thread.Sleep(3100);
                }
            }
        }
Пример #15
0
 private void destroyItem(WoWItem item)
 {
     Logging.Write(LogLevel.Normal, Colors.DarkRed, "[{0} {1}]: Destroying {2} we have {3}", this.Name, this.Version, item.Name, item.StackCount);
     item.PickUp();
     Lua.DoString("DeleteCursorItem()");
     StyxWoW.SleepForLagDuration();
 }
Пример #16
0
 protected Composite CreateApplyPoisons()
 {
     return(new PrioritySelector(
                new Decorator(
                    ret => Poisons.MainHandNeedsPoison && Poisons.MainHandPoison != null,
                    new Sequence(
                        new ActionLogMessage(false, () => string.Format("Applying {0} to main hand", Poisons.MainHandPoison.Name)),
                        new Action(ret => Navigator.PlayerMover.MoveStop()),
                        new Action(ret => StyxWoW.SleepForLagDuration()),
                        new Action(ret => Poisons.MainHandPoison.UseContainerItem()),
                        new Action(ret => StyxWoW.SleepForLagDuration()),
                        new Action(ret => Lua.DoString("UseInventoryItem(16)")),
                        new Action(ret => StyxWoW.SleepForLagDuration()),
                        new WaitContinue(10, ret => !StyxWoW.Me.IsCasting, new ActionAlwaysSucceed()),
                        new Action(ret => Thread.Sleep(1000)))),
                new Decorator(
                    ret => Poisons.OffHandNeedsPoison && Poisons.OffHandPoison != null,
                    new Sequence(
                        new ActionLogMessage(false, () => string.Format("Applying {0} to off hand", Poisons.OffHandPoison.Name)),
                        new Action(ret => Navigator.PlayerMover.MoveStop()),
                        new Action(ret => StyxWoW.SleepForLagDuration()),
                        new Action(ret => Poisons.OffHandPoison.UseContainerItem()),
                        new Action(ret => StyxWoW.SleepForLagDuration()),
                        new Action(ret => Lua.DoString("UseInventoryItem(17)")),
                        new Action(ret => StyxWoW.SleepForLagDuration()),
                        new WaitContinue(10, ret => !StyxWoW.Me.IsCasting, new ActionAlwaysSucceed()),
                        new Action(ret => Thread.Sleep(1000))))
                ));
 }
Пример #17
0
 public void UseGameObjectFunc()
 {
     LogMessage("info", "Using ObjectId({0})", ObjectId);
     _objectList[0].Interact();
     StyxWoW.SleepForLagDuration();
     Counter++;
     Thread.Sleep(6000);
 }
Пример #18
0
        public static void DropItem(WoWItem item)
        {
            // Deleting an item is a two step process in wow, I => pick it up  II => delete item on cursor
            item.PickUp(); // use HB api to do the picky upping
            Lua.DoString("DeleteCursorItem()");

            StyxWoW.SleepForLagDuration();
        }
 // Combat for people in Subtlety spec.
 void FinishSub()
 {
     if (!Me.Combat)
     {
         return;
     }
     if (SSSettings.Instance.UseShadowDance)
     {
         if (SpellManager.CanCast("Shadowstep") && SpellManager.CanCast("Shadow Dance") && SpellManager.CanCast("Gouge"))
         {
             Gouge();
             StyxWoW.SleepForLagDuration();
             ShadowDance();
             StyxWoW.SleepForLagDuration();
             Shadowstep();
             StyxWoW.SleepForLagDuration();
             WoWMovement.Face();
             StyxWoW.SleepForLagDuration();
             Ambush();
         }
     }
     if (StyxWoW.Me.ComboPoints > 1 && Me.CurrentTarget.HealthPercent < 20)
     {
         if (SpellManager.CanCast("Eviscerate") && Me.GotTarget && targetDistance <= 5)
         {
             Eviscerate();
         }
     }
     if (StyxWoW.Me.ComboPoints > 3 && Me.CurrentTarget.HealthPercent < 40)
     {
         if (SpellManager.CanCast("Eviscerate") && Me.GotTarget && targetDistance <= 5)
         {
             Eviscerate();
         }
     }
     if (StyxWoW.Me.ComboPoints > 4 && Me.CurrentTarget.HealthPercent < 100)
     {
         if (SpellManager.CanCast("Eviscerate") && Me.GotTarget && targetDistance <= 5)
         {
             Eviscerate();
         }
     }
     if (StyxWoW.Me.ComboPoints < 5)
     {
         if (!SpellManager.HasSpell("Hemorrhage"))
         {
             SinisterStrike();
         }
         if (SpellManager.CanCast("Hemorrhage") && Me.GotTarget && targetDistance <= 5)
         {
             Hemorrhage();
         }
         else
         {
             return;
         }
     }
 }
Пример #20
0
        private static Composite FindTarget(CanRunDecoratorDelegate cond, TargetFilter filter, RefineFilter refineFilter, Comparison <HealableUnit> compare, string label, params Composite[] children)
        {
            return(new Decorator(
                       cond,
                       new Sequence(

                           // get a target
                           new Action(
                               delegate
            {
                var targetPerformanceTimer = new Stopwatch();   // lets see if we can get some performance on this one.
                targetPerformanceTimer.Start();                 // lets see if we can get some performance on this one.

                //CrabbyProfiler.Instance.Runs.Add(new Run("FindTarget"));

                // Nothing to filter against
                if (!UnitsFilter(filter).Any())
                {
                    HealableUnit.HealTarget = null;
                    return RunStatus.Failure;
                }

                // Filter the Healable Units
                var raid = UnitsFilter(filter).Where(x => x != null && (ObjectManager.ObjectList.Any(y => y.Guid == x.ToUnit().Guid) && refineFilter(x)) && x.ToUnit().Distance2DSqr < 40 * 40 && !x.ToUnit().ToPlayer().IsGhost&& !x.ToUnit().HasAura("Deep Corruption")).ToList();

                // Nothing to heal.
                if (!IsPlayingWoW() || !raid.Any())
                {
                    HealableUnit.HealTarget = null;
                    return RunStatus.Failure;
                }

                raid.Sort(compare);
                var target = raid.FirstOrDefault();
                if (target != null)
                {
                    Log(
                        label,
                        CLULogger.SafeName(target.ToUnit()),
                        target.MaxHealth,
                        target.CurrentHealth,
                        target.MaxHealth - target.CurrentHealth,
                        targetPerformanceTimer.ElapsedMilliseconds);                 // lets see if we can get some performance on this one.

                    //target.ToUnit().Target();
                    HealableUnit.HealTarget = target;
                    return RunStatus.Success;
                }
                HealableUnit.HealTarget = null;

                //CrabbyProfiler.Instance.EndLast();
                return RunStatus.Failure;
            }),
                           new Action(a => StyxWoW.SleepForLagDuration()),

                           // if success, keep going. Else quit sub routine
                           new PrioritySelector(children))));
        }
Пример #21
0
        protected override Composite CreateBehavior()
        {
            return(_root ?? (_root =
                                 new PrioritySelector(

                                     new Decorator(ret => Counter >= NumOfTimes,
                                                   new Action(ret => _isBehaviorDone = true)),

                                     new PrioritySelector(
                                         new Decorator(ret => CurrentObject != null && CurrentObject.DistanceSqr > Range * Range,
                                                       new Sequence(
                                                           new Action(delegate { TreeRoot.StatusText = "Moving to use item on \"" + CurrentObject.Name + "\""; }),
                                                           new Action(ret => Navigator.MoveTo(CurrentObject.Location))
                                                           )
                                                       ),

                                         new Decorator(ret => CurrentObject != null && CurrentObject.DistanceSqr <= Range * Range && Item != null && Item.Cooldown == 0,
                                                       new Sequence(
                                                           new DecoratorContinue(ret => StyxWoW.Me.IsMoving,
                                                                                 new Action(ret =>
            {
                WoWMovement.MoveStop();
                StyxWoW.SleepForLagDuration();
            })),

                                                           new Action(ret =>
            {
                bool targeted = false;
                TreeRoot.StatusText = "Using item on \"" + CurrentObject.Name + "\"";
                if (CurrentObject is WoWUnit && (StyxWoW.Me.CurrentTarget == null || StyxWoW.Me.CurrentTarget != CurrentObject))
                {
                    (CurrentObject as WoWUnit).Target();
                    targeted = true;
                    StyxWoW.SleepForLagDuration();
                }

                WoWMovement.Face(CurrentObject.Guid);

                Item.UseContainerItem();
                _npcBlacklist.Add(CurrentObject.Guid);

                StyxWoW.SleepForLagDuration();
                Counter++;
                Thread.Sleep(WaitTime);

                if (targeted)
                {
                    StyxWoW.Me.ClearTarget();
                }
            }))
                                                       ),

                                         new Sequence(
                                             new Action(delegate { TreeRoot.StatusText = "Moving to location " + Location; }),
                                             new Action(ret => Navigator.MoveTo(Location))))
                                     )));
        }
Пример #22
0
 private Composite CreateSpellCastOnLocation(string spellName, LocationRetrievalDelegate onLocation)
 {
     return(new Decorator(
                ret => CanCast(spellName, null, false),
                new Sequence(
                    new Action(ret => CastWithLog(spellName, null)),
                    new Action(ret => StyxWoW.SleepForLagDuration()),
                    new Action(ret => LegacySpellManager.ClickRemoteLocation(onLocation(ret))))));
 }
Пример #23
0
 public static void WaitForDismount()
 {
     while (IsGameStable() && Me.CurrentHealth > 1 && Me.Mounted)
     {
         Lua.DoString("Dismount()");
         // Mount.Dismount();  // HB API forces Stop also, so use LUA to keep running and let Squire or CC stop if needed
         StyxWoW.SleepForLagDuration();
     }
 }
Пример #24
0
 static private void AnitAfk()
 {
     // keep the bot from going afk.
     if (AntiAfkTimer.IsFinished)
     {
         StyxWoW.ResetAfk();
         AntiAfkTimer.Reset();
     }
 }
Пример #25
0
        protected Composite CreateEnsureTarget()
        {
            return
                (new PrioritySelector(
                     new Decorator(
                         ret => NeedTankTargeting && targetingTimer.IsFinished && Me.Combat &&
                         TankTargeting2.Instance.FirstUnit != null && Me.CurrentTarget != TankTargeting2.Instance.FirstUnit,
                         new Action(
                             ret =>
            {
                Logging.WriteDebug("Targeting first unit of TankTargeting");
                TankTargeting2.Instance.FirstUnit.Target();
                StyxWoW.SleepForLagDuration();
                targetingTimer.Reset();
            })),
                     new Decorator(
                         ret => Me.CurrentTarget == null || Me.CurrentTarget.Dead || Me.CurrentTarget.IsFriendly,
                         new PrioritySelector(
                             ctx =>
            {
                if (Me.IsInInstance)
                {
                    return null;
                }
                if (RaFHelper.Leader != null && RaFHelper.Leader.Combat)
                {
                    return RaFHelper.Leader.CurrentTarget;
                }
                if (Targeting.Instance.FirstUnit != null && Me.Combat)
                {
                    return Targeting.Instance.FirstUnit;
                }
                var units =
                    ObjectManager.GetObjectsOfType <WoWUnit>(false, false).Where(
                        p => p.IsHostile && !p.IsOnTransport && !p.Dead && p.DistanceSqr <= 70 * 70 && p.Combat);

                if (Me.Combat && units.Any())
                {
                    return units.OrderBy(u => u.DistanceSqr).FirstOrDefault();
                }

                return null;
            },
                             new Decorator(
                                 ret => ret != null,
                                 new Sequence(
                                     new Action(ret => Logging.Write("Target is invalid. Switching to " + Extensions.SafeName((WoWUnit)ret) + "!")),
                                     new Action(ret => ((WoWUnit)ret).Target()))),
                             new Decorator(
                                 ret => Me.CurrentTarget != null,
                                 new Action(
                                     ret =>
            {
                Me.ClearTarget();
                return RunStatus.Failure;
            }))))));
        }
Пример #26
0
        public static void Mailspell()
        {
            Logging.Write(Color.Blue, "Moving to Mailbox");
            if (mailboxLoc.X != 0f && mailboxLoc.Y != 0f && mailboxLoc.Z != 0f)
            {
                Styx.Logic.Mount.MountUp();
                while (!ObjectManager.Me.Combat && mailboxLoc.Distance(ObjectManager.Me.Location) > 5)
                {
                    Navigator.MoveTo(mailboxLoc);
                    Thread.Sleep(100);
                }
            }
            ObjectManager.Update();
            List <WoWGameObject> gObjList    = ObjectManager.GetObjectsOfType <WoWGameObject>();
            List <WoWGameObject> mailboxList = new List <WoWGameObject>();

            foreach (WoWGameObject o in gObjList)
            {
                if (o.SubType == WoWGameObjectType.Mailbox)
                {
                    mailboxList.Add(o);
                }
            }
            if (mailboxList.Count != 0)
            {
                mailboxList.Sort((p1, p2) => p1.Location.Distance(ObjectManager.Me.Location).CompareTo(p2.Location.Distance(ObjectManager.Me.Location)));
                if (mailboxList[0].Distance > 50)
                {
                    Styx.Logic.Mount.MountUp();
                }
                while (!ObjectManager.Me.Combat && mailboxList[0].Distance > 5)
                {
                    Navigator.MoveTo(mailboxList[0].Location);
                    Thread.Sleep(100);
                }
                mailboxList[0].Interact();
                Thread.Sleep(2500);
                int mailCount = mailFrame.MailCount;
                int i         = mailCount;
                Logging.Write("[Mail]:I Have {0} Mail", i);
                Logging.Write("[Mail]:Looting Mail");
                while (ObjectManager.Me.FreeNormalBagSlots >= 10 && i >= 1)

                {
                    StyxWoW.SleepForLagDuration();
                    Lua.DoString("TakeInboxItem(" + i.ToString() + ")");
                    i--;

                    if (ObjectManager.Me.FreeNormalBagSlots < 10 || mailCount < 1)
                    {
                        mailFrame.Close();
                        break;
                    }
                }
            }
        }
Пример #27
0
        protected override Composite CreateBehavior()
        {
            return(_root ?? (_root =
                                 new PrioritySelector(ret => _npcResults.Count != 0 ? _npcResults.Peek() : null,

                                                      new Decorator(ret => ret == null,
                                                                    new Action(ret => _isBehaviorDone = true)),

                                                      // Move to it if we are too far away.
                                                      new Decorator(ret => ret is NpcResult && ((NpcResult)ret).Location.Distance(StyxWoW.Me.Location) > 3,
                                                                    new Sequence(
                                                                        new Action(ret => TreeRoot.StatusText = "Moving towards - " + ((NpcResult)ret).Location),
                                                                        new Action(ret => Navigator.MoveTo(((NpcResult)ret).Location)))
                                                                    )
                                                      ,

                                                      new Sequence(ret => ObjectManager.GetObjectsOfType <WoWUnit>().FirstOrDefault(unit => unit.Entry == ((NpcResult)ret).Entry),
                                                                   new DecoratorContinue(ret => ret != null,
                                                                                         new Sequence(

                                                                                             new DecoratorContinue(ret => StyxWoW.Me.IsMoving,
                                                                                                                   new Action(ret =>
            {
                WoWMovement.MoveStop();
                StyxWoW.SleepForLagDuration();
            })
                                                                                                                   ),

                                                                                             new DecoratorContinue(ret => !GossipFrame.Instance.IsVisible,
                                                                                                                   new Sequence(
                                                                                                                       new Action(ret => TreeRoot.StatusText = "Interacting with - " + ((WoWUnit)ret).Name),
                                                                                                                       new Action(ret => ((WoWUnit)ret).Interact()))
                                                                                                                   ),

                                                                                             new WaitContinue(3, ret => !GossipFrame.Instance.IsVisible,
                                                                                                              new Sequence(
                                                                                                                  new Action(ret => TreeRoot.StatusText = "Clicking thru gossip"),
                                                                                                                  new Action(delegate
            {
                Lua.DoString("GossipTitleButton1:Click()");
                Thread.Sleep(1500);

                if (GossipFrame.Instance.IsVisible)
                {
                    return RunStatus.Running;
                }

                _npcResults.Dequeue();
                return RunStatus.Success;
            })
                                                                                                                  ))

                                                                                             )))
                                                      )));
        }
Пример #28
0
        public Composite CreateCombatRogueCombat()
        {
            return(new PrioritySelector
                   (
                       CreateEnsureTarget(),
                       // Make sure we're in range, and facing the damned target. (LOS check as well)
                       CreateAutoAttack(false),
                       CreateMoveToAndFace(5f, ret => Me.CurrentTarget),
                       // Kick/Defensive cooldowns/Recuperation
                       CreateCombatRogueDefense(),
                       // Redirect if we have CP left
                       CreateSpellCast(
                           "Redirect", ret => Me.RawComboPoints > 0 &&
                           Me.ComboPoints < 1),

                       // CP generators, put em at start, since they're strictly conditional
                       // and will help burning energy on Adrenaline Rush
                       new Decorator(
                           ret => (NearbyUnfriendlyUnits.Count(u => u.DistanceSqr < 6 * 6) <= 1 ||
                                   NearbyUnfriendlyUnits.Any(u => u.DistanceSqr < 6 * 6 && u.HasAura("Blind"))) && Me.HasAura("Blade Flurry"),
                           new Sequence(
                               new Action(ret => Lua.DoString("RunMacroText(\"/cancelaura Blade Flurry\")")),
                               new Action(ret => StyxWoW.SleepForLagDuration()))),
                       CreateRogueBlindOnAddBehavior(),
                       CreateSpellCast("Blade Flurry", ret => !NearbyUnfriendlyUnits.Any(u => u.HasAura("Blind")) && NearbyUnfriendlyUnits.Count(u => u.DistanceSqr < 6 * 6) > 1),
                       CreateSpellCast("Eviscerate", ret => !CurrentTargetIsElite && Me.CurrentTarget.HealthPercent <= 40 && Me.ComboPoints > 2),
                       // Always keep Slice and Dice up
                       CreateSpellBuffOnSelf("Slice and Dice", ret => Me.RawComboPoints > 0),
                       // Sinister Strike till 4 CP
                       CreateSpellCast("Sinister Strike", ret => Me.ComboPoints < 4),
                       // Revealing Strike if we're at 4 CP and target does not have it already
                       CreateSpellBuff("Revealing Strike", ret => Me.ComboPoints > 3 && Me.ComboPoints < 5),
                       //
                       // Cooldowns:

                       CreateSpellBuffOnSelf("Adrenaline Rush", ret => Me.CurrentEnergy < 20),
                       // Killing Spree if we are at highest level of Bandit's Guise ( Shallow Insight / Moderate Insight / Deep Insight )
                       CreateSpellCast("Killing Spree", ret => Me.CurrentEnergy < 30 && Me.HasAura("Deep Insight")),
                       // Finishers:
                       new Decorator(
                           ret => Me.ComboPoints > 4,
                           new PrioritySelector(
                               // wait out low SnD duration to cast it at it's finish
                               // through not casting other finishers meanwhile and launching SnD below 1 sec duration
                               new Decorator(
                                   ret => Me.Auras["Slice and Dice"].TimeLeft.TotalSeconds > 5 ||
                                   Me.CurrentEnergy > 85,
                                   new PrioritySelector(
                                       // Check for >our own< Rupture debuff on target since there may be more rogues in party/raid!
                                       CreateSpellCast(
                                           "Rupture", ret => !Me.CurrentTarget.GetAllAuras().Any(a => a.Name == "Rupture" && a.CreatorGuid == Me.Guid)),
                                       CreateSpellCast("Eviscerate"))),
                               CreateSpellCast("Slice and Dice", ret => Me.Auras["Slice and Dice"].TimeLeft.TotalSeconds < 0.9)))));
        }
Пример #29
0
        private RunStatus AimAngle()
        {
            double angleAdjust = GetAimAdjustment();

            Dlog("(Aim Angle) adjusting current angle {0} by {1} to {2}", GetAimAngle(), angleAdjust, AIM_ANGLE);

            Lua.DoString("VehicleAimDecrement({0})", angleAdjust);

            StyxWoW.SleepForLagDuration();
            return(RunStatus.Success);
        }
Пример #30
0
        private void useItem(WoWItem item)
        {
            Logging.Write(LogLevel.Normal, Colors.DarkRed, "[{0} {1}]: Using {2} we have {3}", this.Name, this.Version, item.Name, item.StackCount);
            if (_itemRequiresSleep.Contains(item.Entry))
            {
// some (soulbound) items require an additional sleep to prevent a loot bug
                StyxWoW.SleepForLagDuration();
            }
            Lua.DoString("UseItemByName(\"" + item.Name + "\")");
            StyxWoW.SleepForLagDuration();
        }