Ejemplo n.º 1
0
 public async Task workWithRes(WoWObject obj)
 {
     /*if (Me.IsGroupLeader)
      * {
      *  if (!(PartyMemberNear(obj.InteractRange)) && (obj.Distance <= 6))
      *      //Navigator.MoveTo(obj.Location);
      *      WoWMovement.ClickToMove(obj.Location);
      * }
      * else
      * {*/
     if (obj.WithinInteractRange)
     {
         Log("sind in der nähe");
         if (PartyMemberNear(obj.InteractRange))
         {
             Log("alle members hier");
             obj.Interact();
         }
     }
     else
     {
         Log("nicht in der nähe vom stoff");
         Navigator.MoveTo(obj.Location);
         //WoWMovement.ClickToMove(obj.Location);
     }
 }
        void MoveToBanker()
        {
            WoWPoint  movetoPoint = _loc;
            WoWObject bank        = GetLocalBanker();

            if (bank != null)
            {
                movetoPoint = WoWMathHelper.CalculatePointFrom(Me.Location, bank.Location, 4);
            }
            // search the database
            else if (movetoPoint == WoWPoint.Zero)
            {
                movetoPoint = MoveToAction.GetLocationFromDB(Bank == BankType.Personal ?
                                                             MoveToAction.MoveToType.NearestBanker : MoveToAction.MoveToType.NearestGB, NpcEntry);
            }
            if (movetoPoint == WoWPoint.Zero)
            {
                IsDone = true;
                Professionbuddy.Err("Unable to find bank");
            }
            if (movetoPoint.Distance(ObjectManager.Me.Location) > 4)
            {
                Util.MoveTo(movetoPoint);
            }
            // since there are many personal bank replacement addons I can't just check if frame is open and be generic.. using events isn't reliable
            else if (bank != null)
            {
                bank.Interact();
            }
            else
            {
                IsDone = true;
                Logging.Write(System.Drawing.Color.Red, "Unable to find a banker at location. aborting");
            }
        }
Ejemplo n.º 3
0
 public void Interact()
 {
     if (!IsValid)
     {
         return;
     }
     RefWoWObject.Interact();
     InteractionAttempts++;
 }
Ejemplo n.º 4
0
 protected override RunStatus Run(object context)
 {
     if (!IsDone)
     {
         WoWObject obj = null;
         if (InteractType == InteractActionType.NPC)
         {
             if (Entry != 0)
             {
                 obj =
                     ObjectManager.GetObjectsOfType <WoWUnit>().Where(u => u.Entry == Entry).OrderBy(
                         u => u.Distance).FirstOrDefault();
             }
             else if (ObjectManager.Me.GotTarget)
             {
                 obj = ObjectManager.Me.CurrentTarget;
             }
         }
         else if (InteractType == InteractActionType.GameObject)
         {
             obj =
                 ObjectManager.GetObjectsOfType <WoWGameObject>().OrderBy(u => u.Distance).FirstOrDefault(
                     u => (Entry > 0 && u.Entry == Entry) || (u.SubType == GameObjectType &&
                                                              (GameObjectType != WoWGameObjectType.SpellFocus ||
                                                               (GameObjectType == WoWGameObjectType.SpellFocus &&
                                                                u.SpellFocus == SpellFocus))));
         }
         if (obj != null)
         {
             WoWPoint moveToLoc = WoWMathHelper.CalculatePointFrom(Me.Location, obj.Location, 3);
             if (moveToLoc.Distance(Me.Location) > 4)
             {
                 Util.MoveTo(moveToLoc);
             }
             else
             {
                 if (InteractDelay > 0 &&
                     (!_interactSw.IsRunning || _interactSw.ElapsedMilliseconds < InteractDelay))
                 {
                     _interactSw.Start();
                 }
                 else
                 {
                     _interactSw.Reset();
                     obj.Interact();
                     IsDone = true;
                 }
             }
         }
         if (!IsDone)
         {
             return(RunStatus.Success);
         }
         Professionbuddy.Log("InteractAction complete");
     }
     return(RunStatus.Failure);
 }
        protected override Composite CreateBehavior()
        {
            return(_root ?? (_root =
                                 new PrioritySelector(



                                     // Move to the gameobject if it isn't null and we aren't withing interact range.
                                     new Decorator(ret => GameObject != null && !GameObject.WithinInteractRange && MoveTimer.ElapsedMilliseconds > 30 * 1000,
                                                   new Sequence(
                                                       new Action(ret => ObjBlacklist.Add(GameObject.Guid)),
                                                       new Action(ret => MoveTimer.Reset())
                                                       )
                                                   ),
                                     new Decorator(ret => GameObject != null && !GameObject.WithinInteractRange,
                                                   new Sequence(
                                                       new Action(ret => TreeRoot.StatusText = "movetimer " + MoveTimer.ElapsedMilliseconds / 1000 + " Moving to interact with gameobject: " + GameObject.Name),
                                                       new Action(ret => TreeRoot.GoalText = "Use Gameobject: " + GameObject.Name),
                                                       new Action(ret => WoWMovement.ClickToMove(GameObject.Location)),
                                                       new Action(ret => MoveTimer.Start())
                                                       )
                                                   ),

                                     // Interact etc.
                                     new Decorator(ret => GameObject != null && GameObject.WithinInteractRange,
                                                   // Set the context to the gameobject
                                                   new Sequence(ret => GameObject,

                                                                new DecoratorContinue(ret => StyxWoW.Me.IsMoving,
                                                                                      new Sequence(
                                                                                          new Action(ret => WoWMovement.MoveStop()),
                                                                                          new WaitContinue(5, ret => !StyxWoW.Me.IsMoving,
                                                                                                           null)
                                                                                          )),
                                                                new Action(ret => MoveTimer.Reset()),
                                                                new Action(ret => Logging.Write("Using Object [{0}] {1} Times out of {2}", GameObject.Name, _counter + 1, NumOfTimes)),
                                                                new Action(ret => GameObject.Interact()),
                                                                new Action(ret => StyxWoW.SleepForLagDuration()),
                                                                new Action(ret => ObjBlacklist.Add(GameObject.Guid)),
                                                                new Action(ret => Thread.Sleep(WaitTime)),
                                                                new Action(delegate { _counter++; })
                                                                )),

                                     new Decorator(ret => Location != WoWPoint.Empty && GameObject == null,
                                                   new Sequence(
                                                       new Action(ret => TreeRoot.StatusText = "Moving to interact with gameobject"),
                                                       new Action(ret => TreeRoot.GoalText = "Use Gameobject"),
                                                       new Action(ret => WoWMovement.ClickToMove(Location))
                                                       )
                                                   )
                                     )));
        }
        protected override Composite CreateBehavior()
        {
            return(_root ?? (_root =
                                 new PrioritySelector(

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

                                     new PrioritySelector(

                                         new Decorator(ret => CurrentObject != null && !CurrentObject.WithinInteractRange,
                                                       new Sequence(
                                                           new Action(delegate { TreeRoot.StatusText = "Moving to interact with - " + CurrentObject.Name; }),
                                                           new Action(ret => Navigator.MoveTo(CurrentObject.Location))
                                                           )
                                                       ),

                                         new Decorator(ret => CurrentObject != null && CurrentObject.WithinInteractRange,
                                                       new Sequence(
                                                           new DecoratorContinue(ret => StyxWoW.Me.IsMoving,
                                                                                 new Action(delegate
            {
                WoWMovement.MoveStop();
                StyxWoW.SleepForLagDuration();
            })),

                                                           new Action(delegate
            {
                TreeRoot.StatusText = "Interacting with - " + CurrentObject.Name;
                CurrentObject.Interact();
                _npcBlacklist.Add(CurrentObject.Guid);

                StyxWoW.SleepForLagDuration();
                Counter++;
                Thread.Sleep(3000);
            }))
                                                       ),

                                         new Sequence(
                                             new Action(delegate { Counter++; })
                                             )
                                         )
                                     )));
        }
Ejemplo n.º 7
0
        private void MoveToBanker()
        {
            WoWPoint  movetoPoint = _loc;
            WoWObject bank        = GetLocalBanker();

            if (bank != null)
            {
                movetoPoint = WoWMathHelper.CalculatePointFrom(Me.Location, bank.Location, 4);
            }
            // search the database
            else if (movetoPoint == WoWPoint.Zero)
            {
                movetoPoint = MoveToAction.GetLocationFromDB(
                    Bank == BankType.Personal
                                                ? MoveToAction.MoveToType.NearestBanker
                                                : MoveToAction.MoveToType.NearestGB,
                    NpcEntry);
            }
            if (movetoPoint == WoWPoint.Zero)
            {
                IsDone = true;
                PBLog.Warn("Unable to find bank");
            }
            if (movetoPoint.Distance(StyxWoW.Me.Location) > 4)
            {
                Util.MoveTo(movetoPoint);
            }
            // since there are many personal bank replacement addons I can't just check if frame is open and be generic.. using events isn't reliable
            else if (bank != null)
            {
                bank.Interact();
            }
            else
            {
                IsDone = true;
                PBLog.Warn(Strings["Error_UnableToFindBank"]);
            }
        }
Ejemplo n.º 8
0
        public static async Task <bool> Interact(WoWObject selectedTarget, System.Action actionOnSuccessfulItemUseDelegate = null)
        {
            // Viable target?
            // NB: Since target may go invalid immediately upon interacting with it,
            // we cache its name for use in subsequent log entries.
            if (!Query.IsViable(selectedTarget))
            {
                QBCLog.Warning("Target is not viable!");
                return(false);
            }

            var targetName = selectedTarget.SafeName;

            // Need to be facing target...
            // NB: Not all items require this, but many do.
            Utility.Target(selectedTarget, true);

            // Notify user of intent...
            QBCLog.DeveloperInfo("Interacting with '{0}'", targetName);

            // Set up 'interrupted use' detection, and interact...
            using (var castMonitor = SpellCastMonitor.Start(null))
            {
                selectedTarget.Interact();

                // NB: The target may not be valid after this point...
                // Some targets will go 'invalid' immediately afer interacting with them.
                // Most of the time this happens, the target is immediately and invisibly replaced with
                // an identical looking target with a different script.
                // We must assume our target is no longer available for use after this point.
                await Coroutine.Sleep(Delay.AfterInteraction);

                // Wait for any casting to complete...
                // NB: Some interactions or item usages take time, and the WoWclient models this as spellcasting.
                // NB: We can't test for IsCasting or IsChanneling--we must instead look for a valid spell being cast.
                //      There are some quests that require actions where the WoWclient returns 'true' for IsCasting,
                //      but there is no valid spell being cast.  We want the behavior to move on immediately in these
                //      conditions.  An example of such an interaction is removing 'tangler' vines in the Tillers
                //      daily quest area.
                var castResult = await castMonitor.GetResult();

                if (castResult != SpellCastResult.Succeeded && castResult != SpellCastResult.NoCastStarted)
                {
                    string reason = castResult == SpellCastResult.UnknownFail
                        ? castMonitor.FailReason
                        : castResult.ToString();

                    QBCLog.DeveloperInfo("Interaction with {0} interrupted.", targetName);

                    QBCLog.Warning("Interaction with {0} interrupted. Reason: {1}", targetName, reason);
                    // Give whatever issue encountered a chance to settle...
                    // NB: --we want the Sequence to fail when delay completes.
                    if (castResult != SpellCastResult.LineOfSight &&
                        castResult != SpellCastResult.OutOfRange &&
                        castResult != SpellCastResult.TooClose)
                    {
                        await Coroutine.Sleep(1500);
                    }
                    return(false);
                }

                QBCLog.DeveloperInfo("Interact with '{0}' succeeded.", targetName);
                if (actionOnSuccessfulItemUseDelegate != null)
                {
                    actionOnSuccessfulItemUseDelegate();
                }

                return(true);
            }
        }
Ejemplo n.º 9
0
        /// <summary>Gossips with the specified wow object. Hearthstone bind popups are automatically accepted</summary>
        /// <param name="wowObject">The wow object. Navigates to <paramref name="searchLocation" /> null </param>
        /// <param name="searchLocation">The search location of <paramref name="wowObject" />.</param>
        /// <param name="movementBy">The movement type to use.</param>
        /// <param name="navigationFailedAction">
        ///     The action to take if <paramref name="wowObject" /> or <paramref name="searchLocation"/> cant be navigated to
        /// </param>
        /// <param name="notFoundAction">
        ///     The action to take if <paramref name="wowObject" /> is not found at
        ///     <paramref name="searchLocation" />.
        /// </param>
        /// <param name="noGossipFrameAction">
        ///     The action to take if interaction with <paramref name="wowObject" /> didn't open a
        ///     gossip frame.
        /// </param>
        /// <param name="noMatchingGossipOptionAction">
        ///     <para>The action to take if the passed in gossip type and/or gossip indices </para>
        ///     <para>doesn't match what was offered by <paramref name="wowObject" />.</para>
        /// </param>
        /// <param name="gossipEntryType">
        ///     <para>Type gossip entry type to select. Ignored if set to Unknown.</para>
        ///		<para>If none of this type are found on current page then</para>
        ///     <para> normal gossip types are clicked through in hopes of ending on a page with this gossip type</para>
        /// </param>
        /// <param name="gossipIndexes">
        ///     The gossip indexes to follow through. Has precedence over
        ///     <paramref name="gossipEntryType" />.
        /// </param>
        /// <exception cref="Exception">A delegate callback throws an exception.</exception>
        public static async Task <bool> Gossip(
            WoWObject wowObject,
            WoWPoint searchLocation,
            MovementByType movementBy                   = MovementByType.FlightorPreferred,
            Action navigationFailedAction               = null,
            Action notFoundAction                       = null,
            Action noGossipFrameAction                  = null,
            Action noMatchingGossipOptionAction         = null,
            GossipEntry.GossipEntryType gossipEntryType = GossipEntry.GossipEntryType.Unknown,
            params int[] gossipIndexes)
        {
            if (wowObject == null)
            {
                if (!Navigator.AtLocation(searchLocation))
                {
                    if (await MoveTo(searchLocation, "Gossip object search area", movementBy))
                    {
                        return(true);
                    }

                    navigationFailedAction?.Invoke();
                    return(false);
                }

                if (notFoundAction != null)
                {
                    notFoundAction();
                }
                else
                {
                    TreeRoot.StatusText = "Waiting for the WoW object selected for gossip to spawn";
                }
                return(true);
            }

            if (!wowObject.WithinInteractRange)
            {
                if (await MoveTo(wowObject.Location, wowObject.SafeName, movementBy))
                {
                    return(true);
                }

                navigationFailedAction?.Invoke();
                return(false);
            }

            if (await CommonCoroutines.Dismount("Gossiping with " + wowObject.SafeName))
            {
                await Coroutine.Sleep(Delay.BeforeButtonClick);
            }

            // If gossip frame is open then we must assume that it doesn't belong to the selected gossip object at this point
            if (GossipFrame.Instance.IsVisible)
            {
                GossipFrame.Instance.Close();
                return(true);
            }

            Func <bool> isFrameReadyForInput =
                () =>
                GossipFrame.Instance.IsVisible &&
                (GossipFrame.Instance.GossipOptionEntries != null ||
                 (!gossipIndexes.Any() && gossipEntryType == GossipEntry.GossipEntryType.Unknown));

            wowObject.Interact();
            var openedGossipFrame = await Coroutine.Wait(3000, isFrameReadyForInput);

            if (!openedGossipFrame)
            {
                QBCLog.Warning("No gossip frame was opened after interacting with {0}", wowObject.SafeName);
                noGossipFrameAction?.Invoke();

                return(false);
            }

            int gossipPage = 1;

            // Click through all the gossip indices
            for (var i = 0; i < gossipIndexes.Length; i++)
            {
                var index = gossipIndexes[i] - 1;

                var gossipEntry =
                    GossipFrame.Instance.GossipOptionEntries.Where(g => g.Index == index)
                    .Select(g => (GossipEntry?)g)
                    .FirstOrDefault();

                if (!gossipEntry.HasValue || gossipEntry.Value.Type == GossipEntry.GossipEntryType.Unknown)
                {
                    QBCLog.Warning("{0} does not provide a gossip at index {1} on page {2}", wowObject.SafeName, index + 1, gossipPage);
                    noMatchingGossipOptionAction?.Invoke();
                    return(false);
                }

                await ClickGossipOption(gossipEntry.Value, gossipPage);

                // make sure frame didn't close before we're done.
                if (!isFrameReadyForInput() && (i < gossipIndexes.Length - 1 || gossipEntryType != GossipEntry.GossipEntryType.Unknown))
                {
                    // This can happen if some external event causes object to stop offering gossip frame, such as NPC getting into combat.
                    // Usually this can be fixed by interacting with object again at a later time. We let the caller handle this.
                    QBCLog.Warning("Gossip frame for {0} closed unexpectedly.", wowObject.SafeName);
                    return(true);
                }
                gossipPage++;
            }

            if (gossipEntryType != GossipEntry.GossipEntryType.Unknown)
            {
                if (!gossipIndexes.Any())
                {
                    while (true)
                    {
                        var gossipEntry = GossipFrame.Instance.GossipOptionEntries.FirstOrDefault(g => g.Type == gossipEntryType);
                        // If no gossip indices were specified then we just click through more gossip,
                        // hopefully it leads to the final gossip type
                        if (gossipEntry.Type != gossipEntryType)
                        {
                            gossipEntry =
                                GossipFrame.Instance.GossipOptionEntries.FirstOrDefault(g => g.Type == GossipEntry.GossipEntryType.Gossip);
                        }

                        if (gossipEntry.Type == GossipEntry.GossipEntryType.Unknown)
                        {
                            QBCLog.Warning("{0} does not provide a {0} gossip type", wowObject.SafeName, gossipEntryType);
                            noMatchingGossipOptionAction?.Invoke();
                            return(false);
                        }

                        await ClickGossipOption(gossipEntry, gossipPage);

                        if (!isFrameReadyForInput() && gossipEntry.Type != gossipEntryType)
                        {
                            // This can happen if some external event causes object to stop offering gossip frame, such as NPC getting into combat.
                            // Usually this can be fixed by interacting with object again at a later time. We let the caller handle this.
                            QBCLog.Warning("Gossip frame for {0} closed unexpectedly.", wowObject.SafeName);
                            return(true);
                        }

                        if (gossipEntry.Type == gossipEntryType)
                        {
                            break;
                        }

                        gossipPage++;
                    }
                }
            }

            // Set hearthstone automatically
            const string setHsPopupName = "CONFIRM_BINDER";

            if (Lua.GetReturnVal <bool>($"return StaticPopup_Visible('{setHsPopupName}')", 0))
            {
                uint hsId = StyxWoW.Me.HearthstoneAreaId;
                Lua.DoString(
                    $"local _,frame = StaticPopup_Visible('{setHsPopupName}') if frame then StaticPopup_OnClick(frame, 1) end");

                if (await Coroutine.Wait(5000, () => StyxWoW.Me.HearthstoneAreaId != hsId))
                {
                    await CommonCoroutines.SleepForRandomReactionTime();

                    var boundLocation = Lua.GetReturnVal <string>("return GetBindLocation()", 0);

                    QBCLog.Info(
                        "You are now bound at {0} Inn in {1}({2})",
                        (Query.IsViable(wowObject) ? wowObject.SafeName : "the"),
                        boundLocation,
                        Me.HearthstoneAreaId);
                }
            }
            return(true);
        }
        public override void Pulse()
        {
            #region pulsechecks
            if (!TreeRoot.IsRunning)
            {
                return;
            }
            if (Me.Combat && !Me.GotTarget)
            {
                GetClosestLiveUnitByID(24978).Target();
            }
            if (Me.Combat || Me.Dead || Me.IsGhost || Me.IsResting)
            {
                return;
            }
            #endregion
            QuestlistUpdate();
            //Logging.WriteDebug(TreeRoot.GoalText);
            if (TreeRoot.GoalText == "Goal: Kill Sunwell - Quest Bunny - Poratl x 1")
            {
                TreeRoot.GoalText = "DHX Goal: Take Poratl Reading";
            }
            if (TreeRoot.GoalText == "Goal: Kill Sunwell - Quest Bunny - Sunwell x 1")
            {
                TreeRoot.GoalText = "DHX Goal: Take BloodCrystal Reading";
            }
            if (TreeRoot.GoalText == "Goal: Kill Sunwell - Quest Bunny - Shrine x 1")
            {
                TreeRoot.GoalText = "DHX Goal: Take Shrine Reading";
            }
            if (TreeRoot.GoalText == "Goal: Kill mob with ID 25086 10 times")
            {
                TreeRoot.GoalText = "DHX Goal: Free 10 Greengill Slaves";
            }
            #region looting fix
            List <WoWUnit> LootMobList = ObjectManager.GetObjectsOfType <WoWUnit>();
            if (!StyxWoW.Me.Combat)
            {
                foreach (WoWUnit unit in LootMobList)
                {
                    if (!unit.IsAlive && unit.CanLoot)
                    {
                        while (StyxWoW.Me.Location.Distance(unit.Location) > 4 || unit.CanLoot)
                        {
                            try
                            {
                                WoWMovement.ClickToMove(unit.Location);
                            }
                            catch { }
                            if (StyxWoW.Me.Location.Distance(unit.Location) <= 4)
                            {
                                try
                                {
                                    if (unit.CanLoot)
                                    {
                                        unit.Interact();
                                        Styx.Logic.Inventory.Frames.LootFrame.LootFrame.Instance.LootAll();
                                        LootMobList.Remove(unit);
                                    }
                                    else if (unit.CanLoot)
                                    {
                                        while (unit.CanLoot)
                                        {
                                            unit.Interact();
                                            Styx.Logic.Inventory.Frames.LootFrame.LootFrame.Instance.LootAll();
                                        }
                                        LootMobList.Remove(unit);
                                    }
                                }
                                catch { }
                            }
                        }
                    }
                }
            }
            if (!StyxWoW.Me.GotTarget && !StyxWoW.Me.Combat && Styx.Logic.LootTargeting.Instance.LootingList.Count == 0)
            {
                LootMobList.Clear();
            }
            #endregion
            #region bloodberry bush loot reliability
            WoWObject bloddberrybush = GetClosestObjectByID(187333);
            if (bloddberrybush != null)
            {
                if (bloddberrybush.Distance < 5 && !Me.Combat)
                {
                    bloddberrybush.Interact();
                }
            }
            #endregion
            #region emissary of hate
            if (InvChkByID(34414))
            {
                if (Me.CanLoot || Me.Looting)
                {
                    return;
                }
                WoWUnit emissary = GetUnitByID(25003);
                if (emissary != null)
                {
                    if (emissary.Dead && emissary.Distance < 10)
                    {
                        useItemByID(34414);
                    }
                }
            }
            #endregion
            #region dont stop now
            ObjectManager.Update();
            while (KeyChkByID(34477) && InvTotalByID(34479) < 3 && IsQuestCompleted(11547))
            {
                Logging.WriteDebug("found key");
                WoWObject orechest = GetClosestObjectByID(187264);
                if (orechest != null)
                {
                    Logging.WriteDebug("found chest");
                    while (orechest.Distance > 3)
                    {
                        if (Me.Combat || Me.Dead || Me.IsGhost)
                        {
                            return;
                        }
                        Navigator.MoveTo(orechest.Location);
                        if (orechest.Distance < 5)
                        {
                            Navigator.Clear(); WoWMovement.MoveStop();
                            orechest.Interact();
                            Thread.Sleep(3000);
                        }
                        ObjectManager.Update();
                        return;
                    }
                }
            }
            while (!IsQuestCompleted(11536) && TreeRoot.GoalText == "Goal: Collect Darkspine Iron Ore x 3" && !KeyChkByID(34477))
            {
                if (Me.Combat || Me.Dead || Me.IsGhost)
                {
                    return;
                }
                WoWUnit oretarget = GetClosestLiveUnitByID(25060);
                oretarget.Target();
                oretarget.Face();
                Me.ToggleAttack();
                if (oretarget.Distance > 5)
                {
                    Navigator.MoveTo(oretarget.Location);
                }
            }
            #endregion
            #region pay 10 gold
            if (SSQuestIDList.Contains(11548))
            {
                Lua.DoString("StaticPopup1Button1:Click()");
            }
            #endregion

            #region greengill
            if (Me.CanLoot || Me.Looting)
            {
                return;
            }
            if (InvChkByID(34483))
            {
                WoWUnit greengilltarget = GetClosestUnitByID(25084);
                if (greengilltarget != null)
                {
                    if (greengilltarget.Distance < 36)
                    {
                        useItemByID(34483);
                        Styx.Logic.Combat.SpellManager.ClickRemoteLocation(greengilltarget.Location);
                        Thread.Sleep(4000);
                    }
                }
            }
            #endregion
            if (InvTotalByID(34338) >= 4)
            {
                arms1 = true;
            }
            #region turnin Arm the Wards
            if ((TreeRoot.GoalText == "Goal: Collect Mana Remnants x 4" || TreeRoot.GoalText == "Goal: TurnIn Arm the Wards!") && IsQuestCompleted(11523) && SSQuestIDList.Contains(11523) && !SSCompQuests.Contains(11523))
            {
                bool     handindone = false;
                WoWPoint armsgoto   = new WoWPoint(12892.95, -6880.174, 9.040649);
                while (armsgoto.Distance(Me.Location) > 0 || !handindone)
                {
                    if (TreeRoot.GoalText != "Goal: TurnIn Arm the Wards!")
                    {
                        TreeRoot.GoalText = "Goal: TurnIn Arm the Wards!";
                    }
                    Navigator.MoveTo(armsgoto);
                    while (armsgoto.Distance(Me.Location) < 3 && !handindone)
                    {
                        Navigator.Clear();
                        WoWMovement.MoveStop();
                        GetUnitByID(24967).Interact();
                        Thread.Sleep(2000);
                        Lua.DoString("GossipTitleButton1:Click()");
                        Thread.Sleep(2000);
                        QuestBot.QuestHelper.QuestFrame.CompleteQuest();
                        handindone = true;
                        return;
                    }
                }
            }
            #endregion
            #region ES
            if (SSQuestIDList.Contains(11525) && InvChkByID(34368) && !IsQuestCompleted(11525) && (!Me.CanLoot || !Me.Looting))
            {
                ObjectManager.Update();
                if (Me.Dead || Me.Combat || Me.IsGhost || Me.CanLoot || Me.Looting || Me.IsResting)
                {
                    return;
                }
                if (!IsQuestCompleted(11525))
                {
                    if (Me.Dead || Me.Combat || Me.IsGhost || Me.CanLoot || Me.Looting || Me.IsResting)
                    {
                        return;
                    }
                    WoWUnit ClosestUnit = GetClosestUnitByID(24972);
                    if (ClosestUnit == null)
                    {
                        return;
                    }
                    if (ClosestUnit.KilledByMe)
                    {
                        while (ClosestUnit.Distance > 5)
                        {
                            if (Me.Dead || Me.Combat || Me.IsGhost || Me.CanLoot || Me.Looting || Me.IsResting)
                            {
                                Navigator.Clear(); WoWMovement.MoveStop();
                                return;
                            }
                            Navigator.MoveTo(ClosestUnit.Location);
                        }
                        TargetByGUID(ClosestUnit.Guid);
                        Navigator.Clear(); WoWMovement.MoveStop();
                        useItemByID(34368);
                        Thread.Sleep(3000);
                        return;
                    }
                    if (ClosestUnit.Entry == 24972 && !ClosestUnit.TaggedByOther && !ClosestUnit.TaggedByMe && !ClosestUnit.Dead && !IsQuestCompleted(11525))
                    {
                        Logging.Write("found 1 alive");
                        if (ClosestUnit.Distance < 30)
                        {
                            ClosestUnit.Target();
                            Me.ToggleAttack();
                            while (!Me.Combat && ClosestUnit.Distance < 50)
                            {
                                if (Me.Dead || Me.Combat || Me.IsGhost || Me.CanLoot || Me.Looting || Me.IsResting)
                                {
                                    Navigator.Clear(); WoWMovement.MoveStop();
                                    return;
                                }
                                Navigator.MoveTo(ClosestUnit.Location);
                                Me.ToggleAttack();
                            }
                        }
                        return;
                    }
                }
            }
            #endregion
            while (arms1 && !IsQuestCompleted(11523) && IsQuestCompleted(11525))
            {
                if (Me.Dead || Me.Combat || Me.IsGhost || Me.CanLoot || Me.Looting || Me.IsResting)
                {
                    return;
                }
                WoWPoint armsgoto = new WoWPoint(12913.55, -6932.246, 3.872839);
                while (armsgoto.Distance(Me.Location) > 0)
                {
                    if (Me.Dead || Me.Combat || Me.IsGhost || Me.CanLoot || Me.Looting || Me.IsResting)
                    {
                        return;
                    }
                    Navigator.MoveTo(armsgoto);
                    if (armsgoto.Distance(Me.Location) < 5)
                    {
                        useItemByID(34338);
                        Thread.Sleep(5000);
                        return;
                    }
                }
                return;
            }
            #region Know your ley lines
            if (InvChkByID(34533))
            {
                WoWObject ley1 = GetClosestObjectByID(25156);
                WoWObject ley2 = GetClosestObjectByID(25157);
                WoWObject ley3 = GetClosestObjectByID(25154);
                if (ley1 != null && !ley1done && ley1.Distance2D < 5)
                {
                    Logging.WriteDebug("ley 1");
                    Thread.Sleep(2000);
                    Navigator.Clear(); WoWMovement.MoveStop();
                    useItemByID(34533);
                    Thread.Sleep(6000);
                    ley1done = true;

//<Hotspot X="12575.54" Y="-6915.316" Z="4.602137" />
                }
                if (ley2 != null && !ley2done && ley2.Distance2D < 5)
                {
                    Logging.WriteDebug("ley 2");
                    Thread.Sleep(2000);
                    Navigator.Clear(); WoWMovement.MoveStop();
                    useItemByID(34533);
                    Thread.Sleep(6000);
                    ley2done = true;
                }
                //<Hotspot X="12771.83" Y="-6705.073" Z="2.288224" />
                if (ley3 != null && !ley3done && ley3.Distance2D < 5)
                {
                    Logging.WriteDebug("ley 2");
                    Thread.Sleep(2000);
                    Navigator.Clear(); WoWMovement.MoveStop();
                    useItemByID(34533);
                    Thread.Sleep(6000);
                    ley3done = true;
                }
            }
            #endregion
        }
Ejemplo n.º 11
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.Location.DistanceSqr(Me.Location) > Range * Range,
                                                       new Sequence(
                                                           new Action(ret => { TreeRoot.StatusText = "Moving to interact with - " + CurrentObject.Name; }),
                                                           new Action(ret => Navigator.MoveTo(CurrentObject.Location))
                                                           )
                                                       ),

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

                                                           new Action(ret =>
            {
                TreeRoot.StatusText = "Interacting with - " + CurrentObject.Name;
                CurrentObject.Interact();
                _npcBlacklist.Add(CurrentObject.Guid);

                Thread.Sleep(2000);
                Counter++;
            }),

                                                           new DecoratorContinue(
                                                               ret => GossipOptions.Length > 0,
                                                               new Action(ret =>
            {
                foreach (var gos in GossipOptions)
                {
                    GossipFrame.Instance.SelectGossipOption(gos);
                    Thread.Sleep(1000);
                }
            })),

                                                           new DecoratorContinue(
                                                               ret => Loot && LootFrame.Instance.IsVisible,
                                                               new Action(ret => LootFrame.Instance.LootAll())),

                                                           new DecoratorContinue(
                                                               ret => BuyItemId != 0 && MerchantFrame.Instance.IsVisible,
                                                               new Action(ret =>
            {
                var items = MerchantFrame.Instance.GetAllMerchantItems();
                var item = items.FirstOrDefault(i => i.ItemId == BuyItemId && (i.BuyPrice * (ulong)BuyItemCount) <= Me.Copper && (i.NumAvailable >= BuyItemCount || i.NumAvailable == -1));

                if (item != null)
                {
                    MerchantFrame.Instance.BuyItem(item.Index, BuyItemCount);
                    Thread.Sleep(1500);
                }
            })),

                                                           new DecoratorContinue(
                                                               ret => BuySlot != -1 && BuyItemId == 0 && MerchantFrame.Instance.IsVisible,
                                                               new Action(ret =>
            {
                var item = MerchantFrame.Instance.GetMerchantItemByIndex(BuySlot);
                if (item != null && (item.BuyPrice * (ulong)BuyItemCount) <= Me.Copper && (item.NumAvailable >= BuyItemCount || item.NumAvailable == -1))
                {
                    MerchantFrame.Instance.BuyItem(BuySlot, BuyItemCount);
                    Thread.Sleep(1500);
                }
            })),
                                                           new DecoratorContinue(
                                                               ret => Me.CurrentTarget != null && Me.CurrentTarget == CurrentObject,
                                                               new Action(ret => Me.ClearTarget())),

                                                           new Action(ret => Thread.Sleep(WaitTime))

                                                           )),

                                         new Decorator(
                                             ret => Location.DistanceSqr(Me.Location) > 2 * 2,
                                             new Sequence(
                                                 new Action(ret => { TreeRoot.StatusText = "Moving towards - " + Location; }),
                                                 new Action(ret => Navigator.MoveTo(Location)))),

                                         new Decorator(
                                             ret => !WaitForNpcs && CurrentObject == null,
                                             new Action(ret => _isBehaviorDone = true)),

                                         new Action(ret => TreeRoot.StatusText = "Waiting for object to spawn")

                                         ))));
        }
Ejemplo n.º 12
0
 public override void Pulse()
 {
     #region Goblin Death
     if (Me.Race == WoWRace.Goblin && Me.HasAura("Near Death!") && Me.ZoneId == 4720 && RessGoblin.Count > 0)
     {
         RessGoblin[0].Interact();
         Thread.Sleep(1000);
         Lua.DoString("RunMacroText('/click QuestFrameCompleteQuestButton')");
     }
     #endregion
     #region Quest 6544
     if (Me.QuestLog.GetQuestById(6544) != null && !Me.QuestLog.GetQuestById(6544).IsCompleted&& Me.QuestLog.GetQuestById(6544).IsFailed)
     {
         Me.QuestLog.AbandonQuestById(6544);
     }
     #endregion
     #region Quest 6641
     if (Me.QuestLog.GetQuestById(6641) != null && !Me.QuestLog.GetQuestById(6641).IsCompleted)
     {
         if (Me.CurrentTarget == null)
         {
             return;
         }
         if (Me.CurrentTarget != null && Me.CurrentTarget.CurrentTargetGuid != Me.Guid)
         {
             RoutineManager.Current.Pull();
         }
     }
     #endregion
     #region Quest 13980
     if (Me.QuestLog.GetQuestById(13980) != null && !Me.QuestLog.GetQuestById(13980).IsCompleted&& (Me.MinimapZoneText == "The Skunkworks" || Me.MinimapZoneText == "Talondeep Vale") && !Me.HasAura("Jinx's Elf Detection Ray"))
     {
         Lua.DoString("UseItemByName(46776)");
         Thread.Sleep(500);
     }
     #endregion
     #region Quest 14236
     if (!Me.Dead && Me.QuestLog.GetQuestById(14236) != null && !Me.QuestLog.GetQuestById(14236).IsCompleted)
     {
         WoWPoint q142361 = new WoWPoint(638.7761, 2780.211, 88.81393);
         WoWPoint q142362 = new WoWPoint(634.825, 2824.758, 87.50606);
         WoWPoint q142363 = new WoWPoint(684.2277, 2821.671, 86.48402);
         WoWPoint q142364 = new WoWPoint(646.324, 2859.586, 87.25509);
         WoWPoint q142365 = new WoWPoint(700.0909, 2848.549, 84.93351);
         WoWPoint q142366 = new WoWPoint(610.5126, 2908.886, 91.3634);
         WoWPoint q142367 = new WoWPoint(574.0838, 2886.616, 90.26514);
         WoWPoint q142368 = new WoWPoint(582.1985, 2797.607, 88.356);
         WoWPoint q142369 = new WoWPoint(602.7809, 2784.686, 88.45428);
         while (!Me.HasAura("Weed Whacker"))
         {
             Lua.DoString("UseItemByName(49108)");
             Thread.Sleep(1000);
         }
         while (!Me.QuestLog.GetQuestById(14236).IsCompleted)
         {
             WoWMovement.ClickToMove(q142361);
             Thread.Sleep(20000);
             WoWMovement.ClickToMove(q142362);
             Thread.Sleep(20000);
             WoWMovement.ClickToMove(q142363);
             Thread.Sleep(20000);
             WoWMovement.ClickToMove(q142364);
             Thread.Sleep(20000);
             WoWMovement.ClickToMove(q142365);
             Thread.Sleep(20000);
             WoWMovement.ClickToMove(q142366);
             Thread.Sleep(20000);
             WoWMovement.ClickToMove(q142367);
             Thread.Sleep(20000);
             WoWMovement.ClickToMove(q142368);
             Thread.Sleep(20000);
             WoWMovement.ClickToMove(q142369);
             Thread.Sleep(20000);
         }
     }
     #endregion
     #region Quest 24958
     if (Me.QuestLog.GetQuestById(24958) != null && !Me.QuestLog.GetQuestById(24958).IsCompleted&& !Me.Dead)
     {
         WoWPoint wowpoint = new WoWPoint(1305.009, 1183.095, 121.1527);
         while (Me.Location.Distance(wowpoint) > 5)
         {
             Navigator.MoveTo(wowpoint);
             Thread.Sleep(500);
         }
         if (q24958_Giant_Turtle.Count != 0)
         {
             q24958_Giant_Turtle[0].Target();
             q24958_Giant_Turtle[0].Face();
         }
         while (Me.QuestLog.GetQuestById(24958) != null && !Me.QuestLog.GetQuestById(24958).IsCompleted&& Me.CurrentTarget != null && Me.CurrentTarget.IsAlive)
         {
             WoWMovement.MoveStop();
             Thread.Sleep(100);
             Lua.DoString("UseItemByName(52043)");
             Thread.Sleep(100);
         }
     }
     #endregion
     #region Quest 13961
     if (Me.QuestLog.GetQuestById(13961) != null && !Me.QuestLog.GetQuestById(13961).IsCompleted)
     {
         if (Me.CurrentTargetGuid != 0 && Me.CurrentTarget.Name == "Razormane Pillager" && !Me.HasAura("Dragging a Razormane"))
         {
             while (!Me.CurrentTarget.IsFriendly)
             {
                 Lua.DoString("UseItemByName(46722)");
                 Thread.Sleep(500);
             }
             if (Me.CurrentTarget.IsFriendly)
             {
                 while (Me.CurrentTarget.Distance > 5)
                 {
                     Navigator.MoveTo(Me.CurrentTarget.Location);
                     Thread.Sleep(100);
                 }
                 Me.CurrentTarget.Interact();
                 Thread.Sleep(500);
                 Lua.DoString("SelectGossipOption(1)");
                 Thread.Sleep(500);
             }
         }
     }
     #endregion
     #region Quest 25165
     if (Me.QuestLog.GetQuestById(25165) != null && !Me.QuestLog.GetQuestById(25165).IsCompleted&& !Me.HasAura("Poison Extraction Totem"))
     {
         bool IsOnCD = Lua.GetReturnVal <bool>("GetItemCooldown(52505)", 0);
         if (!IsOnCD)
         {
             Lua.DoString("UseItemByName(52505)");
         }
     }
     #endregion
     #region Quest 26321
     if (Me.QuestLog.GetQuestById(26321) != null && !Me.QuestLog.GetQuestById(26321).IsCompleted)
     {
         bool IsOnCD = Lua.GetReturnVal <bool>("GetItemCooldown(58165)", 0);
         if (!IsOnCD && !Me.HasAura("A Lashtail Hatchling: Hatchling Guardian Aura"))
         {
             Lua.DoString("UseItemByName(58165)");
         }
     }
     #endregion
     #region Quest 26325
     if (Me.QuestLog.GetQuestById(26325) != null && !Me.QuestLog.GetQuestById(26325).IsCompleted)
     {
         bool IsOnCD = Lua.GetReturnVal <bool>("GetItemCooldown(58165)", 0);
         if (!IsOnCD && !Me.HasAura("A Lashtail Hatchling: Hatchling Guardian Aura"))
         {
             Lua.DoString("UseItemByName(58165)");
         }
     }
     #endregion
     #region Quest 26953
     if (Me.QuestLog.GetQuestById(26953) != null && !Me.QuestLog.GetQuestById(26953).IsCompleted&& !Me.HasAura("Zen'Kiki Guardian Aura"))
     {
         if (AdrineTowhide.Count > 0 && AdrineTowhide[0].Distance < 5)
         {
             AdrineTowhide[0].Interact();
             Thread.Sleep(1000);
             Lua.DoString("SelectGossipOption(1)");
         }
         else if (AdrineTowhide.Count > 0 && AdrineTowhide[0].Distance > 5)
         {
             while (AdrineTowhide[0].Distance > 5)
             {
                 Navigator.MoveTo(AdrineTowhide[0].Location);
                 Thread.Sleep(100);
             }
         }
         else if (AdrineTowhide.Count < 1)
         {
             WoWPoint TowHide = new WoWPoint(1796.26, -1684.78, 60.1698);
             while (Me.Location.Distance(TowHide) > 5)
             {
                 Navigator.MoveTo(TowHide);
                 Thread.Sleep(100);
             }
         }
     }
     #endregion
     #region Quest 26925
     if (Me.QuestLog.GetQuestById(26925) != null && !Me.QuestLog.GetQuestById(26925).IsCompleted&& (StickboneBerserker.Count >= 1))
     {
         bool IsOnCD = Lua.GetReturnVal <bool>("GetItemCooldown(60678)", 0);
         if (!IsOnCD)
         {
             Lua.DoString("UseItemByName(60678)");
             LegacySpellManager.ClickRemoteLocation(StickboneBerserker[0].Location);
         }
     }
     #endregion
     #region Quest 26648
     if (Me.QuestLog.GetQuestById(26648) != null && !Me.QuestLog.GetQuestById(26648).IsCompleted)
     {
         bool IsOnCD = Lua.GetReturnVal <bool>("GetItemCooldown(59226)", 0);
         if (!IsOnCD && !Me.HasAura("Dead Eye's Intuition"))
         {
             Lua.DoString("UseItemByName(59226)");
         }
     }
     #endregion
     #region Quest 14238
     if (Me.QuestLog.GetQuestById(14238) != null && !Me.QuestLog.GetQuestById(14238).IsCompleted&& !Me.HasAura("Infrared Heat Focals"))
     {
         bool IsOnCD = Lua.GetReturnVal <bool>("GetItemCooldown(49611)", 0);
         if (!IsOnCD)
         {
             Lua.DoString("UseItemByName(49611)");
         }
     }
     #endregion
     #region Quest 27789
     if (Me.QuestLog.GetQuestById(27789) != null && !Me.QuestLog.GetQuestById(27789).IsCompleted)
     {
         while (Me.QuestLog.GetQuestById(27789) != null && !Me.QuestLog.GetQuestById(27789).IsCompleted)
         {
             StonevaultRuffian[0].Target();
             WoWMovement.ConstantFace(Me.CurrentTarget.Guid);
             Lua.DoString("CastPetAction(1)");
             StonevaultGoon[0].Target();
             WoWMovement.ConstantFace(Me.CurrentTarget.Guid);
             Lua.DoString("CastPetAction(1)");
             Lua.DoString("CastPetAction(2)");
         }
     }
     #endregion
     #region Quest 27771
     if (Me.QuestLog.GetQuestById(27771) != null && !Me.QuestLog.GetQuestById(27771).IsCompleted)
     {
         while (Me.QuestLog.GetQuestById(27771) != null && !Me.QuestLog.GetQuestById(27771).IsCompleted)
         {
             Lua.DoString("RunMacroText('/cleartarget')");
             FuckingWait.Start();
             if (FuckingWait.Elapsed.Seconds > 12)
             {
                 return;
             }
         }
     }
     #endregion
     #region Quest 27885
     if (!Me.Dead && Me.QuestLog.GetQuestById(27885) != null && !Me.QuestLog.GetQuestById(27885).IsCompleted)
     {
         WoWPoint q278850 = new WoWPoint(-6970.479, -3439.854, 200.8959);
         WoWPoint q278851 = new WoWPoint(-6968.06, -3440.255, 200.8969);
         WoWPoint q278852 = new WoWPoint(-6964.444, -3440.112, 200.8969);
         WoWPoint q278853 = new WoWPoint(-6961.984, -3439.921, 200.8963);
         WoWPoint q278854 = new WoWPoint(-6959.851, -3445.163, 201.2538);
         WoWPoint q278855 = new WoWPoint(-6959.738, -3447.433, 201.6079);
         WoWPoint q278856 = new WoWPoint(-6964.568, -3450.362, 200.8965);
         WoWPoint q278857 = new WoWPoint(-6966.959, -3450.602, 200.8965);
         WoWPoint q278858 = new WoWPoint(-6969.584, -3445.054, 200.8965);
         WoWPoint q278859 = new WoWPoint(-6969.789, -3442.688, 200.8965);
         WoWPoint q278811 = new WoWPoint(-6964.177, -3440.75, 200.8958);
         WoWPoint q278812 = new WoWPoint(-6961.631, -3440.965, 200.8958);
         WoWPoint q278813 = new WoWPoint(-6960.158, -3445.682, 200.8958);
         WoWPoint q278814 = new WoWPoint(-6960.385, -3447.647, 200.8958);
         WoWPoint q278815 = new WoWPoint(-6964.737, -3449.662, 200.8958);
         WoWPoint q278816 = new WoWPoint(-6967, -3449.534, 200.8955);
         WoWPoint q278817 = new WoWPoint(-6968.355, -3445.081, 200.8955);
         WoWPoint q278818 = new WoWPoint(-6968.267, -3442.952, 200.8955);
         WoWPoint q278821 = new WoWPoint(-6964.177, -3440.75, 200.8958);
         WoWPoint q278822 = new WoWPoint(-6961.631, -3440.965, 200.8958);
         WoWPoint q278823 = new WoWPoint(-6960.158, -3445.682, 200.8958);
         WoWPoint q278824 = new WoWPoint(-6960.385, -3447.647, 200.8958);
         WoWPoint q278825 = new WoWPoint(-6964.737, -3449.662, 200.8958);
         WoWPoint q278826 = new WoWPoint(-6967, -3449.534, 200.8955);
         WoWPoint q278827 = new WoWPoint(-6968.355, -3445.081, 200.8955);
         WoWPoint q278828 = new WoWPoint(-6968.267, -3442.952, 200.8955);
         WoWPoint q278841 = new WoWPoint(-6964.177, -3440.75, 200.8958);
         WoWPoint q278842 = new WoWPoint(-6961.631, -3440.965, 200.8958);
         WoWPoint q278843 = new WoWPoint(-6960.158, -3445.682, 200.8958);
         WoWPoint q278844 = new WoWPoint(-6961.002, -3447.482, 200.8966);
         WoWPoint q278845 = new WoWPoint(-6964.568, -3445.147, 200.8966);
         while (!Me.QuestLog.GetQuestById(27885).IsCompleted)
         {
             WoWMovement.ClickToMove(q278850);
             Thread.Sleep(3000);
             WoWMovement.ClickToMove(q278851);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278852);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278853);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278854);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278855);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278856);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278857);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278858);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278859);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278811);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278812);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278813);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278814);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278815);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278816);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278817);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278818);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278821);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278822);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278823);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278824);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278825);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278826);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278827);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278828);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278841);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278842);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278843);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278844);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
             WoWMovement.ClickToMove(q278845);
             Thread.Sleep(1000);
             WardensPawn[0].Target();
             WardensPawn[0].Interact();
             Thread.Sleep(1000);
         }
     }
     #endregion
     #region Quest 27893
     if (Me.QuestLog.GetQuestById(27893) != null && !Me.QuestLog.GetQuestById(27893).IsCompleted)
     {
         WoWPoint q278931 = new WoWPoint(-6730.564, -2448.625, 272.7784);
         WoWPoint q278932 = new WoWPoint(-6805.746, -2435.204, 272.7776);
         while (!Me.QuestLog.GetQuestById(27893).IsCompleted)
         {
             WoWMovement.ClickToMove(q278931);
             Thread.Sleep(10000);
             WoWMovement.ClickToMove(q278932);
             Thread.Sleep(13000);
             Lua.DoString("RunMacroText('/target Darkflight Flameblade')");
             Lua.DoString("CastPetAction(1)");
             Lua.DoString("RunMacroText('/target Darkflight Flameblade')");
             Lua.DoString("CastPetAction(4)");
             Lua.DoString("RunMacroText('/target Darkflight Flameblade')");
             Lua.DoString("CastPetAction(8)");
             Lua.DoString("RunMacroText('/target Darkflight Flameblade')");
             Lua.DoString("CastPetAction(2)");
             Thread.Sleep(5000);
             Lua.DoString("RunMacroText('/target Darkflight Flameblade')");
             Lua.DoString("CastPetAction(5)");
             Lua.DoString("RunMacroText('/target Darkflight Flameblade')");
             Lua.DoString("CastPetAction(7)");
             Thread.Sleep(5000);
             Lua.DoString("RunMacroText('/target Darkflight Flameblade')");
             Lua.DoString("CastPetAction(1)");
             Thread.Sleep(5000);
             Lua.DoString("RunMacroText('/target Darkflight Flameblade')");
             Lua.DoString("CastPetAction(1)");
         }
     }
     #endregion
     #region Quest 27894
     if (Me.QuestLog.GetQuestById(27894) != null && !Me.QuestLog.GetQuestById(27894).IsCompleted)
     {
         while (!Me.QuestLog.GetQuestById(27894).IsCompleted&& (Kalaran.Count >= 1))
         {
             Lua.DoString("CastPetAction(1)");
             Lua.DoString("CastPetAction(4)");
             Lua.DoString("CastPetAction(8)");
             Lua.DoString("CastPetAction(2)");
             Lua.DoString("CastPetAction(5)");
             Lua.DoString("CastPetAction(7)");
             FuckingWait.Start();
             if (FuckingWait.Elapsed.Seconds > 12)
             {
                 return;
             }
         }
     }
     #endregion
     #region Quest 27895
     if (Me.QuestLog.GetQuestById(27895) != null && !Me.QuestLog.GetQuestById(27895).IsCompleted)
     {
         while (!Me.QuestLog.GetQuestById(27895).IsCompleted&& (Moldarr.Count >= 1))
         {
             Lua.DoString("CastPetAction(1)");
             Lua.DoString("CastPetAction(4)");
             Lua.DoString("CastPetAction(8)");
             Lua.DoString("CastPetAction(2)");
             Lua.DoString("CastPetAction(5)");
             Lua.DoString("CastPetAction(7)");
             Lua.DoString("AttackTarget()");
             FuckingWait.Start();
             if (FuckingWait.Elapsed.Seconds > 12)
             {
                 return;
             }
         }
     }
     #endregion
     #region Quest 27895
     if (Me.QuestLog.GetQuestById(27895) != null && !Me.QuestLog.GetQuestById(27895).IsCompleted)
     {
         while (!Me.QuestLog.GetQuestById(27895).IsCompleted&& (Jirakka.Count >= 1))
         {
             Lua.DoString("CastPetAction(1)");
             Lua.DoString("CastPetAction(4)");
             Lua.DoString("CastPetAction(8)");
             Lua.DoString("CastPetAction(2)");
             Lua.DoString("CastPetAction(5)");
             Lua.DoString("CastPetAction(7)");
             Lua.DoString("AttackTarget()");
             FuckingWait.Start();
             if (FuckingWait.Elapsed.Seconds > 12)
             {
                 return;
             }
         }
     }
     #endregion
     #region Quest 27896
     if (Me.QuestLog.GetQuestById(27896) != null && !Me.QuestLog.GetQuestById(27896).IsCompleted)
     {
         while (!Me.QuestLog.GetQuestById(27896).IsCompleted&& (Nyxondra.Count >= 1))
         {
             Lua.DoString("RunMacroText('/target Nyxondra')");
             Lua.DoString("CastPetAction(1)");
             Lua.DoString("CastPetAction(4)");
             Lua.DoString("CastPetAction(8)");
             Lua.DoString("CastPetAction(2)");
             Lua.DoString("CastPetAction(5)");
             Lua.DoString("CastPetAction(7)");
             FuckingWait.Start();
             if (FuckingWait.Elapsed.Seconds > 12)
             {
                 return;
             }
         }
     }
     #endregion
     #region Quest 27964
     if (Me.QuestLog.GetQuestById(27964) != null && !Me.QuestLog.GetQuestById(27964).IsCompleted&& !IsAttached27964)
     {
         Lua.Events.AttachEvent("CHAT_MSG_MONSTER_YELL", MY_27964);
         IsAttached27964 = true;
     }
     if (Me.QuestLog.GetQuestById(27964) != null && Me.QuestLog.GetQuestById(27964).IsCompleted&& IsAttached27964)
     {
         Lua.Events.DetachEvent("CHAT_MSG_MONSTER_YELL", MY_27964);
         IsAttached27964 = false;
     }
     if (Me.QuestLog.GetQuestById(27964) != null && !Me.QuestLog.GetQuestById(27964).IsCompleted)
     {
         WoWObject wo = null;
         try
         {
             wo = ObjectManager.GetObjectsOfType <WoWObject>().Where(u => u.Entry == 206573 && !Me.Combat && !Me.Dead).FirstOrDefault();
         }
         catch { }
         if (wo != null)
         {
             while (!Me.QuestLog.GetQuestById(27964).IsCompleted)
             {
                 while (wo.Distance > 5)
                 {
                     Navigator.MoveTo(wo.Location);
                     Thread.Sleep(100);
                 }
                 if (wo.Distance < 5)
                 {
                     wo.Interact();
                     Thread.Sleep(500);
                 }
             }
         }
     }
     #endregion
     #region Quest 28226
     if (Me.QuestLog.GetQuestById(28226) != null && !Me.QuestLog.GetQuestById(28226).IsCompleted)
     {
         if (GossipFrame.Instance.IsVisible)
         {
             if (!Obj4Done28226 && GossipFrame.Instance.GossipOptionEntries.Count > 1)
             {
                 Lua.DoString("SelectGossipOption(2)");
                 Thread.Sleep(1000);
             }
             else
             {
                 Lua.DoString("SelectGossipOption(1)");
                 Thread.Sleep(1000);
             }
         }
     }
     #endregion
     #region Quest 26922
     if (Me.QuestLog.GetQuestById(26922) != null)
     {
         if (StickboneBerserker.Count > 0)
         {
             StickboneBerserker[0].Target();
             Thread.Sleep(500);
             Lua.DoString("UseItemByName(60678)");
             Thread.Sleep(500);
             LegacySpellManager.ClickRemoteLocation(StickboneBerserker[0].Location);
             Thread.Sleep(1000);
         }
         if (ScourgeBoneAnimus.Count > 0)
         {
             Lua.DoString("UseItemByName(60678)");
             Thread.Sleep(500);
             LegacySpellManager.ClickRemoteLocation(ScourgeBoneAnimus[0].Location);
             Thread.Sleep(1000);
         }
     }
     #endregion
     #region Quest 10129
     if (Me.QuestLog.GetQuestById(10129) != null && !Me.QuestLog.GetQuestById(10129).IsCompleted)
     {
         bool IsOnCD = Lua.GetReturnVal <bool>("GetItemCooldown(28038)", 0);
         if (!IsOnCD)
         {
             Lua.DoString("UseItemByName(28038)");
             LegacySpellManager.ClickRemoteLocation(GatewayShaadraz[0].Location);
             Lua.DoString("UseItemByName(28038)");
             LegacySpellManager.ClickRemoteLocation(GatewayMurketh[0].Location);
         }
     }
     #endregion
     #region Quest 10162
     if (Me.QuestLog.GetQuestById(10162) != null && !Me.QuestLog.GetQuestById(10162).IsCompleted)
     {
         bool IsOnCD = Lua.GetReturnVal <bool>("GetItemCooldown(28132)", 0);
         if (!IsOnCD)
         {
             if (!Obj1Done10162)
             {
                 Lua.DoString("UseItemByName(28132)");
                 LegacySpellManager.ClickRemoteLocation(MoargOverseer[0].Location);
             }
             if (Obj1Done10162)
             {
                 Lua.DoString("UseItemByName(28132)");
                 LegacySpellManager.ClickRemoteLocation(GanArgPeon[0].Location);
             }
             if (Obj2Done10162)
             {
                 Lua.DoString("UseItemByName(28132)");
                 LegacySpellManager.ClickRemoteLocation(FelCannon[0].Location);
             }
         }
         #endregion
         #region Quest 26305
         if (Me.QuestLog.GetQuestById(26305) != null && !Me.QuestLog.GetQuestById(26305).IsCompleted)
         {
             if (Me.CurrentTarget.Entry == 2530)
             {
                 Lua.DoString("UseItemByName(3912)");
             }
         }
         #endregion
         #region Disguise Quests
         if (Me.QuestLog.GetQuestById(28439) != null || Me.QuestLog.GetQuestById(28440) != null || Me.QuestLog.GetQuestById(28432) != null || Me.QuestLog.GetQuestById(28433) != null || Me.QuestLog.GetQuestById(28434) != null || Me.QuestLog.GetQuestById(28435) != null)
         {
             int counter = 0;
             foreach (WoWAura s in ObjectManager.Me.ActiveAuras.Values)
             {
                 if (s.Name.Contains("Disguise"))
                 {
                     counter++;
                 }
             }
             if (counter > 0)
             {
                 Lua.DoString("UseItemByName(63357)");
                 Thread.Sleep(6000);
             }
         }
         #endregion
         #region Quest 27001
         if (Me.QuestLog.GetQuestById(27001) != null && !Me.QuestLog.GetQuestById(27001).IsCompleted&& SpiderThingy.Count > 0)
         {
             WoWPoint wp = new WoWPoint(2432.375, -1650.377, 104.1796);
             while (Me.Location.Distance(wp) > 3)
             {
                 Navigator.MoveTo(wp);
                 Thread.Sleep(100);
             }
         }
         #endregion
         #region Quest 10813
         if (Me.QuestLog.GetQuestById(10813) != null && !Me.QuestLog.GetQuestById(10813).IsCompleted&& EyeOfGrillok.Count > 0)
         {
             if (!Me.HasAura("Eye of Grillok"))
             {
                 EyeOfGrillok[0].Target();
                 while (Me.Location.Distance(EyeOfGrillok[0].Location) > 10)
                 {
                     Navigator.MoveTo(EyeOfGrillok[0].Location);
                     Thread.Sleep(200);
                 }
                 Lua.DoString("UseItemByName(31463)");
                 Thread.Sleep(1000);
             }
         }
         if (Me.QuestLog.GetQuestById(10813) != null && !Me.QuestLog.GetQuestById(10813).IsCompleted&& Me.HasAura("Eye of Grillok"))
         {
             WoWPoint wp = new WoWPoint(-1325.649, 2356.759, 88.95618);
             if (!Me.Combat)
             {
                 while (Me.Location.Distance(wp) > 5)
                 {
                     Flightor.MoveTo(wp);
                     Thread.Sleep(200);
                 }
             }
         }
         #endregion
     }
 }