Exemple #1
0
        public void Execute()
        {
            if (Finished)
            {
                return;
            }

            IWowGameobject lootableObject = Bot.Objects.WowObjects.OfType <IWowGameobject>()
                                            .Where(e => GameObjectIds.Contains(e.EntryId))
                                            .OrderBy(e => e.Position.GetDistance(Bot.Player.Position))
                                            .FirstOrDefault();

            if (lootableObject != null)
            {
                if (lootableObject.Position.GetDistance(Bot.Player.Position) > 5.0)
                {
                    Bot.Movement.SetMovementAction(MovementAction.Move, lootableObject.Position);
                }
                else
                {
                    if (RightClickEvent.Run())
                    {
                        Bot.Movement.Reset();
                        Bot.Wow.StopClickToMove();
                        Bot.Wow.InteractWithObject(lootableObject.BaseAddress);
                    }
                }
            }
            else
            {
                AreaNode selectedArea = Area
                                        .OrderBy(e => e.Position.GetDistance(Bot.Player.Position))
                                        .FirstOrDefault(e => e.Position.GetDistance(Bot.Player.Position) < e.Radius);

                if (selectedArea != null)
                {
                    Bot.Movement.SetMovementAction(MovementAction.Move, selectedArea.Position);
                }
            }
        }
        public void Execute()
        {
            if (Finished)
            {
                return;
            }

            WowGameobject lootableObject = WowInterface.ObjectManager.WowObjects.OfType <WowGameobject>()
                                           .Where(e => GameObjectIds.Contains(e.EntryId))
                                           .OrderBy(e => e.Position.GetDistance(WowInterface.Player.Position))
                                           .FirstOrDefault();

            if (lootableObject != null)
            {
                if (lootableObject.Position.GetDistance(WowInterface.Player.Position) > 5.0)
                {
                    WowInterface.MovementEngine.SetMovementAction(MovementAction.Move, lootableObject.Position);
                }
                else
                {
                    if (RightClickEvent.Run())
                    {
                        WowInterface.MovementEngine.Reset();
                        WowInterface.HookManager.WowStopClickToMove();
                        WowInterface.HookManager.WowObjectRightClick(lootableObject);
                    }
                }
            }
            else
            {
                AreaNode selectedArea = Area
                                        .OrderBy(e => e.Position.GetDistance(WowInterface.Player.Position))
                                        .FirstOrDefault(e => e.Position.GetDistance(WowInterface.Player.Position) < e.Radius);

                if (selectedArea != null)
                {
                    WowInterface.MovementEngine.SetMovementAction(MovementAction.Move, selectedArea.Position);
                }
            }
        }