Exemplo n.º 1
0
        public void Execute()
        {
            if (Finished || WowInterface.ObjectManager.Player.IsCasting)
            {
                return;
            }

            WowUnit = WowInterface.ObjectManager.WowObjects
                      .OfType <WowUnit>()
                      .Where(e => e.IsGossip && !e.IsDead && DisplayIds.Contains(e.DisplayId))
                      .OrderBy(e => e.Position.GetDistance(WowInterface.ObjectManager.Player.Position))
                      .FirstOrDefault();

            if (WowUnit != null)
            {
                if (WowUnit.Position.GetDistance(WowInterface.ObjectManager.Player.Position) < 3.0)
                {
                    if (TalkEvent.Run())
                    {
                        WowInterface.HookManager.StopClickToMoveIfActive();
                        WowInterface.MovementEngine.Reset();

                        WowInterface.HookManager.UnitOnRightClick(WowUnit);

                        ++Counter;
                        if (Counter > GossipIds.Count)
                        {
                            Counter = 1;
                        }

                        WowInterface.HookManager.UnitSelectGossipOption(GossipIds[Counter - 1]);
                    }
                }
                else
                {
                    WowInterface.MovementEngine.SetMovementAction(MovementAction.Moving, WowUnit.Position);
                }
            }
        }
        public void Execute()
        {
            if (Finished || Bot.Player.IsCasting)
            {
                return;
            }

            IWowUnit = Bot.Objects.WowObjects
                       .OfType <IWowUnit>()
                       .Where(e => e.IsGossip && !e.IsDead && DisplayIds.Contains(e.DisplayId))
                       .OrderBy(e => e.Position.GetDistance(Bot.Player.Position))
                       .FirstOrDefault();

            if (IWowUnit != null)
            {
                if (IWowUnit.Position.GetDistance(Bot.Player.Position) < 3.0)
                {
                    if (TalkEvent.Run())
                    {
                        Bot.Wow.StopClickToMove();
                        Bot.Movement.Reset();

                        Bot.Wow.InteractWithUnit(IWowUnit.BaseAddress);

                        ++Counter;
                        if (Counter > GossipIds.Count)
                        {
                            Counter = 1;
                        }

                        Bot.Wow.SelectGossipOption(GossipIds[Counter - 1]);
                    }
                }
                else
                {
                    Bot.Movement.SetMovementAction(MovementAction.Move, IWowUnit.Position);
                }
            }
        }