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);
                }
            }
        }
Exemplo n.º 2
0
        public void Execute()
        {
            if (Finished || Bot.Player.IsCasting)
            {
                return;
            }

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

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

                        Bot.Wow.InteractWithUnit(Unit);

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

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